mirror of https://github.com/Mai-with-u/MaiBot.git
408 lines
2.1 MiB
408 lines
2.1 MiB
import{r as b,j as o,L as rv,u as na,R as oe,c as sv,b as ya,d as yJ,e as bJ,f as wJ,g as SJ,h as ps,k as kJ,l as OJ,O as Hz,m as jJ}from"./router-DQNkr8RI.js";import{a as NJ,b as CJ,g as yd}from"./react-vendor-Dtc2IqVY.js";import{c as Qz,R as TJ,T as EJ,L as _J,a as AJ,C as Kx,X as Zx,Y as Pm,b as MJ,B as S4,d as Jx,P as RJ,e as DJ,f as PJ,_ as zJ,g as IJ,h as Ge,i as LJ,j as k9,k as BJ,l as O9,m as FJ,n as qJ,o as $J,r as Vz,p as HJ,q as wj,s as Uz,t as bd,u as Sj,v as QJ,w as VJ,x as Wz,y as Gz,z as Xz,A as kj,D as Oj,E as jj,F as UJ,G as WJ,H as GJ,I as XJ,J as YJ,K as KJ,M as ZJ,N as Nj,O as $y,Q as JJ,S as eee,U as Cj,V as tee,W as nee,Z as Yz,$ as Kz,a0 as Zz,a1 as Jz,a2 as Hy,a3 as eI,a4 as tI,a5 as ree,a6 as see,a7 as iee,a8 as aee,a9 as oee,aa as lee,ab as cee,ac as uee,ad as nI,ae as rI,af as dee,ag as hee,ah as fee,ai as mee,aj as pee,ak as gee,al as xee,am as vee,an as yee,ao as bee,ap as wee,aq as See,ar as kee,as as Oee,at as jee,au as Nee}from"./charts-Cdq_Jxe7.js";import{c as Da,a as Qy,u as Gi,P as Sn,b as nt,d as er,e as Rp,f as Kl,g as Rs,h as oi,i as Wh,j as Tj,k as Vy,S as Cee,l as sI,m as iI,R as aI,O as Uy,n as Ej,C as Wy,o as Gy,T as _j,D as Aj,p as Mj,q as oI,r as lI,W as Tee,s as cI,I as Eee,t as uI,v as dI,w as _ee,x as hI,V as Aee,L as fI,y as mI,z as Mee,A as Ree,B as pI,E as Dee,F as Pee,G as Gc,H as Xy,J as vf,K as gI,M as xI,N as vI,Q as yI,U as Rj,X as Dj,Y as Yy,Z as Ky,_ as Pj,$ as bI,a0 as zee,a1 as wI,a2 as Iee,a3 as Lee,a4 as SI,a5 as Bee}from"./ui-vendor-BgfqR_Xz.js";import{R as Qs,P as Dp,C as Ya,a as Lo,Z as Zu,b as zj,F as Po,c as Fee,S as Vc,A as qee,D as $ee,d as sk,e as Mh,M as Gh,T as Hee,X as Pp,f as kI,g as Qee,I as Xi,h as Ga,i as zo,j as Iv,E as I0,k as Ji,l as OI,m as ik,n as ak,L as j9,K as jI,o as Zy,p as Vee,q as w0,r as Us,s as Uee,B as o0,U as Lv,t as Ij,u as Wee,v as Gee,w as ii,H as L0,x as Bv,y as Xc,z as B0,G as Xee,J as Yee,N as zp,O as Is,Q as Cn,V as Fv,W as Ju,Y as Ip,_ as wd,$ as Zl,a0 as Lp,a1 as Lj,a2 as Kee,a3 as Zee,a4 as Jee,a5 as ed,a6 as N9,a7 as ete,a8 as td,a9 as ok,aa as F0,ab as tte,ac as lk,ad as nte,ae as NI,af as C9,ag as rte,ah as ste,ai as ite,aj as Dc,ak as k4,al as T9,am as ate,an as ote,ao as lte,ap as cte,aq as ute,ar as CI,as as TI,at as EI,au as dte,av as hte,aw as E9,ax as fte,ay as mte,az as _9,aA as pte,aB as gte}from"./icons-CqUsKJFR.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();var O4={exports:{}},zm={},j4={exports:{}},N4={};var A9;function xte(){return A9||(A9=1,(function(t){function e(L,$){var K=L.length;L.push($);e:for(;0<K;){var Y=K-1>>>1,R=L[Y];if(0<s(R,$))L[Y]=$,L[K]=R,K=Y;else break e}}function n(L){return L.length===0?null:L[0]}function r(L){if(L.length===0)return null;var $=L[0],K=L.pop();if(K!==$){L[0]=K;e:for(var Y=0,R=L.length,ie=R>>>1;Y<ie;){var X=2*(Y+1)-1,z=L[X],U=X+1,te=L[U];if(0>s(z,K))U<R&&0>s(te,z)?(L[Y]=te,L[U]=K,Y=U):(L[Y]=z,L[X]=K,Y=X);else if(U<R&&0>s(te,K))L[Y]=te,L[U]=K,Y=U;else break e}}return $}function s(L,$){var K=L.sortIndex-$.sortIndex;return K!==0?K:L.id-$.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var a=Date,l=a.now();t.unstable_now=function(){return a.now()-l}}var c=[],d=[],h=1,m=null,g=3,x=!1,y=!1,w=!1,S=!1,k=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function T(L){for(var $=n(d);$!==null;){if($.callback===null)r(d);else if($.startTime<=L)r(d),$.sortIndex=$.expirationTime,e(c,$);else break;$=n(d)}}function E(L){if(w=!1,T(L),!y)if(n(c)!==null)y=!0,_||(_=!0,W());else{var $=n(d);$!==null&&V(E,$.startTime-L)}}var _=!1,A=-1,D=5,q=-1;function B(){return S?!0:!(t.unstable_now()-q<D)}function H(){if(S=!1,_){var L=t.unstable_now();q=L;var $=!0;try{e:{y=!1,w&&(w=!1,j(A),A=-1),x=!0;var K=g;try{t:{for(T(L),m=n(c);m!==null&&!(m.expirationTime>L&&B());){var Y=m.callback;if(typeof Y=="function"){m.callback=null,g=m.priorityLevel;var R=Y(m.expirationTime<=L);if(L=t.unstable_now(),typeof R=="function"){m.callback=R,T(L),$=!0;break t}m===n(c)&&r(c),T(L)}else r(c);m=n(c)}if(m!==null)$=!0;else{var ie=n(d);ie!==null&&V(E,ie.startTime-L),$=!1}}break e}finally{m=null,g=K,x=!1}$=void 0}}finally{$?W():_=!1}}}var W;if(typeof N=="function")W=function(){N(H)};else if(typeof MessageChannel<"u"){var ee=new MessageChannel,I=ee.port2;ee.port1.onmessage=H,W=function(){I.postMessage(null)}}else W=function(){k(H,0)};function V(L,$){A=k(function(){L(t.unstable_now())},$)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(L){L.callback=null},t.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<L?Math.floor(1e3/L):5},t.unstable_getCurrentPriorityLevel=function(){return g},t.unstable_next=function(L){switch(g){case 1:case 2:case 3:var $=3;break;default:$=g}var K=g;g=$;try{return L()}finally{g=K}},t.unstable_requestPaint=function(){S=!0},t.unstable_runWithPriority=function(L,$){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var K=g;g=L;try{return $()}finally{g=K}},t.unstable_scheduleCallback=function(L,$,K){var Y=t.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?Y+K:Y):K=Y,L){case 1:var R=-1;break;case 2:R=250;break;case 5:R=1073741823;break;case 4:R=1e4;break;default:R=5e3}return R=K+R,L={id:h++,callback:$,priorityLevel:L,startTime:K,expirationTime:R,sortIndex:-1},K>Y?(L.sortIndex=K,e(d,L),n(c)===null&&L===n(d)&&(w?(j(A),A=-1):w=!0,V(E,K-Y))):(L.sortIndex=R,e(c,L),y||x||(y=!0,_||(_=!0,W()))),L},t.unstable_shouldYield=B,t.unstable_wrapCallback=function(L){var $=g;return function(){var K=g;g=$;try{return L.apply(this,arguments)}finally{g=K}}}})(N4)),N4}var M9;function vte(){return M9||(M9=1,j4.exports=xte()),j4.exports}var R9;function yte(){if(R9)return zm;R9=1;var t=vte(),e=NJ(),n=CJ();function r(u){var f="https://react.dev/errors/"+u;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)f+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+u+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(u){return!(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11)}function i(u){var f=u,p=u;if(u.alternate)for(;f.return;)f=f.return;else{u=f;do f=u,(f.flags&4098)!==0&&(p=f.return),u=f.return;while(u)}return f.tag===3?p:null}function a(u){if(u.tag===13){var f=u.memoizedState;if(f===null&&(u=u.alternate,u!==null&&(f=u.memoizedState)),f!==null)return f.dehydrated}return null}function l(u){if(u.tag===31){var f=u.memoizedState;if(f===null&&(u=u.alternate,u!==null&&(f=u.memoizedState)),f!==null)return f.dehydrated}return null}function c(u){if(i(u)!==u)throw Error(r(188))}function d(u){var f=u.alternate;if(!f){if(f=i(u),f===null)throw Error(r(188));return f!==u?null:u}for(var p=u,v=f;;){var O=p.return;if(O===null)break;var C=O.alternate;if(C===null){if(v=O.return,v!==null){p=v;continue}break}if(O.child===C.child){for(C=O.child;C;){if(C===p)return c(O),u;if(C===v)return c(O),f;C=C.sibling}throw Error(r(188))}if(p.return!==v.return)p=O,v=C;else{for(var F=!1,Z=O.child;Z;){if(Z===p){F=!0,p=O,v=C;break}if(Z===v){F=!0,v=O,p=C;break}Z=Z.sibling}if(!F){for(Z=C.child;Z;){if(Z===p){F=!0,p=C,v=O;break}if(Z===v){F=!0,v=C,p=O;break}Z=Z.sibling}if(!F)throw Error(r(189))}}if(p.alternate!==v)throw Error(r(190))}if(p.tag!==3)throw Error(r(188));return p.stateNode.current===p?u:f}function h(u){var f=u.tag;if(f===5||f===26||f===27||f===6)return u;for(u=u.child;u!==null;){if(f=h(u),f!==null)return f;u=u.sibling}return null}var m=Object.assign,g=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),j=Symbol.for("react.consumer"),N=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),q=Symbol.for("react.activity"),B=Symbol.for("react.memo_cache_sentinel"),H=Symbol.iterator;function W(u){return u===null||typeof u!="object"?null:(u=H&&u[H]||u["@@iterator"],typeof u=="function"?u:null)}var ee=Symbol.for("react.client.reference");function I(u){if(u==null)return null;if(typeof u=="function")return u.$$typeof===ee?null:u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case w:return"Fragment";case k:return"Profiler";case S:return"StrictMode";case E:return"Suspense";case _:return"SuspenseList";case q:return"Activity"}if(typeof u=="object")switch(u.$$typeof){case y:return"Portal";case N:return u.displayName||"Context";case j:return(u._context.displayName||"Context")+".Consumer";case T:var f=u.render;return u=u.displayName,u||(u=f.displayName||f.name||"",u=u!==""?"ForwardRef("+u+")":"ForwardRef"),u;case A:return f=u.displayName||null,f!==null?f:I(u.type)||"Memo";case D:f=u._payload,u=u._init;try{return I(u(f))}catch{}}return null}var V=Array.isArray,L=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K={pending:!1,data:null,method:null,action:null},Y=[],R=-1;function ie(u){return{current:u}}function X(u){0>R||(u.current=Y[R],Y[R]=null,R--)}function z(u,f){R++,Y[R]=u.current,u.current=f}var U=ie(null),te=ie(null),ne=ie(null),G=ie(null);function se(u,f){switch(z(ne,f),z(te,u),z(U,null),f.nodeType){case 9:case 11:u=(u=f.documentElement)&&(u=u.namespaceURI)?UT(u):0;break;default:if(u=f.tagName,f=f.namespaceURI)f=UT(f),u=WT(f,u);else switch(u){case"svg":u=1;break;case"math":u=2;break;default:u=0}}X(U),z(U,u)}function re(){X(U),X(te),X(ne)}function ae(u){u.memoizedState!==null&&z(G,u);var f=U.current,p=WT(f,u.type);f!==p&&(z(te,u),z(U,p))}function _e(u){te.current===u&&(X(U),X(te)),G.current===u&&(X(G),Am._currentValue=K)}var Be,Ye;function Je(u){if(Be===void 0)try{throw Error()}catch(p){var f=p.stack.trim().match(/\n( *(at )?)/);Be=f&&f[1]||"",Ye=-1<p.stack.indexOf(`
|
||
at`)?" (<anonymous>)":-1<p.stack.indexOf("@")?"@unknown:0:0":""}return`
|
||
`+Be+u+Ye}var Oe=!1;function Ve(u,f){if(!u||Oe)return"";Oe=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var v={DetermineComponentFrameRoot:function(){try{if(f){var Re=function(){throw Error()};if(Object.defineProperty(Re.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Re,[])}catch(Ce){var ke=Ce}Reflect.construct(u,[],Re)}else{try{Re.call()}catch(Ce){ke=Ce}u.call(Re.prototype)}}else{try{throw Error()}catch(Ce){ke=Ce}(Re=u())&&typeof Re.catch=="function"&&Re.catch(function(){})}}catch(Ce){if(Ce&&ke&&typeof Ce.stack=="string")return[Ce.stack,ke.stack]}return[null,null]}};v.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var O=Object.getOwnPropertyDescriptor(v.DetermineComponentFrameRoot,"name");O&&O.configurable&&Object.defineProperty(v.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var C=v.DetermineComponentFrameRoot(),F=C[0],Z=C[1];if(F&&Z){var de=F.split(`
|
||
`),Se=Z.split(`
|
||
`);for(O=v=0;v<de.length&&!de[v].includes("DetermineComponentFrameRoot");)v++;for(;O<Se.length&&!Se[O].includes("DetermineComponentFrameRoot");)O++;if(v===de.length||O===Se.length)for(v=de.length-1,O=Se.length-1;1<=v&&0<=O&&de[v]!==Se[O];)O--;for(;1<=v&&0<=O;v--,O--)if(de[v]!==Se[O]){if(v!==1||O!==1)do if(v--,O--,0>O||de[v]!==Se[O]){var Te=`
|
||
`+de[v].replace(" at new "," at ");return u.displayName&&Te.includes("<anonymous>")&&(Te=Te.replace("<anonymous>",u.displayName)),Te}while(1<=v&&0<=O);break}}}finally{Oe=!1,Error.prepareStackTrace=p}return(p=u?u.displayName||u.name:"")?Je(p):""}function Ue(u,f){switch(u.tag){case 26:case 27:case 5:return Je(u.type);case 16:return Je("Lazy");case 13:return u.child!==f&&f!==null?Je("Suspense Fallback"):Je("Suspense");case 19:return Je("SuspenseList");case 0:case 15:return Ve(u.type,!1);case 11:return Ve(u.type.render,!1);case 1:return Ve(u.type,!0);case 31:return Je("Activity");default:return""}}function $e(u){try{var f="",p=null;do f+=Ue(u,p),p=u,u=u.return;while(u);return f}catch(v){return`
|
||
Error generating stack: `+v.message+`
|
||
`+v.stack}}var jt=Object.prototype.hasOwnProperty,vt=t.unstable_scheduleCallback,$n=t.unstable_cancelCallback,qt=t.unstable_shouldYield,un=t.unstable_requestPaint,Mt=t.unstable_now,ct=t.unstable_getCurrentPriorityLevel,Ne=t.unstable_ImmediatePriority,ze=t.unstable_UserBlockingPriority,rt=t.unstable_NormalPriority,bt=t.unstable_LowPriority,zt=t.unstable_IdlePriority,Rt=t.log,Hn=t.unstable_setDisableYieldValue,We=null,ot=null;function dn(u){if(typeof Rt=="function"&&Hn(u),ot&&typeof ot.setStrictMode=="function")try{ot.setStrictMode(We,u)}catch{}}var Pt=Math.clz32?Math.clz32:rn,xn=Math.log,dt=Math.LN2;function rn(u){return u>>>=0,u===0?32:31-(xn(u)/dt|0)|0}var wt=256,Wt=262144,Gt=4194304;function lt(u){var f=u&42;if(f!==0)return f;switch(u&-u){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 u&261888;case 262144:case 524288:case 1048576:case 2097152:return u&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return u&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return u}}function ve(u,f,p){var v=u.pendingLanes;if(v===0)return 0;var O=0,C=u.suspendedLanes,F=u.pingedLanes;u=u.warmLanes;var Z=v&134217727;return Z!==0?(v=Z&~C,v!==0?O=lt(v):(F&=Z,F!==0?O=lt(F):p||(p=Z&~u,p!==0&&(O=lt(p))))):(Z=v&~C,Z!==0?O=lt(Z):F!==0?O=lt(F):p||(p=v&~u,p!==0&&(O=lt(p)))),O===0?0:f!==0&&f!==O&&(f&C)===0&&(C=O&-O,p=f&-f,C>=p||C===32&&(p&4194048)!==0)?f:O}function He(u,f){return(u.pendingLanes&~(u.suspendedLanes&~u.pingedLanes)&f)===0}function ht(u,f){switch(u){case 1:case 2:case 4:case 8:case 64:return f+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 f+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 vn(){var u=Gt;return Gt<<=1,(Gt&62914560)===0&&(Gt=4194304),u}function Qn(u){for(var f=[],p=0;31>p;p++)f.push(u);return f}function fr(u,f){u.pendingLanes|=f,f!==268435456&&(u.suspendedLanes=0,u.pingedLanes=0,u.warmLanes=0)}function ar(u,f,p,v,O,C){var F=u.pendingLanes;u.pendingLanes=p,u.suspendedLanes=0,u.pingedLanes=0,u.warmLanes=0,u.expiredLanes&=p,u.entangledLanes&=p,u.errorRecoveryDisabledLanes&=p,u.shellSuspendCounter=0;var Z=u.entanglements,de=u.expirationTimes,Se=u.hiddenUpdates;for(p=F&~p;0<p;){var Te=31-Pt(p),Re=1<<Te;Z[Te]=0,de[Te]=-1;var ke=Se[Te];if(ke!==null)for(Se[Te]=null,Te=0;Te<ke.length;Te++){var Ce=ke[Te];Ce!==null&&(Ce.lane&=-536870913)}p&=~Re}v!==0&&xs(u,v,0),C!==0&&O===0&&u.tag!==0&&(u.suspendedLanes|=C&~(F&~f))}function xs(u,f,p){u.pendingLanes|=f,u.suspendedLanes&=~f;var v=31-Pt(f);u.entangledLanes|=f,u.entanglements[v]=u.entanglements[v]|1073741824|p&261930}function vs(u,f){var p=u.entangledLanes|=f;for(u=u.entanglements;p;){var v=31-Pt(p),O=1<<v;O&f|u[v]&f&&(u[v]|=f),p&=~O}}function js(u,f){var p=f&-f;return p=(p&42)!==0?1:ge(p),(p&(u.suspendedLanes|f))!==0?0:p}function ge(u){switch(u){case 2:u=1;break;case 8:u=4;break;case 32:u=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:u=128;break;case 268435456:u=134217728;break;default:u=0}return u}function Ie(u){return u&=-u,2<u?8<u?(u&134217727)!==0?32:268435456:8:2}function Et(){var u=$.p;return u!==0?u:(u=window.event,u===void 0?32:g9(u.type))}function kn(u,f){var p=$.p;try{return $.p=u,f()}finally{$.p=p}}var Hr=Math.random().toString(36).slice(2),Mr="__reactFiber$"+Hr,Rr="__reactProps$"+Hr,Ns="__reactContainer$"+Hr,Vf="__reactEvents$"+Hr,hw="__reactListeners$"+Hr,fw="__reactHandles$"+Hr,Dg="__reactResources$"+Hr,xu="__reactMarker$"+Hr;function Uf(u){delete u[Mr],delete u[Rr],delete u[Vf],delete u[hw],delete u[fw]}function rc(u){var f=u[Mr];if(f)return f;for(var p=u.parentNode;p;){if(f=p[Ns]||p[Mr]){if(p=f.alternate,f.child!==null||p!==null&&p.child!==null)for(u=e9(u);u!==null;){if(p=u[Mr])return p;u=e9(u)}return f}u=p,p=u.parentNode}return null}function Jo(u){if(u=u[Mr]||u[Ns]){var f=u.tag;if(f===5||f===6||f===13||f===31||f===26||f===27||f===3)return u}return null}function vu(u){var f=u.tag;if(f===5||f===26||f===27||f===6)return u.stateNode;throw Error(r(33))}function sc(u){var f=u[Dg];return f||(f=u[Dg]={hoistableStyles:new Map,hoistableScripts:new Map}),f}function Kr(u){u[xu]=!0}var Pg=new Set,zg={};function el(u,f){tl(u,f),tl(u+"Capture",f)}function tl(u,f){for(zg[u]=f,u=0;u<f.length;u++)Pg.add(f[u])}var mw=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]*$"),Ig={},Lg={};function Wf(u){return jt.call(Lg,u)?!0:jt.call(Ig,u)?!1:mw.test(u)?Lg[u]=!0:(Ig[u]=!0,!1)}function Bg(u,f,p){if(Wf(f))if(p===null)u.removeAttribute(f);else{switch(typeof p){case"undefined":case"function":case"symbol":u.removeAttribute(f);return;case"boolean":var v=f.toLowerCase().slice(0,5);if(v!=="data-"&&v!=="aria-"){u.removeAttribute(f);return}}u.setAttribute(f,""+p)}}function Fg(u,f,p){if(p===null)u.removeAttribute(f);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":u.removeAttribute(f);return}u.setAttribute(f,""+p)}}function nl(u,f,p,v){if(v===null)u.removeAttribute(p);else{switch(typeof v){case"undefined":case"function":case"symbol":case"boolean":u.removeAttribute(p);return}u.setAttributeNS(f,p,""+v)}}function sa(u){switch(typeof u){case"bigint":case"boolean":case"number":case"string":case"undefined":return u;case"object":return u;default:return""}}function L7(u){var f=u.type;return(u=u.nodeName)&&u.toLowerCase()==="input"&&(f==="checkbox"||f==="radio")}function hK(u,f,p){var v=Object.getOwnPropertyDescriptor(u.constructor.prototype,f);if(!u.hasOwnProperty(f)&&typeof v<"u"&&typeof v.get=="function"&&typeof v.set=="function"){var O=v.get,C=v.set;return Object.defineProperty(u,f,{configurable:!0,get:function(){return O.call(this)},set:function(F){p=""+F,C.call(this,F)}}),Object.defineProperty(u,f,{enumerable:v.enumerable}),{getValue:function(){return p},setValue:function(F){p=""+F},stopTracking:function(){u._valueTracker=null,delete u[f]}}}}function pw(u){if(!u._valueTracker){var f=L7(u)?"checked":"value";u._valueTracker=hK(u,f,""+u[f])}}function B7(u){if(!u)return!1;var f=u._valueTracker;if(!f)return!0;var p=f.getValue(),v="";return u&&(v=L7(u)?u.checked?"true":"false":u.value),u=v,u!==p?(f.setValue(u),!0):!1}function qg(u){if(u=u||(typeof document<"u"?document:void 0),typeof u>"u")return null;try{return u.activeElement||u.body}catch{return u.body}}var fK=/[\n"\\]/g;function ia(u){return u.replace(fK,function(f){return"\\"+f.charCodeAt(0).toString(16)+" "})}function gw(u,f,p,v,O,C,F,Z){u.name="",F!=null&&typeof F!="function"&&typeof F!="symbol"&&typeof F!="boolean"?u.type=F:u.removeAttribute("type"),f!=null?F==="number"?(f===0&&u.value===""||u.value!=f)&&(u.value=""+sa(f)):u.value!==""+sa(f)&&(u.value=""+sa(f)):F!=="submit"&&F!=="reset"||u.removeAttribute("value"),f!=null?xw(u,F,sa(f)):p!=null?xw(u,F,sa(p)):v!=null&&u.removeAttribute("value"),O==null&&C!=null&&(u.defaultChecked=!!C),O!=null&&(u.checked=O&&typeof O!="function"&&typeof O!="symbol"),Z!=null&&typeof Z!="function"&&typeof Z!="symbol"&&typeof Z!="boolean"?u.name=""+sa(Z):u.removeAttribute("name")}function F7(u,f,p,v,O,C,F,Z){if(C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(u.type=C),f!=null||p!=null){if(!(C!=="submit"&&C!=="reset"||f!=null)){pw(u);return}p=p!=null?""+sa(p):"",f=f!=null?""+sa(f):p,Z||f===u.value||(u.value=f),u.defaultValue=f}v=v??O,v=typeof v!="function"&&typeof v!="symbol"&&!!v,u.checked=Z?u.checked:!!v,u.defaultChecked=!!v,F!=null&&typeof F!="function"&&typeof F!="symbol"&&typeof F!="boolean"&&(u.name=F),pw(u)}function xw(u,f,p){f==="number"&&qg(u.ownerDocument)===u||u.defaultValue===""+p||(u.defaultValue=""+p)}function Td(u,f,p,v){if(u=u.options,f){f={};for(var O=0;O<p.length;O++)f["$"+p[O]]=!0;for(p=0;p<u.length;p++)O=f.hasOwnProperty("$"+u[p].value),u[p].selected!==O&&(u[p].selected=O),O&&v&&(u[p].defaultSelected=!0)}else{for(p=""+sa(p),f=null,O=0;O<u.length;O++){if(u[O].value===p){u[O].selected=!0,v&&(u[O].defaultSelected=!0);return}f!==null||u[O].disabled||(f=u[O])}f!==null&&(f.selected=!0)}}function q7(u,f,p){if(f!=null&&(f=""+sa(f),f!==u.value&&(u.value=f),p==null)){u.defaultValue!==f&&(u.defaultValue=f);return}u.defaultValue=p!=null?""+sa(p):""}function $7(u,f,p,v){if(f==null){if(v!=null){if(p!=null)throw Error(r(92));if(V(v)){if(1<v.length)throw Error(r(93));v=v[0]}p=v}p==null&&(p=""),f=p}p=sa(f),u.defaultValue=p,v=u.textContent,v===p&&v!==""&&v!==null&&(u.value=v),pw(u)}function Ed(u,f){if(f){var p=u.firstChild;if(p&&p===u.lastChild&&p.nodeType===3){p.nodeValue=f;return}}u.textContent=f}var mK=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 H7(u,f,p){var v=f.indexOf("--")===0;p==null||typeof p=="boolean"||p===""?v?u.setProperty(f,""):f==="float"?u.cssFloat="":u[f]="":v?u.setProperty(f,p):typeof p!="number"||p===0||mK.has(f)?f==="float"?u.cssFloat=p:u[f]=(""+p).trim():u[f]=p+"px"}function Q7(u,f,p){if(f!=null&&typeof f!="object")throw Error(r(62));if(u=u.style,p!=null){for(var v in p)!p.hasOwnProperty(v)||f!=null&&f.hasOwnProperty(v)||(v.indexOf("--")===0?u.setProperty(v,""):v==="float"?u.cssFloat="":u[v]="");for(var O in f)v=f[O],f.hasOwnProperty(O)&&p[O]!==v&&H7(u,O,v)}else for(var C in f)f.hasOwnProperty(C)&&H7(u,C,f[C])}function vw(u){if(u.indexOf("-")===-1)return!1;switch(u){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 pK=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"]]),gK=/^[\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 $g(u){return gK.test(""+u)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":u}function rl(){}var yw=null;function bw(u){return u=u.target||u.srcElement||window,u.correspondingUseElement&&(u=u.correspondingUseElement),u.nodeType===3?u.parentNode:u}var _d=null,Ad=null;function V7(u){var f=Jo(u);if(f&&(u=f.stateNode)){var p=u[Rr]||null;e:switch(u=f.stateNode,f.type){case"input":if(gw(u,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name),f=p.name,p.type==="radio"&&f!=null){for(p=u;p.parentNode;)p=p.parentNode;for(p=p.querySelectorAll('input[name="'+ia(""+f)+'"][type="radio"]'),f=0;f<p.length;f++){var v=p[f];if(v!==u&&v.form===u.form){var O=v[Rr]||null;if(!O)throw Error(r(90));gw(v,O.value,O.defaultValue,O.defaultValue,O.checked,O.defaultChecked,O.type,O.name)}}for(f=0;f<p.length;f++)v=p[f],v.form===u.form&&B7(v)}break e;case"textarea":q7(u,p.value,p.defaultValue);break e;case"select":f=p.value,f!=null&&Td(u,!!p.multiple,f,!1)}}}var ww=!1;function U7(u,f,p){if(ww)return u(f,p);ww=!0;try{var v=u(f);return v}finally{if(ww=!1,(_d!==null||Ad!==null)&&(Ex(),_d&&(f=_d,u=Ad,Ad=_d=null,V7(f),u)))for(f=0;f<u.length;f++)V7(u[f])}}function Gf(u,f){var p=u.stateNode;if(p===null)return null;var v=p[Rr]||null;if(v===null)return null;p=v[f];e:switch(f){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(v=!v.disabled)||(u=u.type,v=!(u==="button"||u==="input"||u==="select"||u==="textarea")),u=!v;break e;default:u=!1}if(u)return null;if(p&&typeof p!="function")throw Error(r(231,f,typeof p));return p}var sl=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Sw=!1;if(sl)try{var Xf={};Object.defineProperty(Xf,"passive",{get:function(){Sw=!0}}),window.addEventListener("test",Xf,Xf),window.removeEventListener("test",Xf,Xf)}catch{Sw=!1}var ic=null,kw=null,Hg=null;function W7(){if(Hg)return Hg;var u,f=kw,p=f.length,v,O="value"in ic?ic.value:ic.textContent,C=O.length;for(u=0;u<p&&f[u]===O[u];u++);var F=p-u;for(v=1;v<=F&&f[p-v]===O[C-v];v++);return Hg=O.slice(u,1<v?1-v:void 0)}function Qg(u){var f=u.keyCode;return"charCode"in u?(u=u.charCode,u===0&&f===13&&(u=13)):u=f,u===10&&(u=13),32<=u||u===13?u:0}function Vg(){return!0}function G7(){return!1}function ci(u){function f(p,v,O,C,F){this._reactName=p,this._targetInst=O,this.type=v,this.nativeEvent=C,this.target=F,this.currentTarget=null;for(var Z in u)u.hasOwnProperty(Z)&&(p=u[Z],this[Z]=p?p(C):C[Z]);return this.isDefaultPrevented=(C.defaultPrevented!=null?C.defaultPrevented:C.returnValue===!1)?Vg:G7,this.isPropagationStopped=G7,this}return m(f.prototype,{preventDefault:function(){this.defaultPrevented=!0;var p=this.nativeEvent;p&&(p.preventDefault?p.preventDefault():typeof p.returnValue!="unknown"&&(p.returnValue=!1),this.isDefaultPrevented=Vg)},stopPropagation:function(){var p=this.nativeEvent;p&&(p.stopPropagation?p.stopPropagation():typeof p.cancelBubble!="unknown"&&(p.cancelBubble=!0),this.isPropagationStopped=Vg)},persist:function(){},isPersistent:Vg}),f}var yu={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(u){return u.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ug=ci(yu),Yf=m({},yu,{view:0,detail:0}),xK=ci(Yf),Ow,jw,Kf,Wg=m({},Yf,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Cw,button:0,buttons:0,relatedTarget:function(u){return u.relatedTarget===void 0?u.fromElement===u.srcElement?u.toElement:u.fromElement:u.relatedTarget},movementX:function(u){return"movementX"in u?u.movementX:(u!==Kf&&(Kf&&u.type==="mousemove"?(Ow=u.screenX-Kf.screenX,jw=u.screenY-Kf.screenY):jw=Ow=0,Kf=u),Ow)},movementY:function(u){return"movementY"in u?u.movementY:jw}}),X7=ci(Wg),vK=m({},Wg,{dataTransfer:0}),yK=ci(vK),bK=m({},Yf,{relatedTarget:0}),Nw=ci(bK),wK=m({},yu,{animationName:0,elapsedTime:0,pseudoElement:0}),SK=ci(wK),kK=m({},yu,{clipboardData:function(u){return"clipboardData"in u?u.clipboardData:window.clipboardData}}),OK=ci(kK),jK=m({},yu,{data:0}),Y7=ci(jK),NK={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},CK={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"},TK={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function EK(u){var f=this.nativeEvent;return f.getModifierState?f.getModifierState(u):(u=TK[u])?!!f[u]:!1}function Cw(){return EK}var _K=m({},Yf,{key:function(u){if(u.key){var f=NK[u.key]||u.key;if(f!=="Unidentified")return f}return u.type==="keypress"?(u=Qg(u),u===13?"Enter":String.fromCharCode(u)):u.type==="keydown"||u.type==="keyup"?CK[u.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Cw,charCode:function(u){return u.type==="keypress"?Qg(u):0},keyCode:function(u){return u.type==="keydown"||u.type==="keyup"?u.keyCode:0},which:function(u){return u.type==="keypress"?Qg(u):u.type==="keydown"||u.type==="keyup"?u.keyCode:0}}),AK=ci(_K),MK=m({},Wg,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),K7=ci(MK),RK=m({},Yf,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Cw}),DK=ci(RK),PK=m({},yu,{propertyName:0,elapsedTime:0,pseudoElement:0}),zK=ci(PK),IK=m({},Wg,{deltaX:function(u){return"deltaX"in u?u.deltaX:"wheelDeltaX"in u?-u.wheelDeltaX:0},deltaY:function(u){return"deltaY"in u?u.deltaY:"wheelDeltaY"in u?-u.wheelDeltaY:"wheelDelta"in u?-u.wheelDelta:0},deltaZ:0,deltaMode:0}),LK=ci(IK),BK=m({},yu,{newState:0,oldState:0}),FK=ci(BK),qK=[9,13,27,32],Tw=sl&&"CompositionEvent"in window,Zf=null;sl&&"documentMode"in document&&(Zf=document.documentMode);var $K=sl&&"TextEvent"in window&&!Zf,Z7=sl&&(!Tw||Zf&&8<Zf&&11>=Zf),J7=" ",eC=!1;function tC(u,f){switch(u){case"keyup":return qK.indexOf(f.keyCode)!==-1;case"keydown":return f.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function nC(u){return u=u.detail,typeof u=="object"&&"data"in u?u.data:null}var Md=!1;function HK(u,f){switch(u){case"compositionend":return nC(f);case"keypress":return f.which!==32?null:(eC=!0,J7);case"textInput":return u=f.data,u===J7&&eC?null:u;default:return null}}function QK(u,f){if(Md)return u==="compositionend"||!Tw&&tC(u,f)?(u=W7(),Hg=kw=ic=null,Md=!1,u):null;switch(u){case"paste":return null;case"keypress":if(!(f.ctrlKey||f.altKey||f.metaKey)||f.ctrlKey&&f.altKey){if(f.char&&1<f.char.length)return f.char;if(f.which)return String.fromCharCode(f.which)}return null;case"compositionend":return Z7&&f.locale!=="ko"?null:f.data;default:return null}}var VK={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 rC(u){var f=u&&u.nodeName&&u.nodeName.toLowerCase();return f==="input"?!!VK[u.type]:f==="textarea"}function sC(u,f,p,v){_d?Ad?Ad.push(v):Ad=[v]:_d=v,f=zx(f,"onChange"),0<f.length&&(p=new Ug("onChange","change",null,p,v),u.push({event:p,listeners:f}))}var Jf=null,em=null;function UK(u){FT(u,0)}function Gg(u){var f=vu(u);if(B7(f))return u}function iC(u,f){if(u==="change")return f}var aC=!1;if(sl){var Ew;if(sl){var _w="oninput"in document;if(!_w){var oC=document.createElement("div");oC.setAttribute("oninput","return;"),_w=typeof oC.oninput=="function"}Ew=_w}else Ew=!1;aC=Ew&&(!document.documentMode||9<document.documentMode)}function lC(){Jf&&(Jf.detachEvent("onpropertychange",cC),em=Jf=null)}function cC(u){if(u.propertyName==="value"&&Gg(em)){var f=[];sC(f,em,u,bw(u)),U7(UK,f)}}function WK(u,f,p){u==="focusin"?(lC(),Jf=f,em=p,Jf.attachEvent("onpropertychange",cC)):u==="focusout"&&lC()}function GK(u){if(u==="selectionchange"||u==="keyup"||u==="keydown")return Gg(em)}function XK(u,f){if(u==="click")return Gg(f)}function YK(u,f){if(u==="input"||u==="change")return Gg(f)}function KK(u,f){return u===f&&(u!==0||1/u===1/f)||u!==u&&f!==f}var Ri=typeof Object.is=="function"?Object.is:KK;function tm(u,f){if(Ri(u,f))return!0;if(typeof u!="object"||u===null||typeof f!="object"||f===null)return!1;var p=Object.keys(u),v=Object.keys(f);if(p.length!==v.length)return!1;for(v=0;v<p.length;v++){var O=p[v];if(!jt.call(f,O)||!Ri(u[O],f[O]))return!1}return!0}function uC(u){for(;u&&u.firstChild;)u=u.firstChild;return u}function dC(u,f){var p=uC(u);u=0;for(var v;p;){if(p.nodeType===3){if(v=u+p.textContent.length,u<=f&&v>=f)return{node:p,offset:f-u};u=v}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=uC(p)}}function hC(u,f){return u&&f?u===f?!0:u&&u.nodeType===3?!1:f&&f.nodeType===3?hC(u,f.parentNode):"contains"in u?u.contains(f):u.compareDocumentPosition?!!(u.compareDocumentPosition(f)&16):!1:!1}function fC(u){u=u!=null&&u.ownerDocument!=null&&u.ownerDocument.defaultView!=null?u.ownerDocument.defaultView:window;for(var f=qg(u.document);f instanceof u.HTMLIFrameElement;){try{var p=typeof f.contentWindow.location.href=="string"}catch{p=!1}if(p)u=f.contentWindow;else break;f=qg(u.document)}return f}function Aw(u){var f=u&&u.nodeName&&u.nodeName.toLowerCase();return f&&(f==="input"&&(u.type==="text"||u.type==="search"||u.type==="tel"||u.type==="url"||u.type==="password")||f==="textarea"||u.contentEditable==="true")}var ZK=sl&&"documentMode"in document&&11>=document.documentMode,Rd=null,Mw=null,nm=null,Rw=!1;function mC(u,f,p){var v=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;Rw||Rd==null||Rd!==qg(v)||(v=Rd,"selectionStart"in v&&Aw(v)?v={start:v.selectionStart,end:v.selectionEnd}:(v=(v.ownerDocument&&v.ownerDocument.defaultView||window).getSelection(),v={anchorNode:v.anchorNode,anchorOffset:v.anchorOffset,focusNode:v.focusNode,focusOffset:v.focusOffset}),nm&&tm(nm,v)||(nm=v,v=zx(Mw,"onSelect"),0<v.length&&(f=new Ug("onSelect","select",null,f,p),u.push({event:f,listeners:v}),f.target=Rd)))}function bu(u,f){var p={};return p[u.toLowerCase()]=f.toLowerCase(),p["Webkit"+u]="webkit"+f,p["Moz"+u]="moz"+f,p}var Dd={animationend:bu("Animation","AnimationEnd"),animationiteration:bu("Animation","AnimationIteration"),animationstart:bu("Animation","AnimationStart"),transitionrun:bu("Transition","TransitionRun"),transitionstart:bu("Transition","TransitionStart"),transitioncancel:bu("Transition","TransitionCancel"),transitionend:bu("Transition","TransitionEnd")},Dw={},pC={};sl&&(pC=document.createElement("div").style,"AnimationEvent"in window||(delete Dd.animationend.animation,delete Dd.animationiteration.animation,delete Dd.animationstart.animation),"TransitionEvent"in window||delete Dd.transitionend.transition);function wu(u){if(Dw[u])return Dw[u];if(!Dd[u])return u;var f=Dd[u],p;for(p in f)if(f.hasOwnProperty(p)&&p in pC)return Dw[u]=f[p];return u}var gC=wu("animationend"),xC=wu("animationiteration"),vC=wu("animationstart"),JK=wu("transitionrun"),eZ=wu("transitionstart"),tZ=wu("transitioncancel"),yC=wu("transitionend"),bC=new Map,Pw="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(" ");Pw.push("scrollEnd");function La(u,f){bC.set(u,f),el(f,[u])}var Xg=typeof reportError=="function"?reportError:function(u){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var f=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof u=="object"&&u!==null&&typeof u.message=="string"?String(u.message):String(u),error:u});if(!window.dispatchEvent(f))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",u);return}console.error(u)},aa=[],Pd=0,zw=0;function Yg(){for(var u=Pd,f=zw=Pd=0;f<u;){var p=aa[f];aa[f++]=null;var v=aa[f];aa[f++]=null;var O=aa[f];aa[f++]=null;var C=aa[f];if(aa[f++]=null,v!==null&&O!==null){var F=v.pending;F===null?O.next=O:(O.next=F.next,F.next=O),v.pending=O}C!==0&&wC(p,O,C)}}function Kg(u,f,p,v){aa[Pd++]=u,aa[Pd++]=f,aa[Pd++]=p,aa[Pd++]=v,zw|=v,u.lanes|=v,u=u.alternate,u!==null&&(u.lanes|=v)}function Iw(u,f,p,v){return Kg(u,f,p,v),Zg(u)}function Su(u,f){return Kg(u,null,null,f),Zg(u)}function wC(u,f,p){u.lanes|=p;var v=u.alternate;v!==null&&(v.lanes|=p);for(var O=!1,C=u.return;C!==null;)C.childLanes|=p,v=C.alternate,v!==null&&(v.childLanes|=p),C.tag===22&&(u=C.stateNode,u===null||u._visibility&1||(O=!0)),u=C,C=C.return;return u.tag===3?(C=u.stateNode,O&&f!==null&&(O=31-Pt(p),u=C.hiddenUpdates,v=u[O],v===null?u[O]=[f]:v.push(f),f.lane=p|536870912),C):null}function Zg(u){if(50<Om)throw Om=0,U2=null,Error(r(185));for(var f=u.return;f!==null;)u=f,f=u.return;return u.tag===3?u.stateNode:null}var zd={};function nZ(u,f,p,v){this.tag=u,this.key=p,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=f,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=v,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Di(u,f,p,v){return new nZ(u,f,p,v)}function Lw(u){return u=u.prototype,!(!u||!u.isReactComponent)}function il(u,f){var p=u.alternate;return p===null?(p=Di(u.tag,f,u.key,u.mode),p.elementType=u.elementType,p.type=u.type,p.stateNode=u.stateNode,p.alternate=u,u.alternate=p):(p.pendingProps=f,p.type=u.type,p.flags=0,p.subtreeFlags=0,p.deletions=null),p.flags=u.flags&65011712,p.childLanes=u.childLanes,p.lanes=u.lanes,p.child=u.child,p.memoizedProps=u.memoizedProps,p.memoizedState=u.memoizedState,p.updateQueue=u.updateQueue,f=u.dependencies,p.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext},p.sibling=u.sibling,p.index=u.index,p.ref=u.ref,p.refCleanup=u.refCleanup,p}function SC(u,f){u.flags&=65011714;var p=u.alternate;return p===null?(u.childLanes=0,u.lanes=f,u.child=null,u.subtreeFlags=0,u.memoizedProps=null,u.memoizedState=null,u.updateQueue=null,u.dependencies=null,u.stateNode=null):(u.childLanes=p.childLanes,u.lanes=p.lanes,u.child=p.child,u.subtreeFlags=0,u.deletions=null,u.memoizedProps=p.memoizedProps,u.memoizedState=p.memoizedState,u.updateQueue=p.updateQueue,u.type=p.type,f=p.dependencies,u.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext}),u}function Jg(u,f,p,v,O,C){var F=0;if(v=u,typeof u=="function")Lw(u)&&(F=1);else if(typeof u=="string")F=oJ(u,p,U.current)?26:u==="html"||u==="head"||u==="body"?27:5;else e:switch(u){case q:return u=Di(31,p,f,O),u.elementType=q,u.lanes=C,u;case w:return ku(p.children,O,C,f);case S:F=8,O|=24;break;case k:return u=Di(12,p,f,O|2),u.elementType=k,u.lanes=C,u;case E:return u=Di(13,p,f,O),u.elementType=E,u.lanes=C,u;case _:return u=Di(19,p,f,O),u.elementType=_,u.lanes=C,u;default:if(typeof u=="object"&&u!==null)switch(u.$$typeof){case N:F=10;break e;case j:F=9;break e;case T:F=11;break e;case A:F=14;break e;case D:F=16,v=null;break e}F=29,p=Error(r(130,u===null?"null":typeof u,"")),v=null}return f=Di(F,p,f,O),f.elementType=u,f.type=v,f.lanes=C,f}function ku(u,f,p,v){return u=Di(7,u,v,f),u.lanes=p,u}function Bw(u,f,p){return u=Di(6,u,null,f),u.lanes=p,u}function kC(u){var f=Di(18,null,null,0);return f.stateNode=u,f}function Fw(u,f,p){return f=Di(4,u.children!==null?u.children:[],u.key,f),f.lanes=p,f.stateNode={containerInfo:u.containerInfo,pendingChildren:null,implementation:u.implementation},f}var OC=new WeakMap;function oa(u,f){if(typeof u=="object"&&u!==null){var p=OC.get(u);return p!==void 0?p:(f={value:u,source:f,stack:$e(f)},OC.set(u,f),f)}return{value:u,source:f,stack:$e(f)}}var Id=[],Ld=0,ex=null,rm=0,la=[],ca=0,ac=null,lo=1,co="";function al(u,f){Id[Ld++]=rm,Id[Ld++]=ex,ex=u,rm=f}function jC(u,f,p){la[ca++]=lo,la[ca++]=co,la[ca++]=ac,ac=u;var v=lo;u=co;var O=32-Pt(v)-1;v&=~(1<<O),p+=1;var C=32-Pt(f)+O;if(30<C){var F=O-O%5;C=(v&(1<<F)-1).toString(32),v>>=F,O-=F,lo=1<<32-Pt(f)+O|p<<O|v,co=C+u}else lo=1<<C|p<<O|v,co=u}function qw(u){u.return!==null&&(al(u,1),jC(u,1,0))}function $w(u){for(;u===ex;)ex=Id[--Ld],Id[Ld]=null,rm=Id[--Ld],Id[Ld]=null;for(;u===ac;)ac=la[--ca],la[ca]=null,co=la[--ca],la[ca]=null,lo=la[--ca],la[ca]=null}function NC(u,f){la[ca++]=lo,la[ca++]=co,la[ca++]=ac,lo=f.id,co=f.overflow,ac=u}var Cs=null,xr=null,On=!1,oc=null,ua=!1,Hw=Error(r(519));function lc(u){var f=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw sm(oa(f,u)),Hw}function CC(u){var f=u.stateNode,p=u.type,v=u.memoizedProps;switch(f[Mr]=u,f[Rr]=v,p){case"dialog":fn("cancel",f),fn("close",f);break;case"iframe":case"object":case"embed":fn("load",f);break;case"video":case"audio":for(p=0;p<Nm.length;p++)fn(Nm[p],f);break;case"source":fn("error",f);break;case"img":case"image":case"link":fn("error",f),fn("load",f);break;case"details":fn("toggle",f);break;case"input":fn("invalid",f),F7(f,v.value,v.defaultValue,v.checked,v.defaultChecked,v.type,v.name,!0);break;case"select":fn("invalid",f);break;case"textarea":fn("invalid",f),$7(f,v.value,v.defaultValue,v.children)}p=v.children,typeof p!="string"&&typeof p!="number"&&typeof p!="bigint"||f.textContent===""+p||v.suppressHydrationWarning===!0||QT(f.textContent,p)?(v.popover!=null&&(fn("beforetoggle",f),fn("toggle",f)),v.onScroll!=null&&fn("scroll",f),v.onScrollEnd!=null&&fn("scrollend",f),v.onClick!=null&&(f.onclick=rl),f=!0):f=!1,f||lc(u,!0)}function TC(u){for(Cs=u.return;Cs;)switch(Cs.tag){case 5:case 31:case 13:ua=!1;return;case 27:case 3:ua=!0;return;default:Cs=Cs.return}}function Bd(u){if(u!==Cs)return!1;if(!On)return TC(u),On=!0,!1;var f=u.tag,p;if((p=f!==3&&f!==27)&&((p=f===5)&&(p=u.type,p=!(p!=="form"&&p!=="button")||o4(u.type,u.memoizedProps)),p=!p),p&&xr&&lc(u),TC(u),f===13){if(u=u.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(r(317));xr=JT(u)}else if(f===31){if(u=u.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(r(317));xr=JT(u)}else f===27?(f=xr,Sc(u.type)?(u=h4,h4=null,xr=u):xr=f):xr=Cs?ha(u.stateNode.nextSibling):null;return!0}function Ou(){xr=Cs=null,On=!1}function Qw(){var u=oc;return u!==null&&(fi===null?fi=u:fi.push.apply(fi,u),oc=null),u}function sm(u){oc===null?oc=[u]:oc.push(u)}var Vw=ie(null),ju=null,ol=null;function cc(u,f,p){z(Vw,f._currentValue),f._currentValue=p}function ll(u){u._currentValue=Vw.current,X(Vw)}function Uw(u,f,p){for(;u!==null;){var v=u.alternate;if((u.childLanes&f)!==f?(u.childLanes|=f,v!==null&&(v.childLanes|=f)):v!==null&&(v.childLanes&f)!==f&&(v.childLanes|=f),u===p)break;u=u.return}}function Ww(u,f,p,v){var O=u.child;for(O!==null&&(O.return=u);O!==null;){var C=O.dependencies;if(C!==null){var F=O.child;C=C.firstContext;e:for(;C!==null;){var Z=C;C=O;for(var de=0;de<f.length;de++)if(Z.context===f[de]){C.lanes|=p,Z=C.alternate,Z!==null&&(Z.lanes|=p),Uw(C.return,p,u),v||(F=null);break e}C=Z.next}}else if(O.tag===18){if(F=O.return,F===null)throw Error(r(341));F.lanes|=p,C=F.alternate,C!==null&&(C.lanes|=p),Uw(F,p,u),F=null}else F=O.child;if(F!==null)F.return=O;else for(F=O;F!==null;){if(F===u){F=null;break}if(O=F.sibling,O!==null){O.return=F.return,F=O;break}F=F.return}O=F}}function Fd(u,f,p,v){u=null;for(var O=f,C=!1;O!==null;){if(!C){if((O.flags&524288)!==0)C=!0;else if((O.flags&262144)!==0)break}if(O.tag===10){var F=O.alternate;if(F===null)throw Error(r(387));if(F=F.memoizedProps,F!==null){var Z=O.type;Ri(O.pendingProps.value,F.value)||(u!==null?u.push(Z):u=[Z])}}else if(O===G.current){if(F=O.alternate,F===null)throw Error(r(387));F.memoizedState.memoizedState!==O.memoizedState.memoizedState&&(u!==null?u.push(Am):u=[Am])}O=O.return}u!==null&&Ww(f,u,p,v),f.flags|=262144}function tx(u){for(u=u.firstContext;u!==null;){if(!Ri(u.context._currentValue,u.memoizedValue))return!0;u=u.next}return!1}function Nu(u){ju=u,ol=null,u=u.dependencies,u!==null&&(u.firstContext=null)}function Ts(u){return EC(ju,u)}function nx(u,f){return ju===null&&Nu(u),EC(u,f)}function EC(u,f){var p=f._currentValue;if(f={context:f,memoizedValue:p,next:null},ol===null){if(u===null)throw Error(r(308));ol=f,u.dependencies={lanes:0,firstContext:f},u.flags|=524288}else ol=ol.next=f;return p}var rZ=typeof AbortController<"u"?AbortController:function(){var u=[],f=this.signal={aborted:!1,addEventListener:function(p,v){u.push(v)}};this.abort=function(){f.aborted=!0,u.forEach(function(p){return p()})}},sZ=t.unstable_scheduleCallback,iZ=t.unstable_NormalPriority,Zr={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Gw(){return{controller:new rZ,data:new Map,refCount:0}}function im(u){u.refCount--,u.refCount===0&&sZ(iZ,function(){u.controller.abort()})}var am=null,Xw=0,qd=0,$d=null;function aZ(u,f){if(am===null){var p=am=[];Xw=0,qd=Z2(),$d={status:"pending",value:void 0,then:function(v){p.push(v)}}}return Xw++,f.then(_C,_C),f}function _C(){if(--Xw===0&&am!==null){$d!==null&&($d.status="fulfilled");var u=am;am=null,qd=0,$d=null;for(var f=0;f<u.length;f++)(0,u[f])()}}function oZ(u,f){var p=[],v={status:"pending",value:null,reason:null,then:function(O){p.push(O)}};return u.then(function(){v.status="fulfilled",v.value=f;for(var O=0;O<p.length;O++)(0,p[O])(f)},function(O){for(v.status="rejected",v.reason=O,O=0;O<p.length;O++)(0,p[O])(void 0)}),v}var AC=L.S;L.S=function(u,f){mT=Mt(),typeof f=="object"&&f!==null&&typeof f.then=="function"&&aZ(u,f),AC!==null&&AC(u,f)};var Cu=ie(null);function Yw(){var u=Cu.current;return u!==null?u:or.pooledCache}function rx(u,f){f===null?z(Cu,Cu.current):z(Cu,f.pool)}function MC(){var u=Yw();return u===null?null:{parent:Zr._currentValue,pool:u}}var Hd=Error(r(460)),Kw=Error(r(474)),sx=Error(r(542)),ix={then:function(){}};function RC(u){return u=u.status,u==="fulfilled"||u==="rejected"}function DC(u,f,p){switch(p=u[p],p===void 0?u.push(f):p!==f&&(f.then(rl,rl),f=p),f.status){case"fulfilled":return f.value;case"rejected":throw u=f.reason,zC(u),u;default:if(typeof f.status=="string")f.then(rl,rl);else{if(u=or,u!==null&&100<u.shellSuspendCounter)throw Error(r(482));u=f,u.status="pending",u.then(function(v){if(f.status==="pending"){var O=f;O.status="fulfilled",O.value=v}},function(v){if(f.status==="pending"){var O=f;O.status="rejected",O.reason=v}})}switch(f.status){case"fulfilled":return f.value;case"rejected":throw u=f.reason,zC(u),u}throw Eu=f,Hd}}function Tu(u){try{var f=u._init;return f(u._payload)}catch(p){throw p!==null&&typeof p=="object"&&typeof p.then=="function"?(Eu=p,Hd):p}}var Eu=null;function PC(){if(Eu===null)throw Error(r(459));var u=Eu;return Eu=null,u}function zC(u){if(u===Hd||u===sx)throw Error(r(483))}var Qd=null,om=0;function ax(u){var f=om;return om+=1,Qd===null&&(Qd=[]),DC(Qd,u,f)}function lm(u,f){f=f.props.ref,u.ref=f!==void 0?f:null}function ox(u,f){throw f.$$typeof===g?Error(r(525)):(u=Object.prototype.toString.call(f),Error(r(31,u==="[object Object]"?"object with keys {"+Object.keys(f).join(", ")+"}":u)))}function IC(u){function f(pe,fe){if(u){var be=pe.deletions;be===null?(pe.deletions=[fe],pe.flags|=16):be.push(fe)}}function p(pe,fe){if(!u)return null;for(;fe!==null;)f(pe,fe),fe=fe.sibling;return null}function v(pe){for(var fe=new Map;pe!==null;)pe.key!==null?fe.set(pe.key,pe):fe.set(pe.index,pe),pe=pe.sibling;return fe}function O(pe,fe){return pe=il(pe,fe),pe.index=0,pe.sibling=null,pe}function C(pe,fe,be){return pe.index=be,u?(be=pe.alternate,be!==null?(be=be.index,be<fe?(pe.flags|=67108866,fe):be):(pe.flags|=67108866,fe)):(pe.flags|=1048576,fe)}function F(pe){return u&&pe.alternate===null&&(pe.flags|=67108866),pe}function Z(pe,fe,be,Ae){return fe===null||fe.tag!==6?(fe=Bw(be,pe.mode,Ae),fe.return=pe,fe):(fe=O(fe,be),fe.return=pe,fe)}function de(pe,fe,be,Ae){var Ct=be.type;return Ct===w?Te(pe,fe,be.props.children,Ae,be.key):fe!==null&&(fe.elementType===Ct||typeof Ct=="object"&&Ct!==null&&Ct.$$typeof===D&&Tu(Ct)===fe.type)?(fe=O(fe,be.props),lm(fe,be),fe.return=pe,fe):(fe=Jg(be.type,be.key,be.props,null,pe.mode,Ae),lm(fe,be),fe.return=pe,fe)}function Se(pe,fe,be,Ae){return fe===null||fe.tag!==4||fe.stateNode.containerInfo!==be.containerInfo||fe.stateNode.implementation!==be.implementation?(fe=Fw(be,pe.mode,Ae),fe.return=pe,fe):(fe=O(fe,be.children||[]),fe.return=pe,fe)}function Te(pe,fe,be,Ae,Ct){return fe===null||fe.tag!==7?(fe=ku(be,pe.mode,Ae,Ct),fe.return=pe,fe):(fe=O(fe,be),fe.return=pe,fe)}function Re(pe,fe,be){if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return fe=Bw(""+fe,pe.mode,be),fe.return=pe,fe;if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case x:return be=Jg(fe.type,fe.key,fe.props,null,pe.mode,be),lm(be,fe),be.return=pe,be;case y:return fe=Fw(fe,pe.mode,be),fe.return=pe,fe;case D:return fe=Tu(fe),Re(pe,fe,be)}if(V(fe)||W(fe))return fe=ku(fe,pe.mode,be,null),fe.return=pe,fe;if(typeof fe.then=="function")return Re(pe,ax(fe),be);if(fe.$$typeof===N)return Re(pe,nx(pe,fe),be);ox(pe,fe)}return null}function ke(pe,fe,be,Ae){var Ct=fe!==null?fe.key:null;if(typeof be=="string"&&be!==""||typeof be=="number"||typeof be=="bigint")return Ct!==null?null:Z(pe,fe,""+be,Ae);if(typeof be=="object"&&be!==null){switch(be.$$typeof){case x:return be.key===Ct?de(pe,fe,be,Ae):null;case y:return be.key===Ct?Se(pe,fe,be,Ae):null;case D:return be=Tu(be),ke(pe,fe,be,Ae)}if(V(be)||W(be))return Ct!==null?null:Te(pe,fe,be,Ae,null);if(typeof be.then=="function")return ke(pe,fe,ax(be),Ae);if(be.$$typeof===N)return ke(pe,fe,nx(pe,be),Ae);ox(pe,be)}return null}function Ce(pe,fe,be,Ae,Ct){if(typeof Ae=="string"&&Ae!==""||typeof Ae=="number"||typeof Ae=="bigint")return pe=pe.get(be)||null,Z(fe,pe,""+Ae,Ct);if(typeof Ae=="object"&&Ae!==null){switch(Ae.$$typeof){case x:return pe=pe.get(Ae.key===null?be:Ae.key)||null,de(fe,pe,Ae,Ct);case y:return pe=pe.get(Ae.key===null?be:Ae.key)||null,Se(fe,pe,Ae,Ct);case D:return Ae=Tu(Ae),Ce(pe,fe,be,Ae,Ct)}if(V(Ae)||W(Ae))return pe=pe.get(be)||null,Te(fe,pe,Ae,Ct,null);if(typeof Ae.then=="function")return Ce(pe,fe,be,ax(Ae),Ct);if(Ae.$$typeof===N)return Ce(pe,fe,be,nx(fe,Ae),Ct);ox(fe,Ae)}return null}function ut(pe,fe,be,Ae){for(var Ct=null,Vn=null,yt=fe,Jt=fe=0,bn=null;yt!==null&&Jt<be.length;Jt++){yt.index>Jt?(bn=yt,yt=null):bn=yt.sibling;var Un=ke(pe,yt,be[Jt],Ae);if(Un===null){yt===null&&(yt=bn);break}u&&yt&&Un.alternate===null&&f(pe,yt),fe=C(Un,fe,Jt),Vn===null?Ct=Un:Vn.sibling=Un,Vn=Un,yt=bn}if(Jt===be.length)return p(pe,yt),On&&al(pe,Jt),Ct;if(yt===null){for(;Jt<be.length;Jt++)yt=Re(pe,be[Jt],Ae),yt!==null&&(fe=C(yt,fe,Jt),Vn===null?Ct=yt:Vn.sibling=yt,Vn=yt);return On&&al(pe,Jt),Ct}for(yt=v(yt);Jt<be.length;Jt++)bn=Ce(yt,pe,Jt,be[Jt],Ae),bn!==null&&(u&&bn.alternate!==null&&yt.delete(bn.key===null?Jt:bn.key),fe=C(bn,fe,Jt),Vn===null?Ct=bn:Vn.sibling=bn,Vn=bn);return u&&yt.forEach(function(Cc){return f(pe,Cc)}),On&&al(pe,Jt),Ct}function Dt(pe,fe,be,Ae){if(be==null)throw Error(r(151));for(var Ct=null,Vn=null,yt=fe,Jt=fe=0,bn=null,Un=be.next();yt!==null&&!Un.done;Jt++,Un=be.next()){yt.index>Jt?(bn=yt,yt=null):bn=yt.sibling;var Cc=ke(pe,yt,Un.value,Ae);if(Cc===null){yt===null&&(yt=bn);break}u&&yt&&Cc.alternate===null&&f(pe,yt),fe=C(Cc,fe,Jt),Vn===null?Ct=Cc:Vn.sibling=Cc,Vn=Cc,yt=bn}if(Un.done)return p(pe,yt),On&&al(pe,Jt),Ct;if(yt===null){for(;!Un.done;Jt++,Un=be.next())Un=Re(pe,Un.value,Ae),Un!==null&&(fe=C(Un,fe,Jt),Vn===null?Ct=Un:Vn.sibling=Un,Vn=Un);return On&&al(pe,Jt),Ct}for(yt=v(yt);!Un.done;Jt++,Un=be.next())Un=Ce(yt,pe,Jt,Un.value,Ae),Un!==null&&(u&&Un.alternate!==null&&yt.delete(Un.key===null?Jt:Un.key),fe=C(Un,fe,Jt),Vn===null?Ct=Un:Vn.sibling=Un,Vn=Un);return u&&yt.forEach(function(vJ){return f(pe,vJ)}),On&&al(pe,Jt),Ct}function rr(pe,fe,be,Ae){if(typeof be=="object"&&be!==null&&be.type===w&&be.key===null&&(be=be.props.children),typeof be=="object"&&be!==null){switch(be.$$typeof){case x:e:{for(var Ct=be.key;fe!==null;){if(fe.key===Ct){if(Ct=be.type,Ct===w){if(fe.tag===7){p(pe,fe.sibling),Ae=O(fe,be.props.children),Ae.return=pe,pe=Ae;break e}}else if(fe.elementType===Ct||typeof Ct=="object"&&Ct!==null&&Ct.$$typeof===D&&Tu(Ct)===fe.type){p(pe,fe.sibling),Ae=O(fe,be.props),lm(Ae,be),Ae.return=pe,pe=Ae;break e}p(pe,fe);break}else f(pe,fe);fe=fe.sibling}be.type===w?(Ae=ku(be.props.children,pe.mode,Ae,be.key),Ae.return=pe,pe=Ae):(Ae=Jg(be.type,be.key,be.props,null,pe.mode,Ae),lm(Ae,be),Ae.return=pe,pe=Ae)}return F(pe);case y:e:{for(Ct=be.key;fe!==null;){if(fe.key===Ct)if(fe.tag===4&&fe.stateNode.containerInfo===be.containerInfo&&fe.stateNode.implementation===be.implementation){p(pe,fe.sibling),Ae=O(fe,be.children||[]),Ae.return=pe,pe=Ae;break e}else{p(pe,fe);break}else f(pe,fe);fe=fe.sibling}Ae=Fw(be,pe.mode,Ae),Ae.return=pe,pe=Ae}return F(pe);case D:return be=Tu(be),rr(pe,fe,be,Ae)}if(V(be))return ut(pe,fe,be,Ae);if(W(be)){if(Ct=W(be),typeof Ct!="function")throw Error(r(150));return be=Ct.call(be),Dt(pe,fe,be,Ae)}if(typeof be.then=="function")return rr(pe,fe,ax(be),Ae);if(be.$$typeof===N)return rr(pe,fe,nx(pe,be),Ae);ox(pe,be)}return typeof be=="string"&&be!==""||typeof be=="number"||typeof be=="bigint"?(be=""+be,fe!==null&&fe.tag===6?(p(pe,fe.sibling),Ae=O(fe,be),Ae.return=pe,pe=Ae):(p(pe,fe),Ae=Bw(be,pe.mode,Ae),Ae.return=pe,pe=Ae),F(pe)):p(pe,fe)}return function(pe,fe,be,Ae){try{om=0;var Ct=rr(pe,fe,be,Ae);return Qd=null,Ct}catch(yt){if(yt===Hd||yt===sx)throw yt;var Vn=Di(29,yt,null,pe.mode);return Vn.lanes=Ae,Vn.return=pe,Vn}finally{}}}var _u=IC(!0),LC=IC(!1),uc=!1;function Zw(u){u.updateQueue={baseState:u.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Jw(u,f){u=u.updateQueue,f.updateQueue===u&&(f.updateQueue={baseState:u.baseState,firstBaseUpdate:u.firstBaseUpdate,lastBaseUpdate:u.lastBaseUpdate,shared:u.shared,callbacks:null})}function dc(u){return{lane:u,tag:0,payload:null,callback:null,next:null}}function hc(u,f,p){var v=u.updateQueue;if(v===null)return null;if(v=v.shared,(Gn&2)!==0){var O=v.pending;return O===null?f.next=f:(f.next=O.next,O.next=f),v.pending=f,f=Zg(u),wC(u,null,p),f}return Kg(u,v,f,p),Zg(u)}function cm(u,f,p){if(f=f.updateQueue,f!==null&&(f=f.shared,(p&4194048)!==0)){var v=f.lanes;v&=u.pendingLanes,p|=v,f.lanes=p,vs(u,p)}}function e2(u,f){var p=u.updateQueue,v=u.alternate;if(v!==null&&(v=v.updateQueue,p===v)){var O=null,C=null;if(p=p.firstBaseUpdate,p!==null){do{var F={lane:p.lane,tag:p.tag,payload:p.payload,callback:null,next:null};C===null?O=C=F:C=C.next=F,p=p.next}while(p!==null);C===null?O=C=f:C=C.next=f}else O=C=f;p={baseState:v.baseState,firstBaseUpdate:O,lastBaseUpdate:C,shared:v.shared,callbacks:v.callbacks},u.updateQueue=p;return}u=p.lastBaseUpdate,u===null?p.firstBaseUpdate=f:u.next=f,p.lastBaseUpdate=f}var t2=!1;function um(){if(t2){var u=$d;if(u!==null)throw u}}function dm(u,f,p,v){t2=!1;var O=u.updateQueue;uc=!1;var C=O.firstBaseUpdate,F=O.lastBaseUpdate,Z=O.shared.pending;if(Z!==null){O.shared.pending=null;var de=Z,Se=de.next;de.next=null,F===null?C=Se:F.next=Se,F=de;var Te=u.alternate;Te!==null&&(Te=Te.updateQueue,Z=Te.lastBaseUpdate,Z!==F&&(Z===null?Te.firstBaseUpdate=Se:Z.next=Se,Te.lastBaseUpdate=de))}if(C!==null){var Re=O.baseState;F=0,Te=Se=de=null,Z=C;do{var ke=Z.lane&-536870913,Ce=ke!==Z.lane;if(Ce?(yn&ke)===ke:(v&ke)===ke){ke!==0&&ke===qd&&(t2=!0),Te!==null&&(Te=Te.next={lane:0,tag:Z.tag,payload:Z.payload,callback:null,next:null});e:{var ut=u,Dt=Z;ke=f;var rr=p;switch(Dt.tag){case 1:if(ut=Dt.payload,typeof ut=="function"){Re=ut.call(rr,Re,ke);break e}Re=ut;break e;case 3:ut.flags=ut.flags&-65537|128;case 0:if(ut=Dt.payload,ke=typeof ut=="function"?ut.call(rr,Re,ke):ut,ke==null)break e;Re=m({},Re,ke);break e;case 2:uc=!0}}ke=Z.callback,ke!==null&&(u.flags|=64,Ce&&(u.flags|=8192),Ce=O.callbacks,Ce===null?O.callbacks=[ke]:Ce.push(ke))}else Ce={lane:ke,tag:Z.tag,payload:Z.payload,callback:Z.callback,next:null},Te===null?(Se=Te=Ce,de=Re):Te=Te.next=Ce,F|=ke;if(Z=Z.next,Z===null){if(Z=O.shared.pending,Z===null)break;Ce=Z,Z=Ce.next,Ce.next=null,O.lastBaseUpdate=Ce,O.shared.pending=null}}while(!0);Te===null&&(de=Re),O.baseState=de,O.firstBaseUpdate=Se,O.lastBaseUpdate=Te,C===null&&(O.shared.lanes=0),xc|=F,u.lanes=F,u.memoizedState=Re}}function BC(u,f){if(typeof u!="function")throw Error(r(191,u));u.call(f)}function FC(u,f){var p=u.callbacks;if(p!==null)for(u.callbacks=null,u=0;u<p.length;u++)BC(p[u],f)}var Vd=ie(null),lx=ie(0);function qC(u,f){u=xl,z(lx,u),z(Vd,f),xl=u|f.baseLanes}function n2(){z(lx,xl),z(Vd,Vd.current)}function r2(){xl=lx.current,X(Vd),X(lx)}var Pi=ie(null),da=null;function fc(u){var f=u.alternate;z(Qr,Qr.current&1),z(Pi,u),da===null&&(f===null||Vd.current!==null||f.memoizedState!==null)&&(da=u)}function s2(u){z(Qr,Qr.current),z(Pi,u),da===null&&(da=u)}function $C(u){u.tag===22?(z(Qr,Qr.current),z(Pi,u),da===null&&(da=u)):mc()}function mc(){z(Qr,Qr.current),z(Pi,Pi.current)}function zi(u){X(Pi),da===u&&(da=null),X(Qr)}var Qr=ie(0);function cx(u){for(var f=u;f!==null;){if(f.tag===13){var p=f.memoizedState;if(p!==null&&(p=p.dehydrated,p===null||u4(p)||d4(p)))return f}else if(f.tag===19&&(f.memoizedProps.revealOrder==="forwards"||f.memoizedProps.revealOrder==="backwards"||f.memoizedProps.revealOrder==="unstable_legacy-backwards"||f.memoizedProps.revealOrder==="together")){if((f.flags&128)!==0)return f}else if(f.child!==null){f.child.return=f,f=f.child;continue}if(f===u)break;for(;f.sibling===null;){if(f.return===null||f.return===u)return null;f=f.return}f.sibling.return=f.return,f=f.sibling}return null}var cl=0,Kt=null,tr=null,Jr=null,ux=!1,Ud=!1,Au=!1,dx=0,hm=0,Wd=null,lZ=0;function Br(){throw Error(r(321))}function i2(u,f){if(f===null)return!1;for(var p=0;p<f.length&&p<u.length;p++)if(!Ri(u[p],f[p]))return!1;return!0}function a2(u,f,p,v,O,C){return cl=C,Kt=f,f.memoizedState=null,f.updateQueue=null,f.lanes=0,L.H=u===null||u.memoizedState===null?j8:w2,Au=!1,C=p(v,O),Au=!1,Ud&&(C=QC(f,p,v,O)),HC(u),C}function HC(u){L.H=pm;var f=tr!==null&&tr.next!==null;if(cl=0,Jr=tr=Kt=null,ux=!1,hm=0,Wd=null,f)throw Error(r(300));u===null||es||(u=u.dependencies,u!==null&&tx(u)&&(es=!0))}function QC(u,f,p,v){Kt=u;var O=0;do{if(Ud&&(Wd=null),hm=0,Ud=!1,25<=O)throw Error(r(301));if(O+=1,Jr=tr=null,u.updateQueue!=null){var C=u.updateQueue;C.lastEffect=null,C.events=null,C.stores=null,C.memoCache!=null&&(C.memoCache.index=0)}L.H=N8,C=f(p,v)}while(Ud);return C}function cZ(){var u=L.H,f=u.useState()[0];return f=typeof f.then=="function"?fm(f):f,u=u.useState()[0],(tr!==null?tr.memoizedState:null)!==u&&(Kt.flags|=1024),f}function o2(){var u=dx!==0;return dx=0,u}function l2(u,f,p){f.updateQueue=u.updateQueue,f.flags&=-2053,u.lanes&=~p}function c2(u){if(ux){for(u=u.memoizedState;u!==null;){var f=u.queue;f!==null&&(f.pending=null),u=u.next}ux=!1}cl=0,Jr=tr=Kt=null,Ud=!1,hm=dx=0,Wd=null}function Ks(){var u={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Jr===null?Kt.memoizedState=Jr=u:Jr=Jr.next=u,Jr}function Vr(){if(tr===null){var u=Kt.alternate;u=u!==null?u.memoizedState:null}else u=tr.next;var f=Jr===null?Kt.memoizedState:Jr.next;if(f!==null)Jr=f,tr=u;else{if(u===null)throw Kt.alternate===null?Error(r(467)):Error(r(310));tr=u,u={memoizedState:tr.memoizedState,baseState:tr.baseState,baseQueue:tr.baseQueue,queue:tr.queue,next:null},Jr===null?Kt.memoizedState=Jr=u:Jr=Jr.next=u}return Jr}function hx(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function fm(u){var f=hm;return hm+=1,Wd===null&&(Wd=[]),u=DC(Wd,u,f),f=Kt,(Jr===null?f.memoizedState:Jr.next)===null&&(f=f.alternate,L.H=f===null||f.memoizedState===null?j8:w2),u}function fx(u){if(u!==null&&typeof u=="object"){if(typeof u.then=="function")return fm(u);if(u.$$typeof===N)return Ts(u)}throw Error(r(438,String(u)))}function u2(u){var f=null,p=Kt.updateQueue;if(p!==null&&(f=p.memoCache),f==null){var v=Kt.alternate;v!==null&&(v=v.updateQueue,v!==null&&(v=v.memoCache,v!=null&&(f={data:v.data.map(function(O){return O.slice()}),index:0})))}if(f==null&&(f={data:[],index:0}),p===null&&(p=hx(),Kt.updateQueue=p),p.memoCache=f,p=f.data[f.index],p===void 0)for(p=f.data[f.index]=Array(u),v=0;v<u;v++)p[v]=B;return f.index++,p}function ul(u,f){return typeof f=="function"?f(u):f}function mx(u){var f=Vr();return d2(f,tr,u)}function d2(u,f,p){var v=u.queue;if(v===null)throw Error(r(311));v.lastRenderedReducer=p;var O=u.baseQueue,C=v.pending;if(C!==null){if(O!==null){var F=O.next;O.next=C.next,C.next=F}f.baseQueue=O=C,v.pending=null}if(C=u.baseState,O===null)u.memoizedState=C;else{f=O.next;var Z=F=null,de=null,Se=f,Te=!1;do{var Re=Se.lane&-536870913;if(Re!==Se.lane?(yn&Re)===Re:(cl&Re)===Re){var ke=Se.revertLane;if(ke===0)de!==null&&(de=de.next={lane:0,revertLane:0,gesture:null,action:Se.action,hasEagerState:Se.hasEagerState,eagerState:Se.eagerState,next:null}),Re===qd&&(Te=!0);else if((cl&ke)===ke){Se=Se.next,ke===qd&&(Te=!0);continue}else Re={lane:0,revertLane:Se.revertLane,gesture:null,action:Se.action,hasEagerState:Se.hasEagerState,eagerState:Se.eagerState,next:null},de===null?(Z=de=Re,F=C):de=de.next=Re,Kt.lanes|=ke,xc|=ke;Re=Se.action,Au&&p(C,Re),C=Se.hasEagerState?Se.eagerState:p(C,Re)}else ke={lane:Re,revertLane:Se.revertLane,gesture:Se.gesture,action:Se.action,hasEagerState:Se.hasEagerState,eagerState:Se.eagerState,next:null},de===null?(Z=de=ke,F=C):de=de.next=ke,Kt.lanes|=Re,xc|=Re;Se=Se.next}while(Se!==null&&Se!==f);if(de===null?F=C:de.next=Z,!Ri(C,u.memoizedState)&&(es=!0,Te&&(p=$d,p!==null)))throw p;u.memoizedState=C,u.baseState=F,u.baseQueue=de,v.lastRenderedState=C}return O===null&&(v.lanes=0),[u.memoizedState,v.dispatch]}function h2(u){var f=Vr(),p=f.queue;if(p===null)throw Error(r(311));p.lastRenderedReducer=u;var v=p.dispatch,O=p.pending,C=f.memoizedState;if(O!==null){p.pending=null;var F=O=O.next;do C=u(C,F.action),F=F.next;while(F!==O);Ri(C,f.memoizedState)||(es=!0),f.memoizedState=C,f.baseQueue===null&&(f.baseState=C),p.lastRenderedState=C}return[C,v]}function VC(u,f,p){var v=Kt,O=Vr(),C=On;if(C){if(p===void 0)throw Error(r(407));p=p()}else p=f();var F=!Ri((tr||O).memoizedState,p);if(F&&(O.memoizedState=p,es=!0),O=O.queue,p2(GC.bind(null,v,O,u),[u]),O.getSnapshot!==f||F||Jr!==null&&Jr.memoizedState.tag&1){if(v.flags|=2048,Gd(9,{destroy:void 0},WC.bind(null,v,O,p,f),null),or===null)throw Error(r(349));C||(cl&127)!==0||UC(v,f,p)}return p}function UC(u,f,p){u.flags|=16384,u={getSnapshot:f,value:p},f=Kt.updateQueue,f===null?(f=hx(),Kt.updateQueue=f,f.stores=[u]):(p=f.stores,p===null?f.stores=[u]:p.push(u))}function WC(u,f,p,v){f.value=p,f.getSnapshot=v,XC(f)&&YC(u)}function GC(u,f,p){return p(function(){XC(f)&&YC(u)})}function XC(u){var f=u.getSnapshot;u=u.value;try{var p=f();return!Ri(u,p)}catch{return!0}}function YC(u){var f=Su(u,2);f!==null&&mi(f,u,2)}function f2(u){var f=Ks();if(typeof u=="function"){var p=u;if(u=p(),Au){dn(!0);try{p()}finally{dn(!1)}}}return f.memoizedState=f.baseState=u,f.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ul,lastRenderedState:u},f}function KC(u,f,p,v){return u.baseState=p,d2(u,tr,typeof v=="function"?v:ul)}function uZ(u,f,p,v,O){if(xx(u))throw Error(r(485));if(u=f.action,u!==null){var C={payload:O,action:u,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(F){C.listeners.push(F)}};L.T!==null?p(!0):C.isTransition=!1,v(C),p=f.pending,p===null?(C.next=f.pending=C,ZC(f,C)):(C.next=p.next,f.pending=p.next=C)}}function ZC(u,f){var p=f.action,v=f.payload,O=u.state;if(f.isTransition){var C=L.T,F={};L.T=F;try{var Z=p(O,v),de=L.S;de!==null&&de(F,Z),JC(u,f,Z)}catch(Se){m2(u,f,Se)}finally{C!==null&&F.types!==null&&(C.types=F.types),L.T=C}}else try{C=p(O,v),JC(u,f,C)}catch(Se){m2(u,f,Se)}}function JC(u,f,p){p!==null&&typeof p=="object"&&typeof p.then=="function"?p.then(function(v){e8(u,f,v)},function(v){return m2(u,f,v)}):e8(u,f,p)}function e8(u,f,p){f.status="fulfilled",f.value=p,t8(f),u.state=p,f=u.pending,f!==null&&(p=f.next,p===f?u.pending=null:(p=p.next,f.next=p,ZC(u,p)))}function m2(u,f,p){var v=u.pending;if(u.pending=null,v!==null){v=v.next;do f.status="rejected",f.reason=p,t8(f),f=f.next;while(f!==v)}u.action=null}function t8(u){u=u.listeners;for(var f=0;f<u.length;f++)(0,u[f])()}function n8(u,f){return f}function r8(u,f){if(On){var p=or.formState;if(p!==null){e:{var v=Kt;if(On){if(xr){t:{for(var O=xr,C=ua;O.nodeType!==8;){if(!C){O=null;break t}if(O=ha(O.nextSibling),O===null){O=null;break t}}C=O.data,O=C==="F!"||C==="F"?O:null}if(O){xr=ha(O.nextSibling),v=O.data==="F!";break e}}lc(v)}v=!1}v&&(f=p[0])}}return p=Ks(),p.memoizedState=p.baseState=f,v={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n8,lastRenderedState:f},p.queue=v,p=S8.bind(null,Kt,v),v.dispatch=p,v=f2(!1),C=b2.bind(null,Kt,!1,v.queue),v=Ks(),O={state:f,dispatch:null,action:u,pending:null},v.queue=O,p=uZ.bind(null,Kt,O,C,p),O.dispatch=p,v.memoizedState=u,[f,p,!1]}function s8(u){var f=Vr();return i8(f,tr,u)}function i8(u,f,p){if(f=d2(u,f,n8)[0],u=mx(ul)[0],typeof f=="object"&&f!==null&&typeof f.then=="function")try{var v=fm(f)}catch(F){throw F===Hd?sx:F}else v=f;f=Vr();var O=f.queue,C=O.dispatch;return p!==f.memoizedState&&(Kt.flags|=2048,Gd(9,{destroy:void 0},dZ.bind(null,O,p),null)),[v,C,u]}function dZ(u,f){u.action=f}function a8(u){var f=Vr(),p=tr;if(p!==null)return i8(f,p,u);Vr(),f=f.memoizedState,p=Vr();var v=p.queue.dispatch;return p.memoizedState=u,[f,v,!1]}function Gd(u,f,p,v){return u={tag:u,create:p,deps:v,inst:f,next:null},f=Kt.updateQueue,f===null&&(f=hx(),Kt.updateQueue=f),p=f.lastEffect,p===null?f.lastEffect=u.next=u:(v=p.next,p.next=u,u.next=v,f.lastEffect=u),u}function o8(){return Vr().memoizedState}function px(u,f,p,v){var O=Ks();Kt.flags|=u,O.memoizedState=Gd(1|f,{destroy:void 0},p,v===void 0?null:v)}function gx(u,f,p,v){var O=Vr();v=v===void 0?null:v;var C=O.memoizedState.inst;tr!==null&&v!==null&&i2(v,tr.memoizedState.deps)?O.memoizedState=Gd(f,C,p,v):(Kt.flags|=u,O.memoizedState=Gd(1|f,C,p,v))}function l8(u,f){px(8390656,8,u,f)}function p2(u,f){gx(2048,8,u,f)}function hZ(u){Kt.flags|=4;var f=Kt.updateQueue;if(f===null)f=hx(),Kt.updateQueue=f,f.events=[u];else{var p=f.events;p===null?f.events=[u]:p.push(u)}}function c8(u){var f=Vr().memoizedState;return hZ({ref:f,nextImpl:u}),function(){if((Gn&2)!==0)throw Error(r(440));return f.impl.apply(void 0,arguments)}}function u8(u,f){return gx(4,2,u,f)}function d8(u,f){return gx(4,4,u,f)}function h8(u,f){if(typeof f=="function"){u=u();var p=f(u);return function(){typeof p=="function"?p():f(null)}}if(f!=null)return u=u(),f.current=u,function(){f.current=null}}function f8(u,f,p){p=p!=null?p.concat([u]):null,gx(4,4,h8.bind(null,f,u),p)}function g2(){}function m8(u,f){var p=Vr();f=f===void 0?null:f;var v=p.memoizedState;return f!==null&&i2(f,v[1])?v[0]:(p.memoizedState=[u,f],u)}function p8(u,f){var p=Vr();f=f===void 0?null:f;var v=p.memoizedState;if(f!==null&&i2(f,v[1]))return v[0];if(v=u(),Au){dn(!0);try{u()}finally{dn(!1)}}return p.memoizedState=[v,f],v}function x2(u,f,p){return p===void 0||(cl&1073741824)!==0&&(yn&261930)===0?u.memoizedState=f:(u.memoizedState=p,u=gT(),Kt.lanes|=u,xc|=u,p)}function g8(u,f,p,v){return Ri(p,f)?p:Vd.current!==null?(u=x2(u,p,v),Ri(u,f)||(es=!0),u):(cl&42)===0||(cl&1073741824)!==0&&(yn&261930)===0?(es=!0,u.memoizedState=p):(u=gT(),Kt.lanes|=u,xc|=u,f)}function x8(u,f,p,v,O){var C=$.p;$.p=C!==0&&8>C?C:8;var F=L.T,Z={};L.T=Z,b2(u,!1,f,p);try{var de=O(),Se=L.S;if(Se!==null&&Se(Z,de),de!==null&&typeof de=="object"&&typeof de.then=="function"){var Te=oZ(de,v);mm(u,f,Te,Bi(u))}else mm(u,f,v,Bi(u))}catch(Re){mm(u,f,{then:function(){},status:"rejected",reason:Re},Bi())}finally{$.p=C,F!==null&&Z.types!==null&&(F.types=Z.types),L.T=F}}function fZ(){}function v2(u,f,p,v){if(u.tag!==5)throw Error(r(476));var O=v8(u).queue;x8(u,O,f,K,p===null?fZ:function(){return y8(u),p(v)})}function v8(u){var f=u.memoizedState;if(f!==null)return f;f={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ul,lastRenderedState:K},next:null};var p={};return f.next={memoizedState:p,baseState:p,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ul,lastRenderedState:p},next:null},u.memoizedState=f,u=u.alternate,u!==null&&(u.memoizedState=f),f}function y8(u){var f=v8(u);f.next===null&&(f=u.alternate.memoizedState),mm(u,f.next.queue,{},Bi())}function y2(){return Ts(Am)}function b8(){return Vr().memoizedState}function w8(){return Vr().memoizedState}function mZ(u){for(var f=u.return;f!==null;){switch(f.tag){case 24:case 3:var p=Bi();u=dc(p);var v=hc(f,u,p);v!==null&&(mi(v,f,p),cm(v,f,p)),f={cache:Gw()},u.payload=f;return}f=f.return}}function pZ(u,f,p){var v=Bi();p={lane:v,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},xx(u)?k8(f,p):(p=Iw(u,f,p,v),p!==null&&(mi(p,u,v),O8(p,f,v)))}function S8(u,f,p){var v=Bi();mm(u,f,p,v)}function mm(u,f,p,v){var O={lane:v,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null};if(xx(u))k8(f,O);else{var C=u.alternate;if(u.lanes===0&&(C===null||C.lanes===0)&&(C=f.lastRenderedReducer,C!==null))try{var F=f.lastRenderedState,Z=C(F,p);if(O.hasEagerState=!0,O.eagerState=Z,Ri(Z,F))return Kg(u,f,O,0),or===null&&Yg(),!1}catch{}finally{}if(p=Iw(u,f,O,v),p!==null)return mi(p,u,v),O8(p,f,v),!0}return!1}function b2(u,f,p,v){if(v={lane:2,revertLane:Z2(),gesture:null,action:v,hasEagerState:!1,eagerState:null,next:null},xx(u)){if(f)throw Error(r(479))}else f=Iw(u,p,v,2),f!==null&&mi(f,u,2)}function xx(u){var f=u.alternate;return u===Kt||f!==null&&f===Kt}function k8(u,f){Ud=ux=!0;var p=u.pending;p===null?f.next=f:(f.next=p.next,p.next=f),u.pending=f}function O8(u,f,p){if((p&4194048)!==0){var v=f.lanes;v&=u.pendingLanes,p|=v,f.lanes=p,vs(u,p)}}var pm={readContext:Ts,use:fx,useCallback:Br,useContext:Br,useEffect:Br,useImperativeHandle:Br,useLayoutEffect:Br,useInsertionEffect:Br,useMemo:Br,useReducer:Br,useRef:Br,useState:Br,useDebugValue:Br,useDeferredValue:Br,useTransition:Br,useSyncExternalStore:Br,useId:Br,useHostTransitionStatus:Br,useFormState:Br,useActionState:Br,useOptimistic:Br,useMemoCache:Br,useCacheRefresh:Br};pm.useEffectEvent=Br;var j8={readContext:Ts,use:fx,useCallback:function(u,f){return Ks().memoizedState=[u,f===void 0?null:f],u},useContext:Ts,useEffect:l8,useImperativeHandle:function(u,f,p){p=p!=null?p.concat([u]):null,px(4194308,4,h8.bind(null,f,u),p)},useLayoutEffect:function(u,f){return px(4194308,4,u,f)},useInsertionEffect:function(u,f){px(4,2,u,f)},useMemo:function(u,f){var p=Ks();f=f===void 0?null:f;var v=u();if(Au){dn(!0);try{u()}finally{dn(!1)}}return p.memoizedState=[v,f],v},useReducer:function(u,f,p){var v=Ks();if(p!==void 0){var O=p(f);if(Au){dn(!0);try{p(f)}finally{dn(!1)}}}else O=f;return v.memoizedState=v.baseState=O,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:u,lastRenderedState:O},v.queue=u,u=u.dispatch=pZ.bind(null,Kt,u),[v.memoizedState,u]},useRef:function(u){var f=Ks();return u={current:u},f.memoizedState=u},useState:function(u){u=f2(u);var f=u.queue,p=S8.bind(null,Kt,f);return f.dispatch=p,[u.memoizedState,p]},useDebugValue:g2,useDeferredValue:function(u,f){var p=Ks();return x2(p,u,f)},useTransition:function(){var u=f2(!1);return u=x8.bind(null,Kt,u.queue,!0,!1),Ks().memoizedState=u,[!1,u]},useSyncExternalStore:function(u,f,p){var v=Kt,O=Ks();if(On){if(p===void 0)throw Error(r(407));p=p()}else{if(p=f(),or===null)throw Error(r(349));(yn&127)!==0||UC(v,f,p)}O.memoizedState=p;var C={value:p,getSnapshot:f};return O.queue=C,l8(GC.bind(null,v,C,u),[u]),v.flags|=2048,Gd(9,{destroy:void 0},WC.bind(null,v,C,p,f),null),p},useId:function(){var u=Ks(),f=or.identifierPrefix;if(On){var p=co,v=lo;p=(v&~(1<<32-Pt(v)-1)).toString(32)+p,f="_"+f+"R_"+p,p=dx++,0<p&&(f+="H"+p.toString(32)),f+="_"}else p=lZ++,f="_"+f+"r_"+p.toString(32)+"_";return u.memoizedState=f},useHostTransitionStatus:y2,useFormState:r8,useActionState:r8,useOptimistic:function(u){var f=Ks();f.memoizedState=f.baseState=u;var p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return f.queue=p,f=b2.bind(null,Kt,!0,p),p.dispatch=f,[u,f]},useMemoCache:u2,useCacheRefresh:function(){return Ks().memoizedState=mZ.bind(null,Kt)},useEffectEvent:function(u){var f=Ks(),p={impl:u};return f.memoizedState=p,function(){if((Gn&2)!==0)throw Error(r(440));return p.impl.apply(void 0,arguments)}}},w2={readContext:Ts,use:fx,useCallback:m8,useContext:Ts,useEffect:p2,useImperativeHandle:f8,useInsertionEffect:u8,useLayoutEffect:d8,useMemo:p8,useReducer:mx,useRef:o8,useState:function(){return mx(ul)},useDebugValue:g2,useDeferredValue:function(u,f){var p=Vr();return g8(p,tr.memoizedState,u,f)},useTransition:function(){var u=mx(ul)[0],f=Vr().memoizedState;return[typeof u=="boolean"?u:fm(u),f]},useSyncExternalStore:VC,useId:b8,useHostTransitionStatus:y2,useFormState:s8,useActionState:s8,useOptimistic:function(u,f){var p=Vr();return KC(p,tr,u,f)},useMemoCache:u2,useCacheRefresh:w8};w2.useEffectEvent=c8;var N8={readContext:Ts,use:fx,useCallback:m8,useContext:Ts,useEffect:p2,useImperativeHandle:f8,useInsertionEffect:u8,useLayoutEffect:d8,useMemo:p8,useReducer:h2,useRef:o8,useState:function(){return h2(ul)},useDebugValue:g2,useDeferredValue:function(u,f){var p=Vr();return tr===null?x2(p,u,f):g8(p,tr.memoizedState,u,f)},useTransition:function(){var u=h2(ul)[0],f=Vr().memoizedState;return[typeof u=="boolean"?u:fm(u),f]},useSyncExternalStore:VC,useId:b8,useHostTransitionStatus:y2,useFormState:a8,useActionState:a8,useOptimistic:function(u,f){var p=Vr();return tr!==null?KC(p,tr,u,f):(p.baseState=u,[u,p.queue.dispatch])},useMemoCache:u2,useCacheRefresh:w8};N8.useEffectEvent=c8;function S2(u,f,p,v){f=u.memoizedState,p=p(v,f),p=p==null?f:m({},f,p),u.memoizedState=p,u.lanes===0&&(u.updateQueue.baseState=p)}var k2={enqueueSetState:function(u,f,p){u=u._reactInternals;var v=Bi(),O=dc(v);O.payload=f,p!=null&&(O.callback=p),f=hc(u,O,v),f!==null&&(mi(f,u,v),cm(f,u,v))},enqueueReplaceState:function(u,f,p){u=u._reactInternals;var v=Bi(),O=dc(v);O.tag=1,O.payload=f,p!=null&&(O.callback=p),f=hc(u,O,v),f!==null&&(mi(f,u,v),cm(f,u,v))},enqueueForceUpdate:function(u,f){u=u._reactInternals;var p=Bi(),v=dc(p);v.tag=2,f!=null&&(v.callback=f),f=hc(u,v,p),f!==null&&(mi(f,u,p),cm(f,u,p))}};function C8(u,f,p,v,O,C,F){return u=u.stateNode,typeof u.shouldComponentUpdate=="function"?u.shouldComponentUpdate(v,C,F):f.prototype&&f.prototype.isPureReactComponent?!tm(p,v)||!tm(O,C):!0}function T8(u,f,p,v){u=f.state,typeof f.componentWillReceiveProps=="function"&&f.componentWillReceiveProps(p,v),typeof f.UNSAFE_componentWillReceiveProps=="function"&&f.UNSAFE_componentWillReceiveProps(p,v),f.state!==u&&k2.enqueueReplaceState(f,f.state,null)}function Mu(u,f){var p=f;if("ref"in f){p={};for(var v in f)v!=="ref"&&(p[v]=f[v])}if(u=u.defaultProps){p===f&&(p=m({},p));for(var O in u)p[O]===void 0&&(p[O]=u[O])}return p}function E8(u){Xg(u)}function _8(u){console.error(u)}function A8(u){Xg(u)}function vx(u,f){try{var p=u.onUncaughtError;p(f.value,{componentStack:f.stack})}catch(v){setTimeout(function(){throw v})}}function M8(u,f,p){try{var v=u.onCaughtError;v(p.value,{componentStack:p.stack,errorBoundary:f.tag===1?f.stateNode:null})}catch(O){setTimeout(function(){throw O})}}function O2(u,f,p){return p=dc(p),p.tag=3,p.payload={element:null},p.callback=function(){vx(u,f)},p}function R8(u){return u=dc(u),u.tag=3,u}function D8(u,f,p,v){var O=p.type.getDerivedStateFromError;if(typeof O=="function"){var C=v.value;u.payload=function(){return O(C)},u.callback=function(){M8(f,p,v)}}var F=p.stateNode;F!==null&&typeof F.componentDidCatch=="function"&&(u.callback=function(){M8(f,p,v),typeof O!="function"&&(vc===null?vc=new Set([this]):vc.add(this));var Z=v.stack;this.componentDidCatch(v.value,{componentStack:Z!==null?Z:""})})}function gZ(u,f,p,v,O){if(p.flags|=32768,v!==null&&typeof v=="object"&&typeof v.then=="function"){if(f=p.alternate,f!==null&&Fd(f,p,O,!0),p=Pi.current,p!==null){switch(p.tag){case 31:case 13:return da===null?_x():p.alternate===null&&Fr===0&&(Fr=3),p.flags&=-257,p.flags|=65536,p.lanes=O,v===ix?p.flags|=16384:(f=p.updateQueue,f===null?p.updateQueue=new Set([v]):f.add(v),X2(u,v,O)),!1;case 22:return p.flags|=65536,v===ix?p.flags|=16384:(f=p.updateQueue,f===null?(f={transitions:null,markerInstances:null,retryQueue:new Set([v])},p.updateQueue=f):(p=f.retryQueue,p===null?f.retryQueue=new Set([v]):p.add(v)),X2(u,v,O)),!1}throw Error(r(435,p.tag))}return X2(u,v,O),_x(),!1}if(On)return f=Pi.current,f!==null?((f.flags&65536)===0&&(f.flags|=256),f.flags|=65536,f.lanes=O,v!==Hw&&(u=Error(r(422),{cause:v}),sm(oa(u,p)))):(v!==Hw&&(f=Error(r(423),{cause:v}),sm(oa(f,p))),u=u.current.alternate,u.flags|=65536,O&=-O,u.lanes|=O,v=oa(v,p),O=O2(u.stateNode,v,O),e2(u,O),Fr!==4&&(Fr=2)),!1;var C=Error(r(520),{cause:v});if(C=oa(C,p),km===null?km=[C]:km.push(C),Fr!==4&&(Fr=2),f===null)return!0;v=oa(v,p),p=f;do{switch(p.tag){case 3:return p.flags|=65536,u=O&-O,p.lanes|=u,u=O2(p.stateNode,v,u),e2(p,u),!1;case 1:if(f=p.type,C=p.stateNode,(p.flags&128)===0&&(typeof f.getDerivedStateFromError=="function"||C!==null&&typeof C.componentDidCatch=="function"&&(vc===null||!vc.has(C))))return p.flags|=65536,O&=-O,p.lanes|=O,O=R8(O),D8(O,u,p,v),e2(p,O),!1}p=p.return}while(p!==null);return!1}var j2=Error(r(461)),es=!1;function Es(u,f,p,v){f.child=u===null?LC(f,null,p,v):_u(f,u.child,p,v)}function P8(u,f,p,v,O){p=p.render;var C=f.ref;if("ref"in v){var F={};for(var Z in v)Z!=="ref"&&(F[Z]=v[Z])}else F=v;return Nu(f),v=a2(u,f,p,F,C,O),Z=o2(),u!==null&&!es?(l2(u,f,O),dl(u,f,O)):(On&&Z&&qw(f),f.flags|=1,Es(u,f,v,O),f.child)}function z8(u,f,p,v,O){if(u===null){var C=p.type;return typeof C=="function"&&!Lw(C)&&C.defaultProps===void 0&&p.compare===null?(f.tag=15,f.type=C,I8(u,f,C,v,O)):(u=Jg(p.type,null,v,f,f.mode,O),u.ref=f.ref,u.return=f,f.child=u)}if(C=u.child,!R2(u,O)){var F=C.memoizedProps;if(p=p.compare,p=p!==null?p:tm,p(F,v)&&u.ref===f.ref)return dl(u,f,O)}return f.flags|=1,u=il(C,v),u.ref=f.ref,u.return=f,f.child=u}function I8(u,f,p,v,O){if(u!==null){var C=u.memoizedProps;if(tm(C,v)&&u.ref===f.ref)if(es=!1,f.pendingProps=v=C,R2(u,O))(u.flags&131072)!==0&&(es=!0);else return f.lanes=u.lanes,dl(u,f,O)}return N2(u,f,p,v,O)}function L8(u,f,p,v){var O=v.children,C=u!==null?u.memoizedState:null;if(u===null&&f.stateNode===null&&(f.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),v.mode==="hidden"){if((f.flags&128)!==0){if(C=C!==null?C.baseLanes|p:p,u!==null){for(v=f.child=u.child,O=0;v!==null;)O=O|v.lanes|v.childLanes,v=v.sibling;v=O&~C}else v=0,f.child=null;return B8(u,f,C,p,v)}if((p&536870912)!==0)f.memoizedState={baseLanes:0,cachePool:null},u!==null&&rx(f,C!==null?C.cachePool:null),C!==null?qC(f,C):n2(),$C(f);else return v=f.lanes=536870912,B8(u,f,C!==null?C.baseLanes|p:p,p,v)}else C!==null?(rx(f,C.cachePool),qC(f,C),mc(),f.memoizedState=null):(u!==null&&rx(f,null),n2(),mc());return Es(u,f,O,p),f.child}function gm(u,f){return u!==null&&u.tag===22||f.stateNode!==null||(f.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),f.sibling}function B8(u,f,p,v,O){var C=Yw();return C=C===null?null:{parent:Zr._currentValue,pool:C},f.memoizedState={baseLanes:p,cachePool:C},u!==null&&rx(f,null),n2(),$C(f),u!==null&&Fd(u,f,v,!0),f.childLanes=O,null}function yx(u,f){return f=wx({mode:f.mode,children:f.children},u.mode),f.ref=u.ref,u.child=f,f.return=u,f}function F8(u,f,p){return _u(f,u.child,null,p),u=yx(f,f.pendingProps),u.flags|=2,zi(f),f.memoizedState=null,u}function xZ(u,f,p){var v=f.pendingProps,O=(f.flags&128)!==0;if(f.flags&=-129,u===null){if(On){if(v.mode==="hidden")return u=yx(f,v),f.lanes=536870912,gm(null,u);if(s2(f),(u=xr)?(u=ZT(u,ua),u=u!==null&&u.data==="&"?u:null,u!==null&&(f.memoizedState={dehydrated:u,treeContext:ac!==null?{id:lo,overflow:co}:null,retryLane:536870912,hydrationErrors:null},p=kC(u),p.return=f,f.child=p,Cs=f,xr=null)):u=null,u===null)throw lc(f);return f.lanes=536870912,null}return yx(f,v)}var C=u.memoizedState;if(C!==null){var F=C.dehydrated;if(s2(f),O)if(f.flags&256)f.flags&=-257,f=F8(u,f,p);else if(f.memoizedState!==null)f.child=u.child,f.flags|=128,f=null;else throw Error(r(558));else if(es||Fd(u,f,p,!1),O=(p&u.childLanes)!==0,es||O){if(v=or,v!==null&&(F=js(v,p),F!==0&&F!==C.retryLane))throw C.retryLane=F,Su(u,F),mi(v,u,F),j2;_x(),f=F8(u,f,p)}else u=C.treeContext,xr=ha(F.nextSibling),Cs=f,On=!0,oc=null,ua=!1,u!==null&&NC(f,u),f=yx(f,v),f.flags|=4096;return f}return u=il(u.child,{mode:v.mode,children:v.children}),u.ref=f.ref,f.child=u,u.return=f,u}function bx(u,f){var p=f.ref;if(p===null)u!==null&&u.ref!==null&&(f.flags|=4194816);else{if(typeof p!="function"&&typeof p!="object")throw Error(r(284));(u===null||u.ref!==p)&&(f.flags|=4194816)}}function N2(u,f,p,v,O){return Nu(f),p=a2(u,f,p,v,void 0,O),v=o2(),u!==null&&!es?(l2(u,f,O),dl(u,f,O)):(On&&v&&qw(f),f.flags|=1,Es(u,f,p,O),f.child)}function q8(u,f,p,v,O,C){return Nu(f),f.updateQueue=null,p=QC(f,v,p,O),HC(u),v=o2(),u!==null&&!es?(l2(u,f,C),dl(u,f,C)):(On&&v&&qw(f),f.flags|=1,Es(u,f,p,C),f.child)}function $8(u,f,p,v,O){if(Nu(f),f.stateNode===null){var C=zd,F=p.contextType;typeof F=="object"&&F!==null&&(C=Ts(F)),C=new p(v,C),f.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,C.updater=k2,f.stateNode=C,C._reactInternals=f,C=f.stateNode,C.props=v,C.state=f.memoizedState,C.refs={},Zw(f),F=p.contextType,C.context=typeof F=="object"&&F!==null?Ts(F):zd,C.state=f.memoizedState,F=p.getDerivedStateFromProps,typeof F=="function"&&(S2(f,p,F,v),C.state=f.memoizedState),typeof p.getDerivedStateFromProps=="function"||typeof C.getSnapshotBeforeUpdate=="function"||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(F=C.state,typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount(),F!==C.state&&k2.enqueueReplaceState(C,C.state,null),dm(f,v,C,O),um(),C.state=f.memoizedState),typeof C.componentDidMount=="function"&&(f.flags|=4194308),v=!0}else if(u===null){C=f.stateNode;var Z=f.memoizedProps,de=Mu(p,Z);C.props=de;var Se=C.context,Te=p.contextType;F=zd,typeof Te=="object"&&Te!==null&&(F=Ts(Te));var Re=p.getDerivedStateFromProps;Te=typeof Re=="function"||typeof C.getSnapshotBeforeUpdate=="function",Z=f.pendingProps!==Z,Te||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(Z||Se!==F)&&T8(f,C,v,F),uc=!1;var ke=f.memoizedState;C.state=ke,dm(f,v,C,O),um(),Se=f.memoizedState,Z||ke!==Se||uc?(typeof Re=="function"&&(S2(f,p,Re,v),Se=f.memoizedState),(de=uc||C8(f,p,de,v,ke,Se,F))?(Te||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount()),typeof C.componentDidMount=="function"&&(f.flags|=4194308)):(typeof C.componentDidMount=="function"&&(f.flags|=4194308),f.memoizedProps=v,f.memoizedState=Se),C.props=v,C.state=Se,C.context=F,v=de):(typeof C.componentDidMount=="function"&&(f.flags|=4194308),v=!1)}else{C=f.stateNode,Jw(u,f),F=f.memoizedProps,Te=Mu(p,F),C.props=Te,Re=f.pendingProps,ke=C.context,Se=p.contextType,de=zd,typeof Se=="object"&&Se!==null&&(de=Ts(Se)),Z=p.getDerivedStateFromProps,(Se=typeof Z=="function"||typeof C.getSnapshotBeforeUpdate=="function")||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(F!==Re||ke!==de)&&T8(f,C,v,de),uc=!1,ke=f.memoizedState,C.state=ke,dm(f,v,C,O),um();var Ce=f.memoizedState;F!==Re||ke!==Ce||uc||u!==null&&u.dependencies!==null&&tx(u.dependencies)?(typeof Z=="function"&&(S2(f,p,Z,v),Ce=f.memoizedState),(Te=uc||C8(f,p,Te,v,ke,Ce,de)||u!==null&&u.dependencies!==null&&tx(u.dependencies))?(Se||typeof C.UNSAFE_componentWillUpdate!="function"&&typeof C.componentWillUpdate!="function"||(typeof C.componentWillUpdate=="function"&&C.componentWillUpdate(v,Ce,de),typeof C.UNSAFE_componentWillUpdate=="function"&&C.UNSAFE_componentWillUpdate(v,Ce,de)),typeof C.componentDidUpdate=="function"&&(f.flags|=4),typeof C.getSnapshotBeforeUpdate=="function"&&(f.flags|=1024)):(typeof C.componentDidUpdate!="function"||F===u.memoizedProps&&ke===u.memoizedState||(f.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||F===u.memoizedProps&&ke===u.memoizedState||(f.flags|=1024),f.memoizedProps=v,f.memoizedState=Ce),C.props=v,C.state=Ce,C.context=de,v=Te):(typeof C.componentDidUpdate!="function"||F===u.memoizedProps&&ke===u.memoizedState||(f.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||F===u.memoizedProps&&ke===u.memoizedState||(f.flags|=1024),v=!1)}return C=v,bx(u,f),v=(f.flags&128)!==0,C||v?(C=f.stateNode,p=v&&typeof p.getDerivedStateFromError!="function"?null:C.render(),f.flags|=1,u!==null&&v?(f.child=_u(f,u.child,null,O),f.child=_u(f,null,p,O)):Es(u,f,p,O),f.memoizedState=C.state,u=f.child):u=dl(u,f,O),u}function H8(u,f,p,v){return Ou(),f.flags|=256,Es(u,f,p,v),f.child}var C2={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function T2(u){return{baseLanes:u,cachePool:MC()}}function E2(u,f,p){return u=u!==null?u.childLanes&~p:0,f&&(u|=Li),u}function Q8(u,f,p){var v=f.pendingProps,O=!1,C=(f.flags&128)!==0,F;if((F=C)||(F=u!==null&&u.memoizedState===null?!1:(Qr.current&2)!==0),F&&(O=!0,f.flags&=-129),F=(f.flags&32)!==0,f.flags&=-33,u===null){if(On){if(O?fc(f):mc(),(u=xr)?(u=ZT(u,ua),u=u!==null&&u.data!=="&"?u:null,u!==null&&(f.memoizedState={dehydrated:u,treeContext:ac!==null?{id:lo,overflow:co}:null,retryLane:536870912,hydrationErrors:null},p=kC(u),p.return=f,f.child=p,Cs=f,xr=null)):u=null,u===null)throw lc(f);return d4(u)?f.lanes=32:f.lanes=536870912,null}var Z=v.children;return v=v.fallback,O?(mc(),O=f.mode,Z=wx({mode:"hidden",children:Z},O),v=ku(v,O,p,null),Z.return=f,v.return=f,Z.sibling=v,f.child=Z,v=f.child,v.memoizedState=T2(p),v.childLanes=E2(u,F,p),f.memoizedState=C2,gm(null,v)):(fc(f),_2(f,Z))}var de=u.memoizedState;if(de!==null&&(Z=de.dehydrated,Z!==null)){if(C)f.flags&256?(fc(f),f.flags&=-257,f=A2(u,f,p)):f.memoizedState!==null?(mc(),f.child=u.child,f.flags|=128,f=null):(mc(),Z=v.fallback,O=f.mode,v=wx({mode:"visible",children:v.children},O),Z=ku(Z,O,p,null),Z.flags|=2,v.return=f,Z.return=f,v.sibling=Z,f.child=v,_u(f,u.child,null,p),v=f.child,v.memoizedState=T2(p),v.childLanes=E2(u,F,p),f.memoizedState=C2,f=gm(null,v));else if(fc(f),d4(Z)){if(F=Z.nextSibling&&Z.nextSibling.dataset,F)var Se=F.dgst;F=Se,v=Error(r(419)),v.stack="",v.digest=F,sm({value:v,source:null,stack:null}),f=A2(u,f,p)}else if(es||Fd(u,f,p,!1),F=(p&u.childLanes)!==0,es||F){if(F=or,F!==null&&(v=js(F,p),v!==0&&v!==de.retryLane))throw de.retryLane=v,Su(u,v),mi(F,u,v),j2;u4(Z)||_x(),f=A2(u,f,p)}else u4(Z)?(f.flags|=192,f.child=u.child,f=null):(u=de.treeContext,xr=ha(Z.nextSibling),Cs=f,On=!0,oc=null,ua=!1,u!==null&&NC(f,u),f=_2(f,v.children),f.flags|=4096);return f}return O?(mc(),Z=v.fallback,O=f.mode,de=u.child,Se=de.sibling,v=il(de,{mode:"hidden",children:v.children}),v.subtreeFlags=de.subtreeFlags&65011712,Se!==null?Z=il(Se,Z):(Z=ku(Z,O,p,null),Z.flags|=2),Z.return=f,v.return=f,v.sibling=Z,f.child=v,gm(null,v),v=f.child,Z=u.child.memoizedState,Z===null?Z=T2(p):(O=Z.cachePool,O!==null?(de=Zr._currentValue,O=O.parent!==de?{parent:de,pool:de}:O):O=MC(),Z={baseLanes:Z.baseLanes|p,cachePool:O}),v.memoizedState=Z,v.childLanes=E2(u,F,p),f.memoizedState=C2,gm(u.child,v)):(fc(f),p=u.child,u=p.sibling,p=il(p,{mode:"visible",children:v.children}),p.return=f,p.sibling=null,u!==null&&(F=f.deletions,F===null?(f.deletions=[u],f.flags|=16):F.push(u)),f.child=p,f.memoizedState=null,p)}function _2(u,f){return f=wx({mode:"visible",children:f},u.mode),f.return=u,u.child=f}function wx(u,f){return u=Di(22,u,null,f),u.lanes=0,u}function A2(u,f,p){return _u(f,u.child,null,p),u=_2(f,f.pendingProps.children),u.flags|=2,f.memoizedState=null,u}function V8(u,f,p){u.lanes|=f;var v=u.alternate;v!==null&&(v.lanes|=f),Uw(u.return,f,p)}function M2(u,f,p,v,O,C){var F=u.memoizedState;F===null?u.memoizedState={isBackwards:f,rendering:null,renderingStartTime:0,last:v,tail:p,tailMode:O,treeForkCount:C}:(F.isBackwards=f,F.rendering=null,F.renderingStartTime=0,F.last=v,F.tail=p,F.tailMode=O,F.treeForkCount=C)}function U8(u,f,p){var v=f.pendingProps,O=v.revealOrder,C=v.tail;v=v.children;var F=Qr.current,Z=(F&2)!==0;if(Z?(F=F&1|2,f.flags|=128):F&=1,z(Qr,F),Es(u,f,v,p),v=On?rm:0,!Z&&u!==null&&(u.flags&128)!==0)e:for(u=f.child;u!==null;){if(u.tag===13)u.memoizedState!==null&&V8(u,p,f);else if(u.tag===19)V8(u,p,f);else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===f)break e;for(;u.sibling===null;){if(u.return===null||u.return===f)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}switch(O){case"forwards":for(p=f.child,O=null;p!==null;)u=p.alternate,u!==null&&cx(u)===null&&(O=p),p=p.sibling;p=O,p===null?(O=f.child,f.child=null):(O=p.sibling,p.sibling=null),M2(f,!1,O,p,C,v);break;case"backwards":case"unstable_legacy-backwards":for(p=null,O=f.child,f.child=null;O!==null;){if(u=O.alternate,u!==null&&cx(u)===null){f.child=O;break}u=O.sibling,O.sibling=p,p=O,O=u}M2(f,!0,p,null,C,v);break;case"together":M2(f,!1,null,null,void 0,v);break;default:f.memoizedState=null}return f.child}function dl(u,f,p){if(u!==null&&(f.dependencies=u.dependencies),xc|=f.lanes,(p&f.childLanes)===0)if(u!==null){if(Fd(u,f,p,!1),(p&f.childLanes)===0)return null}else return null;if(u!==null&&f.child!==u.child)throw Error(r(153));if(f.child!==null){for(u=f.child,p=il(u,u.pendingProps),f.child=p,p.return=f;u.sibling!==null;)u=u.sibling,p=p.sibling=il(u,u.pendingProps),p.return=f;p.sibling=null}return f.child}function R2(u,f){return(u.lanes&f)!==0?!0:(u=u.dependencies,!!(u!==null&&tx(u)))}function vZ(u,f,p){switch(f.tag){case 3:se(f,f.stateNode.containerInfo),cc(f,Zr,u.memoizedState.cache),Ou();break;case 27:case 5:ae(f);break;case 4:se(f,f.stateNode.containerInfo);break;case 10:cc(f,f.type,f.memoizedProps.value);break;case 31:if(f.memoizedState!==null)return f.flags|=128,s2(f),null;break;case 13:var v=f.memoizedState;if(v!==null)return v.dehydrated!==null?(fc(f),f.flags|=128,null):(p&f.child.childLanes)!==0?Q8(u,f,p):(fc(f),u=dl(u,f,p),u!==null?u.sibling:null);fc(f);break;case 19:var O=(u.flags&128)!==0;if(v=(p&f.childLanes)!==0,v||(Fd(u,f,p,!1),v=(p&f.childLanes)!==0),O){if(v)return U8(u,f,p);f.flags|=128}if(O=f.memoizedState,O!==null&&(O.rendering=null,O.tail=null,O.lastEffect=null),z(Qr,Qr.current),v)break;return null;case 22:return f.lanes=0,L8(u,f,p,f.pendingProps);case 24:cc(f,Zr,u.memoizedState.cache)}return dl(u,f,p)}function W8(u,f,p){if(u!==null)if(u.memoizedProps!==f.pendingProps)es=!0;else{if(!R2(u,p)&&(f.flags&128)===0)return es=!1,vZ(u,f,p);es=(u.flags&131072)!==0}else es=!1,On&&(f.flags&1048576)!==0&&jC(f,rm,f.index);switch(f.lanes=0,f.tag){case 16:e:{var v=f.pendingProps;if(u=Tu(f.elementType),f.type=u,typeof u=="function")Lw(u)?(v=Mu(u,v),f.tag=1,f=$8(null,f,u,v,p)):(f.tag=0,f=N2(null,f,u,v,p));else{if(u!=null){var O=u.$$typeof;if(O===T){f.tag=11,f=P8(null,f,u,v,p);break e}else if(O===A){f.tag=14,f=z8(null,f,u,v,p);break e}}throw f=I(u)||u,Error(r(306,f,""))}}return f;case 0:return N2(u,f,f.type,f.pendingProps,p);case 1:return v=f.type,O=Mu(v,f.pendingProps),$8(u,f,v,O,p);case 3:e:{if(se(f,f.stateNode.containerInfo),u===null)throw Error(r(387));v=f.pendingProps;var C=f.memoizedState;O=C.element,Jw(u,f),dm(f,v,null,p);var F=f.memoizedState;if(v=F.cache,cc(f,Zr,v),v!==C.cache&&Ww(f,[Zr],p,!0),um(),v=F.element,C.isDehydrated)if(C={element:v,isDehydrated:!1,cache:F.cache},f.updateQueue.baseState=C,f.memoizedState=C,f.flags&256){f=H8(u,f,v,p);break e}else if(v!==O){O=oa(Error(r(424)),f),sm(O),f=H8(u,f,v,p);break e}else{switch(u=f.stateNode.containerInfo,u.nodeType){case 9:u=u.body;break;default:u=u.nodeName==="HTML"?u.ownerDocument.body:u}for(xr=ha(u.firstChild),Cs=f,On=!0,oc=null,ua=!0,p=LC(f,null,v,p),f.child=p;p;)p.flags=p.flags&-3|4096,p=p.sibling}else{if(Ou(),v===O){f=dl(u,f,p);break e}Es(u,f,v,p)}f=f.child}return f;case 26:return bx(u,f),u===null?(p=s9(f.type,null,f.pendingProps,null))?f.memoizedState=p:On||(p=f.type,u=f.pendingProps,v=Ix(ne.current).createElement(p),v[Mr]=f,v[Rr]=u,_s(v,p,u),Kr(v),f.stateNode=v):f.memoizedState=s9(f.type,u.memoizedProps,f.pendingProps,u.memoizedState),null;case 27:return ae(f),u===null&&On&&(v=f.stateNode=t9(f.type,f.pendingProps,ne.current),Cs=f,ua=!0,O=xr,Sc(f.type)?(h4=O,xr=ha(v.firstChild)):xr=O),Es(u,f,f.pendingProps.children,p),bx(u,f),u===null&&(f.flags|=4194304),f.child;case 5:return u===null&&On&&((O=v=xr)&&(v=GZ(v,f.type,f.pendingProps,ua),v!==null?(f.stateNode=v,Cs=f,xr=ha(v.firstChild),ua=!1,O=!0):O=!1),O||lc(f)),ae(f),O=f.type,C=f.pendingProps,F=u!==null?u.memoizedProps:null,v=C.children,o4(O,C)?v=null:F!==null&&o4(O,F)&&(f.flags|=32),f.memoizedState!==null&&(O=a2(u,f,cZ,null,null,p),Am._currentValue=O),bx(u,f),Es(u,f,v,p),f.child;case 6:return u===null&&On&&((u=p=xr)&&(p=XZ(p,f.pendingProps,ua),p!==null?(f.stateNode=p,Cs=f,xr=null,u=!0):u=!1),u||lc(f)),null;case 13:return Q8(u,f,p);case 4:return se(f,f.stateNode.containerInfo),v=f.pendingProps,u===null?f.child=_u(f,null,v,p):Es(u,f,v,p),f.child;case 11:return P8(u,f,f.type,f.pendingProps,p);case 7:return Es(u,f,f.pendingProps,p),f.child;case 8:return Es(u,f,f.pendingProps.children,p),f.child;case 12:return Es(u,f,f.pendingProps.children,p),f.child;case 10:return v=f.pendingProps,cc(f,f.type,v.value),Es(u,f,v.children,p),f.child;case 9:return O=f.type._context,v=f.pendingProps.children,Nu(f),O=Ts(O),v=v(O),f.flags|=1,Es(u,f,v,p),f.child;case 14:return z8(u,f,f.type,f.pendingProps,p);case 15:return I8(u,f,f.type,f.pendingProps,p);case 19:return U8(u,f,p);case 31:return xZ(u,f,p);case 22:return L8(u,f,p,f.pendingProps);case 24:return Nu(f),v=Ts(Zr),u===null?(O=Yw(),O===null&&(O=or,C=Gw(),O.pooledCache=C,C.refCount++,C!==null&&(O.pooledCacheLanes|=p),O=C),f.memoizedState={parent:v,cache:O},Zw(f),cc(f,Zr,O)):((u.lanes&p)!==0&&(Jw(u,f),dm(f,null,null,p),um()),O=u.memoizedState,C=f.memoizedState,O.parent!==v?(O={parent:v,cache:v},f.memoizedState=O,f.lanes===0&&(f.memoizedState=f.updateQueue.baseState=O),cc(f,Zr,v)):(v=C.cache,cc(f,Zr,v),v!==O.cache&&Ww(f,[Zr],p,!0))),Es(u,f,f.pendingProps.children,p),f.child;case 29:throw f.pendingProps}throw Error(r(156,f.tag))}function hl(u){u.flags|=4}function D2(u,f,p,v,O){if((f=(u.mode&32)!==0)&&(f=!1),f){if(u.flags|=16777216,(O&335544128)===O)if(u.stateNode.complete)u.flags|=8192;else if(bT())u.flags|=8192;else throw Eu=ix,Kw}else u.flags&=-16777217}function G8(u,f){if(f.type!=="stylesheet"||(f.state.loading&4)!==0)u.flags&=-16777217;else if(u.flags|=16777216,!c9(f))if(bT())u.flags|=8192;else throw Eu=ix,Kw}function Sx(u,f){f!==null&&(u.flags|=4),u.flags&16384&&(f=u.tag!==22?vn():536870912,u.lanes|=f,Zd|=f)}function xm(u,f){if(!On)switch(u.tailMode){case"hidden":f=u.tail;for(var p=null;f!==null;)f.alternate!==null&&(p=f),f=f.sibling;p===null?u.tail=null:p.sibling=null;break;case"collapsed":p=u.tail;for(var v=null;p!==null;)p.alternate!==null&&(v=p),p=p.sibling;v===null?f||u.tail===null?u.tail=null:u.tail.sibling=null:v.sibling=null}}function vr(u){var f=u.alternate!==null&&u.alternate.child===u.child,p=0,v=0;if(f)for(var O=u.child;O!==null;)p|=O.lanes|O.childLanes,v|=O.subtreeFlags&65011712,v|=O.flags&65011712,O.return=u,O=O.sibling;else for(O=u.child;O!==null;)p|=O.lanes|O.childLanes,v|=O.subtreeFlags,v|=O.flags,O.return=u,O=O.sibling;return u.subtreeFlags|=v,u.childLanes=p,f}function yZ(u,f,p){var v=f.pendingProps;switch($w(f),f.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return vr(f),null;case 1:return vr(f),null;case 3:return p=f.stateNode,v=null,u!==null&&(v=u.memoizedState.cache),f.memoizedState.cache!==v&&(f.flags|=2048),ll(Zr),re(),p.pendingContext&&(p.context=p.pendingContext,p.pendingContext=null),(u===null||u.child===null)&&(Bd(f)?hl(f):u===null||u.memoizedState.isDehydrated&&(f.flags&256)===0||(f.flags|=1024,Qw())),vr(f),null;case 26:var O=f.type,C=f.memoizedState;return u===null?(hl(f),C!==null?(vr(f),G8(f,C)):(vr(f),D2(f,O,null,v,p))):C?C!==u.memoizedState?(hl(f),vr(f),G8(f,C)):(vr(f),f.flags&=-16777217):(u=u.memoizedProps,u!==v&&hl(f),vr(f),D2(f,O,u,v,p)),null;case 27:if(_e(f),p=ne.current,O=f.type,u!==null&&f.stateNode!=null)u.memoizedProps!==v&&hl(f);else{if(!v){if(f.stateNode===null)throw Error(r(166));return vr(f),null}u=U.current,Bd(f)?CC(f):(u=t9(O,v,p),f.stateNode=u,hl(f))}return vr(f),null;case 5:if(_e(f),O=f.type,u!==null&&f.stateNode!=null)u.memoizedProps!==v&&hl(f);else{if(!v){if(f.stateNode===null)throw Error(r(166));return vr(f),null}if(C=U.current,Bd(f))CC(f);else{var F=Ix(ne.current);switch(C){case 1:C=F.createElementNS("http://www.w3.org/2000/svg",O);break;case 2:C=F.createElementNS("http://www.w3.org/1998/Math/MathML",O);break;default:switch(O){case"svg":C=F.createElementNS("http://www.w3.org/2000/svg",O);break;case"math":C=F.createElementNS("http://www.w3.org/1998/Math/MathML",O);break;case"script":C=F.createElement("div"),C.innerHTML="<script><\/script>",C=C.removeChild(C.firstChild);break;case"select":C=typeof v.is=="string"?F.createElement("select",{is:v.is}):F.createElement("select"),v.multiple?C.multiple=!0:v.size&&(C.size=v.size);break;default:C=typeof v.is=="string"?F.createElement(O,{is:v.is}):F.createElement(O)}}C[Mr]=f,C[Rr]=v;e:for(F=f.child;F!==null;){if(F.tag===5||F.tag===6)C.appendChild(F.stateNode);else if(F.tag!==4&&F.tag!==27&&F.child!==null){F.child.return=F,F=F.child;continue}if(F===f)break e;for(;F.sibling===null;){if(F.return===null||F.return===f)break e;F=F.return}F.sibling.return=F.return,F=F.sibling}f.stateNode=C;e:switch(_s(C,O,v),O){case"button":case"input":case"select":case"textarea":v=!!v.autoFocus;break e;case"img":v=!0;break e;default:v=!1}v&&hl(f)}}return vr(f),D2(f,f.type,u===null?null:u.memoizedProps,f.pendingProps,p),null;case 6:if(u&&f.stateNode!=null)u.memoizedProps!==v&&hl(f);else{if(typeof v!="string"&&f.stateNode===null)throw Error(r(166));if(u=ne.current,Bd(f)){if(u=f.stateNode,p=f.memoizedProps,v=null,O=Cs,O!==null)switch(O.tag){case 27:case 5:v=O.memoizedProps}u[Mr]=f,u=!!(u.nodeValue===p||v!==null&&v.suppressHydrationWarning===!0||QT(u.nodeValue,p)),u||lc(f,!0)}else u=Ix(u).createTextNode(v),u[Mr]=f,f.stateNode=u}return vr(f),null;case 31:if(p=f.memoizedState,u===null||u.memoizedState!==null){if(v=Bd(f),p!==null){if(u===null){if(!v)throw Error(r(318));if(u=f.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(r(557));u[Mr]=f}else Ou(),(f.flags&128)===0&&(f.memoizedState=null),f.flags|=4;vr(f),u=!1}else p=Qw(),u!==null&&u.memoizedState!==null&&(u.memoizedState.hydrationErrors=p),u=!0;if(!u)return f.flags&256?(zi(f),f):(zi(f),null);if((f.flags&128)!==0)throw Error(r(558))}return vr(f),null;case 13:if(v=f.memoizedState,u===null||u.memoizedState!==null&&u.memoizedState.dehydrated!==null){if(O=Bd(f),v!==null&&v.dehydrated!==null){if(u===null){if(!O)throw Error(r(318));if(O=f.memoizedState,O=O!==null?O.dehydrated:null,!O)throw Error(r(317));O[Mr]=f}else Ou(),(f.flags&128)===0&&(f.memoizedState=null),f.flags|=4;vr(f),O=!1}else O=Qw(),u!==null&&u.memoizedState!==null&&(u.memoizedState.hydrationErrors=O),O=!0;if(!O)return f.flags&256?(zi(f),f):(zi(f),null)}return zi(f),(f.flags&128)!==0?(f.lanes=p,f):(p=v!==null,u=u!==null&&u.memoizedState!==null,p&&(v=f.child,O=null,v.alternate!==null&&v.alternate.memoizedState!==null&&v.alternate.memoizedState.cachePool!==null&&(O=v.alternate.memoizedState.cachePool.pool),C=null,v.memoizedState!==null&&v.memoizedState.cachePool!==null&&(C=v.memoizedState.cachePool.pool),C!==O&&(v.flags|=2048)),p!==u&&p&&(f.child.flags|=8192),Sx(f,f.updateQueue),vr(f),null);case 4:return re(),u===null&&n4(f.stateNode.containerInfo),vr(f),null;case 10:return ll(f.type),vr(f),null;case 19:if(X(Qr),v=f.memoizedState,v===null)return vr(f),null;if(O=(f.flags&128)!==0,C=v.rendering,C===null)if(O)xm(v,!1);else{if(Fr!==0||u!==null&&(u.flags&128)!==0)for(u=f.child;u!==null;){if(C=cx(u),C!==null){for(f.flags|=128,xm(v,!1),u=C.updateQueue,f.updateQueue=u,Sx(f,u),f.subtreeFlags=0,u=p,p=f.child;p!==null;)SC(p,u),p=p.sibling;return z(Qr,Qr.current&1|2),On&&al(f,v.treeForkCount),f.child}u=u.sibling}v.tail!==null&&Mt()>Cx&&(f.flags|=128,O=!0,xm(v,!1),f.lanes=4194304)}else{if(!O)if(u=cx(C),u!==null){if(f.flags|=128,O=!0,u=u.updateQueue,f.updateQueue=u,Sx(f,u),xm(v,!0),v.tail===null&&v.tailMode==="hidden"&&!C.alternate&&!On)return vr(f),null}else 2*Mt()-v.renderingStartTime>Cx&&p!==536870912&&(f.flags|=128,O=!0,xm(v,!1),f.lanes=4194304);v.isBackwards?(C.sibling=f.child,f.child=C):(u=v.last,u!==null?u.sibling=C:f.child=C,v.last=C)}return v.tail!==null?(u=v.tail,v.rendering=u,v.tail=u.sibling,v.renderingStartTime=Mt(),u.sibling=null,p=Qr.current,z(Qr,O?p&1|2:p&1),On&&al(f,v.treeForkCount),u):(vr(f),null);case 22:case 23:return zi(f),r2(),v=f.memoizedState!==null,u!==null?u.memoizedState!==null!==v&&(f.flags|=8192):v&&(f.flags|=8192),v?(p&536870912)!==0&&(f.flags&128)===0&&(vr(f),f.subtreeFlags&6&&(f.flags|=8192)):vr(f),p=f.updateQueue,p!==null&&Sx(f,p.retryQueue),p=null,u!==null&&u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(p=u.memoizedState.cachePool.pool),v=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(v=f.memoizedState.cachePool.pool),v!==p&&(f.flags|=2048),u!==null&&X(Cu),null;case 24:return p=null,u!==null&&(p=u.memoizedState.cache),f.memoizedState.cache!==p&&(f.flags|=2048),ll(Zr),vr(f),null;case 25:return null;case 30:return null}throw Error(r(156,f.tag))}function bZ(u,f){switch($w(f),f.tag){case 1:return u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 3:return ll(Zr),re(),u=f.flags,(u&65536)!==0&&(u&128)===0?(f.flags=u&-65537|128,f):null;case 26:case 27:case 5:return _e(f),null;case 31:if(f.memoizedState!==null){if(zi(f),f.alternate===null)throw Error(r(340));Ou()}return u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 13:if(zi(f),u=f.memoizedState,u!==null&&u.dehydrated!==null){if(f.alternate===null)throw Error(r(340));Ou()}return u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 19:return X(Qr),null;case 4:return re(),null;case 10:return ll(f.type),null;case 22:case 23:return zi(f),r2(),u!==null&&X(Cu),u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 24:return ll(Zr),null;case 25:return null;default:return null}}function X8(u,f){switch($w(f),f.tag){case 3:ll(Zr),re();break;case 26:case 27:case 5:_e(f);break;case 4:re();break;case 31:f.memoizedState!==null&&zi(f);break;case 13:zi(f);break;case 19:X(Qr);break;case 10:ll(f.type);break;case 22:case 23:zi(f),r2(),u!==null&&X(Cu);break;case 24:ll(Zr)}}function vm(u,f){try{var p=f.updateQueue,v=p!==null?p.lastEffect:null;if(v!==null){var O=v.next;p=O;do{if((p.tag&u)===u){v=void 0;var C=p.create,F=p.inst;v=C(),F.destroy=v}p=p.next}while(p!==O)}}catch(Z){Zn(f,f.return,Z)}}function pc(u,f,p){try{var v=f.updateQueue,O=v!==null?v.lastEffect:null;if(O!==null){var C=O.next;v=C;do{if((v.tag&u)===u){var F=v.inst,Z=F.destroy;if(Z!==void 0){F.destroy=void 0,O=f;var de=p,Se=Z;try{Se()}catch(Te){Zn(O,de,Te)}}}v=v.next}while(v!==C)}}catch(Te){Zn(f,f.return,Te)}}function Y8(u){var f=u.updateQueue;if(f!==null){var p=u.stateNode;try{FC(f,p)}catch(v){Zn(u,u.return,v)}}}function K8(u,f,p){p.props=Mu(u.type,u.memoizedProps),p.state=u.memoizedState;try{p.componentWillUnmount()}catch(v){Zn(u,f,v)}}function ym(u,f){try{var p=u.ref;if(p!==null){switch(u.tag){case 26:case 27:case 5:var v=u.stateNode;break;case 30:v=u.stateNode;break;default:v=u.stateNode}typeof p=="function"?u.refCleanup=p(v):p.current=v}}catch(O){Zn(u,f,O)}}function uo(u,f){var p=u.ref,v=u.refCleanup;if(p!==null)if(typeof v=="function")try{v()}catch(O){Zn(u,f,O)}finally{u.refCleanup=null,u=u.alternate,u!=null&&(u.refCleanup=null)}else if(typeof p=="function")try{p(null)}catch(O){Zn(u,f,O)}else p.current=null}function Z8(u){var f=u.type,p=u.memoizedProps,v=u.stateNode;try{e:switch(f){case"button":case"input":case"select":case"textarea":p.autoFocus&&v.focus();break e;case"img":p.src?v.src=p.src:p.srcSet&&(v.srcset=p.srcSet)}}catch(O){Zn(u,u.return,O)}}function P2(u,f,p){try{var v=u.stateNode;$Z(v,u.type,p,f),v[Rr]=f}catch(O){Zn(u,u.return,O)}}function J8(u){return u.tag===5||u.tag===3||u.tag===26||u.tag===27&&Sc(u.type)||u.tag===4}function z2(u){e:for(;;){for(;u.sibling===null;){if(u.return===null||J8(u.return))return null;u=u.return}for(u.sibling.return=u.return,u=u.sibling;u.tag!==5&&u.tag!==6&&u.tag!==18;){if(u.tag===27&&Sc(u.type)||u.flags&2||u.child===null||u.tag===4)continue e;u.child.return=u,u=u.child}if(!(u.flags&2))return u.stateNode}}function I2(u,f,p){var v=u.tag;if(v===5||v===6)u=u.stateNode,f?(p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p).insertBefore(u,f):(f=p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p,f.appendChild(u),p=p._reactRootContainer,p!=null||f.onclick!==null||(f.onclick=rl));else if(v!==4&&(v===27&&Sc(u.type)&&(p=u.stateNode,f=null),u=u.child,u!==null))for(I2(u,f,p),u=u.sibling;u!==null;)I2(u,f,p),u=u.sibling}function kx(u,f,p){var v=u.tag;if(v===5||v===6)u=u.stateNode,f?p.insertBefore(u,f):p.appendChild(u);else if(v!==4&&(v===27&&Sc(u.type)&&(p=u.stateNode),u=u.child,u!==null))for(kx(u,f,p),u=u.sibling;u!==null;)kx(u,f,p),u=u.sibling}function eT(u){var f=u.stateNode,p=u.memoizedProps;try{for(var v=u.type,O=f.attributes;O.length;)f.removeAttributeNode(O[0]);_s(f,v,p),f[Mr]=u,f[Rr]=p}catch(C){Zn(u,u.return,C)}}var fl=!1,ts=!1,L2=!1,tT=typeof WeakSet=="function"?WeakSet:Set,ys=null;function wZ(u,f){if(u=u.containerInfo,i4=Qx,u=fC(u),Aw(u)){if("selectionStart"in u)var p={start:u.selectionStart,end:u.selectionEnd};else e:{p=(p=u.ownerDocument)&&p.defaultView||window;var v=p.getSelection&&p.getSelection();if(v&&v.rangeCount!==0){p=v.anchorNode;var O=v.anchorOffset,C=v.focusNode;v=v.focusOffset;try{p.nodeType,C.nodeType}catch{p=null;break e}var F=0,Z=-1,de=-1,Se=0,Te=0,Re=u,ke=null;t:for(;;){for(var Ce;Re!==p||O!==0&&Re.nodeType!==3||(Z=F+O),Re!==C||v!==0&&Re.nodeType!==3||(de=F+v),Re.nodeType===3&&(F+=Re.nodeValue.length),(Ce=Re.firstChild)!==null;)ke=Re,Re=Ce;for(;;){if(Re===u)break t;if(ke===p&&++Se===O&&(Z=F),ke===C&&++Te===v&&(de=F),(Ce=Re.nextSibling)!==null)break;Re=ke,ke=Re.parentNode}Re=Ce}p=Z===-1||de===-1?null:{start:Z,end:de}}else p=null}p=p||{start:0,end:0}}else p=null;for(a4={focusedElem:u,selectionRange:p},Qx=!1,ys=f;ys!==null;)if(f=ys,u=f.child,(f.subtreeFlags&1028)!==0&&u!==null)u.return=f,ys=u;else for(;ys!==null;){switch(f=ys,C=f.alternate,u=f.flags,f.tag){case 0:if((u&4)!==0&&(u=f.updateQueue,u=u!==null?u.events:null,u!==null))for(p=0;p<u.length;p++)O=u[p],O.ref.impl=O.nextImpl;break;case 11:case 15:break;case 1:if((u&1024)!==0&&C!==null){u=void 0,p=f,O=C.memoizedProps,C=C.memoizedState,v=p.stateNode;try{var ut=Mu(p.type,O);u=v.getSnapshotBeforeUpdate(ut,C),v.__reactInternalSnapshotBeforeUpdate=u}catch(Dt){Zn(p,p.return,Dt)}}break;case 3:if((u&1024)!==0){if(u=f.stateNode.containerInfo,p=u.nodeType,p===9)c4(u);else if(p===1)switch(u.nodeName){case"HEAD":case"HTML":case"BODY":c4(u);break;default:u.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((u&1024)!==0)throw Error(r(163))}if(u=f.sibling,u!==null){u.return=f.return,ys=u;break}ys=f.return}}function nT(u,f,p){var v=p.flags;switch(p.tag){case 0:case 11:case 15:pl(u,p),v&4&&vm(5,p);break;case 1:if(pl(u,p),v&4)if(u=p.stateNode,f===null)try{u.componentDidMount()}catch(F){Zn(p,p.return,F)}else{var O=Mu(p.type,f.memoizedProps);f=f.memoizedState;try{u.componentDidUpdate(O,f,u.__reactInternalSnapshotBeforeUpdate)}catch(F){Zn(p,p.return,F)}}v&64&&Y8(p),v&512&&ym(p,p.return);break;case 3:if(pl(u,p),v&64&&(u=p.updateQueue,u!==null)){if(f=null,p.child!==null)switch(p.child.tag){case 27:case 5:f=p.child.stateNode;break;case 1:f=p.child.stateNode}try{FC(u,f)}catch(F){Zn(p,p.return,F)}}break;case 27:f===null&&v&4&&eT(p);case 26:case 5:pl(u,p),f===null&&v&4&&Z8(p),v&512&&ym(p,p.return);break;case 12:pl(u,p);break;case 31:pl(u,p),v&4&&iT(u,p);break;case 13:pl(u,p),v&4&&aT(u,p),v&64&&(u=p.memoizedState,u!==null&&(u=u.dehydrated,u!==null&&(p=_Z.bind(null,p),YZ(u,p))));break;case 22:if(v=p.memoizedState!==null||fl,!v){f=f!==null&&f.memoizedState!==null||ts,O=fl;var C=ts;fl=v,(ts=f)&&!C?gl(u,p,(p.subtreeFlags&8772)!==0):pl(u,p),fl=O,ts=C}break;case 30:break;default:pl(u,p)}}function rT(u){var f=u.alternate;f!==null&&(u.alternate=null,rT(f)),u.child=null,u.deletions=null,u.sibling=null,u.tag===5&&(f=u.stateNode,f!==null&&Uf(f)),u.stateNode=null,u.return=null,u.dependencies=null,u.memoizedProps=null,u.memoizedState=null,u.pendingProps=null,u.stateNode=null,u.updateQueue=null}var Or=null,ui=!1;function ml(u,f,p){for(p=p.child;p!==null;)sT(u,f,p),p=p.sibling}function sT(u,f,p){if(ot&&typeof ot.onCommitFiberUnmount=="function")try{ot.onCommitFiberUnmount(We,p)}catch{}switch(p.tag){case 26:ts||uo(p,f),ml(u,f,p),p.memoizedState?p.memoizedState.count--:p.stateNode&&(p=p.stateNode,p.parentNode.removeChild(p));break;case 27:ts||uo(p,f);var v=Or,O=ui;Sc(p.type)&&(Or=p.stateNode,ui=!1),ml(u,f,p),Tm(p.stateNode),Or=v,ui=O;break;case 5:ts||uo(p,f);case 6:if(v=Or,O=ui,Or=null,ml(u,f,p),Or=v,ui=O,Or!==null)if(ui)try{(Or.nodeType===9?Or.body:Or.nodeName==="HTML"?Or.ownerDocument.body:Or).removeChild(p.stateNode)}catch(C){Zn(p,f,C)}else try{Or.removeChild(p.stateNode)}catch(C){Zn(p,f,C)}break;case 18:Or!==null&&(ui?(u=Or,YT(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,p.stateNode),ah(u)):YT(Or,p.stateNode));break;case 4:v=Or,O=ui,Or=p.stateNode.containerInfo,ui=!0,ml(u,f,p),Or=v,ui=O;break;case 0:case 11:case 14:case 15:pc(2,p,f),ts||pc(4,p,f),ml(u,f,p);break;case 1:ts||(uo(p,f),v=p.stateNode,typeof v.componentWillUnmount=="function"&&K8(p,f,v)),ml(u,f,p);break;case 21:ml(u,f,p);break;case 22:ts=(v=ts)||p.memoizedState!==null,ml(u,f,p),ts=v;break;default:ml(u,f,p)}}function iT(u,f){if(f.memoizedState===null&&(u=f.alternate,u!==null&&(u=u.memoizedState,u!==null))){u=u.dehydrated;try{ah(u)}catch(p){Zn(f,f.return,p)}}}function aT(u,f){if(f.memoizedState===null&&(u=f.alternate,u!==null&&(u=u.memoizedState,u!==null&&(u=u.dehydrated,u!==null))))try{ah(u)}catch(p){Zn(f,f.return,p)}}function SZ(u){switch(u.tag){case 31:case 13:case 19:var f=u.stateNode;return f===null&&(f=u.stateNode=new tT),f;case 22:return u=u.stateNode,f=u._retryCache,f===null&&(f=u._retryCache=new tT),f;default:throw Error(r(435,u.tag))}}function Ox(u,f){var p=SZ(u);f.forEach(function(v){if(!p.has(v)){p.add(v);var O=AZ.bind(null,u,v);v.then(O,O)}})}function di(u,f){var p=f.deletions;if(p!==null)for(var v=0;v<p.length;v++){var O=p[v],C=u,F=f,Z=F;e:for(;Z!==null;){switch(Z.tag){case 27:if(Sc(Z.type)){Or=Z.stateNode,ui=!1;break e}break;case 5:Or=Z.stateNode,ui=!1;break e;case 3:case 4:Or=Z.stateNode.containerInfo,ui=!0;break e}Z=Z.return}if(Or===null)throw Error(r(160));sT(C,F,O),Or=null,ui=!1,C=O.alternate,C!==null&&(C.return=null),O.return=null}if(f.subtreeFlags&13886)for(f=f.child;f!==null;)oT(f,u),f=f.sibling}var Ba=null;function oT(u,f){var p=u.alternate,v=u.flags;switch(u.tag){case 0:case 11:case 14:case 15:di(f,u),hi(u),v&4&&(pc(3,u,u.return),vm(3,u),pc(5,u,u.return));break;case 1:di(f,u),hi(u),v&512&&(ts||p===null||uo(p,p.return)),v&64&&fl&&(u=u.updateQueue,u!==null&&(v=u.callbacks,v!==null&&(p=u.shared.hiddenCallbacks,u.shared.hiddenCallbacks=p===null?v:p.concat(v))));break;case 26:var O=Ba;if(di(f,u),hi(u),v&512&&(ts||p===null||uo(p,p.return)),v&4){var C=p!==null?p.memoizedState:null;if(v=u.memoizedState,p===null)if(v===null)if(u.stateNode===null){e:{v=u.type,p=u.memoizedProps,O=O.ownerDocument||O;t:switch(v){case"title":C=O.getElementsByTagName("title")[0],(!C||C[xu]||C[Mr]||C.namespaceURI==="http://www.w3.org/2000/svg"||C.hasAttribute("itemprop"))&&(C=O.createElement(v),O.head.insertBefore(C,O.querySelector("head > title"))),_s(C,v,p),C[Mr]=u,Kr(C),v=C;break e;case"link":var F=o9("link","href",O).get(v+(p.href||""));if(F){for(var Z=0;Z<F.length;Z++)if(C=F[Z],C.getAttribute("href")===(p.href==null||p.href===""?null:p.href)&&C.getAttribute("rel")===(p.rel==null?null:p.rel)&&C.getAttribute("title")===(p.title==null?null:p.title)&&C.getAttribute("crossorigin")===(p.crossOrigin==null?null:p.crossOrigin)){F.splice(Z,1);break t}}C=O.createElement(v),_s(C,v,p),O.head.appendChild(C);break;case"meta":if(F=o9("meta","content",O).get(v+(p.content||""))){for(Z=0;Z<F.length;Z++)if(C=F[Z],C.getAttribute("content")===(p.content==null?null:""+p.content)&&C.getAttribute("name")===(p.name==null?null:p.name)&&C.getAttribute("property")===(p.property==null?null:p.property)&&C.getAttribute("http-equiv")===(p.httpEquiv==null?null:p.httpEquiv)&&C.getAttribute("charset")===(p.charSet==null?null:p.charSet)){F.splice(Z,1);break t}}C=O.createElement(v),_s(C,v,p),O.head.appendChild(C);break;default:throw Error(r(468,v))}C[Mr]=u,Kr(C),v=C}u.stateNode=v}else l9(O,u.type,u.stateNode);else u.stateNode=a9(O,v,u.memoizedProps);else C!==v?(C===null?p.stateNode!==null&&(p=p.stateNode,p.parentNode.removeChild(p)):C.count--,v===null?l9(O,u.type,u.stateNode):a9(O,v,u.memoizedProps)):v===null&&u.stateNode!==null&&P2(u,u.memoizedProps,p.memoizedProps)}break;case 27:di(f,u),hi(u),v&512&&(ts||p===null||uo(p,p.return)),p!==null&&v&4&&P2(u,u.memoizedProps,p.memoizedProps);break;case 5:if(di(f,u),hi(u),v&512&&(ts||p===null||uo(p,p.return)),u.flags&32){O=u.stateNode;try{Ed(O,"")}catch(ut){Zn(u,u.return,ut)}}v&4&&u.stateNode!=null&&(O=u.memoizedProps,P2(u,O,p!==null?p.memoizedProps:O)),v&1024&&(L2=!0);break;case 6:if(di(f,u),hi(u),v&4){if(u.stateNode===null)throw Error(r(162));v=u.memoizedProps,p=u.stateNode;try{p.nodeValue=v}catch(ut){Zn(u,u.return,ut)}}break;case 3:if(Fx=null,O=Ba,Ba=Lx(f.containerInfo),di(f,u),Ba=O,hi(u),v&4&&p!==null&&p.memoizedState.isDehydrated)try{ah(f.containerInfo)}catch(ut){Zn(u,u.return,ut)}L2&&(L2=!1,lT(u));break;case 4:v=Ba,Ba=Lx(u.stateNode.containerInfo),di(f,u),hi(u),Ba=v;break;case 12:di(f,u),hi(u);break;case 31:di(f,u),hi(u),v&4&&(v=u.updateQueue,v!==null&&(u.updateQueue=null,Ox(u,v)));break;case 13:di(f,u),hi(u),u.child.flags&8192&&u.memoizedState!==null!=(p!==null&&p.memoizedState!==null)&&(Nx=Mt()),v&4&&(v=u.updateQueue,v!==null&&(u.updateQueue=null,Ox(u,v)));break;case 22:O=u.memoizedState!==null;var de=p!==null&&p.memoizedState!==null,Se=fl,Te=ts;if(fl=Se||O,ts=Te||de,di(f,u),ts=Te,fl=Se,hi(u),v&8192)e:for(f=u.stateNode,f._visibility=O?f._visibility&-2:f._visibility|1,O&&(p===null||de||fl||ts||Ru(u)),p=null,f=u;;){if(f.tag===5||f.tag===26){if(p===null){de=p=f;try{if(C=de.stateNode,O)F=C.style,typeof F.setProperty=="function"?F.setProperty("display","none","important"):F.display="none";else{Z=de.stateNode;var Re=de.memoizedProps.style,ke=Re!=null&&Re.hasOwnProperty("display")?Re.display:null;Z.style.display=ke==null||typeof ke=="boolean"?"":(""+ke).trim()}}catch(ut){Zn(de,de.return,ut)}}}else if(f.tag===6){if(p===null){de=f;try{de.stateNode.nodeValue=O?"":de.memoizedProps}catch(ut){Zn(de,de.return,ut)}}}else if(f.tag===18){if(p===null){de=f;try{var Ce=de.stateNode;O?KT(Ce,!0):KT(de.stateNode,!1)}catch(ut){Zn(de,de.return,ut)}}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===u)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===u)break e;for(;f.sibling===null;){if(f.return===null||f.return===u)break e;p===f&&(p=null),f=f.return}p===f&&(p=null),f.sibling.return=f.return,f=f.sibling}v&4&&(v=u.updateQueue,v!==null&&(p=v.retryQueue,p!==null&&(v.retryQueue=null,Ox(u,p))));break;case 19:di(f,u),hi(u),v&4&&(v=u.updateQueue,v!==null&&(u.updateQueue=null,Ox(u,v)));break;case 30:break;case 21:break;default:di(f,u),hi(u)}}function hi(u){var f=u.flags;if(f&2){try{for(var p,v=u.return;v!==null;){if(J8(v)){p=v;break}v=v.return}if(p==null)throw Error(r(160));switch(p.tag){case 27:var O=p.stateNode,C=z2(u);kx(u,C,O);break;case 5:var F=p.stateNode;p.flags&32&&(Ed(F,""),p.flags&=-33);var Z=z2(u);kx(u,Z,F);break;case 3:case 4:var de=p.stateNode.containerInfo,Se=z2(u);I2(u,Se,de);break;default:throw Error(r(161))}}catch(Te){Zn(u,u.return,Te)}u.flags&=-3}f&4096&&(u.flags&=-4097)}function lT(u){if(u.subtreeFlags&1024)for(u=u.child;u!==null;){var f=u;lT(f),f.tag===5&&f.flags&1024&&f.stateNode.reset(),u=u.sibling}}function pl(u,f){if(f.subtreeFlags&8772)for(f=f.child;f!==null;)nT(u,f.alternate,f),f=f.sibling}function Ru(u){for(u=u.child;u!==null;){var f=u;switch(f.tag){case 0:case 11:case 14:case 15:pc(4,f,f.return),Ru(f);break;case 1:uo(f,f.return);var p=f.stateNode;typeof p.componentWillUnmount=="function"&&K8(f,f.return,p),Ru(f);break;case 27:Tm(f.stateNode);case 26:case 5:uo(f,f.return),Ru(f);break;case 22:f.memoizedState===null&&Ru(f);break;case 30:Ru(f);break;default:Ru(f)}u=u.sibling}}function gl(u,f,p){for(p=p&&(f.subtreeFlags&8772)!==0,f=f.child;f!==null;){var v=f.alternate,O=u,C=f,F=C.flags;switch(C.tag){case 0:case 11:case 15:gl(O,C,p),vm(4,C);break;case 1:if(gl(O,C,p),v=C,O=v.stateNode,typeof O.componentDidMount=="function")try{O.componentDidMount()}catch(Se){Zn(v,v.return,Se)}if(v=C,O=v.updateQueue,O!==null){var Z=v.stateNode;try{var de=O.shared.hiddenCallbacks;if(de!==null)for(O.shared.hiddenCallbacks=null,O=0;O<de.length;O++)BC(de[O],Z)}catch(Se){Zn(v,v.return,Se)}}p&&F&64&&Y8(C),ym(C,C.return);break;case 27:eT(C);case 26:case 5:gl(O,C,p),p&&v===null&&F&4&&Z8(C),ym(C,C.return);break;case 12:gl(O,C,p);break;case 31:gl(O,C,p),p&&F&4&&iT(O,C);break;case 13:gl(O,C,p),p&&F&4&&aT(O,C);break;case 22:C.memoizedState===null&&gl(O,C,p),ym(C,C.return);break;case 30:break;default:gl(O,C,p)}f=f.sibling}}function B2(u,f){var p=null;u!==null&&u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(p=u.memoizedState.cachePool.pool),u=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(u=f.memoizedState.cachePool.pool),u!==p&&(u!=null&&u.refCount++,p!=null&&im(p))}function F2(u,f){u=null,f.alternate!==null&&(u=f.alternate.memoizedState.cache),f=f.memoizedState.cache,f!==u&&(f.refCount++,u!=null&&im(u))}function Fa(u,f,p,v){if(f.subtreeFlags&10256)for(f=f.child;f!==null;)cT(u,f,p,v),f=f.sibling}function cT(u,f,p,v){var O=f.flags;switch(f.tag){case 0:case 11:case 15:Fa(u,f,p,v),O&2048&&vm(9,f);break;case 1:Fa(u,f,p,v);break;case 3:Fa(u,f,p,v),O&2048&&(u=null,f.alternate!==null&&(u=f.alternate.memoizedState.cache),f=f.memoizedState.cache,f!==u&&(f.refCount++,u!=null&&im(u)));break;case 12:if(O&2048){Fa(u,f,p,v),u=f.stateNode;try{var C=f.memoizedProps,F=C.id,Z=C.onPostCommit;typeof Z=="function"&&Z(F,f.alternate===null?"mount":"update",u.passiveEffectDuration,-0)}catch(de){Zn(f,f.return,de)}}else Fa(u,f,p,v);break;case 31:Fa(u,f,p,v);break;case 13:Fa(u,f,p,v);break;case 23:break;case 22:C=f.stateNode,F=f.alternate,f.memoizedState!==null?C._visibility&2?Fa(u,f,p,v):bm(u,f):C._visibility&2?Fa(u,f,p,v):(C._visibility|=2,Xd(u,f,p,v,(f.subtreeFlags&10256)!==0||!1)),O&2048&&B2(F,f);break;case 24:Fa(u,f,p,v),O&2048&&F2(f.alternate,f);break;default:Fa(u,f,p,v)}}function Xd(u,f,p,v,O){for(O=O&&((f.subtreeFlags&10256)!==0||!1),f=f.child;f!==null;){var C=u,F=f,Z=p,de=v,Se=F.flags;switch(F.tag){case 0:case 11:case 15:Xd(C,F,Z,de,O),vm(8,F);break;case 23:break;case 22:var Te=F.stateNode;F.memoizedState!==null?Te._visibility&2?Xd(C,F,Z,de,O):bm(C,F):(Te._visibility|=2,Xd(C,F,Z,de,O)),O&&Se&2048&&B2(F.alternate,F);break;case 24:Xd(C,F,Z,de,O),O&&Se&2048&&F2(F.alternate,F);break;default:Xd(C,F,Z,de,O)}f=f.sibling}}function bm(u,f){if(f.subtreeFlags&10256)for(f=f.child;f!==null;){var p=u,v=f,O=v.flags;switch(v.tag){case 22:bm(p,v),O&2048&&B2(v.alternate,v);break;case 24:bm(p,v),O&2048&&F2(v.alternate,v);break;default:bm(p,v)}f=f.sibling}}var wm=8192;function Yd(u,f,p){if(u.subtreeFlags&wm)for(u=u.child;u!==null;)uT(u,f,p),u=u.sibling}function uT(u,f,p){switch(u.tag){case 26:Yd(u,f,p),u.flags&wm&&u.memoizedState!==null&&lJ(p,Ba,u.memoizedState,u.memoizedProps);break;case 5:Yd(u,f,p);break;case 3:case 4:var v=Ba;Ba=Lx(u.stateNode.containerInfo),Yd(u,f,p),Ba=v;break;case 22:u.memoizedState===null&&(v=u.alternate,v!==null&&v.memoizedState!==null?(v=wm,wm=16777216,Yd(u,f,p),wm=v):Yd(u,f,p));break;default:Yd(u,f,p)}}function dT(u){var f=u.alternate;if(f!==null&&(u=f.child,u!==null)){f.child=null;do f=u.sibling,u.sibling=null,u=f;while(u!==null)}}function Sm(u){var f=u.deletions;if((u.flags&16)!==0){if(f!==null)for(var p=0;p<f.length;p++){var v=f[p];ys=v,fT(v,u)}dT(u)}if(u.subtreeFlags&10256)for(u=u.child;u!==null;)hT(u),u=u.sibling}function hT(u){switch(u.tag){case 0:case 11:case 15:Sm(u),u.flags&2048&&pc(9,u,u.return);break;case 3:Sm(u);break;case 12:Sm(u);break;case 22:var f=u.stateNode;u.memoizedState!==null&&f._visibility&2&&(u.return===null||u.return.tag!==13)?(f._visibility&=-3,jx(u)):Sm(u);break;default:Sm(u)}}function jx(u){var f=u.deletions;if((u.flags&16)!==0){if(f!==null)for(var p=0;p<f.length;p++){var v=f[p];ys=v,fT(v,u)}dT(u)}for(u=u.child;u!==null;){switch(f=u,f.tag){case 0:case 11:case 15:pc(8,f,f.return),jx(f);break;case 22:p=f.stateNode,p._visibility&2&&(p._visibility&=-3,jx(f));break;default:jx(f)}u=u.sibling}}function fT(u,f){for(;ys!==null;){var p=ys;switch(p.tag){case 0:case 11:case 15:pc(8,p,f);break;case 23:case 22:if(p.memoizedState!==null&&p.memoizedState.cachePool!==null){var v=p.memoizedState.cachePool.pool;v!=null&&v.refCount++}break;case 24:im(p.memoizedState.cache)}if(v=p.child,v!==null)v.return=p,ys=v;else e:for(p=u;ys!==null;){v=ys;var O=v.sibling,C=v.return;if(rT(v),v===p){ys=null;break e}if(O!==null){O.return=C,ys=O;break e}ys=C}}}var kZ={getCacheForType:function(u){var f=Ts(Zr),p=f.data.get(u);return p===void 0&&(p=u(),f.data.set(u,p)),p},cacheSignal:function(){return Ts(Zr).controller.signal}},OZ=typeof WeakMap=="function"?WeakMap:Map,Gn=0,or=null,hn=null,yn=0,Kn=0,Ii=null,gc=!1,Kd=!1,q2=!1,xl=0,Fr=0,xc=0,Du=0,$2=0,Li=0,Zd=0,km=null,fi=null,H2=!1,Nx=0,mT=0,Cx=1/0,Tx=null,vc=null,ls=0,yc=null,Jd=null,vl=0,Q2=0,V2=null,pT=null,Om=0,U2=null;function Bi(){return(Gn&2)!==0&&yn!==0?yn&-yn:L.T!==null?Z2():Et()}function gT(){if(Li===0)if((yn&536870912)===0||On){var u=Wt;Wt<<=1,(Wt&3932160)===0&&(Wt=262144),Li=u}else Li=536870912;return u=Pi.current,u!==null&&(u.flags|=32),Li}function mi(u,f,p){(u===or&&(Kn===2||Kn===9)||u.cancelPendingCommit!==null)&&(eh(u,0),bc(u,yn,Li,!1)),fr(u,p),((Gn&2)===0||u!==or)&&(u===or&&((Gn&2)===0&&(Du|=p),Fr===4&&bc(u,yn,Li,!1)),ho(u))}function xT(u,f,p){if((Gn&6)!==0)throw Error(r(327));var v=!p&&(f&127)===0&&(f&u.expiredLanes)===0||He(u,f),O=v?CZ(u,f):G2(u,f,!0),C=v;do{if(O===0){Kd&&!v&&bc(u,f,0,!1);break}else{if(p=u.current.alternate,C&&!jZ(p)){O=G2(u,f,!1),C=!1;continue}if(O===2){if(C=f,u.errorRecoveryDisabledLanes&C)var F=0;else F=u.pendingLanes&-536870913,F=F!==0?F:F&536870912?536870912:0;if(F!==0){f=F;e:{var Z=u;O=km;var de=Z.current.memoizedState.isDehydrated;if(de&&(eh(Z,F).flags|=256),F=G2(Z,F,!1),F!==2){if(q2&&!de){Z.errorRecoveryDisabledLanes|=C,Du|=C,O=4;break e}C=fi,fi=O,C!==null&&(fi===null?fi=C:fi.push.apply(fi,C))}O=F}if(C=!1,O!==2)continue}}if(O===1){eh(u,0),bc(u,f,0,!0);break}e:{switch(v=u,C=O,C){case 0:case 1:throw Error(r(345));case 4:if((f&4194048)!==f)break;case 6:bc(v,f,Li,!gc);break e;case 2:fi=null;break;case 3:case 5:break;default:throw Error(r(329))}if((f&62914560)===f&&(O=Nx+300-Mt(),10<O)){if(bc(v,f,Li,!gc),ve(v,0,!0)!==0)break e;vl=f,v.timeoutHandle=GT(vT.bind(null,v,p,fi,Tx,H2,f,Li,Du,Zd,gc,C,"Throttled",-0,0),O);break e}vT(v,p,fi,Tx,H2,f,Li,Du,Zd,gc,C,null,-0,0)}}break}while(!0);ho(u)}function vT(u,f,p,v,O,C,F,Z,de,Se,Te,Re,ke,Ce){if(u.timeoutHandle=-1,Re=f.subtreeFlags,Re&8192||(Re&16785408)===16785408){Re={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:rl},uT(f,C,Re);var ut=(C&62914560)===C?Nx-Mt():(C&4194048)===C?mT-Mt():0;if(ut=cJ(Re,ut),ut!==null){vl=C,u.cancelPendingCommit=ut(NT.bind(null,u,f,C,p,v,O,F,Z,de,Te,Re,null,ke,Ce)),bc(u,C,F,!Se);return}}NT(u,f,C,p,v,O,F,Z,de)}function jZ(u){for(var f=u;;){var p=f.tag;if((p===0||p===11||p===15)&&f.flags&16384&&(p=f.updateQueue,p!==null&&(p=p.stores,p!==null)))for(var v=0;v<p.length;v++){var O=p[v],C=O.getSnapshot;O=O.value;try{if(!Ri(C(),O))return!1}catch{return!1}}if(p=f.child,f.subtreeFlags&16384&&p!==null)p.return=f,f=p;else{if(f===u)break;for(;f.sibling===null;){if(f.return===null||f.return===u)return!0;f=f.return}f.sibling.return=f.return,f=f.sibling}}return!0}function bc(u,f,p,v){f&=~$2,f&=~Du,u.suspendedLanes|=f,u.pingedLanes&=~f,v&&(u.warmLanes|=f),v=u.expirationTimes;for(var O=f;0<O;){var C=31-Pt(O),F=1<<C;v[C]=-1,O&=~F}p!==0&&xs(u,p,f)}function Ex(){return(Gn&6)===0?(jm(0),!1):!0}function W2(){if(hn!==null){if(Kn===0)var u=hn.return;else u=hn,ol=ju=null,c2(u),Qd=null,om=0,u=hn;for(;u!==null;)X8(u.alternate,u),u=u.return;hn=null}}function eh(u,f){var p=u.timeoutHandle;p!==-1&&(u.timeoutHandle=-1,VZ(p)),p=u.cancelPendingCommit,p!==null&&(u.cancelPendingCommit=null,p()),vl=0,W2(),or=u,hn=p=il(u.current,null),yn=f,Kn=0,Ii=null,gc=!1,Kd=He(u,f),q2=!1,Zd=Li=$2=Du=xc=Fr=0,fi=km=null,H2=!1,(f&8)!==0&&(f|=f&32);var v=u.entangledLanes;if(v!==0)for(u=u.entanglements,v&=f;0<v;){var O=31-Pt(v),C=1<<O;f|=u[O],v&=~C}return xl=f,Yg(),p}function yT(u,f){Kt=null,L.H=pm,f===Hd||f===sx?(f=PC(),Kn=3):f===Kw?(f=PC(),Kn=4):Kn=f===j2?8:f!==null&&typeof f=="object"&&typeof f.then=="function"?6:1,Ii=f,hn===null&&(Fr=1,vx(u,oa(f,u.current)))}function bT(){var u=Pi.current;return u===null?!0:(yn&4194048)===yn?da===null:(yn&62914560)===yn||(yn&536870912)!==0?u===da:!1}function wT(){var u=L.H;return L.H=pm,u===null?pm:u}function ST(){var u=L.A;return L.A=kZ,u}function _x(){Fr=4,gc||(yn&4194048)!==yn&&Pi.current!==null||(Kd=!0),(xc&134217727)===0&&(Du&134217727)===0||or===null||bc(or,yn,Li,!1)}function G2(u,f,p){var v=Gn;Gn|=2;var O=wT(),C=ST();(or!==u||yn!==f)&&(Tx=null,eh(u,f)),f=!1;var F=Fr;e:do try{if(Kn!==0&&hn!==null){var Z=hn,de=Ii;switch(Kn){case 8:W2(),F=6;break e;case 3:case 2:case 9:case 6:Pi.current===null&&(f=!0);var Se=Kn;if(Kn=0,Ii=null,th(u,Z,de,Se),p&&Kd){F=0;break e}break;default:Se=Kn,Kn=0,Ii=null,th(u,Z,de,Se)}}NZ(),F=Fr;break}catch(Te){yT(u,Te)}while(!0);return f&&u.shellSuspendCounter++,ol=ju=null,Gn=v,L.H=O,L.A=C,hn===null&&(or=null,yn=0,Yg()),F}function NZ(){for(;hn!==null;)kT(hn)}function CZ(u,f){var p=Gn;Gn|=2;var v=wT(),O=ST();or!==u||yn!==f?(Tx=null,Cx=Mt()+500,eh(u,f)):Kd=He(u,f);e:do try{if(Kn!==0&&hn!==null){f=hn;var C=Ii;t:switch(Kn){case 1:Kn=0,Ii=null,th(u,f,C,1);break;case 2:case 9:if(RC(C)){Kn=0,Ii=null,OT(f);break}f=function(){Kn!==2&&Kn!==9||or!==u||(Kn=7),ho(u)},C.then(f,f);break e;case 3:Kn=7;break e;case 4:Kn=5;break e;case 7:RC(C)?(Kn=0,Ii=null,OT(f)):(Kn=0,Ii=null,th(u,f,C,7));break;case 5:var F=null;switch(hn.tag){case 26:F=hn.memoizedState;case 5:case 27:var Z=hn;if(F?c9(F):Z.stateNode.complete){Kn=0,Ii=null;var de=Z.sibling;if(de!==null)hn=de;else{var Se=Z.return;Se!==null?(hn=Se,Ax(Se)):hn=null}break t}}Kn=0,Ii=null,th(u,f,C,5);break;case 6:Kn=0,Ii=null,th(u,f,C,6);break;case 8:W2(),Fr=6;break e;default:throw Error(r(462))}}TZ();break}catch(Te){yT(u,Te)}while(!0);return ol=ju=null,L.H=v,L.A=O,Gn=p,hn!==null?0:(or=null,yn=0,Yg(),Fr)}function TZ(){for(;hn!==null&&!qt();)kT(hn)}function kT(u){var f=W8(u.alternate,u,xl);u.memoizedProps=u.pendingProps,f===null?Ax(u):hn=f}function OT(u){var f=u,p=f.alternate;switch(f.tag){case 15:case 0:f=q8(p,f,f.pendingProps,f.type,void 0,yn);break;case 11:f=q8(p,f,f.pendingProps,f.type.render,f.ref,yn);break;case 5:c2(f);default:X8(p,f),f=hn=SC(f,xl),f=W8(p,f,xl)}u.memoizedProps=u.pendingProps,f===null?Ax(u):hn=f}function th(u,f,p,v){ol=ju=null,c2(f),Qd=null,om=0;var O=f.return;try{if(gZ(u,O,f,p,yn)){Fr=1,vx(u,oa(p,u.current)),hn=null;return}}catch(C){if(O!==null)throw hn=O,C;Fr=1,vx(u,oa(p,u.current)),hn=null;return}f.flags&32768?(On||v===1?u=!0:Kd||(yn&536870912)!==0?u=!1:(gc=u=!0,(v===2||v===9||v===3||v===6)&&(v=Pi.current,v!==null&&v.tag===13&&(v.flags|=16384))),jT(f,u)):Ax(f)}function Ax(u){var f=u;do{if((f.flags&32768)!==0){jT(f,gc);return}u=f.return;var p=yZ(f.alternate,f,xl);if(p!==null){hn=p;return}if(f=f.sibling,f!==null){hn=f;return}hn=f=u}while(f!==null);Fr===0&&(Fr=5)}function jT(u,f){do{var p=bZ(u.alternate,u);if(p!==null){p.flags&=32767,hn=p;return}if(p=u.return,p!==null&&(p.flags|=32768,p.subtreeFlags=0,p.deletions=null),!f&&(u=u.sibling,u!==null)){hn=u;return}hn=u=p}while(u!==null);Fr=6,hn=null}function NT(u,f,p,v,O,C,F,Z,de){u.cancelPendingCommit=null;do Mx();while(ls!==0);if((Gn&6)!==0)throw Error(r(327));if(f!==null){if(f===u.current)throw Error(r(177));if(C=f.lanes|f.childLanes,C|=zw,ar(u,p,C,F,Z,de),u===or&&(hn=or=null,yn=0),Jd=f,yc=u,vl=p,Q2=C,V2=O,pT=v,(f.subtreeFlags&10256)!==0||(f.flags&10256)!==0?(u.callbackNode=null,u.callbackPriority=0,MZ(rt,function(){return AT(),null})):(u.callbackNode=null,u.callbackPriority=0),v=(f.flags&13878)!==0,(f.subtreeFlags&13878)!==0||v){v=L.T,L.T=null,O=$.p,$.p=2,F=Gn,Gn|=4;try{wZ(u,f,p)}finally{Gn=F,$.p=O,L.T=v}}ls=1,CT(),TT(),ET()}}function CT(){if(ls===1){ls=0;var u=yc,f=Jd,p=(f.flags&13878)!==0;if((f.subtreeFlags&13878)!==0||p){p=L.T,L.T=null;var v=$.p;$.p=2;var O=Gn;Gn|=4;try{oT(f,u);var C=a4,F=fC(u.containerInfo),Z=C.focusedElem,de=C.selectionRange;if(F!==Z&&Z&&Z.ownerDocument&&hC(Z.ownerDocument.documentElement,Z)){if(de!==null&&Aw(Z)){var Se=de.start,Te=de.end;if(Te===void 0&&(Te=Se),"selectionStart"in Z)Z.selectionStart=Se,Z.selectionEnd=Math.min(Te,Z.value.length);else{var Re=Z.ownerDocument||document,ke=Re&&Re.defaultView||window;if(ke.getSelection){var Ce=ke.getSelection(),ut=Z.textContent.length,Dt=Math.min(de.start,ut),rr=de.end===void 0?Dt:Math.min(de.end,ut);!Ce.extend&&Dt>rr&&(F=rr,rr=Dt,Dt=F);var pe=dC(Z,Dt),fe=dC(Z,rr);if(pe&&fe&&(Ce.rangeCount!==1||Ce.anchorNode!==pe.node||Ce.anchorOffset!==pe.offset||Ce.focusNode!==fe.node||Ce.focusOffset!==fe.offset)){var be=Re.createRange();be.setStart(pe.node,pe.offset),Ce.removeAllRanges(),Dt>rr?(Ce.addRange(be),Ce.extend(fe.node,fe.offset)):(be.setEnd(fe.node,fe.offset),Ce.addRange(be))}}}}for(Re=[],Ce=Z;Ce=Ce.parentNode;)Ce.nodeType===1&&Re.push({element:Ce,left:Ce.scrollLeft,top:Ce.scrollTop});for(typeof Z.focus=="function"&&Z.focus(),Z=0;Z<Re.length;Z++){var Ae=Re[Z];Ae.element.scrollLeft=Ae.left,Ae.element.scrollTop=Ae.top}}Qx=!!i4,a4=i4=null}finally{Gn=O,$.p=v,L.T=p}}u.current=f,ls=2}}function TT(){if(ls===2){ls=0;var u=yc,f=Jd,p=(f.flags&8772)!==0;if((f.subtreeFlags&8772)!==0||p){p=L.T,L.T=null;var v=$.p;$.p=2;var O=Gn;Gn|=4;try{nT(u,f.alternate,f)}finally{Gn=O,$.p=v,L.T=p}}ls=3}}function ET(){if(ls===4||ls===3){ls=0,un();var u=yc,f=Jd,p=vl,v=pT;(f.subtreeFlags&10256)!==0||(f.flags&10256)!==0?ls=5:(ls=0,Jd=yc=null,_T(u,u.pendingLanes));var O=u.pendingLanes;if(O===0&&(vc=null),Ie(p),f=f.stateNode,ot&&typeof ot.onCommitFiberRoot=="function")try{ot.onCommitFiberRoot(We,f,void 0,(f.current.flags&128)===128)}catch{}if(v!==null){f=L.T,O=$.p,$.p=2,L.T=null;try{for(var C=u.onRecoverableError,F=0;F<v.length;F++){var Z=v[F];C(Z.value,{componentStack:Z.stack})}}finally{L.T=f,$.p=O}}(vl&3)!==0&&Mx(),ho(u),O=u.pendingLanes,(p&261930)!==0&&(O&42)!==0?u===U2?Om++:(Om=0,U2=u):Om=0,jm(0)}}function _T(u,f){(u.pooledCacheLanes&=f)===0&&(f=u.pooledCache,f!=null&&(u.pooledCache=null,im(f)))}function Mx(){return CT(),TT(),ET(),AT()}function AT(){if(ls!==5)return!1;var u=yc,f=Q2;Q2=0;var p=Ie(vl),v=L.T,O=$.p;try{$.p=32>p?32:p,L.T=null,p=V2,V2=null;var C=yc,F=vl;if(ls=0,Jd=yc=null,vl=0,(Gn&6)!==0)throw Error(r(331));var Z=Gn;if(Gn|=4,hT(C.current),cT(C,C.current,F,p),Gn=Z,jm(0,!1),ot&&typeof ot.onPostCommitFiberRoot=="function")try{ot.onPostCommitFiberRoot(We,C)}catch{}return!0}finally{$.p=O,L.T=v,_T(u,f)}}function MT(u,f,p){f=oa(p,f),f=O2(u.stateNode,f,2),u=hc(u,f,2),u!==null&&(fr(u,2),ho(u))}function Zn(u,f,p){if(u.tag===3)MT(u,u,p);else for(;f!==null;){if(f.tag===3){MT(f,u,p);break}else if(f.tag===1){var v=f.stateNode;if(typeof f.type.getDerivedStateFromError=="function"||typeof v.componentDidCatch=="function"&&(vc===null||!vc.has(v))){u=oa(p,u),p=R8(2),v=hc(f,p,2),v!==null&&(D8(p,v,f,u),fr(v,2),ho(v));break}}f=f.return}}function X2(u,f,p){var v=u.pingCache;if(v===null){v=u.pingCache=new OZ;var O=new Set;v.set(f,O)}else O=v.get(f),O===void 0&&(O=new Set,v.set(f,O));O.has(p)||(q2=!0,O.add(p),u=EZ.bind(null,u,f,p),f.then(u,u))}function EZ(u,f,p){var v=u.pingCache;v!==null&&v.delete(f),u.pingedLanes|=u.suspendedLanes&p,u.warmLanes&=~p,or===u&&(yn&p)===p&&(Fr===4||Fr===3&&(yn&62914560)===yn&&300>Mt()-Nx?(Gn&2)===0&&eh(u,0):$2|=p,Zd===yn&&(Zd=0)),ho(u)}function RT(u,f){f===0&&(f=vn()),u=Su(u,f),u!==null&&(fr(u,f),ho(u))}function _Z(u){var f=u.memoizedState,p=0;f!==null&&(p=f.retryLane),RT(u,p)}function AZ(u,f){var p=0;switch(u.tag){case 31:case 13:var v=u.stateNode,O=u.memoizedState;O!==null&&(p=O.retryLane);break;case 19:v=u.stateNode;break;case 22:v=u.stateNode._retryCache;break;default:throw Error(r(314))}v!==null&&v.delete(f),RT(u,p)}function MZ(u,f){return vt(u,f)}var Rx=null,nh=null,Y2=!1,Dx=!1,K2=!1,wc=0;function ho(u){u!==nh&&u.next===null&&(nh===null?Rx=nh=u:nh=nh.next=u),Dx=!0,Y2||(Y2=!0,DZ())}function jm(u,f){if(!K2&&Dx){K2=!0;do for(var p=!1,v=Rx;v!==null;){if(u!==0){var O=v.pendingLanes;if(O===0)var C=0;else{var F=v.suspendedLanes,Z=v.pingedLanes;C=(1<<31-Pt(42|u)+1)-1,C&=O&~(F&~Z),C=C&201326741?C&201326741|1:C?C|2:0}C!==0&&(p=!0,IT(v,C))}else C=yn,C=ve(v,v===or?C:0,v.cancelPendingCommit!==null||v.timeoutHandle!==-1),(C&3)===0||He(v,C)||(p=!0,IT(v,C));v=v.next}while(p);K2=!1}}function RZ(){DT()}function DT(){Dx=Y2=!1;var u=0;wc!==0&&QZ()&&(u=wc);for(var f=Mt(),p=null,v=Rx;v!==null;){var O=v.next,C=PT(v,f);C===0?(v.next=null,p===null?Rx=O:p.next=O,O===null&&(nh=p)):(p=v,(u!==0||(C&3)!==0)&&(Dx=!0)),v=O}ls!==0&&ls!==5||jm(u),wc!==0&&(wc=0)}function PT(u,f){for(var p=u.suspendedLanes,v=u.pingedLanes,O=u.expirationTimes,C=u.pendingLanes&-62914561;0<C;){var F=31-Pt(C),Z=1<<F,de=O[F];de===-1?((Z&p)===0||(Z&v)!==0)&&(O[F]=ht(Z,f)):de<=f&&(u.expiredLanes|=Z),C&=~Z}if(f=or,p=yn,p=ve(u,u===f?p:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),v=u.callbackNode,p===0||u===f&&(Kn===2||Kn===9)||u.cancelPendingCommit!==null)return v!==null&&v!==null&&$n(v),u.callbackNode=null,u.callbackPriority=0;if((p&3)===0||He(u,p)){if(f=p&-p,f===u.callbackPriority)return f;switch(v!==null&&$n(v),Ie(p)){case 2:case 8:p=ze;break;case 32:p=rt;break;case 268435456:p=zt;break;default:p=rt}return v=zT.bind(null,u),p=vt(p,v),u.callbackPriority=f,u.callbackNode=p,f}return v!==null&&v!==null&&$n(v),u.callbackPriority=2,u.callbackNode=null,2}function zT(u,f){if(ls!==0&&ls!==5)return u.callbackNode=null,u.callbackPriority=0,null;var p=u.callbackNode;if(Mx()&&u.callbackNode!==p)return null;var v=yn;return v=ve(u,u===or?v:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),v===0?null:(xT(u,v,f),PT(u,Mt()),u.callbackNode!=null&&u.callbackNode===p?zT.bind(null,u):null)}function IT(u,f){if(Mx())return null;xT(u,f,!0)}function DZ(){UZ(function(){(Gn&6)!==0?vt(Ne,RZ):DT()})}function Z2(){if(wc===0){var u=qd;u===0&&(u=wt,wt<<=1,(wt&261888)===0&&(wt=256)),wc=u}return wc}function LT(u){return u==null||typeof u=="symbol"||typeof u=="boolean"?null:typeof u=="function"?u:$g(""+u)}function BT(u,f){var p=f.ownerDocument.createElement("input");return p.name=f.name,p.value=f.value,u.id&&p.setAttribute("form",u.id),f.parentNode.insertBefore(p,f),u=new FormData(u),p.parentNode.removeChild(p),u}function PZ(u,f,p,v,O){if(f==="submit"&&p&&p.stateNode===O){var C=LT((O[Rr]||null).action),F=v.submitter;F&&(f=(f=F[Rr]||null)?LT(f.formAction):F.getAttribute("formAction"),f!==null&&(C=f,F=null));var Z=new Ug("action","action",null,v,O);u.push({event:Z,listeners:[{instance:null,listener:function(){if(v.defaultPrevented){if(wc!==0){var de=F?BT(O,F):new FormData(O);v2(p,{pending:!0,data:de,method:O.method,action:C},null,de)}}else typeof C=="function"&&(Z.preventDefault(),de=F?BT(O,F):new FormData(O),v2(p,{pending:!0,data:de,method:O.method,action:C},C,de))},currentTarget:O}]})}}for(var J2=0;J2<Pw.length;J2++){var e4=Pw[J2],zZ=e4.toLowerCase(),IZ=e4[0].toUpperCase()+e4.slice(1);La(zZ,"on"+IZ)}La(gC,"onAnimationEnd"),La(xC,"onAnimationIteration"),La(vC,"onAnimationStart"),La("dblclick","onDoubleClick"),La("focusin","onFocus"),La("focusout","onBlur"),La(JK,"onTransitionRun"),La(eZ,"onTransitionStart"),La(tZ,"onTransitionCancel"),La(yC,"onTransitionEnd"),tl("onMouseEnter",["mouseout","mouseover"]),tl("onMouseLeave",["mouseout","mouseover"]),tl("onPointerEnter",["pointerout","pointerover"]),tl("onPointerLeave",["pointerout","pointerover"]),el("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),el("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),el("onBeforeInput",["compositionend","keypress","textInput","paste"]),el("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),el("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),el("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Nm="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(" "),LZ=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Nm));function FT(u,f){f=(f&4)!==0;for(var p=0;p<u.length;p++){var v=u[p],O=v.event;v=v.listeners;e:{var C=void 0;if(f)for(var F=v.length-1;0<=F;F--){var Z=v[F],de=Z.instance,Se=Z.currentTarget;if(Z=Z.listener,de!==C&&O.isPropagationStopped())break e;C=Z,O.currentTarget=Se;try{C(O)}catch(Te){Xg(Te)}O.currentTarget=null,C=de}else for(F=0;F<v.length;F++){if(Z=v[F],de=Z.instance,Se=Z.currentTarget,Z=Z.listener,de!==C&&O.isPropagationStopped())break e;C=Z,O.currentTarget=Se;try{C(O)}catch(Te){Xg(Te)}O.currentTarget=null,C=de}}}}function fn(u,f){var p=f[Vf];p===void 0&&(p=f[Vf]=new Set);var v=u+"__bubble";p.has(v)||(qT(f,u,2,!1),p.add(v))}function t4(u,f,p){var v=0;f&&(v|=4),qT(p,u,v,f)}var Px="_reactListening"+Math.random().toString(36).slice(2);function n4(u){if(!u[Px]){u[Px]=!0,Pg.forEach(function(p){p!=="selectionchange"&&(LZ.has(p)||t4(p,!1,u),t4(p,!0,u))});var f=u.nodeType===9?u:u.ownerDocument;f===null||f[Px]||(f[Px]=!0,t4("selectionchange",!1,f))}}function qT(u,f,p,v){switch(g9(f)){case 2:var O=hJ;break;case 8:O=fJ;break;default:O=x4}p=O.bind(null,f,p,u),O=void 0,!Sw||f!=="touchstart"&&f!=="touchmove"&&f!=="wheel"||(O=!0),v?O!==void 0?u.addEventListener(f,p,{capture:!0,passive:O}):u.addEventListener(f,p,!0):O!==void 0?u.addEventListener(f,p,{passive:O}):u.addEventListener(f,p,!1)}function r4(u,f,p,v,O){var C=v;if((f&1)===0&&(f&2)===0&&v!==null)e:for(;;){if(v===null)return;var F=v.tag;if(F===3||F===4){var Z=v.stateNode.containerInfo;if(Z===O)break;if(F===4)for(F=v.return;F!==null;){var de=F.tag;if((de===3||de===4)&&F.stateNode.containerInfo===O)return;F=F.return}for(;Z!==null;){if(F=rc(Z),F===null)return;if(de=F.tag,de===5||de===6||de===26||de===27){v=C=F;continue e}Z=Z.parentNode}}v=v.return}U7(function(){var Se=C,Te=bw(p),Re=[];e:{var ke=bC.get(u);if(ke!==void 0){var Ce=Ug,ut=u;switch(u){case"keypress":if(Qg(p)===0)break e;case"keydown":case"keyup":Ce=AK;break;case"focusin":ut="focus",Ce=Nw;break;case"focusout":ut="blur",Ce=Nw;break;case"beforeblur":case"afterblur":Ce=Nw;break;case"click":if(p.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Ce=X7;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ce=yK;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ce=DK;break;case gC:case xC:case vC:Ce=SK;break;case yC:Ce=zK;break;case"scroll":case"scrollend":Ce=xK;break;case"wheel":Ce=LK;break;case"copy":case"cut":case"paste":Ce=OK;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ce=K7;break;case"toggle":case"beforetoggle":Ce=FK}var Dt=(f&4)!==0,rr=!Dt&&(u==="scroll"||u==="scrollend"),pe=Dt?ke!==null?ke+"Capture":null:ke;Dt=[];for(var fe=Se,be;fe!==null;){var Ae=fe;if(be=Ae.stateNode,Ae=Ae.tag,Ae!==5&&Ae!==26&&Ae!==27||be===null||pe===null||(Ae=Gf(fe,pe),Ae!=null&&Dt.push(Cm(fe,Ae,be))),rr)break;fe=fe.return}0<Dt.length&&(ke=new Ce(ke,ut,null,p,Te),Re.push({event:ke,listeners:Dt}))}}if((f&7)===0){e:{if(ke=u==="mouseover"||u==="pointerover",Ce=u==="mouseout"||u==="pointerout",ke&&p!==yw&&(ut=p.relatedTarget||p.fromElement)&&(rc(ut)||ut[Ns]))break e;if((Ce||ke)&&(ke=Te.window===Te?Te:(ke=Te.ownerDocument)?ke.defaultView||ke.parentWindow:window,Ce?(ut=p.relatedTarget||p.toElement,Ce=Se,ut=ut?rc(ut):null,ut!==null&&(rr=i(ut),Dt=ut.tag,ut!==rr||Dt!==5&&Dt!==27&&Dt!==6)&&(ut=null)):(Ce=null,ut=Se),Ce!==ut)){if(Dt=X7,Ae="onMouseLeave",pe="onMouseEnter",fe="mouse",(u==="pointerout"||u==="pointerover")&&(Dt=K7,Ae="onPointerLeave",pe="onPointerEnter",fe="pointer"),rr=Ce==null?ke:vu(Ce),be=ut==null?ke:vu(ut),ke=new Dt(Ae,fe+"leave",Ce,p,Te),ke.target=rr,ke.relatedTarget=be,Ae=null,rc(Te)===Se&&(Dt=new Dt(pe,fe+"enter",ut,p,Te),Dt.target=be,Dt.relatedTarget=rr,Ae=Dt),rr=Ae,Ce&&ut)t:{for(Dt=BZ,pe=Ce,fe=ut,be=0,Ae=pe;Ae;Ae=Dt(Ae))be++;Ae=0;for(var Ct=fe;Ct;Ct=Dt(Ct))Ae++;for(;0<be-Ae;)pe=Dt(pe),be--;for(;0<Ae-be;)fe=Dt(fe),Ae--;for(;be--;){if(pe===fe||fe!==null&&pe===fe.alternate){Dt=pe;break t}pe=Dt(pe),fe=Dt(fe)}Dt=null}else Dt=null;Ce!==null&&$T(Re,ke,Ce,Dt,!1),ut!==null&&rr!==null&&$T(Re,rr,ut,Dt,!0)}}e:{if(ke=Se?vu(Se):window,Ce=ke.nodeName&&ke.nodeName.toLowerCase(),Ce==="select"||Ce==="input"&&ke.type==="file")var Vn=iC;else if(rC(ke))if(aC)Vn=YK;else{Vn=GK;var yt=WK}else Ce=ke.nodeName,!Ce||Ce.toLowerCase()!=="input"||ke.type!=="checkbox"&&ke.type!=="radio"?Se&&vw(Se.elementType)&&(Vn=iC):Vn=XK;if(Vn&&(Vn=Vn(u,Se))){sC(Re,Vn,p,Te);break e}yt&&yt(u,ke,Se),u==="focusout"&&Se&&ke.type==="number"&&Se.memoizedProps.value!=null&&xw(ke,"number",ke.value)}switch(yt=Se?vu(Se):window,u){case"focusin":(rC(yt)||yt.contentEditable==="true")&&(Rd=yt,Mw=Se,nm=null);break;case"focusout":nm=Mw=Rd=null;break;case"mousedown":Rw=!0;break;case"contextmenu":case"mouseup":case"dragend":Rw=!1,mC(Re,p,Te);break;case"selectionchange":if(ZK)break;case"keydown":case"keyup":mC(Re,p,Te)}var Jt;if(Tw)e:{switch(u){case"compositionstart":var bn="onCompositionStart";break e;case"compositionend":bn="onCompositionEnd";break e;case"compositionupdate":bn="onCompositionUpdate";break e}bn=void 0}else Md?tC(u,p)&&(bn="onCompositionEnd"):u==="keydown"&&p.keyCode===229&&(bn="onCompositionStart");bn&&(Z7&&p.locale!=="ko"&&(Md||bn!=="onCompositionStart"?bn==="onCompositionEnd"&&Md&&(Jt=W7()):(ic=Te,kw="value"in ic?ic.value:ic.textContent,Md=!0)),yt=zx(Se,bn),0<yt.length&&(bn=new Y7(bn,u,null,p,Te),Re.push({event:bn,listeners:yt}),Jt?bn.data=Jt:(Jt=nC(p),Jt!==null&&(bn.data=Jt)))),(Jt=$K?HK(u,p):QK(u,p))&&(bn=zx(Se,"onBeforeInput"),0<bn.length&&(yt=new Y7("onBeforeInput","beforeinput",null,p,Te),Re.push({event:yt,listeners:bn}),yt.data=Jt)),PZ(Re,u,Se,p,Te)}FT(Re,f)})}function Cm(u,f,p){return{instance:u,listener:f,currentTarget:p}}function zx(u,f){for(var p=f+"Capture",v=[];u!==null;){var O=u,C=O.stateNode;if(O=O.tag,O!==5&&O!==26&&O!==27||C===null||(O=Gf(u,p),O!=null&&v.unshift(Cm(u,O,C)),O=Gf(u,f),O!=null&&v.push(Cm(u,O,C))),u.tag===3)return v;u=u.return}return[]}function BZ(u){if(u===null)return null;do u=u.return;while(u&&u.tag!==5&&u.tag!==27);return u||null}function $T(u,f,p,v,O){for(var C=f._reactName,F=[];p!==null&&p!==v;){var Z=p,de=Z.alternate,Se=Z.stateNode;if(Z=Z.tag,de!==null&&de===v)break;Z!==5&&Z!==26&&Z!==27||Se===null||(de=Se,O?(Se=Gf(p,C),Se!=null&&F.unshift(Cm(p,Se,de))):O||(Se=Gf(p,C),Se!=null&&F.push(Cm(p,Se,de)))),p=p.return}F.length!==0&&u.push({event:f,listeners:F})}var FZ=/\r\n?/g,qZ=/\u0000|\uFFFD/g;function HT(u){return(typeof u=="string"?u:""+u).replace(FZ,`
|
||
`).replace(qZ,"")}function QT(u,f){return f=HT(f),HT(u)===f}function nr(u,f,p,v,O,C){switch(p){case"children":typeof v=="string"?f==="body"||f==="textarea"&&v===""||Ed(u,v):(typeof v=="number"||typeof v=="bigint")&&f!=="body"&&Ed(u,""+v);break;case"className":Fg(u,"class",v);break;case"tabIndex":Fg(u,"tabindex",v);break;case"dir":case"role":case"viewBox":case"width":case"height":Fg(u,p,v);break;case"style":Q7(u,v,C);break;case"data":if(f!=="object"){Fg(u,"data",v);break}case"src":case"href":if(v===""&&(f!=="a"||p!=="href")){u.removeAttribute(p);break}if(v==null||typeof v=="function"||typeof v=="symbol"||typeof v=="boolean"){u.removeAttribute(p);break}v=$g(""+v),u.setAttribute(p,v);break;case"action":case"formAction":if(typeof v=="function"){u.setAttribute(p,"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 C=="function"&&(p==="formAction"?(f!=="input"&&nr(u,f,"name",O.name,O,null),nr(u,f,"formEncType",O.formEncType,O,null),nr(u,f,"formMethod",O.formMethod,O,null),nr(u,f,"formTarget",O.formTarget,O,null)):(nr(u,f,"encType",O.encType,O,null),nr(u,f,"method",O.method,O,null),nr(u,f,"target",O.target,O,null)));if(v==null||typeof v=="symbol"||typeof v=="boolean"){u.removeAttribute(p);break}v=$g(""+v),u.setAttribute(p,v);break;case"onClick":v!=null&&(u.onclick=rl);break;case"onScroll":v!=null&&fn("scroll",u);break;case"onScrollEnd":v!=null&&fn("scrollend",u);break;case"dangerouslySetInnerHTML":if(v!=null){if(typeof v!="object"||!("__html"in v))throw Error(r(61));if(p=v.__html,p!=null){if(O.children!=null)throw Error(r(60));u.innerHTML=p}}break;case"multiple":u.multiple=v&&typeof v!="function"&&typeof v!="symbol";break;case"muted":u.muted=v&&typeof v!="function"&&typeof v!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(v==null||typeof v=="function"||typeof v=="boolean"||typeof v=="symbol"){u.removeAttribute("xlink:href");break}p=$g(""+v),u.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",p);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":v!=null&&typeof v!="function"&&typeof v!="symbol"?u.setAttribute(p,""+v):u.removeAttribute(p);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":v&&typeof v!="function"&&typeof v!="symbol"?u.setAttribute(p,""):u.removeAttribute(p);break;case"capture":case"download":v===!0?u.setAttribute(p,""):v!==!1&&v!=null&&typeof v!="function"&&typeof v!="symbol"?u.setAttribute(p,v):u.removeAttribute(p);break;case"cols":case"rows":case"size":case"span":v!=null&&typeof v!="function"&&typeof v!="symbol"&&!isNaN(v)&&1<=v?u.setAttribute(p,v):u.removeAttribute(p);break;case"rowSpan":case"start":v==null||typeof v=="function"||typeof v=="symbol"||isNaN(v)?u.removeAttribute(p):u.setAttribute(p,v);break;case"popover":fn("beforetoggle",u),fn("toggle",u),Bg(u,"popover",v);break;case"xlinkActuate":nl(u,"http://www.w3.org/1999/xlink","xlink:actuate",v);break;case"xlinkArcrole":nl(u,"http://www.w3.org/1999/xlink","xlink:arcrole",v);break;case"xlinkRole":nl(u,"http://www.w3.org/1999/xlink","xlink:role",v);break;case"xlinkShow":nl(u,"http://www.w3.org/1999/xlink","xlink:show",v);break;case"xlinkTitle":nl(u,"http://www.w3.org/1999/xlink","xlink:title",v);break;case"xlinkType":nl(u,"http://www.w3.org/1999/xlink","xlink:type",v);break;case"xmlBase":nl(u,"http://www.w3.org/XML/1998/namespace","xml:base",v);break;case"xmlLang":nl(u,"http://www.w3.org/XML/1998/namespace","xml:lang",v);break;case"xmlSpace":nl(u,"http://www.w3.org/XML/1998/namespace","xml:space",v);break;case"is":Bg(u,"is",v);break;case"innerText":case"textContent":break;default:(!(2<p.length)||p[0]!=="o"&&p[0]!=="O"||p[1]!=="n"&&p[1]!=="N")&&(p=pK.get(p)||p,Bg(u,p,v))}}function s4(u,f,p,v,O,C){switch(p){case"style":Q7(u,v,C);break;case"dangerouslySetInnerHTML":if(v!=null){if(typeof v!="object"||!("__html"in v))throw Error(r(61));if(p=v.__html,p!=null){if(O.children!=null)throw Error(r(60));u.innerHTML=p}}break;case"children":typeof v=="string"?Ed(u,v):(typeof v=="number"||typeof v=="bigint")&&Ed(u,""+v);break;case"onScroll":v!=null&&fn("scroll",u);break;case"onScrollEnd":v!=null&&fn("scrollend",u);break;case"onClick":v!=null&&(u.onclick=rl);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!zg.hasOwnProperty(p))e:{if(p[0]==="o"&&p[1]==="n"&&(O=p.endsWith("Capture"),f=p.slice(2,O?p.length-7:void 0),C=u[Rr]||null,C=C!=null?C[p]:null,typeof C=="function"&&u.removeEventListener(f,C,O),typeof v=="function")){typeof C!="function"&&C!==null&&(p in u?u[p]=null:u.hasAttribute(p)&&u.removeAttribute(p)),u.addEventListener(f,v,O);break e}p in u?u[p]=v:v===!0?u.setAttribute(p,""):Bg(u,p,v)}}}function _s(u,f,p){switch(f){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":fn("error",u),fn("load",u);var v=!1,O=!1,C;for(C in p)if(p.hasOwnProperty(C)){var F=p[C];if(F!=null)switch(C){case"src":v=!0;break;case"srcSet":O=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,f));default:nr(u,f,C,F,p,null)}}O&&nr(u,f,"srcSet",p.srcSet,p,null),v&&nr(u,f,"src",p.src,p,null);return;case"input":fn("invalid",u);var Z=C=F=O=null,de=null,Se=null;for(v in p)if(p.hasOwnProperty(v)){var Te=p[v];if(Te!=null)switch(v){case"name":O=Te;break;case"type":F=Te;break;case"checked":de=Te;break;case"defaultChecked":Se=Te;break;case"value":C=Te;break;case"defaultValue":Z=Te;break;case"children":case"dangerouslySetInnerHTML":if(Te!=null)throw Error(r(137,f));break;default:nr(u,f,v,Te,p,null)}}F7(u,C,Z,de,Se,F,O,!1);return;case"select":fn("invalid",u),v=F=C=null;for(O in p)if(p.hasOwnProperty(O)&&(Z=p[O],Z!=null))switch(O){case"value":C=Z;break;case"defaultValue":F=Z;break;case"multiple":v=Z;default:nr(u,f,O,Z,p,null)}f=C,p=F,u.multiple=!!v,f!=null?Td(u,!!v,f,!1):p!=null&&Td(u,!!v,p,!0);return;case"textarea":fn("invalid",u),C=O=v=null;for(F in p)if(p.hasOwnProperty(F)&&(Z=p[F],Z!=null))switch(F){case"value":v=Z;break;case"defaultValue":O=Z;break;case"children":C=Z;break;case"dangerouslySetInnerHTML":if(Z!=null)throw Error(r(91));break;default:nr(u,f,F,Z,p,null)}$7(u,v,O,C);return;case"option":for(de in p)if(p.hasOwnProperty(de)&&(v=p[de],v!=null))switch(de){case"selected":u.selected=v&&typeof v!="function"&&typeof v!="symbol";break;default:nr(u,f,de,v,p,null)}return;case"dialog":fn("beforetoggle",u),fn("toggle",u),fn("cancel",u),fn("close",u);break;case"iframe":case"object":fn("load",u);break;case"video":case"audio":for(v=0;v<Nm.length;v++)fn(Nm[v],u);break;case"image":fn("error",u),fn("load",u);break;case"details":fn("toggle",u);break;case"embed":case"source":case"link":fn("error",u),fn("load",u);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Se in p)if(p.hasOwnProperty(Se)&&(v=p[Se],v!=null))switch(Se){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,f));default:nr(u,f,Se,v,p,null)}return;default:if(vw(f)){for(Te in p)p.hasOwnProperty(Te)&&(v=p[Te],v!==void 0&&s4(u,f,Te,v,p,void 0));return}}for(Z in p)p.hasOwnProperty(Z)&&(v=p[Z],v!=null&&nr(u,f,Z,v,p,null))}function $Z(u,f,p,v){switch(f){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var O=null,C=null,F=null,Z=null,de=null,Se=null,Te=null;for(Ce in p){var Re=p[Ce];if(p.hasOwnProperty(Ce)&&Re!=null)switch(Ce){case"checked":break;case"value":break;case"defaultValue":de=Re;default:v.hasOwnProperty(Ce)||nr(u,f,Ce,null,v,Re)}}for(var ke in v){var Ce=v[ke];if(Re=p[ke],v.hasOwnProperty(ke)&&(Ce!=null||Re!=null))switch(ke){case"type":C=Ce;break;case"name":O=Ce;break;case"checked":Se=Ce;break;case"defaultChecked":Te=Ce;break;case"value":F=Ce;break;case"defaultValue":Z=Ce;break;case"children":case"dangerouslySetInnerHTML":if(Ce!=null)throw Error(r(137,f));break;default:Ce!==Re&&nr(u,f,ke,Ce,v,Re)}}gw(u,F,Z,de,Se,Te,C,O);return;case"select":Ce=F=Z=ke=null;for(C in p)if(de=p[C],p.hasOwnProperty(C)&&de!=null)switch(C){case"value":break;case"multiple":Ce=de;default:v.hasOwnProperty(C)||nr(u,f,C,null,v,de)}for(O in v)if(C=v[O],de=p[O],v.hasOwnProperty(O)&&(C!=null||de!=null))switch(O){case"value":ke=C;break;case"defaultValue":Z=C;break;case"multiple":F=C;default:C!==de&&nr(u,f,O,C,v,de)}f=Z,p=F,v=Ce,ke!=null?Td(u,!!p,ke,!1):!!v!=!!p&&(f!=null?Td(u,!!p,f,!0):Td(u,!!p,p?[]:"",!1));return;case"textarea":Ce=ke=null;for(Z in p)if(O=p[Z],p.hasOwnProperty(Z)&&O!=null&&!v.hasOwnProperty(Z))switch(Z){case"value":break;case"children":break;default:nr(u,f,Z,null,v,O)}for(F in v)if(O=v[F],C=p[F],v.hasOwnProperty(F)&&(O!=null||C!=null))switch(F){case"value":ke=O;break;case"defaultValue":Ce=O;break;case"children":break;case"dangerouslySetInnerHTML":if(O!=null)throw Error(r(91));break;default:O!==C&&nr(u,f,F,O,v,C)}q7(u,ke,Ce);return;case"option":for(var ut in p)if(ke=p[ut],p.hasOwnProperty(ut)&&ke!=null&&!v.hasOwnProperty(ut))switch(ut){case"selected":u.selected=!1;break;default:nr(u,f,ut,null,v,ke)}for(de in v)if(ke=v[de],Ce=p[de],v.hasOwnProperty(de)&&ke!==Ce&&(ke!=null||Ce!=null))switch(de){case"selected":u.selected=ke&&typeof ke!="function"&&typeof ke!="symbol";break;default:nr(u,f,de,ke,v,Ce)}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 Dt in p)ke=p[Dt],p.hasOwnProperty(Dt)&&ke!=null&&!v.hasOwnProperty(Dt)&&nr(u,f,Dt,null,v,ke);for(Se in v)if(ke=v[Se],Ce=p[Se],v.hasOwnProperty(Se)&&ke!==Ce&&(ke!=null||Ce!=null))switch(Se){case"children":case"dangerouslySetInnerHTML":if(ke!=null)throw Error(r(137,f));break;default:nr(u,f,Se,ke,v,Ce)}return;default:if(vw(f)){for(var rr in p)ke=p[rr],p.hasOwnProperty(rr)&&ke!==void 0&&!v.hasOwnProperty(rr)&&s4(u,f,rr,void 0,v,ke);for(Te in v)ke=v[Te],Ce=p[Te],!v.hasOwnProperty(Te)||ke===Ce||ke===void 0&&Ce===void 0||s4(u,f,Te,ke,v,Ce);return}}for(var pe in p)ke=p[pe],p.hasOwnProperty(pe)&&ke!=null&&!v.hasOwnProperty(pe)&&nr(u,f,pe,null,v,ke);for(Re in v)ke=v[Re],Ce=p[Re],!v.hasOwnProperty(Re)||ke===Ce||ke==null&&Ce==null||nr(u,f,Re,ke,v,Ce)}function VT(u){switch(u){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function HZ(){if(typeof performance.getEntriesByType=="function"){for(var u=0,f=0,p=performance.getEntriesByType("resource"),v=0;v<p.length;v++){var O=p[v],C=O.transferSize,F=O.initiatorType,Z=O.duration;if(C&&Z&&VT(F)){for(F=0,Z=O.responseEnd,v+=1;v<p.length;v++){var de=p[v],Se=de.startTime;if(Se>Z)break;var Te=de.transferSize,Re=de.initiatorType;Te&&VT(Re)&&(de=de.responseEnd,F+=Te*(de<Z?1:(Z-Se)/(de-Se)))}if(--v,f+=8*(C+F)/(O.duration/1e3),u++,10<u)break}}if(0<u)return f/u/1e6}return navigator.connection&&(u=navigator.connection.downlink,typeof u=="number")?u:5}var i4=null,a4=null;function Ix(u){return u.nodeType===9?u:u.ownerDocument}function UT(u){switch(u){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function WT(u,f){if(u===0)switch(f){case"svg":return 1;case"math":return 2;default:return 0}return u===1&&f==="foreignObject"?0:u}function o4(u,f){return u==="textarea"||u==="noscript"||typeof f.children=="string"||typeof f.children=="number"||typeof f.children=="bigint"||typeof f.dangerouslySetInnerHTML=="object"&&f.dangerouslySetInnerHTML!==null&&f.dangerouslySetInnerHTML.__html!=null}var l4=null;function QZ(){var u=window.event;return u&&u.type==="popstate"?u===l4?!1:(l4=u,!0):(l4=null,!1)}var GT=typeof setTimeout=="function"?setTimeout:void 0,VZ=typeof clearTimeout=="function"?clearTimeout:void 0,XT=typeof Promise=="function"?Promise:void 0,UZ=typeof queueMicrotask=="function"?queueMicrotask:typeof XT<"u"?function(u){return XT.resolve(null).then(u).catch(WZ)}:GT;function WZ(u){setTimeout(function(){throw u})}function Sc(u){return u==="head"}function YT(u,f){var p=f,v=0;do{var O=p.nextSibling;if(u.removeChild(p),O&&O.nodeType===8)if(p=O.data,p==="/$"||p==="/&"){if(v===0){u.removeChild(O),ah(f);return}v--}else if(p==="$"||p==="$?"||p==="$~"||p==="$!"||p==="&")v++;else if(p==="html")Tm(u.ownerDocument.documentElement);else if(p==="head"){p=u.ownerDocument.head,Tm(p);for(var C=p.firstChild;C;){var F=C.nextSibling,Z=C.nodeName;C[xu]||Z==="SCRIPT"||Z==="STYLE"||Z==="LINK"&&C.rel.toLowerCase()==="stylesheet"||p.removeChild(C),C=F}}else p==="body"&&Tm(u.ownerDocument.body);p=O}while(p);ah(f)}function KT(u,f){var p=u;u=0;do{var v=p.nextSibling;if(p.nodeType===1?f?(p._stashedDisplay=p.style.display,p.style.display="none"):(p.style.display=p._stashedDisplay||"",p.getAttribute("style")===""&&p.removeAttribute("style")):p.nodeType===3&&(f?(p._stashedText=p.nodeValue,p.nodeValue=""):p.nodeValue=p._stashedText||""),v&&v.nodeType===8)if(p=v.data,p==="/$"){if(u===0)break;u--}else p!=="$"&&p!=="$?"&&p!=="$~"&&p!=="$!"||u++;p=v}while(p)}function c4(u){var f=u.firstChild;for(f&&f.nodeType===10&&(f=f.nextSibling);f;){var p=f;switch(f=f.nextSibling,p.nodeName){case"HTML":case"HEAD":case"BODY":c4(p),Uf(p);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(p.rel.toLowerCase()==="stylesheet")continue}u.removeChild(p)}}function GZ(u,f,p,v){for(;u.nodeType===1;){var O=p;if(u.nodeName.toLowerCase()!==f.toLowerCase()){if(!v&&(u.nodeName!=="INPUT"||u.type!=="hidden"))break}else if(v){if(!u[xu])switch(f){case"meta":if(!u.hasAttribute("itemprop"))break;return u;case"link":if(C=u.getAttribute("rel"),C==="stylesheet"&&u.hasAttribute("data-precedence"))break;if(C!==O.rel||u.getAttribute("href")!==(O.href==null||O.href===""?null:O.href)||u.getAttribute("crossorigin")!==(O.crossOrigin==null?null:O.crossOrigin)||u.getAttribute("title")!==(O.title==null?null:O.title))break;return u;case"style":if(u.hasAttribute("data-precedence"))break;return u;case"script":if(C=u.getAttribute("src"),(C!==(O.src==null?null:O.src)||u.getAttribute("type")!==(O.type==null?null:O.type)||u.getAttribute("crossorigin")!==(O.crossOrigin==null?null:O.crossOrigin))&&C&&u.hasAttribute("async")&&!u.hasAttribute("itemprop"))break;return u;default:return u}}else if(f==="input"&&u.type==="hidden"){var C=O.name==null?null:""+O.name;if(O.type==="hidden"&&u.getAttribute("name")===C)return u}else return u;if(u=ha(u.nextSibling),u===null)break}return null}function XZ(u,f,p){if(f==="")return null;for(;u.nodeType!==3;)if((u.nodeType!==1||u.nodeName!=="INPUT"||u.type!=="hidden")&&!p||(u=ha(u.nextSibling),u===null))return null;return u}function ZT(u,f){for(;u.nodeType!==8;)if((u.nodeType!==1||u.nodeName!=="INPUT"||u.type!=="hidden")&&!f||(u=ha(u.nextSibling),u===null))return null;return u}function u4(u){return u.data==="$?"||u.data==="$~"}function d4(u){return u.data==="$!"||u.data==="$?"&&u.ownerDocument.readyState!=="loading"}function YZ(u,f){var p=u.ownerDocument;if(u.data==="$~")u._reactRetry=f;else if(u.data!=="$?"||p.readyState!=="loading")f();else{var v=function(){f(),p.removeEventListener("DOMContentLoaded",v)};p.addEventListener("DOMContentLoaded",v),u._reactRetry=v}}function ha(u){for(;u!=null;u=u.nextSibling){var f=u.nodeType;if(f===1||f===3)break;if(f===8){if(f=u.data,f==="$"||f==="$!"||f==="$?"||f==="$~"||f==="&"||f==="F!"||f==="F")break;if(f==="/$"||f==="/&")return null}}return u}var h4=null;function JT(u){u=u.nextSibling;for(var f=0;u;){if(u.nodeType===8){var p=u.data;if(p==="/$"||p==="/&"){if(f===0)return ha(u.nextSibling);f--}else p!=="$"&&p!=="$!"&&p!=="$?"&&p!=="$~"&&p!=="&"||f++}u=u.nextSibling}return null}function e9(u){u=u.previousSibling;for(var f=0;u;){if(u.nodeType===8){var p=u.data;if(p==="$"||p==="$!"||p==="$?"||p==="$~"||p==="&"){if(f===0)return u;f--}else p!=="/$"&&p!=="/&"||f++}u=u.previousSibling}return null}function t9(u,f,p){switch(f=Ix(p),u){case"html":if(u=f.documentElement,!u)throw Error(r(452));return u;case"head":if(u=f.head,!u)throw Error(r(453));return u;case"body":if(u=f.body,!u)throw Error(r(454));return u;default:throw Error(r(451))}}function Tm(u){for(var f=u.attributes;f.length;)u.removeAttributeNode(f[0]);Uf(u)}var fa=new Map,n9=new Set;function Lx(u){return typeof u.getRootNode=="function"?u.getRootNode():u.nodeType===9?u:u.ownerDocument}var yl=$.d;$.d={f:KZ,r:ZZ,D:JZ,C:eJ,L:tJ,m:nJ,X:sJ,S:rJ,M:iJ};function KZ(){var u=yl.f(),f=Ex();return u||f}function ZZ(u){var f=Jo(u);f!==null&&f.tag===5&&f.type==="form"?y8(f):yl.r(u)}var rh=typeof document>"u"?null:document;function r9(u,f,p){var v=rh;if(v&&typeof f=="string"&&f){var O=ia(f);O='link[rel="'+u+'"][href="'+O+'"]',typeof p=="string"&&(O+='[crossorigin="'+p+'"]'),n9.has(O)||(n9.add(O),u={rel:u,crossOrigin:p,href:f},v.querySelector(O)===null&&(f=v.createElement("link"),_s(f,"link",u),Kr(f),v.head.appendChild(f)))}}function JZ(u){yl.D(u),r9("dns-prefetch",u,null)}function eJ(u,f){yl.C(u,f),r9("preconnect",u,f)}function tJ(u,f,p){yl.L(u,f,p);var v=rh;if(v&&u&&f){var O='link[rel="preload"][as="'+ia(f)+'"]';f==="image"&&p&&p.imageSrcSet?(O+='[imagesrcset="'+ia(p.imageSrcSet)+'"]',typeof p.imageSizes=="string"&&(O+='[imagesizes="'+ia(p.imageSizes)+'"]')):O+='[href="'+ia(u)+'"]';var C=O;switch(f){case"style":C=sh(u);break;case"script":C=ih(u)}fa.has(C)||(u=m({rel:"preload",href:f==="image"&&p&&p.imageSrcSet?void 0:u,as:f},p),fa.set(C,u),v.querySelector(O)!==null||f==="style"&&v.querySelector(Em(C))||f==="script"&&v.querySelector(_m(C))||(f=v.createElement("link"),_s(f,"link",u),Kr(f),v.head.appendChild(f)))}}function nJ(u,f){yl.m(u,f);var p=rh;if(p&&u){var v=f&&typeof f.as=="string"?f.as:"script",O='link[rel="modulepreload"][as="'+ia(v)+'"][href="'+ia(u)+'"]',C=O;switch(v){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":C=ih(u)}if(!fa.has(C)&&(u=m({rel:"modulepreload",href:u},f),fa.set(C,u),p.querySelector(O)===null)){switch(v){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(p.querySelector(_m(C)))return}v=p.createElement("link"),_s(v,"link",u),Kr(v),p.head.appendChild(v)}}}function rJ(u,f,p){yl.S(u,f,p);var v=rh;if(v&&u){var O=sc(v).hoistableStyles,C=sh(u);f=f||"default";var F=O.get(C);if(!F){var Z={loading:0,preload:null};if(F=v.querySelector(Em(C)))Z.loading=5;else{u=m({rel:"stylesheet",href:u,"data-precedence":f},p),(p=fa.get(C))&&f4(u,p);var de=F=v.createElement("link");Kr(de),_s(de,"link",u),de._p=new Promise(function(Se,Te){de.onload=Se,de.onerror=Te}),de.addEventListener("load",function(){Z.loading|=1}),de.addEventListener("error",function(){Z.loading|=2}),Z.loading|=4,Bx(F,f,v)}F={type:"stylesheet",instance:F,count:1,state:Z},O.set(C,F)}}}function sJ(u,f){yl.X(u,f);var p=rh;if(p&&u){var v=sc(p).hoistableScripts,O=ih(u),C=v.get(O);C||(C=p.querySelector(_m(O)),C||(u=m({src:u,async:!0},f),(f=fa.get(O))&&m4(u,f),C=p.createElement("script"),Kr(C),_s(C,"link",u),p.head.appendChild(C)),C={type:"script",instance:C,count:1,state:null},v.set(O,C))}}function iJ(u,f){yl.M(u,f);var p=rh;if(p&&u){var v=sc(p).hoistableScripts,O=ih(u),C=v.get(O);C||(C=p.querySelector(_m(O)),C||(u=m({src:u,async:!0,type:"module"},f),(f=fa.get(O))&&m4(u,f),C=p.createElement("script"),Kr(C),_s(C,"link",u),p.head.appendChild(C)),C={type:"script",instance:C,count:1,state:null},v.set(O,C))}}function s9(u,f,p,v){var O=(O=ne.current)?Lx(O):null;if(!O)throw Error(r(446));switch(u){case"meta":case"title":return null;case"style":return typeof p.precedence=="string"&&typeof p.href=="string"?(f=sh(p.href),p=sc(O).hoistableStyles,v=p.get(f),v||(v={type:"style",instance:null,count:0,state:null},p.set(f,v)),v):{type:"void",instance:null,count:0,state:null};case"link":if(p.rel==="stylesheet"&&typeof p.href=="string"&&typeof p.precedence=="string"){u=sh(p.href);var C=sc(O).hoistableStyles,F=C.get(u);if(F||(O=O.ownerDocument||O,F={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},C.set(u,F),(C=O.querySelector(Em(u)))&&!C._p&&(F.instance=C,F.state.loading=5),fa.has(u)||(p={rel:"preload",as:"style",href:p.href,crossOrigin:p.crossOrigin,integrity:p.integrity,media:p.media,hrefLang:p.hrefLang,referrerPolicy:p.referrerPolicy},fa.set(u,p),C||aJ(O,u,p,F.state))),f&&v===null)throw Error(r(528,""));return F}if(f&&v!==null)throw Error(r(529,""));return null;case"script":return f=p.async,p=p.src,typeof p=="string"&&f&&typeof f!="function"&&typeof f!="symbol"?(f=ih(p),p=sc(O).hoistableScripts,v=p.get(f),v||(v={type:"script",instance:null,count:0,state:null},p.set(f,v)),v):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,u))}}function sh(u){return'href="'+ia(u)+'"'}function Em(u){return'link[rel="stylesheet"]['+u+"]"}function i9(u){return m({},u,{"data-precedence":u.precedence,precedence:null})}function aJ(u,f,p,v){u.querySelector('link[rel="preload"][as="style"]['+f+"]")?v.loading=1:(f=u.createElement("link"),v.preload=f,f.addEventListener("load",function(){return v.loading|=1}),f.addEventListener("error",function(){return v.loading|=2}),_s(f,"link",p),Kr(f),u.head.appendChild(f))}function ih(u){return'[src="'+ia(u)+'"]'}function _m(u){return"script[async]"+u}function a9(u,f,p){if(f.count++,f.instance===null)switch(f.type){case"style":var v=u.querySelector('style[data-href~="'+ia(p.href)+'"]');if(v)return f.instance=v,Kr(v),v;var O=m({},p,{"data-href":p.href,"data-precedence":p.precedence,href:null,precedence:null});return v=(u.ownerDocument||u).createElement("style"),Kr(v),_s(v,"style",O),Bx(v,p.precedence,u),f.instance=v;case"stylesheet":O=sh(p.href);var C=u.querySelector(Em(O));if(C)return f.state.loading|=4,f.instance=C,Kr(C),C;v=i9(p),(O=fa.get(O))&&f4(v,O),C=(u.ownerDocument||u).createElement("link"),Kr(C);var F=C;return F._p=new Promise(function(Z,de){F.onload=Z,F.onerror=de}),_s(C,"link",v),f.state.loading|=4,Bx(C,p.precedence,u),f.instance=C;case"script":return C=ih(p.src),(O=u.querySelector(_m(C)))?(f.instance=O,Kr(O),O):(v=p,(O=fa.get(C))&&(v=m({},p),m4(v,O)),u=u.ownerDocument||u,O=u.createElement("script"),Kr(O),_s(O,"link",v),u.head.appendChild(O),f.instance=O);case"void":return null;default:throw Error(r(443,f.type))}else f.type==="stylesheet"&&(f.state.loading&4)===0&&(v=f.instance,f.state.loading|=4,Bx(v,p.precedence,u));return f.instance}function Bx(u,f,p){for(var v=p.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),O=v.length?v[v.length-1]:null,C=O,F=0;F<v.length;F++){var Z=v[F];if(Z.dataset.precedence===f)C=Z;else if(C!==O)break}C?C.parentNode.insertBefore(u,C.nextSibling):(f=p.nodeType===9?p.head:p,f.insertBefore(u,f.firstChild))}function f4(u,f){u.crossOrigin==null&&(u.crossOrigin=f.crossOrigin),u.referrerPolicy==null&&(u.referrerPolicy=f.referrerPolicy),u.title==null&&(u.title=f.title)}function m4(u,f){u.crossOrigin==null&&(u.crossOrigin=f.crossOrigin),u.referrerPolicy==null&&(u.referrerPolicy=f.referrerPolicy),u.integrity==null&&(u.integrity=f.integrity)}var Fx=null;function o9(u,f,p){if(Fx===null){var v=new Map,O=Fx=new Map;O.set(p,v)}else O=Fx,v=O.get(p),v||(v=new Map,O.set(p,v));if(v.has(u))return v;for(v.set(u,null),p=p.getElementsByTagName(u),O=0;O<p.length;O++){var C=p[O];if(!(C[xu]||C[Mr]||u==="link"&&C.getAttribute("rel")==="stylesheet")&&C.namespaceURI!=="http://www.w3.org/2000/svg"){var F=C.getAttribute(f)||"";F=u+F;var Z=v.get(F);Z?Z.push(C):v.set(F,[C])}}return v}function l9(u,f,p){u=u.ownerDocument||u,u.head.insertBefore(p,f==="title"?u.querySelector("head > title"):null)}function oJ(u,f,p){if(p===1||f.itemProp!=null)return!1;switch(u){case"meta":case"title":return!0;case"style":if(typeof f.precedence!="string"||typeof f.href!="string"||f.href==="")break;return!0;case"link":if(typeof f.rel!="string"||typeof f.href!="string"||f.href===""||f.onLoad||f.onError)break;switch(f.rel){case"stylesheet":return u=f.disabled,typeof f.precedence=="string"&&u==null;default:return!0}case"script":if(f.async&&typeof f.async!="function"&&typeof f.async!="symbol"&&!f.onLoad&&!f.onError&&f.src&&typeof f.src=="string")return!0}return!1}function c9(u){return!(u.type==="stylesheet"&&(u.state.loading&3)===0)}function lJ(u,f,p,v){if(p.type==="stylesheet"&&(typeof v.media!="string"||matchMedia(v.media).matches!==!1)&&(p.state.loading&4)===0){if(p.instance===null){var O=sh(v.href),C=f.querySelector(Em(O));if(C){f=C._p,f!==null&&typeof f=="object"&&typeof f.then=="function"&&(u.count++,u=qx.bind(u),f.then(u,u)),p.state.loading|=4,p.instance=C,Kr(C);return}C=f.ownerDocument||f,v=i9(v),(O=fa.get(O))&&f4(v,O),C=C.createElement("link"),Kr(C);var F=C;F._p=new Promise(function(Z,de){F.onload=Z,F.onerror=de}),_s(C,"link",v),p.instance=C}u.stylesheets===null&&(u.stylesheets=new Map),u.stylesheets.set(p,f),(f=p.state.preload)&&(p.state.loading&3)===0&&(u.count++,p=qx.bind(u),f.addEventListener("load",p),f.addEventListener("error",p))}}var p4=0;function cJ(u,f){return u.stylesheets&&u.count===0&&Hx(u,u.stylesheets),0<u.count||0<u.imgCount?function(p){var v=setTimeout(function(){if(u.stylesheets&&Hx(u,u.stylesheets),u.unsuspend){var C=u.unsuspend;u.unsuspend=null,C()}},6e4+f);0<u.imgBytes&&p4===0&&(p4=62500*HZ());var O=setTimeout(function(){if(u.waitingForImages=!1,u.count===0&&(u.stylesheets&&Hx(u,u.stylesheets),u.unsuspend)){var C=u.unsuspend;u.unsuspend=null,C()}},(u.imgBytes>p4?50:800)+f);return u.unsuspend=p,function(){u.unsuspend=null,clearTimeout(v),clearTimeout(O)}}:null}function qx(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Hx(this,this.stylesheets);else if(this.unsuspend){var u=this.unsuspend;this.unsuspend=null,u()}}}var $x=null;function Hx(u,f){u.stylesheets=null,u.unsuspend!==null&&(u.count++,$x=new Map,f.forEach(uJ,u),$x=null,qx.call(u))}function uJ(u,f){if(!(f.state.loading&4)){var p=$x.get(u);if(p)var v=p.get(null);else{p=new Map,$x.set(u,p);for(var O=u.querySelectorAll("link[data-precedence],style[data-precedence]"),C=0;C<O.length;C++){var F=O[C];(F.nodeName==="LINK"||F.getAttribute("media")!=="not all")&&(p.set(F.dataset.precedence,F),v=F)}v&&p.set(null,v)}O=f.instance,F=O.getAttribute("data-precedence"),C=p.get(F)||v,C===v&&p.set(null,O),p.set(F,O),this.count++,v=qx.bind(this),O.addEventListener("load",v),O.addEventListener("error",v),C?C.parentNode.insertBefore(O,C.nextSibling):(u=u.nodeType===9?u.head:u,u.insertBefore(O,u.firstChild)),f.state.loading|=4}}var Am={$$typeof:N,Provider:null,Consumer:null,_currentValue:K,_currentValue2:K,_threadCount:0};function dJ(u,f,p,v,O,C,F,Z,de){this.tag=1,this.containerInfo=u,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=Qn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Qn(0),this.hiddenUpdates=Qn(null),this.identifierPrefix=v,this.onUncaughtError=O,this.onCaughtError=C,this.onRecoverableError=F,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=de,this.incompleteTransitions=new Map}function u9(u,f,p,v,O,C,F,Z,de,Se,Te,Re){return u=new dJ(u,f,p,F,de,Se,Te,Re,Z),f=1,C===!0&&(f|=24),C=Di(3,null,null,f),u.current=C,C.stateNode=u,f=Gw(),f.refCount++,u.pooledCache=f,f.refCount++,C.memoizedState={element:v,isDehydrated:p,cache:f},Zw(C),u}function d9(u){return u?(u=zd,u):zd}function h9(u,f,p,v,O,C){O=d9(O),v.context===null?v.context=O:v.pendingContext=O,v=dc(f),v.payload={element:p},C=C===void 0?null:C,C!==null&&(v.callback=C),p=hc(u,v,f),p!==null&&(mi(p,u,f),cm(p,u,f))}function f9(u,f){if(u=u.memoizedState,u!==null&&u.dehydrated!==null){var p=u.retryLane;u.retryLane=p!==0&&p<f?p:f}}function g4(u,f){f9(u,f),(u=u.alternate)&&f9(u,f)}function m9(u){if(u.tag===13||u.tag===31){var f=Su(u,67108864);f!==null&&mi(f,u,67108864),g4(u,67108864)}}function p9(u){if(u.tag===13||u.tag===31){var f=Bi();f=ge(f);var p=Su(u,f);p!==null&&mi(p,u,f),g4(u,f)}}var Qx=!0;function hJ(u,f,p,v){var O=L.T;L.T=null;var C=$.p;try{$.p=2,x4(u,f,p,v)}finally{$.p=C,L.T=O}}function fJ(u,f,p,v){var O=L.T;L.T=null;var C=$.p;try{$.p=8,x4(u,f,p,v)}finally{$.p=C,L.T=O}}function x4(u,f,p,v){if(Qx){var O=v4(v);if(O===null)r4(u,f,v,Vx,p),x9(u,v);else if(pJ(O,u,f,p,v))v.stopPropagation();else if(x9(u,v),f&4&&-1<mJ.indexOf(u)){for(;O!==null;){var C=Jo(O);if(C!==null)switch(C.tag){case 3:if(C=C.stateNode,C.current.memoizedState.isDehydrated){var F=lt(C.pendingLanes);if(F!==0){var Z=C;for(Z.pendingLanes|=2,Z.entangledLanes|=2;F;){var de=1<<31-Pt(F);Z.entanglements[1]|=de,F&=~de}ho(C),(Gn&6)===0&&(Cx=Mt()+500,jm(0))}}break;case 31:case 13:Z=Su(C,2),Z!==null&&mi(Z,C,2),Ex(),g4(C,2)}if(C=v4(v),C===null&&r4(u,f,v,Vx,p),C===O)break;O=C}O!==null&&v.stopPropagation()}else r4(u,f,v,null,p)}}function v4(u){return u=bw(u),y4(u)}var Vx=null;function y4(u){if(Vx=null,u=rc(u),u!==null){var f=i(u);if(f===null)u=null;else{var p=f.tag;if(p===13){if(u=a(f),u!==null)return u;u=null}else if(p===31){if(u=l(f),u!==null)return u;u=null}else if(p===3){if(f.stateNode.current.memoizedState.isDehydrated)return f.tag===3?f.stateNode.containerInfo:null;u=null}else f!==u&&(u=null)}}return Vx=u,null}function g9(u){switch(u){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(ct()){case Ne:return 2;case ze:return 8;case rt:case bt:return 32;case zt:return 268435456;default:return 32}default:return 32}}var b4=!1,kc=null,Oc=null,jc=null,Mm=new Map,Rm=new Map,Nc=[],mJ="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 x9(u,f){switch(u){case"focusin":case"focusout":kc=null;break;case"dragenter":case"dragleave":Oc=null;break;case"mouseover":case"mouseout":jc=null;break;case"pointerover":case"pointerout":Mm.delete(f.pointerId);break;case"gotpointercapture":case"lostpointercapture":Rm.delete(f.pointerId)}}function Dm(u,f,p,v,O,C){return u===null||u.nativeEvent!==C?(u={blockedOn:f,domEventName:p,eventSystemFlags:v,nativeEvent:C,targetContainers:[O]},f!==null&&(f=Jo(f),f!==null&&m9(f)),u):(u.eventSystemFlags|=v,f=u.targetContainers,O!==null&&f.indexOf(O)===-1&&f.push(O),u)}function pJ(u,f,p,v,O){switch(f){case"focusin":return kc=Dm(kc,u,f,p,v,O),!0;case"dragenter":return Oc=Dm(Oc,u,f,p,v,O),!0;case"mouseover":return jc=Dm(jc,u,f,p,v,O),!0;case"pointerover":var C=O.pointerId;return Mm.set(C,Dm(Mm.get(C)||null,u,f,p,v,O)),!0;case"gotpointercapture":return C=O.pointerId,Rm.set(C,Dm(Rm.get(C)||null,u,f,p,v,O)),!0}return!1}function v9(u){var f=rc(u.target);if(f!==null){var p=i(f);if(p!==null){if(f=p.tag,f===13){if(f=a(p),f!==null){u.blockedOn=f,kn(u.priority,function(){p9(p)});return}}else if(f===31){if(f=l(p),f!==null){u.blockedOn=f,kn(u.priority,function(){p9(p)});return}}else if(f===3&&p.stateNode.current.memoizedState.isDehydrated){u.blockedOn=p.tag===3?p.stateNode.containerInfo:null;return}}}u.blockedOn=null}function Ux(u){if(u.blockedOn!==null)return!1;for(var f=u.targetContainers;0<f.length;){var p=v4(u.nativeEvent);if(p===null){p=u.nativeEvent;var v=new p.constructor(p.type,p);yw=v,p.target.dispatchEvent(v),yw=null}else return f=Jo(p),f!==null&&m9(f),u.blockedOn=p,!1;f.shift()}return!0}function y9(u,f,p){Ux(u)&&p.delete(f)}function gJ(){b4=!1,kc!==null&&Ux(kc)&&(kc=null),Oc!==null&&Ux(Oc)&&(Oc=null),jc!==null&&Ux(jc)&&(jc=null),Mm.forEach(y9),Rm.forEach(y9)}function Wx(u,f){u.blockedOn===f&&(u.blockedOn=null,b4||(b4=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,gJ)))}var Gx=null;function b9(u){Gx!==u&&(Gx=u,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Gx===u&&(Gx=null);for(var f=0;f<u.length;f+=3){var p=u[f],v=u[f+1],O=u[f+2];if(typeof v!="function"){if(y4(v||p)===null)continue;break}var C=Jo(p);C!==null&&(u.splice(f,3),f-=3,v2(C,{pending:!0,data:O,method:p.method,action:v},v,O))}}))}function ah(u){function f(de){return Wx(de,u)}kc!==null&&Wx(kc,u),Oc!==null&&Wx(Oc,u),jc!==null&&Wx(jc,u),Mm.forEach(f),Rm.forEach(f);for(var p=0;p<Nc.length;p++){var v=Nc[p];v.blockedOn===u&&(v.blockedOn=null)}for(;0<Nc.length&&(p=Nc[0],p.blockedOn===null);)v9(p),p.blockedOn===null&&Nc.shift();if(p=(u.ownerDocument||u).$$reactFormReplay,p!=null)for(v=0;v<p.length;v+=3){var O=p[v],C=p[v+1],F=O[Rr]||null;if(typeof C=="function")F||b9(p);else if(F){var Z=null;if(C&&C.hasAttribute("formAction")){if(O=C,F=C[Rr]||null)Z=F.formAction;else if(y4(O)!==null)continue}else Z=F.action;typeof Z=="function"?p[v+1]=Z:(p.splice(v,3),v-=3),b9(p)}}}function w9(){function u(C){C.canIntercept&&C.info==="react-transition"&&C.intercept({handler:function(){return new Promise(function(F){return O=F})},focusReset:"manual",scroll:"manual"})}function f(){O!==null&&(O(),O=null),v||setTimeout(p,20)}function p(){if(!v&&!navigation.transition){var C=navigation.currentEntry;C&&C.url!=null&&navigation.navigate(C.url,{state:C.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var v=!1,O=null;return navigation.addEventListener("navigate",u),navigation.addEventListener("navigatesuccess",f),navigation.addEventListener("navigateerror",f),setTimeout(p,100),function(){v=!0,navigation.removeEventListener("navigate",u),navigation.removeEventListener("navigatesuccess",f),navigation.removeEventListener("navigateerror",f),O!==null&&(O(),O=null)}}}function w4(u){this._internalRoot=u}Xx.prototype.render=w4.prototype.render=function(u){var f=this._internalRoot;if(f===null)throw Error(r(409));var p=f.current,v=Bi();h9(p,v,u,f,null,null)},Xx.prototype.unmount=w4.prototype.unmount=function(){var u=this._internalRoot;if(u!==null){this._internalRoot=null;var f=u.containerInfo;h9(u.current,2,null,u,null,null),Ex(),f[Ns]=null}};function Xx(u){this._internalRoot=u}Xx.prototype.unstable_scheduleHydration=function(u){if(u){var f=Et();u={blockedOn:null,target:u,priority:f};for(var p=0;p<Nc.length&&f!==0&&f<Nc[p].priority;p++);Nc.splice(p,0,u),p===0&&v9(u)}};var S9=e.version;if(S9!=="19.2.0")throw Error(r(527,S9,"19.2.0"));$.findDOMNode=function(u){var f=u._reactInternals;if(f===void 0)throw typeof u.render=="function"?Error(r(188)):(u=Object.keys(u).join(","),Error(r(268,u)));return u=d(f),u=u!==null?h(u):null,u=u===null?null:u.stateNode,u};var xJ={bundleType:0,version:"19.2.0",rendererPackageName:"react-dom",currentDispatcherRef:L,reconcilerVersion:"19.2.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Yx=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yx.isDisabled&&Yx.supportsFiber)try{We=Yx.inject(xJ),ot=Yx}catch{}}return zm.createRoot=function(u,f){if(!s(u))throw Error(r(299));var p=!1,v="",O=E8,C=_8,F=A8;return f!=null&&(f.unstable_strictMode===!0&&(p=!0),f.identifierPrefix!==void 0&&(v=f.identifierPrefix),f.onUncaughtError!==void 0&&(O=f.onUncaughtError),f.onCaughtError!==void 0&&(C=f.onCaughtError),f.onRecoverableError!==void 0&&(F=f.onRecoverableError)),f=u9(u,1,!1,null,null,p,v,null,O,C,F,w9),u[Ns]=f.current,n4(u),new w4(f)},zm.hydrateRoot=function(u,f,p){if(!s(u))throw Error(r(299));var v=!1,O="",C=E8,F=_8,Z=A8,de=null;return p!=null&&(p.unstable_strictMode===!0&&(v=!0),p.identifierPrefix!==void 0&&(O=p.identifierPrefix),p.onUncaughtError!==void 0&&(C=p.onUncaughtError),p.onCaughtError!==void 0&&(F=p.onCaughtError),p.onRecoverableError!==void 0&&(Z=p.onRecoverableError),p.formState!==void 0&&(de=p.formState)),f=u9(u,1,!0,f,p??null,v,O,de,C,F,Z,w9),f.context=d9(null),p=f.current,v=Bi(),v=ge(v),O=dc(v),O.callback=null,hc(p,O,v),p=v,f.current.lanes=p,fr(f,p),ho(f),u[Ns]=f.current,n4(u),new Xx(f)},zm.version="19.2.0",zm}var D9;function bte(){if(D9)return O4.exports;D9=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),O4.exports=yte(),O4.exports}var wte=bte();function _I(t,e){return function(){return t.apply(e,arguments)}}const{toString:Ste}=Object.prototype,{getPrototypeOf:Bj}=Object,{iterator:Jy,toStringTag:AI}=Symbol,eb=(t=>e=>{const n=Ste.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),no=t=>(t=t.toLowerCase(),e=>eb(e)===t),tb=t=>e=>typeof e===t,{isArray:yf}=Array,Xh=tb("undefined");function Bp(t){return t!==null&&!Xh(t)&&t.constructor!==null&&!Xh(t.constructor)&&ki(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const MI=no("ArrayBuffer");function kte(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&MI(t.buffer),e}const Ote=tb("string"),ki=tb("function"),RI=tb("number"),Fp=t=>t!==null&&typeof t=="object",jte=t=>t===!0||t===!1,iv=t=>{if(eb(t)!=="object")return!1;const e=Bj(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(AI in t)&&!(Jy in t)},Nte=t=>{if(!Fp(t)||Bp(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},Cte=no("Date"),Tte=no("File"),Ete=no("Blob"),_te=no("FileList"),Ate=t=>Fp(t)&&ki(t.pipe),Mte=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||ki(t.append)&&((e=eb(t))==="formdata"||e==="object"&&ki(t.toString)&&t.toString()==="[object FormData]"))},Rte=no("URLSearchParams"),[Dte,Pte,zte,Ite]=["ReadableStream","Request","Response","Headers"].map(no),Lte=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function qp(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,s;if(typeof t!="object"&&(t=[t]),yf(t))for(r=0,s=t.length;r<s;r++)e.call(null,t[r],r,t);else{if(Bp(t))return;const i=n?Object.getOwnPropertyNames(t):Object.keys(t),a=i.length;let l;for(r=0;r<a;r++)l=i[r],e.call(null,t[l],l,t)}}function DI(t,e){if(Bp(t))return null;e=e.toLowerCase();const n=Object.keys(t);let r=n.length,s;for(;r-- >0;)if(s=n[r],e===s.toLowerCase())return s;return null}const Vu=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,PI=t=>!Xh(t)&&t!==Vu;function ck(){const{caseless:t,skipUndefined:e}=PI(this)&&this||{},n={},r=(s,i)=>{const a=t&&DI(n,i)||i;iv(n[a])&&iv(s)?n[a]=ck(n[a],s):iv(s)?n[a]=ck({},s):yf(s)?n[a]=s.slice():(!e||!Xh(s))&&(n[a]=s)};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&qp(arguments[s],r);return n}const Bte=(t,e,n,{allOwnKeys:r}={})=>(qp(e,(s,i)=>{n&&ki(s)?t[i]=_I(s,n):t[i]=s},{allOwnKeys:r}),t),Fte=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),qte=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},$te=(t,e,n,r)=>{let s,i,a;const l={};if(e=e||{},t==null)return e;do{for(s=Object.getOwnPropertyNames(t),i=s.length;i-- >0;)a=s[i],(!r||r(a,t,e))&&!l[a]&&(e[a]=t[a],l[a]=!0);t=n!==!1&&Bj(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},Hte=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},Qte=t=>{if(!t)return null;if(yf(t))return t;let e=t.length;if(!RI(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},Vte=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Bj(Uint8Array)),Ute=(t,e)=>{const r=(t&&t[Jy]).call(t);let s;for(;(s=r.next())&&!s.done;){const i=s.value;e.call(t,i[0],i[1])}},Wte=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},Gte=no("HTMLFormElement"),Xte=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),P9=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),Yte=no("RegExp"),zI=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};qp(n,(s,i)=>{let a;(a=e(s,i,t))!==!1&&(r[i]=a||s)}),Object.defineProperties(t,r)},Kte=t=>{zI(t,(e,n)=>{if(ki(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(ki(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Zte=(t,e)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return yf(t)?r(t):r(String(t).split(e)),n},Jte=()=>{},ene=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function tne(t){return!!(t&&ki(t.append)&&t[AI]==="FormData"&&t[Jy])}const nne=t=>{const e=new Array(10),n=(r,s)=>{if(Fp(r)){if(e.indexOf(r)>=0)return;if(Bp(r))return r;if(!("toJSON"in r)){e[s]=r;const i=yf(r)?[]:{};return qp(r,(a,l)=>{const c=n(a,s+1);!Xh(c)&&(i[l]=c)}),e[s]=void 0,i}}return r};return n(t,0)},rne=no("AsyncFunction"),sne=t=>t&&(Fp(t)||ki(t))&&ki(t.then)&&ki(t.catch),II=((t,e)=>t?setImmediate:e?((n,r)=>(Vu.addEventListener("message",({source:s,data:i})=>{s===Vu&&i===n&&r.length&&r.shift()()},!1),s=>{r.push(s),Vu.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",ki(Vu.postMessage)),ine=typeof queueMicrotask<"u"?queueMicrotask.bind(Vu):typeof process<"u"&&process.nextTick||II,ane=t=>t!=null&&ki(t[Jy]),je={isArray:yf,isArrayBuffer:MI,isBuffer:Bp,isFormData:Mte,isArrayBufferView:kte,isString:Ote,isNumber:RI,isBoolean:jte,isObject:Fp,isPlainObject:iv,isEmptyObject:Nte,isReadableStream:Dte,isRequest:Pte,isResponse:zte,isHeaders:Ite,isUndefined:Xh,isDate:Cte,isFile:Tte,isBlob:Ete,isRegExp:Yte,isFunction:ki,isStream:Ate,isURLSearchParams:Rte,isTypedArray:Vte,isFileList:_te,forEach:qp,merge:ck,extend:Bte,trim:Lte,stripBOM:Fte,inherits:qte,toFlatObject:$te,kindOf:eb,kindOfTest:no,endsWith:Hte,toArray:Qte,forEachEntry:Ute,matchAll:Wte,isHTMLForm:Gte,hasOwnProperty:P9,hasOwnProp:P9,reduceDescriptors:zI,freezeMethods:Kte,toObjectSet:Zte,toCamelCase:Xte,noop:Jte,toFiniteNumber:ene,findKey:DI,global:Vu,isContextDefined:PI,isSpecCompliantForm:tne,toJSONObject:nne,isAsyncFn:rne,isThenable:sne,setImmediate:II,asap:ine,isIterable:ane};function Zt(t,e,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}je.inherits(Zt,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:je.toJSONObject(this.config),code:this.code,status:this.status}}});const LI=Zt.prototype,BI={};["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(t=>{BI[t]={value:t}});Object.defineProperties(Zt,BI);Object.defineProperty(LI,"isAxiosError",{value:!0});Zt.from=(t,e,n,r,s,i)=>{const a=Object.create(LI);je.toFlatObject(t,a,function(h){return h!==Error.prototype},d=>d!=="isAxiosError");const l=t&&t.message?t.message:"Error",c=e==null&&t?t.code:e;return Zt.call(a,l,c,n,r,s),t&&a.cause==null&&Object.defineProperty(a,"cause",{value:t,configurable:!0}),a.name=t&&t.name||"Error",i&&Object.assign(a,i),a};const one=null;function uk(t){return je.isPlainObject(t)||je.isArray(t)}function FI(t){return je.endsWith(t,"[]")?t.slice(0,-2):t}function z9(t,e,n){return t?t.concat(e).map(function(s,i){return s=FI(s),!n&&i?"["+s+"]":s}).join(n?".":""):e}function lne(t){return je.isArray(t)&&!t.some(uk)}const cne=je.toFlatObject(je,{},null,function(e){return/^is[A-Z]/.test(e)});function nb(t,e,n){if(!je.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=je.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(w,S){return!je.isUndefined(S[w])});const r=n.metaTokens,s=n.visitor||h,i=n.dots,a=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&je.isSpecCompliantForm(e);if(!je.isFunction(s))throw new TypeError("visitor must be a function");function d(y){if(y===null)return"";if(je.isDate(y))return y.toISOString();if(je.isBoolean(y))return y.toString();if(!c&&je.isBlob(y))throw new Zt("Blob is not supported. Use a Buffer instead.");return je.isArrayBuffer(y)||je.isTypedArray(y)?c&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}function h(y,w,S){let k=y;if(y&&!S&&typeof y=="object"){if(je.endsWith(w,"{}"))w=r?w:w.slice(0,-2),y=JSON.stringify(y);else if(je.isArray(y)&&lne(y)||(je.isFileList(y)||je.endsWith(w,"[]"))&&(k=je.toArray(y)))return w=FI(w),k.forEach(function(N,T){!(je.isUndefined(N)||N===null)&&e.append(a===!0?z9([w],T,i):a===null?w:w+"[]",d(N))}),!1}return uk(y)?!0:(e.append(z9(S,w,i),d(y)),!1)}const m=[],g=Object.assign(cne,{defaultVisitor:h,convertValue:d,isVisitable:uk});function x(y,w){if(!je.isUndefined(y)){if(m.indexOf(y)!==-1)throw Error("Circular reference detected in "+w.join("."));m.push(y),je.forEach(y,function(k,j){(!(je.isUndefined(k)||k===null)&&s.call(e,k,je.isString(j)?j.trim():j,w,g))===!0&&x(k,w?w.concat(j):[j])}),m.pop()}}if(!je.isObject(t))throw new TypeError("data must be an object");return x(t),e}function I9(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function Fj(t,e){this._pairs=[],t&&nb(t,this,e)}const qI=Fj.prototype;qI.append=function(e,n){this._pairs.push([e,n])};qI.toString=function(e){const n=e?function(r){return e.call(this,r,I9)}:I9;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function une(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function $I(t,e,n){if(!e)return t;const r=n&&n.encode||une;je.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let i;if(s?i=s(e,n):i=je.isURLSearchParams(e)?e.toString():new Fj(e,n).toString(r),i){const a=t.indexOf("#");a!==-1&&(t=t.slice(0,a)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class L9{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){je.forEach(this.handlers,function(r){r!==null&&e(r)})}}const HI={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},dne=typeof URLSearchParams<"u"?URLSearchParams:Fj,hne=typeof FormData<"u"?FormData:null,fne=typeof Blob<"u"?Blob:null,mne={isBrowser:!0,classes:{URLSearchParams:dne,FormData:hne,Blob:fne},protocols:["http","https","file","blob","url","data"]},qj=typeof window<"u"&&typeof document<"u",dk=typeof navigator=="object"&&navigator||void 0,pne=qj&&(!dk||["ReactNative","NativeScript","NS"].indexOf(dk.product)<0),gne=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",xne=qj&&window.location.href||"http://localhost",vne=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:qj,hasStandardBrowserEnv:pne,hasStandardBrowserWebWorkerEnv:gne,navigator:dk,origin:xne},Symbol.toStringTag,{value:"Module"})),$s={...vne,...mne};function yne(t,e){return nb(t,new $s.classes.URLSearchParams,{visitor:function(n,r,s,i){return $s.isNode&&je.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...e})}function bne(t){return je.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function wne(t){const e={},n=Object.keys(t);let r;const s=n.length;let i;for(r=0;r<s;r++)i=n[r],e[i]=t[i];return e}function QI(t){function e(n,r,s,i){let a=n[i++];if(a==="__proto__")return!0;const l=Number.isFinite(+a),c=i>=n.length;return a=!a&&je.isArray(s)?s.length:a,c?(je.hasOwnProp(s,a)?s[a]=[s[a],r]:s[a]=r,!l):((!s[a]||!je.isObject(s[a]))&&(s[a]=[]),e(n,r,s[a],i)&&je.isArray(s[a])&&(s[a]=wne(s[a])),!l)}if(je.isFormData(t)&&je.isFunction(t.entries)){const n={};return je.forEachEntry(t,(r,s)=>{e(bne(r),s,n,0)}),n}return null}function Sne(t,e,n){if(je.isString(t))try{return(e||JSON.parse)(t),je.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const $p={transitional:HI,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,i=je.isObject(e);if(i&&je.isHTMLForm(e)&&(e=new FormData(e)),je.isFormData(e))return s?JSON.stringify(QI(e)):e;if(je.isArrayBuffer(e)||je.isBuffer(e)||je.isStream(e)||je.isFile(e)||je.isBlob(e)||je.isReadableStream(e))return e;if(je.isArrayBufferView(e))return e.buffer;if(je.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let l;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return yne(e,this.formSerializer).toString();if((l=je.isFileList(e))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return nb(l?{"files[]":e}:e,c&&new c,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),Sne(e)):e}],transformResponse:[function(e){const n=this.transitional||$p.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(je.isResponse(e)||je.isReadableStream(e))return e;if(e&&je.isString(e)&&(r&&!this.responseType||s)){const a=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(e,this.parseReviver)}catch(l){if(a)throw l.name==="SyntaxError"?Zt.from(l,Zt.ERR_BAD_RESPONSE,this,null,this.response):l}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:$s.classes.FormData,Blob:$s.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};je.forEach(["delete","get","head","post","put","patch"],t=>{$p.headers[t]={}});const kne=je.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"]),One=t=>{const e={};let n,r,s;return t&&t.split(`
|
||
`).forEach(function(a){s=a.indexOf(":"),n=a.substring(0,s).trim().toLowerCase(),r=a.substring(s+1).trim(),!(!n||e[n]&&kne[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},B9=Symbol("internals");function Im(t){return t&&String(t).trim().toLowerCase()}function av(t){return t===!1||t==null?t:je.isArray(t)?t.map(av):String(t)}function jne(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const Nne=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function C4(t,e,n,r,s){if(je.isFunction(r))return r.call(this,e,n);if(s&&(e=n),!!je.isString(e)){if(je.isString(r))return e.indexOf(r)!==-1;if(je.isRegExp(r))return r.test(e)}}function Cne(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function Tne(t,e){const n=je.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(s,i,a){return this[r].call(this,e,s,i,a)},configurable:!0})})}let Oi=class{constructor(e){e&&this.set(e)}set(e,n,r){const s=this;function i(l,c,d){const h=Im(c);if(!h)throw new Error("header name must be a non-empty string");const m=je.findKey(s,h);(!m||s[m]===void 0||d===!0||d===void 0&&s[m]!==!1)&&(s[m||c]=av(l))}const a=(l,c)=>je.forEach(l,(d,h)=>i(d,h,c));if(je.isPlainObject(e)||e instanceof this.constructor)a(e,n);else if(je.isString(e)&&(e=e.trim())&&!Nne(e))a(One(e),n);else if(je.isObject(e)&&je.isIterable(e)){let l={},c,d;for(const h of e){if(!je.isArray(h))throw TypeError("Object iterator must return a key-value pair");l[d=h[0]]=(c=l[d])?je.isArray(c)?[...c,h[1]]:[c,h[1]]:h[1]}a(l,n)}else e!=null&&i(n,e,r);return this}get(e,n){if(e=Im(e),e){const r=je.findKey(this,e);if(r){const s=this[r];if(!n)return s;if(n===!0)return jne(s);if(je.isFunction(n))return n.call(this,s,r);if(je.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=Im(e),e){const r=je.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||C4(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let s=!1;function i(a){if(a=Im(a),a){const l=je.findKey(r,a);l&&(!n||C4(r,r[l],l,n))&&(delete r[l],s=!0)}}return je.isArray(e)?e.forEach(i):i(e),s}clear(e){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const i=n[r];(!e||C4(this,this[i],i,e,!0))&&(delete this[i],s=!0)}return s}normalize(e){const n=this,r={};return je.forEach(this,(s,i)=>{const a=je.findKey(r,i);if(a){n[a]=av(s),delete n[i];return}const l=e?Cne(i):String(i).trim();l!==i&&delete n[i],n[l]=av(s),r[l]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return je.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=e&&je.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
|
||
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(s=>r.set(s)),r}static accessor(e){const r=(this[B9]=this[B9]={accessors:{}}).accessors,s=this.prototype;function i(a){const l=Im(a);r[l]||(Tne(s,a),r[l]=!0)}return je.isArray(e)?e.forEach(i):i(e),this}};Oi.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);je.reduceDescriptors(Oi.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}});je.freezeMethods(Oi);function T4(t,e){const n=this||$p,r=e||n,s=Oi.from(r.headers);let i=r.data;return je.forEach(t,function(l){i=l.call(n,i,s.normalize(),e?e.status:void 0)}),s.normalize(),i}function VI(t){return!!(t&&t.__CANCEL__)}function bf(t,e,n){Zt.call(this,t??"canceled",Zt.ERR_CANCELED,e,n),this.name="CanceledError"}je.inherits(bf,Zt,{__CANCEL__:!0});function UI(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new Zt("Request failed with status code "+n.status,[Zt.ERR_BAD_REQUEST,Zt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Ene(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function _ne(t,e){t=t||10;const n=new Array(t),r=new Array(t);let s=0,i=0,a;return e=e!==void 0?e:1e3,function(c){const d=Date.now(),h=r[i];a||(a=d),n[s]=c,r[s]=d;let m=i,g=0;for(;m!==s;)g+=n[m++],m=m%t;if(s=(s+1)%t,s===i&&(i=(i+1)%t),d-a<e)return;const x=h&&d-h;return x?Math.round(g*1e3/x):void 0}}function Ane(t,e){let n=0,r=1e3/e,s,i;const a=(d,h=Date.now())=>{n=h,s=null,i&&(clearTimeout(i),i=null),t(...d)};return[(...d)=>{const h=Date.now(),m=h-n;m>=r?a(d,h):(s=d,i||(i=setTimeout(()=>{i=null,a(s)},r-m)))},()=>s&&a(s)]}const qv=(t,e,n=3)=>{let r=0;const s=_ne(50,250);return Ane(i=>{const a=i.loaded,l=i.lengthComputable?i.total:void 0,c=a-r,d=s(c),h=a<=l;r=a;const m={loaded:a,total:l,progress:l?a/l:void 0,bytes:c,rate:d||void 0,estimated:d&&l&&h?(l-a)/d:void 0,event:i,lengthComputable:l!=null,[e?"download":"upload"]:!0};t(m)},n)},F9=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},q9=t=>(...e)=>je.asap(()=>t(...e)),Mne=$s.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,$s.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL($s.origin),$s.navigator&&/(msie|trident)/i.test($s.navigator.userAgent)):()=>!0,Rne=$s.hasStandardBrowserEnv?{write(t,e,n,r,s,i,a){if(typeof document>"u")return;const l=[`${t}=${encodeURIComponent(e)}`];je.isNumber(n)&&l.push(`expires=${new Date(n).toUTCString()}`),je.isString(r)&&l.push(`path=${r}`),je.isString(s)&&l.push(`domain=${s}`),i===!0&&l.push("secure"),je.isString(a)&&l.push(`SameSite=${a}`),document.cookie=l.join("; ")},read(t){if(typeof document>"u")return null;const e=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Dne(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Pne(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function WI(t,e,n){let r=!Dne(e);return t&&(r||n==!1)?Pne(t,e):e}const $9=t=>t instanceof Oi?{...t}:t;function ad(t,e){e=e||{};const n={};function r(d,h,m,g){return je.isPlainObject(d)&&je.isPlainObject(h)?je.merge.call({caseless:g},d,h):je.isPlainObject(h)?je.merge({},h):je.isArray(h)?h.slice():h}function s(d,h,m,g){if(je.isUndefined(h)){if(!je.isUndefined(d))return r(void 0,d,m,g)}else return r(d,h,m,g)}function i(d,h){if(!je.isUndefined(h))return r(void 0,h)}function a(d,h){if(je.isUndefined(h)){if(!je.isUndefined(d))return r(void 0,d)}else return r(void 0,h)}function l(d,h,m){if(m in e)return r(d,h);if(m in t)return r(void 0,d)}const c={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:l,headers:(d,h,m)=>s($9(d),$9(h),m,!0)};return je.forEach(Object.keys({...t,...e}),function(h){const m=c[h]||s,g=m(t[h],e[h],h);je.isUndefined(g)&&m!==l||(n[h]=g)}),n}const GI=t=>{const e=ad({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:i,headers:a,auth:l}=e;if(e.headers=a=Oi.from(a),e.url=$I(WI(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),je.isFormData(n)){if($s.hasStandardBrowserEnv||$s.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(je.isFunction(n.getHeaders)){const c=n.getHeaders(),d=["content-type","content-length"];Object.entries(c).forEach(([h,m])=>{d.includes(h.toLowerCase())&&a.set(h,m)})}}if($s.hasStandardBrowserEnv&&(r&&je.isFunction(r)&&(r=r(e)),r||r!==!1&&Mne(e.url))){const c=s&&i&&Rne.read(i);c&&a.set(s,c)}return e},zne=typeof XMLHttpRequest<"u",Ine=zne&&function(t){return new Promise(function(n,r){const s=GI(t);let i=s.data;const a=Oi.from(s.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:d}=s,h,m,g,x,y;function w(){x&&x(),y&&y(),s.cancelToken&&s.cancelToken.unsubscribe(h),s.signal&&s.signal.removeEventListener("abort",h)}let S=new XMLHttpRequest;S.open(s.method.toUpperCase(),s.url,!0),S.timeout=s.timeout;function k(){if(!S)return;const N=Oi.from("getAllResponseHeaders"in S&&S.getAllResponseHeaders()),E={data:!l||l==="text"||l==="json"?S.responseText:S.response,status:S.status,statusText:S.statusText,headers:N,config:t,request:S};UI(function(A){n(A),w()},function(A){r(A),w()},E),S=null}"onloadend"in S?S.onloadend=k:S.onreadystatechange=function(){!S||S.readyState!==4||S.status===0&&!(S.responseURL&&S.responseURL.indexOf("file:")===0)||setTimeout(k)},S.onabort=function(){S&&(r(new Zt("Request aborted",Zt.ECONNABORTED,t,S)),S=null)},S.onerror=function(T){const E=T&&T.message?T.message:"Network Error",_=new Zt(E,Zt.ERR_NETWORK,t,S);_.event=T||null,r(_),S=null},S.ontimeout=function(){let T=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const E=s.transitional||HI;s.timeoutErrorMessage&&(T=s.timeoutErrorMessage),r(new Zt(T,E.clarifyTimeoutError?Zt.ETIMEDOUT:Zt.ECONNABORTED,t,S)),S=null},i===void 0&&a.setContentType(null),"setRequestHeader"in S&&je.forEach(a.toJSON(),function(T,E){S.setRequestHeader(E,T)}),je.isUndefined(s.withCredentials)||(S.withCredentials=!!s.withCredentials),l&&l!=="json"&&(S.responseType=s.responseType),d&&([g,y]=qv(d,!0),S.addEventListener("progress",g)),c&&S.upload&&([m,x]=qv(c),S.upload.addEventListener("progress",m),S.upload.addEventListener("loadend",x)),(s.cancelToken||s.signal)&&(h=N=>{S&&(r(!N||N.type?new bf(null,t,S):N),S.abort(),S=null)},s.cancelToken&&s.cancelToken.subscribe(h),s.signal&&(s.signal.aborted?h():s.signal.addEventListener("abort",h)));const j=Ene(s.url);if(j&&$s.protocols.indexOf(j)===-1){r(new Zt("Unsupported protocol "+j+":",Zt.ERR_BAD_REQUEST,t));return}S.send(i||null)})},Lne=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let r=new AbortController,s;const i=function(d){if(!s){s=!0,l();const h=d instanceof Error?d:this.reason;r.abort(h instanceof Zt?h:new bf(h instanceof Error?h.message:h))}};let a=e&&setTimeout(()=>{a=null,i(new Zt(`timeout ${e} of ms exceeded`,Zt.ETIMEDOUT))},e);const l=()=>{t&&(a&&clearTimeout(a),a=null,t.forEach(d=>{d.unsubscribe?d.unsubscribe(i):d.removeEventListener("abort",i)}),t=null)};t.forEach(d=>d.addEventListener("abort",i));const{signal:c}=r;return c.unsubscribe=()=>je.asap(l),c}},Bne=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let r=0,s;for(;r<n;)s=r+e,yield t.slice(r,s),r=s},Fne=async function*(t,e){for await(const n of qne(t))yield*Bne(n,e)},qne=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:r}=await e.read();if(n)break;yield r}}finally{await e.cancel()}},H9=(t,e,n,r)=>{const s=Fne(t,e);let i=0,a,l=c=>{a||(a=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:d,value:h}=await s.next();if(d){l(),c.close();return}let m=h.byteLength;if(n){let g=i+=m;n(g)}c.enqueue(new Uint8Array(h))}catch(d){throw l(d),d}},cancel(c){return l(c),s.return()}},{highWaterMark:2})},Q9=64*1024,{isFunction:e1}=je,$ne=(({Request:t,Response:e})=>({Request:t,Response:e}))(je.global),{ReadableStream:V9,TextEncoder:U9}=je.global,W9=(t,...e)=>{try{return!!t(...e)}catch{return!1}},Hne=t=>{t=je.merge.call({skipUndefined:!0},$ne,t);const{fetch:e,Request:n,Response:r}=t,s=e?e1(e):typeof fetch=="function",i=e1(n),a=e1(r);if(!s)return!1;const l=s&&e1(V9),c=s&&(typeof U9=="function"?(y=>w=>y.encode(w))(new U9):async y=>new Uint8Array(await new n(y).arrayBuffer())),d=i&&l&&W9(()=>{let y=!1;const w=new n($s.origin,{body:new V9,method:"POST",get duplex(){return y=!0,"half"}}).headers.has("Content-Type");return y&&!w}),h=a&&l&&W9(()=>je.isReadableStream(new r("").body)),m={stream:h&&(y=>y.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(y=>{!m[y]&&(m[y]=(w,S)=>{let k=w&&w[y];if(k)return k.call(w);throw new Zt(`Response type '${y}' is not supported`,Zt.ERR_NOT_SUPPORT,S)})});const g=async y=>{if(y==null)return 0;if(je.isBlob(y))return y.size;if(je.isSpecCompliantForm(y))return(await new n($s.origin,{method:"POST",body:y}).arrayBuffer()).byteLength;if(je.isArrayBufferView(y)||je.isArrayBuffer(y))return y.byteLength;if(je.isURLSearchParams(y)&&(y=y+""),je.isString(y))return(await c(y)).byteLength},x=async(y,w)=>{const S=je.toFiniteNumber(y.getContentLength());return S??g(w)};return async y=>{let{url:w,method:S,data:k,signal:j,cancelToken:N,timeout:T,onDownloadProgress:E,onUploadProgress:_,responseType:A,headers:D,withCredentials:q="same-origin",fetchOptions:B}=GI(y),H=e||fetch;A=A?(A+"").toLowerCase():"text";let W=Lne([j,N&&N.toAbortSignal()],T),ee=null;const I=W&&W.unsubscribe&&(()=>{W.unsubscribe()});let V;try{if(_&&d&&S!=="get"&&S!=="head"&&(V=await x(D,k))!==0){let ie=new n(w,{method:"POST",body:k,duplex:"half"}),X;if(je.isFormData(k)&&(X=ie.headers.get("content-type"))&&D.setContentType(X),ie.body){const[z,U]=F9(V,qv(q9(_)));k=H9(ie.body,Q9,z,U)}}je.isString(q)||(q=q?"include":"omit");const L=i&&"credentials"in n.prototype,$={...B,signal:W,method:S.toUpperCase(),headers:D.normalize().toJSON(),body:k,duplex:"half",credentials:L?q:void 0};ee=i&&new n(w,$);let K=await(i?H(ee,B):H(w,$));const Y=h&&(A==="stream"||A==="response");if(h&&(E||Y&&I)){const ie={};["status","statusText","headers"].forEach(te=>{ie[te]=K[te]});const X=je.toFiniteNumber(K.headers.get("content-length")),[z,U]=E&&F9(X,qv(q9(E),!0))||[];K=new r(H9(K.body,Q9,z,()=>{U&&U(),I&&I()}),ie)}A=A||"text";let R=await m[je.findKey(m,A)||"text"](K,y);return!Y&&I&&I(),await new Promise((ie,X)=>{UI(ie,X,{data:R,headers:Oi.from(K.headers),status:K.status,statusText:K.statusText,config:y,request:ee})})}catch(L){throw I&&I(),L&&L.name==="TypeError"&&/Load failed|fetch/i.test(L.message)?Object.assign(new Zt("Network Error",Zt.ERR_NETWORK,y,ee),{cause:L.cause||L}):Zt.from(L,L&&L.code,y,ee)}}},Qne=new Map,XI=t=>{let e=t&&t.env||{};const{fetch:n,Request:r,Response:s}=e,i=[r,s,n];let a=i.length,l=a,c,d,h=Qne;for(;l--;)c=i[l],d=h.get(c),d===void 0&&h.set(c,d=l?new Map:Hne(e)),h=d;return d};XI();const $j={http:one,xhr:Ine,fetch:{get:XI}};je.forEach($j,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const G9=t=>`- ${t}`,Vne=t=>je.isFunction(t)||t===null||t===!1;function Une(t,e){t=je.isArray(t)?t:[t];const{length:n}=t;let r,s;const i={};for(let a=0;a<n;a++){r=t[a];let l;if(s=r,!Vne(r)&&(s=$j[(l=String(r)).toLowerCase()],s===void 0))throw new Zt(`Unknown adapter '${l}'`);if(s&&(je.isFunction(s)||(s=s.get(e))))break;i[l||"#"+a]=s}if(!s){const a=Object.entries(i).map(([c,d])=>`adapter ${c} `+(d===!1?"is not supported by the environment":"is not available in the build"));let l=n?a.length>1?`since :
|
||
`+a.map(G9).join(`
|
||
`):" "+G9(a[0]):"as no adapter specified";throw new Zt("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return s}const YI={getAdapter:Une,adapters:$j};function E4(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new bf(null,t)}function X9(t){return E4(t),t.headers=Oi.from(t.headers),t.data=T4.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),YI.getAdapter(t.adapter||$p.adapter,t)(t).then(function(r){return E4(t),r.data=T4.call(t,t.transformResponse,r),r.headers=Oi.from(r.headers),r},function(r){return VI(r)||(E4(t),r&&r.response&&(r.response.data=T4.call(t,t.transformResponse,r.response),r.response.headers=Oi.from(r.response.headers))),Promise.reject(r)})}const KI="1.13.2",rb={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{rb[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const Y9={};rb.transitional=function(e,n,r){function s(i,a){return"[Axios v"+KI+"] Transitional option '"+i+"'"+a+(r?". "+r:"")}return(i,a,l)=>{if(e===!1)throw new Zt(s(a," has been removed"+(n?" in "+n:"")),Zt.ERR_DEPRECATED);return n&&!Y9[a]&&(Y9[a]=!0,console.warn(s(a," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(i,a,l):!0}};rb.spelling=function(e){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function Wne(t,e,n){if(typeof t!="object")throw new Zt("options must be an object",Zt.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let s=r.length;for(;s-- >0;){const i=r[s],a=e[i];if(a){const l=t[i],c=l===void 0||a(l,i,t);if(c!==!0)throw new Zt("option "+i+" must be "+c,Zt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Zt("Unknown option "+i,Zt.ERR_BAD_OPTION)}}const ov={assertOptions:Wne,validators:rb},fo=ov.validators;let nd=class{constructor(e){this.defaults=e||{},this.interceptors={request:new L9,response:new L9}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const i=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
||
`+i):r.stack=i}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=ad(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&ov.assertOptions(r,{silentJSONParsing:fo.transitional(fo.boolean),forcedJSONParsing:fo.transitional(fo.boolean),clarifyTimeoutError:fo.transitional(fo.boolean)},!1),s!=null&&(je.isFunction(s)?n.paramsSerializer={serialize:s}:ov.assertOptions(s,{encode:fo.function,serialize:fo.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),ov.assertOptions(n,{baseUrl:fo.spelling("baseURL"),withXsrfToken:fo.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=i&&je.merge(i.common,i[n.method]);i&&je.forEach(["delete","get","head","post","put","patch","common"],y=>{delete i[y]}),n.headers=Oi.concat(a,i);const l=[];let c=!0;this.interceptors.request.forEach(function(w){typeof w.runWhen=="function"&&w.runWhen(n)===!1||(c=c&&w.synchronous,l.unshift(w.fulfilled,w.rejected))});const d=[];this.interceptors.response.forEach(function(w){d.push(w.fulfilled,w.rejected)});let h,m=0,g;if(!c){const y=[X9.bind(this),void 0];for(y.unshift(...l),y.push(...d),g=y.length,h=Promise.resolve(n);m<g;)h=h.then(y[m++],y[m++]);return h}g=l.length;let x=n;for(;m<g;){const y=l[m++],w=l[m++];try{x=y(x)}catch(S){w.call(this,S);break}}try{h=X9.call(this,x)}catch(y){return Promise.reject(y)}for(m=0,g=d.length;m<g;)h=h.then(d[m++],d[m++]);return h}getUri(e){e=ad(this.defaults,e);const n=WI(e.baseURL,e.url,e.allowAbsoluteUrls);return $I(n,e.params,e.paramsSerializer)}};je.forEach(["delete","get","head","options"],function(e){nd.prototype[e]=function(n,r){return this.request(ad(r||{},{method:e,url:n,data:(r||{}).data}))}});je.forEach(["post","put","patch"],function(e){function n(r){return function(i,a,l){return this.request(ad(l||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))}}nd.prototype[e]=n(),nd.prototype[e+"Form"]=n(!0)});let Gne=class ZI{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(s=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](s);r._listeners=null}),this.promise.then=s=>{let i;const a=new Promise(l=>{r.subscribe(l),i=l}).then(s);return a.cancel=function(){r.unsubscribe(i)},a},e(function(i,a,l){r.reason||(r.reason=new bf(i,a,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new ZI(function(s){e=s}),cancel:e}}};function Xne(t){return function(n){return t.apply(null,n)}}function Yne(t){return je.isObject(t)&&t.isAxiosError===!0}const hk={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(hk).forEach(([t,e])=>{hk[e]=t});function JI(t){const e=new nd(t),n=_I(nd.prototype.request,e);return je.extend(n,nd.prototype,e,{allOwnKeys:!0}),je.extend(n,e,null,{allOwnKeys:!0}),n.create=function(s){return JI(ad(t,s))},n}const Cr=JI($p);Cr.Axios=nd;Cr.CanceledError=bf;Cr.CancelToken=Gne;Cr.isCancel=VI;Cr.VERSION=KI;Cr.toFormData=nb;Cr.AxiosError=Zt;Cr.Cancel=Cr.CanceledError;Cr.all=function(e){return Promise.all(e)};Cr.spread=Xne;Cr.isAxiosError=Yne;Cr.mergeConfig=ad;Cr.AxiosHeaders=Oi;Cr.formToJSON=t=>QI(je.isHTMLForm(t)?new FormData(t):t);Cr.getAdapter=YI.getAdapter;Cr.HttpStatusCode=hk;Cr.default=Cr;const{Axios:fPe,AxiosError:mPe,CanceledError:pPe,isCancel:gPe,CancelToken:xPe,VERSION:vPe,all:yPe,Cancel:bPe,isAxiosError:wPe,spread:SPe,toFormData:kPe,AxiosHeaders:OPe,HttpStatusCode:jPe,formToJSON:NPe,getAdapter:CPe,mergeConfig:TPe}=Cr,Kne=(t,e)=>{const n=new Array(t.length+e.length);for(let r=0;r<t.length;r++)n[r]=t[r];for(let r=0;r<e.length;r++)n[t.length+r]=e[r];return n},Zne=(t,e)=>({classGroupId:t,validator:e}),eL=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),$v="-",K9=[],Jne="arbitrary..",ere=t=>{const e=nre(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return tre(a);const l=a.split($v),c=l[0]===""&&l.length>1?1:0;return tL(l,c,e)},getConflictingClassGroupIds:(a,l)=>{if(l){const c=r[a],d=n[a];return c?d?Kne(d,c):c:d||K9}return n[a]||K9}}},tL=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const s=t[e],i=n.nextPart.get(s);if(i){const d=tL(t,e+1,i);if(d)return d}const a=n.validators;if(a===null)return;const l=e===0?t.join($v):t.slice(e).join($v),c=a.length;for(let d=0;d<c;d++){const h=a[d];if(h.validator(l))return h.classGroupId}},tre=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),r=e.slice(0,n);return r?Jne+r:void 0})(),nre=t=>{const{theme:e,classGroups:n}=t;return rre(n,e)},rre=(t,e)=>{const n=eL();for(const r in t){const s=t[r];Hj(s,n,r,e)}return n},Hj=(t,e,n,r)=>{const s=t.length;for(let i=0;i<s;i++){const a=t[i];sre(a,e,n,r)}},sre=(t,e,n,r)=>{if(typeof t=="string"){ire(t,e,n);return}if(typeof t=="function"){are(t,e,n,r);return}ore(t,e,n,r)},ire=(t,e,n)=>{const r=t===""?e:nL(e,t);r.classGroupId=n},are=(t,e,n,r)=>{if(lre(t)){Hj(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(Zne(n,t))},ore=(t,e,n,r)=>{const s=Object.entries(t),i=s.length;for(let a=0;a<i;a++){const[l,c]=s[a];Hj(c,nL(e,l),n,r)}},nL=(t,e)=>{let n=t;const r=e.split($v),s=r.length;for(let i=0;i<s;i++){const a=r[i];let l=n.nextPart.get(a);l||(l=eL(),n.nextPart.set(a,l)),n=l}return n},lre=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,cre=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),r=Object.create(null);const s=(i,a)=>{n[i]=a,e++,e>t&&(e=0,r=n,n=Object.create(null))};return{get(i){let a=n[i];if(a!==void 0)return a;if((a=r[i])!==void 0)return s(i,a),a},set(i,a){i in n?n[i]=a:s(i,a)}}},fk="!",Z9=":",ure=[],J9=(t,e,n,r,s)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),dre=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=s=>{const i=[];let a=0,l=0,c=0,d;const h=s.length;for(let w=0;w<h;w++){const S=s[w];if(a===0&&l===0){if(S===Z9){i.push(s.slice(c,w)),c=w+1;continue}if(S==="/"){d=w;continue}}S==="["?a++:S==="]"?a--:S==="("?l++:S===")"&&l--}const m=i.length===0?s:s.slice(c);let g=m,x=!1;m.endsWith(fk)?(g=m.slice(0,-1),x=!0):m.startsWith(fk)&&(g=m.slice(1),x=!0);const y=d&&d>c?d-c:void 0;return J9(i,x,g,y)};if(e){const s=e+Z9,i=r;r=a=>a.startsWith(s)?i(a.slice(s.length)):J9(ure,!1,a,void 0,!0)}if(n){const s=r;r=i=>n({className:i,parseClassName:s})}return r},hre=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,r)=>{e.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let i=0;i<n.length;i++){const a=n[i],l=a[0]==="[",c=e.has(a);l||c?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(a)):s.push(a)}return s.length>0&&(s.sort(),r.push(...s)),r}},fre=t=>({cache:cre(t.cacheSize),parseClassName:dre(t),sortModifiers:hre(t),...ere(t)}),mre=/\s+/,pre=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i}=e,a=[],l=t.trim().split(mre);let c="";for(let d=l.length-1;d>=0;d-=1){const h=l[d],{isExternal:m,modifiers:g,hasImportantModifier:x,baseClassName:y,maybePostfixModifierPosition:w}=n(h);if(m){c=h+(c.length>0?" "+c:c);continue}let S=!!w,k=r(S?y.substring(0,w):y);if(!k){if(!S){c=h+(c.length>0?" "+c:c);continue}if(k=r(y),!k){c=h+(c.length>0?" "+c:c);continue}S=!1}const j=g.length===0?"":g.length===1?g[0]:i(g).join(":"),N=x?j+fk:j,T=N+k;if(a.indexOf(T)>-1)continue;a.push(T);const E=s(k,S);for(let _=0;_<E.length;++_){const A=E[_];a.push(N+A)}c=h+(c.length>0?" "+c:c)}return c},gre=(...t)=>{let e=0,n,r,s="";for(;e<t.length;)(n=t[e++])&&(r=rL(n))&&(s&&(s+=" "),s+=r);return s},rL=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=rL(t[r]))&&(n&&(n+=" "),n+=e);return n},xre=(t,...e)=>{let n,r,s,i;const a=c=>{const d=e.reduce((h,m)=>m(h),t());return n=fre(d),r=n.cache.get,s=n.cache.set,i=l,l(c)},l=c=>{const d=r(c);if(d)return d;const h=pre(c,n);return s(c,h),h};return i=a,(...c)=>i(gre(...c))},vre=[],cs=t=>{const e=n=>n[t]||vre;return e.isThemeGetter=!0,e},sL=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,iL=/^\((?:(\w[\w-]*):)?(.+)\)$/i,yre=/^\d+\/\d+$/,bre=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,wre=/\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$/,Sre=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,kre=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ore=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,oh=t=>yre.test(t),sn=t=>!!t&&!Number.isNaN(Number(t)),Tc=t=>!!t&&Number.isInteger(Number(t)),_4=t=>t.endsWith("%")&&sn(t.slice(0,-1)),bl=t=>bre.test(t),jre=()=>!0,Nre=t=>wre.test(t)&&!Sre.test(t),aL=()=>!1,Cre=t=>kre.test(t),Tre=t=>Ore.test(t),Ere=t=>!ft(t)&&!mt(t),_re=t=>wf(t,cL,aL),ft=t=>sL.test(t),Pu=t=>wf(t,uL,Nre),A4=t=>wf(t,Pre,sn),eE=t=>wf(t,oL,aL),Are=t=>wf(t,lL,Tre),t1=t=>wf(t,dL,Cre),mt=t=>iL.test(t),Lm=t=>Sf(t,uL),Mre=t=>Sf(t,zre),tE=t=>Sf(t,oL),Rre=t=>Sf(t,cL),Dre=t=>Sf(t,lL),n1=t=>Sf(t,dL,!0),wf=(t,e,n)=>{const r=sL.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},Sf=(t,e,n=!1)=>{const r=iL.exec(t);return r?r[1]?e(r[1]):n:!1},oL=t=>t==="position"||t==="percentage",lL=t=>t==="image"||t==="url",cL=t=>t==="length"||t==="size"||t==="bg-size",uL=t=>t==="length",Pre=t=>t==="number",zre=t=>t==="family-name",dL=t=>t==="shadow",Ire=()=>{const t=cs("color"),e=cs("font"),n=cs("text"),r=cs("font-weight"),s=cs("tracking"),i=cs("leading"),a=cs("breakpoint"),l=cs("container"),c=cs("spacing"),d=cs("radius"),h=cs("shadow"),m=cs("inset-shadow"),g=cs("text-shadow"),x=cs("drop-shadow"),y=cs("blur"),w=cs("perspective"),S=cs("aspect"),k=cs("ease"),j=cs("animate"),N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],T=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...T(),mt,ft],_=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto","contain","none"],D=()=>[mt,ft,c],q=()=>[oh,"full","auto",...D()],B=()=>[Tc,"none","subgrid",mt,ft],H=()=>["auto",{span:["full",Tc,mt,ft]},Tc,mt,ft],W=()=>[Tc,"auto",mt,ft],ee=()=>["auto","min","max","fr",mt,ft],I=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],V=()=>["start","end","center","stretch","center-safe","end-safe"],L=()=>["auto",...D()],$=()=>[oh,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...D()],K=()=>[t,mt,ft],Y=()=>[...T(),tE,eE,{position:[mt,ft]}],R=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ie=()=>["auto","cover","contain",Rre,_re,{size:[mt,ft]}],X=()=>[_4,Lm,Pu],z=()=>["","none","full",d,mt,ft],U=()=>["",sn,Lm,Pu],te=()=>["solid","dashed","dotted","double"],ne=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],G=()=>[sn,_4,tE,eE],se=()=>["","none",y,mt,ft],re=()=>["none",sn,mt,ft],ae=()=>["none",sn,mt,ft],_e=()=>[sn,mt,ft],Be=()=>[oh,"full",...D()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[bl],breakpoint:[bl],color:[jre],container:[bl],"drop-shadow":[bl],ease:["in","out","in-out"],font:[Ere],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[bl],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[bl],shadow:[bl],spacing:["px",sn],text:[bl],"text-shadow":[bl],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",oh,ft,mt,S]}],container:["container"],columns:[{columns:[sn,ft,mt,l]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:E()}],overflow:[{overflow:_()}],"overflow-x":[{"overflow-x":_()}],"overflow-y":[{"overflow-y":_()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:q()}],"inset-x":[{"inset-x":q()}],"inset-y":[{"inset-y":q()}],start:[{start:q()}],end:[{end:q()}],top:[{top:q()}],right:[{right:q()}],bottom:[{bottom:q()}],left:[{left:q()}],visibility:["visible","invisible","collapse"],z:[{z:[Tc,"auto",mt,ft]}],basis:[{basis:[oh,"full","auto",l,...D()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[sn,oh,"auto","initial","none",ft]}],grow:[{grow:["",sn,mt,ft]}],shrink:[{shrink:["",sn,mt,ft]}],order:[{order:[Tc,"first","last","none",mt,ft]}],"grid-cols":[{"grid-cols":B()}],"col-start-end":[{col:H()}],"col-start":[{"col-start":W()}],"col-end":[{"col-end":W()}],"grid-rows":[{"grid-rows":B()}],"row-start-end":[{row:H()}],"row-start":[{"row-start":W()}],"row-end":[{"row-end":W()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ee()}],"auto-rows":[{"auto-rows":ee()}],gap:[{gap:D()}],"gap-x":[{"gap-x":D()}],"gap-y":[{"gap-y":D()}],"justify-content":[{justify:[...I(),"normal"]}],"justify-items":[{"justify-items":[...V(),"normal"]}],"justify-self":[{"justify-self":["auto",...V()]}],"align-content":[{content:["normal",...I()]}],"align-items":[{items:[...V(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...V(),{baseline:["","last"]}]}],"place-content":[{"place-content":I()}],"place-items":[{"place-items":[...V(),"baseline"]}],"place-self":[{"place-self":["auto",...V()]}],p:[{p:D()}],px:[{px:D()}],py:[{py:D()}],ps:[{ps:D()}],pe:[{pe:D()}],pt:[{pt:D()}],pr:[{pr:D()}],pb:[{pb:D()}],pl:[{pl:D()}],m:[{m:L()}],mx:[{mx:L()}],my:[{my:L()}],ms:[{ms:L()}],me:[{me:L()}],mt:[{mt:L()}],mr:[{mr:L()}],mb:[{mb:L()}],ml:[{ml:L()}],"space-x":[{"space-x":D()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":D()}],"space-y-reverse":["space-y-reverse"],size:[{size:$()}],w:[{w:[l,"screen",...$()]}],"min-w":[{"min-w":[l,"screen","none",...$()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[a]},...$()]}],h:[{h:["screen","lh",...$()]}],"min-h":[{"min-h":["screen","lh","none",...$()]}],"max-h":[{"max-h":["screen","lh",...$()]}],"font-size":[{text:["base",n,Lm,Pu]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,mt,A4]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",_4,ft]}],"font-family":[{font:[Mre,ft,e]}],"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:[s,mt,ft]}],"line-clamp":[{"line-clamp":[sn,"none",mt,A4]}],leading:[{leading:[i,...D()]}],"list-image":[{"list-image":["none",mt,ft]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",mt,ft]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:K()}],"text-color":[{text:K()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...te(),"wavy"]}],"text-decoration-thickness":[{decoration:[sn,"from-font","auto",mt,Pu]}],"text-decoration-color":[{decoration:K()}],"underline-offset":[{"underline-offset":[sn,"auto",mt,ft]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",mt,ft]}],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",mt,ft]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Y()}],"bg-repeat":[{bg:R()}],"bg-size":[{bg:ie()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Tc,mt,ft],radial:["",mt,ft],conic:[Tc,mt,ft]},Dre,Are]}],"bg-color":[{bg:K()}],"gradient-from-pos":[{from:X()}],"gradient-via-pos":[{via:X()}],"gradient-to-pos":[{to:X()}],"gradient-from":[{from:K()}],"gradient-via":[{via:K()}],"gradient-to":[{to:K()}],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:U()}],"border-w-x":[{"border-x":U()}],"border-w-y":[{"border-y":U()}],"border-w-s":[{"border-s":U()}],"border-w-e":[{"border-e":U()}],"border-w-t":[{"border-t":U()}],"border-w-r":[{"border-r":U()}],"border-w-b":[{"border-b":U()}],"border-w-l":[{"border-l":U()}],"divide-x":[{"divide-x":U()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":U()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...te(),"hidden","none"]}],"divide-style":[{divide:[...te(),"hidden","none"]}],"border-color":[{border:K()}],"border-color-x":[{"border-x":K()}],"border-color-y":[{"border-y":K()}],"border-color-s":[{"border-s":K()}],"border-color-e":[{"border-e":K()}],"border-color-t":[{"border-t":K()}],"border-color-r":[{"border-r":K()}],"border-color-b":[{"border-b":K()}],"border-color-l":[{"border-l":K()}],"divide-color":[{divide:K()}],"outline-style":[{outline:[...te(),"none","hidden"]}],"outline-offset":[{"outline-offset":[sn,mt,ft]}],"outline-w":[{outline:["",sn,Lm,Pu]}],"outline-color":[{outline:K()}],shadow:[{shadow:["","none",h,n1,t1]}],"shadow-color":[{shadow:K()}],"inset-shadow":[{"inset-shadow":["none",m,n1,t1]}],"inset-shadow-color":[{"inset-shadow":K()}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:K()}],"ring-offset-w":[{"ring-offset":[sn,Pu]}],"ring-offset-color":[{"ring-offset":K()}],"inset-ring-w":[{"inset-ring":U()}],"inset-ring-color":[{"inset-ring":K()}],"text-shadow":[{"text-shadow":["none",g,n1,t1]}],"text-shadow-color":[{"text-shadow":K()}],opacity:[{opacity:[sn,mt,ft]}],"mix-blend":[{"mix-blend":[...ne(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ne()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[sn]}],"mask-image-linear-from-pos":[{"mask-linear-from":G()}],"mask-image-linear-to-pos":[{"mask-linear-to":G()}],"mask-image-linear-from-color":[{"mask-linear-from":K()}],"mask-image-linear-to-color":[{"mask-linear-to":K()}],"mask-image-t-from-pos":[{"mask-t-from":G()}],"mask-image-t-to-pos":[{"mask-t-to":G()}],"mask-image-t-from-color":[{"mask-t-from":K()}],"mask-image-t-to-color":[{"mask-t-to":K()}],"mask-image-r-from-pos":[{"mask-r-from":G()}],"mask-image-r-to-pos":[{"mask-r-to":G()}],"mask-image-r-from-color":[{"mask-r-from":K()}],"mask-image-r-to-color":[{"mask-r-to":K()}],"mask-image-b-from-pos":[{"mask-b-from":G()}],"mask-image-b-to-pos":[{"mask-b-to":G()}],"mask-image-b-from-color":[{"mask-b-from":K()}],"mask-image-b-to-color":[{"mask-b-to":K()}],"mask-image-l-from-pos":[{"mask-l-from":G()}],"mask-image-l-to-pos":[{"mask-l-to":G()}],"mask-image-l-from-color":[{"mask-l-from":K()}],"mask-image-l-to-color":[{"mask-l-to":K()}],"mask-image-x-from-pos":[{"mask-x-from":G()}],"mask-image-x-to-pos":[{"mask-x-to":G()}],"mask-image-x-from-color":[{"mask-x-from":K()}],"mask-image-x-to-color":[{"mask-x-to":K()}],"mask-image-y-from-pos":[{"mask-y-from":G()}],"mask-image-y-to-pos":[{"mask-y-to":G()}],"mask-image-y-from-color":[{"mask-y-from":K()}],"mask-image-y-to-color":[{"mask-y-to":K()}],"mask-image-radial":[{"mask-radial":[mt,ft]}],"mask-image-radial-from-pos":[{"mask-radial-from":G()}],"mask-image-radial-to-pos":[{"mask-radial-to":G()}],"mask-image-radial-from-color":[{"mask-radial-from":K()}],"mask-image-radial-to-color":[{"mask-radial-to":K()}],"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":T()}],"mask-image-conic-pos":[{"mask-conic":[sn]}],"mask-image-conic-from-pos":[{"mask-conic-from":G()}],"mask-image-conic-to-pos":[{"mask-conic-to":G()}],"mask-image-conic-from-color":[{"mask-conic-from":K()}],"mask-image-conic-to-color":[{"mask-conic-to":K()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Y()}],"mask-repeat":[{mask:R()}],"mask-size":[{mask:ie()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",mt,ft]}],filter:[{filter:["","none",mt,ft]}],blur:[{blur:se()}],brightness:[{brightness:[sn,mt,ft]}],contrast:[{contrast:[sn,mt,ft]}],"drop-shadow":[{"drop-shadow":["","none",x,n1,t1]}],"drop-shadow-color":[{"drop-shadow":K()}],grayscale:[{grayscale:["",sn,mt,ft]}],"hue-rotate":[{"hue-rotate":[sn,mt,ft]}],invert:[{invert:["",sn,mt,ft]}],saturate:[{saturate:[sn,mt,ft]}],sepia:[{sepia:["",sn,mt,ft]}],"backdrop-filter":[{"backdrop-filter":["","none",mt,ft]}],"backdrop-blur":[{"backdrop-blur":se()}],"backdrop-brightness":[{"backdrop-brightness":[sn,mt,ft]}],"backdrop-contrast":[{"backdrop-contrast":[sn,mt,ft]}],"backdrop-grayscale":[{"backdrop-grayscale":["",sn,mt,ft]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[sn,mt,ft]}],"backdrop-invert":[{"backdrop-invert":["",sn,mt,ft]}],"backdrop-opacity":[{"backdrop-opacity":[sn,mt,ft]}],"backdrop-saturate":[{"backdrop-saturate":[sn,mt,ft]}],"backdrop-sepia":[{"backdrop-sepia":["",sn,mt,ft]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":D()}],"border-spacing-x":[{"border-spacing-x":D()}],"border-spacing-y":[{"border-spacing-y":D()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",mt,ft]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[sn,"initial",mt,ft]}],ease:[{ease:["linear","initial",k,mt,ft]}],delay:[{delay:[sn,mt,ft]}],animate:[{animate:["none",j,mt,ft]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,mt,ft]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:re()}],"rotate-x":[{"rotate-x":re()}],"rotate-y":[{"rotate-y":re()}],"rotate-z":[{"rotate-z":re()}],scale:[{scale:ae()}],"scale-x":[{"scale-x":ae()}],"scale-y":[{"scale-y":ae()}],"scale-z":[{"scale-z":ae()}],"scale-3d":["scale-3d"],skew:[{skew:_e()}],"skew-x":[{"skew-x":_e()}],"skew-y":[{"skew-y":_e()}],transform:[{transform:[mt,ft,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Be()}],"translate-x":[{"translate-x":Be()}],"translate-y":[{"translate-y":Be()}],"translate-z":[{"translate-z":Be()}],"translate-none":["translate-none"],accent:[{accent:K()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:K()}],"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",mt,ft]}],"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":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"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",mt,ft]}],fill:[{fill:["none",...K()]}],"stroke-w":[{stroke:[sn,Lm,Pu,A4]}],stroke:[{stroke:["none",...K()]}],"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"]}},Lre=xre(Ire);function xe(...t){return Lre(Qz(t))}const Lt=b.forwardRef(({className:t,...e},n)=>o.jsx("div",{ref:n,className:xe("rounded-xl border bg-card text-card-foreground shadow",t),...e}));Lt.displayName="Card";const En=b.forwardRef(({className:t,...e},n)=>o.jsx("div",{ref:n,className:xe("flex flex-col space-y-1.5 p-6",t),...e}));En.displayName="CardHeader";const _n=b.forwardRef(({className:t,...e},n)=>o.jsx("div",{ref:n,className:xe("font-semibold leading-none tracking-tight",t),...e}));_n.displayName="CardTitle";const Wr=b.forwardRef(({className:t,...e},n)=>o.jsx("div",{ref:n,className:xe("text-sm text-muted-foreground",t),...e}));Wr.displayName="CardDescription";const Xn=b.forwardRef(({className:t,...e},n)=>o.jsx("div",{ref:n,className:xe("p-6 pt-0",t),...e}));Xn.displayName="CardContent";const hL=b.forwardRef(({className:t,...e},n)=>o.jsx("div",{ref:n,className:xe("flex items-center p-6 pt-0",t),...e}));hL.displayName="CardFooter";var M4="rovingFocusGroup.onEntryFocus",Bre={bubbles:!1,cancelable:!0},Hp="RovingFocusGroup",[mk,fL,Fre]=Qy(Hp),[qre,sb]=Da(Hp,[Fre]),[$re,Hre]=qre(Hp),mL=b.forwardRef((t,e)=>o.jsx(mk.Provider,{scope:t.__scopeRovingFocusGroup,children:o.jsx(mk.Slot,{scope:t.__scopeRovingFocusGroup,children:o.jsx(Qre,{...t,ref:e})})}));mL.displayName=Hp;var Qre=b.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:h=!1,...m}=t,g=b.useRef(null),x=er(e,g),y=Rp(i),[w,S]=Kl({prop:a,defaultProp:l??null,onChange:c,caller:Hp}),[k,j]=b.useState(!1),N=Rs(d),T=fL(n),E=b.useRef(!1),[_,A]=b.useState(0);return b.useEffect(()=>{const D=g.current;if(D)return D.addEventListener(M4,N),()=>D.removeEventListener(M4,N)},[N]),o.jsx($re,{scope:n,orientation:r,dir:y,loop:s,currentTabStopId:w,onItemFocus:b.useCallback(D=>S(D),[S]),onItemShiftTab:b.useCallback(()=>j(!0),[]),onFocusableItemAdd:b.useCallback(()=>A(D=>D+1),[]),onFocusableItemRemove:b.useCallback(()=>A(D=>D-1),[]),children:o.jsx(Sn.div,{tabIndex:k||_===0?-1:0,"data-orientation":r,...m,ref:x,style:{outline:"none",...t.style},onMouseDown:nt(t.onMouseDown,()=>{E.current=!0}),onFocus:nt(t.onFocus,D=>{const q=!E.current;if(D.target===D.currentTarget&&q&&!k){const B=new CustomEvent(M4,Bre);if(D.currentTarget.dispatchEvent(B),!B.defaultPrevented){const H=T().filter(L=>L.focusable),W=H.find(L=>L.active),ee=H.find(L=>L.id===w),V=[W,ee,...H].filter(Boolean).map(L=>L.ref.current);xL(V,h)}}E.current=!1}),onBlur:nt(t.onBlur,()=>j(!1))})})}),pL="RovingFocusGroupItem",gL=b.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:i,children:a,...l}=t,c=Gi(),d=i||c,h=Hre(pL,n),m=h.currentTabStopId===d,g=fL(n),{onFocusableItemAdd:x,onFocusableItemRemove:y,currentTabStopId:w}=h;return b.useEffect(()=>{if(r)return x(),()=>y()},[r,x,y]),o.jsx(mk.ItemSlot,{scope:n,id:d,focusable:r,active:s,children:o.jsx(Sn.span,{tabIndex:m?0:-1,"data-orientation":h.orientation,...l,ref:e,onMouseDown:nt(t.onMouseDown,S=>{r?h.onItemFocus(d):S.preventDefault()}),onFocus:nt(t.onFocus,()=>h.onItemFocus(d)),onKeyDown:nt(t.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){h.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const k=Wre(S,h.orientation,h.dir);if(k!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let N=g().filter(T=>T.focusable).map(T=>T.ref.current);if(k==="last")N.reverse();else if(k==="prev"||k==="next"){k==="prev"&&N.reverse();const T=N.indexOf(S.currentTarget);N=h.loop?Gre(N,T+1):N.slice(T+1)}setTimeout(()=>xL(N))}}),children:typeof a=="function"?a({isCurrentTabStop:m,hasTabStop:w!=null}):a})})});gL.displayName=pL;var Vre={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Ure(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function Wre(t,e,n){const r=Ure(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Vre[r]}function xL(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function Gre(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var vL=mL,yL=gL,ib="Tabs",[Xre]=Da(ib,[sb]),bL=sb(),[Yre,Qj]=Xre(ib),wL=b.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:i,orientation:a="horizontal",dir:l,activationMode:c="automatic",...d}=t,h=Rp(l),[m,g]=Kl({prop:r,onChange:s,defaultProp:i??"",caller:ib});return o.jsx(Yre,{scope:n,baseId:Gi(),value:m,onValueChange:g,orientation:a,dir:h,activationMode:c,children:o.jsx(Sn.div,{dir:h,"data-orientation":a,...d,ref:e})})});wL.displayName=ib;var SL="TabsList",kL=b.forwardRef((t,e)=>{const{__scopeTabs:n,loop:r=!0,...s}=t,i=Qj(SL,n),a=bL(n);return o.jsx(vL,{asChild:!0,...a,orientation:i.orientation,dir:i.dir,loop:r,children:o.jsx(Sn.div,{role:"tablist","aria-orientation":i.orientation,...s,ref:e})})});kL.displayName=SL;var OL="TabsTrigger",jL=b.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...i}=t,a=Qj(OL,n),l=bL(n),c=TL(a.baseId,r),d=EL(a.baseId,r),h=r===a.value;return o.jsx(yL,{asChild:!0,...l,focusable:!s,active:h,children:o.jsx(Sn.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":d,"data-state":h?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:c,...i,ref:e,onMouseDown:nt(t.onMouseDown,m=>{!s&&m.button===0&&m.ctrlKey===!1?a.onValueChange(r):m.preventDefault()}),onKeyDown:nt(t.onKeyDown,m=>{[" ","Enter"].includes(m.key)&&a.onValueChange(r)}),onFocus:nt(t.onFocus,()=>{const m=a.activationMode!=="manual";!h&&!s&&m&&a.onValueChange(r)})})})});jL.displayName=OL;var NL="TabsContent",CL=b.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,forceMount:s,children:i,...a}=t,l=Qj(NL,n),c=TL(l.baseId,r),d=EL(l.baseId,r),h=r===l.value,m=b.useRef(h);return b.useEffect(()=>{const g=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(g)},[]),o.jsx(oi,{present:s||h,children:({present:g})=>o.jsx(Sn.div,{"data-state":h?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!g,id:d,tabIndex:0,...a,ref:e,style:{...t.style,animationDuration:m.current?"0s":void 0},children:g&&i})})});CL.displayName=NL;function TL(t,e){return`${t}-trigger-${e}`}function EL(t,e){return`${t}-content-${e}`}var Kre=wL,_L=kL,AL=jL,ML=CL;const Yi=Kre,ji=b.forwardRef(({className:t,...e},n)=>o.jsx(_L,{ref:n,className:xe("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",t),...e}));ji.displayName=_L.displayName;const Bt=b.forwardRef(({className:t,...e},n)=>o.jsx(AL,{ref:n,className:xe("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",t),...e}));Bt.displayName=AL.displayName;const ln=b.forwardRef(({className:t,...e},n)=>o.jsx(ML,{ref:n,className:xe("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",t),...e}));ln.displayName=ML.displayName;function Zre(t,e){return b.useReducer((n,r)=>e[n][r]??n,t)}var Vj="ScrollArea",[RL]=Da(Vj),[Jre,Pa]=RL(Vj),DL=b.forwardRef((t,e)=>{const{__scopeScrollArea:n,type:r="hover",dir:s,scrollHideDelay:i=600,...a}=t,[l,c]=b.useState(null),[d,h]=b.useState(null),[m,g]=b.useState(null),[x,y]=b.useState(null),[w,S]=b.useState(null),[k,j]=b.useState(0),[N,T]=b.useState(0),[E,_]=b.useState(!1),[A,D]=b.useState(!1),q=er(e,H=>c(H)),B=Rp(s);return o.jsx(Jre,{scope:n,type:r,dir:B,scrollHideDelay:i,scrollArea:l,viewport:d,onViewportChange:h,content:m,onContentChange:g,scrollbarX:x,onScrollbarXChange:y,scrollbarXEnabled:E,onScrollbarXEnabledChange:_,scrollbarY:w,onScrollbarYChange:S,scrollbarYEnabled:A,onScrollbarYEnabledChange:D,onCornerWidthChange:j,onCornerHeightChange:T,children:o.jsx(Sn.div,{dir:B,...a,ref:q,style:{position:"relative","--radix-scroll-area-corner-width":k+"px","--radix-scroll-area-corner-height":N+"px",...t.style}})})});DL.displayName=Vj;var PL="ScrollAreaViewport",zL=b.forwardRef((t,e)=>{const{__scopeScrollArea:n,children:r,nonce:s,...i}=t,a=Pa(PL,n),l=b.useRef(null),c=er(e,l,a.onViewportChange);return o.jsxs(o.Fragment,{children:[o.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:s}),o.jsx(Sn.div,{"data-radix-scroll-area-viewport":"",...i,ref:c,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...t.style},children:o.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});zL.displayName=PL;var Ho="ScrollAreaScrollbar",Uj=b.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=Pa(Ho,t.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:a}=s,l=t.orientation==="horizontal";return b.useEffect(()=>(l?i(!0):a(!0),()=>{l?i(!1):a(!1)}),[l,i,a]),s.type==="hover"?o.jsx(ese,{...r,ref:e,forceMount:n}):s.type==="scroll"?o.jsx(tse,{...r,ref:e,forceMount:n}):s.type==="auto"?o.jsx(IL,{...r,ref:e,forceMount:n}):s.type==="always"?o.jsx(Wj,{...r,ref:e}):null});Uj.displayName=Ho;var ese=b.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=Pa(Ho,t.__scopeScrollArea),[i,a]=b.useState(!1);return b.useEffect(()=>{const l=s.scrollArea;let c=0;if(l){const d=()=>{window.clearTimeout(c),a(!0)},h=()=>{c=window.setTimeout(()=>a(!1),s.scrollHideDelay)};return l.addEventListener("pointerenter",d),l.addEventListener("pointerleave",h),()=>{window.clearTimeout(c),l.removeEventListener("pointerenter",d),l.removeEventListener("pointerleave",h)}}},[s.scrollArea,s.scrollHideDelay]),o.jsx(oi,{present:n||i,children:o.jsx(IL,{"data-state":i?"visible":"hidden",...r,ref:e})})}),tse=b.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=Pa(Ho,t.__scopeScrollArea),i=t.orientation==="horizontal",a=ob(()=>c("SCROLL_END"),100),[l,c]=Zre("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 b.useEffect(()=>{if(l==="idle"){const d=window.setTimeout(()=>c("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(d)}},[l,s.scrollHideDelay,c]),b.useEffect(()=>{const d=s.viewport,h=i?"scrollLeft":"scrollTop";if(d){let m=d[h];const g=()=>{const x=d[h];m!==x&&(c("SCROLL"),a()),m=x};return d.addEventListener("scroll",g),()=>d.removeEventListener("scroll",g)}},[s.viewport,i,c,a]),o.jsx(oi,{present:n||l!=="hidden",children:o.jsx(Wj,{"data-state":l==="hidden"?"hidden":"visible",...r,ref:e,onPointerEnter:nt(t.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:nt(t.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),IL=b.forwardRef((t,e)=>{const n=Pa(Ho,t.__scopeScrollArea),{forceMount:r,...s}=t,[i,a]=b.useState(!1),l=t.orientation==="horizontal",c=ob(()=>{if(n.viewport){const d=n.viewport.offsetWidth<n.viewport.scrollWidth,h=n.viewport.offsetHeight<n.viewport.scrollHeight;a(l?d:h)}},10);return Yh(n.viewport,c),Yh(n.content,c),o.jsx(oi,{present:r||i,children:o.jsx(Wj,{"data-state":i?"visible":"hidden",...s,ref:e})})}),Wj=b.forwardRef((t,e)=>{const{orientation:n="vertical",...r}=t,s=Pa(Ho,t.__scopeScrollArea),i=b.useRef(null),a=b.useRef(0),[l,c]=b.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=$L(l.viewport,l.content),h={...r,sizes:l,onSizesChange:c,hasThumb:d>0&&d<1,onThumbChange:g=>i.current=g,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:g=>a.current=g};function m(g,x){return ose(g,a.current,l,x)}return n==="horizontal"?o.jsx(nse,{...h,ref:e,onThumbPositionChange:()=>{if(s.viewport&&i.current){const g=s.viewport.scrollLeft,x=nE(g,l,s.dir);i.current.style.transform=`translate3d(${x}px, 0, 0)`}},onWheelScroll:g=>{s.viewport&&(s.viewport.scrollLeft=g)},onDragScroll:g=>{s.viewport&&(s.viewport.scrollLeft=m(g,s.dir))}}):n==="vertical"?o.jsx(rse,{...h,ref:e,onThumbPositionChange:()=>{if(s.viewport&&i.current){const g=s.viewport.scrollTop,x=nE(g,l);i.current.style.transform=`translate3d(0, ${x}px, 0)`}},onWheelScroll:g=>{s.viewport&&(s.viewport.scrollTop=g)},onDragScroll:g=>{s.viewport&&(s.viewport.scrollTop=m(g))}}):null}),nse=b.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...s}=t,i=Pa(Ho,t.__scopeScrollArea),[a,l]=b.useState(),c=b.useRef(null),d=er(e,c,i.onScrollbarXChange);return b.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),o.jsx(BL,{"data-orientation":"horizontal",...s,ref:d,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":ab(n)+"px",...t.style},onThumbPointerDown:h=>t.onThumbPointerDown(h.x),onDragScroll:h=>t.onDragScroll(h.x),onWheelScroll:(h,m)=>{if(i.viewport){const g=i.viewport.scrollLeft+h.deltaX;t.onWheelScroll(g),QL(g,m)&&h.preventDefault()}},onResize:()=>{c.current&&i.viewport&&a&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:Qv(a.paddingLeft),paddingEnd:Qv(a.paddingRight)}})}})}),rse=b.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...s}=t,i=Pa(Ho,t.__scopeScrollArea),[a,l]=b.useState(),c=b.useRef(null),d=er(e,c,i.onScrollbarYChange);return b.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),o.jsx(BL,{"data-orientation":"vertical",...s,ref:d,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":ab(n)+"px",...t.style},onThumbPointerDown:h=>t.onThumbPointerDown(h.y),onDragScroll:h=>t.onDragScroll(h.y),onWheelScroll:(h,m)=>{if(i.viewport){const g=i.viewport.scrollTop+h.deltaY;t.onWheelScroll(g),QL(g,m)&&h.preventDefault()}},onResize:()=>{c.current&&i.viewport&&a&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:Qv(a.paddingTop),paddingEnd:Qv(a.paddingBottom)}})}})}),[sse,LL]=RL(Ho),BL=b.forwardRef((t,e)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:s,onThumbChange:i,onThumbPointerUp:a,onThumbPointerDown:l,onThumbPositionChange:c,onDragScroll:d,onWheelScroll:h,onResize:m,...g}=t,x=Pa(Ho,n),[y,w]=b.useState(null),S=er(e,q=>w(q)),k=b.useRef(null),j=b.useRef(""),N=x.viewport,T=r.content-r.viewport,E=Rs(h),_=Rs(c),A=ob(m,10);function D(q){if(k.current){const B=q.clientX-k.current.left,H=q.clientY-k.current.top;d({x:B,y:H})}}return b.useEffect(()=>{const q=B=>{const H=B.target;y?.contains(H)&&E(B,T)};return document.addEventListener("wheel",q,{passive:!1}),()=>document.removeEventListener("wheel",q,{passive:!1})},[N,y,T,E]),b.useEffect(_,[r,_]),Yh(y,A),Yh(x.content,A),o.jsx(sse,{scope:n,scrollbar:y,hasThumb:s,onThumbChange:Rs(i),onThumbPointerUp:Rs(a),onThumbPositionChange:_,onThumbPointerDown:Rs(l),children:o.jsx(Sn.div,{...g,ref:S,style:{position:"absolute",...g.style},onPointerDown:nt(t.onPointerDown,q=>{q.button===0&&(q.target.setPointerCapture(q.pointerId),k.current=y.getBoundingClientRect(),j.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",x.viewport&&(x.viewport.style.scrollBehavior="auto"),D(q))}),onPointerMove:nt(t.onPointerMove,D),onPointerUp:nt(t.onPointerUp,q=>{const B=q.target;B.hasPointerCapture(q.pointerId)&&B.releasePointerCapture(q.pointerId),document.body.style.webkitUserSelect=j.current,x.viewport&&(x.viewport.style.scrollBehavior=""),k.current=null})})})}),Hv="ScrollAreaThumb",FL=b.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=LL(Hv,t.__scopeScrollArea);return o.jsx(oi,{present:n||s.hasThumb,children:o.jsx(ise,{ref:e,...r})})}),ise=b.forwardRef((t,e)=>{const{__scopeScrollArea:n,style:r,...s}=t,i=Pa(Hv,n),a=LL(Hv,n),{onThumbPositionChange:l}=a,c=er(e,m=>a.onThumbChange(m)),d=b.useRef(void 0),h=ob(()=>{d.current&&(d.current(),d.current=void 0)},100);return b.useEffect(()=>{const m=i.viewport;if(m){const g=()=>{if(h(),!d.current){const x=lse(m,l);d.current=x,l()}};return l(),m.addEventListener("scroll",g),()=>m.removeEventListener("scroll",g)}},[i.viewport,h,l]),o.jsx(Sn.div,{"data-state":a.hasThumb?"visible":"hidden",...s,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:nt(t.onPointerDownCapture,m=>{const x=m.target.getBoundingClientRect(),y=m.clientX-x.left,w=m.clientY-x.top;a.onThumbPointerDown({x:y,y:w})}),onPointerUp:nt(t.onPointerUp,a.onThumbPointerUp)})});FL.displayName=Hv;var Gj="ScrollAreaCorner",qL=b.forwardRef((t,e)=>{const n=Pa(Gj,t.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?o.jsx(ase,{...t,ref:e}):null});qL.displayName=Gj;var ase=b.forwardRef((t,e)=>{const{__scopeScrollArea:n,...r}=t,s=Pa(Gj,n),[i,a]=b.useState(0),[l,c]=b.useState(0),d=!!(i&&l);return Yh(s.scrollbarX,()=>{const h=s.scrollbarX?.offsetHeight||0;s.onCornerHeightChange(h),c(h)}),Yh(s.scrollbarY,()=>{const h=s.scrollbarY?.offsetWidth||0;s.onCornerWidthChange(h),a(h)}),d?o.jsx(Sn.div,{...r,ref:e,style:{width:i,height:l,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...t.style}}):null});function Qv(t){return t?parseInt(t,10):0}function $L(t,e){const n=t/e;return isNaN(n)?0:n}function ab(t){const e=$L(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,r=(t.scrollbar.size-n)*e;return Math.max(r,18)}function ose(t,e,n,r="ltr"){const s=ab(n),i=s/2,a=e||i,l=s-a,c=n.scrollbar.paddingStart+a,d=n.scrollbar.size-n.scrollbar.paddingEnd-l,h=n.content-n.viewport,m=r==="ltr"?[0,h]:[h*-1,0];return HL([c,d],m)(t)}function nE(t,e,n="ltr"){const r=ab(e),s=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,i=e.scrollbar.size-s,a=e.content-e.viewport,l=i-r,c=n==="ltr"?[0,a]:[a*-1,0],d=Tj(t,c);return HL([0,a],[0,l])(d)}function HL(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function QL(t,e){return t>0&&t<e}var lse=(t,e=()=>{})=>{let n={left:t.scrollLeft,top:t.scrollTop},r=0;return(function s(){const i={left:t.scrollLeft,top:t.scrollTop},a=n.left!==i.left,l=n.top!==i.top;(a||l)&&e(),n=i,r=window.requestAnimationFrame(s)})(),()=>window.cancelAnimationFrame(r)};function ob(t,e){const n=Rs(t),r=b.useRef(0);return b.useEffect(()=>()=>window.clearTimeout(r.current),[]),b.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,e)},[n,e])}function Yh(t,e){const n=Rs(e);Wh(()=>{let r=0;if(t){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return s.observe(t),()=>{window.cancelAnimationFrame(r),s.unobserve(t)}}},[t,n])}var VL=DL,cse=zL,use=qL;const pn=b.forwardRef(({className:t,children:e,viewportRef:n,...r},s)=>o.jsxs(VL,{ref:s,className:xe("relative overflow-hidden",t),...r,children:[o.jsx(cse,{ref:n,className:"h-full w-full rounded-[inherit]",children:e}),o.jsx(pk,{}),o.jsx(pk,{orientation:"horizontal"}),o.jsx(use,{})]}));pn.displayName=VL.displayName;const pk=b.forwardRef(({className:t,orientation:e="vertical",...n},r)=>o.jsx(Uj,{ref:r,orientation:e,className:xe("flex touch-none select-none transition-colors",e==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",e==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",t),...n,children:o.jsx(FL,{className:"relative flex-1 rounded-full bg-border"})}));pk.displayName=Uj.displayName;function dse({className:t,...e}){return o.jsx("div",{className:xe("animate-pulse rounded-md bg-primary/10",t),...e})}function hse(t,e=[]){let n=[];function r(i,a){const l=b.createContext(a);l.displayName=i+"Context";const c=n.length;n=[...n,a];const d=m=>{const{scope:g,children:x,...y}=m,w=g?.[t]?.[c]||l,S=b.useMemo(()=>y,Object.values(y));return o.jsx(w.Provider,{value:S,children:x})};d.displayName=i+"Provider";function h(m,g){const x=g?.[t]?.[c]||l,y=b.useContext(x);if(y)return y;if(a!==void 0)return a;throw new Error(`\`${m}\` must be used within \`${i}\``)}return[d,h]}const s=()=>{const i=n.map(a=>b.createContext(a));return function(l){const c=l?.[t]||i;return b.useMemo(()=>({[`__scope${t}`]:{...l,[t]:c}}),[l,c])}};return s.scopeName=t,[r,fse(s,...e)]}function fse(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const a=r.reduce((l,{useScope:c,scopeName:d})=>{const m=c(i)[`__scope${d}`];return{...l,...m}},{});return b.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}var mse=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],UL=mse.reduce((t,e)=>{const n=Vy(`Primitive.${e}`),r=b.forwardRef((s,i)=>{const{asChild:a,...l}=s,c=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...l,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{}),Xj="Progress",Yj=100,[pse]=hse(Xj),[gse,xse]=pse(Xj),WL=b.forwardRef((t,e)=>{const{__scopeProgress:n,value:r=null,max:s,getValueLabel:i=vse,...a}=t;(s||s===0)&&!rE(s)&&console.error(yse(`${s}`,"Progress"));const l=rE(s)?s:Yj;r!==null&&!sE(r,l)&&console.error(bse(`${r}`,"Progress"));const c=sE(r,l)?r:null,d=Vv(c)?i(c,l):void 0;return o.jsx(gse,{scope:n,value:c,max:l,children:o.jsx(UL.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":Vv(c)?c:void 0,"aria-valuetext":d,role:"progressbar","data-state":YL(c,l),"data-value":c??void 0,"data-max":l,...a,ref:e})})});WL.displayName=Xj;var GL="ProgressIndicator",XL=b.forwardRef((t,e)=>{const{__scopeProgress:n,...r}=t,s=xse(GL,n);return o.jsx(UL.div,{"data-state":YL(s.value,s.max),"data-value":s.value??void 0,"data-max":s.max,...r,ref:e})});XL.displayName=GL;function vse(t,e){return`${Math.round(t/e*100)}%`}function YL(t,e){return t==null?"indeterminate":t===e?"complete":"loading"}function Vv(t){return typeof t=="number"}function rE(t){return Vv(t)&&!isNaN(t)&&t>0}function sE(t,e){return Vv(t)&&!isNaN(t)&&t<=e&&t>=0}function yse(t,e){return`Invalid prop \`max\` of value \`${t}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Yj}\`.`}function bse(t,e){return`Invalid prop \`value\` of value \`${t}\` supplied to \`${e}\`. The \`value\` prop must be:
|
||
- a positive number
|
||
- less than the value passed to \`max\` (or ${Yj} if no \`max\` prop is set)
|
||
- \`null\` or \`undefined\` if the progress is indeterminate.
|
||
|
||
Defaulting to \`null\`.`}var KL=WL,wse=XL;const Qp=b.forwardRef(({className:t,value:e,...n},r)=>o.jsx(KL,{ref:r,className:xe("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",t),...n,children:o.jsx(wse,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(e||0)}%)`}})}));Qp.displayName=KL.displayName;const Sse={light:"",dark:".dark"},ZL=b.createContext(null);function JL(){const t=b.useContext(ZL);if(!t)throw new Error("useChart must be used within a <ChartContainer />");return t}const vh=b.forwardRef(({id:t,className:e,children:n,config:r,...s},i)=>{const a=b.useId(),l=`chart-${t||a.replace(/:/g,"")}`;return o.jsx(ZL.Provider,{value:{config:r},children:o.jsxs("div",{"data-chart":l,ref:i,className:xe("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",e),...s,children:[o.jsx(kse,{id:l,config:r}),o.jsx(TJ,{children:n})]})})});vh.displayName="Chart";const kse=({id:t,config:e})=>{const n=Object.entries(e).filter(([,r])=>r.theme||r.color);return n.length?o.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(Sse).map(([r,s])=>`
|
||
${s} [data-chart=${t}] {
|
||
${n.map(([i,a])=>{const l=a.theme?.[r]||a.color;return l?` --color-${i}: ${l};`:null}).join(`
|
||
`)}
|
||
}
|
||
`).join(`
|
||
`)}}):null},Bm=EJ,yh=b.forwardRef(({active:t,payload:e,className:n,indicator:r="dot",hideLabel:s=!1,hideIndicator:i=!1,label:a,labelFormatter:l,labelClassName:c,formatter:d,color:h,nameKey:m,labelKey:g},x)=>{const{config:y}=JL(),w=b.useMemo(()=>{if(s||!e?.length)return null;const[k]=e,j=`${g||k?.dataKey||k?.name||"value"}`,N=gk(y,k,j),T=!g&&typeof a=="string"?y[a]?.label||a:N?.label;return l?o.jsx("div",{className:xe("font-medium",c),children:l(T,e)}):T?o.jsx("div",{className:xe("font-medium",c),children:T}):null},[a,l,e,s,c,y,g]);if(!t||!e?.length)return null;const S=e.length===1&&r!=="dot";return o.jsxs("div",{ref:x,className:xe("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:w,o.jsx("div",{className:"grid gap-1.5",children:e.filter(k=>k.type!=="none").map((k,j)=>{const N=`${m||k.name||k.dataKey||"value"}`,T=gk(y,k,N),E=h||k.payload.fill||k.color;return o.jsx("div",{className:xe("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",r==="dot"&&"items-center"),children:d&&k?.value!==void 0&&k.name?d(k.value,k.name,k,j,k.payload):o.jsxs(o.Fragment,{children:[T?.icon?o.jsx(T.icon,{}):!i&&o.jsx("div",{className:xe("shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]",{"h-2.5 w-2.5":r==="dot","w-1":r==="line","w-0 border-[1.5px] border-dashed bg-transparent":r==="dashed","my-0.5":S&&r==="dashed"}),style:{"--color-bg":E,"--color-border":E}}),o.jsxs("div",{className:xe("flex flex-1 justify-between leading-none",S?"items-end":"items-center"),children:[o.jsxs("div",{className:"grid gap-1.5",children:[S?w:null,o.jsx("span",{className:"text-muted-foreground",children:T?.label||k.name})]}),k.value&&o.jsx("span",{className:"font-mono font-medium tabular-nums text-foreground",children:k.value.toLocaleString()})]})]})},k.dataKey)})})]})});yh.displayName="ChartTooltip";const Ose=_J,eB=b.forwardRef(({className:t,hideIcon:e=!1,payload:n,verticalAlign:r="bottom",nameKey:s},i)=>{const{config:a}=JL();return n?.length?o.jsx("div",{ref:i,className:xe("flex items-center justify-center gap-4",r==="top"?"pb-3":"pt-3",t),children:n.filter(l=>l.type!=="none").map(l=>{const c=`${s||l.dataKey||"value"}`,d=gk(a,l,c);return o.jsxs("div",{className:xe("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"),children:[d?.icon&&!e?o.jsx(d.icon,{}):o.jsx("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:l.color}}),d?.label]},l.value)})}):null});eB.displayName="ChartLegend";function gk(t,e,n){if(typeof e!="object"||e===null)return;const r="payload"in e&&typeof e.payload=="object"&&e.payload!==null?e.payload:void 0;let s=n;return n in e&&typeof e[n]=="string"?s=e[n]:r&&n in r&&typeof r[n]=="string"&&(s=r[n]),s in t?t[s]:t[n]}const iE=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,aE=Qz,kf=(t,e)=>n=>{var r;if(e?.variants==null)return aE(t,n?.class,n?.className);const{variants:s,defaultVariants:i}=e,a=Object.keys(s).map(d=>{const h=n?.[d],m=i?.[d];if(h===null)return null;const g=iE(h)||iE(m);return s[d][g]}),l=n&&Object.entries(n).reduce((d,h)=>{let[m,g]=h;return g===void 0||(d[m]=g),d},{}),c=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((d,h)=>{let{class:m,className:g,...x}=h;return Object.entries(x).every(y=>{let[w,S]=y;return Array.isArray(S)?S.includes({...i,...l}[w]):{...i,...l}[w]===S})?[...d,m,g]:d},[]);return aE(t,a,c,n?.class,n?.className)},q0=kf("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"}}),ue=b.forwardRef(({className:t,variant:e,size:n,asChild:r=!1,...s},i)=>{const a=r?Cee:"button";return o.jsx(a,{className:xe(q0({variant:e,size:n,className:t})),ref:i,...s})});ue.displayName="Button";const jse=kf("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function tn({className:t,variant:e,...n}){return o.jsx("div",{className:xe(jse({variant:e}),t),...n})}const Nse=5,Cse=5e3;let R4=0;function Tse(){return R4=(R4+1)%Number.MAX_SAFE_INTEGER,R4.toString()}const D4=new Map,oE=t=>{if(D4.has(t))return;const e=setTimeout(()=>{D4.delete(t),S0({type:"REMOVE_TOAST",toastId:t})},Cse);D4.set(t,e)},Ese=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,Nse)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(n=>n.id===e.toast.id?{...n,...e.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=e;return n?oE(n):t.toasts.forEach(r=>{oE(r.id)}),{...t,toasts:t.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(n=>n.id!==e.toastId)}}},lv=[];let cv={toasts:[]};function S0(t){cv=Ese(cv,t),lv.forEach(e=>{e(cv)})}function _se({...t}){const e=Tse(),n=s=>S0({type:"UPDATE_TOAST",toast:{...s,id:e}}),r=()=>S0({type:"DISMISS_TOAST",toastId:e});return S0({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:s=>{s||r()}}}),{id:e,dismiss:r,update:n}}function Lr(){const[t,e]=b.useState(cv);return b.useEffect(()=>(lv.push(e),()=>{const n=lv.indexOf(e);n>-1&&lv.splice(n,1)}),[t]),{...t,toast:_se,dismiss:n=>S0({type:"DISMISS_TOAST",toastId:n})}}const Ase=t=>{const e=[];for(let n=0;n<t;n++){const r=n*137.508%360;e.push(`hsl(${r}, 70%, 55%)`)}return e};function Mse(){const[t,e]=b.useState(null),[n,r]=b.useState(!0),[s,i]=b.useState(0),[a,l]=b.useState(24),[c,d]=b.useState(!0),[h,m]=b.useState(null),[g,x]=b.useState(!0),[y,w]=b.useState(null),[S,k]=b.useState(!1),{toast:j}=Lr(),N=b.useCallback(async()=>{try{x(!0);const $=await Cr.get("https://v1.hitokoto.cn/?c=a&c=b&c=c&c=d&c=h&c=i&c=k");m({hitokoto:$.data.hitokoto,from:$.data.from||$.data.from_who||"未知"})}catch($){console.error("获取一言失败:",$),m({hitokoto:"人生就像一盒巧克力,你永远不知道下一颗是什么味道。",from:"阿甘正传"})}finally{x(!1)}},[]),T=b.useCallback(async()=>{try{const $=localStorage.getItem("access-token"),K=await Cr.get("/api/webui/system/status",{headers:{Authorization:`Bearer ${$}`}});w(K.data)}catch($){console.error("获取机器人状态失败:",$),w(null)}},[]),E=async()=>{if(!S)try{k(!0);const $=localStorage.getItem("access-token");await Cr.post("/api/webui/system/restart",{},{headers:{Authorization:`Bearer ${$}`}}),j({title:"重启中",description:"麦麦正在重启,请稍候..."}),setTimeout(()=>{T(),k(!1)},3e3)}catch($){console.error("重启失败:",$),j({title:"重启失败",description:"无法重启麦麦,请检查控制台",variant:"destructive"}),k(!1)}},_=b.useCallback(async()=>{try{const $=localStorage.getItem("access-token"),K=await Cr.get(`/api/webui/statistics/dashboard?hours=${a}`,{headers:{Authorization:`Bearer ${$}`}});e(K.data),r(!1),i(100)}catch($){console.error("Failed to fetch dashboard data:",$),r(!1),i(100)}},[a]);if(b.useEffect(()=>{if(!n)return;i(0);const $=setTimeout(()=>i(15),200),K=setTimeout(()=>i(30),800),Y=setTimeout(()=>i(45),2e3),R=setTimeout(()=>i(60),4e3),ie=setTimeout(()=>i(75),6500),X=setTimeout(()=>i(85),9e3),z=setTimeout(()=>i(92),11e3);return()=>{clearTimeout($),clearTimeout(K),clearTimeout(Y),clearTimeout(R),clearTimeout(ie),clearTimeout(X),clearTimeout(z)}},[n]),b.useEffect(()=>{_(),N(),T()},[_,N,T]),b.useEffect(()=>{if(!c)return;const $=setInterval(()=>{_(),T()},3e4);return()=>clearInterval($)},[c,_,T]),n||!t)return o.jsx("div",{className:"flex items-center justify-center h-[calc(100vh-200px)]",children:o.jsxs("div",{className:"text-center space-y-6 w-full max-w-md px-4",children:[o.jsx(Qs,{className:"h-12 w-12 animate-spin mx-auto text-primary"}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"text-lg font-medium",children:"加载统计数据中..."}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"正在获取麦麦运行数据"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Qp,{value:s,className:"h-2"}),o.jsxs("p",{className:"text-xs text-muted-foreground",children:[s,"%"]})]})]})});const{summary:A,model_stats:D,hourly_data:q,daily_data:B,recent_activity:H}=t,W=$=>{const K=Math.floor($/3600),Y=Math.floor($%3600/60);return`${K}小时${Y}分钟`},ee=$=>new Date($).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}),I=Ase(D.length),V=D.map(($,K)=>({name:$.model_name,value:$.request_count,fill:I[K]})),L={requests:{label:"请求数",color:"hsl(var(--chart-1))"},cost:{label:"花费(¥)",color:"hsl(var(--chart-2))"},tokens:{label:"Tokens",color:"hsl(var(--chart-3))"}};return o.jsx(pn,{className:"h-full",children:o.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"实时监控面板"}),o.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"麦麦运行状态和统计数据一览"})]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx(Yi,{value:a.toString(),onValueChange:$=>l(Number($)),children:o.jsxs(ji,{className:"grid grid-cols-3 w-full sm:w-auto",children:[o.jsx(Bt,{value:"24",children:"24小时"}),o.jsx(Bt,{value:"168",children:"7天"}),o.jsx(Bt,{value:"720",children:"30天"})]})}),o.jsxs(ue,{variant:c?"default":"outline",size:"sm",onClick:()=>d(!c),className:"gap-2",children:[o.jsx(Qs,{className:`h-4 w-4 ${c?"animate-spin":""}`}),o.jsx("span",{className:"hidden sm:inline",children:"自动刷新"})]}),o.jsx(ue,{variant:"outline",size:"sm",onClick:_,children:o.jsx(Qs,{className:"h-4 w-4"})})]})]}),o.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 rounded-lg border border-dashed border-muted-foreground/30 bg-muted/20",children:[g?o.jsx(dse,{className:"h-5 flex-1"}):h?o.jsxs("p",{className:"flex-1 text-sm text-muted-foreground italic truncate",children:['"',h.hitokoto,'" —— ',h.from]}):null,o.jsx(ue,{variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0",onClick:N,disabled:g,children:o.jsx(Qs,{className:`h-3.5 w-3.5 ${g?"animate-spin":""}`})})]}),o.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-3",children:[o.jsxs(Lt,{className:"lg:col-span-1",children:[o.jsx(En,{className:"pb-3",children:o.jsxs(_n,{className:"text-sm font-medium flex items-center gap-2",children:[o.jsx(Dp,{className:"h-4 w-4"}),"麦麦状态"]})}),o.jsx(Xn,{children:o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("div",{className:"flex items-center gap-2",children:y?.running?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-3 w-3 rounded-full bg-green-500 animate-pulse"}),o.jsxs(tn,{variant:"outline",className:"text-green-600 border-green-300 bg-green-50",children:[o.jsx(Ya,{className:"h-3 w-3 mr-1"}),"运行中"]})]}):o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-3 w-3 rounded-full bg-red-500"}),o.jsxs(tn,{variant:"outline",className:"text-red-600 border-red-300 bg-red-50",children:[o.jsx(Lo,{className:"h-3 w-3 mr-1"}),"已停止"]})]})}),y&&o.jsxs("div",{className:"text-xs text-muted-foreground",children:[o.jsxs("span",{children:["v",y.version]}),o.jsx("span",{className:"mx-2",children:"|"}),o.jsxs("span",{children:["运行 ",W(y.uptime)]})]})]})})]}),o.jsxs(Lt,{className:"lg:col-span-2",children:[o.jsx(En,{className:"pb-3",children:o.jsxs(_n,{className:"text-sm font-medium flex items-center gap-2",children:[o.jsx(Zu,{className:"h-4 w-4"}),"快速操作"]})}),o.jsx(Xn,{children:o.jsxs("div",{className:"flex flex-wrap gap-2",children:[o.jsxs(ue,{variant:"outline",size:"sm",onClick:E,disabled:S,className:"gap-2",children:[o.jsx(zj,{className:`h-4 w-4 ${S?"animate-spin":""}`}),S?"重启中...":"重启麦麦"]}),o.jsx(ue,{variant:"outline",size:"sm",asChild:!0,className:"gap-2",children:o.jsxs(rv,{to:"/logs",children:[o.jsx(Po,{className:"h-4 w-4"}),"查看日志"]})}),o.jsx(ue,{variant:"outline",size:"sm",asChild:!0,className:"gap-2",children:o.jsxs(rv,{to:"/plugins",children:[o.jsx(Fee,{className:"h-4 w-4"}),"插件管理"]})}),o.jsx(ue,{variant:"outline",size:"sm",asChild:!0,className:"gap-2",children:o.jsxs(rv,{to:"/settings",children:[o.jsx(Vc,{className:"h-4 w-4"}),"系统设置"]})})]})})]})]}),o.jsxs("div",{className:"grid gap-4 grid-cols-1 xs:grid-cols-2 lg:grid-cols-4",children:[o.jsxs(Lt,{children:[o.jsxs(En,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(_n,{className:"text-sm font-medium",children:"总请求数"}),o.jsx(qee,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsxs(Xn,{children:[o.jsx("div",{className:"text-2xl font-bold",children:A.total_requests.toLocaleString()}),o.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["最近",a<48?a+"小时":Math.floor(a/24)+"天"]})]})]}),o.jsxs(Lt,{children:[o.jsxs(En,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(_n,{className:"text-sm font-medium",children:"总花费"}),o.jsx($ee,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsxs(Xn,{children:[o.jsxs("div",{className:"text-2xl font-bold",children:["¥",A.total_cost.toFixed(2)]}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:A.cost_per_hour>0?`¥${A.cost_per_hour.toFixed(2)}/小时`:"暂无数据"})]})]}),o.jsxs(Lt,{children:[o.jsxs(En,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(_n,{className:"text-sm font-medium",children:"Token消耗"}),o.jsx(sk,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsxs(Xn,{children:[o.jsxs("div",{className:"text-2xl font-bold",children:[(A.total_tokens/1e3).toFixed(1),"K"]}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:A.tokens_per_hour>0?`${(A.tokens_per_hour/1e3).toFixed(1)}K/小时`:"暂无数据"})]})]}),o.jsxs(Lt,{children:[o.jsxs(En,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(_n,{className:"text-sm font-medium",children:"平均响应"}),o.jsx(Zu,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsxs(Xn,{children:[o.jsxs("div",{className:"text-2xl font-bold",children:[A.avg_response_time.toFixed(2),"s"]}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"API平均耗时"})]})]})]}),o.jsxs("div",{className:"grid gap-4 grid-cols-1 sm:grid-cols-3",children:[o.jsxs(Lt,{children:[o.jsxs(En,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(_n,{className:"text-sm font-medium",children:"在线时长"}),o.jsx(Mh,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsx(Xn,{children:o.jsx("div",{className:"text-xl font-bold",children:W(A.online_time)})})]}),o.jsxs(Lt,{children:[o.jsxs(En,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(_n,{className:"text-sm font-medium",children:"消息处理"}),o.jsx(Gh,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsxs(Xn,{children:[o.jsx("div",{className:"text-xl font-bold",children:A.total_messages.toLocaleString()}),o.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["回复 ",A.total_replies.toLocaleString()," 条"]})]})]}),o.jsxs(Lt,{children:[o.jsxs(En,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(_n,{className:"text-sm font-medium",children:"成本效率"}),o.jsx(Hee,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsxs(Xn,{children:[o.jsx("div",{className:"text-xl font-bold",children:A.total_messages>0?`¥${(A.total_cost/A.total_messages*100).toFixed(2)}`:"¥0.00"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"每100条消息"})]})]})]}),o.jsxs(Yi,{defaultValue:"trends",className:"space-y-4",children:[o.jsxs(ji,{className:"grid w-full grid-cols-2 sm:grid-cols-4",children:[o.jsx(Bt,{value:"trends",children:"趋势"}),o.jsx(Bt,{value:"models",children:"模型"}),o.jsx(Bt,{value:"activity",children:"活动"}),o.jsx(Bt,{value:"daily",children:"日统计"})]}),o.jsxs(ln,{value:"trends",className:"space-y-4",children:[o.jsxs(Lt,{children:[o.jsxs(En,{children:[o.jsx(_n,{children:"请求趋势"}),o.jsxs(Wr,{children:["最近",a,"小时的请求量变化"]})]}),o.jsx(Xn,{children:o.jsx(vh,{config:L,className:"h-[300px] sm:h-[400px] w-full aspect-auto",children:o.jsxs(AJ,{data:q,children:[o.jsx(Kx,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),o.jsx(Zx,{dataKey:"timestamp",tickFormatter:$=>ee($),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),o.jsx(Pm,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),o.jsx(Bm,{content:o.jsx(yh,{labelFormatter:$=>ee($)})}),o.jsx(MJ,{type:"monotone",dataKey:"requests",stroke:"var(--color-requests)",strokeWidth:2})]})})})]}),o.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:[o.jsxs(Lt,{children:[o.jsxs(En,{children:[o.jsx(_n,{children:"花费趋势"}),o.jsx(Wr,{children:"API调用成本变化"})]}),o.jsx(Xn,{children:o.jsx(vh,{config:L,className:"h-[250px] sm:h-[300px] w-full aspect-auto",children:o.jsxs(S4,{data:q,children:[o.jsx(Kx,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),o.jsx(Zx,{dataKey:"timestamp",tickFormatter:$=>ee($),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),o.jsx(Pm,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),o.jsx(Bm,{content:o.jsx(yh,{labelFormatter:$=>ee($)})}),o.jsx(Jx,{dataKey:"cost",fill:"var(--color-cost)"})]})})})]}),o.jsxs(Lt,{children:[o.jsxs(En,{children:[o.jsx(_n,{children:"Token消耗"}),o.jsx(Wr,{children:"Token使用量变化"})]}),o.jsx(Xn,{children:o.jsx(vh,{config:L,className:"h-[250px] sm:h-[300px] w-full aspect-auto",children:o.jsxs(S4,{data:q,children:[o.jsx(Kx,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),o.jsx(Zx,{dataKey:"timestamp",tickFormatter:$=>ee($),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),o.jsx(Pm,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),o.jsx(Bm,{content:o.jsx(yh,{labelFormatter:$=>ee($)})}),o.jsx(Jx,{dataKey:"tokens",fill:"var(--color-tokens)"})]})})})]})]})]}),o.jsx(ln,{value:"models",className:"space-y-4",children:o.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:[o.jsxs(Lt,{children:[o.jsxs(En,{children:[o.jsx(_n,{children:"模型请求分布"}),o.jsxs(Wr,{children:["各模型使用占比 (共 ",D.length," 个模型)"]})]}),o.jsx(Xn,{children:o.jsx(vh,{config:Object.fromEntries(D.map(($,K)=>[$.model_name,{label:$.model_name,color:I[K]}])),className:"h-[300px] sm:h-[400px] w-full aspect-auto",children:o.jsxs(RJ,{children:[o.jsx(Bm,{content:o.jsx(yh,{})}),o.jsx(DJ,{data:V,cx:"50%",cy:"50%",labelLine:!1,label:({name:$,percent:K})=>K&&K<.05?"":`${$} ${K?(K*100).toFixed(0):0}%`,outerRadius:100,dataKey:"value",children:V.map(($,K)=>o.jsx(PJ,{fill:$.fill},`cell-${K}`))})]})})})]}),o.jsxs(Lt,{children:[o.jsxs(En,{children:[o.jsx(_n,{children:"模型详细统计"}),o.jsx(Wr,{children:"请求数、花费和性能"})]}),o.jsx(Xn,{children:o.jsx(pn,{className:"h-[300px] sm:h-[400px]",children:o.jsx("div",{className:"space-y-3",children:D.map(($,K)=>o.jsxs("div",{className:"p-4 rounded-lg border bg-card hover:bg-accent/50 transition-colors",children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsx("h4",{className:"font-semibold text-sm truncate flex-1 min-w-0",children:$.model_name}),o.jsx("div",{className:"w-3 h-3 rounded-full ml-2 flex-shrink-0",style:{backgroundColor:`hsl(var(--chart-${K%5+1}))`}})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"请求数:"}),o.jsx("span",{className:"ml-1 font-medium",children:$.request_count.toLocaleString()})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"花费:"}),o.jsxs("span",{className:"ml-1 font-medium",children:["¥",$.total_cost.toFixed(2)]})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"Tokens:"}),o.jsxs("span",{className:"ml-1 font-medium",children:[($.total_tokens/1e3).toFixed(1),"K"]})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"平均耗时:"}),o.jsxs("span",{className:"ml-1 font-medium",children:[$.avg_response_time.toFixed(2),"s"]})]})]})]},K))})})})]})]})}),o.jsx(ln,{value:"activity",children:o.jsxs(Lt,{children:[o.jsxs(En,{children:[o.jsx(_n,{children:"最近活动"}),o.jsx(Wr,{children:"最新的API调用记录"})]}),o.jsx(Xn,{children:o.jsx(pn,{className:"h-[400px] sm:h-[500px]",children:o.jsx("div",{className:"space-y-2",children:H.map(($,K)=>o.jsxs("div",{className:"p-3 sm:p-4 rounded-lg border bg-card hover:bg-accent/50 transition-colors",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-2 mb-2",children:[o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("div",{className:"font-medium text-sm truncate",children:$.model}),o.jsx("div",{className:"text-xs text-muted-foreground",children:$.request_type})]}),o.jsx("div",{className:"text-xs text-muted-foreground flex-shrink-0",children:ee($.timestamp)})]}),o.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 text-xs",children:[o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"Tokens:"}),o.jsx("span",{className:"ml-1",children:$.tokens})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"花费:"}),o.jsxs("span",{className:"ml-1",children:["¥",$.cost.toFixed(4)]})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"耗时:"}),o.jsxs("span",{className:"ml-1",children:[$.time_cost.toFixed(2),"s"]})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"状态:"}),o.jsx("span",{className:`ml-1 ${$.status==="success"?"text-green-600":"text-red-600"}`,children:$.status})]})]})]},K))})})})]})}),o.jsx(ln,{value:"daily",children:o.jsxs(Lt,{children:[o.jsxs(En,{children:[o.jsx(_n,{children:"每日统计"}),o.jsx(Wr,{children:"最近7天的数据汇总"})]}),o.jsx(Xn,{children:o.jsx(vh,{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:o.jsxs(S4,{data:B,children:[o.jsx(Kx,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),o.jsx(Zx,{dataKey:"timestamp",tickFormatter:$=>{const K=new Date($);return`${K.getMonth()+1}/${K.getDate()}`},stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),o.jsx(Pm,{yAxisId:"left",stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),o.jsx(Pm,{yAxisId:"right",orientation:"right",stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),o.jsx(Bm,{content:o.jsx(yh,{labelFormatter:$=>new Date($).toLocaleDateString("zh-CN")})}),o.jsx(Ose,{content:o.jsx(eB,{})}),o.jsx(Jx,{yAxisId:"left",dataKey:"requests",fill:"var(--color-requests)"}),o.jsx(Jx,{yAxisId:"right",dataKey:"cost",fill:"var(--color-cost)"})]})})})]})})]})]})})}const Rse={theme:"system",setTheme:()=>null},tB=b.createContext(Rse),Kj=()=>{const t=b.useContext(tB);if(t===void 0)throw new Error("useTheme must be used within a ThemeProvider");return t},Dse=(t,e,n)=>{const r=document.documentElement.classList.contains("no-animations");if(!document.startViewTransition||r){e(t);return}const s=n.clientX,i=n.clientY,a=Math.hypot(Math.max(s,innerWidth-s),Math.max(i,innerHeight-i));document.startViewTransition(()=>{e(t)}).ready.then(()=>{document.documentElement.animate({clipPath:[`circle(0px at ${s}px ${i}px)`,`circle(${a}px at ${s}px ${i}px)`]},{duration:500,easing:"ease-in-out",pseudoElement:"::view-transition-new(root)"})})},nB=b.createContext(void 0),rB=()=>{const t=b.useContext(nB);if(t===void 0)throw new Error("useAnimation must be used within an AnimationProvider");return t};var lb="Switch",[Pse]=Da(lb),[zse,Ise]=Pse(lb),sB=b.forwardRef((t,e)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:i,required:a,disabled:l,value:c="on",onCheckedChange:d,form:h,...m}=t,[g,x]=b.useState(null),y=er(e,N=>x(N)),w=b.useRef(!1),S=g?h||!!g.closest("form"):!0,[k,j]=Kl({prop:s,defaultProp:i??!1,onChange:d,caller:lb});return o.jsxs(zse,{scope:n,checked:k,disabled:l,children:[o.jsx(Sn.button,{type:"button",role:"switch","aria-checked":k,"aria-required":a,"data-state":lB(k),"data-disabled":l?"":void 0,disabled:l,value:c,...m,ref:y,onClick:nt(t.onClick,N=>{j(T=>!T),S&&(w.current=N.isPropagationStopped(),w.current||N.stopPropagation())})}),S&&o.jsx(oB,{control:g,bubbles:!w.current,name:r,value:c,checked:k,required:a,disabled:l,form:h,style:{transform:"translateX(-100%)"}})]})});sB.displayName=lb;var iB="SwitchThumb",aB=b.forwardRef((t,e)=>{const{__scopeSwitch:n,...r}=t,s=Ise(iB,n);return o.jsx(Sn.span,{"data-state":lB(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:e})});aB.displayName=iB;var Lse="SwitchBubbleInput",oB=b.forwardRef(({__scopeSwitch:t,control:e,checked:n,bubbles:r=!0,...s},i)=>{const a=b.useRef(null),l=er(a,i),c=sI(n),d=iI(e);return b.useEffect(()=>{const h=a.current;if(!h)return;const m=window.HTMLInputElement.prototype,x=Object.getOwnPropertyDescriptor(m,"checked").set;if(c!==n&&x){const y=new Event("click",{bubbles:r});x.call(h,n),h.dispatchEvent(y)}},[c,n,r]),o.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:l,style:{...s.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});oB.displayName=Lse;function lB(t){return t?"checked":"unchecked"}var cB=sB,Bse=aB;const Ft=b.forwardRef(({className:t,...e},n)=>o.jsx(cB,{className:xe("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",t),...e,ref:n,children:o.jsx(Bse,{className:xe("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")})}));Ft.displayName=cB.displayName;const Fse=kf("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),he=b.forwardRef(({className:t,...e},n)=>o.jsx(aI,{ref:n,className:xe(Fse(),t),...e}));he.displayName=aI.displayName;const Pe=b.forwardRef(({className:t,type:e,...n},r)=>o.jsx("input",{type:e,className:xe("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",t),ref:r,...n}));Pe.displayName="Input";const qse=[{id:"minLength",label:"长度至少 10 位",description:"Token 长度必须大于等于 10 个字符",validate:t=>t.length>=10},{id:"hasUppercase",label:"包含大写字母",description:"至少包含一个大写字母 (A-Z)",validate:t=>/[A-Z]/.test(t)},{id:"hasLowercase",label:"包含小写字母",description:"至少包含一个小写字母 (a-z)",validate:t=>/[a-z]/.test(t)},{id:"hasSpecialChar",label:"包含特殊符号",description:"至少包含一个特殊符号 (!@#$%^&*()_+-=[]{}|;:,.<>?/)",validate:t=>/[!@#$%^&*()_+\-=[\]{}|;:,.<>?/]/.test(t)}];function $se(t){const e=qse.map(r=>({id:r.id,label:r.label,description:r.description,passed:r.validate(t)}));return{isValid:e.every(r=>r.passed),rules:e}}const Zj="0.11.6 Beta",Jj="MaiBot Dashboard",Hse=`${Jj} v${Zj}`,Qse=(t="v")=>`${t}${Zj}`,Er=Mj,Of=oI,Vse=Ej,e6=Gy,uB=b.forwardRef(({className:t,...e},n)=>o.jsx(Uy,{ref:n,className:xe("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",t),...e}));uB.displayName=Uy.displayName;const wr=b.forwardRef(({className:t,children:e,preventOutsideClose:n=!1,...r},s)=>o.jsxs(Vse,{children:[o.jsx(uB,{}),o.jsxs(Wy,{ref:s,className:xe("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",t),onPointerDownOutside:n?i=>i.preventDefault():void 0,onInteractOutside:n?i=>i.preventDefault():void 0,...r,children:[e,o.jsxs(Gy,{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:[o.jsx(Pp,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));wr.displayName=Wy.displayName;const Sr=({className:t,...e})=>o.jsx("div",{className:xe("flex flex-col space-y-1.5 text-center sm:text-left",t),...e});Sr.displayName="DialogHeader";const fs=({className:t,...e})=>o.jsx("div",{className:xe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});fs.displayName="DialogFooter";const kr=b.forwardRef(({className:t,...e},n)=>o.jsx(_j,{ref:n,className:xe("text-lg font-semibold leading-none tracking-tight",t),...e}));kr.displayName=_j.displayName;const Xr=b.forwardRef(({className:t,...e},n)=>o.jsx(Aj,{ref:n,className:xe("text-sm text-muted-foreground",t),...e}));Xr.displayName=Aj.displayName;var Use=Symbol("radix.slottable");function Wse(t){const e=({children:n})=>o.jsx(o.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=Use,e}var dB="AlertDialog",[Gse]=Da(dB,[lI]),Jl=lI(),hB=t=>{const{__scopeAlertDialog:e,...n}=t,r=Jl(e);return o.jsx(Mj,{...r,...n,modal:!0})};hB.displayName=dB;var Xse="AlertDialogTrigger",fB=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Jl(n);return o.jsx(oI,{...s,...r,ref:e})});fB.displayName=Xse;var Yse="AlertDialogPortal",mB=t=>{const{__scopeAlertDialog:e,...n}=t,r=Jl(e);return o.jsx(Ej,{...r,...n})};mB.displayName=Yse;var Kse="AlertDialogOverlay",pB=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Jl(n);return o.jsx(Uy,{...s,...r,ref:e})});pB.displayName=Kse;var Rh="AlertDialogContent",[Zse,Jse]=Gse(Rh),eie=Wse("AlertDialogContent"),gB=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,children:r,...s}=t,i=Jl(n),a=b.useRef(null),l=er(e,a),c=b.useRef(null);return o.jsx(Tee,{contentName:Rh,titleName:xB,docsSlug:"alert-dialog",children:o.jsx(Zse,{scope:n,cancelRef:c,children:o.jsxs(Wy,{role:"alertdialog",...i,...s,ref:l,onOpenAutoFocus:nt(s.onOpenAutoFocus,d=>{d.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:d=>d.preventDefault(),onInteractOutside:d=>d.preventDefault(),children:[o.jsx(eie,{children:r}),o.jsx(nie,{contentRef:a})]})})})});gB.displayName=Rh;var xB="AlertDialogTitle",vB=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Jl(n);return o.jsx(_j,{...s,...r,ref:e})});vB.displayName=xB;var yB="AlertDialogDescription",bB=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Jl(n);return o.jsx(Aj,{...s,...r,ref:e})});bB.displayName=yB;var tie="AlertDialogAction",wB=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Jl(n);return o.jsx(Gy,{...s,...r,ref:e})});wB.displayName=tie;var SB="AlertDialogCancel",kB=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,{cancelRef:s}=Jse(SB,n),i=Jl(n),a=er(e,s);return o.jsx(Gy,{...i,...r,ref:a})});kB.displayName=SB;var nie=({contentRef:t})=>{const e=`\`${Rh}\` requires a description for the component to be accessible for screen reader users.
|
||
|
||
You can add a description to the \`${Rh}\` by passing a \`${yB}\` 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 \`${Rh}\`. 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 b.useEffect(()=>{document.getElementById(t.current?.getAttribute("aria-describedby"))||console.warn(e)},[e,t]),null},rie=hB,sie=fB,iie=mB,OB=pB,jB=gB,NB=wB,CB=kB,TB=vB,EB=bB;const Fn=rie,is=sie,aie=iie,_B=b.forwardRef(({className:t,...e},n)=>o.jsx(OB,{className:xe("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",t),...e,ref:n}));_B.displayName=OB.displayName;const Mn=b.forwardRef(({className:t,...e},n)=>o.jsxs(aie,{children:[o.jsx(_B,{}),o.jsx(jB,{ref:n,className:xe("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",t),...e})]}));Mn.displayName=jB.displayName;const Rn=({className:t,...e})=>o.jsx("div",{className:xe("flex flex-col space-y-2 text-center sm:text-left",t),...e});Rn.displayName="AlertDialogHeader";const Dn=({className:t,...e})=>o.jsx("div",{className:xe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});Dn.displayName="AlertDialogFooter";const Pn=b.forwardRef(({className:t,...e},n)=>o.jsx(TB,{ref:n,className:xe("text-lg font-semibold",t),...e}));Pn.displayName=TB.displayName;const zn=b.forwardRef(({className:t,...e},n)=>o.jsx(EB,{ref:n,className:xe("text-sm text-muted-foreground",t),...e}));zn.displayName=EB.displayName;const In=b.forwardRef(({className:t,...e},n)=>o.jsx(NB,{ref:n,className:xe(q0(),t),...e}));In.displayName=NB.displayName;const Ln=b.forwardRef(({className:t,...e},n)=>o.jsx(CB,{ref:n,className:xe(q0({variant:"outline"}),"mt-2 sm:mt-0",t),...e}));Ln.displayName=CB.displayName;function oie(){return o.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[o.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"系统设置"}),o.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理您的应用偏好设置"})]})}),o.jsxs(Yi,{defaultValue:"appearance",className:"w-full",children:[o.jsxs(ji,{className:"grid w-full grid-cols-2 sm:grid-cols-4 gap-0.5 sm:gap-1 h-auto p-1",children:[o.jsxs(Bt,{value:"appearance",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[o.jsx(kI,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),o.jsx("span",{children:"外观"})]}),o.jsxs(Bt,{value:"security",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[o.jsx(Qee,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),o.jsx("span",{children:"安全"})]}),o.jsxs(Bt,{value:"other",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[o.jsx(Vc,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),o.jsx("span",{children:"其他"})]}),o.jsxs(Bt,{value:"about",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[o.jsx(Xi,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),o.jsx("span",{children:"关于"})]})]}),o.jsxs(pn,{className:"h-[calc(100vh-240px)] sm:h-[calc(100vh-280px)] mt-4 sm:mt-6",children:[o.jsx(ln,{value:"appearance",className:"mt-0",children:o.jsx(lie,{})}),o.jsx(ln,{value:"security",className:"mt-0",children:o.jsx(cie,{})}),o.jsx(ln,{value:"other",className:"mt-0",children:o.jsx(uie,{})}),o.jsx(ln,{value:"about",className:"mt-0",children:o.jsx(die,{})})]})]})]})}function lE(t){const e=document.documentElement,r={blue:{hsl:"221.2 83.2% 53.3%",darkHsl:"217.2 91.2% 59.8%",gradient:null},purple:{hsl:"271 91% 65%",darkHsl:"270 95% 75%",gradient:null},green:{hsl:"142 71% 45%",darkHsl:"142 76% 36%",gradient:null},orange:{hsl:"25 95% 53%",darkHsl:"20 90% 48%",gradient:null},pink:{hsl:"330 81% 60%",darkHsl:"330 85% 70%",gradient:null},red:{hsl:"0 84% 60%",darkHsl:"0 90% 70%",gradient:null},"gradient-sunset":{hsl:"15 95% 60%",darkHsl:"15 95% 65%",gradient:"linear-gradient(135deg, hsl(25 95% 53%) 0%, hsl(330 81% 60%) 100%)"},"gradient-ocean":{hsl:"200 90% 55%",darkHsl:"200 90% 60%",gradient:"linear-gradient(135deg, hsl(221.2 83.2% 53.3%) 0%, hsl(189 94% 43%) 100%)"},"gradient-forest":{hsl:"150 70% 45%",darkHsl:"150 75% 40%",gradient:"linear-gradient(135deg, hsl(142 71% 45%) 0%, hsl(158 64% 52%) 100%)"},"gradient-aurora":{hsl:"310 85% 65%",darkHsl:"310 90% 70%",gradient:"linear-gradient(135deg, hsl(271 91% 65%) 0%, hsl(330 81% 60%) 100%)"},"gradient-fire":{hsl:"15 95% 55%",darkHsl:"15 95% 60%",gradient:"linear-gradient(135deg, hsl(0 84% 60%) 0%, hsl(25 95% 53%) 100%)"},"gradient-twilight":{hsl:"250 90% 60%",darkHsl:"250 95% 65%",gradient:"linear-gradient(135deg, hsl(239 84% 67%) 0%, hsl(271 91% 65%) 100%)"}}[t];if(r)e.style.setProperty("--primary",r.hsl),r.gradient?(e.style.setProperty("--primary-gradient",r.gradient),e.classList.add("has-gradient")):(e.style.removeProperty("--primary-gradient"),e.classList.remove("has-gradient"));else if(t.startsWith("#")){const s=i=>{i=i.replace("#","");const a=parseInt(i.substring(0,2),16)/255,l=parseInt(i.substring(2,4),16)/255,c=parseInt(i.substring(4,6),16)/255,d=Math.max(a,l,c),h=Math.min(a,l,c);let m=0,g=0;const x=(d+h)/2;if(d!==h){const y=d-h;switch(g=x>.5?y/(2-d-h):y/(d+h),d){case a:m=((l-c)/y+(l<c?6:0))/6;break;case l:m=((c-a)/y+2)/6;break;case c:m=((a-l)/y+4)/6;break}}return`${Math.round(m*360)} ${Math.round(g*100)}% ${Math.round(x*100)}%`};e.style.setProperty("--primary",s(t)),e.style.removeProperty("--primary-gradient"),e.classList.remove("has-gradient")}}function lie(){const{theme:t,setTheme:e}=Kj(),{enableAnimations:n,setEnableAnimations:r,enableWavesBackground:s,setEnableWavesBackground:i}=rB(),[a,l]=b.useState(()=>localStorage.getItem("accent-color")||"blue");b.useEffect(()=>{const d=localStorage.getItem("accent-color")||"blue";lE(d)},[]);const c=d=>{l(d),localStorage.setItem("accent-color",d),lE(d)};return o.jsxs("div",{className:"space-y-6 sm:space-y-8",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"主题模式"}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3 sm:gap-4",children:[o.jsx(P4,{value:"light",current:t,onChange:e,label:"浅色",description:"始终使用浅色主题"}),o.jsx(P4,{value:"dark",current:t,onChange:e,label:"深色",description:"始终使用深色主题"}),o.jsx(P4,{value:"system",current:t,onChange:e,label:"跟随系统",description:"根据系统设置自动切换"})]})]}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"主题色"}),o.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"单色"}),o.jsxs("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2 sm:gap-3",children:[o.jsx(ma,{value:"blue",current:a,onChange:c,label:"蓝色",colorClass:"bg-blue-500"}),o.jsx(ma,{value:"purple",current:a,onChange:c,label:"紫色",colorClass:"bg-purple-500"}),o.jsx(ma,{value:"green",current:a,onChange:c,label:"绿色",colorClass:"bg-green-500"}),o.jsx(ma,{value:"orange",current:a,onChange:c,label:"橙色",colorClass:"bg-orange-500"}),o.jsx(ma,{value:"pink",current:a,onChange:c,label:"粉色",colorClass:"bg-pink-500"}),o.jsx(ma,{value:"red",current:a,onChange:c,label:"红色",colorClass:"bg-red-500"})]})]}),o.jsxs("div",{children:[o.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"渐变色"}),o.jsxs("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2 sm:gap-3",children:[o.jsx(ma,{value:"gradient-sunset",current:a,onChange:c,label:"日落",colorClass:"bg-gradient-to-r from-orange-500 to-pink-500"}),o.jsx(ma,{value:"gradient-ocean",current:a,onChange:c,label:"海洋",colorClass:"bg-gradient-to-r from-blue-500 to-cyan-500"}),o.jsx(ma,{value:"gradient-forest",current:a,onChange:c,label:"森林",colorClass:"bg-gradient-to-r from-green-500 to-emerald-500"}),o.jsx(ma,{value:"gradient-aurora",current:a,onChange:c,label:"极光",colorClass:"bg-gradient-to-r from-purple-500 to-pink-500"}),o.jsx(ma,{value:"gradient-fire",current:a,onChange:c,label:"烈焰",colorClass:"bg-gradient-to-r from-red-500 to-orange-500"}),o.jsx(ma,{value:"gradient-twilight",current:a,onChange:c,label:"暮光",colorClass:"bg-gradient-to-r from-indigo-500 to-purple-500"})]})]}),o.jsxs("div",{children:[o.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"自定义颜色"}),o.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 sm:gap-4",children:[o.jsx("div",{className:"flex-1",children:o.jsx("input",{type:"color",value:a.startsWith("#")?a:"#3b82f6",onChange:d=>c(d.target.value),className:"h-10 sm:h-12 w-full rounded-lg border-2 border-border cursor-pointer",title:"选择自定义颜色"})}),o.jsx("div",{className:"flex-1",children:o.jsx(Pe,{type:"text",value:a,onChange:d=>c(d.target.value),placeholder:"#3b82f6",className:"font-mono text-sm"})})]}),o.jsx("p",{className:"text-[10px] sm:text-xs text-muted-foreground mt-2",children:"点击色块选择颜色,或手动输入 HEX 颜色代码"})]})]})]}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"动画效果"}),o.jsxs("div",{className:"space-y-2 sm:space-y-3",children:[o.jsx("div",{className:"rounded-lg border bg-card p-3 sm:p-4",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5 flex-1",children:[o.jsx(he,{htmlFor:"animations",className:"text-base font-medium cursor-pointer",children:"启用动画效果"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭后将禁用所有过渡动画和特效,提升性能"})]}),o.jsx(Ft,{id:"animations",checked:n,onCheckedChange:r})]})}),o.jsx("div",{className:"rounded-lg border bg-card p-4",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5 flex-1",children:[o.jsx(he,{htmlFor:"waves-background",className:"text-base font-medium cursor-pointer",children:"登录页波浪背景"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭后登录页将使用纯色背景,适合低性能设备"})]}),o.jsx(Ft,{id:"waves-background",checked:s,onCheckedChange:i})]})})]})]})]})}function cie(){const t=na(),[e,n]=b.useState(""),[r,s]=b.useState(""),[i,a]=b.useState(!1),[l,c]=b.useState(!1),[d,h]=b.useState(!1),[m,g]=b.useState(!1),[x,y]=b.useState(!1),[w,S]=b.useState(!1),[k,j]=b.useState(""),[N,T]=b.useState(!1),{toast:E}=Lr(),_=b.useMemo(()=>$se(r),[r]),A=()=>localStorage.getItem("access-token")||"",D=async I=>{try{await navigator.clipboard.writeText(I),y(!0),E({title:"复制成功",description:"Token 已复制到剪贴板"}),setTimeout(()=>y(!1),2e3)}catch{E({title:"复制失败",description:"请手动复制 Token",variant:"destructive"})}},q=async()=>{if(!r.trim()){E({title:"输入错误",description:"请输入新的 Token",variant:"destructive"});return}if(!_.isValid){const I=_.rules.filter(V=>!V.passed).map(V=>V.label).join(", ");E({title:"格式错误",description:`Token 不符合要求: ${I}`,variant:"destructive"});return}h(!0);try{const I=A(),V=await fetch("/api/webui/auth/update",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${I}`},body:JSON.stringify({new_token:r.trim()})}),L=await V.json();V.ok&&L.success?(localStorage.setItem("access-token",r.trim()),s(""),e&&n(r.trim()),E({title:"更新成功",description:"Access Token 已更新,即将跳转到登录页"}),setTimeout(()=>{localStorage.removeItem("access-token"),t({to:"/auth"})},1500)):E({title:"更新失败",description:L.message||"无法更新 Token",variant:"destructive"})}catch(I){console.error("更新 Token 错误:",I),E({title:"更新失败",description:"连接服务器失败",variant:"destructive"})}finally{h(!1)}},B=async()=>{g(!0);try{const I=A(),V=await fetch("/api/webui/auth/regenerate",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${I}`}}),L=await V.json();V.ok&&L.success?(localStorage.setItem("access-token",L.token),n(L.token),j(L.token),S(!0),T(!1),E({title:"生成成功",description:"新的 Access Token 已生成,请及时保存"})):E({title:"生成失败",description:L.message||"无法生成新 Token",variant:"destructive"})}catch(I){console.error("生成 Token 错误:",I),E({title:"生成失败",description:"连接服务器失败",variant:"destructive"})}finally{g(!1)}},H=async()=>{try{await navigator.clipboard.writeText(k),T(!0),E({title:"复制成功",description:"Token 已复制到剪贴板"})}catch{E({title:"复制失败",description:"请手动复制 Token",variant:"destructive"})}},W=()=>{S(!1),setTimeout(()=>{j(""),T(!1)},300),setTimeout(()=>{localStorage.removeItem("access-token"),t({to:"/auth"})},500)},ee=I=>{I||W()};return o.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[o.jsx(Er,{open:w,onOpenChange:ee,children:o.jsxs(wr,{className:"sm:max-w-md",children:[o.jsxs(Sr,{children:[o.jsxs(kr,{className:"flex items-center gap-2",children:[o.jsx(Ga,{className:"h-5 w-5 text-yellow-500"}),"新的 Access Token"]}),o.jsx(Xr,{children:"这是您的新 Token,请立即保存。关闭此窗口后将跳转到登录页面。"})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"rounded-lg border-2 border-primary/20 bg-primary/5 p-4",children:[o.jsx(he,{className:"text-xs text-muted-foreground mb-2 block",children:"您的新 Token (64位安全令牌)"}),o.jsx("div",{className:"font-mono text-sm break-all select-all bg-background p-3 rounded border",children:k})]}),o.jsx("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3",children:o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Ga,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-500 flex-shrink-0 mt-0.5"}),o.jsxs("div",{className:"text-sm text-yellow-800 dark:text-yellow-300 space-y-1",children:[o.jsx("p",{className:"font-semibold",children:"重要提示"}),o.jsxs("ul",{className:"list-disc list-inside space-y-0.5 text-xs",children:[o.jsx("li",{children:"此 Token 仅显示一次,关闭后无法再查看"}),o.jsx("li",{children:"请立即复制并保存到安全的位置"}),o.jsx("li",{children:"关闭窗口后将自动跳转到登录页面"}),o.jsx("li",{children:"请使用新 Token 重新登录系统"})]})]})]})})]}),o.jsxs(fs,{className:"gap-2 sm:gap-0",children:[o.jsx(ue,{variant:"outline",onClick:H,className:"gap-2",children:N?o.jsxs(o.Fragment,{children:[o.jsx(zo,{className:"h-4 w-4 text-green-500"}),"已复制"]}):o.jsxs(o.Fragment,{children:[o.jsx(Iv,{className:"h-4 w-4"}),"复制 Token"]})}),o.jsx(ue,{onClick:W,children:"我已保存,关闭"})]})]})}),o.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[o.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"当前 Access Token"}),o.jsx("div",{className:"space-y-3 sm:space-y-4",children:o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"current-token",className:"text-sm",children:"您的访问令牌"}),o.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[o.jsxs("div",{className:"relative flex-1",children:[o.jsx(Pe,{id:"current-token",type:i?"text":"password",value:e||A(),readOnly:!0,className:"pr-10 font-mono text-sm",placeholder:"点击查看按钮显示 Token"}),o.jsx("button",{onClick:()=>{e||n(A()),a(!i)},className:"absolute right-2 top-1/2 -translate-y-1/2 p-1.5 hover:bg-accent rounded",title:i?"隐藏":"显示",children:i?o.jsx(I0,{className:"h-4 w-4 text-muted-foreground"}):o.jsx(Ji,{className:"h-4 w-4 text-muted-foreground"})})]}),o.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[o.jsx(ue,{variant:"outline",size:"icon",onClick:()=>D(A()),title:"复制到剪贴板",className:"flex-shrink-0",children:x?o.jsx(zo,{className:"h-4 w-4 text-green-500"}):o.jsx(Iv,{className:"h-4 w-4"})}),o.jsxs(Fn,{children:[o.jsx(is,{asChild:!0,children:o.jsxs(ue,{variant:"outline",disabled:m,className:"gap-2 flex-1 sm:flex-none",children:[o.jsx(Qs,{className:xe("h-4 w-4",m&&"animate-spin")}),o.jsx("span",{className:"hidden sm:inline",children:"重新生成"}),o.jsx("span",{className:"sm:hidden",children:"生成"})]})}),o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认重新生成 Token"}),o.jsx(zn,{children:"这将生成一个新的 64 位安全令牌,并使当前 Token 立即失效。 您需要使用新 Token 重新登录系统。此操作不可撤销,确定要继续吗?"})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:B,children:"确认生成"})]})]})]})]})]}),o.jsx("p",{className:"text-[10px] sm:text-xs text-muted-foreground",children:"请妥善保管您的 Access Token,不要泄露给他人"})]})})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[o.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"自定义 Access Token"}),o.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"new-token",className:"text-sm",children:"新的访问令牌"}),o.jsxs("div",{className:"relative",children:[o.jsx(Pe,{id:"new-token",type:l?"text":"password",value:r,onChange:I=>s(I.target.value),className:"pr-10 font-mono text-sm",placeholder:"输入自定义 Token"}),o.jsx("button",{onClick:()=>c(!l),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1.5 hover:bg-accent rounded",title:l?"隐藏":"显示",children:l?o.jsx(I0,{className:"h-4 w-4 text-muted-foreground"}):o.jsx(Ji,{className:"h-4 w-4 text-muted-foreground"})})]}),r&&o.jsxs("div",{className:"mt-3 space-y-2 p-3 rounded-lg bg-muted/50",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:"Token 安全要求:"}),o.jsx("div",{className:"space-y-1.5",children:_.rules.map(I=>o.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[I.passed?o.jsx(Ya,{className:"h-4 w-4 text-green-500 flex-shrink-0"}):o.jsx(OI,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),o.jsx("span",{className:xe(I.passed?"text-green-600 dark:text-green-400":"text-muted-foreground"),children:I.label})]},I.id))}),_.isValid&&o.jsx("div",{className:"mt-2 pt-2 border-t border-border",children:o.jsxs("div",{className:"flex items-center gap-2 text-sm text-green-600 dark:text-green-400",children:[o.jsx(zo,{className:"h-4 w-4"}),o.jsx("span",{className:"font-medium",children:"Token 格式正确,可以使用"})]})})]})]}),o.jsx(ue,{onClick:q,disabled:d||!_.isValid||!r,className:"w-full sm:w-auto",children:d?"更新中...":"更新自定义 Token"})]})]}),o.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:[o.jsx("h4",{className:"text-sm sm:text-base font-semibold text-yellow-900 dark:text-yellow-200 mb-2",children:"安全提示"}),o.jsxs("ul",{className:"text-xs sm:text-sm text-yellow-800 dark:text-yellow-300 space-y-1 list-disc list-inside",children:[o.jsx("li",{children:"重新生成 Token 会创建系统随机生成的 64 位安全令牌"}),o.jsx("li",{children:"自定义 Token 必须满足所有安全要求才能使用"}),o.jsx("li",{children:"更新 Token 后,旧的 Token 将立即失效"}),o.jsx("li",{children:"请在安全的环境下查看和复制 Token"}),o.jsx("li",{children:"如果怀疑 Token 泄露,请立即重新生成或更新"}),o.jsx("li",{children:"建议使用系统生成的 Token 以获得最高安全性"})]})]})]})}function uie(){const t=na(),{toast:e}=Lr(),[n,r]=b.useState(!1),[s,i]=b.useState(!1);if(s)throw new Error("这是一个手动触发的测试错误,用于验证错误边界组件是否正常工作。");const a=async()=>{r(!0);try{const l=localStorage.getItem("access-token"),c=await fetch("/api/webui/setup/reset",{method:"POST",headers:{Authorization:`Bearer ${l}`}}),d=await c.json();c.ok&&d.success?(e({title:"重置成功",description:"即将进入初次配置向导"}),setTimeout(()=>{t({to:"/setup"})},1e3)):e({title:"重置失败",description:d.message||"无法重置配置状态",variant:"destructive"})}catch(l){console.error("重置配置状态错误:",l),e({title:"重置失败",description:"连接服务器失败",variant:"destructive"})}finally{r(!1)}};return o.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[o.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[o.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"配置向导"}),o.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[o.jsx("div",{className:"space-y-2",children:o.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"重新进行初次配置向导,可以帮助您重新设置系统的基础配置。"})}),o.jsxs(Fn,{children:[o.jsx(is,{asChild:!0,children:o.jsxs(ue,{variant:"outline",disabled:n,className:"gap-2",children:[o.jsx(zj,{className:xe("h-4 w-4",n&&"animate-spin")}),"重新进行初次配置"]})}),o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认重新配置"}),o.jsx(zn,{children:"这将带您重新进入初次配置向导。您可以重新设置系统的基础配置项。确定要继续吗?"})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:a,children:"确认重置"})]})]})]})]})]}),o.jsxs("div",{className:"rounded-lg border border-dashed border-yellow-500/50 bg-yellow-500/5 p-4 sm:p-6",children:[o.jsxs("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4 flex items-center gap-2",children:[o.jsx(Ga,{className:"h-5 w-5 text-yellow-500"}),"开发者工具"]}),o.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[o.jsx("div",{className:"space-y-2",children:o.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"以下功能仅供开发调试使用,可能会导致页面崩溃或异常。"})}),o.jsxs(Fn,{children:[o.jsx(is,{asChild:!0,children:o.jsxs(ue,{variant:"destructive",className:"gap-2",children:[o.jsx(Ga,{className:"h-4 w-4"}),"触发测试错误"]})}),o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认触发错误"}),o.jsx(zn,{children:"这将手动触发一个 React 错误,用于测试错误边界组件的显示效果。 页面将显示错误界面,您可以通过刷新页面或点击返回首页来恢复。"})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:()=>i(!0),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"确认触发"})]})]})]})]})]})]})}function die(){return o.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[o.jsx("div",{className:"rounded-lg border-2 border-primary/30 bg-gradient-to-r from-primary/5 to-primary/10 p-4 sm:p-6",children:o.jsxs("div",{className:"flex items-start gap-3 sm:gap-4",children:[o.jsx("div",{className:"flex-shrink-0 rounded-lg bg-primary/10 p-2 sm:p-3",children:o.jsx("svg",{className:"h-6 w-6 sm:h-8 sm:w-8 text-primary",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:o.jsx("path",{fillRule:"evenodd",d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z",clipRule:"evenodd"})})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("h3",{className:"text-lg sm:text-xl font-bold text-foreground mb-2",children:"开源项目"}),o.jsx("p",{className:"text-sm sm:text-base text-muted-foreground mb-3",children:"本项目在 GitHub 开源,欢迎 Star ⭐ 支持!"}),o.jsxs("a",{href:"https://github.com/Mai-with-u/MaiBot-Dashboard",target:"_blank",rel:"noopener noreferrer",className:xe("inline-flex items-center gap-2 px-4 py-2 rounded-lg","bg-primary text-primary-foreground font-medium text-sm","hover:bg-primary/90 transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"),children:[o.jsx("svg",{className:"h-4 w-4",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:o.jsx("path",{fillRule:"evenodd",d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z",clipRule:"evenodd"})}),"前往 GitHub",o.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]})]})]})}),o.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[o.jsxs("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:["关于 ",Jj]}),o.jsxs("div",{className:"space-y-2 text-xs sm:text-sm text-muted-foreground",children:[o.jsxs("p",{children:["版本: ",Zj]}),o.jsx("p",{children:"麦麦(MaiBot)的现代化 Web 管理界面"})]})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[o.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"作者"}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx("p",{className:"text-sm font-medium",children:"MaiBot 核心"}),o.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"Mai-with-u"})]}),o.jsxs("div",{className:"space-y-1",children:[o.jsx("p",{className:"text-sm font-medium",children:"WebUI"}),o.jsxs("p",{className:"text-xs sm:text-sm text-muted-foreground",children:["Mai-with-u ",o.jsx("a",{href:"https://github.com/DrSmoothl",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"@MotricSeven"})]})]})]})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[o.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"技术栈"}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 text-xs sm:text-sm text-muted-foreground",children:[o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("p",{className:"font-medium text-foreground",children:"前端框架"}),o.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[o.jsx("li",{children:"React 19.2.0"}),o.jsx("li",{children:"TypeScript 5.7.2"}),o.jsx("li",{children:"Vite 6.0.7"}),o.jsx("li",{children:"TanStack Router 1.94.2"})]})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("p",{className:"font-medium text-foreground",children:"UI 组件"}),o.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[o.jsx("li",{children:"shadcn/ui"}),o.jsx("li",{children:"Radix UI"}),o.jsx("li",{children:"Tailwind CSS 3.4.17"}),o.jsx("li",{children:"Lucide Icons"})]})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("p",{className:"font-medium text-foreground",children:"后端"}),o.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[o.jsx("li",{children:"Python 3.12+"}),o.jsx("li",{children:"FastAPI"}),o.jsx("li",{children:"Uvicorn"}),o.jsx("li",{children:"WebSocket"})]})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("p",{className:"font-medium text-foreground",children:"构建工具"}),o.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[o.jsx("li",{children:"Bun / npm"}),o.jsx("li",{children:"ESLint 9.17.0"}),o.jsx("li",{children:"PostCSS"})]})]})]})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[o.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"开源库感谢"}),o.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mb-3",children:"本项目使用了以下优秀的开源库,感谢他们的贡献:"}),o.jsx(pn,{className:"h-[300px] sm:h-[400px]",children:o.jsxs("div",{className:"space-y-4 pr-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:"UI 框架与组件"}),o.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[o.jsx(Dr,{name:"React",description:"用户界面构建库",license:"MIT"}),o.jsx(Dr,{name:"shadcn/ui",description:"优雅的 React 组件库",license:"MIT"}),o.jsx(Dr,{name:"Radix UI",description:"无样式的可访问组件库",license:"MIT"}),o.jsx(Dr,{name:"Tailwind CSS",description:"实用优先的 CSS 框架",license:"MIT"}),o.jsx(Dr,{name:"Lucide React",description:"精美的图标库",license:"ISC"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:"路由与状态管理"}),o.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[o.jsx(Dr,{name:"TanStack Router",description:"类型安全的路由库",license:"MIT"}),o.jsx(Dr,{name:"Zustand",description:"轻量级状态管理",license:"MIT"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:"表单处理"}),o.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[o.jsx(Dr,{name:"React Hook Form",description:"高性能表单库",license:"MIT"}),o.jsx(Dr,{name:"Zod",description:"TypeScript 优先的 schema 验证",license:"MIT"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:"工具库"}),o.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[o.jsx(Dr,{name:"clsx",description:"条件 className 构建工具",license:"MIT"}),o.jsx(Dr,{name:"tailwind-merge",description:"Tailwind 类名合并工具",license:"MIT"}),o.jsx(Dr,{name:"class-variance-authority",description:"组件变体管理",license:"Apache-2.0"}),o.jsx(Dr,{name:"date-fns",description:"现代化日期处理库",license:"MIT"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:"动画效果"}),o.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[o.jsx(Dr,{name:"Framer Motion",description:"React 动画库",license:"MIT"}),o.jsx(Dr,{name:"vaul",description:"抽屉组件动画",license:"MIT"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:"后端框架"}),o.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[o.jsx(Dr,{name:"FastAPI",description:"现代化 Python Web 框架",license:"MIT"}),o.jsx(Dr,{name:"Uvicorn",description:"ASGI 服务器",license:"BSD-3-Clause"}),o.jsx(Dr,{name:"Pydantic",description:"数据验证库",license:"MIT"}),o.jsx(Dr,{name:"python-multipart",description:"文件上传支持",license:"Apache-2.0"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:"开发工具"}),o.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[o.jsx(Dr,{name:"TypeScript",description:"JavaScript 的超集",license:"Apache-2.0"}),o.jsx(Dr,{name:"Vite",description:"下一代前端构建工具",license:"MIT"}),o.jsx(Dr,{name:"ESLint",description:"JavaScript 代码检查工具",license:"MIT"}),o.jsx(Dr,{name:"PostCSS",description:"CSS 转换工具",license:"MIT"})]})]})]})})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[o.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"开源许可"}),o.jsxs("div",{className:"space-y-3",children:[o.jsx("div",{className:"rounded-lg bg-primary/5 border border-primary/20 p-3 sm:p-4",children:o.jsxs("div",{className:"flex items-start gap-2 sm:gap-3",children:[o.jsx("div",{className:"flex-shrink-0 mt-0.5",children:o.jsx("div",{className:"rounded-md bg-primary/10 px-2 py-1",children:o.jsx("span",{className:"text-xs sm:text-sm font-bold text-primary",children:"GPLv3"})})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("p",{className:"text-sm sm:text-base font-semibold text-foreground mb-1",children:"MaiBot WebUI"}),o.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"本项目采用 GNU General Public License v3.0 开源许可证。 您可以自由地使用、修改和分发本软件,但必须保持相同的开源许可。"})]})]})}),o.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"本项目依赖的所有开源库均遵循各自的开源许可证(MIT、Apache-2.0、BSD 等)。 感谢所有开源贡献者的无私奉献。"})]})]})]})}function Dr({name:t,description:e,license:n}){return o.jsxs("div",{className:"flex items-start justify-between gap-2 rounded-lg border bg-muted/30 p-2.5 sm:p-3",children:[o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("p",{className:"font-medium text-foreground truncate",children:t}),o.jsx("p",{className:"text-muted-foreground text-xs mt-0.5",children:e})]}),o.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 P4({value:t,current:e,onChange:n,label:r,description:s}){const i=e===t;return o.jsxs("button",{onClick:()=>n(t),className:xe("relative rounded-lg border-2 p-3 sm:p-4 text-left transition-all","hover:border-primary/50 hover:bg-accent/50",i?"border-primary bg-accent":"border-border"),children:[i&&o.jsx("div",{className:"absolute top-2 right-2 sm:top-3 sm:right-3 h-2 w-2 rounded-full bg-primary"}),o.jsxs("div",{className:"space-y-1",children:[o.jsx("div",{className:"text-sm sm:text-base font-medium",children:r}),o.jsx("div",{className:"text-[10px] sm:text-xs text-muted-foreground",children:s})]}),o.jsxs("div",{className:"mt-2 sm:mt-3 flex gap-1",children:[t==="light"&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-200"}),o.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-300"}),o.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-400"})]}),t==="dark"&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-700"}),o.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-800"}),o.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-900"})]}),t==="system"&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-200 to-slate-700"}),o.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-300 to-slate-800"}),o.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-400 to-slate-900"})]})]})]})}function ma({value:t,current:e,onChange:n,label:r,colorClass:s}){const i=e===t;return o.jsxs("button",{onClick:()=>n(t),className:xe("relative rounded-lg border-2 p-2 sm:p-3 text-left transition-all","hover:border-primary/50 hover:bg-accent/50",i?"border-primary bg-accent":"border-border"),children:[i&&o.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"}),o.jsxs("div",{className:"flex flex-col items-center gap-1.5 sm:gap-2",children:[o.jsx("div",{className:xe("h-8 w-8 sm:h-10 sm:w-10 rounded-full",s)}),o.jsx("div",{className:"text-[10px] sm:text-xs font-medium text-center",children:r})]})]})}class hie{grad3;p;perm;constructor(e=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(e,n,r){return e[0]*n+e[1]*r}mix(e,n,r){return(1-r)*e+r*n}fade(e){return e*e*e*(e*(e*6-15)+10)}perlin2(e,n){const r=Math.floor(e)&255,s=Math.floor(n)&255;e-=Math.floor(e),n-=Math.floor(n);const i=this.fade(e),a=this.fade(n),l=this.perm[r]+s,c=this.perm[l],d=this.perm[l+1],h=this.perm[r+1]+s,m=this.perm[h],g=this.perm[h+1];return this.mix(this.mix(this.dot(this.grad3[c%12],e,n),this.dot(this.grad3[m%12],e-1,n),i),this.mix(this.dot(this.grad3[d%12],e,n-1),this.dot(this.grad3[g%12],e-1,n-1),i),a)}}function fie(){const t=b.useRef(null),e=b.useRef(null),n=b.useRef(void 0),r=b.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 hie(Math.random()),bounding:null});return b.useEffect(()=>{const s=e.current,i=t.current;if(!s||!i)return;const a=r.current,l=()=>{const w=s.getBoundingClientRect();a.bounding=w,i.style.width=`${w.width}px`,i.style.height=`${w.height}px`},c=()=>{if(!a.bounding)return;const{width:w,height:S}=a.bounding;a.lines=[],a.paths.forEach(q=>q.remove()),a.paths=[];const k=10,j=32,N=w+200,T=S+30,E=Math.ceil(N/k),_=Math.ceil(T/j),A=(w-k*E)/2,D=(S-j*_)/2;for(let q=0;q<=E;q++){const B=[];for(let W=0;W<=_;W++){const ee={x:A+k*q,y:D+j*W,wave:{x:0,y:0},cursor:{x:0,y:0,vx:0,vy:0}};B.push(ee)}const H=document.createElementNS("http://www.w3.org/2000/svg","path");i.appendChild(H),a.paths.push(H),a.lines.push(B)}},d=w=>{const{lines:S,mouse:k,noise:j}=a;S.forEach(N=>{N.forEach(T=>{const E=j.perlin2((T.x+w*.0125)*.002,(T.y+w*.005)*.0015)*12;T.wave.x=Math.cos(E)*32,T.wave.y=Math.sin(E)*16;const _=T.x-k.sx,A=T.y-k.sy,D=Math.hypot(_,A),q=Math.max(175,k.vs);if(D<q){const B=1-D/q,H=Math.cos(D*.001)*B;T.cursor.vx+=Math.cos(k.a)*H*q*k.vs*65e-5,T.cursor.vy+=Math.sin(k.a)*H*q*k.vs*65e-5}T.cursor.vx+=(0-T.cursor.x)*.005,T.cursor.vy+=(0-T.cursor.y)*.005,T.cursor.vx*=.925,T.cursor.vy*=.925,T.cursor.x+=T.cursor.vx*2,T.cursor.y+=T.cursor.vy*2,T.cursor.x=Math.min(100,Math.max(-100,T.cursor.x)),T.cursor.y=Math.min(100,Math.max(-100,T.cursor.y))})})},h=(w,S=!0)=>{const k={x:w.x+w.wave.x+(S?w.cursor.x:0),y:w.y+w.wave.y+(S?w.cursor.y:0)};return k.x=Math.round(k.x*10)/10,k.y=Math.round(k.y*10)/10,k},m=()=>{const{lines:w,paths:S}=a;w.forEach((k,j)=>{let N=h(k[0],!1),T=`M ${N.x} ${N.y}`;k.forEach((E,_)=>{const A=_===k.length-1;N=h(E,!A),T+=`L ${N.x} ${N.y}`}),S[j].setAttribute("d",T)})},g=w=>{const{mouse:S}=a;S.sx+=(S.x-S.sx)*.1,S.sy+=(S.y-S.sy)*.1;const k=S.x-S.lx,j=S.y-S.ly,N=Math.hypot(k,j);S.v=N,S.vs+=(N-S.vs)*.1,S.vs=Math.min(100,S.vs),S.lx=S.x,S.ly=S.y,S.a=Math.atan2(j,k),s&&(s.style.setProperty("--x",`${S.sx}px`),s.style.setProperty("--y",`${S.sy}px`)),d(w),m(),n.current=requestAnimationFrame(g)},x=w=>{if(!a.bounding)return;const{mouse:S}=a;S.x=w.pageX-a.bounding.left,S.y=w.pageY-a.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)},y=()=>{l(),c()};return l(),c(),window.addEventListener("resize",y),window.addEventListener("mousemove",x),n.current=requestAnimationFrame(g),()=>{window.removeEventListener("resize",y),window.removeEventListener("mousemove",x),n.current&&cancelAnimationFrame(n.current)}},[]),o.jsxs("div",{ref:e,className:"waves-background",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"hidden",pointerEvents:"none"},children:[o.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"}}),o.jsx("svg",{ref:t,style:{display:"block",width:"100%",height:"100%"},children:o.jsx("style",{children:`
|
||
path {
|
||
fill: none;
|
||
stroke: hsl(var(--primary) / 0.20);
|
||
stroke-width: 1px;
|
||
}
|
||
`})})]})}function mie(){const t=na();b.useEffect(()=>{localStorage.getItem("access-token")||t({to:"/auth"})},[t])}function AB(){return!!localStorage.getItem("access-token")}function pie(){const[t,e]=b.useState(""),[n,r]=b.useState(!1),[s,i]=b.useState(""),a=na(),{enableWavesBackground:l,setEnableWavesBackground:c}=rB(),{theme:d,setTheme:h}=Kj();b.useEffect(()=>{AB()&&a({to:"/"})},[a]);const g=d==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":d,x=()=>{h(g==="dark"?"light":"dark")},y=async w=>{if(w.preventDefault(),i(""),!t.trim()){i("请输入 Access Token");return}r(!0);try{const S=await fetch("/api/webui/auth/verify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:t.trim()})}),k=await S.json();if(S.ok&&k.valid){localStorage.setItem("access-token",t.trim());const j=await fetch("/api/webui/setup/status",{method:"GET",headers:{Authorization:`Bearer ${t.trim()}`}}),N=await j.json();j.ok&&N.is_first_setup?a({to:"/setup"}):a({to:"/"})}else i(k.message||"Token 验证失败,请检查后重试")}catch(S){console.error("Token 验证错误:",S),i("连接服务器失败,请检查网络连接")}finally{r(!1)}};return o.jsxs("div",{className:"relative flex min-h-screen items-center justify-center overflow-hidden bg-background p-4",children:[l&&o.jsx(fie,{}),o.jsxs(Lt,{className:"relative z-10 w-full max-w-md shadow-2xl backdrop-blur-xl bg-card/80 border-border/50",children:[o.jsx("button",{onClick:x,className:"absolute right-4 top-4 rounded-lg p-2 hover:bg-accent transition-colors z-10 text-foreground",title:g==="dark"?"切换到浅色模式":"切换到深色模式",children:g==="dark"?o.jsx(ik,{className:"h-5 w-5",strokeWidth:2.5,fill:"none"}):o.jsx(ak,{className:"h-5 w-5",strokeWidth:2.5,fill:"none"})}),o.jsxs(En,{className:"space-y-4 text-center",children:[o.jsx("div",{className:"mx-auto flex h-16 w-16 items-center justify-center rounded-2xl bg-primary/10",children:o.jsx(j9,{className:"h-8 w-8 text-primary",strokeWidth:2,fill:"none"})}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(_n,{className:"text-2xl font-bold",children:"欢迎使用 MaiBot"}),o.jsx(Wr,{className:"text-base",children:"请输入您的 Access Token 以继续访问系统"})]})]}),o.jsx(Xn,{children:o.jsxs("form",{onSubmit:y,className:"space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"token",className:"text-sm font-medium",children:"Access Token"}),o.jsxs("div",{className:"relative",children:[o.jsx(jI,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground",strokeWidth:2,fill:"none"}),o.jsx(Pe,{id:"token",type:"password",placeholder:"请输入您的 Access Token",value:t,onChange:w=>e(w.target.value),className:xe("pl-10",s&&"border-red-500 focus-visible:ring-red-500"),disabled:n,autoFocus:!0,autoComplete:"off"})]})]}),s&&o.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:[o.jsx(Lo,{className:"h-4 w-4 flex-shrink-0",strokeWidth:2,fill:"none"}),o.jsx("span",{children:s})]}),o.jsx(ue,{type:"submit",className:"w-full",disabled:n,children:n?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"}),"验证中..."]}):"验证并进入"}),o.jsxs(Er,{children:[o.jsx(Of,{asChild:!0,children:o.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:[o.jsx(Zy,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"我没有 Token,我该去哪里获得 Token?"]})}),o.jsxs(wr,{className:"sm:max-w-md",children:[o.jsxs(Sr,{children:[o.jsxs(kr,{className:"flex items-center gap-2",children:[o.jsx(j9,{className:"h-5 w-5 text-primary",strokeWidth:2,fill:"none"}),"如何获取 Access Token"]}),o.jsx(Xr,{children:"Access Token 是访问 MaiBot WebUI 的唯一凭证,请按以下方式获取"})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx(Vee,{className:"h-5 w-5 text-primary flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),o.jsxs("div",{className:"flex-1 space-y-2",children:[o.jsx("h4",{className:"font-semibold text-sm",children:"方式一:查看启动日志"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"在 MaiBot 启动时,控制台会显示 WebUI Access Token。"}),o.jsxs("div",{className:"rounded bg-background p-2 font-mono text-xs",children:[o.jsx("p",{className:"text-muted-foreground",children:"🔑 WebUI Access Token: abc123..."}),o.jsx("p",{className:"text-muted-foreground",children:"💡 请使用此 Token 登录 WebUI"})]})]})]})}),o.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx(Po,{className:"h-5 w-5 text-primary flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),o.jsxs("div",{className:"flex-1 space-y-2",children:[o.jsx("h4",{className:"font-semibold text-sm",children:"方式二:查看配置文件"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"Token 保存在项目根目录的配置文件中:"}),o.jsx("div",{className:"rounded bg-background p-2 font-mono text-xs break-all",children:o.jsx("code",{className:"text-primary",children:"data/webui.json"})}),o.jsxs("p",{className:"text-xs text-muted-foreground",children:["打开此文件,复制 ",o.jsx("code",{className:"px-1 py-0.5 bg-background rounded",children:"access_token"})," 字段的值"]})]})]})}),o.jsx("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3",children:o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Lo,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-500 flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),o.jsxs("div",{className:"text-sm text-yellow-800 dark:text-yellow-300 space-y-1",children:[o.jsx("p",{className:"font-semibold",children:"安全提示"}),o.jsxs("ul",{className:"list-disc list-inside space-y-0.5 text-xs",children:[o.jsx("li",{children:"请妥善保管您的 Token,不要泄露给他人"}),o.jsx("li",{children:"如需重置 Token,请在登录后前往系统设置"})]})]})]})})]})]})]}),o.jsxs(Fn,{children:[o.jsx(is,{asChild:!0,children:o.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:[o.jsx(Zu,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"我觉得这个界面很卡怎么办?"]})}),o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsxs(Pn,{className:"flex items-center gap-2",children:[o.jsx(Zu,{className:"h-5 w-5 text-primary",strokeWidth:2,fill:"none"}),"关闭背景动画"]}),o.jsx(zn,{children:"背景动画可能会在低性能设备上造成卡顿。关闭动画可以显著提升界面流畅度。"})]}),o.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:o.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭动画后,背景将变为纯色,但不影响任何功能的使用。您可以随时在系统设置中重新开启动画。"})}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:()=>c(!1),children:"关闭动画"})]})]})]})]})})]}),o.jsx("div",{className:"absolute bottom-4 left-0 right-0 text-center text-xs text-muted-foreground",children:o.jsx("p",{children:Hse})})]})}const Nr=b.forwardRef(({className:t,...e},n)=>o.jsx("textarea",{className:xe("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",t),ref:n,...e}));Nr.displayName="Textarea";var gie=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],xie=gie.reduce((t,e)=>{const n=Vy(`Primitive.${e}`),r=b.forwardRef((s,i)=>{const{asChild:a,...l}=s,c=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...l,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{}),vie="Separator",cE="horizontal",yie=["horizontal","vertical"],MB=b.forwardRef((t,e)=>{const{decorative:n,orientation:r=cE,...s}=t,i=bie(r)?r:cE,l=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return o.jsx(xie.div,{"data-orientation":i,...l,...s,ref:e})});MB.displayName=vie;function bie(t){return yie.includes(t)}var RB=MB;const $0=b.forwardRef(({className:t,orientation:e="horizontal",decorative:n=!0,...r},s)=>o.jsx(RB,{ref:s,decorative:n,orientation:e,className:xe("shrink-0 bg-border",e==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...r}));$0.displayName=RB.displayName;function wie({config:t,onChange:e}){const n=s=>{s.trim()&&!t.alias_names.includes(s.trim())&&e({...t,alias_names:[...t.alias_names,s.trim()]})},r=s=>{e({...t,alias_names:t.alias_names.filter((i,a)=>a!==s)})};return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"space-y-3",children:[o.jsx(he,{htmlFor:"qq_account",children:"QQ账号 *"}),o.jsx(Pe,{id:"qq_account",type:"number",placeholder:"请输入机器人的QQ账号",value:t.qq_account||"",onChange:s=>e({...t,qq_account:Number(s.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人登录使用的QQ账号"})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(he,{htmlFor:"nickname",children:"昵称 *"}),o.jsx(Pe,{id:"nickname",placeholder:"请输入机器人的昵称",value:t.nickname,onChange:s=>e({...t,nickname:s.target.value})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人的主要称呼名称"})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(he,{children:"别名"}),o.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:t.alias_names.map((s,i)=>o.jsxs(tn,{variant:"secondary",className:"gap-1",children:[s,o.jsx("button",{type:"button",onClick:()=>r(i),className:"ml-1 hover:text-destructive",children:o.jsx(Pp,{className:"h-3 w-3"})})]},i))}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Pe,{id:"alias_input",placeholder:"输入别名后按回车添加",onKeyPress:s=>{s.key==="Enter"&&(n(s.target.value),s.target.value="")}}),o.jsx(ue,{type:"button",variant:"outline",onClick:()=>{const s=document.getElementById("alias_input");s&&(n(s.value),s.value="")},children:"添加"})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人的其他称呼,可以添加多个"})]})]})}function Sie({config:t,onChange:e}){return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"space-y-3",children:[o.jsx(he,{htmlFor:"personality",children:"人格特征 *"}),o.jsx(Nr,{id:"personality",placeholder:"描述机器人的人格特质和身份特征(建议120字以内)",value:t.personality,onChange:n=>e({...t,personality:n.target.value}),rows:3}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"例如:是一个女大学生,现在在读大二,会刷贴吧"})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(he,{htmlFor:"reply_style",children:"表达风格 *"}),o.jsx(Nr,{id:"reply_style",placeholder:"描述机器人说话的表达风格、表达习惯",value:t.reply_style,onChange:n=>e({...t,reply_style:n.target.value}),rows:3}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"例如:回复平淡一些,简短一些,说中文,参考贴吧、知乎和微博的回复风格"})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(he,{htmlFor:"interest",children:"兴趣 *"}),o.jsx(Nr,{id:"interest",placeholder:"描述机器人感兴趣的话题",value:t.interest,onChange:n=>e({...t,interest:n.target.value}),rows:2}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"会影响机器人对什么话题进行回复"})]}),o.jsx($0,{}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(he,{htmlFor:"plan_style",children:"群聊说话规则 *"}),o.jsx(Nr,{id:"plan_style",placeholder:"机器人在群聊中的行为风格和规则",value:t.plan_style,onChange:n=>e({...t,plan_style:n.target.value}),rows:4}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"定义机器人在群聊中如何行动,例如回复频率、条件等"})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(he,{htmlFor:"private_plan_style",children:"私聊说话规则 *"}),o.jsx(Nr,{id:"private_plan_style",placeholder:"机器人在私聊中的行为风格和规则",value:t.private_plan_style,onChange:n=>e({...t,private_plan_style:n.target.value}),rows:3}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"定义机器人在私聊中的行为方式"})]})]})}function kie({config:t,onChange:e}){return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(he,{htmlFor:"emoji_chance",children:"表情包激活概率"}),o.jsxs("span",{className:"text-sm text-muted-foreground",children:[(t.emoji_chance*100).toFixed(0),"%"]})]}),o.jsx(Pe,{id:"emoji_chance",type:"range",min:"0",max:"1",step:"0.1",value:t.emoji_chance,onChange:n=>e({...t,emoji_chance:Number(n.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人发送表情包的概率"})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(he,{htmlFor:"max_reg_num",children:"最大表情包数量"}),o.jsx(Pe,{id:"max_reg_num",type:"number",min:"1",max:"200",value:t.max_reg_num,onChange:n=>e({...t,max_reg_num:Number(n.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人最多保存的表情包数量"})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx(he,{htmlFor:"do_replace",children:"达到最大数量时替换"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"开启后会删除旧表情包,关闭则不再收集新表情包"})]}),o.jsx(Ft,{id:"do_replace",checked:t.do_replace,onCheckedChange:n=>e({...t,do_replace:n})})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(he,{htmlFor:"check_interval",children:"检查间隔(分钟)"}),o.jsx(Pe,{id:"check_interval",type:"number",min:"1",max:"120",value:t.check_interval,onChange:n=>e({...t,check_interval:Number(n.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"检查表情包注册、破损、删除的时间间隔"})]}),o.jsx($0,{}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx(he,{htmlFor:"steal_emoji",children:"偷取表情包"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人将一些表情包据为己有"})]}),o.jsx(Ft,{id:"steal_emoji",checked:t.steal_emoji,onCheckedChange:n=>e({...t,steal_emoji:n})})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx(he,{htmlFor:"content_filtration",children:"启用表情包过滤"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"只保存符合要求的表情包"})]}),o.jsx(Ft,{id:"content_filtration",checked:t.content_filtration,onCheckedChange:n=>e({...t,content_filtration:n})})]}),t.content_filtration&&o.jsxs("div",{className:"space-y-3",children:[o.jsx(he,{htmlFor:"filtration_prompt",children:"过滤要求"}),o.jsx(Pe,{id:"filtration_prompt",placeholder:"例如:符合公序良俗",value:t.filtration_prompt,onChange:n=>e({...t,filtration_prompt:n.target.value})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"描述表情包应该符合的要求"})]})]})}function Oie({config:t,onChange:e}){return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx(he,{htmlFor:"enable_tool",children:"启用工具系统"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人使用各种工具增强功能"})]}),o.jsx(Ft,{id:"enable_tool",checked:t.enable_tool,onCheckedChange:n=>e({...t,enable_tool:n})})]}),o.jsx($0,{}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx(he,{htmlFor:"enable_mood",children:"启用情绪系统"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"让机器人具有情绪变化能力"})]}),o.jsx(Ft,{id:"enable_mood",checked:t.enable_mood,onCheckedChange:n=>e({...t,enable_mood:n})})]}),t.enable_mood&&o.jsxs("div",{className:"ml-6 space-y-6 border-l-2 border-primary/20 pl-6",children:[o.jsxs("div",{className:"space-y-3",children:[o.jsx(he,{htmlFor:"mood_update_threshold",children:"情绪更新阈值"}),o.jsx(Pe,{id:"mood_update_threshold",type:"number",min:"0.1",max:"10",step:"0.1",value:t.mood_update_threshold||1,onChange:n=>e({...t,mood_update_threshold:Number(n.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"值越高,情绪更新越慢"})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(he,{htmlFor:"emotion_style",children:"情感特征"}),o.jsx(Nr,{id:"emotion_style",placeholder:"描述情绪的变化情况,例如:情绪较为稳定,但遭遇特定事件时起伏较大",value:t.emotion_style||"",onChange:n=>e({...t,emotion_style:n.target.value}),rows:2}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"影响机器人的情绪变化方式"})]})]}),o.jsx($0,{}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx(he,{htmlFor:"all_global",children:"启用全局黑话模式"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人学习和使用群组黑话"})]}),o.jsx(Ft,{id:"all_global",checked:t.all_global,onCheckedChange:n=>e({...t,all_global:n})})]})]})}function jie({config:t,onChange:e}){const[n,r]=b.useState(!1);return o.jsxs("div",{className:"space-y-6",children:[o.jsx("div",{className:"rounded-lg bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-4",children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx("div",{className:"mt-0.5",children:o.jsx("svg",{className:"h-5 w-5 text-blue-600 dark:text-blue-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),o.jsxs("div",{className:"flex-1 text-sm",children:[o.jsx("p",{className:"font-medium text-blue-900 dark:text-blue-100 mb-1",children:"关于硅基流动 (SiliconFlow)"}),o.jsx("p",{className:"text-blue-700 dark:text-blue-300 mb-2",children:"硅基流动提供了完整的模型覆盖,包括 DeepSeek V3、Qwen、视觉模型、语音识别和嵌入模型。 只需一个 API Key 即可使用麦麦的所有功能!"}),o.jsxs("a",{href:"https://cloud.siliconflow.cn",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-blue-600 dark:text-blue-400 hover:underline font-medium",children:["前往硅基流动获取 API Key",o.jsx(w0,{className:"h-3 w-3"})]})]})]})}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(he,{htmlFor:"siliconflow_api_key",children:"SiliconFlow API Key *"}),o.jsxs("div",{className:"relative",children:[o.jsx(Pe,{id:"siliconflow_api_key",type:n?"text":"password",placeholder:"sk-...",value:t.api_key,onChange:s=>e({api_key:s.target.value}),className:"font-mono pr-10"}),o.jsx(ue,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3 hover:bg-transparent",onClick:()=>r(!n),children:n?o.jsx(I0,{className:"h-4 w-4 text-muted-foreground"}):o.jsx(Ji,{className:"h-4 w-4 text-muted-foreground"})})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"请输入您的硅基流动 API 密钥。获取后,麦麦将自动配置所有必需的模型。"})]}),o.jsxs("div",{className:"rounded-lg bg-muted/50 p-4 text-sm space-y-2",children:[o.jsx("p",{className:"font-medium",children:"将自动配置以下模型:"}),o.jsxs("ul",{className:"list-disc list-inside space-y-1 text-muted-foreground ml-2",children:[o.jsx("li",{children:"DeepSeek V3 - 主要对话和工具模型"}),o.jsx("li",{children:"Qwen3 30B - 高频小任务和工具调用"}),o.jsx("li",{children:"Qwen3 VL 30B - 图像识别"}),o.jsx("li",{children:"SenseVoice - 语音识别"}),o.jsx("li",{children:"BGE-M3 - 文本嵌入"}),o.jsx("li",{children:"知识库相关模型 (LPMM)"})]})]}),o.jsx("div",{className:"rounded-lg border border-amber-200 dark:border-amber-800 bg-amber-50 dark:bg-amber-950/30 p-4",children:o.jsxs("p",{className:"text-sm text-amber-900 dark:text-amber-100",children:[o.jsx("span",{className:"font-medium",children:"💡 提示:"}),'完成向导后,您可以在"系统设置 → 模型配置"中添加更多 API 提供商和模型。']})})]})}async function gt(t,e){const n=await fetch(t,e);if(n.status===401)throw localStorage.removeItem("access-token"),window.location.href="/auth",new Error("认证失败,请重新登录");return n}function Tt(){return{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("access-token")}`}}async function Nie(){const t=await gt("/api/webui/config/bot",{method:"GET",headers:Tt()});if(!t.ok)throw new Error("读取Bot配置失败");const n=(await t.json()).config.bot||{};return{qq_account:n.qq_account||0,nickname:n.nickname||"",alias_names:n.alias_names||[]}}async function Cie(){const t=await gt("/api/webui/config/bot",{method:"GET",headers:Tt()});if(!t.ok)throw new Error("读取人格配置失败");const n=(await t.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 Tie(){const t=await gt("/api/webui/config/bot",{method:"GET",headers:Tt()});if(!t.ok)throw new Error("读取表情包配置失败");const n=(await t.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 Eie(){const t=await gt("/api/webui/config/bot",{method:"GET",headers:Tt()});if(!t.ok)throw new Error("读取其他配置失败");const n=(await t.json()).config,r=n.tool||{},s=n.mood||{},i=n.jargon||{};return{enable_tool:r.enable_tool??!0,enable_mood:s.enable_mood??!1,mood_update_threshold:s.mood_update_threshold,emotion_style:s.emotion_style,all_global:i.all_global??!0}}async function _ie(){const t=await gt("/api/webui/config/model",{method:"GET",headers:Tt()});if(!t.ok)throw new Error("读取模型配置失败");return{api_key:((await t.json()).config.api_providers||[]).find(i=>i.name==="SiliconFlow")?.api_key||""}}async function Aie(t){const e=await gt("/api/webui/config/bot/section/bot",{method:"POST",headers:Tt(),body:JSON.stringify(t)});if(!e.ok){const n=await e.json();throw new Error(n.detail||"保存Bot基础配置失败")}return await e.json()}async function Mie(t){const e=await gt("/api/webui/config/bot/section/personality",{method:"POST",headers:Tt(),body:JSON.stringify(t)});if(!e.ok){const n=await e.json();throw new Error(n.detail||"保存人格配置失败")}return await e.json()}async function Rie(t){const e=await gt("/api/webui/config/bot/section/emoji",{method:"POST",headers:Tt(),body:JSON.stringify(t)});if(!e.ok){const n=await e.json();throw new Error(n.detail||"保存表情包配置失败")}return await e.json()}async function Die(t){const e=[];e.push(gt("/api/webui/config/bot/section/tool",{method:"POST",headers:Tt(),body:JSON.stringify({enable_tool:t.enable_tool})})),e.push(gt("/api/webui/config/bot/section/jargon",{method:"POST",headers:Tt(),body:JSON.stringify({all_global:t.all_global})}));const n={enable_mood:t.enable_mood};t.enable_mood&&(n.mood_update_threshold=t.mood_update_threshold||1,n.emotion_style=t.emotion_style||""),e.push(gt("/api/webui/config/bot/section/mood",{method:"POST",headers:Tt(),body:JSON.stringify(n)}));const r=await Promise.all(e);for(const s of r)if(!s.ok){const i=await s.json();throw new Error(i.detail||"保存其他配置失败")}return{success:!0}}async function Pie(t){const e=await gt("/api/webui/config/model",{method:"GET",headers:Tt()});if(!e.ok)throw new Error("读取模型配置失败");const r=(await e.json()).config,s=r.api_providers||[],i=s.findIndex(c=>c.name==="SiliconFlow");i>=0?s[i]={...s[i],api_key:t.api_key}:s.push({name:"SiliconFlow",base_url:"https://api.siliconflow.cn/v1",api_key:t.api_key,client_type:"openai",max_retry:3,timeout:120,retry_interval:5});const a={...r,api_providers:s},l=await gt("/api/webui/config/model",{method:"POST",headers:Tt(),body:JSON.stringify(a)});if(!l.ok){const c=await l.json();throw new Error(c.detail||"保存模型配置失败")}return await l.json()}async function uE(){const t=localStorage.getItem("access-token"),e=await gt("/api/webui/setup/complete",{method:"POST",headers:{Authorization:`Bearer ${t}`}});if(!e.ok){const n=await e.json();throw new Error(n.message||"标记配置完成失败")}return await e.json()}async function cb(){const t=await gt("/api/webui/system/restart",{method:"POST",headers:Tt()});if(!t.ok){const e=await t.json();throw new Error(e.detail||"重启失败")}return await t.json()}async function zie(){const t=await gt("/api/webui/system/status",{method:"GET",headers:Tt()});if(!t.ok){const e=await t.json();throw new Error(e.detail||"获取状态失败")}return await t.json()}function Iie(){const t=na(),{toast:e}=Lr(),[n,r]=b.useState(0),[s,i]=b.useState(!1),[a,l]=b.useState(!1),[c,d]=b.useState(!0),[h,m]=b.useState({qq_account:0,nickname:"",alias_names:[]}),[g,x]=b.useState({personality:"是一个女大学生,现在在读大二,会刷贴吧。",reply_style:"请回复的平淡一些,简短一些,说中文,不要刻意突出自身学科背景。可以参考贴吧,知乎和微博的回复风格。",interest:"对技术相关话题,游戏和动漫相关话题感兴趣,也对日常话题感兴趣,不喜欢太过沉重严肃的话题",plan_style:`1.思考**所有**的可用的action中的**每个动作**是否符合当下条件,如果动作使用条件符合聊天内容就使用
|
||
2.如果相同的内容已经被执行,请不要重复执行
|
||
3.请控制你的发言频率,不要太过频繁的发言
|
||
4.如果有人对你感到厌烦,请减少回复
|
||
5.如果有人对你进行攻击,或者情绪激动,请你以合适的方法应对`,private_plan_style:`1.思考**所有**的可用的action中的**每个动作**是否符合当下条件,如果动作使用条件符合聊天内容就使用
|
||
2.如果相同的内容已经被执行,请不要重复执行
|
||
3.某句话如果已经被回复过,不要重复回复`}),[y,w]=b.useState({emoji_chance:.4,max_reg_num:40,do_replace:!0,check_interval:10,steal_emoji:!0,content_filtration:!1,filtration_prompt:"符合公序良俗"}),[S,k]=b.useState({enable_tool:!0,enable_mood:!1,mood_update_threshold:1,emotion_style:"情绪较为稳定,但遇遇特定事件的时候起伏较大",all_global:!0}),[j,N]=b.useState({api_key:""}),[T,E]=b.useState(!1),[_,A]=b.useState(""),D=[{id:"bot-basic",title:"Bot基础",description:"配置机器人的基本信息",icon:o0},{id:"personality",title:"人格配置",description:"定义机器人的性格和说话风格",icon:Lv},{id:"emoji",title:"表情包",description:"配置表情包相关设置",icon:Ij},{id:"other",title:"其他设置",description:"工具、情绪系统等配置",icon:Vc},{id:"siliconflow",title:"API配置",description:"配置硅基流动API密钥",icon:jI}],q=(n+1)/D.length*100;b.useEffect(()=>{(async()=>{try{d(!0);const[$,K,Y,R,ie]=await Promise.all([Nie(),Cie(),Tie(),Eie(),_ie()]);m($),x(K),w(Y),k(R),N(ie)}catch($){e({title:"加载配置失败",description:$ instanceof Error?$.message:"无法加载现有配置,将使用默认值",variant:"destructive"})}finally{d(!1)}})()},[e]);const B=async()=>{l(!0);try{switch(n){case 0:await Aie(h);break;case 1:await Mie(g);break;case 2:await Rie(y);break;case 3:await Die(S);break;case 4:await Pie(j);break}return e({title:"保存成功",description:`${D[n].title}配置已保存`}),!0}catch(L){return e({title:"保存失败",description:L instanceof Error?L.message:"未知错误",variant:"destructive"}),!1}finally{l(!1)}},H=async()=>{await B()&&n<D.length-1&&r(n+1)},W=()=>{n>0&&r(n-1)},ee=async()=>{i(!0),E(!0);try{if(A("正在保存API配置..."),!await B()){i(!1),E(!1);return}A("正在完成初始化..."),await uE(),A("正在重启麦麦..."),await cb(),e({title:"配置完成",description:"麦麦正在重启以应用新配置..."}),A("等待麦麦重启完成...");const $=60;let K=0,Y=!1;for(;K<$&&!Y;){await new Promise(R=>setTimeout(R,1e3));try{(await zie()).running&&(Y=!0,A("重启成功!正在跳转..."))}catch{K++}}if(!Y)throw new Error("重启超时,请手动检查麦麦状态");setTimeout(()=>{t({to:"/"})},1e3)}catch(L){E(!1),e({title:"配置失败",description:L instanceof Error?L.message:"未知错误",variant:"destructive"})}finally{i(!1)}},I=async()=>{try{await uE(),t({to:"/"})}catch(L){e({title:"跳过失败",description:L instanceof Error?L.message:"未知错误",variant:"destructive"})}},V=()=>{switch(n){case 0:return o.jsx(wie,{config:h,onChange:m});case 1:return o.jsx(Sie,{config:g,onChange:x});case 2:return o.jsx(kie,{config:y,onChange:w});case 3:return o.jsx(Oie,{config:S,onChange:k});case 4:return o.jsx(jie,{config:j,onChange:N});default:return null}};return o.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:[T&&o.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm",children:o.jsxs("div",{className:"mx-auto flex max-w-md flex-col items-center space-y-6 rounded-lg border bg-card p-8 text-center shadow-lg",children:[o.jsx("div",{className:"flex h-20 w-20 items-center justify-center rounded-full bg-primary/10",children:o.jsx(Us,{className:"h-10 w-10 animate-spin text-primary"})}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h2",{className:"text-2xl font-bold",children:"正在重启麦麦"}),o.jsx("p",{className:"text-muted-foreground",children:_})]}),o.jsx("div",{className:"w-full",children:o.jsx("div",{className:"h-2 w-full overflow-hidden rounded-full bg-secondary",children:o.jsx("div",{className:"h-full w-full animate-pulse bg-primary",style:{animation:"pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite"}})})}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"请稍候,这可能需要一分钟..."})]})}),o.jsxs("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[o.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"}),o.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"})]}),c?o.jsxs("div",{className:"relative z-10 text-center",children:[o.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center",children:o.jsx("div",{className:"h-12 w-12 animate-spin rounded-full border-4 border-primary border-t-transparent"})}),o.jsx("p",{className:"text-lg font-medium",children:"加载配置中..."}),o.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"正在读取现有配置"})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"relative z-10 w-full max-w-4xl",children:[o.jsxs("div",{className:"mb-6 md:mb-8 text-center",children:[o.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:o.jsx(Uee,{className:"h-6 w-6 md:h-8 md:w-8 text-primary",strokeWidth:2,fill:"none"})}),o.jsx("h1",{className:"mb-2 text-2xl md:text-3xl font-bold",children:"首次配置向导"}),o.jsxs("p",{className:"text-sm md:text-base text-muted-foreground",children:["让我们一起完成 ",Jj," 的初始配置"]})]}),o.jsxs("div",{className:"mb-6 md:mb-8",children:[o.jsxs("div",{className:"mb-2 flex items-center justify-between text-xs md:text-sm",children:[o.jsxs("span",{className:"text-muted-foreground",children:["步骤 ",n+1," / ",D.length]}),o.jsxs("span",{className:"font-medium text-primary",children:[Math.round(q),"%"]})]}),o.jsx(Qp,{value:q,className:"h-2"})]}),o.jsx("div",{className:"mb-6 md:mb-8 flex justify-between",children:D.map((L,$)=>{const K=L.icon;return o.jsxs("div",{className:xe("flex flex-1 flex-col items-center gap-1 md:gap-2",$<D.length-1&&"relative"),children:[$<D.length-1&&o.jsx("div",{className:xe("absolute left-1/2 top-3 md:top-4 h-0.5 w-full",$<n?"bg-primary":"bg-border")}),o.jsx("div",{className:xe("relative z-10 flex h-6 w-6 md:h-8 md:w-8 items-center justify-center rounded-full border-2 transition-all",$===n||$<n?"border-primary bg-primary text-primary-foreground":"border-border bg-background text-muted-foreground"),children:$<n?o.jsx(Ya,{className:"h-3 w-3 md:h-4 md:w-4",strokeWidth:2.5,fill:"none"}):o.jsx(K,{className:"h-3 w-3 md:h-4 md:w-4"})}),o.jsx("span",{className:xe("text-[10px] md:text-xs text-center max-w-[60px] md:max-w-none truncate md:whitespace-normal",$===n?"font-medium text-foreground":"text-muted-foreground"),title:L.title,children:L.title})]},L.id)})}),o.jsx(Lt,{className:"mb-6 md:mb-8 shadow-lg",children:o.jsx(Xn,{className:"p-4 md:p-8",children:o.jsxs("div",{className:"min-h-[300px] md:min-h-[400px]",children:[o.jsxs("div",{className:"mb-4 md:mb-6",children:[o.jsx("h2",{className:"mb-2 text-xl md:text-2xl font-semibold",children:D[n].title}),o.jsx("p",{className:"text-sm md:text-base text-muted-foreground",children:D[n].description})]}),o.jsx(pn,{className:"h-[400px] md:h-[500px]",children:o.jsx("div",{className:"pr-2",children:V()})})]})})}),o.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-3 sm:gap-0",children:[o.jsx(ue,{variant:"outline",onClick:W,disabled:n===0||a,className:"w-full sm:w-auto order-2 sm:order-1",children:"上一步"}),o.jsxs("div",{className:"flex gap-2 w-full sm:w-auto order-1 sm:order-2",children:[o.jsxs(Fn,{children:[o.jsx(is,{asChild:!0,children:o.jsxs(ue,{variant:"ghost",className:"flex-1 sm:flex-none gap-2",disabled:a||s,children:[o.jsx(Wee,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"跳过向导"]})}),o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认跳过配置向导"}),o.jsx(zn,{children:"您可以随时在系统设置中重新进入配置向导。确定要跳过吗?"})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:I,children:"确认跳过"})]})]})]}),n===D.length-1?o.jsx(ue,{onClick:ee,disabled:s||a,className:"flex-1 sm:flex-none",children:s||a?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"}),a?"保存中...":"完成中..."]}):o.jsxs(o.Fragment,{children:["完成配置",o.jsx(Ya,{className:"ml-2 h-4 w-4",strokeWidth:2,fill:"none"})]})}):o.jsx(ue,{onClick:H,disabled:a,className:"flex-1 sm:flex-none",children:a?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"}),"保存中..."]}):o.jsxs(o.Fragment,{children:["下一步",o.jsx(Gee,{className:"ml-2 h-4 w-4",strokeWidth:2,fill:"none"})]})})]})]})]}),o.jsx("div",{className:"relative z-10 mt-6 md:mt-8 text-center text-xs text-muted-foreground",children:o.jsx("p",{children:"您可以随时在设置中修改这些配置"})})]})]})}function DB(){const t=na();return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:o.jsxs("div",{className:"w-full max-w-2xl text-center",children:[o.jsxs("div",{className:"relative mb-8",children:[o.jsx("h1",{className:"text-[150px] font-black leading-none text-primary/10 select-none sm:text-[200px]",children:"404"}),o.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:o.jsx(ii,{className:"h-20 w-20 text-primary/30 sm:h-24 sm:w-24"})})]}),o.jsxs("div",{className:"space-y-4 mb-8",children:[o.jsx("h2",{className:"text-2xl font-bold text-foreground sm:text-3xl",children:"页面未找到"}),o.jsx("p",{className:"text-base text-muted-foreground sm:text-lg max-w-md mx-auto",children:"抱歉,您访问的页面不存在或已被移除。请检查 URL 是否正确,或返回首页继续浏览。"})]}),o.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-4",children:[o.jsxs(ue,{size:"lg",onClick:()=>t({to:"/"}),className:"gap-2 w-full sm:w-auto",children:[o.jsx(L0,{className:"h-4 w-4"}),"返回首页"]}),o.jsxs(ue,{size:"lg",variant:"outline",onClick:()=>window.history.back(),className:"gap-2 w-full sm:w-auto",children:[o.jsx(Bv,{className:"h-4 w-4"}),"返回上一页"]})]}),o.jsx("div",{className:"mt-12 pt-8 border-t border-border",children:o.jsx("p",{className:"text-sm text-muted-foreground",children:"如果您认为这是一个错误,请联系系统管理员"})})]})})}var PB=["PageUp","PageDown"],zB=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],IB={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},jf="Slider",[xk,Lie,Bie]=Qy(jf),[LB]=Da(jf,[Bie]),[Fie,ub]=LB(jf),BB=b.forwardRef((t,e)=>{const{name:n,min:r=0,max:s=100,step:i=1,orientation:a="horizontal",disabled:l=!1,minStepsBetweenThumbs:c=0,defaultValue:d=[r],value:h,onValueChange:m=()=>{},onValueCommit:g=()=>{},inverted:x=!1,form:y,...w}=t,S=b.useRef(new Set),k=b.useRef(0),N=a==="horizontal"?qie:$ie,[T=[],E]=Kl({prop:h,defaultProp:d,onChange:H=>{[...S.current][k.current]?.focus(),m(H)}}),_=b.useRef(T);function A(H){const W=Wie(T,H);B(H,W)}function D(H){B(H,k.current)}function q(){const H=_.current[k.current];T[k.current]!==H&&g(T)}function B(H,W,{commit:ee}={commit:!1}){const I=Kie(i),V=Zie(Math.round((H-r)/i)*i+r,I),L=Tj(V,[r,s]);E(($=[])=>{const K=Vie($,L,W);if(Yie(K,c*i)){k.current=K.indexOf(L);const Y=String(K)!==String($);return Y&&ee&&g(K),Y?K:$}else return $})}return o.jsx(Fie,{scope:t.__scopeSlider,name:n,disabled:l,min:r,max:s,valueIndexToChangeRef:k,thumbs:S.current,values:T,orientation:a,form:y,children:o.jsx(xk.Provider,{scope:t.__scopeSlider,children:o.jsx(xk.Slot,{scope:t.__scopeSlider,children:o.jsx(N,{"aria-disabled":l,"data-disabled":l?"":void 0,...w,ref:e,onPointerDown:nt(w.onPointerDown,()=>{l||(_.current=T)}),min:r,max:s,inverted:x,onSlideStart:l?void 0:A,onSlideMove:l?void 0:D,onSlideEnd:l?void 0:q,onHomeKeyDown:()=>!l&&B(r,0,{commit:!0}),onEndKeyDown:()=>!l&&B(s,T.length-1,{commit:!0}),onStepKeyDown:({event:H,direction:W})=>{if(!l){const V=PB.includes(H.key)||H.shiftKey&&zB.includes(H.key)?10:1,L=k.current,$=T[L],K=i*V*W;B($+K,L,{commit:!0})}}})})})})});BB.displayName=jf;var[FB,qB]=LB(jf,{startEdge:"left",endEdge:"right",size:"width",direction:1}),qie=b.forwardRef((t,e)=>{const{min:n,max:r,dir:s,inverted:i,onSlideStart:a,onSlideMove:l,onSlideEnd:c,onStepKeyDown:d,...h}=t,[m,g]=b.useState(null),x=er(e,N=>g(N)),y=b.useRef(void 0),w=Rp(s),S=w==="ltr",k=S&&!i||!S&&i;function j(N){const T=y.current||m.getBoundingClientRect(),E=[0,T.width],A=t6(E,k?[n,r]:[r,n]);return y.current=T,A(N-T.left)}return o.jsx(FB,{scope:t.__scopeSlider,startEdge:k?"left":"right",endEdge:k?"right":"left",direction:k?1:-1,size:"width",children:o.jsx($B,{dir:w,"data-orientation":"horizontal",...h,ref:x,style:{...h.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:N=>{const T=j(N.clientX);a?.(T)},onSlideMove:N=>{const T=j(N.clientX);l?.(T)},onSlideEnd:()=>{y.current=void 0,c?.()},onStepKeyDown:N=>{const E=IB[k?"from-left":"from-right"].includes(N.key);d?.({event:N,direction:E?-1:1})}})})}),$ie=b.forwardRef((t,e)=>{const{min:n,max:r,inverted:s,onSlideStart:i,onSlideMove:a,onSlideEnd:l,onStepKeyDown:c,...d}=t,h=b.useRef(null),m=er(e,h),g=b.useRef(void 0),x=!s;function y(w){const S=g.current||h.current.getBoundingClientRect(),k=[0,S.height],N=t6(k,x?[r,n]:[n,r]);return g.current=S,N(w-S.top)}return o.jsx(FB,{scope:t.__scopeSlider,startEdge:x?"bottom":"top",endEdge:x?"top":"bottom",size:"height",direction:x?1:-1,children:o.jsx($B,{"data-orientation":"vertical",...d,ref:m,style:{...d.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:w=>{const S=y(w.clientY);i?.(S)},onSlideMove:w=>{const S=y(w.clientY);a?.(S)},onSlideEnd:()=>{g.current=void 0,l?.()},onStepKeyDown:w=>{const k=IB[x?"from-bottom":"from-top"].includes(w.key);c?.({event:w,direction:k?-1:1})}})})}),$B=b.forwardRef((t,e)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:s,onSlideEnd:i,onHomeKeyDown:a,onEndKeyDown:l,onStepKeyDown:c,...d}=t,h=ub(jf,n);return o.jsx(Sn.span,{...d,ref:e,onKeyDown:nt(t.onKeyDown,m=>{m.key==="Home"?(a(m),m.preventDefault()):m.key==="End"?(l(m),m.preventDefault()):PB.concat(zB).includes(m.key)&&(c(m),m.preventDefault())}),onPointerDown:nt(t.onPointerDown,m=>{const g=m.target;g.setPointerCapture(m.pointerId),m.preventDefault(),h.thumbs.has(g)?g.focus():r(m)}),onPointerMove:nt(t.onPointerMove,m=>{m.target.hasPointerCapture(m.pointerId)&&s(m)}),onPointerUp:nt(t.onPointerUp,m=>{const g=m.target;g.hasPointerCapture(m.pointerId)&&(g.releasePointerCapture(m.pointerId),i(m))})})}),HB="SliderTrack",QB=b.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,s=ub(HB,n);return o.jsx(Sn.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...r,ref:e})});QB.displayName=HB;var vk="SliderRange",VB=b.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,s=ub(vk,n),i=qB(vk,n),a=b.useRef(null),l=er(e,a),c=s.values.length,d=s.values.map(g=>GB(g,s.min,s.max)),h=c>1?Math.min(...d):0,m=100-Math.max(...d);return o.jsx(Sn.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...r,ref:l,style:{...t.style,[i.startEdge]:h+"%",[i.endEdge]:m+"%"}})});VB.displayName=vk;var yk="SliderThumb",UB=b.forwardRef((t,e)=>{const n=Lie(t.__scopeSlider),[r,s]=b.useState(null),i=er(e,l=>s(l)),a=b.useMemo(()=>r?n().findIndex(l=>l.ref.current===r):-1,[n,r]);return o.jsx(Hie,{...t,ref:i,index:a})}),Hie=b.forwardRef((t,e)=>{const{__scopeSlider:n,index:r,name:s,...i}=t,a=ub(yk,n),l=qB(yk,n),[c,d]=b.useState(null),h=er(e,j=>d(j)),m=c?a.form||!!c.closest("form"):!0,g=iI(c),x=a.values[r],y=x===void 0?0:GB(x,a.min,a.max),w=Uie(r,a.values.length),S=g?.[l.size],k=S?Gie(S,y,l.direction):0;return b.useEffect(()=>{if(c)return a.thumbs.add(c),()=>{a.thumbs.delete(c)}},[c,a.thumbs]),o.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[l.startEdge]:`calc(${y}% + ${k}px)`},children:[o.jsx(xk.ItemSlot,{scope:t.__scopeSlider,children:o.jsx(Sn.span,{role:"slider","aria-label":t["aria-label"]||w,"aria-valuemin":a.min,"aria-valuenow":x,"aria-valuemax":a.max,"aria-orientation":a.orientation,"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,tabIndex:a.disabled?void 0:0,...i,ref:h,style:x===void 0?{display:"none"}:t.style,onFocus:nt(t.onFocus,()=>{a.valueIndexToChangeRef.current=r})})}),m&&o.jsx(WB,{name:s??(a.name?a.name+(a.values.length>1?"[]":""):void 0),form:a.form,value:x},r)]})});UB.displayName=yk;var Qie="RadioBubbleInput",WB=b.forwardRef(({__scopeSlider:t,value:e,...n},r)=>{const s=b.useRef(null),i=er(s,r),a=sI(e);return b.useEffect(()=>{const l=s.current;if(!l)return;const c=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(c,"value").set;if(a!==e&&h){const m=new Event("input",{bubbles:!0});h.call(l,e),l.dispatchEvent(m)}},[a,e]),o.jsx(Sn.input,{style:{display:"none"},...n,ref:i,defaultValue:e})});WB.displayName=Qie;function Vie(t=[],e,n){const r=[...t];return r[n]=e,r.sort((s,i)=>s-i)}function GB(t,e,n){const i=100/(n-e)*(t-e);return Tj(i,[0,100])}function Uie(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}function Wie(t,e){if(t.length===1)return 0;const n=t.map(s=>Math.abs(s-e)),r=Math.min(...n);return n.indexOf(r)}function Gie(t,e,n){const r=t/2,i=t6([0,50],[0,r]);return(r-i(e)*n)*n}function Xie(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}function Yie(t,e){if(e>0){const n=Xie(t);return Math.min(...n)>=e}return!0}function t6(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function Kie(t){return(String(t).split(".")[1]||"").length}function Zie(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}var XB=BB,Jie=QB,eae=VB,tae=UB;const Nf=b.forwardRef(({className:t,...e},n)=>o.jsxs(XB,{ref:n,className:xe("relative flex w-full touch-none select-none items-center",t),...e,children:[o.jsx(Jie,{className:"relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20",children:o.jsx(eae,{className:"absolute h-full bg-primary"})}),o.jsx(tae,{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"})]}));Nf.displayName=XB.displayName;const Vt=Dee,Ut=Pee,$t=b.forwardRef(({className:t,children:e,...n},r)=>o.jsxs(cI,{ref:r,className:xe("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",t),...n,children:[e,o.jsx(Eee,{asChild:!0,children:o.jsx(Xc,{className:"h-4 w-4 opacity-50"})})]}));$t.displayName=cI.displayName;const YB=b.forwardRef(({className:t,...e},n)=>o.jsx(uI,{ref:n,className:xe("flex cursor-default items-center justify-center py-1",t),...e,children:o.jsx(B0,{className:"h-4 w-4"})}));YB.displayName=uI.displayName;const KB=b.forwardRef(({className:t,...e},n)=>o.jsx(dI,{ref:n,className:xe("flex cursor-default items-center justify-center py-1",t),...e,children:o.jsx(Xc,{className:"h-4 w-4"})}));KB.displayName=dI.displayName;const Ht=b.forwardRef(({className:t,children:e,position:n="popper",...r},s)=>o.jsx(_ee,{children:o.jsxs(hI,{ref:s,className:xe("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",t),position:n,...r,children:[o.jsx(YB,{}),o.jsx(Aee,{className:xe("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),o.jsx(KB,{})]})}));Ht.displayName=hI.displayName;const nae=b.forwardRef(({className:t,...e},n)=>o.jsx(fI,{ref:n,className:xe("px-2 py-1.5 text-sm font-semibold",t),...e}));nae.displayName=fI.displayName;const De=b.forwardRef(({className:t,children:e,...n},r)=>o.jsxs(mI,{ref:r,className:xe("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",t),...n,children:[o.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(Mee,{children:o.jsx(zo,{className:"h-4 w-4"})})}),o.jsx(Ree,{children:e})]}));De.displayName=mI.displayName;const rae=b.forwardRef(({className:t,...e},n)=>o.jsx(pI,{ref:n,className:xe("-mx-1 my-1 h-px bg-muted",t),...e}));rae.displayName=pI.displayName;function sae(t){const e=iae(t),n=b.forwardRef((r,s)=>{const{children:i,...a}=r,l=b.Children.toArray(i),c=l.find(oae);if(c){const d=c.props.children,h=l.map(m=>m===c?b.Children.count(d)>1?b.Children.only(null):b.isValidElement(d)?d.props.children:null:m);return o.jsx(e,{...a,ref:s,children:b.isValidElement(d)?b.cloneElement(d,void 0,h):null})}return o.jsx(e,{...a,ref:s,children:i})});return n.displayName=`${t}.Slot`,n}function iae(t){const e=b.forwardRef((n,r)=>{const{children:s,...i}=n;if(b.isValidElement(s)){const a=cae(s),l=lae(i,s.props);return s.type!==b.Fragment&&(l.ref=r?Gc(r,a):a),b.cloneElement(s,l)}return b.Children.count(s)>1?b.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var aae=Symbol("radix.slottable");function oae(t){return b.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===aae}function lae(t,e){const n={...e};for(const r in e){const s=t[r],i=e[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...l)=>{const c=i(...l);return s(...l),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}function cae(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var db="Popover",[ZB]=Da(db,[vf]),Vp=vf(),[uae,lu]=ZB(db),JB=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:a=!1}=t,l=Vp(e),c=b.useRef(null),[d,h]=b.useState(!1),[m,g]=Kl({prop:r,defaultProp:s??!1,onChange:i,caller:db});return o.jsx(Yy,{...l,children:o.jsx(uae,{scope:e,contentId:Gi(),triggerRef:c,open:m,onOpenChange:g,onOpenToggle:b.useCallback(()=>g(x=>!x),[g]),hasCustomAnchor:d,onCustomAnchorAdd:b.useCallback(()=>h(!0),[]),onCustomAnchorRemove:b.useCallback(()=>h(!1),[]),modal:a,children:n})})};JB.displayName=db;var eF="PopoverAnchor",dae=b.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=lu(eF,n),i=Vp(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:l}=s;return b.useEffect(()=>(a(),()=>l()),[a,l]),o.jsx(Ky,{...i,...r,ref:e})});dae.displayName=eF;var tF="PopoverTrigger",nF=b.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=lu(tF,n),i=Vp(n),a=er(e,s.triggerRef),l=o.jsx(Sn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":oF(s.open),...r,ref:a,onClick:nt(t.onClick,s.onOpenToggle)});return s.hasCustomAnchor?l:o.jsx(Ky,{asChild:!0,...i,children:l})});nF.displayName=tF;var n6="PopoverPortal",[hae,fae]=ZB(n6,{forceMount:void 0}),rF=t=>{const{__scopePopover:e,forceMount:n,children:r,container:s}=t,i=lu(n6,e);return o.jsx(hae,{scope:e,forceMount:n,children:o.jsx(oi,{present:n||i.open,children:o.jsx(Xy,{asChild:!0,container:s,children:r})})})};rF.displayName=n6;var Kh="PopoverContent",sF=b.forwardRef((t,e)=>{const n=fae(Kh,t.__scopePopover),{forceMount:r=n.forceMount,...s}=t,i=lu(Kh,t.__scopePopover);return o.jsx(oi,{present:r||i.open,children:i.modal?o.jsx(pae,{...s,ref:e}):o.jsx(gae,{...s,ref:e})})});sF.displayName=Kh;var mae=sae("PopoverContent.RemoveScroll"),pae=b.forwardRef((t,e)=>{const n=lu(Kh,t.__scopePopover),r=b.useRef(null),s=er(e,r),i=b.useRef(!1);return b.useEffect(()=>{const a=r.current;if(a)return gI(a)},[]),o.jsx(xI,{as:mae,allowPinchZoom:!0,children:o.jsx(iF,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:nt(t.onCloseAutoFocus,a=>{a.preventDefault(),i.current||n.triggerRef.current?.focus()}),onPointerDownOutside:nt(t.onPointerDownOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;i.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:nt(t.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),gae=b.forwardRef((t,e)=>{const n=lu(Kh,t.__scopePopover),r=b.useRef(!1),s=b.useRef(!1);return o.jsx(iF,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{t.onCloseAutoFocus?.(i),i.defaultPrevented||(r.current||n.triggerRef.current?.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{t.onInteractOutside?.(i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;n.triggerRef.current?.contains(a)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),iF=b.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:h,...m}=t,g=lu(Kh,n),x=Vp(n);return vI(),o.jsx(yI,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:o.jsx(Rj,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:h,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>g.onOpenChange(!1),children:o.jsx(Dj,{"data-state":oF(g.open),role:"dialog",id:g.contentId,...x,...m,ref:e,style:{...m.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),aF="PopoverClose",xae=b.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=lu(aF,n);return o.jsx(Sn.button,{type:"button",...r,ref:e,onClick:nt(t.onClick,()=>s.onOpenChange(!1))})});xae.displayName=aF;var vae="PopoverArrow",yae=b.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=Vp(n);return o.jsx(Pj,{...s,...r,ref:e})});yae.displayName=vae;function oF(t){return t?"open":"closed"}var bae=JB,wae=nF,Sae=rF,lF=sF;const Bo=bae,Fo=wae,Ka=b.forwardRef(({className:t,align:e="center",sideOffset:n=4,...r},s)=>o.jsx(Sae,{children:o.jsx(lF,{ref:s,align:e,sideOffset:n,className:xe("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]",t),...r})}));Ka.displayName=lF.displayName;const cu="/api/webui/config";async function dE(){const e=await(await gt(`${cu}/bot`)).json();if(!e.success)throw new Error("获取配置数据失败");return e.config}async function Dh(){const e=await(await gt(`${cu}/model`)).json();if(!e.success)throw new Error("获取模型配置数据失败");return e.config}async function hE(t){const n=await(await gt(`${cu}/bot`,{method:"POST",headers:Tt(),body:JSON.stringify(t)})).json();if(!n.success)throw new Error(n.message||"保存配置失败")}async function kae(){const e=await(await gt(`${cu}/bot/raw`)).json();if(!e.success)throw new Error("获取配置源代码失败");return e.content}async function Oae(t){const n=await(await gt(`${cu}/bot/raw`,{method:"POST",headers:Tt(),body:JSON.stringify({raw_content:t})})).json();if(!n.success)throw new Error(n.message||"保存配置失败")}async function Uv(t){const n=await(await gt(`${cu}/model`,{method:"POST",headers:Tt(),body:JSON.stringify(t)})).json();if(!n.success)throw new Error(n.message||"保存配置失败")}async function jae(t,e){const r=await(await gt(`${cu}/bot/section/${t}`,{method:"POST",headers:Tt(),body:JSON.stringify(e)})).json();if(!r.success)throw new Error(r.message||`保存配置节 ${t} 失败`)}async function bk(t,e){const r=await(await gt(`${cu}/model/section/${t}`,{method:"POST",headers:Tt(),body:JSON.stringify(e)})).json();if(!r.success)throw new Error(r.message||`保存配置节 ${t} 失败`)}async function Nae(t,e="openai",n="/models"){const r=new URLSearchParams({provider_name:t,parser:e,endpoint:n}),s=await gt(`/api/webui/models/list?${r}`);if(!s.ok){const a=await s.json().catch(()=>({}));throw new Error(a.detail||`获取模型列表失败 (${s.status})`)}const i=await s.json();if(!i.success)throw new Error("获取模型列表失败");return i.models}async function Cae(t){const e=new URLSearchParams({provider_name:t}),n=await gt(`/api/webui/models/test-connection-by-name?${e}`,{method:"POST"});if(!n.ok){const r=await n.json().catch(()=>({}));throw new Error(r.detail||`测试连接失败 (${n.status})`)}return await n.json()}const Tae=kf("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"}}),ba=b.forwardRef(({className:t,variant:e,...n},r)=>o.jsx("div",{ref:r,role:"alert",className:xe(Tae({variant:e}),t),...n}));ba.displayName="Alert";const Eae=b.forwardRef(({className:t,...e},n)=>o.jsx("h5",{ref:n,className:xe("mb-1 font-medium leading-none tracking-tight",t),...e}));Eae.displayName="AlertTitle";const wa=b.forwardRef(({className:t,...e},n)=>o.jsx("div",{ref:n,className:xe("text-sm [&_p]:leading-relaxed",t),...e}));wa.displayName="AlertDescription";function r6({onRestartComplete:t,onRestartFailed:e}){const[n,r]=b.useState(0),[s,i]=b.useState("restarting"),[a,l]=b.useState(0),[c,d]=b.useState(0);b.useEffect(()=>{const g=setInterval(()=>{r(w=>w>=90?w:w+1)},200),x=setInterval(()=>{l(w=>w+1)},1e3),y=setTimeout(()=>{i("checking"),h()},3e3);return()=>{clearInterval(g),clearInterval(x),clearTimeout(y)}},[]);const h=()=>{const x=async()=>{try{if(d(w=>w+1),(await fetch("/api/webui/system/status",{method:"GET",headers:{"Content-Type":"application/json"},signal:AbortSignal.timeout(3e3)})).ok)r(100),i("success"),setTimeout(()=>{t?.()},1500);else throw new Error("Status check failed")}catch{c<60?setTimeout(x,2e3):(i("failed"),e?.())}};x()},m=g=>{const x=Math.floor(g/60),y=g%60;return`${x}:${y.toString().padStart(2,"0")}`};return o.jsx("div",{className:"fixed inset-0 bg-background/95 backdrop-blur-sm z-50 flex items-center justify-center",children:o.jsxs("div",{className:"max-w-md w-full mx-4 space-y-8",children:[o.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[s==="restarting"&&o.jsxs(o.Fragment,{children:[o.jsx(Us,{className:"h-16 w-16 text-primary animate-spin"}),o.jsx("h2",{className:"text-2xl font-bold",children:"正在重启麦麦"}),o.jsx("p",{className:"text-muted-foreground text-center",children:"请稍候,麦麦正在重启中..."})]}),s==="checking"&&o.jsxs(o.Fragment,{children:[o.jsx(Us,{className:"h-16 w-16 text-primary animate-spin"}),o.jsx("h2",{className:"text-2xl font-bold",children:"检查服务状态"}),o.jsxs("p",{className:"text-muted-foreground text-center",children:["等待服务恢复... (尝试 ",c,"/60)"]})]}),s==="success"&&o.jsxs(o.Fragment,{children:[o.jsx(Ya,{className:"h-16 w-16 text-green-500"}),o.jsx("h2",{className:"text-2xl font-bold",children:"重启成功"}),o.jsx("p",{className:"text-muted-foreground text-center",children:"正在跳转到登录页面..."})]}),s==="failed"&&o.jsxs(o.Fragment,{children:[o.jsx(Lo,{className:"h-16 w-16 text-destructive"}),o.jsx("h2",{className:"text-2xl font-bold",children:"重启超时"}),o.jsx("p",{className:"text-muted-foreground text-center",children:"服务未能在预期时间内恢复,请手动检查或刷新页面"})]})]}),s!=="failed"&&o.jsxs("div",{className:"space-y-2",children:[o.jsx(Qp,{value:n,className:"h-2"}),o.jsxs("div",{className:"flex justify-between text-sm text-muted-foreground",children:[o.jsxs("span",{children:[n,"%"]}),o.jsxs("span",{children:["已用时: ",m(a)]})]})]}),o.jsx("div",{className:"bg-muted/50 rounded-lg p-4 space-y-2",children:o.jsxs("p",{className:"text-sm text-muted-foreground",children:[s==="restarting"&&"🔄 配置已保存,正在重启主程序...",s==="checking"&&"⏳ 正在等待服务恢复,请勿关闭页面...",s==="success"&&"✅ 配置已生效,服务运行正常",s==="failed"&&"⚠️ 如果长时间无响应,请尝试手动重启"]})}),o.jsx("div",{className:"bg-yellow-500/10 border border-yellow-500/50 rounded-lg p-4",children:o.jsxs("p",{className:"text-sm text-yellow-900 dark:text-yellow-100",children:[o.jsx("strong",{children:"⚠️ 重要提示:"})," 由于技术原因,使用重启功能后,将无法再使用 ",o.jsx("code",{className:"px-1 py-0.5 bg-yellow-200 dark:bg-yellow-900 rounded",children:"Ctrl+C"})," 结束程序。如需结束程序,请使用脚本目录下的进程管理脚本。"]})}),s==="failed"&&o.jsxs("div",{className:"flex gap-2",children:[o.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:"刷新页面"}),o.jsx("button",{onClick:()=>{i("checking"),d(0),h()},className:"flex-1 px-4 py-2 bg-secondary text-secondary-foreground rounded-md hover:bg-secondary/90",children:"重试检测"})]})]})})}let wk=[],cF=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,n=0;e<t.length;e++)(e%2?cF:wk).push(n=n+t[e])})();function _ae(t){if(t<768)return!1;for(let e=0,n=wk.length;;){let r=e+n>>1;if(t<wk[r])n=r;else if(t>=cF[r])e=r+1;else return!0;if(e==n)return!1}}function fE(t){return t>=127462&&t<=127487}const mE=8205;function Aae(t,e,n=!0,r=!0){return(n?uF:Mae)(t,e,r)}function uF(t,e,n){if(e==t.length)return e;e&&dF(t.charCodeAt(e))&&hF(t.charCodeAt(e-1))&&e--;let r=z4(t,e);for(e+=pE(r);e<t.length;){let s=z4(t,e);if(r==mE||s==mE||n&&_ae(s))e+=pE(s),r=s;else if(fE(s)){let i=0,a=e-2;for(;a>=0&&fE(z4(t,a));)i++,a-=2;if(i%2==0)break;e+=2}else break}return e}function Mae(t,e,n){for(;e>0;){let r=uF(t,e-2,n);if(r<e)return r;e--}return 0}function z4(t,e){let n=t.charCodeAt(e);if(!hF(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return dF(r)?(n-55296<<10)+(r-56320)+65536:n}function dF(t){return t>=56320&&t<57344}function hF(t){return t>=55296&&t<56320}function pE(t){return t<65536?1:2}class An{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,r){[e,n]=Zh(this,e,n);let s=[];return this.decompose(0,e,s,2),r.length&&r.decompose(0,r.length,s,3),this.decompose(n,this.length,s,1),uv.from(s,this.length-(n-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=Zh(this,e,n);let r=[];return this.decompose(e,n,r,0),uv.from(r,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),s=new k0(this),i=new k0(e);for(let a=n,l=n;;){if(s.next(a),i.next(a),a=0,s.lineBreak!=i.lineBreak||s.done!=i.done||s.value!=i.value)return!1;if(l+=s.value.length,s.done||l>=r)return!0}}iter(e=1){return new k0(this,e)}iterRange(e,n=this.length){return new fF(this,e,n)}iterLines(e,n){let r;if(e==null)r=this.iter();else{n==null&&(n=this.lines+1);let s=this.line(e).from;r=this.iterRange(s,Math.max(s,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new mF(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?An.empty:e.length<=32?new Ur(e):uv.from(Ur.split(e,[]))}}class Ur extends An{constructor(e,n=Rae(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,r,s){for(let i=0;;i++){let a=this.text[i],l=s+a.length;if((n?r:l)>=e)return new Dae(s,l,r,a);s=l+1,r++}}decompose(e,n,r,s){let i=e<=0&&n>=this.length?this:new Ur(gE(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(s&1){let a=r.pop(),l=dv(i.text,a.text.slice(),0,i.length);if(l.length<=32)r.push(new Ur(l,a.length+i.length));else{let c=l.length>>1;r.push(new Ur(l.slice(0,c)),new Ur(l.slice(c)))}}else r.push(i)}replace(e,n,r){if(!(r instanceof Ur))return super.replace(e,n,r);[e,n]=Zh(this,e,n);let s=dv(this.text,dv(r.text,gE(this.text,0,e)),n),i=this.length+r.length-(n-e);return s.length<=32?new Ur(s,i):uv.from(Ur.split(s,[]),i)}sliceString(e,n=this.length,r=`
|
||
`){[e,n]=Zh(this,e,n);let s="";for(let i=0,a=0;i<=n&&a<this.text.length;a++){let l=this.text[a],c=i+l.length;i>e&&a&&(s+=r),e<c&&n>i&&(s+=l.slice(Math.max(0,e-i),n-i)),i=c+1}return s}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let r=[],s=-1;for(let i of e)r.push(i),s+=i.length+1,r.length==32&&(n.push(new Ur(r,s)),r=[],s=-1);return s>-1&&n.push(new Ur(r,s)),n}}let uv=class bh extends An{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,n,r,s){for(let i=0;;i++){let a=this.children[i],l=s+a.length,c=r+a.lines-1;if((n?c:l)>=e)return a.lineInner(e,n,r,s);s=l+1,r=c+1}}decompose(e,n,r,s){for(let i=0,a=0;a<=n&&i<this.children.length;i++){let l=this.children[i],c=a+l.length;if(e<=c&&n>=a){let d=s&((a<=e?1:0)|(c>=n?2:0));a>=e&&c<=n&&!d?r.push(l):l.decompose(e-a,n-a,r,d)}a=c+1}}replace(e,n,r){if([e,n]=Zh(this,e,n),r.lines<this.lines)for(let s=0,i=0;s<this.children.length;s++){let a=this.children[s],l=i+a.length;if(e>=i&&n<=l){let c=a.replace(e-i,n-i,r),d=this.lines-a.lines+c.lines;if(c.lines<d>>4&&c.lines>d>>6){let h=this.children.slice();return h[s]=c,new bh(h,this.length-(n-e)+r.length)}return super.replace(i,l,c)}i=l+1}return super.replace(e,n,r)}sliceString(e,n=this.length,r=`
|
||
`){[e,n]=Zh(this,e,n);let s="";for(let i=0,a=0;i<this.children.length&&a<=n;i++){let l=this.children[i],c=a+l.length;a>e&&i&&(s+=r),e<c&&n>a&&(s+=l.sliceString(e-a,n-a,r)),a=c+1}return s}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof bh))return 0;let r=0,[s,i,a,l]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;s+=n,i+=n){if(s==a||i==l)return r;let c=this.children[s],d=e.children[i];if(c!=d)return r+c.scanIdentical(d,n);r+=c.length+1}}static from(e,n=e.reduce((r,s)=>r+s.length+1,-1)){let r=0;for(let x of e)r+=x.lines;if(r<32){let x=[];for(let y of e)y.flatten(x);return new Ur(x,n)}let s=Math.max(32,r>>5),i=s<<1,a=s>>1,l=[],c=0,d=-1,h=[];function m(x){let y;if(x.lines>i&&x instanceof bh)for(let w of x.children)m(w);else x.lines>a&&(c>a||!c)?(g(),l.push(x)):x instanceof Ur&&c&&(y=h[h.length-1])instanceof Ur&&x.lines+y.lines<=32?(c+=x.lines,d+=x.length+1,h[h.length-1]=new Ur(y.text.concat(x.text),y.length+1+x.length)):(c+x.lines>s&&g(),c+=x.lines,d+=x.length+1,h.push(x))}function g(){c!=0&&(l.push(h.length==1?h[0]:bh.from(h,d)),d=-1,c=h.length=0)}for(let x of e)m(x);return g(),l.length==1?l[0]:new bh(l,n)}};An.empty=new Ur([""],0);function Rae(t){let e=-1;for(let n of t)e+=n.length+1;return e}function dv(t,e,n=0,r=1e9){for(let s=0,i=0,a=!0;i<t.length&&s<=r;i++){let l=t[i],c=s+l.length;c>=n&&(c>r&&(l=l.slice(0,r-s)),s<n&&(l=l.slice(n-s)),a?(e[e.length-1]+=l,a=!1):e.push(l)),s=c+1}return e}function gE(t,e,n){return dv(t,[""],e,n)}class k0{constructor(e,n=1){this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[n>0?1:(e instanceof Ur?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,s=this.nodes[r],i=this.offsets[r],a=i>>1,l=s instanceof Ur?s.text.length:s.children.length;if(a==(n>0?l:0)){if(r==0)return this.done=!0,this.value="",this;n>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((i&1)==(n>0?0:1)){if(this.offsets[r]+=n,e==0)return this.lineBreak=!0,this.value=`
|
||
`,this;e--}else if(s instanceof Ur){let c=s.text[a+(n<0?-1:0)];if(this.offsets[r]+=n,c.length>Math.max(0,e))return this.value=e==0?c:n>0?c.slice(e):c.slice(0,c.length-e),this;e-=c.length}else{let c=s.children[a+(n<0?-1:0)];e>c.length?(e-=c.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(c),this.offsets.push(n>0?1:(c instanceof Ur?c.text.length:c.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class fF{constructor(e,n,r){this.value="",this.done=!1,this.cursor=new k0(e,n>r?-1:1),this.pos=n>r?e.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}nextInner(e,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let r=n<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:s}=this.cursor.next(e);return this.pos+=(s.length+e)*n,this.value=s.length<=r?s:n<0?s.slice(s.length-r):s.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class mF{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:r,value:s}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(An.prototype[Symbol.iterator]=function(){return this.iter()},k0.prototype[Symbol.iterator]=fF.prototype[Symbol.iterator]=mF.prototype[Symbol.iterator]=function(){return this});class Dae{constructor(e,n,r,s){this.from=e,this.to=n,this.number=r,this.text=s}get length(){return this.to-this.from}}function Zh(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function Ps(t,e,n=!0,r=!0){return Aae(t,e,n,r)}function Pae(t){return t>=56320&&t<57344}function zae(t){return t>=55296&&t<56320}function vi(t,e){let n=t.charCodeAt(e);if(!zae(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return Pae(r)?(n-55296<<10)+(r-56320)+65536:n}function s6(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function ko(t){return t<65536?1:2}const Sk=/\r\n?|\n/;var Ds=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(Ds||(Ds={}));class Io{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;n<this.sections.length;n+=2)e+=this.sections[n];return e}get newLength(){let e=0;for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n+1];e+=r<0?this.sections[n]:r}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let n=0,r=0,s=0;n<this.sections.length;){let i=this.sections[n++],a=this.sections[n++];a<0?(e(r,s,i),s+=i):s+=a,r+=i}}iterChangedRanges(e,n=!1){kk(this,e,n)}get invertedDesc(){let e=[];for(let n=0;n<this.sections.length;){let r=this.sections[n++],s=this.sections[n++];s<0?e.push(r,s):e.push(s,r)}return new Io(e)}composeDesc(e){return this.empty?e:e.empty?this:pF(this,e)}mapDesc(e,n=!1){return e.empty?this:Ok(this,e,n)}mapPos(e,n=-1,r=Ds.Simple){let s=0,i=0;for(let a=0;a<this.sections.length;){let l=this.sections[a++],c=this.sections[a++],d=s+l;if(c<0){if(d>e)return i+(e-s);i+=l}else{if(r!=Ds.Simple&&d>=e&&(r==Ds.TrackDel&&s<e&&d>e||r==Ds.TrackBefore&&s<e||r==Ds.TrackAfter&&d>e))return null;if(d>e||d==e&&n<0&&!l)return e==s||n<0?i:i+c;i+=c}s=d}if(e>s)throw new RangeError(`Position ${e} is out of range for changeset of length ${s}`);return i}touchesRange(e,n=e){for(let r=0,s=0;r<this.sections.length&&s<=n;){let i=this.sections[r++],a=this.sections[r++],l=s+i;if(a>=0&&s<=n&&l>=e)return s<e&&l>n?"cover":!0;s=l}return!1}toString(){let e="";for(let n=0;n<this.sections.length;){let r=this.sections[n++],s=this.sections[n++];e+=(e?" ":"")+r+(s>=0?":"+s:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Io(e)}static create(e){return new Io(e)}}class us extends Io{constructor(e,n){super(e),this.inserted=n}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return kk(this,(n,r,s,i,a)=>e=e.replace(s,s+(r-n),a),!1),e}mapDesc(e,n=!1){return Ok(this,e,n,!0)}invert(e){let n=this.sections.slice(),r=[];for(let s=0,i=0;s<n.length;s+=2){let a=n[s],l=n[s+1];if(l>=0){n[s]=l,n[s+1]=a;let c=s>>1;for(;r.length<c;)r.push(An.empty);r.push(a?e.slice(i,i+a):An.empty)}i+=a}return new us(n,r)}compose(e){return this.empty?e:e.empty?this:pF(this,e,!0)}map(e,n=!1){return e.empty?this:Ok(this,e,n,!0)}iterChanges(e,n=!1){kk(this,e,n)}get desc(){return Io.create(this.sections)}filter(e){let n=[],r=[],s=[],i=new H0(this);e:for(let a=0,l=0;;){let c=a==e.length?1e9:e[a++];for(;l<c||l==c&&i.len==0;){if(i.done)break e;let h=Math.min(i.len,c-l);qs(s,h,-1);let m=i.ins==-1?-1:i.off==0?i.ins:0;qs(n,h,m),m>0&&$c(r,n,i.text),i.forward(h),l+=h}let d=e[a++];for(;l<d;){if(i.done)break e;let h=Math.min(i.len,d-l);qs(n,h,-1),qs(s,h,i.ins==-1?-1:i.off==0?i.ins:0),i.forward(h),l+=h}}return{changes:new us(n,r),filtered:Io.create(s)}}toJSON(){let e=[];for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n],s=this.sections[n+1];s<0?e.push(r):s==0?e.push([r]):e.push([r].concat(this.inserted[n>>1].toJSON()))}return e}static of(e,n,r){let s=[],i=[],a=0,l=null;function c(h=!1){if(!h&&!s.length)return;a<n&&qs(s,n-a,-1);let m=new us(s,i);l=l?l.compose(m.map(l)):m,s=[],i=[],a=0}function d(h){if(Array.isArray(h))for(let m of h)d(m);else if(h instanceof us){if(h.length!=n)throw new RangeError(`Mismatched change set length (got ${h.length}, expected ${n})`);c(),l=l?l.compose(h.map(l)):h}else{let{from:m,to:g=m,insert:x}=h;if(m>g||m<0||g>n)throw new RangeError(`Invalid change range ${m} to ${g} (in doc of length ${n})`);let y=x?typeof x=="string"?An.of(x.split(r||Sk)):x:An.empty,w=y.length;if(m==g&&w==0)return;m<a&&c(),m>a&&qs(s,m-a,-1),qs(s,g-m,w),$c(i,s,y),a=g}}return d(e),c(!l),l}static empty(e){return new us(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let s=0;s<e.length;s++){let i=e[s];if(typeof i=="number")n.push(i,-1);else{if(!Array.isArray(i)||typeof i[0]!="number"||i.some((a,l)=>l&&typeof a!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(i.length==1)n.push(i[0],0);else{for(;r.length<s;)r.push(An.empty);r[s]=An.of(i.slice(1)),n.push(i[0],r[s].length)}}}return new us(n,r)}static createSet(e,n){return new us(e,n)}}function qs(t,e,n,r=!1){if(e==0&&n<=0)return;let s=t.length-2;s>=0&&n<=0&&n==t[s+1]?t[s]+=e:s>=0&&e==0&&t[s]==0?t[s+1]+=n:r?(t[s]+=e,t[s+1]+=n):t.push(e,n)}function $c(t,e,n){if(n.length==0)return;let r=e.length-2>>1;if(r<t.length)t[t.length-1]=t[t.length-1].append(n);else{for(;t.length<r;)t.push(An.empty);t.push(n)}}function kk(t,e,n){let r=t.inserted;for(let s=0,i=0,a=0;a<t.sections.length;){let l=t.sections[a++],c=t.sections[a++];if(c<0)s+=l,i+=l;else{let d=s,h=i,m=An.empty;for(;d+=l,h+=c,c&&r&&(m=m.append(r[a-2>>1])),!(n||a==t.sections.length||t.sections[a+1]<0);)l=t.sections[a++],c=t.sections[a++];e(s,d,i,h,m),s=d,i=h}}}function Ok(t,e,n,r=!1){let s=[],i=r?[]:null,a=new H0(t),l=new H0(e);for(let c=-1;;){if(a.done&&l.len||l.done&&a.len)throw new Error("Mismatched change set lengths");if(a.ins==-1&&l.ins==-1){let d=Math.min(a.len,l.len);qs(s,d,-1),a.forward(d),l.forward(d)}else if(l.ins>=0&&(a.ins<0||c==a.i||a.off==0&&(l.len<a.len||l.len==a.len&&!n))){let d=l.len;for(qs(s,l.ins,-1);d;){let h=Math.min(a.len,d);a.ins>=0&&c<a.i&&a.len<=h&&(qs(s,0,a.ins),i&&$c(i,s,a.text),c=a.i),a.forward(h),d-=h}l.next()}else if(a.ins>=0){let d=0,h=a.len;for(;h;)if(l.ins==-1){let m=Math.min(h,l.len);d+=m,h-=m,l.forward(m)}else if(l.ins==0&&l.len<h)h-=l.len,l.next();else break;qs(s,d,c<a.i?a.ins:0),i&&c<a.i&&$c(i,s,a.text),c=a.i,a.forward(a.len-h)}else{if(a.done&&l.done)return i?us.createSet(s,i):Io.create(s);throw new Error("Mismatched change set lengths")}}}function pF(t,e,n=!1){let r=[],s=n?[]:null,i=new H0(t),a=new H0(e);for(let l=!1;;){if(i.done&&a.done)return s?us.createSet(r,s):Io.create(r);if(i.ins==0)qs(r,i.len,0,l),i.next();else if(a.len==0&&!a.done)qs(r,0,a.ins,l),s&&$c(s,r,a.text),a.next();else{if(i.done||a.done)throw new Error("Mismatched change set lengths");{let c=Math.min(i.len2,a.len),d=r.length;if(i.ins==-1){let h=a.ins==-1?-1:a.off?0:a.ins;qs(r,c,h,l),s&&h&&$c(s,r,a.text)}else a.ins==-1?(qs(r,i.off?0:i.len,c,l),s&&$c(s,r,i.textBit(c))):(qs(r,i.off?0:i.len,a.off?0:a.ins,l),s&&!a.off&&$c(s,r,a.text));l=(i.ins>c||a.ins>=0&&a.len>c)&&(l||r.length>d),i.forward2(c),a.forward(c)}}}}class H0{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,n=this.i-2>>1;return n>=e.length?An.empty:e[n]}textBit(e){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!e?An.empty:n[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class Uu{constructor(e,n,r){this.from=e,this.to=n,this.flags=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,n=-1){let r,s;return this.empty?r=s=e.mapPos(this.from,n):(r=e.mapPos(this.from,1),s=e.mapPos(this.to,-1)),r==this.from&&s==this.to?this:new Uu(r,s,this.flags)}extend(e,n=e){if(e<=this.anchor&&n>=this.anchor)return Me.range(e,n);let r=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return Me.range(this.anchor,r)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&(!n||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return Me.range(e.anchor,e.head)}static create(e,n,r){return new Uu(e,n,r)}}class Me{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:Me.create(this.ranges.map(r=>r.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;r<this.ranges.length;r++)if(!this.ranges[r].eq(e.ranges[r],n))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new Me([this.main],0)}addRange(e,n=!0){return Me.create([e].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(e,n=this.mainIndex){let r=this.ranges.slice();return r[n]=e,Me.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new Me(e.ranges.map(n=>Uu.fromJSON(n)),e.main)}static single(e,n=e){return new Me([Me.range(e,n)],0)}static create(e,n=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,s=0;s<e.length;s++){let i=e[s];if(i.empty?i.from<=r:i.from<r)return Me.normalized(e.slice(),n);r=i.to}return new Me(e,n)}static cursor(e,n=0,r,s){return Uu.create(e,e,(n==0?0:n<0?8:16)|(r==null?7:Math.min(6,r))|(s??16777215)<<6)}static range(e,n,r,s){let i=(r??16777215)<<6|(s==null?7:Math.min(6,s));return n<e?Uu.create(n,e,48|i):Uu.create(e,n,(n>e?8:0)|i)}static normalized(e,n=0){let r=e[n];e.sort((s,i)=>s.from-i.from),n=e.indexOf(r);for(let s=1;s<e.length;s++){let i=e[s],a=e[s-1];if(i.empty?i.from<=a.to:i.from<a.to){let l=a.from,c=Math.max(i.to,a.to);s<=n&&n--,e.splice(--s,2,i.anchor>i.head?Me.range(c,l):Me.range(l,c))}}return new Me(e,n)}}function gF(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let i6=0;class st{constructor(e,n,r,s,i){this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=s,this.id=i6++,this.default=e([]),this.extensions=typeof i=="function"?i(this):i}get reader(){return this}static define(e={}){return new st(e.combine||(n=>n),e.compareInput||((n,r)=>n===r),e.compare||(e.combine?(n,r)=>n===r:a6),!!e.static,e.enables)}of(e){return new hv([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new hv(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new hv(e,this,2,n)}from(e,n){return n||(n=r=>r),this.compute([e],r=>n(r.field(e)))}}function a6(t,e){return t==e||t.length==e.length&&t.every((n,r)=>n===e[r])}class hv{constructor(e,n,r,s){this.dependencies=e,this.facet=n,this.type=r,this.value=s,this.id=i6++}dynamicSlot(e){var n;let r=this.value,s=this.facet.compareInput,i=this.id,a=e[i]>>1,l=this.type==2,c=!1,d=!1,h=[];for(let m of this.dependencies)m=="doc"?c=!0:m=="selection"?d=!0:(((n=e[m.id])!==null&&n!==void 0?n:1)&1)==0&&h.push(e[m.id]);return{create(m){return m.values[a]=r(m),1},update(m,g){if(c&&g.docChanged||d&&(g.docChanged||g.selection)||jk(m,h)){let x=r(m);if(l?!xE(x,m.values[a],s):!s(x,m.values[a]))return m.values[a]=x,1}return 0},reconfigure:(m,g)=>{let x,y=g.config.address[i];if(y!=null){let w=Gv(g,y);if(this.dependencies.every(S=>S instanceof st?g.facet(S)===m.facet(S):S instanceof Os?g.field(S,!1)==m.field(S,!1):!0)||(l?xE(x=r(m),w,s):s(x=r(m),w)))return m.values[a]=w,0}else x=r(m);return m.values[a]=x,1}}}}function xE(t,e,n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!n(t[r],e[r]))return!1;return!0}function jk(t,e){let n=!1;for(let r of e)O0(t,r)&1&&(n=!0);return n}function Iae(t,e,n){let r=n.map(c=>t[c.id]),s=n.map(c=>c.type),i=r.filter(c=>!(c&1)),a=t[e.id]>>1;function l(c){let d=[];for(let h=0;h<r.length;h++){let m=Gv(c,r[h]);if(s[h]==2)for(let g of m)d.push(g);else d.push(m)}return e.combine(d)}return{create(c){for(let d of r)O0(c,d);return c.values[a]=l(c),1},update(c,d){if(!jk(c,i))return 0;let h=l(c);return e.compare(h,c.values[a])?0:(c.values[a]=h,1)},reconfigure(c,d){let h=jk(c,r),m=d.config.facets[e.id],g=d.facet(e);if(m&&!h&&a6(n,m))return c.values[a]=g,0;let x=l(c);return e.compare(x,g)?(c.values[a]=g,0):(c.values[a]=x,1)}}}const r1=st.define({static:!0});class Os{constructor(e,n,r,s,i){this.id=e,this.createF=n,this.updateF=r,this.compareF=s,this.spec=i,this.provides=void 0}static define(e){let n=new Os(i6++,e.create,e.update,e.compare||((r,s)=>r===s),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(r1).find(r=>r.field==this);return(n?.create||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:r=>(r.values[n]=this.create(r),1),update:(r,s)=>{let i=r.values[n],a=this.updateF(i,s);return this.compareF(i,a)?0:(r.values[n]=a,1)},reconfigure:(r,s)=>{let i=r.facet(r1),a=s.facet(r1),l;return(l=i.find(c=>c.field==this))&&l!=a.find(c=>c.field==this)?(r.values[n]=l.create(r),1):s.config.address[this.id]!=null?(r.values[n]=s.field(this),0):(r.values[n]=this.create(r),1)}}}init(e){return[this,r1.of({field:this,create:e})]}get extension(){return this}}const Hu={lowest:4,low:3,default:2,high:1,highest:0};function Fm(t){return e=>new xF(e,t)}const uu={highest:Fm(Hu.highest),high:Fm(Hu.high),default:Fm(Hu.default),low:Fm(Hu.low),lowest:Fm(Hu.lowest)};class xF{constructor(e,n){this.inner=e,this.prec=n}}class hb{of(e){return new Nk(this,e)}reconfigure(e){return hb.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Nk{constructor(e,n){this.compartment=e,this.inner=n}}class Wv{constructor(e,n,r,s,i,a){for(this.base=e,this.compartments=n,this.dynamicSlots=r,this.address=s,this.staticValues=i,this.facets=a,this.statusTemplate=[];this.statusTemplate.length<r.length;)this.statusTemplate.push(0)}staticFacet(e){let n=this.address[e.id];return n==null?e.default:this.staticValues[n>>1]}static resolve(e,n,r){let s=[],i=Object.create(null),a=new Map;for(let g of Lae(e,n,a))g instanceof Os?s.push(g):(i[g.facet.id]||(i[g.facet.id]=[])).push(g);let l=Object.create(null),c=[],d=[];for(let g of s)l[g.id]=d.length<<1,d.push(x=>g.slot(x));let h=r?.config.facets;for(let g in i){let x=i[g],y=x[0].facet,w=h&&h[g]||[];if(x.every(S=>S.type==0))if(l[y.id]=c.length<<1|1,a6(w,x))c.push(r.facet(y));else{let S=y.combine(x.map(k=>k.value));c.push(r&&y.compare(S,r.facet(y))?r.facet(y):S)}else{for(let S of x)S.type==0?(l[S.id]=c.length<<1|1,c.push(S.value)):(l[S.id]=d.length<<1,d.push(k=>S.dynamicSlot(k)));l[y.id]=d.length<<1,d.push(S=>Iae(S,y,x))}}let m=d.map(g=>g(l));return new Wv(e,a,m,l,c,i)}}function Lae(t,e,n){let r=[[],[],[],[],[]],s=new Map;function i(a,l){let c=s.get(a);if(c!=null){if(c<=l)return;let d=r[c].indexOf(a);d>-1&&r[c].splice(d,1),a instanceof Nk&&n.delete(a.compartment)}if(s.set(a,l),Array.isArray(a))for(let d of a)i(d,l);else if(a instanceof Nk){if(n.has(a.compartment))throw new RangeError("Duplicate use of compartment in extensions");let d=e.get(a.compartment)||a.inner;n.set(a.compartment,d),i(d,l)}else if(a instanceof xF)i(a.inner,a.prec);else if(a instanceof Os)r[l].push(a),a.provides&&i(a.provides,l);else if(a instanceof hv)r[l].push(a),a.facet.extensions&&i(a.facet.extensions,Hu.default);else{let d=a.extension;if(!d)throw new Error(`Unrecognized extension value in extension set (${a}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);i(d,l)}}return i(t,Hu.default),r.reduce((a,l)=>a.concat(l))}function O0(t,e){if(e&1)return 2;let n=e>>1,r=t.status[n];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;t.status[n]=4;let s=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|s}function Gv(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const vF=st.define(),Ck=st.define({combine:t=>t.some(e=>e),static:!0}),yF=st.define({combine:t=>t.length?t[0]:void 0,static:!0}),bF=st.define(),wF=st.define(),SF=st.define(),kF=st.define({combine:t=>t.length?t[0]:!1});class Qo{constructor(e,n){this.type=e,this.value=n}static define(){return new Bae}}class Bae{of(e){return new Qo(this,e)}}class Fae{constructor(e){this.map=e}of(e){return new Qt(this,e)}}class Qt{constructor(e,n){this.type=e,this.value=n}map(e){let n=this.type.map(this.value,e);return n===void 0?void 0:n==this.value?this:new Qt(this.type,n)}is(e){return this.type==e}static define(e={}){return new Fae(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let r=[];for(let s of e){let i=s.map(n);i&&r.push(i)}return r}}Qt.reconfigure=Qt.define();Qt.appendConfig=Qt.define();class ss{constructor(e,n,r,s,i,a){this.startState=e,this.changes=n,this.selection=r,this.effects=s,this.annotations=i,this.scrollIntoView=a,this._doc=null,this._state=null,r&&gF(r,n.newLength),i.some(l=>l.type==ss.time)||(this.annotations=i.concat(ss.time.of(Date.now())))}static create(e,n,r,s,i,a){return new ss(e,n,r,s,i,a)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let n of this.annotations)if(n.type==e)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let n=this.annotation(ss.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}ss.time=Qo.define();ss.userEvent=Qo.define();ss.addToHistory=Qo.define();ss.remote=Qo.define();function qae(t,e){let n=[];for(let r=0,s=0;;){let i,a;if(r<t.length&&(s==e.length||e[s]>=t[r]))i=t[r++],a=t[r++];else if(s<e.length)i=e[s++],a=e[s++];else return n;!n.length||n[n.length-1]<i?n.push(i,a):n[n.length-1]<a&&(n[n.length-1]=a)}}function OF(t,e,n){var r;let s,i,a;return n?(s=e.changes,i=us.empty(e.changes.length),a=t.changes.compose(e.changes)):(s=e.changes.map(t.changes),i=t.changes.mapDesc(e.changes,!0),a=t.changes.compose(s)),{changes:a,selection:e.selection?e.selection.map(i):(r=t.selection)===null||r===void 0?void 0:r.map(s),effects:Qt.mapEffects(t.effects,s).concat(Qt.mapEffects(e.effects,i)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function Tk(t,e,n){let r=e.selection,s=Ph(e.annotations);return e.userEvent&&(s=s.concat(ss.userEvent.of(e.userEvent))),{changes:e.changes instanceof us?e.changes:us.of(e.changes||[],n,t.facet(yF)),selection:r&&(r instanceof Me?r:Me.single(r.anchor,r.head)),effects:Ph(e.effects),annotations:s,scrollIntoView:!!e.scrollIntoView}}function jF(t,e,n){let r=Tk(t,e.length?e[0]:{},t.doc.length);e.length&&e[0].filter===!1&&(n=!1);for(let i=1;i<e.length;i++){e[i].filter===!1&&(n=!1);let a=!!e[i].sequential;r=OF(r,Tk(t,e[i],a?r.changes.newLength:t.doc.length),a)}let s=ss.create(t,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return Hae(n?$ae(s):s)}function $ae(t){let e=t.startState,n=!0;for(let s of e.facet(bF)){let i=s(t);if(i===!1){n=!1;break}Array.isArray(i)&&(n=n===!0?i:qae(n,i))}if(n!==!0){let s,i;if(n===!1)i=t.changes.invertedDesc,s=us.empty(e.doc.length);else{let a=t.changes.filter(n);s=a.changes,i=a.filtered.mapDesc(a.changes).invertedDesc}t=ss.create(e,s,t.selection&&t.selection.map(i),Qt.mapEffects(t.effects,i),t.annotations,t.scrollIntoView)}let r=e.facet(wF);for(let s=r.length-1;s>=0;s--){let i=r[s](t);i instanceof ss?t=i:Array.isArray(i)&&i.length==1&&i[0]instanceof ss?t=i[0]:t=jF(e,Ph(i),!1)}return t}function Hae(t){let e=t.startState,n=e.facet(SF),r=t;for(let s=n.length-1;s>=0;s--){let i=n[s](t);i&&Object.keys(i).length&&(r=OF(r,Tk(e,i,t.changes.newLength),!0))}return r==t?t:ss.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}const Qae=[];function Ph(t){return t==null?Qae:Array.isArray(t)?t:[t]}var Tr=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(Tr||(Tr={}));const Vae=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Ek;try{Ek=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function Uae(t){if(Ek)return Ek.test(t);for(let e=0;e<t.length;e++){let n=t[e];if(/\w/.test(n)||n>""&&(n.toUpperCase()!=n.toLowerCase()||Vae.test(n)))return!0}return!1}function Wae(t){return e=>{if(!/\S/.test(e))return Tr.Space;if(Uae(e))return Tr.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return Tr.Word;return Tr.Other}}class Nn{constructor(e,n,r,s,i,a){this.config=e,this.doc=n,this.selection=r,this.values=s,this.status=e.statusTemplate.slice(),this.computeSlot=i,a&&(a._state=this);for(let l=0;l<this.config.dynamicSlots.length;l++)O0(this,l<<1);this.computeSlot=null}field(e,n=!0){let r=this.config.address[e.id];if(r==null){if(n)throw new RangeError("Field is not present in this state");return}return O0(this,r),Gv(this,r)}update(...e){return jF(this,e,!0)}applyTransaction(e){let n=this.config,{base:r,compartments:s}=n;for(let l of e.effects)l.is(hb.reconfigure)?(n&&(s=new Map,n.compartments.forEach((c,d)=>s.set(d,c)),n=null),s.set(l.value.compartment,l.value.extension)):l.is(Qt.reconfigure)?(n=null,r=l.value):l.is(Qt.appendConfig)&&(n=null,r=Ph(r).concat(l.value));let i;n?i=e.startState.values.slice():(n=Wv.resolve(r,s,this),i=new Nn(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(c,d)=>d.reconfigure(c,this),null).values);let a=e.startState.facet(Ck)?e.newSelection:e.newSelection.asSingle();new Nn(n,e.newDoc,a,i,(l,c)=>c.update(l,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range:Me.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,r=e(n.ranges[0]),s=this.changes(r.changes),i=[r.range],a=Ph(r.effects);for(let l=1;l<n.ranges.length;l++){let c=e(n.ranges[l]),d=this.changes(c.changes),h=d.map(s);for(let g=0;g<l;g++)i[g]=i[g].map(h);let m=s.mapDesc(d,!0);i.push(c.range.map(m)),s=s.compose(h),a=Qt.mapEffects(a,h).concat(Qt.mapEffects(Ph(c.effects),m))}return{changes:s,selection:Me.create(i,n.mainIndex),effects:a}}changes(e=[]){return e instanceof us?e:us.of(e,this.doc.length,this.facet(Nn.lineSeparator))}toText(e){return An.of(e.split(this.facet(Nn.lineSeparator)||Sk))}sliceDoc(e=0,n=this.doc.length){return this.doc.sliceString(e,n,this.lineBreak)}facet(e){let n=this.config.address[e.id];return n==null?e.default:(O0(this,n),Gv(this,n))}toJSON(e){let n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let r in e){let s=e[r];s instanceof Os&&this.config.address[s.id]!=null&&(n[r]=s.spec.toJSON(this.field(e[r]),this))}return n}static fromJSON(e,n={},r){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let s=[];if(r){for(let i in r)if(Object.prototype.hasOwnProperty.call(e,i)){let a=r[i],l=e[i];s.push(a.init(c=>a.spec.fromJSON(l,c)))}}return Nn.create({doc:e.doc,selection:Me.fromJSON(e.selection),extensions:n.extensions?s.concat([n.extensions]):s})}static create(e={}){let n=Wv.resolve(e.extensions||[],new Map),r=e.doc instanceof An?e.doc:An.of((e.doc||"").split(n.staticFacet(Nn.lineSeparator)||Sk)),s=e.selection?e.selection instanceof Me?e.selection:Me.single(e.selection.anchor,e.selection.head):Me.single(0);return gF(s,r.length),n.staticFacet(Ck)||(s=s.asSingle()),new Nn(n,r,s,n.dynamicSlots.map(()=>null),(i,a)=>a.create(i),null)}get tabSize(){return this.facet(Nn.tabSize)}get lineBreak(){return this.facet(Nn.lineSeparator)||`
|
||
`}get readOnly(){return this.facet(kF)}phrase(e,...n){for(let r of this.facet(Nn.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(r,s)=>{if(s=="$")return"$";let i=+(s||1);return!i||i>n.length?r:n[i-1]})),e}languageDataAt(e,n,r=-1){let s=[];for(let i of this.facet(vF))for(let a of i(this,n,r))Object.prototype.hasOwnProperty.call(a,e)&&s.push(a[e]);return s}charCategorizer(e){return Wae(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:n,from:r,length:s}=this.doc.lineAt(e),i=this.charCategorizer(e),a=e-r,l=e-r;for(;a>0;){let c=Ps(n,a,!1);if(i(n.slice(c,a))!=Tr.Word)break;a=c}for(;l<s;){let c=Ps(n,l);if(i(n.slice(l,c))!=Tr.Word)break;l=c}return a==l?null:Me.range(a+r,l+r)}}Nn.allowMultipleSelections=Ck;Nn.tabSize=st.define({combine:t=>t.length?t[0]:4});Nn.lineSeparator=yF;Nn.readOnly=kF;Nn.phrases=st.define({compare(t,e){let n=Object.keys(t),r=Object.keys(e);return n.length==r.length&&n.every(s=>t[s]==e[s])}});Nn.languageData=vF;Nn.changeFilter=bF;Nn.transactionFilter=wF;Nn.transactionExtender=SF;hb.reconfigure=Qt.define();function Vo(t,e,n={}){let r={};for(let s of t)for(let i of Object.keys(s)){let a=s[i],l=r[i];if(l===void 0)r[i]=a;else if(!(l===a||a===void 0))if(Object.hasOwnProperty.call(n,i))r[i]=n[i](l,a);else throw new Error("Config merge conflict for field "+i)}for(let s in e)r[s]===void 0&&(r[s]=e[s]);return r}class od{eq(e){return this==e}range(e,n=e){return _k.create(e,n,this)}}od.prototype.startSide=od.prototype.endSide=0;od.prototype.point=!1;od.prototype.mapMode=Ds.TrackDel;let _k=class NF{constructor(e,n,r){this.from=e,this.to=n,this.value=r}static create(e,n,r){return new NF(e,n,r)}};function Ak(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class o6{constructor(e,n,r,s){this.from=e,this.to=n,this.value=r,this.maxPoint=s}get length(){return this.to[this.to.length-1]}findIndex(e,n,r,s=0){let i=r?this.to:this.from;for(let a=s,l=i.length;;){if(a==l)return a;let c=a+l>>1,d=i[c]-e||(r?this.value[c].endSide:this.value[c].startSide)-n;if(c==a)return d>=0?a:l;d>=0?l=c:a=c+1}}between(e,n,r,s){for(let i=this.findIndex(n,-1e9,!0),a=this.findIndex(r,1e9,!1,i);i<a;i++)if(s(this.from[i]+e,this.to[i]+e,this.value[i])===!1)return!1}map(e,n){let r=[],s=[],i=[],a=-1,l=-1;for(let c=0;c<this.value.length;c++){let d=this.value[c],h=this.from[c]+e,m=this.to[c]+e,g,x;if(h==m){let y=n.mapPos(h,d.startSide,d.mapMode);if(y==null||(g=x=y,d.startSide!=d.endSide&&(x=n.mapPos(h,d.endSide),x<g)))continue}else if(g=n.mapPos(h,d.startSide),x=n.mapPos(m,d.endSide),g>x||g==x&&d.startSide>0&&d.endSide<=0)continue;(x-g||d.endSide-d.startSide)<0||(a<0&&(a=g),d.point&&(l=Math.max(l,x-g)),r.push(d),s.push(g-a),i.push(x-a))}return{mapped:r.length?new o6(s,i,r,l):null,pos:a}}}class Bn{constructor(e,n,r,s){this.chunkPos=e,this.chunk=n,this.nextLayer=r,this.maxPoint=s}static create(e,n,r,s){return new Bn(e,n,r,s)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let n of this.chunk)e+=n.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:n=[],sort:r=!1,filterFrom:s=0,filterTo:i=this.length}=e,a=e.filter;if(n.length==0&&!a)return this;if(r&&(n=n.slice().sort(Ak)),this.isEmpty)return n.length?Bn.of(n):this;let l=new CF(this,null,-1).goto(0),c=0,d=[],h=new Hl;for(;l.value||c<n.length;)if(c<n.length&&(l.from-n[c].from||l.startSide-n[c].value.startSide)>=0){let m=n[c++];h.addInner(m.from,m.to,m.value)||d.push(m)}else l.rangeIndex==1&&l.chunkIndex<this.chunk.length&&(c==n.length||this.chunkEnd(l.chunkIndex)<n[c].from)&&(!a||s>this.chunkEnd(l.chunkIndex)||i<this.chunkPos[l.chunkIndex])&&h.addChunk(this.chunkPos[l.chunkIndex],this.chunk[l.chunkIndex])?l.nextChunk():((!a||s>l.to||i<l.from||a(l.from,l.to,l.value))&&(h.addInner(l.from,l.to,l.value)||d.push(_k.create(l.from,l.to,l.value))),l.next());return h.finishInner(this.nextLayer.isEmpty&&!d.length?Bn.empty:this.nextLayer.update({add:d,filter:a,filterFrom:s,filterTo:i}))}map(e){if(e.empty||this.isEmpty)return this;let n=[],r=[],s=-1;for(let a=0;a<this.chunk.length;a++){let l=this.chunkPos[a],c=this.chunk[a],d=e.touchesRange(l,l+c.length);if(d===!1)s=Math.max(s,c.maxPoint),n.push(c),r.push(e.mapPos(l));else if(d===!0){let{mapped:h,pos:m}=c.map(l,e);h&&(s=Math.max(s,h.maxPoint),n.push(h),r.push(m))}}let i=this.nextLayer.map(e);return n.length==0?i:new Bn(r,n,i||Bn.empty,s)}between(e,n,r){if(!this.isEmpty){for(let s=0;s<this.chunk.length;s++){let i=this.chunkPos[s],a=this.chunk[s];if(n>=i&&e<=i+a.length&&a.between(i,e-i,n-i,r)===!1)return}this.nextLayer.between(e,n,r)}}iter(e=0){return Q0.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return Q0.from(e).goto(n)}static compare(e,n,r,s,i=-1){let a=e.filter(m=>m.maxPoint>0||!m.isEmpty&&m.maxPoint>=i),l=n.filter(m=>m.maxPoint>0||!m.isEmpty&&m.maxPoint>=i),c=vE(a,l,r),d=new qm(a,c,i),h=new qm(l,c,i);r.iterGaps((m,g,x)=>yE(d,m,h,g,x,s)),r.empty&&r.length==0&&yE(d,0,h,0,0,s)}static eq(e,n,r=0,s){s==null&&(s=999999999);let i=e.filter(h=>!h.isEmpty&&n.indexOf(h)<0),a=n.filter(h=>!h.isEmpty&&e.indexOf(h)<0);if(i.length!=a.length)return!1;if(!i.length)return!0;let l=vE(i,a),c=new qm(i,l,0).goto(r),d=new qm(a,l,0).goto(r);for(;;){if(c.to!=d.to||!Mk(c.active,d.active)||c.point&&(!d.point||!c.point.eq(d.point)))return!1;if(c.to>s)return!0;c.next(),d.next()}}static spans(e,n,r,s,i=-1){let a=new qm(e,null,i).goto(n),l=n,c=a.openStart;for(;;){let d=Math.min(a.to,r);if(a.point){let h=a.activeForPoint(a.to),m=a.pointFrom<n?h.length+1:a.point.startSide<0?h.length:Math.min(h.length,c);s.point(l,d,a.point,h,m,a.pointRank),c=Math.min(a.openEnd(d),h.length)}else d>l&&(s.span(l,d,a.active,c),c=a.openEnd(d));if(a.to>r)return c+(a.point&&a.to>r?1:0);l=a.to,a.next()}}static of(e,n=!1){let r=new Hl;for(let s of e instanceof _k?[e]:n?Gae(e):e)r.add(s.from,s.to,s.value);return r.finish()}static join(e){if(!e.length)return Bn.empty;let n=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let s=e[r];s!=Bn.empty;s=s.nextLayer)n=new Bn(s.chunkPos,s.chunk,n,Math.max(s.maxPoint,n.maxPoint));return n}}Bn.empty=new Bn([],[],null,-1);function Gae(t){if(t.length>1)for(let e=t[0],n=1;n<t.length;n++){let r=t[n];if(Ak(e,r)>0)return t.slice().sort(Ak);e=r}return t}Bn.empty.nextLayer=Bn.empty;class Hl{finishChunk(e){this.chunks.push(new o6(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,n,r){this.addInner(e,n,r)||(this.nextLayer||(this.nextLayer=new Hl)).add(e,n,r)}addInner(e,n,r){let s=e-this.lastTo||r.startSide-this.last.endSide;if(s<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return s<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(n-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=n,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,n-e)),!0)}addChunk(e,n){if((e-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(e);let r=n.value.length-1;return this.last=n.value[r],this.lastFrom=n.from[r]+e,this.lastTo=n.to[r]+e,!0}finish(){return this.finishInner(Bn.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=Bn.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function vE(t,e,n){let r=new Map;for(let i of t)for(let a=0;a<i.chunk.length;a++)i.chunk[a].maxPoint<=0&&r.set(i.chunk[a],i.chunkPos[a]);let s=new Set;for(let i of e)for(let a=0;a<i.chunk.length;a++){let l=r.get(i.chunk[a]);l!=null&&(n?n.mapPos(l):l)==i.chunkPos[a]&&!n?.touchesRange(l,l+i.chunk[a].length)&&s.add(i.chunk[a])}return s}class CF{constructor(e,n,r,s=0){this.layer=e,this.skip=n,this.minPoint=r,this.rank=s}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,n=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,n,!1),this}gotoInner(e,n,r){for(;this.chunkIndex<this.layer.chunk.length;){let s=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(s)||this.layer.chunkEnd(this.chunkIndex)<e||s.maxPoint<this.minPoint))break;this.chunkIndex++,r=!1}if(this.chunkIndex<this.layer.chunk.length){let s=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],n,!0);(!r||this.rangeIndex<s)&&this.setRangeIndex(s)}this.next()}forward(e,n){(this.to-e||this.endSide-n)<0&&this.gotoInner(e,n,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],n=this.layer.chunk[this.chunkIndex],r=e+n.from[this.rangeIndex];if(this.from=r,this.to=e+n.to[this.rangeIndex],this.value=n.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class Q0{constructor(e){this.heap=e}static from(e,n=null,r=-1){let s=[];for(let i=0;i<e.length;i++)for(let a=e[i];!a.isEmpty;a=a.nextLayer)a.maxPoint>=r&&s.push(new CF(a,n,r,i));return s.length==1?s[0]:new Q0(s)}get startSide(){return this.value?this.value.startSide:0}goto(e,n=-1e9){for(let r of this.heap)r.goto(e,n);for(let r=this.heap.length>>1;r>=0;r--)I4(this.heap,r);return this.next(),this}forward(e,n){for(let r of this.heap)r.forward(e,n);for(let r=this.heap.length>>1;r>=0;r--)I4(this.heap,r);(this.to-e||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),I4(this.heap,0)}}}function I4(t,e){for(let n=t[e];;){let r=(e<<1)+1;if(r>=t.length)break;let s=t[r];if(r+1<t.length&&s.compare(t[r+1])>=0&&(s=t[r+1],r++),n.compare(s)<0)break;t[r]=n,t[e]=s,e=r}}class qm{constructor(e,n,r){this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Q0.from(e,n,r)}goto(e,n=-1e9){return this.cursor.goto(e,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=n,this.openStart=-1,this.next(),this}forward(e,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(e,n)}removeActive(e){s1(this.active,e),s1(this.activeTo,e),s1(this.activeRank,e),this.minActive=bE(this.active,this.activeTo)}addActive(e){let n=0,{value:r,to:s,rank:i}=this.cursor;for(;n<this.activeRank.length&&(i-this.activeRank[n]||s-this.activeTo[n])>0;)n++;i1(this.active,n,r),i1(this.activeTo,n,s),i1(this.activeRank,n,i),e&&i1(e,n,this.cursor.from),this.minActive=bE(this.active,this.activeTo)}next(){let e=this.to,n=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let s=this.minActive;if(s>-1&&(this.activeTo[s]-this.cursor.from||this.active[s].endSide-this.cursor.startSide)<0){if(this.activeTo[s]>e){this.to=this.activeTo[s],this.endSide=this.active[s].endSide;break}this.removeActive(s),r&&s1(r,s)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let i=this.cursor.value;if(!i.point)this.addActive(r),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=i,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=i.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(r){this.openStart=0;for(let s=r.length-1;s>=0&&r[s]<e;s--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let n=[];for(let r=this.active.length-1;r>=0&&!(this.activeRank[r]<this.pointRank);r--)(this.activeTo[r]>e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&n.push(this.active[r]);return n.reverse()}openEnd(e){let n=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)n++;return n}}function yE(t,e,n,r,s,i){t.goto(e),n.goto(r);let a=r+s,l=r,c=r-e;for(;;){let d=t.to+c-n.to,h=d||t.endSide-n.endSide,m=h<0?t.to+c:n.to,g=Math.min(m,a);if(t.point||n.point?t.point&&n.point&&(t.point==n.point||t.point.eq(n.point))&&Mk(t.activeForPoint(t.to),n.activeForPoint(n.to))||i.comparePoint(l,g,t.point,n.point):g>l&&!Mk(t.active,n.active)&&i.compareRange(l,g,t.active,n.active),m>a)break;(d||t.openEnd!=n.openEnd)&&i.boundChange&&i.boundChange(m),l=m,h<=0&&t.next(),h>=0&&n.next()}}function Mk(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n]&&!t[n].eq(e[n]))return!1;return!0}function s1(t,e){for(let n=e,r=t.length-1;n<r;n++)t[n]=t[n+1];t.pop()}function i1(t,e,n){for(let r=t.length-1;r>=e;r--)t[r+1]=t[r];t[e]=n}function bE(t,e){let n=-1,r=1e9;for(let s=0;s<e.length;s++)(e[s]-r||t[s].endSide-t[n].endSide)<0&&(n=s,r=e[s]);return n}function Cf(t,e,n=t.length){let r=0;for(let s=0;s<n&&s<t.length;)t.charCodeAt(s)==9?(r+=e-r%e,s++):(r++,s=Ps(t,s));return r}function Rk(t,e,n,r){for(let s=0,i=0;;){if(i>=e)return s;if(s==t.length)break;i+=t.charCodeAt(s)==9?n-i%n:1,s=Ps(t,s)}return r===!0?-1:t.length}const Dk="ͼ",wE=typeof Symbol>"u"?"__"+Dk:Symbol.for(Dk),Pk=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),SE=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Yc{constructor(e,n){this.rules=[];let{finish:r}=n||{};function s(a){return/^@/.test(a)?[a]:a.split(/,\s*/)}function i(a,l,c,d){let h=[],m=/^@(\w+)\b/.exec(a[0]),g=m&&m[1]=="keyframes";if(m&&l==null)return c.push(a[0]+";");for(let x in l){let y=l[x];if(/&/.test(x))i(x.split(/,\s*/).map(w=>a.map(S=>w.replace(/&/,S))).reduce((w,S)=>w.concat(S)),y,c);else if(y&&typeof y=="object"){if(!m)throw new RangeError("The value of a property ("+x+") should be a primitive value.");i(s(x),y,h,g)}else y!=null&&h.push(x.replace(/_.*/,"").replace(/[A-Z]/g,w=>"-"+w.toLowerCase())+": "+y+";")}(h.length||g)&&c.push((r&&!m&&!d?a.map(r):a).join(", ")+" {"+h.join(" ")+"}")}for(let a in e)i(s(a),e[a],this.rules)}getRules(){return this.rules.join(`
|
||
`)}static newName(){let e=SE[wE]||1;return SE[wE]=e+1,Dk+e.toString(36)}static mount(e,n,r){let s=e[Pk],i=r&&r.nonce;s?i&&s.setNonce(i):s=new Xae(e,i),s.mount(Array.isArray(n)?n:[n],e)}}let kE=new Map;class Xae{constructor(e,n){let r=e.ownerDocument||e,s=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&s.CSSStyleSheet){let i=kE.get(r);if(i)return e[Pk]=i;this.sheet=new s.CSSStyleSheet,kE.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[Pk]=this}mount(e,n){let r=this.sheet,s=0,i=0;for(let a=0;a<e.length;a++){let l=e[a],c=this.modules.indexOf(l);if(c<i&&c>-1&&(this.modules.splice(c,1),i--,c=-1),c==-1){if(this.modules.splice(i++,0,l),r)for(let d=0;d<l.rules.length;d++)r.insertRule(l.rules[d],s++)}else{for(;i<c;)s+=this.modules[i++].rules.length;s+=l.rules.length,i++}}if(r)n.adoptedStyleSheets.indexOf(this.sheet)<0&&(n.adoptedStyleSheets=[this.sheet,...n.adoptedStyleSheets]);else{let a="";for(let c=0;c<this.modules.length;c++)a+=this.modules[c].getRules()+`
|
||
`;this.styleTag.textContent=a;let l=n.head||n;this.styleTag.parentNode!=l&&l.insertBefore(this.styleTag,l.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var Kc={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},V0={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Yae=typeof navigator<"u"&&/Mac/.test(navigator.platform),Kae=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Ms=0;Ms<10;Ms++)Kc[48+Ms]=Kc[96+Ms]=String(Ms);for(var Ms=1;Ms<=24;Ms++)Kc[Ms+111]="F"+Ms;for(var Ms=65;Ms<=90;Ms++)Kc[Ms]=String.fromCharCode(Ms+32),V0[Ms]=String.fromCharCode(Ms);for(var L4 in Kc)V0.hasOwnProperty(L4)||(V0[L4]=Kc[L4]);function Zae(t){var e=Yae&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Kae&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?V0:Kc)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}function lr(){var t=arguments[0];typeof t=="string"&&(t=document.createElement(t));var e=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var s=n[r];typeof s=="string"?t.setAttribute(r,s):s!=null&&(t[r]=s)}e++}for(;e<arguments.length;e++)TF(t,arguments[e]);return t}function TF(t,e){if(typeof e=="string")t.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)t.appendChild(e);else if(Array.isArray(e))for(var n=0;n<e.length;n++)TF(t,e[n]);else throw new RangeError("Unsupported child node: "+e)}let Js=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},zk=typeof document<"u"?document:{documentElement:{style:{}}};const Ik=/Edge\/(\d+)/.exec(Js.userAgent),EF=/MSIE \d/.test(Js.userAgent),Lk=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Js.userAgent),fb=!!(EF||Lk||Ik),OE=!fb&&/gecko\/(\d+)/i.test(Js.userAgent),B4=!fb&&/Chrome\/(\d+)/.exec(Js.userAgent),Jae="webkitFontSmoothing"in zk.documentElement.style,Bk=!fb&&/Apple Computer/.test(Js.vendor),jE=Bk&&(/Mobile\/\w+/.test(Js.userAgent)||Js.maxTouchPoints>2);var et={mac:jE||/Mac/.test(Js.platform),windows:/Win/.test(Js.platform),linux:/Linux|X11/.test(Js.platform),ie:fb,ie_version:EF?zk.documentMode||6:Lk?+Lk[1]:Ik?+Ik[1]:0,gecko:OE,gecko_version:OE?+(/Firefox\/(\d+)/.exec(Js.userAgent)||[0,0])[1]:0,chrome:!!B4,chrome_version:B4?+B4[1]:0,ios:jE,android:/Android\b/.test(Js.userAgent),webkit_version:Jae?+(/\bAppleWebKit\/(\d+)/.exec(Js.userAgent)||[0,0])[1]:0,safari:Bk,safari_version:Bk?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Js.userAgent)||[0,0])[1]:0,tabSize:zk.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function U0(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function Fk(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function fv(t,e){if(!e.anchorNode)return!1;try{return Fk(t,e.anchorNode)}catch{return!1}}function Jh(t){return t.nodeType==3?cd(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function j0(t,e,n,r){return n?NE(t,e,n,r,-1)||NE(t,e,n,r,1):!1}function ld(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function Xv(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function NE(t,e,n,r,s){for(;;){if(t==n&&e==r)return!0;if(e==(s<0?0:qo(t))){if(t.nodeName=="DIV")return!1;let i=t.parentNode;if(!i||i.nodeType!=1)return!1;e=ld(t)+(s<0?0:1),t=i}else if(t.nodeType==1){if(t=t.childNodes[e+(s<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=s<0?qo(t):0}else return!1}}function qo(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Up(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function eoe(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function _F(t,e){let n=e.width/t.offsetWidth,r=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-t.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function toe(t,e,n,r,s,i,a,l){let c=t.ownerDocument,d=c.defaultView||window;for(let h=t,m=!1;h&&!m;)if(h.nodeType==1){let g,x=h==c.body,y=1,w=1;if(x)g=eoe(d);else{if(/^(fixed|sticky)$/.test(getComputedStyle(h).position)&&(m=!0),h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.assignedSlot||h.parentNode;continue}let j=h.getBoundingClientRect();({scaleX:y,scaleY:w}=_F(h,j)),g={left:j.left,right:j.left+h.clientWidth*y,top:j.top,bottom:j.top+h.clientHeight*w}}let S=0,k=0;if(s=="nearest")e.top<g.top?(k=e.top-(g.top+a),n>0&&e.bottom>g.bottom+k&&(k=e.bottom-g.bottom+a)):e.bottom>g.bottom&&(k=e.bottom-g.bottom+a,n<0&&e.top-k<g.top&&(k=e.top-(g.top+a)));else{let j=e.bottom-e.top,N=g.bottom-g.top;k=(s=="center"&&j<=N?e.top+j/2-N/2:s=="start"||s=="center"&&n<0?e.top-a:e.bottom-N+a)-g.top}if(r=="nearest"?e.left<g.left?(S=e.left-(g.left+i),n>0&&e.right>g.right+S&&(S=e.right-g.right+i)):e.right>g.right&&(S=e.right-g.right+i,n<0&&e.left<g.left+S&&(S=e.left-(g.left+i))):S=(r=="center"?e.left+(e.right-e.left)/2-(g.right-g.left)/2:r=="start"==l?e.left-i:e.right-(g.right-g.left)+i)-g.left,S||k)if(x)d.scrollBy(S,k);else{let j=0,N=0;if(k){let T=h.scrollTop;h.scrollTop+=k/w,N=(h.scrollTop-T)*w}if(S){let T=h.scrollLeft;h.scrollLeft+=S/y,j=(h.scrollLeft-T)*y}e={left:e.left-j,top:e.top-N,right:e.right-j,bottom:e.bottom-N},j&&Math.abs(j-S)<1&&(r="nearest"),N&&Math.abs(N-k)<1&&(s="nearest")}if(x)break;(e.top<g.top||e.bottom>g.bottom||e.left<g.left||e.right>g.right)&&(e={left:Math.max(e.left,g.left),right:Math.min(e.right,g.right),top:Math.max(e.top,g.top),bottom:Math.min(e.bottom,g.bottom)}),h=h.assignedSlot||h.parentNode}else if(h.nodeType==11)h=h.host;else break}function noe(t){let e=t.ownerDocument,n,r;for(let s=t.parentNode;s&&!(s==e.body||n&&r);)if(s.nodeType==1)!r&&s.scrollHeight>s.clientHeight&&(r=s),!n&&s.scrollWidth>s.clientWidth&&(n=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:n,y:r}}class roe{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:n,focusNode:r}=e;this.set(n,Math.min(e.anchorOffset,n?qo(n):0),r,Math.min(e.focusOffset,r?qo(r):0))}set(e,n,r,s){this.anchorNode=e,this.anchorOffset=n,this.focusNode=r,this.focusOffset=s}}let Fu=null;et.safari&&et.safari_version>=26&&(Fu=!1);function AF(t){if(t.setActive)return t.setActive();if(Fu)return t.focus(Fu);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(Fu==null?{get preventScroll(){return Fu={preventScroll:!0},!0}}:void 0),!Fu){Fu=!1;for(let n=0;n<e.length;){let r=e[n++],s=e[n++],i=e[n++];r.scrollTop!=s&&(r.scrollTop=s),r.scrollLeft!=i&&(r.scrollLeft=i)}}}let CE;function cd(t,e,n=e){let r=CE||(CE=document.createRange());return r.setEnd(t,n),r.setStart(t,e),r}function zh(t,e,n,r){let s={key:e,code:e,keyCode:n,which:n,cancelable:!0};r&&({altKey:s.altKey,ctrlKey:s.ctrlKey,shiftKey:s.shiftKey,metaKey:s.metaKey}=r);let i=new KeyboardEvent("keydown",s);i.synthetic=!0,t.dispatchEvent(i);let a=new KeyboardEvent("keyup",s);return a.synthetic=!0,t.dispatchEvent(a),i.defaultPrevented||a.defaultPrevented}function soe(t){for(;t;){if(t&&(t.nodeType==9||t.nodeType==11&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}function MF(t){for(;t.attributes.length;)t.removeAttributeNode(t.attributes[0])}function ioe(t,e){let n=e.focusNode,r=e.focusOffset;if(!n||e.anchorNode!=n||e.anchorOffset!=r)return!1;for(r=Math.min(r,qo(n));;)if(r){if(n.nodeType!=1)return!1;let s=n.childNodes[r-1];s.contentEditable=="false"?r--:(n=s,r=qo(n))}else{if(n==t)return!0;r=ld(n),n=n.parentNode}}function RF(t){return t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function DF(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r>0)return{node:n,offset:r};if(n.nodeType==1&&r>0){if(n.contentEditable=="false")return null;n=n.childNodes[r-1],r=qo(n)}else if(n.parentNode&&!Xv(n))r=ld(n),n=n.parentNode;else return null}}function PF(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r<n.nodeValue.length)return{node:n,offset:r};if(n.nodeType==1&&r<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[r],r=0}else if(n.parentNode&&!Xv(n))r=ld(n)+1,n=n.parentNode;else return null}}class Hs{constructor(e,n,r=!0){this.node=e,this.offset=n,this.precise=r}static before(e,n){return new Hs(e.parentNode,ld(e),n)}static after(e,n){return new Hs(e.parentNode,ld(e)+1,n)}}const l6=[];class sr{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let n=this.posAtStart;for(let r of this.children){if(r==e)return n;n+=r.length+r.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,n){if(this.flags&2){let r=this.dom,s=null,i;for(let a of this.children){if(a.flags&7){if(!a.dom&&(i=s?s.nextSibling:r.firstChild)){let l=sr.get(i);(!l||!l.parent&&l.canReuseDOM(a))&&a.reuseDOM(i)}a.sync(e,n),a.flags&=-8}if(i=s?s.nextSibling:r.firstChild,n&&!n.written&&n.node==r&&i!=a.dom&&(n.written=!0),a.dom.parentNode==r)for(;i&&i!=a.dom;)i=TE(i);else r.insertBefore(a.dom,i);s=a.dom}for(i=s?s.nextSibling:r.firstChild,i&&n&&n.node==r&&(n.written=!0);i;)i=TE(i)}else if(this.flags&1)for(let r of this.children)r.flags&7&&(r.sync(e,n),r.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,n){let r;if(e==this.dom)r=this.dom.childNodes[n];else{let s=qo(e)==0?0:n==0?-1:1;for(;;){let i=e.parentNode;if(i==this.dom)break;s==0&&i.firstChild!=i.lastChild&&(e==i.firstChild?s=-1:s=1),e=i}s<0?r=e:r=e.nextSibling}if(r==this.dom.firstChild)return 0;for(;r&&!sr.get(r);)r=r.nextSibling;if(!r)return this.length;for(let s=0,i=0;;s++){let a=this.children[s];if(a.dom==r)return i;i+=a.length+a.breakAfter}}domBoundsAround(e,n,r=0){let s=-1,i=-1,a=-1,l=-1;for(let c=0,d=r,h=r;c<this.children.length;c++){let m=this.children[c],g=d+m.length;if(d<e&&g>n)return m.domBoundsAround(e,n,d);if(g>=e&&s==-1&&(s=c,i=d),d>n&&m.dom.parentNode==this.dom){a=c,l=h;break}h=g,d=g+m.breakAfter}return{from:i,to:l<0?r+this.length:l,startDOM:(s?this.children[s-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:a<this.children.length&&a>=0?this.children[a].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let n=this.parent;n;n=n.parent){if(e&&(n.flags|=2),n.flags&1)return;n.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let n=e.parent;if(!n)return e;e=n}}replaceChildren(e,n,r=l6){this.markDirty();for(let s=e;s<n;s++){let i=this.children[s];i.parent==this&&r.indexOf(i)<0&&i.destroy()}r.length<250?this.children.splice(e,n-e,...r):this.children=[].concat(this.children.slice(0,e),r,this.children.slice(n));for(let s=0;s<r.length;s++)r[s].setParent(this)}ignoreMutation(e){return!1}ignoreEvent(e){return!1}childCursor(e=this.length){return new zF(this.children,e,this.children.length)}childPos(e,n=1){return this.childCursor().findPos(e,n)}toString(){let e=this.constructor.name.replace("View","");return e+(this.children.length?"("+this.children.join()+")":this.length?"["+(e=="Text"?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}static get(e){return e.cmView}get isEditable(){return!0}get isWidget(){return!1}get isHidden(){return!1}merge(e,n,r,s,i,a){return!1}become(e){return!1}canReuseDOM(e){return e.constructor==this.constructor&&!((this.flags|e.flags)&8)}getSide(){return 0}destroy(){for(let e of this.children)e.parent==this&&e.destroy();this.parent=null}}sr.prototype.breakAfter=0;function TE(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class zF{constructor(e,n,r){this.children=e,this.pos=n,this.i=r,this.off=0}findPos(e,n=1){for(;;){if(e>this.pos||e==this.pos&&(n>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let r=this.children[--this.i];this.pos-=r.length+r.breakAfter}}}function IF(t,e,n,r,s,i,a,l,c){let{children:d}=t,h=d.length?d[e]:null,m=i.length?i[i.length-1]:null,g=m?m.breakAfter:a;if(!(e==r&&h&&!a&&!g&&i.length<2&&h.merge(n,s,i.length?m:null,n==0,l,c))){if(r<d.length){let x=d[r];x&&(s<x.length||x.breakAfter&&m?.breakAfter)?(e==r&&(x=x.split(s),s=0),!g&&m&&x.merge(0,s,m,!0,0,c)?i[i.length-1]=x:((s||x.children.length&&!x.children[0].length)&&x.merge(0,s,null,!1,0,c),i.push(x))):x?.breakAfter&&(m?m.breakAfter=1:a=1),r++}for(h&&(h.breakAfter=a,n>0&&(!a&&i.length&&h.merge(n,h.length,i[0],!1,l,0)?h.breakAfter=i.shift().breakAfter:(n<h.length||h.children.length&&h.children[h.children.length-1].length==0)&&h.merge(n,h.length,null,!1,l,0),e++));e<r&&i.length;)if(d[r-1].become(i[i.length-1]))r--,i.pop(),c=i.length?0:l;else if(d[e].become(i[0]))e++,i.shift(),l=i.length?0:c;else break;!i.length&&e&&r<d.length&&!d[e-1].breakAfter&&d[r].merge(0,0,d[e-1],!1,l,c)&&e--,(e<r||i.length)&&t.replaceChildren(e,r,i)}}function LF(t,e,n,r,s,i){let a=t.childCursor(),{i:l,off:c}=a.findPos(n,1),{i:d,off:h}=a.findPos(e,-1),m=e-n;for(let g of r)m+=g.length;t.length+=m,IF(t,d,h,l,c,r,0,s,i)}const aoe=256;class Za extends sr{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,n){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(n&&n.node==this.dom&&(n.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,n,r){return this.flags&8||r&&(!(r instanceof Za)||this.length-(n-e)+r.length>aoe||r.flags&8)?!1:(this.text=this.text.slice(0,e)+(r?r.text:"")+this.text.slice(n),this.markDirty(),!0)}split(e){let n=new Za(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),n.flags|=this.flags&8,n}localPosFromDOM(e,n){return e==this.dom?n:n?this.text.length:0}domAtPos(e){return new Hs(this.dom,e)}domBoundsAround(e,n,r){return{from:r,to:r+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,n){return ooe(this.dom,e,n)}}class Ql extends sr{constructor(e,n=[],r=0){super(),this.mark=e,this.children=n,this.length=r;for(let s of n)s.setParent(this)}setAttrs(e){if(MF(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let n in this.mark.attrs)e.setAttribute(n,this.mark.attrs[n]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,n){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,n)}merge(e,n,r,s,i,a){return r&&(!(r instanceof Ql&&r.mark.eq(this.mark))||e&&i<=0||n<this.length&&a<=0)?!1:(LF(this,e,n,r?r.children.slice():[],i-1,a-1),this.markDirty(),!0)}split(e){let n=[],r=0,s=-1,i=0;for(let l of this.children){let c=r+l.length;c>e&&n.push(r<e?l.split(e-r):l),s<0&&r>=e&&(s=i),r=c,i++}let a=this.length-e;return this.length=e,s>-1&&(this.children.length=s,this.markDirty()),new Ql(this.mark,n,a)}domAtPos(e){return BF(this,e)}coordsAt(e,n){return qF(this,e,n)}}function ooe(t,e,n){let r=t.nodeValue.length;e>r&&(e=r);let s=e,i=e,a=0;e==0&&n<0||e==r&&n>=0?et.chrome||et.gecko||(e?(s--,a=1):i<r&&(i++,a=-1)):n<0?s--:i<r&&i++;let l=cd(t,s,i).getClientRects();if(!l.length)return null;let c=l[(a?a<0:n>=0)?0:l.length-1];return et.safari&&!a&&c.width==0&&(c=Array.prototype.find.call(l,d=>d.width)||c),a?Up(c,a<0):c||null}class Dl extends sr{static create(e,n,r){return new Dl(e,n,r)}constructor(e,n,r){super(),this.widget=e,this.length=n,this.side=r,this.prevWidget=null}split(e){let n=Dl.create(this.widget,this.length-e,this.side);return this.length-=e,n}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,n,r,s,i,a){return r&&(!(r instanceof Dl)||!this.widget.compare(r.widget)||e>0&&i<=0||n<this.length&&a<=0)?!1:(this.length=e+(r?r.length:0)+(this.length-n),!0)}become(e){return e instanceof Dl&&e.side==this.side&&this.widget.constructor==e.widget.constructor?(this.widget.compare(e.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get overrideDOMText(){if(this.length==0)return An.empty;let e=this;for(;e.parent;)e=e.parent;let{view:n}=e,r=n&&n.state.doc,s=this.posAtStart;return r?r.slice(s,s+this.length):An.empty}domAtPos(e){return(this.length?e==0:this.side>0)?Hs.before(this.dom):Hs.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,n){let r=this.widget.coordsAt(this.dom,e,n);if(r)return r;let s=this.dom.getClientRects(),i=null;if(!s.length)return null;let a=this.side?this.side<0:e>0;for(let l=a?s.length-1:0;i=s[l],!(e>0?l==0:l==s.length-1||i.top<i.bottom);l+=a?-1:1);return Up(i,!a)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class ef extends sr{constructor(e){super(),this.side=e}get length(){return 0}merge(){return!1}become(e){return e instanceof ef&&e.side==this.side}split(){return new ef(this.side)}sync(){if(!this.dom){let e=document.createElement("img");e.className="cm-widgetBuffer",e.setAttribute("aria-hidden","true"),this.setDOM(e)}}getSide(){return this.side}domAtPos(e){return this.side>0?Hs.before(this.dom):Hs.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return An.empty}get isHidden(){return!0}}Za.prototype.children=Dl.prototype.children=ef.prototype.children=l6;function BF(t,e){let n=t.dom,{children:r}=t,s=0;for(let i=0;s<r.length;s++){let a=r[s],l=i+a.length;if(!(l==i&&a.getSide()<=0)){if(e>i&&e<l&&a.dom.parentNode==n)return a.domAtPos(e-i);if(e<=i)break;i=l}}for(let i=s;i>0;i--){let a=r[i-1];if(a.dom.parentNode==n)return a.domAtPos(a.length)}for(let i=s;i<r.length;i++){let a=r[i];if(a.dom.parentNode==n)return a.domAtPos(0)}return new Hs(n,0)}function FF(t,e,n){let r,{children:s}=t;n>0&&e instanceof Ql&&s.length&&(r=s[s.length-1])instanceof Ql&&r.mark.eq(e.mark)?FF(r,e.children[0],n-1):(s.push(e),e.setParent(t)),t.length+=e.length}function qF(t,e,n){let r=null,s=-1,i=null,a=-1;function l(d,h){for(let m=0,g=0;m<d.children.length&&g<=h;m++){let x=d.children[m],y=g+x.length;y>=h&&(x.children.length?l(x,h-g):(!i||i.isHidden&&(n>0||coe(i,x)))&&(y>h||g==y&&x.getSide()>0)?(i=x,a=h-g):(g<h||g==y&&x.getSide()<0&&!x.isHidden)&&(r=x,s=h-g)),g=y}}l(t,e);let c=(n<0?r:i)||r||i;return c?c.coordsAt(Math.max(0,c==r?s:a),n):loe(t)}function loe(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let n=Jh(e);return n[n.length-1]||null}function coe(t,e){let n=t.coordsAt(0,1),r=e.coordsAt(0,1);return n&&r&&r.top<n.bottom}function qk(t,e){for(let n in t)n=="class"&&e.class?e.class+=" "+t.class:n=="style"&&e.style?e.style+=";"+t.style:e[n]=t[n];return e}const EE=Object.create(null);function Yv(t,e,n){if(t==e)return!0;t||(t=EE),e||(e=EE);let r=Object.keys(t),s=Object.keys(e);if(r.length-(n&&r.indexOf(n)>-1?1:0)!=s.length-(n&&s.indexOf(n)>-1?1:0))return!1;for(let i of r)if(i!=n&&(s.indexOf(i)==-1||t[i]!==e[i]))return!1;return!0}function $k(t,e,n){let r=!1;if(e)for(let s in e)n&&s in n||(r=!0,s=="style"?t.style.cssText="":t.removeAttribute(s));if(n)for(let s in n)e&&e[s]==n[s]||(r=!0,s=="style"?t.style.cssText=n[s]:t.setAttribute(s,n[s]));return r}function uoe(t){let e=Object.create(null);for(let n=0;n<t.attributes.length;n++){let r=t.attributes[n];e[r.name]=r.value}return e}class Uo{eq(e){return!1}updateDOM(e,n){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,n,r){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var ri=(function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t})(ri||(ri={}));class Ot extends od{constructor(e,n,r,s){super(),this.startSide=e,this.endSide=n,this.widget=r,this.spec=s}get heightRelevant(){return!1}static mark(e){return new Wp(e)}static widget(e){let n=Math.max(-1e4,Math.min(1e4,e.side||0)),r=!!e.block;return n+=r&&!e.inlineOrder?n>0?3e8:-4e8:n>0?1e8:-1e8,new Zc(e,n,n,r,e.widget||null,!1)}static replace(e){let n=!!e.block,r,s;if(e.isBlockGap)r=-5e8,s=4e8;else{let{start:i,end:a}=$F(e,n);r=(i?n?-3e8:-1:5e8)-1,s=(a?n?2e8:1:-6e8)+1}return new Zc(e,r,s,n,e.widget||null,!0)}static line(e){return new Gp(e)}static set(e,n=!1){return Bn.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Ot.none=Bn.empty;class Wp extends Ot{constructor(e){let{start:n,end:r}=$F(e);super(n?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var n,r;return this==e||e instanceof Wp&&this.tagName==e.tagName&&(this.class||((n=this.attrs)===null||n===void 0?void 0:n.class))==(e.class||((r=e.attrs)===null||r===void 0?void 0:r.class))&&Yv(this.attrs,e.attrs,"class")}range(e,n=e){if(e>=n)throw new RangeError("Mark decorations may not be empty");return super.range(e,n)}}Wp.prototype.point=!1;class Gp extends Ot{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Gp&&this.spec.class==e.spec.class&&Yv(this.spec.attributes,e.spec.attributes)}range(e,n=e){if(n!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,n)}}Gp.prototype.mapMode=Ds.TrackBefore;Gp.prototype.point=!0;class Zc extends Ot{constructor(e,n,r,s,i,a){super(n,r,i,e),this.block=s,this.isReplace=a,this.mapMode=s?n<=0?Ds.TrackBefore:Ds.TrackAfter:Ds.TrackDel}get type(){return this.startSide!=this.endSide?ri.WidgetRange:this.startSide<=0?ri.WidgetBefore:ri.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Zc&&doe(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,n=e){if(this.isReplace&&(e>n||e==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,n)}}Zc.prototype.point=!0;function $F(t,e=!1){let{inclusiveStart:n,inclusiveEnd:r}=t;return n==null&&(n=t.inclusive),r==null&&(r=t.inclusive),{start:n??e,end:r??e}}function doe(t,e){return t==e||!!(t&&e&&t.compare(e))}function mv(t,e,n,r=0){let s=n.length-1;s>=0&&n[s]+r>=t?n[s]=Math.max(n[s],e):n.push(t,e)}class rs extends sr{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,n,r,s,i,a){if(r){if(!(r instanceof rs))return!1;this.dom||r.transferDOM(this)}return s&&this.setDeco(r?r.attrs:null),LF(this,e,n,r?r.children.slice():[],i,a),!0}split(e){let n=new rs;if(n.breakAfter=this.breakAfter,this.length==0)return n;let{i:r,off:s}=this.childPos(e);s&&(n.append(this.children[r].split(s),0),this.children[r].merge(s,this.children[r].length,null,!1,0,0),r++);for(let i=r;i<this.children.length;i++)n.append(this.children[i],0);for(;r>0&&this.children[r-1].length==0;)this.children[--r].destroy();return this.children.length=r,this.markDirty(),this.length=e,n}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){Yv(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,n){FF(this,e,n)}addLineDeco(e){let n=e.spec.attributes,r=e.spec.class;n&&(this.attrs=qk(n,this.attrs||{})),r&&(this.attrs=qk({class:r},this.attrs||{}))}domAtPos(e){return BF(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,n){var r;this.dom?this.flags&4&&(MF(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&($k(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,n);let s=this.dom.lastChild;for(;s&&sr.get(s)instanceof Ql;)s=s.lastChild;if(!s||!this.length||s.nodeName!="BR"&&((r=sr.get(s))===null||r===void 0?void 0:r.isEditable)==!1&&(!et.ios||!this.children.some(i=>i instanceof Za))){let i=document.createElement("BR");i.cmIgnore=!0,this.dom.appendChild(i)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,n;for(let r of this.children){if(!(r instanceof Za)||/[^ -~]/.test(r.text))return null;let s=Jh(r.dom);if(s.length!=1)return null;e+=s[0].width,n=s[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:n}:null}coordsAt(e,n){let r=qF(this,e,n);if(!this.children.length&&r&&this.parent){let{heightOracle:s}=this.parent.view.viewState,i=r.bottom-r.top;if(Math.abs(i-s.lineHeight)<2&&s.textHeight<i){let a=(i-s.textHeight)/2;return{top:r.top+a,bottom:r.bottom-a,left:r.left,right:r.left}}}return r}become(e){return e instanceof rs&&this.children.length==0&&e.children.length==0&&Yv(this.attrs,e.attrs)&&this.breakAfter==e.breakAfter}covers(){return!0}static find(e,n){for(let r=0,s=0;r<e.children.length;r++){let i=e.children[r],a=s+i.length;if(a>=n){if(i instanceof rs)return i;if(a>n)break}s=a+i.breakAfter}return null}}class Bl extends sr{constructor(e,n,r){super(),this.widget=e,this.length=n,this.deco=r,this.breakAfter=0,this.prevWidget=null}merge(e,n,r,s,i,a){return r&&(!(r instanceof Bl)||!this.widget.compare(r.widget)||e>0&&i<=0||n<this.length&&a<=0)?!1:(this.length=e+(r?r.length:0)+(this.length-n),!0)}domAtPos(e){return e==0?Hs.before(this.dom):Hs.after(this.dom,e==this.length)}split(e){let n=this.length-e;this.length=e;let r=new Bl(this.widget,n,this.deco);return r.breakAfter=this.breakAfter,r}get children(){return l6}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}get overrideDOMText(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):An.empty}domBoundsAround(){return null}become(e){return e instanceof Bl&&e.widget.constructor==this.widget.constructor?(e.widget.compare(this.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,this.deco=e.deco,this.breakAfter=e.breakAfter,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get isEditable(){return!1}get isWidget(){return!0}coordsAt(e,n){let r=this.widget.coordsAt(this.dom,e,n);return r||(this.widget instanceof Hk?null:Up(this.dom.getBoundingClientRect(),this.length?e==0:n<=0))}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}covers(e){let{startSide:n,endSide:r}=this.deco;return n==r?!1:e<0?n<0:r>0}}class Hk extends Uo{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class N0{constructor(e,n,r,s){this.doc=e,this.pos=n,this.end=r,this.disallowBlockEffectsFor=s,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=n}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof Bl&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new rs),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(a1(new ef(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof Bl)&&this.getLine()}buildText(e,n,r){for(;e>0;){if(this.textOff==this.text.length){let{value:a,lineBreak:l,done:c}=this.cursor.next(this.skip);if(this.skip=0,c)throw new Error("Ran out of text content when drawing inline views");if(l){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=a,this.textOff=0}let s=Math.min(this.text.length-this.textOff,e),i=Math.min(s,512);this.flushBuffer(n.slice(n.length-r)),this.getLine().append(a1(new Za(this.text.slice(this.textOff,this.textOff+i)),n),r),this.atCursorPos=!0,this.textOff+=i,e-=i,r=s<=i?0:n.length}}span(e,n,r,s){this.buildText(n-e,r,s),this.pos=n,this.openStart<0&&(this.openStart=s)}point(e,n,r,s,i,a){if(this.disallowBlockEffectsFor[a]&&r instanceof Zc){if(r.block)throw new RangeError("Block decorations may not be specified via plugins");if(n>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let l=n-e;if(r instanceof Zc)if(r.block)r.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new Bl(r.widget||tf.block,l,r));else{let c=Dl.create(r.widget||tf.inline,l,l?0:r.startSide),d=this.atCursorPos&&!c.isEditable&&i<=s.length&&(e<n||r.startSide>0),h=!c.isEditable&&(e<n||i>s.length||r.startSide<=0),m=this.getLine();this.pendingBuffer==2&&!d&&!c.isEditable&&(this.pendingBuffer=0),this.flushBuffer(s),d&&(m.append(a1(new ef(1),s),i),i=s.length+Math.max(0,i-s.length)),m.append(a1(c,s),i),this.atCursorPos=h,this.pendingBuffer=h?e<n||i>s.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=s.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(r);l&&(this.textOff+l<=this.text.length?this.textOff+=l:(this.skip+=l-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=n),this.openStart<0&&(this.openStart=i)}static build(e,n,r,s,i){let a=new N0(e,n,r,i);return a.openEnd=Bn.spans(s,n,r,a),a.openStart<0&&(a.openStart=a.openEnd),a.finish(a.openEnd),a}}function a1(t,e){for(let n of e)t=new Ql(n,[t],t.length);return t}class tf extends Uo{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}tf.inline=new tf("span");tf.block=new tf("div");var br=(function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t})(br||(br={}));const ud=br.LTR,c6=br.RTL;function HF(t){let e=[];for(let n=0;n<t.length;n++)e.push(1<<+t[n]);return e}const hoe=HF("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),foe=HF("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Qk=Object.create(null),mo=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),n=t.charCodeAt(1);Qk[e]=n,Qk[n]=-e}function QF(t){return t<=247?hoe[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?foe[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}const moe=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class Hc{get dir(){return this.level%2?c6:ud}constructor(e,n,r){this.from=e,this.to=n,this.level=r}side(e,n){return this.dir==n==e?this.to:this.from}forward(e,n){return e==(this.dir==n)}static find(e,n,r,s){let i=-1;for(let a=0;a<e.length;a++){let l=e[a];if(l.from<=n&&l.to>=n){if(l.level==r)return a;(i<0||(s!=0?s<0?l.from<n:l.to>n:e[i].level>l.level))&&(i=a)}}if(i<0)throw new RangeError("Index out of range");return i}}function VF(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++){let r=t[n],s=e[n];if(r.from!=s.from||r.to!=s.to||r.direction!=s.direction||!VF(r.inner,s.inner))return!1}return!0}const cr=[];function poe(t,e,n,r,s){for(let i=0;i<=r.length;i++){let a=i?r[i-1].to:e,l=i<r.length?r[i].from:n,c=i?256:s;for(let d=a,h=c,m=c;d<l;d++){let g=QF(t.charCodeAt(d));g==512?g=h:g==8&&m==4&&(g=16),cr[d]=g==4?2:g,g&7&&(m=g),h=g}for(let d=a,h=c,m=c;d<l;d++){let g=cr[d];if(g==128)d<l-1&&h==cr[d+1]&&h&24?g=cr[d]=h:cr[d]=256;else if(g==64){let x=d+1;for(;x<l&&cr[x]==64;)x++;let y=d&&h==8||x<n&&cr[x]==8?m==1?1:8:256;for(let w=d;w<x;w++)cr[w]=y;d=x-1}else g==8&&m==1&&(cr[d]=1);h=g,g&7&&(m=g)}}}function goe(t,e,n,r,s){let i=s==1?2:1;for(let a=0,l=0,c=0;a<=r.length;a++){let d=a?r[a-1].to:e,h=a<r.length?r[a].from:n;for(let m=d,g,x,y;m<h;m++)if(x=Qk[g=t.charCodeAt(m)])if(x<0){for(let w=l-3;w>=0;w-=3)if(mo[w+1]==-x){let S=mo[w+2],k=S&2?s:S&4?S&1?i:s:0;k&&(cr[m]=cr[mo[w]]=k),l=w;break}}else{if(mo.length==189)break;mo[l++]=m,mo[l++]=g,mo[l++]=c}else if((y=cr[m])==2||y==1){let w=y==s;c=w?0:1;for(let S=l-3;S>=0;S-=3){let k=mo[S+2];if(k&2)break;if(w)mo[S+2]|=2;else{if(k&4)break;mo[S+2]|=4}}}}}function xoe(t,e,n,r){for(let s=0,i=r;s<=n.length;s++){let a=s?n[s-1].to:t,l=s<n.length?n[s].from:e;for(let c=a;c<l;){let d=cr[c];if(d==256){let h=c+1;for(;;)if(h==l){if(s==n.length)break;h=n[s++].to,l=s<n.length?n[s].from:e}else if(cr[h]==256)h++;else break;let m=i==1,g=(h<e?cr[h]:r)==1,x=m==g?m?1:2:r;for(let y=h,w=s,S=w?n[w-1].to:t;y>c;)y==S&&(y=n[--w].from,S=w?n[w-1].to:t),cr[--y]=x;c=h}else i=d,c++}}}function Vk(t,e,n,r,s,i,a){let l=r%2?2:1;if(r%2==s%2)for(let c=e,d=0;c<n;){let h=!0,m=!1;if(d==i.length||c<i[d].from){let w=cr[c];w!=l&&(h=!1,m=w==16)}let g=!h&&l==1?[]:null,x=h?r:r+1,y=c;e:for(;;)if(d<i.length&&y==i[d].from){if(m)break e;let w=i[d];if(!h)for(let S=w.to,k=d+1;;){if(S==n)break e;if(k<i.length&&i[k].from==S)S=i[k++].to;else{if(cr[S]==l)break e;break}}if(d++,g)g.push(w);else{w.from>c&&a.push(new Hc(c,w.from,x));let S=w.direction==ud!=!(x%2);Uk(t,S?r+1:r,s,w.inner,w.from,w.to,a),c=w.to}y=w.to}else{if(y==n||(h?cr[y]!=l:cr[y]==l))break;y++}g?Vk(t,c,y,r+1,s,g,a):c<y&&a.push(new Hc(c,y,x)),c=y}else for(let c=n,d=i.length;c>e;){let h=!0,m=!1;if(!d||c>i[d-1].to){let w=cr[c-1];w!=l&&(h=!1,m=w==16)}let g=!h&&l==1?[]:null,x=h?r:r+1,y=c;e:for(;;)if(d&&y==i[d-1].to){if(m)break e;let w=i[--d];if(!h)for(let S=w.from,k=d;;){if(S==e)break e;if(k&&i[k-1].to==S)S=i[--k].from;else{if(cr[S-1]==l)break e;break}}if(g)g.push(w);else{w.to<c&&a.push(new Hc(w.to,c,x));let S=w.direction==ud!=!(x%2);Uk(t,S?r+1:r,s,w.inner,w.from,w.to,a),c=w.from}y=w.from}else{if(y==e||(h?cr[y-1]!=l:cr[y-1]==l))break;y--}g?Vk(t,y,c,r+1,s,g,a):y<c&&a.push(new Hc(y,c,x)),c=y}}function Uk(t,e,n,r,s,i,a){let l=e%2?2:1;poe(t,s,i,r,l),goe(t,s,i,r,l),xoe(s,i,r,l),Vk(t,s,i,e,n,r,a)}function voe(t,e,n){if(!t)return[new Hc(0,0,e==c6?1:0)];if(e==ud&&!n.length&&!moe.test(t))return UF(t.length);if(n.length)for(;t.length>cr.length;)cr[cr.length]=256;let r=[],s=e==ud?0:1;return Uk(t,s,s,n,0,t.length,r),r}function UF(t){return[new Hc(0,t,0)]}let WF="";function yoe(t,e,n,r,s){var i;let a=r.head-t.from,l=Hc.find(e,a,(i=r.bidiLevel)!==null&&i!==void 0?i:-1,r.assoc),c=e[l],d=c.side(s,n);if(a==d){let g=l+=s?1:-1;if(g<0||g>=e.length)return null;c=e[l=g],a=c.side(!s,n),d=c.side(s,n)}let h=Ps(t.text,a,c.forward(s,n));(h<c.from||h>c.to)&&(h=d),WF=t.text.slice(Math.min(a,h),Math.max(a,h));let m=l==(s?e.length-1:0)?null:e[l+(s?1:-1)];return m&&h==d&&m.level+(s?0:1)<c.level?Me.cursor(m.side(!s,n)+t.from,m.forward(s,n)?1:-1,m.level):Me.cursor(h+t.from,c.forward(s,n)?-1:1,c.level)}function boe(t,e,n){for(let r=e;r<n;r++){let s=QF(t.charCodeAt(r));if(s==1)return ud;if(s==2||s==4)return c6}return ud}const GF=st.define(),XF=st.define(),YF=st.define(),KF=st.define(),Wk=st.define(),ZF=st.define(),JF=st.define(),u6=st.define(),d6=st.define(),eq=st.define({combine:t=>t.some(e=>e)}),tq=st.define({combine:t=>t.some(e=>e)}),nq=st.define();class Ih{constructor(e,n="nearest",r="nearest",s=5,i=5,a=!1){this.range=e,this.y=n,this.x=r,this.yMargin=s,this.xMargin=i,this.isSnapshot=a}map(e){return e.empty?this:new Ih(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new Ih(Me.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const o1=Qt.define({map:(t,e)=>t.map(e)}),rq=Qt.define();function bi(t,e,n){let r=t.facet(KF);r.length?r[0](e):window.onerror&&window.onerror(String(e),n,void 0,void 0,e)||(n?console.error(n+":",e):console.error(e))}const Ml=st.define({combine:t=>t.length?t[0]:!0});let woe=0;const Th=st.define({combine(t){return t.filter((e,n)=>{for(let r=0;r<n;r++)if(t[r].plugin==e.plugin)return!1;return!0})}});class Yr{constructor(e,n,r,s,i){this.id=e,this.create=n,this.domEventHandlers=r,this.domEventObservers=s,this.baseExtensions=i(this),this.extension=this.baseExtensions.concat(Th.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(Th.of({plugin:this,arg:e}))}static define(e,n){const{eventHandlers:r,eventObservers:s,provide:i,decorations:a}=n||{};return new Yr(woe++,e,r,s,l=>{let c=[];return a&&c.push(W0.of(d=>{let h=d.plugin(l);return h?a(h):Ot.none})),i&&c.push(i(l)),c})}static fromClass(e,n){return Yr.define((r,s)=>new e(r,s),n)}}class F4{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(r){if(bi(n.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(n){bi(e.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(r){bi(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const sq=st.define(),h6=st.define(),W0=st.define(),iq=st.define(),Xp=st.define(),aq=st.define();function _E(t,e){let n=t.state.facet(aq);if(!n.length)return n;let r=n.map(i=>i instanceof Function?i(t):i),s=[];return Bn.spans(r,e.from,e.to,{point(){},span(i,a,l,c){let d=i-e.from,h=a-e.from,m=s;for(let g=l.length-1;g>=0;g--,c--){let x=l[g].spec.bidiIsolate,y;if(x==null&&(x=boe(e.text,d,h)),c>0&&m.length&&(y=m[m.length-1]).to==d&&y.direction==x)y.to=h,m=y.inner;else{let w={from:d,to:h,direction:x,inner:[]};m.push(w),m=w.inner}}}}),s}const oq=st.define();function f6(t){let e=0,n=0,r=0,s=0;for(let i of t.state.facet(oq)){let a=i(t);a&&(a.left!=null&&(e=Math.max(e,a.left)),a.right!=null&&(n=Math.max(n,a.right)),a.top!=null&&(r=Math.max(r,a.top)),a.bottom!=null&&(s=Math.max(s,a.bottom)))}return{left:e,right:n,top:r,bottom:s}}const l0=st.define();class Ta{constructor(e,n,r,s){this.fromA=e,this.toA=n,this.fromB=r,this.toB=s}join(e){return new Ta(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let n=e.length,r=this;for(;n>0;n--){let s=e[n-1];if(!(s.fromA>r.toA)){if(s.toA<r.fromA)break;r=r.join(s),e.splice(n-1,1)}}return e.splice(n,0,r),e}static extendWithRanges(e,n){if(n.length==0)return e;let r=[];for(let s=0,i=0,a=0,l=0;;s++){let c=s==e.length?null:e[s],d=a-l,h=c?c.fromB:1e9;for(;i<n.length&&n[i]<h;){let m=n[i],g=n[i+1],x=Math.max(l,m),y=Math.min(h,g);if(x<=y&&new Ta(x+d,y+d,x,y).addToSet(r),g>h)break;i+=2}if(!c)return r;new Ta(c.fromA,c.toA,c.fromB,c.toB).addToSet(r),a=c.toA,l=c.toB}}}class Kv{constructor(e,n,r){this.view=e,this.state=n,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=us.empty(this.startState.doc.length);for(let i of r)this.changes=this.changes.compose(i.changes);let s=[];this.changes.iterChangedRanges((i,a,l,c)=>s.push(new Ta(i,a,l,c))),this.changedRanges=s}static create(e,n,r){return new Kv(e,n,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class AE extends sr{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=Ot.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new rs],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new Ta(0,0,0,e.state.doc.length)],0,null)}update(e){var n;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:d,toA:h})=>h<this.minWidthFrom||d>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let s=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?s=this.domChanged.newSel.head:!Toe(e.changes,this.hasComposition)&&!e.selectionSet&&(s=e.state.selection.main.head));let i=s>-1?koe(this.view,e.changes,s):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:d,to:h}=this.hasComposition;r=new Ta(d,h,e.changes.mapPos(d,-1),e.changes.mapPos(h,1)).addToSet(r.slice())}this.hasComposition=i?{from:i.range.fromB,to:i.range.toB}:null,(et.ie||et.chrome)&&!i&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let a=this.decorations,l=this.updateDeco(),c=Noe(a,l,e.changes);return r=Ta.extendWithRanges(r,c),!(this.flags&7)&&r.length==0?!1:(this.updateInner(r,e.startState.doc.length,i),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,n,r){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,n,r);let{observer:s}=this.view;s.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let a=et.chrome||et.ios?{node:s.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,a),this.flags&=-8,a&&(a.written||s.selectionRange.focusNode!=a.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(a=>a.flags&=-9);let i=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let a of this.children)a instanceof Bl&&a.widget instanceof Hk&&i.push(a.dom);s.updateGaps(i)}updateChildren(e,n,r){let s=r?r.range.addToSet(e.slice()):e,i=this.childCursor(n);for(let a=s.length-1;;a--){let l=a>=0?s[a]:null;if(!l)break;let{fromA:c,toA:d,fromB:h,toB:m}=l,g,x,y,w;if(r&&r.range.fromB<m&&r.range.toB>h){let T=N0.build(this.view.state.doc,h,r.range.fromB,this.decorations,this.dynamicDecorationMap),E=N0.build(this.view.state.doc,r.range.toB,m,this.decorations,this.dynamicDecorationMap);x=T.breakAtStart,y=T.openStart,w=E.openEnd;let _=this.compositionView(r);E.breakAtStart?_.breakAfter=1:E.content.length&&_.merge(_.length,_.length,E.content[0],!1,E.openStart,0)&&(_.breakAfter=E.content[0].breakAfter,E.content.shift()),T.content.length&&_.merge(0,0,T.content[T.content.length-1],!0,0,T.openEnd)&&T.content.pop(),g=T.content.concat(_).concat(E.content)}else({content:g,breakAtStart:x,openStart:y,openEnd:w}=N0.build(this.view.state.doc,h,m,this.decorations,this.dynamicDecorationMap));let{i:S,off:k}=i.findPos(d,1),{i:j,off:N}=i.findPos(c,-1);IF(this,j,N,S,k,g,x,y,w)}r&&this.fixCompositionDOM(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let n of e.transactions)for(let r of n.effects)r.is(rq)&&(this.editContextFormatting=r.value)}compositionView(e){let n=new Za(e.text.nodeValue);n.flags|=8;for(let{deco:s}of e.marks)n=new Ql(s,[n],n.length);let r=new rs;return r.append(n,0),r}fixCompositionDOM(e){let n=(i,a)=>{a.flags|=8|(a.children.some(c=>c.flags&7)?1:0),this.markedForComposition.add(a);let l=sr.get(i);l&&l!=a&&(l.dom=null),a.setDOM(i)},r=this.childPos(e.range.fromB,1),s=this.children[r.i];n(e.line,s);for(let i=e.marks.length-1;i>=-1;i--)r=s.childPos(r.off,1),s=s.children[r.i],n(i>=0?e.marks[i].node:e.text,s)}updateSelection(e=!1,n=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let r=this.view.root.activeElement,s=r==this.dom,i=!s&&!(this.view.state.facet(Ml)||this.dom.tabIndex>-1)&&fv(this.dom,this.view.observer.selectionRange)&&!(r&&this.dom.contains(r));if(!(s||n||i))return;let a=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,c=this.moveToLine(this.domAtPos(l.anchor)),d=l.empty?c:this.moveToLine(this.domAtPos(l.head));if(et.gecko&&l.empty&&!this.hasComposition&&Soe(c)){let m=document.createTextNode("");this.view.observer.ignore(()=>c.node.insertBefore(m,c.node.childNodes[c.offset]||null)),c=d=new Hs(m,0),a=!0}let h=this.view.observer.selectionRange;(a||!h.focusNode||(!j0(c.node,c.offset,h.anchorNode,h.anchorOffset)||!j0(d.node,d.offset,h.focusNode,h.focusOffset))&&!this.suppressWidgetCursorChange(h,l))&&(this.view.observer.ignore(()=>{et.android&&et.chrome&&this.dom.contains(h.focusNode)&&Coe(h.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let m=U0(this.view.root);if(m)if(l.empty){if(et.gecko){let g=Ooe(c.node,c.offset);if(g&&g!=3){let x=(g==1?DF:PF)(c.node,c.offset);x&&(c=new Hs(x.node,x.offset))}}m.collapse(c.node,c.offset),l.bidiLevel!=null&&m.caretBidiLevel!==void 0&&(m.caretBidiLevel=l.bidiLevel)}else if(m.extend){m.collapse(c.node,c.offset);try{m.extend(d.node,d.offset)}catch{}}else{let g=document.createRange();l.anchor>l.head&&([c,d]=[d,c]),g.setEnd(d.node,d.offset),g.setStart(c.node,c.offset),m.removeAllRanges(),m.addRange(g)}i&&this.view.root.activeElement==this.dom&&(this.dom.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(c,d)),this.impreciseAnchor=c.precise?null:new Hs(h.anchorNode,h.anchorOffset),this.impreciseHead=d.precise?null:new Hs(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&j0(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,n=e.state.selection.main,r=U0(e.root),{anchorNode:s,anchorOffset:i}=e.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let a=rs.find(this,n.head);if(!a)return;let l=a.posAtStart;if(n.head==l||n.head==l+a.length)return;let c=this.coordsAt(n.head,-1),d=this.coordsAt(n.head,1);if(!c||!d||c.bottom>d.top)return;let h=this.domAtPos(n.head+n.assoc);r.collapse(h.node,h.offset),r.modify("move",n.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let m=e.observer.selectionRange;e.docView.posFromDOM(m.anchorNode,m.anchorOffset)!=n.from&&r.collapse(s,i)}moveToLine(e){let n=this.dom,r;if(e.node!=n)return e;for(let s=e.offset;!r&&s<n.childNodes.length;s++){let i=sr.get(n.childNodes[s]);i instanceof rs&&(r=i.domAtPos(0))}for(let s=e.offset-1;!r&&s>=0;s--){let i=sr.get(n.childNodes[s]);i instanceof rs&&(r=i.domAtPos(i.length))}return r?new Hs(r.node,r.offset,!0):e}nearest(e){for(let n=e;n;){let r=sr.get(n);if(r&&r.rootView==this)return r;n=n.parentNode}return null}posFromDOM(e,n){let r=this.nearest(e);if(!r)throw new RangeError("Trying to find position for a DOM position outside of the document");return r.localPosFromDOM(e,n)+r.posAtStart}domAtPos(e){let{i:n,off:r}=this.childCursor().findPos(e,-1);for(;n<this.children.length-1;){let s=this.children[n];if(r<s.length||s instanceof rs)break;n++,r=0}return this.children[n].domAtPos(r)}coordsAt(e,n){let r=null,s=0;for(let i=this.length,a=this.children.length-1;a>=0;a--){let l=this.children[a],c=i-l.breakAfter,d=c-l.length;if(c<e)break;if(d<=e&&(d<e||l.covers(-1))&&(c>e||l.covers(1))&&(!r||l instanceof rs&&!(r instanceof rs&&n>=0)))r=l,s=d;else if(r&&d==e&&c==e&&l instanceof Bl&&Math.abs(n)<2){if(l.deco.startSide<0)break;a&&(r=null)}i=d}return r?r.coordsAt(e-s,n):null}coordsForChar(e){let{i:n,off:r}=this.childPos(e,1),s=this.children[n];if(!(s instanceof rs))return null;for(;s.children.length;){let{i:l,off:c}=s.childPos(r,1);for(;;l++){if(l==s.children.length)return null;if((s=s.children[l]).length)break}r=c}if(!(s instanceof Za))return null;let i=Ps(s.text,r);if(i==r)return null;let a=cd(s.dom,r,i).getClientRects();for(let l=0;l<a.length;l++){let c=a[l];if(l==a.length-1||c.top<c.bottom&&c.left<c.right)return c}return null}measureVisibleLineHeights(e){let n=[],{from:r,to:s}=e,i=this.view.contentDOM.clientWidth,a=i>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,c=this.view.textDirection==br.LTR;for(let d=0,h=0;h<this.children.length;h++){let m=this.children[h],g=d+m.length;if(g>s)break;if(d>=r){let x=m.dom.getBoundingClientRect();if(n.push(x.height),a){let y=m.dom.lastChild,w=y?Jh(y):[];if(w.length){let S=w[w.length-1],k=c?S.right-x.left:x.right-S.left;k>l&&(l=k,this.minWidth=i,this.minWidthFrom=d,this.minWidthTo=g)}}}d=g+m.breakAfter}return n}textDirectionAt(e){let{i:n}=this.childPos(e,1);return getComputedStyle(this.children[n].dom).direction=="rtl"?br.RTL:br.LTR}measureTextSize(){for(let i of this.children)if(i instanceof rs){let a=i.measureTextSize();if(a)return a}let e=document.createElement("div"),n,r,s;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let i=Jh(e.firstChild)[0];n=e.getBoundingClientRect().height,r=i?i.width/27:7,s=i?i.height:n,e.remove()}),{lineHeight:n,charWidth:r,textHeight:s}}childCursor(e=this.length){let n=this.children.length;return n&&(e-=this.children[--n].length),new zF(this.children,e,n)}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let r=0,s=0;;s++){let i=s==n.viewports.length?null:n.viewports[s],a=i?i.from-1:this.length;if(a>r){let l=(n.lineBlockAt(a).bottom-n.lineBlockAt(r).top)/this.view.scaleY;e.push(Ot.replace({widget:new Hk(l),block:!0,inclusive:!0,isBlockGap:!0}).range(r,a))}if(!i)break;r=i.to+1}return Ot.set(e)}updateDeco(){let e=1,n=this.view.state.facet(W0).map(i=>(this.dynamicDecorationMap[e++]=typeof i=="function")?i(this.view):i),r=!1,s=this.view.state.facet(iq).map((i,a)=>{let l=typeof i=="function";return l&&(r=!0),l?i(this.view):i});for(s.length&&(this.dynamicDecorationMap[e++]=r,n.push(Bn.join(s))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;return this.decorations}scrollIntoView(e){if(e.isSnapshot){let d=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=d.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let d of this.view.state.facet(nq))try{if(d(this.view,e.range,e))return!0}catch(h){bi(this.view.state,h,"scroll handler")}let{range:n}=e,r=this.coordsAt(n.head,n.empty?n.assoc:n.head>n.anchor?-1:1),s;if(!r)return;!n.empty&&(s=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(r={left:Math.min(r.left,s.left),top:Math.min(r.top,s.top),right:Math.max(r.right,s.right),bottom:Math.max(r.bottom,s.bottom)});let i=f6(this.view),a={left:r.left-i.left,top:r.top-i.top,right:r.right+i.right,bottom:r.bottom+i.bottom},{offsetWidth:l,offsetHeight:c}=this.view.scrollDOM;toe(this.view.scrollDOM,a,n.head<n.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,l),-l),Math.max(Math.min(e.yMargin,c),-c),this.view.textDirection==br.LTR)}lineHasWidget(e){let{i:n}=this.childCursor().findPos(e);if(n==this.children.length)return!1;let r=s=>s instanceof Dl||s.children.some(r);return r(this.children[n])}}function Soe(t){return t.node.nodeType==1&&t.node.firstChild&&(t.offset==0||t.node.childNodes[t.offset-1].contentEditable=="false")&&(t.offset==t.node.childNodes.length||t.node.childNodes[t.offset].contentEditable=="false")}function lq(t,e){let n=t.observer.selectionRange;if(!n.focusNode)return null;let r=DF(n.focusNode,n.focusOffset),s=PF(n.focusNode,n.focusOffset),i=r||s;if(s&&r&&s.node!=r.node){let l=sr.get(s.node);if(!l||l instanceof Za&&l.text!=s.node.nodeValue)i=s;else if(t.docView.lastCompositionAfterCursor){let c=sr.get(r.node);!c||c instanceof Za&&c.text!=r.node.nodeValue||(i=s)}}if(t.docView.lastCompositionAfterCursor=i!=r,!i)return null;let a=e-i.offset;return{from:a,to:a+i.node.nodeValue.length,node:i.node}}function koe(t,e,n){let r=lq(t,n);if(!r)return null;let{node:s,from:i,to:a}=r,l=s.nodeValue;if(/[\n\r]/.test(l)||t.state.doc.sliceString(r.from,r.to)!=l)return null;let c=e.invertedDesc,d=new Ta(c.mapPos(i),c.mapPos(a),i,a),h=[];for(let m=s.parentNode;;m=m.parentNode){let g=sr.get(m);if(g instanceof Ql)h.push({node:m,deco:g.mark});else{if(g instanceof rs||m.nodeName=="DIV"&&m.parentNode==t.contentDOM)return{range:d,text:s,marks:h,line:m};if(m!=t.contentDOM)h.push({node:m,deco:new Wp({inclusive:!0,attributes:uoe(m),tagName:m.tagName.toLowerCase()})});else return null}}}function Ooe(t,e){return t.nodeType!=1?0:(e&&t.childNodes[e-1].contentEditable=="false"?1:0)|(e<t.childNodes.length&&t.childNodes[e].contentEditable=="false"?2:0)}let joe=class{constructor(){this.changes=[]}compareRange(e,n){mv(e,n,this.changes)}comparePoint(e,n){mv(e,n,this.changes)}boundChange(e){mv(e,e,this.changes)}};function Noe(t,e,n){let r=new joe;return Bn.compare(t,e,n,r),r.changes}function Coe(t,e){for(let n=t;n&&n!=e;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable=="false")return!0;return!1}function Toe(t,e){let n=!1;return e&&t.iterChangedRanges((r,s)=>{r<e.to&&s>e.from&&(n=!0)}),n}function Eoe(t,e,n=1){let r=t.charCategorizer(e),s=t.doc.lineAt(e),i=e-s.from;if(s.length==0)return Me.cursor(e);i==0?n=1:i==s.length&&(n=-1);let a=i,l=i;n<0?a=Ps(s.text,i,!1):l=Ps(s.text,i);let c=r(s.text.slice(a,l));for(;a>0;){let d=Ps(s.text,a,!1);if(r(s.text.slice(d,a))!=c)break;a=d}for(;l<s.length;){let d=Ps(s.text,l);if(r(s.text.slice(l,d))!=c)break;l=d}return Me.range(a+s.from,l+s.from)}function _oe(t,e){return e.left>t?e.left-t:Math.max(0,t-e.right)}function Aoe(t,e){return e.top>t?e.top-t:Math.max(0,t-e.bottom)}function q4(t,e){return t.top<e.bottom-1&&t.bottom>e.top+1}function ME(t,e){return e<t.top?{top:e,left:t.left,right:t.right,bottom:t.bottom}:t}function RE(t,e){return e>t.bottom?{top:t.top,left:t.left,right:t.right,bottom:e}:t}function Gk(t,e,n){let r,s,i,a,l=!1,c,d,h,m;for(let y=t.firstChild;y;y=y.nextSibling){let w=Jh(y);for(let S=0;S<w.length;S++){let k=w[S];s&&q4(s,k)&&(k=ME(RE(k,s.bottom),s.top));let j=_oe(e,k),N=Aoe(n,k);if(j==0&&N==0)return y.nodeType==3?DE(y,e,n):Gk(y,e,n);(!r||a>N||a==N&&i>j)&&(r=y,s=k,i=j,a=N,l=j?e<k.left?S>0:S<w.length-1:!0),j==0?n>k.bottom&&(!h||h.bottom<k.bottom)?(c=y,h=k):n<k.top&&(!m||m.top>k.top)&&(d=y,m=k):h&&q4(h,k)?h=RE(h,k.bottom):m&&q4(m,k)&&(m=ME(m,k.top))}}if(h&&h.bottom>=n?(r=c,s=h):m&&m.top<=n&&(r=d,s=m),!r)return{node:t,offset:0};let g=Math.max(s.left,Math.min(s.right,e));if(r.nodeType==3)return DE(r,g,n);if(l&&r.contentEditable!="false")return Gk(r,g,n);let x=Array.prototype.indexOf.call(t.childNodes,r)+(e>=(s.left+s.right)/2?1:0);return{node:t,offset:x}}function DE(t,e,n){let r=t.nodeValue.length,s=-1,i=1e9,a=0;for(let l=0;l<r;l++){let c=cd(t,l,l+1).getClientRects();for(let d=0;d<c.length;d++){let h=c[d];if(h.top==h.bottom)continue;a||(a=e-h.left);let m=(h.top>n?h.top-n:n-h.bottom)-1;if(h.left-1<=e&&h.right+1>=e&&m<i){let g=e>=(h.left+h.right)/2,x=g;if(et.chrome||et.gecko){let y=cd(t,l).getBoundingClientRect();Math.abs(y.left-h.right)<.1&&(x=!g)}if(m<=0)return{node:t,offset:l+(x?1:0)};s=l+(x?1:0),i=m}}}return{node:t,offset:s>-1?s:a>0?t.nodeValue.length:0}}function cq(t,e,n,r=-1){var s,i;let a=t.contentDOM.getBoundingClientRect(),l=a.top+t.viewState.paddingTop,c,{docHeight:d}=t.viewState,{x:h,y:m}=e,g=m-l;if(g<0)return 0;if(g>d)return t.state.doc.length;for(let T=t.viewState.heightOracle.textHeight/2,E=!1;c=t.elementAtHeight(g),c.type!=ri.Text;)for(;g=r>0?c.bottom+T:c.top-T,!(g>=0&&g<=d);){if(E)return n?null:0;E=!0,r=-r}m=l+g;let x=c.from;if(x<t.viewport.from)return t.viewport.from==0?0:n?null:PE(t,a,c,h,m);if(x>t.viewport.to)return t.viewport.to==t.state.doc.length?t.state.doc.length:n?null:PE(t,a,c,h,m);let y=t.dom.ownerDocument,w=t.root.elementFromPoint?t.root:y,S=w.elementFromPoint(h,m);S&&!t.contentDOM.contains(S)&&(S=null),S||(h=Math.max(a.left+1,Math.min(a.right-1,h)),S=w.elementFromPoint(h,m),S&&!t.contentDOM.contains(S)&&(S=null));let k,j=-1;if(S&&((s=t.docView.nearest(S))===null||s===void 0?void 0:s.isEditable)!=!1){if(y.caretPositionFromPoint){let T=y.caretPositionFromPoint(h,m);T&&({offsetNode:k,offset:j}=T)}else if(y.caretRangeFromPoint){let T=y.caretRangeFromPoint(h,m);T&&({startContainer:k,startOffset:j}=T)}k&&(!t.contentDOM.contains(k)||et.safari&&Moe(k,j,h)||et.chrome&&Roe(k,j,h))&&(k=void 0),k&&(j=Math.min(qo(k),j))}if(!k||!t.docView.dom.contains(k)){let T=rs.find(t.docView,x);if(!T)return g>c.top+c.height/2?c.to:c.from;({node:k,offset:j}=Gk(T.dom,h,m))}let N=t.docView.nearest(k);if(!N)return null;if(N.isWidget&&((i=N.dom)===null||i===void 0?void 0:i.nodeType)==1){let T=N.dom.getBoundingClientRect();return e.y<T.top||e.y<=T.bottom&&e.x<=(T.left+T.right)/2?N.posAtStart:N.posAtEnd}else return N.localPosFromDOM(k,j)+N.posAtStart}function PE(t,e,n,r,s){let i=Math.round((r-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&n.height>t.defaultLineHeight*1.5){let l=t.viewState.heightOracle.textHeight,c=Math.floor((s-n.top-(t.defaultLineHeight-l)*.5)/l);i+=c*t.viewState.heightOracle.lineLength}let a=t.state.sliceDoc(n.from,n.to);return n.from+Rk(a,i,t.state.tabSize)}function uq(t,e,n){let r,s=t;if(t.nodeType!=3||e!=(r=t.nodeValue.length))return!1;for(;;){let i=s.nextSibling;if(i){if(i.nodeName=="BR")break;return!1}else{let a=s.parentNode;if(!a||a.nodeName=="DIV")break;s=a}}return cd(t,r-1,r).getBoundingClientRect().right>n}function Moe(t,e,n){return uq(t,e,n)}function Roe(t,e,n){if(e!=0)return uq(t,e,n);for(let s=t;;){let i=s.parentNode;if(!i||i.nodeType!=1||i.firstChild!=s)return!1;if(i.classList.contains("cm-line"))break;s=i}let r=t.nodeType==1?t.getBoundingClientRect():cd(t,0,Math.max(t.nodeValue.length,1)).getBoundingClientRect();return n-r.left>5}function Xk(t,e,n){let r=t.lineBlockAt(e);if(Array.isArray(r.type)){let s;for(let i of r.type){if(i.from>e)break;if(!(i.to<e)){if(i.from<e&&i.to>e)return i;(!s||i.type==ri.Text&&(s.type!=i.type||(n<0?i.from<e:i.to>e)))&&(s=i)}}return s||r}return r}function Doe(t,e,n,r){let s=Xk(t,e.head,e.assoc||-1),i=!r||s.type!=ri.Text||!(t.lineWrapping||s.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>s.from?e.head-1:e.head);if(i){let a=t.dom.getBoundingClientRect(),l=t.textDirectionAt(s.from),c=t.posAtCoords({x:n==(l==br.LTR)?a.right-1:a.left+1,y:(i.top+i.bottom)/2});if(c!=null)return Me.cursor(c,n?-1:1)}return Me.cursor(n?s.to:s.from,n?-1:1)}function zE(t,e,n,r){let s=t.state.doc.lineAt(e.head),i=t.bidiSpans(s),a=t.textDirectionAt(s.from);for(let l=e,c=null;;){let d=yoe(s,i,a,l,n),h=WF;if(!d){if(s.number==(n?t.state.doc.lines:1))return l;h=`
|
||
`,s=t.state.doc.line(s.number+(n?1:-1)),i=t.bidiSpans(s),d=t.visualLineSide(s,!n)}if(c){if(!c(h))return l}else{if(!r)return d;c=r(h)}l=d}}function Poe(t,e,n){let r=t.state.charCategorizer(e),s=r(n);return i=>{let a=r(i);return s==Tr.Space&&(s=a),s==a}}function zoe(t,e,n,r){let s=e.head,i=n?1:-1;if(s==(n?t.state.doc.length:0))return Me.cursor(s,e.assoc);let a=e.goalColumn,l,c=t.contentDOM.getBoundingClientRect(),d=t.coordsAtPos(s,e.assoc||-1),h=t.documentTop;if(d)a==null&&(a=d.left-c.left),l=i<0?d.top:d.bottom;else{let x=t.viewState.lineBlockAt(s);a==null&&(a=Math.min(c.right-c.left,t.defaultCharacterWidth*(s-x.from))),l=(i<0?x.top:x.bottom)+h}let m=c.left+a,g=r??t.viewState.heightOracle.textHeight>>1;for(let x=0;;x+=10){let y=l+(g+x)*i,w=cq(t,{x:m,y},!1,i);if(y<c.top||y>c.bottom||(i<0?w<s:w>s)){let S=t.docView.coordsForChar(w),k=!S||y<S.top?-1:1;return Me.cursor(w,k,void 0,a)}}}function C0(t,e,n){for(;;){let r=0;for(let s of t)s.between(e-1,e+1,(i,a,l)=>{if(e>i&&e<a){let c=r||n||(e-i<a-e?-1:1);e=c<0?i:a,r=c}});if(!r)return e}}function dq(t,e){let n=null;for(let r=0;r<e.ranges.length;r++){let s=e.ranges[r],i=null;if(s.empty){let a=C0(t,s.from,0);a!=s.from&&(i=Me.cursor(a,-1))}else{let a=C0(t,s.from,-1),l=C0(t,s.to,1);(a!=s.from||l!=s.to)&&(i=Me.range(s.from==s.anchor?a:l,s.from==s.head?a:l))}i&&(n||(n=e.ranges.slice()),n[r]=i)}return n?Me.create(n,e.mainIndex):e}function $4(t,e,n){let r=C0(t.state.facet(Xp).map(s=>s(t)),n.from,e.head>n.from?-1:1);return r==n.from?n:Me.cursor(r,r<n.from?1:-1)}const c0="";class Ioe{constructor(e,n){this.points=e,this.text="",this.lineSeparator=n.facet(Nn.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=c0}readRange(e,n){if(!e)return this;let r=e.parentNode;for(let s=e;;){this.findPointBefore(r,s);let i=this.text.length;this.readNode(s);let a=s.nextSibling;if(a==n)break;let l=sr.get(s),c=sr.get(a);(l&&c?l.breakAfter:(l?l.breakAfter:Xv(s))||Xv(a)&&(s.nodeName!="BR"||s.cmIgnore)&&this.text.length>i)&&!Boe(a,n)&&this.lineBreak(),s=a}return this.findPointBefore(r,n),this}readTextNode(e){let n=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,n.length));for(let r=0,s=this.lineSeparator?null:/\r\n?|\n/g;;){let i=-1,a=1,l;if(this.lineSeparator?(i=n.indexOf(this.lineSeparator,r),a=this.lineSeparator.length):(l=s.exec(n))&&(i=l.index,a=l[0].length),this.append(n.slice(r,i<0?n.length:i)),i<0)break;if(this.lineBreak(),a>1)for(let c of this.points)c.node==e&&c.pos>this.text.length&&(c.pos-=a-1);r=i+a}}readNode(e){if(e.cmIgnore)return;let n=sr.get(e),r=n&&n.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let s=r.iter();!s.next().done;)s.lineBreak?this.lineBreak():this.append(s.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,n){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==n&&(r.pos=this.text.length)}findPointInside(e,n){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(Loe(e,r.node,r.offset)?n:0))}}function Loe(t,e,n){for(;;){if(!e||n<qo(e))return!1;if(e==t)return!0;n=ld(e)+1,e=e.parentNode}}function Boe(t,e){let n;for(;!(t==e||!t);t=t.nextSibling){let r=sr.get(t);if(!(r?.isWidget||t.cmIgnore))return!1;r&&(n||(n=[])).push(r)}if(n)for(let r of n){let s=r.overrideDOMText;if(s?.length)return!1}return!0}class IE{constructor(e,n){this.node=e,this.offset=n,this.pos=-1}}class Foe{constructor(e,n,r,s){this.typeOver=s,this.bounds=null,this.text="",this.domChanged=n>-1;let{impreciseHead:i,impreciseAnchor:a}=e.docView;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=e.docView.domBoundsAround(n,r,0))){let l=i||a?[]:$oe(e),c=new Ioe(l,e.state);c.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=c.text,this.newSel=Hoe(l,this.bounds.from)}else{let l=e.observer.selectionRange,c=i&&i.node==l.focusNode&&i.offset==l.focusOffset||!Fk(e.contentDOM,l.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),d=a&&a.node==l.anchorNode&&a.offset==l.anchorOffset||!Fk(e.contentDOM,l.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset),h=e.viewport;if((et.ios||et.chrome)&&e.state.selection.main.empty&&c!=d&&(h.from>0||h.to<e.state.doc.length)){let m=Math.min(c,d),g=Math.max(c,d),x=h.from-m,y=h.to-g;(x==0||x==1||m==0)&&(y==0||y==-1||g==e.state.doc.length)&&(c=0,d=e.state.doc.length)}e.inputState.composing>-1&&e.state.selection.ranges.length>1?this.newSel=e.state.selection.replaceRange(Me.range(d,c)):this.newSel=Me.single(d,c)}}}function hq(t,e){let n,{newSel:r}=e,s=t.state.selection.main,i=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:a,to:l}=e.bounds,c=s.from,d=null;(i===8||et.android&&e.text.length<l-a)&&(c=s.to,d="end");let h=fq(t.state.doc.sliceString(a,l,c0),e.text,c-a,d);h&&(et.chrome&&i==13&&h.toB==h.from+2&&e.text.slice(h.from,h.toB)==c0+c0&&h.toB--,n={from:a+h.from,to:a+h.toA,insert:An.of(e.text.slice(h.from,h.toB).split(c0))})}else r&&(!t.hasFocus&&t.state.facet(Ml)||r.main.eq(s))&&(r=null);if(!n&&!r)return!1;if(!n&&e.typeOver&&!s.empty&&r&&r.main.empty?n={from:s.from,to:s.to,insert:t.state.doc.slice(s.from,s.to)}:(et.mac||et.android)&&n&&n.from==n.to&&n.from==s.head-1&&/^\. ?$/.test(n.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(r&&n.insert.length==2&&(r=Me.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:An.of([n.insert.toString().replace("."," ")])}):n&&n.from>=s.from&&n.to<=s.to&&(n.from!=s.from||n.to!=s.to)&&s.to-s.from-(n.to-n.from)<=4?n={from:s.from,to:s.to,insert:t.state.doc.slice(s.from,n.from).append(n.insert).append(t.state.doc.slice(n.to,s.to))}:t.state.doc.lineAt(s.from).to<s.to&&t.docView.lineHasWidget(s.to)&&t.inputState.insertingTextAt>Date.now()-50?n={from:s.from,to:s.to,insert:t.state.toText(t.inputState.insertingText)}:et.chrome&&n&&n.from==n.to&&n.from==s.head&&n.insert.toString()==`
|
||
`&&t.lineWrapping&&(r&&(r=Me.single(r.main.anchor-1,r.main.head-1)),n={from:s.from,to:s.to,insert:An.of([" "])}),n)return m6(t,n,r,i);if(r&&!r.main.eq(s)){let a=!1,l="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(a=!0),l=t.inputState.lastSelectionOrigin,l=="select.pointer"&&(r=dq(t.state.facet(Xp).map(c=>c(t)),r))),t.dispatch({selection:r,scrollIntoView:a,userEvent:l}),!0}else return!1}function m6(t,e,n,r=-1){if(et.ios&&t.inputState.flushIOSKey(e))return!0;let s=t.state.selection.main;if(et.android&&(e.to==s.to&&(e.from==s.from||e.from==s.from-1&&t.state.sliceDoc(e.from,s.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&zh(t.contentDOM,"Enter",13)||(e.from==s.from-1&&e.to==s.to&&e.insert.length==0||r==8&&e.insert.length<e.to-e.from&&e.to>s.head)&&zh(t.contentDOM,"Backspace",8)||e.from==s.from&&e.to==s.to+1&&e.insert.length==0&&zh(t.contentDOM,"Delete",46)))return!0;let i=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let a,l=()=>a||(a=qoe(t,e,n));return t.state.facet(ZF).some(c=>c(t,e.from,e.to,i,l))||t.dispatch(l()),!0}function qoe(t,e,n){let r,s=t.state,i=s.selection.main,a=-1;if(e.from==e.to&&e.from<i.from||e.from>i.to){let c=e.from<i.from?-1:1,d=c<0?i.from:i.to,h=C0(s.facet(Xp).map(m=>m(t)),d,c);e.from==h&&(a=h)}if(a>-1)r={changes:e,selection:Me.cursor(e.from+e.insert.length,-1)};else if(e.from>=i.from&&e.to<=i.to&&e.to-e.from>=(i.to-i.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let c=i.from<e.from?s.sliceDoc(i.from,e.from):"",d=i.to>e.to?s.sliceDoc(e.to,i.to):"";r=s.replaceSelection(t.state.toText(c+e.insert.sliceString(0,void 0,t.state.lineBreak)+d))}else{let c=s.changes(e),d=n&&n.main.to<=c.newLength?n.main:void 0;if(s.selection.ranges.length>1&&(t.inputState.composing>=0||t.inputState.compositionPendingChange)&&e.to<=i.to+10&&e.to>=i.to-10){let h=t.state.sliceDoc(e.from,e.to),m,g=n&&lq(t,n.main.head);if(g){let y=e.insert.length-(e.to-e.from);m={from:g.from,to:g.to-y}}else m=t.state.doc.lineAt(i.head);let x=i.to-e.to;r=s.changeByRange(y=>{if(y.from==i.from&&y.to==i.to)return{changes:c,range:d||y.map(c)};let w=y.to-x,S=w-h.length;if(t.state.sliceDoc(S,w)!=h||w>=m.from&&S<=m.to)return{range:y};let k=s.changes({from:S,to:w,insert:e.insert}),j=y.to-i.to;return{changes:k,range:d?Me.range(Math.max(0,d.anchor+j),Math.max(0,d.head+j)):y.map(k)}})}else r={changes:c,selection:d&&s.selection.replaceRange(d)}}let l="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,l+=".compose",t.inputState.compositionFirstChange&&(l+=".start",t.inputState.compositionFirstChange=!1)),s.update(r,{userEvent:l,scrollIntoView:!0})}function fq(t,e,n,r){let s=Math.min(t.length,e.length),i=0;for(;i<s&&t.charCodeAt(i)==e.charCodeAt(i);)i++;if(i==s&&t.length==e.length)return null;let a=t.length,l=e.length;for(;a>0&&l>0&&t.charCodeAt(a-1)==e.charCodeAt(l-1);)a--,l--;if(r=="end"){let c=Math.max(0,i-Math.min(a,l));n-=a+c-i}if(a<i&&t.length<e.length){let c=n<=i&&n>=a?i-n:0;i-=c,l=i+(l-a),a=i}else if(l<i){let c=n<=i&&n>=l?i-n:0;i-=c,a=i+(a-l),l=i}return{from:i,toA:a,toB:l}}function $oe(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:r,focusNode:s,focusOffset:i}=t.observer.selectionRange;return n&&(e.push(new IE(n,r)),(s!=n||i!=r)&&e.push(new IE(s,i))),e}function Hoe(t,e){if(t.length==0)return null;let n=t[0].pos,r=t.length==2?t[1].pos:n;return n>-1&&r>-1?Me.single(n+e,r+e):null}class Qoe{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,et.safari&&e.contentDOM.addEventListener("input",()=>null),et.gecko&&ale(e.contentDOM.ownerDocument)}handleEvent(e){!Zoe(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,n){let r=this.handlers[e];if(r){for(let s of r.observers)s(this.view,n);for(let s of r.handlers){if(n.defaultPrevented)break;if(s(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=Voe(e),r=this.handlers,s=this.view.contentDOM;for(let i in n)if(i!="scroll"){let a=!n[i].handlers.length,l=r[i];l&&a!=!l.handlers.length&&(s.removeEventListener(i,this.handleEvent),l=null),l||s.addEventListener(i,this.handleEvent,{passive:a})}for(let i in r)i!="scroll"&&!n[i]&&s.removeEventListener(i,this.handleEvent);this.handlers=n}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&pq.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),et.android&&et.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let n;return et.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((n=mq.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||Uoe.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=n||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,zh(this.view.contentDOM,n.key,n.keyCode,n instanceof KeyboardEvent?n:void 0))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:et.safari&&!et.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function LE(t,e){return(n,r)=>{try{return e.call(t,r,n)}catch(s){bi(n.state,s)}}}function Voe(t){let e=Object.create(null);function n(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of t){let s=r.spec,i=s&&s.plugin.domEventHandlers,a=s&&s.plugin.domEventObservers;if(i)for(let l in i){let c=i[l];c&&n(l).handlers.push(LE(r.value,c))}if(a)for(let l in a){let c=a[l];c&&n(l).observers.push(LE(r.value,c))}}for(let r in Ja)n(r).handlers.push(Ja[r]);for(let r in Aa)n(r).observers.push(Aa[r]);return e}const mq=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Uoe="dthko",pq=[16,17,18,20,91,92,224,225],l1=6;function c1(t){return Math.max(0,t)*.7+8}function Woe(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class Goe{constructor(e,n,r,s){this.view=e,this.startEvent=n,this.style=r,this.mustSelect=s,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=noe(e.contentDOM),this.atoms=e.state.facet(Xp).map(a=>a(e));let i=e.contentDOM.ownerDocument;i.addEventListener("mousemove",this.move=this.move.bind(this)),i.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=e.state.facet(Nn.allowMultipleSelections)&&Xoe(e,n),this.dragging=Koe(e,n)&&vq(n)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&Woe(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,r=0,s=0,i=0,a=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:s,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:i,bottom:l}=this.scrollParents.y.getBoundingClientRect());let c=f6(this.view);e.clientX-c.left<=s+l1?n=-c1(s-e.clientX):e.clientX+c.right>=a-l1&&(n=c1(e.clientX-a)),e.clientY-c.top<=i+l1?r=-c1(i-e.clientY):e.clientY+c.bottom>=l-l1&&(r=c1(e.clientY-l)),this.setScrollSpeed(n,r)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,n){this.scrollSpeed={x:e,y:n},e||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:n}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(e||n)&&this.view.win.scrollBy(e,n),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:n}=this,r=dq(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!r.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:r,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function Xoe(t,e){let n=t.state.facet(GF);return n.length?n[0](e):et.mac?e.metaKey:e.ctrlKey}function Yoe(t,e){let n=t.state.facet(XF);return n.length?n[0](e):et.mac?!e.altKey:!e.ctrlKey}function Koe(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let r=U0(t.root);if(!r||r.rangeCount==0)return!0;let s=r.getRangeAt(0).getClientRects();for(let i=0;i<s.length;i++){let a=s[i];if(a.left<=e.clientX&&a.right>=e.clientX&&a.top<=e.clientY&&a.bottom>=e.clientY)return!0}return!1}function Zoe(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,r;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=sr.get(n))&&r.ignoreEvent(e))return!1;return!0}const Ja=Object.create(null),Aa=Object.create(null),gq=et.ie&&et.ie_version<15||et.ios&&et.webkit_version<604;function Joe(t){let e=t.dom.parentNode;if(!e)return;let n=e.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{t.focus(),n.remove(),xq(t,n.value)},50)}function mb(t,e,n){for(let r of t.facet(e))n=r(n,t);return n}function xq(t,e){e=mb(t.state,u6,e);let{state:n}=t,r,s=1,i=n.toText(e),a=i.lines==n.selection.ranges.length;if(Yk!=null&&n.selection.ranges.every(c=>c.empty)&&Yk==i.toString()){let c=-1;r=n.changeByRange(d=>{let h=n.doc.lineAt(d.from);if(h.from==c)return{range:d};c=h.from;let m=n.toText((a?i.line(s++).text:e)+n.lineBreak);return{changes:{from:h.from,insert:m},range:Me.cursor(d.from+m.length)}})}else a?r=n.changeByRange(c=>{let d=i.line(s++);return{changes:{from:c.from,to:c.to,insert:d.text},range:Me.cursor(c.from+d.length)}}):r=n.replaceSelection(i);t.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}Aa.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};Ja.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);Aa.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")};Aa.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};Ja.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of t.state.facet(YF))if(n=r(t,e),n)break;if(!n&&e.button==0&&(n=nle(t,e)),n){let r=!t.hasFocus;t.inputState.startMouseSelection(new Goe(t,e,n,r)),r&&t.observer.ignore(()=>{AF(t.contentDOM);let i=t.root.activeElement;i&&!i.contains(t.contentDOM)&&i.blur()});let s=t.inputState.mouseSelection;if(s)return s.start(e),s.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function BE(t,e,n,r){if(r==1)return Me.cursor(e,n);if(r==2)return Eoe(t.state,e,n);{let s=rs.find(t.docView,e),i=t.state.doc.lineAt(s?s.posAtEnd:e),a=s?s.posAtStart:i.from,l=s?s.posAtEnd:i.to;return l<t.state.doc.length&&l==i.to&&l++,Me.range(a,l)}}let FE=(t,e,n)=>e>=n.top&&e<=n.bottom&&t>=n.left&&t<=n.right;function ele(t,e,n,r){let s=rs.find(t.docView,e);if(!s)return 1;let i=e-s.posAtStart;if(i==0)return 1;if(i==s.length)return-1;let a=s.coordsAt(i,-1);if(a&&FE(n,r,a))return-1;let l=s.coordsAt(i,1);return l&&FE(n,r,l)?1:a&&a.bottom>=r?-1:1}function qE(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:n,bias:ele(t,n,e.clientX,e.clientY)}}const tle=et.ie&&et.ie_version<=11;let $E=null,HE=0,QE=0;function vq(t){if(!tle)return t.detail;let e=$E,n=QE;return $E=t,QE=Date.now(),HE=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(HE+1)%3:1}function nle(t,e){let n=qE(t,e),r=vq(e),s=t.state.selection;return{update(i){i.docChanged&&(n.pos=i.changes.mapPos(n.pos),s=s.map(i.changes))},get(i,a,l){let c=qE(t,i),d,h=BE(t,c.pos,c.bias,r);if(n.pos!=c.pos&&!a){let m=BE(t,n.pos,n.bias,r),g=Math.min(m.from,h.from),x=Math.max(m.to,h.to);h=g<h.from?Me.range(g,x):Me.range(x,g)}return a?s.replaceRange(s.main.extend(h.from,h.to)):l&&r==1&&s.ranges.length>1&&(d=rle(s,c.pos))?d:l?s.addRange(h):Me.create([h])}}}function rle(t,e){for(let n=0;n<t.ranges.length;n++){let{from:r,to:s}=t.ranges[n];if(r<=e&&s>=e)return Me.create(t.ranges.slice(0,n).concat(t.ranges.slice(n+1)),t.mainIndex==n?0:t.mainIndex-(t.mainIndex>n?1:0))}return null}Ja.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let s=t.docView.nearest(e.target);if(s&&s.isWidget){let i=s.posAtStart,a=i+s.length;(i>=n.to||a<=n.from)&&(n=Me.range(i,a))}}let{inputState:r}=t;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",mb(t.state,d6,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1};Ja.dragend=t=>(t.inputState.draggedContent=null,!1);function VE(t,e,n,r){if(n=mb(t.state,u6,n),!n)return;let s=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:i}=t.inputState,a=r&&i&&Yoe(t,e)?{from:i.from,to:i.to}:null,l={from:s,insert:n},c=t.state.changes(a?[a,l]:l);t.focus(),t.dispatch({changes:c,selection:{anchor:c.mapPos(s,-1),head:c.mapPos(s,1)},userEvent:a?"move.drop":"input.drop"}),t.inputState.draggedContent=null}Ja.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let r=Array(n.length),s=0,i=()=>{++s==n.length&&VE(t,e,r.filter(a=>a!=null).join(t.state.lineBreak),!1)};for(let a=0;a<n.length;a++){let l=new FileReader;l.onerror=i,l.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(r[a]=l.result),i()},l.readAsText(n[a])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return VE(t,e,r,!0),!0}return!1};Ja.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=gq?null:e.clipboardData;return n?(xq(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(Joe(t),!1)};function sle(t,e){let n=t.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),t.focus()},50)}function ile(t){let e=[],n=[],r=!1;for(let s of t.selection.ranges)s.empty||(e.push(t.sliceDoc(s.from,s.to)),n.push(s));if(!e.length){let s=-1;for(let{from:i}of t.selection.ranges){let a=t.doc.lineAt(i);a.number>s&&(e.push(a.text),n.push({from:a.from,to:Math.min(t.doc.length,a.to+1)})),s=a.number}r=!0}return{text:mb(t,d6,e.join(t.lineBreak)),ranges:n,linewise:r}}let Yk=null;Ja.copy=Ja.cut=(t,e)=>{let{text:n,ranges:r,linewise:s}=ile(t.state);if(!n&&!s)return!1;Yk=s?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let i=gq?null:e.clipboardData;return i?(i.clearData(),i.setData("text/plain",n),!0):(sle(t,n),!1)};const yq=Qo.define();function bq(t,e){let n=[];for(let r of t.facet(JF)){let s=r(t,e);s&&n.push(s)}return n.length?t.update({effects:n,annotations:yq.of(!0)}):null}function wq(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=bq(t.state,e);n?t.dispatch(n):t.update([])}},10)}Aa.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),wq(t)};Aa.blur=t=>{t.observer.clearSelectionRange(),wq(t)};Aa.compositionstart=Aa.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};Aa.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,et.chrome&&et.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};Aa.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};Ja.beforeinput=(t,e)=>{var n,r;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(t.inputState.insertingText=e.data,t.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&t.observer.editContext){let i=(n=e.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),a=e.getTargetRanges();if(i&&a.length){let l=a[0],c=t.posAtDOM(l.startContainer,l.startOffset),d=t.posAtDOM(l.endContainer,l.endOffset);return m6(t,{from:c,to:d,insert:t.state.toText(i)},null),!0}}let s;if(et.chrome&&et.android&&(s=mq.find(i=>i.inputType==e.inputType))&&(t.observer.delayAndroidKey(s.key,s.keyCode),s.key=="Backspace"||s.key=="Delete")){let i=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var a;(((a=window.visualViewport)===null||a===void 0?void 0:a.height)||0)>i+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return et.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),et.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>Aa.compositionend(t,e),20),!1};const UE=new Set;function ale(t){UE.has(t)||(UE.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const WE=["pre-wrap","normal","pre-line","break-spaces"];let nf=!1;function GE(){nf=!1}class ole{constructor(e){this.lineWrapping=e,this.doc=An.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,n){let r=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((n-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return WE.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let r=0;r<e.length;r++){let s=e[r];s<0?r++:this.heightSamples[Math.floor(s*10)]||(n=!0,this.heightSamples[Math.floor(s*10)]=!0)}return n}refresh(e,n,r,s,i,a){let l=WE.indexOf(e)>-1,c=Math.round(n)!=Math.round(this.lineHeight)||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=n,this.charWidth=r,this.textHeight=s,this.lineLength=i,c){this.heightSamples={};for(let d=0;d<a.length;d++){let h=a[d];h<0?d++:this.heightSamples[Math.floor(h*10)]=!0}}return c}}class lle{constructor(e,n){this.from=e,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}}class Oo{constructor(e,n,r,s,i){this.from=e,this.length=n,this.top=r,this.height=s,this._content=i}get type(){return typeof this._content=="number"?ri.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof Zc?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new Oo(this.from,this.length+e.length,this.top,this.height+e.height,n)}}var yr=(function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t})(yr||(yr={}));const pv=.001;class si{constructor(e,n,r=2){this.length=e,this.height=n,this.flags=r}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>pv&&(nf=!0),this.height=e)}replace(e,n,r){return si.of(r)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,r,s){let i=this,a=r.doc;for(let l=s.length-1;l>=0;l--){let{fromA:c,toA:d,fromB:h,toB:m}=s[l],g=i.lineAt(c,yr.ByPosNoHeight,r.setDoc(n),0,0),x=g.to>=d?g:i.lineAt(d,yr.ByPosNoHeight,r,0,0);for(m+=x.to-d,d=x.to;l>0&&g.from<=s[l-1].toA;)c=s[l-1].fromA,h=s[l-1].fromB,l--,c<g.from&&(g=i.lineAt(c,yr.ByPosNoHeight,r,0,0));h+=g.from-c,c=g.from;let y=p6.build(r.setDoc(a),e,h,m);i=Zv(i,i.replace(c,d,y))}return i.updateHeight(r,0)}static empty(){return new Qi(0,0)}static of(e){if(e.length==1)return e[0];let n=0,r=e.length,s=0,i=0;for(;;)if(n==r)if(s>i*2){let l=e[n-1];l.break?e.splice(--n,1,l.left,null,l.right):e.splice(--n,1,l.left,l.right),r+=1+l.break,s-=l.size}else if(i>s*2){let l=e[r];l.break?e.splice(r,1,l.left,null,l.right):e.splice(r,1,l.left,l.right),r+=2+l.break,i-=l.size}else break;else if(s<i){let l=e[n++];l&&(s+=l.size)}else{let l=e[--r];l&&(i+=l.size)}let a=0;return e[n-1]==null?(a=1,n--):e[n]==null&&(a=1,r++),new cle(si.of(e.slice(0,n)),a,si.of(e.slice(r)))}}function Zv(t,e){return t==e?t:(t.constructor!=e.constructor&&(nf=!0),e)}si.prototype.size=1;class Sq extends si{constructor(e,n,r){super(e,n),this.deco=r}blockAt(e,n,r,s){return new Oo(s,this.length,r,this.height,this.deco||0)}lineAt(e,n,r,s,i){return this.blockAt(0,r,s,i)}forEachLine(e,n,r,s,i,a){e<=i+this.length&&n>=i&&a(this.blockAt(0,r,s,i))}updateHeight(e,n=0,r=!1,s){return s&&s.from<=n&&s.more&&this.setHeight(s.heights[s.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Qi extends Sq{constructor(e,n){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,n,r,s){return new Oo(s,this.length,r,this.height,this.breaks)}replace(e,n,r){let s=r[0];return r.length==1&&(s instanceof Qi||s instanceof As&&s.flags&4)&&Math.abs(this.length-s.length)<10?(s instanceof As?s=new Qi(s.length,this.height):s.height=this.height,this.outdated||(s.outdated=!1),s):si.of(r)}updateHeight(e,n=0,r=!1,s){return s&&s.from<=n&&s.more?this.setHeight(s.heights[s.index++]):(r||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class As extends si{constructor(e){super(e,0)}heightMetrics(e,n){let r=e.doc.lineAt(n).number,s=e.doc.lineAt(n+this.length).number,i=s-r+1,a,l=0;if(e.lineWrapping){let c=Math.min(this.height,e.lineHeight*i);a=c/i,this.length>i+1&&(l=(this.height-c)/(this.length-i-1))}else a=this.height/i;return{firstLine:r,lastLine:s,perLine:a,perChar:l}}blockAt(e,n,r,s){let{firstLine:i,lastLine:a,perLine:l,perChar:c}=this.heightMetrics(n,s);if(n.lineWrapping){let d=s+(e<n.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-r)/this.height))*this.length)),h=n.doc.lineAt(d),m=l+h.length*c,g=Math.max(r,e-m/2);return new Oo(h.from,h.length,g,m,0)}else{let d=Math.max(0,Math.min(a-i,Math.floor((e-r)/l))),{from:h,length:m}=n.doc.line(i+d);return new Oo(h,m,r+l*d,l,0)}}lineAt(e,n,r,s,i){if(n==yr.ByHeight)return this.blockAt(e,r,s,i);if(n==yr.ByPosNoHeight){let{from:x,to:y}=r.doc.lineAt(e);return new Oo(x,y-x,0,0,0)}let{firstLine:a,perLine:l,perChar:c}=this.heightMetrics(r,i),d=r.doc.lineAt(e),h=l+d.length*c,m=d.number-a,g=s+l*m+c*(d.from-i-m);return new Oo(d.from,d.length,Math.max(s,Math.min(g,s+this.height-h)),h,0)}forEachLine(e,n,r,s,i,a){e=Math.max(e,i),n=Math.min(n,i+this.length);let{firstLine:l,perLine:c,perChar:d}=this.heightMetrics(r,i);for(let h=e,m=s;h<=n;){let g=r.doc.lineAt(h);if(h==e){let y=g.number-l;m+=c*y+d*(e-i-y)}let x=c+d*g.length;a(new Oo(g.from,g.length,m,x,0)),m+=x,h=g.to+1}}replace(e,n,r){let s=this.length-n;if(s>0){let i=r[r.length-1];i instanceof As?r[r.length-1]=new As(i.length+s):r.push(null,new As(s-1))}if(e>0){let i=r[0];i instanceof As?r[0]=new As(e+i.length):r.unshift(new As(e-1),null)}return si.of(r)}decomposeLeft(e,n){n.push(new As(e-1),null)}decomposeRight(e,n){n.push(null,new As(this.length-e-1))}updateHeight(e,n=0,r=!1,s){let i=n+this.length;if(s&&s.from<=n+this.length&&s.more){let a=[],l=Math.max(n,s.from),c=-1;for(s.from>n&&a.push(new As(s.from-n-1).updateHeight(e,n));l<=i&&s.more;){let h=e.doc.lineAt(l).length;a.length&&a.push(null);let m=s.heights[s.index++];c==-1?c=m:Math.abs(m-c)>=pv&&(c=-2);let g=new Qi(h,m);g.outdated=!1,a.push(g),l+=h+1}l<=i&&a.push(null,new As(i-l).updateHeight(e,l));let d=si.of(a);return(c<0||Math.abs(d.height-this.height)>=pv||Math.abs(c-this.heightMetrics(e,n).perLine)>=pv)&&(nf=!0),Zv(this,d)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class cle extends si{constructor(e,n,r){super(e.length+n+r.length,e.height+r.height,n|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,n,r,s){let i=r+this.left.height;return e<i?this.left.blockAt(e,n,r,s):this.right.blockAt(e,n,i,s+this.left.length+this.break)}lineAt(e,n,r,s,i){let a=s+this.left.height,l=i+this.left.length+this.break,c=n==yr.ByHeight?e<a:e<l,d=c?this.left.lineAt(e,n,r,s,i):this.right.lineAt(e,n,r,a,l);if(this.break||(c?d.to<l:d.from>l))return d;let h=n==yr.ByPosNoHeight?yr.ByPosNoHeight:yr.ByPos;return c?d.join(this.right.lineAt(l,h,r,a,l)):this.left.lineAt(l,h,r,s,i).join(d)}forEachLine(e,n,r,s,i,a){let l=s+this.left.height,c=i+this.left.length+this.break;if(this.break)e<c&&this.left.forEachLine(e,n,r,s,i,a),n>=c&&this.right.forEachLine(e,n,r,l,c,a);else{let d=this.lineAt(c,yr.ByPos,r,s,i);e<d.from&&this.left.forEachLine(e,d.from-1,r,s,i,a),d.to>=e&&d.from<=n&&a(d),n>d.to&&this.right.forEachLine(d.to+1,n,r,l,c,a)}}replace(e,n,r){let s=this.left.length+this.break;if(n<s)return this.balanced(this.left.replace(e,n,r),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-s,n-s,r));let i=[];e>0&&this.decomposeLeft(e,i);let a=i.length;for(let l of r)i.push(l);if(e>0&&XE(i,a-1),n<this.length){let l=i.length;this.decomposeRight(n,i),XE(i,l)}return si.of(i)}decomposeLeft(e,n){let r=this.left.length;if(e<=r)return this.left.decomposeLeft(e,n);n.push(this.left),this.break&&(r++,e>=r&&n.push(null)),e>r&&this.right.decomposeLeft(e-r,n)}decomposeRight(e,n){let r=this.left.length,s=r+this.break;if(e>=s)return this.right.decomposeRight(e-s,n);e<r&&this.left.decomposeRight(e,n),this.break&&e<s&&n.push(null),n.push(this.right)}balanced(e,n){return e.size>2*n.size||n.size>2*e.size?si.of(this.break?[e,null,n]:[e,n]):(this.left=Zv(this.left,e),this.right=Zv(this.right,n),this.setHeight(e.height+n.height),this.outdated=e.outdated||n.outdated,this.size=e.size+n.size,this.length=e.length+this.break+n.length,this)}updateHeight(e,n=0,r=!1,s){let{left:i,right:a}=this,l=n+i.length+this.break,c=null;return s&&s.from<=n+i.length&&s.more?c=i=i.updateHeight(e,n,r,s):i.updateHeight(e,n,r),s&&s.from<=l+a.length&&s.more?c=a=a.updateHeight(e,l,r,s):a.updateHeight(e,l,r),c?this.balanced(i,a):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function XE(t,e){let n,r;t[e]==null&&(n=t[e-1])instanceof As&&(r=t[e+1])instanceof As&&t.splice(e-1,3,new As(n.length+1+r.length))}const ule=5;class p6{constructor(e,n){this.pos=e,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,n){if(this.lineStart>-1){let r=Math.min(n,this.lineEnd),s=this.nodes[this.nodes.length-1];s instanceof Qi?s.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new Qi(r-this.pos,-1)),this.writtenTo=r,n>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,r){if(e<n||r.heightRelevant){let s=r.widget?r.widget.estimatedHeight:0,i=r.widget?r.widget.lineBreaks:0;s<0&&(s=this.oracle.lineHeight);let a=n-e;r.block?this.addBlock(new Sq(a,s,r)):(a||i||s>=ule)&&this.addLineDeco(s,i,a)}else n>e&&this.span(e,n);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=n,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new Qi(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,n){let r=new As(n-e);return this.oracle.doc.lineAt(e).to==n&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Qi)return e;let n=new Qi(0,-1);return this.nodes.push(n),n}addBlock(e){this.enterLine();let n=e.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,n&&n.endSide>0&&(this.covering=e)}addLineDeco(e,n,r){let s=this.ensureLine();s.length+=r,s.collapsed+=r,s.widgetHeight=Math.max(s.widgetHeight,e),s.breaks+=n,this.writtenTo=this.pos=this.pos+r}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof Qi)&&!this.isCovered?this.nodes.push(new Qi(0,-1)):(this.writtenTo<this.pos||n==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let r=e;for(let s of this.nodes)s instanceof Qi&&s.updateHeight(this.oracle,r),r+=s?s.length:1;return this.nodes}static build(e,n,r,s){let i=new p6(r,e);return Bn.spans(n,r,s,i,0),i.finish(r)}}function dle(t,e,n){let r=new hle;return Bn.compare(t,e,n,r,0),r.changes}class hle{constructor(){this.changes=[]}compareRange(){}comparePoint(e,n,r,s){(e<n||r&&r.heightRelevant||s&&s.heightRelevant)&&mv(e,n,this.changes,5)}}function fle(t,e){let n=t.getBoundingClientRect(),r=t.ownerDocument,s=r.defaultView||window,i=Math.max(0,n.left),a=Math.min(s.innerWidth,n.right),l=Math.max(0,n.top),c=Math.min(s.innerHeight,n.bottom);for(let d=t.parentNode;d&&d!=r.body;)if(d.nodeType==1){let h=d,m=window.getComputedStyle(h);if((h.scrollHeight>h.clientHeight||h.scrollWidth>h.clientWidth)&&m.overflow!="visible"){let g=h.getBoundingClientRect();i=Math.max(i,g.left),a=Math.min(a,g.right),l=Math.max(l,g.top),c=Math.min(d==t.parentNode?s.innerHeight:c,g.bottom)}d=m.position=="absolute"||m.position=="fixed"?h.offsetParent:h.parentNode}else if(d.nodeType==11)d=d.host;else break;return{left:i-n.left,right:Math.max(i,a)-n.left,top:l-(n.top+e),bottom:Math.max(l,c)-(n.top+e)}}function mle(t){let e=t.getBoundingClientRect(),n=t.ownerDocument.defaultView||window;return e.left<n.innerWidth&&e.right>0&&e.top<n.innerHeight&&e.bottom>0}function ple(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class H4{constructor(e,n,r,s){this.from=e,this.to=n,this.size=r,this.displaySize=s}static same(e,n){if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++){let s=e[r],i=n[r];if(s.from!=i.from||s.to!=i.to||s.size!=i.size)return!1}return!0}draw(e,n){return Ot.replace({widget:new gle(this.displaySize*(n?e.scaleY:e.scaleX),n)}).range(this.from,this.to)}}class gle extends Uo{constructor(e,n){super(),this.size=e,this.vertical=n}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class YE{constructor(e){this.state=e,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=KE,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=br.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let n=e.facet(h6).some(r=>typeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new ole(n),this.stateDeco=e.facet(W0).filter(r=>typeof r!="function"),this.heightMap=si.empty().applyChanges(this.stateDeco,An.empty,this.heightOracle.setDoc(e.doc),[new Ta(0,0,0,e.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Ot.set(this.lineGaps.map(r=>r.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let r=0;r<=1;r++){let s=r?n.head:n.anchor;if(!e.some(({from:i,to:a})=>s>=i&&s<=a)){let{from:i,to:a}=this.lineBlockAt(s);e.push(new u1(i,a))}}return this.viewports=e.sort((r,s)=>r.from-s.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?KE:new g6(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(u0(e,this.scaler))})}update(e,n=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=this.state.facet(W0).filter(h=>typeof h!="function");let s=e.changedRanges,i=Ta.extendWithRanges(s,dle(r,this.stateDeco,e?e.changes:us.empty(this.state.doc.length))),a=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);GE(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),i),(this.heightMap.height!=a||nf)&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=a);let c=i.length?this.mapViewport(this.viewport,e.changes):this.viewport;(n&&(n.range.head<c.from||n.range.head>c.to)||!this.viewportIsAppropriate(c))&&(c=this.getViewport(0,n));let d=c.from!=this.viewport.from||c.to!=this.viewport.to;this.viewport=c,e.flags|=this.updateForViewport(),(d||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(tq)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let n=e.contentDOM,r=window.getComputedStyle(n),s=this.heightOracle,i=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?br.RTL:br.LTR;let a=this.heightOracle.mustRefreshForWrapping(i),l=n.getBoundingClientRect(),c=a||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let d=0,h=0;if(l.width&&l.height){let{scaleX:T,scaleY:E}=_F(n,l);(T>.005&&Math.abs(this.scaleX-T)>.005||E>.005&&Math.abs(this.scaleY-E)>.005)&&(this.scaleX=T,this.scaleY=E,d|=16,a=c=!0)}let m=(parseInt(r.paddingTop)||0)*this.scaleY,g=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=m||this.paddingBottom!=g)&&(this.paddingTop=m,this.paddingBottom=g,d|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(s.lineWrapping&&(c=!0),this.editorWidth=e.scrollDOM.clientWidth,d|=16);let x=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=x&&(this.scrollAnchorHeight=-1,this.scrollTop=x),this.scrolledToBottom=RF(e.scrollDOM);let y=(this.printing?ple:fle)(n,this.paddingTop),w=y.top-this.pixelViewport.top,S=y.bottom-this.pixelViewport.bottom;this.pixelViewport=y;let k=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(k!=this.inView&&(this.inView=k,k&&(c=!0)),!this.inView&&!this.scrollTarget&&!mle(e.dom))return 0;let j=l.width;if((this.contentDOMWidth!=j||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,d|=16),c){let T=e.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(T)&&(a=!0),a||s.lineWrapping&&Math.abs(j-this.contentDOMWidth)>s.charWidth){let{lineHeight:E,charWidth:_,textHeight:A}=e.docView.measureTextSize();a=E>0&&s.refresh(i,E,_,A,Math.max(5,j/_),T),a&&(e.docView.minWidth=0,d|=16)}w>0&&S>0?h=Math.max(w,S):w<0&&S<0&&(h=Math.min(w,S)),GE();for(let E of this.viewports){let _=E.from==this.viewport.from?T:e.docView.measureVisibleLineHeights(E);this.heightMap=(a?si.empty().applyChanges(this.stateDeco,An.empty,this.heightOracle,[new Ta(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(s,0,a,new lle(E.from,_))}nf&&(d|=2)}let N=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return N&&(d&2&&(d|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),d|=this.updateForViewport()),(d&2||N)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,e)),d|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),d}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,n){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),s=this.heightMap,i=this.heightOracle,{visibleTop:a,visibleBottom:l}=this,c=new u1(s.lineAt(a-r*1e3,yr.ByHeight,i,0,0).from,s.lineAt(l+(1-r)*1e3,yr.ByHeight,i,0,0).to);if(n){let{head:d}=n.range;if(d<c.from||d>c.to){let h=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),m=s.lineAt(d,yr.ByPos,i,0,0),g;n.y=="center"?g=(m.top+m.bottom)/2-h/2:n.y=="start"||n.y=="nearest"&&d<c.from?g=m.top:g=m.bottom-h,c=new u1(s.lineAt(g-1e3/2,yr.ByHeight,i,0,0).from,s.lineAt(g+h+1e3/2,yr.ByHeight,i,0,0).to)}}return c}mapViewport(e,n){let r=n.mapPos(e.from,-1),s=n.mapPos(e.to,1);return new u1(this.heightMap.lineAt(r,yr.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(s,yr.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:n},r=0){if(!this.inView)return!0;let{top:s}=this.heightMap.lineAt(e,yr.ByPos,this.heightOracle,0,0),{bottom:i}=this.heightMap.lineAt(n,yr.ByPos,this.heightOracle,0,0),{visibleTop:a,visibleBottom:l}=this;return(e==0||s<=a-Math.max(10,Math.min(-r,250)))&&(n==this.state.doc.length||i>=l+Math.max(10,Math.min(r,250)))&&s>a-2*1e3&&i<l+2*1e3}mapLineGaps(e,n){if(!e.length||n.empty)return e;let r=[];for(let s of e)n.touchesRange(s.from,s.to)||r.push(new H4(n.mapPos(s.from),n.mapPos(s.to),s.size,s.displaySize));return r}ensureLineGaps(e,n){let r=this.heightOracle.lineWrapping,s=r?1e4:2e3,i=s>>1,a=s<<1;if(this.defaultTextDirection!=br.LTR&&!r)return[];let l=[],c=(h,m,g,x)=>{if(m-h<i)return;let y=this.state.selection.main,w=[y.from];y.empty||w.push(y.to);for(let k of w)if(k>h&&k<m){c(h,k-10,g,x),c(k+10,m,g,x);return}let S=vle(e,k=>k.from>=g.from&&k.to<=g.to&&Math.abs(k.from-h)<i&&Math.abs(k.to-m)<i&&!w.some(j=>k.from<j&&k.to>j));if(!S){if(m<g.to&&n&&r&&n.visibleRanges.some(N=>N.from<=m&&N.to>=m)){let N=n.moveToLineBoundary(Me.cursor(m),!1,!0).head;N>h&&(m=N)}let k=this.gapSize(g,h,m,x),j=r||k<2e6?k:2e6;S=new H4(h,m,k,j)}l.push(S)},d=h=>{if(h.length<a||h.type!=ri.Text)return;let m=xle(h.from,h.to,this.stateDeco);if(m.total<a)return;let g=this.scrollTarget?this.scrollTarget.range.head:null,x,y;if(r){let w=s/this.heightOracle.lineLength*this.heightOracle.lineHeight,S,k;if(g!=null){let j=h1(m,g),N=((this.visibleBottom-this.visibleTop)/2+w)/h.height;S=j-N,k=j+N}else S=(this.visibleTop-h.top-w)/h.height,k=(this.visibleBottom-h.top+w)/h.height;x=d1(m,S),y=d1(m,k)}else{let w=m.total*this.heightOracle.charWidth,S=s*this.heightOracle.charWidth,k=0;if(w>2e6)for(let _ of e)_.from>=h.from&&_.from<h.to&&_.size!=_.displaySize&&_.from*this.heightOracle.charWidth+k<this.pixelViewport.left&&(k=_.size-_.displaySize);let j=this.pixelViewport.left+k,N=this.pixelViewport.right+k,T,E;if(g!=null){let _=h1(m,g),A=((N-j)/2+S)/w;T=_-A,E=_+A}else T=(j-S)/w,E=(N+S)/w;x=d1(m,T),y=d1(m,E)}x>h.from&&c(h.from,x,h,m),y<h.to&&c(y,h.to,h,m)};for(let h of this.viewportLines)Array.isArray(h.type)?h.type.forEach(d):d(h);return l}gapSize(e,n,r,s){let i=h1(s,r)-h1(s,n);return this.heightOracle.lineWrapping?e.height*i:s.total*this.heightOracle.charWidth*i}updateLineGaps(e){H4.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=Ot.set(e.map(n=>n.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let r=[];Bn.spans(n,this.viewport.from,this.viewport.to,{span(i,a){r.push({from:i,to:a})},point(){}},20);let s=0;if(r.length!=this.visibleRanges.length)s=12;else for(let i=0;i<r.length&&!(s&8);i++){let a=this.visibleRanges[i],l=r[i];(a.from!=l.from||a.to!=l.to)&&(s|=4,e&&e.mapPos(a.from,-1)==l.from&&e.mapPos(a.to,1)==l.to||(s|=8))}return this.visibleRanges=r,s}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||u0(this.heightMap.lineAt(e,yr.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=e&&n.bottom>=e)||u0(this.heightMap.lineAt(this.scaler.fromDOM(e),yr.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let n=this.lineBlockAtHeight(e+8);return n.from>=this.viewport.from||this.viewportLines[0].top-e>200?n:this.viewportLines[0]}elementAtHeight(e){return u0(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}let u1=class{constructor(e,n){this.from=e,this.to=n}};function xle(t,e,n){let r=[],s=t,i=0;return Bn.spans(n,t,e,{span(){},point(a,l){a>s&&(r.push({from:s,to:a}),i+=a-s),s=l}},20),s<e&&(r.push({from:s,to:e}),i+=e-s),{total:i,ranges:r}}function d1({total:t,ranges:e},n){if(n<=0)return e[0].from;if(n>=1)return e[e.length-1].to;let r=Math.floor(t*n);for(let s=0;;s++){let{from:i,to:a}=e[s],l=a-i;if(r<=l)return i+r;r-=l}}function h1(t,e){let n=0;for(let{from:r,to:s}of t.ranges){if(e<=s){n+=e-r;break}n+=s-r}return n/t.total}function vle(t,e){for(let n of t)if(e(n))return n}const KE={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};class g6{constructor(e,n,r){let s=0,i=0,a=0;this.viewports=r.map(({from:l,to:c})=>{let d=n.lineAt(l,yr.ByPos,e,0,0).top,h=n.lineAt(c,yr.ByPos,e,0,0).bottom;return s+=h-d,{from:l,to:c,top:d,bottom:h,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(n.height-s);for(let l of this.viewports)l.domTop=a+(l.top-i)*this.scale,a=l.domBottom=l.domTop+(l.bottom-l.top),i=l.bottom}toDOM(e){for(let n=0,r=0,s=0;;n++){let i=n<this.viewports.length?this.viewports[n]:null;if(!i||e<i.top)return s+(e-r)*this.scale;if(e<=i.bottom)return i.domTop+(e-i.top);r=i.bottom,s=i.domBottom}}fromDOM(e){for(let n=0,r=0,s=0;;n++){let i=n<this.viewports.length?this.viewports[n]:null;if(!i||e<i.domTop)return r+(e-s)/this.scale;if(e<=i.domBottom)return i.top+(e-i.domTop);r=i.bottom,s=i.domBottom}}eq(e){return e instanceof g6?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((n,r)=>n.from==e.viewports[r].from&&n.to==e.viewports[r].to):!1}}function u0(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),r=e.toDOM(t.bottom);return new Oo(t.from,t.length,n,r-n,Array.isArray(t._content)?t._content.map(s=>u0(s,e)):t._content)}const f1=st.define({combine:t=>t.join(" ")}),Kk=st.define({combine:t=>t.indexOf(!0)>-1}),Zk=Yc.newName(),kq=Yc.newName(),Oq=Yc.newName(),jq={"&light":"."+kq,"&dark":"."+Oq};function Jk(t,e,n){return new Yc(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,s=>{if(s=="&")return t;if(!n||!n[s])throw new RangeError(`Unsupported selector: ${s}`);return n[s]}):t+" "+r}})}const yle=Jk("."+Zk,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},jq),ble={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Q4=et.ie&&et.ie_version<=11;class wle{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new roe,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(n=>{for(let r of n)this.queue.push(r);(et.ie&&et.ie_version<=11||et.ios&&e.composing)&&n.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&et.android&&e.constructor.EDIT_CONTEXT!==!1&&!(et.chrome&&et.chrome_version<126)&&(this.editContext=new kle(e),e.state.facet(Ml)&&(e.contentDOM.editContext=this.editContext.editContext)),Q4&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(n=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((n,r)=>n!=e[r]))){this.gapIntersection.disconnect();for(let n of e)this.gapIntersection.observe(n);this.gaps=e}}onSelectionChange(e){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,s=this.selectionRange;if(r.state.facet(Ml)?r.root.activeElement!=this.dom:!fv(this.dom,s))return;let i=s.anchorNode&&r.docView.nearest(s.anchorNode);if(i&&i.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(et.ie&&et.ie_version<=11||et.android&&et.chrome)&&!r.state.selection.main.empty&&s.focusNode&&j0(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=U0(e.root);if(!n)return!1;let r=et.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&Sle(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let s=fv(this.dom,r);return s&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&ioe(this.dom,r)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(r),s&&(this.selectionChanged=!0),!0)}setSelectionRange(e,n){this.selectionRange.set(e.node,e.offset,n.node,n.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,n=null;for(let r=this.dom;r;)if(r.nodeType==1)!n&&e<this.scrollTargets.length&&this.scrollTargets[e]==r?e++:n||(n=this.scrollTargets.slice(0,e)),n&&n.push(r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;if(e<this.scrollTargets.length&&!n&&(n=this.scrollTargets.slice(0,e)),n){for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);for(let r of this.scrollTargets=n)r.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,ble),Q4&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Q4&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,n){var r;if(!this.delayedAndroidKey){let s=()=>{let i=this.delayedAndroidKey;i&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=i.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&i.force&&zh(this.dom,i.key,i.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(s)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:n,force:this.lastChange<Date.now()-50||!!(!((r=this.delayedAndroidKey)===null||r===void 0)&&r.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let n=-1,r=-1,s=!1;for(let i of e){let a=this.readMutation(i);a&&(a.typeOver&&(s=!0),n==-1?{from:n,to:r}=a:(n=Math.min(a.from,n),r=Math.max(a.to,r)))}return{from:n,to:r,typeOver:s}}readChange(){let{from:e,to:n,typeOver:r}=this.processRecords(),s=this.selectionChanged&&fv(this.dom,this.selectionRange);if(e<0&&!s)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let i=new Foe(this.view,e,n,r);return this.view.docView.domChanged={newSel:i.newSel?i.newSel.main:null},i}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let r=this.view.state,s=hq(this.view,n);return this.view.state==r&&(n.domChanged||n.newSel&&!n.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),s}readMutation(e){let n=this.view.docView.nearest(e.target);if(!n||n.ignoreMutation(e))return null;if(n.markDirty(e.type=="attributes"),e.type=="attributes"&&(n.flags|=4),e.type=="childList"){let r=ZE(n,e.previousSibling||e.target.previousSibling,-1),s=ZE(n,e.nextSibling||e.target.nextSibling,1);return{from:r?n.posAfter(r):n.posAtStart,to:s?n.posBefore(s):n.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(Ml)!=e.state.facet(Ml)&&(e.view.contentDOM.editContext=e.state.facet(Ml)?this.editContext.editContext:null))}destroy(){var e,n,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let s of this.scrollTargets)s.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function ZE(t,e,n){for(;e;){let r=sr.get(e);if(r&&r.parent==t)return r;let s=e.parentNode;e=s!=t.dom?s:n>0?e.nextSibling:e.previousSibling}return null}function JE(t,e){let n=e.startContainer,r=e.startOffset,s=e.endContainer,i=e.endOffset,a=t.docView.domAtPos(t.state.selection.main.anchor);return j0(a.node,a.offset,s,i)&&([n,r,s,i]=[s,i,n,r]),{anchorNode:n,anchorOffset:r,focusNode:s,focusOffset:i}}function Sle(t,e){if(e.getComposedRanges){let s=e.getComposedRanges(t.root)[0];if(s)return JE(t,s)}let n=null;function r(s){s.preventDefault(),s.stopImmediatePropagation(),n=s.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",r,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",r,!0),n?JE(t,n):null}class kle{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let n=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=r=>{let s=e.state.selection.main,{anchor:i,head:a}=s,l=this.toEditorPos(r.updateRangeStart),c=this.toEditorPos(r.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:l,drifted:!1});let d=c-l>r.text.length;l==this.from&&i<this.from?l=i:c==this.to&&i>this.to&&(c=i);let h=fq(e.state.sliceDoc(l,c),r.text,(d?s.from:s.to)-l,d?"end":null);if(!h){let g=Me.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));g.main.eq(s)||e.dispatch({selection:g,userEvent:"select"});return}let m={from:h.from+l,to:h.toA+l,insert:An.of(r.text.slice(h.from,h.toB).split(`
|
||
`))};if((et.mac||et.android)&&m.from==a-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(m={from:l,to:c,insert:An.of([r.text.replace("."," ")])}),this.pendingContextChange=m,!e.state.readOnly){let g=this.to-this.from+(m.to-m.from+m.insert.length);m6(e,m,Me.single(this.toEditorPos(r.selectionStart,g),this.toEditorPos(r.selectionEnd,g)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),m.from<m.to&&!m.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,r.updateRangeStart-1),Math.min(n.text.length,r.updateRangeStart+1)))&&this.handlers.compositionend(r)},this.handlers.characterboundsupdate=r=>{let s=[],i=null;for(let a=this.toEditorPos(r.rangeStart),l=this.toEditorPos(r.rangeEnd);a<l;a++){let c=e.coordsForChar(a);i=c&&new DOMRect(c.left,c.top,c.right-c.left,c.bottom-c.top)||i||new DOMRect,s.push(i)}n.updateCharacterBounds(r.rangeStart,s)},this.handlers.textformatupdate=r=>{let s=[];for(let i of r.getTextFormats()){let a=i.underlineStyle,l=i.underlineThickness;if(!/none/i.test(a)&&!/none/i.test(l)){let c=this.toEditorPos(i.rangeStart),d=this.toEditorPos(i.rangeEnd);if(c<d){let h=`text-decoration: underline ${/^[a-z]/.test(a)?a+" ":a=="Dashed"?"dashed ":a=="Squiggle"?"wavy ":""}${/thin/i.test(l)?1:2}px`;s.push(Ot.mark({attributes:{style:h}}).range(c,d))}}}e.dispatch({effects:rq.of(Ot.set(s))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:r}=this.composing;this.composing=null,r&&this.reset(e.state)}};for(let r in this.handlers)n.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let s=U0(r.root);s&&s.rangeCount&&this.editContext.updateSelectionBounds(s.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,r=!1,s=this.pendingContextChange;return e.changes.iterChanges((i,a,l,c,d)=>{if(r)return;let h=d.length-(a-i);if(s&&a>=s.to)if(s.from==i&&s.to==a&&s.insert.eq(d)){s=this.pendingContextChange=null,n+=h,this.to+=h;return}else s=null,this.revertPending(e.state);if(i+=n,a+=n,a<=this.from)this.from+=h,this.to+=h;else if(i<this.to){if(i<this.from||a>this.to||this.to-this.from+d.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(i),this.toContextPos(a),d.toString()),this.to+=h}n+=h}),s&&!r&&this.revertPending(e.state),!r}update(e){let n=this.pendingContextChange,r=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(r.from,r.to)&&e.transactions.some(s=>!s.isUserEvent("input.type")&&s.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||n)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:n}=e.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(e.doc.length,n+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),e.doc.sliceString(n.from,n.to))}setSelection(e){let{main:n}=e.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),s=this.toContextPos(n.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=s)&&this.editContext.updateSelection(r,s)}rangeIsValid(e){let{head:n}=e.selection.main;return!(this.from>0&&n-this.from<500||this.to<e.doc.length&&this.to-n<500||this.to-this.from>1e4*3)}toEditorPos(e,n=this.to-this.from){e=Math.min(e,n);let r=this.composing;return r&&r.drifted?r.editorBase+(e-r.contextBase):e+this.from}toContextPos(e){let n=this.composing;return n&&n.drifted?n.contextBase+(e-n.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class Ze{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:r}=e;this.dispatchTransactions=e.dispatchTransactions||r&&(s=>s.forEach(i=>r(i,this)))||(s=>this.update(s)),this.dispatch=this.dispatch.bind(this),this._root=e.root||soe(e.parent)||document,this.viewState=new YE(e.state||Nn.create(e)),e.scrollTo&&e.scrollTo.is(o1)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Th).map(s=>new F4(s));for(let s of this.plugins)s.update(this);this.observer=new wle(this),this.inputState=new Qoe(this),this.inputState.ensureHandlers(this.plugins),this.docView=new AE(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let n=e.length==1&&e[0]instanceof ss?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(n,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,r=!1,s,i=this.state;for(let g of e){if(g.startState!=i)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");i=g.state}if(this.destroyed){this.viewState.state=i;return}let a=this.hasFocus,l=0,c=null;e.some(g=>g.annotation(yq))?(this.inputState.notifiedFocused=a,l=1):a!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=a,c=bq(i,a),c||(l=1));let d=this.observer.delayedAndroidKey,h=null;if(d?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(i.doc)||!this.state.selection.eq(i.selection))&&(h=null)):this.observer.clear(),i.facet(Nn.phrases)!=this.state.facet(Nn.phrases))return this.setState(i);s=Kv.create(this,i,e),s.flags|=l;let m=this.viewState.scrollTarget;try{this.updateState=2;for(let g of e){if(m&&(m=m.map(g.changes)),g.scrollIntoView){let{main:x}=g.state.selection;m=new Ih(x.empty?x:Me.cursor(x.head,x.head>x.anchor?-1:1))}for(let x of g.effects)x.is(o1)&&(m=x.value.clip(this.state))}this.viewState.update(s,m),this.bidiCache=Jv.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),n=this.docView.update(s),this.state.facet(l0)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(g=>g.isUserEvent("select.pointer")))}finally{this.updateState=0}if(s.startState.facet(f1)!=s.state.facet(f1)&&(this.viewState.mustMeasureContent=!0),(n||r||m||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!s.empty)for(let g of this.state.facet(Wk))try{g(s)}catch(x){bi(this.state,x,"update listener")}(c||h)&&Promise.resolve().then(()=>{c&&this.state==c.startState&&this.dispatch(c),h&&!hq(this,h)&&d.force&&zh(this.contentDOM,d.key,d.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let n=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new YE(e),this.plugins=e.facet(Th).map(r=>new F4(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new AE(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(e){let n=e.startState.facet(Th),r=e.state.facet(Th);if(n!=r){let s=[];for(let i of r){let a=n.indexOf(i);if(a<0)s.push(new F4(i));else{let l=this.plugins[a];l.mustUpdate=e,s.push(l)}}for(let i of this.plugins)i.mustUpdate!=e&&i.destroy(this);this.plugins=s,this.pluginMap.clear()}else for(let s of this.plugins)s.mustUpdate=e;for(let s=0;s<this.plugins.length;s++)this.plugins[s].update(this);n!=r&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let n=e.value;if(n&&n.docViewUpdate)try{n.docViewUpdate(this)}catch(r){bi(this.state,r,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let n=null,r=this.scrollDOM,s=r.scrollTop*this.scaleY,{scrollAnchorPos:i,scrollAnchorHeight:a}=this.viewState;Math.abs(s-this.viewState.scrollTop)>1&&(a=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(a<0)if(RF(r))i=-1,a=this.viewState.heightMap.height;else{let x=this.viewState.scrollAnchorAt(s);i=x.from,a=x.top}this.updateState=1;let c=this.viewState.measure(this);if(!c&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let d=[];c&4||([this.measureRequests,d]=[d,this.measureRequests]);let h=d.map(x=>{try{return x.read(this)}catch(y){return bi(this.state,y),e_}}),m=Kv.create(this,this.state,[]),g=!1;m.flags|=c,n?n.flags|=c:n=m,this.updateState=2,m.empty||(this.updatePlugins(m),this.inputState.update(m),this.updateAttrs(),g=this.docView.update(m),g&&this.docViewUpdate());for(let x=0;x<d.length;x++)if(h[x]!=e_)try{let y=d[x];y.write&&y.write(h[x],this)}catch(y){bi(this.state,y)}if(g&&this.docView.updateSelection(!0),!m.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,a=-1;continue}else{let y=(i<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(i).top)-a;if(y>1||y<-1){s=s+y,r.scrollTop=s/this.scaleY,a=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let l of this.state.facet(Wk))l(n)}get themeClasses(){return Zk+" "+(this.state.facet(Kk)?Oq:kq)+" "+this.state.facet(f1)}updateAttrs(){let e=t_(this,sq,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Ml)?"true":"false",class:"cm-content",style:`${et.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),t_(this,h6,n);let r=this.observer.ignore(()=>{let s=$k(this.contentDOM,this.contentAttrs,n),i=$k(this.dom,this.editorAttrs,e);return s||i});return this.editorAttrs=e,this.contentAttrs=n,r}showAnnouncements(e){let n=!0;for(let r of e)for(let s of r.effects)if(s.is(Ze.announce)){n&&(this.announceDOM.textContent=""),n=!1;let i=this.announceDOM.appendChild(document.createElement("div"));i.textContent=s.value}}mountStyles(){this.styleModules=this.state.facet(l0);let e=this.state.facet(Ze.cspNonce);Yc.mount(this.root,this.styleModules.concat(yle).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let n=0;n<this.measureRequests.length;n++)if(this.measureRequests[n].key===e.key){this.measureRequests[n]=e;return}}this.measureRequests.push(e)}}plugin(e){let n=this.pluginMap.get(e);return(n===void 0||n&&n.plugin!=e)&&this.pluginMap.set(e,n=this.plugins.find(r=>r.plugin==e)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,n,r){return $4(this,e,zE(this,e,n,r))}moveByGroup(e,n){return $4(this,e,zE(this,e,n,r=>Poe(this,e.head,r)))}visualLineSide(e,n){let r=this.bidiSpans(e),s=this.textDirectionAt(e.from),i=r[n?r.length-1:0];return Me.cursor(i.side(n,s)+e.from,i.forward(!n,s)?1:-1)}moveToLineBoundary(e,n,r=!0){return Doe(this,e,n,r)}moveVertically(e,n,r){return $4(this,e,zoe(this,e,n,r))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,n=0){return this.docView.posFromDOM(e,n)}posAtCoords(e,n=!0){return this.readMeasured(),cq(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let r=this.docView.coordsAt(e,n);if(!r||r.left==r.right)return r;let s=this.state.doc.lineAt(e),i=this.bidiSpans(s),a=i[Hc.find(i,e-s.from,-1,n)];return Up(r,a.dir==br.LTR==n>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(eq)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>Ole)return UF(e.length);let n=this.textDirectionAt(e.from),r;for(let i of this.bidiCache)if(i.from==e.from&&i.dir==n&&(i.fresh||VF(i.isolates,r=_E(this,e))))return i.order;r||(r=_E(this,e));let s=voe(e.text,n,r);return this.bidiCache.push(new Jv(e.from,e.to,n,r,!0,s)),s}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||et.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{AF(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,n={}){return o1.of(new Ih(typeof e=="number"?Me.cursor(e):e,n.y,n.x,n.yMargin,n.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return o1.of(new Ih(Me.cursor(r.from),"start","start",r.top-e,n,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return Yr.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Yr.define(()=>({}),{eventObservers:e})}static theme(e,n){let r=Yc.newName(),s=[f1.of(r),l0.of(Jk(`.${r}`,e))];return n&&n.dark&&s.push(Kk.of(!0)),s}static baseTheme(e){return uu.lowest(l0.of(Jk("."+Zk,e,jq)))}static findFromDOM(e){var n;let r=e.querySelector(".cm-content"),s=r&&sr.get(r)||sr.get(e);return((n=s?.rootView)===null||n===void 0?void 0:n.view)||null}}Ze.styleModule=l0;Ze.inputHandler=ZF;Ze.clipboardInputFilter=u6;Ze.clipboardOutputFilter=d6;Ze.scrollHandler=nq;Ze.focusChangeEffect=JF;Ze.perLineTextDirection=eq;Ze.exceptionSink=KF;Ze.updateListener=Wk;Ze.editable=Ml;Ze.mouseSelectionStyle=YF;Ze.dragMovesSelection=XF;Ze.clickAddsSelectionRange=GF;Ze.decorations=W0;Ze.outerDecorations=iq;Ze.atomicRanges=Xp;Ze.bidiIsolatedRanges=aq;Ze.scrollMargins=oq;Ze.darkTheme=Kk;Ze.cspNonce=st.define({combine:t=>t.length?t[0]:""});Ze.contentAttributes=h6;Ze.editorAttributes=sq;Ze.lineWrapping=Ze.contentAttributes.of({class:"cm-lineWrapping"});Ze.announce=Qt.define();const Ole=4096,e_={};class Jv{constructor(e,n,r,s,i,a){this.from=e,this.to=n,this.dir=r,this.isolates=s,this.fresh=i,this.order=a}static update(e,n){if(n.empty&&!e.some(i=>i.fresh))return e;let r=[],s=e.length?e[e.length-1].dir:br.LTR;for(let i=Math.max(0,e.length-10);i<e.length;i++){let a=e[i];a.dir==s&&!n.touchesRange(a.from,a.to)&&r.push(new Jv(n.mapPos(a.from,1),n.mapPos(a.to,-1),a.dir,a.isolates,!1,a.order))}return r}}function t_(t,e,n){for(let r=t.state.facet(e),s=r.length-1;s>=0;s--){let i=r[s],a=typeof i=="function"?i(t):i;a&&qk(a,n)}return n}const jle=et.mac?"mac":et.windows?"win":et.linux?"linux":"key";function Nle(t,e){const n=t.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let s,i,a,l;for(let c=0;c<n.length-1;++c){const d=n[c];if(/^(cmd|meta|m)$/i.test(d))l=!0;else if(/^a(lt)?$/i.test(d))s=!0;else if(/^(c|ctrl|control)$/i.test(d))i=!0;else if(/^s(hift)?$/i.test(d))a=!0;else if(/^mod$/i.test(d))e=="mac"?l=!0:i=!0;else throw new Error("Unrecognized modifier name: "+d)}return s&&(r="Alt-"+r),i&&(r="Ctrl-"+r),l&&(r="Meta-"+r),a&&(r="Shift-"+r),r}function m1(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n!==!1&&e.shiftKey&&(t="Shift-"+t),t}const Cle=uu.default(Ze.domEventHandlers({keydown(t,e){return Cq(Nq(e.state),t,e,"editor")}})),Yp=st.define({enables:Cle}),n_=new WeakMap;function Nq(t){let e=t.facet(Yp),n=n_.get(e);return n||n_.set(e,n=_le(e.reduce((r,s)=>r.concat(s),[]))),n}function Tle(t,e,n){return Cq(Nq(t.state),e,t,n)}let Bc=null;const Ele=4e3;function _le(t,e=jle){let n=Object.create(null),r=Object.create(null),s=(a,l)=>{let c=r[a];if(c==null)r[a]=l;else if(c!=l)throw new Error("Key binding "+a+" is used both as a regular binding and as a multi-stroke prefix")},i=(a,l,c,d,h)=>{var m,g;let x=n[a]||(n[a]=Object.create(null)),y=l.split(/ (?!$)/).map(k=>Nle(k,e));for(let k=1;k<y.length;k++){let j=y.slice(0,k).join(" ");s(j,!0),x[j]||(x[j]={preventDefault:!0,stopPropagation:!1,run:[N=>{let T=Bc={view:N,prefix:j,scope:a};return setTimeout(()=>{Bc==T&&(Bc=null)},Ele),!0}]})}let w=y.join(" ");s(w,!1);let S=x[w]||(x[w]={preventDefault:!1,stopPropagation:!1,run:((g=(m=x._any)===null||m===void 0?void 0:m.run)===null||g===void 0?void 0:g.slice())||[]});c&&S.run.push(c),d&&(S.preventDefault=!0),h&&(S.stopPropagation=!0)};for(let a of t){let l=a.scope?a.scope.split(" "):["editor"];if(a.any)for(let d of l){let h=n[d]||(n[d]=Object.create(null));h._any||(h._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:m}=a;for(let g in h)h[g].run.push(x=>m(x,eO))}let c=a[e]||a.key;if(c)for(let d of l)i(d,c,a.run,a.preventDefault,a.stopPropagation),a.shift&&i(d,"Shift-"+c,a.shift,a.preventDefault,a.stopPropagation)}return n}let eO=null;function Cq(t,e,n,r){eO=e;let s=Zae(e),i=vi(s,0),a=ko(i)==s.length&&s!=" ",l="",c=!1,d=!1,h=!1;Bc&&Bc.view==n&&Bc.scope==r&&(l=Bc.prefix+" ",pq.indexOf(e.keyCode)<0&&(d=!0,Bc=null));let m=new Set,g=S=>{if(S){for(let k of S.run)if(!m.has(k)&&(m.add(k),k(n)))return S.stopPropagation&&(h=!0),!0;S.preventDefault&&(S.stopPropagation&&(h=!0),d=!0)}return!1},x=t[r],y,w;return x&&(g(x[l+m1(s,e,!a)])?c=!0:a&&(e.altKey||e.metaKey||e.ctrlKey)&&!(et.windows&&e.ctrlKey&&e.altKey)&&!(et.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(y=Kc[e.keyCode])&&y!=s?(g(x[l+m1(y,e,!0)])||e.shiftKey&&(w=V0[e.keyCode])!=s&&w!=y&&g(x[l+m1(w,e,!1)]))&&(c=!0):a&&e.shiftKey&&g(x[l+m1(s,e,!0)])&&(c=!0),!c&&g(x._any)&&(c=!0)),d&&(c=!0),c&&h&&e.stopPropagation(),eO=null,c}class Kp{constructor(e,n,r,s,i){this.className=e,this.left=n,this.top=r,this.width=s,this.height=i}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,n){return n.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,n,r){if(r.empty){let s=e.coordsAtPos(r.head,r.assoc||1);if(!s)return[];let i=Tq(e);return[new Kp(n,s.left-i.left,s.top-i.top,null,s.bottom-s.top)]}else return Ale(e,n,r)}}function Tq(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==br.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function r_(t,e,n,r){let s=t.coordsAtPos(e,n*2);if(!s)return r;let i=t.dom.getBoundingClientRect(),a=(s.top+s.bottom)/2,l=t.posAtCoords({x:i.left+1,y:a}),c=t.posAtCoords({x:i.right-1,y:a});return l==null||c==null?r:{from:Math.max(r.from,Math.min(l,c)),to:Math.min(r.to,Math.max(l,c))}}function Ale(t,e,n){if(n.to<=t.viewport.from||n.from>=t.viewport.to)return[];let r=Math.max(n.from,t.viewport.from),s=Math.min(n.to,t.viewport.to),i=t.textDirection==br.LTR,a=t.contentDOM,l=a.getBoundingClientRect(),c=Tq(t),d=a.querySelector(".cm-line"),h=d&&window.getComputedStyle(d),m=l.left+(h?parseInt(h.paddingLeft)+Math.min(0,parseInt(h.textIndent)):0),g=l.right-(h?parseInt(h.paddingRight):0),x=Xk(t,r,1),y=Xk(t,s,-1),w=x.type==ri.Text?x:null,S=y.type==ri.Text?y:null;if(w&&(t.lineWrapping||x.widgetLineBreaks)&&(w=r_(t,r,1,w)),S&&(t.lineWrapping||y.widgetLineBreaks)&&(S=r_(t,s,-1,S)),w&&S&&w.from==S.from&&w.to==S.to)return j(N(n.from,n.to,w));{let E=w?N(n.from,null,w):T(x,!1),_=S?N(null,n.to,S):T(y,!0),A=[];return(w||x).to<(S||y).from-(w&&S?1:0)||x.widgetLineBreaks>1&&E.bottom+t.defaultLineHeight/2<_.top?A.push(k(m,E.bottom,g,_.top)):E.bottom<_.top&&t.elementAtHeight((E.bottom+_.top)/2).type==ri.Text&&(E.bottom=_.top=(E.bottom+_.top)/2),j(E).concat(A).concat(j(_))}function k(E,_,A,D){return new Kp(e,E-c.left,_-c.top,A-E,D-_)}function j({top:E,bottom:_,horizontal:A}){let D=[];for(let q=0;q<A.length;q+=2)D.push(k(A[q],E,A[q+1],_));return D}function N(E,_,A){let D=1e9,q=-1e9,B=[];function H(I,V,L,$,K){let Y=t.coordsAtPos(I,I==A.to?-2:2),R=t.coordsAtPos(L,L==A.from?2:-2);!Y||!R||(D=Math.min(Y.top,R.top,D),q=Math.max(Y.bottom,R.bottom,q),K==br.LTR?B.push(i&&V?m:Y.left,i&&$?g:R.right):B.push(!i&&$?m:R.left,!i&&V?g:Y.right))}let W=E??A.from,ee=_??A.to;for(let I of t.visibleRanges)if(I.to>W&&I.from<ee)for(let V=Math.max(I.from,W),L=Math.min(I.to,ee);;){let $=t.state.doc.lineAt(V);for(let K of t.bidiSpans($)){let Y=K.from+$.from,R=K.to+$.from;if(Y>=L)break;R>V&&H(Math.max(Y,V),E==null&&Y<=W,Math.min(R,L),_==null&&R>=ee,K.dir)}if(V=$.to+1,V>=L)break}return B.length==0&&H(W,E==null,ee,_==null,t.textDirection),{top:D,bottom:q,horizontal:B}}function T(E,_){let A=l.top+(_?E.top:E.bottom);return{top:A,bottom:A,horizontal:[]}}}function Mle(t,e){return t.constructor==e.constructor&&t.eq(e)}class Rle{constructor(e,n){this.view=e,this.layer=n,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,e)}update(e){e.startState.facet(gv)!=e.state.facet(gv)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let n=0,r=e.facet(gv);for(;n<r.length&&r[n]!=this.layer;)n++;this.dom.style.zIndex=String((this.layer.above?150:-1)-n)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:n}=this.view;(e!=this.scaleX||n!=this.scaleY)&&(this.scaleX=e,this.scaleY=n,this.dom.style.transform=`scale(${1/e}, ${1/n})`)}draw(e){if(e.length!=this.drawn.length||e.some((n,r)=>!Mle(n,this.drawn[r]))){let n=this.dom.firstChild,r=0;for(let s of e)s.update&&n&&s.constructor&&this.drawn[r].constructor&&s.update(n,this.drawn[r])?(n=n.nextSibling,r++):this.dom.insertBefore(s.draw(),n);for(;n;){let s=n.nextSibling;n.remove(),n=s}this.drawn=e,et.safari&&et.safari_version>=26&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const gv=st.define();function Eq(t){return[Yr.define(e=>new Rle(e,t)),gv.of(t)]}const G0=st.define({combine(t){return Vo(t,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,n)=>Math.min(e,n),drawRangeCursor:(e,n)=>e||n})}});function Dle(t={}){return[G0.of(t),Ple,zle,Ile,tq.of(!0)]}function _q(t){return t.startState.facet(G0)!=t.state.facet(G0)}const Ple=Eq({above:!0,markers(t){let{state:e}=t,n=e.facet(G0),r=[];for(let s of e.selection.ranges){let i=s==e.selection.main;if(s.empty||n.drawRangeCursor){let a=i?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=s.empty?s:Me.cursor(s.head,s.head>s.anchor?-1:1);for(let c of Kp.forRange(t,a,l))r.push(c)}}return r},update(t,e){t.transactions.some(r=>r.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=_q(t);return n&&s_(t.state,e),t.docChanged||t.selectionSet||n},mount(t,e){s_(e.state,t)},class:"cm-cursorLayer"});function s_(t,e){e.style.animationDuration=t.facet(G0).cursorBlinkRate+"ms"}const zle=Eq({above:!1,markers(t){return t.state.selection.ranges.map(e=>e.empty?[]:Kp.forRange(t,"cm-selectionBackground",e)).reduce((e,n)=>e.concat(n))},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||_q(t)},class:"cm-selectionLayer"}),Ile=uu.highest(Ze.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),Aq=Qt.define({map(t,e){return t==null?null:e.mapPos(t)}}),d0=Os.define({create(){return null},update(t,e){return t!=null&&(t=e.changes.mapPos(t)),e.effects.reduce((n,r)=>r.is(Aq)?r.value:n,t)}}),Lle=Yr.fromClass(class{constructor(t){this.view=t,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(t){var e;let n=t.state.field(d0);n==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(t.startState.field(d0)!=n||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(d0),n=e!=null&&t.coordsAtPos(e);if(!n)return null;let r=t.scrollDOM.getBoundingClientRect();return{left:n.left-r.left+t.scrollDOM.scrollLeft*t.scaleX,top:n.top-r.top+t.scrollDOM.scrollTop*t.scaleY,height:n.bottom-n.top}}drawCursor(t){if(this.cursor){let{scaleX:e,scaleY:n}=this.view;t?(this.cursor.style.left=t.left/e+"px",this.cursor.style.top=t.top/n+"px",this.cursor.style.height=t.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(t){this.view.state.field(d0)!=t&&this.view.dispatch({effects:Aq.of(t)})}},{eventObservers:{dragover(t){this.setDropPos(this.view.posAtCoords({x:t.clientX,y:t.clientY}))},dragleave(t){(t.target==this.view.contentDOM||!this.view.contentDOM.contains(t.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function Ble(){return[d0,Lle]}function i_(t,e,n,r,s){e.lastIndex=0;for(let i=t.iterRange(n,r),a=n,l;!i.next().done;a+=i.value.length)if(!i.lineBreak)for(;l=e.exec(i.value);)s(a+l.index,l)}function Fle(t,e){let n=t.visibleRanges;if(n.length==1&&n[0].from==t.viewport.from&&n[0].to==t.viewport.to)return n;let r=[];for(let{from:s,to:i}of n)s=Math.max(t.state.doc.lineAt(s).from,s-e),i=Math.min(t.state.doc.lineAt(i).to,i+e),r.length&&r[r.length-1].to>=s?r[r.length-1].to=i:r.push({from:s,to:i});return r}class qle{constructor(e){const{regexp:n,decoration:r,decorate:s,boundary:i,maxLength:a=1e3}=e;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,s)this.addMatch=(l,c,d,h)=>s(h,d,d+l[0].length,l,c);else if(typeof r=="function")this.addMatch=(l,c,d,h)=>{let m=r(l,c,d);m&&h(d,d+l[0].length,m)};else if(r)this.addMatch=(l,c,d,h)=>h(d,d+l[0].length,r);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=i,this.maxLength=a}createDeco(e){let n=new Hl,r=n.add.bind(n);for(let{from:s,to:i}of Fle(e,this.maxLength))i_(e.state.doc,this.regexp,s,i,(a,l)=>this.addMatch(l,e,a,r));return n.finish()}updateDeco(e,n){let r=1e9,s=-1;return e.docChanged&&e.changes.iterChanges((i,a,l,c)=>{c>=e.view.viewport.from&&l<=e.view.viewport.to&&(r=Math.min(l,r),s=Math.max(c,s))}),e.viewportMoved||s-r>1e3?this.createDeco(e.view):s>-1?this.updateRange(e.view,n.map(e.changes),r,s):n}updateRange(e,n,r,s){for(let i of e.visibleRanges){let a=Math.max(i.from,r),l=Math.min(i.to,s);if(l>=a){let c=e.state.doc.lineAt(a),d=c.to<l?e.state.doc.lineAt(l):c,h=Math.max(i.from,c.from),m=Math.min(i.to,d.to);if(this.boundary){for(;a>c.from;a--)if(this.boundary.test(c.text[a-1-c.from])){h=a;break}for(;l<d.to;l++)if(this.boundary.test(d.text[l-d.from])){m=l;break}}let g=[],x,y=(w,S,k)=>g.push(k.range(w,S));if(c==d)for(this.regexp.lastIndex=h-c.from;(x=this.regexp.exec(c.text))&&x.index<m-c.from;)this.addMatch(x,e,x.index+c.from,y);else i_(e.state.doc,this.regexp,h,m,(w,S)=>this.addMatch(S,e,w,y));n=n.update({filterFrom:h,filterTo:m,filter:(w,S)=>w<h||S>m,add:g})}}return n}}const tO=/x/.unicode!=null?"gu":"g",$le=new RegExp(`[\0-\b
|
||
--\u2028\u2029\uFEFF-]`,tO),Hle={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let V4=null;function Qle(){var t;if(V4==null&&typeof document<"u"&&document.body){let e=document.body.style;V4=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return V4||!1}const xv=st.define({combine(t){let e=Vo(t,{render:null,specialChars:$le,addSpecialChars:null});return(e.replaceTabs=!Qle())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,tO)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,tO)),e}});function Vle(t={}){return[xv.of(t),Ule()]}let a_=null;function Ule(){return a_||(a_=Yr.fromClass(class{constructor(t){this.view=t,this.decorations=Ot.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(xv)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new qle({regexp:t.specialChars,decoration:(e,n,r)=>{let{doc:s}=n.state,i=vi(e[0],0);if(i==9){let a=s.lineAt(r),l=n.state.tabSize,c=Cf(a.text,l,r-a.from);return Ot.replace({widget:new Yle((l-c%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[i]||(this.decorationCache[i]=Ot.replace({widget:new Xle(t,i)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(xv);t.startState.facet(xv)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))}const Wle="•";function Gle(t){return t>=32?Wle:t==10?"":String.fromCharCode(9216+t)}class Xle extends Uo{constructor(e,n){super(),this.options=e,this.code=n}eq(e){return e.code==this.code}toDOM(e){let n=Gle(this.code),r=e.state.phrase("Control character")+" "+(Hle[this.code]||"0x"+this.code.toString(16)),s=this.options.render&&this.options.render(this.code,r,n);if(s)return s;let i=document.createElement("span");return i.textContent=n,i.title=r,i.setAttribute("aria-label",r),i.className="cm-specialChar",i}ignoreEvent(){return!1}}class Yle extends Uo{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function Kle(){return Jle}const Zle=Ot.line({class:"cm-activeLine"}),Jle=Yr.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,n=[];for(let r of t.state.selection.ranges){let s=t.lineBlockAt(r.head);s.from>e&&(n.push(Zle.range(s.from)),e=s.from)}return Ot.set(n)}},{decorations:t=>t.decorations});class ece extends Uo{constructor(e){super(),this.content=e}toDOM(e){let n=document.createElement("span");return n.className="cm-placeholder",n.style.pointerEvents="none",n.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),n.setAttribute("aria-hidden","true"),n}coordsAt(e){let n=e.firstChild?Jh(e.firstChild):[];if(!n.length)return null;let r=window.getComputedStyle(e.parentNode),s=Up(n[0],r.direction!="rtl"),i=parseInt(r.lineHeight);return s.bottom-s.top>i*1.5?{left:s.left,right:s.right,top:s.top,bottom:s.top+i}:s}ignoreEvent(){return!1}}function tce(t){let e=Yr.fromClass(class{constructor(n){this.view=n,this.placeholder=t?Ot.set([Ot.widget({widget:new ece(t),side:1}).range(0)]):Ot.none}get decorations(){return this.view.state.doc.length?Ot.none:this.placeholder}},{decorations:n=>n.decorations});return typeof t=="string"?[e,Ze.contentAttributes.of({"aria-placeholder":t})]:e}const nO=2e3;function nce(t,e,n){let r=Math.min(e.line,n.line),s=Math.max(e.line,n.line),i=[];if(e.off>nO||n.off>nO||e.col<0||n.col<0){let a=Math.min(e.off,n.off),l=Math.max(e.off,n.off);for(let c=r;c<=s;c++){let d=t.doc.line(c);d.length<=l&&i.push(Me.range(d.from+a,d.to+l))}}else{let a=Math.min(e.col,n.col),l=Math.max(e.col,n.col);for(let c=r;c<=s;c++){let d=t.doc.line(c),h=Rk(d.text,a,t.tabSize,!0);if(h<0)i.push(Me.cursor(d.to));else{let m=Rk(d.text,l,t.tabSize);i.push(Me.range(d.from+h,d.from+m))}}}return i}function rce(t,e){let n=t.coordsAtPos(t.viewport.from);return n?Math.round(Math.abs((n.left-e)/t.defaultCharacterWidth)):-1}function o_(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1),r=t.state.doc.lineAt(n),s=n-r.from,i=s>nO?-1:s==r.length?rce(t,e.clientX):Cf(r.text,t.state.tabSize,n-r.from);return{line:r.number,col:i,off:s}}function sce(t,e){let n=o_(t,e),r=t.state.selection;return n?{update(s){if(s.docChanged){let i=s.changes.mapPos(s.startState.doc.line(n.line).from),a=s.state.doc.lineAt(i);n={line:a.number,col:n.col,off:Math.min(n.off,a.length)},r=r.map(s.changes)}},get(s,i,a){let l=o_(t,s);if(!l)return r;let c=nce(t.state,n,l);return c.length?a?Me.create(c.concat(r.ranges)):Me.create(c):r}}:null}function ice(t){let e=(n=>n.altKey&&n.button==0);return Ze.mouseSelectionStyle.of((n,r)=>e(r)?sce(n,r):null)}const ace={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},oce={style:"cursor: crosshair"};function lce(t={}){let[e,n]=ace[t.key||"Alt"],r=Yr.fromClass(class{constructor(s){this.view=s,this.isDown=!1}set(s){this.isDown!=s&&(this.isDown=s,this.view.update([]))}},{eventObservers:{keydown(s){this.set(s.keyCode==e||n(s))},keyup(s){(s.keyCode==e||!n(s))&&this.set(!1)},mousemove(s){this.set(n(s))}}});return[r,Ze.contentAttributes.of(s=>{var i;return!((i=s.plugin(r))===null||i===void 0)&&i.isDown?oce:null})]}const p1="-10000px";class Mq{constructor(e,n,r,s){this.facet=n,this.createTooltipView=r,this.removeTooltipView=s,this.input=e.state.facet(n),this.tooltips=this.input.filter(a=>a);let i=null;this.tooltipViews=this.tooltips.map(a=>i=r(a,i))}update(e,n){var r;let s=e.state.facet(this.facet),i=s.filter(c=>c);if(s===this.input){for(let c of this.tooltipViews)c.update&&c.update(e);return!1}let a=[],l=n?[]:null;for(let c=0;c<i.length;c++){let d=i[c],h=-1;if(d){for(let m=0;m<this.tooltips.length;m++){let g=this.tooltips[m];g&&g.create==d.create&&(h=m)}if(h<0)a[c]=this.createTooltipView(d,c?a[c-1]:null),l&&(l[c]=!!d.above);else{let m=a[c]=this.tooltipViews[h];l&&(l[c]=n[h]),m.update&&m.update(e)}}}for(let c of this.tooltipViews)a.indexOf(c)<0&&(this.removeTooltipView(c),(r=c.destroy)===null||r===void 0||r.call(c));return n&&(l.forEach((c,d)=>n[d]=c),n.length=l.length),this.input=s,this.tooltips=i,this.tooltipViews=a,!0}}function cce(t){let e=t.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const U4=st.define({combine:t=>{var e,n,r;return{position:et.ios?"absolute":((e=t.find(s=>s.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((n=t.find(s=>s.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((r=t.find(s=>s.tooltipSpace))===null||r===void 0?void 0:r.tooltipSpace)||cce}}}),l_=new WeakMap,x6=Yr.fromClass(class{constructor(t){this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet(U4);this.position=e.position,this.parent=e.parent,this.classes=t.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new Mq(t,v6,(n,r)=>this.createTooltip(n,r),n=>{this.resizeObserver&&this.resizeObserver.unobserve(n.dom),n.dom.remove()}),this.above=this.manager.tooltips.map(n=>!!n.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(n=>{Date.now()>this.lastTransaction-50&&n.length>0&&n[n.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let t of this.manager.tooltipViews)this.intersectionObserver.observe(t.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t,this.above);e&&this.observeIntersection();let n=e||t.geometryChanged,r=t.state.facet(U4);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let s of this.manager.tooltipViews)s.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let s of this.manager.tooltipViews)this.container.appendChild(s.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(t,e){let n=t.create(this.view),r=e?e.dom:null;if(n.dom.classList.add("cm-tooltip"),t.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let s=document.createElement("div");s.className="cm-tooltip-arrow",n.dom.appendChild(s)}return n.dom.style.position=this.position,n.dom.style.top=p1,n.dom.style.left="0px",this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var t,e,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let r of this.manager.tooltipViews)r.dom.remove(),(t=r.destroy)===null||t===void 0||t.call(r);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=1,e=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:i}=this.manager.tooltipViews[0];if(et.safari){let a=i.getBoundingClientRect();n=Math.abs(a.top+1e4)>1||Math.abs(a.left)>1}else n=!!i.offsetParent&&i.offsetParent!=this.container.ownerDocument.body}if(n||this.position=="absolute")if(this.parent){let i=this.parent.getBoundingClientRect();i.width&&i.height&&(t=i.width/this.parent.offsetWidth,e=i.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:e}=this.view.viewState);let r=this.view.scrollDOM.getBoundingClientRect(),s=f6(this.view);return{visible:{left:r.left+s.left,top:r.top+s.top,right:r.right-s.right,bottom:r.bottom-s.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((i,a)=>{let l=this.manager.tooltipViews[a];return l.getCoords?l.getCoords(i.pos):this.view.coordsAtPos(i.pos)}),size:this.manager.tooltipViews.map(({dom:i})=>i.getBoundingClientRect()),space:this.view.state.facet(U4).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:n}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{visible:n,space:r,scaleX:s,scaleY:i}=t,a=[];for(let l=0;l<this.manager.tooltips.length;l++){let c=this.manager.tooltips[l],d=this.manager.tooltipViews[l],{dom:h}=d,m=t.pos[l],g=t.size[l];if(!m||c.clip!==!1&&(m.bottom<=Math.max(n.top,r.top)||m.top>=Math.min(n.bottom,r.bottom)||m.right<Math.max(n.left,r.left)-.1||m.left>Math.min(n.right,r.right)+.1)){h.style.top=p1;continue}let x=c.arrow?d.dom.querySelector(".cm-tooltip-arrow"):null,y=x?7:0,w=g.right-g.left,S=(e=l_.get(d))!==null&&e!==void 0?e:g.bottom-g.top,k=d.offset||dce,j=this.view.textDirection==br.LTR,N=g.width>r.right-r.left?j?r.left:r.right-g.width:j?Math.max(r.left,Math.min(m.left-(x?14:0)+k.x,r.right-w)):Math.min(Math.max(r.left,m.left-w+(x?14:0)-k.x),r.right-w),T=this.above[l];!c.strictSide&&(T?m.top-S-y-k.y<r.top:m.bottom+S+y+k.y>r.bottom)&&T==r.bottom-m.bottom>m.top-r.top&&(T=this.above[l]=!T);let E=(T?m.top-r.top:r.bottom-m.bottom)-y;if(E<S&&d.resize!==!1){if(E<this.view.defaultLineHeight){h.style.top=p1;continue}l_.set(d,S),h.style.height=(S=E)/i+"px"}else h.style.height&&(h.style.height="");let _=T?m.top-S-y-k.y:m.bottom+y+k.y,A=N+w;if(d.overlap!==!0)for(let D of a)D.left<A&&D.right>N&&D.top<_+S&&D.bottom>_&&(_=T?D.top-S-2-y:D.bottom+y+2);if(this.position=="absolute"?(h.style.top=(_-t.parent.top)/i+"px",c_(h,(N-t.parent.left)/s)):(h.style.top=_/i+"px",c_(h,N/s)),x){let D=m.left+(j?k.x:-k.x)-(N+14-7);x.style.left=D/s+"px"}d.overlap!==!0&&a.push({left:N,top:_,right:A,bottom:_+S}),h.classList.toggle("cm-tooltip-above",T),h.classList.toggle("cm-tooltip-below",!T),d.positioned&&d.positioned(t.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let t of this.manager.tooltipViews)t.dom.style.top=p1}},{eventObservers:{scroll(){this.maybeMeasure()}}});function c_(t,e){let n=parseInt(t.style.left,10);(isNaN(n)||Math.abs(e-n)>1)&&(t.style.left=e+"px")}const uce=Ze.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),dce={x:0,y:0},v6=st.define({enables:[x6,uce]}),ey=st.define({combine:t=>t.reduce((e,n)=>e.concat(n),[])});class pb{static create(e){return new pb(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new Mq(e,ey,(n,r)=>this.createHostedView(n,r),n=>n.dom.remove())}createHostedView(e,n){let r=e.create(this.view);return r.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(r.dom,n?n.dom.nextSibling:this.dom.firstChild),this.mounted&&r.mount&&r.mount(this.view),r}mount(e){for(let n of this.manager.tooltipViews)n.mount&&n.mount(e);this.mounted=!0}positioned(e){for(let n of this.manager.tooltipViews)n.positioned&&n.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let n of this.manager.tooltipViews)(e=n.destroy)===null||e===void 0||e.call(n)}passProp(e){let n;for(let r of this.manager.tooltipViews){let s=r[e];if(s!==void 0){if(n===void 0)n=s;else if(n!==s)return}}return n}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const hce=v6.compute([ey],t=>{let e=t.facet(ey);return e.length===0?null:{pos:Math.min(...e.map(n=>n.pos)),end:Math.max(...e.map(n=>{var r;return(r=n.end)!==null&&r!==void 0?r:n.pos})),create:pb.create,above:e[0].above,arrow:e.some(n=>n.arrow)}});class fce{constructor(e,n,r,s,i){this.view=e,this.source=n,this.field=r,this.setHover=s,this.hoverTime=i,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:n}=this,r=e.docView.nearest(n.target);if(!r)return;let s,i=1;if(r instanceof Dl)s=r.posAtStart;else{if(s=e.posAtCoords(n),s==null)return;let l=e.coordsAtPos(s);if(!l||n.y<l.top||n.y>l.bottom||n.x<l.left-e.defaultCharacterWidth||n.x>l.right+e.defaultCharacterWidth)return;let c=e.bidiSpans(e.state.doc.lineAt(s)).find(h=>h.from<=s&&h.to>=s),d=c&&c.dir==br.RTL?-1:1;i=n.x<l.left?-d:d}let a=this.source(e,s,i);if(a?.then){let l=this.pending={pos:s};a.then(c=>{this.pending==l&&(this.pending=null,c&&!(Array.isArray(c)&&!c.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(c)?c:[c])}))},c=>bi(e.state,c,"hover tooltip"))}else a&&!(Array.isArray(a)&&!a.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(a)?a:[a])})}get tooltip(){let e=this.view.plugin(x6),n=e?e.manager.tooltips.findIndex(r=>r.create==pb.create):-1;return n>-1?e.manager.tooltipViews[n]:null}mousemove(e){var n,r;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:s,tooltip:i}=this;if(s.length&&i&&!mce(i.dom,e)||this.pending){let{pos:a}=s[0]||this.pending,l=(r=(n=s[0])===null||n===void 0?void 0:n.end)!==null&&r!==void 0?r:a;(a==l?this.view.posAtCoords(this.lastMove)!=a:!pce(this.view,a,l,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:n}=this;if(n.length){let{tooltip:r}=this;r&&r.dom.contains(e.relatedTarget)?this.watchTooltipLeave(r.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let n=r=>{e.removeEventListener("mouseleave",n),this.active.length&&!this.view.dom.contains(r.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",n)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const g1=4;function mce(t,e){let{left:n,right:r,top:s,bottom:i}=t.getBoundingClientRect(),a;if(a=t.querySelector(".cm-tooltip-arrow")){let l=a.getBoundingClientRect();s=Math.min(l.top,s),i=Math.max(l.bottom,i)}return e.clientX>=n-g1&&e.clientX<=r+g1&&e.clientY>=s-g1&&e.clientY<=i+g1}function pce(t,e,n,r,s,i){let a=t.scrollDOM.getBoundingClientRect(),l=t.documentTop+t.documentPadding.top+t.contentHeight;if(a.left>r||a.right<r||a.top>s||Math.min(a.bottom,l)<s)return!1;let c=t.posAtCoords({x:r,y:s},!1);return c>=e&&c<=n}function gce(t,e={}){let n=Qt.define(),r=Os.define({create(){return[]},update(s,i){if(s.length&&(e.hideOnChange&&(i.docChanged||i.selection)?s=[]:e.hideOn&&(s=s.filter(a=>!e.hideOn(i,a))),i.docChanged)){let a=[];for(let l of s){let c=i.changes.mapPos(l.pos,-1,Ds.TrackDel);if(c!=null){let d=Object.assign(Object.create(null),l);d.pos=c,d.end!=null&&(d.end=i.changes.mapPos(d.end)),a.push(d)}}s=a}for(let a of i.effects)a.is(n)&&(s=a.value),a.is(xce)&&(s=[]);return s},provide:s=>ey.from(s)});return{active:r,extension:[r,Yr.define(s=>new fce(s,t,r,n,e.hoverTime||300)),hce]}}function Rq(t,e){let n=t.plugin(x6);if(!n)return null;let r=n.manager.tooltips.indexOf(e);return r<0?null:n.manager.tooltipViews[r]}const xce=Qt.define(),u_=st.define({combine(t){let e,n;for(let r of t)e=e||r.topContainer,n=n||r.bottomContainer;return{topContainer:e,bottomContainer:n}}});function X0(t,e){let n=t.plugin(Dq),r=n?n.specs.indexOf(e):-1;return r>-1?n.panels[r]:null}const Dq=Yr.fromClass(class{constructor(t){this.input=t.state.facet(Y0),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(t));let e=t.state.facet(u_);this.top=new x1(t,!0,e.topContainer),this.bottom=new x1(t,!1,e.bottomContainer),this.top.sync(this.panels.filter(n=>n.top)),this.bottom.sync(this.panels.filter(n=>!n.top));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(t){let e=t.state.facet(u_);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new x1(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new x1(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=t.state.facet(Y0);if(n!=this.input){let r=n.filter(c=>c),s=[],i=[],a=[],l=[];for(let c of r){let d=this.specs.indexOf(c),h;d<0?(h=c(t.view),l.push(h)):(h=this.panels[d],h.update&&h.update(t)),s.push(h),(h.top?i:a).push(h)}this.specs=r,this.panels=s,this.top.sync(i),this.bottom.sync(a);for(let c of l)c.dom.classList.add("cm-panel"),c.mount&&c.mount()}else for(let r of this.panels)r.update&&r.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>Ze.scrollMargins.of(e=>{let n=e.plugin(t);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class x1{constructor(e,n,r){this.view=e,this.top=n,this.container=r,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let n of this.panels)n.destroy&&e.indexOf(n)<0&&n.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let e=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;e!=n.dom;)e=d_(e);e=e.nextSibling}else this.dom.insertBefore(n.dom,e);for(;e;)e=d_(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function d_(t){let e=t.nextSibling;return t.remove(),e}const Y0=st.define({enables:Dq});class Vl extends od{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Vl.prototype.elementClass="";Vl.prototype.toDOM=void 0;Vl.prototype.mapMode=Ds.TrackBefore;Vl.prototype.startSide=Vl.prototype.endSide=-1;Vl.prototype.point=!0;const vv=st.define(),vce=st.define(),yce={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Bn.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},T0=st.define();function bce(t){return[Pq(),T0.of({...yce,...t})]}const h_=st.define({combine:t=>t.some(e=>e)});function Pq(t){return[wce]}const wce=Yr.fromClass(class{constructor(t){this.view=t,this.domAfter=null,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(T0).map(e=>new m_(t,e)),this.fixed=!t.state.facet(h_);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(t){if(this.updateGutters(t)){let e=this.prevViewport,n=t.view.viewport,r=Math.min(e.to,n.to)-Math.max(e.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}if(t.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(h_)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=Bn.iter(this.view.state.facet(vv),this.view.viewport.from),r=[],s=this.gutters.map(i=>new Sce(i,this.view.viewport,-this.view.documentPadding.top));for(let i of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(i.type)){let a=!0;for(let l of i.type)if(l.type==ri.Text&&a){rO(n,r,l.from);for(let c of s)c.line(this.view,l,r);a=!1}else if(l.widget)for(let c of s)c.widget(this.view,l)}else if(i.type==ri.Text){rO(n,r,i.from);for(let a of s)a.line(this.view,i,r)}else if(i.widget)for(let a of s)a.widget(this.view,i);for(let i of s)i.finish();t&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(t){let e=t.startState.facet(T0),n=t.state.facet(T0),r=t.docChanged||t.heightChanged||t.viewportChanged||!Bn.eq(t.startState.facet(vv),t.state.facet(vv),t.view.viewport.from,t.view.viewport.to);if(e==n)for(let s of this.gutters)s.update(t)&&(r=!0);else{r=!0;let s=[];for(let i of n){let a=e.indexOf(i);a<0?s.push(new m_(this.view,i)):(this.gutters[a].update(t),s.push(this.gutters[a]))}for(let i of this.gutters)i.dom.remove(),s.indexOf(i)<0&&i.destroy();for(let i of s)i.config.side=="after"?this.getDOMAfter().appendChild(i.dom):this.dom.appendChild(i.dom);this.gutters=s}return r}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:t=>Ze.scrollMargins.of(e=>{let n=e.plugin(t);if(!n||n.gutters.length==0||!n.fixed)return null;let r=n.dom.offsetWidth*e.scaleX,s=n.domAfter?n.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==br.LTR?{left:r,right:s}:{right:r,left:s}})});function f_(t){return Array.isArray(t)?t:[t]}function rO(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}class Sce{constructor(e,n,r){this.gutter=e,this.height=r,this.i=0,this.cursor=Bn.iter(e.markers,n.from)}addElement(e,n,r){let{gutter:s}=this,i=(n.top-this.height)/e.scaleY,a=n.height/e.scaleY;if(this.i==s.elements.length){let l=new zq(e,a,i,r);s.elements.push(l),s.dom.appendChild(l.dom)}else s.elements[this.i].update(e,a,i,r);this.height=n.bottom,this.i++}line(e,n,r){let s=[];rO(this.cursor,s,n.from),r.length&&(s=s.concat(r));let i=this.gutter.config.lineMarker(e,n,s);i&&s.unshift(i);let a=this.gutter;s.length==0&&!a.config.renderEmptyElements||this.addElement(e,n,s)}widget(e,n){let r=this.gutter.config.widgetMarker(e,n.widget,n),s=r?[r]:null;for(let i of e.state.facet(vce)){let a=i(e,n.widget,n);a&&(s||(s=[])).push(a)}s&&this.addElement(e,n,s)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let n=e.elements.pop();e.dom.removeChild(n.dom),n.destroy()}}}class m_{constructor(e,n){this.view=e,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in n.domEventHandlers)this.dom.addEventListener(r,s=>{let i=s.target,a;if(i!=this.dom&&this.dom.contains(i)){for(;i.parentNode!=this.dom;)i=i.parentNode;let c=i.getBoundingClientRect();a=(c.top+c.bottom)/2}else a=s.clientY;let l=e.lineBlockAtHeight(a-e.documentTop);n.domEventHandlers[r](e,l,s)&&s.preventDefault()});this.markers=f_(n.markers(e)),n.initialSpacer&&(this.spacer=new zq(e,0,0,[n.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let n=this.markers;if(this.markers=f_(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let s=this.config.updateSpacer(this.spacer.markers[0],e);s!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[s])}let r=e.view.viewport;return!Bn.eq(this.markers,n,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class zq{constructor(e,n,r,s){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,n,r,s)}update(e,n,r,s){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),kce(this.markers,s)||this.setMarkers(e,s)}setMarkers(e,n){let r="cm-gutterElement",s=this.dom.firstChild;for(let i=0,a=0;;){let l=a,c=i<n.length?n[i++]:null,d=!1;if(c){let h=c.elementClass;h&&(r+=" "+h);for(let m=a;m<this.markers.length;m++)if(this.markers[m].compare(c)){l=m,d=!0;break}}else l=this.markers.length;for(;a<l;){let h=this.markers[a++];if(h.toDOM){h.destroy(s);let m=s.nextSibling;s.remove(),s=m}}if(!c)break;c.toDOM&&(d?s=s.nextSibling:this.dom.insertBefore(c.toDOM(e),s)),d&&a++}this.dom.className=r,this.markers=n}destroy(){this.setMarkers(null,[])}}function kce(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].compare(e[n]))return!1;return!0}const Oce=st.define(),jce=st.define(),Eh=st.define({combine(t){return Vo(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,n){let r=Object.assign({},e);for(let s in n){let i=r[s],a=n[s];r[s]=i?(l,c,d)=>i(l,c,d)||a(l,c,d):a}return r}})}});class W4 extends Vl{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function G4(t,e){return t.state.facet(Eh).formatNumber(e,t.state)}const Nce=T0.compute([Eh],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(Oce)},lineMarker(e,n,r){return r.some(s=>s.toDOM)?null:new W4(G4(e,e.state.doc.lineAt(n.from).number))},widgetMarker:(e,n,r)=>{for(let s of e.state.facet(jce)){let i=s(e,n,r);if(i)return i}return null},lineMarkerChange:e=>e.startState.facet(Eh)!=e.state.facet(Eh),initialSpacer(e){return new W4(G4(e,p_(e.state.doc.lines)))},updateSpacer(e,n){let r=G4(n.view,p_(n.view.state.doc.lines));return r==e.number?e:new W4(r)},domEventHandlers:t.facet(Eh).domEventHandlers,side:"before"}));function Cce(t={}){return[Eh.of(t),Pq(),Nce]}function p_(t){let e=9;for(;e<t;)e=e*10+9;return e}const Tce=new class extends Vl{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},Ece=vv.compute(["selection"],t=>{let e=[],n=-1;for(let r of t.selection.ranges){let s=t.doc.lineAt(r.head).from;s>n&&(n=s,e.push(Tce.range(s)))}return Bn.of(e)});function _ce(){return Ece}const Iq=1024;let Ace=0;class X4{constructor(e,n){this.from=e,this.to=n}}class an{constructor(e={}){this.id=Ace++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=ai.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}}an.closedBy=new an({deserialize:t=>t.split(" ")});an.openedBy=new an({deserialize:t=>t.split(" ")});an.group=new an({deserialize:t=>t.split(" ")});an.isolate=new an({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});an.contextHash=new an({perNode:!0});an.lookAhead=new an({perNode:!0});an.mounted=new an({perNode:!0});class ty{constructor(e,n,r){this.tree=e,this.overlay=n,this.parser=r}static get(e){return e&&e.props&&e.props[an.mounted.id]}}const Mce=Object.create(null);class ai{constructor(e,n,r,s=0){this.name=e,this.props=n,this.id=r,this.flags=s}static define(e){let n=e.props&&e.props.length?Object.create(null):Mce,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),s=new ai(e.name||"",n,e.id,r);if(e.props){for(let i of e.props)if(Array.isArray(i)||(i=i(s)),i){if(i[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[i[0].id]=i[1]}}return s}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(an.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let r in e)for(let s of r.split(" "))n[s]=e[r];return r=>{for(let s=r.prop(an.group),i=-1;i<(s?s.length:0);i++){let a=n[i<0?r.name:s[i]];if(a)return a}}}}ai.none=new ai("",Object.create(null),0,8);class gb{constructor(e){this.types=e;for(let n=0;n<e.length;n++)if(e[n].id!=n)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let n=[];for(let r of this.types){let s=null;for(let i of e){let a=i(r);if(a){s||(s=Object.assign({},r.props));let l=a[1],c=a[0];c.combine&&c.id in s&&(l=c.combine(s[c.id],l)),s[c.id]=l}}n.push(s?new ai(r.name,s,r.id,r.flags):r)}return new gb(n)}}const v1=new WeakMap,g_=new WeakMap;var hs;(function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays"})(hs||(hs={}));class ur{constructor(e,n,r,s,i){if(this.type=e,this.children=n,this.positions=r,this.length=s,this.props=null,i&&i.length){this.props=Object.create(null);for(let[a,l]of i)this.props[typeof a=="number"?a:a.id]=l}}toString(){let e=ty.get(this);if(e&&!e.overlay)return e.tree.toString();let n="";for(let r of this.children){let s=r.toString();s&&(n&&(n+=","),n+=s)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(n.length?"("+n+")":""):n}cursor(e=0){return new iO(this.topNode,e)}cursorAt(e,n=0,r=0){let s=v1.get(this)||this.topNode,i=new iO(s);return i.moveTo(e,n),v1.set(this,i._tree),i}get topNode(){return new Ni(this,0,0,null)}resolve(e,n=0){let r=K0(v1.get(this)||this.topNode,e,n,!1);return v1.set(this,r),r}resolveInner(e,n=0){let r=K0(g_.get(this)||this.topNode,e,n,!0);return g_.set(this,r),r}resolveStack(e,n=0){return Pce(this,e,n)}iterate(e){let{enter:n,leave:r,from:s=0,to:i=this.length}=e,a=e.mode||0,l=(a&hs.IncludeAnonymous)>0;for(let c=this.cursor(a|hs.IncludeAnonymous);;){let d=!1;if(c.from<=i&&c.to>=s&&(!l&&c.type.isAnonymous||n(c)!==!1)){if(c.firstChild())continue;d=!0}for(;d&&r&&(l||!c.type.isAnonymous)&&r(c),!c.nextSibling();){if(!c.parent())return;d=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:w6(ai.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,s)=>new ur(this.type,n,r,s,this.propValues),e.makeTree||((n,r,s)=>new ur(ai.none,n,r,s)))}static build(e){return zce(e)}}ur.empty=new ur(ai.none,[],[],0);class y6{constructor(e,n){this.buffer=e,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new y6(this.buffer,this.index)}}class Jc{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return ai.none}toString(){let e=[];for(let n=0;n<this.buffer.length;)e.push(this.childString(n)),n=this.buffer[n+3];return e.join(",")}childString(e){let n=this.buffer[e],r=this.buffer[e+3],s=this.set.types[n],i=s.name;if(/\W/.test(i)&&!s.isError&&(i=JSON.stringify(i)),e+=4,r==e)return i;let a=[];for(;e<r;)a.push(this.childString(e)),e=this.buffer[e+3];return i+"("+a.join(",")+")"}findChild(e,n,r,s,i){let{buffer:a}=this,l=-1;for(let c=e;c!=n&&!(Lq(i,s,a[c+1],a[c+2])&&(l=c,r>0));c=a[c+3]);return l}slice(e,n,r){let s=this.buffer,i=new Uint16Array(n-e),a=0;for(let l=e,c=0;l<n;){i[c++]=s[l++],i[c++]=s[l++]-r;let d=i[c++]=s[l++]-r;i[c++]=s[l++]-e,a=Math.max(a,d)}return new Jc(i,a,this.set)}}function Lq(t,e,n,r){switch(t){case-2:return n<e;case-1:return r>=e&&n<e;case 0:return n<e&&r>e;case 1:return n<=e&&r>e;case 2:return r>e;case 4:return!0}}function K0(t,e,n,r){for(var s;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to<e);){let a=!r&&t instanceof Ni&&t.index<0?null:t.parent;if(!a)return t;t=a}let i=r?0:hs.IgnoreOverlays;if(r)for(let a=t,l=a.parent;l;a=l,l=a.parent)a instanceof Ni&&a.index<0&&((s=l.enter(e,n,i))===null||s===void 0?void 0:s.from)!=a.from&&(t=l);for(;;){let a=t.enter(e,n,i);if(!a)return t;t=a}}class Bq{cursor(e=0){return new iO(this,e)}getChild(e,n=null,r=null){let s=x_(this,e,n,r);return s.length?s[0]:null}getChildren(e,n=null,r=null){return x_(this,e,n,r)}resolve(e,n=0){return K0(this,e,n,!1)}resolveInner(e,n=0){return K0(this,e,n,!0)}matchContext(e){return sO(this.parent,e)}enterUnfinishedNodesBefore(e){let n=this.childBefore(e),r=this;for(;n;){let s=n.lastChild;if(!s||s.to!=n.to)break;s.type.isError&&s.from==s.to?(r=n,n=s.prevSibling):n=s}return r}get node(){return this}get next(){return this.parent}}class Ni extends Bq{constructor(e,n,r,s){super(),this._tree=e,this.from=n,this.index=r,this._parent=s}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,n,r,s,i=0){for(let a=this;;){for(let{children:l,positions:c}=a._tree,d=n>0?l.length:-1;e!=d;e+=n){let h=l[e],m=c[e]+a.from;if(Lq(s,r,m,m+h.length)){if(h instanceof Jc){if(i&hs.ExcludeBuffers)continue;let g=h.findChild(0,h.buffer.length,n,r-m,s);if(g>-1)return new Co(new Rce(a,h,e,m),null,g)}else if(i&hs.IncludeAnonymous||!h.type.isAnonymous||b6(h)){let g;if(!(i&hs.IgnoreMounts)&&(g=ty.get(h))&&!g.overlay)return new Ni(g.tree,m,e,a);let x=new Ni(h,m,e,a);return i&hs.IncludeAnonymous||!x.type.isAnonymous?x:x.nextChild(n<0?h.children.length-1:0,n,r,s)}}}if(i&hs.IncludeAnonymous||!a.type.isAnonymous||(a.index>=0?e=a.index+n:e=n<0?-1:a._parent._tree.children.length,a=a._parent,!a))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,n,r=0){let s;if(!(r&hs.IgnoreOverlays)&&(s=ty.get(this._tree))&&s.overlay){let i=e-this.from;for(let{from:a,to:l}of s.overlay)if((n>0?a<=i:a<i)&&(n<0?l>=i:l>i))return new Ni(s.tree,s.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function x_(t,e,n,r){let s=t.cursor(),i=[];if(!s.firstChild())return i;if(n!=null){for(let a=!1;!a;)if(a=s.type.is(n),!s.nextSibling())return i}for(;;){if(r!=null&&s.type.is(r))return i;if(s.type.is(e)&&i.push(s.node),!s.nextSibling())return r==null?i:[]}}function sO(t,e,n=e.length-1){for(let r=t;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[n]&&e[n]!=r.name)return!1;n--}}return!0}class Rce{constructor(e,n,r,s){this.parent=e,this.buffer=n,this.index=r,this.start=s}}class Co extends Bq{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,n,r){super(),this.context=e,this._parent=n,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,n,r){let{buffer:s}=this.context,i=s.findChild(this.index+4,s.buffer[this.index+3],e,n-this.context.start,r);return i<0?null:new Co(this.context,this,i)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,n,r=0){if(r&hs.ExcludeBuffers)return null;let{buffer:s}=this.context,i=s.findChild(this.index+4,s.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return i<0?null:new Co(this.context,this,i)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Co(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new Co(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:r}=this.context,s=this.index+4,i=r.buffer[this.index+3];if(i>s){let a=r.buffer[this.index+1];e.push(r.slice(s,i,a)),n.push(0)}return new ur(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Fq(t){if(!t.length)return null;let e=0,n=t[0];for(let i=1;i<t.length;i++){let a=t[i];(a.from>n.from||a.to<n.to)&&(n=a,e=i)}let r=n instanceof Ni&&n.index<0?null:n.parent,s=t.slice();return r?s[e]=r:s.splice(e,1),new Dce(s,n)}class Dce{constructor(e,n){this.heads=e,this.node=n}get next(){return Fq(this.heads)}}function Pce(t,e,n){let r=t.resolveInner(e,n),s=null;for(let i=r instanceof Ni?r:r.context.parent;i;i=i.parent)if(i.index<0){let a=i.parent;(s||(s=[r])).push(a.resolve(e,n)),i=a}else{let a=ty.get(i.tree);if(a&&a.overlay&&a.overlay[0].from<=e&&a.overlay[a.overlay.length-1].to>=e){let l=new Ni(a.tree,a.overlay[0].from+i.from,-1,i);(s||(s=[r])).push(K0(l,e,n,!1))}}return s?Fq(s):r}class iO{get name(){return this.type.name}constructor(e,n=0){if(this.mode=n,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof Ni)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:r,buffer:s}=this.buffer;return this.type=n||s.set.types[s.buffer[e]],this.from=r+s.buffer[e+1],this.to=r+s.buffer[e+2],!0}yield(e){return e?e instanceof Ni?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,r,this.mode));let{buffer:s}=this.buffer,i=s.findChild(this.index+4,s.buffer[this.index+3],e,n-this.buffer.start,r);return i<0?!1:(this.stack.push(this.index),this.yieldBuf(i))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,r=this.mode){return this.buffer?r&hs.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&hs.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&hs.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:n}=this.buffer,r=this.stack.length-1;if(e<0){let s=r<0?0:this.stack[r]+4;if(this.index!=s)return this.yieldBuf(n.findChild(s,this.index,-1,0,4))}else{let s=n.buffer[this.index+3];if(s<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(s)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,r,{buffer:s}=this;if(s){if(e>0){if(this.index<s.buffer.buffer.length)return!1}else for(let i=0;i<this.index;i++)if(s.buffer.buffer[i+3]<this.index)return!1;({index:n,parent:r}=s)}else({index:n,_parent:r}=this._tree);for(;r;{index:n,_parent:r}=r)if(n>-1)for(let i=n+e,a=e<0?-1:r._tree.children.length;i!=a;i+=e){let l=r._tree.children[i];if(this.mode&hs.IncludeAnonymous||l instanceof Jc||!l.type.isAnonymous||b6(l))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,n););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,n=null,r=0;if(e&&e.context==this.buffer)e:for(let s=this.index,i=this.stack.length;i>=0;){for(let a=e;a;a=a._parent)if(a.index==s){if(s==this.index)return a;n=a,r=i+1;break e}s=this.stack[--i]}for(let s=r;s<this.stack.length;s++)n=new Co(this.buffer,n,this.stack[s]);return this.bufferNode=new Co(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,n){for(let r=0;;){let s=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(s=!0)}for(;;){if(s&&n&&n(this),s=this.type.isAnonymous,!r)return;if(this.nextSibling())break;this.parent(),r--,s=!0}}}matchContext(e){if(!this.buffer)return sO(this.node.parent,e);let{buffer:n}=this.buffer,{types:r}=n.set;for(let s=e.length-1,i=this.stack.length-1;s>=0;i--){if(i<0)return sO(this._tree,e,s);let a=r[n.buffer[this.stack[i]]];if(!a.isAnonymous){if(e[s]&&e[s]!=a.name)return!1;s--}}return!0}}function b6(t){return t.children.some(e=>e instanceof Jc||!e.type.isAnonymous||b6(e))}function zce(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:s=Iq,reused:i=[],minRepeatType:a=r.types.length}=t,l=Array.isArray(n)?new y6(n,n.length):n,c=r.types,d=0,h=0;function m(E,_,A,D,q,B){let{id:H,start:W,end:ee,size:I}=l,V=h,L=d;if(I<0)if(l.next(),I==-1){let ie=i[H];A.push(ie),D.push(W-E);return}else if(I==-3){d=H;return}else if(I==-4){h=H;return}else throw new RangeError(`Unrecognized record size: ${I}`);let $=c[H],K,Y,R=W-E;if(ee-W<=s&&(Y=S(l.pos-_,q))){let ie=new Uint16Array(Y.size-Y.skip),X=l.pos-Y.size,z=ie.length;for(;l.pos>X;)z=k(Y.start,ie,z);K=new Jc(ie,ee-Y.start,r),R=Y.start-E}else{let ie=l.pos-I;l.next();let X=[],z=[],U=H>=a?H:-1,te=0,ne=ee;for(;l.pos>ie;)U>=0&&l.id==U&&l.size>=0?(l.end<=ne-s&&(y(X,z,W,te,l.end,ne,U,V,L),te=X.length,ne=l.end),l.next()):B>2500?g(W,ie,X,z):m(W,ie,X,z,U,B+1);if(U>=0&&te>0&&te<X.length&&y(X,z,W,te,W,ne,U,V,L),X.reverse(),z.reverse(),U>-1&&te>0){let G=x($,L);K=w6($,X,z,0,X.length,0,ee-W,G,G)}else K=w($,X,z,ee-W,V-ee,L)}A.push(K),D.push(R)}function g(E,_,A,D){let q=[],B=0,H=-1;for(;l.pos>_;){let{id:W,start:ee,end:I,size:V}=l;if(V>4)l.next();else{if(H>-1&&ee<H)break;H<0&&(H=I-s),q.push(W,ee,I),B++,l.next()}}if(B){let W=new Uint16Array(B*4),ee=q[q.length-2];for(let I=q.length-3,V=0;I>=0;I-=3)W[V++]=q[I],W[V++]=q[I+1]-ee,W[V++]=q[I+2]-ee,W[V++]=V;A.push(new Jc(W,q[2]-ee,r)),D.push(ee-E)}}function x(E,_){return(A,D,q)=>{let B=0,H=A.length-1,W,ee;if(H>=0&&(W=A[H])instanceof ur){if(!H&&W.type==E&&W.length==q)return W;(ee=W.prop(an.lookAhead))&&(B=D[H]+W.length+ee)}return w(E,A,D,q,B,_)}}function y(E,_,A,D,q,B,H,W,ee){let I=[],V=[];for(;E.length>D;)I.push(E.pop()),V.push(_.pop()+A-q);E.push(w(r.types[H],I,V,B-q,W-B,ee)),_.push(q-A)}function w(E,_,A,D,q,B,H){if(B){let W=[an.contextHash,B];H=H?[W].concat(H):[W]}if(q>25){let W=[an.lookAhead,q];H=H?[W].concat(H):[W]}return new ur(E,_,A,D,H)}function S(E,_){let A=l.fork(),D=0,q=0,B=0,H=A.end-s,W={size:0,start:0,skip:0};e:for(let ee=A.pos-E;A.pos>ee;){let I=A.size;if(A.id==_&&I>=0){W.size=D,W.start=q,W.skip=B,B+=4,D+=4,A.next();continue}let V=A.pos-I;if(I<0||V<ee||A.start<H)break;let L=A.id>=a?4:0,$=A.start;for(A.next();A.pos>V;){if(A.size<0)if(A.size==-3)L+=4;else break e;else A.id>=a&&(L+=4);A.next()}q=$,D+=I,B+=L}return(_<0||D==E)&&(W.size=D,W.start=q,W.skip=B),W.size>4?W:void 0}function k(E,_,A){let{id:D,start:q,end:B,size:H}=l;if(l.next(),H>=0&&D<a){let W=A;if(H>4){let ee=l.pos-(H-4);for(;l.pos>ee;)A=k(E,_,A)}_[--A]=W,_[--A]=B-E,_[--A]=q-E,_[--A]=D}else H==-3?d=D:H==-4&&(h=D);return A}let j=[],N=[];for(;l.pos>0;)m(t.start||0,t.bufferStart||0,j,N,-1,0);let T=(e=t.length)!==null&&e!==void 0?e:j.length?N[0]+j[0].length:0;return new ur(c[t.topID],j.reverse(),N.reverse(),T)}const v_=new WeakMap;function yv(t,e){if(!t.isAnonymous||e instanceof Jc||e.type!=t)return 1;let n=v_.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof ur)){n=1;break}n+=yv(t,r)}v_.set(e,n)}return n}function w6(t,e,n,r,s,i,a,l,c){let d=0;for(let y=r;y<s;y++)d+=yv(t,e[y]);let h=Math.ceil(d*1.5/8),m=[],g=[];function x(y,w,S,k,j){for(let N=S;N<k;){let T=N,E=w[N],_=yv(t,y[N]);for(N++;N<k;N++){let A=yv(t,y[N]);if(_+A>=h)break;_+=A}if(N==T+1){if(_>h){let A=y[T];x(A.children,A.positions,0,A.children.length,w[T]+j);continue}m.push(y[T])}else{let A=w[N-1]+y[N-1].length-E;m.push(w6(t,y,w,T,N,E,A,null,c))}g.push(E+j-i)}}return x(e,n,r,s,0),(l||c)(m,g,a)}class Ice{constructor(){this.map=new WeakMap}setBuffer(e,n,r){let s=this.map.get(e);s||this.map.set(e,s=new Map),s.set(n,r)}getBuffer(e,n){let r=this.map.get(e);return r&&r.get(n)}set(e,n){e instanceof Co?this.setBuffer(e.context.buffer,e.index,n):e instanceof Ni&&this.map.set(e.tree,n)}get(e){return e instanceof Co?this.getBuffer(e.context.buffer,e.index):e instanceof Ni?this.map.get(e.tree):void 0}cursorSet(e,n){e.buffer?this.setBuffer(e.buffer.buffer,e.index,n):this.map.set(e.tree,n)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class rd{constructor(e,n,r,s,i=!1,a=!1){this.from=e,this.to=n,this.tree=r,this.offset=s,this.open=(i?1:0)|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],r=!1){let s=[new rd(0,e.length,e,0,!1,r)];for(let i of n)i.to>e.length&&s.push(i);return s}static applyChanges(e,n,r=128){if(!n.length)return e;let s=[],i=1,a=e.length?e[0]:null;for(let l=0,c=0,d=0;;l++){let h=l<n.length?n[l]:null,m=h?h.fromA:1e9;if(m-c>=r)for(;a&&a.from<m;){let g=a;if(c>=g.from||m<=g.to||d){let x=Math.max(g.from,c)-d,y=Math.min(g.to,m)-d;g=x>=y?null:new rd(x,y,g.tree,g.offset+d,l>0,!!h)}if(g&&s.push(g),a.to>m)break;a=i<e.length?e[i++]:null}if(!h)break;c=h.toA,d=h.toA-h.toB}return s}}let S6=class{startParse(e,n,r){return typeof e=="string"&&(e=new Lce(e)),r=r?r.length?r.map(s=>new X4(s.from,s.to)):[new X4(0,0)]:[new X4(0,e.length)],this.createParse(e,n||[],r)}parse(e,n,r){let s=this.startParse(e,n,r);for(;;){let i=s.advance();if(i)return i}}};class Lce{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}}new an({perNode:!0});let Bce=0;class ga{constructor(e,n,r,s){this.name=e,this.set=n,this.base=r,this.modified=s,this.id=Bce++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let r=typeof e=="string"?e:"?";if(e instanceof ga&&(n=e),n?.base)throw new Error("Can not derive from a modified tag");let s=new ga(r,[],null,[]);if(s.set.push(s),n)for(let i of n.set)s.set.push(i);return s}static defineModifier(e){let n=new ny(e);return r=>r.modified.indexOf(n)>-1?r:ny.get(r.base||r,r.modified.concat(n).sort((s,i)=>s.id-i.id))}}let Fce=0;class ny{constructor(e){this.name=e,this.instances=[],this.id=Fce++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(l=>l.base==e&&qce(n,l.modified));if(r)return r;let s=[],i=new ga(e.name,s,e,n);for(let l of n)l.instances.push(i);let a=$ce(n);for(let l of e.set)if(!l.modified.length)for(let c of a)s.push(ny.get(l,c));return i}}function qce(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}function $ce(t){let e=[[]];for(let n=0;n<t.length;n++)for(let r=0,s=e.length;r<s;r++)e.push(e[r].concat(t[n]));return e.sort((n,r)=>r.length-n.length)}function k6(t){let e=Object.create(null);for(let n in t){let r=t[n];Array.isArray(r)||(r=[r]);for(let s of n.split(" "))if(s){let i=[],a=2,l=s;for(let m=0;;){if(l=="..."&&m>0&&m+3==s.length){a=1;break}let g=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!g)throw new RangeError("Invalid path: "+s);if(i.push(g[0]=="*"?"":g[0][0]=='"'?JSON.parse(g[0]):g[0]),m+=g[0].length,m==s.length)break;let x=s[m++];if(m==s.length&&x=="!"){a=0;break}if(x!="/")throw new RangeError("Invalid path: "+s);l=s.slice(m)}let c=i.length-1,d=i[c];if(!d)throw new RangeError("Invalid path: "+s);let h=new Z0(r,a,c>0?i.slice(0,c):null);e[d]=h.sort(e[d])}}return qq.add(e)}const qq=new an({combine(t,e){let n,r,s;for(;t||e;){if(!t||e&&t.depth>=e.depth?(s=e,e=e.next):(s=t,t=t.next),n&&n.mode==s.mode&&!s.context&&!n.context)continue;let i=new Z0(s.tags,s.mode,s.context);n?n.next=i:r=i,n=i}return r}});class Z0{constructor(e,n,r,s){this.tags=e,this.mode=n,this.context=r,this.next=s}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}Z0.empty=new Z0([],2,null);function $q(t,e){let n=Object.create(null);for(let i of t)if(!Array.isArray(i.tag))n[i.tag.id]=i.class;else for(let a of i.tag)n[a.id]=i.class;let{scope:r,all:s=null}=e||{};return{style:i=>{let a=s;for(let l of i)for(let c of l.set){let d=n[c.id];if(d){a=a?a+" "+d:d;break}}return a},scope:r}}function Hce(t,e){let n=null;for(let r of t){let s=r.style(e);s&&(n=n?n+" "+s:s)}return n}function Qce(t,e,n,r=0,s=t.length){let i=new Vce(r,Array.isArray(e)?e:[e],n);i.highlightRange(t.cursor(),r,s,"",i.highlighters),i.flush(s)}class Vce{constructor(e,n,r){this.at=e,this.highlighters=n,this.span=r,this.class=""}startSpan(e,n){n!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=n)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,n,r,s,i){let{type:a,from:l,to:c}=e;if(l>=r||c<=n)return;a.isTop&&(i=this.highlighters.filter(x=>!x.scope||x.scope(a)));let d=s,h=Uce(e)||Z0.empty,m=Hce(i,h.tags);if(m&&(d&&(d+=" "),d+=m,h.mode==1&&(s+=(s?" ":"")+m)),this.startSpan(Math.max(n,l),d),h.opaque)return;let g=e.tree&&e.tree.prop(an.mounted);if(g&&g.overlay){let x=e.node.enter(g.overlay[0].from+l,1),y=this.highlighters.filter(S=>!S.scope||S.scope(g.tree.type)),w=e.firstChild();for(let S=0,k=l;;S++){let j=S<g.overlay.length?g.overlay[S]:null,N=j?j.from+l:c,T=Math.max(n,k),E=Math.min(r,N);if(T<E&&w)for(;e.from<E&&(this.highlightRange(e,T,E,s,i),this.startSpan(Math.min(E,e.to),d),!(e.to>=N||!e.nextSibling())););if(!j||N>r)break;k=j.to+l,k>n&&(this.highlightRange(x.cursor(),Math.max(n,j.from+l),Math.min(r,k),"",y),this.startSpan(Math.min(r,k),d))}w&&e.parent()}else if(e.firstChild()){g&&(s="");do if(!(e.to<=n)){if(e.from>=r)break;this.highlightRange(e,n,r,s,i),this.startSpan(Math.min(r,e.to),d)}while(e.nextSibling());e.parent()}}}function Uce(t){let e=t.type.prop(qq);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const Ke=ga.define,y1=Ke(),Pc=Ke(),y_=Ke(Pc),b_=Ke(Pc),zc=Ke(),b1=Ke(zc),Y4=Ke(zc),xo=Ke(),zu=Ke(xo),po=Ke(),go=Ke(),aO=Ke(),$m=Ke(aO),w1=Ke(),ye={comment:y1,lineComment:Ke(y1),blockComment:Ke(y1),docComment:Ke(y1),name:Pc,variableName:Ke(Pc),typeName:y_,tagName:Ke(y_),propertyName:b_,attributeName:Ke(b_),className:Ke(Pc),labelName:Ke(Pc),namespace:Ke(Pc),macroName:Ke(Pc),literal:zc,string:b1,docString:Ke(b1),character:Ke(b1),attributeValue:Ke(b1),number:Y4,integer:Ke(Y4),float:Ke(Y4),bool:Ke(zc),regexp:Ke(zc),escape:Ke(zc),color:Ke(zc),url:Ke(zc),keyword:po,self:Ke(po),null:Ke(po),atom:Ke(po),unit:Ke(po),modifier:Ke(po),operatorKeyword:Ke(po),controlKeyword:Ke(po),definitionKeyword:Ke(po),moduleKeyword:Ke(po),operator:go,derefOperator:Ke(go),arithmeticOperator:Ke(go),logicOperator:Ke(go),bitwiseOperator:Ke(go),compareOperator:Ke(go),updateOperator:Ke(go),definitionOperator:Ke(go),typeOperator:Ke(go),controlOperator:Ke(go),punctuation:aO,separator:Ke(aO),bracket:$m,angleBracket:Ke($m),squareBracket:Ke($m),paren:Ke($m),brace:Ke($m),content:xo,heading:zu,heading1:Ke(zu),heading2:Ke(zu),heading3:Ke(zu),heading4:Ke(zu),heading5:Ke(zu),heading6:Ke(zu),contentSeparator:Ke(xo),list:Ke(xo),quote:Ke(xo),emphasis:Ke(xo),strong:Ke(xo),link:Ke(xo),monospace:Ke(xo),strikethrough:Ke(xo),inserted:Ke(),deleted:Ke(),changed:Ke(),invalid:Ke(),meta:w1,documentMeta:Ke(w1),annotation:Ke(w1),processingInstruction:Ke(w1),definition:ga.defineModifier("definition"),constant:ga.defineModifier("constant"),function:ga.defineModifier("function"),standard:ga.defineModifier("standard"),local:ga.defineModifier("local"),special:ga.defineModifier("special")};for(let t in ye){let e=ye[t];e instanceof ga&&(e.name=t)}$q([{tag:ye.link,class:"tok-link"},{tag:ye.heading,class:"tok-heading"},{tag:ye.emphasis,class:"tok-emphasis"},{tag:ye.strong,class:"tok-strong"},{tag:ye.keyword,class:"tok-keyword"},{tag:ye.atom,class:"tok-atom"},{tag:ye.bool,class:"tok-bool"},{tag:ye.url,class:"tok-url"},{tag:ye.labelName,class:"tok-labelName"},{tag:ye.inserted,class:"tok-inserted"},{tag:ye.deleted,class:"tok-deleted"},{tag:ye.literal,class:"tok-literal"},{tag:ye.string,class:"tok-string"},{tag:ye.number,class:"tok-number"},{tag:[ye.regexp,ye.escape,ye.special(ye.string)],class:"tok-string2"},{tag:ye.variableName,class:"tok-variableName"},{tag:ye.local(ye.variableName),class:"tok-variableName tok-local"},{tag:ye.definition(ye.variableName),class:"tok-variableName tok-definition"},{tag:ye.special(ye.variableName),class:"tok-variableName2"},{tag:ye.definition(ye.propertyName),class:"tok-propertyName tok-definition"},{tag:ye.typeName,class:"tok-typeName"},{tag:ye.namespace,class:"tok-namespace"},{tag:ye.className,class:"tok-className"},{tag:ye.macroName,class:"tok-macroName"},{tag:ye.propertyName,class:"tok-propertyName"},{tag:ye.operator,class:"tok-operator"},{tag:ye.comment,class:"tok-comment"},{tag:ye.meta,class:"tok-meta"},{tag:ye.invalid,class:"tok-invalid"},{tag:ye.punctuation,class:"tok-punctuation"}]);var K4;const Wu=new an;function Hq(t){return st.define({combine:t?e=>e.concat(t):void 0})}const Wce=new an;class Sa{constructor(e,n,r=[],s=""){this.data=e,this.name=s,Nn.prototype.hasOwnProperty("tree")||Object.defineProperty(Nn.prototype,"tree",{get(){return Ss(this)}}),this.parser=n,this.extension=[eu.of(this),Nn.languageData.of((i,a,l)=>{let c=w_(i,a,l),d=c.type.prop(Wu);if(!d)return[];let h=i.facet(d),m=c.type.prop(Wce);if(m){let g=c.resolve(a-c.from,l);for(let x of m)if(x.test(g,i)){let y=i.facet(x.facet);return x.type=="replace"?y:y.concat(h)}}return h})].concat(r)}isActiveAt(e,n,r=-1){return w_(e,n,r).type.prop(Wu)==this.data}findRegions(e){let n=e.facet(eu);if(n?.data==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],s=(i,a)=>{if(i.prop(Wu)==this.data){r.push({from:a,to:a+i.length});return}let l=i.prop(an.mounted);if(l){if(l.tree.prop(Wu)==this.data){if(l.overlay)for(let c of l.overlay)r.push({from:c.from+a,to:c.to+a});else r.push({from:a,to:a+i.length});return}else if(l.overlay){let c=r.length;if(s(l.tree,l.overlay[0].from+a),r.length>c)return}}for(let c=0;c<i.children.length;c++){let d=i.children[c];d instanceof ur&&s(d,i.positions[c]+a)}};return s(Ss(e),0),r}get allowsNesting(){return!0}}Sa.setState=Qt.define();function w_(t,e,n){let r=t.facet(eu),s=Ss(t).topNode;if(!r||r.allowsNesting)for(let i=s;i;i=i.enter(e,n,hs.ExcludeBuffers))i.type.isTop&&(s=i);return s}class J0 extends Sa{constructor(e,n,r){super(e,n,[],r),this.parser=n}static define(e){let n=Hq(e.languageData);return new J0(n,e.parser.configure({props:[Wu.add(r=>r.isTop?n:void 0)]}),e.name)}configure(e,n){return new J0(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Ss(t){let e=t.field(Sa.state,!1);return e?e.tree:ur.empty}class Gce{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,n){let r=this.cursorPos-this.string.length;return e<r||n>=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-r,n-r)}}let Hm=null;class rf{constructor(e,n,r=[],s,i,a,l,c){this.parser=e,this.state=n,this.fragments=r,this.tree=s,this.treeLen=i,this.viewport=a,this.skipped=l,this.scheduleOn=c,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new rf(e,n,[],ur.empty,0,r,[],null)}startParse(){return this.parser.startParse(new Gce(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=ur.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let s=Date.now()+e;e=()=>Date.now()>s}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n<this.state.doc.length&&this.parse.stopAt(n);;){let s=this.parse.advance();if(s)if(this.fragments=this.withoutTempSkipped(rd.addTree(s,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=s,this.parse=null,this.treeLen<(n??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,n;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(rd.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=Hm;Hm=this;try{return e()}finally{Hm=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=S_(e,n.from,n.to);return e}changes(e,n){let{fragments:r,tree:s,treeLen:i,viewport:a,skipped:l}=this;if(this.takeTree(),!e.empty){let c=[];if(e.iterChangedRanges((d,h,m,g)=>c.push({fromA:d,toA:h,fromB:m,toB:g})),r=rd.applyChanges(r,c),s=ur.empty,i=0,a={from:e.mapPos(a.from,-1),to:e.mapPos(a.to,1)},this.skipped.length){l=[];for(let d of this.skipped){let h=e.mapPos(d.from,1),m=e.mapPos(d.to,-1);h<m&&l.push({from:h,to:m})}}}return new rf(this.parser,n,r,s,i,a,l,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let n=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:s,to:i}=this.skipped[r];s<e.to&&i>e.from&&(this.fragments=S_(this.fragments,s,i),this.skipped.splice(r--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends S6{createParse(n,r,s){let i=s[0].from,a=s[s.length-1].to;return{parsedPos:i,advance(){let c=Hm;if(c){for(let d of s)c.tempSkipped.push(d);e&&(c.scheduleOn=c.scheduleOn?Promise.all([c.scheduleOn,e]):e)}return this.parsedPos=a,new ur(ai.none,[],[],a-i)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let n=this.fragments;return this.treeLen>=e&&n.length&&n[0].from==0&&n[0].to>=e}static get(){return Hm}}function S_(t,e,n){return rd.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class sf{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new sf(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=rf.create(e.facet(eu).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new sf(r)}}Sa.state=Os.define({create:sf.init,update(t,e){for(let n of e.effects)if(n.is(Sa.setState))return n.value;return e.startState.facet(eu)!=e.state.facet(eu)?sf.init(e.state):t.apply(e)}});let Qq=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(Qq=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const Z4=typeof navigator<"u"&&(!((K4=navigator.scheduling)===null||K4===void 0)&&K4.isInputPending)?()=>navigator.scheduling.isInputPending():null,Xce=Yr.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let n=this.view.state.field(Sa.state).context;(n.updateViewport(e.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:e}=this.view,n=e.field(Sa.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=Qq(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEnd<n&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=n+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:r,viewport:{to:s}}=this.view,i=r.field(Sa.state);if(i.tree==i.context.tree&&i.context.isDone(s+1e5))return;let a=Date.now()+Math.min(this.chunkBudget,100,e&&!Z4?Math.max(25,e.timeRemaining()-5):1e9),l=i.context.treeLen<s&&r.doc.length>s+1e3,c=i.context.work(()=>Z4&&Z4()||Date.now()>a,s+(l?0:1e5));this.chunkBudget-=Date.now()-n,(c||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:Sa.setState.of(new sf(i.context))})),this.chunkBudget>0&&!(c&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>bi(this.view.state,n)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),eu=st.define({combine(t){return t.length?t[0]:null},enables:t=>[Sa.state,Xce,Ze.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class Vq{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}}const Yce=st.define(),Zp=st.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(n=>n!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function dd(t){let e=t.facet(Zp);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function ep(t,e){let n="",r=t.tabSize,s=t.facet(Zp)[0];if(s==" "){for(;e>=r;)n+=" ",e-=r;s=" "}for(let i=0;i<e;i++)n+=s;return n}function O6(t,e){t instanceof Nn&&(t=new xb(t));for(let r of t.state.facet(Yce)){let s=r(t,e);if(s!==void 0)return s}let n=Ss(t.state);return n.length>=e?Kce(t,n,e):null}class xb{constructor(e,n={}){this.state=e,this.options=n,this.unit=dd(e)}lineAt(e,n=1){let r=this.state.doc.lineAt(e),{simulateBreak:s,simulateDoubleBreak:i}=this.options;return s!=null&&s>=r.from&&s<=r.to?i&&s==e?{text:"",from:e}:(n<0?s<e:s<=e)?{text:r.text.slice(s-r.from),from:s}:{text:r.text.slice(0,s-r.from),from:r.from}:r}textAfterPos(e,n=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:r,from:s}=this.lineAt(e,n);return r.slice(e-s,Math.min(r.length,e+100-s))}column(e,n=1){let{text:r,from:s}=this.lineAt(e,n),i=this.countColumn(r,e-s),a=this.options.overrideIndentation?this.options.overrideIndentation(s):-1;return a>-1&&(i+=a-this.countColumn(r,r.search(/\S|$/))),i}countColumn(e,n=e.length){return Cf(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:r,from:s}=this.lineAt(e,n),i=this.options.overrideIndentation;if(i){let a=i(s);if(a>-1)return a}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const vb=new an;function Kce(t,e,n){let r=e.resolveStack(n),s=e.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(s!=r.node){let i=[];for(let a=s;a&&!(a.from<r.node.from||a.to>r.node.to||a.from==r.node.from&&a.type==r.node.type);a=a.parent)i.push(a);for(let a=i.length-1;a>=0;a--)r={node:i[a],next:r}}return Uq(r,t,n)}function Uq(t,e,n){for(let r=t;r;r=r.next){let s=Jce(r.node);if(s)return s(j6.create(e,n,r))}return 0}function Zce(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function Jce(t){let e=t.type.prop(vb);if(e)return e;let n=t.firstChild,r;if(n&&(r=n.type.prop(an.closedBy))){let s=t.lastChild,i=s&&r.indexOf(s.name)>-1;return a=>Wq(a,!0,1,void 0,i&&!Zce(a)?s.from:void 0)}return t.parent==null?eue:null}function eue(){return 0}class j6 extends xb{constructor(e,n,r){super(e.state,e.options),this.base=e,this.pos=n,this.context=r}get node(){return this.context.node}static create(e,n,r){return new j6(e,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let n=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(n.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(tue(r,e))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return Uq(this.context.next,this.base,this.pos)}}function tue(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function nue(t){let e=t.node,n=e.childAfter(e.from),r=e.lastChild;if(!n)return null;let s=t.options.simulateBreak,i=t.state.doc.lineAt(n.from),a=s==null||s<=i.from?i.to:Math.min(i.to,s);for(let l=n.to;;){let c=e.childAfter(l);if(!c||c==r)return null;if(!c.type.isSkipped){if(c.from>=a)return null;let d=/^ */.exec(i.text.slice(n.to-i.from))[0].length;return{from:n.from,to:n.to+d}}l=c.to}}function J4({closing:t,align:e=!0,units:n=1}){return r=>Wq(r,e,n,t)}function Wq(t,e,n,r,s){let i=t.textAfter,a=i.match(/^\s*/)[0].length,l=r&&i.slice(a,a+r.length)==r||s==t.pos+a,c=e?nue(t):null;return c?l?t.column(c.from):t.column(c.to):t.baseIndent+(l?0:t.unit*n)}function k_({except:t,units:e=1}={}){return n=>{let r=t&&t.test(n.textAfter);return n.baseIndent+(r?0:e*n.unit)}}const rue=200;function sue(){return Nn.transactionFilter.of(t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let n=t.newDoc,{head:r}=t.newSelection.main,s=n.lineAt(r);if(r>s.from+rue)return t;let i=n.sliceString(s.from,r);if(!e.some(d=>d.test(i)))return t;let{state:a}=t,l=-1,c=[];for(let{head:d}of a.selection.ranges){let h=a.doc.lineAt(d);if(h.from==l)continue;l=h.from;let m=O6(a,h.from);if(m==null)continue;let g=/^\s*/.exec(h.text)[0],x=ep(a,m);g!=x&&c.push({from:h.from,to:h.from+g.length,insert:x})}return c.length?[t,{changes:c,sequential:!0}]:t})}const iue=st.define(),N6=new an;function Gq(t){let e=t.firstChild,n=t.lastChild;return e&&e.to<n.from?{from:e.to,to:n.type.isError?t.to:n.from}:null}function aue(t,e,n){let r=Ss(t);if(r.length<n)return null;let s=r.resolveStack(n,1),i=null;for(let a=s;a;a=a.next){let l=a.node;if(l.to<=n||l.from>n)continue;if(i&&l.from<e)break;let c=l.type.prop(N6);if(c&&(l.to<r.length-50||r.length==t.doc.length||!oue(l))){let d=c(l,t);d&&d.from<=n&&d.from>=e&&d.to>n&&(i=d)}}return i}function oue(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function ry(t,e,n){for(let r of t.facet(iue)){let s=r(t,e,n);if(s)return s}return aue(t,e,n)}function Xq(t,e){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);return n>=r?void 0:{from:n,to:r}}const yb=Qt.define({map:Xq}),Jp=Qt.define({map:Xq});function Yq(t){let e=[];for(let{head:n}of t.state.selection.ranges)e.some(r=>r.from<=n&&r.to>=n)||e.push(t.lineBlockAt(n));return e}const hd=Os.define({create(){return Ot.none},update(t,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((n,r)=>t=O_(t,n,r)),t=t.map(e.changes);for(let n of e.effects)if(n.is(yb)&&!lue(t,n.value.from,n.value.to)){let{preparePlaceholder:r}=e.state.facet(Jq),s=r?Ot.replace({widget:new pue(r(e.state,n.value))}):j_;t=t.update({add:[s.range(n.value.from,n.value.to)]})}else n.is(Jp)&&(t=t.update({filter:(r,s)=>n.value.from!=r||n.value.to!=s,filterFrom:n.value.from,filterTo:n.value.to}));return e.selection&&(t=O_(t,e.selection.main.head)),t},provide:t=>Ze.decorations.from(t),toJSON(t,e){let n=[];return t.between(0,e.doc.length,(r,s)=>{n.push(r,s)}),n},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let n=0;n<t.length;){let r=t[n++],s=t[n++];if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid JSON for fold state");e.push(j_.range(r,s))}return Ot.set(e,!0)}});function O_(t,e,n=e){let r=!1;return t.between(e,n,(s,i)=>{s<n&&i>e&&(r=!0)}),r?t.update({filterFrom:e,filterTo:n,filter:(s,i)=>s>=n||i<=e}):t}function sy(t,e,n){var r;let s=null;return(r=t.field(hd,!1))===null||r===void 0||r.between(e,n,(i,a)=>{(!s||s.from>i)&&(s={from:i,to:a})}),s}function lue(t,e,n){let r=!1;return t.between(e,e,(s,i)=>{s==e&&i==n&&(r=!0)}),r}function Kq(t,e){return t.field(hd,!1)?e:e.concat(Qt.appendConfig.of(e$()))}const cue=t=>{for(let e of Yq(t)){let n=ry(t.state,e.from,e.to);if(n)return t.dispatch({effects:Kq(t.state,[yb.of(n),Zq(t,n)])}),!0}return!1},uue=t=>{if(!t.state.field(hd,!1))return!1;let e=[];for(let n of Yq(t)){let r=sy(t.state,n.from,n.to);r&&e.push(Jp.of(r),Zq(t,r,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function Zq(t,e,n=!0){let r=t.state.doc.lineAt(e.from).number,s=t.state.doc.lineAt(e.to).number;return Ze.announce.of(`${t.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${t.state.phrase("to")} ${s}.`)}const due=t=>{let{state:e}=t,n=[];for(let r=0;r<e.doc.length;){let s=t.lineBlockAt(r),i=ry(e,s.from,s.to);i&&n.push(yb.of(i)),r=(i?t.lineBlockAt(i.to):s).to+1}return n.length&&t.dispatch({effects:Kq(t.state,n)}),!!n.length},hue=t=>{let e=t.state.field(hd,!1);if(!e||!e.size)return!1;let n=[];return e.between(0,t.state.doc.length,(r,s)=>{n.push(Jp.of({from:r,to:s}))}),t.dispatch({effects:n}),!0},fue=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:cue},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:uue},{key:"Ctrl-Alt-[",run:due},{key:"Ctrl-Alt-]",run:hue}],mue={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},Jq=st.define({combine(t){return Vo(t,mue)}});function e$(t){return[hd,vue]}function t$(t,e){let{state:n}=t,r=n.facet(Jq),s=a=>{let l=t.lineBlockAt(t.posAtDOM(a.target)),c=sy(t.state,l.from,l.to);c&&t.dispatch({effects:Jp.of(c)}),a.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(t,s,e);let i=document.createElement("span");return i.textContent=r.placeholderText,i.setAttribute("aria-label",n.phrase("folded code")),i.title=n.phrase("unfold"),i.className="cm-foldPlaceholder",i.onclick=s,i}const j_=Ot.replace({widget:new class extends Uo{toDOM(t){return t$(t,null)}}});class pue extends Uo{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return t$(e,this.value)}}const gue={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class eS extends Vl{constructor(e,n){super(),this.config=e,this.open=n}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let n=document.createElement("span");return n.textContent=this.open?this.config.openText:this.config.closedText,n.title=e.state.phrase(this.open?"Fold line":"Unfold line"),n}}function xue(t={}){let e={...gue,...t},n=new eS(e,!0),r=new eS(e,!1),s=Yr.fromClass(class{constructor(a){this.from=a.viewport.from,this.markers=this.buildMarkers(a)}update(a){(a.docChanged||a.viewportChanged||a.startState.facet(eu)!=a.state.facet(eu)||a.startState.field(hd,!1)!=a.state.field(hd,!1)||Ss(a.startState)!=Ss(a.state)||e.foldingChanged(a))&&(this.markers=this.buildMarkers(a.view))}buildMarkers(a){let l=new Hl;for(let c of a.viewportLineBlocks){let d=sy(a.state,c.from,c.to)?r:ry(a.state,c.from,c.to)?n:null;d&&l.add(c.from,c.from,d)}return l.finish()}}),{domEventHandlers:i}=e;return[s,bce({class:"cm-foldGutter",markers(a){var l;return((l=a.plugin(s))===null||l===void 0?void 0:l.markers)||Bn.empty},initialSpacer(){return new eS(e,!1)},domEventHandlers:{...i,click:(a,l,c)=>{if(i.click&&i.click(a,l,c))return!0;let d=sy(a.state,l.from,l.to);if(d)return a.dispatch({effects:Jp.of(d)}),!0;let h=ry(a.state,l.from,l.to);return h?(a.dispatch({effects:yb.of(h)}),!0):!1}}}),e$()]}const vue=Ze.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class eg{constructor(e,n){this.specs=e;let r;function s(l){let c=Yc.newName();return(r||(r=Object.create(null)))["."+c]=l,c}const i=typeof n.all=="string"?n.all:n.all?s(n.all):void 0,a=n.scope;this.scope=a instanceof Sa?l=>l.prop(Wu)==a.data:a?l=>l==a:void 0,this.style=$q(e.map(l=>({tag:l.tag,class:l.class||s(Object.assign({},l,{tag:null}))})),{all:i}).style,this.module=r?new Yc(r):null,this.themeType=n.themeType}static define(e,n){return new eg(e,n||{})}}const oO=st.define(),n$=st.define({combine(t){return t.length?[t[0]]:null}});function tS(t){let e=t.facet(oO);return e.length?e:t.facet(n$)}function r$(t,e){let n=[bue],r;return t instanceof eg&&(t.module&&n.push(Ze.styleModule.of(t.module)),r=t.themeType),e?.fallback?n.push(n$.of(t)):r?n.push(oO.computeN([Ze.darkTheme],s=>s.facet(Ze.darkTheme)==(r=="dark")?[t]:[])):n.push(oO.of(t)),n}class yue{constructor(e){this.markCache=Object.create(null),this.tree=Ss(e.state),this.decorations=this.buildDeco(e,tS(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=Ss(e.state),r=tS(e.state),s=r!=tS(e.startState),{viewport:i}=e.view,a=e.changes.mapPos(this.decoratedTo,1);n.length<i.to&&!s&&n.type==this.tree.type&&a>=i.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=a):(n!=this.tree||e.viewportChanged||s)&&(this.tree=n,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=i.to)}buildDeco(e,n){if(!n||!this.tree.length)return Ot.none;let r=new Hl;for(let{from:s,to:i}of e.visibleRanges)Qce(this.tree,n,(a,l,c)=>{r.add(a,l,this.markCache[c]||(this.markCache[c]=Ot.mark({class:c})))},s,i);return r.finish()}}const bue=uu.high(Yr.fromClass(yue,{decorations:t=>t.decorations})),wue=eg.define([{tag:ye.meta,color:"#404740"},{tag:ye.link,textDecoration:"underline"},{tag:ye.heading,textDecoration:"underline",fontWeight:"bold"},{tag:ye.emphasis,fontStyle:"italic"},{tag:ye.strong,fontWeight:"bold"},{tag:ye.strikethrough,textDecoration:"line-through"},{tag:ye.keyword,color:"#708"},{tag:[ye.atom,ye.bool,ye.url,ye.contentSeparator,ye.labelName],color:"#219"},{tag:[ye.literal,ye.inserted],color:"#164"},{tag:[ye.string,ye.deleted],color:"#a11"},{tag:[ye.regexp,ye.escape,ye.special(ye.string)],color:"#e40"},{tag:ye.definition(ye.variableName),color:"#00f"},{tag:ye.local(ye.variableName),color:"#30a"},{tag:[ye.typeName,ye.namespace],color:"#085"},{tag:ye.className,color:"#167"},{tag:[ye.special(ye.variableName),ye.macroName],color:"#256"},{tag:ye.definition(ye.propertyName),color:"#00c"},{tag:ye.comment,color:"#940"},{tag:ye.invalid,color:"#f00"}]),Sue=Ze.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),s$=1e4,i$="()[]{}",a$=st.define({combine(t){return Vo(t,{afterCursor:!0,brackets:i$,maxScanDistance:s$,renderMatch:jue})}}),kue=Ot.mark({class:"cm-matchingBracket"}),Oue=Ot.mark({class:"cm-nonmatchingBracket"});function jue(t){let e=[],n=t.matched?kue:Oue;return e.push(n.range(t.start.from,t.start.to)),t.end&&e.push(n.range(t.end.from,t.end.to)),e}const Nue=Os.define({create(){return Ot.none},update(t,e){if(!e.docChanged&&!e.selection)return t;let n=[],r=e.state.facet(a$);for(let s of e.state.selection.ranges){if(!s.empty)continue;let i=To(e.state,s.head,-1,r)||s.head>0&&To(e.state,s.head-1,1,r)||r.afterCursor&&(To(e.state,s.head,1,r)||s.head<e.state.doc.length&&To(e.state,s.head+1,-1,r));i&&(n=n.concat(r.renderMatch(i,e.state)))}return Ot.set(n,!0)},provide:t=>Ze.decorations.from(t)}),Cue=[Nue,Sue];function Tue(t={}){return[a$.of(t),Cue]}const Eue=new an;function lO(t,e,n){let r=t.prop(e<0?an.openedBy:an.closedBy);if(r)return r;if(t.name.length==1){let s=n.indexOf(t.name);if(s>-1&&s%2==(e<0?1:0))return[n[s+e]]}return null}function cO(t){let e=t.type.prop(Eue);return e?e(t.node):t}function To(t,e,n,r={}){let s=r.maxScanDistance||s$,i=r.brackets||i$,a=Ss(t),l=a.resolveInner(e,n);for(let c=l;c;c=c.parent){let d=lO(c.type,n,i);if(d&&c.from<c.to){let h=cO(c);if(h&&(n>0?e>=h.from&&e<h.to:e>h.from&&e<=h.to))return _ue(t,e,n,c,h,d,i)}}return Aue(t,e,n,a,l.type,s,i)}function _ue(t,e,n,r,s,i,a){let l=r.parent,c={from:s.from,to:s.to},d=0,h=l?.cursor();if(h&&(n<0?h.childBefore(r.from):h.childAfter(r.to)))do if(n<0?h.to<=r.from:h.from>=r.to){if(d==0&&i.indexOf(h.type.name)>-1&&h.from<h.to){let m=cO(h);return{start:c,end:m?{from:m.from,to:m.to}:void 0,matched:!0}}else if(lO(h.type,n,a))d++;else if(lO(h.type,-n,a)){if(d==0){let m=cO(h);return{start:c,end:m&&m.from<m.to?{from:m.from,to:m.to}:void 0,matched:!1}}d--}}while(n<0?h.prevSibling():h.nextSibling());return{start:c,matched:!1}}function Aue(t,e,n,r,s,i,a){let l=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),c=a.indexOf(l);if(c<0||c%2==0!=n>0)return null;let d={from:n<0?e-1:e,to:n>0?e+1:e},h=t.doc.iterRange(e,n>0?t.doc.length:0),m=0;for(let g=0;!h.next().done&&g<=i;){let x=h.value;n<0&&(g+=x.length);let y=e+g*n;for(let w=n>0?0:x.length-1,S=n>0?x.length:-1;w!=S;w+=n){let k=a.indexOf(x[w]);if(!(k<0||r.resolveInner(y+w,1).type!=s))if(k%2==0==n>0)m++;else{if(m==1)return{start:d,end:{from:y+w,to:y+w+1},matched:k>>1==c>>1};m--}}n>0&&(g+=x.length)}return h.done?{start:d,matched:!1}:null}function N_(t,e,n,r=0,s=0){e==null&&(e=t.search(/[^\s\u00a0]/),e==-1&&(e=t.length));let i=s;for(let a=r;a<e;a++)t.charCodeAt(a)==9?i+=n-i%n:i++;return i}class o${constructor(e,n,r,s){this.string=e,this.tabSize=n,this.indentUnit=r,this.overrideIndent=s,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}eol(){return this.pos>=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}eat(e){let n=this.string.charAt(this.pos),r;if(typeof e=="string"?r=n==e:r=n&&(e instanceof RegExp?e.test(n):e(n)),r)return++this.pos,n}eatWhile(e){let n=this.pos;for(;this.eat(e););return this.pos>n}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let n=this.string.indexOf(e,this.pos);if(n>-1)return this.pos=n,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPos<this.start&&(this.lastColumnValue=N_(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){var e;return(e=this.overrideIndent)!==null&&e!==void 0?e:N_(this.string,null,this.tabSize)}match(e,n,r){if(typeof e=="string"){let s=a=>r?a.toLowerCase():a,i=this.string.substr(this.pos,e.length);return s(i)==s(e)?(n!==!1&&(this.pos+=e.length),!0):null}else{let s=this.string.slice(this.pos).match(e);return s&&s.index>0?null:(s&&n!==!1&&(this.pos+=s[0].length),s)}}current(){return this.string.slice(this.start,this.pos)}}function Mue(t){return{name:t.name||"",token:t.token,blankLine:t.blankLine||(()=>{}),startState:t.startState||(()=>!0),copyState:t.copyState||Rue,indent:t.indent||(()=>null),languageData:t.languageData||{},tokenTable:t.tokenTable||E6,mergeTokens:t.mergeTokens!==!1}}function Rue(t){if(typeof t!="object")return t;let e={};for(let n in t){let r=t[n];e[n]=r instanceof Array?r.slice():r}return e}const C_=new WeakMap;class C6 extends Sa{constructor(e){let n=Hq(e.languageData),r=Mue(e),s,i=new class extends S6{createParse(a,l,c){return new Pue(s,a,l,c)}};super(n,i,[],e.name),this.topNode=Lue(n,this),s=this,this.streamParser=r,this.stateAfter=new an({perNode:!0}),this.tokenTable=e.tokenTable?new d$(r.tokenTable):Iue}static define(e){return new C6(e)}getIndent(e){let n,{overrideIndentation:r}=e.options;r&&(n=C_.get(e.state),n!=null&&n<e.pos-1e4&&(n=void 0));let s=T6(this,e.node.tree,e.node.from,e.node.from,n??e.pos),i,a;if(s?(a=s.state,i=s.pos+1):(a=this.streamParser.startState(e.unit),i=e.node.from),e.pos-i>1e4)return null;for(;i<e.pos;){let c=e.state.doc.lineAt(i),d=Math.min(e.pos,c.to);if(c.length){let h=r?r(c.from):-1,m=new o$(c.text,e.state.tabSize,e.unit,h<0?void 0:h);for(;m.pos<d-c.from;)c$(this.streamParser.token,m,a)}else this.streamParser.blankLine(a,e.unit);if(d==e.pos)break;i=c.to+1}let l=e.lineAt(e.pos);return r&&n==null&&C_.set(e.state,l.from),this.streamParser.indent(a,/^\s*(.*)/.exec(l.text)[1],e)}get allowsNesting(){return!1}}function T6(t,e,n,r,s){let i=n>=r&&n+e.length<=s&&e.prop(t.stateAfter);if(i)return{state:t.streamParser.copyState(i),pos:n+e.length};for(let a=e.children.length-1;a>=0;a--){let l=e.children[a],c=n+e.positions[a],d=l instanceof ur&&c<s&&T6(t,l,c,r,s);if(d)return d}return null}function l$(t,e,n,r,s){if(s&&n<=0&&r>=e.length)return e;!s&&n==0&&e.type==t.topNode&&(s=!0);for(let i=e.children.length-1;i>=0;i--){let a=e.positions[i],l=e.children[i],c;if(a<r&&l instanceof ur){if(!(c=l$(t,l,n-a,r-a,s)))break;return s?new ur(e.type,e.children.slice(0,i).concat(c),e.positions.slice(0,i+1),a+c.length):c}}return null}function Due(t,e,n,r,s){for(let i of e){let a=i.from+(i.openStart?25:0),l=i.to-(i.openEnd?25:0),c=a<=n&&l>n&&T6(t,i.tree,0-i.offset,n,l),d;if(c&&c.pos<=r&&(d=l$(t,i.tree,n+i.offset,c.pos+i.offset,!1)))return{state:c.state,tree:d}}return{state:t.streamParser.startState(s?dd(s):4),tree:ur.empty}}let Pue=class{constructor(e,n,r,s){this.lang=e,this.input=n,this.fragments=r,this.ranges=s,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=s[s.length-1].to;let i=rf.get(),a=s[0].from,{state:l,tree:c}=Due(e,r,a,this.to,i?.state);this.state=l,this.parsedPos=this.chunkStart=a+c.length;for(let d=0;d<c.children.length;d++)this.chunks.push(c.children[d]),this.chunkPos.push(c.positions[d]);i&&this.parsedPos<i.viewport.from-1e5&&s.some(d=>d.from<=i.viewport.from&&d.to>=i.viewport.from)&&(this.state=this.lang.streamParser.startState(dd(i.state)),i.skipUntilInView(this.parsedPos,i.viewport.from),this.parsedPos=i.viewport.from),this.moveRangeIndex()}advance(){let e=rf.get(),n=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),r=Math.min(n,this.chunkStart+512);for(e&&(r=Math.min(r,e.viewport.to));this.parsedPos<r;)this.parseLine(e);return this.chunkStart<this.parsedPos&&this.finishChunk(),this.parsedPos>=n?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,n),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let n=this.input.chunk(e);if(this.input.lineChunks)n==`
|
||
`&&(n="");else{let r=n.indexOf(`
|
||
`);r>-1&&(n=n.slice(0,r))}return e+n.length<=this.to?n:n.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,n=this.lineAfter(e),r=e+n.length;for(let s=this.rangeIndex;;){let i=this.ranges[s].to;if(i>=r||(n=n.slice(0,i-(r-n.length)),s++,s==this.ranges.length))break;let a=this.ranges[s].from,l=this.lineAfter(a);n+=l,r=a+l.length}return{line:n,end:r}}skipGapsTo(e,n,r){for(;;){let s=this.ranges[this.rangeIndex].to,i=e+n;if(r>0?s>i:s>=i)break;let a=this.ranges[++this.rangeIndex].from;n+=a-s}return n}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,n,r,s){let i=4;if(this.ranges.length>1){s=this.skipGapsTo(n,s,1),n+=s;let l=this.chunk.length;s=this.skipGapsTo(r,s,-1),r+=s,i+=this.chunk.length-l}let a=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&i==4&&a>=0&&this.chunk[a]==e&&this.chunk[a+2]==n?this.chunk[a+2]=r:this.chunk.push(e,n,r,i),s}parseLine(e){let{line:n,end:r}=this.nextLine(),s=0,{streamParser:i}=this.lang,a=new o$(n,e?e.state.tabSize:4,e?dd(e.state):2);if(a.eol())i.blankLine(this.state,a.indentUnit);else for(;!a.eol();){let l=c$(i.token,a,this.state);if(l&&(s=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+a.start,this.parsedPos+a.pos,s)),a.start>1e4)break}this.parsedPos=r,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=ur.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:zue,topID:0,maxBufferLength:512,reused:this.chunkReused});e=new ur(e.type,e.children,e.positions,e.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(e),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new ur(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}};function c$(t,e,n){e.start=e.pos;for(let r=0;r<10;r++){let s=t(e,n);if(e.pos>e.start)return s}throw new Error("Stream parser failed to advance stream.")}const E6=Object.create(null),tp=[ai.none],zue=new gb(tp),T_=[],E_=Object.create(null),u$=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])u$[t]=h$(E6,e);class d${constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),u$)}resolve(e){return e?this.table[e]||(this.table[e]=h$(this.extra,e)):0}}const Iue=new d$(E6);function nS(t,e){T_.indexOf(t)>-1||(T_.push(t),console.warn(e))}function h$(t,e){let n=[];for(let l of e.split(" ")){let c=[];for(let d of l.split(".")){let h=t[d]||ye[d];h?typeof h=="function"?c.length?c=c.map(h):nS(d,`Modifier ${d} used at start of tag`):c.length?nS(d,`Tag ${d} used as modifier`):c=Array.isArray(h)?h:[h]:nS(d,`Unknown highlighting tag ${d}`)}for(let d of c)n.push(d)}if(!n.length)return 0;let r=e.replace(/ /g,"_"),s=r+" "+n.map(l=>l.id),i=E_[s];if(i)return i.id;let a=E_[s]=ai.define({id:tp.length,name:r,props:[k6({[r]:n})]});return tp.push(a),a.id}function Lue(t,e){let n=ai.define({id:tp.length,name:"Document",props:[Wu.add(()=>t),vb.add(()=>r=>e.getIndent(r))],top:!0});return tp.push(n),n}br.RTL,br.LTR;const Bue=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),r=A6(t.state,n.from);return r.line?Fue(t):r.block?$ue(t):!1};function _6(t,e){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let s=t(e,n);return s?(r(n.update(s)),!0):!1}}const Fue=_6(Vue,0),que=_6(f$,0),$ue=_6((t,e)=>f$(t,e,Que(e)),0);function A6(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}const Qm=50;function Hue(t,{open:e,close:n},r,s){let i=t.sliceDoc(r-Qm,r),a=t.sliceDoc(s,s+Qm),l=/\s*$/.exec(i)[0].length,c=/^\s*/.exec(a)[0].length,d=i.length-l;if(i.slice(d-e.length,d)==e&&a.slice(c,c+n.length)==n)return{open:{pos:r-l,margin:l&&1},close:{pos:s+c,margin:c&&1}};let h,m;s-r<=2*Qm?h=m=t.sliceDoc(r,s):(h=t.sliceDoc(r,r+Qm),m=t.sliceDoc(s-Qm,s));let g=/^\s*/.exec(h)[0].length,x=/\s*$/.exec(m)[0].length,y=m.length-x-n.length;return h.slice(g,g+e.length)==e&&m.slice(y,y+n.length)==n?{open:{pos:r+g+e.length,margin:/\s/.test(h.charAt(g+e.length))?1:0},close:{pos:s-x-n.length,margin:/\s/.test(m.charAt(y-1))?1:0}}:null}function Que(t){let e=[];for(let n of t.selection.ranges){let r=t.doc.lineAt(n.from),s=n.to<=r.to?r:t.doc.lineAt(n.to);s.from>r.from&&s.from==n.to&&(s=n.to==r.to+1?r:t.doc.lineAt(n.to-1));let i=e.length-1;i>=0&&e[i].to>r.from?e[i].to=s.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:s.to})}return e}function f$(t,e,n=e.selection.ranges){let r=n.map(i=>A6(e,i.from).block);if(!r.every(i=>i))return null;let s=n.map((i,a)=>Hue(e,r[a],i.from,i.to));if(t!=2&&!s.every(i=>i))return{changes:e.changes(n.map((i,a)=>s[a]?[]:[{from:i.from,insert:r[a].open+" "},{from:i.to,insert:" "+r[a].close}]))};if(t!=1&&s.some(i=>i)){let i=[];for(let a=0,l;a<s.length;a++)if(l=s[a]){let c=r[a],{open:d,close:h}=l;i.push({from:d.pos-c.open.length,to:d.pos+d.margin},{from:h.pos-h.margin,to:h.pos+c.close.length})}return{changes:i}}return null}function Vue(t,e,n=e.selection.ranges){let r=[],s=-1;for(let{from:i,to:a}of n){let l=r.length,c=1e9,d=A6(e,i).line;if(d){for(let h=i;h<=a;){let m=e.doc.lineAt(h);if(m.from>s&&(i==a||a>m.from)){s=m.from;let g=/^\s*/.exec(m.text)[0].length,x=g==m.length,y=m.text.slice(g,g+d.length)==d?g:-1;g<m.text.length&&g<c&&(c=g),r.push({line:m,comment:y,token:d,indent:g,empty:x,single:!1})}h=m.to+1}if(c<1e9)for(let h=l;h<r.length;h++)r[h].indent<r[h].line.text.length&&(r[h].indent=c);r.length==l+1&&(r[l].single=!0)}}if(t!=2&&r.some(i=>i.comment<0&&(!i.empty||i.single))){let i=[];for(let{line:l,token:c,indent:d,empty:h,single:m}of r)(m||!h)&&i.push({from:l.from+d,insert:c+" "});let a=e.changes(i);return{changes:a,selection:e.selection.map(a,1)}}else if(t!=1&&r.some(i=>i.comment>=0)){let i=[];for(let{line:a,comment:l,token:c}of r)if(l>=0){let d=a.from+l,h=d+c.length;a.text[h-a.from]==" "&&h++,i.push({from:d,to:h})}return{changes:i}}return null}const uO=Qo.define(),Uue=Qo.define(),Wue=st.define(),m$=st.define({combine(t){return Vo(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(r,s)=>e(r,s)||n(r,s)})}}),p$=Os.define({create(){return Eo.empty},update(t,e){let n=e.state.facet(m$),r=e.annotation(uO);if(r){let c=wi.fromTransaction(e,r.selection),d=r.side,h=d==0?t.undone:t.done;return c?h=iy(h,h.length,n.minDepth,c):h=v$(h,e.startState.selection),new Eo(d==0?r.rest:h,d==0?h:r.rest)}let s=e.annotation(Uue);if((s=="full"||s=="before")&&(t=t.isolate()),e.annotation(ss.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let i=wi.fromTransaction(e),a=e.annotation(ss.time),l=e.annotation(ss.userEvent);return i?t=t.addChanges(i,a,l,n,e):e.selection&&(t=t.addSelection(e.startState.selection,a,l,n.newGroupDelay)),(s=="full"||s=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new Eo(t.done.map(wi.fromJSON),t.undone.map(wi.fromJSON))}});function Gue(t={}){return[p$,m$.of(t),Ze.domEventHandlers({beforeinput(e,n){let r=e.inputType=="historyUndo"?g$:e.inputType=="historyRedo"?dO:null;return r?(e.preventDefault(),r(n)):!1}})]}function bb(t,e){return function({state:n,dispatch:r}){if(!e&&n.readOnly)return!1;let s=n.field(p$,!1);if(!s)return!1;let i=s.pop(t,n,e);return i?(r(i),!0):!1}}const g$=bb(0,!1),dO=bb(1,!1),Xue=bb(0,!0),Yue=bb(1,!0);class wi{constructor(e,n,r,s,i){this.changes=e,this.effects=n,this.mapped=r,this.startSelection=s,this.selectionsAfter=i}setSelAfter(e){return new wi(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(e){return new wi(e.changes&&us.fromJSON(e.changes),[],e.mapped&&Io.fromJSON(e.mapped),e.startSelection&&Me.fromJSON(e.startSelection),e.selectionsAfter.map(Me.fromJSON))}static fromTransaction(e,n){let r=ka;for(let s of e.startState.facet(Wue)){let i=s(e);i.length&&(r=r.concat(i))}return!r.length&&e.changes.empty?null:new wi(e.changes.invert(e.startState.doc),r,void 0,n||e.startState.selection,ka)}static selection(e){return new wi(void 0,ka,void 0,void 0,e)}}function iy(t,e,n,r){let s=e+1>n+20?e-n-1:0,i=t.slice(s,e);return i.push(r),i}function Kue(t,e){let n=[],r=!1;return t.iterChangedRanges((s,i)=>n.push(s,i)),e.iterChangedRanges((s,i,a,l)=>{for(let c=0;c<n.length;){let d=n[c++],h=n[c++];l>=d&&a<=h&&(r=!0)}}),r}function Zue(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,r)=>n.empty!=e.ranges[r].empty).length===0}function x$(t,e){return t.length?e.length?t.concat(e):t:e}const ka=[],Jue=200;function v$(t,e){if(t.length){let n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-Jue));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),iy(t,t.length-1,1e9,n.setSelAfter(r)))}else return[wi.selection([e])]}function ede(t){let e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}function rS(t,e){if(!t.length)return t;let n=t.length,r=ka;for(;n;){let s=tde(t[n-1],e,r);if(s.changes&&!s.changes.empty||s.effects.length){let i=t.slice(0,n);return i[n-1]=s,i}else e=s.mapped,n--,r=s.selectionsAfter}return r.length?[wi.selection(r)]:ka}function tde(t,e,n){let r=x$(t.selectionsAfter.length?t.selectionsAfter.map(l=>l.map(e)):ka,n);if(!t.changes)return wi.selection(r);let s=t.changes.map(e),i=e.mapDesc(t.changes,!0),a=t.mapped?t.mapped.composeDesc(i):i;return new wi(s,Qt.mapEffects(t.effects,e),a,t.startSelection.map(i),r)}const nde=/^(input\.type|delete)($|\.)/;class Eo{constructor(e,n,r=0,s=void 0){this.done=e,this.undone=n,this.prevTime=r,this.prevUserEvent=s}isolate(){return this.prevTime?new Eo(this.done,this.undone):this}addChanges(e,n,r,s,i){let a=this.done,l=a[a.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!r||nde.test(r))&&(!l.selectionsAfter.length&&n-this.prevTime<s.newGroupDelay&&s.joinToEvent(i,Kue(l.changes,e.changes))||r=="input.type.compose")?a=iy(a,a.length-1,s.minDepth,new wi(e.changes.compose(l.changes),x$(Qt.mapEffects(e.effects,l.changes),l.effects),l.mapped,l.startSelection,ka)):a=iy(a,a.length,s.minDepth,e),new Eo(a,ka,n,r)}addSelection(e,n,r,s){let i=this.done.length?this.done[this.done.length-1].selectionsAfter:ka;return i.length>0&&n-this.prevTime<s&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&Zue(i[i.length-1],e)?this:new Eo(v$(this.done,e),this.undone,n,r)}addMapping(e){return new Eo(rS(this.done,e),rS(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,n,r){let s=e==0?this.done:this.undone;if(s.length==0)return null;let i=s[s.length-1],a=i.selectionsAfter[0]||n.selection;if(r&&i.selectionsAfter.length)return n.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:uO.of({side:e,rest:ede(s),selection:a}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(i.changes){let l=s.length==1?ka:s.slice(0,s.length-1);return i.mapped&&(l=rS(l,i.mapped)),n.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:uO.of({side:e,rest:l,selection:a}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}Eo.empty=new Eo(ka,ka);const rde=[{key:"Mod-z",run:g$,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:dO,preventDefault:!0},{linux:"Ctrl-Shift-z",run:dO,preventDefault:!0},{key:"Mod-u",run:Xue,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:Yue,preventDefault:!0}];function Tf(t,e){return Me.create(t.ranges.map(e),t.mainIndex)}function ro(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function so({state:t,dispatch:e},n){let r=Tf(t.selection,n);return r.eq(t.selection,!0)?!1:(e(ro(t,r)),!0)}function wb(t,e){return Me.cursor(e?t.to:t.from)}function y$(t,e){return so(t,n=>n.empty?t.moveByChar(n,e):wb(n,e))}function Ws(t){return t.textDirectionAt(t.state.selection.main.head)==br.LTR}const b$=t=>y$(t,!Ws(t)),w$=t=>y$(t,Ws(t));function S$(t,e){return so(t,n=>n.empty?t.moveByGroup(n,e):wb(n,e))}const sde=t=>S$(t,!Ws(t)),ide=t=>S$(t,Ws(t));function ade(t,e,n){if(e.type.prop(n))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function Sb(t,e,n){let r=Ss(t).resolveInner(e.head),s=n?an.closedBy:an.openedBy;for(let c=e.head;;){let d=n?r.childAfter(c):r.childBefore(c);if(!d)break;ade(t,d,s)?r=d:c=n?d.to:d.from}let i=r.type.prop(s),a,l;return i&&(a=n?To(t,r.from,1):To(t,r.to,-1))&&a.matched?l=n?a.end.to:a.end.from:l=n?r.to:r.from,Me.cursor(l,n?-1:1)}const ode=t=>so(t,e=>Sb(t.state,e,!Ws(t))),lde=t=>so(t,e=>Sb(t.state,e,Ws(t)));function k$(t,e){return so(t,n=>{if(!n.empty)return wb(n,e);let r=t.moveVertically(n,e);return r.head!=n.head?r:t.moveToLineBoundary(n,e)})}const O$=t=>k$(t,!1),j$=t=>k$(t,!0);function N$(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,n=0,r=0,s;if(e){for(let i of t.state.facet(Ze.scrollMargins)){let a=i(t);a?.top&&(n=Math.max(a?.top,n)),a?.bottom&&(r=Math.max(a?.bottom,r))}s=t.scrollDOM.clientHeight-n-r}else s=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:e,height:Math.max(t.defaultLineHeight,s-5)}}function C$(t,e){let n=N$(t),{state:r}=t,s=Tf(r.selection,a=>a.empty?t.moveVertically(a,e,n.height):wb(a,e));if(s.eq(r.selection))return!1;let i;if(n.selfScroll){let a=t.coordsAtPos(r.selection.main.head),l=t.scrollDOM.getBoundingClientRect(),c=l.top+n.marginTop,d=l.bottom-n.marginBottom;a&&a.top>c&&a.bottom<d&&(i=Ze.scrollIntoView(s.main.head,{y:"start",yMargin:a.top-c}))}return t.dispatch(ro(r,s),{effects:i}),!0}const __=t=>C$(t,!1),hO=t=>C$(t,!0);function du(t,e,n){let r=t.lineBlockAt(e.head),s=t.moveToLineBoundary(e,n);if(s.head==e.head&&s.head!=(n?r.to:r.from)&&(s=t.moveToLineBoundary(e,n,!1)),!n&&s.head==r.from&&r.length){let i=/^\s*/.exec(t.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;i&&e.head!=r.from+i&&(s=Me.cursor(r.from+i))}return s}const cde=t=>so(t,e=>du(t,e,!0)),ude=t=>so(t,e=>du(t,e,!1)),dde=t=>so(t,e=>du(t,e,!Ws(t))),hde=t=>so(t,e=>du(t,e,Ws(t))),fde=t=>so(t,e=>Me.cursor(t.lineBlockAt(e.head).from,1)),mde=t=>so(t,e=>Me.cursor(t.lineBlockAt(e.head).to,-1));function pde(t,e,n){let r=!1,s=Tf(t.selection,i=>{let a=To(t,i.head,-1)||To(t,i.head,1)||i.head>0&&To(t,i.head-1,1)||i.head<t.doc.length&&To(t,i.head+1,-1);if(!a||!a.end)return i;r=!0;let l=a.start.from==i.head?a.end.to:a.end.from;return Me.cursor(l)});return r?(e(ro(t,s)),!0):!1}const gde=({state:t,dispatch:e})=>pde(t,e);function za(t,e){let n=Tf(t.state.selection,r=>{let s=e(r);return Me.range(r.anchor,s.head,s.goalColumn,s.bidiLevel||void 0)});return n.eq(t.state.selection)?!1:(t.dispatch(ro(t.state,n)),!0)}function T$(t,e){return za(t,n=>t.moveByChar(n,e))}const E$=t=>T$(t,!Ws(t)),_$=t=>T$(t,Ws(t));function A$(t,e){return za(t,n=>t.moveByGroup(n,e))}const xde=t=>A$(t,!Ws(t)),vde=t=>A$(t,Ws(t)),yde=t=>za(t,e=>Sb(t.state,e,!Ws(t))),bde=t=>za(t,e=>Sb(t.state,e,Ws(t)));function M$(t,e){return za(t,n=>t.moveVertically(n,e))}const R$=t=>M$(t,!1),D$=t=>M$(t,!0);function P$(t,e){return za(t,n=>t.moveVertically(n,e,N$(t).height))}const A_=t=>P$(t,!1),M_=t=>P$(t,!0),wde=t=>za(t,e=>du(t,e,!0)),Sde=t=>za(t,e=>du(t,e,!1)),kde=t=>za(t,e=>du(t,e,!Ws(t))),Ode=t=>za(t,e=>du(t,e,Ws(t))),jde=t=>za(t,e=>Me.cursor(t.lineBlockAt(e.head).from)),Nde=t=>za(t,e=>Me.cursor(t.lineBlockAt(e.head).to)),R_=({state:t,dispatch:e})=>(e(ro(t,{anchor:0})),!0),D_=({state:t,dispatch:e})=>(e(ro(t,{anchor:t.doc.length})),!0),P_=({state:t,dispatch:e})=>(e(ro(t,{anchor:t.selection.main.anchor,head:0})),!0),z_=({state:t,dispatch:e})=>(e(ro(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),Cde=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),Tde=({state:t,dispatch:e})=>{let n=kb(t).map(({from:r,to:s})=>Me.range(r,Math.min(s+1,t.doc.length)));return e(t.update({selection:Me.create(n),userEvent:"select"})),!0},Ede=({state:t,dispatch:e})=>{let n=Tf(t.selection,r=>{let s=Ss(t),i=s.resolveStack(r.from,1);if(r.empty){let a=s.resolveStack(r.from,-1);a.node.from>=i.node.from&&a.node.to<=i.node.to&&(i=a)}for(let a=i;a;a=a.next){let{node:l}=a;if((l.from<r.from&&l.to>=r.to||l.to>r.to&&l.from<=r.from)&&a.next)return Me.range(l.to,l.from)}return r});return n.eq(t.selection)?!1:(e(ro(t,n)),!0)};function z$(t,e){let{state:n}=t,r=n.selection,s=n.selection.ranges.slice();for(let i of n.selection.ranges){let a=n.doc.lineAt(i.head);if(e?a.to<t.state.doc.length:a.from>0)for(let l=i;;){let c=t.moveVertically(l,e);if(c.head<a.from||c.head>a.to){s.some(d=>d.head==c.head)||s.push(c);break}else{if(c.head==l.head)break;l=c}}}return s.length==r.ranges.length?!1:(t.dispatch(ro(n,Me.create(s,s.length-1))),!0)}const _de=t=>z$(t,!1),Ade=t=>z$(t,!0),Mde=({state:t,dispatch:e})=>{let n=t.selection,r=null;return n.ranges.length>1?r=Me.create([n.main]):n.main.empty||(r=Me.create([Me.cursor(n.main.head)])),r?(e(ro(t,r)),!0):!1};function tg(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:r}=t,s=r.changeByRange(i=>{let{from:a,to:l}=i;if(a==l){let c=e(i);c<a?(n="delete.backward",c=S1(t,c,!1)):c>a&&(n="delete.forward",c=S1(t,c,!0)),a=Math.min(a,c),l=Math.max(l,c)}else a=S1(t,a,!1),l=S1(t,l,!0);return a==l?{range:i}:{changes:{from:a,to:l},range:Me.cursor(a,a<i.head?-1:1)}});return s.changes.empty?!1:(t.dispatch(r.update(s,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?Ze.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function S1(t,e,n){if(t instanceof Ze)for(let r of t.state.facet(Ze.atomicRanges).map(s=>s(t)))r.between(e,e,(s,i)=>{s<e&&i>e&&(e=n?i:s)});return e}const I$=(t,e,n)=>tg(t,r=>{let s=r.from,{state:i}=t,a=i.doc.lineAt(s),l,c;if(n&&!e&&s>a.from&&s<a.from+200&&!/[^ \t]/.test(l=a.text.slice(0,s-a.from))){if(l[l.length-1]==" ")return s-1;let d=Cf(l,i.tabSize),h=d%dd(i)||dd(i);for(let m=0;m<h&&l[l.length-1-m]==" ";m++)s--;c=s}else c=Ps(a.text,s-a.from,e,e)+a.from,c==s&&a.number!=(e?i.doc.lines:1)?c+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(a.text.slice(c-a.from,s-a.from))&&(c=Ps(a.text,c-a.from,!1,!1)+a.from);return c}),fO=t=>I$(t,!1,!0),L$=t=>I$(t,!0,!1),B$=(t,e)=>tg(t,n=>{let r=n.head,{state:s}=t,i=s.doc.lineAt(r),a=s.charCategorizer(r);for(let l=null;;){if(r==(e?i.to:i.from)){r==n.head&&i.number!=(e?s.doc.lines:1)&&(r+=e?1:-1);break}let c=Ps(i.text,r-i.from,e)+i.from,d=i.text.slice(Math.min(r,c)-i.from,Math.max(r,c)-i.from),h=a(d);if(l!=null&&h!=l)break;(d!=" "||r!=n.head)&&(l=h),r=c}return r}),F$=t=>B$(t,!1),Rde=t=>B$(t,!0),Dde=t=>tg(t,e=>{let n=t.lineBlockAt(e.head).to;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),Pde=t=>tg(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),zde=t=>tg(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),Ide=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:An.of(["",""])},range:Me.cursor(r.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},Lde=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>{if(!r.empty||r.from==0||r.from==t.doc.length)return{range:r};let s=r.from,i=t.doc.lineAt(s),a=s==i.from?s-1:Ps(i.text,s-i.from,!1)+i.from,l=s==i.to?s+1:Ps(i.text,s-i.from,!0)+i.from;return{changes:{from:a,to:l,insert:t.doc.slice(s,l).append(t.doc.slice(a,s))},range:Me.cursor(l)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function kb(t){let e=[],n=-1;for(let r of t.selection.ranges){let s=t.doc.lineAt(r.from),i=t.doc.lineAt(r.to);if(!r.empty&&r.to==i.from&&(i=t.doc.lineAt(r.to-1)),n>=s.number){let a=e[e.length-1];a.to=i.to,a.ranges.push(r)}else e.push({from:s.from,to:i.to,ranges:[r]});n=i.number+1}return e}function q$(t,e,n){if(t.readOnly)return!1;let r=[],s=[];for(let i of kb(t)){if(n?i.to==t.doc.length:i.from==0)continue;let a=t.doc.lineAt(n?i.to+1:i.from-1),l=a.length+1;if(n){r.push({from:i.to,to:a.to},{from:i.from,insert:a.text+t.lineBreak});for(let c of i.ranges)s.push(Me.range(Math.min(t.doc.length,c.anchor+l),Math.min(t.doc.length,c.head+l)))}else{r.push({from:a.from,to:i.from},{from:i.to,insert:t.lineBreak+a.text});for(let c of i.ranges)s.push(Me.range(c.anchor-l,c.head-l))}}return r.length?(e(t.update({changes:r,scrollIntoView:!0,selection:Me.create(s,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const Bde=({state:t,dispatch:e})=>q$(t,e,!1),Fde=({state:t,dispatch:e})=>q$(t,e,!0);function $$(t,e,n){if(t.readOnly)return!1;let r=[];for(let s of kb(t))n?r.push({from:s.from,insert:t.doc.slice(s.from,s.to)+t.lineBreak}):r.push({from:s.to,insert:t.lineBreak+t.doc.slice(s.from,s.to)});return e(t.update({changes:r,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const qde=({state:t,dispatch:e})=>$$(t,e,!1),$de=({state:t,dispatch:e})=>$$(t,e,!0),Hde=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(kb(e).map(({from:s,to:i})=>(s>0?s--:i<e.doc.length&&i++,{from:s,to:i}))),r=Tf(e.selection,s=>{let i;if(t.lineWrapping){let a=t.lineBlockAt(s.head),l=t.coordsAtPos(s.head,s.assoc||1);l&&(i=a.bottom+t.documentTop-l.bottom+t.defaultLineHeight/2)}return t.moveVertically(s,!0,i)}).map(n);return t.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function Qde(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=Ss(t).resolveInner(e),r=n.childBefore(e),s=n.childAfter(e),i;return r&&s&&r.to<=e&&s.from>=e&&(i=r.type.prop(an.closedBy))&&i.indexOf(s.name)>-1&&t.doc.lineAt(r.to).from==t.doc.lineAt(s.from).from&&!/\S/.test(t.sliceDoc(r.to,s.from))?{from:r.to,to:s.from}:null}const I_=H$(!1),Vde=H$(!0);function H$(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let r=e.changeByRange(s=>{let{from:i,to:a}=s,l=e.doc.lineAt(i),c=!t&&i==a&&Qde(e,i);t&&(i=a=(a<=l.to?l:e.doc.lineAt(a)).to);let d=new xb(e,{simulateBreak:i,simulateDoubleBreak:!!c}),h=O6(d,i);for(h==null&&(h=Cf(/^\s*/.exec(e.doc.lineAt(i).text)[0],e.tabSize));a<l.to&&/\s/.test(l.text[a-l.from]);)a++;c?{from:i,to:a}=c:i>l.from&&i<l.from+100&&!/\S/.test(l.text.slice(0,i))&&(i=l.from);let m=["",ep(e,h)];return c&&m.push(ep(e,d.lineIndent(l.from,-1))),{changes:{from:i,to:a,insert:An.of(m)},range:Me.cursor(i+1+m[1].length)}});return n(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function M6(t,e){let n=-1;return t.changeByRange(r=>{let s=[];for(let a=r.from;a<=r.to;){let l=t.doc.lineAt(a);l.number>n&&(r.empty||r.to>l.from)&&(e(l,s,r),n=l.number),a=l.to+1}let i=t.changes(s);return{changes:s,range:Me.range(i.mapPos(r.anchor,1),i.mapPos(r.head,1))}})}const Ude=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),r=new xb(t,{overrideIndentation:i=>{let a=n[i];return a??-1}}),s=M6(t,(i,a,l)=>{let c=O6(r,i.from);if(c==null)return;/\S/.test(i.text)||(c=0);let d=/^\s*/.exec(i.text)[0],h=ep(t,c);(d!=h||l.from<i.from+d.length)&&(n[i.from]=c,a.push({from:i.from,to:i.from+d.length,insert:h}))});return s.changes.empty||e(t.update(s,{userEvent:"indent"})),!0},Q$=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(M6(t,(n,r)=>{r.push({from:n.from,insert:t.facet(Zp)})}),{userEvent:"input.indent"})),!0),V$=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(M6(t,(n,r)=>{let s=/^\s*/.exec(n.text)[0];if(!s)return;let i=Cf(s,t.tabSize),a=0,l=ep(t,Math.max(0,i-dd(t)));for(;a<s.length&&a<l.length&&s.charCodeAt(a)==l.charCodeAt(a);)a++;r.push({from:n.from+a,to:n.from+s.length,insert:l.slice(a)})}),{userEvent:"delete.dedent"})),!0),Wde=t=>(t.setTabFocusMode(),!0),Gde=[{key:"Ctrl-b",run:b$,shift:E$,preventDefault:!0},{key:"Ctrl-f",run:w$,shift:_$},{key:"Ctrl-p",run:O$,shift:R$},{key:"Ctrl-n",run:j$,shift:D$},{key:"Ctrl-a",run:fde,shift:jde},{key:"Ctrl-e",run:mde,shift:Nde},{key:"Ctrl-d",run:L$},{key:"Ctrl-h",run:fO},{key:"Ctrl-k",run:Dde},{key:"Ctrl-Alt-h",run:F$},{key:"Ctrl-o",run:Ide},{key:"Ctrl-t",run:Lde},{key:"Ctrl-v",run:hO}],Xde=[{key:"ArrowLeft",run:b$,shift:E$,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:sde,shift:xde,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:dde,shift:kde,preventDefault:!0},{key:"ArrowRight",run:w$,shift:_$,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:ide,shift:vde,preventDefault:!0},{mac:"Cmd-ArrowRight",run:hde,shift:Ode,preventDefault:!0},{key:"ArrowUp",run:O$,shift:R$,preventDefault:!0},{mac:"Cmd-ArrowUp",run:R_,shift:P_},{mac:"Ctrl-ArrowUp",run:__,shift:A_},{key:"ArrowDown",run:j$,shift:D$,preventDefault:!0},{mac:"Cmd-ArrowDown",run:D_,shift:z_},{mac:"Ctrl-ArrowDown",run:hO,shift:M_},{key:"PageUp",run:__,shift:A_},{key:"PageDown",run:hO,shift:M_},{key:"Home",run:ude,shift:Sde,preventDefault:!0},{key:"Mod-Home",run:R_,shift:P_},{key:"End",run:cde,shift:wde,preventDefault:!0},{key:"Mod-End",run:D_,shift:z_},{key:"Enter",run:I_,shift:I_},{key:"Mod-a",run:Cde},{key:"Backspace",run:fO,shift:fO,preventDefault:!0},{key:"Delete",run:L$,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:F$,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:Rde,preventDefault:!0},{mac:"Mod-Backspace",run:Pde,preventDefault:!0},{mac:"Mod-Delete",run:zde,preventDefault:!0}].concat(Gde.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),Yde=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:ode,shift:yde},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:lde,shift:bde},{key:"Alt-ArrowUp",run:Bde},{key:"Shift-Alt-ArrowUp",run:qde},{key:"Alt-ArrowDown",run:Fde},{key:"Shift-Alt-ArrowDown",run:$de},{key:"Mod-Alt-ArrowUp",run:_de},{key:"Mod-Alt-ArrowDown",run:Ade},{key:"Escape",run:Mde},{key:"Mod-Enter",run:Vde},{key:"Alt-l",mac:"Ctrl-l",run:Tde},{key:"Mod-i",run:Ede,preventDefault:!0},{key:"Mod-[",run:V$},{key:"Mod-]",run:Q$},{key:"Mod-Alt-\\",run:Ude},{key:"Shift-Mod-k",run:Hde},{key:"Shift-Mod-\\",run:gde},{key:"Mod-/",run:Bue},{key:"Alt-A",run:que},{key:"Ctrl-m",mac:"Shift-Alt-m",run:Wde}].concat(Xde),Kde={key:"Tab",run:Q$,shift:V$},L_=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t;class af{constructor(e,n,r=0,s=e.length,i,a){this.test=a,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,s),this.bufferStart=r,this.normalize=i?l=>i(L_(l)):L_,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return vi(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let n=s6(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=ko(e);let s=this.normalize(n);if(s.length)for(let i=0,a=r;;i++){let l=s.charCodeAt(i),c=this.match(l,a,this.bufferPos+this.bufferStart);if(i==s.length-1){if(c)return this.value=c,this;break}a==r&&i<n.length&&n.charCodeAt(i)==l&&a++}}}match(e,n,r){let s=null;for(let i=0;i<this.matches.length;i+=2){let a=this.matches[i],l=!1;this.query.charCodeAt(a)==e&&(a==this.query.length-1?s={from:this.matches[i+1],to:r}:(this.matches[i]++,l=!0)),l||(this.matches.splice(i,2),i-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?s={from:n,to:r}:this.matches.push(1,n)),s&&this.test&&!this.test(s.from,s.to,this.buffer,this.bufferStart)&&(s=null),s}}typeof Symbol<"u"&&(af.prototype[Symbol.iterator]=function(){return this});const U$={from:-1,to:-1,match:/.*/.exec("")},R6="gm"+(/x/.unicode==null?"":"u");class W${constructor(e,n,r,s=0,i=e.length){if(this.text=e,this.to=i,this.curLine="",this.done=!1,this.value=U$,/\\[sWDnr]|\n|\r|\[\^/.test(n))return new G$(e,n,r,s,i);this.re=new RegExp(n,R6+(r?.ignoreCase?"i":"")),this.test=r?.test,this.iter=e.iter();let a=e.lineAt(s);this.curLineStart=a.from,this.matchPos=ay(e,s),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let r=this.curLineStart+n.index,s=r+n[0].length;if(this.matchPos=ay(this.text,s+(r==s?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(r<s||r>this.value.to)&&(!this.test||this.test(r,s,n)))return this.value={from:r,to:s,match:n},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}}const sS=new WeakMap;class Lh{constructor(e,n){this.from=e,this.text=n}get to(){return this.from+this.text.length}static get(e,n,r){let s=sS.get(e);if(!s||s.from>=r||s.to<=n){let l=new Lh(n,e.sliceString(n,r));return sS.set(e,l),l}if(s.from==n&&s.to==r)return s;let{text:i,from:a}=s;return a>n&&(i=e.sliceString(n,a)+i,a=n),s.to<r&&(i+=e.sliceString(s.to,r)),sS.set(e,new Lh(a,i)),new Lh(n,i.slice(n-a,r-a))}}class G${constructor(e,n,r,s,i){this.text=e,this.to=i,this.done=!1,this.value=U$,this.matchPos=ay(e,s),this.re=new RegExp(n,R6+(r?.ignoreCase?"i":"")),this.test=r?.test,this.flat=Lh.get(e,s,this.chunkEnd(s+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==e&&(this.re.lastIndex=e+1,n=this.re.exec(this.flat.text)),n){let r=this.flat.from+n.index,s=r+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,s,n)))return this.value={from:r,to:s,match:n},this.matchPos=ay(this.text,s+(r==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Lh.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(W$.prototype[Symbol.iterator]=G$.prototype[Symbol.iterator]=function(){return this});function Zde(t){try{return new RegExp(t,R6),!0}catch{return!1}}function ay(t,e){if(e>=t.length)return e;let n=t.lineAt(e),r;for(;e<n.to&&(r=n.text.charCodeAt(e-n.from))>=56320&&r<57344;)e++;return e}function mO(t){let e=String(t.state.doc.lineAt(t.state.selection.main.head).number),n=lr("input",{class:"cm-textfield",name:"line",value:e}),r=lr("form",{class:"cm-gotoLine",onkeydown:i=>{i.keyCode==27?(i.preventDefault(),t.dispatch({effects:E0.of(!1)}),t.focus()):i.keyCode==13&&(i.preventDefault(),s())},onsubmit:i=>{i.preventDefault(),s()}},lr("label",t.state.phrase("Go to line"),": ",n)," ",lr("button",{class:"cm-button",type:"submit"},t.state.phrase("go")),lr("button",{name:"close",onclick:()=>{t.dispatch({effects:E0.of(!1)}),t.focus()},"aria-label":t.state.phrase("close"),type:"button"},["×"]));function s(){let i=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.value);if(!i)return;let{state:a}=t,l=a.doc.lineAt(a.selection.main.head),[,c,d,h,m]=i,g=h?+h.slice(1):0,x=d?+d:l.number;if(d&&m){let S=x/100;c&&(S=S*(c=="-"?-1:1)+l.number/a.doc.lines),x=Math.round(a.doc.lines*S)}else d&&c&&(x=x*(c=="-"?-1:1)+l.number);let y=a.doc.line(Math.max(1,Math.min(a.doc.lines,x))),w=Me.cursor(y.from+Math.max(0,Math.min(g,y.length)));t.dispatch({effects:[E0.of(!1),Ze.scrollIntoView(w.from,{y:"center"})],selection:w}),t.focus()}return{dom:r}}const E0=Qt.define(),B_=Os.define({create(){return!0},update(t,e){for(let n of e.effects)n.is(E0)&&(t=n.value);return t},provide:t=>Y0.from(t,e=>e?mO:null)}),Jde=t=>{let e=X0(t,mO);if(!e){let n=[E0.of(!0)];t.state.field(B_,!1)==null&&n.push(Qt.appendConfig.of([B_,ehe])),t.dispatch({effects:n}),e=X0(t,mO)}return e&&e.dom.querySelector("input").select(),!0},ehe=Ze.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px",position:"relative","& label":{fontSize:"80%"},"& [name=close]":{position:"absolute",top:"0",bottom:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:"0"}}}),the={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},nhe=st.define({combine(t){return Vo(t,the,{highlightWordAroundCursor:(e,n)=>e||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function rhe(t){return[lhe,ohe]}const she=Ot.mark({class:"cm-selectionMatch"}),ihe=Ot.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function F_(t,e,n,r){return(n==0||t(e.sliceDoc(n-1,n))!=Tr.Word)&&(r==e.doc.length||t(e.sliceDoc(r,r+1))!=Tr.Word)}function ahe(t,e,n,r){return t(e.sliceDoc(n,n+1))==Tr.Word&&t(e.sliceDoc(r-1,r))==Tr.Word}const ohe=Yr.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(nhe),{state:n}=t,r=n.selection;if(r.ranges.length>1)return Ot.none;let s=r.main,i,a=null;if(s.empty){if(!e.highlightWordAroundCursor)return Ot.none;let c=n.wordAt(s.head);if(!c)return Ot.none;a=n.charCategorizer(s.head),i=n.sliceDoc(c.from,c.to)}else{let c=s.to-s.from;if(c<e.minSelectionLength||c>200)return Ot.none;if(e.wholeWords){if(i=n.sliceDoc(s.from,s.to),a=n.charCategorizer(s.head),!(F_(a,n,s.from,s.to)&&ahe(a,n,s.from,s.to)))return Ot.none}else if(i=n.sliceDoc(s.from,s.to),!i)return Ot.none}let l=[];for(let c of t.visibleRanges){let d=new af(n.doc,i,c.from,c.to);for(;!d.next().done;){let{from:h,to:m}=d.value;if((!a||F_(a,n,h,m))&&(s.empty&&h<=s.from&&m>=s.to?l.push(ihe.range(h,m)):(h>=s.to||m<=s.from)&&l.push(she.range(h,m)),l.length>e.maxMatches))return Ot.none}}return Ot.set(l)}},{decorations:t=>t.decorations}),lhe=Ze.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),che=({state:t,dispatch:e})=>{let{selection:n}=t,r=Me.create(n.ranges.map(s=>t.wordAt(s.head)||Me.cursor(s.head)),n.mainIndex);return r.eq(n)?!1:(e(t.update({selection:r})),!0)};function uhe(t,e){let{main:n,ranges:r}=t.selection,s=t.wordAt(n.head),i=s&&s.from==n.from&&s.to==n.to;for(let a=!1,l=new af(t.doc,e,r[r.length-1].to);;)if(l.next(),l.done){if(a)return null;l=new af(t.doc,e,0,Math.max(0,r[r.length-1].from-1)),a=!0}else{if(a&&r.some(c=>c.from==l.value.from))continue;if(i){let c=t.wordAt(l.value.from);if(!c||c.from!=l.value.from||c.to!=l.value.to)continue}return l.value}}const dhe=({state:t,dispatch:e})=>{let{ranges:n}=t.selection;if(n.some(i=>i.from===i.to))return che({state:t,dispatch:e});let r=t.sliceDoc(n[0].from,n[0].to);if(t.selection.ranges.some(i=>t.sliceDoc(i.from,i.to)!=r))return!1;let s=uhe(t,r);return s?(e(t.update({selection:t.selection.addRange(Me.range(s.from,s.to),!1),effects:Ze.scrollIntoView(s.to)})),!0):!1},Ef=st.define({combine(t){return Vo(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new khe(e),scrollToMatch:e=>Ze.scrollIntoView(e)})}});class X${constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||Zde(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(n,r)=>r=="n"?`
|
||
`:r=="r"?"\r":r=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new phe(this):new fhe(this)}getCursor(e,n=0,r){let s=e.doc?e:Nn.create({doc:e});return r==null&&(r=s.doc.length),this.regexp?Sh(this,s,n,r):wh(this,s,n,r)}}class Y${constructor(e){this.spec=e}}function wh(t,e,n,r){return new af(e.doc,t.unquoted,n,r,t.caseSensitive?void 0:s=>s.toLowerCase(),t.wholeWord?hhe(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function hhe(t,e){return(n,r,s,i)=>((i>n||i+s.length<r)&&(i=Math.max(0,n-2),s=t.sliceString(i,Math.min(t.length,r+2))),(e(oy(s,n-i))!=Tr.Word||e(ly(s,n-i))!=Tr.Word)&&(e(ly(s,r-i))!=Tr.Word||e(oy(s,r-i))!=Tr.Word))}class fhe extends Y${constructor(e){super(e)}nextMatch(e,n,r){let s=wh(this.spec,e,r,e.doc.length).nextOverlapping();if(s.done){let i=Math.min(e.doc.length,n+this.spec.unquoted.length);s=wh(this.spec,e,0,i).nextOverlapping()}return s.done||s.value.from==n&&s.value.to==r?null:s.value}prevMatchInRange(e,n,r){for(let s=r;;){let i=Math.max(n,s-1e4-this.spec.unquoted.length),a=wh(this.spec,e,i,s),l=null;for(;!a.nextOverlapping().done;)l=a.value;if(l)return l;if(i==n)return null;s-=1e4}}prevMatch(e,n,r){let s=this.prevMatchInRange(e,0,n);return s||(s=this.prevMatchInRange(e,Math.max(0,r-this.spec.unquoted.length),e.doc.length)),s&&(s.from!=n||s.to!=r)?s:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,n){let r=wh(this.spec,e,0,e.doc.length),s=[];for(;!r.next().done;){if(s.length>=n)return null;s.push(r.value)}return s}highlight(e,n,r,s){let i=wh(this.spec,e,Math.max(0,n-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)s(i.value.from,i.value.to)}}function Sh(t,e,n,r){return new W$(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:t.wholeWord?mhe(e.charCategorizer(e.selection.main.head)):void 0},n,r)}function oy(t,e){return t.slice(Ps(t,e,!1),e)}function ly(t,e){return t.slice(e,Ps(t,e))}function mhe(t){return(e,n,r)=>!r[0].length||(t(oy(r.input,r.index))!=Tr.Word||t(ly(r.input,r.index))!=Tr.Word)&&(t(ly(r.input,r.index+r[0].length))!=Tr.Word||t(oy(r.input,r.index+r[0].length))!=Tr.Word)}class phe extends Y${nextMatch(e,n,r){let s=Sh(this.spec,e,r,e.doc.length).next();return s.done&&(s=Sh(this.spec,e,0,n).next()),s.done?null:s.value}prevMatchInRange(e,n,r){for(let s=1;;s++){let i=Math.max(n,r-s*1e4),a=Sh(this.spec,e,i,r),l=null;for(;!a.next().done;)l=a.value;if(l&&(i==n||l.from>i+10))return l;if(i==n)return null}}prevMatch(e,n,r){return this.prevMatchInRange(e,0,n)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(n,r)=>{if(r=="&")return e.match[0];if(r=="$")return"$";for(let s=r.length;s>0;s--){let i=+r.slice(0,s);if(i>0&&i<e.match.length)return e.match[i]+r.slice(s)}return n})}matchAll(e,n){let r=Sh(this.spec,e,0,e.doc.length),s=[];for(;!r.next().done;){if(s.length>=n)return null;s.push(r.value)}return s}highlight(e,n,r,s){let i=Sh(this.spec,e,Math.max(0,n-250),Math.min(r+250,e.doc.length));for(;!i.next().done;)s(i.value.from,i.value.to)}}const np=Qt.define(),D6=Qt.define(),Uc=Os.define({create(t){return new iS(pO(t).create(),null)},update(t,e){for(let n of e.effects)n.is(np)?t=new iS(n.value.create(),t.panel):n.is(D6)&&(t=new iS(t.query,n.value?P6:null));return t},provide:t=>Y0.from(t,e=>e.panel)});class iS{constructor(e,n){this.query=e,this.panel=n}}const ghe=Ot.mark({class:"cm-searchMatch"}),xhe=Ot.mark({class:"cm-searchMatch cm-searchMatch-selected"}),vhe=Yr.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(Uc))}update(t){let e=t.state.field(Uc);(e!=t.startState.field(Uc)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return Ot.none;let{view:n}=this,r=new Hl;for(let s=0,i=n.visibleRanges,a=i.length;s<a;s++){let{from:l,to:c}=i[s];for(;s<a-1&&c>i[s+1].from-500;)c=i[++s].to;t.highlight(n.state,l,c,(d,h)=>{let m=n.state.selection.ranges.some(g=>g.from==d&&g.to==h);r.add(d,h,m?xhe:ghe)})}return r.finish()}},{decorations:t=>t.decorations});function ng(t){return e=>{let n=e.state.field(Uc,!1);return n&&n.query.spec.valid?t(e,n):J$(e)}}const cy=ng((t,{query:e})=>{let{to:n}=t.state.selection.main,r=e.nextMatch(t.state,n,n);if(!r)return!1;let s=Me.single(r.from,r.to),i=t.state.facet(Ef);return t.dispatch({selection:s,effects:[z6(t,r),i.scrollToMatch(s.main,t)],userEvent:"select.search"}),Z$(t),!0}),uy=ng((t,{query:e})=>{let{state:n}=t,{from:r}=n.selection.main,s=e.prevMatch(n,r,r);if(!s)return!1;let i=Me.single(s.from,s.to),a=t.state.facet(Ef);return t.dispatch({selection:i,effects:[z6(t,s),a.scrollToMatch(i.main,t)],userEvent:"select.search"}),Z$(t),!0}),yhe=ng((t,{query:e})=>{let n=e.matchAll(t.state,1e3);return!n||!n.length?!1:(t.dispatch({selection:Me.create(n.map(r=>Me.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),bhe=({state:t,dispatch:e})=>{let n=t.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:s}=n.main,i=[],a=0;for(let l=new af(t.doc,t.sliceDoc(r,s));!l.next().done;){if(i.length>1e3)return!1;l.value.from==r&&(a=i.length),i.push(Me.range(l.value.from,l.value.to))}return e(t.update({selection:Me.create(i,a),userEvent:"select.search.matches"})),!0},q_=ng((t,{query:e})=>{let{state:n}=t,{from:r,to:s}=n.selection.main;if(n.readOnly)return!1;let i=e.nextMatch(n,r,r);if(!i)return!1;let a=i,l=[],c,d,h=[];a.from==r&&a.to==s&&(d=n.toText(e.getReplacement(a)),l.push({from:a.from,to:a.to,insert:d}),a=e.nextMatch(n,a.from,a.to),h.push(Ze.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+".")));let m=t.state.changes(l);return a&&(c=Me.single(a.from,a.to).map(m),h.push(z6(t,a)),h.push(n.facet(Ef).scrollToMatch(c.main,t))),t.dispatch({changes:m,selection:c,effects:h,userEvent:"input.replace"}),!0}),whe=ng((t,{query:e})=>{if(t.state.readOnly)return!1;let n=e.matchAll(t.state,1e9).map(s=>{let{from:i,to:a}=s;return{from:i,to:a,insert:e.getReplacement(s)}});if(!n.length)return!1;let r=t.state.phrase("replaced $ matches",n.length)+".";return t.dispatch({changes:n,effects:Ze.announce.of(r),userEvent:"input.replace.all"}),!0});function P6(t){return t.state.facet(Ef).createPanel(t)}function pO(t,e){var n,r,s,i,a;let l=t.selection.main,c=l.empty||l.to>l.from+100?"":t.sliceDoc(l.from,l.to);if(e&&!c)return e;let d=t.facet(Ef);return new X$({search:((n=e?.literal)!==null&&n!==void 0?n:d.literal)?c:c.replace(/\n/g,"\\n"),caseSensitive:(r=e?.caseSensitive)!==null&&r!==void 0?r:d.caseSensitive,literal:(s=e?.literal)!==null&&s!==void 0?s:d.literal,regexp:(i=e?.regexp)!==null&&i!==void 0?i:d.regexp,wholeWord:(a=e?.wholeWord)!==null&&a!==void 0?a:d.wholeWord})}function K$(t){let e=X0(t,P6);return e&&e.dom.querySelector("[main-field]")}function Z$(t){let e=K$(t);e&&e==t.root.activeElement&&e.select()}const J$=t=>{let e=t.state.field(Uc,!1);if(e&&e.panel){let n=K$(t);if(n&&n!=t.root.activeElement){let r=pO(t.state,e.query.spec);r.valid&&t.dispatch({effects:np.of(r)}),n.focus(),n.select()}}else t.dispatch({effects:[D6.of(!0),e?np.of(pO(t.state,e.query.spec)):Qt.appendConfig.of(jhe)]});return!0},eH=t=>{let e=t.state.field(Uc,!1);if(!e||!e.panel)return!1;let n=X0(t,P6);return n&&n.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:D6.of(!1)}),!0},She=[{key:"Mod-f",run:J$,scope:"editor search-panel"},{key:"F3",run:cy,shift:uy,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:cy,shift:uy,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:eH,scope:"editor search-panel"},{key:"Mod-Shift-l",run:bhe},{key:"Mod-Alt-g",run:Jde},{key:"Mod-d",run:dhe,preventDefault:!0}];class khe{constructor(e){this.view=e;let n=this.query=e.state.field(Uc).query.spec;this.commit=this.commit.bind(this),this.searchField=lr("input",{value:n.search,placeholder:Fi(e,"Find"),"aria-label":Fi(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=lr("input",{value:n.replace,placeholder:Fi(e,"Replace"),"aria-label":Fi(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=lr("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=lr("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=lr("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function r(s,i,a){return lr("button",{class:"cm-button",name:s,onclick:i,type:"button"},a)}this.dom=lr("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,r("next",()=>cy(e),[Fi(e,"next")]),r("prev",()=>uy(e),[Fi(e,"previous")]),r("select",()=>yhe(e),[Fi(e,"all")]),lr("label",null,[this.caseField,Fi(e,"match case")]),lr("label",null,[this.reField,Fi(e,"regexp")]),lr("label",null,[this.wordField,Fi(e,"by word")]),...e.state.readOnly?[]:[lr("br"),this.replaceField,r("replace",()=>q_(e),[Fi(e,"replace")]),r("replaceAll",()=>whe(e),[Fi(e,"replace all")])],lr("button",{name:"close",onclick:()=>eH(e),"aria-label":Fi(e,"close"),type:"button"},["×"])])}commit(){let e=new X$({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:np.of(e)}))}keydown(e){Tle(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?uy:cy)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),q_(this.view))}update(e){for(let n of e.transactions)for(let r of n.effects)r.is(np)&&!r.value.eq(this.query)&&this.setQuery(r.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Ef).top}}function Fi(t,e){return t.state.phrase(e)}const k1=30,O1=/[\s\.,:;?!]/;function z6(t,{from:e,to:n}){let r=t.state.doc.lineAt(e),s=t.state.doc.lineAt(n).to,i=Math.max(r.from,e-k1),a=Math.min(s,n+k1),l=t.state.sliceDoc(i,a);if(i!=r.from){for(let c=0;c<k1;c++)if(!O1.test(l[c+1])&&O1.test(l[c])){l=l.slice(c);break}}if(a!=s){for(let c=l.length-1;c>l.length-k1;c--)if(!O1.test(l[c-1])&&O1.test(l[c])){l=l.slice(0,c);break}}return Ze.announce.of(`${t.state.phrase("current match")}. ${l} ${t.state.phrase("on line")} ${r.number}.`)}const Ohe=Ze.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),jhe=[Uc,uu.low(vhe),Ohe];class tH{constructor(e,n,r,s){this.state=e,this.pos=n,this.explicit=r,this.view=s,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let n=Ss(this.state).resolveInner(this.pos,-1);for(;n&&e.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(e){let n=this.state.doc.lineAt(this.pos),r=Math.max(n.from,this.pos-250),s=n.text.slice(r-n.from,this.pos-n.from),i=s.search(rH(e,!1));return i<0?null:{from:r+i,to:this.pos,text:s.slice(i)}}get aborted(){return this.abortListeners==null}addEventListener(e,n,r){e=="abort"&&this.abortListeners&&(this.abortListeners.push(n),r&&r.onDocChange&&(this.abortOnDocChange=!0))}}function $_(t){let e=Object.keys(t).join(""),n=/\w/.test(e);return n&&(e=e.replace(/\w/g,"")),`[${n?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function Nhe(t){let e=Object.create(null),n=Object.create(null);for(let{label:s}of t){e[s[0]]=!0;for(let i=1;i<s.length;i++)n[s[i]]=!0}let r=$_(e)+$_(n)+"*$";return[new RegExp("^"+r),new RegExp(r)]}function nH(t){let e=t.map(s=>typeof s=="string"?{label:s}:s),[n,r]=e.every(s=>/^\w+$/.test(s.label))?[/\w*$/,/\w+$/]:Nhe(e);return s=>{let i=s.matchBefore(r);return i||s.explicit?{from:i?i.from:s.pos,options:e,validFor:n}:null}}function Che(t,e){return n=>{for(let r=Ss(n.state).resolveInner(n.pos,-1);r;r=r.parent){if(t.indexOf(r.name)>-1)return null;if(r.type.isTop)break}return e(n)}}let H_=class{constructor(e,n,r,s){this.completion=e,this.source=n,this.match=r,this.score=s}};function sd(t){return t.selection.main.from}function rH(t,e){var n;let{source:r}=t,s=e&&r[0]!="^",i=r[r.length-1]!="$";return!s&&!i?t:new RegExp(`${s?"^":""}(?:${r})${i?"$":""}`,(n=t.flags)!==null&&n!==void 0?n:t.ignoreCase?"i":"")}const I6=Qo.define();function The(t,e,n,r){let{main:s}=t.selection,i=n-s.from,a=r-s.from;return{...t.changeByRange(l=>{if(l!=s&&n!=r&&t.sliceDoc(l.from+i,l.from+a)!=t.sliceDoc(n,r))return{range:l};let c=t.toText(e);return{changes:{from:l.from+i,to:r==s.from?l.to:l.from+a,insert:c},range:Me.cursor(l.from+i+c.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const Q_=new WeakMap;function Ehe(t){if(!Array.isArray(t))return t;let e=Q_.get(t);return e||Q_.set(t,e=nH(t)),e}const dy=Qt.define(),rp=Qt.define();class _he{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let n=0;n<e.length;){let r=vi(e,n),s=ko(r);this.chars.push(r);let i=e.slice(n,n+s),a=i.toUpperCase();this.folded.push(vi(a==i?i.toLowerCase():a,0)),n+=s}this.astral=e.length!=this.chars.length}ret(e,n){return this.score=e,this.matched=n,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:n,folded:r,any:s,precise:i,byWord:a}=this;if(n.length==1){let j=vi(e,0),N=ko(j),T=N==e.length?0:-100;if(j!=n[0])if(j==r[0])T+=-200;else return null;return this.ret(T,[0,N])}let l=e.indexOf(this.pattern);if(l==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let c=n.length,d=0;if(l<0){for(let j=0,N=Math.min(e.length,200);j<N&&d<c;){let T=vi(e,j);(T==n[d]||T==r[d])&&(s[d++]=j),j+=ko(T)}if(d<c)return null}let h=0,m=0,g=!1,x=0,y=-1,w=-1,S=/[a-z]/.test(e),k=!0;for(let j=0,N=Math.min(e.length,200),T=0;j<N&&m<c;){let E=vi(e,j);l<0&&(h<c&&E==n[h]&&(i[h++]=j),x<c&&(E==n[x]||E==r[x]?(x==0&&(y=j),w=j+1,x++):x=0));let _,A=E<255?E>=48&&E<=57||E>=97&&E<=122?2:E>=65&&E<=90?1:0:(_=s6(E))!=_.toLowerCase()?1:_!=_.toUpperCase()?2:0;(!j||A==1&&S||T==0&&A!=0)&&(n[m]==E||r[m]==E&&(g=!0)?a[m++]=j:a.length&&(k=!1)),T=A,j+=ko(E)}return m==c&&a[0]==0&&k?this.result(-100+(g?-200:0),a,e):x==c&&y==0?this.ret(-200-e.length+(w==e.length?0:-100),[0,w]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):x==c?this.ret(-900-e.length,[y,w]):m==c?this.result(-100+(g?-200:0)+-700+(k?0:-1100),a,e):n.length==2?null:this.result((s[0]?-700:0)+-200+-1100,s,e)}result(e,n,r){let s=[],i=0;for(let a of n){let l=a+(this.astral?ko(vi(r,a)):1);i&&s[i-1]==a?s[i-1]=l:(s[i++]=a,s[i++]=l)}return this.ret(e-r.length,s)}}class Ahe{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let n=e.slice(0,this.pattern.length),r=n==this.pattern?0:n.toLowerCase()==this.folded?-200:null;return r==null?null:(this.matched=[0,n.length],this.score=r+(e.length==this.pattern.length?0:-100),this)}}const ws=st.define({combine(t){return Vo(t,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:Mhe,filterStrict:!1,compareCompletions:(e,n)=>e.label.localeCompare(n.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,n)=>e&&n,closeOnBlur:(e,n)=>e&&n,icons:(e,n)=>e&&n,tooltipClass:(e,n)=>r=>V_(e(r),n(r)),optionClass:(e,n)=>r=>V_(e(r),n(r)),addToOptions:(e,n)=>e.concat(n),filterStrict:(e,n)=>e||n})}});function V_(t,e){return t?e?t+" "+e:t:e}function Mhe(t,e,n,r,s,i){let a=t.textDirection==br.RTL,l=a,c=!1,d="top",h,m,g=e.left-s.left,x=s.right-e.right,y=r.right-r.left,w=r.bottom-r.top;if(l&&g<Math.min(y,x)?l=!1:!l&&x<Math.min(y,g)&&(l=!0),y<=(l?g:x))h=Math.max(s.top,Math.min(n.top,s.bottom-w))-e.top,m=Math.min(400,l?g:x);else{c=!0,m=Math.min(400,(a?e.right:s.right-e.left)-30);let j=s.bottom-e.bottom;j>=w||j>e.top?h=n.bottom-e.top:(d="bottom",h=e.bottom-n.top)}let S=(e.bottom-e.top)/i.offsetHeight,k=(e.right-e.left)/i.offsetWidth;return{style:`${d}: ${h/S}px; max-width: ${m/k}px`,class:"cm-completionInfo-"+(c?a?"left-narrow":"right-narrow":l?"left":"right")}}function Rhe(t){let e=t.addToOptions.slice();return t.icons&&e.push({render(n){let r=document.createElement("div");return r.classList.add("cm-completionIcon"),n.type&&r.classList.add(...n.type.split(/\s+/g).map(s=>"cm-completionIcon-"+s)),r.setAttribute("aria-hidden","true"),r},position:20}),e.push({render(n,r,s,i){let a=document.createElement("span");a.className="cm-completionLabel";let l=n.displayLabel||n.label,c=0;for(let d=0;d<i.length;){let h=i[d++],m=i[d++];h>c&&a.appendChild(document.createTextNode(l.slice(c,h)));let g=a.appendChild(document.createElement("span"));g.appendChild(document.createTextNode(l.slice(h,m))),g.className="cm-completionMatchedText",c=m}return c<l.length&&a.appendChild(document.createTextNode(l.slice(c))),a},position:50},{render(n){if(!n.detail)return null;let r=document.createElement("span");return r.className="cm-completionDetail",r.textContent=n.detail,r},position:80}),e.sort((n,r)=>n.position-r.position).map(n=>n.render)}function aS(t,e,n){if(t<=n)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){let s=Math.floor(e/n);return{from:s*n,to:(s+1)*n}}let r=Math.floor((t-e)/n);return{from:t-(r+1)*n,to:t-r*n}}class Dhe{constructor(e,n,r){this.view=e,this.stateField=n,this.applyCompletion=r,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:c=>this.placeInfo(c),key:this},this.space=null,this.currentClass="";let s=e.state.field(n),{options:i,selected:a}=s.open,l=e.state.facet(ws);this.optionContent=Rhe(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=aS(i.length,a,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",c=>{let{options:d}=e.state.field(n).open;for(let h=c.target,m;h&&h!=this.dom;h=h.parentNode)if(h.nodeName=="LI"&&(m=/-(\d+)$/.exec(h.id))&&+m[1]<d.length){this.applyCompletion(e,d[+m[1]]),c.preventDefault();return}}),this.dom.addEventListener("focusout",c=>{let d=e.state.field(this.stateField,!1);d&&d.tooltip&&e.state.facet(ws).closeOnBlur&&c.relatedTarget!=e.contentDOM&&e.dispatch({effects:rp.of(null)})}),this.showOptions(i,s.id)}mount(){this.updateSel()}showOptions(e,n){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,n,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var n;let r=e.state.field(this.stateField),s=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),r!=s){let{options:i,selected:a,disabled:l}=r.open;(!s.open||s.open.options!=i)&&(this.range=aS(i.length,a,e.state.facet(ws).maxRenderedOptions),this.showOptions(i,r.id)),this.updateSel(),l!=((n=s.open)===null||n===void 0?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(e){let n=this.tooltipClass(e);if(n!=this.currentClass){for(let r of this.currentClass.split(" "))r&&this.dom.classList.remove(r);for(let r of n.split(" "))r&&this.dom.classList.add(r);this.currentClass=n}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),n=e.open;(n.selected>-1&&n.selected<this.range.from||n.selected>=this.range.to)&&(this.range=aS(n.options.length,n.selected,this.view.state.facet(ws).maxRenderedOptions),this.showOptions(n.options,e.id));let r=this.updateSelectedOption(n.selected);if(r){this.destroyInfo();let{completion:s}=n.options[n.selected],{info:i}=s;if(!i)return;let a=typeof i=="string"?document.createTextNode(i):i(s);if(!a)return;"then"in a?a.then(l=>{l&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(l,s)}).catch(l=>bi(this.view.state,l,"completion info")):(this.addInfoPane(a,s),r.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,n){this.destroyInfo();let r=this.info=document.createElement("div");if(r.className="cm-tooltip cm-completionInfo",r.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)r.appendChild(e),this.infoDestroy=null;else{let{dom:s,destroy:i}=e;r.appendChild(s),this.infoDestroy=i||null}this.dom.appendChild(r),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let n=null;for(let r=this.list.firstChild,s=this.range.from;r;r=r.nextSibling,s++)r.nodeName!="LI"||!r.id?s--:s==e?r.hasAttribute("aria-selected")||(r.setAttribute("aria-selected","true"),n=r):r.hasAttribute("aria-selected")&&(r.removeAttribute("aria-selected"),r.removeAttribute("aria-describedby"));return n&&zhe(this.list,n),n}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let n=this.dom.getBoundingClientRect(),r=this.info.getBoundingClientRect(),s=e.getBoundingClientRect(),i=this.space;if(!i){let a=this.dom.ownerDocument.documentElement;i={left:0,top:0,right:a.clientWidth,bottom:a.clientHeight}}return s.top>Math.min(i.bottom,n.bottom)-10||s.bottom<Math.max(i.top,n.top)+10?null:this.view.state.facet(ws).positionInfo(this.view,n,s,r,i,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,n,r){const s=document.createElement("ul");s.id=n,s.setAttribute("role","listbox"),s.setAttribute("aria-expanded","true"),s.setAttribute("aria-label",this.view.state.phrase("Completions")),s.addEventListener("mousedown",a=>{a.target==s&&a.preventDefault()});let i=null;for(let a=r.from;a<r.to;a++){let{completion:l,match:c}=e[a],{section:d}=l;if(d){let g=typeof d=="string"?d:d.name;if(g!=i&&(a>r.from||r.from==0))if(i=g,typeof d!="string"&&d.header)s.appendChild(d.header(d));else{let x=s.appendChild(document.createElement("completion-section"));x.textContent=g}}const h=s.appendChild(document.createElement("li"));h.id=n+"-"+a,h.setAttribute("role","option");let m=this.optionClass(l);m&&(h.className=m);for(let g of this.optionContent){let x=g(l,this.view.state,this.view,c);x&&h.appendChild(x)}}return r.from&&s.classList.add("cm-completionListIncompleteTop"),r.to<e.length&&s.classList.add("cm-completionListIncompleteBottom"),s}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function Phe(t,e){return n=>new Dhe(n,t,e)}function zhe(t,e){let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),s=n.height/t.offsetHeight;r.top<n.top?t.scrollTop-=(n.top-r.top)/s:r.bottom>n.bottom&&(t.scrollTop+=(r.bottom-n.bottom)/s)}function U_(t){return(t.boost||0)*100+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}function Ihe(t,e){let n=[],r=null,s=null,i=h=>{n.push(h);let{section:m}=h.completion;if(m){r||(r=[]);let g=typeof m=="string"?m:m.name;r.some(x=>x.name==g)||r.push(typeof m=="string"?{name:g}:m)}},a=e.facet(ws);for(let h of t)if(h.hasResult()){let m=h.result.getMatch;if(h.result.filter===!1)for(let g of h.result.options)i(new H_(g,h.source,m?m(g):[],1e9-n.length));else{let g=e.sliceDoc(h.from,h.to),x,y=a.filterStrict?new Ahe(g):new _he(g);for(let w of h.result.options)if(x=y.match(w.label)){let S=w.displayLabel?m?m(w,x.matched):[]:x.matched,k=x.score+(w.boost||0);if(i(new H_(w,h.source,S,k)),typeof w.section=="object"&&w.section.rank==="dynamic"){let{name:j}=w.section;s||(s=Object.create(null)),s[j]=Math.max(k,s[j]||-1e9)}}}}if(r){let h=Object.create(null),m=0,g=(x,y)=>(x.rank==="dynamic"&&y.rank==="dynamic"?s[y.name]-s[x.name]:0)||(typeof x.rank=="number"?x.rank:1e9)-(typeof y.rank=="number"?y.rank:1e9)||(x.name<y.name?-1:1);for(let x of r.sort(g))m-=1e5,h[x.name]=m;for(let x of n){let{section:y}=x.completion;y&&(x.score+=h[typeof y=="string"?y:y.name])}}let l=[],c=null,d=a.compareCompletions;for(let h of n.sort((m,g)=>g.score-m.score||d(m.completion,g.completion))){let m=h.completion;!c||c.label!=m.label||c.detail!=m.detail||c.type!=null&&m.type!=null&&c.type!=m.type||c.apply!=m.apply||c.boost!=m.boost?l.push(h):U_(h.completion)>U_(c)&&(l[l.length-1]=h),c=h.completion}return l}class _h{constructor(e,n,r,s,i,a){this.options=e,this.attrs=n,this.tooltip=r,this.timestamp=s,this.selected=i,this.disabled=a}setSelected(e,n){return e==this.selected||e>=this.options.length?this:new _h(this.options,W_(n,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,n,r,s,i,a){if(s&&!a&&e.some(d=>d.isPending))return s.setDisabled();let l=Ihe(e,n);if(!l.length)return s&&e.some(d=>d.isPending)?s.setDisabled():null;let c=n.facet(ws).selectOnOpen?0:-1;if(s&&s.selected!=c&&s.selected!=-1){let d=s.options[s.selected].completion;for(let h=0;h<l.length;h++)if(l[h].completion==d){c=h;break}}return new _h(l,W_(r,c),{pos:e.reduce((d,h)=>h.hasResult()?Math.min(d,h.from):d,1e8),create:Hhe,above:i.aboveCursor},s?s.timestamp:Date.now(),c,!1)}map(e){return new _h(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new _h(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class hy{constructor(e,n,r){this.active=e,this.id=n,this.open=r}static start(){return new hy(qhe,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:n}=e,r=n.facet(ws),i=(r.override||n.languageDataAt("autocomplete",sd(n)).map(Ehe)).map(c=>(this.active.find(h=>h.source==c)||new Oa(c,this.active.some(h=>h.state!=0)?1:0)).update(e,r));i.length==this.active.length&&i.every((c,d)=>c==this.active[d])&&(i=this.active);let a=this.open,l=e.effects.some(c=>c.is(L6));a&&e.docChanged&&(a=a.map(e.changes)),e.selection||i.some(c=>c.hasResult()&&e.changes.touchesRange(c.from,c.to))||!Lhe(i,this.active)||l?a=_h.build(i,n,this.id,a,r,l):a&&a.disabled&&!i.some(c=>c.isPending)&&(a=null),!a&&i.every(c=>!c.isPending)&&i.some(c=>c.hasResult())&&(i=i.map(c=>c.hasResult()?new Oa(c.source,0):c));for(let c of e.effects)c.is(iH)&&(a=a&&a.setSelected(c.value,this.id));return i==this.active&&a==this.open?this:new hy(i,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?Bhe:Fhe}}function Lhe(t,e){if(t==e)return!0;for(let n=0,r=0;;){for(;n<t.length&&!t[n].hasResult();)n++;for(;r<e.length&&!e[r].hasResult();)r++;let s=n==t.length,i=r==e.length;if(s||i)return s==i;if(t[n++].result!=e[r++].result)return!1}}const Bhe={"aria-autocomplete":"list"},Fhe={};function W_(t,e){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":t};return e>-1&&(n["aria-activedescendant"]=t+"-"+e),n}const qhe=[];function sH(t,e){if(t.isUserEvent("input.complete")){let r=t.annotation(I6);if(r&&e.activateOnCompletion(r))return 12}let n=t.isUserEvent("input.type");return n&&e.activateOnTyping?5:n?1:t.isUserEvent("delete.backward")?2:t.selection?8:t.docChanged?16:0}class Oa{constructor(e,n,r=!1){this.source=e,this.state=n,this.explicit=r}hasResult(){return!1}get isPending(){return this.state==1}update(e,n){let r=sH(e,n),s=this;(r&8||r&16&&this.touches(e))&&(s=new Oa(s.source,0)),r&4&&s.state==0&&(s=new Oa(this.source,1)),s=s.updateFor(e,r);for(let i of e.effects)if(i.is(dy))s=new Oa(s.source,1,i.value);else if(i.is(rp))s=new Oa(s.source,0);else if(i.is(L6))for(let a of i.value)a.source==s.source&&(s=a);return s}updateFor(e,n){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(sd(e.state))}}class Bh extends Oa{constructor(e,n,r,s,i,a){super(e,3,n),this.limit=r,this.result=s,this.from=i,this.to=a}hasResult(){return!0}updateFor(e,n){var r;if(!(n&3))return this.map(e.changes);let s=this.result;s.map&&!e.changes.empty&&(s=s.map(s,e.changes));let i=e.changes.mapPos(this.from),a=e.changes.mapPos(this.to,1),l=sd(e.state);if(l>a||!s||n&2&&(sd(e.startState)==this.from||l<this.limit))return new Oa(this.source,n&4?1:0);let c=e.changes.mapPos(this.limit);return $he(s.validFor,e.state,i,a)?new Bh(this.source,this.explicit,c,s,i,a):s.update&&(s=s.update(s,i,a,new tH(e.state,l,!1)))?new Bh(this.source,this.explicit,c,s,s.from,(r=s.to)!==null&&r!==void 0?r:sd(e.state)):new Oa(this.source,1,this.explicit)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new Bh(this.source,this.explicit,e.mapPos(this.limit),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new Oa(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function $he(t,e,n,r){if(!t)return!1;let s=e.sliceDoc(n,r);return typeof t=="function"?t(s,n,r,e):rH(t,!0).test(s)}const L6=Qt.define({map(t,e){return t.map(n=>n.map(e))}}),iH=Qt.define(),yi=Os.define({create(){return hy.start()},update(t,e){return t.update(e)},provide:t=>[v6.from(t,e=>e.tooltip),Ze.contentAttributes.from(t,e=>e.attrs)]});function B6(t,e){const n=e.completion.apply||e.completion.label;let r=t.state.field(yi).active.find(s=>s.source==e.source);return r instanceof Bh?(typeof n=="string"?t.dispatch({...The(t.state,n,r.from,r.to),annotations:I6.of(e.completion)}):n(t,e.completion,r.from,r.to),!0):!1}const Hhe=Phe(yi,B6);function j1(t,e="option"){return n=>{let r=n.state.field(yi,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(ws).interactionDelay)return!1;let s=1,i;e=="page"&&(i=Rq(n,r.open.tooltip))&&(s=Math.max(2,Math.floor(i.dom.offsetHeight/i.dom.querySelector("li").offsetHeight)-1));let{length:a}=r.open.options,l=r.open.selected>-1?r.open.selected+s*(t?1:-1):t?0:a-1;return l<0?l=e=="page"?0:a-1:l>=a&&(l=e=="page"?a-1:0),n.dispatch({effects:iH.of(l)}),!0}}const Qhe=t=>{let e=t.state.field(yi,!1);return t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<t.state.facet(ws).interactionDelay?!1:B6(t,e.open.options[e.open.selected])},oS=t=>t.state.field(yi,!1)?(t.dispatch({effects:dy.of(!0)}),!0):!1,Vhe=t=>{let e=t.state.field(yi,!1);return!e||!e.active.some(n=>n.state!=0)?!1:(t.dispatch({effects:rp.of(null)}),!0)};class Uhe{constructor(e,n){this.active=e,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const Whe=50,Ghe=1e3,Xhe=Yr.fromClass(class{constructor(t){this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of t.state.field(yi).active)e.isPending&&this.startQuery(e)}update(t){let e=t.state.field(yi),n=t.state.facet(ws);if(!t.selectionSet&&!t.docChanged&&t.startState.field(yi)==e)return;let r=t.transactions.some(i=>{let a=sH(i,n);return a&8||(i.selection||i.docChanged)&&!(a&3)});for(let i=0;i<this.running.length;i++){let a=this.running[i];if(r||a.context.abortOnDocChange&&t.docChanged||a.updates.length+t.transactions.length>Whe&&Date.now()-a.time>Ghe){for(let l of a.context.abortListeners)try{l()}catch(c){bi(this.view.state,c)}a.context.abortListeners=null,this.running.splice(i--,1)}else a.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some(i=>i.effects.some(a=>a.is(dy)))&&(this.pendingStart=!0);let s=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(i=>i.isPending&&!this.running.some(a=>a.active.source==i.source))?setTimeout(()=>this.startUpdate(),s):-1,this.composing!=0)for(let i of t.transactions)i.isUserEvent("input.type")?this.composing=2:this.composing==2&&i.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:t}=this.view,e=t.field(yi);for(let n of e.active)n.isPending&&!this.running.some(r=>r.active.source==n.source)&&this.startQuery(n);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(ws).updateSyncTime))}startQuery(t){let{state:e}=this.view,n=sd(e),r=new tH(e,n,t.explicit,this.view),s=new Uhe(t,r);this.running.push(s),Promise.resolve(t.source(r)).then(i=>{s.context.aborted||(s.done=i||null,this.scheduleAccept())},i=>{this.view.dispatch({effects:rp.of(null)}),bi(this.view.state,i)})}scheduleAccept(){this.running.every(t=>t.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(ws).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],n=this.view.state.facet(ws),r=this.view.state.field(yi);for(let s=0;s<this.running.length;s++){let i=this.running[s];if(i.done===void 0)continue;if(this.running.splice(s--,1),i.done){let l=sd(i.updates.length?i.updates[0].startState:this.view.state),c=Math.min(l,i.done.from+(i.active.explicit?0:1)),d=new Bh(i.active.source,i.active.explicit,c,i.done,i.done.from,(t=i.done.to)!==null&&t!==void 0?t:l);for(let h of i.updates)d=d.update(h,n);if(d.hasResult()){e.push(d);continue}}let a=r.active.find(l=>l.source==i.active.source);if(a&&a.isPending)if(i.done==null){let l=new Oa(i.active.source,0);for(let c of i.updates)l=l.update(c,n);l.isPending||e.push(l)}else this.startQuery(a)}(e.length||r.open&&r.open.disabled)&&this.view.dispatch({effects:L6.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(yi,!1);if(e&&e.tooltip&&this.view.state.facet(ws).closeOnBlur){let n=e.open&&Rq(this.view,e.open.tooltip);(!n||!n.dom.contains(t.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:rp.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:dy.of(!1)}),20),this.composing=0}}}),Yhe=typeof navigator=="object"&&/Win/.test(navigator.platform),Khe=uu.highest(Ze.domEventHandlers({keydown(t,e){let n=e.state.field(yi,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||t.key.length>1||t.ctrlKey&&!(Yhe&&t.altKey)||t.metaKey)return!1;let r=n.open.options[n.open.selected],s=n.active.find(a=>a.source==r.source),i=r.completion.commitCharacters||s.result.commitCharacters;return i&&i.indexOf(t.key)>-1&&B6(e,r),!1}})),aH=Ze.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class Zhe{constructor(e,n,r,s){this.field=e,this.line=n,this.from=r,this.to=s}}class F6{constructor(e,n,r){this.field=e,this.from=n,this.to=r}map(e){let n=e.mapPos(this.from,-1,Ds.TrackDel),r=e.mapPos(this.to,1,Ds.TrackDel);return n==null||r==null?null:new F6(this.field,n,r)}}class q6{constructor(e,n){this.lines=e,this.fieldPositions=n}instantiate(e,n){let r=[],s=[n],i=e.doc.lineAt(n),a=/^\s*/.exec(i.text)[0];for(let c of this.lines){if(r.length){let d=a,h=/^\t*/.exec(c)[0].length;for(let m=0;m<h;m++)d+=e.facet(Zp);s.push(n+d.length-h),c=d+c.slice(h)}r.push(c),n+=c.length+1}let l=this.fieldPositions.map(c=>new F6(c.field,s[c.line]+c.from,s[c.line]+c.to));return{text:r,ranges:l}}static parse(e){let n=[],r=[],s=[],i;for(let a of e.split(/\r\n?|\n/)){for(;i=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(a);){let l=i[1]?+i[1]:null,c=i[2]||i[3]||"",d=-1,h=c.replace(/\\[{}]/g,m=>m[1]);for(let m=0;m<n.length;m++)(l!=null?n[m].seq==l:h&&n[m].name==h)&&(d=m);if(d<0){let m=0;for(;m<n.length&&(l==null||n[m].seq!=null&&n[m].seq<l);)m++;n.splice(m,0,{seq:l,name:h}),d=m;for(let g of s)g.field>=d&&g.field++}for(let m of s)if(m.line==r.length&&m.from>i.index){let g=i[2]?3+(i[1]||"").length:2;m.from-=g,m.to-=g}s.push(new Zhe(d,r.length,i.index,i.index+h.length)),a=a.slice(0,i.index)+c+a.slice(i.index+i[0].length)}a=a.replace(/\\([{}])/g,(l,c,d)=>{for(let h of s)h.line==r.length&&h.from>d&&(h.from--,h.to--);return c}),r.push(a)}return new q6(r,s)}}let Jhe=Ot.widget({widget:new class extends Uo{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),efe=Ot.mark({class:"cm-snippetField"});class _f{constructor(e,n){this.ranges=e,this.active=n,this.deco=Ot.set(e.map(r=>(r.from==r.to?Jhe:efe).range(r.from,r.to)),!0)}map(e){let n=[];for(let r of this.ranges){let s=r.map(e);if(!s)return null;n.push(s)}return new _f(n,this.active)}selectionInsideField(e){return e.ranges.every(n=>this.ranges.some(r=>r.field==this.active&&r.from<=n.from&&r.to>=n.to))}}const rg=Qt.define({map(t,e){return t&&t.map(e)}}),tfe=Qt.define(),sp=Os.define({create(){return null},update(t,e){for(let n of e.effects){if(n.is(rg))return n.value;if(n.is(tfe)&&t)return new _f(t.ranges,n.value)}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t},provide:t=>Ze.decorations.from(t,e=>e?e.deco:Ot.none)});function $6(t,e){return Me.create(t.filter(n=>n.field==e).map(n=>Me.range(n.from,n.to)))}function nfe(t){let e=q6.parse(t);return(n,r,s,i)=>{let{text:a,ranges:l}=e.instantiate(n.state,s),{main:c}=n.state.selection,d={changes:{from:s,to:i==c.from?c.to:i,insert:An.of(a)},scrollIntoView:!0,annotations:r?[I6.of(r),ss.userEvent.of("input.complete")]:void 0};if(l.length&&(d.selection=$6(l,0)),l.some(h=>h.field>0)){let h=new _f(l,0),m=d.effects=[rg.of(h)];n.state.field(sp,!1)===void 0&&m.push(Qt.appendConfig.of([sp,ofe,lfe,aH]))}n.dispatch(n.state.update(d))}}function oH(t){return({state:e,dispatch:n})=>{let r=e.field(sp,!1);if(!r||t<0&&r.active==0)return!1;let s=r.active+t,i=t>0&&!r.ranges.some(a=>a.field==s+t);return n(e.update({selection:$6(r.ranges,s),effects:rg.of(i?null:new _f(r.ranges,s)),scrollIntoView:!0})),!0}}const rfe=({state:t,dispatch:e})=>t.field(sp,!1)?(e(t.update({effects:rg.of(null)})),!0):!1,sfe=oH(1),ife=oH(-1),afe=[{key:"Tab",run:sfe,shift:ife},{key:"Escape",run:rfe}],G_=st.define({combine(t){return t.length?t[0]:afe}}),ofe=uu.highest(Yp.compute([G_],t=>t.facet(G_)));function wl(t,e){return{...e,apply:nfe(t)}}const lfe=Ze.domEventHandlers({mousedown(t,e){let n=e.state.field(sp,!1),r;if(!n||(r=e.posAtCoords({x:t.clientX,y:t.clientY}))==null)return!1;let s=n.ranges.find(i=>i.from<=r&&i.to>=r);return!s||s.field==n.active?!1:(e.dispatch({selection:$6(n.ranges,s.field),effects:rg.of(n.ranges.some(i=>i.field>s.field)?new _f(n.ranges,s.field):null),scrollIntoView:!0}),!0)}}),ip={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Gu=Qt.define({map(t,e){let n=e.mapPos(t,-1,Ds.TrackAfter);return n??void 0}}),H6=new class extends od{};H6.startSide=1;H6.endSide=-1;const lH=Os.define({create(){return Bn.empty},update(t,e){if(t=t.map(e.changes),e.selection){let n=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:r=>r>=n.from&&r<=n.to})}for(let n of e.effects)n.is(Gu)&&(t=t.update({add:[H6.range(n.value,n.value+1)]}));return t}});function cfe(){return[dfe,lH]}const lS="()[]{}<>«»»«[]{}";function cH(t){for(let e=0;e<lS.length;e+=2)if(lS.charCodeAt(e)==t)return lS.charAt(e+1);return s6(t<128?t:t+1)}function uH(t,e){return t.languageDataAt("closeBrackets",e)[0]||ip}const ufe=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),dfe=Ze.inputHandler.of((t,e,n,r)=>{if((ufe?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let s=t.state.selection.main;if(r.length>2||r.length==2&&ko(vi(r,0))==1||e!=s.from||n!=s.to)return!1;let i=mfe(t.state,r);return i?(t.dispatch(i),!0):!1}),hfe=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=uH(t,t.selection.main.head).brackets||ip.brackets,s=null,i=t.changeByRange(a=>{if(a.empty){let l=pfe(t.doc,a.head);for(let c of r)if(c==l&&Ob(t.doc,a.head)==cH(vi(c,0)))return{changes:{from:a.head-c.length,to:a.head+c.length},range:Me.cursor(a.head-c.length)}}return{range:s=a}});return s||e(t.update(i,{scrollIntoView:!0,userEvent:"delete.backward"})),!s},ffe=[{key:"Backspace",run:hfe}];function mfe(t,e){let n=uH(t,t.selection.main.head),r=n.brackets||ip.brackets;for(let s of r){let i=cH(vi(s,0));if(e==s)return i==s?vfe(t,s,r.indexOf(s+s+s)>-1,n):gfe(t,s,i,n.before||ip.before);if(e==i&&dH(t,t.selection.main.from))return xfe(t,s,i)}return null}function dH(t,e){let n=!1;return t.field(lH).between(0,t.doc.length,r=>{r==e&&(n=!0)}),n}function Ob(t,e){let n=t.sliceString(e,e+2);return n.slice(0,ko(vi(n,0)))}function pfe(t,e){let n=t.sliceString(e-2,e);return ko(vi(n,0))==n.length?n:n.slice(1)}function gfe(t,e,n,r){let s=null,i=t.changeByRange(a=>{if(!a.empty)return{changes:[{insert:e,from:a.from},{insert:n,from:a.to}],effects:Gu.of(a.to+e.length),range:Me.range(a.anchor+e.length,a.head+e.length)};let l=Ob(t.doc,a.head);return!l||/\s/.test(l)||r.indexOf(l)>-1?{changes:{insert:e+n,from:a.head},effects:Gu.of(a.head+e.length),range:Me.cursor(a.head+e.length)}:{range:s=a}});return s?null:t.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function xfe(t,e,n){let r=null,s=t.changeByRange(i=>i.empty&&Ob(t.doc,i.head)==n?{changes:{from:i.head,to:i.head+n.length,insert:n},range:Me.cursor(i.head+n.length)}:r={range:i});return r?null:t.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function vfe(t,e,n,r){let s=r.stringPrefixes||ip.stringPrefixes,i=null,a=t.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:e,from:l.to}],effects:Gu.of(l.to+e.length),range:Me.range(l.anchor+e.length,l.head+e.length)};let c=l.head,d=Ob(t.doc,c),h;if(d==e){if(X_(t,c))return{changes:{insert:e+e,from:c},effects:Gu.of(c+e.length),range:Me.cursor(c+e.length)};if(dH(t,c)){let g=n&&t.sliceDoc(c,c+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:c,to:c+g.length,insert:g},range:Me.cursor(c+g.length)}}}else{if(n&&t.sliceDoc(c-2*e.length,c)==e+e&&(h=Y_(t,c-2*e.length,s))>-1&&X_(t,h))return{changes:{insert:e+e+e+e,from:c},effects:Gu.of(c+e.length),range:Me.cursor(c+e.length)};if(t.charCategorizer(c)(d)!=Tr.Word&&Y_(t,c,s)>-1&&!yfe(t,c,e,s))return{changes:{insert:e+e,from:c},effects:Gu.of(c+e.length),range:Me.cursor(c+e.length)}}return{range:i=l}});return i?null:t.update(a,{scrollIntoView:!0,userEvent:"input.type"})}function X_(t,e){let n=Ss(t).resolveInner(e+1);return n.parent&&n.from==e}function yfe(t,e,n,r){let s=Ss(t).resolveInner(e,-1),i=r.reduce((a,l)=>Math.max(a,l.length),0);for(let a=0;a<5;a++){let l=t.sliceDoc(s.from,Math.min(s.to,s.from+n.length+i)),c=l.indexOf(n);if(!c||c>-1&&r.indexOf(l.slice(0,c))>-1){let h=s.firstChild;for(;h&&h.from==s.from&&h.to-h.from>n.length+c;){if(t.sliceDoc(h.to-n.length,h.to)==n)return!1;h=h.firstChild}return!0}let d=s.to==e&&s.parent;if(!d)break;s=d}return!1}function Y_(t,e,n){let r=t.charCategorizer(e);if(r(t.sliceDoc(e-1,e))!=Tr.Word)return e;for(let s of n){let i=e-s.length;if(t.sliceDoc(i,e)==s&&r(t.sliceDoc(i-1,i))!=Tr.Word)return i}return-1}function bfe(t={}){return[Khe,yi,ws.of(t),Xhe,wfe,aH]}const hH=[{key:"Ctrl-Space",run:oS},{mac:"Alt-`",run:oS},{mac:"Alt-i",run:oS},{key:"Escape",run:Vhe},{key:"ArrowDown",run:j1(!0)},{key:"ArrowUp",run:j1(!1)},{key:"PageDown",run:j1(!0,"page")},{key:"PageUp",run:j1(!1,"page")},{key:"Enter",run:Qhe}],wfe=uu.highest(Yp.computeN([ws],t=>t.facet(ws).defaultKeymap?[hH]:[]));class K_{constructor(e,n,r){this.from=e,this.to=n,this.diagnostic=r}}class Qu{constructor(e,n,r){this.diagnostics=e,this.panel=n,this.selected=r}static init(e,n,r){let s=r.facet(ap).markerFilter;s&&(e=s(e,r));let i=e.slice().sort((x,y)=>x.from-y.from||x.to-y.to),a=new Hl,l=[],c=0,d=r.doc.iter(),h=0,m=r.doc.length;for(let x=0;;){let y=x==i.length?null:i[x];if(!y&&!l.length)break;let w,S;if(l.length)w=c,S=l.reduce((N,T)=>Math.min(N,T.to),y&&y.from>w?y.from:1e8);else{if(w=y.from,w>m)break;S=y.to,l.push(y),x++}for(;x<i.length;){let N=i[x];if(N.from==w&&(N.to>N.from||N.to==w))l.push(N),x++,S=Math.min(N.to,S);else{S=Math.min(N.from,S);break}}S=Math.min(S,m);let k=!1;if(l.some(N=>N.from==w&&(N.to==S||S==m))&&(k=w==S,!k&&S-w<10)){let N=w-(h+d.value.length);N>0&&(d.next(N),h=w);for(let T=w;;){if(T>=S){k=!0;break}if(!d.lineBreak&&h+d.value.length>T)break;T=h+d.value.length,h+=d.value.length,d.next()}}let j=Dfe(l);if(k)a.add(w,w,Ot.widget({widget:new _fe(j),diagnostics:l.slice()}));else{let N=l.reduce((T,E)=>E.markClass?T+" "+E.markClass:T,"");a.add(w,S,Ot.mark({class:"cm-lintRange cm-lintRange-"+j+N,diagnostics:l.slice(),inclusiveEnd:l.some(T=>T.to>S)}))}if(c=S,c==m)break;for(let N=0;N<l.length;N++)l[N].to<=c&&l.splice(N--,1)}let g=a.finish();return new Qu(g,n,of(g))}}function of(t,e=null,n=0){let r=null;return t.between(n,1e9,(s,i,{spec:a})=>{if(!(e&&a.diagnostics.indexOf(e)<0))if(!r)r=new K_(s,i,e||a.diagnostics[0]);else{if(a.diagnostics.indexOf(r.diagnostic)<0)return!1;r=new K_(r.from,i,r.diagnostic)}}),r}function Sfe(t,e){let n=e.pos,r=e.end||n,s=t.state.facet(ap).hideOn(t,n,r);if(s!=null)return s;let i=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(a=>a.is(fH))||t.changes.touchesRange(i.from,Math.max(i.to,r)))}function kfe(t,e){return t.field(Wi,!1)?e:e.concat(Qt.appendConfig.of(Pfe))}const fH=Qt.define(),Q6=Qt.define(),mH=Qt.define(),Wi=Os.define({create(){return new Qu(Ot.none,null,null)},update(t,e){if(e.docChanged&&t.diagnostics.size){let n=t.diagnostics.map(e.changes),r=null,s=t.panel;if(t.selected){let i=e.changes.mapPos(t.selected.from,1);r=of(n,t.selected.diagnostic,i)||of(n,null,i)}!n.size&&s&&e.state.facet(ap).autoPanel&&(s=null),t=new Qu(n,s,r)}for(let n of e.effects)if(n.is(fH)){let r=e.state.facet(ap).autoPanel?n.value.length?op.open:null:t.panel;t=Qu.init(n.value,r,e.state)}else n.is(Q6)?t=new Qu(t.diagnostics,n.value?op.open:null,t.selected):n.is(mH)&&(t=new Qu(t.diagnostics,t.panel,n.value));return t},provide:t=>[Y0.from(t,e=>e.panel),Ze.decorations.from(t,e=>e.diagnostics)]}),Ofe=Ot.mark({class:"cm-lintRange cm-lintRange-active"});function jfe(t,e,n){let{diagnostics:r}=t.state.field(Wi),s,i=-1,a=-1;r.between(e-(n<0?1:0),e+(n>0?1:0),(c,d,{spec:h})=>{if(e>=c&&e<=d&&(c==d||(e>c||n>0)&&(e<d||n<0)))return s=h.diagnostics,i=c,a=d,!1});let l=t.state.facet(ap).tooltipFilter;return s&&l&&(s=l(s,t.state)),s?{pos:i,end:a,above:t.state.doc.lineAt(i).to<a,create(){return{dom:Nfe(t,s)}}}:null}function Nfe(t,e){return lr("ul",{class:"cm-tooltip-lint"},e.map(n=>gH(t,n,!1)))}const Cfe=t=>{let e=t.state.field(Wi,!1);(!e||!e.panel)&&t.dispatch({effects:kfe(t.state,[Q6.of(!0)])});let n=X0(t,op.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},Z_=t=>{let e=t.state.field(Wi,!1);return!e||!e.panel?!1:(t.dispatch({effects:Q6.of(!1)}),!0)},Tfe=t=>{let e=t.state.field(Wi,!1);if(!e)return!1;let n=t.state.selection.main,r=e.diagnostics.iter(n.to+1);return!r.value&&(r=e.diagnostics.iter(0),!r.value||r.from==n.from&&r.to==n.to)?!1:(t.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)},Efe=[{key:"Mod-Shift-m",run:Cfe,preventDefault:!0},{key:"F8",run:Tfe}],ap=st.define({combine(t){return{sources:t.map(e=>e.source).filter(e=>e!=null),...Vo(t.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:J_,tooltipFilter:J_,needsRefresh:(e,n)=>e?n?r=>e(r)||n(r):e:n,hideOn:(e,n)=>e?n?(r,s,i)=>e(r,s,i)||n(r,s,i):e:n,autoPanel:(e,n)=>e||n})}}});function J_(t,e){return t?e?(n,r)=>e(t(n,r),r):t:e}function pH(t){let e=[];if(t)e:for(let{name:n}of t){for(let r=0;r<n.length;r++){let s=n[r];if(/[a-zA-Z]/.test(s)&&!e.some(i=>i.toLowerCase()==s.toLowerCase())){e.push(s);continue e}}e.push("")}return e}function gH(t,e,n){var r;let s=n?pH(e.actions):[];return lr("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},lr("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):e.message),(r=e.actions)===null||r===void 0?void 0:r.map((i,a)=>{let l=!1,c=x=>{if(x.preventDefault(),l)return;l=!0;let y=of(t.state.field(Wi).diagnostics,e);y&&i.apply(t,y.from,y.to)},{name:d}=i,h=s[a]?d.indexOf(s[a]):-1,m=h<0?d:[d.slice(0,h),lr("u",d.slice(h,h+1)),d.slice(h+1)],g=i.markClass?" "+i.markClass:"";return lr("button",{type:"button",class:"cm-diagnosticAction"+g,onclick:c,onmousedown:c,"aria-label":` Action: ${d}${h<0?"":` (access key "${s[a]})"`}.`},m)}),e.source&&lr("div",{class:"cm-diagnosticSource"},e.source))}class _fe extends Uo{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return lr("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class eA{constructor(e,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=gH(e,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class op{constructor(e){this.view=e,this.items=[];let n=s=>{if(s.keyCode==27)Z_(this.view),this.view.focus();else if(s.keyCode==38||s.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(s.keyCode==40||s.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(s.keyCode==36)this.moveSelection(0);else if(s.keyCode==35)this.moveSelection(this.items.length-1);else if(s.keyCode==13)this.view.focus();else if(s.keyCode>=65&&s.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:i}=this.items[this.selectedIndex],a=pH(i.actions);for(let l=0;l<a.length;l++)if(a[l].toUpperCase().charCodeAt(0)==s.keyCode){let c=of(this.view.state.field(Wi).diagnostics,i);c&&i.actions[l].apply(e,c.from,c.to)}}else return;s.preventDefault()},r=s=>{for(let i=0;i<this.items.length;i++)this.items[i].dom.contains(s.target)&&this.moveSelection(i)};this.list=lr("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:n,onclick:r}),this.dom=lr("div",{class:"cm-panel-lint"},this.list,lr("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>Z_(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Wi).selected;if(!e)return-1;for(let n=0;n<this.items.length;n++)if(this.items[n].diagnostic==e.diagnostic)return n;return-1}update(){let{diagnostics:e,selected:n}=this.view.state.field(Wi),r=0,s=!1,i=null,a=new Set;for(e.between(0,this.view.state.doc.length,(l,c,{spec:d})=>{for(let h of d.diagnostics){if(a.has(h))continue;a.add(h);let m=-1,g;for(let x=r;x<this.items.length;x++)if(this.items[x].diagnostic==h){m=x;break}m<0?(g=new eA(this.view,h),this.items.splice(r,0,g),s=!0):(g=this.items[m],m>r&&(this.items.splice(r,m-r),s=!0)),n&&g.diagnostic==n.diagnostic?g.dom.hasAttribute("aria-selected")||(g.dom.setAttribute("aria-selected","true"),i=g):g.dom.hasAttribute("aria-selected")&&g.dom.removeAttribute("aria-selected"),r++}});r<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)s=!0,this.items.pop();this.items.length==0&&(this.items.push(new eA(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),s=!0),i?(this.list.setAttribute("aria-activedescendant",i.id),this.view.requestMeasure({key:this,read:()=>({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:l,panel:c})=>{let d=c.height/this.list.offsetHeight;l.top<c.top?this.list.scrollTop-=(c.top-l.top)/d:l.bottom>c.bottom&&(this.list.scrollTop+=(l.bottom-c.bottom)/d)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),s&&this.sync()}sync(){let e=this.list.firstChild;function n(){let r=e;e=r.nextSibling,r.remove()}for(let r of this.items)if(r.dom.parentNode==this.list){for(;e!=r.dom;)n();e=r.dom.nextSibling}else this.list.insertBefore(r.dom,e);for(;e;)n()}moveSelection(e){if(this.selectedIndex<0)return;let n=this.view.state.field(Wi),r=of(n.diagnostics,this.items[e].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:mH.of(r)})}static open(e){return new op(e)}}function Afe(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(t)}</svg>')`}function N1(t){return Afe(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${t}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const Mfe=Ze.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:N1("#d11")},".cm-lintRange-warning":{backgroundImage:N1("orange")},".cm-lintRange-info":{backgroundImage:N1("#999")},".cm-lintRange-hint":{backgroundImage:N1("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function Rfe(t){return t=="error"?4:t=="warning"?3:t=="info"?2:1}function Dfe(t){let e="hint",n=1;for(let r of t){let s=Rfe(r.severity);s>n&&(n=s,e=r.severity)}return e}const Pfe=[Wi,Ze.decorations.compute([Wi],t=>{let{selected:e,panel:n}=t.field(Wi);return!e||!n||e.from==e.to?Ot.none:Ot.set([Ofe.range(e.from,e.to)])}),gce(jfe,{hideOn:Sfe}),Mfe];var tA=function(e){e===void 0&&(e={});var{crosshairCursor:n=!1}=e,r=[];e.closeBracketsKeymap!==!1&&(r=r.concat(ffe)),e.defaultKeymap!==!1&&(r=r.concat(Yde)),e.searchKeymap!==!1&&(r=r.concat(She)),e.historyKeymap!==!1&&(r=r.concat(rde)),e.foldKeymap!==!1&&(r=r.concat(fue)),e.completionKeymap!==!1&&(r=r.concat(hH)),e.lintKeymap!==!1&&(r=r.concat(Efe));var s=[];return e.lineNumbers!==!1&&s.push(Cce()),e.highlightActiveLineGutter!==!1&&s.push(_ce()),e.highlightSpecialChars!==!1&&s.push(Vle()),e.history!==!1&&s.push(Gue()),e.foldGutter!==!1&&s.push(xue()),e.drawSelection!==!1&&s.push(Dle()),e.dropCursor!==!1&&s.push(Ble()),e.allowMultipleSelections!==!1&&s.push(Nn.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&s.push(sue()),e.syntaxHighlighting!==!1&&s.push(r$(wue,{fallback:!0})),e.bracketMatching!==!1&&s.push(Tue()),e.closeBrackets!==!1&&s.push(cfe()),e.autocompletion!==!1&&s.push(bfe()),e.rectangularSelection!==!1&&s.push(ice()),n!==!1&&s.push(lce()),e.highlightActiveLine!==!1&&s.push(Kle()),e.highlightSelectionMatches!==!1&&s.push(rhe()),e.tabSize&&typeof e.tabSize=="number"&&s.push(Zp.of(" ".repeat(e.tabSize))),s.concat([Yp.of(r.flat())]).filter(Boolean)};const zfe="#e5c07b",nA="#e06c75",Ife="#56b6c2",Lfe="#ffffff",bv="#abb2bf",gO="#7d8799",Bfe="#61afef",Ffe="#98c379",rA="#d19a66",qfe="#c678dd",$fe="#21252b",sA="#2c313a",iA="#282c34",cS="#353a42",Hfe="#3E4451",aA="#528bff",Qfe=Ze.theme({"&":{color:bv,backgroundColor:iA},".cm-content":{caretColor:aA},".cm-cursor, .cm-dropCursor":{borderLeftColor:aA},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:Hfe},".cm-panels":{backgroundColor:$fe,color:bv},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:iA,color:gO,border:"none"},".cm-activeLineGutter":{backgroundColor:sA},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:cS},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:cS,borderBottomColor:cS},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:sA,color:bv}}},{dark:!0}),Vfe=eg.define([{tag:ye.keyword,color:qfe},{tag:[ye.name,ye.deleted,ye.character,ye.propertyName,ye.macroName],color:nA},{tag:[ye.function(ye.variableName),ye.labelName],color:Bfe},{tag:[ye.color,ye.constant(ye.name),ye.standard(ye.name)],color:rA},{tag:[ye.definition(ye.name),ye.separator],color:bv},{tag:[ye.typeName,ye.className,ye.number,ye.changed,ye.annotation,ye.modifier,ye.self,ye.namespace],color:zfe},{tag:[ye.operator,ye.operatorKeyword,ye.url,ye.escape,ye.regexp,ye.link,ye.special(ye.string)],color:Ife},{tag:[ye.meta,ye.comment],color:gO},{tag:ye.strong,fontWeight:"bold"},{tag:ye.emphasis,fontStyle:"italic"},{tag:ye.strikethrough,textDecoration:"line-through"},{tag:ye.link,color:gO,textDecoration:"underline"},{tag:ye.heading,fontWeight:"bold",color:nA},{tag:[ye.atom,ye.bool,ye.special(ye.variableName)],color:rA},{tag:[ye.processingInstruction,ye.string,ye.inserted],color:Ffe},{tag:ye.invalid,color:Lfe}]),xH=[Qfe,r$(Vfe)];var Ufe=Ze.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),Wfe=function(e){e===void 0&&(e={});var{indentWithTab:n=!0,editable:r=!0,readOnly:s=!1,theme:i="light",placeholder:a="",basicSetup:l=!0}=e,c=[];switch(n&&c.unshift(Yp.of([Kde])),l&&(typeof l=="boolean"?c.unshift(tA()):c.unshift(tA(l))),a&&c.unshift(tce(a)),i){case"light":c.push(Ufe);break;case"dark":c.push(xH);break;case"none":break;default:c.push(i);break}return r===!1&&c.push(Ze.editable.of(!1)),s&&c.push(Nn.readOnly.of(!0)),[...c]},Gfe=t=>({line:t.state.doc.lineAt(t.state.selection.main.from),lineCount:t.state.doc.lines,lineBreak:t.state.lineBreak,length:t.state.doc.length,readOnly:t.state.readOnly,tabSize:t.state.tabSize,selection:t.state.selection,selectionAsSingle:t.state.selection.asSingle().main,ranges:t.state.selection.ranges,selectionCode:t.state.sliceDoc(t.state.selection.main.from,t.state.selection.main.to),selections:t.state.selection.ranges.map(e=>t.state.sliceDoc(e.from,e.to)),selectedText:t.state.selection.ranges.some(e=>!e.empty)});class Xfe{constructor(e,n){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=n,this.timeoutMS=n,this.callbacks.push(e)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var e=this.callbacks.slice();this.callbacks.length=0,e.forEach(n=>{try{n()}catch(r){console.error("TimeoutLatch callback error:",r)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}}class oA{constructor(){this.interval=null,this.latches=new Set}add(e){this.latches.add(e),this.start()}remove(e){this.latches.delete(e),this.latches.size===0&&this.stop()}start(){this.interval===null&&(this.interval=setInterval(()=>{this.latches.forEach(e=>{e.tick(),e.isDone&&this.remove(e)})},1))}stop(){this.interval!==null&&(clearInterval(this.interval),this.interval=null)}}var uS=null,Yfe=()=>typeof window>"u"?new oA:(uS||(uS=new oA),uS),lA=Qo.define(),Kfe=200,Zfe=[];function Jfe(t){var{value:e,selection:n,onChange:r,onStatistics:s,onCreateEditor:i,onUpdate:a,extensions:l=Zfe,autoFocus:c,theme:d="light",height:h=null,minHeight:m=null,maxHeight:g=null,width:x=null,minWidth:y=null,maxWidth:w=null,placeholder:S="",editable:k=!0,readOnly:j=!1,indentWithTab:N=!0,basicSetup:T=!0,root:E,initialState:_}=t,[A,D]=b.useState(),[q,B]=b.useState(),[H,W]=b.useState(),ee=b.useState(()=>({current:null}))[0],I=b.useState(()=>({current:null}))[0],V=Ze.theme({"&":{height:h,minHeight:m,maxHeight:g,width:x,minWidth:y,maxWidth:w},"& .cm-scroller":{height:"100% !important"}}),L=Ze.updateListener.of(Y=>{if(Y.docChanged&&typeof r=="function"&&!Y.transactions.some(X=>X.annotation(lA))){ee.current?ee.current.reset():(ee.current=new Xfe(()=>{if(I.current){var X=I.current;I.current=null,X()}ee.current=null},Kfe),Yfe().add(ee.current));var R=Y.state.doc,ie=R.toString();r(ie,Y)}s&&s(Gfe(Y))}),$=Wfe({theme:d,editable:k,readOnly:j,placeholder:S,indentWithTab:N,basicSetup:T}),K=[L,V,...$];return a&&typeof a=="function"&&K.push(Ze.updateListener.of(a)),K=K.concat(l),b.useLayoutEffect(()=>{if(A&&!H){var Y={doc:e,selection:n,extensions:K},R=_?Nn.fromJSON(_.json,Y,_.fields):Nn.create(Y);if(W(R),!q){var ie=new Ze({state:R,parent:A,root:E});B(ie),i&&i(ie,R)}}return()=>{q&&(W(void 0),B(void 0))}},[A,H]),b.useEffect(()=>{t.container&&D(t.container)},[t.container]),b.useEffect(()=>()=>{q&&(q.destroy(),B(void 0)),ee.current&&(ee.current.cancel(),ee.current=null)},[q]),b.useEffect(()=>{c&&q&&q.focus()},[c,q]),b.useEffect(()=>{q&&q.dispatch({effects:Qt.reconfigure.of(K)})},[d,l,h,m,g,x,y,w,S,k,j,N,T,r,a]),b.useEffect(()=>{if(e!==void 0){var Y=q?q.state.doc.toString():"";if(q&&e!==Y){var R=ee.current&&!ee.current.isDone,ie=()=>{q&&e!==q.state.doc.toString()&&q.dispatch({changes:{from:0,to:q.state.doc.toString().length,insert:e||""},annotations:[lA.of(!0)]})};R?I.current=ie:ie()}}},[e,q]),{state:H,setState:W,view:q,setView:B,container:A,setContainer:D}}var eme=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],vH=b.forwardRef((t,e)=>{var{className:n,value:r="",selection:s,extensions:i=[],onChange:a,onStatistics:l,onCreateEditor:c,onUpdate:d,autoFocus:h,theme:m="light",height:g,minHeight:x,maxHeight:y,width:w,minWidth:S,maxWidth:k,basicSetup:j,placeholder:N,indentWithTab:T,editable:E,readOnly:_,root:A,initialState:D}=t,q=zJ(t,eme),B=b.useRef(null),{state:H,view:W,container:ee,setContainer:I}=Jfe({root:A,value:r,autoFocus:h,theme:m,height:g,minHeight:x,maxHeight:y,width:w,minWidth:S,maxWidth:k,basicSetup:j,placeholder:N,indentWithTab:T,editable:E,readOnly:_,selection:s,onChange:a,onStatistics:l,onCreateEditor:c,onUpdate:d,extensions:i,initialState:D});b.useImperativeHandle(e,()=>({editor:B.current,state:H,view:W}),[B,ee,H,W]);var V=b.useCallback($=>{B.current=$,I($)},[I]);if(typeof r!="string")throw new Error("value must be typeof string but got "+typeof r);var L=typeof m=="string"?"cm-theme-"+m:"cm-theme";return o.jsx("div",IJ({ref:V,className:""+L+(n?" "+n:"")},q))});vH.displayName="CodeMirror";var cA={};class fy{constructor(e,n,r,s,i,a,l,c,d,h=0,m){this.p=e,this.stack=n,this.state=r,this.reducePos=s,this.pos=i,this.score=a,this.buffer=l,this.bufferBase=c,this.curContext=d,this.lookAhead=h,this.parent=m}toString(){return`[${this.stack.filter((e,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,n,r=0){let s=e.parser.context;return new fy(e,[],n,r,r,0,[],0,s?new uA(s,s.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var n;let r=e>>19,s=e&65535,{parser:i}=this.p,a=this.reducePos<this.pos-25;a&&this.setLookAhead(this.pos);let l=i.dynamicPrecedence(s);if(l&&(this.score+=l),r==0){this.pushState(i.getGoto(this.state,s,!0),this.reducePos),s<i.minRepeatTerm&&this.storeNode(s,this.reducePos,this.reducePos,a?8:4,!0),this.reduceContext(s,this.reducePos);return}let c=this.stack.length-(r-1)*3-(e&262144?6:0),d=c?this.stack[c-2]:this.p.ranges[0].from,h=this.reducePos-d;h>=2e3&&!(!((n=this.p.parser.nodeSet.types[s])===null||n===void 0)&&n.isAnonymous)&&(d==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=h):this.p.lastBigReductionSize<h&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=d,this.p.lastBigReductionSize=h));let m=c?this.stack[c-1]:0,g=this.bufferBase+this.buffer.length-m;if(s<i.minRepeatTerm||e&131072){let x=i.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(s,d,x,g+4,!0)}if(e&262144)this.state=this.stack[c];else{let x=this.stack[c-3];this.state=i.getGoto(x,s,!0)}for(;this.stack.length>c;)this.stack.pop();this.reduceContext(s,d)}storeNode(e,n,r,s=4,i=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let a=this,l=this.buffer.length;if(l==0&&a.parent&&(l=a.bufferBase-a.parent.bufferBase,a=a.parent),l>0&&a.buffer[l-4]==0&&a.buffer[l-1]>-1){if(n==r)return;if(a.buffer[l-2]>=n){a.buffer[l-2]=r;return}}}if(!i||this.pos==r)this.buffer.push(e,n,r,s);else{let a=this.buffer.length;if(a>0&&(this.buffer[a-4]!=0||this.buffer[a-1]<0)){let l=!1;for(let c=a;c>0&&this.buffer[c-2]>r;c-=4)if(this.buffer[c-1]>=0){l=!0;break}if(l)for(;a>0&&this.buffer[a-2]>r;)this.buffer[a]=this.buffer[a-4],this.buffer[a+1]=this.buffer[a-3],this.buffer[a+2]=this.buffer[a-2],this.buffer[a+3]=this.buffer[a-1],a-=4,s>4&&(s-=4)}this.buffer[a]=e,this.buffer[a+1]=n,this.buffer[a+2]=r,this.buffer[a+3]=s}}shift(e,n,r,s){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let i=e,{parser:a}=this.p;(s>this.pos||n<=a.maxNode)&&(this.pos=s,a.stateFlag(i,1)||(this.reducePos=s)),this.pushState(i,r),this.shiftContext(n,r),n<=a.maxNode&&this.buffer.push(n,r,s,4)}else this.pos=s,this.shiftContext(n,r),n<=this.p.parser.maxNode&&this.buffer.push(n,r,s,4)}apply(e,n,r,s){e&65536?this.reduce(e):this.shift(e,n,r,s)}useNode(e,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let s=this.pos;this.reducePos=this.pos=s+e.length,this.pushState(n,s),this.buffer.push(r,s,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,n=e.buffer.length;for(;n>0&&e.buffer[n-2]>e.reducePos;)n-=4;let r=e.buffer.slice(n),s=e.bufferBase+n;for(;e&&s==e.bufferBase;)e=e.parent;return new fy(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,s,this.curContext,this.lookAhead,e)}recoverByDelete(e,n){let r=e<=this.p.parser.maxNode;r&&this.storeNode(e,this.pos,n,4),this.storeNode(0,this.pos,n,r?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(e){for(let n=new tme(this);;){let r=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,e);if(r==0)return!1;if((r&65536)==0)return!0;n.reduce(r)}}recoverByInsert(e){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let s=[];for(let i=0,a;i<n.length;i+=2)(a=n[i+1])!=this.state&&this.p.parser.hasAction(a,e)&&s.push(n[i],a);if(this.stack.length<120)for(let i=0;s.length<8&&i<n.length;i+=2){let a=n[i+1];s.some((l,c)=>c&1&&l==a)||s.push(n[i],a)}n=s}let r=[];for(let s=0;s<n.length&&r.length<4;s+=2){let i=n[s+1];if(i==this.state)continue;let a=this.split();a.pushState(i,this.pos),a.storeNode(0,a.pos,a.pos,4,!0),a.shiftContext(n[s],this.pos),a.reducePos=this.pos,a.score-=200,r.push(a)}return r}forceReduce(){let{parser:e}=this.p,n=e.stateSlot(this.state,5);if((n&65536)==0)return!1;if(!e.validAction(this.state,n)){let r=n>>19,s=n&65535,i=this.stack.length-r*3;if(i<0||e.getGoto(this.stack[i],s,!1)<0){let a=this.findForcedReduction();if(a==null)return!1;n=a}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:e}=this.p,n=[],r=(s,i)=>{if(!n.includes(s))return n.push(s),e.allActions(s,a=>{if(!(a&393216))if(a&65536){let l=(a>>19)-i;if(l>1){let c=a&65535,d=this.stack.length-l*3;if(d>=0&&e.getGoto(this.stack[d],c,!1)>=0)return l<<19|65536|c}}else{let l=r(a,i+1);if(l!=null)return l}})};return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let n=0;n<this.stack.length;n+=3)if(this.stack[n]!=e.stack[n])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(n)))}reduceContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(n)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let n=new uA(this.curContext.tracker,e);n.hash!=this.curContext.hash&&this.emitContext(),this.curContext=n}}setLookAhead(e){e>this.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class uA{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}}class tme{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let n=e&65535,r=e>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let s=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=s}}class my{constructor(e,n,r){this.stack=e,this.pos=n,this.index=r,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,n=e.bufferBase+e.buffer.length){return new my(e,n,n-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new my(this.stack,this.pos,this.index)}}function C1(t,e=Uint16Array){if(typeof t!="string")return t;let n=null;for(let r=0,s=0;r<t.length;){let i=0;for(;;){let a=t.charCodeAt(r++),l=!1;if(a==126){i=65535;break}a>=92&&a--,a>=34&&a--;let c=a-32;if(c>=46&&(c-=46,l=!0),i+=c,l)break;i*=46}n?n[s++]=i:n=new e(i)}return n}class wv{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const dA=new wv;class nme{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=dA,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(e,n){let r=this.range,s=this.rangeIndex,i=this.pos+e;for(;i<r.from;){if(!s)return null;let a=this.ranges[--s];i-=r.from-a.to,r=a}for(;n<0?i>r.to:i>=r.to;){if(s==this.ranges.length-1)return null;let a=this.ranges[++s];i+=a.from-r.to,r=a}return i}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let n of this.ranges)if(n.to>e)return Math.max(e,n.from);return this.end}peek(e){let n=this.chunkOff+e,r,s;if(n>=0&&n<this.chunk.length)r=this.pos+e,s=this.chunk.charCodeAt(n);else{let i=this.resolveOffset(e,1);if(i==null)return-1;if(r=i,r>=this.chunk2Pos&&r<this.chunk2Pos+this.chunk2.length)s=this.chunk2.charCodeAt(r-this.chunk2Pos);else{let a=this.rangeIndex,l=this.range;for(;l.to<=r;)l=this.ranges[++a];this.chunk2=this.input.chunk(this.chunk2Pos=r),r+this.chunk2.length>l.to&&(this.chunk2=this.chunk2.slice(0,l.to-r)),s=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),s}acceptToken(e,n=0){let r=n?this.resolveOffset(n,-1):this.pos;if(r==null||r<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=r}acceptTokenTo(e,n){this.token.value=e,this.token.end=n}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:n}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=n,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),n=this.pos+e.length;this.chunk=n>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,n){if(n?(this.token=n,n.start=e,n.lookAhead=e+1,n.value=n.extended=-1):this.token=dA,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,n){if(e>=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,n-this.chunkPos);if(e>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,n-this.chunk2Pos);if(e>=this.range.from&&n<=this.range.to)return this.input.read(e,n);let r="";for(let s of this.ranges){if(s.from>=n)break;s.to>e&&(r+=this.input.read(Math.max(s.from,e),Math.min(s.to,n)))}return r}}class Fh{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:r}=n.p;rme(this.data,e,n,this.id,r.data,r.tokenPrecTable)}}Fh.prototype.contextual=Fh.prototype.fallback=Fh.prototype.extend=!1;Fh.prototype.fallback=Fh.prototype.extend=!1;class jb{constructor(e,n={}){this.token=e,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function rme(t,e,n,r,s,i){let a=0,l=1<<r,{dialect:c}=n.p.parser;e:for(;(l&t[a])!=0;){let d=t[a+1];for(let x=a+3;x<d;x+=2)if((t[x+1]&l)>0){let y=t[x];if(c.allows(y)&&(e.token.value==-1||e.token.value==y||sme(y,e.token.value,s,i))){e.acceptToken(y);break}}let h=e.next,m=0,g=t[a+2];if(e.next<0&&g>m&&t[d+g*3-3]==65535){a=t[d+g*3-1];continue e}for(;m<g;){let x=m+g>>1,y=d+x+(x<<1),w=t[y],S=t[y+1]||65536;if(h<w)g=x;else if(h>=S)m=x+1;else{a=t[y+2],e.advance();continue e}}break}}function hA(t,e,n){for(let r=e,s;(s=t[r])!=65535;r++)if(s==n)return r-e;return-1}function sme(t,e,n,r){let s=hA(n,r,e);return s<0||hA(n,r,t)<s}const qi=typeof process<"u"&&cA&&/\bparse\b/.test(cA.LOG);let dS=null;function fA(t,e,n){let r=t.cursor(hs.IncludeAnonymous);for(r.moveTo(e);;)if(!(n<0?r.childBefore(e):r.childAfter(e)))for(;;){if((n<0?r.to<e:r.from>e)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,e-25)):Math.min(t.length,Math.max(r.from+1,e+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:t.length}}class ime{constructor(e,n){this.fragments=e,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?fA(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?fA(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let n=this.trees.length-1;if(n<0)return this.nextFragment(),null;let r=this.trees[n],s=this.index[n];if(s==r.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let i=r.children[s],a=this.start[n]+r.positions[s];if(a>e)return this.nextStart=a,null;if(i instanceof ur){if(a==e){if(a<this.safeFrom)return null;let l=a+i.length;if(l<=this.safeTo){let c=i.prop(an.lookAhead);if(!c||l+c<this.fragment.to)return i}}this.index[n]++,a+i.length>=Math.max(this.safeFrom,e)&&(this.trees.push(i),this.start.push(a),this.index.push(0))}else this.index[n]++,this.nextStart=a+i.length}}}class ame{constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new wv)}getActions(e){let n=0,r=null,{parser:s}=e.p,{tokenizers:i}=s,a=s.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,c=0;for(let d=0;d<i.length;d++){if((1<<d&a)==0)continue;let h=i[d],m=this.tokens[d];if(!(r&&!h.fallback)&&((h.contextual||m.start!=e.pos||m.mask!=a||m.context!=l)&&(this.updateCachedToken(m,h,e),m.mask=a,m.context=l),m.lookAhead>m.end+25&&(c=Math.max(m.lookAhead,c)),m.value!=0)){let g=n;if(m.extended>-1&&(n=this.addActions(e,m.extended,m.end,n)),n=this.addActions(e,m.value,m.end,n),!h.extend&&(r=m,n>g))break}}for(;this.actions.length>n;)this.actions.pop();return c&&e.setLookAhead(c),!r&&e.pos==this.stream.end&&(r=new wv,r.value=e.p.parser.eofTerm,r.start=r.end=e.pos,n=this.addActions(e,r.value,r.end,n)),this.mainToken=r,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let n=new wv,{pos:r,p:s}=e;return n.start=r,n.end=Math.min(r+1,s.stream.end),n.value=r==s.stream.end?s.parser.eofTerm:0,n}updateCachedToken(e,n,r){let s=this.stream.clipPos(r.pos);if(n.token(this.stream.reset(s,e),r),e.value>-1){let{parser:i}=r.p;for(let a=0;a<i.specialized.length;a++)if(i.specialized[a]==e.value){let l=i.specializers[a](this.stream.read(e.start,e.end),r);if(l>=0&&r.p.parser.dialect.allows(l>>1)){(l&1)==0?e.value=l>>1:e.extended=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(s+1)}putAction(e,n,r,s){for(let i=0;i<s;i+=3)if(this.actions[i]==e)return s;return this.actions[s++]=e,this.actions[s++]=n,this.actions[s++]=r,s}addActions(e,n,r,s){let{state:i}=e,{parser:a}=e.p,{data:l}=a;for(let c=0;c<2;c++)for(let d=a.stateSlot(i,c?2:1);;d+=3){if(l[d]==65535)if(l[d+1]==1)d=_l(l,d+2);else{s==0&&l[d+1]==2&&(s=this.putAction(_l(l,d+2),n,r,s));break}l[d]==n&&(s=this.putAction(_l(l,d+1),n,r,s))}return s}}class ome{constructor(e,n,r,s){this.parser=e,this.input=n,this.ranges=s,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new nme(n,s),this.tokens=new ame(e,this.stream),this.topTerm=e.top[1];let{from:i}=s[0];this.stacks=[fy.start(this,e.top[0],i)],this.fragments=r.length&&this.stream.end-i>e.bufferLength*4?new ime(r,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,n=this.minStackPos,r=this.stacks=[],s,i;if(this.bigReductionCount>300&&e.length==1){let[a]=e;for(;a.forceReduce()&&a.stack.length&&a.stack[a.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;a<e.length;a++){let l=e[a];for(;;){if(this.tokens.mainToken=null,l.pos>n)r.push(l);else{if(this.advanceStack(l,r,e))continue;{s||(s=[],i=[]),s.push(l);let c=this.tokens.getMainToken(l);i.push(c.value,c.end)}}break}}if(!r.length){let a=s&&ume(s);if(a)return qi&&console.log("Finish with "+this.stackID(a)),this.stackToTree(a);if(this.parser.strict)throw qi&&s&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&s){let a=this.stoppedAt!=null&&s[0].pos>this.stoppedAt?s[0]:this.runRecovery(s,i,r);if(a)return qi&&console.log("Force-finish "+this.stackID(a)),this.stackToTree(a.forceAll())}if(this.recovering){let a=this.recovering==1?1:this.recovering*3;if(r.length>a)for(r.sort((l,c)=>c.score-l.score);r.length>a;)r.pop();r.some(l=>l.reducePos>n)&&this.recovering--}else if(r.length>1){e:for(let a=0;a<r.length-1;a++){let l=r[a];for(let c=a+1;c<r.length;c++){let d=r[c];if(l.sameState(d)||l.buffer.length>500&&d.buffer.length>500)if((l.score-d.score||l.buffer.length-d.buffer.length)>0)r.splice(c--,1);else{r.splice(a--,1);continue e}}}r.length>12&&r.splice(12,r.length-12)}this.minStackPos=r[0].pos;for(let a=1;a<r.length;a++)r[a].pos<this.minStackPos&&(this.minStackPos=r[a].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,n,r){let s=e.pos,{parser:i}=this,a=qi?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&s>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let d=e.curContext&&e.curContext.tracker.strict,h=d?e.curContext.hash:0;for(let m=this.fragments.nodeAt(s);m;){let g=this.parser.nodeSet.types[m.type.id]==m.type?i.getGoto(e.state,m.type.id):-1;if(g>-1&&m.length&&(!d||(m.prop(an.contextHash)||0)==h))return e.useNode(m,g),qi&&console.log(a+this.stackID(e)+` (via reuse of ${i.getName(m.type.id)})`),!0;if(!(m instanceof ur)||m.children.length==0||m.positions[0]>0)break;let x=m.children[0];if(x instanceof ur&&m.positions[0]==0)m=x;else break}}let l=i.stateSlot(e.state,4);if(l>0)return e.reduce(l),qi&&console.log(a+this.stackID(e)+` (via always-reduce ${i.getName(l&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let c=this.tokens.getActions(e);for(let d=0;d<c.length;){let h=c[d++],m=c[d++],g=c[d++],x=d==c.length||!r,y=x?e:e.split(),w=this.tokens.mainToken;if(y.apply(h,m,w?w.start:y.pos,g),qi&&console.log(a+this.stackID(y)+` (via ${(h&65536)==0?"shift":`reduce of ${i.getName(h&65535)}`} for ${i.getName(m)} @ ${s}${y==e?"":", split"})`),x)return!0;y.pos>s?n.push(y):r.push(y)}return!1}advanceFully(e,n){let r=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>r)return mA(e,n),!0}}runRecovery(e,n,r){let s=null,i=!1;for(let a=0;a<e.length;a++){let l=e[a],c=n[a<<1],d=n[(a<<1)+1],h=qi?this.stackID(l)+" -> ":"";if(l.deadEnd&&(i||(i=!0,l.restart(),qi&&console.log(h+this.stackID(l)+" (restarted)"),this.advanceFully(l,r))))continue;let m=l.split(),g=h;for(let x=0;x<10&&m.forceReduce()&&(qi&&console.log(g+this.stackID(m)+" (via force-reduce)"),!this.advanceFully(m,r));x++)qi&&(g=this.stackID(m)+" -> ");for(let x of l.recoverByInsert(c))qi&&console.log(h+this.stackID(x)+" (via recover-insert)"),this.advanceFully(x,r);this.stream.end>l.pos?(d==l.pos&&(d++,c=0),l.recoverByDelete(c,d),qi&&console.log(h+this.stackID(l)+` (via recover-delete ${this.parser.getName(c)})`),mA(l,r)):(!s||s.score<l.score)&&(s=l)}return s}stackToTree(e){return e.close(),ur.build({buffer:my.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let n=(dS||(dS=new WeakMap)).get(e);return n||dS.set(e,n=String.fromCodePoint(this.nextStackID++)),n+e}}function mA(t,e){for(let n=0;n<e.length;n++){let r=e[n];if(r.pos==t.pos&&r.sameState(t)){e[n].score<t.score&&(e[n]=t);return}}e.push(t)}class lme{constructor(e,n,r){this.source=e,this.flags=n,this.disabled=r}allows(e){return!this.disabled||this.disabled[e]==0}}const hS=t=>t;class cme{constructor(e){this.start=e.start,this.shift=e.shift||hS,this.reduce=e.reduce||hS,this.reuse=e.reuse||hS,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class lp extends S6{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let n=e.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let l=0;l<e.repeatNodeCount;l++)n.push("");let r=Object.keys(e.topRules).map(l=>e.topRules[l][1]),s=[];for(let l=0;l<n.length;l++)s.push([]);function i(l,c,d){s[l].push([c,c.deserialize(String(d))])}if(e.nodeProps)for(let l of e.nodeProps){let c=l[0];typeof c=="string"&&(c=an[c]);for(let d=1;d<l.length;){let h=l[d++];if(h>=0)i(h,c,l[d++]);else{let m=l[d+-h];for(let g=-h;g>0;g--)i(l[d++],c,m);d++}}}this.nodeSet=new gb(n.map((l,c)=>ai.define({name:c>=this.minRepeatTerm?void 0:l,id:c,props:s[c],top:r.indexOf(c)>-1,error:c==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(c)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=Iq;let a=C1(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;l<this.specializerSpecs.length;l++)this.specialized[l]=this.specializerSpecs[l].term;this.specializers=this.specializerSpecs.map(pA),this.states=C1(e.states,Uint32Array),this.data=C1(e.stateData),this.goto=C1(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(l=>typeof l=="number"?new Fh(a,l):l),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,n,r){let s=new ome(this,e,n,r);for(let i of this.wrappers)s=i(s,e,n,r);return s}getGoto(e,n,r=!1){let s=this.goto;if(n>=s[0])return-1;for(let i=s[n+1];;){let a=s[i++],l=a&1,c=s[i++];if(l&&r)return c;for(let d=i+(a>>1);i<d;i++)if(s[i]==e)return c;if(l)return-1}}hasAction(e,n){let r=this.data;for(let s=0;s<2;s++)for(let i=this.stateSlot(e,s?2:1),a;;i+=3){if((a=r[i])==65535)if(r[i+1]==1)a=r[i=_l(r,i+2)];else{if(r[i+1]==2)return _l(r,i+2);break}if(a==n||a==0)return _l(r,i+1)}return 0}stateSlot(e,n){return this.states[e*6+n]}stateFlag(e,n){return(this.stateSlot(e,0)&n)>0}validAction(e,n){return!!this.allActions(e,r=>r==n?!0:null)}allActions(e,n){let r=this.stateSlot(e,4),s=r?n(r):void 0;for(let i=this.stateSlot(e,1);s==null;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=_l(this.data,i+2);else break;s=n(_l(this.data,i+1))}return s}nextStates(e){let n=[];for(let r=this.stateSlot(e,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=_l(this.data,r+2);else break;if((this.data[r+2]&1)==0){let s=this.data[r+1];n.some((i,a)=>a&1&&i==s)||n.push(this.data[r],s)}}return n}configure(e){let n=Object.assign(Object.create(lp.prototype),this);if(e.props&&(n.nodeSet=this.nodeSet.extend(...e.props)),e.top){let r=this.topRules[e.top];if(!r)throw new RangeError(`Invalid top rule name ${e.top}`);n.top=r}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(r=>{let s=e.tokenizers.find(i=>i.from==r);return s?s.to:r})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((r,s)=>{let i=e.specializers.find(l=>l.from==r.external);if(!i)return r;let a=Object.assign(Object.assign({},r),{external:i.to});return n.specializers[s]=pA(a),a})),e.contextTracker&&(n.context=e.contextTracker),e.dialect&&(n.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(n.strict=e.strict),e.wrap&&(n.wrappers=n.wrappers.concat(e.wrap)),e.bufferLength!=null&&(n.bufferLength=e.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let n=this.dynamicPrecedences;return n==null?0:n[e]||0}parseDialect(e){let n=Object.keys(this.dialects),r=n.map(()=>!1);if(e)for(let i of e.split(" ")){let a=n.indexOf(i);a>=0&&(r[a]=!0)}let s=null;for(let i=0;i<n.length;i++)if(!r[i])for(let a=this.dialects[n[i]],l;(l=this.data[a++])!=65535;)(s||(s=new Uint8Array(this.maxTerm+1)))[l]=1;return new lme(e,r,s)}static deserialize(e){return new lp(e)}}function _l(t,e){return t[e]|t[e+1]<<16}function ume(t){let e=null;for(let n of t){let r=n.p.stoppedAt;(n.pos==n.p.stream.end||r!=null&&n.pos>r)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.score<n.score)&&(e=n)}return e}function pA(t){if(t.external){let e=t.extend?1:0;return(n,r)=>t.external(n,r)<<1|e}return t.get}const dme=1,yH=194,bH=195,hme=196,gA=197,fme=198,mme=199,pme=200,gme=2,wH=3,xA=201,xme=24,vme=25,yme=49,bme=50,wme=55,Sme=56,kme=57,Ome=59,jme=60,Nme=61,Cme=62,Tme=63,Eme=65,_me=238,Ame=71,Mme=241,Rme=242,Dme=243,Pme=244,zme=245,Ime=246,Lme=247,Bme=248,SH=72,Fme=249,qme=250,$me=251,Hme=252,Qme=253,Vme=254,Ume=255,Wme=256,Gme=73,Xme=77,Yme=263,Kme=112,Zme=130,Jme=151,e0e=152,t0e=155,fd=10,cp=13,V6=32,Nb=9,U6=35,n0e=40,r0e=46,xO=123,vA=125,kH=39,OH=34,yA=92,s0e=111,i0e=120,a0e=78,o0e=117,l0e=85,c0e=new Set([vme,yme,bme,Yme,Eme,Zme,Sme,kme,_me,Cme,Tme,SH,Gme,Xme,jme,Nme,Jme,e0e,t0e,Kme]);function fS(t){return t==fd||t==cp}function mS(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}const u0e=new jb((t,e)=>{let n;if(t.next<0)t.acceptToken(mme);else if(e.context.flags&Sv)fS(t.next)&&t.acceptToken(fme,1);else if(((n=t.peek(-1))<0||fS(n))&&e.canShift(gA)){let r=0;for(;t.next==V6||t.next==Nb;)t.advance(),r++;(t.next==fd||t.next==cp||t.next==U6)&&t.acceptToken(gA,-r)}else fS(t.next)&&t.acceptToken(hme,1)},{contextual:!0}),d0e=new jb((t,e)=>{let n=e.context;if(n.flags)return;let r=t.peek(-1);if(r==fd||r==cp){let s=0,i=0;for(;;){if(t.next==V6)s++;else if(t.next==Nb)s+=8-s%8;else break;t.advance(),i++}s!=n.indent&&t.next!=fd&&t.next!=cp&&t.next!=U6&&(s<n.indent?t.acceptToken(bH,-i):t.acceptToken(yH))}}),Sv=1,jH=2,jl=4,Nl=8,Cl=16,Tl=32;function kv(t,e,n){this.parent=t,this.indent=e,this.flags=n,this.hash=(t?t.hash+t.hash<<8:0)+e+(e<<4)+n+(n<<6)}const h0e=new kv(null,0,0);function f0e(t){let e=0;for(let n=0;n<t.length;n++)e+=t.charCodeAt(n)==Nb?8-e%8:1;return e}const bA=new Map([[Mme,0],[Rme,jl],[Dme,Nl],[Pme,Nl|jl],[zme,Cl],[Ime,Cl|jl],[Lme,Cl|Nl],[Bme,Cl|Nl|jl],[Fme,Tl],[qme,Tl|jl],[$me,Tl|Nl],[Hme,Tl|Nl|jl],[Qme,Tl|Cl],[Vme,Tl|Cl|jl],[Ume,Tl|Cl|Nl],[Wme,Tl|Cl|Nl|jl]].map(([t,e])=>[t,e|jH])),m0e=new cme({start:h0e,reduce(t,e,n,r){return t.flags&Sv&&c0e.has(e)||(e==Ame||e==SH)&&t.flags&jH?t.parent:t},shift(t,e,n,r){return e==yH?new kv(t,f0e(r.read(r.pos,n.pos)),0):e==bH?t.parent:e==xme||e==wme||e==Ome||e==wH?new kv(t,0,Sv):bA.has(e)?new kv(t,0,bA.get(e)|t.flags&Sv):t},hash(t){return t.hash}}),p0e=new jb(t=>{for(let e=0;e<5;e++){if(t.next!="print".charCodeAt(e))return;t.advance()}if(!/\w/.test(String.fromCharCode(t.next)))for(let e=0;;e++){let n=t.peek(e);if(!(n==V6||n==Nb)){n!=n0e&&n!=r0e&&n!=fd&&n!=cp&&n!=U6&&t.acceptToken(dme);return}}}),g0e=new jb((t,e)=>{let{flags:n}=e.context,r=n&jl?OH:kH,s=(n&Nl)>0,i=!(n&Cl),a=(n&Tl)>0,l=t.pos;for(;!(t.next<0);)if(a&&t.next==xO)if(t.peek(1)==xO)t.advance(2);else{if(t.pos==l){t.acceptToken(wH,1);return}break}else if(i&&t.next==yA){if(t.pos==l){t.advance();let c=t.next;c>=0&&(t.advance(),x0e(t,c)),t.acceptToken(gme);return}break}else if(t.next==yA&&!i&&t.peek(1)>-1)t.advance(2);else if(t.next==r&&(!s||t.peek(1)==r&&t.peek(2)==r)){if(t.pos==l){t.acceptToken(xA,s?3:1);return}break}else if(t.next==fd){if(s)t.advance();else if(t.pos==l){t.acceptToken(xA);return}break}else t.advance();t.pos>l&&t.acceptToken(pme)});function x0e(t,e){if(e==s0e)for(let n=0;n<2&&t.next>=48&&t.next<=55;n++)t.advance();else if(e==i0e)for(let n=0;n<2&&mS(t.next);n++)t.advance();else if(e==o0e)for(let n=0;n<4&&mS(t.next);n++)t.advance();else if(e==l0e)for(let n=0;n<8&&mS(t.next);n++)t.advance();else if(e==a0e&&t.next==xO){for(t.advance();t.next>=0&&t.next!=vA&&t.next!=kH&&t.next!=OH&&t.next!=fd;)t.advance();t.next==vA&&t.advance()}}const v0e=k6({'async "*" "**" FormatConversion FormatSpec':ye.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":ye.controlKeyword,"in not and or is del":ye.operatorKeyword,"from def class global nonlocal lambda":ye.definitionKeyword,import:ye.moduleKeyword,"with as print":ye.keyword,Boolean:ye.bool,None:ye.null,VariableName:ye.variableName,"CallExpression/VariableName":ye.function(ye.variableName),"FunctionDefinition/VariableName":ye.function(ye.definition(ye.variableName)),"ClassDefinition/VariableName":ye.definition(ye.className),PropertyName:ye.propertyName,"CallExpression/MemberExpression/PropertyName":ye.function(ye.propertyName),Comment:ye.lineComment,Number:ye.number,String:ye.string,FormatString:ye.special(ye.string),Escape:ye.escape,UpdateOp:ye.updateOperator,"ArithOp!":ye.arithmeticOperator,BitOp:ye.bitwiseOperator,CompareOp:ye.compareOperator,AssignOp:ye.definitionOperator,Ellipsis:ye.punctuation,At:ye.meta,"( )":ye.paren,"[ ]":ye.squareBracket,"{ }":ye.brace,".":ye.derefOperator,", ;":ye.separator}),y0e={__proto__:null,await:44,or:54,and:56,in:60,not:62,is:64,if:70,else:72,lambda:76,yield:94,from:96,async:102,for:104,None:162,True:164,False:164,del:178,pass:182,break:186,continue:190,return:194,raise:202,import:206,as:208,global:212,nonlocal:214,assert:218,type:223,elif:236,while:240,try:246,except:248,finally:250,with:254,def:258,class:268,match:279,case:285},b0e=lp.deserialize({version:14,states:"##jO`QeOOP$}OSOOO&WQtO'#HUOOQS'#Co'#CoOOQS'#Cp'#CpO'vQdO'#CnO*UQtO'#HTOOQS'#HU'#HUOOQS'#DU'#DUOOQS'#HT'#HTO*rQdO'#D_O+VQdO'#DfO+gQdO'#DjO+zOWO'#DuO,VOWO'#DvO.[QtO'#GuOOQS'#Gu'#GuO'vQdO'#GtO0ZQtO'#GtOOQS'#Eb'#EbO0rQdO'#EcOOQS'#Gs'#GsO0|QdO'#GrOOQV'#Gr'#GrO1XQdO'#FYOOQS'#G^'#G^O1^QdO'#FXOOQV'#IS'#ISOOQV'#Gq'#GqOOQV'#Fq'#FqQ`QeOOO'vQdO'#CqO1lQdO'#C}O1sQdO'#DRO2RQdO'#HYO2cQtO'#EVO'vQdO'#EWOOQS'#EY'#EYOOQS'#E['#E[OOQS'#E^'#E^O2wQdO'#E`O3_QdO'#EdO3rQdO'#EfO3zQtO'#EfO1XQdO'#EiO0rQdO'#ElO1XQdO'#EnO0rQdO'#EtO0rQdO'#EwO4VQdO'#EyO4^QdO'#FOO4iQdO'#EzO0rQdO'#FOO1XQdO'#FQO1XQdO'#FVO4nQdO'#F[P4uOdO'#GpPOOO)CBd)CBdOOQS'#Ce'#CeOOQS'#Cf'#CfOOQS'#Cg'#CgOOQS'#Ch'#ChOOQS'#Ci'#CiOOQS'#Cj'#CjOOQS'#Cl'#ClO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO5TQdO'#DoOOQS,5:Y,5:YO5hQdO'#HdOOQS,5:],5:]O5uQ!fO,5:]O5zQtO,59YO1lQdO,59bO1lQdO,59bO1lQdO,59bO8jQdO,59bO8oQdO,59bO8vQdO,59jO8}QdO'#HTO:TQdO'#HSOOQS'#HS'#HSOOQS'#D['#D[O:lQdO,59aO'vQdO,59aO:zQdO,59aOOQS,59y,59yO;PQdO,5:RO'vQdO,5:ROOQS,5:Q,5:QO;_QdO,5:QO;dQdO,5:XO'vQdO,5:XO'vQdO,5:VOOQS,5:U,5:UO;uQdO,5:UO;zQdO,5:WOOOW'#Fy'#FyO<POWO,5:aOOQS,5:a,5:aO<[QdO'#HwOOOW'#Dw'#DwOOOW'#Fz'#FzO<lOWO,5:bOOQS,5:b,5:bOOQS'#F}'#F}O<zQtO,5:iO?lQtO,5=`O@VQ#xO,5=`O@vQtO,5=`OOQS,5:},5:}OA_QeO'#GWOBqQdO,5;^OOQV,5=^,5=^OB|QtO'#IPOCkQdO,5;tOOQS-E:[-E:[OOQV,5;s,5;sO4dQdO'#FQOOQV-E9o-E9oOCsQtO,59]OEzQtO,59iOFeQdO'#HVOFpQdO'#HVO1XQdO'#HVOF{QdO'#DTOGTQdO,59mOGYQdO'#HZO'vQdO'#HZO0rQdO,5=tOOQS,5=t,5=tO0rQdO'#EROOQS'#ES'#ESOGwQdO'#GPOHXQdO,58|OHXQdO,58|O*xQdO,5:oOHgQtO'#H]OOQS,5:r,5:rOOQS,5:z,5:zOHzQdO,5;OOI]QdO'#IOO1XQdO'#H}OOQS,5;Q,5;QOOQS'#GT'#GTOIqQtO,5;QOJPQdO,5;QOJUQdO'#IQOOQS,5;T,5;TOJdQdO'#H|OOQS,5;W,5;WOJuQdO,5;YO4iQdO,5;`O4iQdO,5;cOJ}QtO'#ITO'vQdO'#ITOKXQdO,5;eO4VQdO,5;eO0rQdO,5;jO1XQdO,5;lOK^QeO'#EuOLjQgO,5;fO!!kQdO'#IUO4iQdO,5;jO!!vQdO,5;lO!#OQdO,5;qO!#ZQtO,5;vO'vQdO,5;vPOOO,5=[,5=[P!#bOSO,5=[P!#jOdO,5=[O!&bQtO1G.jO!&iQtO1G.jO!)YQtO1G.jO!)dQtO1G.jO!+}QtO1G.jO!,bQtO1G.jO!,uQdO'#HcO!-TQtO'#GuO0rQdO'#HcO!-_QdO'#HbOOQS,5:Z,5:ZO!-gQdO,5:ZO!-lQdO'#HeO!-wQdO'#HeO!.[QdO,5>OOOQS'#Ds'#DsOOQS1G/w1G/wOOQS1G.|1G.|O!/[QtO1G.|O!/cQtO1G.|O1lQdO1G.|O!0OQdO1G/UOOQS'#DZ'#DZO0rQdO,59tOOQS1G.{1G.{O!0VQdO1G/eO!0gQdO1G/eO!0oQdO1G/fO'vQdO'#H[O!0tQdO'#H[O!0yQtO1G.{O!1ZQdO,59iO!2aQdO,5=zO!2qQdO,5=zO!2yQdO1G/mO!3OQtO1G/mOOQS1G/l1G/lO!3`QdO,5=uO!4VQdO,5=uO0rQdO1G/qO!4tQdO1G/sO!4yQtO1G/sO!5ZQtO1G/qOOQS1G/p1G/pOOQS1G/r1G/rOOOW-E9w-E9wOOQS1G/{1G/{O!5kQdO'#HxO0rQdO'#HxO!5|QdO,5>cOOOW-E9x-E9xOOQS1G/|1G/|OOQS-E9{-E9{O!6[Q#xO1G2zO!6{QtO1G2zO'vQdO,5<jOOQS,5<j,5<jOOQS-E9|-E9|OOQS,5<r,5<rOOQS-E:U-E:UOOQV1G0x1G0xO1XQdO'#GRO!7dQtO,5>kOOQS1G1`1G1`O!8RQdO1G1`OOQS'#DV'#DVO0rQdO,5=qOOQS,5=q,5=qO!8WQdO'#FrO!8cQdO,59oO!8kQdO1G/XO!8uQtO,5=uOOQS1G3`1G3`OOQS,5:m,5:mO!9fQdO'#GtOOQS,5<k,5<kOOQS-E9}-E9}O!9wQdO1G.hOOQS1G0Z1G0ZO!:VQdO,5=wO!:gQdO,5=wO0rQdO1G0jO0rQdO1G0jO!:xQdO,5>jO!;ZQdO,5>jO1XQdO,5>jO!;lQdO,5>iOOQS-E:R-E:RO!;qQdO1G0lO!;|QdO1G0lO!<RQdO,5>lO!<aQdO,5>lO!<oQdO,5>hO!=VQdO,5>hO!=hQdO'#EpO0rQdO1G0tO!=sQdO1G0tO!=xQgO1G0zO!AvQgO1G0}O!EqQdO,5>oO!E{QdO,5>oO!FTQtO,5>oO0rQdO1G1PO!F_QdO1G1PO4iQdO1G1UO!!vQdO1G1WOOQV,5;a,5;aO!FdQfO,5;aO!FiQgO1G1QO!JjQdO'#GZO4iQdO1G1QO4iQdO1G1QO!JzQdO,5>pO!KXQdO,5>pO1XQdO,5>pOOQV1G1U1G1UO!KaQdO'#FSO!KrQ!fO1G1WO!KzQdO1G1WOOQV1G1]1G1]O4iQdO1G1]O!LPQdO1G1]O!LXQdO'#F^OOQV1G1b1G1bO!#ZQtO1G1bPOOO1G2v1G2vP!L^OSO1G2vOOQS,5=},5=}OOQS'#Dp'#DpO0rQdO,5=}O!LfQdO,5=|O!LyQdO,5=|OOQS1G/u1G/uO!MRQdO,5>PO!McQdO,5>PO!MkQdO,5>PO!NOQdO,5>PO!N`QdO,5>POOQS1G3j1G3jOOQS7+$h7+$hO!8kQdO7+$pO#!RQdO1G.|O#!YQdO1G.|OOQS1G/`1G/`OOQS,5<`,5<`O'vQdO,5<`OOQS7+%P7+%PO#!aQdO7+%POOQS-E9r-E9rOOQS7+%Q7+%QO#!qQdO,5=vO'vQdO,5=vOOQS7+$g7+$gO#!vQdO7+%PO##OQdO7+%QO##TQdO1G3fOOQS7+%X7+%XO##eQdO1G3fO##mQdO7+%XOOQS,5<_,5<_O'vQdO,5<_O##rQdO1G3aOOQS-E9q-E9qO#$iQdO7+%]OOQS7+%_7+%_O#$wQdO1G3aO#%fQdO7+%_O#%kQdO1G3gO#%{QdO1G3gO#&TQdO7+%]O#&YQdO,5>dO#&sQdO,5>dO#&sQdO,5>dOOQS'#Dx'#DxO#'UO&jO'#DzO#'aO`O'#HyOOOW1G3}1G3}O#'fQdO1G3}O#'nQdO1G3}O#'yQ#xO7+(fO#(jQtO1G2UP#)TQdO'#GOOOQS,5<m,5<mOOQS-E:P-E:POOQS7+&z7+&zOOQS1G3]1G3]OOQS,5<^,5<^OOQS-E9p-E9pOOQS7+$s7+$sO#)bQdO,5=`O#){QdO,5=`O#*^QtO,5<aO#*qQdO1G3cOOQS-E9s-E9sOOQS7+&U7+&UO#+RQdO7+&UO#+aQdO,5<nO#+uQdO1G4UOOQS-E:Q-E:QO#,WQdO1G4UOOQS1G4T1G4TOOQS7+&W7+&WO#,iQdO7+&WOOQS,5<p,5<pO#,tQdO1G4WOOQS-E:S-E:SOOQS,5<l,5<lO#-SQdO1G4SOOQS-E:O-E:OO1XQdO'#EqO#-jQdO'#EqO#-uQdO'#IRO#-}QdO,5;[OOQS7+&`7+&`O0rQdO7+&`O#.SQgO7+&fO!JmQdO'#GXO4iQdO7+&fO4iQdO7+&iO#2QQtO,5<tO'vQdO,5<tO#2[QdO1G4ZOOQS-E:W-E:WO#2fQdO1G4ZO4iQdO7+&kO0rQdO7+&kOOQV7+&p7+&pO!KrQ!fO7+&rO!KzQdO7+&rO`QeO1G0{OOQV-E:X-E:XO4iQdO7+&lO4iQdO7+&lOOQV,5<u,5<uO#2nQdO,5<uO!JmQdO,5<uOOQV7+&l7+&lO#2yQgO7+&lO#6tQdO,5<vO#7PQdO1G4[OOQS-E:Y-E:YO#7^QdO1G4[O#7fQdO'#IWO#7tQdO'#IWO1XQdO'#IWOOQS'#IW'#IWO#8PQdO'#IVOOQS,5;n,5;nO#8XQdO,5;nO0rQdO'#FUOOQV7+&r7+&rO4iQdO7+&rOOQV7+&w7+&wO4iQdO7+&wO#8^QfO,5;xOOQV7+&|7+&|POOO7+(b7+(bO#8cQdO1G3iOOQS,5<c,5<cO#8qQdO1G3hOOQS-E9u-E9uO#9UQdO,5<dO#9aQdO,5<dO#9tQdO1G3kOOQS-E9v-E9vO#:UQdO1G3kO#:^QdO1G3kO#:nQdO1G3kO#:UQdO1G3kOOQS<<H[<<H[O#:yQtO1G1zOOQS<<Hk<<HkP#;WQdO'#FtO8vQdO1G3bO#;eQdO1G3bO#;jQdO<<HkOOQS<<Hl<<HlO#;zQdO7+)QOOQS<<Hs<<HsO#<[QtO1G1yP#<{QdO'#FsO#=YQdO7+)RO#=jQdO7+)RO#=rQdO<<HwO#=wQdO7+({OOQS<<Hy<<HyO#>nQdO,5<bO'vQdO,5<bOOQS-E9t-E9tOOQS<<Hw<<HwOOQS,5<g,5<gO0rQdO,5<gO#>sQdO1G4OOOQS-E9y-E9yO#?^QdO1G4OO<[QdO'#H{OOOO'#D{'#D{OOOO'#F|'#F|O#?oO&jO,5:fOOOW,5>e,5>eOOOW7+)i7+)iO#?zQdO7+)iO#@SQdO1G2zO#@mQdO1G2zP'vQdO'#FuO0rQdO<<IpO1XQdO1G2YP1XQdO'#GSO#AOQdO7+)pO#AaQdO7+)pOOQS<<Ir<<IrP1XQdO'#GUP0rQdO'#GQOOQS,5;],5;]O#ArQdO,5>mO#BQQdO,5>mOOQS1G0v1G0vOOQS<<Iz<<IzOOQV-E:V-E:VO4iQdO<<JQOOQV,5<s,5<sO4iQdO,5<sOOQV<<JQ<<JQOOQV<<JT<<JTO#BYQtO1G2`P#BdQdO'#GYO#BkQdO7+)uO#BuQgO<<JVO4iQdO<<JVOOQV<<J^<<J^O4iQdO<<J^O!KrQ!fO<<J^O#FpQgO7+&gOOQV<<JW<<JWO#FzQgO<<JWOOQV1G2a1G2aO1XQdO1G2aO#JuQdO1G2aO4iQdO<<JWO1XQdO1G2bP0rQdO'#G[O#KQQdO7+)vO#K_QdO7+)vOOQS'#FT'#FTO0rQdO,5>rO#KgQdO,5>rO#KrQdO,5>rO#K}QdO,5>qO#L`QdO,5>qOOQS1G1Y1G1YOOQS,5;p,5;pOOQV<<Jc<<JcO#LhQdO1G1dOOQS7+)T7+)TP#LmQdO'#FwO#L}QdO1G2OO#MbQdO1G2OO#MrQdO1G2OP#M}QdO'#FxO#N[QdO7+)VO#NlQdO7+)VO#NlQdO7+)VO#NtQdO7+)VO$ UQdO7+(|O8vQdO7+(|OOQSAN>VAN>VO$ oQdO<<LmOOQSAN>cAN>cO0rQdO1G1|O$!PQtO1G1|P$!ZQdO'#FvOOQS1G2R1G2RP$!hQdO'#F{O$!uQdO7+)jO$#`QdO,5>gOOOO-E9z-E9zOOOW<<MT<<MTO$#nQdO7+(fOOQSAN?[AN?[OOQS7+'t7+'tO$$XQdO<<M[OOQS,5<q,5<qO$$jQdO1G4XOOQS-E:T-E:TOOQVAN?lAN?lOOQV1G2_1G2_O4iQdOAN?qO$$xQgOAN?qOOQVAN?xAN?xO4iQdOAN?xOOQV<<JR<<JRO4iQdOAN?rO4iQdO7+'{OOQV7+'{7+'{O1XQdO7+'{OOQVAN?rAN?rOOQS7+'|7+'|O$(sQdO<<MbOOQS1G4^1G4^O0rQdO1G4^OOQS,5<w,5<wO$)QQdO1G4]OOQS-E:Z-E:ZOOQU'#G_'#G_O$)cQfO7+'OO$)nQdO'#F_O$*uQdO7+'jO$+VQdO7+'jOOQS7+'j7+'jO$+bQdO<<LqO$+rQdO<<LqO$+rQdO<<LqO$+zQdO'#H^OOQS<<Lh<<LhO$,UQdO<<LhOOQS7+'h7+'hOOQS'#D|'#D|OOOO1G4R1G4RO$,oQdO1G4RO$,wQdO1G4RP!=hQdO'#GVOOQVG25]G25]O4iQdOG25]OOQVG25dG25dOOQVG25^G25^OOQV<<Kg<<KgO4iQdO<<KgOOQS7+)x7+)xP$-SQdO'#G]OOQU-E:]-E:]OOQV<<Jj<<JjO$-vQtO'#FaOOQS'#Fc'#FcO$.WQdO'#FbO$.xQdO'#FbOOQS'#Fb'#FbO$.}QdO'#IYO$)nQdO'#FiO$)nQdO'#FiO$/fQdO'#FjO$)nQdO'#FkO$/mQdO'#IZOOQS'#IZ'#IZO$0[QdO,5;yOOQS<<KU<<KUO$0dQdO<<KUO$0tQdOANB]O$1UQdOANB]O$1^QdO'#H_OOQS'#H_'#H_O1sQdO'#DcO$1wQdO,5=xOOQSANBSANBSOOOO7+)m7+)mO$2`QdO7+)mOOQVLD*wLD*wOOQVANARANARO5uQ!fO'#GaO$2hQtO,5<SO$)nQdO'#FmOOQS,5<W,5<WOOQS'#Fd'#FdO$3YQdO,5;|O$3_QdO,5;|OOQS'#Fg'#FgO$)nQdO'#G`O$4PQdO,5<QO$4kQdO,5>tO$4{QdO,5>tO1XQdO,5<PO$5^QdO,5<TO$5cQdO,5<TO$)nQdO'#I[O$5hQdO'#I[O$5mQdO,5<UOOQS,5<V,5<VO0rQdO'#FpOOQU1G1e1G1eO4iQdO1G1eOOQSAN@pAN@pO$5rQdOG27wO$6SQdO,59}OOQS1G3d1G3dOOOO<<MX<<MXOOQS,5<{,5<{OOQS-E:_-E:_O$6XQtO'#FaO$6`QdO'#I]O$6nQdO'#I]O$6vQdO,5<XOOQS1G1h1G1hO$6{QdO1G1hO$7QQdO,5<zOOQS-E:^-E:^O$7lQdO,5=OO$8TQdO1G4`OOQS-E:b-E:bOOQS1G1k1G1kOOQS1G1o1G1oO$8eQdO,5>vO$)nQdO,5>vOOQS1G1p1G1pOOQS,5<[,5<[OOQU7+'P7+'PO$+zQdO1G/iO$)nQdO,5<YO$8sQdO,5>wO$8zQdO,5>wOOQS1G1s1G1sOOQS7+'S7+'SP$)nQdO'#GdO$9SQdO1G4bO$9^QdO1G4bO$9fQdO1G4bOOQS7+%T7+%TO$9tQdO1G1tO$:SQtO'#FaO$:ZQdO,5<}OOQS,5<},5<}O$:iQdO1G4cOOQS-E:a-E:aO$)nQdO,5<|O$:pQdO,5<|O$:uQdO7+)|OOQS-E:`-E:`O$;PQdO7+)|O$)nQdO,5<ZP$)nQdO'#GcO$;XQdO1G2hO$)nQdO1G2hP$;gQdO'#GbO$;nQdO<<MhO$;xQdO1G1uO$<WQdO7+(SO8vQdO'#C}O8vQdO,59bO8vQdO,59bO8vQdO,59bO$<fQtO,5=`O8vQdO1G.|O0rQdO1G/XO0rQdO7+$pP$<yQdO'#GOO'vQdO'#GtO$=WQdO,59bO$=]QdO,59bO$=dQdO,59mO$=iQdO1G/UO1sQdO'#DRO8vQdO,59j",stateData:"$>S~O%cOS%^OSSOS%]PQ~OPdOVaOfoOhYOopOs!POvqO!PrO!Q{O!T!SO!U!RO!XZO!][O!h`O!r`O!s`O!t`O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO#l!QO#o!TO#s!UO#u!VO#z!WO#}hO$P!XO%oRO%pRO%tSO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O~O%]!YO~OV!aO_!aOa!bOh!iO!X!kO!f!mO%j![O%k!]O%l!^O%m!_O%n!_O%o!`O%p!`O%q!aO%r!aO%s!aO~Ok%xXl%xXm%xXn%xXo%xXp%xXs%xXz%xX{%xX!x%xX#g%xX%[%xX%_%xX%z%xXg%xX!T%xX!U%xX%{%xX!W%xX![%xX!Q%xX#[%xXt%xX!m%xX~P%SOfoOhYO!XZO!][O!h`O!r`O!s`O!t`O%oRO%pRO%tSO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O~Oz%wX{%wX#g%wX%[%wX%_%wX%z%wX~Ok!pOl!qOm!oOn!oOo!rOp!sOs!tO!x%wX~P)pOV!zOg!|Oo0cOv0qO!PrO~P'vOV#OOo0cOv0qO!W#PO~P'vOV#SOa#TOo0cOv0qO![#UO~P'vOQ#XO%`#XO%a#ZO~OQ#^OR#[O%`#^O%a#`O~OV%iX_%iXa%iXh%iXk%iXl%iXm%iXn%iXo%iXp%iXs%iXz%iX!X%iX!f%iX%j%iX%k%iX%l%iX%m%iX%n%iX%o%iX%p%iX%q%iX%r%iX%s%iXg%iX!T%iX!U%iX~O&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O{%iX!x%iX#g%iX%[%iX%_%iX%z%iX%{%iX!W%iX![%iX!Q%iX#[%iXt%iX!m%iX~P,eOz#dO{%hX!x%hX#g%hX%[%hX%_%hX%z%hX~Oo0cOv0qO~P'vO#g#gO%[#iO%_#iO~O%uWO~O!T#nO#u!VO#z!WO#}hO~OopO~P'vOV#sOa#tO%uWO{wP~OV#xOo0cOv0qO!Q#yO~P'vO{#{O!x$QO%z#|O#g!yX%[!yX%_!yX~OV#xOo0cOv0qO#g#SX%[#SX%_#SX~P'vOo0cOv0qO#g#WX%[#WX%_#WX~P'vOh$WO%uWO~O!f$YO!r$YO%uWO~OV$eO~P'vO!U$gO#s$hO#u$iO~O{$jO~OV$qO~P'vOS$sO%[$rO%_$rO%c$tO~OV$}Oa$}Og%POo0cOv0qO~P'vOo0cOv0qO{%SO~P'vO&Y%UO~Oa!bOh!iO!X!kO!f!mOVba_bakbalbambanbaobapbasbazba{ba!xba#gba%[ba%_ba%jba%kba%lba%mba%nba%oba%pba%qba%rba%sba%zbagba!Tba!Uba%{ba!Wba![ba!Qba#[batba!mba~On%ZO~Oo%ZO~P'vOo0cO~P'vOk0eOl0fOm0dOn0dOo0mOp0nOs0rOg%wX!T%wX!U%wX%{%wX!W%wX![%wX!Q%wX#[%wX!m%wX~P)pO%{%]Og%vXz%vX!T%vX!U%vX!W%vX{%vX~Og%_Oz%`O!T%dO!U%cO~Og%_O~Oz%gO!T%dO!U%cO!W&SX~O!W%kO~Oz%lO{%nO!T%dO!U%cO![%}X~O![%rO~O![%sO~OQ#XO%`#XO%a%uO~OV%wOo0cOv0qO!PrO~P'vOQ#^OR#[O%`#^O%a%zO~OV!qa_!qaa!qah!qak!qal!qam!qan!qao!qap!qas!qaz!qa{!qa!X!qa!f!qa!x!qa#g!qa%[!qa%_!qa%j!qa%k!qa%l!qa%m!qa%n!qa%o!qa%p!qa%q!qa%r!qa%s!qa%z!qag!qa!T!qa!U!qa%{!qa!W!qa![!qa!Q!qa#[!qat!qa!m!qa~P#yOz%|O{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~P%SOV&OOopOvqO{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~P'vOz%|O{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~OPdOVaOopOvqO!PrO!Q{O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO#g$zX%[$zX%_$zX~P'vO#g#gO%[&TO%_&TO~O!f&UOh&sX%[&sXz&sX#[&sX#g&sX%_&sX#Z&sXg&sX~Oh!iO%[&WO~Okealeameaneaoeapeaseazea{ea!xea#gea%[ea%_ea%zeagea!Tea!Uea%{ea!Wea![ea!Qea#[eatea!mea~P%SOsqazqa{qa#gqa%[qa%_qa%zqa~Ok!pOl!qOm!oOn!oOo!rOp!sO!xqa~PEcO%z&YOz%yX{%yX~O%uWOz%yX{%yX~Oz&]O{wX~O{&_O~Oz%lO#g%}X%[%}X%_%}Xg%}X{%}X![%}X!m%}X%z%}X~OV0lOo0cOv0qO!PrO~P'vO%z#|O#gUa%[Ua%_Ua~Oz&hO#g&PX%[&PX%_&PXn&PX~P%SOz&kO!Q&jO#g#Wa%[#Wa%_#Wa~Oz&lO#[&nO#g&rX%[&rX%_&rXg&rX~O!f$YO!r$YO#Z&qO%uWO~O#Z&qO~Oz&sO#g&tX%[&tX%_&tX~Oz&uO#g&pX%[&pX%_&pX{&pX~O!X&wO%z&xO~Oz&|On&wX~P%SOn'PO~OPdOVaOopOvqO!PrO!Q{O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO%['UO~P'vOt'YO#p'WO#q'XOP#naV#naf#nah#nao#nas#nav#na!P#na!Q#na!T#na!U#na!X#na!]#na!h#na!r#na!s#na!t#na!{#na!}#na#P#na#R#na#T#na#X#na#Z#na#^#na#_#na#a#na#c#na#l#na#o#na#s#na#u#na#z#na#}#na$P#na%X#na%o#na%p#na%t#na%u#na&Z#na&[#na&]#na&^#na&_#na&`#na&a#na&b#na&c#na&d#na&e#na&f#na&g#na&h#na&i#na&j#na%Z#na%_#na~Oz'ZO#[']O{&xX~Oh'_O!X&wO~Oh!iO{$jO!X&wO~O{'eO~P%SO%['hO%_'hO~OS'iO%['hO%_'hO~OV!aO_!aOa!bOh!iO!X!kO!f!mO%l!^O%m!_O%n!_O%o!`O%p!`O%q!aO%r!aO%s!aOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~O%k!]O~P!#uO%kWi~P!#uOV!aO_!aOa!bOh!iO!X!kO!f!mO%o!`O%p!`O%q!aO%r!aO%s!aOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%kWi%lWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~O%m!_O%n!_O~P!&pO%mWi%nWi~P!&pOa!bOh!iO!X!kO!f!mOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%kWi%lWi%mWi%nWi%oWi%pWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~OV!aO_!aO%q!aO%r!aO%s!aO~P!)nOVWi_Wi%qWi%rWi%sWi~P!)nO!T%dO!U%cOg&VXz&VX~O%z'kO%{'kO~P,eOz'mOg&UX~Og'oO~Oz'pO{'rO!W&XX~Oo0cOv0qOz'pO{'sO!W&XX~P'vO!W'uO~Om!oOn!oOo!rOp!sOkjisjizji{ji!xji#gji%[ji%_ji%zji~Ol!qO~P!.aOlji~P!.aOk0eOl0fOm0dOn0dOo0mOp0nO~Ot'wO~P!/jOV'|Og'}Oo0cOv0qO~P'vOg'}Oz(OO~Og(QO~O!U(SO~Og(TOz(OO!T%dO!U%cO~P%SOk0eOl0fOm0dOn0dOo0mOp0nOgqa!Tqa!Uqa%{qa!Wqa![qa!Qqa#[qatqa!mqa~PEcOV'|Oo0cOv0qO!W&Sa~P'vOz(WO!W&Sa~O!W(XO~Oz(WO!T%dO!U%cO!W&Sa~P%SOV(]Oo0cOv0qO![%}a#g%}a%[%}a%_%}ag%}a{%}a!m%}a%z%}a~P'vOz(^O![%}a#g%}a%[%}a%_%}ag%}a{%}a!m%}a%z%}a~O![(aO~Oz(^O!T%dO!U%cO![%}a~P%SOz(dO!T%dO!U%cO![&Ta~P%SOz(gO{&lX![&lX!m&lX%z&lX~O{(kO![(mO!m(nO%z(jO~OV&OOopOvqO{%hi!x%hi#g%hi%[%hi%_%hi%z%hi~P'vOz(pO{%hi!x%hi#g%hi%[%hi%_%hi%z%hi~O!f&UOh&sa%[&saz&sa#[&sa#g&sa%_&sa#Z&sag&sa~O%[(uO~OV#sOa#tO%uWO~Oz&]O{wa~OopOvqO~P'vOz(^O#g%}a%[%}a%_%}ag%}a{%}a![%}a!m%}a%z%}a~P%SOz(zO#g%hX%[%hX%_%hX%z%hX~O%z#|O#gUi%[Ui%_Ui~O#g&Pa%[&Pa%_&Pan&Pa~P'vOz(}O#g&Pa%[&Pa%_&Pan&Pa~O%uWO#g&ra%[&ra%_&rag&ra~Oz)SO#g&ra%[&ra%_&rag&ra~Og)VO~OV)WOh$WO%uWO~O#Z)XO~O%uWO#g&ta%[&ta%_&ta~Oz)ZO#g&ta%[&ta%_&ta~Oo0cOv0qO#g&pa%[&pa%_&pa{&pa~P'vOz)^O#g&pa%[&pa%_&pa{&pa~OV)`Oa)`O%uWO~O%z)eO~Ot)hO#j)gOP#hiV#hif#hih#hio#his#hiv#hi!P#hi!Q#hi!T#hi!U#hi!X#hi!]#hi!h#hi!r#hi!s#hi!t#hi!{#hi!}#hi#P#hi#R#hi#T#hi#X#hi#Z#hi#^#hi#_#hi#a#hi#c#hi#l#hi#o#hi#s#hi#u#hi#z#hi#}#hi$P#hi%X#hi%o#hi%p#hi%t#hi%u#hi&Z#hi&[#hi&]#hi&^#hi&_#hi&`#hi&a#hi&b#hi&c#hi&d#hi&e#hi&f#hi&g#hi&h#hi&i#hi&j#hi%Z#hi%_#hi~Ot)iOP#kiV#kif#kih#kio#kis#kiv#ki!P#ki!Q#ki!T#ki!U#ki!X#ki!]#ki!h#ki!r#ki!s#ki!t#ki!{#ki!}#ki#P#ki#R#ki#T#ki#X#ki#Z#ki#^#ki#_#ki#a#ki#c#ki#l#ki#o#ki#s#ki#u#ki#z#ki#}#ki$P#ki%X#ki%o#ki%p#ki%t#ki%u#ki&Z#ki&[#ki&]#ki&^#ki&_#ki&`#ki&a#ki&b#ki&c#ki&d#ki&e#ki&f#ki&g#ki&h#ki&i#ki&j#ki%Z#ki%_#ki~OV)kOn&wa~P'vOz)lOn&wa~Oz)lOn&wa~P%SOn)pO~O%Y)tO~Ot)wO#p'WO#q)vOP#niV#nif#nih#nio#nis#niv#ni!P#ni!Q#ni!T#ni!U#ni!X#ni!]#ni!h#ni!r#ni!s#ni!t#ni!{#ni!}#ni#P#ni#R#ni#T#ni#X#ni#Z#ni#^#ni#_#ni#a#ni#c#ni#l#ni#o#ni#s#ni#u#ni#z#ni#}#ni$P#ni%X#ni%o#ni%p#ni%t#ni%u#ni&Z#ni&[#ni&]#ni&^#ni&_#ni&`#ni&a#ni&b#ni&c#ni&d#ni&e#ni&f#ni&g#ni&h#ni&i#ni&j#ni%Z#ni%_#ni~OV)zOo0cOv0qO{$jO~P'vOo0cOv0qO{&xa~P'vOz*OO{&xa~OV*SOa*TOg*WO%q*UO%uWO~O{$jO&{*YO~Oh'_O~Oh!iO{$jO~O%[*_O~O%[*aO%_*aO~OV$}Oa$}Oo0cOv0qOg&Ua~P'vOz*dOg&Ua~Oo0cOv0qO{*gO!W&Xa~P'vOz*hO!W&Xa~Oo0cOv0qOz*hO{*kO!W&Xa~P'vOo0cOv0qOz*hO!W&Xa~P'vOz*hO{*kO!W&Xa~Om0dOn0dOo0mOp0nOgjikjisjizji!Tji!Uji%{ji!Wji{ji![ji#gji%[ji%_ji!Qji#[jitji!mji%zji~Ol0fO~P!NkOlji~P!NkOV'|Og*pOo0cOv0qO~P'vOn*rO~Og*pOz*tO~Og*uO~OV'|Oo0cOv0qO!W&Si~P'vOz*vO!W&Si~O!W*wO~OV(]Oo0cOv0qO![%}i#g%}i%[%}i%_%}ig%}i{%}i!m%}i%z%}i~P'vOz*zO!T%dO!U%cO![&Ti~Oz*}O![%}i#g%}i%[%}i%_%}ig%}i{%}i!m%}i%z%}i~O![+OO~Oa+QOo0cOv0qO![&Ti~P'vOz*zO![&Ti~O![+SO~OV+UOo0cOv0qO{&la![&la!m&la%z&la~P'vOz+VO{&la![&la!m&la%z&la~O!]+YO&n+[O![!nX~O![+^O~O{(kO![+_O~O{(kO![+_O!m+`O~OV&OOopOvqO{%hq!x%hq#g%hq%[%hq%_%hq%z%hq~P'vOz$ri{$ri!x$ri#g$ri%[$ri%_$ri%z$ri~P%SOV&OOopOvqO~P'vOV&OOo0cOv0qO#g%ha%[%ha%_%ha%z%ha~P'vOz+aO#g%ha%[%ha%_%ha%z%ha~Oz$ia#g$ia%[$ia%_$ian$ia~P%SO#g&Pi%[&Pi%_&Pin&Pi~P'vOz+dO#g#Wq%[#Wq%_#Wq~O#[+eOz$va#g$va%[$va%_$vag$va~O%uWO#g&ri%[&ri%_&rig&ri~Oz+gO#g&ri%[&ri%_&rig&ri~OV+iOh$WO%uWO~O%uWO#g&ti%[&ti%_&ti~Oo0cOv0qO#g&pi%[&pi%_&pi{&pi~P'vO{#{Oz#eX!W#eX~Oz+mO!W&uX~O!W+oO~Ot+rO#j)gOP#hqV#hqf#hqh#hqo#hqs#hqv#hq!P#hq!Q#hq!T#hq!U#hq!X#hq!]#hq!h#hq!r#hq!s#hq!t#hq!{#hq!}#hq#P#hq#R#hq#T#hq#X#hq#Z#hq#^#hq#_#hq#a#hq#c#hq#l#hq#o#hq#s#hq#u#hq#z#hq#}#hq$P#hq%X#hq%o#hq%p#hq%t#hq%u#hq&Z#hq&[#hq&]#hq&^#hq&_#hq&`#hq&a#hq&b#hq&c#hq&d#hq&e#hq&f#hq&g#hq&h#hq&i#hq&j#hq%Z#hq%_#hq~On$|az$|a~P%SOV)kOn&wi~P'vOz+yOn&wi~Oz,TO{$jO#[,TO~O#q,VOP#nqV#nqf#nqh#nqo#nqs#nqv#nq!P#nq!Q#nq!T#nq!U#nq!X#nq!]#nq!h#nq!r#nq!s#nq!t#nq!{#nq!}#nq#P#nq#R#nq#T#nq#X#nq#Z#nq#^#nq#_#nq#a#nq#c#nq#l#nq#o#nq#s#nq#u#nq#z#nq#}#nq$P#nq%X#nq%o#nq%p#nq%t#nq%u#nq&Z#nq&[#nq&]#nq&^#nq&_#nq&`#nq&a#nq&b#nq&c#nq&d#nq&e#nq&f#nq&g#nq&h#nq&i#nq&j#nq%Z#nq%_#nq~O#[,WOz%Oa{%Oa~Oo0cOv0qO{&xi~P'vOz,YO{&xi~O{#{O%z,[Og&zXz&zX~O%uWOg&zXz&zX~Oz,`Og&yX~Og,bO~O%Y,eO~O!T%dO!U%cOg&Viz&Vi~OV$}Oa$}Oo0cOv0qOg&Ui~P'vO{,hOz$la!W$la~Oo0cOv0qO{,iOz$la!W$la~P'vOo0cOv0qO{*gO!W&Xi~P'vOz,lO!W&Xi~Oo0cOv0qOz,lO!W&Xi~P'vOz,lO{,oO!W&Xi~Og$hiz$hi!W$hi~P%SOV'|Oo0cOv0qO~P'vOn,qO~OV'|Og,rOo0cOv0qO~P'vOV'|Oo0cOv0qO!W&Sq~P'vOz$gi![$gi#g$gi%[$gi%_$gig$gi{$gi!m$gi%z$gi~P%SOV(]Oo0cOv0qO~P'vOa+QOo0cOv0qO![&Tq~P'vOz,sO![&Tq~O![,tO~OV(]Oo0cOv0qO![%}q#g%}q%[%}q%_%}qg%}q{%}q!m%}q%z%}q~P'vO{,uO~OV+UOo0cOv0qO{&li![&li!m&li%z&li~P'vOz,zO{&li![&li!m&li%z&li~O!]+YO&n+[O![!na~O{(kO![,}O~OV&OOo0cOv0qO#g%hi%[%hi%_%hi%z%hi~P'vOz-OO#g%hi%[%hi%_%hi%z%hi~O%uWO#g&rq%[&rq%_&rqg&rq~Oz-RO#g&rq%[&rq%_&rqg&rq~OV)`Oa)`O%uWO!W&ua~Oz-TO!W&ua~On$|iz$|i~P%SOV)kO~P'vOV)kOn&wq~P'vOt-XOP#myV#myf#myh#myo#mys#myv#my!P#my!Q#my!T#my!U#my!X#my!]#my!h#my!r#my!s#my!t#my!{#my!}#my#P#my#R#my#T#my#X#my#Z#my#^#my#_#my#a#my#c#my#l#my#o#my#s#my#u#my#z#my#}#my$P#my%X#my%o#my%p#my%t#my%u#my&Z#my&[#my&]#my&^#my&_#my&`#my&a#my&b#my&c#my&d#my&e#my&f#my&g#my&h#my&i#my&j#my%Z#my%_#my~O%Z-]O%_-]O~P`O#q-^OP#nyV#nyf#nyh#nyo#nys#nyv#ny!P#ny!Q#ny!T#ny!U#ny!X#ny!]#ny!h#ny!r#ny!s#ny!t#ny!{#ny!}#ny#P#ny#R#ny#T#ny#X#ny#Z#ny#^#ny#_#ny#a#ny#c#ny#l#ny#o#ny#s#ny#u#ny#z#ny#}#ny$P#ny%X#ny%o#ny%p#ny%t#ny%u#ny&Z#ny&[#ny&]#ny&^#ny&_#ny&`#ny&a#ny&b#ny&c#ny&d#ny&e#ny&f#ny&g#ny&h#ny&i#ny&j#ny%Z#ny%_#ny~Oz-aO{$jO#[-aO~Oo0cOv0qO{&xq~P'vOz-dO{&xq~O%z,[Og&zaz&za~O{#{Og&zaz&za~OV*SOa*TO%q*UO%uWOg&ya~Oz-hOg&ya~O$S-lO~OV$}Oa$}Oo0cOv0qO~P'vOo0cOv0qO{-mOz$li!W$li~P'vOo0cOv0qOz$li!W$li~P'vO{-mOz$li!W$li~Oo0cOv0qO{*gO~P'vOo0cOv0qO{*gO!W&Xq~P'vOz-pO!W&Xq~Oo0cOv0qOz-pO!W&Xq~P'vOs-sO!T%dO!U%cOg&Oq!W&Oq![&Oqz&Oq~P!/jOa+QOo0cOv0qO![&Ty~P'vOz$ji![$ji~P%SOa+QOo0cOv0qO~P'vOV+UOo0cOv0qO~P'vOV+UOo0cOv0qO{&lq![&lq!m&lq%z&lq~P'vO{(kO![-xO!m-yO%z-wO~OV&OOo0cOv0qO#g%hq%[%hq%_%hq%z%hq~P'vO%uWO#g&ry%[&ry%_&ryg&ry~OV)`Oa)`O%uWO!W&ui~Ot-}OP#m!RV#m!Rf#m!Rh#m!Ro#m!Rs#m!Rv#m!R!P#m!R!Q#m!R!T#m!R!U#m!R!X#m!R!]#m!R!h#m!R!r#m!R!s#m!R!t#m!R!{#m!R!}#m!R#P#m!R#R#m!R#T#m!R#X#m!R#Z#m!R#^#m!R#_#m!R#a#m!R#c#m!R#l#m!R#o#m!R#s#m!R#u#m!R#z#m!R#}#m!R$P#m!R%X#m!R%o#m!R%p#m!R%t#m!R%u#m!R&Z#m!R&[#m!R&]#m!R&^#m!R&_#m!R&`#m!R&a#m!R&b#m!R&c#m!R&d#m!R&e#m!R&f#m!R&g#m!R&h#m!R&i#m!R&j#m!R%Z#m!R%_#m!R~Oo0cOv0qO{&xy~P'vOV*SOa*TO%q*UO%uWOg&yi~O$S-lO%Z.VO%_.VO~OV.aOh._O!X.^O!].`O!h.YO!s.[O!t.[O%p.XO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O~Oo0cOv0qOz$lq!W$lq~P'vO{.fOz$lq!W$lq~Oo0cOv0qO{*gO!W&Xy~P'vOz.gO!W&Xy~Oo0cOv.kO~P'vOs-sO!T%dO!U%cOg&Oy!W&Oy![&Oyz&Oy~P!/jO{(kO![.nO~O{(kO![.nO!m.oO~OV*SOa*TO%q*UO%uWO~Oh.tO!f.rOz$TX#[$TX%j$TXg$TX~Os$TX{$TX!W$TX![$TX~P$-bO%o.vO%p.vOs$UXz$UX{$UX#[$UX%j$UX!W$UXg$UX![$UX~O!h.xO~Oz.|O#[/OO%j.yOs&|X{&|X!W&|Xg&|X~Oa/RO~P$)zOh.tOs&}Xz&}X{&}X#[&}X%j&}X!W&}Xg&}X![&}X~Os/VO{$jO~Oo0cOv0qOz$ly!W$ly~P'vOo0cOv0qO{*gO!W&X!R~P'vOz/ZO!W&X!R~Og&RXs&RX!T&RX!U&RX!W&RX![&RXz&RX~P!/jOs-sO!T%dO!U%cOg&Qa!W&Qa![&Qaz&Qa~O{(kO![/^O~O!f.rOh$[as$[az$[a{$[a#[$[a%j$[a!W$[ag$[a![$[a~O!h/eO~O%o.vO%p.vOs$Uaz$Ua{$Ua#[$Ua%j$Ua!W$Uag$Ua![$Ua~O%j.yOs$Yaz$Ya{$Ya#[$Ya!W$Yag$Ya![$Ya~Os&|a{&|a!W&|ag&|a~P$)nOz/jOs&|a{&|a!W&|ag&|a~O!W/mO~Og/mO~O{/oO~O![/pO~Oo0cOv0qO{*gO!W&X!Z~P'vO{/sO~O%z/tO~P$-bOz/uO#[/OO%j.yOg'PX~Oz/uOg'PX~Og/wO~O!h/xO~O#[/OOs%Saz%Sa{%Sa%j%Sa!W%Sag%Sa![%Sa~O#[/OO%j.yOs%Waz%Wa{%Wa!W%Wag%Wa~Os&|i{&|i!W&|ig&|i~P$)nOz/zO#[/OO%j.yO!['Oa~Og'Pa~P$)nOz0SOg'Pa~Oa0UO!['Oi~P$)zOz0WO!['Oi~Oz0WO#[/OO%j.yO!['Oi~O#[/OO%j.yOg$biz$bi~O%z0ZO~P$-bO#[/OO%j.yOg%Vaz%Va~Og'Pi~P$)nO{0^O~Oa0UO!['Oq~P$)zOz0`O!['Oq~O#[/OO%j.yOz%Ui![%Ui~Oa0UO~P$)zOa0UO!['Oy~P$)zO#[/OO%j.yOg$ciz$ci~O#[/OO%j.yOz%Uq![%Uq~Oz+aO#g%ha%[%ha%_%ha%z%ha~P%SOV&OOo0cOv0qO~P'vOn0hO~Oo0hO~P'vO{0iO~Ot0jO~P!/jO&]&Z&j&h&i&g&f&d&e&c&b&`&a&_&^&[%u~",goto:"!=j'QPPPPPP'RP'Z*s+[+t,_,y-fP.SP'Z.r.r'ZPPP'Z2[PPPPPP2[5PPP5PP7b7k=sPP=v>h>kPP'Z'ZPP>zPP'Z'ZPP'Z'Z'Z'Z'Z?O?w'ZP?zP@QDXGuGyPG|HWH['ZPPPH_Hk'RP'R'RP'RP'RP'RP'RP'R'R'RP'RPP'RPP'RP'RPHqH}IVPI^IdPI^PI^I^PPPI^PKrPK{LVL]KrPI^LfPI^PLmLsPLwM]MzNeLwLwNkNxLwLwLwLw! ^! d! g! l! o! y!!P!!]!!o!!u!#P!#V!#s!#y!$P!$Z!$a!$g!$y!%T!%Z!%a!%k!%q!%w!%}!&T!&Z!&e!&k!&u!&{!'U!'[!'k!'s!'}!(UPPPPPPPPPPP!([!(_!(e!(n!(x!)TPPPPPPPPPPPP!-u!/Z!3^!6oPP!6w!7W!7a!8Y!8P!8c!8i!8l!8o!8r!8z!9jPPPPPPPPPPPPPPPPP!9m!9q!9wP!:]!:a!:m!:v!;S!;j!;m!;p!;v!;|!<S!<VP!<_!<h!=d!=g]eOn#g$j)t,P'}`OTYZ[adnoprtxy}!P!Q!R!U!X!c!d!e!f!g!h!i!k!o!p!q!s!t!z#O#S#T#[#d#g#x#y#{#}$Q$e$g$h$j$q$}%S%Z%^%`%c%g%l%n%w%|&O&Z&_&h&j&k&u&x&|'P'W'Z'l'm'p'r's'w'|(O(S(W(](^(d(g(p(r(z(})^)e)g)k)l)p)t)z*O*Y*d*g*h*k*q*r*t*v*y*z*}+Q+U+V+Y+a+c+d+k+x+y,P,X,Y,],g,h,i,k,l,o,q,s,u,w,y,z-O-d-f-m-p-s.f.g/V/Z/s0c0d0e0f0h0i0j0k0l0n0r{!cQ#c#p$R$d$p%e%j%p%q&`'O'g(q(|)j*o*x+w,v0g}!dQ#c#p$R$d$p$u%e%j%p%q&`'O'g(q(|)j*o*x+w,v0g!P!eQ#c#p$R$d$p$u$v%e%j%p%q&`'O'g(q(|)j*o*x+w,v0g!R!fQ#c#p$R$d$p$u$v$w%e%j%p%q&`'O'g(q(|)j*o*x+w,v0g!T!gQ#c#p$R$d$p$u$v$w$x%e%j%p%q&`'O'g(q(|)j*o*x+w,v0g!V!hQ#c#p$R$d$p$u$v$w$x$y%e%j%p%q&`'O'g(q(|)j*o*x+w,v0g!Z!hQ!n#c#p$R$d$p$u$v$w$x$y$z%e%j%p%q&`'O'g(q(|)j*o*x+w,v0g'}TOTYZ[adnoprtxy}!P!Q!R!U!X!c!d!e!f!g!h!i!k!o!p!q!s!t!z#O#S#T#[#d#g#x#y#{#}$Q$e$g$h$j$q$}%S%Z%^%`%c%g%l%n%w%|&O&Z&_&h&j&k&u&x&|'P'W'Z'l'm'p'r's'w'|(O(S(W(](^(d(g(p(r(z(})^)e)g)k)l)p)t)z*O*Y*d*g*h*k*q*r*t*v*y*z*}+Q+U+V+Y+a+c+d+k+x+y,P,X,Y,],g,h,i,k,l,o,q,s,u,w,y,z-O-d-f-m-p-s.f.g/V/Z/s0c0d0e0f0h0i0j0k0l0n0r&eVOYZ[dnprxy}!P!Q!U!i!k!o!p!q!s!t#[#d#g#y#{#}$Q$h$j$}%S%Z%^%`%g%l%n%w%|&Z&_&j&k&u&x'P'W'Z'l'm'p'r's'w(O(W(^(d(g(p(r(z)^)e)g)p)t)z*O*Y*d*g*h*k*q*r*t*v*y*z*}+U+V+Y+a+d+k,P,X,Y,],g,h,i,k,l,o,q,s,u,w,y,z-O-d-f-m-p-s.f.g/V/Z/s0c0d0e0f0h0i0j0k0n0r%oXOYZ[dnrxy}!P!Q!U!i!k#[#d#g#y#{#}$Q$h$j$}%S%^%`%g%l%n%w%|&Z&_&j&k&u&x'P'W'Z'l'm'p'r's'w(O(W(^(d(g(p(r(z)^)e)g)p)t)z*O*Y*d*g*h*k*q*t*v*y*z*}+U+V+Y+a+d+k,P,X,Y,],g,h,i,k,l,o,s,u,w,y,z-O-d-f-m-p.f.g/V/Z0i0j0kQ#vqQ/[.kR0o0q't`OTYZ[adnoprtxy}!P!Q!R!U!X!c!d!e!f!g!h!k!o!p!q!s!t!z#O#S#T#[#d#g#x#y#{#}$Q$e$g$h$j$q$}%S%Z%^%`%c%g%l%n%w%|&O&Z&_&h&j&k&u&x&|'P'W'Z'l'p'r's'w'|(O(S(W(](^(d(g(p(r(z(})^)e)g)k)l)p)t)z*O*Y*g*h*k*q*r*t*v*y*z*}+Q+U+V+Y+a+c+d+k+x+y,P,X,Y,],h,i,k,l,o,q,s,u,w,y,z-O-d-f-m-p-s.f.g/V/Z/s0c0d0e0f0h0i0j0k0l0n0rh#jhz{$W$Z&l&q)S)X+f+g-RW#rq&].k0qQ$]|Q$a!OQ$n!VQ$o!WW$|!i'm*d,gS&[#s#tQ'S$iQ(s&UQ)U&nU)Y&s)Z+jW)a&w+m-T-{Q*Q']W*R'_,`-h.TQ+l)`S,_*S*TQ-Q+eQ-_,TQ-c,WQ.R-al.W-l.^._.a.z.|/R/j/o/t/y0U0Z0^Q/S.`Q/a.tQ/l/OU0P/u0S0[X0V/z0W0_0`R&Z#r!_!wYZ!P!Q!k%S%`%g'p'r's(O(W)g*g*h*k*q*t*v,h,i,k,l,o-m-p.f.g/ZR%^!vQ!{YQ%x#[Q&d#}Q&g$QR,{+YT.j-s/s!Y!jQ!n#c#p$R$d$p$u$v$w$x$y$z%e%j%p%q&`'O'g(q(|)j*o*x+w,v0gQ&X#kQ'c$oR*^'dR'l$|Q%V!mR/_.r'|_OTYZ[adnoprtxy}!P!Q!R!U!X!c!d!e!f!g!h!i!k!o!p!q!s!t!z#O#S#T#[#d#g#x#y#{#}$Q$e$g$h$j$q$}%S%Z%^%`%c%g%l%n%w%|&O&Z&_&h&j&k&u&x&|'P'W'Z'l'm'p'r's'w'|(O(S(W(](^(d(g(p(r(z(})^)e)g)k)l)p)t)z*O*Y*d*g*h*k*q*r*t*v*y*z*}+Q+U+V+Y+a+c+d+k+x+y,P,X,Y,],g,h,i,k,l,o,q,s,u,w,y,z-O-d-f-m-p-s.f.g/V/Z/s0c0d0e0f0h0i0j0k0l0n0rS#a_#b!P.[-l.^._.`.a.t.z.|/R/j/o/t/u/y/z0S0U0W0Z0[0^0_0`'|_OTYZ[adnoprtxy}!P!Q!R!U!X!c!d!e!f!g!h!i!k!o!p!q!s!t!z#O#S#T#[#d#g#x#y#{#}$Q$e$g$h$j$q$}%S%Z%^%`%c%g%l%n%w%|&O&Z&_&h&j&k&u&x&|'P'W'Z'l'm'p'r's'w'|(O(S(W(](^(d(g(p(r(z(})^)e)g)k)l)p)t)z*O*Y*d*g*h*k*q*r*t*v*y*z*}+Q+U+V+Y+a+c+d+k+x+y,P,X,Y,],g,h,i,k,l,o,q,s,u,w,y,z-O-d-f-m-p-s.f.g/V/Z/s0c0d0e0f0h0i0j0k0l0n0rT#a_#bT#^^#_R(o%xa(l%x(n(o+`,{-y-z.oT+[(k+]R-z,{Q$PsQ+l)aQ,^*RR-e,_X#}s$O$P&fQ&y$aQ'a$nQ'd$oR)s'SQ)b&wV-S+m-T-{ZgOn$j)t,PXkOn)t,PQ$k!TQ&z$bQ&{$cQ'^$mQ'b$oQ)q'RQ)x'WQ){'XQ)|'YQ*Z'`S*]'c'dQ+s)gQ+u)hQ+v)iQ+z)oS+|)r*[Q,Q)vQ,R)wS,S)y)zQ,d*^Q-V+rQ-W+tQ-Y+{S-Z+},OQ-`,UQ-b,VQ-|-XQ.O-[Q.P-^Q.Q-_Q.p-}Q.q.RQ/W.dR/r/XWkOn)t,PR#mjQ'`$nS)r'S'aR,O)sQ,]*RR-f,^Q*['`Q+})rR-[,OZiOjn)t,PQ'f$pR*`'gT-j,e-ku.c-l.^._.a.t.z.|/R/j/o/t/u/y0S0U0Z0[0^t.c-l.^._.a.t.z.|/R/j/o/t/u/y0S0U0Z0[0^Q/S.`X0V/z0W0_0`!P.Z-l.^._.`.a.t.z.|/R/j/o/t/u/y/z0S0U0W0Z0[0^0_0`Q.w.YR/f.xg.z.].{/b/i/n/|0O0Q0]0a0bu.b-l.^._.a.t.z.|/R/j/o/t/u/y0S0U0Z0[0^X.u.W.b/a0PR/c.tV0R/u0S0[R/X.dQnOS#on,PR,P)tQ&^#uR(x&^S%m#R#wS(_%m(bT(b%p&`Q%a!yQ%h!}W(P%a%h(U(YQ(U%eR(Y%jQ&i$RR)O&iQ(e%qQ*{(`T+R(e*{Q'n%OR*e'nS'q%R%SY*i'q*j,m-q.hU*j'r's'tU,m*k*l*mS-q,n,oR.h-rQ#Y]R%t#YQ#_^R%y#_Q(h%vS+W(h+XR+X(iQ+](kR,|+]Q#b_R%{#bQ#ebQ%}#cW&Q#e%}({+bQ({&cR+b0gQ$OsS&e$O&fR&f$PQ&v$_R)_&vQ&V#jR(t&VQ&m$VS)T&m+hR+h)UQ$Z{R&p$ZQ&t$]R)[&tQ+n)bR-U+nQ#hfR&S#hQ)f&zR+q)fQ&}$dS)m&})nR)n'OQ'V$kR)u'VQ'[$lS*P'[,ZR,Z*QQ,a*VR-i,aWjOn)t,PR#ljQ-k,eR.U-kd.{.]/b/i/n/|0O0Q0]0a0bR/h.{U.s.W/a0PR/`.sQ/{/nS0X/{0YR0Y/|S/v/b/cR0T/vQ.}.]R/k.}R!ZPXmOn)t,PWlOn)t,PR'T$jYfOn$j)t,PR&R#g[sOn#g$j)t,PR&d#}&dQOYZ[dnprxy}!P!Q!U!i!k!o!p!q!s!t#[#d#g#y#{#}$Q$h$j$}%S%Z%^%`%g%l%n%w%|&Z&_&j&k&u&x'P'W'Z'l'm'p'r's'w(O(W(^(d(g(p(r(z)^)e)g)p)t)z*O*Y*d*g*h*k*q*r*t*v*y*z*}+U+V+Y+a+d+k,P,X,Y,],g,h,i,k,l,o,q,s,u,w,y,z-O-d-f-m-p-s.f.g/V/Z/s0c0d0e0f0h0i0j0k0n0rQ!nTQ#caQ#poU$Rt%c(SS$d!R$gQ$p!XQ$u!cQ$v!dQ$w!eQ$x!fQ$y!gQ$z!hQ%e!zQ%j#OQ%p#SQ%q#TQ&`#xQ'O$eQ'g$qQ(q&OU(|&h(}+cW)j&|)l+x+yQ*o'|Q*x(]Q+w)kQ,v+QR0g0lQ!yYQ!}ZQ$b!PQ$c!QQ%R!kQ't%S^'{%`%g(O(W*q*t*v^*f'p*h,k,l-p.g/ZQ*l'rQ*m'sQ+t)gQ,j*gQ,n*kQ-n,hQ-o,iQ-r,oQ.e-mR/Y.f[bOn#g$j)t,P!^!vYZ!P!Q!k%S%`%g'p'r's(O(W)g*g*h*k*q*t*v,h,i,k,l,o-m-p.f.g/ZQ#R[Q#fdS#wrxQ$UyW$_}$Q'P)pS$l!U$hW${!i'm*d,gS%v#[+Y`&P#d%|(p(r(z+a-O0kQ&a#yQ&b#{Q&c#}Q'j$}Q'z%^W([%l(^*y*}Q(`%nQ(i%wQ(v&ZS(y&_0iQ)P&jQ)Q&kU)]&u)^+kQ)d&xQ)y'WY)}'Z*O,X,Y-dQ*b'lS*n'w0jW+P(d*z,s,wW+T(g+V,y,zQ+p)eQ,U)zQ,c*YQ,x+UQ-P+dQ-e,]Q-v,uQ.S-fR/q/VhUOn#d#g$j%|&_'w(p(r)t,P%U!uYZ[drxy}!P!Q!U!i!k#[#y#{#}$Q$h$}%S%^%`%g%l%n%w&Z&j&k&u&x'P'W'Z'l'm'p'r's(O(W(^(d(g(z)^)e)g)p)z*O*Y*d*g*h*k*q*t*v*y*z*}+U+V+Y+a+d+k,X,Y,],g,h,i,k,l,o,s,u,w,y,z-O-d-f-m-p.f.g/V/Z0i0j0kQ#qpW%W!o!s0d0nQ%X!pQ%Y!qQ%[!tQ%f0cS'v%Z0hQ'x0eQ'y0fQ,p*rQ-u,qS.i-s/sR0p0rU#uq.k0qR(w&][cOn#g$j)t,PZ!xY#[#}$Q+YQ#W[Q#zrR$TxQ%b!yQ%i!}Q%o#RQ'j${Q(V%eQ(Z%jQ(c%pQ(f%qQ*|(`Q,f*bQ-t,pQ.m-uR/].lQ$StQ(R%cR*s(SQ.l-sR/}/sR#QZR#V[R%Q!iQ%O!iV*c'm*d,g!Z!lQ!n#c#p$R$d$p$u$v$w$x$y$z%e%j%p%q&`'O'g(q(|)j*o*x+w,v0gR%T!kT#]^#_Q%x#[R,{+YQ(m%xS+_(n(oQ,}+`Q-x,{S.n-y-zR/^.oT+Z(k+]Q$`}Q&g$QQ)o'PR+{)pQ$XzQ)W&qR+i)XQ$XzQ&o$WQ)W&qR+i)XQ#khW$Vz$W&q)XQ$[{Q&r$ZZ)R&l)S+f+g-RR$^|R)c&wXlOn)t,PQ$f!RR'Q$gQ$m!UR'R$hR*X'_Q*V'_V-g,`-h.TQ.d-lQ/P.^R/Q._U.]-l.^._Q/U.aQ/b.tQ/g.zU/i.|/j/yQ/n/RQ/|/oQ0O/tU0Q/u0S0[Q0]0UQ0a0ZR0b0^R/T.`R/d.t",nodeNames:"⚠ print Escape { Comment Script AssignStatement * BinaryExpression BitOp BitOp BitOp BitOp ArithOp ArithOp @ ArithOp ** UnaryExpression ArithOp BitOp AwaitExpression await ) ( ParenthesizedExpression BinaryExpression or and CompareOp in not is UnaryExpression ConditionalExpression if else LambdaExpression lambda ParamList VariableName AssignOp , : NamedExpression AssignOp YieldExpression yield from TupleExpression ComprehensionExpression async for LambdaExpression ] [ ArrayExpression ArrayComprehensionExpression } { DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression CallExpression ArgList AssignOp MemberExpression . PropertyName Number String FormatString FormatReplacement FormatSelfDoc FormatConversion FormatSpec FormatReplacement FormatSelfDoc ContinuedString Ellipsis None Boolean TypeDef AssignOp UpdateStatement UpdateOp ExpressionStatement DeleteStatement del PassStatement pass BreakStatement break ContinueStatement continue ReturnStatement return YieldStatement PrintStatement RaiseStatement raise ImportStatement import as ScopeStatement global nonlocal AssertStatement assert TypeDefinition type TypeParamList TypeParam StatementGroup ; IfStatement Body elif WhileStatement while ForStatement TryStatement try except finally WithStatement with FunctionDefinition def ParamList AssignOp TypeDef ClassDefinition class DecoratedStatement Decorator At MatchStatement match MatchBody MatchClause case CapturePattern LiteralPattern ArithOp ArithOp AsPattern OrPattern LogicOp AttributePattern SequencePattern MappingPattern StarPattern ClassPattern PatternArgList KeywordPattern KeywordPattern Guard",maxTerm:277,context:m0e,nodeProps:[["isolate",-5,4,71,72,73,77,""],["group",-15,6,85,87,88,90,92,94,96,98,99,100,102,105,108,110,"Statement Statement",-22,8,18,21,25,40,49,50,56,57,60,61,62,63,64,67,70,71,72,79,80,81,82,"Expression",-10,114,116,119,121,122,126,128,133,135,138,"Statement",-9,143,144,147,148,150,151,152,153,154,"Pattern"],["openedBy",23,"(",54,"[",58,"{"],["closedBy",24,")",55,"]",59,"}"]],propSources:[v0e],skippedNodes:[0,4],repeatNodeCount:34,tokenData:"!2|~R!`OX%TXY%oY[%T[]%o]p%Tpq%oqr'ars)Yst*xtu%Tuv,dvw-hwx.Uxy/tyz0[z{0r{|2S|}2p}!O3W!O!P4_!P!Q:Z!Q!R;k!R![>_![!]Do!]!^Es!^!_FZ!_!`Gk!`!aHX!a!b%T!b!cIf!c!dJU!d!eK^!e!hJU!h!i!#f!i!tJU!t!u!,|!u!wJU!w!x!.t!x!}JU!}#O!0S#O#P&o#P#Q!0j#Q#R!1Q#R#SJU#S#T%T#T#UJU#U#VK^#V#YJU#Y#Z!#f#Z#fJU#f#g!,|#g#iJU#i#j!.t#j#oJU#o#p!1n#p#q!1s#q#r!2a#r#s!2f#s$g%T$g;'SJU;'S;=`KW<%lOJU`%YT&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T`%lP;=`<%l%To%v]&n`%c_OX%TXY%oY[%T[]%o]p%Tpq%oq#O%T#O#P&o#P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To&tX&n`OY%TYZ%oZ]%T]^%o^#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc'f[&n`O!_%T!_!`([!`#T%T#T#U(r#U#f%T#f#g(r#g#h(r#h#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(cTmR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(yT!mR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk)aV&n`&[ZOr%Trs)vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk){V&n`Or%Trs*bs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk*iT&n`&^ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To+PZS_&n`OY*xYZ%TZ]*x]^%T^#o*x#o#p+r#p#q*x#q#r+r#r;'S*x;'S;=`,^<%lO*x_+wTS_OY+rZ]+r^;'S+r;'S;=`,W<%lO+r_,ZP;=`<%l+ro,aP;=`<%l*xj,kV%rQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-XT!xY&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-oV%lQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.]V&n`&ZZOw%Twx.rx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.wV&n`Ow%Twx/^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/eT&n`&]ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/{ThZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc0cTgR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk0yXVZ&n`Oz%Tz{1f{!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk1mVaR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk2ZV%oZ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc2wTzR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To3_W%pZ&n`O!_%T!_!`-Q!`!a3w!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Td4OT&{S&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk4fX!fQ&n`O!O%T!O!P5R!P!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5WV&n`O!O%T!O!P5m!P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5tT!rZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti6[a!hX&n`O!Q%T!Q![6T![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S6T#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti7fZ&n`O{%T{|8X|}%T}!O8X!O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8^V&n`O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8z]!hX&n`O!Q%T!Q![8s![!l%T!l!m9s!m#R%T#R#S8s#S#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti9zT!hX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk:bX%qR&n`O!P%T!P!Q:}!Q!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj;UV%sQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti;ro!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!d%T!d!e?q!e!g%T!g!h7a!h!l%T!l!m9s!m!q%T!q!rA]!r!z%T!z!{Bq!{#R%T#R#S>_#S#U%T#U#V?q#V#X%T#X#Y7a#Y#^%T#^#_9s#_#c%T#c#dA]#d#l%T#l#mBq#m#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti=xV&n`O!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti>fc!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S>_#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti?vY&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti@mY!hX&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiAbX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBUX!hX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBv]&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiCv]!hX&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToDvV{_&n`O!_%T!_!`E]!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TcEdT%{R&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkEzT#gZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkFbXmR&n`O!^%T!^!_F}!_!`([!`!a([!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjGUV%mQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkGrV%zZ&n`O!_%T!_!`([!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkH`WmR&n`O!_%T!_!`([!`!aHx!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjIPV%nQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkIoV_Q#}P&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToJ_]&n`&YS%uZO!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoKZP;=`<%lJUoKge&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!tJU!t!uLx!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#gLx#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoMRa&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUkN_V&n`&`ZOr%TrsNts#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkNyV&n`Or%Trs! `s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! gT&n`&bZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! }V&n`&_ZOw%Twx!!dx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!!iV&n`Ow%Twx!#Ox#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!#VT&n`&aZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!#oe&n`&YS%uZOr%Trs!%Qsw%Twx!&px!Q%T!Q![JU![!c%T!c!tJU!t!u!(`!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#g!(`#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!%XV&n`&dZOr%Trs!%ns#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!%sV&n`Or%Trs!&Ys#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&aT&n`&fZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&wV&n`&cZOw%Twx!'^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!'cV&n`Ow%Twx!'xx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!(PT&n`&eZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!(ia&n`&YS%uZOr%Trs!)nsw%Twx!+^x!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!)uV&n`&hZOr%Trs!*[s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*aV&n`Or%Trs!*vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*}T&n`&jZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!+eV&n`&gZOw%Twx!+zx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,PV&n`Ow%Twx!,fx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,mT&n`&iZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!-Vi&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!dJU!d!eLx!e!hJU!h!i!(`!i!}JU!}#R%T#R#SJU#S#T%T#T#UJU#U#VLx#V#YJU#Y#Z!(`#Z#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUo!.}a&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!0ZT!XZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc!0qT!WR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj!1XV%kQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!1sO!]~k!1zV%jR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!2fO![~i!2mT%tX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T",tokenizers:[p0e,d0e,u0e,g0e,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:t=>y0e[t]||-1}],tokenPrec:7668}),wA=new Ice,NH=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function T1(t){return(e,n,r)=>{if(r)return!1;let s=e.node.getChild("VariableName");return s&&n(s,t),!0}}const w0e={FunctionDefinition:T1("function"),ClassDefinition:T1("class"),ForStatement(t,e,n){if(n){for(let r=t.node.firstChild;r;r=r.nextSibling)if(r.name=="VariableName")e(r,"variable");else if(r.name=="in")break}},ImportStatement(t,e){var n,r;let{node:s}=t,i=((n=s.firstChild)===null||n===void 0?void 0:n.name)=="from";for(let a=s.getChild("import");a;a=a.nextSibling)a.name=="VariableName"&&((r=a.nextSibling)===null||r===void 0?void 0:r.name)!="as"&&e(a,i?"variable":"namespace")},AssignStatement(t,e){for(let n=t.node.firstChild;n;n=n.nextSibling)if(n.name=="VariableName")e(n,"variable");else if(n.name==":"||n.name=="AssignOp")break},ParamList(t,e){for(let n=null,r=t.node.firstChild;r;r=r.nextSibling)r.name=="VariableName"&&(!n||!/\*|AssignOp/.test(n.name))&&e(r,"variable"),n=r},CapturePattern:T1("variable"),AsPattern:T1("variable"),__proto__:null};function CH(t,e){let n=wA.get(e);if(n)return n;let r=[],s=!0;function i(a,l){let c=t.sliceString(a.from,a.to);r.push({label:c,type:l})}return e.cursor(hs.IncludeAnonymous).iterate(a=>{if(a.name){let l=w0e[a.name];if(l&&l(a,i,s)||!s&&NH.has(a.name))return!1;s=!1}else if(a.to-a.from>8192){for(let l of CH(t,a.node))r.push(l);return!1}}),wA.set(e,r),r}const SA=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,TH=["String","FormatString","Comment","PropertyName"];function S0e(t){let e=Ss(t.state).resolveInner(t.pos,-1);if(TH.indexOf(e.name)>-1)return null;let n=e.name=="VariableName"||e.to-e.from<20&&SA.test(t.state.sliceDoc(e.from,e.to));if(!n&&!t.explicit)return null;let r=[];for(let s=e;s;s=s.parent)NH.has(s.name)&&(r=r.concat(CH(t.state.doc,s)));return{options:r,from:n?e.from:t.pos,validFor:SA}}const k0e=["__annotations__","__builtins__","__debug__","__doc__","__import__","__name__","__loader__","__package__","__spec__","False","None","True"].map(t=>({label:t,type:"constant"})).concat(["ArithmeticError","AssertionError","AttributeError","BaseException","BlockingIOError","BrokenPipeError","BufferError","BytesWarning","ChildProcessError","ConnectionAbortedError","ConnectionError","ConnectionRefusedError","ConnectionResetError","DeprecationWarning","EOFError","Ellipsis","EncodingWarning","EnvironmentError","Exception","FileExistsError","FileNotFoundError","FloatingPointError","FutureWarning","GeneratorExit","IOError","ImportError","ImportWarning","IndentationError","IndexError","InterruptedError","IsADirectoryError","KeyError","KeyboardInterrupt","LookupError","MemoryError","ModuleNotFoundError","NameError","NotADirectoryError","NotImplemented","NotImplementedError","OSError","OverflowError","PendingDeprecationWarning","PermissionError","ProcessLookupError","RecursionError","ReferenceError","ResourceWarning","RuntimeError","RuntimeWarning","StopAsyncIteration","StopIteration","SyntaxError","SyntaxWarning","SystemError","SystemExit","TabError","TimeoutError","TypeError","UnboundLocalError","UnicodeDecodeError","UnicodeEncodeError","UnicodeError","UnicodeTranslateError","UnicodeWarning","UserWarning","ValueError","Warning","ZeroDivisionError"].map(t=>({label:t,type:"type"}))).concat(["bool","bytearray","bytes","classmethod","complex","float","frozenset","int","list","map","memoryview","object","range","set","staticmethod","str","super","tuple","type"].map(t=>({label:t,type:"class"}))).concat(["abs","aiter","all","anext","any","ascii","bin","breakpoint","callable","chr","compile","delattr","dict","dir","divmod","enumerate","eval","exec","exit","filter","format","getattr","globals","hasattr","hash","help","hex","id","input","isinstance","issubclass","iter","len","license","locals","max","min","next","oct","open","ord","pow","print","property","quit","repr","reversed","round","setattr","slice","sorted","sum","vars","zip"].map(t=>({label:t,type:"function"}))),O0e=[wl("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),wl("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),wl("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),wl("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),wl(`if \${}:
|
||
|
||
`,{label:"if",detail:"block",type:"keyword"}),wl("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),wl("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),wl("import ${module}",{label:"import",detail:"statement",type:"keyword"}),wl("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],j0e=Che(TH,nH(k0e.concat(O0e)));function pS(t){let{node:e,pos:n}=t,r=t.lineIndent(n,-1),s=null;for(;;){let i=e.childBefore(n);if(i)if(i.name=="Comment")n=i.from;else if(i.name=="Body"||i.name=="MatchBody")t.baseIndentFor(i)+t.unit<=r&&(s=i),e=i;else if(i.name=="MatchClause")e=i;else if(i.type.is("Statement"))e=i;else break;else break}return s}function gS(t,e){let n=t.baseIndentFor(e),r=t.lineAt(t.pos,-1),s=r.from+r.text.length;return/^\s*($|#)/.test(r.text)&&t.node.to<s+100&&!/\S/.test(t.state.sliceDoc(s,t.node.to))&&t.lineIndent(t.pos,-1)<=n||/^\s*(else:|elif |except |finally:|case\s+[^=:]+:)/.test(t.textAfter)&&t.lineIndent(t.pos,-1)>n?null:n+t.unit}const xS=J0.define({name:"python",parser:b0e.configure({props:[vb.add({Body:t=>{var e;let n=/^\s*(#|$)/.test(t.textAfter)&&pS(t)||t.node;return(e=gS(t,n))!==null&&e!==void 0?e:t.continue()},MatchBody:t=>{var e;let n=pS(t);return(e=gS(t,n||t.node))!==null&&e!==void 0?e:t.continue()},IfStatement:t=>/^\s*(else:|elif )/.test(t.textAfter)?t.baseIndent:t.continue(),"ForStatement WhileStatement":t=>/^\s*else:/.test(t.textAfter)?t.baseIndent:t.continue(),TryStatement:t=>/^\s*(except[ :]|finally:|else:)/.test(t.textAfter)?t.baseIndent:t.continue(),MatchStatement:t=>/^\s*case /.test(t.textAfter)?t.baseIndent+t.unit:t.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":J4({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":J4({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":J4({closing:"]"}),MemberExpression:t=>t.baseIndent+t.unit,"String FormatString":()=>null,Script:t=>{var e;let n=pS(t);return(e=n&&gS(t,n))!==null&&e!==void 0?e:t.continue()}}),N6.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":Gq,Body:(t,e)=>({from:t.from+1,to:t.to-(t.to==e.doc.length?0:1)}),"String FormatString":(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:|case\s+[^:]*:?)$/}});function N0e(){return new Vq(xS,[xS.data.of({autocomplete:S0e}),xS.data.of({autocomplete:j0e})])}const C0e=k6({String:ye.string,Number:ye.number,"True False":ye.bool,PropertyName:ye.propertyName,Null:ye.null,", :":ye.separator,"[ ]":ye.squareBracket,"{ }":ye.brace}),T0e=lp.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[C0e],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),E0e=()=>t=>{try{JSON.parse(t.state.doc.toString())}catch(e){if(!(e instanceof SyntaxError))throw e;const n=_0e(e,t.state.doc);return[{from:n,message:e.message,severity:"error",to:n}]}return[]};function _0e(t,e){let n;return(n=t.message.match(/at position (\d+)/))?Math.min(+n[1],e.length):(n=t.message.match(/at line (\d+) column (\d+)/))?Math.min(e.line(+n[1]).from+ +n[2]-1,e.length):0}const A0e=J0.define({name:"json",parser:T0e.configure({props:[vb.add({Object:k_({except:/^\s*\}/}),Array:k_({except:/^\s*\]/})}),N6.add({"Object Array":Gq})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function M0e(){return new Vq(A0e)}const R0e={name:"toml",startState:function(){return{inString:!1,stringType:"",lhs:!0,inArray:0}},token:function(t,e){let n;if(!e.inString&&(n=t.match(/^('''|"""|'|")/))&&(e.stringType=n[0],e.inString=!0),t.sol()&&!e.inString&&e.inArray===0&&(e.lhs=!0),e.inString){for(;e.inString;)if(t.match(e.stringType))e.inString=!1;else if(t.peek()==="\\")t.next(),t.next();else{if(t.eol())break;t.match(/^.[^\\\"\']*/)}return e.lhs?"property":"string"}else{if(e.inArray&&t.peek()==="]")return t.next(),e.inArray--,"bracket";if(e.lhs&&t.peek()==="["&&t.skipTo("]"))return t.next(),t.peek()==="]"&&t.next(),"atom";if(t.peek()==="#")return t.skipToEnd(),"comment";if(t.eatSpace())return null;if(e.lhs&&t.eatWhile(function(r){return r!="="&&r!=" "}))return"property";if(e.lhs&&t.peek()==="=")return t.next(),e.lhs=!1,null;if(!e.lhs&&t.match(/^\d\d\d\d[\d\-\:\.T]*Z/))return"atom";if(!e.lhs&&(t.match("true")||t.match("false")))return"atom";if(!e.lhs&&t.peek()==="[")return e.inArray++,t.next(),"bracket";if(!e.lhs&&t.match(/^\-?\d+(?:\.\d+)?/))return"number";t.eatSpace()||t.next()}return null},languageData:{commentTokens:{line:"#"}}},D0e={python:[N0e()],json:[M0e(),E0e()],toml:[C6.define(R0e)],text:[]};function P0e({value:t,onChange:e,language:n="text",readOnly:r=!1,height:s="400px",minHeight:i,maxHeight:a,placeholder:l,theme:c="dark",className:d=""}){const[h,m]=b.useState(!1);if(b.useEffect(()=>{m(!0)},[]),!h)return o.jsx("div",{className:`rounded-md border bg-muted animate-pulse ${d}`,style:{height:s,minHeight:i,maxHeight:a}});const g=[...D0e[n]||[],Ze.lineWrapping];return r&&g.push(Ze.editable.of(!1)),o.jsx("div",{className:`rounded-md overflow-hidden border ${d}`,children:o.jsx(vH,{value:t,height:s,minHeight:i,maxHeight:a,theme:c==="dark"?xH:void 0,extensions:g,onChange:e,placeholder:l,basicSetup:{lineNumbers:!0,highlightActiveLineGutter:!0,highlightSpecialChars:!0,history:!0,foldGutter:!0,drawSelection:!0,dropCursor:!0,allowMultipleSelections:!0,indentOnInput:!0,syntaxHighlighting:!0,bracketMatching:!0,closeBrackets:!0,autocompletion:!0,rectangularSelection:!0,crosshairCursor:!0,highlightActiveLine:!0,highlightSelectionMatches:!0,closeBracketsKeymap:!0,defaultKeymap:!0,searchKeymap:!0,historyKeymap:!0,foldKeymap:!0,completionKeymap:!0,lintKeymap:!0}})})}function z0e(){const[t,e]=b.useState(!0),[n,r]=b.useState(!1),[s,i]=b.useState(!1),[a,l]=b.useState(!1),[c,d]=b.useState(!1),[h,m]=b.useState(!1),[g,x]=b.useState("visual"),[y,w]=b.useState(""),[S,k]=b.useState(!1),{toast:j}=Lr(),[N,T]=b.useState(null),[E,_]=b.useState(null),[A,D]=b.useState(null),[q,B]=b.useState(null),[H,W]=b.useState(null),[ee,I]=b.useState(null),[V,L]=b.useState(null),[$,K]=b.useState(null),[Y,R]=b.useState(null),[ie,X]=b.useState(null),[z,U]=b.useState(null),[te,ne]=b.useState(null),[G,se]=b.useState(null),[re,ae]=b.useState(null),[_e,Be]=b.useState(null),[Ye,Je]=b.useState(null),[Oe,Ve]=b.useState(null),[Ue,$e]=b.useState(null),jt=b.useRef(null),vt=b.useRef(!0),$n=b.useRef({}),qt=b.useCallback(async()=>{try{const We=await kae();w(We),k(!1)}catch(We){j({variant:"destructive",title:"加载失败",description:We instanceof Error?We.message:"加载源代码失败"})}},[j]),un=b.useCallback(async()=>{try{e(!0);const We=await dE();$n.current=We,T(We.bot),_(We.personality);const ot=We.chat;ot.talk_value_rules||(ot.talk_value_rules=[]),D(ot),B(We.expression),W(We.emoji),I(We.memory),L(We.tool),K(We.mood),R(We.voice),X(We.lpmm_knowledge),U(We.keyword_reaction),ne(We.response_post_process),se(We.chinese_typo),ae(We.response_splitter),Be(We.log),Je(We.debug),Ve(We.maim_message),$e(We.telemetry),l(!1),vt.current=!1,await qt()}catch(We){console.error("加载配置失败:",We),j({title:"加载失败",description:"无法加载配置文件",variant:"destructive"})}finally{e(!1)}},[j,qt]);b.useEffect(()=>{un()},[un]);const Mt=b.useCallback(async(We,ot)=>{if(!vt.current)try{i(!0),await jae(We,ot),l(!1)}catch(dn){console.error(`自动保存 ${We} 失败:`,dn),l(!0)}finally{i(!1)}},[]),ct=b.useCallback((We,ot)=>{vt.current||(l(!0),jt.current&&clearTimeout(jt.current),jt.current=setTimeout(()=>{Mt(We,ot)},2e3))},[Mt]);b.useEffect(()=>{N&&!vt.current&&ct("bot",N)},[N,ct]),b.useEffect(()=>{E&&!vt.current&&ct("personality",E)},[E,ct]),b.useEffect(()=>{A&&!vt.current&&ct("chat",A)},[A,ct]),b.useEffect(()=>{q&&!vt.current&&ct("expression",q)},[q,ct]),b.useEffect(()=>{H&&!vt.current&&ct("emoji",H)},[H,ct]),b.useEffect(()=>{ee&&!vt.current&&ct("memory",ee)},[ee,ct]),b.useEffect(()=>{V&&!vt.current&&ct("tool",V)},[V,ct]),b.useEffect(()=>{$&&!vt.current&&ct("mood",$)},[$,ct]),b.useEffect(()=>{Y&&!vt.current&&ct("voice",Y)},[Y,ct]),b.useEffect(()=>{ie&&!vt.current&&ct("lpmm_knowledge",ie)},[ie,ct]),b.useEffect(()=>{z&&!vt.current&&ct("keyword_reaction",z)},[z,ct]),b.useEffect(()=>{te&&!vt.current&&ct("response_post_process",te)},[te,ct]),b.useEffect(()=>{G&&!vt.current&&ct("chinese_typo",G)},[G,ct]),b.useEffect(()=>{re&&!vt.current&&ct("response_splitter",re)},[re,ct]),b.useEffect(()=>{_e&&!vt.current&&ct("log",_e)},[_e,ct]),b.useEffect(()=>{Ye&&!vt.current&&ct("debug",Ye)},[Ye,ct]),b.useEffect(()=>{Oe&&!vt.current&&ct("maim_message",Oe)},[Oe,ct]),b.useEffect(()=>{Ue&&!vt.current&&ct("telemetry",Ue)},[Ue,ct]);const Ne=async()=>{try{r(!0),await Oae(y),l(!1),k(!1),j({title:"保存成功",description:"配置已保存"}),await un()}catch(We){k(!0),j({variant:"destructive",title:"保存失败",description:We instanceof Error?We.message:"保存配置失败"})}finally{r(!1)}},ze=async We=>{if(a){j({variant:"destructive",title:"切换失败",description:"请先保存当前更改"});return}if(x(We),We==="source")await qt();else try{const ot=await dE();$n.current=ot,T(ot.bot),_(ot.personality);const dn=ot.chat;dn.talk_value_rules||(dn.talk_value_rules=[]),D(dn),B(ot.expression),W(ot.emoji),I(ot.memory),L(ot.tool),K(ot.mood),R(ot.voice),X(ot.lpmm_knowledge),U(ot.keyword_reaction),ne(ot.response_post_process),se(ot.chinese_typo),ae(ot.response_splitter),Be(ot.log),Je(ot.debug),Ve(ot.maim_message),$e(ot.telemetry),l(!1)}catch(ot){console.error("加载配置失败:",ot),j({title:"加载失败",description:"无法加载配置文件",variant:"destructive"})}},rt=async()=>{try{r(!0),jt.current&&clearTimeout(jt.current);const We={...$n.current,bot:N,personality:E,chat:A,expression:q,emoji:H,memory:ee,tool:V,mood:$,voice:Y,lpmm_knowledge:ie,keyword_reaction:z,response_post_process:te,chinese_typo:G,response_splitter:re,log:_e,debug:Ye,maim_message:Oe,telemetry:Ue};await hE(We),l(!1),j({title:"保存成功",description:"麦麦主程序配置已保存"})}catch(We){console.error("保存配置失败:",We),j({title:"保存失败",description:We.message,variant:"destructive"})}finally{r(!1)}},bt=async()=>{try{d(!0),cb().catch(()=>{}),m(!0)}catch(We){console.error("重启失败:",We),m(!1),j({title:"重启失败",description:"无法发送重启请求,请手动重启",variant:"destructive"}),d(!1)}},zt=async()=>{try{r(!0),jt.current&&clearTimeout(jt.current);const We={...$n.current,bot:N,personality:E,chat:A,expression:q,emoji:H,memory:ee,tool:V,mood:$,voice:Y,lpmm_knowledge:ie,keyword_reaction:z,response_post_process:te,chinese_typo:G,response_splitter:re,log:_e,debug:Ye,maim_message:Oe,telemetry:Ue};await hE(We),l(!1),j({title:"保存成功",description:"配置已保存,即将重启麦麦..."}),await new Promise(ot=>setTimeout(ot,500)),await bt()}catch(We){console.error("保存失败:",We),j({title:"保存失败",description:We.message,variant:"destructive"})}finally{r(!1)}},Rt=()=>{localStorage.removeItem("access-token"),window.location.href="/auth"},Hn=()=>{m(!1),d(!1),j({title:"重启失败",description:"服务器未能在预期时间内恢复,请手动检查",variant:"destructive"})};return t?o.jsx(pn,{className:"h-full",children:o.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})})}):o.jsx(pn,{className:"h-full",children:o.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"麦麦主程序配置"}),o.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理麦麦的核心功能和行为设置"})]}),o.jsxs("div",{className:"flex gap-2 w-full sm:w-auto items-center",children:[o.jsx(Yi,{value:g,onValueChange:We=>ze(We),className:"w-auto",children:o.jsxs(ji,{className:"h-9",children:[o.jsxs(Bt,{value:"visual",className:"text-xs sm:text-sm px-2 sm:px-3",children:[o.jsx(Xee,{className:"h-3 w-3 sm:h-4 sm:w-4 mr-1"}),"可视化"]}),o.jsxs(Bt,{value:"source",className:"text-xs sm:text-sm px-2 sm:px-3",children:[o.jsx(Yee,{className:"h-3 w-3 sm:h-4 sm:w-4 mr-1"}),"源代码"]})]})}),o.jsxs(ue,{onClick:g==="visual"?rt:Ne,disabled:n||s||!a||c,size:"sm",variant:"outline",className:"flex-1 sm:flex-none",children:[o.jsx(zp,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),n?"保存中...":s?"自动保存中...":a?"保存配置":"已保存"]}),o.jsxs(Fn,{children:[o.jsx(is,{asChild:!0,children:o.jsxs(ue,{disabled:n||s||c,size:"sm",className:"flex-1 sm:flex-none",children:[o.jsx(Dp,{className:"mr-2 h-4 w-4"}),c?"重启中...":a?"保存并重启":"重启麦麦"]})}),o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认重启麦麦?"}),o.jsx(zn,{className:"space-y-3",asChild:!0,children:o.jsxs("div",{children:[o.jsx("p",{children:a?"当前有未保存的配置更改。点击确认将先保存配置,然后重启麦麦使新配置生效。重启过程中麦麦将暂时离线。":"即将重启麦麦主程序。重启过程中麦麦将暂时离线,配置将在重启后生效。"}),o.jsxs(ba,{className:"border-yellow-500/50 bg-yellow-500/10",children:[o.jsx(Xi,{className:"h-4 w-4 text-yellow-600"}),o.jsxs(wa,{className:"text-yellow-900 dark:text-yellow-100",children:[o.jsx("strong",{children:"重要提示:"}),"由于技术原因,使用重启功能后,将无法再使用 ",o.jsx("code",{className:"px-1 py-0.5 bg-yellow-200 dark:bg-yellow-900 rounded",children:"Ctrl+C"})," 结束程序。",o.jsxs(Er,{children:[o.jsx(Of,{asChild:!0,children:o.jsxs("button",{className:"ml-1 text-yellow-700 dark:text-yellow-300 underline hover:text-yellow-800 dark:hover:text-yellow-200 inline-flex items-center gap-1",children:[o.jsx(Zy,{className:"h-3 w-3"}),"如何结束程序?"]})}),o.jsxs(wr,{className:"max-w-2xl",children:[o.jsxs(Sr,{children:[o.jsx(kr,{children:"如何结束使用重启功能后的麦麦程序"}),o.jsx(Xr,{children:"由于重启功能会使程序脱离终端控制,需要通过系统命令来结束进程"})]}),o.jsxs(Yi,{defaultValue:"windows",className:"w-full",children:[o.jsxs(ji,{className:"grid w-full grid-cols-3",children:[o.jsx(Bt,{value:"windows",children:"Windows"}),o.jsx(Bt,{value:"macos",children:"macOS"}),o.jsx(Bt,{value:"linux",children:"Linux"})]}),o.jsxs(ln,{value:"windows",className:"space-y-4 mt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"方法一:使用任务管理器"}),o.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[o.jsxs("li",{children:["按 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Ctrl + Shift + Esc"})," 打开任务管理器"]}),o.jsxs("li",{children:['在"进程"或"详细信息"标签页中找到 ',o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"python.exe"})]}),o.jsx("li",{children:'右键点击并选择"结束任务"'})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"方法二:使用命令行"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"打开 PowerShell 或命令提示符,执行以下命令:"}),o.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[o.jsx("p",{children:"# 查找麦麦进程"}),o.jsx("p",{children:'Get-Process python | Where-Object {$_.MainWindowTitle -eq ""}'}),o.jsx("p",{className:"mt-2",children:"# 结束所有 Python 进程(谨慎使用)"}),o.jsx("p",{children:"Stop-Process -Name python -Force"})]})]})]}),o.jsxs(ln,{value:"macos",className:"space-y-4 mt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"方法一:使用活动监视器"}),o.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[o.jsxs("li",{children:["按 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Cmd + Space"}),' 打开 Spotlight,搜索"活动监视器"']}),o.jsxs("li",{children:["在进程列表中找到 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Python"})]}),o.jsx("li",{children:"选中后点击左上角的 X 按钮结束进程"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"方法二:使用终端"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"打开终端,执行以下命令:"}),o.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[o.jsx("p",{children:"# 查找麦麦进程"}),o.jsx("p",{children:"ps aux | grep python | grep -v grep"}),o.jsx("p",{className:"mt-2",children:"# 结束指定 PID 的进程"}),o.jsx("p",{children:"kill -9 <PID>"}),o.jsx("p",{className:"mt-2",children:"# 或结束所有 Python 进程(谨慎使用)"}),o.jsx("p",{children:"pkill -9 python"})]})]})]}),o.jsxs(ln,{value:"linux",className:"space-y-4 mt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"使用终端命令"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"打开终端,执行以下命令:"}),o.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[o.jsx("p",{children:"# 查找麦麦进程"}),o.jsx("p",{children:"ps aux | grep python | grep -v grep"}),o.jsx("p",{className:"mt-2",children:"# 结束指定 PID 的进程"}),o.jsx("p",{children:"kill -9 <PID>"}),o.jsx("p",{className:"mt-2",children:"# 或使用 pkill 按名称结束"}),o.jsx("p",{children:'pkill -9 -f "bot.py"'}),o.jsx("p",{className:"mt-2",children:"# 或结束所有 Python 进程(谨慎使用)"}),o.jsx("p",{children:"pkill -9 python"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"使用 htop(如已安装)"}),o.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[o.jsxs("li",{children:["在终端输入 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"htop"})]}),o.jsxs("li",{children:["按 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"F3"})," 搜索 python"]}),o.jsxs("li",{children:["按 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"F9"})," 发送信号,选择 SIGKILL"]})]})]})]})]}),o.jsx(fs,{children:o.jsx(e6,{asChild:!0,children:o.jsx(ue,{variant:"outline",children:"关闭"})})})]})]})]})]})]})})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:a?zt:bt,children:a?"保存并重启":"确认重启"})]})]})]})]})]}),o.jsxs(ba,{children:[o.jsx(Xi,{className:"h-4 w-4"}),o.jsxs(wa,{children:["配置更新后需要",o.jsx("strong",{children:"重启麦麦"}),'才能生效。你可以点击右上角的"保存并重启"按钮一键完成保存和重启。']})]}),g==="source"&&o.jsxs("div",{className:"space-y-4",children:[o.jsxs(ba,{children:[o.jsx(Xi,{className:"h-4 w-4"}),o.jsxs(wa,{children:[o.jsx("strong",{children:"源代码模式(高级功能):"}),"直接编辑 TOML 配置文件。此功能仅适用于熟悉 TOML 语法的高级用户。保存时会在后端验证格式,只有格式完全正确才能保存。",S&&o.jsx("span",{className:"text-destructive font-semibold ml-2",children:"⚠️ 上次保存失败,请检查 TOML 格式"})]})]}),o.jsx(P0e,{value:y,onChange:We=>{w(We),l(!0),S&&k(!1)},language:"toml",theme:"dark",height:"calc(100vh - 280px)",minHeight:"500px",placeholder:"TOML 配置内容"})]}),g==="visual"&&o.jsx(o.Fragment,{children:o.jsxs(Yi,{defaultValue:"bot",className:"w-full",children:[o.jsx("div",{className:"overflow-x-auto -mx-4 px-4 sm:mx-0 sm:px-0",children:o.jsxs(ji,{className:"inline-flex w-auto min-w-full sm:grid sm:w-full sm:grid-cols-5 lg:grid-cols-10",children:[o.jsx(Bt,{value:"bot",className:"flex-shrink-0",children:"基本信息"}),o.jsx(Bt,{value:"personality",className:"flex-shrink-0",children:"人格"}),o.jsx(Bt,{value:"chat",className:"flex-shrink-0",children:"聊天"}),o.jsx(Bt,{value:"expression",className:"flex-shrink-0",children:"表达"}),o.jsx(Bt,{value:"features",className:"flex-shrink-0",children:"功能"}),o.jsx(Bt,{value:"processing",className:"flex-shrink-0",children:"处理"}),o.jsx(Bt,{value:"mood",className:"flex-shrink-0",children:"情绪"}),o.jsx(Bt,{value:"voice",className:"flex-shrink-0",children:"语音"}),o.jsx(Bt,{value:"lpmm",className:"flex-shrink-0",children:"知识库"}),o.jsx(Bt,{value:"other",className:"flex-shrink-0",children:"其他"})]})}),o.jsx(ln,{value:"bot",className:"space-y-4",children:N&&o.jsx(I0e,{config:N,onChange:T})}),o.jsx(ln,{value:"personality",className:"space-y-4",children:E&&o.jsx(L0e,{config:E,onChange:_})}),o.jsx(ln,{value:"chat",className:"space-y-4",children:A&&o.jsx(B0e,{config:A,onChange:D})}),o.jsx(ln,{value:"expression",className:"space-y-4",children:q&&o.jsx(q0e,{config:q,onChange:B})}),o.jsx(ln,{value:"features",className:"space-y-4",children:H&&ee&&V&&o.jsx($0e,{emojiConfig:H,memoryConfig:ee,toolConfig:V,onEmojiChange:W,onMemoryChange:I,onToolChange:L})}),o.jsx(ln,{value:"processing",className:"space-y-4",children:z&&te&&G&&re&&o.jsx(H0e,{keywordReactionConfig:z,responsePostProcessConfig:te,chineseTypoConfig:G,responseSplitterConfig:re,onKeywordReactionChange:U,onResponsePostProcessChange:ne,onChineseTypoChange:se,onResponseSplitterChange:ae})}),o.jsx(ln,{value:"mood",className:"space-y-4",children:$&&o.jsx(Q0e,{config:$,onChange:K})}),o.jsx(ln,{value:"voice",className:"space-y-4",children:Y&&o.jsx(V0e,{config:Y,onChange:R})}),o.jsx(ln,{value:"lpmm",className:"space-y-4",children:ie&&o.jsx(U0e,{config:ie,onChange:X})}),o.jsxs(ln,{value:"other",className:"space-y-4",children:[_e&&o.jsx(W0e,{config:_e,onChange:Be}),Ye&&o.jsx(G0e,{config:Ye,onChange:Je}),Oe&&o.jsx(X0e,{config:Oe,onChange:Ve}),Ue&&o.jsx(Y0e,{config:Ue,onChange:$e})]})]})}),h&&o.jsx(r6,{onRestartComplete:Rt,onRestartFailed:Hn})]})})}function I0e({config:t,onChange:e}){const n=()=>{e({...t,platforms:[...t.platforms,""]})},r=c=>{e({...t,platforms:t.platforms.filter((d,h)=>h!==c)})},s=(c,d)=>{const h=[...t.platforms];h[c]=d,e({...t,platforms:h})},i=()=>{e({...t,alias_names:[...t.alias_names,""]})},a=c=>{e({...t,alias_names:t.alias_names.filter((d,h)=>h!==c)})},l=(c,d)=>{const h=[...t.alias_names];h[c]=d,e({...t,alias_names:h})};return o.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-4",children:"基本信息"}),o.jsxs("div",{className:"grid gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"platform",children:"平台"}),o.jsx(Pe,{id:"platform",value:t.platform,onChange:c=>e({...t,platform:c.target.value}),placeholder:"qq"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"qq_account",children:"QQ账号"}),o.jsx(Pe,{id:"qq_account",value:t.qq_account,onChange:c=>e({...t,qq_account:c.target.value}),placeholder:"123456789"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"nickname",children:"昵称"}),o.jsx(Pe,{id:"nickname",value:t.nickname,onChange:c=>e({...t,nickname:c.target.value}),placeholder:"麦麦"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(he,{children:"其他平台账号"}),o.jsxs(ue,{onClick:n,size:"sm",variant:"outline",children:[o.jsx(Is,{className:"h-4 w-4 mr-1"}),"添加"]})]}),o.jsxs("div",{className:"space-y-2",children:[t.platforms.map((c,d)=>o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Pe,{value:c,onChange:h=>s(d,h.target.value),placeholder:"wx:114514"}),o.jsxs(Fn,{children:[o.jsx(is,{asChild:!0,children:o.jsx(ue,{size:"icon",variant:"outline",children:o.jsx(Cn,{className:"h-4 w-4"})})}),o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认删除"}),o.jsxs(zn,{children:['确定要删除平台账号 "',c||"(空)",'" 吗?此操作无法撤销。']})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:()=>r(d),children:"删除"})]})]})]})]},d)),t.platforms.length===0&&o.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无其他平台账号"})]})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(he,{children:"别名"}),o.jsxs(ue,{onClick:i,size:"sm",variant:"outline",children:[o.jsx(Is,{className:"h-4 w-4 mr-1"}),"添加"]})]}),o.jsxs("div",{className:"space-y-2",children:[t.alias_names.map((c,d)=>o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Pe,{value:c,onChange:h=>l(d,h.target.value),placeholder:"小麦"}),o.jsxs(Fn,{children:[o.jsx(is,{asChild:!0,children:o.jsx(ue,{size:"icon",variant:"outline",children:o.jsx(Cn,{className:"h-4 w-4"})})}),o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认删除"}),o.jsxs(zn,{children:['确定要删除别名 "',c||"(空)",'" 吗?此操作无法撤销。']})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:()=>a(d),children:"删除"})]})]})]})]},d)),t.alias_names.length===0&&o.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无别名"})]})]})]})]})})}function L0e({config:t,onChange:e}){const n=()=>{e({...t,states:[...t.states,""]})},r=i=>{e({...t,states:t.states.filter((a,l)=>l!==i)})},s=(i,a)=>{const l=[...t.states];l[i]=a,e({...t,states:l})};return o.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-4",children:"人格设置"}),o.jsxs("div",{className:"grid gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"personality",children:"人格特质"}),o.jsx(Nr,{id:"personality",value:t.personality,onChange:i=>e({...t,personality:i.target.value}),placeholder:"描述人格特质和身份特征(建议120字以内)",rows:3}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"建议120字以内,描述人格特质和身份特征"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"reply_style",children:"表达风格"}),o.jsx(Nr,{id:"reply_style",value:t.reply_style,onChange:i=>e({...t,reply_style:i.target.value}),placeholder:"描述说话的表达风格和习惯",rows:3})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"interest",children:"兴趣"}),o.jsx(Nr,{id:"interest",value:t.interest,onChange:i=>e({...t,interest:i.target.value}),placeholder:"会影响麦麦对什么话题进行回复",rows:2})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"plan_style",children:"说话规则与行为风格"}),o.jsx(Nr,{id:"plan_style",value:t.plan_style,onChange:i=>e({...t,plan_style:i.target.value}),placeholder:"麦麦的说话规则和行为风格",rows:5})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"visual_style",children:"识图规则"}),o.jsx(Nr,{id:"visual_style",value:t.visual_style,onChange:i=>e({...t,visual_style:i.target.value}),placeholder:"识图时的处理规则",rows:3})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"private_plan_style",children:"私聊规则"}),o.jsx(Nr,{id:"private_plan_style",value:t.private_plan_style,onChange:i=>e({...t,private_plan_style:i.target.value}),placeholder:"私聊的说话规则和行为风格",rows:4})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(he,{children:"状态列表(人格多样性)"}),o.jsxs(ue,{onClick:n,size:"sm",variant:"outline",children:[o.jsx(Is,{className:"h-4 w-4 mr-1"}),"添加状态"]})]}),o.jsx("div",{className:"space-y-2",children:t.states.map((i,a)=>o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Nr,{value:i,onChange:l=>s(a,l.target.value),placeholder:"描述一个人格状态",rows:2}),o.jsxs(Fn,{children:[o.jsx(is,{asChild:!0,children:o.jsx(ue,{size:"icon",variant:"outline",children:o.jsx(Cn,{className:"h-4 w-4"})})}),o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认删除"}),o.jsx(zn,{children:"确定要删除这个人格状态吗?此操作无法撤销。"})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:()=>r(a),children:"删除"})]})]})]})]},a))})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"state_probability",children:"状态替换概率"}),o.jsx(Pe,{id:"state_probability",type:"number",step:"0.1",min:"0",max:"1",value:t.state_probability,onChange:i=>e({...t,state_probability:parseFloat(i.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"每次构建人格时替换 personality 的概率(0.0-1.0)"})]})]})]})})}function B0e({config:t,onChange:e}){const n=()=>{e({...t,talk_value_rules:[...t.talk_value_rules,{target:"",time:"00:00-23:59",value:1}]})},r=l=>{e({...t,talk_value_rules:t.talk_value_rules.filter((c,d)=>d!==l)})},s=(l,c,d)=>{const h=[...t.talk_value_rules];h[l]={...h[l],[c]:d},e({...t,talk_value_rules:h})},i=({value:l,onChange:c})=>{const[d,h]=b.useState("00"),[m,g]=b.useState("00"),[x,y]=b.useState("23"),[w,S]=b.useState("59");b.useEffect(()=>{const j=l.split("-");if(j.length===2){const[N,T]=j,[E,_]=N.split(":"),[A,D]=T.split(":");E&&h(E.padStart(2,"0")),_&&g(_.padStart(2,"0")),A&&y(A.padStart(2,"0")),D&&S(D.padStart(2,"0"))}},[l]);const k=(j,N,T,E)=>{const _=`${j}:${N}-${T}:${E}`;c(_)};return o.jsxs(Bo,{children:[o.jsx(Fo,{asChild:!0,children:o.jsxs(ue,{variant:"outline",className:"w-full justify-start font-mono text-sm",children:[o.jsx(Mh,{className:"h-4 w-4 mr-2"}),l||"选择时间段"]})}),o.jsx(Ka,{className:"w-80",children:o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"font-medium text-sm mb-3",children:"开始时间"}),o.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:gap-3",children:[o.jsxs("div",{children:[o.jsx(he,{className:"text-xs",children:"小时"}),o.jsxs(Vt,{value:d,onValueChange:j=>{h(j),k(j,m,x,w)},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsx(Ht,{children:Array.from({length:24},(j,N)=>N).map(j=>o.jsx(De,{value:j.toString().padStart(2,"0"),children:j.toString().padStart(2,"0")},j))})]})]}),o.jsxs("div",{children:[o.jsx(he,{className:"text-xs",children:"分钟"}),o.jsxs(Vt,{value:m,onValueChange:j=>{g(j),k(d,j,x,w)},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsx(Ht,{children:Array.from({length:60},(j,N)=>N).map(j=>o.jsx(De,{value:j.toString().padStart(2,"0"),children:j.toString().padStart(2,"0")},j))})]})]})]})]}),o.jsxs("div",{children:[o.jsx("h4",{className:"font-medium text-sm mb-3",children:"结束时间"}),o.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:gap-3",children:[o.jsxs("div",{children:[o.jsx(he,{className:"text-xs",children:"小时"}),o.jsxs(Vt,{value:x,onValueChange:j=>{y(j),k(d,m,j,w)},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsx(Ht,{children:Array.from({length:24},(j,N)=>N).map(j=>o.jsx(De,{value:j.toString().padStart(2,"0"),children:j.toString().padStart(2,"0")},j))})]})]}),o.jsxs("div",{children:[o.jsx(he,{className:"text-xs",children:"分钟"}),o.jsxs(Vt,{value:w,onValueChange:j=>{S(j),k(d,m,x,j)},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsx(Ht,{children:Array.from({length:60},(j,N)=>N).map(j=>o.jsx(De,{value:j.toString().padStart(2,"0"),children:j.toString().padStart(2,"0")},j))})]})]})]})]})]})})]})},a=({rule:l})=>{const c=`{ target = "${l.target}", time = "${l.time}", value = ${l.value.toFixed(1)} }`;return o.jsxs(Bo,{children:[o.jsx(Fo,{asChild:!0,children:o.jsxs(ue,{variant:"outline",size:"sm",children:[o.jsx(Ji,{className:"h-4 w-4 mr-1"}),"预览"]})}),o.jsx(Ka,{className:"w-96",children:o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),o.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:c}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})};return o.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-4",children:"聊天设置"}),o.jsxs("div",{className:"grid gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"talk_value",children:"聊天频率(基础值)"}),o.jsx(Pe,{id:"talk_value",type:"number",step:"0.1",min:"0",max:"1",value:t.talk_value,onChange:l=>e({...t,talk_value:parseFloat(l.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"越小越沉默,范围 0-1"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Ft,{id:"mentioned_bot_reply",checked:t.mentioned_bot_reply,onCheckedChange:l=>e({...t,mentioned_bot_reply:l})}),o.jsx(he,{htmlFor:"mentioned_bot_reply",className:"cursor-pointer",children:"启用提及必回复"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"max_context_size",children:"上下文长度"}),o.jsx(Pe,{id:"max_context_size",type:"number",min:"1",value:t.max_context_size,onChange:l=>e({...t,max_context_size:parseInt(l.target.value)})})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"planner_smooth",children:"规划器平滑"}),o.jsx(Pe,{id:"planner_smooth",type:"number",step:"1",min:"0",value:t.planner_smooth,onChange:l=>e({...t,planner_smooth:parseFloat(l.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"增大数值会减小 planner 负荷,推荐 1-5,0 为关闭"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Ft,{id:"enable_talk_value_rules",checked:t.enable_talk_value_rules,onCheckedChange:l=>e({...t,enable_talk_value_rules:l})}),o.jsx(he,{htmlFor:"enable_talk_value_rules",className:"cursor-pointer",children:"启用动态发言频率规则"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Ft,{id:"include_planner_reasoning",checked:t.include_planner_reasoning,onCheckedChange:l=>e({...t,include_planner_reasoning:l})}),o.jsx(he,{htmlFor:"include_planner_reasoning",className:"cursor-pointer",children:"将 planner 推理加入 replyer"})]})]})]}),t.enable_talk_value_rules&&o.jsxs("div",{className:"border-t pt-6",children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"text-base font-semibold",children:"动态发言频率规则"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"按时段或聊天流ID调整发言频率,优先匹配具体聊天,再匹配全局规则"})]}),o.jsxs(ue,{onClick:n,size:"sm",children:[o.jsx(Is,{className:"h-4 w-4 mr-1"}),"添加规则"]})]}),t.talk_value_rules&&t.talk_value_rules.length>0?o.jsx("div",{className:"space-y-4",children:t.talk_value_rules.map((l,c)=>o.jsxs("div",{className:"rounded-lg border p-4 bg-muted/50 space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("span",{className:"text-sm font-medium text-muted-foreground",children:["规则 #",c+1]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(a,{rule:l}),o.jsxs(Fn,{children:[o.jsx(is,{asChild:!0,children:o.jsx(ue,{variant:"ghost",size:"sm",children:o.jsx(Cn,{className:"h-4 w-4 text-destructive"})})}),o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认删除"}),o.jsxs(zn,{children:["确定要删除规则 #",c+1," 吗?此操作无法撤销。"]})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:()=>r(c),children:"删除"})]})]})]})]})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{className:"text-xs font-medium",children:"配置类型"}),o.jsxs(Vt,{value:l.target===""?"global":"specific",onValueChange:d=>{d==="global"?s(c,"target",""):s(c,"target","qq::group")},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"global",children:"全局配置"}),o.jsx(De,{value:"specific",children:"详细配置"})]})]})]}),l.target!==""&&(()=>{const d=l.target.split(":"),h=d[0]||"qq",m=d[1]||"",g=d[2]||"group";return o.jsxs("div",{className:"grid gap-4 p-4 rounded-lg bg-muted/50",children:[o.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{className:"text-xs font-medium",children:"平台"}),o.jsxs(Vt,{value:h,onValueChange:x=>{s(c,"target",`${x}:${m}:${g}`)},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"qq",children:"QQ"}),o.jsx(De,{value:"wx",children:"微信"})]})]})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{className:"text-xs font-medium",children:"群 ID"}),o.jsx(Pe,{value:m,onChange:x=>{s(c,"target",`${h}:${x.target.value}:${g}`)},placeholder:"输入群 ID",className:"font-mono text-sm"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{className:"text-xs font-medium",children:"类型"}),o.jsxs(Vt,{value:g,onValueChange:x=>{s(c,"target",`${h}:${m}:${x}`)},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"group",children:"群组(group)"}),o.jsx(De,{value:"private",children:"私聊(private)"})]})]})]})]}),o.jsxs("p",{className:"text-xs text-muted-foreground",children:["当前聊天流 ID:",l.target||"(未设置)"]})]})})(),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{className:"text-xs font-medium",children:"时间段 (Time)"}),o.jsx(i,{value:l.time,onChange:d=>s(c,"time",d)}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"支持跨夜区间,例如 23:00-02:00"})]}),o.jsxs("div",{className:"grid gap-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(he,{htmlFor:`rule-value-${c}`,className:"text-xs font-medium",children:"发言频率值 (Value)"}),o.jsx(Pe,{id:`rule-value-${c}`,type:"number",step:"0.01",min:"0.01",max:"1",value:l.value,onChange:d=>{const h=parseFloat(d.target.value);isNaN(h)||s(c,"value",Math.max(.01,Math.min(1,h)))},className:"w-20 h-8 text-xs"})]}),o.jsx(Nf,{value:[l.value],onValueChange:d=>s(c,"value",d[0]),min:.01,max:1,step:.01,className:"w-full"}),o.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[o.jsx("span",{children:"0.01 (极少发言)"}),o.jsx("span",{children:"0.5"}),o.jsx("span",{children:"1.0 (正常)"})]})]})]})]},c))}):o.jsx("div",{className:"text-center py-8 text-muted-foreground",children:o.jsx("p",{className:"text-sm",children:'暂无规则,点击"添加规则"按钮创建'})}),o.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:[o.jsx("h5",{className:"text-sm font-semibold text-blue-900 dark:text-blue-100 mb-2",children:"📝 规则说明"}),o.jsxs("ul",{className:"text-xs text-blue-800 dark:text-blue-200 space-y-1",children:[o.jsxs("li",{children:["• ",o.jsx("strong",{children:"Target 为空"}),":全局规则,对所有聊天生效"]}),o.jsxs("li",{children:["• ",o.jsx("strong",{children:"Target 指定"}),":仅对特定聊天流生效(格式:platform:id:type)"]}),o.jsxs("li",{children:["• ",o.jsx("strong",{children:"优先级"}),":先匹配具体聊天流规则,再匹配全局规则"]}),o.jsxs("li",{children:["• ",o.jsx("strong",{children:"时间支持跨夜"}),":例如 23:00-02:00 表示晚上11点到次日凌晨2点"]}),o.jsxs("li",{children:["• ",o.jsx("strong",{children:"数值范围"}),":建议 0-1,0 表示完全沉默,1 表示正常发言"]})]})]})]})]})}function F0e({member:t,groupIndex:e,memberIndex:n,availableChatIds:r,onUpdate:s,onRemove:i}){const a=r.includes(t)||t==="*",[l,c]=b.useState(!a);return o.jsxs("div",{className:"flex gap-2",children:[o.jsx("div",{className:"flex-1 flex gap-2",children:l?o.jsxs(o.Fragment,{children:[o.jsx(Pe,{value:t,onChange:d=>s(e,n,d.target.value),placeholder:'输入 "*" 或 "qq:123456:group"',className:"flex-1"}),r.length>0&&o.jsx(ue,{size:"sm",variant:"outline",onClick:()=>c(!1),title:"切换到下拉选择",children:"下拉"})]}):o.jsxs(o.Fragment,{children:[o.jsxs(Vt,{value:t,onValueChange:d=>s(e,n,d),children:[o.jsx($t,{className:"flex-1",children:o.jsx(Ut,{placeholder:"选择聊天流"})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"*",children:"* (全局共享)"}),r.map((d,h)=>o.jsx(De,{value:d,children:d},h))]})]}),o.jsx(ue,{size:"sm",variant:"outline",onClick:()=>c(!0),title:"切换到手动输入",children:"输入"})]})}),o.jsxs(Fn,{children:[o.jsx(is,{asChild:!0,children:o.jsx(ue,{size:"icon",variant:"outline",children:o.jsx(Cn,{className:"h-4 w-4"})})}),o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认删除"}),o.jsxs(zn,{children:['确定要删除组成员 "',t||"(空)",'" 吗?此操作无法撤销。']})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:()=>i(e,n),children:"删除"})]})]})]})]})}function q0e({config:t,onChange:e}){const n=()=>{e({...t,learning_list:[...t.learning_list,["","enable","enable","1.0"]]})},r=m=>{e({...t,learning_list:t.learning_list.filter((g,x)=>x!==m)})},s=(m,g,x)=>{const y=[...t.learning_list];y[m][g]=x,e({...t,learning_list:y})},i=({rule:m})=>{const g=`["${m[0]}", "${m[1]}", "${m[2]}", "${m[3]}"]`;return o.jsxs(Bo,{children:[o.jsx(Fo,{asChild:!0,children:o.jsxs(ue,{variant:"outline",size:"sm",children:[o.jsx(Ji,{className:"h-4 w-4 mr-1"}),"预览"]})}),o.jsx(Ka,{className:"w-96",children:o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),o.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:g}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})},a=()=>{e({...t,expression_groups:[...t.expression_groups,[]]})},l=m=>{e({...t,expression_groups:t.expression_groups.filter((g,x)=>x!==m)})},c=m=>{const g=[...t.expression_groups];g[m]=[...g[m],""],e({...t,expression_groups:g})},d=(m,g)=>{const x=[...t.expression_groups];x[m]=x[m].filter((y,w)=>w!==g),e({...t,expression_groups:x})},h=(m,g,x)=>{const y=[...t.expression_groups];y[m][g]=x,e({...t,expression_groups:y})};return o.jsxs("div",{className:"space-y-6",children:[o.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold",children:"表达学习配置"}),o.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"配置麦麦如何学习和使用表达方式"})]}),o.jsxs(ue,{onClick:n,size:"sm",variant:"outline",children:[o.jsx(Is,{className:"h-4 w-4 mr-1"}),"添加规则"]})]}),o.jsxs("div",{className:"space-y-4",children:[t.learning_list.map((m,g)=>{const x=t.learning_list.some((N,T)=>T!==g&&N[0]===""),y=m[0]==="",w=m[0].split(":"),S=w[0]||"qq",k=w[1]||"",j=w[2]||"group";return o.jsxs("div",{className:"rounded-lg border p-4 space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("span",{className:"text-sm font-medium",children:["规则 ",g+1," ",y&&"(全局配置)"]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(i,{rule:m}),o.jsxs(Fn,{children:[o.jsx(is,{asChild:!0,children:o.jsx(ue,{size:"sm",variant:"ghost",children:o.jsx(Cn,{className:"h-4 w-4"})})}),o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认删除"}),o.jsxs(zn,{children:["确定要删除学习规则 ",g+1," 吗?此操作无法撤销。"]})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:()=>r(g),children:"删除"})]})]})]})]})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{className:"text-xs font-medium",children:"配置类型"}),o.jsxs(Vt,{value:y?"global":"specific",onValueChange:N=>{N==="global"?s(g,0,""):s(g,0,"qq::group")},disabled:x&&!y,children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"global",children:"全局配置"}),o.jsx(De,{value:"specific",disabled:x&&!y,children:"详细配置"})]})]}),x&&!y&&o.jsx("p",{className:"text-xs text-amber-600",children:"已存在全局配置,无法创建新的全局配置"})]}),!y&&o.jsxs("div",{className:"grid gap-4 p-4 rounded-lg bg-muted/50",children:[o.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{className:"text-xs font-medium",children:"平台"}),o.jsxs(Vt,{value:S,onValueChange:N=>{s(g,0,`${N}:${k}:${j}`)},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"qq",children:"QQ"}),o.jsx(De,{value:"wx",children:"微信"})]})]})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{className:"text-xs font-medium",children:"群 ID"}),o.jsx(Pe,{value:k,onChange:N=>{s(g,0,`${S}:${N.target.value}:${j}`)},placeholder:"输入群 ID",className:"font-mono text-sm"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{className:"text-xs font-medium",children:"类型"}),o.jsxs(Vt,{value:j,onValueChange:N=>{s(g,0,`${S}:${k}:${N}`)},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"group",children:"群组(group)"}),o.jsx(De,{value:"private",children:"私聊(private)"})]})]})]})]}),o.jsxs("p",{className:"text-xs text-muted-foreground",children:["当前聊天流 ID:",m[0]||"(未设置)"]})]}),o.jsx("div",{className:"grid gap-2",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx(he,{className:"text-xs font-medium",children:"使用学到的表达"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"允许麦麦使用从聊天中学到的表达方式"})]}),o.jsx(Ft,{checked:m[1]==="enable",onCheckedChange:N=>s(g,1,N?"enable":"disable")})]})}),o.jsx("div",{className:"grid gap-2",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx(he,{className:"text-xs font-medium",children:"学习表达"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"允许麦麦从聊天中学习新的表达方式"})]}),o.jsx(Ft,{checked:m[2]==="enable",onCheckedChange:N=>s(g,2,N?"enable":"disable")})]})}),o.jsxs("div",{className:"grid gap-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(he,{className:"text-xs font-medium",children:"学习强度"}),o.jsx(Pe,{type:"number",step:"0.1",min:"0",max:"5",value:m[3],onChange:N=>{const T=parseFloat(N.target.value);isNaN(T)||s(g,3,Math.max(0,Math.min(5,T)).toFixed(1))},className:"w-20 h-8 text-xs"})]}),o.jsx(Nf,{value:[parseFloat(m[3])||1],onValueChange:N=>s(g,3,N[0].toFixed(1)),min:0,max:5,step:.1,className:"w-full"}),o.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[o.jsx("span",{children:"0 (不学习)"}),o.jsx("span",{children:"2.5"}),o.jsx("span",{children:"5.0 (快速学习)"})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"影响学习频率,最短学习间隔 = 300/学习强度(秒)"})]})]})]},g)}),t.learning_list.length===0&&o.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无学习规则,点击"添加规则"开始配置'})]})]})}),o.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold",children:"表达共享组配置"}),o.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"配置不同聊天流之间如何共享学到的表达方式"})]}),o.jsxs(ue,{onClick:a,size:"sm",variant:"outline",children:[o.jsx(Is,{className:"h-4 w-4 mr-1"}),"添加共享组"]})]}),o.jsxs("div",{className:"space-y-4",children:[t.expression_groups.map((m,g)=>{const x=t.learning_list.map(y=>y[0]).filter(y=>y!=="");return o.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("span",{className:"text-sm font-medium",children:["共享组 ",g+1,m.length===1&&m[0]==="*"&&"(全局共享)"]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(ue,{onClick:()=>c(g),size:"sm",variant:"outline",children:o.jsx(Is,{className:"h-4 w-4"})}),o.jsxs(Fn,{children:[o.jsx(is,{asChild:!0,children:o.jsx(ue,{size:"sm",variant:"ghost",children:o.jsx(Cn,{className:"h-4 w-4"})})}),o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认删除"}),o.jsxs(zn,{children:["确定要删除共享组 ",g+1," 吗?此操作无法撤销。"]})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:()=>l(g),children:"删除"})]})]})]})]})]}),o.jsx("div",{className:"space-y-2",children:m.map((y,w)=>o.jsx(F0e,{member:y,groupIndex:g,memberIndex:w,availableChatIds:x,onUpdate:h,onRemove:d},`${g}-${w}`))}),o.jsx("p",{className:"text-xs text-muted-foreground",children:'提示:可以从下拉框选择已配置的聊天流,或手动输入。输入 "*" 启用全局共享'})]},g)}),t.expression_groups.length===0&&o.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无共享组,点击"添加共享组"开始配置'})]})]})})]})}function $0e({emojiConfig:t,memoryConfig:e,toolConfig:n,onEmojiChange:r,onMemoryChange:s,onToolChange:i}){return o.jsxs("div",{className:"space-y-6",children:[o.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-4",children:"工具设置"}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Ft,{id:"enable_tool",checked:n.enable_tool,onCheckedChange:a=>i({...n,enable_tool:a})}),o.jsx(he,{htmlFor:"enable_tool",className:"cursor-pointer",children:"启用工具系统"})]}),o.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"允许麦麦使用各种工具来增强功能"})]})}),o.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-4",children:"记忆设置"}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"max_agent_iterations",children:"记忆思考深度"}),o.jsx(Pe,{id:"max_agent_iterations",type:"number",min:"1",value:e.max_agent_iterations,onChange:a=>s({...e,max_agent_iterations:parseInt(a.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"最低为 1(不深入思考)"})]})]})}),o.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-4",children:"表情包设置"}),o.jsxs("div",{className:"grid gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"emoji_chance",children:"表情包激活概率"}),o.jsx(Pe,{id:"emoji_chance",type:"number",step:"0.1",min:"0",max:"1",value:t.emoji_chance,onChange:a=>r({...t,emoji_chance:parseFloat(a.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"范围 0-1,越大越容易发送表情包"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"max_reg_num",children:"最大注册数量"}),o.jsx(Pe,{id:"max_reg_num",type:"number",min:"1",value:t.max_reg_num,onChange:a=>r({...t,max_reg_num:parseInt(a.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"麦麦最多可以注册的表情包数量"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"check_interval",children:"检查间隔(分钟)"}),o.jsx(Pe,{id:"check_interval",type:"number",min:"1",value:t.check_interval,onChange:a=>r({...t,check_interval:parseInt(a.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"检查表情包(注册、破损、删除)的时间间隔"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Ft,{id:"do_replace",checked:t.do_replace,onCheckedChange:a=>r({...t,do_replace:a})}),o.jsx(he,{htmlFor:"do_replace",className:"cursor-pointer",children:"达到最大数量时替换表情包"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Ft,{id:"steal_emoji",checked:t.steal_emoji,onCheckedChange:a=>r({...t,steal_emoji:a})}),o.jsx(he,{htmlFor:"steal_emoji",className:"cursor-pointer",children:"偷取表情包"})]}),o.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:"允许麦麦将看到的表情包据为己有"}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Ft,{id:"content_filtration",checked:t.content_filtration,onCheckedChange:a=>r({...t,content_filtration:a})}),o.jsx(he,{htmlFor:"content_filtration",className:"cursor-pointer",children:"启用表情包过滤"})]}),t.content_filtration&&o.jsxs("div",{className:"grid gap-2 pl-6 border-l-2 border-primary/20",children:[o.jsx(he,{htmlFor:"filtration_prompt",children:"过滤要求"}),o.jsx(Pe,{id:"filtration_prompt",value:t.filtration_prompt,onChange:a=>r({...t,filtration_prompt:a.target.value}),placeholder:"符合公序良俗"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"只有符合此要求的表情包才会被保存"})]})]})]})})]})}function H0e({keywordReactionConfig:t,responsePostProcessConfig:e,chineseTypoConfig:n,responseSplitterConfig:r,onKeywordReactionChange:s,onResponsePostProcessChange:i,onChineseTypoChange:a,onResponseSplitterChange:l}){const c=()=>{s({...t,regex_rules:[...t.regex_rules,{regex:[""],reaction:""}]})},d=T=>{s({...t,regex_rules:t.regex_rules.filter((E,_)=>_!==T)})},h=(T,E,_)=>{const A=[...t.regex_rules];E==="regex"&&typeof _=="string"?A[T]={...A[T],regex:[_]}:E==="reaction"&&typeof _=="string"&&(A[T]={...A[T],reaction:_}),s({...t,regex_rules:A})},m=({regex:T,reaction:E,onRegexChange:_,onReactionChange:A})=>{const[D,q]=b.useState(!1),[B,H]=b.useState(""),[W,ee]=b.useState(null),[I,V]=b.useState(""),[L,$]=b.useState({}),[K,Y]=b.useState(""),R=b.useRef(null),[ie,X]=b.useState("build"),z=G=>G.replace(/\(\?P<([^>]+)>/g,"(?<$1>"),U=(G,se=0)=>{const re=R.current;if(!re)return;const ae=re.selectionStart||0,_e=re.selectionEnd||0,Be=T.substring(0,ae)+G+T.substring(_e);_(Be),setTimeout(()=>{const Ye=ae+G.length+se;re.setSelectionRange(Ye,Ye),re.focus()},0)};b.useEffect(()=>{if(!T||!B){ee(null),$({}),Y(E),V("");return}try{const G=z(T),se=new RegExp(G,"g"),re=B.match(se);ee(re),V("");const _e=new RegExp(G).exec(B);if(_e&&_e.groups){$(_e.groups);let Be=E;Object.entries(_e.groups).forEach(([Ye,Je])=>{Be=Be.replace(new RegExp(`\\[${Ye}\\]`,"g"),Je||"")}),Y(Be)}else $({}),Y(E)}catch(G){V(G.message),ee(null),$({}),Y(E)}},[T,B,E]);const te=()=>{if(!B||!W||W.length===0)return o.jsx("span",{className:"text-muted-foreground",children:B||"请输入测试文本"});try{const G=z(T),se=new RegExp(G,"g");let re=0;const ae=[];let _e;for(;(_e=se.exec(B))!==null;)_e.index>re&&ae.push(o.jsx("span",{children:B.substring(re,_e.index)},`text-${re}`)),ae.push(o.jsx("span",{className:"bg-yellow-200 dark:bg-yellow-900 font-semibold",children:_e[0]},`match-${_e.index}`)),re=_e.index+_e[0].length;return re<B.length&&ae.push(o.jsx("span",{children:B.substring(re)},`text-${re}`)),o.jsx(o.Fragment,{children:ae})}catch{return o.jsx("span",{children:B})}},ne=[{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 o.jsxs(Er,{open:D,onOpenChange:q,children:[o.jsx(Of,{asChild:!0,children:o.jsxs(ue,{variant:"outline",size:"sm",children:[o.jsx(Fv,{className:"h-4 w-4 mr-1"}),"正则编辑器"]})}),o.jsxs(wr,{className:"max-w-[95vw] sm:max-w-[900px] max-h-[90vh]",children:[o.jsxs(Sr,{children:[o.jsx(kr,{children:"正则表达式编辑器"}),o.jsx(Xr,{className:"text-sm",children:"使用可视化工具构建正则表达式,并实时测试效果"})]}),o.jsx(pn,{className:"max-h-[calc(90vh-120px)]",children:o.jsxs(Yi,{value:ie,onValueChange:G=>X(G),className:"w-full",children:[o.jsxs(ji,{className:"grid w-full grid-cols-2",children:[o.jsx(Bt,{value:"build",children:"🔧 构建器"}),o.jsx(Bt,{value:"test",children:"🧪 测试器"})]}),o.jsxs(ln,{value:"build",className:"space-y-4 mt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{className:"text-sm font-medium",children:"正则表达式"}),o.jsx(Pe,{ref:R,value:T,onChange:G=>_(G.target.value),className:"font-mono text-sm",placeholder:"点击下方按钮构建正则表达式..."})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{className:"text-sm font-medium",children:"Reaction 内容"}),o.jsx(Nr,{value:E,onChange:G=>A(G.target.value),placeholder:"使用 [捕获组名] 引用捕获的内容...",rows:3,className:"text-sm"})]}),o.jsxs("div",{className:"space-y-4 border-t pt-4",children:[ne.map(G=>o.jsxs("div",{className:"space-y-2",children:[o.jsx("h5",{className:"text-xs font-semibold text-primary",children:G.category}),o.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:G.items.map(se=>o.jsx(ue,{variant:"outline",size:"sm",className:"justify-start h-auto py-2 px-3",onClick:()=>U(se.pattern,se.moveCursor||0),children:o.jsxs("div",{className:"flex flex-col items-start w-full",children:[o.jsxs("div",{className:"flex items-center gap-2 w-full",children:[o.jsx("span",{className:"text-xs font-medium",children:se.label}),o.jsx("code",{className:"ml-auto text-xs bg-muted px-1.5 py-0.5 rounded font-mono",children:se.pattern})]}),o.jsx("span",{className:"text-xs text-muted-foreground mt-0.5",children:se.desc})]})},se.label))})]},G.category)),o.jsxs("div",{className:"space-y-2 border-t pt-4",children:[o.jsx("h5",{className:"text-xs font-semibold text-primary",children:"完整示例模板"}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(ue,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>_("^(?P<n>\\S{1,20})是这样的$"),children:o.jsxs("div",{className:"flex flex-col items-start w-full",children:[o.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}",")是这样的$"]}),o.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"匹配「某事物是这样的」并捕获事物名称"})]})}),o.jsx(ue,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>_("(?:[^,。.\\s]+,\\s*)?我(?:也)?[没沒]要求你\\s*(?P<action>.+?)[.。,,]?$"),children:o.jsxs("div",{className:"flex flex-col items-start w-full",children:[o.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>.+?)[.。,,]?$"}),o.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"匹配「我没要求你做某事」并捕获具体行为"})]})}),o.jsx(ue,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>_("(?P<subject>.+?)(?:是|为什么|怎么)"),children:o.jsxs("div",{className:"flex flex-col items-start w-full",children:[o.jsx("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:"(?P<subject>.+?)(?:是|为什么|怎么)"}),o.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"捕获问题主题词"})]})})]})]})]}),o.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:[o.jsx("p",{className:"text-xs font-medium text-blue-900 dark:text-blue-100",children:"💡 使用提示"}),o.jsxs("ul",{className:"text-xs text-blue-700 dark:text-blue-300 space-y-1 list-disc list-inside",children:[o.jsx("li",{children:"点击输入框设置光标位置,然后点击按钮插入模式"}),o.jsxs("li",{children:["命名捕获组格式:",o.jsx("code",{className:"bg-blue-100 dark:bg-blue-900 px-1 rounded",children:"(?P<名称>模式)"})]}),o.jsxs("li",{children:["在 reaction 中使用 ",o.jsx("code",{className:"bg-blue-100 dark:bg-blue-900 px-1 rounded",children:"[名称]"})," 引用捕获的内容"]}),o.jsx("li",{children:"切换到测试器标签页验证正则表达式效果"})]})]})]}),o.jsxs(ln,{value:"test",className:"space-y-4 mt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{className:"text-sm font-medium",children:"当前正则表达式"}),o.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:T||"(未设置)"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"test-text",className:"text-sm font-medium",children:"测试文本"}),o.jsx(Nr,{id:"test-text",value:B,onChange:G=>H(G.target.value),placeholder:`在此输入要测试的文本...
|
||
例如:打游戏是这样的`,className:"min-h-[100px] text-sm"})]}),I&&o.jsxs("div",{className:"rounded-md bg-destructive/10 border border-destructive/20 p-3",children:[o.jsx("p",{className:"text-sm text-destructive font-medium",children:"正则表达式错误"}),o.jsx("p",{className:"text-xs text-destructive/80 mt-1",children:I})]}),!I&&B&&o.jsxs("div",{className:"space-y-3",children:[o.jsx("div",{className:"flex items-center gap-2",children:W&&W.length>0?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-2 w-2 rounded-full bg-green-500"}),o.jsxs("span",{className:"text-sm font-medium text-green-600 dark:text-green-400",children:["匹配成功 (",W.length," 处)"]})]}):o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-2 w-2 rounded-full bg-gray-400"}),o.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"无匹配"})]})}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{className:"text-sm font-medium",children:"匹配高亮"}),o.jsx(pn,{className:"h-40 rounded-md bg-muted p-3",children:o.jsx("div",{className:"text-sm break-words",children:te()})})]}),Object.keys(L).length>0&&o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{className:"text-sm font-medium",children:"命名捕获组"}),o.jsx(pn,{className:"h-32 rounded-md border p-3",children:o.jsx("div",{className:"space-y-2",children:Object.entries(L).map(([G,se])=>o.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[o.jsxs("span",{className:"font-mono font-semibold text-primary min-w-[80px]",children:["[",G,"]"]}),o.jsx("span",{className:"text-muted-foreground",children:"="}),o.jsx("span",{className:"font-mono bg-muted px-2 py-0.5 rounded",children:se})]},G))})})]}),Object.keys(L).length>0&&E&&o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{className:"text-sm font-medium",children:"Reaction 替换预览"}),o.jsx(pn,{className:"h-48 rounded-md bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-3",children:o.jsx("div",{className:"text-sm break-words",children:K})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"reaction 中的 [name] 已被替换为对应的捕获组值"})]})]}),o.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:[o.jsx("p",{className:"text-xs font-medium text-blue-900 dark:text-blue-100",children:"💡 测试说明"}),o.jsxs("ul",{className:"text-xs text-blue-700 dark:text-blue-300 space-y-1 list-disc list-inside",children:[o.jsx("li",{children:"匹配的文本会以黄色背景高亮显示"}),o.jsx("li",{children:"命名捕获组的值会显示在下方列表中"}),o.jsx("li",{children:"Reaction 替换预览显示最终生成的反应内容"}),o.jsx("li",{children:"如需修改正则,切换回构建器标签页"})]})]})]})]})})]})]})},g=()=>{s({...t,keyword_rules:[...t.keyword_rules,{keywords:[],reaction:""}]})},x=T=>{s({...t,keyword_rules:t.keyword_rules.filter((E,_)=>_!==T)})},y=(T,E,_)=>{const A=[...t.keyword_rules];typeof _=="string"&&(A[T]={...A[T],reaction:_}),s({...t,keyword_rules:A})},w=T=>{const E=[...t.keyword_rules];E[T]={...E[T],keywords:[...E[T].keywords||[],""]},s({...t,keyword_rules:E})},S=(T,E)=>{const _=[...t.keyword_rules];_[T]={..._[T],keywords:(_[T].keywords||[]).filter((A,D)=>D!==E)},s({...t,keyword_rules:_})},k=(T,E,_)=>{const A=[...t.keyword_rules],D=[...A[T].keywords||[]];D[E]=_,A[T]={...A[T],keywords:D},s({...t,keyword_rules:A})},j=({rule:T})=>{const E=`{ regex = [${(T.regex||[]).map(_=>`"${_}"`).join(", ")}], reaction = "${T.reaction}" }`;return o.jsxs(Bo,{children:[o.jsx(Fo,{asChild:!0,children:o.jsxs(ue,{variant:"outline",size:"sm",children:[o.jsx(Ji,{className:"h-4 w-4 mr-1"}),"预览"]})}),o.jsx(Ka,{className:"w-[95vw] sm:w-[500px]",children:o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),o.jsx(pn,{className:"h-60 rounded-md bg-muted p-3",children:o.jsx("pre",{className:"font-mono text-xs break-all",children:E})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})},N=({rule:T})=>{const E=`[[keyword_reaction.keyword_rules]]
|
||
keywords = [${(T.keywords||[]).map(_=>`"${_}"`).join(", ")}]
|
||
reaction = "${T.reaction}"`;return o.jsxs(Bo,{children:[o.jsx(Fo,{asChild:!0,children:o.jsxs(ue,{variant:"outline",size:"sm",children:[o.jsx(Ji,{className:"h-4 w-4 mr-1"}),"预览"]})}),o.jsx(Ka,{className:"w-[95vw] sm:w-[500px]",children:o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),o.jsx(pn,{className:"h-60 rounded-md bg-muted p-3",children:o.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap break-all",children:E})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})};return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-2",children:"关键词反应配置"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"配置触发特定反应的关键词和正则表达式规则"})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"text-base font-semibold",children:"正则表达式规则"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"使用正则表达式匹配消息内容"})]}),o.jsxs(ue,{onClick:c,size:"sm",variant:"outline",children:[o.jsx(Is,{className:"h-4 w-4 mr-1"}),"添加正则规则"]})]}),o.jsxs("div",{className:"space-y-3",children:[t.regex_rules.map((T,E)=>o.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("span",{className:"text-sm font-medium",children:["正则规则 ",E+1]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(m,{regex:T.regex&&T.regex[0]||"",reaction:T.reaction,onRegexChange:_=>h(E,"regex",_),onReactionChange:_=>h(E,"reaction",_)}),o.jsx(j,{rule:T}),o.jsxs(Fn,{children:[o.jsx(is,{asChild:!0,children:o.jsx(ue,{size:"sm",variant:"ghost",children:o.jsx(Cn,{className:"h-4 w-4"})})}),o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认删除"}),o.jsxs(zn,{children:["确定要删除正则规则 ",E+1," 吗?此操作无法撤销。"]})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:()=>d(E),children:"删除"})]})]})]})]})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{className:"text-xs font-medium",children:"正则表达式(Python 语法)"}),o.jsx(Pe,{value:T.regex&&T.regex[0]||"",onChange:_=>h(E,"regex",_.target.value),placeholder:"例如:^(?P<n>\\\\S{1,20})是这样的$ (点击正则编辑器按钮可视化构建)",className:"font-mono text-sm"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:'支持命名捕获组 (?P<name>pattern),可在 reaction 中使用 [name] 引用。点击"正则编辑器"可视化构建和测试!'})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{className:"text-xs font-medium",children:"反应内容"}),o.jsx(Nr,{value:T.reaction,onChange:_=>h(E,"reaction",_.target.value),placeholder:`触发后麦麦的反应...
|
||
可以使用 [捕获组名] 来引用正则表达式中的内容`,rows:3,className:"text-sm"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"使用 [捕获组名] 引用正则表达式中的命名捕获组,例如 [n] 会被替换为捕获的内容"})]})]})]},E)),t.regex_rules.length===0&&o.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无正则规则,点击"添加正则规则"开始配置'})]})]}),o.jsxs("div",{className:"space-y-4 border-t pt-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"text-base font-semibold",children:"关键词规则"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"使用关键词列表匹配消息内容"})]}),o.jsxs(ue,{onClick:g,size:"sm",variant:"outline",children:[o.jsx(Is,{className:"h-4 w-4 mr-1"}),"添加关键词规则"]})]}),o.jsxs("div",{className:"space-y-3",children:[t.keyword_rules.map((T,E)=>o.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("span",{className:"text-sm font-medium",children:["关键词规则 ",E+1]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(N,{rule:T}),o.jsxs(Fn,{children:[o.jsx(is,{asChild:!0,children:o.jsx(ue,{size:"sm",variant:"ghost",children:o.jsx(Cn,{className:"h-4 w-4"})})}),o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认删除"}),o.jsxs(zn,{children:["确定要删除关键词规则 ",E+1," 吗?此操作无法撤销。"]})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:()=>x(E),children:"删除"})]})]})]})]})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(he,{className:"text-xs font-medium",children:"关键词列表"}),o.jsxs(ue,{onClick:()=>w(E),size:"sm",variant:"ghost",children:[o.jsx(Is,{className:"h-3 w-3 mr-1"}),"添加关键词"]})]}),o.jsxs("div",{className:"space-y-2",children:[(T.keywords||[]).map((_,A)=>o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Pe,{value:_,onChange:D=>k(E,A,D.target.value),placeholder:"关键词",className:"flex-1"}),o.jsx(ue,{onClick:()=>S(E,A),size:"sm",variant:"ghost",children:o.jsx(Cn,{className:"h-4 w-4"})})]},A)),(!T.keywords||T.keywords.length===0)&&o.jsx("p",{className:"text-xs text-muted-foreground text-center py-2",children:'暂无关键词,点击"添加关键词"开始配置'})]})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{className:"text-xs font-medium",children:"反应内容"}),o.jsx(Nr,{value:T.reaction,onChange:_=>y(E,"reaction",_.target.value),placeholder:"触发后麦麦的反应...",rows:3,className:"text-sm"})]})]})]},E)),t.keyword_rules.length===0&&o.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无关键词规则,点击"添加关键词规则"开始配置'})]})]})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-4",children:"回复后处理配置"}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Ft,{id:"enable_response_post_process",checked:e.enable_response_post_process,onCheckedChange:T=>i({...e,enable_response_post_process:T})}),o.jsx(he,{htmlFor:"enable_response_post_process",className:"cursor-pointer",children:"启用回复后处理"})]}),o.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"包括错别字生成器和回复分割器"})]}),e.enable_response_post_process&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"border-t pt-6 space-y-4",children:o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center space-x-2 mb-4",children:[o.jsx(Ft,{id:"enable_chinese_typo",checked:n.enable,onCheckedChange:T=>a({...n,enable:T})}),o.jsx(he,{htmlFor:"enable_chinese_typo",className:"cursor-pointer font-semibold",children:"中文错别字生成器"})]}),o.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"为回复添加随机错别字,让麦麦的回复更自然"}),n.enable&&o.jsxs("div",{className:"grid gap-4 pl-6 border-l-2 border-primary/20",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"error_rate",className:"text-xs font-medium",children:"单字替换概率"}),o.jsx(Pe,{id:"error_rate",type:"number",step:"0.001",min:"0",max:"1",value:n.error_rate,onChange:T=>a({...n,error_rate:parseFloat(T.target.value)})})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"min_freq",className:"text-xs font-medium",children:"最小字频阈值"}),o.jsx(Pe,{id:"min_freq",type:"number",min:"0",value:n.min_freq,onChange:T=>a({...n,min_freq:parseInt(T.target.value)})})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"tone_error_rate",className:"text-xs font-medium",children:"声调错误概率"}),o.jsx(Pe,{id:"tone_error_rate",type:"number",step:"0.01",min:"0",max:"1",value:n.tone_error_rate,onChange:T=>a({...n,tone_error_rate:parseFloat(T.target.value)})})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"word_replace_rate",className:"text-xs font-medium",children:"整词替换概率"}),o.jsx(Pe,{id:"word_replace_rate",type:"number",step:"0.001",min:"0",max:"1",value:n.word_replace_rate,onChange:T=>a({...n,word_replace_rate:parseFloat(T.target.value)})})]})]})]})}),o.jsx("div",{className:"border-t pt-6 space-y-4",children:o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center space-x-2 mb-4",children:[o.jsx(Ft,{id:"enable_response_splitter",checked:r.enable,onCheckedChange:T=>l({...r,enable:T})}),o.jsx(he,{htmlFor:"enable_response_splitter",className:"cursor-pointer font-semibold",children:"回复分割器"})]}),o.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"控制回复的长度和句子数量"}),r.enable&&o.jsxs("div",{className:"grid gap-4 pl-6 border-l-2 border-primary/20",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"max_length",className:"text-xs font-medium",children:"最大长度"}),o.jsx(Pe,{id:"max_length",type:"number",min:"1",value:r.max_length,onChange:T=>l({...r,max_length:parseInt(T.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"回复允许的最大字符数"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"max_sentence_num",className:"text-xs font-medium",children:"最大句子数"}),o.jsx(Pe,{id:"max_sentence_num",type:"number",min:"1",value:r.max_sentence_num,onChange:T=>l({...r,max_sentence_num:parseInt(T.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"回复允许的最大句子数量"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Ft,{id:"enable_kaomoji_protection",checked:r.enable_kaomoji_protection,onCheckedChange:T=>l({...r,enable_kaomoji_protection:T})}),o.jsx(he,{htmlFor:"enable_kaomoji_protection",className:"cursor-pointer",children:"启用颜文字保护"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Ft,{id:"enable_overflow_return_all",checked:r.enable_overflow_return_all,onCheckedChange:T=>l({...r,enable_overflow_return_all:T})}),o.jsx(he,{htmlFor:"enable_overflow_return_all",className:"cursor-pointer",children:"超出时一次性返回全部"})]}),o.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:"当句子数量超出限制时,合并后一次性返回所有内容"})]})]})})]})]})]})}function Q0e({config:t,onChange:e}){return o.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"情绪设置"}),o.jsxs("div",{className:"grid gap-4",children:[o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Ft,{checked:t.enable_mood,onCheckedChange:n=>e({...t,enable_mood:n})}),o.jsx(he,{className:"cursor-pointer",children:"启用情绪系统"})]}),t.enable_mood&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"情绪更新阈值"}),o.jsx(Pe,{type:"number",min:"1",value:t.mood_update_threshold,onChange:n=>e({...t,mood_update_threshold:parseInt(n.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"越高,更新越慢"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"情感特征"}),o.jsx(Nr,{value:t.emotion_style,onChange:n=>e({...t,emotion_style:n.target.value}),placeholder:"影响情绪的变化情况",rows:2})]})]})]})]})}function V0e({config:t,onChange:e}){return o.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"语音设置"}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Ft,{checked:t.enable_asr,onCheckedChange:n=>e({...t,enable_asr:n})}),o.jsx(he,{className:"cursor-pointer",children:"启用语音识别"})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"启用后麦麦可以识别语音消息,需要配置语音识别模型"})]})}function U0e({config:t,onChange:e}){return o.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"LPMM 知识库设置"}),o.jsxs("div",{className:"grid gap-4",children:[o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Ft,{checked:t.enable,onCheckedChange:n=>e({...t,enable:n})}),o.jsx(he,{className:"cursor-pointer",children:"启用 LPMM 知识库"})]}),t.enable&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"LPMM 模式"}),o.jsxs(Vt,{value:t.lpmm_mode,onValueChange:n=>e({...t,lpmm_mode:n}),children:[o.jsx($t,{children:o.jsx(Ut,{placeholder:"选择 LPMM 模式"})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"classic",children:"经典模式"}),o.jsx(De,{value:"agent",children:"Agent 模式"})]})]})]}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"同义词搜索 TopK"}),o.jsx(Pe,{type:"number",min:"1",value:t.rag_synonym_search_top_k,onChange:n=>e({...t,rag_synonym_search_top_k:parseInt(n.target.value)})})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"同义词阈值"}),o.jsx(Pe,{type:"number",step:"0.1",min:"0",max:"1",value:t.rag_synonym_threshold,onChange:n=>e({...t,rag_synonym_threshold:parseFloat(n.target.value)})})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"实体提取线程数"}),o.jsx(Pe,{type:"number",min:"1",value:t.info_extraction_workers,onChange:n=>e({...t,info_extraction_workers:parseInt(n.target.value)})})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"嵌入向量维度"}),o.jsx(Pe,{type:"number",min:"1",value:t.embedding_dimension,onChange:n=>e({...t,embedding_dimension:parseInt(n.target.value)})})]})]})]})]})]})}function W0e({config:t,onChange:e}){const[n,r]=b.useState(""),[s,i]=b.useState("WARNING"),a=()=>{n&&!t.suppress_libraries.includes(n)&&(e({...t,suppress_libraries:[...t.suppress_libraries,n]}),r(""))},l=x=>{e({...t,suppress_libraries:t.suppress_libraries.filter(y=>y!==x)})},c=()=>{n&&!t.library_log_levels[n]&&(e({...t,library_log_levels:{...t.library_log_levels,[n]:s}}),r(""),i("WARNING"))},d=x=>{const y={...t.library_log_levels};delete y[x],e({...t,library_log_levels:y})},h=["DEBUG","INFO","WARNING","ERROR","CRITICAL"],m=["FULL","compact","lite"],g=["none","title","full"];return o.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-6",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-4",children:"日志配置"}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"日期格式"}),o.jsx(Pe,{value:t.date_style,onChange:x=>e({...t,date_style:x.target.value}),placeholder:"例如: m-d H:i:s"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"m=月, d=日, H=时, i=分, s=秒"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"日志级别样式"}),o.jsxs(Vt,{value:t.log_level_style,onValueChange:x=>e({...t,log_level_style:x}),children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsx(Ht,{children:m.map(x=>o.jsx(De,{value:x,children:x},x))})]})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"日志文本颜色"}),o.jsxs(Vt,{value:t.color_text,onValueChange:x=>e({...t,color_text:x}),children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsx(Ht,{children:g.map(x=>o.jsx(De,{value:x,children:x},x))})]})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"全局日志级别"}),o.jsxs(Vt,{value:t.log_level,onValueChange:x=>e({...t,log_level:x}),children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsx(Ht,{children:h.map(x=>o.jsx(De,{value:x,children:x},x))})]})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"控制台日志级别"}),o.jsxs(Vt,{value:t.console_log_level,onValueChange:x=>e({...t,console_log_level:x}),children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsx(Ht,{children:h.map(x=>o.jsx(De,{value:x,children:x},x))})]})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"文件日志级别"}),o.jsxs(Vt,{value:t.file_log_level,onValueChange:x=>e({...t,file_log_level:x}),children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsx(Ht,{children:h.map(x=>o.jsx(De,{value:x,children:x},x))})]})]})]})]}),o.jsxs("div",{children:[o.jsx(he,{className:"mb-2 block",children:"完全屏蔽的库"}),o.jsxs("div",{className:"flex gap-2 mb-2",children:[o.jsx(Pe,{value:n,onChange:x=>r(x.target.value),placeholder:"输入库名",className:"flex-1",onKeyDown:x=>{x.key==="Enter"&&(x.preventDefault(),a())}}),o.jsx(ue,{onClick:a,size:"sm",className:"flex-shrink-0",children:o.jsx(Is,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),o.jsx("div",{className:"flex flex-wrap gap-2",children:t.suppress_libraries.map(x=>o.jsxs("div",{className:"flex items-center gap-1 bg-secondary px-3 py-1 rounded-md",children:[o.jsx("span",{className:"text-sm",children:x}),o.jsx(ue,{variant:"ghost",size:"sm",className:"h-5 w-5 p-0",onClick:()=>l(x),children:o.jsx(Cn,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]},x))})]}),o.jsxs("div",{children:[o.jsx(he,{className:"mb-2 block",children:"特定库的日志级别"}),o.jsxs("div",{className:"flex gap-2 mb-2",children:[o.jsx(Pe,{value:n,onChange:x=>r(x.target.value),placeholder:"输入库名",className:"flex-1"}),o.jsxs(Vt,{value:s,onValueChange:i,children:[o.jsx($t,{className:"w-32",children:o.jsx(Ut,{})}),o.jsx(Ht,{children:h.map(x=>o.jsx(De,{value:x,children:x},x))})]}),o.jsx(ue,{onClick:c,size:"sm",children:o.jsx(Is,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),o.jsx("div",{className:"space-y-2",children:Object.entries(t.library_log_levels).map(([x,y])=>o.jsxs("div",{className:"flex items-center justify-between bg-secondary px-3 py-2 rounded-md",children:[o.jsx("span",{className:"text-sm font-medium",children:x}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-sm text-muted-foreground",children:y}),o.jsx(ue,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>d(x),children:o.jsx(Cn,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]})]},x))})]})]})}function G0e({config:t,onChange:e}){return o.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"调试配置"}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(he,{children:"显示 Prompt"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"是否在日志中显示提示词"})]}),o.jsx(Ft,{checked:t.show_prompt,onCheckedChange:n=>e({...t,show_prompt:n})})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(he,{children:"显示回复器 Prompt"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示回复器的提示词"})]}),o.jsx(Ft,{checked:t.show_replyer_prompt,onCheckedChange:n=>e({...t,show_replyer_prompt:n})})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(he,{children:"显示回复器推理"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示回复器的推理过程"})]}),o.jsx(Ft,{checked:t.show_replyer_reasoning,onCheckedChange:n=>e({...t,show_replyer_reasoning:n})})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(he,{children:"显示 Jargon Prompt"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示术语相关的提示词"})]}),o.jsx(Ft,{checked:t.show_jargon_prompt,onCheckedChange:n=>e({...t,show_jargon_prompt:n})})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(he,{children:"显示记忆检索 Prompt"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示记忆检索相关的提示词"})]}),o.jsx(Ft,{checked:t.show_memory_prompt,onCheckedChange:n=>e({...t,show_memory_prompt:n})})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(he,{children:"显示 Planner Prompt"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示 Planner 的提示词和原始返回结果"})]}),o.jsx(Ft,{checked:t.show_planner_prompt,onCheckedChange:n=>e({...t,show_planner_prompt:n})})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(he,{children:"显示 LPMM 相关文段"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示 LPMM 知识库找到的相关文段日志"})]}),o.jsx(Ft,{checked:t.show_lpmm_paragraph,onCheckedChange:n=>e({...t,show_lpmm_paragraph:n})})]})]})]})}function X0e({config:t,onChange:e}){const[n,r]=b.useState(""),s=()=>{n&&!t.auth_token.includes(n)&&(e({...t,auth_token:[...t.auth_token,n]}),r(""))},i=a=>{e({...t,auth_token:t.auth_token.filter((l,c)=>c!==a)})};return o.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-4",children:"MaimMessage 服务配置"}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(he,{children:"启用自定义服务器"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"是否使用自定义的 MaimMessage 服务器"})]}),o.jsx(Ft,{checked:t.use_custom,onCheckedChange:a=>e({...t,use_custom:a})})]}),t.use_custom&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"主机地址"}),o.jsx(Pe,{value:t.host,onChange:a=>e({...t,host:a.target.value}),placeholder:"127.0.0.1"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"端口号"}),o.jsx(Pe,{type:"number",value:t.port,onChange:a=>e({...t,port:parseInt(a.target.value)}),placeholder:"8090"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"连接模式"}),o.jsxs(Vt,{value:t.mode,onValueChange:a=>e({...t,mode:a}),children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"ws",children:"WebSocket (ws)"}),o.jsx(De,{value:"tcp",children:"TCP"})]})]})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Ft,{checked:t.use_wss,onCheckedChange:a=>e({...t,use_wss:a}),disabled:t.mode!=="ws"}),o.jsx(he,{children:"使用 WSS 安全连接"})]})]}),t.use_wss&&t.mode==="ws"&&o.jsxs("div",{className:"grid gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"SSL 证书文件路径"}),o.jsx(Pe,{value:t.cert_file,onChange:a=>e({...t,cert_file:a.target.value}),placeholder:"cert.pem"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"SSL 密钥文件路径"}),o.jsx(Pe,{value:t.key_file,onChange:a=>e({...t,key_file:a.target.value}),placeholder:"key.pem"})]})]})]})]})]}),o.jsxs("div",{children:[o.jsx(he,{className:"mb-2 block",children:"认证令牌"}),o.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"用于 API 验证,为空则不启用验证"}),o.jsxs("div",{className:"flex gap-2 mb-2",children:[o.jsx(Pe,{value:n,onChange:a=>r(a.target.value),placeholder:"输入认证令牌",onKeyDown:a=>{a.key==="Enter"&&(a.preventDefault(),s())}}),o.jsx(ue,{onClick:s,size:"sm",children:o.jsx(Is,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),o.jsx("div",{className:"space-y-2",children:t.auth_token.map((a,l)=>o.jsxs("div",{className:"flex items-center justify-between bg-secondary px-3 py-2 rounded-md",children:[o.jsx("span",{className:"text-sm font-mono",children:a}),o.jsx(ue,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>i(l),children:o.jsx(Cn,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]},l))})]})]})}function Y0e({config:t,onChange:e}){return o.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"统计信息"}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(he,{children:"启用统计信息发送"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"发送匿名统计信息,帮助我们了解全球有多少只麦麦在运行"})]}),o.jsx(Ft,{checked:t.enable,onCheckedChange:n=>e({...t,enable:n})})]})]})}const Af=b.forwardRef(({className:t,...e},n)=>o.jsx("div",{className:"relative w-full overflow-auto",children:o.jsx("table",{ref:n,className:xe("w-full caption-bottom text-sm",t),...e})}));Af.displayName="Table";const Mf=b.forwardRef(({className:t,...e},n)=>o.jsx("thead",{ref:n,className:xe("[&_tr]:border-b",t),...e}));Mf.displayName="TableHeader";const Rf=b.forwardRef(({className:t,...e},n)=>o.jsx("tbody",{ref:n,className:xe("[&_tr:last-child]:border-0",t),...e}));Rf.displayName="TableBody";const K0e=b.forwardRef(({className:t,...e},n)=>o.jsx("tfoot",{ref:n,className:xe("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",t),...e}));K0e.displayName="TableFooter";const zs=b.forwardRef(({className:t,...e},n)=>o.jsx("tr",{ref:n,className:xe("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",t),...e}));zs.displayName="TableRow";const mn=b.forwardRef(({className:t,...e},n)=>o.jsx("th",{ref:n,className:xe("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...e}));mn.displayName="TableHead";const Yt=b.forwardRef(({className:t,...e},n)=>o.jsx("td",{ref:n,className:xe("px-4 py-3 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...e}));Yt.displayName="TableCell";const Z0e=b.forwardRef(({className:t,...e},n)=>o.jsx("caption",{ref:n,className:xe("mt-4 text-sm text-muted-foreground",t),...e}));Z0e.displayName="TableCaption";var kA=1,J0e=.9,epe=.8,tpe=.17,vS=.1,yS=.999,npe=.9999,rpe=.99,spe=/[\\\/_+.#"@\[\(\{&]/,ipe=/[\\\/_+.#"@\[\(\{&]/g,ape=/[\s-]/,EH=/[\s-]/g;function vO(t,e,n,r,s,i,a){if(i===e.length)return s===t.length?kA:rpe;var l=`${s},${i}`;if(a[l]!==void 0)return a[l];for(var c=r.charAt(i),d=n.indexOf(c,s),h=0,m,g,x,y;d>=0;)m=vO(t,e,n,r,d+1,i+1,a),m>h&&(d===s?m*=kA:spe.test(t.charAt(d-1))?(m*=epe,x=t.slice(s,d-1).match(ipe),x&&s>0&&(m*=Math.pow(yS,x.length))):ape.test(t.charAt(d-1))?(m*=J0e,y=t.slice(s,d-1).match(EH),y&&s>0&&(m*=Math.pow(yS,y.length))):(m*=tpe,s>0&&(m*=Math.pow(yS,d-s))),t.charAt(d)!==e.charAt(i)&&(m*=npe)),(m<vS&&n.charAt(d-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(d-1)!==r.charAt(i))&&(g=vO(t,e,n,r,d+1,i+2,a),g*vS>m&&(m=g*vS)),m>h&&(h=m),d=n.indexOf(c,d+1);return a[l]=h,h}function OA(t){return t.toLowerCase().replace(EH," ")}function ope(t,e,n){return t=n&&n.length>0?`${t+" "+n.join(" ")}`:t,vO(t,e,OA(t),OA(e),0,0,{})}var lpe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],hu=lpe.reduce((t,e)=>{const n=Vy(`Primitive.${e}`),r=b.forwardRef((s,i)=>{const{asChild:a,...l}=s,c=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...l,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{}),Vm='[cmdk-group=""]',bS='[cmdk-group-items=""]',cpe='[cmdk-group-heading=""]',_H='[cmdk-item=""]',jA=`${_H}:not([aria-disabled="true"])`,yO="cmdk-item-select",kh="data-value",upe=(t,e,n)=>ope(t,e,n),AH=b.createContext(void 0),sg=()=>b.useContext(AH),MH=b.createContext(void 0),W6=()=>b.useContext(MH),RH=b.createContext(void 0),DH=b.forwardRef((t,e)=>{let n=Oh(()=>{var X,z;return{search:"",value:(z=(X=t.value)!=null?X:t.defaultValue)!=null?z:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Oh(()=>new Set),s=Oh(()=>new Map),i=Oh(()=>new Map),a=Oh(()=>new Set),l=PH(t),{label:c,children:d,value:h,onValueChange:m,filter:g,shouldFilter:x,loop:y,disablePointerSelection:w=!1,vimBindings:S=!0,...k}=t,j=Gi(),N=Gi(),T=Gi(),E=b.useRef(null),_=wpe();md(()=>{if(h!==void 0){let X=h.trim();n.current.value=X,A.emit()}},[h]),md(()=>{_(6,ee)},[]);let A=b.useMemo(()=>({subscribe:X=>(a.current.add(X),()=>a.current.delete(X)),snapshot:()=>n.current,setState:(X,z,U)=>{var te,ne,G,se;if(!Object.is(n.current[X],z)){if(n.current[X]=z,X==="search")W(),B(),_(1,H);else if(X==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let re=document.getElementById(T);re?re.focus():(te=document.getElementById(j))==null||te.focus()}if(_(7,()=>{var re;n.current.selectedItemId=(re=I())==null?void 0:re.id,A.emit()}),U||_(5,ee),((ne=l.current)==null?void 0:ne.value)!==void 0){let re=z??"";(se=(G=l.current).onValueChange)==null||se.call(G,re);return}}A.emit()}},emit:()=>{a.current.forEach(X=>X())}}),[]),D=b.useMemo(()=>({value:(X,z,U)=>{var te;z!==((te=i.current.get(X))==null?void 0:te.value)&&(i.current.set(X,{value:z,keywords:U}),n.current.filtered.items.set(X,q(z,U)),_(2,()=>{B(),A.emit()}))},item:(X,z)=>(r.current.add(X),z&&(s.current.has(z)?s.current.get(z).add(X):s.current.set(z,new Set([X]))),_(3,()=>{W(),B(),n.current.value||H(),A.emit()}),()=>{i.current.delete(X),r.current.delete(X),n.current.filtered.items.delete(X);let U=I();_(4,()=>{W(),U?.getAttribute("id")===X&&H(),A.emit()})}),group:X=>(s.current.has(X)||s.current.set(X,new Set),()=>{i.current.delete(X),s.current.delete(X)}),filter:()=>l.current.shouldFilter,label:c||t["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:j,inputId:T,labelId:N,listInnerRef:E}),[]);function q(X,z){var U,te;let ne=(te=(U=l.current)==null?void 0:U.filter)!=null?te:upe;return X?ne(X,n.current.search,z):0}function B(){if(!n.current.search||l.current.shouldFilter===!1)return;let X=n.current.filtered.items,z=[];n.current.filtered.groups.forEach(te=>{let ne=s.current.get(te),G=0;ne.forEach(se=>{let re=X.get(se);G=Math.max(re,G)}),z.push([te,G])});let U=E.current;V().sort((te,ne)=>{var G,se;let re=te.getAttribute("id"),ae=ne.getAttribute("id");return((G=X.get(ae))!=null?G:0)-((se=X.get(re))!=null?se:0)}).forEach(te=>{let ne=te.closest(bS);ne?ne.appendChild(te.parentElement===ne?te:te.closest(`${bS} > *`)):U.appendChild(te.parentElement===U?te:te.closest(`${bS} > *`))}),z.sort((te,ne)=>ne[1]-te[1]).forEach(te=>{var ne;let G=(ne=E.current)==null?void 0:ne.querySelector(`${Vm}[${kh}="${encodeURIComponent(te[0])}"]`);G?.parentElement.appendChild(G)})}function H(){let X=V().find(U=>U.getAttribute("aria-disabled")!=="true"),z=X?.getAttribute(kh);A.setState("value",z||void 0)}function W(){var X,z,U,te;if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let ne=0;for(let G of r.current){let se=(z=(X=i.current.get(G))==null?void 0:X.value)!=null?z:"",re=(te=(U=i.current.get(G))==null?void 0:U.keywords)!=null?te:[],ae=q(se,re);n.current.filtered.items.set(G,ae),ae>0&&ne++}for(let[G,se]of s.current)for(let re of se)if(n.current.filtered.items.get(re)>0){n.current.filtered.groups.add(G);break}n.current.filtered.count=ne}function ee(){var X,z,U;let te=I();te&&(((X=te.parentElement)==null?void 0:X.firstChild)===te&&((U=(z=te.closest(Vm))==null?void 0:z.querySelector(cpe))==null||U.scrollIntoView({block:"nearest"})),te.scrollIntoView({block:"nearest"}))}function I(){var X;return(X=E.current)==null?void 0:X.querySelector(`${_H}[aria-selected="true"]`)}function V(){var X;return Array.from(((X=E.current)==null?void 0:X.querySelectorAll(jA))||[])}function L(X){let z=V()[X];z&&A.setState("value",z.getAttribute(kh))}function $(X){var z;let U=I(),te=V(),ne=te.findIndex(se=>se===U),G=te[ne+X];(z=l.current)!=null&&z.loop&&(G=ne+X<0?te[te.length-1]:ne+X===te.length?te[0]:te[ne+X]),G&&A.setState("value",G.getAttribute(kh))}function K(X){let z=I(),U=z?.closest(Vm),te;for(;U&&!te;)U=X>0?ype(U,Vm):bpe(U,Vm),te=U?.querySelector(jA);te?A.setState("value",te.getAttribute(kh)):$(X)}let Y=()=>L(V().length-1),R=X=>{X.preventDefault(),X.metaKey?Y():X.altKey?K(1):$(1)},ie=X=>{X.preventDefault(),X.metaKey?L(0):X.altKey?K(-1):$(-1)};return b.createElement(hu.div,{ref:e,tabIndex:-1,...k,"cmdk-root":"",onKeyDown:X=>{var z;(z=k.onKeyDown)==null||z.call(k,X);let U=X.nativeEvent.isComposing||X.keyCode===229;if(!(X.defaultPrevented||U))switch(X.key){case"n":case"j":{S&&X.ctrlKey&&R(X);break}case"ArrowDown":{R(X);break}case"p":case"k":{S&&X.ctrlKey&&ie(X);break}case"ArrowUp":{ie(X);break}case"Home":{X.preventDefault(),L(0);break}case"End":{X.preventDefault(),Y();break}case"Enter":{X.preventDefault();let te=I();if(te){let ne=new Event(yO);te.dispatchEvent(ne)}}}}},b.createElement("label",{"cmdk-label":"",htmlFor:D.inputId,id:D.labelId,style:kpe},c),Cb(t,X=>b.createElement(MH.Provider,{value:A},b.createElement(AH.Provider,{value:D},X))))}),dpe=b.forwardRef((t,e)=>{var n,r;let s=Gi(),i=b.useRef(null),a=b.useContext(RH),l=sg(),c=PH(t),d=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:a?.forceMount;md(()=>{if(!d)return l.item(s,a?.id)},[d]);let h=zH(s,i,[t.value,t.children,i],t.keywords),m=W6(),g=tu(_=>_.value&&_.value===h.current),x=tu(_=>d||l.filter()===!1?!0:_.search?_.filtered.items.get(s)>0:!0);b.useEffect(()=>{let _=i.current;if(!(!_||t.disabled))return _.addEventListener(yO,y),()=>_.removeEventListener(yO,y)},[x,t.onSelect,t.disabled]);function y(){var _,A;w(),(A=(_=c.current).onSelect)==null||A.call(_,h.current)}function w(){m.setState("value",h.current,!0)}if(!x)return null;let{disabled:S,value:k,onSelect:j,forceMount:N,keywords:T,...E}=t;return b.createElement(hu.div,{ref:Gc(i,e),...E,id:s,"cmdk-item":"",role:"option","aria-disabled":!!S,"aria-selected":!!g,"data-disabled":!!S,"data-selected":!!g,onPointerMove:S||l.getDisablePointerSelection()?void 0:w,onClick:S?void 0:y},t.children)}),hpe=b.forwardRef((t,e)=>{let{heading:n,children:r,forceMount:s,...i}=t,a=Gi(),l=b.useRef(null),c=b.useRef(null),d=Gi(),h=sg(),m=tu(x=>s||h.filter()===!1?!0:x.search?x.filtered.groups.has(a):!0);md(()=>h.group(a),[]),zH(a,l,[t.value,t.heading,c]);let g=b.useMemo(()=>({id:a,forceMount:s}),[s]);return b.createElement(hu.div,{ref:Gc(l,e),...i,"cmdk-group":"",role:"presentation",hidden:m?void 0:!0},n&&b.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:d},n),Cb(t,x=>b.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?d:void 0},b.createElement(RH.Provider,{value:g},x))))}),fpe=b.forwardRef((t,e)=>{let{alwaysRender:n,...r}=t,s=b.useRef(null),i=tu(a=>!a.search);return!n&&!i?null:b.createElement(hu.div,{ref:Gc(s,e),...r,"cmdk-separator":"",role:"separator"})}),mpe=b.forwardRef((t,e)=>{let{onValueChange:n,...r}=t,s=t.value!=null,i=W6(),a=tu(d=>d.search),l=tu(d=>d.selectedItemId),c=sg();return b.useEffect(()=>{t.value!=null&&i.setState("search",t.value)},[t.value]),b.createElement(hu.input,{ref:e,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":l,id:c.inputId,type:"text",value:s?t.value:a,onChange:d=>{s||i.setState("search",d.target.value),n?.(d.target.value)}})}),ppe=b.forwardRef((t,e)=>{let{children:n,label:r="Suggestions",...s}=t,i=b.useRef(null),a=b.useRef(null),l=tu(d=>d.selectedItemId),c=sg();return b.useEffect(()=>{if(a.current&&i.current){let d=a.current,h=i.current,m,g=new ResizeObserver(()=>{m=requestAnimationFrame(()=>{let x=d.offsetHeight;h.style.setProperty("--cmdk-list-height",x.toFixed(1)+"px")})});return g.observe(d),()=>{cancelAnimationFrame(m),g.unobserve(d)}}},[]),b.createElement(hu.div,{ref:Gc(i,e),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":r,id:c.listId},Cb(t,d=>b.createElement("div",{ref:Gc(a,c.listInnerRef),"cmdk-list-sizer":""},d)))}),gpe=b.forwardRef((t,e)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:i,container:a,...l}=t;return b.createElement(Mj,{open:n,onOpenChange:r},b.createElement(Ej,{container:a},b.createElement(Uy,{"cmdk-overlay":"",className:s}),b.createElement(Wy,{"aria-label":t.label,"cmdk-dialog":"",className:i},b.createElement(DH,{ref:e,...l}))))}),xpe=b.forwardRef((t,e)=>tu(n=>n.filtered.count===0)?b.createElement(hu.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),vpe=b.forwardRef((t,e)=>{let{progress:n,children:r,label:s="Loading...",...i}=t;return b.createElement(hu.div,{ref:e,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},Cb(t,a=>b.createElement("div",{"aria-hidden":!0},a)))}),Ei=Object.assign(DH,{List:ppe,Item:dpe,Input:mpe,Group:hpe,Separator:fpe,Dialog:gpe,Empty:xpe,Loading:vpe});function ype(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function bpe(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function PH(t){let e=b.useRef(t);return md(()=>{e.current=t}),e}var md=typeof window>"u"?b.useEffect:b.useLayoutEffect;function Oh(t){let e=b.useRef();return e.current===void 0&&(e.current=t()),e}function tu(t){let e=W6(),n=()=>t(e.snapshot());return b.useSyncExternalStore(e.subscribe,n,n)}function zH(t,e,n,r=[]){let s=b.useRef(),i=sg();return md(()=>{var a;let l=(()=>{var d;for(let h of n){if(typeof h=="string")return h.trim();if(typeof h=="object"&&"current"in h)return h.current?(d=h.current.textContent)==null?void 0:d.trim():s.current}})(),c=r.map(d=>d.trim());i.value(t,l,c),(a=e.current)==null||a.setAttribute(kh,l),s.current=l}),s}var wpe=()=>{let[t,e]=b.useState(),n=Oh(()=>new Map);return md(()=>{n.current.forEach(r=>r()),n.current=new Map},[t]),(r,s)=>{n.current.set(r,s),e({})}};function Spe(t){let e=t.type;return typeof e=="function"?e(t.props):"render"in e?e.render(t.props):t}function Cb({asChild:t,children:e},n){return t&&b.isValidElement(e)?b.cloneElement(Spe(e),{ref:e.ref},n(e.props.children)):n(e)}var kpe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Tb=b.forwardRef(({className:t,...e},n)=>o.jsx(Ei,{ref:n,className:xe("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...e}));Tb.displayName=Ei.displayName;const Eb=b.forwardRef(({className:t,...e},n)=>o.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[o.jsx(ii,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),o.jsx(Ei.Input,{ref:n,className:xe("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",t),...e})]}));Eb.displayName=Ei.Input.displayName;const _b=b.forwardRef(({className:t,...e},n)=>o.jsx(Ei.List,{ref:n,className:xe("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...e}));_b.displayName=Ei.List.displayName;const Ab=b.forwardRef((t,e)=>o.jsx(Ei.Empty,{ref:e,className:"py-6 text-center text-sm",...t}));Ab.displayName=Ei.Empty.displayName;const up=b.forwardRef(({className:t,...e},n)=>o.jsx(Ei.Group,{ref:n,className:xe("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",t),...e}));up.displayName=Ei.Group.displayName;const Ope=b.forwardRef(({className:t,...e},n)=>o.jsx(Ei.Separator,{ref:n,className:xe("-mx-1 h-px bg-border",t),...e}));Ope.displayName=Ei.Separator.displayName;const dp=b.forwardRef(({className:t,...e},n)=>o.jsx(Ei.Item,{ref:n,className:xe("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",t),...e}));dp.displayName=Ei.Item.displayName;const Ci=b.forwardRef(({className:t,...e},n)=>o.jsx(bI,{ref:n,className:xe("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",t),...e,children:o.jsx(zee,{className:xe("grid place-content-center text-current"),children:o.jsx(zo,{className:"h-4 w-4"})})}));Ci.displayName=bI.displayName;const IH=b.createContext(null),LH="maibot-completed-tours";function jpe(){try{const t=localStorage.getItem(LH);return t?new Set(JSON.parse(t)):new Set}catch{return new Set}}function NA(t){localStorage.setItem(LH,JSON.stringify([...t]))}function Npe({children:t}){const[e,n]=b.useState({activeTourId:null,stepIndex:0,isRunning:!1}),r=b.useRef(new Map),[,s]=b.useState(0),[i,a]=b.useState(jpe),l=b.useCallback((N,T)=>{r.current.set(N,T),s(E=>E+1)},[]),c=b.useCallback(N=>{r.current.delete(N),n(T=>T.activeTourId===N?{...T,activeTourId:null,isRunning:!1,stepIndex:0}:T)},[]),d=b.useCallback((N,T=0)=>{r.current.has(N)&&n({activeTourId:N,stepIndex:T,isRunning:!0})},[]),h=b.useCallback(()=>{n(N=>({...N,isRunning:!1}))},[]),m=b.useCallback(N=>{n(T=>({...T,stepIndex:N}))},[]),g=b.useCallback(()=>{n(N=>({...N,stepIndex:N.stepIndex+1}))},[]),x=b.useCallback(()=>{n(N=>({...N,stepIndex:Math.max(0,N.stepIndex-1)}))},[]),y=b.useCallback(()=>e.activeTourId?r.current.get(e.activeTourId)||[]:[],[e.activeTourId]),w=b.useCallback(N=>{a(T=>{const E=new Set(T);return E.add(N),NA(E),E})},[]),S=b.useCallback(N=>{const{action:T,index:E,status:_,type:A}=N,D=["finished","skipped"];if(T==="close"){n(q=>({...q,isRunning:!1,stepIndex:0}));return}D.includes(_)?n(q=>(_==="finished"&&q.activeTourId&&setTimeout(()=>w(q.activeTourId),0),{...q,isRunning:!1,stepIndex:0})):A==="step:after"&&(T==="next"?n(q=>({...q,stepIndex:E+1})):T==="prev"&&n(q=>({...q,stepIndex:E-1})))},[w]),k=b.useCallback(N=>i.has(N),[i]),j=b.useCallback(N=>{a(T=>{const E=new Set(T);return E.delete(N),NA(E),E})},[]);return o.jsx(IH.Provider,{value:{state:e,tours:r.current,registerTour:l,unregisterTour:c,startTour:d,stopTour:h,goToStep:m,nextStep:g,prevStep:x,getCurrentSteps:y,handleJoyrideCallback:S,isTourCompleted:k,markTourCompleted:w,resetTourCompleted:j},children:t})}function BH(t){return e=>typeof e===t}var Cpe=BH("function"),Tpe=t=>t===null,CA=t=>Object.prototype.toString.call(t).slice(8,-1)==="RegExp",TA=t=>!Epe(t)&&!Tpe(t)&&(Cpe(t)||typeof t=="object"),Epe=BH("undefined");function _pe(t,e){const{length:n}=t;if(n!==e.length)return!1;for(let r=n;r--!==0;)if(!ti(t[r],e[r]))return!1;return!0}function Ape(t,e){if(t.byteLength!==e.byteLength)return!1;const n=new DataView(t.buffer),r=new DataView(e.buffer);let s=t.byteLength;for(;s--;)if(n.getUint8(s)!==r.getUint8(s))return!1;return!0}function Mpe(t,e){if(t.size!==e.size)return!1;for(const n of t.entries())if(!e.has(n[0]))return!1;for(const n of t.entries())if(!ti(n[1],e.get(n[0])))return!1;return!0}function Rpe(t,e){if(t.size!==e.size)return!1;for(const n of t.entries())if(!e.has(n[0]))return!1;return!0}function ti(t,e){if(t===e)return!0;if(t&&TA(t)&&e&&TA(e)){if(t.constructor!==e.constructor)return!1;if(Array.isArray(t)&&Array.isArray(e))return _pe(t,e);if(t instanceof Map&&e instanceof Map)return Mpe(t,e);if(t instanceof Set&&e instanceof Set)return Rpe(t,e);if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(e))return Ape(t,e);if(CA(t)&&CA(e))return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(let s=n.length;s--!==0;)if(!Object.prototype.hasOwnProperty.call(e,n[s]))return!1;for(let s=n.length;s--!==0;){const i=n[s];if(!(i==="_owner"&&t.$$typeof)&&!ti(t[i],e[i]))return!1}return!0}return Number.isNaN(t)&&Number.isNaN(e)?!0:t===e}var Dpe=["Array","ArrayBuffer","AsyncFunction","AsyncGenerator","AsyncGeneratorFunction","Date","Error","Function","Generator","GeneratorFunction","HTMLElement","Map","Object","Promise","RegExp","Set","WeakMap","WeakSet"],Ppe=["bigint","boolean","null","number","string","symbol","undefined"];function Mb(t){const e=Object.prototype.toString.call(t).slice(8,-1);if(/HTML\w+Element/.test(e))return"HTMLElement";if(zpe(e))return e}function io(t){return e=>Mb(e)===t}function zpe(t){return Dpe.includes(t)}function Df(t){return e=>typeof e===t}function Ipe(t){return Ppe.includes(t)}var Lpe=["innerHTML","ownerDocument","style","attributes","nodeValue"];function at(t){if(t===null)return"null";switch(typeof t){case"bigint":return"bigint";case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"symbol":return"symbol";case"undefined":return"undefined"}if(at.array(t))return"Array";if(at.plainFunction(t))return"Function";const e=Mb(t);return e||"Object"}at.array=Array.isArray;at.arrayOf=(t,e)=>!at.array(t)&&!at.function(e)?!1:t.every(n=>e(n));at.asyncGeneratorFunction=t=>Mb(t)==="AsyncGeneratorFunction";at.asyncFunction=io("AsyncFunction");at.bigint=Df("bigint");at.boolean=t=>t===!0||t===!1;at.date=io("Date");at.defined=t=>!at.undefined(t);at.domElement=t=>at.object(t)&&!at.plainObject(t)&&t.nodeType===1&&at.string(t.nodeName)&&Lpe.every(e=>e in t);at.empty=t=>at.string(t)&&t.length===0||at.array(t)&&t.length===0||at.object(t)&&!at.map(t)&&!at.set(t)&&Object.keys(t).length===0||at.set(t)&&t.size===0||at.map(t)&&t.size===0;at.error=io("Error");at.function=Df("function");at.generator=t=>at.iterable(t)&&at.function(t.next)&&at.function(t.throw);at.generatorFunction=io("GeneratorFunction");at.instanceOf=(t,e)=>!t||!e?!1:Object.getPrototypeOf(t)===e.prototype;at.iterable=t=>!at.nullOrUndefined(t)&&at.function(t[Symbol.iterator]);at.map=io("Map");at.nan=t=>Number.isNaN(t);at.null=t=>t===null;at.nullOrUndefined=t=>at.null(t)||at.undefined(t);at.number=t=>Df("number")(t)&&!at.nan(t);at.numericString=t=>at.string(t)&&t.length>0&&!Number.isNaN(Number(t));at.object=t=>!at.nullOrUndefined(t)&&(at.function(t)||typeof t=="object");at.oneOf=(t,e)=>at.array(t)?t.indexOf(e)>-1:!1;at.plainFunction=io("Function");at.plainObject=t=>{if(Mb(t)!=="Object")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.getPrototypeOf({})};at.primitive=t=>at.null(t)||Ipe(typeof t);at.promise=io("Promise");at.propertyOf=(t,e,n)=>{if(!at.object(t)||!e)return!1;const r=t[e];return at.function(n)?n(r):at.defined(r)};at.regexp=io("RegExp");at.set=io("Set");at.string=Df("string");at.symbol=Df("symbol");at.undefined=Df("undefined");at.weakMap=io("WeakMap");at.weakSet=io("WeakSet");var pt=at;function Bpe(...t){return t.every(e=>pt.string(e)||pt.array(e)||pt.plainObject(e))}function Fpe(t,e,n){return FH(t,e)?[t,e].every(pt.array)?!t.some(RA(n))&&e.some(RA(n)):[t,e].every(pt.plainObject)?!Object.entries(t).some(MA(n))&&Object.entries(e).some(MA(n)):e===n:!1}function EA(t,e,n){const{actual:r,key:s,previous:i,type:a}=n,l=_o(t,s),c=_o(e,s);let d=[l,c].every(pt.number)&&(a==="increased"?l<c:l>c);return pt.undefined(r)||(d=d&&c===r),pt.undefined(i)||(d=d&&l===i),d}function _A(t,e,n){const{key:r,type:s,value:i}=n,a=_o(t,r),l=_o(e,r),c=s==="added"?a:l,d=s==="added"?l:a;if(!pt.nullOrUndefined(i)){if(pt.defined(c)){if(pt.array(c)||pt.plainObject(c))return Fpe(c,d,i)}else return ti(d,i);return!1}return[a,l].every(pt.array)?!d.every(G6(c)):[a,l].every(pt.plainObject)?qpe(Object.keys(c),Object.keys(d)):![a,l].every(h=>pt.primitive(h)&&pt.defined(h))&&(s==="added"?!pt.defined(a)&&pt.defined(l):pt.defined(a)&&!pt.defined(l))}function AA(t,e,{key:n}={}){let r=_o(t,n),s=_o(e,n);if(!FH(r,s))throw new TypeError("Inputs have different types");if(!Bpe(r,s))throw new TypeError("Inputs don't have length");return[r,s].every(pt.plainObject)&&(r=Object.keys(r),s=Object.keys(s)),[r,s]}function MA(t){return([e,n])=>pt.array(t)?ti(t,n)||t.some(r=>ti(r,n)||pt.array(n)&&G6(n)(r)):pt.plainObject(t)&&t[e]?!!t[e]&&ti(t[e],n):ti(t,n)}function qpe(t,e){return e.some(n=>!t.includes(n))}function RA(t){return e=>pt.array(t)?t.some(n=>ti(n,e)||pt.array(e)&&G6(e)(n)):ti(t,e)}function Um(t,e){return pt.array(t)?t.some(n=>ti(n,e)):ti(t,e)}function G6(t){return e=>t.some(n=>ti(n,e))}function FH(...t){return t.every(pt.array)||t.every(pt.number)||t.every(pt.plainObject)||t.every(pt.string)}function _o(t,e){return pt.plainObject(t)||pt.array(t)?pt.string(e)?e.split(".").reduce((r,s)=>r&&r[s],t):pt.number(e)?t[e]:t:t}function py(t,e){if([t,e].some(pt.nullOrUndefined))throw new Error("Missing required parameters");if(![t,e].every(h=>pt.plainObject(h)||pt.array(h)))throw new Error("Expected plain objects or array");return{added:(h,m)=>{try{return _A(t,e,{key:h,type:"added",value:m})}catch{return!1}},changed:(h,m,g)=>{try{const x=_o(t,h),y=_o(e,h),w=pt.defined(m),S=pt.defined(g);if(w||S){const k=S?Um(g,x):!Um(m,x),j=Um(m,y);return k&&j}return[x,y].every(pt.array)||[x,y].every(pt.plainObject)?!ti(x,y):x!==y}catch{return!1}},changedFrom:(h,m,g)=>{if(!pt.defined(h))return!1;try{const x=_o(t,h),y=_o(e,h),w=pt.defined(g);return Um(m,x)&&(w?Um(g,y):!w)}catch{return!1}},decreased:(h,m,g)=>{if(!pt.defined(h))return!1;try{return EA(t,e,{key:h,actual:m,previous:g,type:"decreased"})}catch{return!1}},emptied:h=>{try{const[m,g]=AA(t,e,{key:h});return!!m.length&&!g.length}catch{return!1}},filled:h=>{try{const[m,g]=AA(t,e,{key:h});return!m.length&&!!g.length}catch{return!1}},increased:(h,m,g)=>{if(!pt.defined(h))return!1;try{return EA(t,e,{key:h,actual:m,previous:g,type:"increased"})}catch{return!1}},removed:(h,m)=>{try{return _A(t,e,{key:h,type:"removed",value:m})}catch{return!1}}}}var wS,DA;function $pe(){if(DA)return wS;DA=1;var t=new Error("Element already at target scroll position"),e=new Error("Scroll cancelled"),n=Math.min,r=Date.now;wS={left:s("scrollLeft"),top:s("scrollTop")};function s(l){return function(d,h,m,g){m=m||{},typeof m=="function"&&(g=m,m={}),typeof g!="function"&&(g=a);var x=r(),y=d[l],w=m.ease||i,S=isNaN(m.duration)?350:+m.duration,k=!1;return y===h?g(t,d[l]):requestAnimationFrame(N),j;function j(){k=!0}function N(T){if(k)return g(e,d[l]);var E=r(),_=n(1,(E-x)/S),A=w(_);d[l]=A*(h-y)+y,_<1?requestAnimationFrame(N):requestAnimationFrame(function(){g(null,d[l])})}}}function i(l){return .5*(1-Math.cos(Math.PI*l))}function a(){}return wS}var Hpe=$pe();const Qpe=yd(Hpe);var Ov={exports:{}},Vpe=Ov.exports,PA;function Upe(){return PA||(PA=1,(function(t){(function(e,n){t.exports?t.exports=n():e.Scrollparent=n()})(Vpe,function(){function e(r){var s=getComputedStyle(r,null).getPropertyValue("overflow");return s.indexOf("scroll")>-1||s.indexOf("auto")>-1}function n(r){if(r instanceof HTMLElement||r instanceof SVGElement){for(var s=r.parentNode;s.parentNode;){if(e(s))return s;s=s.parentNode}return document.scrollingElement||document.documentElement}}return n})})(Ov)),Ov.exports}var Wpe=Upe();const qH=yd(Wpe);var SS,zA;function Gpe(){if(zA)return SS;zA=1;var t=function(r){return Object.prototype.hasOwnProperty.call(r,"props")},e=function(r,s){return r+n(s)},n=function(r){return r===null||typeof r=="boolean"||typeof r>"u"?"":typeof r=="number"?r.toString():typeof r=="string"?r:Array.isArray(r)?r.reduce(e,""):t(r)&&Object.prototype.hasOwnProperty.call(r.props,"children")?n(r.props.children):""};return n.default=n,SS=n,SS}var Xpe=Gpe();const IA=yd(Xpe);var kS,LA;function Ype(){if(LA)return kS;LA=1;var t=function(j){return e(j)&&!n(j)};function e(k){return!!k&&typeof k=="object"}function n(k){var j=Object.prototype.toString.call(k);return j==="[object RegExp]"||j==="[object Date]"||i(k)}var r=typeof Symbol=="function"&&Symbol.for,s=r?Symbol.for("react.element"):60103;function i(k){return k.$$typeof===s}function a(k){return Array.isArray(k)?[]:{}}function l(k,j){return j.clone!==!1&&j.isMergeableObject(k)?w(a(k),k,j):k}function c(k,j,N){return k.concat(j).map(function(T){return l(T,N)})}function d(k,j){if(!j.customMerge)return w;var N=j.customMerge(k);return typeof N=="function"?N:w}function h(k){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(k).filter(function(j){return Object.propertyIsEnumerable.call(k,j)}):[]}function m(k){return Object.keys(k).concat(h(k))}function g(k,j){try{return j in k}catch{return!1}}function x(k,j){return g(k,j)&&!(Object.hasOwnProperty.call(k,j)&&Object.propertyIsEnumerable.call(k,j))}function y(k,j,N){var T={};return N.isMergeableObject(k)&&m(k).forEach(function(E){T[E]=l(k[E],N)}),m(j).forEach(function(E){x(k,E)||(g(k,E)&&N.isMergeableObject(j[E])?T[E]=d(E,N)(k[E],j[E],N):T[E]=l(j[E],N))}),T}function w(k,j,N){N=N||{},N.arrayMerge=N.arrayMerge||c,N.isMergeableObject=N.isMergeableObject||t,N.cloneUnlessOtherwiseSpecified=l;var T=Array.isArray(j),E=Array.isArray(k),_=T===E;return _?T?N.arrayMerge(k,j,N):y(k,j,N):l(j,N)}w.all=function(j,N){if(!Array.isArray(j))throw new Error("first argument should be an array");return j.reduce(function(T,E){return w(T,E,N)},{})};var S=w;return kS=S,kS}var Kpe=Ype();const Ua=yd(Kpe);var ig=typeof window<"u"&&typeof document<"u"&&typeof navigator<"u",Zpe=(function(){for(var t=["Edge","Trident","Firefox"],e=0;e<t.length;e+=1)if(ig&&navigator.userAgent.indexOf(t[e])>=0)return 1;return 0})();function Jpe(t){var e=!1;return function(){e||(e=!0,window.Promise.resolve().then(function(){e=!1,t()}))}}function ege(t){var e=!1;return function(){e||(e=!0,setTimeout(function(){e=!1,t()},Zpe))}}var tge=ig&&window.Promise,nge=tge?Jpe:ege;function $H(t){var e={};return t&&e.toString.call(t)==="[object Function]"}function Sd(t,e){if(t.nodeType!==1)return[];var n=t.ownerDocument.defaultView,r=n.getComputedStyle(t,null);return e?r[e]:r}function X6(t){return t.nodeName==="HTML"?t:t.parentNode||t.host}function ag(t){if(!t)return document.body;switch(t.nodeName){case"HTML":case"BODY":return t.ownerDocument.body;case"#document":return t.body}var e=Sd(t),n=e.overflow,r=e.overflowX,s=e.overflowY;return/(auto|scroll|overlay)/.test(n+s+r)?t:ag(X6(t))}function HH(t){return t&&t.referenceNode?t.referenceNode:t}var BA=ig&&!!(window.MSInputMethodContext&&document.documentMode),FA=ig&&/MSIE 10/.test(navigator.userAgent);function Pf(t){return t===11?BA:t===10?FA:BA||FA}function lf(t){if(!t)return document.documentElement;for(var e=Pf(10)?document.body:null,n=t.offsetParent||null;n===e&&t.nextElementSibling;)n=(t=t.nextElementSibling).offsetParent;var r=n&&n.nodeName;return!r||r==="BODY"||r==="HTML"?t?t.ownerDocument.documentElement:document.documentElement:["TH","TD","TABLE"].indexOf(n.nodeName)!==-1&&Sd(n,"position")==="static"?lf(n):n}function rge(t){var e=t.nodeName;return e==="BODY"?!1:e==="HTML"||lf(t.firstElementChild)===t}function bO(t){return t.parentNode!==null?bO(t.parentNode):t}function gy(t,e){if(!t||!t.nodeType||!e||!e.nodeType)return document.documentElement;var n=t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING,r=n?t:e,s=n?e:t,i=document.createRange();i.setStart(r,0),i.setEnd(s,0);var a=i.commonAncestorContainer;if(t!==a&&e!==a||r.contains(s))return rge(a)?a:lf(a);var l=bO(t);return l.host?gy(l.host,e):gy(t,bO(e).host)}function cf(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"top",n=e==="top"?"scrollTop":"scrollLeft",r=t.nodeName;if(r==="BODY"||r==="HTML"){var s=t.ownerDocument.documentElement,i=t.ownerDocument.scrollingElement||s;return i[n]}return t[n]}function sge(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=cf(e,"top"),s=cf(e,"left"),i=n?-1:1;return t.top+=r*i,t.bottom+=r*i,t.left+=s*i,t.right+=s*i,t}function qA(t,e){var n=e==="x"?"Left":"Top",r=n==="Left"?"Right":"Bottom";return parseFloat(t["border"+n+"Width"])+parseFloat(t["border"+r+"Width"])}function $A(t,e,n,r){return Math.max(e["offset"+t],e["scroll"+t],n["client"+t],n["offset"+t],n["scroll"+t],Pf(10)?parseInt(n["offset"+t])+parseInt(r["margin"+(t==="Height"?"Top":"Left")])+parseInt(r["margin"+(t==="Height"?"Bottom":"Right")]):0)}function QH(t){var e=t.body,n=t.documentElement,r=Pf(10)&&getComputedStyle(n);return{height:$A("Height",e,n,r),width:$A("Width",e,n,r)}}var ige=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},age=(function(){function t(e,n){for(var r=0;r<n.length;r++){var s=n[r];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}})(),uf=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},ja=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};function nu(t){return ja({},t,{right:t.left+t.width,bottom:t.top+t.height})}function wO(t){var e={};try{if(Pf(10)){e=t.getBoundingClientRect();var n=cf(t,"top"),r=cf(t,"left");e.top+=n,e.left+=r,e.bottom+=n,e.right+=r}else e=t.getBoundingClientRect()}catch{}var s={left:e.left,top:e.top,width:e.right-e.left,height:e.bottom-e.top},i=t.nodeName==="HTML"?QH(t.ownerDocument):{},a=i.width||t.clientWidth||s.width,l=i.height||t.clientHeight||s.height,c=t.offsetWidth-a,d=t.offsetHeight-l;if(c||d){var h=Sd(t);c-=qA(h,"x"),d-=qA(h,"y"),s.width-=c,s.height-=d}return nu(s)}function Y6(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=Pf(10),s=e.nodeName==="HTML",i=wO(t),a=wO(e),l=ag(t),c=Sd(e),d=parseFloat(c.borderTopWidth),h=parseFloat(c.borderLeftWidth);n&&s&&(a.top=Math.max(a.top,0),a.left=Math.max(a.left,0));var m=nu({top:i.top-a.top-d,left:i.left-a.left-h,width:i.width,height:i.height});if(m.marginTop=0,m.marginLeft=0,!r&&s){var g=parseFloat(c.marginTop),x=parseFloat(c.marginLeft);m.top-=d-g,m.bottom-=d-g,m.left-=h-x,m.right-=h-x,m.marginTop=g,m.marginLeft=x}return(r&&!n?e.contains(l):e===l&&l.nodeName!=="BODY")&&(m=sge(m,e)),m}function oge(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=t.ownerDocument.documentElement,r=Y6(t,n),s=Math.max(n.clientWidth,window.innerWidth||0),i=Math.max(n.clientHeight,window.innerHeight||0),a=e?0:cf(n),l=e?0:cf(n,"left"),c={top:a-r.top+r.marginTop,left:l-r.left+r.marginLeft,width:s,height:i};return nu(c)}function VH(t){var e=t.nodeName;if(e==="BODY"||e==="HTML")return!1;if(Sd(t,"position")==="fixed")return!0;var n=X6(t);return n?VH(n):!1}function UH(t){if(!t||!t.parentElement||Pf())return document.documentElement;for(var e=t.parentElement;e&&Sd(e,"transform")==="none";)e=e.parentElement;return e||document.documentElement}function K6(t,e,n,r){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,i={top:0,left:0},a=s?UH(t):gy(t,HH(e));if(r==="viewport")i=oge(a,s);else{var l=void 0;r==="scrollParent"?(l=ag(X6(e)),l.nodeName==="BODY"&&(l=t.ownerDocument.documentElement)):r==="window"?l=t.ownerDocument.documentElement:l=r;var c=Y6(l,a,s);if(l.nodeName==="HTML"&&!VH(a)){var d=QH(t.ownerDocument),h=d.height,m=d.width;i.top+=c.top-c.marginTop,i.bottom=h+c.top,i.left+=c.left-c.marginLeft,i.right=m+c.left}else i=c}n=n||0;var g=typeof n=="number";return i.left+=g?n:n.left||0,i.top+=g?n:n.top||0,i.right-=g?n:n.right||0,i.bottom-=g?n:n.bottom||0,i}function lge(t){var e=t.width,n=t.height;return e*n}function WH(t,e,n,r,s){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0;if(t.indexOf("auto")===-1)return t;var a=K6(n,r,i,s),l={top:{width:a.width,height:e.top-a.top},right:{width:a.right-e.right,height:a.height},bottom:{width:a.width,height:a.bottom-e.bottom},left:{width:e.left-a.left,height:a.height}},c=Object.keys(l).map(function(g){return ja({key:g},l[g],{area:lge(l[g])})}).sort(function(g,x){return x.area-g.area}),d=c.filter(function(g){var x=g.width,y=g.height;return x>=n.clientWidth&&y>=n.clientHeight}),h=d.length>0?d[0].key:c[0].key,m=t.split("-")[1];return h+(m?"-"+m:"")}function GH(t,e,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,s=r?UH(e):gy(e,HH(n));return Y6(n,s,r)}function XH(t){var e=t.ownerDocument.defaultView,n=e.getComputedStyle(t),r=parseFloat(n.marginTop||0)+parseFloat(n.marginBottom||0),s=parseFloat(n.marginLeft||0)+parseFloat(n.marginRight||0),i={width:t.offsetWidth+s,height:t.offsetHeight+r};return i}function xy(t){var e={left:"right",right:"left",bottom:"top",top:"bottom"};return t.replace(/left|right|bottom|top/g,function(n){return e[n]})}function YH(t,e,n){n=n.split("-")[0];var r=XH(t),s={width:r.width,height:r.height},i=["right","left"].indexOf(n)!==-1,a=i?"top":"left",l=i?"left":"top",c=i?"height":"width",d=i?"width":"height";return s[a]=e[a]+e[c]/2-r[c]/2,n===l?s[l]=e[l]-r[d]:s[l]=e[xy(l)],s}function og(t,e){return Array.prototype.find?t.find(e):t.filter(e)[0]}function cge(t,e,n){if(Array.prototype.findIndex)return t.findIndex(function(s){return s[e]===n});var r=og(t,function(s){return s[e]===n});return t.indexOf(r)}function KH(t,e,n){var r=n===void 0?t:t.slice(0,cge(t,"name",n));return r.forEach(function(s){s.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var i=s.function||s.fn;s.enabled&&$H(i)&&(e.offsets.popper=nu(e.offsets.popper),e.offsets.reference=nu(e.offsets.reference),e=i(e,s))}),e}function uge(){if(!this.state.isDestroyed){var t={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};t.offsets.reference=GH(this.state,this.popper,this.reference,this.options.positionFixed),t.placement=WH(this.options.placement,t.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),t.originalPlacement=t.placement,t.positionFixed=this.options.positionFixed,t.offsets.popper=YH(this.popper,t.offsets.reference,t.placement),t.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",t=KH(this.modifiers,t),this.state.isCreated?this.options.onUpdate(t):(this.state.isCreated=!0,this.options.onCreate(t))}}function ZH(t,e){return t.some(function(n){var r=n.name,s=n.enabled;return s&&r===e})}function Z6(t){for(var e=[!1,"ms","Webkit","Moz","O"],n=t.charAt(0).toUpperCase()+t.slice(1),r=0;r<e.length;r++){var s=e[r],i=s?""+s+n:t;if(typeof document.body.style[i]<"u")return i}return null}function dge(){return this.state.isDestroyed=!0,ZH(this.modifiers,"applyStyle")&&(this.popper.removeAttribute("x-placement"),this.popper.style.position="",this.popper.style.top="",this.popper.style.left="",this.popper.style.right="",this.popper.style.bottom="",this.popper.style.willChange="",this.popper.style[Z6("transform")]=""),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}function JH(t){var e=t.ownerDocument;return e?e.defaultView:window}function eQ(t,e,n,r){var s=t.nodeName==="BODY",i=s?t.ownerDocument.defaultView:t;i.addEventListener(e,n,{passive:!0}),s||eQ(ag(i.parentNode),e,n,r),r.push(i)}function hge(t,e,n,r){n.updateBound=r,JH(t).addEventListener("resize",n.updateBound,{passive:!0});var s=ag(t);return eQ(s,"scroll",n.updateBound,n.scrollParents),n.scrollElement=s,n.eventsEnabled=!0,n}function fge(){this.state.eventsEnabled||(this.state=hge(this.reference,this.options,this.state,this.scheduleUpdate))}function mge(t,e){return JH(t).removeEventListener("resize",e.updateBound),e.scrollParents.forEach(function(n){n.removeEventListener("scroll",e.updateBound)}),e.updateBound=null,e.scrollParents=[],e.scrollElement=null,e.eventsEnabled=!1,e}function pge(){this.state.eventsEnabled&&(cancelAnimationFrame(this.scheduleUpdate),this.state=mge(this.reference,this.state))}function J6(t){return t!==""&&!isNaN(parseFloat(t))&&isFinite(t)}function SO(t,e){Object.keys(e).forEach(function(n){var r="";["width","height","top","right","bottom","left"].indexOf(n)!==-1&&J6(e[n])&&(r="px"),t.style[n]=e[n]+r})}function gge(t,e){Object.keys(e).forEach(function(n){var r=e[n];r!==!1?t.setAttribute(n,e[n]):t.removeAttribute(n)})}function xge(t){return SO(t.instance.popper,t.styles),gge(t.instance.popper,t.attributes),t.arrowElement&&Object.keys(t.arrowStyles).length&&SO(t.arrowElement,t.arrowStyles),t}function vge(t,e,n,r,s){var i=GH(s,e,t,n.positionFixed),a=WH(n.placement,i,e,t,n.modifiers.flip.boundariesElement,n.modifiers.flip.padding);return e.setAttribute("x-placement",a),SO(e,{position:n.positionFixed?"fixed":"absolute"}),n}function yge(t,e){var n=t.offsets,r=n.popper,s=n.reference,i=Math.round,a=Math.floor,l=function(k){return k},c=i(s.width),d=i(r.width),h=["left","right"].indexOf(t.placement)!==-1,m=t.placement.indexOf("-")!==-1,g=c%2===d%2,x=c%2===1&&d%2===1,y=e?h||m||g?i:a:l,w=e?i:l;return{left:y(x&&!m&&e?r.left-1:r.left),top:w(r.top),bottom:w(r.bottom),right:y(r.right)}}var bge=ig&&/Firefox/i.test(navigator.userAgent);function wge(t,e){var n=e.x,r=e.y,s=t.offsets.popper,i=og(t.instance.modifiers,function(N){return N.name==="applyStyle"}).gpuAcceleration;i!==void 0&&console.warn("WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!");var a=i!==void 0?i:e.gpuAcceleration,l=lf(t.instance.popper),c=wO(l),d={position:s.position},h=yge(t,window.devicePixelRatio<2||!bge),m=n==="bottom"?"top":"bottom",g=r==="right"?"left":"right",x=Z6("transform"),y=void 0,w=void 0;if(m==="bottom"?l.nodeName==="HTML"?w=-l.clientHeight+h.bottom:w=-c.height+h.bottom:w=h.top,g==="right"?l.nodeName==="HTML"?y=-l.clientWidth+h.right:y=-c.width+h.right:y=h.left,a&&x)d[x]="translate3d("+y+"px, "+w+"px, 0)",d[m]=0,d[g]=0,d.willChange="transform";else{var S=m==="bottom"?-1:1,k=g==="right"?-1:1;d[m]=w*S,d[g]=y*k,d.willChange=m+", "+g}var j={"x-placement":t.placement};return t.attributes=ja({},j,t.attributes),t.styles=ja({},d,t.styles),t.arrowStyles=ja({},t.offsets.arrow,t.arrowStyles),t}function tQ(t,e,n){var r=og(t,function(l){var c=l.name;return c===e}),s=!!r&&t.some(function(l){return l.name===n&&l.enabled&&l.order<r.order});if(!s){var i="`"+e+"`",a="`"+n+"`";console.warn(a+" modifier is required by "+i+" modifier in order to work, be sure to include it before "+i+"!")}return s}function Sge(t,e){var n;if(!tQ(t.instance.modifiers,"arrow","keepTogether"))return t;var r=e.element;if(typeof r=="string"){if(r=t.instance.popper.querySelector(r),!r)return t}else if(!t.instance.popper.contains(r))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),t;var s=t.placement.split("-")[0],i=t.offsets,a=i.popper,l=i.reference,c=["left","right"].indexOf(s)!==-1,d=c?"height":"width",h=c?"Top":"Left",m=h.toLowerCase(),g=c?"left":"top",x=c?"bottom":"right",y=XH(r)[d];l[x]-y<a[m]&&(t.offsets.popper[m]-=a[m]-(l[x]-y)),l[m]+y>a[x]&&(t.offsets.popper[m]+=l[m]+y-a[x]),t.offsets.popper=nu(t.offsets.popper);var w=l[m]+l[d]/2-y/2,S=Sd(t.instance.popper),k=parseFloat(S["margin"+h]),j=parseFloat(S["border"+h+"Width"]),N=w-t.offsets.popper[m]-k-j;return N=Math.max(Math.min(a[d]-y,N),0),t.arrowElement=r,t.offsets.arrow=(n={},uf(n,m,Math.round(N)),uf(n,g,""),n),t}function kge(t){return t==="end"?"start":t==="start"?"end":t}var nQ=["auto-start","auto","auto-end","top-start","top","top-end","right-start","right","right-end","bottom-end","bottom","bottom-start","left-end","left","left-start"],OS=nQ.slice(3);function HA(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=OS.indexOf(t),r=OS.slice(n+1).concat(OS.slice(0,n));return e?r.reverse():r}var jS={FLIP:"flip",CLOCKWISE:"clockwise",COUNTERCLOCKWISE:"counterclockwise"};function Oge(t,e){if(ZH(t.instance.modifiers,"inner")||t.flipped&&t.placement===t.originalPlacement)return t;var n=K6(t.instance.popper,t.instance.reference,e.padding,e.boundariesElement,t.positionFixed),r=t.placement.split("-")[0],s=xy(r),i=t.placement.split("-")[1]||"",a=[];switch(e.behavior){case jS.FLIP:a=[r,s];break;case jS.CLOCKWISE:a=HA(r);break;case jS.COUNTERCLOCKWISE:a=HA(r,!0);break;default:a=e.behavior}return a.forEach(function(l,c){if(r!==l||a.length===c+1)return t;r=t.placement.split("-")[0],s=xy(r);var d=t.offsets.popper,h=t.offsets.reference,m=Math.floor,g=r==="left"&&m(d.right)>m(h.left)||r==="right"&&m(d.left)<m(h.right)||r==="top"&&m(d.bottom)>m(h.top)||r==="bottom"&&m(d.top)<m(h.bottom),x=m(d.left)<m(n.left),y=m(d.right)>m(n.right),w=m(d.top)<m(n.top),S=m(d.bottom)>m(n.bottom),k=r==="left"&&x||r==="right"&&y||r==="top"&&w||r==="bottom"&&S,j=["top","bottom"].indexOf(r)!==-1,N=!!e.flipVariations&&(j&&i==="start"&&x||j&&i==="end"&&y||!j&&i==="start"&&w||!j&&i==="end"&&S),T=!!e.flipVariationsByContent&&(j&&i==="start"&&y||j&&i==="end"&&x||!j&&i==="start"&&S||!j&&i==="end"&&w),E=N||T;(g||k||E)&&(t.flipped=!0,(g||k)&&(r=a[c+1]),E&&(i=kge(i)),t.placement=r+(i?"-"+i:""),t.offsets.popper=ja({},t.offsets.popper,YH(t.instance.popper,t.offsets.reference,t.placement)),t=KH(t.instance.modifiers,t,"flip"))}),t}function jge(t){var e=t.offsets,n=e.popper,r=e.reference,s=t.placement.split("-")[0],i=Math.floor,a=["top","bottom"].indexOf(s)!==-1,l=a?"right":"bottom",c=a?"left":"top",d=a?"width":"height";return n[l]<i(r[c])&&(t.offsets.popper[c]=i(r[c])-n[d]),n[c]>i(r[l])&&(t.offsets.popper[c]=i(r[l])),t}function Nge(t,e,n,r){var s=t.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),i=+s[1],a=s[2];if(!i)return t;if(a.indexOf("%")===0){var l=void 0;switch(a){case"%p":l=n;break;case"%":case"%r":default:l=r}var c=nu(l);return c[e]/100*i}else if(a==="vh"||a==="vw"){var d=void 0;return a==="vh"?d=Math.max(document.documentElement.clientHeight,window.innerHeight||0):d=Math.max(document.documentElement.clientWidth,window.innerWidth||0),d/100*i}else return i}function Cge(t,e,n,r){var s=[0,0],i=["right","left"].indexOf(r)!==-1,a=t.split(/(\+|\-)/).map(function(h){return h.trim()}),l=a.indexOf(og(a,function(h){return h.search(/,|\s/)!==-1}));a[l]&&a[l].indexOf(",")===-1&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var c=/\s*,\s*|\s+/,d=l!==-1?[a.slice(0,l).concat([a[l].split(c)[0]]),[a[l].split(c)[1]].concat(a.slice(l+1))]:[a];return d=d.map(function(h,m){var g=(m===1?!i:i)?"height":"width",x=!1;return h.reduce(function(y,w){return y[y.length-1]===""&&["+","-"].indexOf(w)!==-1?(y[y.length-1]=w,x=!0,y):x?(y[y.length-1]+=w,x=!1,y):y.concat(w)},[]).map(function(y){return Nge(y,g,e,n)})}),d.forEach(function(h,m){h.forEach(function(g,x){J6(g)&&(s[m]+=g*(h[x-1]==="-"?-1:1))})}),s}function Tge(t,e){var n=e.offset,r=t.placement,s=t.offsets,i=s.popper,a=s.reference,l=r.split("-")[0],c=void 0;return J6(+n)?c=[+n,0]:c=Cge(n,i,a,l),l==="left"?(i.top+=c[0],i.left-=c[1]):l==="right"?(i.top+=c[0],i.left+=c[1]):l==="top"?(i.left+=c[0],i.top-=c[1]):l==="bottom"&&(i.left+=c[0],i.top+=c[1]),t.popper=i,t}function Ege(t,e){var n=e.boundariesElement||lf(t.instance.popper);t.instance.reference===n&&(n=lf(n));var r=Z6("transform"),s=t.instance.popper.style,i=s.top,a=s.left,l=s[r];s.top="",s.left="",s[r]="";var c=K6(t.instance.popper,t.instance.reference,e.padding,n,t.positionFixed);s.top=i,s.left=a,s[r]=l,e.boundaries=c;var d=e.priority,h=t.offsets.popper,m={primary:function(x){var y=h[x];return h[x]<c[x]&&!e.escapeWithReference&&(y=Math.max(h[x],c[x])),uf({},x,y)},secondary:function(x){var y=x==="right"?"left":"top",w=h[y];return h[x]>c[x]&&!e.escapeWithReference&&(w=Math.min(h[y],c[x]-(x==="right"?h.width:h.height))),uf({},y,w)}};return d.forEach(function(g){var x=["left","top"].indexOf(g)!==-1?"primary":"secondary";h=ja({},h,m[x](g))}),t.offsets.popper=h,t}function _ge(t){var e=t.placement,n=e.split("-")[0],r=e.split("-")[1];if(r){var s=t.offsets,i=s.reference,a=s.popper,l=["bottom","top"].indexOf(n)!==-1,c=l?"left":"top",d=l?"width":"height",h={start:uf({},c,i[c]),end:uf({},c,i[c]+i[d]-a[d])};t.offsets.popper=ja({},a,h[r])}return t}function Age(t){if(!tQ(t.instance.modifiers,"hide","preventOverflow"))return t;var e=t.offsets.reference,n=og(t.instance.modifiers,function(r){return r.name==="preventOverflow"}).boundaries;if(e.bottom<n.top||e.left>n.right||e.top>n.bottom||e.right<n.left){if(t.hide===!0)return t;t.hide=!0,t.attributes["x-out-of-boundaries"]=""}else{if(t.hide===!1)return t;t.hide=!1,t.attributes["x-out-of-boundaries"]=!1}return t}function Mge(t){var e=t.placement,n=e.split("-")[0],r=t.offsets,s=r.popper,i=r.reference,a=["left","right"].indexOf(n)!==-1,l=["top","left"].indexOf(n)===-1;return s[a?"left":"top"]=i[n]-(l?s[a?"width":"height"]:0),t.placement=xy(e),t.offsets.popper=nu(s),t}var Rge={shift:{order:100,enabled:!0,fn:_ge},offset:{order:200,enabled:!0,fn:Tge,offset:0},preventOverflow:{order:300,enabled:!0,fn:Ege,priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:jge},arrow:{order:500,enabled:!0,fn:Sge,element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:Oge,behavior:"flip",padding:5,boundariesElement:"viewport",flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:Mge},hide:{order:800,enabled:!0,fn:Age},computeStyle:{order:850,enabled:!0,fn:wge,gpuAcceleration:!0,x:"bottom",y:"right"},applyStyle:{order:900,enabled:!0,fn:xge,onLoad:vge,gpuAcceleration:void 0}},Dge={placement:"bottom",positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:Rge},hp=(function(){function t(e,n){var r=this,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};ige(this,t),this.scheduleUpdate=function(){return requestAnimationFrame(r.update)},this.update=nge(this.update.bind(this)),this.options=ja({},t.Defaults,s),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=e&&e.jquery?e[0]:e,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(ja({},t.Defaults.modifiers,s.modifiers)).forEach(function(a){r.options.modifiers[a]=ja({},t.Defaults.modifiers[a]||{},s.modifiers?s.modifiers[a]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(a){return ja({name:a},r.options.modifiers[a])}).sort(function(a,l){return a.order-l.order}),this.modifiers.forEach(function(a){a.enabled&&$H(a.onLoad)&&a.onLoad(r.reference,r.popper,r.options,a,r.state)}),this.update();var i=this.options.eventsEnabled;i&&this.enableEventListeners(),this.state.eventsEnabled=i}return age(t,[{key:"update",value:function(){return uge.call(this)}},{key:"destroy",value:function(){return dge.call(this)}},{key:"enableEventListeners",value:function(){return fge.call(this)}},{key:"disableEventListeners",value:function(){return pge.call(this)}}]),t})();hp.Utils=(typeof window<"u"?window:global).PopperUtils;hp.placements=nQ;hp.Defaults=Dge;var Pge=["innerHTML","ownerDocument","style","attributes","nodeValue"],zge=["Array","ArrayBuffer","AsyncFunction","AsyncGenerator","AsyncGeneratorFunction","Date","Error","Function","Generator","GeneratorFunction","HTMLElement","Map","Object","Promise","RegExp","Set","WeakMap","WeakSet"],Ige=["bigint","boolean","null","number","string","symbol","undefined"];function Rb(t){var e=Object.prototype.toString.call(t).slice(8,-1);if(/HTML\w+Element/.test(e))return"HTMLElement";if(Lge(e))return e}function ao(t){return function(e){return Rb(e)===t}}function Lge(t){return zge.includes(t)}function zf(t){return function(e){return typeof e===t}}function Bge(t){return Ige.includes(t)}function Ee(t){if(t===null)return"null";switch(typeof t){case"bigint":return"bigint";case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"symbol":return"symbol";case"undefined":return"undefined"}if(Ee.array(t))return"Array";if(Ee.plainFunction(t))return"Function";var e=Rb(t);return e||"Object"}Ee.array=Array.isArray;Ee.arrayOf=function(t,e){return!Ee.array(t)&&!Ee.function(e)?!1:t.every(function(n){return e(n)})};Ee.asyncGeneratorFunction=function(t){return Rb(t)==="AsyncGeneratorFunction"};Ee.asyncFunction=ao("AsyncFunction");Ee.bigint=zf("bigint");Ee.boolean=function(t){return t===!0||t===!1};Ee.date=ao("Date");Ee.defined=function(t){return!Ee.undefined(t)};Ee.domElement=function(t){return Ee.object(t)&&!Ee.plainObject(t)&&t.nodeType===1&&Ee.string(t.nodeName)&&Pge.every(function(e){return e in t})};Ee.empty=function(t){return Ee.string(t)&&t.length===0||Ee.array(t)&&t.length===0||Ee.object(t)&&!Ee.map(t)&&!Ee.set(t)&&Object.keys(t).length===0||Ee.set(t)&&t.size===0||Ee.map(t)&&t.size===0};Ee.error=ao("Error");Ee.function=zf("function");Ee.generator=function(t){return Ee.iterable(t)&&Ee.function(t.next)&&Ee.function(t.throw)};Ee.generatorFunction=ao("GeneratorFunction");Ee.instanceOf=function(t,e){return!t||!e?!1:Object.getPrototypeOf(t)===e.prototype};Ee.iterable=function(t){return!Ee.nullOrUndefined(t)&&Ee.function(t[Symbol.iterator])};Ee.map=ao("Map");Ee.nan=function(t){return Number.isNaN(t)};Ee.null=function(t){return t===null};Ee.nullOrUndefined=function(t){return Ee.null(t)||Ee.undefined(t)};Ee.number=function(t){return zf("number")(t)&&!Ee.nan(t)};Ee.numericString=function(t){return Ee.string(t)&&t.length>0&&!Number.isNaN(Number(t))};Ee.object=function(t){return!Ee.nullOrUndefined(t)&&(Ee.function(t)||typeof t=="object")};Ee.oneOf=function(t,e){return Ee.array(t)?t.indexOf(e)>-1:!1};Ee.plainFunction=ao("Function");Ee.plainObject=function(t){if(Rb(t)!=="Object")return!1;var e=Object.getPrototypeOf(t);return e===null||e===Object.getPrototypeOf({})};Ee.primitive=function(t){return Ee.null(t)||Bge(typeof t)};Ee.promise=ao("Promise");Ee.propertyOf=function(t,e,n){if(!Ee.object(t)||!e)return!1;var r=t[e];return Ee.function(n)?n(r):Ee.defined(r)};Ee.regexp=ao("RegExp");Ee.set=ao("Set");Ee.string=zf("string");Ee.symbol=zf("symbol");Ee.undefined=zf("undefined");Ee.weakMap=ao("WeakMap");Ee.weakSet=ao("WeakSet");function rQ(t){return function(e){return typeof e===t}}var Fge=rQ("function"),qge=function(t){return t===null},QA=function(t){return Object.prototype.toString.call(t).slice(8,-1)==="RegExp"},VA=function(t){return!$ge(t)&&!qge(t)&&(Fge(t)||typeof t=="object")},$ge=rQ("undefined"),kO=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};function Hge(t,e){var n=t.length;if(n!==e.length)return!1;for(var r=n;r--!==0;)if(!Si(t[r],e[r]))return!1;return!0}function Qge(t,e){if(t.byteLength!==e.byteLength)return!1;for(var n=new DataView(t.buffer),r=new DataView(e.buffer),s=t.byteLength;s--;)if(n.getUint8(s)!==r.getUint8(s))return!1;return!0}function Vge(t,e){var n,r,s,i;if(t.size!==e.size)return!1;try{for(var a=kO(t.entries()),l=a.next();!l.done;l=a.next()){var c=l.value;if(!e.has(c[0]))return!1}}catch(m){n={error:m}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}try{for(var d=kO(t.entries()),h=d.next();!h.done;h=d.next()){var c=h.value;if(!Si(c[1],e.get(c[0])))return!1}}catch(m){s={error:m}}finally{try{h&&!h.done&&(i=d.return)&&i.call(d)}finally{if(s)throw s.error}}return!0}function Uge(t,e){var n,r;if(t.size!==e.size)return!1;try{for(var s=kO(t.entries()),i=s.next();!i.done;i=s.next()){var a=i.value;if(!e.has(a[0]))return!1}}catch(l){n={error:l}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return!0}function Si(t,e){if(t===e)return!0;if(t&&VA(t)&&e&&VA(e)){if(t.constructor!==e.constructor)return!1;if(Array.isArray(t)&&Array.isArray(e))return Hge(t,e);if(t instanceof Map&&e instanceof Map)return Vge(t,e);if(t instanceof Set&&e instanceof Set)return Uge(t,e);if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(e))return Qge(t,e);if(QA(t)&&QA(e))return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(var s=n.length;s--!==0;)if(!Object.prototype.hasOwnProperty.call(e,n[s]))return!1;for(var s=n.length;s--!==0;){var i=n[s];if(!(i==="_owner"&&t.$$typeof)&&!Si(t[i],e[i]))return!1}return!0}return Number.isNaN(t)&&Number.isNaN(e)?!0:t===e}function Wge(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.every(function(n){return Ee.string(n)||Ee.array(n)||Ee.plainObject(n)})}function Gge(t,e,n){return sQ(t,e)?[t,e].every(Ee.array)?!t.some(YA(n))&&e.some(YA(n)):[t,e].every(Ee.plainObject)?!Object.entries(t).some(XA(n))&&Object.entries(e).some(XA(n)):e===n:!1}function UA(t,e,n){var r=n.actual,s=n.key,i=n.previous,a=n.type,l=Ao(t,s),c=Ao(e,s),d=[l,c].every(Ee.number)&&(a==="increased"?l<c:l>c);return Ee.undefined(r)||(d=d&&c===r),Ee.undefined(i)||(d=d&&l===i),d}function WA(t,e,n){var r=n.key,s=n.type,i=n.value,a=Ao(t,r),l=Ao(e,r),c=s==="added"?a:l,d=s==="added"?l:a;if(!Ee.nullOrUndefined(i)){if(Ee.defined(c)){if(Ee.array(c)||Ee.plainObject(c))return Gge(c,d,i)}else return Si(d,i);return!1}return[a,l].every(Ee.array)?!d.every(eN(c)):[a,l].every(Ee.plainObject)?Xge(Object.keys(c),Object.keys(d)):![a,l].every(function(h){return Ee.primitive(h)&&Ee.defined(h)})&&(s==="added"?!Ee.defined(a)&&Ee.defined(l):Ee.defined(a)&&!Ee.defined(l))}function GA(t,e,n){var r=n===void 0?{}:n,s=r.key,i=Ao(t,s),a=Ao(e,s);if(!sQ(i,a))throw new TypeError("Inputs have different types");if(!Wge(i,a))throw new TypeError("Inputs don't have length");return[i,a].every(Ee.plainObject)&&(i=Object.keys(i),a=Object.keys(a)),[i,a]}function XA(t){return function(e){var n=e[0],r=e[1];return Ee.array(t)?Si(t,r)||t.some(function(s){return Si(s,r)||Ee.array(r)&&eN(r)(s)}):Ee.plainObject(t)&&t[n]?!!t[n]&&Si(t[n],r):Si(t,r)}}function Xge(t,e){return e.some(function(n){return!t.includes(n)})}function YA(t){return function(e){return Ee.array(t)?t.some(function(n){return Si(n,e)||Ee.array(e)&&eN(e)(n)}):Si(t,e)}}function Wm(t,e){return Ee.array(t)?t.some(function(n){return Si(n,e)}):Si(t,e)}function eN(t){return function(e){return t.some(function(n){return Si(n,e)})}}function sQ(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.every(Ee.array)||t.every(Ee.number)||t.every(Ee.plainObject)||t.every(Ee.string)}function Ao(t,e){if(Ee.plainObject(t)||Ee.array(t)){if(Ee.string(e)){var n=e.split(".");return n.reduce(function(r,s){return r&&r[s]},t)}return Ee.number(e)?t[e]:t}return t}function Yge(t,e){if([t,e].some(Ee.nullOrUndefined))throw new Error("Missing required parameters");if(![t,e].every(function(m){return Ee.plainObject(m)||Ee.array(m)}))throw new Error("Expected plain objects or array");var n=function(m,g){try{return WA(t,e,{key:m,type:"added",value:g})}catch{return!1}},r=function(m,g,x){try{var y=Ao(t,m),w=Ao(e,m),S=Ee.defined(g),k=Ee.defined(x);if(S||k){var j=k?Wm(x,y):!Wm(g,y),N=Wm(g,w);return j&&N}return[y,w].every(Ee.array)||[y,w].every(Ee.plainObject)?!Si(y,w):y!==w}catch{return!1}},s=function(m,g,x){if(!Ee.defined(m))return!1;try{var y=Ao(t,m),w=Ao(e,m),S=Ee.defined(x);return Wm(g,y)&&(S?Wm(x,w):!S)}catch{return!1}},i=function(m,g){return Ee.defined(m)?r(m,g):!1},a=function(m,g,x){if(!Ee.defined(m))return!1;try{return UA(t,e,{key:m,actual:g,previous:x,type:"decreased"})}catch{return!1}},l=function(m){try{var g=GA(t,e,{key:m}),x=g[0],y=g[1];return!!x.length&&!y.length}catch{return!1}},c=function(m){try{var g=GA(t,e,{key:m}),x=g[0],y=g[1];return!x.length&&!!y.length}catch{return!1}},d=function(m,g,x){if(!Ee.defined(m))return!1;try{return UA(t,e,{key:m,actual:g,previous:x,type:"increased"})}catch{return!1}},h=function(m,g){try{return WA(t,e,{key:m,type:"removed",value:g})}catch{return!1}};return{added:n,changed:r,changedFrom:s,changedTo:i,decreased:a,emptied:l,filled:c,increased:d,removed:h}}function KA(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,r)}return n}function jr(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?KA(Object(n),!0).forEach(function(r){Fs(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):KA(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function lg(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Kge(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,aQ(r.key),r)}}function cg(t,e,n){return e&&Kge(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Fs(t,e,n){return e=aQ(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ug(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&OO(t,e)}function vy(t){return vy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},vy(t)}function OO(t,e){return OO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},OO(t,e)}function Zge(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Jge(t,e){if(t==null)return{};var n={},r=Object.keys(t),s,i;for(i=0;i<r.length;i++)s=r[i],!(e.indexOf(s)>=0)&&(n[s]=t[s]);return n}function iQ(t,e){if(t==null)return{};var n=Jge(t,e),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function El(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function exe(t,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return El(t)}function dg(t){var e=Zge();return function(){var r=vy(t),s;if(e){var i=vy(this).constructor;s=Reflect.construct(r,arguments,i)}else s=r.apply(this,arguments);return exe(this,s)}}function txe(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function aQ(t){var e=txe(t,"string");return typeof e=="symbol"?e:String(e)}var nxe={flip:{padding:20},preventOverflow:{padding:10}},rxe="The typeValidator argument must be a function with the signature function(props, propName, componentName).",sxe="The error message is optional, but must be a string if provided.";function ixe(t,e,n,r){return typeof t=="boolean"?t:typeof t=="function"?t(e,n,r):t?!!t:!1}function axe(t,e){return Object.hasOwnProperty.call(t,e)}function oxe(t,e,n,r){return new Error("Required ".concat(t[e]," `").concat(e,"` was not specified in `").concat(n,"`."))}function lxe(t,e){if(typeof t!="function")throw new TypeError(rxe);if(e&&typeof e!="string")throw new TypeError(sxe)}function ZA(t,e,n){return lxe(t,n),function(r,s,i){for(var a=arguments.length,l=new Array(a>3?a-3:0),c=3;c<a;c++)l[c-3]=arguments[c];return ixe(e,r,s,i)?axe(r,s)?t.apply(void 0,[r,s,i].concat(l)):oxe(r,s,i):t.apply(void 0,[r,s,i].concat(l))}}var Tn={INIT:"init",IDLE:"idle",OPENING:"opening",OPEN:"open",CLOSING:"closing"},Gm=sv.createPortal!==void 0;function bo(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function NS(){return"ontouchstart"in window&&/Mobi/.test(navigator.userAgent)}function E1(t){var e=t.title,n=t.data,r=t.warn,s=r===void 0?!1:r,i=t.debug,a=i===void 0?!1:i,l=s?console.warn||console.error:console.log;a&&e&&n&&(console.groupCollapsed("%creact-floater: ".concat(e),"color: #9b00ff; font-weight: bold; font-size: 12px;"),Array.isArray(n)?n.forEach(function(c){Ee.plainObject(c)&&c.key?l.apply(console,[c.key,c.value]):l.apply(console,[c])}):l.apply(console,[n]),console.groupEnd())}function cxe(t,e,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;t.addEventListener(e,n,r)}function uxe(t,e,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;t.removeEventListener(e,n,r)}function dxe(t,e,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,s;s=function(a){n(a),uxe(t,e,s)},cxe(t,e,s,r)}function JA(){}var oQ=(function(t){ug(n,t);var e=dg(n);function n(){return lg(this,n),e.apply(this,arguments)}return cg(n,[{key:"componentDidMount",value:function(){bo()&&(this.node||this.appendNode(),Gm||this.renderPortal())}},{key:"componentDidUpdate",value:function(){bo()&&(Gm||this.renderPortal())}},{key:"componentWillUnmount",value:function(){!bo()||!this.node||(Gm||sv.unmountComponentAtNode(this.node),this.node&&this.node.parentNode===document.body&&(document.body.removeChild(this.node),this.node=void 0))}},{key:"appendNode",value:function(){var s=this.props,i=s.id,a=s.zIndex;this.node||(this.node=document.createElement("div"),i&&(this.node.id=i),a&&(this.node.style.zIndex=a),document.body.appendChild(this.node))}},{key:"renderPortal",value:function(){if(!bo())return null;var s=this.props,i=s.children,a=s.setRef;if(this.node||this.appendNode(),Gm)return sv.createPortal(i,this.node);var l=sv.unstable_renderSubtreeIntoContainer(this,i.length>1?oe.createElement("div",null,i):i[0],this.node);return a(l),null}},{key:"renderReact16",value:function(){var s=this.props,i=s.hasChildren,a=s.placement,l=s.target;return i?this.renderPortal():l||a==="center"?this.renderPortal():null}},{key:"render",value:function(){return Gm?this.renderReact16():null}}]),n})(oe.Component);Fs(oQ,"propTypes",{children:Ge.oneOfType([Ge.element,Ge.array]),hasChildren:Ge.bool,id:Ge.oneOfType([Ge.string,Ge.number]),placement:Ge.string,setRef:Ge.func.isRequired,target:Ge.oneOfType([Ge.object,Ge.string]),zIndex:Ge.number});var lQ=(function(t){ug(n,t);var e=dg(n);function n(){return lg(this,n),e.apply(this,arguments)}return cg(n,[{key:"parentStyle",get:function(){var s=this.props,i=s.placement,a=s.styles,l=a.arrow.length,c={pointerEvents:"none",position:"absolute",width:"100%"};return i.startsWith("top")?(c.bottom=0,c.left=0,c.right=0,c.height=l):i.startsWith("bottom")?(c.left=0,c.right=0,c.top=0,c.height=l):i.startsWith("left")?(c.right=0,c.top=0,c.bottom=0):i.startsWith("right")&&(c.left=0,c.top=0),c}},{key:"render",value:function(){var s=this.props,i=s.placement,a=s.setArrowRef,l=s.styles,c=l.arrow,d=c.color,h=c.display,m=c.length,g=c.margin,x=c.position,y=c.spread,w={display:h,position:x},S,k=y,j=m;return i.startsWith("top")?(S="0,0 ".concat(k/2,",").concat(j," ").concat(k,",0"),w.bottom=0,w.marginLeft=g,w.marginRight=g):i.startsWith("bottom")?(S="".concat(k,",").concat(j," ").concat(k/2,",0 0,").concat(j),w.top=0,w.marginLeft=g,w.marginRight=g):i.startsWith("left")?(j=y,k=m,S="0,0 ".concat(k,",").concat(j/2," 0,").concat(j),w.right=0,w.marginTop=g,w.marginBottom=g):i.startsWith("right")&&(j=y,k=m,S="".concat(k,",").concat(j," ").concat(k,",0 0,").concat(j/2),w.left=0,w.marginTop=g,w.marginBottom=g),oe.createElement("div",{className:"__floater__arrow",style:this.parentStyle},oe.createElement("span",{ref:a,style:w},oe.createElement("svg",{width:k,height:j,version:"1.1",xmlns:"http://www.w3.org/2000/svg"},oe.createElement("polygon",{points:S,fill:d}))))}}]),n})(oe.Component);Fs(lQ,"propTypes",{placement:Ge.string.isRequired,setArrowRef:Ge.func.isRequired,styles:Ge.object.isRequired});var hxe=["color","height","width"];function cQ(t){var e=t.handleClick,n=t.styles,r=n.color,s=n.height,i=n.width,a=iQ(n,hxe);return oe.createElement("button",{"aria-label":"close",onClick:e,style:a,type:"button"},oe.createElement("svg",{width:"".concat(i,"px"),height:"".concat(s,"px"),viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"xMidYMid"},oe.createElement("g",null,oe.createElement("path",{d:"M8.13911129,9.00268191 L0.171521827,17.0258467 C-0.0498027049,17.248715 -0.0498027049,17.6098394 0.171521827,17.8327545 C0.28204354,17.9443526 0.427188206,17.9998706 0.572051765,17.9998706 C0.71714958,17.9998706 0.862013139,17.9443526 0.972581703,17.8327545 L9.0000937,9.74924618 L17.0276057,17.8327545 C17.1384085,17.9443526 17.2832721,17.9998706 17.4281356,17.9998706 C17.5729992,17.9998706 17.718097,17.9443526 17.8286656,17.8327545 C18.0499901,17.6098862 18.0499901,17.2487618 17.8286656,17.0258467 L9.86135722,9.00268191 L17.8340066,0.973848225 C18.0553311,0.750979934 18.0553311,0.389855532 17.8340066,0.16694039 C17.6126821,-0.0556467968 17.254037,-0.0556467968 17.0329467,0.16694039 L9.00042166,8.25611765 L0.967006424,0.167268345 C0.745681892,-0.0553188426 0.387317931,-0.0553188426 0.165993399,0.167268345 C-0.0553311331,0.390136635 -0.0553311331,0.751261038 0.165993399,0.974176179 L8.13920499,9.00268191 L8.13911129,9.00268191 Z",fill:r}))))}cQ.propTypes={handleClick:Ge.func.isRequired,styles:Ge.object.isRequired};function uQ(t){var e=t.content,n=t.footer,r=t.handleClick,s=t.open,i=t.positionWrapper,a=t.showCloseButton,l=t.title,c=t.styles,d={content:oe.isValidElement(e)?e:oe.createElement("div",{className:"__floater__content",style:c.content},e)};return l&&(d.title=oe.isValidElement(l)?l:oe.createElement("div",{className:"__floater__title",style:c.title},l)),n&&(d.footer=oe.isValidElement(n)?n:oe.createElement("div",{className:"__floater__footer",style:c.footer},n)),(a||i)&&!Ee.boolean(s)&&(d.close=oe.createElement(cQ,{styles:c.close,handleClick:r})),oe.createElement("div",{className:"__floater__container",style:c.container},d.close,d.title,d.content,d.footer)}uQ.propTypes={content:Ge.node.isRequired,footer:Ge.node,handleClick:Ge.func.isRequired,open:Ge.bool,positionWrapper:Ge.bool.isRequired,showCloseButton:Ge.bool.isRequired,styles:Ge.object.isRequired,title:Ge.node};var dQ=(function(t){ug(n,t);var e=dg(n);function n(){return lg(this,n),e.apply(this,arguments)}return cg(n,[{key:"style",get:function(){var s=this.props,i=s.disableAnimation,a=s.component,l=s.placement,c=s.hideArrow,d=s.status,h=s.styles,m=h.arrow.length,g=h.floater,x=h.floaterCentered,y=h.floaterClosing,w=h.floaterOpening,S=h.floaterWithAnimation,k=h.floaterWithComponent,j={};return c||(l.startsWith("top")?j.padding="0 0 ".concat(m,"px"):l.startsWith("bottom")?j.padding="".concat(m,"px 0 0"):l.startsWith("left")?j.padding="0 ".concat(m,"px 0 0"):l.startsWith("right")&&(j.padding="0 0 0 ".concat(m,"px"))),[Tn.OPENING,Tn.OPEN].indexOf(d)!==-1&&(j=jr(jr({},j),w)),d===Tn.CLOSING&&(j=jr(jr({},j),y)),d===Tn.OPEN&&!i&&(j=jr(jr({},j),S)),l==="center"&&(j=jr(jr({},j),x)),a&&(j=jr(jr({},j),k)),jr(jr({},g),j)}},{key:"render",value:function(){var s=this.props,i=s.component,a=s.handleClick,l=s.hideArrow,c=s.setFloaterRef,d=s.status,h={},m=["__floater"];return i?oe.isValidElement(i)?h.content=oe.cloneElement(i,{closeFn:a}):h.content=i({closeFn:a}):h.content=oe.createElement(uQ,this.props),d===Tn.OPEN&&m.push("__floater__open"),l||(h.arrow=oe.createElement(lQ,this.props)),oe.createElement("div",{ref:c,className:m.join(" "),style:this.style},oe.createElement("div",{className:"__floater__body"},h.content,h.arrow))}}]),n})(oe.Component);Fs(dQ,"propTypes",{component:Ge.oneOfType([Ge.func,Ge.element]),content:Ge.node,disableAnimation:Ge.bool.isRequired,footer:Ge.node,handleClick:Ge.func.isRequired,hideArrow:Ge.bool.isRequired,open:Ge.bool,placement:Ge.string.isRequired,positionWrapper:Ge.bool.isRequired,setArrowRef:Ge.func.isRequired,setFloaterRef:Ge.func.isRequired,showCloseButton:Ge.bool,status:Ge.string.isRequired,styles:Ge.object.isRequired,title:Ge.node});var hQ=(function(t){ug(n,t);var e=dg(n);function n(){return lg(this,n),e.apply(this,arguments)}return cg(n,[{key:"render",value:function(){var s=this.props,i=s.children,a=s.handleClick,l=s.handleMouseEnter,c=s.handleMouseLeave,d=s.setChildRef,h=s.setWrapperRef,m=s.style,g=s.styles,x;if(i)if(oe.Children.count(i)===1)if(!oe.isValidElement(i))x=oe.createElement("span",null,i);else{var y=Ee.function(i.type)?"innerRef":"ref";x=oe.cloneElement(oe.Children.only(i),Fs({},y,d))}else x=i;return x?oe.createElement("span",{ref:h,style:jr(jr({},g),m),onClick:a,onMouseEnter:l,onMouseLeave:c},x):null}}]),n})(oe.Component);Fs(hQ,"propTypes",{children:Ge.node,handleClick:Ge.func.isRequired,handleMouseEnter:Ge.func.isRequired,handleMouseLeave:Ge.func.isRequired,setChildRef:Ge.func.isRequired,setWrapperRef:Ge.func.isRequired,style:Ge.object,styles:Ge.object.isRequired});var fxe={zIndex:100};function mxe(t){var e=Ua(fxe,t.options||{});return{wrapper:{cursor:"help",display:"inline-flex",flexDirection:"column",zIndex:e.zIndex},wrapperPosition:{left:-1e3,position:"absolute",top:-1e3,visibility:"hidden"},floater:{display:"inline-block",filter:"drop-shadow(0 0 3px rgba(0, 0, 0, 0.3))",maxWidth:300,opacity:0,position:"relative",transition:"opacity 0.3s",visibility:"hidden",zIndex:e.zIndex},floaterOpening:{opacity:1,visibility:"visible"},floaterWithAnimation:{opacity:1,transition:"opacity 0.3s, transform 0.2s",visibility:"visible"},floaterWithComponent:{maxWidth:"100%"},floaterClosing:{opacity:0,visibility:"visible"},floaterCentered:{left:"50%",position:"fixed",top:"50%",transform:"translate(-50%, -50%)"},container:{backgroundColor:"#fff",color:"#666",minHeight:60,minWidth:200,padding:20,position:"relative",zIndex:10},title:{borderBottom:"1px solid #555",color:"#555",fontSize:18,marginBottom:5,paddingBottom:6,paddingRight:18},content:{fontSize:15},close:{backgroundColor:"transparent",border:0,borderRadius:0,color:"#555",fontSize:0,height:15,outline:"none",padding:10,position:"absolute",right:0,top:0,width:15,WebkitAppearance:"none"},footer:{borderTop:"1px solid #ccc",fontSize:13,marginTop:10,paddingTop:5},arrow:{color:"#fff",display:"inline-flex",length:16,margin:8,position:"absolute",spread:32},options:e}}var pxe=["arrow","flip","offset"],gxe=["position","top","right","bottom","left"],tN=(function(t){ug(n,t);var e=dg(n);function n(r){var s;return lg(this,n),s=e.call(this,r),Fs(El(s),"setArrowRef",function(i){s.arrowRef=i}),Fs(El(s),"setChildRef",function(i){s.childRef=i}),Fs(El(s),"setFloaterRef",function(i){s.floaterRef=i}),Fs(El(s),"setWrapperRef",function(i){s.wrapperRef=i}),Fs(El(s),"handleTransitionEnd",function(){var i=s.state.status,a=s.props.callback;s.wrapperPopper&&s.wrapperPopper.instance.update(),s.setState({status:i===Tn.OPENING?Tn.OPEN:Tn.IDLE},function(){var l=s.state.status;a(l===Tn.OPEN?"open":"close",s.props)})}),Fs(El(s),"handleClick",function(){var i=s.props,a=i.event,l=i.open;if(!Ee.boolean(l)){var c=s.state,d=c.positionWrapper,h=c.status;(s.event==="click"||s.event==="hover"&&d)&&(E1({title:"click",data:[{event:a,status:h===Tn.OPEN?"closing":"opening"}],debug:s.debug}),s.toggle())}}),Fs(El(s),"handleMouseEnter",function(){var i=s.props,a=i.event,l=i.open;if(!(Ee.boolean(l)||NS())){var c=s.state.status;s.event==="hover"&&c===Tn.IDLE&&(E1({title:"mouseEnter",data:[{key:"originalEvent",value:a}],debug:s.debug}),clearTimeout(s.eventDelayTimeout),s.toggle())}}),Fs(El(s),"handleMouseLeave",function(){var i=s.props,a=i.event,l=i.eventDelay,c=i.open;if(!(Ee.boolean(c)||NS())){var d=s.state,h=d.status,m=d.positionWrapper;s.event==="hover"&&(E1({title:"mouseLeave",data:[{key:"originalEvent",value:a}],debug:s.debug}),l?[Tn.OPENING,Tn.OPEN].indexOf(h)!==-1&&!m&&!s.eventDelayTimeout&&(s.eventDelayTimeout=setTimeout(function(){delete s.eventDelayTimeout,s.toggle()},l*1e3)):s.toggle(Tn.IDLE))}}),s.state={currentPlacement:r.placement,needsUpdate:!1,positionWrapper:r.wrapperOptions.position&&!!r.target,status:Tn.INIT,statusWrapper:Tn.INIT},s._isMounted=!1,s.hasMounted=!1,bo()&&window.addEventListener("load",function(){s.popper&&s.popper.instance.update(),s.wrapperPopper&&s.wrapperPopper.instance.update()}),s}return cg(n,[{key:"componentDidMount",value:function(){if(bo()){var s=this.state.positionWrapper,i=this.props,a=i.children,l=i.open,c=i.target;this._isMounted=!0,E1({title:"init",data:{hasChildren:!!a,hasTarget:!!c,isControlled:Ee.boolean(l),positionWrapper:s,target:this.target,floater:this.floaterRef},debug:this.debug}),this.hasMounted||(this.initPopper(),this.hasMounted=!0),!a&&c&&Ee.boolean(l)}}},{key:"componentDidUpdate",value:function(s,i){if(bo()){var a=this.props,l=a.autoOpen,c=a.open,d=a.target,h=a.wrapperOptions,m=Yge(i,this.state),g=m.changedFrom,x=m.changed;if(s.open!==c){var y;Ee.boolean(c)&&(y=c?Tn.OPENING:Tn.CLOSING),this.toggle(y)}(s.wrapperOptions.position!==h.position||s.target!==d)&&this.changeWrapperPosition(this.props),x("status",Tn.IDLE)&&c?this.toggle(Tn.OPEN):g("status",Tn.INIT,Tn.IDLE)&&l&&this.toggle(Tn.OPEN),this.popper&&x("status",Tn.OPENING)&&this.popper.instance.update(),this.floaterRef&&(x("status",Tn.OPENING)||x("status",Tn.CLOSING))&&dxe(this.floaterRef,"transitionend",this.handleTransitionEnd),x("needsUpdate",!0)&&this.rebuildPopper()}}},{key:"componentWillUnmount",value:function(){bo()&&(this._isMounted=!1,this.popper&&this.popper.instance.destroy(),this.wrapperPopper&&this.wrapperPopper.instance.destroy())}},{key:"initPopper",value:function(){var s=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.target,a=this.state.positionWrapper,l=this.props,c=l.disableFlip,d=l.getPopper,h=l.hideArrow,m=l.offset,g=l.placement,x=l.wrapperOptions,y=g==="top"||g==="bottom"?"flip":["right","bottom-end","top-end","left","top-start","bottom-start"];if(g==="center")this.setState({status:Tn.IDLE});else if(i&&this.floaterRef){var w=this.options,S=w.arrow,k=w.flip,j=w.offset,N=iQ(w,pxe);new hp(i,this.floaterRef,{placement:g,modifiers:jr({arrow:jr({enabled:!h,element:this.arrowRef},S),flip:jr({enabled:!c,behavior:y},k),offset:jr({offset:"0, ".concat(m,"px")},j)},N),onCreate:function(_){var A;if(s.popper=_,!((A=s.floaterRef)!==null&&A!==void 0&&A.isConnected)){s.setState({needsUpdate:!0});return}d(_,"floater"),s._isMounted&&s.setState({currentPlacement:_.placement,status:Tn.IDLE}),g!==_.placement&&setTimeout(function(){_.instance.update()},1)},onUpdate:function(_){s.popper=_;var A=s.state.currentPlacement;s._isMounted&&_.placement!==A&&s.setState({currentPlacement:_.placement})}})}if(a){var T=Ee.undefined(x.offset)?0:x.offset;new hp(this.target,this.wrapperRef,{placement:x.placement||g,modifiers:{arrow:{enabled:!1},offset:{offset:"0, ".concat(T,"px")},flip:{enabled:!1}},onCreate:function(_){s.wrapperPopper=_,s._isMounted&&s.setState({statusWrapper:Tn.IDLE}),d(_,"wrapper"),g!==_.placement&&setTimeout(function(){_.instance.update()},1)}})}}},{key:"rebuildPopper",value:function(){var s=this;this.floaterRefInterval=setInterval(function(){var i;(i=s.floaterRef)!==null&&i!==void 0&&i.isConnected&&(clearInterval(s.floaterRefInterval),s.setState({needsUpdate:!1}),s.initPopper())},50)}},{key:"changeWrapperPosition",value:function(s){var i=s.target,a=s.wrapperOptions;this.setState({positionWrapper:a.position&&!!i})}},{key:"toggle",value:function(s){var i=this.state.status,a=i===Tn.OPEN?Tn.CLOSING:Tn.OPENING;Ee.undefined(s)||(a=s),this.setState({status:a})}},{key:"debug",get:function(){var s=this.props.debug;return s||bo()&&"ReactFloaterDebug"in window&&!!window.ReactFloaterDebug}},{key:"event",get:function(){var s=this.props,i=s.disableHoverToClick,a=s.event;return a==="hover"&&NS()&&!i?"click":a}},{key:"options",get:function(){var s=this.props.options;return Ua(nxe,s||{})}},{key:"styles",get:function(){var s=this,i=this.state,a=i.status,l=i.positionWrapper,c=i.statusWrapper,d=this.props.styles,h=Ua(mxe(d),d);if(l){var m;[Tn.IDLE].indexOf(a)===-1||[Tn.IDLE].indexOf(c)===-1?m=h.wrapperPosition:m=this.wrapperPopper.styles,h.wrapper=jr(jr({},h.wrapper),m)}if(this.target){var g=window.getComputedStyle(this.target);this.wrapperStyles?h.wrapper=jr(jr({},h.wrapper),this.wrapperStyles):["relative","static"].indexOf(g.position)===-1&&(this.wrapperStyles={},l||(gxe.forEach(function(x){s.wrapperStyles[x]=g[x]}),h.wrapper=jr(jr({},h.wrapper),this.wrapperStyles),this.target.style.position="relative",this.target.style.top="auto",this.target.style.right="auto",this.target.style.bottom="auto",this.target.style.left="auto"))}return h}},{key:"target",get:function(){if(!bo())return null;var s=this.props.target;return s?Ee.domElement(s)?s:document.querySelector(s):this.childRef||this.wrapperRef}},{key:"render",value:function(){var s=this.state,i=s.currentPlacement,a=s.positionWrapper,l=s.status,c=this.props,d=c.children,h=c.component,m=c.content,g=c.disableAnimation,x=c.footer,y=c.hideArrow,w=c.id,S=c.open,k=c.showCloseButton,j=c.style,N=c.target,T=c.title,E=oe.createElement(hQ,{handleClick:this.handleClick,handleMouseEnter:this.handleMouseEnter,handleMouseLeave:this.handleMouseLeave,setChildRef:this.setChildRef,setWrapperRef:this.setWrapperRef,style:j,styles:this.styles.wrapper},d),_={};return a?_.wrapperInPortal=E:_.wrapperAsChildren=E,oe.createElement("span",null,oe.createElement(oQ,{hasChildren:!!d,id:w,placement:i,setRef:this.setFloaterRef,target:N,zIndex:this.styles.options.zIndex},oe.createElement(dQ,{component:h,content:m,disableAnimation:g,footer:x,handleClick:this.handleClick,hideArrow:y||i==="center",open:S,placement:i,positionWrapper:a,setArrowRef:this.setArrowRef,setFloaterRef:this.setFloaterRef,showCloseButton:k,status:l,styles:this.styles,title:T}),_.wrapperInPortal),_.wrapperAsChildren)}}]),n})(oe.Component);Fs(tN,"propTypes",{autoOpen:Ge.bool,callback:Ge.func,children:Ge.node,component:ZA(Ge.oneOfType([Ge.func,Ge.element]),function(t){return!t.content}),content:ZA(Ge.node,function(t){return!t.component}),debug:Ge.bool,disableAnimation:Ge.bool,disableFlip:Ge.bool,disableHoverToClick:Ge.bool,event:Ge.oneOf(["hover","click"]),eventDelay:Ge.number,footer:Ge.node,getPopper:Ge.func,hideArrow:Ge.bool,id:Ge.oneOfType([Ge.string,Ge.number]),offset:Ge.number,open:Ge.bool,options:Ge.object,placement:Ge.oneOf(["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end","auto","center"]),showCloseButton:Ge.bool,style:Ge.object,styles:Ge.object,target:Ge.oneOfType([Ge.object,Ge.string]),title:Ge.node,wrapperOptions:Ge.shape({offset:Ge.number,placement:Ge.oneOf(["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end","auto"]),position:Ge.bool})});Fs(tN,"defaultProps",{autoOpen:!1,callback:JA,debug:!1,disableAnimation:!1,disableFlip:!1,disableHoverToClick:!1,event:"click",eventDelay:.4,getPopper:JA,hideArrow:!1,offset:15,placement:"bottom",showCloseButton:!1,styles:{},target:null,wrapperOptions:{position:!1}});var xxe=Object.defineProperty,vxe=(t,e,n)=>e in t?xxe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,xt=(t,e,n)=>vxe(t,typeof e!="symbol"?e+"":e,n),Yn={INIT:"init",START:"start",STOP:"stop",RESET:"reset",PREV:"prev",NEXT:"next",GO:"go",CLOSE:"close",SKIP:"skip",UPDATE:"update"},Va={TOUR_START:"tour:start",STEP_BEFORE:"step:before",BEACON:"beacon",TOOLTIP:"tooltip",STEP_AFTER:"step:after",TOUR_END:"tour:end",TOUR_STATUS:"tour:status",TARGET_NOT_FOUND:"error:target_not_found"},Xt={INIT:"init",READY:"ready",BEACON:"beacon",TOOLTIP:"tooltip",COMPLETE:"complete",ERROR:"error"},wn={IDLE:"idle",READY:"ready",WAITING:"waiting",RUNNING:"running",PAUSED:"paused",SKIPPED:"skipped",FINISHED:"finished"};function Fc(){var t;return!!(typeof window<"u"&&((t=window.document)!=null&&t.createElement))}function fQ(t){return t?t.getBoundingClientRect():null}function yxe(t=!1){const{body:e,documentElement:n}=document;if(!e||!n)return 0;if(t){const r=[e.scrollHeight,e.offsetHeight,n.clientHeight,n.scrollHeight,n.offsetHeight].sort((i,a)=>i-a),s=Math.floor(r.length/2);return r.length%2===0?(r[s-1]+r[s])/2:r[s]}return Math.max(e.scrollHeight,e.offsetHeight,n.clientHeight,n.scrollHeight,n.offsetHeight)}function Pl(t){if(typeof t=="string")try{return document.querySelector(t)}catch{return null}return t}function bxe(t){return!t||t.nodeType!==1?null:getComputedStyle(t)}function fp(t,e,n){if(!t)return Xu();const r=qH(t);if(r){if(r.isSameNode(Xu()))return n?document:Xu();if(!(r.scrollHeight>r.offsetHeight)&&!e)return r.style.overflow="initial",Xu()}return r}function Db(t,e){if(!t)return!1;const n=fp(t,e);return n?!n.isSameNode(Xu()):!1}function wxe(t){return t.offsetParent!==document.body}function df(t,e="fixed"){if(!t||!(t instanceof HTMLElement))return!1;const{nodeName:n}=t,r=bxe(t);return n==="BODY"||n==="HTML"?!1:r&&r.position===e?!0:t.parentNode?df(t.parentNode,e):!1}function Sxe(t){var e;if(!t)return!1;let n=t;for(;n&&n!==document.body;){if(n instanceof HTMLElement){const{display:r,visibility:s}=getComputedStyle(n);if(r==="none"||s==="hidden")return!1}n=(e=n.parentElement)!=null?e:null}return!0}function kxe(t,e,n){var r,s,i;const a=fQ(t),l=fp(t,n),c=Db(t,n),d=df(t);let h=0,m=(r=a?.top)!=null?r:0;if(c&&d){const g=(s=t?.offsetTop)!=null?s:0,x=(i=l?.scrollTop)!=null?i:0;m=g-x}else l instanceof HTMLElement&&(h=l.scrollTop,!c&&!df(t)&&(m+=h),l.isSameNode(Xu())||(m+=Xu().scrollTop));return Math.floor(m-e)}function Oxe(t,e,n){var r;if(!t)return 0;const{offsetTop:s=0,scrollTop:i=0}=(r=qH(t))!=null?r:{};let a=t.getBoundingClientRect().top+i;s&&(Db(t,n)||wxe(t))&&(a-=s);const l=Math.floor(a-e);return l<0?0:l}function Xu(){var t;return(t=document.scrollingElement)!=null?t:document.documentElement}function jxe(t,e){const{duration:n,element:r}=e;return new Promise((s,i)=>{const{scrollTop:a}=r,l=t>a?t-a:a-t;Qpe.top(r,t,{duration:l<100?50:n},c=>c&&c.message!=="Element already at target scroll position"?i(c):s())})}var Xm=ya.createPortal!==void 0;function mQ(t=navigator.userAgent){let e=t;return typeof window>"u"?e="node":document.documentMode?e="ie":/Edge/.test(t)?e="edge":window.opera||t.includes(" OPR/")?e="opera":typeof window.InstallTrigger<"u"?e="firefox":window.chrome?e="chrome":/(Version\/([\d._]+).*Safari|CriOS|FxiOS| Mobile\/)/.test(t)&&(e="safari"),e}function jv(t){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}function wo(t,e={}){const{defaultValue:n,step:r,steps:s}=e;let i=IA(t);if(i)(i.includes("{step}")||i.includes("{steps}"))&&r&&s&&(i=i.replace("{step}",r.toString()).replace("{steps}",s.toString()));else if(b.isValidElement(t)&&!Object.values(t.props).length&&jv(t.type)==="function"){const a=t.type({});i=wo(a,e)}else i=IA(n);return i}function Nxe(t,e){return!pt.plainObject(t)||!pt.array(e)?!1:Object.keys(t).every(n=>e.includes(n))}function Cxe(t){const e=/^#?([\da-f])([\da-f])([\da-f])$/i,n=t.replace(e,(s,i,a,l)=>i+i+a+a+l+l),r=/^#?([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i.exec(n);return r?[parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16)]:[]}function eM(t){return t.disableBeacon||t.placement==="center"}function tM(){return!["chrome","safari","firefox","opera"].includes(mQ())}function pd({data:t,debug:e=!1,title:n,warn:r=!1}){const s=r?console.warn||console.error:console.log;e&&(n&&t?(console.groupCollapsed(`%creact-joyride: ${n}`,"color: #ff0044; font-weight: bold; font-size: 12px;"),Array.isArray(t)?t.forEach(i=>{pt.plainObject(i)&&i.key?s.apply(console,[i.key,i.value]):s.apply(console,[i])}):s.apply(console,[t]),console.groupEnd()):console.error("Missing title or data props"))}function Txe(t){return Object.keys(t)}function pQ(t,...e){if(!pt.plainObject(t))throw new TypeError("Expected an object");const n={};for(const r in t)({}).hasOwnProperty.call(t,r)&&(e.includes(r)||(n[r]=t[r]));return n}function Exe(t,...e){if(!pt.plainObject(t))throw new TypeError("Expected an object");if(!e.length)return t;const n={};for(const r in t)({}).hasOwnProperty.call(t,r)&&e.includes(r)&&(n[r]=t[r]);return n}function jO(t,e,n){const r=i=>i.replace("{step}",String(e)).replace("{steps}",String(n));if(jv(t)==="string")return r(t);if(!b.isValidElement(t))return t;const{children:s}=t.props;if(jv(s)==="string"&&s.includes("{step}"))return b.cloneElement(t,{children:r(s)});if(Array.isArray(s))return b.cloneElement(t,{children:s.map(i=>typeof i=="string"?r(i):jO(i,e,n))});if(jv(t.type)==="function"&&!Object.values(t.props).length){const i=t.type({});return jO(i,e,n)}return t}function _xe(t){const{isFirstStep:e,lifecycle:n,previousLifecycle:r,scrollToFirstStep:s,step:i,target:a}=t;return!i.disableScrolling&&(!e||s||n===Xt.TOOLTIP)&&i.placement!=="center"&&(!i.isFixed||!df(a))&&r!==n&&[Xt.BEACON,Xt.TOOLTIP].includes(n)}var Axe={options:{preventOverflow:{boundariesElement:"scrollParent"}},wrapperOptions:{offset:-18,position:!0}},gQ={back:"Back",close:"Close",last:"Last",next:"Next",nextLabelWithProgress:"Next (Step {step} of {steps})",open:"Open the dialog",skip:"Skip"},Mxe={event:"click",placement:"bottom",offset:10,disableBeacon:!1,disableCloseOnEsc:!1,disableOverlay:!1,disableOverlayClose:!1,disableScrollParentFix:!1,disableScrolling:!1,hideBackButton:!1,hideCloseButton:!1,hideFooter:!1,isFixed:!1,locale:gQ,showProgress:!1,showSkipButton:!1,spotlightClicks:!1,spotlightPadding:10},Rxe={continuous:!1,debug:!1,disableCloseOnEsc:!1,disableOverlay:!1,disableOverlayClose:!1,disableScrolling:!1,disableScrollParentFix:!1,getHelpers:void 0,hideBackButton:!1,run:!0,scrollOffset:20,scrollDuration:300,scrollToFirstStep:!1,showSkipButton:!1,showProgress:!1,spotlightClicks:!1,spotlightPadding:10,steps:[]},Dxe={arrowColor:"#fff",backgroundColor:"#fff",beaconSize:36,overlayColor:"rgba(0, 0, 0, 0.5)",primaryColor:"#f04",spotlightShadow:"0 0 15px rgba(0, 0, 0, 0.5)",textColor:"#333",width:380,zIndex:100},Ym={backgroundColor:"transparent",border:0,borderRadius:0,color:"#555",cursor:"pointer",fontSize:16,lineHeight:1,padding:8,WebkitAppearance:"none"},nM={borderRadius:4,position:"absolute"};function Pxe(t,e){var n,r,s,i,a;const{floaterProps:l,styles:c}=t,d=Ua((n=e.floaterProps)!=null?n:{},l??{}),h=Ua(c??{},(r=e.styles)!=null?r:{}),m=Ua(Dxe,h.options||{}),g=e.placement==="center"||e.disableBeacon;let{width:x}=m;window.innerWidth>480&&(x=380),"width"in m&&(x=typeof m.width=="number"&&window.innerWidth<m.width?window.innerWidth-30:m.width);const y={bottom:0,left:0,overflow:"hidden",position:"absolute",right:0,top:0,zIndex:m.zIndex},w={beacon:{...Ym,display:g?"none":"inline-block",height:m.beaconSize,position:"relative",width:m.beaconSize,zIndex:m.zIndex},beaconInner:{animation:"joyride-beacon-inner 1.2s infinite ease-in-out",backgroundColor:m.primaryColor,borderRadius:"50%",display:"block",height:"50%",left:"50%",opacity:.7,position:"absolute",top:"50%",transform:"translate(-50%, -50%)",width:"50%"},beaconOuter:{animation:"joyride-beacon-outer 1.2s infinite ease-in-out",backgroundColor:`rgba(${Cxe(m.primaryColor).join(",")}, 0.2)`,border:`2px solid ${m.primaryColor}`,borderRadius:"50%",boxSizing:"border-box",display:"block",height:"100%",left:0,opacity:.9,position:"absolute",top:0,transformOrigin:"center",width:"100%"},tooltip:{backgroundColor:m.backgroundColor,borderRadius:5,boxSizing:"border-box",color:m.textColor,fontSize:16,maxWidth:"100%",padding:15,position:"relative",width:x},tooltipContainer:{lineHeight:1.4,textAlign:"center"},tooltipTitle:{fontSize:18,margin:0},tooltipContent:{padding:"20px 10px"},tooltipFooter:{alignItems:"center",display:"flex",justifyContent:"flex-end",marginTop:15},tooltipFooterSpacer:{flex:1},buttonNext:{...Ym,backgroundColor:m.primaryColor,borderRadius:4,color:"#fff"},buttonBack:{...Ym,color:m.primaryColor,marginLeft:"auto",marginRight:5},buttonClose:{...Ym,color:m.textColor,height:14,padding:15,position:"absolute",right:0,top:0,width:14},buttonSkip:{...Ym,color:m.textColor,fontSize:14},overlay:{...y,backgroundColor:m.overlayColor,mixBlendMode:"hard-light"},overlayLegacy:{...y},overlayLegacyCenter:{...y,backgroundColor:m.overlayColor},spotlight:{...nM,backgroundColor:"gray"},spotlightLegacy:{...nM,boxShadow:`0 0 0 9999px ${m.overlayColor}, ${m.spotlightShadow}`},floaterStyles:{arrow:{color:(a=(i=(s=d?.styles)==null?void 0:s.arrow)==null?void 0:i.color)!=null?a:m.arrowColor},options:{zIndex:m.zIndex+100}},options:m};return Ua(w,h)}function zxe(t){return Exe(t,"beaconComponent","disableCloseOnEsc","disableOverlay","disableOverlayClose","disableScrolling","disableScrollParentFix","floaterProps","hideBackButton","hideCloseButton","locale","showProgress","showSkipButton","spotlightClicks","spotlightPadding","styles","tooltipComponent")}function lh(t,e){var n,r,s,i,a,l;const c=e??{},d=Ua.all([Mxe,zxe(t),c],{isMergeableObject:pt.plainObject}),h=Pxe(t,d),m=Db(Pl(d.target),d.disableScrollParentFix),g=Ua.all([Axe,(n=t.floaterProps)!=null?n:{},(r=d.floaterProps)!=null?r:{}]);return g.offset=d.offset,g.styles=Ua((s=g.styles)!=null?s:{},h.floaterStyles),g.offset+=(a=(i=t.spotlightPadding)!=null?i:d.spotlightPadding)!=null?a:0,d.placementBeacon&&g.wrapperOptions&&(g.wrapperOptions.placement=d.placementBeacon),m&&g.options.preventOverflow&&(g.options.preventOverflow.boundariesElement="window"),{...d,locale:Ua.all([gQ,(l=t.locale)!=null?l:{},d.locale||{}]),floaterProps:g,styles:pQ(h,"floaterStyles")}}function xQ(t,e=!1){return pt.plainObject(t)?t.target?!0:(pd({title:"validateStep",data:"target is missing from the step",warn:!0,debug:e}),!1):(pd({title:"validateStep",data:"step must be an object",warn:!0,debug:e}),!1)}function rM(t,e=!1){return pt.array(t)?t.every(n=>xQ(n,e)):(pd({title:"validateSteps",data:"steps must be an array",warn:!0,debug:e}),!1)}var vQ={action:"init",controlled:!1,index:0,lifecycle:Xt.INIT,origin:null,size:0,status:wn.IDLE},sM=Txe(pQ(vQ,"controlled","size")),Ixe=class{constructor(t){xt(this,"beaconPopper"),xt(this,"tooltipPopper"),xt(this,"data",new Map),xt(this,"listener"),xt(this,"store",new Map),xt(this,"addListener",s=>{this.listener=s}),xt(this,"setSteps",s=>{const{size:i,status:a}=this.getState(),l={size:s.length,status:a};this.data.set("steps",s),a===wn.WAITING&&!i&&s.length&&(l.status=wn.RUNNING),this.setState(l)}),xt(this,"getPopper",s=>s==="beacon"?this.beaconPopper:this.tooltipPopper),xt(this,"setPopper",(s,i)=>{s==="beacon"?this.beaconPopper=i:this.tooltipPopper=i}),xt(this,"cleanupPoppers",()=>{this.beaconPopper=null,this.tooltipPopper=null}),xt(this,"close",(s=null)=>{const{index:i,status:a}=this.getState();a===wn.RUNNING&&this.setState({...this.getNextState({action:Yn.CLOSE,index:i+1,origin:s})})}),xt(this,"go",s=>{const{controlled:i,status:a}=this.getState();if(i||a!==wn.RUNNING)return;const l=this.getSteps()[s];this.setState({...this.getNextState({action:Yn.GO,index:s}),status:l?a:wn.FINISHED})}),xt(this,"info",()=>this.getState()),xt(this,"next",()=>{const{index:s,status:i}=this.getState();i===wn.RUNNING&&this.setState(this.getNextState({action:Yn.NEXT,index:s+1}))}),xt(this,"open",()=>{const{status:s}=this.getState();s===wn.RUNNING&&this.setState({...this.getNextState({action:Yn.UPDATE,lifecycle:Xt.TOOLTIP})})}),xt(this,"prev",()=>{const{index:s,status:i}=this.getState();i===wn.RUNNING&&this.setState({...this.getNextState({action:Yn.PREV,index:s-1})})}),xt(this,"reset",(s=!1)=>{const{controlled:i}=this.getState();i||this.setState({...this.getNextState({action:Yn.RESET,index:0}),status:s?wn.RUNNING:wn.READY})}),xt(this,"skip",()=>{const{status:s}=this.getState();s===wn.RUNNING&&this.setState({action:Yn.SKIP,lifecycle:Xt.INIT,status:wn.SKIPPED})}),xt(this,"start",s=>{const{index:i,size:a}=this.getState();this.setState({...this.getNextState({action:Yn.START,index:pt.number(s)?s:i},!0),status:a?wn.RUNNING:wn.WAITING})}),xt(this,"stop",(s=!1)=>{const{index:i,status:a}=this.getState();[wn.FINISHED,wn.SKIPPED].includes(a)||this.setState({...this.getNextState({action:Yn.STOP,index:i+(s?1:0)}),status:wn.PAUSED})}),xt(this,"update",s=>{var i,a;if(!Nxe(s,sM))throw new Error(`State is not valid. Valid keys: ${sM.join(", ")}`);this.setState({...this.getNextState({...this.getState(),...s,action:(i=s.action)!=null?i:Yn.UPDATE,origin:(a=s.origin)!=null?a:null},!0)})});const{continuous:e=!1,stepIndex:n,steps:r=[]}=t??{};this.setState({action:Yn.INIT,controlled:pt.number(n),continuous:e,index:pt.number(n)?n:0,lifecycle:Xt.INIT,origin:null,status:r.length?wn.READY:wn.IDLE},!0),this.beaconPopper=null,this.tooltipPopper=null,this.listener=null,this.setSteps(r)}getState(){return this.store.size?{action:this.store.get("action")||"",controlled:this.store.get("controlled")||!1,index:parseInt(this.store.get("index"),10),lifecycle:this.store.get("lifecycle")||"",origin:this.store.get("origin")||null,size:this.store.get("size")||0,status:this.store.get("status")||""}:{...vQ}}getNextState(t,e=!1){var n,r,s,i,a;const{action:l,controlled:c,index:d,size:h,status:m}=this.getState(),g=pt.number(t.index)?t.index:d,x=c&&!e?d:Math.min(Math.max(g,0),h);return{action:(n=t.action)!=null?n:l,controlled:c,index:x,lifecycle:(r=t.lifecycle)!=null?r:Xt.INIT,origin:(s=t.origin)!=null?s:null,size:(i=t.size)!=null?i:h,status:x===h?wn.FINISHED:(a=t.status)!=null?a:m}}getSteps(){const t=this.data.get("steps");return Array.isArray(t)?t:[]}hasUpdatedState(t){const e=JSON.stringify(t),n=JSON.stringify(this.getState());return e!==n}setState(t,e=!1){const n=this.getState(),{action:r,index:s,lifecycle:i,origin:a=null,size:l,status:c}={...n,...t};this.store.set("action",r),this.store.set("index",s),this.store.set("lifecycle",i),this.store.set("origin",a),this.store.set("size",l),this.store.set("status",c),e&&(this.store.set("controlled",t.controlled),this.store.set("continuous",t.continuous)),this.listener&&this.hasUpdatedState(n)&&this.listener(this.getState())}getHelpers(){return{close:this.close,go:this.go,info:this.info,next:this.next,open:this.open,prev:this.prev,reset:this.reset,skip:this.skip}}};function Lxe(t){return new Ixe(t)}function Bxe({styles:t}){return b.createElement("div",{key:"JoyrideSpotlight",className:"react-joyride__spotlight","data-test-id":"spotlight",style:t})}var Fxe=Bxe,qxe=class extends b.Component{constructor(){super(...arguments),xt(this,"isActive",!1),xt(this,"resizeTimeout"),xt(this,"scrollTimeout"),xt(this,"scrollParent"),xt(this,"state",{isScrolling:!1,mouseOverSpotlight:!1,showSpotlight:!0}),xt(this,"hideSpotlight",()=>{const{continuous:t,disableOverlay:e,lifecycle:n}=this.props,r=[Xt.INIT,Xt.BEACON,Xt.COMPLETE,Xt.ERROR];return e||(t?r.includes(n):n!==Xt.TOOLTIP)}),xt(this,"handleMouseMove",t=>{const{mouseOverSpotlight:e}=this.state,{height:n,left:r,position:s,top:i,width:a}=this.spotlightStyles,l=s==="fixed"?t.clientY:t.pageY,c=s==="fixed"?t.clientX:t.pageX,d=l>=i&&l<=i+n,m=c>=r&&c<=r+a&&d;m!==e&&this.updateState({mouseOverSpotlight:m})}),xt(this,"handleScroll",()=>{const{target:t}=this.props,e=Pl(t);if(this.scrollParent!==document){const{isScrolling:n}=this.state;n||this.updateState({isScrolling:!0,showSpotlight:!1}),clearTimeout(this.scrollTimeout),this.scrollTimeout=window.setTimeout(()=>{this.updateState({isScrolling:!1,showSpotlight:!0})},50)}else df(e,"sticky")&&this.updateState({})}),xt(this,"handleResize",()=>{clearTimeout(this.resizeTimeout),this.resizeTimeout=window.setTimeout(()=>{this.isActive&&this.forceUpdate()},100)})}componentDidMount(){const{debug:t,disableScrolling:e,disableScrollParentFix:n=!1,target:r}=this.props,s=Pl(r);this.scrollParent=fp(s??document.body,n,!0),this.isActive=!0,window.addEventListener("resize",this.handleResize)}componentDidUpdate(t){var e;const{disableScrollParentFix:n,lifecycle:r,spotlightClicks:s,target:i}=this.props,{changed:a}=py(t,this.props);if(a("target")||a("disableScrollParentFix")){const l=Pl(i);this.scrollParent=fp(l??document.body,n,!0)}a("lifecycle",Xt.TOOLTIP)&&((e=this.scrollParent)==null||e.addEventListener("scroll",this.handleScroll,{passive:!0}),setTimeout(()=>{const{isScrolling:l}=this.state;l||this.updateState({showSpotlight:!0})},100)),(a("spotlightClicks")||a("disableOverlay")||a("lifecycle"))&&(s&&r===Xt.TOOLTIP?window.addEventListener("mousemove",this.handleMouseMove,!1):r!==Xt.TOOLTIP&&window.removeEventListener("mousemove",this.handleMouseMove))}componentWillUnmount(){var t;this.isActive=!1,window.removeEventListener("mousemove",this.handleMouseMove),window.removeEventListener("resize",this.handleResize),clearTimeout(this.resizeTimeout),clearTimeout(this.scrollTimeout),(t=this.scrollParent)==null||t.removeEventListener("scroll",this.handleScroll)}get overlayStyles(){const{mouseOverSpotlight:t}=this.state,{disableOverlayClose:e,placement:n,styles:r}=this.props;let s=r.overlay;return tM()&&(s=n==="center"?r.overlayLegacyCenter:r.overlayLegacy),{cursor:e?"default":"pointer",height:yxe(),pointerEvents:t?"none":"auto",...s}}get spotlightStyles(){var t,e,n;const{showSpotlight:r}=this.state,{disableScrollParentFix:s=!1,spotlightClicks:i,spotlightPadding:a=0,styles:l,target:c}=this.props,d=Pl(c),h=fQ(d),m=df(d),g=kxe(d,a,s);return{...tM()?l.spotlightLegacy:l.spotlight,height:Math.round(((t=h?.height)!=null?t:0)+a*2),left:Math.round(((e=h?.left)!=null?e:0)-a),opacity:r?1:0,pointerEvents:i?"none":"auto",position:m?"fixed":"absolute",top:g,transition:"opacity 0.2s",width:Math.round(((n=h?.width)!=null?n:0)+a*2)}}updateState(t){this.isActive&&this.setState(e=>({...e,...t}))}render(){const{showSpotlight:t}=this.state,{onClickOverlay:e,placement:n}=this.props,{hideSpotlight:r,overlayStyles:s,spotlightStyles:i}=this;if(r())return null;let a=n!=="center"&&t&&b.createElement(Fxe,{styles:i});if(mQ()==="safari"){const{mixBlendMode:l,zIndex:c,...d}=s;a=b.createElement("div",{style:{...d}},a),delete s.backgroundColor}return b.createElement("div",{className:"react-joyride__overlay","data-test-id":"overlay",onClick:e,role:"presentation",style:s},a)}},$xe=class extends b.Component{constructor(){super(...arguments),xt(this,"node",null)}componentDidMount(){const{id:t}=this.props;Fc()&&(this.node=document.createElement("div"),this.node.id=t,document.body.appendChild(this.node),Xm||this.renderReact15())}componentDidUpdate(){Fc()&&(Xm||this.renderReact15())}componentWillUnmount(){!Fc()||!this.node||(Xm||ya.unmountComponentAtNode(this.node),this.node.parentNode===document.body&&(document.body.removeChild(this.node),this.node=null))}renderReact15(){if(!Fc())return;const{children:t}=this.props;this.node&&ya.unstable_renderSubtreeIntoContainer(this,t,this.node)}renderReact16(){if(!Fc()||!Xm)return null;const{children:t}=this.props;return this.node?ya.createPortal(t,this.node):null}render(){return Xm?this.renderReact16():null}},Hxe=class{constructor(t,e){if(xt(this,"element"),xt(this,"options"),xt(this,"canBeTabbed",n=>{const{tabIndex:r}=n;return r===null||r<0?!1:this.canHaveFocus(n)}),xt(this,"canHaveFocus",n=>{const r=/input|select|textarea|button|object/,s=n.nodeName.toLowerCase();return(r.test(s)&&!n.getAttribute("disabled")||s==="a"&&!!n.getAttribute("href"))&&this.isVisible(n)}),xt(this,"findValidTabElements",()=>[].slice.call(this.element.querySelectorAll("*"),0).filter(this.canBeTabbed)),xt(this,"handleKeyDown",n=>{const{code:r="Tab"}=this.options;n.code===r&&this.interceptTab(n)}),xt(this,"interceptTab",n=>{n.preventDefault();const r=this.findValidTabElements(),{shiftKey:s}=n;if(!r.length)return;let i=document.activeElement?r.indexOf(document.activeElement):0;i===-1||!s&&i+1===r.length?i=0:s&&i===0?i=r.length-1:i+=s?-1:1,r[i].focus()}),xt(this,"isHidden",n=>{const r=n.offsetWidth<=0&&n.offsetHeight<=0,s=window.getComputedStyle(n);return r&&!n.innerHTML?!0:r&&s.getPropertyValue("overflow")!=="visible"||s.getPropertyValue("display")==="none"}),xt(this,"isVisible",n=>{let r=n;for(;r;)if(r instanceof HTMLElement){if(r===document.body)break;if(this.isHidden(r))return!1;r=r.parentNode}return!0}),xt(this,"removeScope",()=>{window.removeEventListener("keydown",this.handleKeyDown)}),xt(this,"checkFocus",n=>{document.activeElement!==n&&(n.focus(),window.requestAnimationFrame(()=>this.checkFocus(n)))}),xt(this,"setFocus",()=>{const{selector:n}=this.options;if(!n)return;const r=this.element.querySelector(n);r&&window.requestAnimationFrame(()=>this.checkFocus(r))}),!(t instanceof HTMLElement))throw new TypeError("Invalid parameter: element must be an HTMLElement");this.element=t,this.options=e,window.addEventListener("keydown",this.handleKeyDown,!1),this.setFocus()}},Qxe=class extends b.Component{constructor(t){if(super(t),xt(this,"beacon",null),xt(this,"setBeaconRef",s=>{this.beacon=s}),t.beaconComponent)return;const e=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.id="joyride-beacon-animation",t.nonce&&n.setAttribute("nonce",t.nonce),n.appendChild(document.createTextNode(`
|
||
@keyframes joyride-beacon-inner {
|
||
20% {
|
||
opacity: 0.9;
|
||
}
|
||
|
||
90% {
|
||
opacity: 0.7;
|
||
}
|
||
}
|
||
|
||
@keyframes joyride-beacon-outer {
|
||
0% {
|
||
transform: scale(1);
|
||
}
|
||
|
||
45% {
|
||
opacity: 0.7;
|
||
transform: scale(0.75);
|
||
}
|
||
|
||
100% {
|
||
opacity: 0.9;
|
||
transform: scale(1);
|
||
}
|
||
}
|
||
`)),e.appendChild(n)}componentDidMount(){const{shouldFocus:t}=this.props;setTimeout(()=>{pt.domElement(this.beacon)&&t&&this.beacon.focus()},0)}componentWillUnmount(){const t=document.getElementById("joyride-beacon-animation");t?.parentNode&&t.parentNode.removeChild(t)}render(){const{beaconComponent:t,continuous:e,index:n,isLastStep:r,locale:s,onClickOrHover:i,size:a,step:l,styles:c}=this.props,d=wo(s.open),h={"aria-label":d,onClick:i,onMouseEnter:i,ref:this.setBeaconRef,title:d};let m;if(t){const g=t;m=b.createElement(g,{continuous:e,index:n,isLastStep:r,size:a,step:l,...h})}else m=b.createElement("button",{key:"JoyrideBeacon",className:"react-joyride__beacon","data-test-id":"button-beacon",style:c.beacon,type:"button",...h},b.createElement("span",{style:c.beaconInner}),b.createElement("span",{style:c.beaconOuter}));return m}};function Vxe({styles:t,...e}){const{color:n,height:r,width:s,...i}=t;return oe.createElement("button",{style:i,type:"button",...e},oe.createElement("svg",{height:typeof r=="number"?`${r}px`:r,preserveAspectRatio:"xMidYMid",version:"1.1",viewBox:"0 0 18 18",width:typeof s=="number"?`${s}px`:s,xmlns:"http://www.w3.org/2000/svg"},oe.createElement("g",null,oe.createElement("path",{d:"M8.13911129,9.00268191 L0.171521827,17.0258467 C-0.0498027049,17.248715 -0.0498027049,17.6098394 0.171521827,17.8327545 C0.28204354,17.9443526 0.427188206,17.9998706 0.572051765,17.9998706 C0.71714958,17.9998706 0.862013139,17.9443526 0.972581703,17.8327545 L9.0000937,9.74924618 L17.0276057,17.8327545 C17.1384085,17.9443526 17.2832721,17.9998706 17.4281356,17.9998706 C17.5729992,17.9998706 17.718097,17.9443526 17.8286656,17.8327545 C18.0499901,17.6098862 18.0499901,17.2487618 17.8286656,17.0258467 L9.86135722,9.00268191 L17.8340066,0.973848225 C18.0553311,0.750979934 18.0553311,0.389855532 17.8340066,0.16694039 C17.6126821,-0.0556467968 17.254037,-0.0556467968 17.0329467,0.16694039 L9.00042166,8.25611765 L0.967006424,0.167268345 C0.745681892,-0.0553188426 0.387317931,-0.0553188426 0.165993399,0.167268345 C-0.0553311331,0.390136635 -0.0553311331,0.751261038 0.165993399,0.974176179 L8.13920499,9.00268191 L8.13911129,9.00268191 Z",fill:n}))))}var Uxe=Vxe;function Wxe(t){const{backProps:e,closeProps:n,index:r,isLastStep:s,primaryProps:i,skipProps:a,step:l,tooltipProps:c}=t,{content:d,hideBackButton:h,hideCloseButton:m,hideFooter:g,showSkipButton:x,styles:y,title:w}=l,S={};return S.primary=b.createElement("button",{"data-test-id":"button-primary",style:y.buttonNext,type:"button",...i}),x&&!s&&(S.skip=b.createElement("button",{"aria-live":"off","data-test-id":"button-skip",style:y.buttonSkip,type:"button",...a})),!h&&r>0&&(S.back=b.createElement("button",{"data-test-id":"button-back",style:y.buttonBack,type:"button",...e})),S.close=!m&&b.createElement(Uxe,{"data-test-id":"button-close",styles:y.buttonClose,...n}),b.createElement("div",{key:"JoyrideTooltip","aria-label":wo(w??d),className:"react-joyride__tooltip",style:y.tooltip,...c},b.createElement("div",{style:y.tooltipContainer},w&&b.createElement("h1",{"aria-label":wo(w),style:y.tooltipTitle},w),b.createElement("div",{style:y.tooltipContent},d)),!g&&b.createElement("div",{style:y.tooltipFooter},b.createElement("div",{style:y.tooltipFooterSpacer},S.skip),S.back,S.primary),S.close)}var Gxe=Wxe,Xxe=class extends b.Component{constructor(){super(...arguments),xt(this,"handleClickBack",t=>{t.preventDefault();const{helpers:e}=this.props;e.prev()}),xt(this,"handleClickClose",t=>{t.preventDefault();const{helpers:e}=this.props;e.close("button_close")}),xt(this,"handleClickPrimary",t=>{t.preventDefault();const{continuous:e,helpers:n}=this.props;if(!e){n.close("button_primary");return}n.next()}),xt(this,"handleClickSkip",t=>{t.preventDefault();const{helpers:e}=this.props;e.skip()}),xt(this,"getElementsProps",()=>{const{continuous:t,index:e,isLastStep:n,setTooltipRef:r,size:s,step:i}=this.props,{back:a,close:l,last:c,next:d,nextLabelWithProgress:h,skip:m}=i.locale,g=wo(a),x=wo(l),y=wo(c),w=wo(d),S=wo(m);let k=l,j=x;if(t){if(k=d,j=w,i.showProgress&&!n){const N=wo(h,{step:e+1,steps:s});k=jO(h,e+1,s),j=N}n&&(k=c,j=y)}return{backProps:{"aria-label":g,children:a,"data-action":"back",onClick:this.handleClickBack,role:"button",title:g},closeProps:{"aria-label":x,children:l,"data-action":"close",onClick:this.handleClickClose,role:"button",title:x},primaryProps:{"aria-label":j,children:k,"data-action":"primary",onClick:this.handleClickPrimary,role:"button",title:j},skipProps:{"aria-label":S,children:m,"data-action":"skip",onClick:this.handleClickSkip,role:"button",title:S},tooltipProps:{"aria-modal":!0,ref:r,role:"alertdialog"}}})}render(){const{continuous:t,index:e,isLastStep:n,setTooltipRef:r,size:s,step:i}=this.props,{beaconComponent:a,tooltipComponent:l,...c}=i;let d;if(l){const h={...this.getElementsProps(),continuous:t,index:e,isLastStep:n,size:s,step:c,setTooltipRef:r},m=l;d=b.createElement(m,{...h})}else d=b.createElement(Gxe,{...this.getElementsProps(),continuous:t,index:e,isLastStep:n,size:s,step:i});return d}},Yxe=class extends b.Component{constructor(){super(...arguments),xt(this,"scope",null),xt(this,"tooltip",null),xt(this,"handleClickHoverBeacon",t=>{const{step:e,store:n}=this.props;t.type==="mouseenter"&&e.event!=="hover"||n.update({lifecycle:Xt.TOOLTIP})}),xt(this,"setTooltipRef",t=>{this.tooltip=t}),xt(this,"setPopper",(t,e)=>{var n;const{action:r,lifecycle:s,step:i,store:a}=this.props;e==="wrapper"?a.setPopper("beacon",t):a.setPopper("tooltip",t),a.getPopper("beacon")&&(a.getPopper("tooltip")||i.placement==="center")&&s===Xt.INIT&&a.update({action:r,lifecycle:Xt.READY}),(n=i.floaterProps)!=null&&n.getPopper&&i.floaterProps.getPopper(t,e)}),xt(this,"renderTooltip",t=>{const{continuous:e,helpers:n,index:r,size:s,step:i}=this.props;return b.createElement(Xxe,{continuous:e,helpers:n,index:r,isLastStep:r+1===s,setTooltipRef:this.setTooltipRef,size:s,step:i,...t})})}componentDidMount(){const{debug:t,index:e}=this.props;pd({title:`step:${e}`,data:[{key:"props",value:this.props}],debug:t})}componentDidUpdate(t){var e;const{action:n,callback:r,continuous:s,controlled:i,debug:a,helpers:l,index:c,lifecycle:d,shouldScroll:h,status:m,step:g,store:x}=this.props,{changed:y,changedFrom:w}=py(t,this.props),S=l.info(),k=s&&n!==Yn.CLOSE&&(c>0||n===Yn.PREV),j=y("action")||y("index")||y("lifecycle")||y("status"),N=w("lifecycle",[Xt.TOOLTIP,Xt.INIT],Xt.INIT),T=y("action",[Yn.NEXT,Yn.PREV,Yn.SKIP,Yn.CLOSE]),E=i&&c===t.index;if(T&&(N||E)&&r({...S,index:t.index,lifecycle:Xt.COMPLETE,step:t.step,type:Va.STEP_AFTER}),g.placement==="center"&&m===wn.RUNNING&&y("index")&&n!==Yn.START&&d===Xt.INIT&&x.update({lifecycle:Xt.READY}),j){const _=Pl(g.target),A=!!_;A&&Sxe(_)?(w("status",wn.READY,wn.RUNNING)||w("lifecycle",Xt.INIT,Xt.READY))&&r({...S,step:g,type:Va.STEP_BEFORE}):(console.warn(A?"Target not visible":"Target not mounted",g),r({...S,type:Va.TARGET_NOT_FOUND,step:g}),i||x.update({index:c+(n===Yn.PREV?-1:1)}))}w("lifecycle",Xt.INIT,Xt.READY)&&x.update({lifecycle:eM(g)||k?Xt.TOOLTIP:Xt.BEACON}),y("index")&&pd({title:`step:${d}`,data:[{key:"props",value:this.props}],debug:a}),y("lifecycle",Xt.BEACON)&&r({...S,step:g,type:Va.BEACON}),y("lifecycle",Xt.TOOLTIP)&&(r({...S,step:g,type:Va.TOOLTIP}),h&&this.tooltip&&(this.scope=new Hxe(this.tooltip,{selector:"[data-action=primary]"}),this.scope.setFocus())),w("lifecycle",[Xt.TOOLTIP,Xt.INIT],Xt.INIT)&&((e=this.scope)==null||e.removeScope(),x.cleanupPoppers())}componentWillUnmount(){var t;(t=this.scope)==null||t.removeScope()}get open(){const{lifecycle:t,step:e}=this.props;return eM(e)||t===Xt.TOOLTIP}render(){const{continuous:t,debug:e,index:n,nonce:r,shouldScroll:s,size:i,step:a}=this.props,l=Pl(a.target);return!xQ(a)||!pt.domElement(l)?null:b.createElement("div",{key:`JoyrideStep-${n}`,className:"react-joyride__step"},b.createElement(tN,{...a.floaterProps,component:this.renderTooltip,debug:e,getPopper:this.setPopper,id:`react-joyride-step-${n}`,open:this.open,placement:a.placement,target:a.target},b.createElement(Qxe,{beaconComponent:a.beaconComponent,continuous:t,index:n,isLastStep:n+1===i,locale:a.locale,nonce:r,onClickOrHover:this.handleClickHoverBeacon,shouldFocus:s,size:i,step:a,styles:a.styles})))}},yQ=class extends b.Component{constructor(t){super(t),xt(this,"helpers"),xt(this,"store"),xt(this,"callback",a=>{const{callback:l}=this.props;pt.function(l)&&l(a)}),xt(this,"handleKeyboard",a=>{const{index:l,lifecycle:c}=this.state,{steps:d}=this.props,h=d[l];c===Xt.TOOLTIP&&a.code==="Escape"&&h&&!h.disableCloseOnEsc&&this.store.close("keyboard")}),xt(this,"handleClickOverlay",()=>{const{index:a}=this.state,{steps:l}=this.props;lh(this.props,l[a]).disableOverlayClose||this.helpers.close("overlay")}),xt(this,"syncState",a=>{this.setState(a)});const{debug:e,getHelpers:n,run:r=!0,stepIndex:s}=t;this.store=Lxe({...t,controlled:r&&pt.number(s)}),this.helpers=this.store.getHelpers();const{addListener:i}=this.store;pd({title:"init",data:[{key:"props",value:this.props},{key:"state",value:this.state}],debug:e}),i(this.syncState),n&&n(this.helpers),this.state=this.store.getState()}componentDidMount(){if(!Fc())return;const{debug:t,disableCloseOnEsc:e,run:n,steps:r}=this.props,{start:s}=this.store;rM(r,t)&&n&&s(),e||document.body.addEventListener("keydown",this.handleKeyboard,{passive:!0})}componentDidUpdate(t,e){if(!Fc())return;const{action:n,controlled:r,index:s,status:i}=this.state,{debug:a,run:l,stepIndex:c,steps:d}=this.props,{stepIndex:h,steps:m}=t,{reset:g,setSteps:x,start:y,stop:w,update:S}=this.store,{changed:k}=py(t,this.props),{changed:j,changedFrom:N}=py(e,this.state),T=lh(this.props,d[s]),E=!ti(m,d),_=pt.number(c)&&k("stepIndex"),A=Pl(T.target);if(E&&(rM(d,a)?x(d):console.warn("Steps are not valid",d)),k("run")&&(l?y(c):w()),_){let B=pt.number(h)&&h<c?Yn.NEXT:Yn.PREV;n===Yn.STOP&&(B=Yn.START),[wn.FINISHED,wn.SKIPPED].includes(i)||S({action:n===Yn.CLOSE?Yn.CLOSE:B,index:c,lifecycle:Xt.INIT})}!r&&i===wn.RUNNING&&s===0&&!A&&(this.store.update({index:s+1}),this.callback({...this.state,type:Va.TARGET_NOT_FOUND,step:T}));const D={...this.state,index:s,step:T};if(j("action",[Yn.NEXT,Yn.PREV,Yn.SKIP,Yn.CLOSE])&&j("status",wn.PAUSED)){const B=lh(this.props,d[e.index]);this.callback({...D,index:e.index,lifecycle:Xt.COMPLETE,step:B,type:Va.STEP_AFTER})}if(j("status",[wn.FINISHED,wn.SKIPPED])){const B=lh(this.props,d[e.index]);r||this.callback({...D,index:e.index,lifecycle:Xt.COMPLETE,step:B,type:Va.STEP_AFTER}),this.callback({...D,type:Va.TOUR_END,step:B,index:e.index}),g()}else N("status",[wn.IDLE,wn.READY],wn.RUNNING)?this.callback({...D,type:Va.TOUR_START}):(j("status")||j("action",Yn.RESET))&&this.callback({...D,type:Va.TOUR_STATUS});this.scrollToStep(e)}componentWillUnmount(){const{disableCloseOnEsc:t}=this.props;t||document.body.removeEventListener("keydown",this.handleKeyboard)}scrollToStep(t){const{index:e,lifecycle:n,status:r}=this.state,{debug:s,disableScrollParentFix:i=!1,scrollDuration:a,scrollOffset:l=20,scrollToFirstStep:c=!1,steps:d}=this.props,h=lh(this.props,d[e]),m=Pl(h.target),g=_xe({isFirstStep:e===0,lifecycle:n,previousLifecycle:t.lifecycle,scrollToFirstStep:c,step:h,target:m});if(r===wn.RUNNING&&g){const x=Db(m,i),y=fp(m,i);let w=Math.floor(Oxe(m,l,i))||0;pd({title:"scrollToStep",data:[{key:"index",value:e},{key:"lifecycle",value:n},{key:"status",value:r}],debug:s});const S=this.store.getPopper("beacon"),k=this.store.getPopper("tooltip");if(n===Xt.BEACON&&S){const{offsets:j,placement:N}=S;!["bottom"].includes(N)&&!x&&(w=Math.floor(j.popper.top-l))}else if(n===Xt.TOOLTIP&&k){const{flipped:j,offsets:N,placement:T}=k;["top","right","left"].includes(T)&&!j&&!x?w=Math.floor(N.popper.top-l):w-=h.spotlightPadding}w=w>=0?w:0,r===wn.RUNNING&&jxe(w,{element:y,duration:a}).then(()=>{setTimeout(()=>{var j;(j=this.store.getPopper("tooltip"))==null||j.instance.update()},10)})}}render(){if(!Fc())return null;const{index:t,lifecycle:e,status:n}=this.state,{continuous:r=!1,debug:s=!1,nonce:i,scrollToFirstStep:a=!1,steps:l}=this.props,c=n===wn.RUNNING,d={};if(c&&l[t]){const h=lh(this.props,l[t]);d.step=b.createElement(Yxe,{...this.state,callback:this.callback,continuous:r,debug:s,helpers:this.helpers,nonce:i,shouldScroll:!h.disableScrolling&&(t!==0||a),step:h,store:this.store}),d.overlay=b.createElement($xe,{id:"react-joyride-portal"},b.createElement(qxe,{...h,continuous:r,debug:s,lifecycle:e,onClickOverlay:this.handleClickOverlay}))}return b.createElement("div",{className:"react-joyride"},d.step,d.overlay)}};xt(yQ,"defaultProps",Rxe);var Kxe=yQ;function nN(){const t=b.useContext(IH);if(!t)throw new Error("useTour must be used within a TourProvider");return t}const Zxe={options:{zIndex:1e4,primaryColor:"hsl(var(--primary))",textColor:"hsl(var(--foreground))",backgroundColor:"hsl(var(--background))",arrowColor:"hsl(var(--background))",overlayColor:"rgba(0, 0, 0, 0.5)"},tooltip:{borderRadius:"var(--radius)",padding:"1rem"},tooltipContainer:{textAlign:"left"},tooltipTitle:{fontSize:"1rem",fontWeight:600,marginBottom:"0.5rem"},tooltipContent:{fontSize:"0.875rem",padding:"0.5rem 0"},buttonNext:{backgroundColor:"hsl(var(--primary))",color:"hsl(var(--primary-foreground))",borderRadius:"calc(var(--radius) - 2px)",fontSize:"0.875rem",padding:"0.5rem 1rem"},buttonBack:{color:"hsl(var(--muted-foreground))",fontSize:"0.875rem",marginRight:"0.5rem"},buttonSkip:{color:"hsl(var(--muted-foreground))",fontSize:"0.875rem"},buttonClose:{color:"hsl(var(--muted-foreground))"},spotlight:{borderRadius:"var(--radius)"}},Jxe={back:"上一步",close:"关闭",last:"完成",next:"下一步",nextLabelWithProgress:"下一步 ({step}/{steps})",open:"打开对话框",skip:"跳过"};function e1e(){const{state:t,getCurrentSteps:e,handleJoyrideCallback:n}=nN(),r=e(),[s,i]=b.useState(!1),a=b.useRef(t.stepIndex),l=b.useRef(null);b.useEffect(()=>{a.current!==t.stepIndex&&(i(!1),a.current=t.stepIndex)},[t.stepIndex]),b.useEffect(()=>{if(!t.isRunning||r.length===0){i(!1);return}const h=r[t.stepIndex];if(!h){i(!1);return}const m=h.target;if(m==="body"){i(!0);return}i(!1);const g=setTimeout(()=>{const x=()=>{const k=document.querySelector(m);if(k){const j=k.getBoundingClientRect();if(j.width>0&&j.height>0)return!0}return!1};if(x()){setTimeout(()=>i(!0),100);return}const y=setInterval(()=>{x()&&(clearInterval(y),setTimeout(()=>i(!0),100))},100),w=setTimeout(()=>{clearInterval(y),i(!0)},5e3),S=()=>{clearInterval(y),clearTimeout(w)};l.current=S},150);return()=>{clearTimeout(g),l.current&&(l.current(),l.current=null)}},[t.isRunning,t.stepIndex,r]);const c=b.useRef(null);if(b.useEffect(()=>{let h=document.getElementById("tour-portal-container");return h||(h=document.createElement("div"),h.id="tour-portal-container",h.style.cssText="position: fixed; top: 0; left: 0; z-index: 99999; pointer-events: none;",document.body.appendChild(h)),c.current=h,()=>{}},[]),!t.isRunning||r.length===0||!s)return null;const d=o.jsx(Kxe,{steps:r,stepIndex:t.stepIndex,run:t.isRunning,continuous:!0,showSkipButton:!0,showProgress:!0,disableOverlayClose:!0,disableScrolling:!1,disableScrollParentFix:!1,callback:n,styles:Zxe,locale:Jxe,scrollOffset:80,scrollToFirstStep:!0,floaterProps:{styles:{floater:{zIndex:99999}},disableAnimation:!0}},`tour-step-${t.stepIndex}`);return c.current?ya.createPortal(d,c.current):d}const Rl="model-assignment-tour",bQ=[{target:"body",content:"本引导旨在帮助你配置模型提供商和对应的模型,并为麦麦的各个组件分配合适的模型。",placement:"center",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="sidebar-model-provider"]',content:'第一步,你需要配置模型提供商。模型提供商决定了你要使用谁家的模型,无论是单一厂商(如 DeepSeek),还是模型平台(如 Siliconflow),都可以在这里进行配置。点击"下一步"进入配置页面。',placement:"right",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="add-provider-button"]',content:'点击"添加提供商"按钮,开始配置你的模型提供商。',placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!0,hideFooter:!0},{target:'[data-tour="provider-dialog"]',content:"在这里,你可以选择你想要配置的模型提供商,填写相关信息后保存即可。",placement:"left",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="provider-name-input"]',content:"这里的名称是你为这个模型提供商起的一个名字,方便你在后续使用时识别它。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="provider-apikey-input"]',content:"这里需要填写你从模型提供商那里获取的 API 密钥,用于验证和调用模型服务。对于不同的提供商,获取 API 密钥的方式可能有所不同,请参考对应提供商的文档。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="provider-url-input"]',content:"这里需要填写模型提供商的 API 访问地址,确保填写正确以便系统能够连接到模型服务。对于不同的提供商,API 地址可能有所不同,请参考对应提供商的文档。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="provider-template-select"]',content:"当然,如果你不知道如何填写这些信息,很多模型提供商在这里都提供了预设的模板供你选择,选择对应的模板后,相关信息会自动填充。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="provider-save-button"]',content:"填写完所有信息后,点击保存按钮,模型提供商就配置完成了。",placement:"top",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="provider-cancel-button"]',content:"因为这次咱们什么都没有填写,所以点击取消按钮退出吧。",placement:"top",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!0,hideFooter:!0},{target:'[data-tour="sidebar-model-management"]',content:'配置好模型提供商后,接下来我们需要为麦麦添加模型并分配功能。点击"下一步"进入模型管理页面。',placement:"right",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="add-model-button"]',content:'在为麦麦的组件分配模型之前,首先需要添加你想要分配的模型,点击"添加模型"按钮开始添加。',placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!0,hideFooter:!0},{target:'[data-tour="model-dialog"]',content:"在这里,你可以选择你之前配置好的模型提供商,然后选择对应的模型来添加。",placement:"left",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="model-name-input"]',content:"这里的模型名称是你为这个模型起的一个名字,方便你在后续使用时识别它。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="model-provider-select"]',content:"在这里选择你之前配置好的模型提供商,这样系统才能知道你要添加哪个提供商的模型。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="model-identifier-input"]',content:"这里需要填写你想要添加的模型的标识符,不同的模型提供商可能有不同的标识符格式,请参考对应提供商的文档。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="model-save-button"]',content:"填写完所有信息后,点击保存按钮,模型就添加完成了。",placement:"top",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="model-cancel-button"]',content:"当然,因为这次咱们什么都没有填写,所以直接点击取消按钮退出吧,等你准备好了再来添加模型。",placement:"top",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!0,hideFooter:!0},{target:'[data-tour="tasks-tab-trigger"]',content:'最后一步,添加好模型后,切换到"为模型分配功能"标签页,为麦麦的各个组件分配合适的模型。',placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!0,hideFooter:!0},{target:'[data-tour="task-model-select"]',content:"在这里,你可以为每个组件选择一个或多个合适的模型,选择完成后配置会自动保存。恭喜你完成了模型配置的学习!",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1}],wQ={0:"/config/model",1:"/config/model",2:"/config/modelProvider",3:"/config/modelProvider",4:"/config/modelProvider",5:"/config/modelProvider",6:"/config/modelProvider",7:"/config/modelProvider",8:"/config/modelProvider",9:"/config/modelProvider",10:"/config/modelProvider",11:"/config/model",12:"/config/model",13:"/config/model",14:"/config/model",15:"/config/model",16:"/config/model",17:"/config/model",18:"/config/model",19:"/config/model"},h0=[{id:"siliconflow",name:"SiliconFlow",base_url:"https://api.siliconflow.cn/v1",client_type:"openai",display_name:"硅基流动 (SiliconFlow)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"deepseek",name:"DeepSeek",base_url:"https://api.deepseek.com",client_type:"openai",display_name:"DeepSeek",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"rinkoai",name:"RinkoAI",base_url:"https://rinkoai.com/v1",client_type:"openai",display_name:"RinkoAI",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"zhipu",name:"ZhipuAI",base_url:"https://open.bigmodel.cn/api/paas/v4",client_type:"openai",display_name:"智谱 AI (ZhipuAI / GLM)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"moonshot",name:"Moonshot",base_url:"https://api.moonshot.cn/v1",client_type:"openai",display_name:"月之暗面 (Moonshot / Kimi)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"doubao",name:"Doubao",base_url:"https://ark.cn-beijing.volces.com/api/v3",client_type:"openai",display_name:"字节豆包 (Doubao)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"alibaba",name:"Alibaba",base_url:"https://dashscope.aliyuncs.com/compatible-mode/v1",client_type:"openai",display_name:"阿里云百炼 (Alibaba Qwen)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"baichuan",name:"Baichuan",base_url:"https://api.baichuan-ai.com/v1",client_type:"openai",display_name:"百川智能 (Baichuan)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"minimax",name:"MiniMax",base_url:"https://api.minimax.chat/v1",client_type:"openai",display_name:"MiniMax (海螺 AI)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"stepfun",name:"StepFun",base_url:"https://api.stepfun.com/v1",client_type:"openai",display_name:"阶跃星辰 (StepFun)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"lingyi",name:"Lingyi",base_url:"https://api.lingyiwanwu.com/v1",client_type:"openai",display_name:"零一万物 (Lingyi / Yi)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"openai",name:"OpenAI",base_url:"https://api.openai.com/v1",client_type:"openai",display_name:"OpenAI",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"xai",name:"xAI",base_url:"https://api.x.ai/v1",client_type:"openai",display_name:"xAI (Grok)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"anthropic",name:"Anthropic",base_url:"https://api.anthropic.com/v1",client_type:"openai",display_name:"Anthropic (Claude)"},{id:"gemini",name:"Gemini",base_url:"https://generativelanguage.googleapis.com/v1beta",client_type:"gemini",display_name:"Google Gemini",modelFetcher:{endpoint:"/models",parser:"gemini"}},{id:"cohere",name:"Cohere",base_url:"https://api.cohere.ai/v1",client_type:"openai",display_name:"Cohere"},{id:"groq",name:"Groq",base_url:"https://api.groq.com/openai/v1",client_type:"openai",display_name:"Groq",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"together",name:"Together AI",base_url:"https://api.together.xyz/v1",client_type:"openai",display_name:"Together AI",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"fireworks",name:"Fireworks",base_url:"https://api.fireworks.ai/inference/v1",client_type:"openai",display_name:"Fireworks AI",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"mistral",name:"Mistral",base_url:"https://api.mistral.ai/v1",client_type:"openai",display_name:"Mistral AI",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"perplexity",name:"Perplexity",base_url:"https://api.perplexity.ai",client_type:"openai",display_name:"Perplexity AI"},{id:"custom",name:"",base_url:"",client_type:"openai",display_name:"自定义"}];function iM(t){return t?t.replace(/\/+$/,"").toLowerCase():""}function t1e(t){if(!t)return null;const e=iM(t);return h0.find(n=>n.id!=="custom"&&iM(n.base_url)===e)||null}function n1e(){const[t,e]=b.useState([]),[n,r]=b.useState(!0),[s,i]=b.useState(!1),[a,l]=b.useState(!1),[c,d]=b.useState(!1),[h,m]=b.useState(!1),[g,x]=b.useState(!1),[y,w]=b.useState(!1),[S,k]=b.useState(null),[j,N]=b.useState(null),[T,E]=b.useState("custom"),[_,A]=b.useState(!1),[D,q]=b.useState(!1),[B,H]=b.useState(null),[W,ee]=b.useState(!1),[I,V]=b.useState(""),[L,$]=b.useState(new Set),[K,Y]=b.useState(!1),[R,ie]=b.useState(1),[X,z]=b.useState(20),[U,te]=b.useState(""),[ne,G]=b.useState(new Set),[se,re]=b.useState(new Map),{toast:ae}=Lr(),_e=na(),{state:Be,goToStep:Ye,registerTour:Je}=nN(),Oe=b.useRef(null),Ve=b.useRef(!0);b.useEffect(()=>{Je(Rl,bQ)},[Je]),b.useEffect(()=>{if(Be.activeTourId===Rl&&Be.isRunning){const ve=wQ[Be.stepIndex];ve&&!window.location.pathname.endsWith(ve.replace("/config/",""))&&_e({to:ve})}},[Be.stepIndex,Be.activeTourId,Be.isRunning,_e]);const Ue=b.useRef(Be.stepIndex);b.useEffect(()=>{if(Be.activeTourId===Rl&&Be.isRunning){const ve=Ue.current,He=Be.stepIndex;ve>=3&&ve<=9&&He<3&&w(!1),Ue.current=He}},[Be.stepIndex,Be.activeTourId,Be.isRunning]),b.useEffect(()=>{if(Be.activeTourId!==Rl||!Be.isRunning)return;const ve=He=>{const ht=He.target,vn=Be.stepIndex;vn===2&&ht.closest('[data-tour="add-provider-button"]')?setTimeout(()=>Ye(3),300):vn===9&&ht.closest('[data-tour="provider-cancel-button"]')&&setTimeout(()=>Ye(10),300)};return document.addEventListener("click",ve,!0),()=>document.removeEventListener("click",ve,!0)},[Be,Ye]),b.useEffect(()=>{$e()},[]);const $e=async()=>{try{r(!0);const ve=await Dh();e(ve.api_providers||[]),d(!1),Ve.current=!1}catch(ve){console.error("加载配置失败:",ve)}finally{r(!1)}},jt=async()=>{try{m(!0),cb().catch(()=>{}),x(!0)}catch(ve){console.error("重启失败:",ve),x(!1),ae({title:"重启失败",description:"无法发送重启请求,请手动重启",variant:"destructive"}),m(!1)}},vt=async()=>{try{i(!0),Oe.current&&clearTimeout(Oe.current);const ve=await Dh();ve.api_providers=t,await Uv(ve),d(!1),ae({title:"保存成功",description:"正在重启麦麦..."}),await jt()}catch(ve){console.error("保存配置失败:",ve),ae({title:"保存失败",description:ve.message,variant:"destructive"}),i(!1)}},$n=()=>{localStorage.removeItem("access-token"),window.location.href="/auth"},qt=()=>{x(!1),m(!1),ae({title:"重启超时",description:"服务未能在预期时间内恢复,请手动检查或刷新页面",variant:"destructive"})},un=b.useCallback(async ve=>{if(!Ve.current)try{l(!0),await bk("api_providers",ve),d(!1)}catch(He){console.error("自动保存失败:",He),d(!0)}finally{l(!1)}},[]);b.useEffect(()=>{if(!Ve.current)return d(!0),Oe.current&&clearTimeout(Oe.current),Oe.current=setTimeout(()=>{un(t)},2e3),()=>{Oe.current&&clearTimeout(Oe.current)}},[t,un]);const Mt=async()=>{try{i(!0),Oe.current&&clearTimeout(Oe.current);const ve=await Dh();ve.api_providers=t,await Uv(ve),d(!1),ae({title:"保存成功",description:"模型提供商配置已保存"})}catch(ve){console.error("保存配置失败:",ve),ae({title:"保存失败",description:ve.message,variant:"destructive"})}finally{i(!1)}},ct=(ve,He)=>{if(ve){const ht=h0.find(vn=>vn.base_url===ve.base_url&&vn.client_type===ve.client_type);E(ht?.id||"custom"),k(ve)}else E("custom"),k({name:"",base_url:"",api_key:"",client_type:"openai",max_retry:2,timeout:30,retry_interval:10});N(He),ee(!1),w(!0)},Ne=ve=>{E(ve),A(!1);const He=h0.find(ht=>ht.id===ve);He&&He.id!=="custom"?k(ht=>({...ht,name:He.name,base_url:He.base_url,client_type:He.client_type})):He?.id==="custom"&&k(ht=>({...ht,name:"",base_url:"",client_type:"openai"}))},ze=b.useMemo(()=>T!=="custom",[T]),rt=async()=>{if(S?.api_key)try{await navigator.clipboard.writeText(S.api_key),ae({title:"复制成功",description:"API Key 已复制到剪贴板"})}catch{ae({title:"复制失败",description:"无法访问剪贴板",variant:"destructive"})}},bt=()=>{if(!S)return;const ve={...S,max_retry:S.max_retry??2,timeout:S.timeout??30,retry_interval:S.retry_interval??10};if(j!==null){const He=[...t];He[j]=ve,e(He)}else e([...t,ve]);w(!1),k(null),N(null)},zt=ve=>{if(!ve&&S){const He={...S,max_retry:S.max_retry??2,timeout:S.timeout??30,retry_interval:S.retry_interval??10};k(He)}w(ve)},Rt=ve=>{H(ve),q(!0)},Hn=()=>{if(B!==null){const ve=t.filter((He,ht)=>ht!==B);e(ve),ae({title:"删除成功",description:"提供商已从列表中移除"})}q(!1),H(null)},We=ve=>{const He=new Set(L);He.has(ve)?He.delete(ve):He.add(ve),$(He)},ot=()=>{if(L.size===xn.length)$(new Set);else{const ve=xn.map((He,ht)=>t.findIndex(vn=>vn===xn[ht]));$(new Set(ve))}},dn=()=>{if(L.size===0){ae({title:"提示",description:"请先选择要删除的提供商",variant:"default"});return}Y(!0)},Pt=()=>{const ve=t.filter((He,ht)=>!L.has(ht));e(ve),$(new Set),Y(!1),ae({title:"批量删除成功",description:`已删除 ${L.size} 个提供商`})},xn=t.filter(ve=>{if(!I)return!0;const He=I.toLowerCase();return ve.name.toLowerCase().includes(He)||ve.base_url.toLowerCase().includes(He)||ve.client_type.toLowerCase().includes(He)}),dt=Math.ceil(xn.length/X),rn=xn.slice((R-1)*X,R*X),wt=()=>{const ve=parseInt(U);ve>=1&&ve<=dt&&(ie(ve),te(""))},Wt=async ve=>{G(He=>new Set(He).add(ve));try{const He=await Cae(ve);re(ht=>new Map(ht).set(ve,He)),He.network_ok?He.api_key_valid===!0?ae({title:"连接正常",description:`${ve} 网络连接正常,API Key 有效 (${He.latency_ms}ms)`}):He.api_key_valid===!1?ae({title:"连接正常但 Key 无效",description:`${ve} 网络连接正常,但 API Key 无效或已过期`,variant:"destructive"}):ae({title:"网络连接正常",description:`${ve} 可以访问 (${He.latency_ms}ms)`}):ae({title:"连接失败",description:He.error||"无法连接到提供商",variant:"destructive"})}catch(He){ae({title:"测试失败",description:He.message,variant:"destructive"})}finally{G(He=>{const ht=new Set(He);return ht.delete(ve),ht})}},Gt=async()=>{for(const ve of t)await Wt(ve.name)},lt=ve=>{const He=ne.has(ve),ht=se.get(ve);return He?o.jsxs(tn,{variant:"secondary",className:"gap-1",children:[o.jsx(Us,{className:"h-3 w-3 animate-spin"}),"测试中"]}):ht?ht.network_ok?ht.api_key_valid===!0?o.jsxs(tn,{className:"gap-1 bg-green-600 hover:bg-green-700",children:[o.jsx(Ya,{className:"h-3 w-3"}),"正常"]}):ht.api_key_valid===!1?o.jsxs(tn,{variant:"destructive",className:"gap-1",children:[o.jsx(Lo,{className:"h-3 w-3"}),"Key无效"]}):o.jsxs(tn,{className:"gap-1 bg-blue-600 hover:bg-blue-700",children:[o.jsx(Ya,{className:"h-3 w-3"}),"可访问"]}):o.jsxs(tn,{variant:"destructive",className:"gap-1",children:[o.jsx(OI,{className:"h-3 w-3"}),"离线"]}):null};return n?o.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})}):o.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"AI模型厂商配置"}),o.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理 AI 模型厂商的 API 配置"})]}),o.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[L.size>0&&o.jsxs(ue,{onClick:dn,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[o.jsx(Cn,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"批量删除 (",L.size,")"]}),o.jsxs(ue,{onClick:Gt,size:"sm",variant:"outline",className:"w-full sm:w-auto",disabled:t.length===0||ne.size>0,children:[o.jsx(Zu,{className:"mr-2 h-4 w-4"}),ne.size>0?`测试中 (${ne.size})`:"测试全部"]}),o.jsxs(ue,{onClick:()=>ct(null,null),size:"sm",className:"w-full sm:w-auto","data-tour":"add-provider-button",children:[o.jsx(Is,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"添加提供商"]}),o.jsxs(ue,{onClick:Mt,disabled:s||a||!c||h,size:"sm",variant:"outline",className:"w-full sm:w-auto sm:min-w-[120px]",children:[o.jsx(zp,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),s?"保存中...":a?"自动保存中...":c?"保存配置":"已保存"]}),o.jsxs(Fn,{children:[o.jsx(is,{asChild:!0,children:o.jsxs(ue,{disabled:s||a||h,size:"sm",className:"w-full sm:w-auto sm:min-w-[120px]",children:[o.jsx(Dp,{className:"mr-2 h-4 w-4"}),h?"重启中...":c?"保存并重启":"重启麦麦"]})}),o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认重启麦麦?"}),o.jsx(zn,{className:"space-y-3",asChild:!0,children:o.jsxs("div",{children:[o.jsx("p",{children:c?"当前有未保存的配置更改。点击确认将先保存配置,然后重启麦麦使新配置生效。重启过程中麦麦将暂时离线。":"即将重启麦麦主程序。重启过程中麦麦将暂时离线,配置将在重启后生效。"}),o.jsxs(ba,{className:"border-yellow-500/50 bg-yellow-500/10",children:[o.jsx(Xi,{className:"h-4 w-4 text-yellow-600"}),o.jsxs(wa,{className:"text-yellow-900 dark:text-yellow-100",children:[o.jsx("strong",{children:"重要提示:"}),"由于技术原因,使用重启功能后,将无法再使用 ",o.jsx("code",{className:"px-1 py-0.5 bg-yellow-200 dark:bg-yellow-900 rounded",children:"Ctrl+C"})," 结束程序。",o.jsxs(Er,{children:[o.jsx(Of,{asChild:!0,children:o.jsxs("button",{className:"ml-1 text-yellow-700 dark:text-yellow-300 underline hover:text-yellow-800 dark:hover:text-yellow-200 inline-flex items-center gap-1",children:[o.jsx(Zy,{className:"h-3 w-3"}),"如何结束程序?"]})}),o.jsxs(wr,{className:"max-w-2xl",children:[o.jsxs(Sr,{children:[o.jsx(kr,{children:"如何结束使用重启功能后的麦麦程序"}),o.jsx(Xr,{children:"由于重启功能会使程序脱离终端控制,需要通过系统命令来结束进程"})]}),o.jsxs(Yi,{defaultValue:"windows",className:"w-full",children:[o.jsxs(ji,{className:"grid w-full grid-cols-3",children:[o.jsx(Bt,{value:"windows",children:"Windows"}),o.jsx(Bt,{value:"macos",children:"macOS"}),o.jsx(Bt,{value:"linux",children:"Linux"})]}),o.jsxs(ln,{value:"windows",className:"space-y-4 mt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"方法一:使用任务管理器"}),o.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[o.jsxs("li",{children:["按 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Ctrl + Shift + Esc"})," 打开任务管理器"]}),o.jsxs("li",{children:["在“进程”或“详细信息”标签页中找到 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"python.exe"})]}),o.jsx("li",{children:"右键点击并选择“结束任务”"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"方法二:使用命令行"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"打开 PowerShell 或命令提示符,执行以下命令:"}),o.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[o.jsx("p",{children:"# 查找麦麦进程"}),o.jsx("p",{children:'Get-Process python | Where-Object {$_.MainWindowTitle -eq ""}'}),o.jsx("p",{className:"mt-2",children:"# 结束所有 Python 进程(谨慎使用)"}),o.jsx("p",{children:"Stop-Process -Name python -Force"})]})]})]}),o.jsxs(ln,{value:"macos",className:"space-y-4 mt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"方法一:使用活动监视器"}),o.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[o.jsxs("li",{children:["按 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Cmd + Space"})," 打开 Spotlight,搜索“活动监视器”"]}),o.jsxs("li",{children:["在进程列表中找到 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Python"})]}),o.jsx("li",{children:"选中后点击左上角的 X 按钮结束进程"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"方法二:使用终端"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"打开终端,执行以下命令:"}),o.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[o.jsx("p",{children:"# 查找麦麦进程"}),o.jsx("p",{children:"ps aux | grep python | grep -v grep"}),o.jsx("p",{className:"mt-2",children:"# 结束指定 PID 的进程"}),o.jsx("p",{children:"kill -9 <PID>"}),o.jsx("p",{className:"mt-2",children:"# 或结束所有 Python 进程(谨慎使用)"}),o.jsx("p",{children:"pkill -9 python"})]})]})]}),o.jsxs(ln,{value:"linux",className:"space-y-4 mt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"使用终端命令"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"打开终端,执行以下命令:"}),o.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[o.jsx("p",{children:"# 查找麦麦进程"}),o.jsx("p",{children:"ps aux | grep python | grep -v grep"}),o.jsx("p",{className:"mt-2",children:"# 结束指定 PID 的进程"}),o.jsx("p",{children:"kill -9 <PID>"}),o.jsx("p",{className:"mt-2",children:"# 或使用 pkill 按名称结束"}),o.jsx("p",{children:'pkill -9 -f "bot.py"'}),o.jsx("p",{className:"mt-2",children:"# 或结束所有 Python 进程(谨慎使用)"}),o.jsx("p",{children:"pkill -9 python"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"使用 htop(如已安装)"}),o.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[o.jsxs("li",{children:["在终端输入 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"htop"})]}),o.jsxs("li",{children:["按 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"F3"})," 搜索 python"]}),o.jsxs("li",{children:["按 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"F9"})," 发送信号,选择 SIGKILL"]})]})]})]})]}),o.jsx(fs,{children:o.jsx(e6,{asChild:!0,children:o.jsx(ue,{variant:"outline",children:"关闭"})})})]})]})]})]})]})})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:c?vt:jt,children:c?"保存并重启":"确认重启"})]})]})]})]})]}),o.jsxs(ba,{children:[o.jsx(Xi,{className:"h-4 w-4"}),o.jsxs(wa,{children:["配置更新后需要",o.jsx("strong",{children:"重启麦麦"}),'才能生效。你可以点击右上角的"保存并重启"按钮一键完成保存和重启。']})]}),o.jsxs(pn,{className:"h-[calc(100vh-260px)]",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2 mb-4",children:[o.jsxs("div",{className:"relative w-full sm:flex-1 sm:max-w-sm",children:[o.jsx(ii,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),o.jsx(Pe,{placeholder:"搜索提供商名称、URL 或类型...",value:I,onChange:ve=>V(ve.target.value),className:"pl-9"})]}),I&&o.jsxs("p",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["找到 ",xn.length," 个结果"]})]}),o.jsx("div",{className:"md:hidden space-y-3",children:xn.length===0?o.jsx("div",{className:"text-center text-muted-foreground py-8 rounded-lg border bg-card",children:I?"未找到匹配的提供商":'暂无提供商配置,点击"添加提供商"开始配置'}):rn.map((ve,He)=>{const ht=t.findIndex(vn=>vn===ve);return o.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3",children:[o.jsxs("div",{className:"flex items-start justify-between gap-2",children:[o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[o.jsx("h3",{className:"font-semibold text-base truncate",children:ve.name}),lt(ve.name)]}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1 break-all",children:ve.base_url})]}),o.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[o.jsx(ue,{variant:"outline",size:"sm",onClick:()=>Wt(ve.name),disabled:ne.has(ve.name),title:"测试连接",children:ne.has(ve.name)?o.jsx(Us,{className:"h-4 w-4 animate-spin"}):o.jsx(Zu,{className:"h-4 w-4"})}),o.jsx(ue,{variant:"default",size:"sm",onClick:()=>ct(ve,ht),children:o.jsx(Ju,{className:"h-4 w-4",strokeWidth:2,fill:"none"})}),o.jsx(ue,{size:"sm",onClick:()=>Rt(ht),className:"bg-red-600 hover:bg-red-700 text-white",children:o.jsx(Cn,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"客户端类型"}),o.jsx("p",{className:"font-medium",children:ve.client_type})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"最大重试"}),o.jsx("p",{className:"font-medium",children:ve.max_retry})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"超时(秒)"}),o.jsx("p",{className:"font-medium",children:ve.timeout})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"重试间隔(秒)"}),o.jsx("p",{className:"font-medium",children:ve.retry_interval})]})]})]},He)})}),o.jsx("div",{className:"hidden md:block rounded-lg border bg-card overflow-hidden",children:o.jsx("div",{className:"overflow-x-auto",children:o.jsxs(Af,{children:[o.jsx(Mf,{children:o.jsxs(zs,{children:[o.jsx(mn,{className:"w-12",children:o.jsx(Ci,{checked:L.size===xn.length&&xn.length>0,onCheckedChange:ot})}),o.jsx(mn,{children:"状态"}),o.jsx(mn,{children:"名称"}),o.jsx(mn,{children:"基础URL"}),o.jsx(mn,{children:"客户端类型"}),o.jsx(mn,{className:"text-right",children:"最大重试"}),o.jsx(mn,{className:"text-right",children:"超时(秒)"}),o.jsx(mn,{className:"text-right",children:"重试间隔(秒)"}),o.jsx(mn,{className:"text-right",children:"操作"})]})}),o.jsx(Rf,{children:rn.length===0?o.jsx(zs,{children:o.jsx(Yt,{colSpan:9,className:"text-center text-muted-foreground py-8",children:I?"未找到匹配的提供商":'暂无提供商配置,点击"添加提供商"开始配置'})}):rn.map((ve,He)=>{const ht=t.findIndex(vn=>vn===ve);return o.jsxs(zs,{children:[o.jsx(Yt,{children:o.jsx(Ci,{checked:L.has(ht),onCheckedChange:()=>We(ht)})}),o.jsx(Yt,{children:lt(ve.name)||o.jsx(tn,{variant:"outline",className:"text-muted-foreground",children:"未测试"})}),o.jsx(Yt,{className:"font-medium",children:ve.name}),o.jsx(Yt,{className:"max-w-xs truncate",title:ve.base_url,children:ve.base_url}),o.jsx(Yt,{children:ve.client_type}),o.jsx(Yt,{className:"text-right",children:ve.max_retry}),o.jsx(Yt,{className:"text-right",children:ve.timeout}),o.jsx(Yt,{className:"text-right",children:ve.retry_interval}),o.jsx(Yt,{className:"text-right",children:o.jsxs("div",{className:"flex justify-end gap-2",children:[o.jsx(ue,{variant:"outline",size:"sm",onClick:()=>Wt(ve.name),disabled:ne.has(ve.name),title:"测试连接",children:ne.has(ve.name)?o.jsx(Us,{className:"h-4 w-4 animate-spin"}):o.jsx(Zu,{className:"h-4 w-4"})}),o.jsxs(ue,{variant:"default",size:"sm",onClick:()=>ct(ve,ht),children:[o.jsx(Ju,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),o.jsxs(ue,{size:"sm",onClick:()=>Rt(ht),className:"bg-red-600 hover:bg-red-700 text-white",children:[o.jsx(Cn,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})})]},He)})})]})})}),xn.length>0&&o.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 mt-4",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(he,{htmlFor:"page-size-provider",className:"text-sm whitespace-nowrap",children:"每页显示"}),o.jsxs(Vt,{value:X.toString(),onValueChange:ve=>{z(parseInt(ve)),ie(1),$(new Set)},children:[o.jsx($t,{id:"page-size-provider",className:"w-20",children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"10",children:"10"}),o.jsx(De,{value:"20",children:"20"}),o.jsx(De,{value:"50",children:"50"}),o.jsx(De,{value:"100",children:"100"})]})]}),o.jsxs("span",{className:"text-sm text-muted-foreground",children:["显示 ",(R-1)*X+1," 到"," ",Math.min(R*X,xn.length)," 条,共 ",xn.length," 条"]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ue,{variant:"outline",size:"sm",onClick:()=>ie(1),disabled:R===1,className:"hidden sm:flex",children:o.jsx(Ip,{className:"h-4 w-4"})}),o.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>ie(ve=>Math.max(1,ve-1)),disabled:R===1,children:[o.jsx(wd,{className:"h-4 w-4 sm:mr-1"}),o.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Pe,{type:"number",value:U,onChange:ve=>te(ve.target.value),onKeyDown:ve=>ve.key==="Enter"&&wt(),placeholder:R.toString(),className:"w-16 h-8 text-center",min:1,max:dt}),o.jsx(ue,{variant:"outline",size:"sm",onClick:wt,disabled:!U,className:"h-8",children:"跳转"})]}),o.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>ie(ve=>ve+1),disabled:R>=dt,children:[o.jsx("span",{className:"hidden sm:inline",children:"下一页"}),o.jsx(Zl,{className:"h-4 w-4 sm:ml-1"})]}),o.jsx(ue,{variant:"outline",size:"sm",onClick:()=>ie(dt),disabled:R>=dt,className:"hidden sm:flex",children:o.jsx(Lp,{className:"h-4 w-4"})})]})]})]}),o.jsx(Er,{open:y,onOpenChange:zt,children:o.jsxs(wr,{className:"max-w-[95vw] sm:max-w-2xl max-h-[90vh] overflow-y-auto","data-tour":"provider-dialog",preventOutsideClose:Be.isRunning,children:[o.jsxs(Sr,{children:[o.jsx(kr,{children:j!==null?"编辑提供商":"添加提供商"}),o.jsx(Xr,{children:"配置 API 提供商的连接信息和参数"})]}),o.jsxs("form",{onSubmit:ve=>{ve.preventDefault(),bt()},autoComplete:"off",children:[o.jsxs("div",{className:"grid gap-4 py-4",children:[o.jsxs("div",{className:"grid gap-2","data-tour":"provider-template-select",children:[o.jsx(he,{htmlFor:"template",children:"提供商模板"}),o.jsxs(Bo,{open:_,onOpenChange:A,children:[o.jsx(Fo,{asChild:!0,children:o.jsxs(ue,{variant:"outline",role:"combobox","aria-expanded":_,className:"w-full justify-between",children:[T?h0.find(ve=>ve.id===T)?.display_name:"选择提供商模板...",o.jsx(Lj,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),o.jsx(Ka,{className:"p-0",align:"start",style:{width:"var(--radix-popover-trigger-width)"},children:o.jsxs(Tb,{children:[o.jsx(Eb,{placeholder:"搜索提供商模板..."}),o.jsx(pn,{className:"h-[300px]",children:o.jsxs(_b,{className:"max-h-none overflow-visible",children:[o.jsx(Ab,{children:"未找到匹配的模板"}),o.jsx(up,{children:h0.map(ve=>o.jsxs(dp,{value:ve.display_name,onSelect:()=>Ne(ve.id),children:[o.jsx(zo,{className:`mr-2 h-4 w-4 ${T===ve.id?"opacity-100":"opacity-0"}`}),ve.display_name]},ve.id))})]})})]})})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"选择预设模板可自动填充 URL 和客户端类型,支持搜索"})]}),o.jsxs("div",{className:"grid gap-2","data-tour":"provider-name-input",children:[o.jsx(he,{htmlFor:"name",children:"名称 *"}),o.jsx(Pe,{id:"name",value:S?.name||"",onChange:ve=>k(He=>He?{...He,name:ve.target.value}:null),placeholder:"例如: DeepSeek, SiliconFlow"})]}),o.jsxs("div",{className:"grid gap-2","data-tour":"provider-url-input",children:[o.jsx(he,{htmlFor:"base_url",children:"基础 URL *"}),o.jsx(Pe,{id:"base_url",value:S?.base_url||"",onChange:ve=>k(He=>He?{...He,base_url:ve.target.value}:null),placeholder:"https://api.example.com/v1",disabled:ze,className:ze?"bg-muted cursor-not-allowed":""}),ze&&o.jsx("p",{className:"text-xs text-muted-foreground",children:'使用模板时 URL 不可编辑,切换到"自定义"以手动配置'})]}),o.jsxs("div",{className:"grid gap-2","data-tour":"provider-apikey-input",children:[o.jsx(he,{htmlFor:"api_key",children:"API Key *"}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Pe,{id:"api_key",type:W?"text":"password",value:S?.api_key||"",onChange:ve=>k(He=>He?{...He,api_key:ve.target.value}:null),placeholder:"sk-...",className:"flex-1"}),o.jsx(ue,{type:"button",variant:"outline",size:"icon",onClick:()=>ee(!W),title:W?"隐藏密钥":"显示密钥",children:W?o.jsx(I0,{className:"h-4 w-4"}):o.jsx(Ji,{className:"h-4 w-4"})}),o.jsx(ue,{type:"button",variant:"outline",size:"icon",onClick:rt,title:"复制密钥",children:o.jsx(Iv,{className:"h-4 w-4"})})]})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"client_type",children:"客户端类型"}),o.jsxs(Vt,{value:S?.client_type||"openai",onValueChange:ve=>k(He=>He?{...He,client_type:ve}:null),disabled:ze,children:[o.jsx($t,{id:"client_type",className:ze?"bg-muted cursor-not-allowed":"",children:o.jsx(Ut,{placeholder:"选择客户端类型"})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"openai",children:"OpenAI"}),o.jsx(De,{value:"gemini",children:"Gemini"})]})]}),ze&&o.jsx("p",{className:"text-xs text-muted-foreground",children:'使用模板时客户端类型不可编辑,切换到"自定义"以手动配置'})]}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"max_retry",children:"最大重试"}),o.jsx(Pe,{id:"max_retry",type:"number",min:"0",value:S?.max_retry??"",onChange:ve=>{const He=ve.target.value===""?null:parseInt(ve.target.value);k(ht=>ht?{...ht,max_retry:He}:null)},placeholder:"默认: 2"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"timeout",children:"超时(秒)"}),o.jsx(Pe,{id:"timeout",type:"number",min:"1",value:S?.timeout??"",onChange:ve=>{const He=ve.target.value===""?null:parseInt(ve.target.value);k(ht=>ht?{...ht,timeout:He}:null)},placeholder:"默认: 30"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"retry_interval",children:"重试间隔(秒)"}),o.jsx(Pe,{id:"retry_interval",type:"number",min:"1",value:S?.retry_interval??"",onChange:ve=>{const He=ve.target.value===""?null:parseInt(ve.target.value);k(ht=>ht?{...ht,retry_interval:He}:null)},placeholder:"默认: 10"})]})]})]}),o.jsxs(fs,{children:[o.jsx(ue,{type:"button",variant:"outline",onClick:()=>w(!1),"data-tour":"provider-cancel-button",children:"取消"}),o.jsx(ue,{type:"submit","data-tour":"provider-save-button",children:"保存"})]})]})]})}),o.jsx(Fn,{open:D,onOpenChange:q,children:o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认删除"}),o.jsxs(zn,{children:['确定要删除提供商 "',B!==null?t[B]?.name:"",'" 吗? 此操作无法撤销。']})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:Hn,children:"删除"})]})]})}),o.jsx(Fn,{open:K,onOpenChange:Y,children:o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认批量删除"}),o.jsxs(zn,{children:["确定要删除选中的 ",L.size," 个提供商吗? 此操作无法撤销。"]})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:Pt,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})}),g&&o.jsx(r6,{onRestartComplete:$n,onRestartFailed:qt})]})}function r1e(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return b.useMemo(()=>r=>{e.forEach(s=>s(r))},e)}const Pb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function If(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function rN(t){return"nodeType"in t}function _i(t){var e,n;return t?If(t)?t:rN(t)&&(e=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}function sN(t){const{Document:e}=_i(t);return t instanceof e}function hg(t){return If(t)?!1:t instanceof _i(t).HTMLElement}function SQ(t){return t instanceof _i(t).SVGElement}function Lf(t){return t?If(t)?t.document:rN(t)?sN(t)?t:hg(t)||SQ(t)?t.ownerDocument:document:document:document}const $o=Pb?b.useLayoutEffect:b.useEffect;function iN(t){const e=b.useRef(t);return $o(()=>{e.current=t}),b.useCallback(function(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return e.current==null?void 0:e.current(...r)},[])}function s1e(){const t=b.useRef(null),e=b.useCallback((r,s)=>{t.current=setInterval(r,s)},[]),n=b.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[e,n]}function mp(t,e){e===void 0&&(e=[t]);const n=b.useRef(t);return $o(()=>{n.current!==t&&(n.current=t)},e),n}function fg(t,e){const n=b.useRef();return b.useMemo(()=>{const r=t(n.current);return n.current=r,r},[...e])}function yy(t){const e=iN(t),n=b.useRef(null),r=b.useCallback(s=>{s!==n.current&&e?.(s,n.current),n.current=s},[]);return[n,r]}function NO(t){const e=b.useRef();return b.useEffect(()=>{e.current=t},[t]),e.current}let CS={};function mg(t,e){return b.useMemo(()=>{if(e)return e;const n=CS[t]==null?0:CS[t]+1;return CS[t]=n,t+"-"+n},[t,e])}function kQ(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return r.reduce((i,a)=>{const l=Object.entries(a);for(const[c,d]of l){const h=i[c];h!=null&&(i[c]=h+t*d)}return i},{...e})}}const qh=kQ(1),pp=kQ(-1);function i1e(t){return"clientX"in t&&"clientY"in t}function aN(t){if(!t)return!1;const{KeyboardEvent:e}=_i(t.target);return e&&t instanceof e}function a1e(t){if(!t)return!1;const{TouchEvent:e}=_i(t.target);return e&&t instanceof e}function CO(t){if(a1e(t)){if(t.touches&&t.touches.length){const{clientX:e,clientY:n}=t.touches[0];return{x:e,y:n}}else if(t.changedTouches&&t.changedTouches.length){const{clientX:e,clientY:n}=t.changedTouches[0];return{x:e,y:n}}}return i1e(t)?{x:t.clientX,y:t.clientY}:null}const gp=Object.freeze({Translate:{toString(t){if(!t)return;const{x:e,y:n}=t;return"translate3d("+(e?Math.round(e):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;const{scaleX:e,scaleY:n}=t;return"scaleX("+e+") scaleY("+n+")"}},Transform:{toString(t){if(t)return[gp.Translate.toString(t),gp.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:n,easing:r}=t;return e+" "+n+"ms "+r}}}),aM="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function o1e(t){return t.matches(aM)?t:t.querySelector(aM)}const l1e={display:"none"};function c1e(t){let{id:e,value:n}=t;return oe.createElement("div",{id:e,style:l1e},n)}function u1e(t){let{id:e,announcement:n,ariaLiveType:r="assertive"}=t;const s={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return oe.createElement("div",{id:e,style:s,role:"status","aria-live":r,"aria-atomic":!0},n)}function d1e(){const[t,e]=b.useState("");return{announce:b.useCallback(r=>{r!=null&&e(r)},[]),announcement:t}}const OQ=b.createContext(null);function h1e(t){const e=b.useContext(OQ);b.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of <DndContext>");return e(t)},[t,e])}function f1e(){const[t]=b.useState(()=>new Set),e=b.useCallback(r=>(t.add(r),()=>t.delete(r)),[t]);return[b.useCallback(r=>{let{type:s,event:i}=r;t.forEach(a=>{var l;return(l=a[s])==null?void 0:l.call(a,i)})},[t]),e]}const m1e={draggable:`
|
||
To pick up a draggable item, press the space bar.
|
||
While dragging, use the arrow keys to move the item.
|
||
Press space again to drop the item in its new position, or press escape to cancel.
|
||
`},p1e={onDragStart(t){let{active:e}=t;return"Picked up draggable item "+e.id+"."},onDragOver(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was moved over droppable area "+n.id+".":"Draggable item "+e.id+" is no longer over a droppable area."},onDragEnd(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was dropped over droppable area "+n.id:"Draggable item "+e.id+" was dropped."},onDragCancel(t){let{active:e}=t;return"Dragging was cancelled. Draggable item "+e.id+" was dropped."}};function g1e(t){let{announcements:e=p1e,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=m1e}=t;const{announce:i,announcement:a}=d1e(),l=mg("DndLiveRegion"),[c,d]=b.useState(!1);if(b.useEffect(()=>{d(!0)},[]),h1e(b.useMemo(()=>({onDragStart(m){let{active:g}=m;i(e.onDragStart({active:g}))},onDragMove(m){let{active:g,over:x}=m;e.onDragMove&&i(e.onDragMove({active:g,over:x}))},onDragOver(m){let{active:g,over:x}=m;i(e.onDragOver({active:g,over:x}))},onDragEnd(m){let{active:g,over:x}=m;i(e.onDragEnd({active:g,over:x}))},onDragCancel(m){let{active:g,over:x}=m;i(e.onDragCancel({active:g,over:x}))}}),[i,e])),!c)return null;const h=oe.createElement(oe.Fragment,null,oe.createElement(c1e,{id:r,value:s.draggable}),oe.createElement(u1e,{id:l,announcement:a}));return n?ya.createPortal(h,n):h}var ds;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(ds||(ds={}));function by(){}function oM(t,e){return b.useMemo(()=>({sensor:t,options:e??{}}),[t,e])}function x1e(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return b.useMemo(()=>[...e].filter(r=>r!=null),[...e])}const eo=Object.freeze({x:0,y:0});function jQ(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function NQ(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return n-r}function v1e(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return r-n}function lM(t){let{left:e,top:n,height:r,width:s}=t;return[{x:e,y:n},{x:e+s,y:n},{x:e,y:n+r},{x:e+s,y:n+r}]}function CQ(t,e){if(!t||t.length===0)return null;const[n]=t;return n[e]}function cM(t,e,n){return e===void 0&&(e=t.left),n===void 0&&(n=t.top),{x:e+t.width*.5,y:n+t.height*.5}}const y1e=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=cM(e,e.left,e.top),i=[];for(const a of r){const{id:l}=a,c=n.get(l);if(c){const d=jQ(cM(c),s);i.push({id:l,data:{droppableContainer:a,value:d}})}}return i.sort(NQ)},b1e=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=lM(e),i=[];for(const a of r){const{id:l}=a,c=n.get(l);if(c){const d=lM(c),h=s.reduce((g,x,y)=>g+jQ(d[y],x),0),m=Number((h/4).toFixed(4));i.push({id:l,data:{droppableContainer:a,value:m}})}}return i.sort(NQ)};function w1e(t,e){const n=Math.max(e.top,t.top),r=Math.max(e.left,t.left),s=Math.min(e.left+e.width,t.left+t.width),i=Math.min(e.top+e.height,t.top+t.height),a=s-r,l=i-n;if(r<s&&n<i){const c=e.width*e.height,d=t.width*t.height,h=a*l,m=h/(c+d-h);return Number(m.toFixed(4))}return 0}const S1e=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=[];for(const i of r){const{id:a}=i,l=n.get(a);if(l){const c=w1e(l,e);c>0&&s.push({id:a,data:{droppableContainer:i,value:c}})}}return s.sort(v1e)};function k1e(t,e,n){return{...t,scaleX:e&&n?e.width/n.width:1,scaleY:e&&n?e.height/n.height:1}}function TQ(t,e){return t&&e?{x:t.left-e.left,y:t.top-e.top}:eo}function O1e(t){return function(n){for(var r=arguments.length,s=new Array(r>1?r-1:0),i=1;i<r;i++)s[i-1]=arguments[i];return s.reduce((a,l)=>({...a,top:a.top+t*l.y,bottom:a.bottom+t*l.y,left:a.left+t*l.x,right:a.right+t*l.x}),{...n})}}const j1e=O1e(1);function N1e(t){if(t.startsWith("matrix3d(")){const e=t.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}else if(t.startsWith("matrix(")){const e=t.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}function C1e(t,e,n){const r=N1e(e);if(!r)return t;const{scaleX:s,scaleY:i,x:a,y:l}=r,c=t.left-a-(1-s)*parseFloat(n),d=t.top-l-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),h=s?t.width/s:t.width,m=i?t.height/i:t.height;return{width:h,height:m,top:d,right:c+h,bottom:d+m,left:c}}const T1e={ignoreTransform:!1};function Bf(t,e){e===void 0&&(e=T1e);let n=t.getBoundingClientRect();if(e.ignoreTransform){const{transform:d,transformOrigin:h}=_i(t).getComputedStyle(t);d&&(n=C1e(n,d,h))}const{top:r,left:s,width:i,height:a,bottom:l,right:c}=n;return{top:r,left:s,width:i,height:a,bottom:l,right:c}}function uM(t){return Bf(t,{ignoreTransform:!0})}function E1e(t){const e=t.innerWidth,n=t.innerHeight;return{top:0,left:0,right:e,bottom:n,width:e,height:n}}function _1e(t,e){return e===void 0&&(e=_i(t).getComputedStyle(t)),e.position==="fixed"}function A1e(t,e){e===void 0&&(e=_i(t).getComputedStyle(t));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const i=e[s];return typeof i=="string"?n.test(i):!1})}function zb(t,e){const n=[];function r(s){if(e!=null&&n.length>=e||!s)return n;if(sN(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!hg(s)||SQ(s)||n.includes(s))return n;const i=_i(t).getComputedStyle(s);return s!==t&&A1e(s,i)&&n.push(s),_1e(s,i)?n:r(s.parentNode)}return t?r(t):n}function EQ(t){const[e]=zb(t,1);return e??null}function TS(t){return!Pb||!t?null:If(t)?t:rN(t)?sN(t)||t===Lf(t).scrollingElement?window:hg(t)?t:null:null}function _Q(t){return If(t)?t.scrollX:t.scrollLeft}function AQ(t){return If(t)?t.scrollY:t.scrollTop}function TO(t){return{x:_Q(t),y:AQ(t)}}var bs;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(bs||(bs={}));function MQ(t){return!Pb||!t?!1:t===document.scrollingElement}function RQ(t){const e={x:0,y:0},n=MQ(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},r={x:t.scrollWidth-n.width,y:t.scrollHeight-n.height},s=t.scrollTop<=e.y,i=t.scrollLeft<=e.x,a=t.scrollTop>=r.y,l=t.scrollLeft>=r.x;return{isTop:s,isLeft:i,isBottom:a,isRight:l,maxScroll:r,minScroll:e}}const M1e={x:.2,y:.2};function R1e(t,e,n,r,s){let{top:i,left:a,right:l,bottom:c}=n;r===void 0&&(r=10),s===void 0&&(s=M1e);const{isTop:d,isBottom:h,isLeft:m,isRight:g}=RQ(t),x={x:0,y:0},y={x:0,y:0},w={height:e.height*s.y,width:e.width*s.x};return!d&&i<=e.top+w.height?(x.y=bs.Backward,y.y=r*Math.abs((e.top+w.height-i)/w.height)):!h&&c>=e.bottom-w.height&&(x.y=bs.Forward,y.y=r*Math.abs((e.bottom-w.height-c)/w.height)),!g&&l>=e.right-w.width?(x.x=bs.Forward,y.x=r*Math.abs((e.right-w.width-l)/w.width)):!m&&a<=e.left+w.width&&(x.x=bs.Backward,y.x=r*Math.abs((e.left+w.width-a)/w.width)),{direction:x,speed:y}}function D1e(t){if(t===document.scrollingElement){const{innerWidth:i,innerHeight:a}=window;return{top:0,left:0,right:i,bottom:a,width:i,height:a}}const{top:e,left:n,right:r,bottom:s}=t.getBoundingClientRect();return{top:e,left:n,right:r,bottom:s,width:t.clientWidth,height:t.clientHeight}}function DQ(t){return t.reduce((e,n)=>qh(e,TO(n)),eo)}function P1e(t){return t.reduce((e,n)=>e+_Q(n),0)}function z1e(t){return t.reduce((e,n)=>e+AQ(n),0)}function I1e(t,e){if(e===void 0&&(e=Bf),!t)return;const{top:n,left:r,bottom:s,right:i}=e(t);EQ(t)&&(s<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const L1e=[["x",["left","right"],P1e],["y",["top","bottom"],z1e]];class oN{constructor(e,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=zb(n),s=DQ(r);this.rect={...e},this.width=e.width,this.height=e.height;for(const[i,a,l]of L1e)for(const c of a)Object.defineProperty(this,c,{get:()=>{const d=l(r),h=s[i]-d;return this.rect[c]+h},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class _0{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=e}add(e,n,r){var s;(s=this.target)==null||s.addEventListener(e,n,r),this.listeners.push([e,n,r])}}function B1e(t){const{EventTarget:e}=_i(t);return t instanceof e?t:Lf(t)}function ES(t,e){const n=Math.abs(t.x),r=Math.abs(t.y);return typeof e=="number"?Math.sqrt(n**2+r**2)>e:"x"in e&&"y"in e?n>e.x&&r>e.y:"x"in e?n>e.x:"y"in e?r>e.y:!1}var pa;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(pa||(pa={}));function dM(t){t.preventDefault()}function F1e(t){t.stopPropagation()}var jn;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"})(jn||(jn={}));const PQ={start:[jn.Space,jn.Enter],cancel:[jn.Esc],end:[jn.Space,jn.Enter,jn.Tab]},q1e=(t,e)=>{let{currentCoordinates:n}=e;switch(t.code){case jn.Right:return{...n,x:n.x+25};case jn.Left:return{...n,x:n.x-25};case jn.Down:return{...n,y:n.y+25};case jn.Up:return{...n,y:n.y-25}}};class lN{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:n}}=e;this.props=e,this.listeners=new _0(Lf(n)),this.windowListeners=new _0(_i(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(pa.Resize,this.handleCancel),this.windowListeners.add(pa.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(pa.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,r=e.node.current;r&&I1e(r),n(eo)}handleKeyDown(e){if(aN(e)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:i=PQ,coordinateGetter:a=q1e,scrollBehavior:l="smooth"}=s,{code:c}=e;if(i.end.includes(c)){this.handleEnd(e);return}if(i.cancel.includes(c)){this.handleCancel(e);return}const{collisionRect:d}=r.current,h=d?{x:d.left,y:d.top}:eo;this.referenceCoordinates||(this.referenceCoordinates=h);const m=a(e,{active:n,context:r.current,currentCoordinates:h});if(m){const g=pp(m,h),x={x:0,y:0},{scrollableAncestors:y}=r.current;for(const w of y){const S=e.code,{isTop:k,isRight:j,isLeft:N,isBottom:T,maxScroll:E,minScroll:_}=RQ(w),A=D1e(w),D={x:Math.min(S===jn.Right?A.right-A.width/2:A.right,Math.max(S===jn.Right?A.left:A.left+A.width/2,m.x)),y:Math.min(S===jn.Down?A.bottom-A.height/2:A.bottom,Math.max(S===jn.Down?A.top:A.top+A.height/2,m.y))},q=S===jn.Right&&!j||S===jn.Left&&!N,B=S===jn.Down&&!T||S===jn.Up&&!k;if(q&&D.x!==m.x){const H=w.scrollLeft+g.x,W=S===jn.Right&&H<=E.x||S===jn.Left&&H>=_.x;if(W&&!g.y){w.scrollTo({left:H,behavior:l});return}W?x.x=w.scrollLeft-H:x.x=S===jn.Right?w.scrollLeft-E.x:w.scrollLeft-_.x,x.x&&w.scrollBy({left:-x.x,behavior:l});break}else if(B&&D.y!==m.y){const H=w.scrollTop+g.y,W=S===jn.Down&&H<=E.y||S===jn.Up&&H>=_.y;if(W&&!g.x){w.scrollTo({top:H,behavior:l});return}W?x.y=w.scrollTop-H:x.y=S===jn.Down?w.scrollTop-E.y:w.scrollTop-_.y,x.y&&w.scrollBy({top:-x.y,behavior:l});break}}this.handleMove(e,qh(pp(m,this.referenceCoordinates),x))}}}handleMove(e,n){const{onMove:r}=this.props;e.preventDefault(),r(n)}handleEnd(e){const{onEnd:n}=this.props;e.preventDefault(),this.detach(),n()}handleCancel(e){const{onCancel:n}=this.props;e.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}lN.activators=[{eventName:"onKeyDown",handler:(t,e,n)=>{let{keyboardCodes:r=PQ,onActivation:s}=e,{active:i}=n;const{code:a}=t.nativeEvent;if(r.start.includes(a)){const l=i.activatorNode.current;return l&&t.target!==l?!1:(t.preventDefault(),s?.({event:t.nativeEvent}),!0)}return!1}}];function hM(t){return!!(t&&"distance"in t)}function fM(t){return!!(t&&"delay"in t)}class cN{constructor(e,n,r){var s;r===void 0&&(r=B1e(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=n;const{event:i}=e,{target:a}=i;this.props=e,this.events=n,this.document=Lf(a),this.documentListeners=new _0(this.document),this.listeners=new _0(r),this.windowListeners=new _0(_i(a)),this.initialCoordinates=(s=CO(i))!=null?s:eo,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(pa.Resize,this.handleCancel),this.windowListeners.add(pa.DragStart,dM),this.windowListeners.add(pa.VisibilityChange,this.handleCancel),this.windowListeners.add(pa.ContextMenu,dM),this.documentListeners.add(pa.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(fM(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(hM(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,n){const{active:r,onPending:s}=this.props;s(r,e,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:e}=this,{onStart:n}=this.props;e&&(this.activated=!0,this.documentListeners.add(pa.Click,F1e,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(pa.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;const{activated:r,initialCoordinates:s,props:i}=this,{onMove:a,options:{activationConstraint:l}}=i;if(!s)return;const c=(n=CO(e))!=null?n:eo,d=pp(s,c);if(!r&&l){if(hM(l)){if(l.tolerance!=null&&ES(d,l.tolerance))return this.handleCancel();if(ES(d,l.distance))return this.handleStart()}if(fM(l)&&ES(d,l.tolerance))return this.handleCancel();this.handlePending(l,d);return}e.cancelable&&e.preventDefault(),a(c)}handleEnd(){const{onAbort:e,onEnd:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleCancel(){const{onAbort:e,onCancel:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleKeydown(e){e.code===jn.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const $1e={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class uN extends cN{constructor(e){const{event:n}=e,r=Lf(n.target);super(e,$1e,r)}}uN.activators=[{eventName:"onPointerDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];const H1e={move:{name:"mousemove"},end:{name:"mouseup"}};var EO;(function(t){t[t.RightClick=2]="RightClick"})(EO||(EO={}));class Q1e extends cN{constructor(e){super(e,H1e,Lf(e.event.target))}}Q1e.activators=[{eventName:"onMouseDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return n.button===EO.RightClick?!1:(r?.({event:n}),!0)}}];const _S={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class V1e extends cN{constructor(e){super(e,_S)}static setup(){return window.addEventListener(_S.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(_S.move.name,e)};function e(){}}}V1e.activators=[{eventName:"onTouchStart",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;const{touches:s}=n;return s.length>1?!1:(r?.({event:n}),!0)}}];var A0;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(A0||(A0={}));var wy;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(wy||(wy={}));function U1e(t){let{acceleration:e,activator:n=A0.Pointer,canScroll:r,draggingRect:s,enabled:i,interval:a=5,order:l=wy.TreeOrder,pointerCoordinates:c,scrollableAncestors:d,scrollableAncestorRects:h,delta:m,threshold:g}=t;const x=G1e({delta:m,disabled:!i}),[y,w]=s1e(),S=b.useRef({x:0,y:0}),k=b.useRef({x:0,y:0}),j=b.useMemo(()=>{switch(n){case A0.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case A0.DraggableRect:return s}},[n,s,c]),N=b.useRef(null),T=b.useCallback(()=>{const _=N.current;if(!_)return;const A=S.current.x*k.current.x,D=S.current.y*k.current.y;_.scrollBy(A,D)},[]),E=b.useMemo(()=>l===wy.TreeOrder?[...d].reverse():d,[l,d]);b.useEffect(()=>{if(!i||!d.length||!j){w();return}for(const _ of E){if(r?.(_)===!1)continue;const A=d.indexOf(_),D=h[A];if(!D)continue;const{direction:q,speed:B}=R1e(_,D,j,e,g);for(const H of["x","y"])x[H][q[H]]||(B[H]=0,q[H]=0);if(B.x>0||B.y>0){w(),N.current=_,y(T,a),S.current=B,k.current=q;return}}S.current={x:0,y:0},k.current={x:0,y:0},w()},[e,T,r,w,i,a,JSON.stringify(j),JSON.stringify(x),y,d,E,h,JSON.stringify(g)])}const W1e={x:{[bs.Backward]:!1,[bs.Forward]:!1},y:{[bs.Backward]:!1,[bs.Forward]:!1}};function G1e(t){let{delta:e,disabled:n}=t;const r=NO(e);return fg(s=>{if(n||!r||!s)return W1e;const i={x:Math.sign(e.x-r.x),y:Math.sign(e.y-r.y)};return{x:{[bs.Backward]:s.x[bs.Backward]||i.x===-1,[bs.Forward]:s.x[bs.Forward]||i.x===1},y:{[bs.Backward]:s.y[bs.Backward]||i.y===-1,[bs.Forward]:s.y[bs.Forward]||i.y===1}}},[n,e,r])}function X1e(t,e){const n=e!=null?t.get(e):void 0,r=n?n.node.current:null;return fg(s=>{var i;return e==null?null:(i=r??s)!=null?i:null},[r,e])}function Y1e(t,e){return b.useMemo(()=>t.reduce((n,r)=>{const{sensor:s}=r,i=s.activators.map(a=>({eventName:a.eventName,handler:e(a.handler,r)}));return[...n,...i]},[]),[t,e])}var xp;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(xp||(xp={}));var _O;(function(t){t.Optimized="optimized"})(_O||(_O={}));const mM=new Map;function K1e(t,e){let{dragging:n,dependencies:r,config:s}=e;const[i,a]=b.useState(null),{frequency:l,measure:c,strategy:d}=s,h=b.useRef(t),m=S(),g=mp(m),x=b.useCallback(function(k){k===void 0&&(k=[]),!g.current&&a(j=>j===null?k:j.concat(k.filter(N=>!j.includes(N))))},[g]),y=b.useRef(null),w=fg(k=>{if(m&&!n)return mM;if(!k||k===mM||h.current!==t||i!=null){const j=new Map;for(let N of t){if(!N)continue;if(i&&i.length>0&&!i.includes(N.id)&&N.rect.current){j.set(N.id,N.rect.current);continue}const T=N.node.current,E=T?new oN(c(T),T):null;N.rect.current=E,E&&j.set(N.id,E)}return j}return k},[t,i,n,m,c]);return b.useEffect(()=>{h.current=t},[t]),b.useEffect(()=>{m||x()},[n,m]),b.useEffect(()=>{i&&i.length>0&&a(null)},[JSON.stringify(i)]),b.useEffect(()=>{m||typeof l!="number"||y.current!==null||(y.current=setTimeout(()=>{x(),y.current=null},l))},[l,m,x,...r]),{droppableRects:w,measureDroppableContainers:x,measuringScheduled:i!=null};function S(){switch(d){case xp.Always:return!1;case xp.BeforeDragging:return n;default:return!n}}}function zQ(t,e){return fg(n=>t?n||(typeof e=="function"?e(t):t):null,[e,t])}function Z1e(t,e){return zQ(t,e)}function J1e(t){let{callback:e,disabled:n}=t;const r=iN(e),s=b.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return b.useEffect(()=>()=>s?.disconnect(),[s]),s}function Ib(t){let{callback:e,disabled:n}=t;const r=iN(e),s=b.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return b.useEffect(()=>()=>s?.disconnect(),[s]),s}function eve(t){return new oN(Bf(t),t)}function pM(t,e,n){e===void 0&&(e=eve);const[r,s]=b.useState(null);function i(){s(c=>{if(!t)return null;if(t.isConnected===!1){var d;return(d=c??n)!=null?d:null}const h=e(t);return JSON.stringify(c)===JSON.stringify(h)?c:h})}const a=J1e({callback(c){if(t)for(const d of c){const{type:h,target:m}=d;if(h==="childList"&&m instanceof HTMLElement&&m.contains(t)){i();break}}}}),l=Ib({callback:i});return $o(()=>{i(),t?(l?.observe(t),a?.observe(document.body,{childList:!0,subtree:!0})):(l?.disconnect(),a?.disconnect())},[t]),r}function tve(t){const e=zQ(t);return TQ(t,e)}const gM=[];function nve(t){const e=b.useRef(t),n=fg(r=>t?r&&r!==gM&&t&&e.current&&t.parentNode===e.current.parentNode?r:zb(t):gM,[t]);return b.useEffect(()=>{e.current=t},[t]),n}function rve(t){const[e,n]=b.useState(null),r=b.useRef(t),s=b.useCallback(i=>{const a=TS(i.target);a&&n(l=>l?(l.set(a,TO(a)),new Map(l)):null)},[]);return b.useEffect(()=>{const i=r.current;if(t!==i){a(i);const l=t.map(c=>{const d=TS(c);return d?(d.addEventListener("scroll",s,{passive:!0}),[d,TO(d)]):null}).filter(c=>c!=null);n(l.length?new Map(l):null),r.current=t}return()=>{a(t),a(i)};function a(l){l.forEach(c=>{const d=TS(c);d?.removeEventListener("scroll",s)})}},[s,t]),b.useMemo(()=>t.length?e?Array.from(e.values()).reduce((i,a)=>qh(i,a),eo):DQ(t):eo,[t,e])}function xM(t,e){e===void 0&&(e=[]);const n=b.useRef(null);return b.useEffect(()=>{n.current=null},e),b.useEffect(()=>{const r=t!==eo;r&&!n.current&&(n.current=t),!r&&n.current&&(n.current=null)},[t]),n.current?pp(t,n.current):eo}function sve(t){b.useEffect(()=>{if(!Pb)return;const e=t.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of e)n?.()}},t.map(e=>{let{sensor:n}=e;return n}))}function ive(t,e){return b.useMemo(()=>t.reduce((n,r)=>{let{eventName:s,handler:i}=r;return n[s]=a=>{i(a,e)},n},{}),[t,e])}function IQ(t){return b.useMemo(()=>t?E1e(t):null,[t])}const vM=[];function ave(t,e){e===void 0&&(e=Bf);const[n]=t,r=IQ(n?_i(n):null),[s,i]=b.useState(vM);function a(){i(()=>t.length?t.map(c=>MQ(c)?r:new oN(e(c),c)):vM)}const l=Ib({callback:a});return $o(()=>{l?.disconnect(),a(),t.forEach(c=>l?.observe(c))},[t]),s}function ove(t){if(!t)return null;if(t.children.length>1)return t;const e=t.children[0];return hg(e)?e:t}function lve(t){let{measure:e}=t;const[n,r]=b.useState(null),s=b.useCallback(d=>{for(const{target:h}of d)if(hg(h)){r(m=>{const g=e(h);return m?{...m,width:g.width,height:g.height}:g});break}},[e]),i=Ib({callback:s}),a=b.useCallback(d=>{const h=ove(d);i?.disconnect(),h&&i?.observe(h),r(h?e(h):null)},[e,i]),[l,c]=yy(a);return b.useMemo(()=>({nodeRef:l,rect:n,setRef:c}),[n,l,c])}const cve=[{sensor:uN,options:{}},{sensor:lN,options:{}}],uve={current:{}},Nv={draggable:{measure:uM},droppable:{measure:uM,strategy:xp.WhileDragging,frequency:_O.Optimized},dragOverlay:{measure:Bf}};class M0 extends Map{get(e){var n;return e!=null&&(n=super.get(e))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:n}=e;return!n})}getNodeFor(e){var n,r;return(n=(r=this.get(e))==null?void 0:r.node.current)!=null?n:void 0}}const dve={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new M0,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:by},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Nv,measureDroppableContainers:by,windowRect:null,measuringScheduled:!1},hve={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:by,draggableNodes:new Map,over:null,measureDroppableContainers:by},Lb=b.createContext(hve),LQ=b.createContext(dve);function fve(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new M0}}}function mve(t,e){switch(e.type){case ds.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case ds.DragMove:return t.draggable.active==null?t:{...t,draggable:{...t.draggable,translate:{x:e.coordinates.x-t.draggable.initialCoordinates.x,y:e.coordinates.y-t.draggable.initialCoordinates.y}}};case ds.DragEnd:case ds.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case ds.RegisterDroppable:{const{element:n}=e,{id:r}=n,s=new M0(t.droppable.containers);return s.set(r,n),{...t,droppable:{...t.droppable,containers:s}}}case ds.SetDroppableDisabled:{const{id:n,key:r,disabled:s}=e,i=t.droppable.containers.get(n);if(!i||r!==i.key)return t;const a=new M0(t.droppable.containers);return a.set(n,{...i,disabled:s}),{...t,droppable:{...t.droppable,containers:a}}}case ds.UnregisterDroppable:{const{id:n,key:r}=e,s=t.droppable.containers.get(n);if(!s||r!==s.key)return t;const i=new M0(t.droppable.containers);return i.delete(n),{...t,droppable:{...t.droppable,containers:i}}}default:return t}}function pve(t){let{disabled:e}=t;const{active:n,activatorEvent:r,draggableNodes:s}=b.useContext(Lb),i=NO(r),a=NO(n?.id);return b.useEffect(()=>{if(!e&&!r&&i&&a!=null){if(!aN(i)||document.activeElement===i.target)return;const l=s.get(a);if(!l)return;const{activatorNode:c,node:d}=l;if(!c.current&&!d.current)return;requestAnimationFrame(()=>{for(const h of[c.current,d.current]){if(!h)continue;const m=o1e(h);if(m){m.focus();break}}})}},[r,e,s,a,i]),null}function gve(t,e){let{transform:n,...r}=e;return t!=null&&t.length?t.reduce((s,i)=>i({transform:s,...r}),n):n}function xve(t){return b.useMemo(()=>({draggable:{...Nv.draggable,...t?.draggable},droppable:{...Nv.droppable,...t?.droppable},dragOverlay:{...Nv.dragOverlay,...t?.dragOverlay}}),[t?.draggable,t?.droppable,t?.dragOverlay])}function vve(t){let{activeNode:e,measure:n,initialRect:r,config:s=!0}=t;const i=b.useRef(!1),{x:a,y:l}=typeof s=="boolean"?{x:s,y:s}:s;$o(()=>{if(!a&&!l||!e){i.current=!1;return}if(i.current||!r)return;const d=e?.node.current;if(!d||d.isConnected===!1)return;const h=n(d),m=TQ(h,r);if(a||(m.x=0),l||(m.y=0),i.current=!0,Math.abs(m.x)>0||Math.abs(m.y)>0){const g=EQ(d);g&&g.scrollBy({top:m.y,left:m.x})}},[e,a,l,r,n])}const BQ=b.createContext({...eo,scaleX:1,scaleY:1});var Ic;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(Ic||(Ic={}));const yve=b.memo(function(e){var n,r,s,i;let{id:a,accessibility:l,autoScroll:c=!0,children:d,sensors:h=cve,collisionDetection:m=S1e,measuring:g,modifiers:x,...y}=e;const w=b.useReducer(mve,void 0,fve),[S,k]=w,[j,N]=f1e(),[T,E]=b.useState(Ic.Uninitialized),_=T===Ic.Initialized,{draggable:{active:A,nodes:D,translate:q},droppable:{containers:B}}=S,H=A!=null?D.get(A):null,W=b.useRef({initial:null,translated:null}),ee=b.useMemo(()=>{var Gt;return A!=null?{id:A,data:(Gt=H?.data)!=null?Gt:uve,rect:W}:null},[A,H]),I=b.useRef(null),[V,L]=b.useState(null),[$,K]=b.useState(null),Y=mp(y,Object.values(y)),R=mg("DndDescribedBy",a),ie=b.useMemo(()=>B.getEnabled(),[B]),X=xve(g),{droppableRects:z,measureDroppableContainers:U,measuringScheduled:te}=K1e(ie,{dragging:_,dependencies:[q.x,q.y],config:X.droppable}),ne=X1e(D,A),G=b.useMemo(()=>$?CO($):null,[$]),se=Wt(),re=Z1e(ne,X.draggable.measure);vve({activeNode:A!=null?D.get(A):null,config:se.layoutShiftCompensation,initialRect:re,measure:X.draggable.measure});const ae=pM(ne,X.draggable.measure,re),_e=pM(ne?ne.parentElement:null),Be=b.useRef({activatorEvent:null,active:null,activeNode:ne,collisionRect:null,collisions:null,droppableRects:z,draggableNodes:D,draggingNode:null,draggingNodeRect:null,droppableContainers:B,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ye=B.getNodeFor((n=Be.current.over)==null?void 0:n.id),Je=lve({measure:X.dragOverlay.measure}),Oe=(r=Je.nodeRef.current)!=null?r:ne,Ve=_?(s=Je.rect)!=null?s:ae:null,Ue=!!(Je.nodeRef.current&&Je.rect),$e=tve(Ue?null:ae),jt=IQ(Oe?_i(Oe):null),vt=nve(_?Ye??ne:null),$n=ave(vt),qt=gve(x,{transform:{x:q.x-$e.x,y:q.y-$e.y,scaleX:1,scaleY:1},activatorEvent:$,active:ee,activeNodeRect:ae,containerNodeRect:_e,draggingNodeRect:Ve,over:Be.current.over,overlayNodeRect:Je.rect,scrollableAncestors:vt,scrollableAncestorRects:$n,windowRect:jt}),un=G?qh(G,q):null,Mt=rve(vt),ct=xM(Mt),Ne=xM(Mt,[ae]),ze=qh(qt,ct),rt=Ve?j1e(Ve,qt):null,bt=ee&&rt?m({active:ee,collisionRect:rt,droppableRects:z,droppableContainers:ie,pointerCoordinates:un}):null,zt=CQ(bt,"id"),[Rt,Hn]=b.useState(null),We=Ue?qt:qh(qt,Ne),ot=k1e(We,(i=Rt?.rect)!=null?i:null,ae),dn=b.useRef(null),Pt=b.useCallback((Gt,lt)=>{let{sensor:ve,options:He}=lt;if(I.current==null)return;const ht=D.get(I.current);if(!ht)return;const vn=Gt.nativeEvent,Qn=new ve({active:I.current,activeNode:ht,event:vn,options:He,context:Be,onAbort(ar){if(!D.get(ar))return;const{onDragAbort:vs}=Y.current,js={id:ar};vs?.(js),j({type:"onDragAbort",event:js})},onPending(ar,xs,vs,js){if(!D.get(ar))return;const{onDragPending:Ie}=Y.current,Et={id:ar,constraint:xs,initialCoordinates:vs,offset:js};Ie?.(Et),j({type:"onDragPending",event:Et})},onStart(ar){const xs=I.current;if(xs==null)return;const vs=D.get(xs);if(!vs)return;const{onDragStart:js}=Y.current,ge={activatorEvent:vn,active:{id:xs,data:vs.data,rect:W}};ya.unstable_batchedUpdates(()=>{js?.(ge),E(Ic.Initializing),k({type:ds.DragStart,initialCoordinates:ar,active:xs}),j({type:"onDragStart",event:ge}),L(dn.current),K(vn)})},onMove(ar){k({type:ds.DragMove,coordinates:ar})},onEnd:fr(ds.DragEnd),onCancel:fr(ds.DragCancel)});dn.current=Qn;function fr(ar){return async function(){const{active:vs,collisions:js,over:ge,scrollAdjustedTranslate:Ie}=Be.current;let Et=null;if(vs&&Ie){const{cancelDrop:kn}=Y.current;Et={activatorEvent:vn,active:vs,collisions:js,delta:Ie,over:ge},ar===ds.DragEnd&&typeof kn=="function"&&await Promise.resolve(kn(Et))&&(ar=ds.DragCancel)}I.current=null,ya.unstable_batchedUpdates(()=>{k({type:ar}),E(Ic.Uninitialized),Hn(null),L(null),K(null),dn.current=null;const kn=ar===ds.DragEnd?"onDragEnd":"onDragCancel";if(Et){const Hr=Y.current[kn];Hr?.(Et),j({type:kn,event:Et})}})}}},[D]),xn=b.useCallback((Gt,lt)=>(ve,He)=>{const ht=ve.nativeEvent,vn=D.get(He);if(I.current!==null||!vn||ht.dndKit||ht.defaultPrevented)return;const Qn={active:vn};Gt(ve,lt.options,Qn)===!0&&(ht.dndKit={capturedBy:lt.sensor},I.current=He,Pt(ve,lt))},[D,Pt]),dt=Y1e(h,xn);sve(h),$o(()=>{ae&&T===Ic.Initializing&&E(Ic.Initialized)},[ae,T]),b.useEffect(()=>{const{onDragMove:Gt}=Y.current,{active:lt,activatorEvent:ve,collisions:He,over:ht}=Be.current;if(!lt||!ve)return;const vn={active:lt,activatorEvent:ve,collisions:He,delta:{x:ze.x,y:ze.y},over:ht};ya.unstable_batchedUpdates(()=>{Gt?.(vn),j({type:"onDragMove",event:vn})})},[ze.x,ze.y]),b.useEffect(()=>{const{active:Gt,activatorEvent:lt,collisions:ve,droppableContainers:He,scrollAdjustedTranslate:ht}=Be.current;if(!Gt||I.current==null||!lt||!ht)return;const{onDragOver:vn}=Y.current,Qn=He.get(zt),fr=Qn&&Qn.rect.current?{id:Qn.id,rect:Qn.rect.current,data:Qn.data,disabled:Qn.disabled}:null,ar={active:Gt,activatorEvent:lt,collisions:ve,delta:{x:ht.x,y:ht.y},over:fr};ya.unstable_batchedUpdates(()=>{Hn(fr),vn?.(ar),j({type:"onDragOver",event:ar})})},[zt]),$o(()=>{Be.current={activatorEvent:$,active:ee,activeNode:ne,collisionRect:rt,collisions:bt,droppableRects:z,draggableNodes:D,draggingNode:Oe,draggingNodeRect:Ve,droppableContainers:B,over:Rt,scrollableAncestors:vt,scrollAdjustedTranslate:ze},W.current={initial:Ve,translated:rt}},[ee,ne,bt,rt,D,Oe,Ve,z,B,Rt,vt,ze]),U1e({...se,delta:q,draggingRect:rt,pointerCoordinates:un,scrollableAncestors:vt,scrollableAncestorRects:$n});const rn=b.useMemo(()=>({active:ee,activeNode:ne,activeNodeRect:ae,activatorEvent:$,collisions:bt,containerNodeRect:_e,dragOverlay:Je,draggableNodes:D,droppableContainers:B,droppableRects:z,over:Rt,measureDroppableContainers:U,scrollableAncestors:vt,scrollableAncestorRects:$n,measuringConfiguration:X,measuringScheduled:te,windowRect:jt}),[ee,ne,ae,$,bt,_e,Je,D,B,z,Rt,U,vt,$n,X,te,jt]),wt=b.useMemo(()=>({activatorEvent:$,activators:dt,active:ee,activeNodeRect:ae,ariaDescribedById:{draggable:R},dispatch:k,draggableNodes:D,over:Rt,measureDroppableContainers:U}),[$,dt,ee,ae,k,R,D,Rt,U]);return oe.createElement(OQ.Provider,{value:N},oe.createElement(Lb.Provider,{value:wt},oe.createElement(LQ.Provider,{value:rn},oe.createElement(BQ.Provider,{value:ot},d)),oe.createElement(pve,{disabled:l?.restoreFocus===!1})),oe.createElement(g1e,{...l,hiddenTextDescribedById:R}));function Wt(){const Gt=V?.autoScrollEnabled===!1,lt=typeof c=="object"?c.enabled===!1:c===!1,ve=_&&!Gt&&!lt;return typeof c=="object"?{...c,enabled:ve}:{enabled:ve}}}),bve=b.createContext(null),yM="button",wve="Draggable";function Sve(t){let{id:e,data:n,disabled:r=!1,attributes:s}=t;const i=mg(wve),{activators:a,activatorEvent:l,active:c,activeNodeRect:d,ariaDescribedById:h,draggableNodes:m,over:g}=b.useContext(Lb),{role:x=yM,roleDescription:y="draggable",tabIndex:w=0}=s??{},S=c?.id===e,k=b.useContext(S?BQ:bve),[j,N]=yy(),[T,E]=yy(),_=ive(a,e),A=mp(n);$o(()=>(m.set(e,{id:e,key:i,node:j,activatorNode:T,data:A}),()=>{const q=m.get(e);q&&q.key===i&&m.delete(e)}),[m,e]);const D=b.useMemo(()=>({role:x,tabIndex:w,"aria-disabled":r,"aria-pressed":S&&x===yM?!0:void 0,"aria-roledescription":y,"aria-describedby":h.draggable}),[r,x,w,S,y,h.draggable]);return{active:c,activatorEvent:l,activeNodeRect:d,attributes:D,isDragging:S,listeners:r?void 0:_,node:j,over:g,setNodeRef:N,setActivatorNodeRef:E,transform:k}}function kve(){return b.useContext(LQ)}const Ove="Droppable",jve={timeout:25};function Nve(t){let{data:e,disabled:n=!1,id:r,resizeObserverConfig:s}=t;const i=mg(Ove),{active:a,dispatch:l,over:c,measureDroppableContainers:d}=b.useContext(Lb),h=b.useRef({disabled:n}),m=b.useRef(!1),g=b.useRef(null),x=b.useRef(null),{disabled:y,updateMeasurementsFor:w,timeout:S}={...jve,...s},k=mp(w??r),j=b.useCallback(()=>{if(!m.current){m.current=!0;return}x.current!=null&&clearTimeout(x.current),x.current=setTimeout(()=>{d(Array.isArray(k.current)?k.current:[k.current]),x.current=null},S)},[S]),N=Ib({callback:j,disabled:y||!a}),T=b.useCallback((D,q)=>{N&&(q&&(N.unobserve(q),m.current=!1),D&&N.observe(D))},[N]),[E,_]=yy(T),A=mp(e);return b.useEffect(()=>{!N||!E.current||(N.disconnect(),m.current=!1,N.observe(E.current))},[E,N]),b.useEffect(()=>(l({type:ds.RegisterDroppable,element:{id:r,key:i,disabled:n,node:E,rect:g,data:A}}),()=>l({type:ds.UnregisterDroppable,key:i,id:r})),[r]),b.useEffect(()=>{n!==h.current.disabled&&(l({type:ds.SetDroppableDisabled,id:r,key:i,disabled:n}),h.current.disabled=n)},[r,i,n,l]),{active:a,rect:g,isOver:c?.id===r,node:E,over:c,setNodeRef:_}}function dN(t,e,n){const r=t.slice();return r.splice(n<0?r.length+n:n,0,r.splice(e,1)[0]),r}function Cve(t,e){return t.reduce((n,r,s)=>{const i=e.get(r);return i&&(n[s]=i),n},Array(t.length))}function _1(t){return t!==null&&t>=0}function Tve(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function Eve(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}const A1={scaleX:1,scaleY:1},_ve=t=>{var e;let{rects:n,activeNodeRect:r,activeIndex:s,overIndex:i,index:a}=t;const l=(e=n[s])!=null?e:r;if(!l)return null;const c=Ave(n,a,s);if(a===s){const d=n[i];return d?{x:s<i?d.left+d.width-(l.left+l.width):d.left-l.left,y:0,...A1}:null}return a>s&&a<=i?{x:-l.width-c,y:0,...A1}:a<s&&a>=i?{x:l.width+c,y:0,...A1}:{x:0,y:0,...A1}};function Ave(t,e,n){const r=t[e],s=t[e-1],i=t[e+1];return!r||!s&&!i?0:n<e?s?r.left-(s.left+s.width):i.left-(r.left+r.width):i?i.left-(r.left+r.width):r.left-(s.left+s.width)}const FQ=t=>{let{rects:e,activeIndex:n,overIndex:r,index:s}=t;const i=dN(e,r,n),a=e[s],l=i[s];return!l||!a?null:{x:l.left-a.left,y:l.top-a.top,scaleX:l.width/a.width,scaleY:l.height/a.height}},qQ="Sortable",$Q=oe.createContext({activeIndex:-1,containerId:qQ,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:FQ,disabled:{draggable:!1,droppable:!1}});function Mve(t){let{children:e,id:n,items:r,strategy:s=FQ,disabled:i=!1}=t;const{active:a,dragOverlay:l,droppableRects:c,over:d,measureDroppableContainers:h}=kve(),m=mg(qQ,n),g=l.rect!==null,x=b.useMemo(()=>r.map(_=>typeof _=="object"&&"id"in _?_.id:_),[r]),y=a!=null,w=a?x.indexOf(a.id):-1,S=d?x.indexOf(d.id):-1,k=b.useRef(x),j=!Tve(x,k.current),N=S!==-1&&w===-1||j,T=Eve(i);$o(()=>{j&&y&&h(x)},[j,x,y,h]),b.useEffect(()=>{k.current=x},[x]);const E=b.useMemo(()=>({activeIndex:w,containerId:m,disabled:T,disableTransforms:N,items:x,overIndex:S,useDragOverlay:g,sortedRects:Cve(x,c),strategy:s}),[w,m,T.draggable,T.droppable,N,x,S,c,g,s]);return oe.createElement($Q.Provider,{value:E},e)}const Rve=t=>{let{id:e,items:n,activeIndex:r,overIndex:s}=t;return dN(n,r,s).indexOf(e)},Dve=t=>{let{containerId:e,isSorting:n,wasDragging:r,index:s,items:i,newIndex:a,previousItems:l,previousContainerId:c,transition:d}=t;return!d||!r||l!==i&&s===a?!1:n?!0:a!==s&&e===c},Pve={duration:200,easing:"ease"},HQ="transform",zve=gp.Transition.toString({property:HQ,duration:0,easing:"linear"}),Ive={roleDescription:"sortable"};function Lve(t){let{disabled:e,index:n,node:r,rect:s}=t;const[i,a]=b.useState(null),l=b.useRef(n);return $o(()=>{if(!e&&n!==l.current&&r.current){const c=s.current;if(c){const d=Bf(r.current,{ignoreTransform:!0}),h={x:c.left-d.left,y:c.top-d.top,scaleX:c.width/d.width,scaleY:c.height/d.height};(h.x||h.y)&&a(h)}}n!==l.current&&(l.current=n)},[e,n,r,s]),b.useEffect(()=>{i&&a(null)},[i]),i}function Bve(t){let{animateLayoutChanges:e=Dve,attributes:n,disabled:r,data:s,getNewIndex:i=Rve,id:a,strategy:l,resizeObserverConfig:c,transition:d=Pve}=t;const{items:h,containerId:m,activeIndex:g,disabled:x,disableTransforms:y,sortedRects:w,overIndex:S,useDragOverlay:k,strategy:j}=b.useContext($Q),N=Fve(r,x),T=h.indexOf(a),E=b.useMemo(()=>({sortable:{containerId:m,index:T,items:h},...s}),[m,s,T,h]),_=b.useMemo(()=>h.slice(h.indexOf(a)),[h,a]),{rect:A,node:D,isOver:q,setNodeRef:B}=Nve({id:a,data:E,disabled:N.droppable,resizeObserverConfig:{updateMeasurementsFor:_,...c}}),{active:H,activatorEvent:W,activeNodeRect:ee,attributes:I,setNodeRef:V,listeners:L,isDragging:$,over:K,setActivatorNodeRef:Y,transform:R}=Sve({id:a,data:E,attributes:{...Ive,...n},disabled:N.draggable}),ie=r1e(B,V),X=!!H,z=X&&!y&&_1(g)&&_1(S),U=!k&&$,te=U&&z?R:null,G=z?te??(l??j)({rects:w,activeNodeRect:ee,activeIndex:g,overIndex:S,index:T}):null,se=_1(g)&&_1(S)?i({id:a,items:h,activeIndex:g,overIndex:S}):T,re=H?.id,ae=b.useRef({activeId:re,items:h,newIndex:se,containerId:m}),_e=h!==ae.current.items,Be=e({active:H,containerId:m,isDragging:$,isSorting:X,id:a,index:T,items:h,newIndex:ae.current.newIndex,previousItems:ae.current.items,previousContainerId:ae.current.containerId,transition:d,wasDragging:ae.current.activeId!=null}),Ye=Lve({disabled:!Be,index:T,node:D,rect:A});return b.useEffect(()=>{X&&ae.current.newIndex!==se&&(ae.current.newIndex=se),m!==ae.current.containerId&&(ae.current.containerId=m),h!==ae.current.items&&(ae.current.items=h)},[X,se,m,h]),b.useEffect(()=>{if(re===ae.current.activeId)return;if(re!=null&&ae.current.activeId==null){ae.current.activeId=re;return}const Oe=setTimeout(()=>{ae.current.activeId=re},50);return()=>clearTimeout(Oe)},[re]),{active:H,activeIndex:g,attributes:I,data:E,rect:A,index:T,newIndex:se,items:h,isOver:q,isSorting:X,isDragging:$,listeners:L,node:D,overIndex:S,over:K,setNodeRef:ie,setActivatorNodeRef:Y,setDroppableNodeRef:B,setDraggableNodeRef:V,transform:Ye??G,transition:Je()};function Je(){if(Ye||_e&&ae.current.newIndex===T)return zve;if(!(U&&!aN(W)||!d)&&(X||Be))return gp.Transition.toString({...d,property:HQ})}}function Fve(t,e){var n,r;return typeof t=="boolean"?{draggable:t,droppable:!1}:{draggable:(n=t?.draggable)!=null?n:e.draggable,droppable:(r=t?.droppable)!=null?r:e.droppable}}function Sy(t){if(!t)return!1;const e=t.data.current;return!!(e&&"sortable"in e&&typeof e.sortable=="object"&&"containerId"in e.sortable&&"items"in e.sortable&&"index"in e.sortable)}const qve=[jn.Down,jn.Right,jn.Up,jn.Left],$ve=(t,e)=>{let{context:{active:n,collisionRect:r,droppableRects:s,droppableContainers:i,over:a,scrollableAncestors:l}}=e;if(qve.includes(t.code)){if(t.preventDefault(),!n||!r)return;const c=[];i.getEnabled().forEach(m=>{if(!m||m!=null&&m.disabled)return;const g=s.get(m.id);if(g)switch(t.code){case jn.Down:r.top<g.top&&c.push(m);break;case jn.Up:r.top>g.top&&c.push(m);break;case jn.Left:r.left>g.left&&c.push(m);break;case jn.Right:r.left<g.left&&c.push(m);break}});const d=b1e({collisionRect:r,droppableRects:s,droppableContainers:c});let h=CQ(d,"id");if(h===a?.id&&d.length>1&&(h=d[1].id),h!=null){const m=i.get(n.id),g=i.get(h),x=g?s.get(g.id):null,y=g?.node.current;if(y&&x&&m&&g){const S=zb(y).some((_,A)=>l[A]!==_),k=QQ(m,g),j=Hve(m,g),N=S||!k?{x:0,y:0}:{x:j?r.width-x.width:0,y:j?r.height-x.height:0},T={x:x.left,y:x.top};return N.x&&N.y?T:pp(T,N)}}}};function QQ(t,e){return!Sy(t)||!Sy(e)?!1:t.data.current.sortable.containerId===e.data.current.sortable.containerId}function Hve(t,e){return!Sy(t)||!Sy(e)||!QQ(t,e)?!1:t.data.current.sortable.index<e.data.current.sortable.index}function Qve({value:t,label:e,onRemove:n}){const{attributes:r,listeners:s,setNodeRef:i,transform:a,transition:l,isDragging:c}=Bve({id:t}),d={transform:gp.Transform.toString(a),transition:l,opacity:c?.5:1};return o.jsx("div",{ref:i,style:d,className:xe("inline-flex items-center gap-1",c&&"shadow-lg"),children:o.jsxs(tn,{variant:"secondary",className:"cursor-move hover:bg-secondary/80 flex items-center gap-1",children:[o.jsx("div",{...r,...s,className:"cursor-grab active:cursor-grabbing flex items-center",children:o.jsx(Kee,{className:"h-3 w-3 text-muted-foreground"})}),o.jsx("span",{children:e}),o.jsx(Pp,{className:"ml-1 h-3 w-3 cursor-pointer hover:text-destructive",strokeWidth:2,fill:"none",onClick:h=>{h.stopPropagation(),n(t)}})]})})}function Vve({options:t,selected:e,onChange:n,placeholder:r="选择选项...",emptyText:s="未找到选项",className:i}){const[a,l]=b.useState(!1),c=x1e(oM(uN,{activationConstraint:{distance:8}}),oM(lN,{coordinateGetter:$ve})),d=g=>{e.includes(g)?n(e.filter(x=>x!==g)):n([...e,g])},h=g=>{n(e.filter(x=>x!==g))},m=g=>{const{active:x,over:y}=g;if(y&&x.id!==y.id){const w=e.indexOf(x.id),S=e.indexOf(y.id);n(dN(e,w,S))}};return o.jsxs(Bo,{open:a,onOpenChange:l,children:[o.jsx(Fo,{asChild:!0,children:o.jsxs(ue,{variant:"outline",role:"combobox","aria-expanded":a,className:xe("w-full justify-between min-h-10 h-auto",i),children:[o.jsx(yve,{sensors:c,collisionDetection:y1e,onDragEnd:m,children:o.jsx(Mve,{items:e,strategy:_ve,children:o.jsx("div",{className:"flex gap-1 flex-wrap flex-1",children:e.length===0?o.jsx("span",{className:"text-muted-foreground",children:r}):e.map(g=>{const x=t.find(y=>y.value===g);return o.jsx(Qve,{value:g,label:x?.label||g,onRemove:h},g)})})})}),o.jsx(Lj,{className:"ml-2 h-4 w-4 shrink-0 opacity-50",strokeWidth:2,fill:"none"})]})}),o.jsx(Ka,{className:"w-full p-0",align:"start",children:o.jsxs(Tb,{children:[o.jsx(Eb,{placeholder:"搜索...",className:"h-9"}),o.jsxs(_b,{children:[o.jsx(Ab,{children:s}),o.jsx(up,{children:t.map(g=>{const x=e.includes(g.value);return o.jsxs(dp,{value:g.value,onSelect:()=>d(g.value),children:[o.jsx("div",{className:xe("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:o.jsx(zo,{className:"h-3 w-3",strokeWidth:2,fill:"none"})}),o.jsx("span",{children:g.label})]},g.value)})})]})]})})]})}const bM=new Map,Uve=300*1e3;function Wve(){const[t,e]=b.useState([]),[n,r]=b.useState([]),[s,i]=b.useState([]),[a,l]=b.useState([]),[c,d]=b.useState(null),[h,m]=b.useState(!0),[g,x]=b.useState(!1),[y,w]=b.useState(!1),[S,k]=b.useState(!1),[j,N]=b.useState(!1),[T,E]=b.useState(!1),[_,A]=b.useState(!1),[D,q]=b.useState(null),[B,H]=b.useState(null),[W,ee]=b.useState(!1),[I,V]=b.useState(null),[L,$]=b.useState(""),[K,Y]=b.useState(new Set),[R,ie]=b.useState(!1),[X,z]=b.useState(1),[U,te]=b.useState(20),[ne,G]=b.useState(""),[se,re]=b.useState([]),[ae,_e]=b.useState(!1),[Be,Ye]=b.useState(null),[Je,Oe]=b.useState(!1),[Ve,Ue]=b.useState(null),{toast:$e}=Lr(),jt=na(),{registerTour:vt,startTour:$n,state:qt,goToStep:un}=nN(),Mt=b.useRef(null),ct=b.useRef(null),Ne=b.useRef(!0);b.useEffect(()=>{vt(Rl,bQ)},[vt]),b.useEffect(()=>{if(qt.activeTourId===Rl&&qt.isRunning){const ge=wQ[qt.stepIndex];ge&&!window.location.pathname.endsWith(ge.replace("/config/",""))&&jt({to:ge})}},[qt.stepIndex,qt.activeTourId,qt.isRunning,jt]);const ze=b.useRef(qt.stepIndex);b.useEffect(()=>{if(qt.activeTourId===Rl&&qt.isRunning){const ge=ze.current,Ie=qt.stepIndex;ge>=12&&ge<=17&&Ie<12&&A(!1),ze.current=Ie}},[qt.stepIndex,qt.activeTourId,qt.isRunning]),b.useEffect(()=>{if(qt.activeTourId!==Rl||!qt.isRunning)return;const ge=Ie=>{const Et=Ie.target,kn=qt.stepIndex;kn===2&&Et.closest('[data-tour="add-provider-button"]')?setTimeout(()=>un(3),300):kn===9&&Et.closest('[data-tour="provider-cancel-button"]')?setTimeout(()=>un(10),300):kn===11&&Et.closest('[data-tour="add-model-button"]')?setTimeout(()=>un(12),300):kn===17&&Et.closest('[data-tour="model-cancel-button"]')?setTimeout(()=>un(18),300):kn===18&&Et.closest('[data-tour="tasks-tab-trigger"]')&&setTimeout(()=>un(19),300)};return document.addEventListener("click",ge,!0),()=>document.removeEventListener("click",ge,!0)},[qt,un]);const rt=()=>{$n(Rl)};b.useEffect(()=>{bt()},[]);const bt=async()=>{try{m(!0);const ge=await Dh(),Ie=ge.models||[];e(Ie),l(Ie.map(kn=>kn.name));const Et=ge.api_providers||[];r(Et.map(kn=>kn.name)),i(Et),d(ge.model_task_config||null),k(!1),Ne.current=!1}catch(ge){console.error("加载配置失败:",ge)}finally{m(!1)}},zt=b.useCallback(ge=>s.find(Ie=>Ie.name===ge),[s]),Rt=b.useCallback(async(ge,Ie=!1)=>{const Et=zt(ge);if(!Et?.base_url){re([]),Ue(null),Ye('提供商配置不完整,请先在"模型提供商配置"中配置');return}if(!Et.api_key){re([]),Ue(null),Ye('该提供商未配置 API Key,请先在"模型提供商配置"中填写');return}const kn=t1e(Et.base_url);if(Ue(kn),!kn?.modelFetcher){re([]),Ye(null);return}const Hr=`${ge}:${Et.base_url}`,Mr=bM.get(Hr);if(!Ie&&Mr&&Date.now()-Mr.timestamp<Uve){re(Mr.models),Ye(null);return}_e(!0),Ye(null);try{const Rr=await Nae(ge,kn.modelFetcher.parser,kn.modelFetcher.endpoint);re(Rr),bM.set(Hr,{models:Rr,timestamp:Date.now()})}catch(Rr){console.error("获取模型列表失败:",Rr);const Ns=Rr.message||"获取模型列表失败";Ns.includes("无效")||Ns.includes("过期")||Ns.includes("API Key")?Ye('API Key 无效或已过期,请检查"模型提供商配置"中的密钥'):Ns.includes("权限")?Ye("没有权限获取模型列表,请检查 API Key 权限"):Ns.includes("timeout")||Ns.includes("超时")?Ye("请求超时,请检查网络连接后重试"):Ns.includes("不支持")?Ye("该提供商不支持自动获取模型列表,请手动输入"):Ye(Ns),re([])}finally{_e(!1)}},[zt]);b.useEffect(()=>{_&&D?.api_provider&&Rt(D.api_provider)},[_,D?.api_provider,Rt]);const Hn=async()=>{try{N(!0),cb().catch(()=>{}),E(!0)}catch(ge){console.error("重启失败:",ge),E(!1),$e({title:"重启失败",description:"无法发送重启请求,请手动重启",variant:"destructive"}),N(!1)}},We=async()=>{try{x(!0),Mt.current&&clearTimeout(Mt.current),ct.current&&clearTimeout(ct.current);const ge=await Dh();ge.models=t,ge.model_task_config=c,await Uv(ge),k(!1),$e({title:"保存成功",description:"正在重启麦麦..."}),await Hn()}catch(ge){console.error("保存配置失败:",ge),$e({title:"保存失败",description:ge.message,variant:"destructive"}),x(!1)}},ot=()=>{localStorage.removeItem("access-token"),window.location.href="/auth"},dn=()=>{E(!1),N(!1),$e({title:"重启超时",description:"服务未能在预期时间内恢复,请手动检查或刷新页面",variant:"destructive"})},Pt=b.useCallback(async ge=>{if(!Ne.current)try{w(!0),await bk("models",ge),k(!1)}catch(Ie){console.error("自动保存模型列表失败:",Ie),k(!0)}finally{w(!1)}},[]),xn=b.useCallback(async ge=>{if(!Ne.current)try{w(!0),await bk("model_task_config",ge),k(!1)}catch(Ie){console.error("自动保存任务配置失败:",Ie),k(!0)}finally{w(!1)}},[]);b.useEffect(()=>{if(!Ne.current)return k(!0),Mt.current&&clearTimeout(Mt.current),Mt.current=setTimeout(()=>{Pt(t)},2e3),()=>{Mt.current&&clearTimeout(Mt.current)}},[t,Pt]),b.useEffect(()=>{if(!(Ne.current||!c))return k(!0),ct.current&&clearTimeout(ct.current),ct.current=setTimeout(()=>{xn(c)},2e3),()=>{ct.current&&clearTimeout(ct.current)}},[c,xn]);const dt=async()=>{try{x(!0),Mt.current&&clearTimeout(Mt.current),ct.current&&clearTimeout(ct.current);const ge=await Dh();ge.models=t,ge.model_task_config=c,await Uv(ge),k(!1),$e({title:"保存成功",description:"模型配置已保存"}),await bt()}catch(ge){console.error("保存配置失败:",ge),$e({title:"保存失败",description:ge.message,variant:"destructive"})}finally{x(!1)}},rn=(ge,Ie)=>{q(ge||{model_identifier:"",name:"",api_provider:n[0]||"",price_in:0,price_out:0,force_stream_mode:!1,extra_params:{}}),H(Ie),A(!0)},wt=()=>{if(!D)return;const ge={...D,price_in:D.price_in??0,price_out:D.price_out??0};let Ie;B!==null?(Ie=[...t],Ie[B]=ge):Ie=[...t,ge],e(Ie),l(Ie.map(Et=>Et.name)),A(!1),q(null),H(null)},Wt=ge=>{if(!ge&&D){const Ie={...D,price_in:D.price_in??0,price_out:D.price_out??0};q(Ie)}A(ge)},Gt=ge=>{V(ge),ee(!0)},lt=()=>{if(I!==null){const ge=t.filter((Ie,Et)=>Et!==I);e(ge),l(ge.map(Ie=>Ie.name)),$e({title:"删除成功",description:"模型已从列表中移除"})}ee(!1),V(null)},ve=ge=>{const Ie=new Set(K);Ie.has(ge)?Ie.delete(ge):Ie.add(ge),Y(Ie)},He=()=>{if(K.size===fr.length)Y(new Set);else{const ge=fr.map((Ie,Et)=>t.findIndex(kn=>kn===fr[Et]));Y(new Set(ge))}},ht=()=>{if(K.size===0){$e({title:"提示",description:"请先选择要删除的模型",variant:"default"});return}ie(!0)},vn=()=>{const ge=t.filter((Ie,Et)=>!K.has(Et));e(ge),l(ge.map(Ie=>Ie.name)),Y(new Set),ie(!1),$e({title:"批量删除成功",description:`已删除 ${K.size} 个模型`})},Qn=(ge,Ie,Et)=>{c&&d({...c,[ge]:{...c[ge],[Ie]:Et}})},fr=t.filter(ge=>{if(!L)return!0;const Ie=L.toLowerCase();return ge.name.toLowerCase().includes(Ie)||ge.model_identifier.toLowerCase().includes(Ie)||ge.api_provider.toLowerCase().includes(Ie)}),ar=Math.ceil(fr.length/U),xs=fr.slice((X-1)*U,X*U),vs=()=>{const ge=parseInt(ne);ge>=1&&ge<=ar&&(z(ge),G(""))},js=ge=>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(Et=>Et.includes(ge)):!1;return h?o.jsx(pn,{className:"h-full",children:o.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})})}):o.jsx(pn,{className:"h-full",children:o.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"模型管理与分配"}),o.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"添加模型并为模型分配功能"})]}),o.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[o.jsxs(ue,{onClick:dt,disabled:g||y||!S||j,size:"sm",variant:"outline",className:"flex-1 sm:flex-none sm:min-w-[120px]",children:[o.jsx(zp,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),g?"保存中...":y?"自动保存中...":S?"保存配置":"已保存"]}),o.jsxs(Fn,{children:[o.jsx(is,{asChild:!0,children:o.jsxs(ue,{disabled:g||y||j,size:"sm",className:"flex-1 sm:flex-none sm:min-w-[120px]",children:[o.jsx(Dp,{className:"mr-2 h-4 w-4"}),j?"重启中...":S?"保存并重启":"重启麦麦"]})}),o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认重启麦麦?"}),o.jsx(zn,{className:"space-y-3",asChild:!0,children:o.jsxs("div",{children:[o.jsx("p",{children:S?"当前有未保存的配置更改。点击确认将先保存配置,然后重启麦麦使新配置生效。重启过程中麦麦将暂时离线。":"即将重启麦麦主程序。重启过程中麦麦将暂时离线,配置将在重启后生效。"}),o.jsxs(ba,{className:"border-yellow-500/50 bg-yellow-500/10",children:[o.jsx(Xi,{className:"h-4 w-4 text-yellow-600"}),o.jsxs(wa,{className:"text-yellow-900 dark:text-yellow-100",children:[o.jsx("strong",{children:"重要提示:"}),"由于技术原因,使用重启功能后,将无法再使用 ",o.jsx("code",{className:"px-1 py-0.5 bg-yellow-200 dark:bg-yellow-900 rounded",children:"Ctrl+C"})," 结束程序。",o.jsxs(Er,{children:[o.jsx(Of,{asChild:!0,children:o.jsxs("button",{className:"ml-1 text-yellow-700 dark:text-yellow-300 underline hover:text-yellow-800 dark:hover:text-yellow-200 inline-flex items-center gap-1",children:[o.jsx(Zy,{className:"h-3 w-3"}),"如何结束程序?"]})}),o.jsxs(wr,{className:"max-w-2xl",children:[o.jsxs(Sr,{children:[o.jsx(kr,{children:"如何结束使用重启功能后的麦麦程序"}),o.jsx(Xr,{children:"由于重启功能会使程序脱离终端控制,需要通过系统命令来结束进程"})]}),o.jsxs(Yi,{defaultValue:"windows",className:"w-full",children:[o.jsxs(ji,{className:"grid w-full grid-cols-3",children:[o.jsx(Bt,{value:"windows",children:"Windows"}),o.jsx(Bt,{value:"macos",children:"macOS"}),o.jsx(Bt,{value:"linux",children:"Linux"})]}),o.jsxs(ln,{value:"windows",className:"space-y-4 mt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"方法一:使用任务管理器"}),o.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[o.jsxs("li",{children:["按 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Ctrl + Shift + Esc"})," 打开任务管理器"]}),o.jsxs("li",{children:['在"进程"或"详细信息"标签页中找到 ',o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"python.exe"})]}),o.jsx("li",{children:'右键点击并选择"结束任务"'})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"方法二:使用命令行"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"打开 PowerShell 或命令提示符,执行以下命令:"}),o.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[o.jsx("p",{children:"# 查找麦麦进程"}),o.jsx("p",{children:'Get-Process python | Where-Object {$_.MainWindowTitle -eq ""}'}),o.jsx("p",{className:"mt-2",children:"# 结束所有 Python 进程(谨慎使用)"}),o.jsx("p",{children:"Stop-Process -Name python -Force"})]})]})]}),o.jsxs(ln,{value:"macos",className:"space-y-4 mt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"方法一:使用活动监视器"}),o.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[o.jsxs("li",{children:["按 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Cmd + Space"}),' 打开 Spotlight,搜索"活动监视器"']}),o.jsxs("li",{children:["在进程列表中找到 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Python"})]}),o.jsx("li",{children:"选中后点击左上角的 X 按钮结束进程"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"方法二:使用终端"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"打开终端,执行以下命令:"}),o.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[o.jsx("p",{children:"# 查找麦麦进程"}),o.jsx("p",{children:"ps aux | grep python | grep -v grep"}),o.jsx("p",{className:"mt-2",children:"# 结束指定 PID 的进程"}),o.jsx("p",{children:"kill -9 <PID>"}),o.jsx("p",{className:"mt-2",children:"# 或结束所有 Python 进程(谨慎使用)"}),o.jsx("p",{children:"pkill -9 python"})]})]})]}),o.jsxs(ln,{value:"linux",className:"space-y-4 mt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"使用终端命令"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"打开终端,执行以下命令:"}),o.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[o.jsx("p",{children:"# 查找麦麦进程"}),o.jsx("p",{children:"ps aux | grep python | grep -v grep"}),o.jsx("p",{className:"mt-2",children:"# 结束指定 PID 的进程"}),o.jsx("p",{children:"kill -9 <PID>"}),o.jsx("p",{className:"mt-2",children:"# 或使用 pkill 按名称结束"}),o.jsx("p",{children:'pkill -9 -f "bot.py"'}),o.jsx("p",{className:"mt-2",children:"# 或结束所有 Python 进程(谨慎使用)"}),o.jsx("p",{children:"pkill -9 python"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"使用 htop(如已安装)"}),o.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[o.jsxs("li",{children:["在终端输入 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"htop"})]}),o.jsxs("li",{children:["按 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"F3"})," 搜索 python"]}),o.jsxs("li",{children:["按 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"F9"})," 发送信号,选择 SIGKILL"]})]})]})]})]}),o.jsx(fs,{children:o.jsx(e6,{asChild:!0,children:o.jsx(ue,{variant:"outline",children:"关闭"})})})]})]})]})]})]})})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:S?We:Hn,children:S?"保存并重启":"确认重启"})]})]})]})]})]}),o.jsxs(ba,{children:[o.jsx(Xi,{className:"h-4 w-4"}),o.jsxs(wa,{children:["配置更新后需要",o.jsx("strong",{children:"重启麦麦"}),'才能生效。你可以点击右上角的"保存并重启"按钮一键完成保存和重启。']})]}),o.jsxs(ba,{className:"hidden lg:flex border-primary/30 bg-primary/5 cursor-pointer hover:bg-primary/10 transition-colors",onClick:rt,children:[o.jsx(Zee,{className:"h-4 w-4 text-primary"}),o.jsxs(wa,{className:"flex items-center justify-between",children:[o.jsxs("span",{children:[o.jsx("strong",{className:"text-primary",children:"新手引导:"}),"不知道如何配置模型?点击这里开始学习如何为麦麦的组件分配模型。"]}),o.jsx(ue,{variant:"outline",size:"sm",className:"ml-4 shrink-0",children:"开始引导"})]})]}),o.jsxs(Yi,{defaultValue:"models",className:"w-full",children:[o.jsxs(ji,{className:"grid w-full max-w-full sm:max-w-md grid-cols-2",children:[o.jsx(Bt,{value:"models",children:"添加模型"}),o.jsx(Bt,{value:"tasks","data-tour":"tasks-tab-trigger",children:"为模型分配功能"})]}),o.jsxs(ln,{value:"models",className:"space-y-4 mt-0",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-2",children:[o.jsx("p",{className:"text-sm text-muted-foreground",children:"配置可用的模型列表"}),o.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[K.size>0&&o.jsxs(ue,{onClick:ht,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[o.jsx(Cn,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"批量删除 (",K.size,")"]}),o.jsxs(ue,{onClick:()=>rn(null,null),size:"sm",variant:"outline",className:"w-full sm:w-auto","data-tour":"add-model-button",children:[o.jsx(Is,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"添加模型"]})]})]}),o.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2",children:[o.jsxs("div",{className:"relative w-full sm:flex-1 sm:max-w-sm",children:[o.jsx(ii,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),o.jsx(Pe,{placeholder:"搜索模型名称、标识符或提供商...",value:L,onChange:ge=>$(ge.target.value),className:"pl-9"})]}),L&&o.jsxs("p",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["找到 ",fr.length," 个结果"]})]}),o.jsx("div",{className:"md:hidden space-y-3",children:xs.length===0?o.jsx("div",{className:"text-center text-muted-foreground py-8 rounded-lg border bg-card",children:L?"未找到匹配的模型":"暂无模型配置"}):xs.map((ge,Ie)=>{const Et=t.findIndex(Hr=>Hr===ge),kn=js(ge.name);return o.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3",children:[o.jsxs("div",{className:"flex items-start justify-between gap-2",children:[o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[o.jsx("h3",{className:"font-semibold text-base",children:ge.name}),o.jsx(tn,{variant:kn?"default":"secondary",className:kn?"bg-green-600 hover:bg-green-700":"",children:kn?"已使用":"未使用"})]}),o.jsx("p",{className:"text-xs text-muted-foreground break-all",title:ge.model_identifier,children:ge.model_identifier})]}),o.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[o.jsxs(ue,{variant:"default",size:"sm",onClick:()=>rn(ge,Et),children:[o.jsx(Ju,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),o.jsxs(ue,{size:"sm",onClick:()=>Gt(Et),className:"bg-red-600 hover:bg-red-700 text-white",children:[o.jsx(Cn,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"提供商"}),o.jsx("p",{className:"font-medium",children:ge.api_provider})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"强制流式"}),o.jsx("p",{className:"font-medium",children:ge.force_stream_mode?"是":"否"})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"输入价格"}),o.jsxs("p",{className:"font-medium",children:["¥",ge.price_in,"/M"]})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"输出价格"}),o.jsxs("p",{className:"font-medium",children:["¥",ge.price_out,"/M"]})]})]})]},Ie)})}),o.jsx("div",{className:"hidden md:block rounded-lg border bg-card overflow-hidden",children:o.jsx("div",{className:"overflow-x-auto",children:o.jsxs(Af,{children:[o.jsx(Mf,{children:o.jsxs(zs,{children:[o.jsx(mn,{className:"w-12",children:o.jsx(Ci,{checked:K.size===fr.length&&fr.length>0,onCheckedChange:He})}),o.jsx(mn,{className:"w-24",children:"使用状态"}),o.jsx(mn,{children:"模型名称"}),o.jsx(mn,{children:"模型标识符"}),o.jsx(mn,{children:"提供商"}),o.jsx(mn,{className:"text-right",children:"输入价格"}),o.jsx(mn,{className:"text-right",children:"输出价格"}),o.jsx(mn,{className:"text-center",children:"强制流式"}),o.jsx(mn,{className:"text-right",children:"操作"})]})}),o.jsx(Rf,{children:xs.length===0?o.jsx(zs,{children:o.jsx(Yt,{colSpan:9,className:"text-center text-muted-foreground py-8",children:L?"未找到匹配的模型":"暂无模型配置"})}):xs.map((ge,Ie)=>{const Et=t.findIndex(Hr=>Hr===ge),kn=js(ge.name);return o.jsxs(zs,{children:[o.jsx(Yt,{children:o.jsx(Ci,{checked:K.has(Et),onCheckedChange:()=>ve(Et)})}),o.jsx(Yt,{children:o.jsx(tn,{variant:kn?"default":"secondary",className:kn?"bg-green-600 hover:bg-green-700":"",children:kn?"已使用":"未使用"})}),o.jsx(Yt,{className:"font-medium",children:ge.name}),o.jsx(Yt,{className:"max-w-xs truncate",title:ge.model_identifier,children:ge.model_identifier}),o.jsx(Yt,{children:ge.api_provider}),o.jsxs(Yt,{className:"text-right",children:["¥",ge.price_in,"/M"]}),o.jsxs(Yt,{className:"text-right",children:["¥",ge.price_out,"/M"]}),o.jsx(Yt,{className:"text-center",children:ge.force_stream_mode?"是":"否"}),o.jsx(Yt,{className:"text-right",children:o.jsxs("div",{className:"flex justify-end gap-2",children:[o.jsxs(ue,{variant:"default",size:"sm",onClick:()=>rn(ge,Et),children:[o.jsx(Ju,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),o.jsxs(ue,{size:"sm",onClick:()=>Gt(Et),className:"bg-red-600 hover:bg-red-700 text-white",children:[o.jsx(Cn,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})})]},Ie)})})]})})}),fr.length>0&&o.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 mt-4",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(he,{htmlFor:"page-size-model",className:"text-sm whitespace-nowrap",children:"每页显示"}),o.jsxs(Vt,{value:U.toString(),onValueChange:ge=>{te(parseInt(ge)),z(1),Y(new Set)},children:[o.jsx($t,{id:"page-size-model",className:"w-20",children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"10",children:"10"}),o.jsx(De,{value:"20",children:"20"}),o.jsx(De,{value:"50",children:"50"}),o.jsx(De,{value:"100",children:"100"})]})]}),o.jsxs("span",{className:"text-sm text-muted-foreground",children:["显示 ",(X-1)*U+1," 到"," ",Math.min(X*U,fr.length)," 条,共 ",fr.length," 条"]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ue,{variant:"outline",size:"sm",onClick:()=>z(1),disabled:X===1,className:"hidden sm:flex",children:o.jsx(Ip,{className:"h-4 w-4"})}),o.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>z(ge=>Math.max(1,ge-1)),disabled:X===1,children:[o.jsx(wd,{className:"h-4 w-4 sm:mr-1"}),o.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Pe,{type:"number",value:ne,onChange:ge=>G(ge.target.value),onKeyDown:ge=>ge.key==="Enter"&&vs(),placeholder:X.toString(),className:"w-16 h-8 text-center",min:1,max:ar}),o.jsx(ue,{variant:"outline",size:"sm",onClick:vs,disabled:!ne,className:"h-8",children:"跳转"})]}),o.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>z(ge=>ge+1),disabled:X>=ar,children:[o.jsx("span",{className:"hidden sm:inline",children:"下一页"}),o.jsx(Zl,{className:"h-4 w-4 sm:ml-1"})]}),o.jsx(ue,{variant:"outline",size:"sm",onClick:()=>z(ar),disabled:X>=ar,className:"hidden sm:flex",children:o.jsx(Lp,{className:"h-4 w-4"})})]})]})]}),o.jsxs(ln,{value:"tasks",className:"space-y-6 mt-0",children:[o.jsx("p",{className:"text-sm text-muted-foreground",children:"为不同的任务配置使用的模型和参数"}),c&&o.jsxs("div",{className:"grid gap-4 sm:gap-6",children:[o.jsx(qa,{title:"组件模型 (utils)",description:"用于表情包、取名、关系、情绪变化等组件",taskConfig:c.utils,modelNames:a,onChange:(ge,Ie)=>Qn("utils",ge,Ie),dataTour:"task-model-select"}),o.jsx(qa,{title:"组件小模型 (utils_small)",description:"消耗量较大的组件,建议使用速度较快的小模型",taskConfig:c.utils_small,modelNames:a,onChange:(ge,Ie)=>Qn("utils_small",ge,Ie)}),o.jsx(qa,{title:"工具调用模型 (tool_use)",description:"需要使用支持工具调用的模型",taskConfig:c.tool_use,modelNames:a,onChange:(ge,Ie)=>Qn("tool_use",ge,Ie)}),o.jsx(qa,{title:"首要回复模型 (replyer)",description:"用于表达器和表达方式学习",taskConfig:c.replyer,modelNames:a,onChange:(ge,Ie)=>Qn("replyer",ge,Ie)}),o.jsx(qa,{title:"决策模型 (planner)",description:"负责决定麦麦该什么时候回复",taskConfig:c.planner,modelNames:a,onChange:(ge,Ie)=>Qn("planner",ge,Ie)}),o.jsx(qa,{title:"图像识别模型 (vlm)",description:"视觉语言模型",taskConfig:c.vlm,modelNames:a,onChange:(ge,Ie)=>Qn("vlm",ge,Ie),hideTemperature:!0}),o.jsx(qa,{title:"语音识别模型 (voice)",description:"语音转文字",taskConfig:c.voice,modelNames:a,onChange:(ge,Ie)=>Qn("voice",ge,Ie),hideTemperature:!0,hideMaxTokens:!0}),o.jsx(qa,{title:"嵌入模型 (embedding)",description:"用于向量化",taskConfig:c.embedding,modelNames:a,onChange:(ge,Ie)=>Qn("embedding",ge,Ie),hideTemperature:!0,hideMaxTokens:!0}),o.jsxs("div",{className:"space-y-4",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"LPMM 知识库模型"}),o.jsx(qa,{title:"实体提取模型 (lpmm_entity_extract)",description:"从文本中提取实体",taskConfig:c.lpmm_entity_extract,modelNames:a,onChange:(ge,Ie)=>Qn("lpmm_entity_extract",ge,Ie)}),o.jsx(qa,{title:"RDF 构建模型 (lpmm_rdf_build)",description:"构建知识图谱",taskConfig:c.lpmm_rdf_build,modelNames:a,onChange:(ge,Ie)=>Qn("lpmm_rdf_build",ge,Ie)}),o.jsx(qa,{title:"问答模型 (lpmm_qa)",description:"知识库问答",taskConfig:c.lpmm_qa,modelNames:a,onChange:(ge,Ie)=>Qn("lpmm_qa",ge,Ie)})]})]})]})]}),o.jsx(Er,{open:_,onOpenChange:Wt,children:o.jsxs(wr,{className:"max-w-[95vw] sm:max-w-2xl max-h-[90vh] overflow-y-auto","data-tour":"model-dialog",preventOutsideClose:qt.isRunning,children:[o.jsxs(Sr,{children:[o.jsx(kr,{children:B!==null?"编辑模型":"添加模型"}),o.jsx(Xr,{children:"配置模型的基本信息和参数"})]}),o.jsxs("div",{className:"grid gap-4 py-4",children:[o.jsxs("div",{className:"grid gap-2","data-tour":"model-name-input",children:[o.jsx(he,{htmlFor:"model_name",children:"模型名称 *"}),o.jsx(Pe,{id:"model_name",value:D?.name||"",onChange:ge=>q(Ie=>Ie?{...Ie,name:ge.target.value}:null),placeholder:"例如: qwen3-30b"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"用于在任务配置中引用此模型"})]}),o.jsxs("div",{className:"grid gap-2","data-tour":"model-provider-select",children:[o.jsx(he,{htmlFor:"api_provider",children:"API 提供商 *"}),o.jsxs(Vt,{value:D?.api_provider||"",onValueChange:ge=>{q(Ie=>Ie?{...Ie,api_provider:ge}:null),re([]),Ye(null)},children:[o.jsx($t,{id:"api_provider",children:o.jsx(Ut,{placeholder:"选择提供商"})}),o.jsx(Ht,{children:n.map(ge=>o.jsx(De,{value:ge,children:ge},ge))})]})]}),o.jsxs("div",{className:"grid gap-2","data-tour":"model-identifier-input",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(he,{htmlFor:"model_identifier",children:"模型标识符 *"}),Ve?.modelFetcher&&o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(tn,{variant:"secondary",className:"text-xs",children:Ve.display_name}),o.jsx(ue,{variant:"ghost",size:"sm",className:"h-6 px-2",onClick:()=>D?.api_provider&&Rt(D.api_provider,!0),disabled:ae,children:ae?o.jsx(Us,{className:"h-3 w-3 animate-spin"}):o.jsx(Qs,{className:"h-3 w-3"})})]})]}),Ve?.modelFetcher?o.jsxs(Bo,{open:Je,onOpenChange:Oe,children:[o.jsx(Fo,{asChild:!0,children:o.jsxs(ue,{variant:"outline",role:"combobox","aria-expanded":Je,className:"w-full justify-between font-normal",disabled:ae||!!Be,children:[ae?o.jsxs("span",{className:"flex items-center gap-2 text-muted-foreground",children:[o.jsx(Us,{className:"h-4 w-4 animate-spin"}),"正在获取模型列表..."]}):Be?o.jsx("span",{className:"text-muted-foreground text-sm",children:"点击下方输入框手动填写"}):D?.model_identifier?o.jsx("span",{className:"truncate",children:D.model_identifier}):o.jsx("span",{className:"text-muted-foreground",children:"搜索或选择模型..."}),o.jsx(Lj,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),o.jsx(Ka,{className:"p-0",align:"start",style:{width:"var(--radix-popover-trigger-width)"},children:o.jsxs(Tb,{children:[o.jsx(Eb,{placeholder:"搜索模型..."}),o.jsx(pn,{className:"h-[300px]",children:o.jsxs(_b,{className:"max-h-none overflow-visible",children:[o.jsx(Ab,{children:Be?o.jsxs("div",{className:"py-4 px-2 text-center space-y-2",children:[o.jsx("p",{className:"text-sm text-destructive",children:Be}),!Be.includes("API Key")&&o.jsx(ue,{variant:"link",size:"sm",onClick:()=>D?.api_provider&&Rt(D.api_provider,!0),children:"重试"})]}):"未找到匹配的模型"}),o.jsx(up,{heading:"可用模型",children:se.map(ge=>o.jsxs(dp,{value:ge.id,onSelect:()=>{q(Ie=>Ie?{...Ie,model_identifier:ge.id}:null),Oe(!1)},children:[o.jsx(zo,{className:`mr-2 h-4 w-4 ${D?.model_identifier===ge.id?"opacity-100":"opacity-0"}`}),o.jsxs("div",{className:"flex flex-col",children:[o.jsx("span",{children:ge.id}),ge.name!==ge.id&&o.jsx("span",{className:"text-xs text-muted-foreground",children:ge.name})]})]},ge.id))}),o.jsx(up,{heading:"手动输入",children:o.jsxs(dp,{value:"__manual_input__",onSelect:()=>{Oe(!1)},children:[o.jsx(Ju,{className:"mr-2 h-4 w-4"}),"手动输入模型标识符..."]})})]})})]})})]}):o.jsx(Pe,{id:"model_identifier",value:D?.model_identifier||"",onChange:ge=>q(Ie=>Ie?{...Ie,model_identifier:ge.target.value}:null),placeholder:"Qwen/Qwen3-30B-A3B-Instruct-2507"}),Be&&Ve?.modelFetcher&&o.jsxs(ba,{variant:"destructive",className:"mt-2 py-2",children:[o.jsx(Xi,{className:"h-4 w-4"}),o.jsx(wa,{className:"text-xs",children:Be})]}),Ve?.modelFetcher&&o.jsx(Pe,{value:D?.model_identifier||"",onChange:ge=>q(Ie=>Ie?{...Ie,model_identifier:ge.target.value}:null),placeholder:"或手动输入模型标识符",className:"mt-2"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:Be?'请手动输入模型标识符,或前往"模型提供商配置"检查 API Key':Ve?.modelFetcher?`已识别为 ${Ve.display_name},支持自动获取模型列表`:"API 提供商提供的模型 ID"})]}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"price_in",children:"输入价格 (¥/M token)"}),o.jsx(Pe,{id:"price_in",type:"number",step:"0.1",min:"0",value:D?.price_in??"",onChange:ge=>{const Ie=ge.target.value===""?null:parseFloat(ge.target.value);q(Et=>Et?{...Et,price_in:Ie}:null)},placeholder:"默认: 0"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"price_out",children:"输出价格 (¥/M token)"}),o.jsx(Pe,{id:"price_out",type:"number",step:"0.1",min:"0",value:D?.price_out??"",onChange:ge=>{const Ie=ge.target.value===""?null:parseFloat(ge.target.value);q(Et=>Et?{...Et,price_out:Ie}:null)},placeholder:"默认: 0"})]})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Ft,{id:"force_stream_mode",checked:D?.force_stream_mode||!1,onCheckedChange:ge=>q(Ie=>Ie?{...Ie,force_stream_mode:ge}:null)}),o.jsx(he,{htmlFor:"force_stream_mode",className:"cursor-pointer",children:"强制流式输出模式"})]})]}),o.jsxs(fs,{children:[o.jsx(ue,{variant:"outline",onClick:()=>A(!1),"data-tour":"model-cancel-button",children:"取消"}),o.jsx(ue,{onClick:wt,"data-tour":"model-save-button",children:"保存"})]})]})}),o.jsx(Fn,{open:W,onOpenChange:ee,children:o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认删除"}),o.jsxs(zn,{children:['确定要删除模型 "',I!==null?t[I]?.name:"",'" 吗? 此操作无法撤销。']})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:lt,children:"删除"})]})]})}),o.jsx(Fn,{open:R,onOpenChange:ie,children:o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认批量删除"}),o.jsxs(zn,{children:["确定要删除选中的 ",K.size," 个模型吗? 此操作无法撤销。"]})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:vn,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})}),T&&o.jsx(r6,{onRestartComplete:ot,onRestartFailed:dn})]})})}function qa({title:t,description:e,taskConfig:n,modelNames:r,onChange:s,hideTemperature:i=!1,hideMaxTokens:a=!1,dataTour:l}){const c=d=>{s("model_list",d)};return o.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-4",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"font-semibold text-base sm:text-lg",children:t}),o.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mt-1",children:e})]}),o.jsxs("div",{className:"grid gap-4",children:[o.jsxs("div",{className:"grid gap-2","data-tour":l,children:[o.jsx(he,{children:"模型列表"}),o.jsx(Vve,{options:r.map(d=>({label:d,value:d})),selected:n.model_list||[],onChange:c,placeholder:"选择模型...",emptyText:"暂无可用模型"})]}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[!i&&o.jsxs("div",{className:"grid gap-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(he,{children:"温度"}),o.jsx(Pe,{type:"number",step:"0.1",min:"0",max:"1",value:n.temperature??.3,onChange:d=>{const h=parseFloat(d.target.value);!isNaN(h)&&h>=0&&h<=1&&s("temperature",h)},className:"w-20 h-8 text-sm"})]}),o.jsx(Nf,{value:[n.temperature??.3],onValueChange:d=>s("temperature",d[0]),min:0,max:1,step:.1,className:"w-full"})]}),!a&&o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"最大 Token"}),o.jsx(Pe,{type:"number",step:"1",min:"1",value:n.max_tokens??1024,onChange:d=>s("max_tokens",parseInt(d.target.value))})]})]})]})]})}const Bb="/api/webui/config";async function Gve(){const e=await(await gt(`${Bb}/adapter-config/path`)).json();return!e.success||!e.path?null:{path:e.path,lastModified:e.lastModified}}async function wM(t){const n=await(await gt(`${Bb}/adapter-config/path`,{method:"POST",headers:Tt(),body:JSON.stringify({path:t})})).json();if(!n.success)throw new Error(n.message||"保存路径失败")}async function SM(t){const n=await(await gt(`${Bb}/adapter-config?path=${encodeURIComponent(t)}`)).json();if(!n.success)throw new Error("读取配置文件失败");return n.content}async function kM(t,e){const r=await(await gt(`${Bb}/adapter-config`,{method:"POST",headers:Tt(),body:JSON.stringify({path:t,content:e})})).json();if(!r.success)throw new Error(r.message||"保存配置失败")}const $i={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"}},AS={oneclick:{name:"一键包",description:"使用一键包部署的适配器配置",path:"../MaiBot-Napcat-Adapter/config.toml",icon:ed},docker:{name:"Docker",description:"Docker Compose 部署的适配器配置",path:"/MaiMBot/adapters-config/config.toml",icon:Jee}};function Xve(){const[t,e]=b.useState("upload"),[n,r]=b.useState(null),[s,i]=b.useState(""),[a,l]=b.useState(""),[c,d]=b.useState("oneclick"),[h,m]=b.useState(""),[g,x]=b.useState(!1),[y,w]=b.useState(!1),[S,k]=b.useState(!1),[j,N]=b.useState(!1),[T,E]=b.useState(null),_=b.useRef(null),{toast:A}=Lr(),D=b.useRef(null),q=G=>{if(!G.trim())return{valid:!1,error:"路径不能为空"};if(!G.toLowerCase().endsWith(".toml"))return{valid:!1,error:"文件必须是 .toml 格式"};const se=/^([a-zA-Z]:\\|\\\\[^\\]+\\[^\\]+\\).+\.toml$/i,re=/^(\/|~\/).+\.toml$/i,ae=/^(\.{1,2}[\\/]|[^:\\/]).+\.toml$/i,_e=se.test(G),Be=re.test(G),Ye=ae.test(G);return!_e&&!Be&&!Ye?{valid:!1,error:"路径格式错误"}:/[<>"|?*\x00-\x1F]/.test(G)?{valid:!1,error:"路径包含非法字符"}:{valid:!0,error:""}},B=G=>{if(l(G),G.trim()){const se=q(G);m(se.error)}else m("")},H=b.useCallback(async G=>{const se=AS[G];w(!0);try{const re=await SM(se.path),ae=X(re);r(ae),d(G),l(se.path),await wM(se.path),A({title:"加载成功",description:`已从${se.name}预设加载配置`})}catch(re){console.error("加载预设配置失败:",re),A({title:"加载失败",description:re instanceof Error?re.message:"无法读取预设配置文件",variant:"destructive"})}finally{w(!1)}},[A]),W=b.useCallback(async G=>{const se=q(G);if(!se.valid){m(se.error),A({title:"路径无效",description:se.error,variant:"destructive"});return}m(""),w(!0);try{const re=await SM(G),ae=X(re);r(ae),l(G),await wM(G),A({title:"加载成功",description:"已从配置文件加载"})}catch(re){console.error("加载配置失败:",re),A({title:"加载失败",description:re instanceof Error?re.message:"无法读取配置文件",variant:"destructive"})}finally{w(!1)}},[A]);b.useEffect(()=>{(async()=>{try{const se=await Gve();if(se&&se.path){l(se.path);const re=Object.entries(AS).find(([,ae])=>ae.path===se.path);re?(e("preset"),d(re[0]),await H(re[0])):(e("path"),await W(se.path))}}catch(se){console.error("加载保存的路径失败:",se)}})()},[W,H]);const ee=b.useCallback(G=>{t!=="path"&&t!=="preset"||!a||(D.current&&clearTimeout(D.current),D.current=setTimeout(async()=>{x(!0);try{const se=z(G);await kM(a,se),A({title:"自动保存成功",description:"配置已保存到文件"})}catch(se){console.error("自动保存失败:",se),A({title:"自动保存失败",description:se instanceof Error?se.message:"保存配置失败",variant:"destructive"})}finally{x(!1)}},1e3))},[t,a,A]),I=async()=>{if(!n||!a)return;const G=q(a);if(!G.valid){A({title:"保存失败",description:G.error,variant:"destructive"});return}x(!0);try{const se=z(n);await kM(a,se),A({title:"保存成功",description:"配置已保存到文件"})}catch(se){console.error("保存失败:",se),A({title:"保存失败",description:se instanceof Error?se.message:"保存配置失败",variant:"destructive"})}finally{x(!1)}},V=async()=>{a&&await W(a)},L=G=>{if(G!==t){if(n){E(G),k(!0);return}$(G)}},$=G=>{r(null),i(""),m(""),e(G),G==="preset"&&H("oneclick"),A({title:"已切换模式",description:{upload:"现在可以上传配置文件",path:"现在可以指定配置文件路径",preset:"现在可以使用预设配置"}[G]})},K=()=>{T&&($(T),E(null)),k(!1)},Y=()=>{if(n){N(!0);return}R()},R=()=>{l(""),r(null),m(""),A({title:"已清空",description:"路径和配置已清空"})},ie=()=>{R(),N(!1)},X=G=>{const se=JSON.parse(JSON.stringify($i)),re=G.split(`
|
||
`);let ae="";for(const _e of re){const Be=_e.trim();if(!Be||Be.startsWith("#"))continue;const Ye=Be.match(/^\[(\w+)\]/);if(Ye){ae=Ye[1];continue}const Je=Be.match(/^(\w+)\s*=\s*(.+)$/);if(Je&&ae){const[,Oe,Ve]=Je;let Ue=Ve.trim();const $e=Ue.match(/^("[^"]*")/);if($e)Ue=$e[1];else{const vt=Ue.indexOf("#");vt!==-1&&(Ue=Ue.substring(0,vt).trim())}let jt;if(Ue==="true")jt=!0;else if(Ue==="false")jt=!1;else if(Ue.startsWith("[")&&Ue.endsWith("]")){const vt=Ue.slice(1,-1).trim();if(vt){const $n=vt.split(",").map(un=>{const Mt=un.trim();return isNaN(Number(Mt))?Mt.replace(/"/g,""):Number(Mt)}),qt=typeof $n[0];jt=$n.every(un=>typeof un===qt)?$n:$n.filter(un=>typeof un=="number")}else jt=[]}else Ue.startsWith('"')&&Ue.endsWith('"')?jt=Ue.slice(1,-1):isNaN(Number(Ue))?jt=Ue.replace(/"/g,""):jt=Number(Ue);if(ae in se){const vt=se[ae];vt[Oe]=jt}}}return se},z=G=>{const se=[],re=(ae,_e)=>ae===""||ae===null||ae===void 0?_e:ae;return se.push("[inner]"),se.push(`version = "${re(G.inner.version,$i.inner.version)}" # 版本号`),se.push("# 请勿修改版本号,除非你知道自己在做什么"),se.push(""),se.push("[nickname] # 现在没用"),se.push(`nickname = "${re(G.nickname.nickname,$i.nickname.nickname)}"`),se.push(""),se.push("[napcat_server] # Napcat连接的ws服务设置"),se.push(`host = "${re(G.napcat_server.host,$i.napcat_server.host)}" # Napcat设定的主机地址`),se.push(`port = ${re(G.napcat_server.port||0,$i.napcat_server.port)} # Napcat设定的端口`),se.push(`token = "${re(G.napcat_server.token,$i.napcat_server.token)}" # Napcat设定的访问令牌,若无则留空`),se.push(`heartbeat_interval = ${re(G.napcat_server.heartbeat_interval||0,$i.napcat_server.heartbeat_interval)} # 与Napcat设置的心跳相同(按秒计)`),se.push(""),se.push("[maibot_server] # 连接麦麦的ws服务设置"),se.push(`host = "${re(G.maibot_server.host,$i.maibot_server.host)}" # 麦麦在.env文件中设置的主机地址,即HOST字段`),se.push(`port = ${re(G.maibot_server.port||0,$i.maibot_server.port)} # 麦麦在.env文件中设置的端口,即PORT字段`),se.push(""),se.push("[chat] # 黑白名单功能"),se.push(`group_list_type = "${re(G.chat.group_list_type,$i.chat.group_list_type)}" # 群组名单类型,可选为:whitelist, blacklist`),se.push(`group_list = [${G.chat.group_list.join(", ")}] # 群组名单`),se.push("# 当group_list_type为whitelist时,只有群组名单中的群组可以聊天"),se.push("# 当group_list_type为blacklist时,群组名单中的任何群组无法聊天"),se.push(`private_list_type = "${re(G.chat.private_list_type,$i.chat.private_list_type)}" # 私聊名单类型,可选为:whitelist, blacklist`),se.push(`private_list = [${G.chat.private_list.join(", ")}] # 私聊名单`),se.push("# 当private_list_type为whitelist时,只有私聊名单中的用户可以聊天"),se.push("# 当private_list_type为blacklist时,私聊名单中的任何用户无法聊天"),se.push(`ban_user_id = [${G.chat.ban_user_id.join(", ")}] # 全局禁止名单(全局禁止名单中的用户无法进行任何聊天)`),se.push(`ban_qq_bot = ${G.chat.ban_qq_bot} # 是否屏蔽QQ官方机器人`),se.push(`enable_poke = ${G.chat.enable_poke} # 是否启用戳一戳功能`),se.push(""),se.push("[voice] # 发送语音设置"),se.push(`use_tts = ${G.voice.use_tts} # 是否使用tts语音(请确保你配置了tts并有对应的adapter)`),se.push(""),se.push("[debug]"),se.push(`level = "${re(G.debug.level,$i.debug.level)}" # 日志等级(DEBUG, INFO, WARNING, ERROR, CRITICAL)`),se.join(`
|
||
`)},U=G=>{const se=G.target.files?.[0];if(!se)return;const re=new FileReader;re.onload=ae=>{try{const _e=ae.target?.result,Be=X(_e);r(Be),i(se.name),A({title:"上传成功",description:`已加载配置文件:${se.name}`})}catch(_e){console.error("解析配置文件失败:",_e),A({title:"解析失败",description:"配置文件格式错误,请检查文件内容",variant:"destructive"})}},re.readAsText(se)},te=()=>{if(!n)return;const G=z(n),se=new Blob([G],{type:"text/plain;charset=utf-8"}),re=URL.createObjectURL(se),ae=document.createElement("a");ae.href=re,ae.download=s||"config.toml",document.body.appendChild(ae),ae.click(),document.body.removeChild(ae),URL.revokeObjectURL(re),A({title:"下载成功",description:"配置文件已下载,请手动覆盖并重启适配器"})},ne=()=>{r(JSON.parse(JSON.stringify($i))),i("config.toml"),A({title:"已加载默认配置",description:"可以开始编辑配置"})};return o.jsx(pn,{className:"h-full",children:o.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[o.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"麦麦适配器配置"}),o.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理麦麦的 QQ 适配器的配置文件"})]})}),o.jsxs("div",{className:"flex items-start gap-2 p-3 rounded-lg border border-amber-500/50 bg-amber-500/10 text-amber-700 dark:text-amber-400",children:[o.jsx(Lo,{className:"h-4 w-4 mt-0.5 flex-shrink-0"}),o.jsx("p",{className:"text-sm",children:"适配器配置保存之后使用 WebUI 的重启功能适配器并不会重启,需要手动重启适配器。"})]}),o.jsxs(Lt,{children:[o.jsxs(En,{children:[o.jsx(_n,{children:"工作模式"}),o.jsx(Wr,{children:"选择配置文件的管理方式"})]}),o.jsxs(Xn,{className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3 md:gap-4",children:[o.jsx("div",{className:`border-2 rounded-lg p-3 md:p-4 cursor-pointer transition-all ${t==="preset"?"border-primary bg-primary/5":"border-muted hover:border-primary/50 active:border-primary/70"}`,onClick:()=>L("preset"),children:o.jsxs("div",{className:"flex items-start gap-2 md:gap-3",children:[o.jsx(ed,{className:"h-4 w-4 md:h-5 md:w-5 mt-0.5 flex-shrink-0"}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("h3",{className:"font-semibold text-sm md:text-base",children:"预设模式"}),o.jsx("p",{className:"text-xs md:text-sm text-muted-foreground mt-1 line-clamp-2",children:"使用预设的部署配置"})]})]})}),o.jsx("div",{className:`border-2 rounded-lg p-3 md:p-4 cursor-pointer transition-all ${t==="upload"?"border-primary bg-primary/5":"border-muted hover:border-primary/50 active:border-primary/70"}`,onClick:()=>L("upload"),children:o.jsxs("div",{className:"flex items-start gap-2 md:gap-3",children:[o.jsx(N9,{className:"h-4 w-4 md:h-5 md:w-5 mt-0.5 flex-shrink-0"}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("h3",{className:"font-semibold text-sm md:text-base",children:"上传文件模式"}),o.jsx("p",{className:"text-xs md:text-sm text-muted-foreground mt-1 line-clamp-2",children:"上传配置文件,编辑后下载并手动覆盖"})]})]})}),o.jsx("div",{className:`border-2 rounded-lg p-3 md:p-4 cursor-pointer transition-all ${t==="path"?"border-primary bg-primary/5":"border-muted hover:border-primary/50 active:border-primary/70"}`,onClick:()=>L("path"),children:o.jsxs("div",{className:"flex items-start gap-2 md:gap-3",children:[o.jsx(ete,{className:"h-4 w-4 md:h-5 md:w-5 mt-0.5 flex-shrink-0"}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("h3",{className:"font-semibold text-sm md:text-base",children:"指定路径模式"}),o.jsx("p",{className:"text-xs md:text-sm text-muted-foreground mt-1 line-clamp-2",children:"指定配置文件路径,自动加载和保存"})]})]})})]}),t==="preset"&&o.jsxs("div",{className:"space-y-3 pt-2 border-t",children:[o.jsx(he,{className:"text-sm md:text-base",children:"选择部署方式"}),o.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:Object.entries(AS).map(([G,se])=>{const re=se.icon,ae=c===G;return o.jsx("div",{className:`border-2 rounded-lg p-3 cursor-pointer transition-all ${ae?"border-primary bg-primary/5":"border-muted hover:border-primary/50"}`,onClick:()=>{d(G),H(G)},children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx(re,{className:"h-5 w-5 mt-0.5 flex-shrink-0"}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("h4",{className:"font-semibold text-sm",children:se.name}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:se.description}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1 font-mono break-all",children:se.path})]})]})},G)})})]}),t==="path"&&o.jsxs("div",{className:"space-y-3 pt-2 border-t",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"config-path",className:"text-sm md:text-base",children:"配置文件路径"}),o.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[o.jsxs("div",{className:"flex-1 space-y-1",children:[o.jsx(Pe,{id:"config-path",value:a,onChange:G=>B(G.target.value),placeholder:"例: C:\\Adapter\\config.toml",className:`text-sm ${h?"border-destructive":""}`}),h&&o.jsx("p",{className:"text-xs text-destructive",children:h})]}),o.jsx(ue,{onClick:()=>W(a),disabled:y||!a||!!h,className:"w-full sm:w-auto",children:y?o.jsxs(o.Fragment,{children:[o.jsx(Qs,{className:"h-4 w-4 animate-spin mr-2"}),o.jsx("span",{className:"sm:hidden",children:"加载中..."})]}):o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"sm:hidden",children:"加载配置"}),o.jsx("span",{className:"hidden sm:inline",children:"加载"})]})})]})]}),o.jsxs("details",{className:"rounded-lg bg-muted/50 p-3 group",children:[o.jsxs("summary",{className:"text-xs font-medium cursor-pointer select-none list-none flex items-center justify-between",children:[o.jsx("span",{children:"路径格式说明"}),o.jsx("svg",{className:"h-4 w-4 transition-transform group-open:rotate-180",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),o.jsxs("div",{className:"mt-2 space-y-2 text-xs text-muted-foreground",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx("div",{className:"flex items-center gap-2",children:o.jsx("span",{className:"font-mono bg-background px-1.5 py-0.5 rounded text-[10px] md:text-xs whitespace-nowrap",children:"Windows"})}),o.jsxs("div",{className:"pl-2 space-y-0.5 text-[10px] md:text-xs break-all",children:[o.jsx("div",{children:"C:\\Adapter\\config.toml"}),o.jsx("div",{className:"hidden sm:block",children:"D:\\MaiBot\\adapter\\config.toml"}),o.jsx("div",{className:"hidden sm:block",children:"\\\\server\\share\\config.toml"})]})]}),o.jsxs("div",{className:"space-y-1",children:[o.jsx("div",{className:"flex items-center gap-2",children:o.jsx("span",{className:"font-mono bg-background px-1.5 py-0.5 rounded text-[10px] md:text-xs whitespace-nowrap",children:"Linux"})}),o.jsxs("div",{className:"pl-2 space-y-0.5 text-[10px] md:text-xs break-all",children:[o.jsx("div",{children:"/opt/adapter/config.toml"}),o.jsx("div",{className:"hidden sm:block",children:"/home/user/adapter/config.toml"}),o.jsx("div",{className:"hidden sm:block",children:"~/adapter/config.toml"})]})]}),o.jsx("p",{className:"pt-1 border-t text-[10px] md:text-xs",children:"💡 配置会自动保存到指定文件,修改后 1 秒自动保存"})]})]})]})]})]}),o.jsxs(ba,{children:[o.jsx(Xi,{className:"h-4 w-4"}),o.jsx(wa,{children:t==="preset"?o.jsxs(o.Fragment,{children:[o.jsx("strong",{children:"预设模式:"}),"选择预设的部署方式,配置会自动加载,修改后 1 秒自动保存",g&&" (正在保存...)"]}):t==="upload"?o.jsxs(o.Fragment,{children:[o.jsx("strong",{children:"上传文件模式:"}),"上传配置文件 → 在线编辑 → 下载文件 → 手动覆盖并重启适配器"]}):o.jsxs(o.Fragment,{children:[o.jsx("strong",{children:"指定路径模式:"}),"指定配置文件路径后,配置会自动加载,修改后 1 秒自动保存",g&&" (正在保存...)"]})})]}),t==="upload"&&!n&&o.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 w-full",children:[o.jsx("input",{ref:_,type:"file",accept:".toml",className:"hidden",onChange:U}),o.jsxs(ue,{onClick:()=>_.current?.click(),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[o.jsx(N9,{className:"mr-2 h-4 w-4"}),"上传配置"]}),o.jsxs(ue,{onClick:ne,size:"sm",className:"w-full sm:w-auto",children:[o.jsx(Po,{className:"mr-2 h-4 w-4"}),"使用默认配置"]})]}),t==="upload"&&n&&o.jsx("div",{className:"flex gap-2",children:o.jsxs(ue,{onClick:te,size:"sm",className:"w-full sm:w-auto",children:[o.jsx(td,{className:"mr-2 h-4 w-4"}),"下载配置"]})}),(t==="preset"||t==="path")&&n&&o.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[o.jsxs(ue,{onClick:I,size:"sm",disabled:g||!!h,className:"w-full sm:w-auto",children:[o.jsx(zp,{className:"mr-2 h-4 w-4"}),g?"保存中...":"立即保存"]}),o.jsxs(ue,{onClick:V,size:"sm",variant:"outline",disabled:y,className:"w-full sm:w-auto",children:[o.jsx(Qs,{className:`mr-2 h-4 w-4 ${y?"animate-spin":""}`}),"刷新"]}),t==="path"&&o.jsxs(ue,{onClick:Y,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[o.jsx(Cn,{className:"mr-2 h-4 w-4"}),"清空路径"]})]}),n?o.jsxs(Yi,{defaultValue:"napcat",className:"w-full",children:[o.jsx("div",{className:"overflow-x-auto -mx-4 px-4 sm:mx-0 sm:px-0",children:o.jsxs(ji,{className:"inline-flex w-auto min-w-full sm:grid sm:w-full sm:grid-cols-5",children:[o.jsxs(Bt,{value:"napcat",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:[o.jsx("span",{className:"hidden sm:inline",children:"Napcat 连接"}),o.jsx("span",{className:"sm:hidden",children:"Napcat"})]}),o.jsxs(Bt,{value:"maibot",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:[o.jsx("span",{className:"hidden sm:inline",children:"麦麦连接"}),o.jsx("span",{className:"sm:hidden",children:"麦麦"})]}),o.jsxs(Bt,{value:"chat",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:[o.jsx("span",{className:"hidden sm:inline",children:"聊天控制"}),o.jsx("span",{className:"sm:hidden",children:"聊天"})]}),o.jsxs(Bt,{value:"voice",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:[o.jsx("span",{className:"hidden sm:inline",children:"语音设置"}),o.jsx("span",{className:"sm:hidden",children:"语音"})]}),o.jsx(Bt,{value:"debug",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:"调试"})]})}),o.jsx(ln,{value:"napcat",className:"space-y-4",children:o.jsx(Yve,{config:n,onChange:G=>{r(G),ee(G)}})}),o.jsx(ln,{value:"maibot",className:"space-y-4",children:o.jsx(Kve,{config:n,onChange:G=>{r(G),ee(G)}})}),o.jsx(ln,{value:"chat",className:"space-y-4",children:o.jsx(Zve,{config:n,onChange:G=>{r(G),ee(G)}})}),o.jsx(ln,{value:"voice",className:"space-y-4",children:o.jsx(Jve,{config:n,onChange:G=>{r(G),ee(G)}})}),o.jsx(ln,{value:"debug",className:"space-y-4",children:o.jsx(eye,{config:n,onChange:G=>{r(G),ee(G)}})})]}):o.jsx("div",{className:"rounded-lg border bg-card p-6 md:p-12",children:o.jsxs("div",{className:"text-center space-y-3 md:space-y-4",children:[o.jsx(Po,{className:"h-12 w-12 md:h-16 md:w-16 mx-auto text-muted-foreground"}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-base md:text-lg font-semibold",children:"尚未加载配置"}),o.jsx("p",{className:"text-xs md:text-sm text-muted-foreground mt-2 px-4",children:t==="preset"?"请选择预设的部署方式":t==="upload"?"请上传现有配置文件,或使用默认配置开始编辑":"请指定配置文件路径并点击加载按钮"})]})]})}),o.jsx(Fn,{open:S,onOpenChange:k,children:o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认切换模式"}),o.jsxs(zn,{children:["切换模式将清空当前配置,确定要继续吗?",o.jsx("br",{}),o.jsx("span",{className:"text-destructive font-medium",children:"请确保已保存重要配置"})]})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{onClick:()=>{k(!1),E(null)},children:"取消"}),o.jsx(In,{onClick:K,children:"确认切换"})]})]})}),o.jsx(Fn,{open:j,onOpenChange:N,children:o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认清空路径"}),o.jsxs(zn,{children:["清空路径将清除当前配置,确定要继续吗?",o.jsx("br",{}),o.jsx("span",{className:"text-muted-foreground text-sm",children:"此操作不会删除配置文件,只是清除界面中的配置"})]})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{onClick:()=>N(!1),children:"取消"}),o.jsx(In,{onClick:ie,className:"bg-destructive hover:bg-destructive/90",children:"确认清空"})]})]})})]})})}function Yve({config:t,onChange:e}){return o.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:o.jsxs("div",{children:[o.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"Napcat WebSocket 服务设置"}),o.jsxs("div",{className:"grid gap-3 md:gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"napcat-host",className:"text-sm md:text-base",children:"主机地址"}),o.jsx(Pe,{id:"napcat-host",value:t.napcat_server.host,onChange:n=>e({...t,napcat_server:{...t.napcat_server,host:n.target.value}}),placeholder:"localhost",className:"text-sm md:text-base"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"Napcat 设定的主机地址"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"napcat-port",className:"text-sm md:text-base",children:"端口"}),o.jsx(Pe,{id:"napcat-port",type:"number",value:t.napcat_server.port||"",onChange:n=>e({...t,napcat_server:{...t.napcat_server,port:n.target.value?parseInt(n.target.value):0}}),placeholder:"8095",className:"text-sm md:text-base"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"Napcat 设定的端口(留空使用默认值 8095)"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"napcat-token",className:"text-sm md:text-base",children:"访问令牌(Token)"}),o.jsx(Pe,{id:"napcat-token",type:"password",value:t.napcat_server.token,onChange:n=>e({...t,napcat_server:{...t.napcat_server,token:n.target.value}}),placeholder:"留空表示无需令牌",className:"text-sm md:text-base"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"Napcat 设定的访问令牌,若无则留空"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"napcat-heartbeat",className:"text-sm md:text-base",children:"心跳间隔(秒)"}),o.jsx(Pe,{id:"napcat-heartbeat",type:"number",value:t.napcat_server.heartbeat_interval||"",onChange:n=>e({...t,napcat_server:{...t.napcat_server,heartbeat_interval:n.target.value?parseInt(n.target.value):0}}),placeholder:"30",className:"text-sm md:text-base"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"与 Napcat 设置的心跳间隔保持一致(留空使用默认值 30)"})]})]})]})})}function Kve({config:t,onChange:e}){return o.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:o.jsxs("div",{children:[o.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"麦麦 WebSocket 服务设置"}),o.jsxs("div",{className:"grid gap-3 md:gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"maibot-host",className:"text-sm md:text-base",children:"主机地址"}),o.jsx(Pe,{id:"maibot-host",value:t.maibot_server.host,onChange:n=>e({...t,maibot_server:{...t.maibot_server,host:n.target.value}}),placeholder:"localhost",className:"text-sm md:text-base"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"麦麦在 .env 文件中设置的 HOST 字段"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"maibot-port",className:"text-sm md:text-base",children:"端口"}),o.jsx(Pe,{id:"maibot-port",type:"number",value:t.maibot_server.port||"",onChange:n=>e({...t,maibot_server:{...t.maibot_server,port:n.target.value?parseInt(n.target.value):0}}),placeholder:"8000",className:"text-sm md:text-base"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"麦麦在 .env 文件中设置的 PORT 字段(留空使用默认值 8000)"})]})]})]})})}function Zve({config:t,onChange:e}){const n=i=>{const a={...t};i==="group"?a.chat.group_list=[...a.chat.group_list,0]:i==="private"?a.chat.private_list=[...a.chat.private_list,0]:a.chat.ban_user_id=[...a.chat.ban_user_id,0],e(a)},r=(i,a)=>{const l={...t};i==="group"?l.chat.group_list=l.chat.group_list.filter((c,d)=>d!==a):i==="private"?l.chat.private_list=l.chat.private_list.filter((c,d)=>d!==a):l.chat.ban_user_id=l.chat.ban_user_id.filter((c,d)=>d!==a),e(l)},s=(i,a,l)=>{const c={...t};i==="group"?c.chat.group_list[a]=l:i==="private"?c.chat.private_list[a]=l:c.chat.ban_user_id[a]=l,e(c)};return o.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:o.jsxs("div",{children:[o.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"聊天黑白名单功能"}),o.jsxs("div",{className:"grid gap-4 md:gap-6",children:[o.jsxs("div",{className:"space-y-3 md:space-y-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{className:"text-sm md:text-base",children:"群组名单类型"}),o.jsxs(Vt,{value:t.chat.group_list_type,onValueChange:i=>e({...t,chat:{...t.chat,group_list_type:i}}),children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"whitelist",children:"白名单(仅名单内可聊天)"}),o.jsx(De,{value:"blacklist",children:"黑名单(名单内禁止聊天)"})]})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 sm:gap-0",children:[o.jsx(he,{className:"text-sm md:text-base",children:"群组列表"}),o.jsxs(ue,{onClick:()=>n("group"),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[o.jsx(Po,{className:"mr-1 h-4 w-4"}),"添加群号"]})]}),t.chat.group_list.map((i,a)=>o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Pe,{type:"number",value:i,onChange:l=>s("group",a,parseInt(l.target.value)||0),placeholder:"输入群号",className:"text-sm md:text-base"}),o.jsxs(Fn,{children:[o.jsx(is,{asChild:!0,children:o.jsx(ue,{size:"icon",variant:"outline",children:o.jsx(Cn,{className:"h-4 w-4"})})}),o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认删除"}),o.jsxs(zn,{children:["确定要删除群号 ",i," 吗?此操作无法撤销。"]})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:()=>r("group",a),children:"删除"})]})]})]})]},a)),t.chat.group_list.length===0&&o.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无群组"})]})]}),o.jsxs("div",{className:"space-y-3 md:space-y-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{className:"text-sm md:text-base",children:"私聊名单类型"}),o.jsxs(Vt,{value:t.chat.private_list_type,onValueChange:i=>e({...t,chat:{...t.chat,private_list_type:i}}),children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"whitelist",children:"白名单(仅名单内可聊天)"}),o.jsx(De,{value:"blacklist",children:"黑名单(名单内禁止聊天)"})]})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 sm:gap-0",children:[o.jsx(he,{className:"text-sm md:text-base",children:"私聊列表"}),o.jsxs(ue,{onClick:()=>n("private"),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[o.jsx(Po,{className:"mr-1 h-4 w-4"}),"添加用户"]})]}),t.chat.private_list.map((i,a)=>o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Pe,{type:"number",value:i,onChange:l=>s("private",a,parseInt(l.target.value)||0),placeholder:"输入QQ号",className:"text-sm md:text-base"}),o.jsxs(Fn,{children:[o.jsx(is,{asChild:!0,children:o.jsx(ue,{size:"icon",variant:"outline",children:o.jsx(Cn,{className:"h-4 w-4"})})}),o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认删除"}),o.jsxs(zn,{children:["确定要删除用户 ",i," 吗?此操作无法撤销。"]})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:()=>r("private",a),children:"删除"})]})]})]})]},a)),t.chat.private_list.length===0&&o.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无用户"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 sm:gap-0",children:[o.jsxs("div",{children:[o.jsx(he,{className:"text-sm md:text-base",children:"全局禁止名单"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"名单中的用户无法进行任何聊天"})]}),o.jsxs(ue,{onClick:()=>n("ban"),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[o.jsx(Po,{className:"mr-1 h-4 w-4"}),"添加用户"]})]}),t.chat.ban_user_id.map((i,a)=>o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Pe,{type:"number",value:i,onChange:l=>s("ban",a,parseInt(l.target.value)||0),placeholder:"输入QQ号",className:"text-sm md:text-base"}),o.jsxs(Fn,{children:[o.jsx(is,{asChild:!0,children:o.jsx(ue,{size:"icon",variant:"outline",children:o.jsx(Cn,{className:"h-4 w-4"})})}),o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认删除"}),o.jsxs(zn,{children:["确定要从全局禁止名单中删除用户 ",i," 吗?此操作无法撤销。"]})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:()=>r("ban",a),children:"删除"})]})]})]})]},a)),t.chat.ban_user_id.length===0&&o.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无禁止用户"})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx(he,{className:"text-sm md:text-base",children:"屏蔽QQ官方机器人"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"是否屏蔽来自QQ官方机器人的消息"})]}),o.jsx(Ft,{checked:t.chat.ban_qq_bot,onCheckedChange:i=>e({...t,chat:{...t.chat,ban_qq_bot:i}})})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx(he,{className:"text-sm md:text-base",children:"启用戳一戳功能"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"是否响应戳一戳消息"})]}),o.jsx(Ft,{checked:t.chat.enable_poke,onCheckedChange:i=>e({...t,chat:{...t.chat,enable_poke:i}})})]})]})]})})}function Jve({config:t,onChange:e}){return o.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:o.jsxs("div",{children:[o.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"发送语音设置"}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx(he,{className:"text-sm md:text-base",children:"使用 TTS 语音"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"请确保已配置 TTS 并有对应的适配器"})]}),o.jsx(Ft,{checked:t.voice.use_tts,onCheckedChange:n=>e({...t,voice:{use_tts:n}})})]})]})})}function eye({config:t,onChange:e}){return o.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:o.jsxs("div",{children:[o.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"调试设置"}),o.jsx("div",{className:"grid gap-3 md:gap-4",children:o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{className:"text-sm md:text-base",children:"日志等级"}),o.jsxs(Vt,{value:t.debug.level,onValueChange:n=>e({...t,debug:{level:n}}),children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"DEBUG",children:"DEBUG(调试)"}),o.jsx(De,{value:"INFO",children:"INFO(信息)"}),o.jsx(De,{value:"WARNING",children:"WARNING(警告)"}),o.jsx(De,{value:"ERROR",children:"ERROR(错误)"}),o.jsx(De,{value:"CRITICAL",children:"CRITICAL(严重)"})]})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"设置适配器的日志输出等级"})]})})]})})}function OM(t){const e=[],n=String(t||"");let r=n.indexOf(","),s=0,i=!1;for(;!i;){r===-1&&(r=n.length,i=!0);const a=n.slice(s,r).trim();(a||!i)&&e.push(a),s=r+1,r=n.indexOf(",",s)}return e}function tye(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const nye=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,rye=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,sye={};function jM(t,e){return(sye.jsx?rye:nye).test(t)}const iye=/[ \t\n\f\r]/g;function aye(t){return typeof t=="object"?t.type==="text"?NM(t.value):!1:NM(t)}function NM(t){return t.replace(iye,"")===""}class pg{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}pg.prototype.normal={};pg.prototype.property={};pg.prototype.space=void 0;function VQ(t,e){const n={},r={};for(const s of t)Object.assign(n,s.property),Object.assign(r,s.normal);return new pg(n,r,e)}function vp(t){return t.toLowerCase()}class Ai{constructor(e,n){this.attribute=n,this.property=e}}Ai.prototype.attribute="";Ai.prototype.booleanish=!1;Ai.prototype.boolean=!1;Ai.prototype.commaOrSpaceSeparated=!1;Ai.prototype.commaSeparated=!1;Ai.prototype.defined=!1;Ai.prototype.mustUseProperty=!1;Ai.prototype.number=!1;Ai.prototype.overloadedBoolean=!1;Ai.prototype.property="";Ai.prototype.spaceSeparated=!1;Ai.prototype.space=void 0;let oye=0;const en=kd(),ns=kd(),AO=kd(),Qe=kd(),mr=kd(),$h=kd(),Hi=kd();function kd(){return 2**++oye}const MO=Object.freeze(Object.defineProperty({__proto__:null,boolean:en,booleanish:ns,commaOrSpaceSeparated:Hi,commaSeparated:$h,number:Qe,overloadedBoolean:AO,spaceSeparated:mr},Symbol.toStringTag,{value:"Module"})),MS=Object.keys(MO);class hN extends Ai{constructor(e,n,r,s){let i=-1;if(super(e,n),CM(this,"space",s),typeof r=="number")for(;++i<MS.length;){const a=MS[i];CM(this,MS[i],(r&MO[a])===MO[a])}}}hN.prototype.defined=!0;function CM(t,e,n){n&&(t[e]=n)}function Ff(t){const e={},n={};for(const[r,s]of Object.entries(t.properties)){const i=new hN(r,t.transform(t.attributes||{},r),s,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),e[r]=i,n[vp(r)]=r,n[vp(i.attribute)]=r}return new pg(e,n,t.space)}const UQ=Ff({properties:{ariaActiveDescendant:null,ariaAtomic:ns,ariaAutoComplete:null,ariaBusy:ns,ariaChecked:ns,ariaColCount:Qe,ariaColIndex:Qe,ariaColSpan:Qe,ariaControls:mr,ariaCurrent:null,ariaDescribedBy:mr,ariaDetails:null,ariaDisabled:ns,ariaDropEffect:mr,ariaErrorMessage:null,ariaExpanded:ns,ariaFlowTo:mr,ariaGrabbed:ns,ariaHasPopup:null,ariaHidden:ns,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:mr,ariaLevel:Qe,ariaLive:null,ariaModal:ns,ariaMultiLine:ns,ariaMultiSelectable:ns,ariaOrientation:null,ariaOwns:mr,ariaPlaceholder:null,ariaPosInSet:Qe,ariaPressed:ns,ariaReadOnly:ns,ariaRelevant:null,ariaRequired:ns,ariaRoleDescription:mr,ariaRowCount:Qe,ariaRowIndex:Qe,ariaRowSpan:Qe,ariaSelected:ns,ariaSetSize:Qe,ariaSort:null,ariaValueMax:Qe,ariaValueMin:Qe,ariaValueNow:Qe,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function WQ(t,e){return e in t?t[e]:e}function GQ(t,e){return WQ(t,e.toLowerCase())}const lye=Ff({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:$h,acceptCharset:mr,accessKey:mr,action:null,allow:null,allowFullScreen:en,allowPaymentRequest:en,allowUserMedia:en,alt:null,as:null,async:en,autoCapitalize:null,autoComplete:mr,autoFocus:en,autoPlay:en,blocking:mr,capture:null,charSet:null,checked:en,cite:null,className:mr,cols:Qe,colSpan:null,content:null,contentEditable:ns,controls:en,controlsList:mr,coords:Qe|$h,crossOrigin:null,data:null,dateTime:null,decoding:null,default:en,defer:en,dir:null,dirName:null,disabled:en,download:AO,draggable:ns,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:en,formTarget:null,headers:mr,height:Qe,hidden:AO,high:Qe,href:null,hrefLang:null,htmlFor:mr,httpEquiv:mr,id:null,imageSizes:null,imageSrcSet:null,inert:en,inputMode:null,integrity:null,is:null,isMap:en,itemId:null,itemProp:mr,itemRef:mr,itemScope:en,itemType:mr,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:en,low:Qe,manifest:null,max:null,maxLength:Qe,media:null,method:null,min:null,minLength:Qe,multiple:en,muted:en,name:null,nonce:null,noModule:en,noValidate:en,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:en,optimum:Qe,pattern:null,ping:mr,placeholder:null,playsInline:en,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:en,referrerPolicy:null,rel:mr,required:en,reversed:en,rows:Qe,rowSpan:Qe,sandbox:mr,scope:null,scoped:en,seamless:en,selected:en,shadowRootClonable:en,shadowRootDelegatesFocus:en,shadowRootMode:null,shape:null,size:Qe,sizes:null,slot:null,span:Qe,spellCheck:ns,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Qe,step:null,style:null,tabIndex:Qe,target:null,title:null,translate:null,type:null,typeMustMatch:en,useMap:null,value:ns,width:Qe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:mr,axis:null,background:null,bgColor:null,border:Qe,borderColor:null,bottomMargin:Qe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:en,declare:en,event:null,face:null,frame:null,frameBorder:null,hSpace:Qe,leftMargin:Qe,link:null,longDesc:null,lowSrc:null,marginHeight:Qe,marginWidth:Qe,noResize:en,noHref:en,noShade:en,noWrap:en,object:null,profile:null,prompt:null,rev:null,rightMargin:Qe,rules:null,scheme:null,scrolling:ns,standby:null,summary:null,text:null,topMargin:Qe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Qe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:en,disableRemotePlayback:en,prefix:null,property:null,results:Qe,security:null,unselectable:null},space:"html",transform:GQ}),cye=Ff({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:Hi,accentHeight:Qe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Qe,amplitude:Qe,arabicForm:null,ascent:Qe,attributeName:null,attributeType:null,azimuth:Qe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Qe,by:null,calcMode:null,capHeight:Qe,className:mr,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:Qe,diffuseConstant:Qe,direction:null,display:null,dur:null,divisor:Qe,dominantBaseline:null,download:en,dx:null,dy:null,edgeMode:null,editable:null,elevation:Qe,enableBackground:null,end:null,event:null,exponent:Qe,externalResourcesRequired:null,fill:null,fillOpacity:Qe,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:$h,g2:$h,glyphName:$h,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Qe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Qe,horizOriginX:Qe,horizOriginY:Qe,id:null,ideographic:Qe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Qe,k:Qe,k1:Qe,k2:Qe,k3:Qe,k4:Qe,kernelMatrix:Hi,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Qe,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:Qe,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:Qe,overlineThickness:Qe,paintOrder:null,panose1:null,path:null,pathLength:Qe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:mr,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Qe,pointsAtY:Qe,pointsAtZ:Qe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Hi,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Hi,rev:Hi,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Hi,requiredFeatures:Hi,requiredFonts:Hi,requiredFormats:Hi,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:Qe,specularExponent:Qe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Qe,strikethroughThickness:Qe,string:null,stroke:null,strokeDashArray:Hi,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Qe,strokeOpacity:Qe,strokeWidth:null,style:null,surfaceScale:Qe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Hi,tabIndex:Qe,tableValues:null,target:null,targetX:Qe,targetY:Qe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Hi,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Qe,underlineThickness:Qe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Qe,values:null,vAlphabetic:Qe,vMathematical:Qe,vectorEffect:null,vHanging:Qe,vIdeographic:Qe,version:null,vertAdvY:Qe,vertOriginX:Qe,vertOriginY:Qe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Qe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:WQ}),XQ=Ff({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),YQ=Ff({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:GQ}),KQ=Ff({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),uye={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"},dye=/[A-Z]/g,TM=/-[a-z]/g,hye=/^data[-\w.:]+$/i;function ZQ(t,e){const n=vp(e);let r=e,s=Ai;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&hye.test(e)){if(e.charAt(4)==="-"){const i=e.slice(5).replace(TM,mye);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=e.slice(4);if(!TM.test(i)){let a=i.replace(dye,fye);a.charAt(0)!=="-"&&(a="-"+a),e="data"+a}}s=hN}return new s(r,e)}function fye(t){return"-"+t.toLowerCase()}function mye(t){return t.charAt(1).toUpperCase()}const JQ=VQ([UQ,lye,XQ,YQ,KQ],"html"),Fb=VQ([UQ,cye,XQ,YQ,KQ],"svg");function EM(t){const e=String(t||"").trim();return e?e.split(/[ \t\n\r\f]+/g):[]}function pye(t){return t.join(" ").trim()}var ch={},RS,_M;function gye(){if(_M)return RS;_M=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,l=/^\s+|\s+$/g,c=`
|
||
`,d="/",h="*",m="",g="comment",x="declaration";function y(S,k){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];k=k||{};var j=1,N=1;function T(I){var V=I.match(e);V&&(j+=V.length);var L=I.lastIndexOf(c);N=~L?I.length-L:N+I.length}function E(){var I={line:j,column:N};return function(V){return V.position=new _(I),q(),V}}function _(I){this.start=I,this.end={line:j,column:N},this.source=k.source}_.prototype.content=S;function A(I){var V=new Error(k.source+":"+j+":"+N+": "+I);if(V.reason=I,V.filename=k.source,V.line=j,V.column=N,V.source=S,!k.silent)throw V}function D(I){var V=I.exec(S);if(V){var L=V[0];return T(L),S=S.slice(L.length),V}}function q(){D(n)}function B(I){var V;for(I=I||[];V=H();)V!==!1&&I.push(V);return I}function H(){var I=E();if(!(d!=S.charAt(0)||h!=S.charAt(1))){for(var V=2;m!=S.charAt(V)&&(h!=S.charAt(V)||d!=S.charAt(V+1));)++V;if(V+=2,m===S.charAt(V-1))return A("End of comment missing");var L=S.slice(2,V-2);return N+=2,T(L),S=S.slice(V),N+=2,I({type:g,comment:L})}}function W(){var I=E(),V=D(r);if(V){if(H(),!D(s))return A("property missing ':'");var L=D(i),$=I({type:x,property:w(V[0].replace(t,m)),value:L?w(L[0].replace(t,m)):m});return D(a),$}}function ee(){var I=[];B(I);for(var V;V=W();)V!==!1&&(I.push(V),B(I));return I}return q(),ee()}function w(S){return S?S.replace(l,m):m}return RS=y,RS}var AM;function xye(){if(AM)return ch;AM=1;var t=ch&&ch.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ch,"__esModule",{value:!0}),ch.default=n;const e=t(gye());function n(r,s){let i=null;if(!r||typeof r!="string")return i;const a=(0,e.default)(r),l=typeof s=="function";return a.forEach(c=>{if(c.type!=="declaration")return;const{property:d,value:h}=c;l?s(d,h,c):h&&(i=i||{},i[d]=h)}),i}return ch}var Km={},MM;function vye(){if(MM)return Km;MM=1,Object.defineProperty(Km,"__esModule",{value:!0}),Km.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,i=function(d){return!d||n.test(d)||t.test(d)},a=function(d,h){return h.toUpperCase()},l=function(d,h){return"".concat(h,"-")},c=function(d,h){return h===void 0&&(h={}),i(d)?d:(d=d.toLowerCase(),h.reactCompat?d=d.replace(s,l):d=d.replace(r,l),d.replace(e,a))};return Km.camelCase=c,Km}var Zm,RM;function yye(){if(RM)return Zm;RM=1;var t=Zm&&Zm.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},e=t(xye()),n=vye();function r(s,i){var a={};return!s||typeof s!="string"||(0,e.default)(s,function(l,c){l&&c&&(a[(0,n.camelCase)(l,i)]=c)}),a}return r.default=r,Zm=r,Zm}var bye=yye();const wye=yd(bye),eV=tV("end"),fN=tV("start");function tV(t){return e;function e(n){const r=n&&n.position&&n.position[t]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Sye(t){const e=fN(t),n=eV(t);if(e&&n)return{start:e,end:n}}function R0(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?DM(t.position):"start"in t||"end"in t?DM(t):"line"in t||"column"in t?RO(t):""}function RO(t){return PM(t&&t.line)+":"+PM(t&&t.column)}function DM(t){return RO(t&&t.start)+"-"+RO(t&&t.end)}function PM(t){return t&&typeof t=="number"?t:1}class Gs extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",i={},a=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof e=="string"?s=e:!i.cause&&e&&(a=!0,s=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?i.ruleId=r:(i.source=r.slice(0,c),i.ruleId=r.slice(c+1))}if(!i.place&&i.ancestors&&i.ancestors){const c=i.ancestors[i.ancestors.length-1];c&&(i.place=c.position)}const l=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=l?l.line:void 0,this.name=R0(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Gs.prototype.file="";Gs.prototype.name="";Gs.prototype.reason="";Gs.prototype.message="";Gs.prototype.stack="";Gs.prototype.column=void 0;Gs.prototype.line=void 0;Gs.prototype.ancestors=void 0;Gs.prototype.cause=void 0;Gs.prototype.fatal=void 0;Gs.prototype.place=void 0;Gs.prototype.ruleId=void 0;Gs.prototype.source=void 0;const mN={}.hasOwnProperty,kye=new Map,Oye=/[A-Z]/g,jye=new Set(["table","tbody","thead","tfoot","tr"]),Nye=new Set(["td","th"]),nV="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Cye(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=e.filePath||void 0;let r;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Pye(n,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Dye(n,e.jsx,e.jsxs)}const s={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:r,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?Fb:JQ,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},i=rV(s,t,void 0);return i&&typeof i!="string"?i:s.create(t,s.Fragment,{children:i||void 0},void 0)}function rV(t,e,n){if(e.type==="element")return Tye(t,e,n);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return Eye(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return Aye(t,e,n);if(e.type==="mdxjsEsm")return _ye(t,e);if(e.type==="root")return Mye(t,e,n);if(e.type==="text")return Rye(t,e)}function Tye(t,e,n){const r=t.schema;let s=r;e.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=Fb,t.schema=s),t.ancestors.push(e);const i=iV(t,e.tagName,!1),a=zye(t,e);let l=gN(t,e);return jye.has(e.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!aye(c):!0})),sV(t,a,i,e),pN(a,l),t.ancestors.pop(),t.schema=r,t.create(e,i,a,n)}function Eye(t,e){if(e.data&&e.data.estree&&t.evaluater){const r=e.data.estree.body[0];return r.type,t.evaluater.evaluateExpression(r.expression)}yp(t,e.position)}function _ye(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);yp(t,e.position)}function Aye(t,e,n){const r=t.schema;let s=r;e.name==="svg"&&r.space==="html"&&(s=Fb,t.schema=s),t.ancestors.push(e);const i=e.name===null?t.Fragment:iV(t,e.name,!0),a=Iye(t,e),l=gN(t,e);return sV(t,a,i,e),pN(a,l),t.ancestors.pop(),t.schema=r,t.create(e,i,a,n)}function Mye(t,e,n){const r={};return pN(r,gN(t,e)),t.create(e,t.Fragment,r,n)}function Rye(t,e){return e.value}function sV(t,e,n,r){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=r)}function pN(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function Dye(t,e,n){return r;function r(s,i,a,l){const d=Array.isArray(a.children)?n:e;return l?d(i,a,l):d(i,a)}}function Pye(t,e){return n;function n(r,s,i,a){const l=Array.isArray(i.children),c=fN(r);return e(s,i,a,l,{columnNumber:c?c.column-1:void 0,fileName:t,lineNumber:c?c.line:void 0},void 0)}}function zye(t,e){const n={};let r,s;for(s in e.properties)if(s!=="children"&&mN.call(e.properties,s)){const i=Lye(t,s,e.properties[s]);if(i){const[a,l]=i;t.tableCellAlignToStyle&&a==="align"&&typeof l=="string"&&Nye.has(e.tagName)?r=l:n[a]=l}}if(r){const i=n.style||(n.style={});i[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Iye(t,e){const n={};for(const r of e.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&t.evaluater){const i=r.data.estree.body[0];i.type;const a=i.expression;a.type;const l=a.properties[0];l.type,Object.assign(n,t.evaluater.evaluateExpression(l.argument))}else yp(t,e.position);else{const s=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&t.evaluater){const l=r.value.data.estree.body[0];l.type,i=t.evaluater.evaluateExpression(l.expression)}else yp(t,e.position);else i=r.value===null?!0:r.value;n[s]=i}return n}function gN(t,e){const n=[];let r=-1;const s=t.passKeys?new Map:kye;for(;++r<e.children.length;){const i=e.children[r];let a;if(t.passKeys){const c=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(c){const d=s.get(c)||0;a=c+"-"+d,s.set(c,d+1)}}const l=rV(t,i,a);l!==void 0&&n.push(l)}return n}function Lye(t,e,n){const r=ZQ(t.schema,e);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?tye(n):pye(n)),r.property==="style"){let s=typeof n=="object"?n:Bye(t,String(n));return t.stylePropertyNameCase==="css"&&(s=Fye(s)),["style",s]}return[t.elementAttributeNameCase==="react"&&r.space?uye[r.property]||r.property:r.attribute,n]}}function Bye(t,e){try{return wye(e,{reactCompat:!0})}catch(n){if(t.ignoreInvalidStyle)return{};const r=n,s=new Gs("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=t.filePath||void 0,s.url=nV+"#cannot-parse-style-attribute",s}}function iV(t,e,n){let r;if(!n)r={type:"Literal",value:e};else if(e.includes(".")){const s=e.split(".");let i=-1,a;for(;++i<s.length;){const l=jM(s[i])?{type:"Identifier",name:s[i]}:{type:"Literal",value:s[i]};a=a?{type:"MemberExpression",object:a,property:l,computed:!!(i&&l.type==="Literal"),optional:!1}:l}r=a}else r=jM(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(r.type==="Literal"){const s=r.value;return mN.call(t.components,s)?t.components[s]:s}if(t.evaluater)return t.evaluater.evaluateExpression(r);yp(t)}function yp(t,e){const n=new Gs("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=t.filePath||void 0,n.url=nV+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Fye(t){const e={};let n;for(n in t)mN.call(t,n)&&(e[qye(n)]=t[n]);return e}function qye(t){let e=t.replace(Oye,$ye);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function $ye(t){return"-"+t.toLowerCase()}const DS={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"]},Hye={};function xN(t,e){const n=Hye,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return aV(t,r,s)}function aV(t,e,n){if(Qye(t)){if("value"in t)return t.type==="html"&&!n?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return zM(t.children,e,n)}return Array.isArray(t)?zM(t,e,n):""}function zM(t,e,n){const r=[];let s=-1;for(;++s<t.length;)r[s]=aV(t[s],e,n);return r.join("")}function Qye(t){return!!(t&&typeof t=="object")}const IM=document.createElement("i");function vN(t){const e="&"+t+";";IM.innerHTML=e;const n=IM.textContent;return n.charCodeAt(n.length-1)===59&&t!=="semi"||n===e?!1:n}function Ki(t,e,n,r){const s=t.length;let i=0,a;if(e<0?e=-e>s?0:s+e:e=e>s?s:e,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(e,n),t.splice(...a);else for(n&&t.splice(e,n);i<r.length;)a=r.slice(i,i+1e4),a.unshift(e,0),t.splice(...a),i+=1e4,e+=1e4}function xa(t,e){return t.length>0?(Ki(t,t.length,0,e),t):e}const LM={}.hasOwnProperty;function oV(t){const e={};let n=-1;for(;++n<t.length;)Vye(e,t[n]);return e}function Vye(t,e){let n;for(n in e){const s=(LM.call(t,n)?t[n]:void 0)||(t[n]={}),i=e[n];let a;if(i)for(a in i){LM.call(s,a)||(s[a]=[]);const l=i[a];Uye(s[a],Array.isArray(l)?l:l?[l]:[])}}}function Uye(t,e){let n=-1;const r=[];for(;++n<e.length;)(e[n].add==="after"?t:r).push(e[n]);Ki(t,0,0,r)}function lV(t,e){const n=Number.parseInt(t,e);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 Xa(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ei=fu(/[A-Za-z]/),Vs=fu(/[\dA-Za-z]/),Wye=fu(/[#-'*+\--9=?A-Z^-~]/);function ky(t){return t!==null&&(t<32||t===127)}const DO=fu(/\d/),Gye=fu(/[\dA-Fa-f]/),Xye=fu(/[!-/:-@[-`{-~]/);function St(t){return t!==null&&t<-2}function dr(t){return t!==null&&(t<0||t===32)}function gn(t){return t===-2||t===-1||t===32}const qb=fu(new RegExp("\\p{P}|\\p{S}","u")),gd=fu(/\s/);function fu(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function qf(t){const e=[];let n=-1,r=0,s=0;for(;++n<t.length;){const i=t.charCodeAt(n);let a="";if(i===37&&Vs(t.charCodeAt(n+1))&&Vs(t.charCodeAt(n+2)))s=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(a=String.fromCharCode(i));else if(i>55295&&i<57344){const l=t.charCodeAt(n+1);i<56320&&l>56319&&l<57344?(a=String.fromCharCode(i,l),s=1):a="<22>"}else a=String.fromCharCode(i);a&&(e.push(t.slice(r,n),encodeURIComponent(a)),r=n+s+1,a=""),s&&(n+=s,s=0)}return e.join("")+t.slice(r)}function cn(t,e,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return a;function a(c){return gn(c)?(t.enter(n),l(c)):e(c)}function l(c){return gn(c)&&i++<s?(t.consume(c),l):(t.exit(n),e(c))}}const Yye={tokenize:Kye};function Kye(t){const e=t.attempt(this.parser.constructs.contentInitial,r,s);let n;return e;function r(l){if(l===null){t.consume(l);return}return t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),cn(t,e,"linePrefix")}function s(l){return t.enter("paragraph"),i(l)}function i(l){const c=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,a(l)}function a(l){if(l===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(l);return}return St(l)?(t.consume(l),t.exit("chunkText"),i):(t.consume(l),a)}}const Zye={tokenize:Jye},BM={tokenize:ebe};function Jye(t){const e=this,n=[];let r=0,s,i,a;return l;function l(N){if(r<n.length){const T=n[r];return e.containerState=T[1],t.attempt(T[0].continuation,c,d)(N)}return d(N)}function c(N){if(r++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,s&&j();const T=e.events.length;let E=T,_;for(;E--;)if(e.events[E][0]==="exit"&&e.events[E][1].type==="chunkFlow"){_=e.events[E][1].end;break}k(r);let A=T;for(;A<e.events.length;)e.events[A][1].end={..._},A++;return Ki(e.events,E+1,0,e.events.slice(T)),e.events.length=A,d(N)}return l(N)}function d(N){if(r===n.length){if(!s)return g(N);if(s.currentConstruct&&s.currentConstruct.concrete)return y(N);e.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(BM,h,m)(N)}function h(N){return s&&j(),k(r),g(N)}function m(N){return e.parser.lazy[e.now().line]=r!==n.length,a=e.now().offset,y(N)}function g(N){return e.containerState={},t.attempt(BM,x,y)(N)}function x(N){return r++,n.push([e.currentConstruct,e.containerState]),g(N)}function y(N){if(N===null){s&&j(),k(0),t.consume(N);return}return s=s||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:i}),w(N)}function w(N){if(N===null){S(t.exit("chunkFlow"),!0),k(0),t.consume(N);return}return St(N)?(t.consume(N),S(t.exit("chunkFlow")),r=0,e.interrupt=void 0,l):(t.consume(N),w)}function S(N,T){const E=e.sliceStream(N);if(T&&E.push(null),N.previous=i,i&&(i.next=N),i=N,s.defineSkip(N.start),s.write(E),e.parser.lazy[N.start.line]){let _=s.events.length;for(;_--;)if(s.events[_][1].start.offset<a&&(!s.events[_][1].end||s.events[_][1].end.offset>a))return;const A=e.events.length;let D=A,q,B;for(;D--;)if(e.events[D][0]==="exit"&&e.events[D][1].type==="chunkFlow"){if(q){B=e.events[D][1].end;break}q=!0}for(k(r),_=A;_<e.events.length;)e.events[_][1].end={...B},_++;Ki(e.events,D+1,0,e.events.slice(A)),e.events.length=_}}function k(N){let T=n.length;for(;T-- >N;){const E=n[T];e.containerState=E[1],E[0].exit.call(e,t)}n.length=N}function j(){s.write([null]),i=void 0,s=void 0,e.containerState._closeFlow=void 0}}function ebe(t,e,n){return cn(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function hf(t){if(t===null||dr(t)||gd(t))return 1;if(qb(t))return 2}function $b(t,e,n){const r=[];let s=-1;for(;++s<t.length;){const i=t[s].resolveAll;i&&!r.includes(i)&&(e=i(e,n),r.push(i))}return e}const PO={name:"attention",resolveAll:tbe,tokenize:nbe};function tbe(t,e){let n=-1,r,s,i,a,l,c,d,h;for(;++n<t.length;)if(t[n][0]==="enter"&&t[n][1].type==="attentionSequence"&&t[n][1]._close){for(r=n;r--;)if(t[r][0]==="exit"&&t[r][1].type==="attentionSequence"&&t[r][1]._open&&e.sliceSerialize(t[r][1]).charCodeAt(0)===e.sliceSerialize(t[n][1]).charCodeAt(0)){if((t[r][1]._close||t[n][1]._open)&&(t[n][1].end.offset-t[n][1].start.offset)%3&&!((t[r][1].end.offset-t[r][1].start.offset+t[n][1].end.offset-t[n][1].start.offset)%3))continue;c=t[r][1].end.offset-t[r][1].start.offset>1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const m={...t[r][1].end},g={...t[n][1].start};FM(m,-c),FM(g,c),a={type:c>1?"strongSequence":"emphasisSequence",start:m,end:{...t[r][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:g},i={type:c>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[n][1].start}},s={type:c>1?"strong":"emphasis",start:{...a.start},end:{...l.end}},t[r][1].end={...a.start},t[n][1].start={...l.end},d=[],t[r][1].end.offset-t[r][1].start.offset&&(d=xa(d,[["enter",t[r][1],e],["exit",t[r][1],e]])),d=xa(d,[["enter",s,e],["enter",a,e],["exit",a,e],["enter",i,e]]),d=xa(d,$b(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),d=xa(d,[["exit",i,e],["enter",l,e],["exit",l,e],["exit",s,e]]),t[n][1].end.offset-t[n][1].start.offset?(h=2,d=xa(d,[["enter",t[n][1],e],["exit",t[n][1],e]])):h=0,Ki(t,r-1,n-r+3,d),n=r+d.length-h-2;break}}for(n=-1;++n<t.length;)t[n][1].type==="attentionSequence"&&(t[n][1].type="data");return t}function nbe(t,e){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=hf(r);let i;return a;function a(c){return i=c,t.enter("attentionSequence"),l(c)}function l(c){if(c===i)return t.consume(c),l;const d=t.exit("attentionSequence"),h=hf(c),m=!h||h===2&&s||n.includes(c),g=!s||s===2&&h||n.includes(r);return d._open=!!(i===42?m:m&&(s||!g)),d._close=!!(i===42?g:g&&(h||!m)),e(c)}}function FM(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const rbe={name:"autolink",tokenize:sbe};function sbe(t,e,n){let r=0;return s;function s(x){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(x),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),i}function i(x){return ei(x)?(t.consume(x),a):x===64?n(x):d(x)}function a(x){return x===43||x===45||x===46||Vs(x)?(r=1,l(x)):d(x)}function l(x){return x===58?(t.consume(x),r=0,c):(x===43||x===45||x===46||Vs(x))&&r++<32?(t.consume(x),l):(r=0,d(x))}function c(x){return x===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(x),t.exit("autolinkMarker"),t.exit("autolink"),e):x===null||x===32||x===60||ky(x)?n(x):(t.consume(x),c)}function d(x){return x===64?(t.consume(x),h):Wye(x)?(t.consume(x),d):n(x)}function h(x){return Vs(x)?m(x):n(x)}function m(x){return x===46?(t.consume(x),r=0,h):x===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(x),t.exit("autolinkMarker"),t.exit("autolink"),e):g(x)}function g(x){if((x===45||Vs(x))&&r++<63){const y=x===45?g:m;return t.consume(x),y}return n(x)}}const gg={partial:!0,tokenize:ibe};function ibe(t,e,n){return r;function r(i){return gn(i)?cn(t,s,"linePrefix")(i):s(i)}function s(i){return i===null||St(i)?e(i):n(i)}}const cV={continuation:{tokenize:obe},exit:lbe,name:"blockQuote",tokenize:abe};function abe(t,e,n){const r=this;return s;function s(a){if(a===62){const l=r.containerState;return l.open||(t.enter("blockQuote",{_container:!0}),l.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(a),t.exit("blockQuoteMarker"),i}return n(a)}function i(a){return gn(a)?(t.enter("blockQuotePrefixWhitespace"),t.consume(a),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(a))}}function obe(t,e,n){const r=this;return s;function s(a){return gn(a)?cn(t,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):i(a)}function i(a){return t.attempt(cV,e,n)(a)}}function lbe(t){t.exit("blockQuote")}const uV={name:"characterEscape",tokenize:cbe};function cbe(t,e,n){return r;function r(i){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(i),t.exit("escapeMarker"),s}function s(i){return Xye(i)?(t.enter("characterEscapeValue"),t.consume(i),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(i)}}const dV={name:"characterReference",tokenize:ube};function ube(t,e,n){const r=this;let s=0,i,a;return l;function l(m){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(m),t.exit("characterReferenceMarker"),c}function c(m){return m===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(m),t.exit("characterReferenceMarkerNumeric"),d):(t.enter("characterReferenceValue"),i=31,a=Vs,h(m))}function d(m){return m===88||m===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(m),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),i=6,a=Gye,h):(t.enter("characterReferenceValue"),i=7,a=DO,h(m))}function h(m){if(m===59&&s){const g=t.exit("characterReferenceValue");return a===Vs&&!vN(r.sliceSerialize(g))?n(m):(t.enter("characterReferenceMarker"),t.consume(m),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return a(m)&&s++<i?(t.consume(m),h):n(m)}}const qM={partial:!0,tokenize:hbe},$M={concrete:!0,name:"codeFenced",tokenize:dbe};function dbe(t,e,n){const r=this,s={partial:!0,tokenize:E};let i=0,a=0,l;return c;function c(_){return d(_)}function d(_){const A=r.events[r.events.length-1];return i=A&&A[1].type==="linePrefix"?A[2].sliceSerialize(A[1],!0).length:0,l=_,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),h(_)}function h(_){return _===l?(a++,t.consume(_),h):a<3?n(_):(t.exit("codeFencedFenceSequence"),gn(_)?cn(t,m,"whitespace")(_):m(_))}function m(_){return _===null||St(_)?(t.exit("codeFencedFence"),r.interrupt?e(_):t.check(qM,w,T)(_)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),g(_))}function g(_){return _===null||St(_)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),m(_)):gn(_)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),cn(t,x,"whitespace")(_)):_===96&&_===l?n(_):(t.consume(_),g)}function x(_){return _===null||St(_)?m(_):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),y(_))}function y(_){return _===null||St(_)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),m(_)):_===96&&_===l?n(_):(t.consume(_),y)}function w(_){return t.attempt(s,T,S)(_)}function S(_){return t.enter("lineEnding"),t.consume(_),t.exit("lineEnding"),k}function k(_){return i>0&&gn(_)?cn(t,j,"linePrefix",i+1)(_):j(_)}function j(_){return _===null||St(_)?t.check(qM,w,T)(_):(t.enter("codeFlowValue"),N(_))}function N(_){return _===null||St(_)?(t.exit("codeFlowValue"),j(_)):(t.consume(_),N)}function T(_){return t.exit("codeFenced"),e(_)}function E(_,A,D){let q=0;return B;function B(V){return _.enter("lineEnding"),_.consume(V),_.exit("lineEnding"),H}function H(V){return _.enter("codeFencedFence"),gn(V)?cn(_,W,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(V):W(V)}function W(V){return V===l?(_.enter("codeFencedFenceSequence"),ee(V)):D(V)}function ee(V){return V===l?(q++,_.consume(V),ee):q>=a?(_.exit("codeFencedFenceSequence"),gn(V)?cn(_,I,"whitespace")(V):I(V)):D(V)}function I(V){return V===null||St(V)?(_.exit("codeFencedFence"),A(V)):D(V)}}}function hbe(t,e,n){const r=this;return s;function s(a){return a===null?n(a):(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),i)}function i(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}const PS={name:"codeIndented",tokenize:mbe},fbe={partial:!0,tokenize:pbe};function mbe(t,e,n){const r=this;return s;function s(d){return t.enter("codeIndented"),cn(t,i,"linePrefix",5)(d)}function i(d){const h=r.events[r.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?a(d):n(d)}function a(d){return d===null?c(d):St(d)?t.attempt(fbe,a,c)(d):(t.enter("codeFlowValue"),l(d))}function l(d){return d===null||St(d)?(t.exit("codeFlowValue"),a(d)):(t.consume(d),l)}function c(d){return t.exit("codeIndented"),e(d)}}function pbe(t,e,n){const r=this;return s;function s(a){return r.parser.lazy[r.now().line]?n(a):St(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),s):cn(t,i,"linePrefix",5)(a)}function i(a){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?e(a):St(a)?s(a):n(a)}}const gbe={name:"codeText",previous:vbe,resolve:xbe,tokenize:ybe};function xbe(t){let e=t.length-4,n=3,r,s;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r<e;)if(t[r][1].type==="codeTextData"){t[n][1].type="codeTextPadding",t[e][1].type="codeTextPadding",n+=2,e-=2;break}}for(r=n-1,e++;++r<=e;)s===void 0?r!==e&&t[r][1].type!=="lineEnding"&&(s=r):(r===e||t[r][1].type==="lineEnding")&&(t[s][1].type="codeTextData",r!==s+2&&(t[s][1].end=t[r-1][1].end,t.splice(s+2,r-s-2),e-=r-s-2,r=s+2),s=void 0);return t}function vbe(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function ybe(t,e,n){let r=0,s,i;return a;function a(m){return t.enter("codeText"),t.enter("codeTextSequence"),l(m)}function l(m){return m===96?(t.consume(m),r++,l):(t.exit("codeTextSequence"),c(m))}function c(m){return m===null?n(m):m===32?(t.enter("space"),t.consume(m),t.exit("space"),c):m===96?(i=t.enter("codeTextSequence"),s=0,h(m)):St(m)?(t.enter("lineEnding"),t.consume(m),t.exit("lineEnding"),c):(t.enter("codeTextData"),d(m))}function d(m){return m===null||m===32||m===96||St(m)?(t.exit("codeTextData"),c(m)):(t.consume(m),d)}function h(m){return m===96?(t.consume(m),s++,h):s===r?(t.exit("codeTextSequence"),t.exit("codeText"),e(m)):(i.type="codeTextData",d(m))}}class bbe{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(e,r):e>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,n,r){const s=n||0;this.setCursor(Math.trunc(e));const i=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&Jm(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),Jm(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Jm(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const n=this.left.splice(e,Number.POSITIVE_INFINITY);Jm(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Jm(this.left,n.reverse())}}}function Jm(t,e){let n=0;if(e.length<1e4)t.push(...e);else for(;n<e.length;)t.push(...e.slice(n,n+1e4)),n+=1e4}function hV(t){const e={};let n=-1,r,s,i,a,l,c,d;const h=new bbe(t);for(;++n<h.length;){for(;n in e;)n=e[n];if(r=h.get(n),n&&r[1].type==="chunkFlow"&&h.get(n-1)[1].type==="listItemPrefix"&&(c=r[1]._tokenizer.events,i=0,i<c.length&&c[i][1].type==="lineEndingBlank"&&(i+=2),i<c.length&&c[i][1].type==="content"))for(;++i<c.length&&c[i][1].type!=="content";)c[i][1].type==="chunkText"&&(c[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(e,wbe(h,n)),n=e[n],d=!0);else if(r[1]._container){for(i=n,s=void 0;i--;)if(a=h.get(i),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(s&&(h.get(s)[1].type="lineEndingBlank"),a[1].type="lineEnding",s=i);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;s&&(r[1].end={...h.get(s)[1].start},l=h.slice(s,n),l.unshift(r),h.splice(s,n-s+1,l))}}return Ki(t,0,Number.POSITIVE_INFINITY,h.slice(0)),!d}function wbe(t,e){const n=t.get(e)[1],r=t.get(e)[2];let s=e-1;const i=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const l=a.events,c=[],d={};let h,m,g=-1,x=n,y=0,w=0;const S=[w];for(;x;){for(;t.get(++s)[1]!==x;);i.push(s),x._tokenizer||(h=r.sliceStream(x),x.next||h.push(null),m&&a.defineSkip(x.start),x._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(h),x._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),m=x,x=x.next}for(x=n;++g<l.length;)l[g][0]==="exit"&&l[g-1][0]==="enter"&&l[g][1].type===l[g-1][1].type&&l[g][1].start.line!==l[g][1].end.line&&(w=g+1,S.push(w),x._tokenizer=void 0,x.previous=void 0,x=x.next);for(a.events=[],x?(x._tokenizer=void 0,x.previous=void 0):S.pop(),g=S.length;g--;){const k=l.slice(S[g],S[g+1]),j=i.pop();c.push([j,j+k.length-1]),t.splice(j,2,k)}for(c.reverse(),g=-1;++g<c.length;)d[y+c[g][0]]=y+c[g][1],y+=c[g][1]-c[g][0]-1;return d}const Sbe={resolve:Obe,tokenize:jbe},kbe={partial:!0,tokenize:Nbe};function Obe(t){return hV(t),t}function jbe(t,e){let n;return r;function r(l){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),s(l)}function s(l){return l===null?i(l):St(l)?t.check(kbe,a,i)(l):(t.consume(l),s)}function i(l){return t.exit("chunkContent"),t.exit("content"),e(l)}function a(l){return t.consume(l),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function Nbe(t,e,n){const r=this;return s;function s(a){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),cn(t,i,"linePrefix")}function i(a){if(a===null||St(a))return n(a);const l=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?e(a):t.interrupt(r.parser.constructs.flow,n,e)(a)}}function fV(t,e,n,r,s,i,a,l,c){const d=c||Number.POSITIVE_INFINITY;let h=0;return m;function m(k){return k===60?(t.enter(r),t.enter(s),t.enter(i),t.consume(k),t.exit(i),g):k===null||k===32||k===41||ky(k)?n(k):(t.enter(r),t.enter(a),t.enter(l),t.enter("chunkString",{contentType:"string"}),w(k))}function g(k){return k===62?(t.enter(i),t.consume(k),t.exit(i),t.exit(s),t.exit(r),e):(t.enter(l),t.enter("chunkString",{contentType:"string"}),x(k))}function x(k){return k===62?(t.exit("chunkString"),t.exit(l),g(k)):k===null||k===60||St(k)?n(k):(t.consume(k),k===92?y:x)}function y(k){return k===60||k===62||k===92?(t.consume(k),x):x(k)}function w(k){return!h&&(k===null||k===41||dr(k))?(t.exit("chunkString"),t.exit(l),t.exit(a),t.exit(r),e(k)):h<d&&k===40?(t.consume(k),h++,w):k===41?(t.consume(k),h--,w):k===null||k===32||k===40||ky(k)?n(k):(t.consume(k),k===92?S:w)}function S(k){return k===40||k===41||k===92?(t.consume(k),w):w(k)}}function mV(t,e,n,r,s,i){const a=this;let l=0,c;return d;function d(x){return t.enter(r),t.enter(s),t.consume(x),t.exit(s),t.enter(i),h}function h(x){return l>999||x===null||x===91||x===93&&!c||x===94&&!l&&"_hiddenFootnoteSupport"in a.parser.constructs?n(x):x===93?(t.exit(i),t.enter(s),t.consume(x),t.exit(s),t.exit(r),e):St(x)?(t.enter("lineEnding"),t.consume(x),t.exit("lineEnding"),h):(t.enter("chunkString",{contentType:"string"}),m(x))}function m(x){return x===null||x===91||x===93||St(x)||l++>999?(t.exit("chunkString"),h(x)):(t.consume(x),c||(c=!gn(x)),x===92?g:m)}function g(x){return x===91||x===92||x===93?(t.consume(x),l++,m):m(x)}}function pV(t,e,n,r,s,i){let a;return l;function l(g){return g===34||g===39||g===40?(t.enter(r),t.enter(s),t.consume(g),t.exit(s),a=g===40?41:g,c):n(g)}function c(g){return g===a?(t.enter(s),t.consume(g),t.exit(s),t.exit(r),e):(t.enter(i),d(g))}function d(g){return g===a?(t.exit(i),c(a)):g===null?n(g):St(g)?(t.enter("lineEnding"),t.consume(g),t.exit("lineEnding"),cn(t,d,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),h(g))}function h(g){return g===a||g===null||St(g)?(t.exit("chunkString"),d(g)):(t.consume(g),g===92?m:h)}function m(g){return g===a||g===92?(t.consume(g),h):h(g)}}function D0(t,e){let n;return r;function r(s){return St(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),n=!0,r):gn(s)?cn(t,r,n?"linePrefix":"lineSuffix")(s):e(s)}}const Cbe={name:"definition",tokenize:Ebe},Tbe={partial:!0,tokenize:_be};function Ebe(t,e,n){const r=this;let s;return i;function i(x){return t.enter("definition"),a(x)}function a(x){return mV.call(r,t,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function l(x){return s=Xa(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),x===58?(t.enter("definitionMarker"),t.consume(x),t.exit("definitionMarker"),c):n(x)}function c(x){return dr(x)?D0(t,d)(x):d(x)}function d(x){return fV(t,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function h(x){return t.attempt(Tbe,m,m)(x)}function m(x){return gn(x)?cn(t,g,"whitespace")(x):g(x)}function g(x){return x===null||St(x)?(t.exit("definition"),r.parser.defined.push(s),e(x)):n(x)}}function _be(t,e,n){return r;function r(l){return dr(l)?D0(t,s)(l):n(l)}function s(l){return pV(t,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function i(l){return gn(l)?cn(t,a,"whitespace")(l):a(l)}function a(l){return l===null||St(l)?e(l):n(l)}}const Abe={name:"hardBreakEscape",tokenize:Mbe};function Mbe(t,e,n){return r;function r(i){return t.enter("hardBreakEscape"),t.consume(i),s}function s(i){return St(i)?(t.exit("hardBreakEscape"),e(i)):n(i)}}const Rbe={name:"headingAtx",resolve:Dbe,tokenize:Pbe};function Dbe(t,e){let n=t.length-2,r=3,s,i;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(s={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},i={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},Ki(t,r,n-r+1,[["enter",s,e],["enter",i,e],["exit",i,e],["exit",s,e]])),t}function Pbe(t,e,n){let r=0;return s;function s(h){return t.enter("atxHeading"),i(h)}function i(h){return t.enter("atxHeadingSequence"),a(h)}function a(h){return h===35&&r++<6?(t.consume(h),a):h===null||dr(h)?(t.exit("atxHeadingSequence"),l(h)):n(h)}function l(h){return h===35?(t.enter("atxHeadingSequence"),c(h)):h===null||St(h)?(t.exit("atxHeading"),e(h)):gn(h)?cn(t,l,"whitespace")(h):(t.enter("atxHeadingText"),d(h))}function c(h){return h===35?(t.consume(h),c):(t.exit("atxHeadingSequence"),l(h))}function d(h){return h===null||h===35||dr(h)?(t.exit("atxHeadingText"),l(h)):(t.consume(h),d)}}const zbe=["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"],HM=["pre","script","style","textarea"],Ibe={concrete:!0,name:"htmlFlow",resolveTo:Fbe,tokenize:qbe},Lbe={partial:!0,tokenize:Hbe},Bbe={partial:!0,tokenize:$be};function Fbe(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function qbe(t,e,n){const r=this;let s,i,a,l,c;return d;function d(z){return h(z)}function h(z){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(z),m}function m(z){return z===33?(t.consume(z),g):z===47?(t.consume(z),i=!0,w):z===63?(t.consume(z),s=3,r.interrupt?e:R):ei(z)?(t.consume(z),a=String.fromCharCode(z),S):n(z)}function g(z){return z===45?(t.consume(z),s=2,x):z===91?(t.consume(z),s=5,l=0,y):ei(z)?(t.consume(z),s=4,r.interrupt?e:R):n(z)}function x(z){return z===45?(t.consume(z),r.interrupt?e:R):n(z)}function y(z){const U="CDATA[";return z===U.charCodeAt(l++)?(t.consume(z),l===U.length?r.interrupt?e:W:y):n(z)}function w(z){return ei(z)?(t.consume(z),a=String.fromCharCode(z),S):n(z)}function S(z){if(z===null||z===47||z===62||dr(z)){const U=z===47,te=a.toLowerCase();return!U&&!i&&HM.includes(te)?(s=1,r.interrupt?e(z):W(z)):zbe.includes(a.toLowerCase())?(s=6,U?(t.consume(z),k):r.interrupt?e(z):W(z)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(z):i?j(z):N(z))}return z===45||Vs(z)?(t.consume(z),a+=String.fromCharCode(z),S):n(z)}function k(z){return z===62?(t.consume(z),r.interrupt?e:W):n(z)}function j(z){return gn(z)?(t.consume(z),j):B(z)}function N(z){return z===47?(t.consume(z),B):z===58||z===95||ei(z)?(t.consume(z),T):gn(z)?(t.consume(z),N):B(z)}function T(z){return z===45||z===46||z===58||z===95||Vs(z)?(t.consume(z),T):E(z)}function E(z){return z===61?(t.consume(z),_):gn(z)?(t.consume(z),E):N(z)}function _(z){return z===null||z===60||z===61||z===62||z===96?n(z):z===34||z===39?(t.consume(z),c=z,A):gn(z)?(t.consume(z),_):D(z)}function A(z){return z===c?(t.consume(z),c=null,q):z===null||St(z)?n(z):(t.consume(z),A)}function D(z){return z===null||z===34||z===39||z===47||z===60||z===61||z===62||z===96||dr(z)?E(z):(t.consume(z),D)}function q(z){return z===47||z===62||gn(z)?N(z):n(z)}function B(z){return z===62?(t.consume(z),H):n(z)}function H(z){return z===null||St(z)?W(z):gn(z)?(t.consume(z),H):n(z)}function W(z){return z===45&&s===2?(t.consume(z),L):z===60&&s===1?(t.consume(z),$):z===62&&s===4?(t.consume(z),ie):z===63&&s===3?(t.consume(z),R):z===93&&s===5?(t.consume(z),Y):St(z)&&(s===6||s===7)?(t.exit("htmlFlowData"),t.check(Lbe,X,ee)(z)):z===null||St(z)?(t.exit("htmlFlowData"),ee(z)):(t.consume(z),W)}function ee(z){return t.check(Bbe,I,X)(z)}function I(z){return t.enter("lineEnding"),t.consume(z),t.exit("lineEnding"),V}function V(z){return z===null||St(z)?ee(z):(t.enter("htmlFlowData"),W(z))}function L(z){return z===45?(t.consume(z),R):W(z)}function $(z){return z===47?(t.consume(z),a="",K):W(z)}function K(z){if(z===62){const U=a.toLowerCase();return HM.includes(U)?(t.consume(z),ie):W(z)}return ei(z)&&a.length<8?(t.consume(z),a+=String.fromCharCode(z),K):W(z)}function Y(z){return z===93?(t.consume(z),R):W(z)}function R(z){return z===62?(t.consume(z),ie):z===45&&s===2?(t.consume(z),R):W(z)}function ie(z){return z===null||St(z)?(t.exit("htmlFlowData"),X(z)):(t.consume(z),ie)}function X(z){return t.exit("htmlFlow"),e(z)}}function $be(t,e,n){const r=this;return s;function s(a){return St(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),i):n(a)}function i(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}function Hbe(t,e,n){return r;function r(s){return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),t.attempt(gg,e,n)}}const Qbe={name:"htmlText",tokenize:Vbe};function Vbe(t,e,n){const r=this;let s,i,a;return l;function l(R){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(R),c}function c(R){return R===33?(t.consume(R),d):R===47?(t.consume(R),E):R===63?(t.consume(R),N):ei(R)?(t.consume(R),D):n(R)}function d(R){return R===45?(t.consume(R),h):R===91?(t.consume(R),i=0,y):ei(R)?(t.consume(R),j):n(R)}function h(R){return R===45?(t.consume(R),x):n(R)}function m(R){return R===null?n(R):R===45?(t.consume(R),g):St(R)?(a=m,$(R)):(t.consume(R),m)}function g(R){return R===45?(t.consume(R),x):m(R)}function x(R){return R===62?L(R):R===45?g(R):m(R)}function y(R){const ie="CDATA[";return R===ie.charCodeAt(i++)?(t.consume(R),i===ie.length?w:y):n(R)}function w(R){return R===null?n(R):R===93?(t.consume(R),S):St(R)?(a=w,$(R)):(t.consume(R),w)}function S(R){return R===93?(t.consume(R),k):w(R)}function k(R){return R===62?L(R):R===93?(t.consume(R),k):w(R)}function j(R){return R===null||R===62?L(R):St(R)?(a=j,$(R)):(t.consume(R),j)}function N(R){return R===null?n(R):R===63?(t.consume(R),T):St(R)?(a=N,$(R)):(t.consume(R),N)}function T(R){return R===62?L(R):N(R)}function E(R){return ei(R)?(t.consume(R),_):n(R)}function _(R){return R===45||Vs(R)?(t.consume(R),_):A(R)}function A(R){return St(R)?(a=A,$(R)):gn(R)?(t.consume(R),A):L(R)}function D(R){return R===45||Vs(R)?(t.consume(R),D):R===47||R===62||dr(R)?q(R):n(R)}function q(R){return R===47?(t.consume(R),L):R===58||R===95||ei(R)?(t.consume(R),B):St(R)?(a=q,$(R)):gn(R)?(t.consume(R),q):L(R)}function B(R){return R===45||R===46||R===58||R===95||Vs(R)?(t.consume(R),B):H(R)}function H(R){return R===61?(t.consume(R),W):St(R)?(a=H,$(R)):gn(R)?(t.consume(R),H):q(R)}function W(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(t.consume(R),s=R,ee):St(R)?(a=W,$(R)):gn(R)?(t.consume(R),W):(t.consume(R),I)}function ee(R){return R===s?(t.consume(R),s=void 0,V):R===null?n(R):St(R)?(a=ee,$(R)):(t.consume(R),ee)}function I(R){return R===null||R===34||R===39||R===60||R===61||R===96?n(R):R===47||R===62||dr(R)?q(R):(t.consume(R),I)}function V(R){return R===47||R===62||dr(R)?q(R):n(R)}function L(R){return R===62?(t.consume(R),t.exit("htmlTextData"),t.exit("htmlText"),e):n(R)}function $(R){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(R),t.exit("lineEnding"),K}function K(R){return gn(R)?cn(t,Y,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):Y(R)}function Y(R){return t.enter("htmlTextData"),a(R)}}const yN={name:"labelEnd",resolveAll:Xbe,resolveTo:Ybe,tokenize:Kbe},Ube={tokenize:Zbe},Wbe={tokenize:Jbe},Gbe={tokenize:ewe};function Xbe(t){let e=-1;const n=[];for(;++e<t.length;){const r=t[e][1];if(n.push(t[e]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const s=r.type==="labelImage"?4:2;r.type="data",e+=s}}return t.length!==n.length&&Ki(t,0,t.length,n),t}function Ybe(t,e){let n=t.length,r=0,s,i,a,l;for(;n--;)if(s=t[n][1],i){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;t[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(a){if(t[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(i=n,s.type!=="labelLink")){r=2;break}}else s.type==="labelEnd"&&(a=n);const c={type:t[i][1].type==="labelLink"?"link":"image",start:{...t[i][1].start},end:{...t[t.length-1][1].end}},d={type:"label",start:{...t[i][1].start},end:{...t[a][1].end}},h={type:"labelText",start:{...t[i+r+2][1].end},end:{...t[a-2][1].start}};return l=[["enter",c,e],["enter",d,e]],l=xa(l,t.slice(i+1,i+r+3)),l=xa(l,[["enter",h,e]]),l=xa(l,$b(e.parser.constructs.insideSpan.null,t.slice(i+r+4,a-3),e)),l=xa(l,[["exit",h,e],t[a-2],t[a-1],["exit",d,e]]),l=xa(l,t.slice(a+1)),l=xa(l,[["exit",c,e]]),Ki(t,i,t.length,l),t}function Kbe(t,e,n){const r=this;let s=r.events.length,i,a;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){i=r.events[s][1];break}return l;function l(g){return i?i._inactive?m(g):(a=r.parser.defined.includes(Xa(r.sliceSerialize({start:i.end,end:r.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(g),t.exit("labelMarker"),t.exit("labelEnd"),c):n(g)}function c(g){return g===40?t.attempt(Ube,h,a?h:m)(g):g===91?t.attempt(Wbe,h,a?d:m)(g):a?h(g):m(g)}function d(g){return t.attempt(Gbe,h,m)(g)}function h(g){return e(g)}function m(g){return i._balanced=!0,n(g)}}function Zbe(t,e,n){return r;function r(m){return t.enter("resource"),t.enter("resourceMarker"),t.consume(m),t.exit("resourceMarker"),s}function s(m){return dr(m)?D0(t,i)(m):i(m)}function i(m){return m===41?h(m):fV(t,a,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function a(m){return dr(m)?D0(t,c)(m):h(m)}function l(m){return n(m)}function c(m){return m===34||m===39||m===40?pV(t,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):h(m)}function d(m){return dr(m)?D0(t,h)(m):h(m)}function h(m){return m===41?(t.enter("resourceMarker"),t.consume(m),t.exit("resourceMarker"),t.exit("resource"),e):n(m)}}function Jbe(t,e,n){const r=this;return s;function s(l){return mV.call(r,t,i,a,"reference","referenceMarker","referenceString")(l)}function i(l){return r.parser.defined.includes(Xa(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?e(l):n(l)}function a(l){return n(l)}}function ewe(t,e,n){return r;function r(i){return t.enter("reference"),t.enter("referenceMarker"),t.consume(i),t.exit("referenceMarker"),s}function s(i){return i===93?(t.enter("referenceMarker"),t.consume(i),t.exit("referenceMarker"),t.exit("reference"),e):n(i)}}const twe={name:"labelStartImage",resolveAll:yN.resolveAll,tokenize:nwe};function nwe(t,e,n){const r=this;return s;function s(l){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(l),t.exit("labelImageMarker"),i}function i(l){return l===91?(t.enter("labelMarker"),t.consume(l),t.exit("labelMarker"),t.exit("labelImage"),a):n(l)}function a(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):e(l)}}const rwe={name:"labelStartLink",resolveAll:yN.resolveAll,tokenize:swe};function swe(t,e,n){const r=this;return s;function s(a){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(a),t.exit("labelMarker"),t.exit("labelLink"),i}function i(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):e(a)}}const zS={name:"lineEnding",tokenize:iwe};function iwe(t,e){return n;function n(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),cn(t,e,"linePrefix")}}const Cv={name:"thematicBreak",tokenize:awe};function awe(t,e,n){let r=0,s;return i;function i(d){return t.enter("thematicBreak"),a(d)}function a(d){return s=d,l(d)}function l(d){return d===s?(t.enter("thematicBreakSequence"),c(d)):r>=3&&(d===null||St(d))?(t.exit("thematicBreak"),e(d)):n(d)}function c(d){return d===s?(t.consume(d),r++,c):(t.exit("thematicBreakSequence"),gn(d)?cn(t,l,"whitespace")(d):l(d))}}const pi={continuation:{tokenize:uwe},exit:hwe,name:"list",tokenize:cwe},owe={partial:!0,tokenize:fwe},lwe={partial:!0,tokenize:dwe};function cwe(t,e,n){const r=this,s=r.events[r.events.length-1];let i=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,a=0;return l;function l(x){const y=r.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(y==="listUnordered"?!r.containerState.marker||x===r.containerState.marker:DO(x)){if(r.containerState.type||(r.containerState.type=y,t.enter(y,{_container:!0})),y==="listUnordered")return t.enter("listItemPrefix"),x===42||x===45?t.check(Cv,n,d)(x):d(x);if(!r.interrupt||x===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),c(x)}return n(x)}function c(x){return DO(x)&&++a<10?(t.consume(x),c):(!r.interrupt||a<2)&&(r.containerState.marker?x===r.containerState.marker:x===41||x===46)?(t.exit("listItemValue"),d(x)):n(x)}function d(x){return t.enter("listItemMarker"),t.consume(x),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||x,t.check(gg,r.interrupt?n:h,t.attempt(owe,g,m))}function h(x){return r.containerState.initialBlankLine=!0,i++,g(x)}function m(x){return gn(x)?(t.enter("listItemPrefixWhitespace"),t.consume(x),t.exit("listItemPrefixWhitespace"),g):n(x)}function g(x){return r.containerState.size=i+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(x)}}function uwe(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(gg,s,i);function s(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,cn(t,e,"listItemIndent",r.containerState.size+1)(l)}function i(l){return r.containerState.furtherBlankLines||!gn(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(lwe,e,a)(l))}function a(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,cn(t,t.attempt(pi,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function dwe(t,e,n){const r=this;return cn(t,s,"listItemIndent",r.containerState.size+1);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?e(i):n(i)}}function hwe(t){t.exit(this.containerState.type)}function fwe(t,e,n){const r=this;return cn(t,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(i){const a=r.events[r.events.length-1];return!gn(i)&&a&&a[1].type==="listItemPrefixWhitespace"?e(i):n(i)}}const QM={name:"setextUnderline",resolveTo:mwe,tokenize:pwe};function mwe(t,e){let n=t.length,r,s,i;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(s=n)}else t[n][1].type==="content"&&t.splice(n,1),!i&&t[n][1].type==="definition"&&(i=n);const a={type:"setextHeading",start:{...t[r][1].start},end:{...t[t.length-1][1].end}};return t[s][1].type="setextHeadingText",i?(t.splice(s,0,["enter",a,e]),t.splice(i+1,0,["exit",t[r][1],e]),t[r][1].end={...t[i][1].end}):t[r][1]=a,t.push(["exit",a,e]),t}function pwe(t,e,n){const r=this;let s;return i;function i(d){let h=r.events.length,m;for(;h--;)if(r.events[h][1].type!=="lineEnding"&&r.events[h][1].type!=="linePrefix"&&r.events[h][1].type!=="content"){m=r.events[h][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(t.enter("setextHeadingLine"),s=d,a(d)):n(d)}function a(d){return t.enter("setextHeadingLineSequence"),l(d)}function l(d){return d===s?(t.consume(d),l):(t.exit("setextHeadingLineSequence"),gn(d)?cn(t,c,"lineSuffix")(d):c(d))}function c(d){return d===null||St(d)?(t.exit("setextHeadingLine"),e(d)):n(d)}}const gwe={tokenize:xwe};function xwe(t){const e=this,n=t.attempt(gg,r,t.attempt(this.parser.constructs.flowInitial,s,cn(t,t.attempt(this.parser.constructs.flow,s,t.attempt(Sbe,s)),"linePrefix")));return n;function r(i){if(i===null){t.consume(i);return}return t.enter("lineEndingBlank"),t.consume(i),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function s(i){if(i===null){t.consume(i);return}return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const vwe={resolveAll:xV()},ywe=gV("string"),bwe=gV("text");function gV(t){return{resolveAll:xV(t==="text"?wwe:void 0),tokenize:e};function e(n){const r=this,s=this.parser.constructs[t],i=n.attempt(s,a,l);return a;function a(h){return d(h)?i(h):l(h)}function l(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),c}function c(h){return d(h)?(n.exit("data"),i(h)):(n.consume(h),c)}function d(h){if(h===null)return!0;const m=s[h];let g=-1;if(m)for(;++g<m.length;){const x=m[g];if(!x.previous||x.previous.call(r,r.previous))return!0}return!1}}}function xV(t){return e;function e(n,r){let s=-1,i;for(;++s<=n.length;)i===void 0?n[s]&&n[s][1].type==="data"&&(i=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==i+2&&(n[i][1].end=n[s-1][1].end,n.splice(i+2,s-i-2),s=i+2),i=void 0);return t?t(n,r):n}}function wwe(t,e){let n=0;for(;++n<=t.length;)if((n===t.length||t[n][1].type==="lineEnding")&&t[n-1][1].type==="data"){const r=t[n-1][1],s=e.sliceStream(r);let i=s.length,a=-1,l=0,c;for(;i--;){const d=s[i];if(typeof d=="string"){for(a=d.length;d.charCodeAt(a-1)===32;)l++,a--;if(a)break;a=-1}else if(d===-2)c=!0,l++;else if(d!==-1){i++;break}}if(e._contentTypeTextTrailing&&n===t.length&&(l=0),l){const d={type:n===t.length||c||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?a:r.start._bufferIndex+a,_index:r.start._index+i,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},end:{...r.end}};r.end={...d.start},r.start.offset===r.end.offset?Object.assign(r,d):(t.splice(n,0,["enter",d,e],["exit",d,e]),n+=2)}n++}return t}const Swe={42:pi,43:pi,45:pi,48:pi,49:pi,50:pi,51:pi,52:pi,53:pi,54:pi,55:pi,56:pi,57:pi,62:cV},kwe={91:Cbe},Owe={[-2]:PS,[-1]:PS,32:PS},jwe={35:Rbe,42:Cv,45:[QM,Cv],60:Ibe,61:QM,95:Cv,96:$M,126:$M},Nwe={38:dV,92:uV},Cwe={[-5]:zS,[-4]:zS,[-3]:zS,33:twe,38:dV,42:PO,60:[rbe,Qbe],91:rwe,92:[Abe,uV],93:yN,95:PO,96:gbe},Twe={null:[PO,vwe]},Ewe={null:[42,95]},_we={null:[]},Awe=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Ewe,contentInitial:kwe,disable:_we,document:Swe,flow:jwe,flowInitial:Owe,insideSpan:Twe,string:Nwe,text:Cwe},Symbol.toStringTag,{value:"Module"}));function Mwe(t,e,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const s={},i=[];let a=[],l=[];const c={attempt:A(E),check:A(_),consume:j,enter:N,exit:T,interrupt:A(_,{interrupt:!0})},d={code:null,containerState:{},defineSkip:w,events:[],now:y,parser:t,previous:null,sliceSerialize:g,sliceStream:x,write:m};let h=e.tokenize.call(d,c);return e.resolveAll&&i.push(e),d;function m(H){return a=xa(a,H),S(),a[a.length-1]!==null?[]:(D(e,0),d.events=$b(i,d.events,d),d.events)}function g(H,W){return Dwe(x(H),W)}function x(H){return Rwe(a,H)}function y(){const{_bufferIndex:H,_index:W,line:ee,column:I,offset:V}=r;return{_bufferIndex:H,_index:W,line:ee,column:I,offset:V}}function w(H){s[H.line]=H.column,B()}function S(){let H;for(;r._index<a.length;){const W=a[r._index];if(typeof W=="string")for(H=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===H&&r._bufferIndex<W.length;)k(W.charCodeAt(r._bufferIndex));else k(W)}}function k(H){h=h(H)}function j(H){St(H)?(r.line++,r.column=1,r.offset+=H===-3?2:1,B()):H!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=H}function N(H,W){const ee=W||{};return ee.type=H,ee.start=y(),d.events.push(["enter",ee,d]),l.push(ee),ee}function T(H){const W=l.pop();return W.end=y(),d.events.push(["exit",W,d]),W}function E(H,W){D(H,W.from)}function _(H,W){W.restore()}function A(H,W){return ee;function ee(I,V,L){let $,K,Y,R;return Array.isArray(I)?X(I):"tokenize"in I?X([I]):ie(I);function ie(ne){return G;function G(se){const re=se!==null&&ne[se],ae=se!==null&&ne.null,_e=[...Array.isArray(re)?re:re?[re]:[],...Array.isArray(ae)?ae:ae?[ae]:[]];return X(_e)(se)}}function X(ne){return $=ne,K=0,ne.length===0?L:z(ne[K])}function z(ne){return G;function G(se){return R=q(),Y=ne,ne.partial||(d.currentConstruct=ne),ne.name&&d.parser.constructs.disable.null.includes(ne.name)?te():ne.tokenize.call(W?Object.assign(Object.create(d),W):d,c,U,te)(se)}}function U(ne){return H(Y,R),V}function te(ne){return R.restore(),++K<$.length?z($[K]):L}}}function D(H,W){H.resolveAll&&!i.includes(H)&&i.push(H),H.resolve&&Ki(d.events,W,d.events.length-W,H.resolve(d.events.slice(W),d)),H.resolveTo&&(d.events=H.resolveTo(d.events,d))}function q(){const H=y(),W=d.previous,ee=d.currentConstruct,I=d.events.length,V=Array.from(l);return{from:I,restore:L};function L(){r=H,d.previous=W,d.currentConstruct=ee,d.events.length=I,l=V,B()}}function B(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function Rwe(t,e){const n=e.start._index,r=e.start._bufferIndex,s=e.end._index,i=e.end._bufferIndex;let a;if(n===s)a=[t[n].slice(r,i)];else{if(a=t.slice(n,s),r>-1){const l=a[0];typeof l=="string"?a[0]=l.slice(r):a.shift()}i>0&&a.push(t[s].slice(0,i))}return a}function Dwe(t,e){let n=-1;const r=[];let s;for(;++n<t.length;){const i=t[n];let a;if(typeof i=="string")a=i;else switch(i){case-5:{a="\r";break}case-4:{a=`
|
||
`;break}case-3:{a=`\r
|
||
`;break}case-2:{a=e?" ":" ";break}case-1:{if(!e&&s)continue;a=" ";break}default:a=String.fromCharCode(i)}s=i===-2,r.push(a)}return r.join("")}function Pwe(t){const r={constructs:oV([Awe,...(t||{}).extensions||[]]),content:s(Yye),defined:[],document:s(Zye),flow:s(gwe),lazy:{},string:s(ywe),text:s(bwe)};return r;function s(i){return a;function a(l){return Mwe(r,i,l)}}}function zwe(t){for(;!hV(t););return t}const VM=/[\0\t\n\r]/g;function Iwe(){let t=1,e="",n=!0,r;return s;function s(i,a,l){const c=[];let d,h,m,g,x;for(i=e+(typeof i=="string"?i.toString():new TextDecoder(a||void 0).decode(i)),m=0,e="",n&&(i.charCodeAt(0)===65279&&m++,n=void 0);m<i.length;){if(VM.lastIndex=m,d=VM.exec(i),g=d&&d.index!==void 0?d.index:i.length,x=i.charCodeAt(g),!d){e=i.slice(m);break}if(x===10&&m===g&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),m<g&&(c.push(i.slice(m,g)),t+=g-m),x){case 0:{c.push(65533),t++;break}case 9:{for(h=Math.ceil(t/4)*4,c.push(-2);t++<h;)c.push(-1);break}case 10:{c.push(-4),t=1;break}default:r=!0,t=1}m=g+1}return l&&(r&&c.push(-5),e&&c.push(e),c.push(null)),c}}const Lwe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Bwe(t){return t.replace(Lwe,Fwe)}function Fwe(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),i=s===120||s===88;return lV(n.slice(i?2:1),i?16:10)}return vN(n)||t}const vV={}.hasOwnProperty;function qwe(t,e,n){return typeof e!="string"&&(n=e,e=void 0),$we(n)(zwe(Pwe(n).document().write(Iwe()(t,e,!0))))}function $we(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(jt),autolinkProtocol:q,autolinkEmail:q,atxHeading:i(Oe),blockQuote:i(ae),characterEscape:q,characterReference:q,codeFenced:i(_e),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:i(_e,a),codeText:i(Be,a),codeTextData:q,data:q,codeFlowValue:q,definition:i(Ye),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:i(Je),hardBreakEscape:i(Ve),hardBreakTrailing:i(Ve),htmlFlow:i(Ue,a),htmlFlowData:q,htmlText:i(Ue,a),htmlTextData:q,image:i($e),label:a,link:i(jt),listItem:i($n),listItemValue:g,listOrdered:i(vt,m),listUnordered:i(vt),paragraph:i(qt),reference:z,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:i(Oe),strong:i(un),thematicBreak:i(ct)},exit:{atxHeading:c(),atxHeadingSequence:E,autolink:c(),autolinkEmail:re,autolinkProtocol:se,blockQuote:c(),characterEscapeValue:B,characterReferenceMarkerHexadecimal:te,characterReferenceMarkerNumeric:te,characterReferenceValue:ne,characterReference:G,codeFenced:c(S),codeFencedFence:w,codeFencedFenceInfo:x,codeFencedFenceMeta:y,codeFlowValue:B,codeIndented:c(k),codeText:c(V),codeTextData:B,data:B,definition:c(),definitionDestinationString:T,definitionLabelString:j,definitionTitleString:N,emphasis:c(),hardBreakEscape:c(W),hardBreakTrailing:c(W),htmlFlow:c(ee),htmlFlowData:B,htmlText:c(I),htmlTextData:B,image:c($),label:Y,labelText:K,lineEnding:H,link:c(L),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:U,resourceDestinationString:R,resourceTitleString:ie,resource:X,setextHeading:c(D),setextHeadingLineSequence:A,setextHeadingText:_,strong:c(),thematicBreak:c()}};yV(e,(t||{}).mdastExtensions||[]);const n={};return r;function r(Ne){let ze={type:"root",children:[]};const rt={stack:[ze],tokenStack:[],config:e,enter:l,exit:d,buffer:a,resume:h,data:n},bt=[];let zt=-1;for(;++zt<Ne.length;)if(Ne[zt][1].type==="listOrdered"||Ne[zt][1].type==="listUnordered")if(Ne[zt][0]==="enter")bt.push(zt);else{const Rt=bt.pop();zt=s(Ne,Rt,zt)}for(zt=-1;++zt<Ne.length;){const Rt=e[Ne[zt][0]];vV.call(Rt,Ne[zt][1].type)&&Rt[Ne[zt][1].type].call(Object.assign({sliceSerialize:Ne[zt][2].sliceSerialize},rt),Ne[zt][1])}if(rt.tokenStack.length>0){const Rt=rt.tokenStack[rt.tokenStack.length-1];(Rt[1]||UM).call(rt,void 0,Rt[0])}for(ze.position={start:Ec(Ne.length>0?Ne[0][1].start:{line:1,column:1,offset:0}),end:Ec(Ne.length>0?Ne[Ne.length-2][1].end:{line:1,column:1,offset:0})},zt=-1;++zt<e.transforms.length;)ze=e.transforms[zt](ze)||ze;return ze}function s(Ne,ze,rt){let bt=ze-1,zt=-1,Rt=!1,Hn,We,ot,dn;for(;++bt<=rt;){const Pt=Ne[bt];switch(Pt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Pt[0]==="enter"?zt++:zt--,dn=void 0;break}case"lineEndingBlank":{Pt[0]==="enter"&&(Hn&&!dn&&!zt&&!ot&&(ot=bt),dn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:dn=void 0}if(!zt&&Pt[0]==="enter"&&Pt[1].type==="listItemPrefix"||zt===-1&&Pt[0]==="exit"&&(Pt[1].type==="listUnordered"||Pt[1].type==="listOrdered")){if(Hn){let xn=bt;for(We=void 0;xn--;){const dt=Ne[xn];if(dt[1].type==="lineEnding"||dt[1].type==="lineEndingBlank"){if(dt[0]==="exit")continue;We&&(Ne[We][1].type="lineEndingBlank",Rt=!0),dt[1].type="lineEnding",We=xn}else if(!(dt[1].type==="linePrefix"||dt[1].type==="blockQuotePrefix"||dt[1].type==="blockQuotePrefixWhitespace"||dt[1].type==="blockQuoteMarker"||dt[1].type==="listItemIndent"))break}ot&&(!We||ot<We)&&(Hn._spread=!0),Hn.end=Object.assign({},We?Ne[We][1].start:Pt[1].end),Ne.splice(We||bt,0,["exit",Hn,Pt[2]]),bt++,rt++}if(Pt[1].type==="listItemPrefix"){const xn={type:"listItem",_spread:!1,start:Object.assign({},Pt[1].start),end:void 0};Hn=xn,Ne.splice(bt,0,["enter",xn,Pt[2]]),bt++,rt++,ot=void 0,dn=!0}}}return Ne[ze][1]._spread=Rt,rt}function i(Ne,ze){return rt;function rt(bt){l.call(this,Ne(bt),bt),ze&&ze.call(this,bt)}}function a(){this.stack.push({type:"fragment",children:[]})}function l(Ne,ze,rt){this.stack[this.stack.length-1].children.push(Ne),this.stack.push(Ne),this.tokenStack.push([ze,rt||void 0]),Ne.position={start:Ec(ze.start),end:void 0}}function c(Ne){return ze;function ze(rt){Ne&&Ne.call(this,rt),d.call(this,rt)}}function d(Ne,ze){const rt=this.stack.pop(),bt=this.tokenStack.pop();if(bt)bt[0].type!==Ne.type&&(ze?ze.call(this,Ne,bt[0]):(bt[1]||UM).call(this,Ne,bt[0]));else throw new Error("Cannot close `"+Ne.type+"` ("+R0({start:Ne.start,end:Ne.end})+"): it’s not open");rt.position.end=Ec(Ne.end)}function h(){return xN(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function g(Ne){if(this.data.expectingFirstListItemValue){const ze=this.stack[this.stack.length-2];ze.start=Number.parseInt(this.sliceSerialize(Ne),10),this.data.expectingFirstListItemValue=void 0}}function x(){const Ne=this.resume(),ze=this.stack[this.stack.length-1];ze.lang=Ne}function y(){const Ne=this.resume(),ze=this.stack[this.stack.length-1];ze.meta=Ne}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const Ne=this.resume(),ze=this.stack[this.stack.length-1];ze.value=Ne.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function k(){const Ne=this.resume(),ze=this.stack[this.stack.length-1];ze.value=Ne.replace(/(\r?\n|\r)$/g,"")}function j(Ne){const ze=this.resume(),rt=this.stack[this.stack.length-1];rt.label=ze,rt.identifier=Xa(this.sliceSerialize(Ne)).toLowerCase()}function N(){const Ne=this.resume(),ze=this.stack[this.stack.length-1];ze.title=Ne}function T(){const Ne=this.resume(),ze=this.stack[this.stack.length-1];ze.url=Ne}function E(Ne){const ze=this.stack[this.stack.length-1];if(!ze.depth){const rt=this.sliceSerialize(Ne).length;ze.depth=rt}}function _(){this.data.setextHeadingSlurpLineEnding=!0}function A(Ne){const ze=this.stack[this.stack.length-1];ze.depth=this.sliceSerialize(Ne).codePointAt(0)===61?1:2}function D(){this.data.setextHeadingSlurpLineEnding=void 0}function q(Ne){const rt=this.stack[this.stack.length-1].children;let bt=rt[rt.length-1];(!bt||bt.type!=="text")&&(bt=Mt(),bt.position={start:Ec(Ne.start),end:void 0},rt.push(bt)),this.stack.push(bt)}function B(Ne){const ze=this.stack.pop();ze.value+=this.sliceSerialize(Ne),ze.position.end=Ec(Ne.end)}function H(Ne){const ze=this.stack[this.stack.length-1];if(this.data.atHardBreak){const rt=ze.children[ze.children.length-1];rt.position.end=Ec(Ne.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(ze.type)&&(q.call(this,Ne),B.call(this,Ne))}function W(){this.data.atHardBreak=!0}function ee(){const Ne=this.resume(),ze=this.stack[this.stack.length-1];ze.value=Ne}function I(){const Ne=this.resume(),ze=this.stack[this.stack.length-1];ze.value=Ne}function V(){const Ne=this.resume(),ze=this.stack[this.stack.length-1];ze.value=Ne}function L(){const Ne=this.stack[this.stack.length-1];if(this.data.inReference){const ze=this.data.referenceType||"shortcut";Ne.type+="Reference",Ne.referenceType=ze,delete Ne.url,delete Ne.title}else delete Ne.identifier,delete Ne.label;this.data.referenceType=void 0}function $(){const Ne=this.stack[this.stack.length-1];if(this.data.inReference){const ze=this.data.referenceType||"shortcut";Ne.type+="Reference",Ne.referenceType=ze,delete Ne.url,delete Ne.title}else delete Ne.identifier,delete Ne.label;this.data.referenceType=void 0}function K(Ne){const ze=this.sliceSerialize(Ne),rt=this.stack[this.stack.length-2];rt.label=Bwe(ze),rt.identifier=Xa(ze).toLowerCase()}function Y(){const Ne=this.stack[this.stack.length-1],ze=this.resume(),rt=this.stack[this.stack.length-1];if(this.data.inReference=!0,rt.type==="link"){const bt=Ne.children;rt.children=bt}else rt.alt=ze}function R(){const Ne=this.resume(),ze=this.stack[this.stack.length-1];ze.url=Ne}function ie(){const Ne=this.resume(),ze=this.stack[this.stack.length-1];ze.title=Ne}function X(){this.data.inReference=void 0}function z(){this.data.referenceType="collapsed"}function U(Ne){const ze=this.resume(),rt=this.stack[this.stack.length-1];rt.label=ze,rt.identifier=Xa(this.sliceSerialize(Ne)).toLowerCase(),this.data.referenceType="full"}function te(Ne){this.data.characterReferenceType=Ne.type}function ne(Ne){const ze=this.sliceSerialize(Ne),rt=this.data.characterReferenceType;let bt;rt?(bt=lV(ze,rt==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):bt=vN(ze);const zt=this.stack[this.stack.length-1];zt.value+=bt}function G(Ne){const ze=this.stack.pop();ze.position.end=Ec(Ne.end)}function se(Ne){B.call(this,Ne);const ze=this.stack[this.stack.length-1];ze.url=this.sliceSerialize(Ne)}function re(Ne){B.call(this,Ne);const ze=this.stack[this.stack.length-1];ze.url="mailto:"+this.sliceSerialize(Ne)}function ae(){return{type:"blockquote",children:[]}}function _e(){return{type:"code",lang:null,meta:null,value:""}}function Be(){return{type:"inlineCode",value:""}}function Ye(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Je(){return{type:"emphasis",children:[]}}function Oe(){return{type:"heading",depth:0,children:[]}}function Ve(){return{type:"break"}}function Ue(){return{type:"html",value:""}}function $e(){return{type:"image",title:null,url:"",alt:null}}function jt(){return{type:"link",title:null,url:"",children:[]}}function vt(Ne){return{type:"list",ordered:Ne.type==="listOrdered",start:null,spread:Ne._spread,children:[]}}function $n(Ne){return{type:"listItem",spread:Ne._spread,checked:null,children:[]}}function qt(){return{type:"paragraph",children:[]}}function un(){return{type:"strong",children:[]}}function Mt(){return{type:"text",value:""}}function ct(){return{type:"thematicBreak"}}}function Ec(t){return{line:t.line,column:t.column,offset:t.offset}}function yV(t,e){let n=-1;for(;++n<e.length;){const r=e[n];Array.isArray(r)?yV(t,r):Hwe(t,r)}}function Hwe(t,e){let n;for(n in e)if(vV.call(e,n))switch(n){case"canContainEols":{const r=e[n];r&&t[n].push(...r);break}case"transforms":{const r=e[n];r&&t[n].push(...r);break}case"enter":case"exit":{const r=e[n];r&&Object.assign(t[n],r);break}}}function UM(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+R0({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+R0({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+R0({start:e.start,end:e.end})+") is still open")}function Qwe(t){const e=this;e.parser=n;function n(r){return qwe(r,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function Vwe(t,e){const n={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,n),t.applyData(e,n)}function Uwe(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:`
|
||
`}]}function Wwe(t,e){const n=e.value?e.value+`
|
||
`:"",r={};e.lang&&(r.className=["language-"+e.lang]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return e.meta&&(s.data={meta:e.meta}),t.patch(e,s),s=t.applyData(e,s),s={type:"element",tagName:"pre",properties:{},children:[s]},t.patch(e,s),s}function Gwe(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Xwe(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Ywe(t,e){const n=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",r=String(e.identifier).toUpperCase(),s=qf(r.toLowerCase()),i=t.footnoteOrder.indexOf(r);let a,l=t.footnoteCounts.get(r);l===void 0?(l=0,t.footnoteOrder.push(r),a=t.footnoteOrder.length):a=i+1,l+=1,t.footnoteCounts.set(r,l);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};t.patch(e,c);const d={type:"element",tagName:"sup",properties:{},children:[c]};return t.patch(e,d),t.applyData(e,d)}function Kwe(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Zwe(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function bV(t,e){const n=e.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+r}];const s=t.all(e),i=s[0];i&&i.type==="text"?i.value="["+i.value:s.unshift({type:"text",value:"["});const a=s[s.length-1];return a&&a.type==="text"?a.value+=r:s.push({type:"text",value:r}),s}function Jwe(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return bV(t,e);const s={src:qf(r.url||""),alt:e.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"img",properties:s,children:[]};return t.patch(e,i),t.applyData(e,i)}function e2e(t,e){const n={src:qf(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,r),t.applyData(e,r)}function t2e(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,r),t.applyData(e,r)}function n2e(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return bV(t,e);const s={href:qf(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"a",properties:s,children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}function r2e(t,e){const n={href:qf(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function s2e(t,e,n){const r=t.all(e),s=n?i2e(n):wV(e),i={},a=[];if(typeof e.checked=="boolean"){const h=r[0];let m;h&&h.type==="element"&&h.tagName==="p"?m=h:(m={type:"element",tagName:"p",properties:{},children:[]},r.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let l=-1;for(;++l<r.length;){const h=r[l];(s||l!==0||h.type!=="element"||h.tagName!=="p")&&a.push({type:"text",value:`
|
||
`}),h.type==="element"&&h.tagName==="p"&&!s?a.push(...h.children):a.push(h)}const c=r[r.length-1];c&&(s||c.type!=="element"||c.tagName!=="p")&&a.push({type:"text",value:`
|
||
`});const d={type:"element",tagName:"li",properties:i,children:a};return t.patch(e,d),t.applyData(e,d)}function i2e(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const n=t.children;let r=-1;for(;!e&&++r<n.length;)e=wV(n[r])}return e}function wV(t){const e=t.spread;return e??t.children.length>1}function a2e(t,e){const n={},r=t.all(e);let s=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++s<r.length;){const a=r[s];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:e.ordered?"ol":"ul",properties:n,children:t.wrap(r,!0)};return t.patch(e,i),t.applyData(e,i)}function o2e(t,e){const n={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function l2e(t,e){const n={type:"root",children:t.wrap(t.all(e))};return t.patch(e,n),t.applyData(e,n)}function c2e(t,e){const n={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function u2e(t,e){const n=t.all(e),r=n.shift(),s=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:t.wrap([r],!0)};t.patch(e.children[0],a),s.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},l=fN(e.children[1]),c=eV(e.children[e.children.length-1]);l&&c&&(a.position={start:l,end:c}),s.push(a)}const i={type:"element",tagName:"table",properties:{},children:t.wrap(s,!0)};return t.patch(e,i),t.applyData(e,i)}function d2e(t,e,n){const r=n?n.children:void 0,i=(r?r.indexOf(e):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,l=a?a.length:e.children.length;let c=-1;const d=[];for(;++c<l;){const m=e.children[c],g={},x=a?a[c]:void 0;x&&(g.align=x);let y={type:"element",tagName:i,properties:g,children:[]};m&&(y.children=t.all(m),t.patch(m,y),y=t.applyData(m,y)),d.push(y)}const h={type:"element",tagName:"tr",properties:{},children:t.wrap(d,!0)};return t.patch(e,h),t.applyData(e,h)}function h2e(t,e){const n={type:"element",tagName:"td",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}const WM=9,GM=32;function f2e(t){const e=String(t),n=/\r?\n|\r/g;let r=n.exec(e),s=0;const i=[];for(;r;)i.push(XM(e.slice(s,r.index),s>0,!0),r[0]),s=r.index+r[0].length,r=n.exec(e);return i.push(XM(e.slice(s),s>0,!1)),i.join("")}function XM(t,e,n){let r=0,s=t.length;if(e){let i=t.codePointAt(r);for(;i===WM||i===GM;)r++,i=t.codePointAt(r)}if(n){let i=t.codePointAt(s-1);for(;i===WM||i===GM;)s--,i=t.codePointAt(s-1)}return s>r?t.slice(r,s):""}function m2e(t,e){const n={type:"text",value:f2e(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function p2e(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const g2e={blockquote:Vwe,break:Uwe,code:Wwe,delete:Gwe,emphasis:Xwe,footnoteReference:Ywe,heading:Kwe,html:Zwe,imageReference:Jwe,image:e2e,inlineCode:t2e,linkReference:n2e,link:r2e,listItem:s2e,list:a2e,paragraph:o2e,root:l2e,strong:c2e,table:u2e,tableCell:h2e,tableRow:d2e,text:m2e,thematicBreak:p2e,toml:M1,yaml:M1,definition:M1,footnoteDefinition:M1};function M1(){}const SV=-1,Hb=0,P0=1,Oy=2,bN=3,wN=4,SN=5,kN=6,kV=7,OV=8,YM=typeof self=="object"?self:globalThis,x2e=(t,e)=>{const n=(s,i)=>(t.set(i,s),s),r=s=>{if(t.has(s))return t.get(s);const[i,a]=e[s];switch(i){case Hb:case SV:return n(a,s);case P0:{const l=n([],s);for(const c of a)l.push(r(c));return l}case Oy:{const l=n({},s);for(const[c,d]of a)l[r(c)]=r(d);return l}case bN:return n(new Date(a),s);case wN:{const{source:l,flags:c}=a;return n(new RegExp(l,c),s)}case SN:{const l=n(new Map,s);for(const[c,d]of a)l.set(r(c),r(d));return l}case kN:{const l=n(new Set,s);for(const c of a)l.add(r(c));return l}case kV:{const{name:l,message:c}=a;return n(new YM[l](c),s)}case OV:return n(BigInt(a),s);case"BigInt":return n(Object(BigInt(a)),s);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:l}=new Uint8Array(a);return n(new DataView(l),a)}}return n(new YM[i](a),s)};return r},KM=t=>x2e(new Map,t)(0),uh="",{toString:v2e}={},{keys:y2e}=Object,e0=t=>{const e=typeof t;if(e!=="object"||!t)return[Hb,e];const n=v2e.call(t).slice(8,-1);switch(n){case"Array":return[P0,uh];case"Object":return[Oy,uh];case"Date":return[bN,uh];case"RegExp":return[wN,uh];case"Map":return[SN,uh];case"Set":return[kN,uh];case"DataView":return[P0,n]}return n.includes("Array")?[P0,n]:n.includes("Error")?[kV,n]:[Oy,n]},R1=([t,e])=>t===Hb&&(e==="function"||e==="symbol"),b2e=(t,e,n,r)=>{const s=(a,l)=>{const c=r.push(a)-1;return n.set(l,c),c},i=a=>{if(n.has(a))return n.get(a);let[l,c]=e0(a);switch(l){case Hb:{let h=a;switch(c){case"bigint":l=OV,h=a.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+c);h=null;break;case"undefined":return s([SV],a)}return s([l,h],a)}case P0:{if(c){let g=a;return c==="DataView"?g=new Uint8Array(a.buffer):c==="ArrayBuffer"&&(g=new Uint8Array(a)),s([c,[...g]],a)}const h=[],m=s([l,h],a);for(const g of a)h.push(i(g));return m}case Oy:{if(c)switch(c){case"BigInt":return s([c,a.toString()],a);case"Boolean":case"Number":case"String":return s([c,a.valueOf()],a)}if(e&&"toJSON"in a)return i(a.toJSON());const h=[],m=s([l,h],a);for(const g of y2e(a))(t||!R1(e0(a[g])))&&h.push([i(g),i(a[g])]);return m}case bN:return s([l,a.toISOString()],a);case wN:{const{source:h,flags:m}=a;return s([l,{source:h,flags:m}],a)}case SN:{const h=[],m=s([l,h],a);for(const[g,x]of a)(t||!(R1(e0(g))||R1(e0(x))))&&h.push([i(g),i(x)]);return m}case kN:{const h=[],m=s([l,h],a);for(const g of a)(t||!R1(e0(g)))&&h.push(i(g));return m}}const{message:d}=a;return s([l,{name:c,message:d}],a)};return i},ZM=(t,{json:e,lossy:n}={})=>{const r=[];return b2e(!(e||n),!!e,new Map,r)(t),r},jy=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?KM(ZM(t,e)):structuredClone(t):(t,e)=>KM(ZM(t,e));function w2e(t,e){const n=[{type:"text",value:"↩"}];return e>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),n}function S2e(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function k2e(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||w2e,r=t.options.footnoteBackLabel||S2e,s=t.options.footnoteLabel||"Footnotes",i=t.options.footnoteLabelTagName||"h2",a=t.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c<t.footnoteOrder.length;){const d=t.footnoteById.get(t.footnoteOrder[c]);if(!d)continue;const h=t.all(d),m=String(d.identifier).toUpperCase(),g=qf(m.toLowerCase());let x=0;const y=[],w=t.footnoteCounts.get(m);for(;w!==void 0&&++x<=w;){y.length>0&&y.push({type:"text",value:" "});let j=typeof n=="string"?n:n(c,x);typeof j=="string"&&(j={type:"text",value:j}),y.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+g+(x>1?"-"+x:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,x),className:["data-footnote-backref"]},children:Array.isArray(j)?j:[j]})}const S=h[h.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const j=S.children[S.children.length-1];j&&j.type==="text"?j.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...y)}else h.push(...y);const k={type:"element",tagName:"li",properties:{id:e+"fn-"+g},children:t.wrap(h,!0)};t.patch(d,k),l.push(k)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...jy(a),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
|
||
`},{type:"element",tagName:"ol",properties:{},children:t.wrap(l,!0)},{type:"text",value:`
|
||
`}]}}const xg=(function(t){if(t==null)return C2e;if(typeof t=="function")return Qb(t);if(typeof t=="object")return Array.isArray(t)?O2e(t):j2e(t);if(typeof t=="string")return N2e(t);throw new Error("Expected function, string, or object as test")});function O2e(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=xg(t[n]);return Qb(r);function r(...s){let i=-1;for(;++i<e.length;)if(e[i].apply(this,s))return!0;return!1}}function j2e(t){const e=t;return Qb(n);function n(r){const s=r;let i;for(i in t)if(s[i]!==e[i])return!1;return!0}}function N2e(t){return Qb(e);function e(n){return n&&n.type===t}}function Qb(t){return e;function e(n,r,s){return!!(T2e(n)&&t.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function C2e(){return!0}function T2e(t){return t!==null&&typeof t=="object"&&"type"in t}const jV=[],E2e=!0,zO=!1,NV="skip";function ON(t,e,n,r){let s;typeof e=="function"&&typeof n!="function"?(r=n,n=e):s=e;const i=xg(s),a=r?-1:1;l(t,void 0,[])();function l(c,d,h){const m=c&&typeof c=="object"?c:{};if(typeof m.type=="string"){const x=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(g,"name",{value:"node ("+(c.type+(x?"<"+x+">":""))+")"})}return g;function g(){let x=jV,y,w,S;if((!e||i(c,d,h[h.length-1]||void 0))&&(x=_2e(n(c,h)),x[0]===zO))return x;if("children"in c&&c.children){const k=c;if(k.children&&x[0]!==NV)for(w=(r?k.children.length:-1)+a,S=h.concat(k);w>-1&&w<k.children.length;){const j=k.children[w];if(y=l(j,w,S)(),y[0]===zO)return y;w=typeof y[1]=="number"?y[1]:w+a}}return x}}}function _2e(t){return Array.isArray(t)?t:typeof t=="number"?[E2e,t]:t==null?jV:[t]}function jN(t,e,n,r){let s,i,a;typeof e=="function"&&typeof n!="function"?(i=void 0,a=e,s=n):(i=e,a=n,s=r),ON(t,i,l,s);function l(c,d){const h=d[d.length-1],m=h?h.children.indexOf(c):void 0;return a(c,m,h)}}const IO={}.hasOwnProperty,A2e={};function M2e(t,e){const n=e||A2e,r=new Map,s=new Map,i=new Map,a={...g2e,...n.handlers},l={all:d,applyData:D2e,definitionById:r,footnoteById:s,footnoteCounts:i,footnoteOrder:[],handlers:a,one:c,options:n,patch:R2e,wrap:z2e};return jN(t,function(h){if(h.type==="definition"||h.type==="footnoteDefinition"){const m=h.type==="definition"?r:s,g=String(h.identifier).toUpperCase();m.has(g)||m.set(g,h)}}),l;function c(h,m){const g=h.type,x=l.handlers[g];if(IO.call(l.handlers,g)&&x)return x(l,h,m);if(l.options.passThrough&&l.options.passThrough.includes(g)){if("children"in h){const{children:w,...S}=h,k=jy(S);return k.children=l.all(h),k}return jy(h)}return(l.options.unknownHandler||P2e)(l,h,m)}function d(h){const m=[];if("children"in h){const g=h.children;let x=-1;for(;++x<g.length;){const y=l.one(g[x],h);if(y){if(x&&g[x-1].type==="break"&&(!Array.isArray(y)&&y.type==="text"&&(y.value=JM(y.value)),!Array.isArray(y)&&y.type==="element")){const w=y.children[0];w&&w.type==="text"&&(w.value=JM(w.value))}Array.isArray(y)?m.push(...y):m.push(y)}}}return m}}function R2e(t,e){t.position&&(e.position=Sye(t))}function D2e(t,e){let n=e;if(t&&t.data){const r=t.data.hName,s=t.data.hChildren,i=t.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&i&&Object.assign(n.properties,jy(i)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function P2e(t,e){const n=e.data||{},r="value"in e&&!(IO.call(n,"hProperties")||IO.call(n,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function z2e(t,e){const n=[];let r=-1;for(e&&n.push({type:"text",value:`
|
||
`});++r<t.length;)r&&n.push({type:"text",value:`
|
||
`}),n.push(t[r]);return e&&t.length>0&&n.push({type:"text",value:`
|
||
`}),n}function JM(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function eR(t,e){const n=M2e(t,e),r=n.one(t,void 0),s=k2e(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&i.children.push({type:"text",value:`
|
||
`},s),i}function I2e(t,e){return t&&"run"in t?async function(n,r){const s=eR(n,{file:r,...e});await t.run(s,r)}:function(n,r){return eR(n,{file:r,...t||e})}}function tR(t){if(t)throw t}var IS,nR;function L2e(){if(nR)return IS;nR=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(d){return typeof Array.isArray=="function"?Array.isArray(d):e.call(d)==="[object Array]"},i=function(d){if(!d||e.call(d)!=="[object Object]")return!1;var h=t.call(d,"constructor"),m=d.constructor&&d.constructor.prototype&&t.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!h&&!m)return!1;var g;for(g in d);return typeof g>"u"||t.call(d,g)},a=function(d,h){n&&h.name==="__proto__"?n(d,h.name,{enumerable:!0,configurable:!0,value:h.newValue,writable:!0}):d[h.name]=h.newValue},l=function(d,h){if(h==="__proto__")if(t.call(d,h)){if(r)return r(d,h).value}else return;return d[h]};return IS=function c(){var d,h,m,g,x,y,w=arguments[0],S=1,k=arguments.length,j=!1;for(typeof w=="boolean"&&(j=w,w=arguments[1]||{},S=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});S<k;++S)if(d=arguments[S],d!=null)for(h in d)m=l(w,h),g=l(d,h),w!==g&&(j&&g&&(i(g)||(x=s(g)))?(x?(x=!1,y=m&&s(m)?m:[]):y=m&&i(m)?m:{},a(w,{name:h,newValue:c(j,y,g)})):typeof g<"u"&&a(w,{name:h,newValue:g}));return w},IS}var B2e=L2e();const LS=yd(B2e);function LO(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function F2e(){const t=[],e={run:n,use:r};return e;function n(...s){let i=-1;const a=s.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);l(null,...s);function l(c,...d){const h=t[++i];let m=-1;if(c){a(c);return}for(;++m<s.length;)(d[m]===null||d[m]===void 0)&&(d[m]=s[m]);s=d,h?q2e(h,l)(...d):a(null,...d)}}function r(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return t.push(s),e}}function q2e(t,e){let n;return r;function r(...a){const l=t.length>a.length;let c;l&&a.push(s);try{c=t.apply(this,a)}catch(d){const h=d;if(l&&n)throw h;return s(h)}l||(c&&c.then&&typeof c.then=="function"?c.then(i,s):c instanceof Error?s(c):i(c))}function s(a,...l){n||(n=!0,e(a,...l))}function i(a){s(null,a)}}const vo={basename:$2e,dirname:H2e,extname:Q2e,join:V2e,sep:"/"};function $2e(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');vg(t);let n=0,r=-1,s=t.length,i;if(e===void 0||e.length===0||e.length>t.length){for(;s--;)if(t.codePointAt(s)===47){if(i){n=s+1;break}}else r<0&&(i=!0,r=s+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let a=-1,l=e.length-1;for(;s--;)if(t.codePointAt(s)===47){if(i){n=s+1;break}}else a<0&&(i=!0,a=s+1),l>-1&&(t.codePointAt(s)===e.codePointAt(l--)?l<0&&(r=s):(l=-1,r=a));return n===r?r=a:r<0&&(r=t.length),t.slice(n,r)}function H2e(t){if(vg(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.codePointAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function Q2e(t){vg(t);let e=t.length,n=-1,r=0,s=-1,i=0,a;for(;e--;){const l=t.codePointAt(e);if(l===47){if(a){r=e+1;break}continue}n<0&&(a=!0,n=e+1),l===46?s<0?s=e:i!==1&&(i=1):s>-1&&(i=-1)}return s<0||n<0||i===0||i===1&&s===n-1&&s===r+1?"":t.slice(s,n)}function V2e(...t){let e=-1,n;for(;++e<t.length;)vg(t[e]),t[e]&&(n=n===void 0?t[e]:n+"/"+t[e]);return n===void 0?".":U2e(n)}function U2e(t){vg(t);const e=t.codePointAt(0)===47;let n=W2e(t,!e);return n.length===0&&!e&&(n="."),n.length>0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function W2e(t,e){let n="",r=0,s=-1,i=0,a=-1,l,c;for(;++a<=t.length;){if(a<t.length)l=t.codePointAt(a);else{if(l===47)break;l=47}if(l===47){if(!(s===a-1||i===1))if(s!==a-1&&i===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),s=a,i=0;continue}}else if(n.length>0){n="",r=0,s=a,i=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(s+1,a):n=t.slice(s+1,a),r=a-s-1;s=a,i=0}else l===46&&i>-1?i++:i=-1}return n}function vg(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const G2e={cwd:X2e};function X2e(){return"/"}function BO(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function Y2e(t){if(typeof t=="string")t=new URL(t);else if(!BO(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return K2e(t)}function K2e(t){if(t.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=t.pathname;let n=-1;for(;++n<e.length;)if(e.codePointAt(n)===37&&e.codePointAt(n+1)===50){const r=e.codePointAt(n+2);if(r===70||r===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(e)}const BS=["history","path","basename","stem","extname","dirname"];class CV{constructor(e){let n;e?BO(e)?n={path:e}:typeof e=="string"||Z2e(e)?n={value:e}:n=e:n={},this.cwd="cwd"in n?"":G2e.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<BS.length;){const i=BS[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let s;for(s in n)BS.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?vo.basename(this.path):void 0}set basename(e){qS(e,"basename"),FS(e,"basename"),this.path=vo.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?vo.dirname(this.path):void 0}set dirname(e){rR(this.basename,"dirname"),this.path=vo.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?vo.extname(this.path):void 0}set extname(e){if(FS(e,"extname"),rR(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=vo.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){BO(e)&&(e=Y2e(e)),qS(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?vo.basename(this.path,this.extname):void 0}set stem(e){qS(e,"stem"),FS(e,"stem"),this.path=vo.join(this.dirname||"",e+(this.extname||""))}fail(e,n,r){const s=this.message(e,n,r);throw s.fatal=!0,s}info(e,n,r){const s=this.message(e,n,r);return s.fatal=void 0,s}message(e,n,r){const s=new Gs(e,n,r);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function FS(t,e){if(t&&t.includes(vo.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+vo.sep+"`")}function qS(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function rR(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function Z2e(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const J2e=(function(t){const r=this.constructor.prototype,s=r[t],i=function(){return s.apply(i,arguments)};return Object.setPrototypeOf(i,r),i}),e4e={}.hasOwnProperty;class NN extends J2e{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=F2e()}copy(){const e=new NN;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];e.use(...r)}return e.data(LS(!0,{},this.namespace)),e}data(e,n){return typeof e=="string"?arguments.length===2?(QS("data",this.frozen),this.namespace[e]=n,this):e4e.call(this.namespace,e)&&this.namespace[e]||void 0:e?(QS("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const s=n.call(e,...r);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const n=D1(e),r=this.parser||this.Parser;return $S("parse",r),r(String(n),n)}process(e,n){const r=this;return this.freeze(),$S("process",this.parser||this.Parser),HS("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(i,a){const l=D1(e),c=r.parse(l);r.run(c,l,function(h,m,g){if(h||!m||!g)return d(h);const x=m,y=r.stringify(x,g);r4e(y)?g.value=y:g.result=y,d(h,g)});function d(h,m){h||!m?a(h):i?i(m):n(void 0,m)}}}processSync(e){let n=!1,r;return this.freeze(),$S("processSync",this.parser||this.Parser),HS("processSync",this.compiler||this.Compiler),this.process(e,s),iR("processSync","process",n),r;function s(i,a){n=!0,tR(i),r=a}}run(e,n,r){sR(e),this.freeze();const s=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?i(void 0,r):new Promise(i);function i(a,l){const c=D1(n);s.run(e,c,d);function d(h,m,g){const x=m||e;h?l(h):a?a(x):r(void 0,x,g)}}}runSync(e,n){let r=!1,s;return this.run(e,n,i),iR("runSync","run",r),s;function i(a,l){tR(a),s=l,r=!0}}stringify(e,n){this.freeze();const r=D1(n),s=this.compiler||this.Compiler;return HS("stringify",s),sR(e),s(e,r)}use(e,...n){const r=this.attachers,s=this.namespace;if(QS("use",this.frozen),e!=null)if(typeof e=="function")c(e,n);else if(typeof e=="object")Array.isArray(e)?l(e):a(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function i(d){if(typeof d=="function")c(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[h,...m]=d;c(h,m)}else a(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function a(d){if(!("plugins"in d)&&!("settings"in d))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");l(d.plugins),d.settings&&(s.settings=LS(!0,s.settings,d.settings))}function l(d){let h=-1;if(d!=null)if(Array.isArray(d))for(;++h<d.length;){const m=d[h];i(m)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function c(d,h){let m=-1,g=-1;for(;++m<r.length;)if(r[m][0]===d){g=m;break}if(g===-1)r.push([d,...h]);else if(h.length>0){let[x,...y]=h;const w=r[g][1];LO(w)&&LO(x)&&(x=LS(!0,w,x)),r[g]=[d,x,...y]}}}}const t4e=new NN().freeze();function $S(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function HS(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function QS(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function sR(t){if(!LO(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function iR(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function D1(t){return n4e(t)?t:new CV(t)}function n4e(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function r4e(t){return typeof t=="string"||s4e(t)}function s4e(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const i4e="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",aR=[],oR={allowDangerousHtml:!0},a4e=/^(https?|ircs?|mailto|xmpp)$/i,o4e=[{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 l4e(t){const e=c4e(t),n=u4e(t);return d4e(e.runSync(e.parse(n),n),t)}function c4e(t){const e=t.rehypePlugins||aR,n=t.remarkPlugins||aR,r=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...oR}:oR;return t4e().use(Qwe).use(n).use(I2e,r).use(e)}function u4e(t){const e=t.children||"",n=new CV;return typeof e=="string"&&(n.value=e),n}function d4e(t,e){const n=e.allowedElements,r=e.allowElement,s=e.components,i=e.disallowedElements,a=e.skipHtml,l=e.unwrapDisallowed,c=e.urlTransform||h4e;for(const h of o4e)Object.hasOwn(e,h.from)&&(""+h.from+(h.to?"use `"+h.to+"` instead":"remove it")+i4e+h.id,void 0);return jN(t,d),Cye(t,{Fragment:o.Fragment,components:s,ignoreInvalidStyle:!0,jsx:o.jsx,jsxs:o.jsxs,passKeys:!0,passNode:!0});function d(h,m,g){if(h.type==="raw"&&g&&typeof m=="number")return a?g.children.splice(m,1):g.children[m]={type:"text",value:h.value},m;if(h.type==="element"){let x;for(x in DS)if(Object.hasOwn(DS,x)&&Object.hasOwn(h.properties,x)){const y=h.properties[x],w=DS[x];(w===null||w.includes(h.tagName))&&(h.properties[x]=c(String(y||""),x,h))}}if(h.type==="element"){let x=n?!n.includes(h.tagName):i?i.includes(h.tagName):!1;if(!x&&r&&typeof m=="number"&&(x=!r(h,m,g)),x&&g&&typeof m=="number")return l&&h.children?g.children.splice(m,1,...h.children):g.children.splice(m,1),m}}}function h4e(t){const e=t.indexOf(":"),n=t.indexOf("?"),r=t.indexOf("#"),s=t.indexOf("/");return e===-1||s!==-1&&e>s||n!==-1&&e>n||r!==-1&&e>r||a4e.test(t.slice(0,e))?t:""}function lR(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let r=0,s=n.indexOf(e);for(;s!==-1;)r++,s=n.indexOf(e,s+e.length);return r}function f4e(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function m4e(t,e,n){const s=xg((n||{}).ignore||[]),i=p4e(e);let a=-1;for(;++a<i.length;)ON(t,"text",l);function l(d,h){let m=-1,g;for(;++m<h.length;){const x=h[m],y=g?g.children:void 0;if(s(x,y?y.indexOf(x):void 0,g))return;g=x}if(g)return c(d,h)}function c(d,h){const m=h[h.length-1],g=i[a][0],x=i[a][1];let y=0;const S=m.children.indexOf(d);let k=!1,j=[];g.lastIndex=0;let N=g.exec(d.value);for(;N;){const T=N.index,E={index:N.index,input:N.input,stack:[...h,d]};let _=x(...N,E);if(typeof _=="string"&&(_=_.length>0?{type:"text",value:_}:void 0),_===!1?g.lastIndex=T+1:(y!==T&&j.push({type:"text",value:d.value.slice(y,T)}),Array.isArray(_)?j.push(..._):_&&j.push(_),y=T+N[0].length,k=!0),!g.global)break;N=g.exec(d.value)}return k?(y<d.value.length&&j.push({type:"text",value:d.value.slice(y)}),m.children.splice(S,1,...j)):j=[d],S+j.length}}function p4e(t){const e=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!t[0]||Array.isArray(t[0])?t:[t];let r=-1;for(;++r<n.length;){const s=n[r];e.push([g4e(s[0]),x4e(s[1])])}return e}function g4e(t){return typeof t=="string"?new RegExp(f4e(t),"g"):t}function x4e(t){return typeof t=="function"?t:function(){return t}}const VS="phrasing",US=["autolink","link","image","label"];function v4e(){return{transforms:[j4e],enter:{literalAutolink:b4e,literalAutolinkEmail:WS,literalAutolinkHttp:WS,literalAutolinkWww:WS},exit:{literalAutolink:O4e,literalAutolinkEmail:k4e,literalAutolinkHttp:w4e,literalAutolinkWww:S4e}}}function y4e(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:VS,notInConstruct:US},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:VS,notInConstruct:US},{character:":",before:"[ps]",after:"\\/",inConstruct:VS,notInConstruct:US}]}}function b4e(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function WS(t){this.config.enter.autolinkProtocol.call(this,t)}function w4e(t){this.config.exit.autolinkProtocol.call(this,t)}function S4e(t){this.config.exit.data.call(this,t);const e=this.stack[this.stack.length-1];e.type,e.url="http://"+this.sliceSerialize(t)}function k4e(t){this.config.exit.autolinkEmail.call(this,t)}function O4e(t){this.exit(t)}function j4e(t){m4e(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,N4e],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),C4e]],{ignore:["link","linkReference"]})}function N4e(t,e,n,r,s){let i="";if(!TV(s)||(/^w/i.test(e)&&(n=e+n,e="",i="http://"),!T4e(n)))return!1;const a=E4e(n+r);if(!a[0])return!1;const l={type:"link",title:null,url:i+e+a[0],children:[{type:"text",value:e+a[0]}]};return a[1]?[l,{type:"text",value:a[1]}]:l}function C4e(t,e,n,r){return!TV(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+n,children:[{type:"text",value:e+"@"+n}]}}function T4e(t){const e=t.split(".");return!(e.length<2||e[e.length-1]&&(/_/.test(e[e.length-1])||!/[a-zA-Z\d]/.test(e[e.length-1]))||e[e.length-2]&&(/_/.test(e[e.length-2])||!/[a-zA-Z\d]/.test(e[e.length-2])))}function E4e(t){const e=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!e)return[t,void 0];t=t.slice(0,e.index);let n=e[0],r=n.indexOf(")");const s=lR(t,"(");let i=lR(t,")");for(;r!==-1&&s>i;)t+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),i++;return[t,n]}function TV(t,e){const n=t.input.charCodeAt(t.index-1);return(t.index===0||gd(n)||qb(n))&&(!e||n!==47)}EV.peek=L4e;function _4e(){this.buffer()}function A4e(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function M4e(){this.buffer()}function R4e(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function D4e(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Xa(this.sliceSerialize(t)).toLowerCase(),n.label=e}function P4e(t){this.exit(t)}function z4e(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Xa(this.sliceSerialize(t)).toLowerCase(),n.label=e}function I4e(t){this.exit(t)}function L4e(){return"["}function EV(t,e,n,r){const s=n.createTracker(r);let i=s.move("[^");const a=n.enter("footnoteReference"),l=n.enter("reference");return i+=s.move(n.safe(n.associationId(t),{after:"]",before:i})),l(),a(),i+=s.move("]"),i}function B4e(){return{enter:{gfmFootnoteCallString:_4e,gfmFootnoteCall:A4e,gfmFootnoteDefinitionLabelString:M4e,gfmFootnoteDefinition:R4e},exit:{gfmFootnoteCallString:D4e,gfmFootnoteCall:P4e,gfmFootnoteDefinitionLabelString:z4e,gfmFootnoteDefinition:I4e}}}function F4e(t){let e=!1;return t&&t.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:n,footnoteReference:EV},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,i,a){const l=i.createTracker(a);let c=l.move("[^");const d=i.enter("footnoteDefinition"),h=i.enter("label");return c+=l.move(i.safe(i.associationId(r),{before:c,after:"]"})),h(),c+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),c+=l.move((e?`
|
||
`:" ")+i.indentLines(i.containerFlow(r,l.current()),e?_V:q4e))),d(),c}}function q4e(t,e,n){return e===0?t:_V(t,e,n)}function _V(t,e,n){return(n?"":" ")+t}const $4e=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];AV.peek=W4e;function H4e(){return{canContainEols:["delete"],enter:{strikethrough:V4e},exit:{strikethrough:U4e}}}function Q4e(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:$4e}],handlers:{delete:AV}}}function V4e(t){this.enter({type:"delete",children:[]},t)}function U4e(t){this.exit(t)}function AV(t,e,n,r){const s=n.createTracker(r),i=n.enter("strikethrough");let a=s.move("~~");return a+=n.containerPhrasing(t,{...s.current(),before:a,after:"~"}),a+=s.move("~~"),i(),a}function W4e(){return"~"}function G4e(t){return t.length}function X4e(t,e){const n=e||{},r=(n.align||[]).concat(),s=n.stringLength||G4e,i=[],a=[],l=[],c=[];let d=0,h=-1;for(;++h<t.length;){const w=[],S=[];let k=-1;for(t[h].length>d&&(d=t[h].length);++k<t[h].length;){const j=Y4e(t[h][k]);if(n.alignDelimiters!==!1){const N=s(j);S[k]=N,(c[k]===void 0||N>c[k])&&(c[k]=N)}w.push(j)}a[h]=w,l[h]=S}let m=-1;if(typeof r=="object"&&"length"in r)for(;++m<d;)i[m]=cR(r[m]);else{const w=cR(r);for(;++m<d;)i[m]=w}m=-1;const g=[],x=[];for(;++m<d;){const w=i[m];let S="",k="";w===99?(S=":",k=":"):w===108?S=":":w===114&&(k=":");let j=n.alignDelimiters===!1?1:Math.max(1,c[m]-S.length-k.length);const N=S+"-".repeat(j)+k;n.alignDelimiters!==!1&&(j=S.length+j+k.length,j>c[m]&&(c[m]=j),x[m]=j),g[m]=N}a.splice(1,0,g),l.splice(1,0,x),h=-1;const y=[];for(;++h<a.length;){const w=a[h],S=l[h];m=-1;const k=[];for(;++m<d;){const j=w[m]||"";let N="",T="";if(n.alignDelimiters!==!1){const E=c[m]-(S[m]||0),_=i[m];_===114?N=" ".repeat(E):_===99?E%2?(N=" ".repeat(E/2+.5),T=" ".repeat(E/2-.5)):(N=" ".repeat(E/2),T=N):T=" ".repeat(E)}n.delimiterStart!==!1&&!m&&k.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&j==="")&&(n.delimiterStart!==!1||m)&&k.push(" "),n.alignDelimiters!==!1&&k.push(N),k.push(j),n.alignDelimiters!==!1&&k.push(T),n.padding!==!1&&k.push(" "),(n.delimiterEnd!==!1||m!==d-1)&&k.push("|")}y.push(n.delimiterEnd===!1?k.join("").replace(/ +$/,""):k.join(""))}return y.join(`
|
||
`)}function Y4e(t){return t==null?"":String(t)}function cR(t){const e=typeof t=="string"?t.codePointAt(0):0;return e===67||e===99?99:e===76||e===108?108:e===82||e===114?114:0}function K4e(t,e,n,r){const s=n.enter("blockquote"),i=n.createTracker(r);i.move("> "),i.shift(2);const a=n.indentLines(n.containerFlow(t,i.current()),Z4e);return s(),a}function Z4e(t,e,n){return">"+(n?"":" ")+t}function J4e(t,e){return uR(t,e.inConstruct,!0)&&!uR(t,e.notInConstruct,!1)}function uR(t,e,n){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return n;let r=-1;for(;++r<e.length;)if(t.includes(e[r]))return!0;return!1}function dR(t,e,n,r){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
|
||
`&&J4e(n.stack,n.unsafe[s]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
||
`}function MV(t,e){const n=String(t);let r=n.indexOf(e),s=r,i=0,a=0;if(typeof e!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===s?++i>a&&(a=i):i=1,s=r+e.length,r=n.indexOf(e,s);return a}function eSe(t,e){return!!(e.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function tSe(t){const e=t.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function nSe(t,e,n,r){const s=tSe(n),i=t.value||"",a=s==="`"?"GraveAccent":"Tilde";if(eSe(t,n)){const m=n.enter("codeIndented"),g=n.indentLines(i,rSe);return m(),g}const l=n.createTracker(r),c=s.repeat(Math.max(MV(i,s)+1,3)),d=n.enter("codeFenced");let h=l.move(c);if(t.lang){const m=n.enter(`codeFencedLang${a}`);h+=l.move(n.safe(t.lang,{before:h,after:" ",encode:["`"],...l.current()})),m()}if(t.lang&&t.meta){const m=n.enter(`codeFencedMeta${a}`);h+=l.move(" "),h+=l.move(n.safe(t.meta,{before:h,after:`
|
||
`,encode:["`"],...l.current()})),m()}return h+=l.move(`
|
||
`),i&&(h+=l.move(i+`
|
||
`)),h+=l.move(c),d(),h}function rSe(t,e,n){return(n?"":" ")+t}function CN(t){const e=t.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function sSe(t,e,n,r){const s=CN(n),i=s==='"'?"Quote":"Apostrophe",a=n.enter("definition");let l=n.enter("label");const c=n.createTracker(r);let d=c.move("[");return d+=c.move(n.safe(n.associationId(t),{before:d,after:"]",...c.current()})),d+=c.move("]: "),l(),!t.url||/[\0- \u007F]/.test(t.url)?(l=n.enter("destinationLiteral"),d+=c.move("<"),d+=c.move(n.safe(t.url,{before:d,after:">",...c.current()})),d+=c.move(">")):(l=n.enter("destinationRaw"),d+=c.move(n.safe(t.url,{before:d,after:t.title?" ":`
|
||
`,...c.current()}))),l(),t.title&&(l=n.enter(`title${i}`),d+=c.move(" "+s),d+=c.move(n.safe(t.title,{before:d,after:s,...c.current()})),d+=c.move(s),l()),a(),d}function iSe(t){const e=t.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function bp(t){return"&#x"+t.toString(16).toUpperCase()+";"}function Ny(t,e,n){const r=hf(t),s=hf(e);return r===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}RV.peek=aSe;function RV(t,e,n,r){const s=iSe(n),i=n.enter("emphasis"),a=n.createTracker(r),l=a.move(s);let c=a.move(n.containerPhrasing(t,{after:s,before:l,...a.current()}));const d=c.charCodeAt(0),h=Ny(r.before.charCodeAt(r.before.length-1),d,s);h.inside&&(c=bp(d)+c.slice(1));const m=c.charCodeAt(c.length-1),g=Ny(r.after.charCodeAt(0),m,s);g.inside&&(c=c.slice(0,-1)+bp(m));const x=a.move(s);return i(),n.attentionEncodeSurroundingInfo={after:g.outside,before:h.outside},l+c+x}function aSe(t,e,n){return n.options.emphasis||"*"}function oSe(t,e){let n=!1;return jN(t,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,zO}),!!((!t.depth||t.depth<3)&&xN(t)&&(e.options.setext||n))}function lSe(t,e,n,r){const s=Math.max(Math.min(6,t.depth||1),1),i=n.createTracker(r);if(oSe(t,n)){const h=n.enter("headingSetext"),m=n.enter("phrasing"),g=n.containerPhrasing(t,{...i.current(),before:`
|
||
`,after:`
|
||
`});return m(),h(),g+`
|
||
`+(s===1?"=":"-").repeat(g.length-(Math.max(g.lastIndexOf("\r"),g.lastIndexOf(`
|
||
`))+1))}const a="#".repeat(s),l=n.enter("headingAtx"),c=n.enter("phrasing");i.move(a+" ");let d=n.containerPhrasing(t,{before:"# ",after:`
|
||
`,...i.current()});return/^[\t ]/.test(d)&&(d=bp(d.charCodeAt(0))+d.slice(1)),d=d?a+" "+d:a,n.options.closeAtx&&(d+=" "+a),c(),l(),d}DV.peek=cSe;function DV(t){return t.value||""}function cSe(){return"<"}PV.peek=uSe;function PV(t,e,n,r){const s=CN(n),i=s==='"'?"Quote":"Apostrophe",a=n.enter("image");let l=n.enter("label");const c=n.createTracker(r);let d=c.move("![");return d+=c.move(n.safe(t.alt,{before:d,after:"]",...c.current()})),d+=c.move("]("),l(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(l=n.enter("destinationLiteral"),d+=c.move("<"),d+=c.move(n.safe(t.url,{before:d,after:">",...c.current()})),d+=c.move(">")):(l=n.enter("destinationRaw"),d+=c.move(n.safe(t.url,{before:d,after:t.title?" ":")",...c.current()}))),l(),t.title&&(l=n.enter(`title${i}`),d+=c.move(" "+s),d+=c.move(n.safe(t.title,{before:d,after:s,...c.current()})),d+=c.move(s),l()),d+=c.move(")"),a(),d}function uSe(){return"!"}zV.peek=dSe;function zV(t,e,n,r){const s=t.referenceType,i=n.enter("imageReference");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("![");const d=n.safe(t.alt,{before:c,after:"]",...l.current()});c+=l.move(d+"]["),a();const h=n.stack;n.stack=[],a=n.enter("reference");const m=n.safe(n.associationId(t),{before:c,after:"]",...l.current()});return a(),n.stack=h,i(),s==="full"||!d||d!==m?c+=l.move(m+"]"):s==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function dSe(){return"!"}IV.peek=hSe;function IV(t,e,n){let r=t.value||"",s="`",i=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i<n.unsafe.length;){const a=n.unsafe[i],l=n.compilePattern(a);let c;if(a.atBreak)for(;c=l.exec(r);){let d=c.index;r.charCodeAt(d)===10&&r.charCodeAt(d-1)===13&&d--,r=r.slice(0,d)+" "+r.slice(c.index+1)}}return s+r+s}function hSe(){return"`"}function LV(t,e){const n=xN(t);return!!(!e.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(n===t.url||"mailto:"+n===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}BV.peek=fSe;function BV(t,e,n,r){const s=CN(n),i=s==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let l,c;if(LV(t,n)){const h=n.stack;n.stack=[],l=n.enter("autolink");let m=a.move("<");return m+=a.move(n.containerPhrasing(t,{before:m,after:">",...a.current()})),m+=a.move(">"),l(),n.stack=h,m}l=n.enter("link"),c=n.enter("label");let d=a.move("[");return d+=a.move(n.containerPhrasing(t,{before:d,after:"](",...a.current()})),d+=a.move("]("),c(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(c=n.enter("destinationLiteral"),d+=a.move("<"),d+=a.move(n.safe(t.url,{before:d,after:">",...a.current()})),d+=a.move(">")):(c=n.enter("destinationRaw"),d+=a.move(n.safe(t.url,{before:d,after:t.title?" ":")",...a.current()}))),c(),t.title&&(c=n.enter(`title${i}`),d+=a.move(" "+s),d+=a.move(n.safe(t.title,{before:d,after:s,...a.current()})),d+=a.move(s),c()),d+=a.move(")"),l(),d}function fSe(t,e,n){return LV(t,n)?"<":"["}FV.peek=mSe;function FV(t,e,n,r){const s=t.referenceType,i=n.enter("linkReference");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("[");const d=n.containerPhrasing(t,{before:c,after:"]",...l.current()});c+=l.move(d+"]["),a();const h=n.stack;n.stack=[],a=n.enter("reference");const m=n.safe(n.associationId(t),{before:c,after:"]",...l.current()});return a(),n.stack=h,i(),s==="full"||!d||d!==m?c+=l.move(m+"]"):s==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function mSe(){return"["}function TN(t){const e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function pSe(t){const e=TN(t),n=t.options.bulletOther;if(!n)return e==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+n+"`) to be different");return n}function gSe(t){const e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function qV(t){const e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function xSe(t,e,n,r){const s=n.enter("list"),i=n.bulletCurrent;let a=t.ordered?gSe(n):TN(n);const l=t.ordered?a==="."?")":".":pSe(n);let c=e&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!t.ordered){const h=t.children?t.children[0]:void 0;if((a==="*"||a==="-")&&h&&(!h.children||!h.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&&(c=!0),qV(n)===a&&h){let m=-1;for(;++m<t.children.length;){const g=t.children[m];if(g&&g.type==="listItem"&&g.children&&g.children[0]&&g.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(a=l),n.bulletCurrent=a;const d=n.containerFlow(t,r);return n.bulletLastUsed=a,n.bulletCurrent=i,s(),d}function vSe(t){const e=t.options.listItemIndent||"one";if(e!=="tab"&&e!=="one"&&e!=="mixed")throw new Error("Cannot serialize items with `"+e+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return e}function ySe(t,e,n,r){const s=vSe(n);let i=n.bulletCurrent||TN(n);e&&e.type==="list"&&e.ordered&&(i=(typeof e.start=="number"&&e.start>-1?e.start:1)+(n.options.incrementListMarker===!1?0:e.children.indexOf(t))+i);let a=i.length+1;(s==="tab"||s==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(a=Math.ceil(a/4)*4);const l=n.createTracker(r);l.move(i+" ".repeat(a-i.length)),l.shift(a);const c=n.enter("listItem"),d=n.indentLines(n.containerFlow(t,l.current()),h);return c(),d;function h(m,g,x){return g?(x?"":" ".repeat(a))+m:(x?i:i+" ".repeat(a-i.length))+m}}function bSe(t,e,n,r){const s=n.enter("paragraph"),i=n.enter("phrasing"),a=n.containerPhrasing(t,r);return i(),s(),a}const wSe=xg(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function SSe(t,e,n,r){return(t.children.some(function(a){return wSe(a)})?n.containerPhrasing:n.containerFlow).call(n,t,r)}function kSe(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}$V.peek=OSe;function $V(t,e,n,r){const s=kSe(n),i=n.enter("strong"),a=n.createTracker(r),l=a.move(s+s);let c=a.move(n.containerPhrasing(t,{after:s,before:l,...a.current()}));const d=c.charCodeAt(0),h=Ny(r.before.charCodeAt(r.before.length-1),d,s);h.inside&&(c=bp(d)+c.slice(1));const m=c.charCodeAt(c.length-1),g=Ny(r.after.charCodeAt(0),m,s);g.inside&&(c=c.slice(0,-1)+bp(m));const x=a.move(s+s);return i(),n.attentionEncodeSurroundingInfo={after:g.outside,before:h.outside},l+c+x}function OSe(t,e,n){return n.options.strong||"*"}function jSe(t,e,n,r){return n.safe(t.value,r)}function NSe(t){const e=t.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function CSe(t,e,n){const r=(qV(n)+(n.options.ruleSpaces?" ":"")).repeat(NSe(n));return n.options.ruleSpaces?r.slice(0,-1):r}const HV={blockquote:K4e,break:dR,code:nSe,definition:sSe,emphasis:RV,hardBreak:dR,heading:lSe,html:DV,image:PV,imageReference:zV,inlineCode:IV,link:BV,linkReference:FV,list:xSe,listItem:ySe,paragraph:bSe,root:SSe,strong:$V,text:jSe,thematicBreak:CSe};function TSe(){return{enter:{table:ESe,tableData:hR,tableHeader:hR,tableRow:ASe},exit:{codeText:MSe,table:_Se,tableData:GS,tableHeader:GS,tableRow:GS}}}function ESe(t){const e=t._align;this.enter({type:"table",align:e.map(function(n){return n==="none"?null:n}),children:[]},t),this.data.inTable=!0}function _Se(t){this.exit(t),this.data.inTable=void 0}function ASe(t){this.enter({type:"tableRow",children:[]},t)}function GS(t){this.exit(t)}function hR(t){this.enter({type:"tableCell",children:[]},t)}function MSe(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,RSe));const n=this.stack[this.stack.length-1];n.type,n.value=e,this.exit(t)}function RSe(t,e){return e==="|"?e:t}function DSe(t){const e=t||{},n=e.tableCellPadding,r=e.tablePipeAlign,s=e.stringLength,i=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:g,table:a,tableCell:c,tableRow:l}};function a(x,y,w,S){return d(h(x,w,S),x.align)}function l(x,y,w,S){const k=m(x,w,S),j=d([k]);return j.slice(0,j.indexOf(`
|
||
`))}function c(x,y,w,S){const k=w.enter("tableCell"),j=w.enter("phrasing"),N=w.containerPhrasing(x,{...S,before:i,after:i});return j(),k(),N}function d(x,y){return X4e(x,{align:y,alignDelimiters:r,padding:n,stringLength:s})}function h(x,y,w){const S=x.children;let k=-1;const j=[],N=y.enter("table");for(;++k<S.length;)j[k]=m(S[k],y,w);return N(),j}function m(x,y,w){const S=x.children;let k=-1;const j=[],N=y.enter("tableRow");for(;++k<S.length;)j[k]=c(S[k],x,y,w);return N(),j}function g(x,y,w){let S=HV.inlineCode(x,y,w);return w.stack.includes("tableCell")&&(S=S.replace(/\|/g,"\\$&")),S}}function PSe(){return{exit:{taskListCheckValueChecked:fR,taskListCheckValueUnchecked:fR,paragraph:ISe}}}function zSe(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:LSe}}}function fR(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function ISe(t){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const s=e.children;let i=-1,a;for(;++i<s.length;){const l=s[i];if(l.type==="paragraph"){a=l;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(t)}function LSe(t,e,n,r){const s=t.children[0],i=typeof t.checked=="boolean"&&s&&s.type==="paragraph",a="["+(t.checked?"x":" ")+"] ",l=n.createTracker(r);i&&l.move(a);let c=HV.listItem(t,e,n,{...r,...l.current()});return i&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),c;function d(h){return h+a}}function BSe(){return[v4e(),B4e(),H4e(),TSe(),PSe()]}function FSe(t){return{extensions:[y4e(),F4e(t),Q4e(),DSe(t),zSe()]}}const qSe={tokenize:WSe,partial:!0},QV={tokenize:GSe,partial:!0},VV={tokenize:XSe,partial:!0},UV={tokenize:YSe,partial:!0},$Se={tokenize:KSe,partial:!0},WV={name:"wwwAutolink",tokenize:VSe,previous:XV},GV={name:"protocolAutolink",tokenize:USe,previous:YV},ec={name:"emailAutolink",tokenize:QSe,previous:KV},Wo={};function HSe(){return{text:Wo}}let Iu=48;for(;Iu<123;)Wo[Iu]=ec,Iu++,Iu===58?Iu=65:Iu===91&&(Iu=97);Wo[43]=ec;Wo[45]=ec;Wo[46]=ec;Wo[95]=ec;Wo[72]=[ec,GV];Wo[104]=[ec,GV];Wo[87]=[ec,WV];Wo[119]=[ec,WV];function QSe(t,e,n){const r=this;let s,i;return a;function a(m){return!FO(m)||!KV.call(r,r.previous)||EN(r.events)?n(m):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),l(m))}function l(m){return FO(m)?(t.consume(m),l):m===64?(t.consume(m),c):n(m)}function c(m){return m===46?t.check($Se,h,d)(m):m===45||m===95||Vs(m)?(i=!0,t.consume(m),c):h(m)}function d(m){return t.consume(m),s=!0,c}function h(m){return i&&s&&ei(r.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(m)):n(m)}}function VSe(t,e,n){const r=this;return s;function s(a){return a!==87&&a!==119||!XV.call(r,r.previous)||EN(r.events)?n(a):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(qSe,t.attempt(QV,t.attempt(VV,i),n),n)(a))}function i(a){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(a)}}function USe(t,e,n){const r=this;let s="",i=!1;return a;function a(m){return(m===72||m===104)&&YV.call(r,r.previous)&&!EN(r.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),s+=String.fromCodePoint(m),t.consume(m),l):n(m)}function l(m){if(ei(m)&&s.length<5)return s+=String.fromCodePoint(m),t.consume(m),l;if(m===58){const g=s.toLowerCase();if(g==="http"||g==="https")return t.consume(m),c}return n(m)}function c(m){return m===47?(t.consume(m),i?d:(i=!0,c)):n(m)}function d(m){return m===null||ky(m)||dr(m)||gd(m)||qb(m)?n(m):t.attempt(QV,t.attempt(VV,h),n)(m)}function h(m){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(m)}}function WSe(t,e,n){let r=0;return s;function s(a){return(a===87||a===119)&&r<3?(r++,t.consume(a),s):a===46&&r===3?(t.consume(a),i):n(a)}function i(a){return a===null?n(a):e(a)}}function GSe(t,e,n){let r,s,i;return a;function a(d){return d===46||d===95?t.check(UV,c,l)(d):d===null||dr(d)||gd(d)||d!==45&&qb(d)?c(d):(i=!0,t.consume(d),a)}function l(d){return d===95?r=!0:(s=r,r=void 0),t.consume(d),a}function c(d){return s||r||!i?n(d):e(d)}}function XSe(t,e){let n=0,r=0;return s;function s(a){return a===40?(n++,t.consume(a),s):a===41&&r<n?i(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?t.check(UV,e,i)(a):a===null||dr(a)||gd(a)?e(a):(t.consume(a),s)}function i(a){return a===41&&r++,t.consume(a),s}}function YSe(t,e,n){return r;function r(l){return l===33||l===34||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===63||l===95||l===126?(t.consume(l),r):l===38?(t.consume(l),i):l===93?(t.consume(l),s):l===60||l===null||dr(l)||gd(l)?e(l):n(l)}function s(l){return l===null||l===40||l===91||dr(l)||gd(l)?e(l):r(l)}function i(l){return ei(l)?a(l):n(l)}function a(l){return l===59?(t.consume(l),r):ei(l)?(t.consume(l),a):n(l)}}function KSe(t,e,n){return r;function r(i){return t.consume(i),s}function s(i){return Vs(i)?n(i):e(i)}}function XV(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||dr(t)}function YV(t){return!ei(t)}function KV(t){return!(t===47||FO(t))}function FO(t){return t===43||t===45||t===46||t===95||Vs(t)}function EN(t){let e=t.length,n=!1;for(;e--;){const r=t[e][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return t.length>0&&!n&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const ZSe={tokenize:a5e,partial:!0};function JSe(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:r5e,continuation:{tokenize:s5e},exit:i5e}},text:{91:{name:"gfmFootnoteCall",tokenize:n5e},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:e5e,resolveTo:t5e}}}}function e5e(t,e,n){const r=this;let s=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;s--;){const c=r.events[s][1];if(c.type==="labelImage"){a=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return l;function l(c){if(!a||!a._balanced)return n(c);const d=Xa(r.sliceSerialize({start:a.end,end:r.now()}));return d.codePointAt(0)!==94||!i.includes(d.slice(1))?n(c):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(c),t.exit("gfmFootnoteCallLabelMarker"),e(c))}}function t5e(t,e){let n=t.length;for(;n--;)if(t[n][1].type==="labelImage"&&t[n][0]==="enter"){t[n][1];break}t[n+1][1].type="data",t[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},t[n+3][1].start),end:Object.assign({},t[t.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},t[n+3][1].end),end:Object.assign({},t[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},t[t.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},l=[t[n+1],t[n+2],["enter",r,e],t[n+3],t[n+4],["enter",s,e],["exit",s,e],["enter",i,e],["enter",a,e],["exit",a,e],["exit",i,e],t[t.length-2],t[t.length-1],["exit",r,e]];return t.splice(n,t.length-n+1,...l),t}function n5e(t,e,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,a;return l;function l(m){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(m),t.exit("gfmFootnoteCallLabelMarker"),c}function c(m){return m!==94?n(m):(t.enter("gfmFootnoteCallMarker"),t.consume(m),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",d)}function d(m){if(i>999||m===93&&!a||m===null||m===91||dr(m))return n(m);if(m===93){t.exit("chunkString");const g=t.exit("gfmFootnoteCallString");return s.includes(Xa(r.sliceSerialize(g)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(m),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(m)}return dr(m)||(a=!0),i++,t.consume(m),m===92?h:d}function h(m){return m===91||m===92||m===93?(t.consume(m),i++,d):d(m)}}function r5e(t,e,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0,l;return c;function c(y){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(y),t.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(y){return y===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(y),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",h):n(y)}function h(y){if(a>999||y===93&&!l||y===null||y===91||dr(y))return n(y);if(y===93){t.exit("chunkString");const w=t.exit("gfmFootnoteDefinitionLabelString");return i=Xa(r.sliceSerialize(w)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(y),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),g}return dr(y)||(l=!0),a++,t.consume(y),y===92?m:h}function m(y){return y===91||y===92||y===93?(t.consume(y),a++,h):h(y)}function g(y){return y===58?(t.enter("definitionMarker"),t.consume(y),t.exit("definitionMarker"),s.includes(i)||s.push(i),cn(t,x,"gfmFootnoteDefinitionWhitespace")):n(y)}function x(y){return e(y)}}function s5e(t,e,n){return t.check(gg,e,t.attempt(ZSe,e,n))}function i5e(t){t.exit("gfmFootnoteDefinition")}function a5e(t,e,n){const r=this;return cn(t,s,"gfmFootnoteDefinitionIndent",5);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?e(i):n(i)}}function o5e(t){let n=(t||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(a,l){let c=-1;for(;++c<a.length;)if(a[c][0]==="enter"&&a[c][1].type==="strikethroughSequenceTemporary"&&a[c][1]._close){let d=c;for(;d--;)if(a[d][0]==="exit"&&a[d][1].type==="strikethroughSequenceTemporary"&&a[d][1]._open&&a[c][1].end.offset-a[c][1].start.offset===a[d][1].end.offset-a[d][1].start.offset){a[c][1].type="strikethroughSequence",a[d][1].type="strikethroughSequence";const h={type:"strikethrough",start:Object.assign({},a[d][1].start),end:Object.assign({},a[c][1].end)},m={type:"strikethroughText",start:Object.assign({},a[d][1].end),end:Object.assign({},a[c][1].start)},g=[["enter",h,l],["enter",a[d][1],l],["exit",a[d][1],l],["enter",m,l]],x=l.parser.constructs.insideSpan.null;x&&Ki(g,g.length,0,$b(x,a.slice(d+1,c),l)),Ki(g,g.length,0,[["exit",m,l],["enter",a[c][1],l],["exit",a[c][1],l],["exit",h,l]]),Ki(a,d-1,c-d+3,g),c=d+g.length-2;break}}for(c=-1;++c<a.length;)a[c][1].type==="strikethroughSequenceTemporary"&&(a[c][1].type="data");return a}function i(a,l,c){const d=this.previous,h=this.events;let m=0;return g;function g(y){return d===126&&h[h.length-1][1].type!=="characterEscape"?c(y):(a.enter("strikethroughSequenceTemporary"),x(y))}function x(y){const w=hf(d);if(y===126)return m>1?c(y):(a.consume(y),m++,x);if(m<2&&!n)return c(y);const S=a.exit("strikethroughSequenceTemporary"),k=hf(y);return S._open=!k||k===2&&!!w,S._close=!w||w===2&&!!k,l(y)}}}class l5e{constructor(){this.map=[]}add(e,n,r){c5e(this,e,n,r)}consume(e){if(this.map.sort(function(i,a){return i[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][0];r.push(e.slice()),e.length=0;let s=r.pop();for(;s;){for(const i of s)e.push(i);s=r.pop()}this.map.length=0}}function c5e(t,e,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s<t.map.length;){if(t.map[s][0]===e){t.map[s][1]+=n,t.map[s][2].push(...r);return}s+=1}t.map.push([e,n,r])}}function u5e(t,e){let n=!1;const r=[];for(;e<t.length;){const s=t[e];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&r.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){const i=r.length-1;r[i]=r[i]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);e+=1}return r}function d5e(){return{flow:{null:{name:"table",tokenize:h5e,resolveAll:f5e}}}}function h5e(t,e,n){const r=this;let s=0,i=0,a;return l;function l(B){let H=r.events.length-1;for(;H>-1;){const I=r.events[H][1].type;if(I==="lineEnding"||I==="linePrefix")H--;else break}const W=H>-1?r.events[H][1].type:null,ee=W==="tableHead"||W==="tableRow"?_:c;return ee===_&&r.parser.lazy[r.now().line]?n(B):ee(B)}function c(B){return t.enter("tableHead"),t.enter("tableRow"),d(B)}function d(B){return B===124||(a=!0,i+=1),h(B)}function h(B){return B===null?n(B):St(B)?i>1?(i=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(B),t.exit("lineEnding"),x):n(B):gn(B)?cn(t,h,"whitespace")(B):(i+=1,a&&(a=!1,s+=1),B===124?(t.enter("tableCellDivider"),t.consume(B),t.exit("tableCellDivider"),a=!0,h):(t.enter("data"),m(B)))}function m(B){return B===null||B===124||dr(B)?(t.exit("data"),h(B)):(t.consume(B),B===92?g:m)}function g(B){return B===92||B===124?(t.consume(B),m):m(B)}function x(B){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(B):(t.enter("tableDelimiterRow"),a=!1,gn(B)?cn(t,y,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):y(B))}function y(B){return B===45||B===58?S(B):B===124?(a=!0,t.enter("tableCellDivider"),t.consume(B),t.exit("tableCellDivider"),w):E(B)}function w(B){return gn(B)?cn(t,S,"whitespace")(B):S(B)}function S(B){return B===58?(i+=1,a=!0,t.enter("tableDelimiterMarker"),t.consume(B),t.exit("tableDelimiterMarker"),k):B===45?(i+=1,k(B)):B===null||St(B)?T(B):E(B)}function k(B){return B===45?(t.enter("tableDelimiterFiller"),j(B)):E(B)}function j(B){return B===45?(t.consume(B),j):B===58?(a=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(B),t.exit("tableDelimiterMarker"),N):(t.exit("tableDelimiterFiller"),N(B))}function N(B){return gn(B)?cn(t,T,"whitespace")(B):T(B)}function T(B){return B===124?y(B):B===null||St(B)?!a||s!==i?E(B):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(B)):E(B)}function E(B){return n(B)}function _(B){return t.enter("tableRow"),A(B)}function A(B){return B===124?(t.enter("tableCellDivider"),t.consume(B),t.exit("tableCellDivider"),A):B===null||St(B)?(t.exit("tableRow"),e(B)):gn(B)?cn(t,A,"whitespace")(B):(t.enter("data"),D(B))}function D(B){return B===null||B===124||dr(B)?(t.exit("data"),A(B)):(t.consume(B),B===92?q:D)}function q(B){return B===92||B===124?(t.consume(B),D):D(B)}}function f5e(t,e){let n=-1,r=!0,s=0,i=[0,0,0,0],a=[0,0,0,0],l=!1,c=0,d,h,m;const g=new l5e;for(;++n<t.length;){const x=t[n],y=x[1];x[0]==="enter"?y.type==="tableHead"?(l=!1,c!==0&&(mR(g,e,c,d,h),h=void 0,c=0),d={type:"table",start:Object.assign({},y.start),end:Object.assign({},y.end)},g.add(n,0,[["enter",d,e]])):y.type==="tableRow"||y.type==="tableDelimiterRow"?(r=!0,m=void 0,i=[0,0,0,0],a=[0,n+1,0,0],l&&(l=!1,h={type:"tableBody",start:Object.assign({},y.start),end:Object.assign({},y.end)},g.add(n,0,[["enter",h,e]])),s=y.type==="tableDelimiterRow"?2:h?3:1):s&&(y.type==="data"||y.type==="tableDelimiterMarker"||y.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(i[1]!==0&&(a[0]=a[1],m=P1(g,e,i,s,void 0,m),i=[0,0,0,0]),a[2]=n)):y.type==="tableCellDivider"&&(r?r=!1:(i[1]!==0&&(a[0]=a[1],m=P1(g,e,i,s,void 0,m)),i=a,a=[i[1],n,0,0])):y.type==="tableHead"?(l=!0,c=n):y.type==="tableRow"||y.type==="tableDelimiterRow"?(c=n,i[1]!==0?(a[0]=a[1],m=P1(g,e,i,s,n,m)):a[1]!==0&&(m=P1(g,e,a,s,n,m)),s=0):s&&(y.type==="data"||y.type==="tableDelimiterMarker"||y.type==="tableDelimiterFiller")&&(a[3]=n)}for(c!==0&&mR(g,e,c,d,h),g.consume(e.events),n=-1;++n<e.events.length;){const x=e.events[n];x[0]==="enter"&&x[1].type==="table"&&(x[1]._align=u5e(e.events,n))}return t}function P1(t,e,n,r,s,i){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",l="tableContent";n[0]!==0&&(i.end=Object.assign({},jh(e.events,n[0])),t.add(n[0],0,[["exit",i,e]]));const c=jh(e.events,n[1]);if(i={type:a,start:Object.assign({},c),end:Object.assign({},c)},t.add(n[1],0,[["enter",i,e]]),n[2]!==0){const d=jh(e.events,n[2]),h=jh(e.events,n[3]),m={type:l,start:Object.assign({},d),end:Object.assign({},h)};if(t.add(n[2],0,[["enter",m,e]]),r!==2){const g=e.events[n[2]],x=e.events[n[3]];if(g[1].end=Object.assign({},x[1].end),g[1].type="chunkText",g[1].contentType="text",n[3]>n[2]+1){const y=n[2]+1,w=n[3]-n[2]-1;t.add(y,w,[])}}t.add(n[3]+1,0,[["exit",m,e]])}return s!==void 0&&(i.end=Object.assign({},jh(e.events,s)),t.add(s,0,[["exit",i,e]]),i=void 0),i}function mR(t,e,n,r,s){const i=[],a=jh(e.events,n);s&&(s.end=Object.assign({},a),i.push(["exit",s,e])),r.end=Object.assign({},a),i.push(["exit",r,e]),t.add(n+1,0,i)}function jh(t,e){const n=t[e],r=n[0]==="enter"?"start":"end";return n[1][r]}const m5e={name:"tasklistCheck",tokenize:g5e};function p5e(){return{text:{91:m5e}}}function g5e(t,e,n){const r=this;return s;function s(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(c),t.exit("taskListCheckMarker"),i)}function i(c){return dr(c)?(t.enter("taskListCheckValueUnchecked"),t.consume(c),t.exit("taskListCheckValueUnchecked"),a):c===88||c===120?(t.enter("taskListCheckValueChecked"),t.consume(c),t.exit("taskListCheckValueChecked"),a):n(c)}function a(c){return c===93?(t.enter("taskListCheckMarker"),t.consume(c),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),l):n(c)}function l(c){return St(c)?e(c):gn(c)?t.check({tokenize:x5e},e,n)(c):n(c)}}function x5e(t,e,n){return cn(t,r,"whitespace");function r(s){return s===null?n(s):e(s)}}function v5e(t){return oV([HSe(),JSe(),o5e(t),d5e(),p5e()])}const y5e={};function b5e(t){const e=this,n=t||y5e,r=e.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(v5e(n)),i.push(BSe()),a.push(FSe(n))}function w5e(){return{enter:{mathFlow:t,mathFlowFenceMeta:e,mathText:i},exit:{mathFlow:s,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:l,mathText:a,mathTextData:l}};function t(c){const d={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[d]}},c)}function e(){this.buffer()}function n(){const c=this.resume(),d=this.stack[this.stack.length-1];d.type,d.meta=c}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function s(c){const d=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),h=this.stack[this.stack.length-1];h.type,this.exit(c),h.value=d;const m=h.data.hChildren[0];m.type,m.tagName,m.children.push({type:"text",value:d}),this.data.mathFlowInside=void 0}function i(c){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},c),this.buffer()}function a(c){const d=this.resume(),h=this.stack[this.stack.length-1];h.type,this.exit(c),h.value=d,h.data.hChildren.push({type:"text",value:d})}function l(c){this.config.enter.data.call(this,c),this.config.exit.data.call(this,c)}}function S5e(t){let e=(t||{}).singleDollarTextMath;return e==null&&(e=!0),r.peek=s,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:`
|
||
`,inConstruct:"mathFlowMeta"},{character:"$",after:e?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:n,inlineMath:r}};function n(i,a,l,c){const d=i.value||"",h=l.createTracker(c),m="$".repeat(Math.max(MV(d,"$")+1,2)),g=l.enter("mathFlow");let x=h.move(m);if(i.meta){const y=l.enter("mathFlowMeta");x+=h.move(l.safe(i.meta,{after:`
|
||
`,before:x,encode:["$"],...h.current()})),y()}return x+=h.move(`
|
||
`),d&&(x+=h.move(d+`
|
||
`)),x+=h.move(m),g(),x}function r(i,a,l){let c=i.value||"",d=1;for(e||d++;new RegExp("(^|[^$])"+"\\$".repeat(d)+"([^$]|$)").test(c);)d++;const h="$".repeat(d);/[^ \r\n]/.test(c)&&(/^[ \r\n]/.test(c)&&/[ \r\n]$/.test(c)||/^\$|\$$/.test(c))&&(c=" "+c+" ");let m=-1;for(;++m<l.unsafe.length;){const g=l.unsafe[m];if(!g.atBreak)continue;const x=l.compilePattern(g);let y;for(;y=x.exec(c);){let w=y.index;c.codePointAt(w)===10&&c.codePointAt(w-1)===13&&w--,c=c.slice(0,w)+" "+c.slice(y.index+1)}}return h+c+h}function s(){return"$"}}const k5e={tokenize:O5e,concrete:!0,name:"mathFlow"},pR={tokenize:j5e,partial:!0};function O5e(t,e,n){const r=this,s=r.events[r.events.length-1],i=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0;let a=0;return l;function l(j){return t.enter("mathFlow"),t.enter("mathFlowFence"),t.enter("mathFlowFenceSequence"),c(j)}function c(j){return j===36?(t.consume(j),a++,c):a<2?n(j):(t.exit("mathFlowFenceSequence"),cn(t,d,"whitespace")(j))}function d(j){return j===null||St(j)?m(j):(t.enter("mathFlowFenceMeta"),t.enter("chunkString",{contentType:"string"}),h(j))}function h(j){return j===null||St(j)?(t.exit("chunkString"),t.exit("mathFlowFenceMeta"),m(j)):j===36?n(j):(t.consume(j),h)}function m(j){return t.exit("mathFlowFence"),r.interrupt?e(j):t.attempt(pR,g,S)(j)}function g(j){return t.attempt({tokenize:k,partial:!0},S,x)(j)}function x(j){return(i?cn(t,y,"linePrefix",i+1):y)(j)}function y(j){return j===null?S(j):St(j)?t.attempt(pR,g,S)(j):(t.enter("mathFlowValue"),w(j))}function w(j){return j===null||St(j)?(t.exit("mathFlowValue"),y(j)):(t.consume(j),w)}function S(j){return t.exit("mathFlow"),e(j)}function k(j,N,T){let E=0;return cn(j,_,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function _(q){return j.enter("mathFlowFence"),j.enter("mathFlowFenceSequence"),A(q)}function A(q){return q===36?(E++,j.consume(q),A):E<a?T(q):(j.exit("mathFlowFenceSequence"),cn(j,D,"whitespace")(q))}function D(q){return q===null||St(q)?(j.exit("mathFlowFence"),N(q)):T(q)}}}function j5e(t,e,n){const r=this;return s;function s(a){return a===null?e(a):(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),i)}function i(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}function N5e(t){let n=(t||{}).singleDollarTextMath;return n==null&&(n=!0),{tokenize:r,resolve:C5e,previous:T5e,name:"mathText"};function r(s,i,a){let l=0,c,d;return h;function h(w){return s.enter("mathText"),s.enter("mathTextSequence"),m(w)}function m(w){return w===36?(s.consume(w),l++,m):l<2&&!n?a(w):(s.exit("mathTextSequence"),g(w))}function g(w){return w===null?a(w):w===36?(d=s.enter("mathTextSequence"),c=0,y(w)):w===32?(s.enter("space"),s.consume(w),s.exit("space"),g):St(w)?(s.enter("lineEnding"),s.consume(w),s.exit("lineEnding"),g):(s.enter("mathTextData"),x(w))}function x(w){return w===null||w===32||w===36||St(w)?(s.exit("mathTextData"),g(w)):(s.consume(w),x)}function y(w){return w===36?(s.consume(w),c++,y):c===l?(s.exit("mathTextSequence"),s.exit("mathText"),i(w)):(d.type="mathTextData",x(w))}}}function C5e(t){let e=t.length-4,n=3,r,s;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r<e;)if(t[r][1].type==="mathTextData"){t[e][1].type="mathTextPadding",t[n][1].type="mathTextPadding",n+=2,e-=2;break}}for(r=n-1,e++;++r<=e;)s===void 0?r!==e&&t[r][1].type!=="lineEnding"&&(s=r):(r===e||t[r][1].type==="lineEnding")&&(t[s][1].type="mathTextData",r!==s+2&&(t[s][1].end=t[r-1][1].end,t.splice(s+2,r-s-2),e-=r-s-2,r=s+2),s=void 0);return t}function T5e(t){return t!==36||this.events[this.events.length-1][1].type==="characterEscape"}function E5e(t){return{flow:{36:k5e},text:{36:N5e(t)}}}class xi{constructor(e,n,r){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=n,this.end=r}static range(e,n){return n?!e||!e.loc||!n.loc||e.loc.lexer!==n.loc.lexer?null:new xi(e.loc.lexer,e.loc.start,n.loc.end):e&&e.loc}}class Zi{constructor(e,n){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=n}range(e,n){return new Zi(n,xi.range(this,e))}}class qe{constructor(e,n){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var r="KaTeX parse error: "+e,s,i,a=n&&n.loc;if(a&&a.start<=a.end){var l=a.lexer.input;s=a.start,i=a.end,s===l.length?r+=" at end of input: ":r+=" at position "+(s+1)+": ";var c=l.slice(s,i).replace(/[^]/g,"$&̲"),d;s>15?d="…"+l.slice(s-15,s):d=l.slice(0,s);var h;i+15<l.length?h=l.slice(i,i+15)+"…":h=l.slice(i),r+=d+c+h}var m=new Error(r);return m.name="ParseError",m.__proto__=qe.prototype,m.position=s,s!=null&&i!=null&&(m.length=i-s),m.rawMessage=e,m}}qe.prototype.__proto__=Error.prototype;var _5e=function(e,n){return e===void 0?n:e},A5e=/([A-Z])/g,M5e=function(e){return e.replace(A5e,"-$1").toLowerCase()},R5e={"&":"&",">":">","<":"<",'"':""","'":"'"},D5e=/[&><"']/g;function P5e(t){return String(t).replace(D5e,e=>R5e[e])}var ZV=function t(e){return e.type==="ordgroup"||e.type==="color"?e.body.length===1?t(e.body[0]):e:e.type==="font"?t(e.body):e},z5e=function(e){var n=ZV(e);return n.type==="mathord"||n.type==="textord"||n.type==="atom"},I5e=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e},L5e=function(e){var n=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return n?n[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(n[1])?null:n[1].toLowerCase():"_relative"},Wn={deflt:_5e,escape:P5e,hyphenate:M5e,getBaseElem:ZV,isCharacterBox:z5e,protocolFromUrl:L5e},Tv={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:t=>"#"+t},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:(t,e)=>(e.push(t),e)},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:t=>Math.max(0,t),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:t=>Math.max(0,t),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:t=>Math.max(0,t),cli:"-e, --max-expand <n>",cliProcessor:t=>t==="Infinity"?1/0:parseInt(t)},globalGroup:{type:"boolean",cli:!1}};function B5e(t){if(t.default)return t.default;var e=t.type,n=Array.isArray(e)?e[0]:e;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 _N{constructor(e){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,e=e||{};for(var n in Tv)if(Tv.hasOwnProperty(n)){var r=Tv[n];this[n]=e[n]!==void 0?r.processor?r.processor(e[n]):e[n]:B5e(r)}}reportNonstrict(e,n,r){var s=this.strict;if(typeof s=="function"&&(s=s(e,n,r)),!(!s||s==="ignore")){if(s===!0||s==="error")throw new qe("LaTeX-incompatible input and strict mode is set to 'error': "+(n+" ["+e+"]"),r);s==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+s+"': "+n+" ["+e+"]"))}}useStrictBehavior(e,n,r){var s=this.strict;if(typeof s=="function")try{s=s(e,n,r)}catch{s="error"}return!s||s==="ignore"?!1:s===!0||s==="error"?!0:s==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+s+"': "+n+" ["+e+"]")),!1)}isTrusted(e){if(e.url&&!e.protocol){var n=Wn.protocolFromUrl(e.url);if(n==null)return!1;e.protocol=n}var r=typeof this.trust=="function"?this.trust(e):this.trust;return!!r}}class _c{constructor(e,n,r){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=n,this.cramped=r}sup(){return So[F5e[this.id]]}sub(){return So[q5e[this.id]]}fracNum(){return So[$5e[this.id]]}fracDen(){return So[H5e[this.id]]}cramp(){return So[Q5e[this.id]]}text(){return So[V5e[this.id]]}isTight(){return this.size>=2}}var AN=0,Cy=1,Hh=2,Fl=3,wp=4,Na=5,ff=6,ni=7,So=[new _c(AN,0,!1),new _c(Cy,0,!0),new _c(Hh,1,!1),new _c(Fl,1,!0),new _c(wp,2,!1),new _c(Na,2,!0),new _c(ff,3,!1),new _c(ni,3,!0)],F5e=[wp,Na,wp,Na,ff,ni,ff,ni],q5e=[Na,Na,Na,Na,ni,ni,ni,ni],$5e=[Hh,Fl,wp,Na,ff,ni,ff,ni],H5e=[Fl,Fl,Na,Na,ni,ni,ni,ni],Q5e=[Cy,Cy,Fl,Fl,Na,Na,ni,ni],V5e=[AN,Cy,Hh,Fl,Hh,Fl,Hh,Fl],At={DISPLAY:So[AN],TEXT:So[Hh],SCRIPT:So[wp],SCRIPTSCRIPT:So[ff]},qO=[{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 U5e(t){for(var e=0;e<qO.length;e++)for(var n=qO[e],r=0;r<n.blocks.length;r++){var s=n.blocks[r];if(t>=s[0]&&t<=s[1])return n.name}return null}var Ev=[];qO.forEach(t=>t.blocks.forEach(e=>Ev.push(...e)));function JV(t){for(var e=0;e<Ev.length;e+=2)if(t>=Ev[e]&&t<=Ev[e+1])return!0;return!1}var dh=80,W5e=function(e,n){return"M95,"+(622+e+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`+e/2.075+" -"+e+`
|
||
c5.3,-9.3,12,-14,20,-14
|
||
H400000v`+(40+e)+`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+e)+" "+n+"h400000v"+(40+e)+"h-400000z"},G5e=function(e,n){return"M263,"+(601+e+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`+e/2.084+" -"+e+`
|
||
c4.7,-7.3,11,-11,19,-11
|
||
H40000v`+(40+e)+`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+e)+" "+n+"h400000v"+(40+e)+"h-400000z"},X5e=function(e,n){return"M983 "+(10+e+n)+`
|
||
l`+e/3.13+" -"+e+`
|
||
c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+`
|
||
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+e)+" "+n+"h400000v"+(40+e)+"h-400000z"},Y5e=function(e,n){return"M424,"+(2398+e+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`+e/4.223+" -"+e+`c4,-6.7,10,-10,18,-10 H400000
|
||
v`+(40+e)+`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+e)+" "+n+`
|
||
h400000v`+(40+e)+"h-400000z"},K5e=function(e,n){return"M473,"+(2713+e+n)+`
|
||
c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+" -"+e+`
|
||
c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`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+e)+" "+n+"h400000v"+(40+e)+"H1017.7z"},Z5e=function(e){var n=e/2;return"M400000 "+e+" H0 L"+n+" 0 l65 45 L145 "+(e-80)+" H400000z"},J5e=function(e,n,r){var s=r-54-n-e;return"M702 "+(e+n)+"H400000"+(40+e)+`
|
||
H742v`+s+`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+e)+"H742z"},e3e=function(e,n,r){n=1e3*n;var s="";switch(e){case"sqrtMain":s=W5e(n,dh);break;case"sqrtSize1":s=G5e(n,dh);break;case"sqrtSize2":s=X5e(n,dh);break;case"sqrtSize3":s=Y5e(n,dh);break;case"sqrtSize4":s=K5e(n,dh);break;case"sqrtTall":s=J5e(n,dh,r)}return s},t3e=function(e,n){switch(e){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""}},gR={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`},n3e=function(e,n){switch(e){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 yg{constructor(e){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=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e}toMarkup(){for(var e="",n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e}toText(){var e=n=>n.toText();return this.children.map(e).join("")}}var Mo={"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]}},z1={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]},xR={Å:"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 r3e(t,e){Mo[t]=e}function MN(t,e,n){if(!Mo[e])throw new Error("Font metrics not found for font: "+e+".");var r=t.charCodeAt(0),s=Mo[e][r];if(!s&&t[0]in xR&&(r=xR[t[0]].charCodeAt(0),s=Mo[e][r]),!s&&n==="text"&&JV(r)&&(s=Mo[e][77]),s)return{depth:s[0],height:s[1],italic:s[2],skew:s[3],width:s[4]}}var XS={};function s3e(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!XS[e]){var n=XS[e]={cssEmPerMu:z1.quad[e]/18};for(var r in z1)z1.hasOwnProperty(r)&&(n[r]=z1[r][e])}return XS[e]}var i3e=[[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]],vR=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],yR=function(e,n){return n.size<2?e:i3e[e-1][n.size-1]};class Al{constructor(e){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=e.style,this.color=e.color,this.size=e.size||Al.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=vR[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){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 r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);return new Al(n)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:yR(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:vR[e-1]})}havingBaseStyle(e){e=e||this.style.text();var n=yR(Al.BASESIZE,e);return this.size===n&&this.textSize===Al.BASESIZE&&this.style===e?this:this.extend({style:e,size:n})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Al.BASESIZE?["sizing","reset-size"+this.size,"size"+Al.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=s3e(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Al.BASESIZE=6;var $O={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},a3e={ex:!0,em:!0,mu:!0},eU=function(e){return typeof e!="string"&&(e=e.unit),e in $O||e in a3e||e==="ex"},Ir=function(e,n){var r;if(e.unit in $O)r=$O[e.unit]/n.fontMetrics().ptPerEm/n.sizeMultiplier;else if(e.unit==="mu")r=n.fontMetrics().cssEmPerMu;else{var s;if(n.style.isTight()?s=n.havingStyle(n.style.text()):s=n,e.unit==="ex")r=s.fontMetrics().xHeight;else if(e.unit==="em")r=s.fontMetrics().quad;else throw new qe("Invalid unit: '"+e.unit+"'");s!==n&&(r*=s.sizeMultiplier/n.sizeMultiplier)}return Math.min(e.number*r,n.maxSize)},Xe=function(e){return+e.toFixed(4)+"em"},ru=function(e){return e.filter(n=>n).join(" ")},tU=function(e,n,r){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},n){n.style.isTight()&&this.classes.push("mtight");var s=n.getColor();s&&(this.style.color=s)}},nU=function(e){var n=document.createElement(e);n.className=ru(this.classes);for(var r in this.style)this.style.hasOwnProperty(r)&&(n.style[r]=this.style[r]);for(var s in this.attributes)this.attributes.hasOwnProperty(s)&&n.setAttribute(s,this.attributes[s]);for(var i=0;i<this.children.length;i++)n.appendChild(this.children[i].toNode());return n},o3e=/[\s"'>/=\x00-\x1f]/,rU=function(e){var n="<"+e;this.classes.length&&(n+=' class="'+Wn.escape(ru(this.classes))+'"');var r="";for(var s in this.style)this.style.hasOwnProperty(s)&&(r+=Wn.hyphenate(s)+":"+this.style[s]+";");r&&(n+=' style="'+Wn.escape(r)+'"');for(var i in this.attributes)if(this.attributes.hasOwnProperty(i)){if(o3e.test(i))throw new qe("Invalid attribute name '"+i+"'");n+=" "+i+'="'+Wn.escape(this.attributes[i])+'"'}n+=">";for(var a=0;a<this.children.length;a++)n+=this.children[a].toMarkup();return n+="</"+e+">",n};class bg{constructor(e,n,r,s){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,tU.call(this,e,r,s),this.children=n||[]}setAttribute(e,n){this.attributes[e]=n}hasClass(e){return this.classes.includes(e)}toNode(){return nU.call(this,"span")}toMarkup(){return rU.call(this,"span")}}class RN{constructor(e,n,r,s){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,tU.call(this,n,s),this.children=r||[],this.setAttribute("href",e)}setAttribute(e,n){this.attributes[e]=n}hasClass(e){return this.classes.includes(e)}toNode(){return nU.call(this,"a")}toMarkup(){return rU.call(this,"a")}}class l3e{constructor(e,n,r){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=e,this.classes=["mord"],this.style=r}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement("img");e.src=this.src,e.alt=this.alt,e.className="mord";for(var n in this.style)this.style.hasOwnProperty(n)&&(e.style[n]=this.style[n]);return e}toMarkup(){var e='<img src="'+Wn.escape(this.src)+'"'+(' alt="'+Wn.escape(this.alt)+'"'),n="";for(var r in this.style)this.style.hasOwnProperty(r)&&(n+=Wn.hyphenate(r)+":"+this.style[r]+";");return n&&(e+=' style="'+Wn.escape(n)+'"'),e+="'/>",e}}var c3e={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class Ma{constructor(e,n,r,s,i,a,l,c){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=e,this.height=n||0,this.depth=r||0,this.italic=s||0,this.skew=i||0,this.width=a||0,this.classes=l||[],this.style=c||{},this.maxFontSize=0;var d=U5e(this.text.charCodeAt(0));d&&this.classes.push(d+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=c3e[this.text])}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createTextNode(this.text),n=null;this.italic>0&&(n=document.createElement("span"),n.style.marginRight=Xe(this.italic)),this.classes.length>0&&(n=n||document.createElement("span"),n.className=ru(this.classes));for(var r in this.style)this.style.hasOwnProperty(r)&&(n=n||document.createElement("span"),n.style[r]=this.style[r]);return n?(n.appendChild(e),n):e}toMarkup(){var e=!1,n="<span";this.classes.length&&(e=!0,n+=' class="',n+=Wn.escape(ru(this.classes)),n+='"');var r="";this.italic>0&&(r+="margin-right:"+this.italic+"em;");for(var s in this.style)this.style.hasOwnProperty(s)&&(r+=Wn.hyphenate(s)+":"+this.style[s]+";");r&&(e=!0,n+=' style="'+Wn.escape(r)+'"');var i=Wn.escape(this.text);return e?(n+=">",n+=i,n+="</span>",n):i}}class Ul{constructor(e,n){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=n||{}}toNode(){var e="http://www.w3.org/2000/svg",n=document.createElementNS(e,"svg");for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&n.setAttribute(r,this.attributes[r]);for(var s=0;s<this.children.length;s++)n.appendChild(this.children[s].toNode());return n}toMarkup(){var e='<svg xmlns="http://www.w3.org/2000/svg"';for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&(e+=" "+n+'="'+Wn.escape(this.attributes[n])+'"');e+=">";for(var r=0;r<this.children.length;r++)e+=this.children[r].toMarkup();return e+="</svg>",e}}class su{constructor(e,n){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=n}toNode(){var e="http://www.w3.org/2000/svg",n=document.createElementNS(e,"path");return this.alternate?n.setAttribute("d",this.alternate):n.setAttribute("d",gR[this.pathName]),n}toMarkup(){return this.alternate?'<path d="'+Wn.escape(this.alternate)+'"/>':'<path d="'+Wn.escape(gR[this.pathName])+'"/>'}}class HO{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",n=document.createElementNS(e,"line");for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&n.setAttribute(r,this.attributes[r]);return n}toMarkup(){var e="<line";for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&(e+=" "+n+'="'+Wn.escape(this.attributes[n])+'"');return e+="/>",e}}function bR(t){if(t instanceof Ma)return t;throw new Error("Expected symbolNode but got "+String(t)+".")}function u3e(t){if(t instanceof bg)return t;throw new Error("Expected span<HtmlDomNode> but got "+String(t)+".")}var d3e={bin:1,close:1,inner:1,open:1,punct:1,rel:1},h3e={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},pr={math:{},text:{}};function M(t,e,n,r,s,i){pr[t][s]={font:e,group:n,replace:r},i&&r&&(pr[t][r]=pr[t][s])}var P="math",Le="text",Q="main",le="ams",_r="accent-token",it="bin",li="close",$f="inner",_t="mathord",os="op-token",ra="open",Vb="punct",ce="rel",tc="spacing",me="textord";M(P,Q,ce,"≡","\\equiv",!0);M(P,Q,ce,"≺","\\prec",!0);M(P,Q,ce,"≻","\\succ",!0);M(P,Q,ce,"∼","\\sim",!0);M(P,Q,ce,"⊥","\\perp");M(P,Q,ce,"⪯","\\preceq",!0);M(P,Q,ce,"⪰","\\succeq",!0);M(P,Q,ce,"≃","\\simeq",!0);M(P,Q,ce,"∣","\\mid",!0);M(P,Q,ce,"≪","\\ll",!0);M(P,Q,ce,"≫","\\gg",!0);M(P,Q,ce,"≍","\\asymp",!0);M(P,Q,ce,"∥","\\parallel");M(P,Q,ce,"⋈","\\bowtie",!0);M(P,Q,ce,"⌣","\\smile",!0);M(P,Q,ce,"⊑","\\sqsubseteq",!0);M(P,Q,ce,"⊒","\\sqsupseteq",!0);M(P,Q,ce,"≐","\\doteq",!0);M(P,Q,ce,"⌢","\\frown",!0);M(P,Q,ce,"∋","\\ni",!0);M(P,Q,ce,"∝","\\propto",!0);M(P,Q,ce,"⊢","\\vdash",!0);M(P,Q,ce,"⊣","\\dashv",!0);M(P,Q,ce,"∋","\\owns");M(P,Q,Vb,".","\\ldotp");M(P,Q,Vb,"⋅","\\cdotp");M(P,Q,me,"#","\\#");M(Le,Q,me,"#","\\#");M(P,Q,me,"&","\\&");M(Le,Q,me,"&","\\&");M(P,Q,me,"ℵ","\\aleph",!0);M(P,Q,me,"∀","\\forall",!0);M(P,Q,me,"ℏ","\\hbar",!0);M(P,Q,me,"∃","\\exists",!0);M(P,Q,me,"∇","\\nabla",!0);M(P,Q,me,"♭","\\flat",!0);M(P,Q,me,"ℓ","\\ell",!0);M(P,Q,me,"♮","\\natural",!0);M(P,Q,me,"♣","\\clubsuit",!0);M(P,Q,me,"℘","\\wp",!0);M(P,Q,me,"♯","\\sharp",!0);M(P,Q,me,"♢","\\diamondsuit",!0);M(P,Q,me,"ℜ","\\Re",!0);M(P,Q,me,"♡","\\heartsuit",!0);M(P,Q,me,"ℑ","\\Im",!0);M(P,Q,me,"♠","\\spadesuit",!0);M(P,Q,me,"§","\\S",!0);M(Le,Q,me,"§","\\S");M(P,Q,me,"¶","\\P",!0);M(Le,Q,me,"¶","\\P");M(P,Q,me,"†","\\dag");M(Le,Q,me,"†","\\dag");M(Le,Q,me,"†","\\textdagger");M(P,Q,me,"‡","\\ddag");M(Le,Q,me,"‡","\\ddag");M(Le,Q,me,"‡","\\textdaggerdbl");M(P,Q,li,"⎱","\\rmoustache",!0);M(P,Q,ra,"⎰","\\lmoustache",!0);M(P,Q,li,"⟯","\\rgroup",!0);M(P,Q,ra,"⟮","\\lgroup",!0);M(P,Q,it,"∓","\\mp",!0);M(P,Q,it,"⊖","\\ominus",!0);M(P,Q,it,"⊎","\\uplus",!0);M(P,Q,it,"⊓","\\sqcap",!0);M(P,Q,it,"∗","\\ast");M(P,Q,it,"⊔","\\sqcup",!0);M(P,Q,it,"◯","\\bigcirc",!0);M(P,Q,it,"∙","\\bullet",!0);M(P,Q,it,"‡","\\ddagger");M(P,Q,it,"≀","\\wr",!0);M(P,Q,it,"⨿","\\amalg");M(P,Q,it,"&","\\And");M(P,Q,ce,"⟵","\\longleftarrow",!0);M(P,Q,ce,"⇐","\\Leftarrow",!0);M(P,Q,ce,"⟸","\\Longleftarrow",!0);M(P,Q,ce,"⟶","\\longrightarrow",!0);M(P,Q,ce,"⇒","\\Rightarrow",!0);M(P,Q,ce,"⟹","\\Longrightarrow",!0);M(P,Q,ce,"↔","\\leftrightarrow",!0);M(P,Q,ce,"⟷","\\longleftrightarrow",!0);M(P,Q,ce,"⇔","\\Leftrightarrow",!0);M(P,Q,ce,"⟺","\\Longleftrightarrow",!0);M(P,Q,ce,"↦","\\mapsto",!0);M(P,Q,ce,"⟼","\\longmapsto",!0);M(P,Q,ce,"↗","\\nearrow",!0);M(P,Q,ce,"↩","\\hookleftarrow",!0);M(P,Q,ce,"↪","\\hookrightarrow",!0);M(P,Q,ce,"↘","\\searrow",!0);M(P,Q,ce,"↼","\\leftharpoonup",!0);M(P,Q,ce,"⇀","\\rightharpoonup",!0);M(P,Q,ce,"↙","\\swarrow",!0);M(P,Q,ce,"↽","\\leftharpoondown",!0);M(P,Q,ce,"⇁","\\rightharpoondown",!0);M(P,Q,ce,"↖","\\nwarrow",!0);M(P,Q,ce,"⇌","\\rightleftharpoons",!0);M(P,le,ce,"≮","\\nless",!0);M(P,le,ce,"","\\@nleqslant");M(P,le,ce,"","\\@nleqq");M(P,le,ce,"⪇","\\lneq",!0);M(P,le,ce,"≨","\\lneqq",!0);M(P,le,ce,"","\\@lvertneqq");M(P,le,ce,"⋦","\\lnsim",!0);M(P,le,ce,"⪉","\\lnapprox",!0);M(P,le,ce,"⊀","\\nprec",!0);M(P,le,ce,"⋠","\\npreceq",!0);M(P,le,ce,"⋨","\\precnsim",!0);M(P,le,ce,"⪹","\\precnapprox",!0);M(P,le,ce,"≁","\\nsim",!0);M(P,le,ce,"","\\@nshortmid");M(P,le,ce,"∤","\\nmid",!0);M(P,le,ce,"⊬","\\nvdash",!0);M(P,le,ce,"⊭","\\nvDash",!0);M(P,le,ce,"⋪","\\ntriangleleft");M(P,le,ce,"⋬","\\ntrianglelefteq",!0);M(P,le,ce,"⊊","\\subsetneq",!0);M(P,le,ce,"","\\@varsubsetneq");M(P,le,ce,"⫋","\\subsetneqq",!0);M(P,le,ce,"","\\@varsubsetneqq");M(P,le,ce,"≯","\\ngtr",!0);M(P,le,ce,"","\\@ngeqslant");M(P,le,ce,"","\\@ngeqq");M(P,le,ce,"⪈","\\gneq",!0);M(P,le,ce,"≩","\\gneqq",!0);M(P,le,ce,"","\\@gvertneqq");M(P,le,ce,"⋧","\\gnsim",!0);M(P,le,ce,"⪊","\\gnapprox",!0);M(P,le,ce,"⊁","\\nsucc",!0);M(P,le,ce,"⋡","\\nsucceq",!0);M(P,le,ce,"⋩","\\succnsim",!0);M(P,le,ce,"⪺","\\succnapprox",!0);M(P,le,ce,"≆","\\ncong",!0);M(P,le,ce,"","\\@nshortparallel");M(P,le,ce,"∦","\\nparallel",!0);M(P,le,ce,"⊯","\\nVDash",!0);M(P,le,ce,"⋫","\\ntriangleright");M(P,le,ce,"⋭","\\ntrianglerighteq",!0);M(P,le,ce,"","\\@nsupseteqq");M(P,le,ce,"⊋","\\supsetneq",!0);M(P,le,ce,"","\\@varsupsetneq");M(P,le,ce,"⫌","\\supsetneqq",!0);M(P,le,ce,"","\\@varsupsetneqq");M(P,le,ce,"⊮","\\nVdash",!0);M(P,le,ce,"⪵","\\precneqq",!0);M(P,le,ce,"⪶","\\succneqq",!0);M(P,le,ce,"","\\@nsubseteqq");M(P,le,it,"⊴","\\unlhd");M(P,le,it,"⊵","\\unrhd");M(P,le,ce,"↚","\\nleftarrow",!0);M(P,le,ce,"↛","\\nrightarrow",!0);M(P,le,ce,"⇍","\\nLeftarrow",!0);M(P,le,ce,"⇏","\\nRightarrow",!0);M(P,le,ce,"↮","\\nleftrightarrow",!0);M(P,le,ce,"⇎","\\nLeftrightarrow",!0);M(P,le,ce,"△","\\vartriangle");M(P,le,me,"ℏ","\\hslash");M(P,le,me,"▽","\\triangledown");M(P,le,me,"◊","\\lozenge");M(P,le,me,"Ⓢ","\\circledS");M(P,le,me,"®","\\circledR");M(Le,le,me,"®","\\circledR");M(P,le,me,"∡","\\measuredangle",!0);M(P,le,me,"∄","\\nexists");M(P,le,me,"℧","\\mho");M(P,le,me,"Ⅎ","\\Finv",!0);M(P,le,me,"⅁","\\Game",!0);M(P,le,me,"‵","\\backprime");M(P,le,me,"▲","\\blacktriangle");M(P,le,me,"▼","\\blacktriangledown");M(P,le,me,"■","\\blacksquare");M(P,le,me,"⧫","\\blacklozenge");M(P,le,me,"★","\\bigstar");M(P,le,me,"∢","\\sphericalangle",!0);M(P,le,me,"∁","\\complement",!0);M(P,le,me,"ð","\\eth",!0);M(Le,Q,me,"ð","ð");M(P,le,me,"╱","\\diagup");M(P,le,me,"╲","\\diagdown");M(P,le,me,"□","\\square");M(P,le,me,"□","\\Box");M(P,le,me,"◊","\\Diamond");M(P,le,me,"¥","\\yen",!0);M(Le,le,me,"¥","\\yen",!0);M(P,le,me,"✓","\\checkmark",!0);M(Le,le,me,"✓","\\checkmark");M(P,le,me,"ℶ","\\beth",!0);M(P,le,me,"ℸ","\\daleth",!0);M(P,le,me,"ℷ","\\gimel",!0);M(P,le,me,"ϝ","\\digamma",!0);M(P,le,me,"ϰ","\\varkappa");M(P,le,ra,"┌","\\@ulcorner",!0);M(P,le,li,"┐","\\@urcorner",!0);M(P,le,ra,"└","\\@llcorner",!0);M(P,le,li,"┘","\\@lrcorner",!0);M(P,le,ce,"≦","\\leqq",!0);M(P,le,ce,"⩽","\\leqslant",!0);M(P,le,ce,"⪕","\\eqslantless",!0);M(P,le,ce,"≲","\\lesssim",!0);M(P,le,ce,"⪅","\\lessapprox",!0);M(P,le,ce,"≊","\\approxeq",!0);M(P,le,it,"⋖","\\lessdot");M(P,le,ce,"⋘","\\lll",!0);M(P,le,ce,"≶","\\lessgtr",!0);M(P,le,ce,"⋚","\\lesseqgtr",!0);M(P,le,ce,"⪋","\\lesseqqgtr",!0);M(P,le,ce,"≑","\\doteqdot");M(P,le,ce,"≓","\\risingdotseq",!0);M(P,le,ce,"≒","\\fallingdotseq",!0);M(P,le,ce,"∽","\\backsim",!0);M(P,le,ce,"⋍","\\backsimeq",!0);M(P,le,ce,"⫅","\\subseteqq",!0);M(P,le,ce,"⋐","\\Subset",!0);M(P,le,ce,"⊏","\\sqsubset",!0);M(P,le,ce,"≼","\\preccurlyeq",!0);M(P,le,ce,"⋞","\\curlyeqprec",!0);M(P,le,ce,"≾","\\precsim",!0);M(P,le,ce,"⪷","\\precapprox",!0);M(P,le,ce,"⊲","\\vartriangleleft");M(P,le,ce,"⊴","\\trianglelefteq");M(P,le,ce,"⊨","\\vDash",!0);M(P,le,ce,"⊪","\\Vvdash",!0);M(P,le,ce,"⌣","\\smallsmile");M(P,le,ce,"⌢","\\smallfrown");M(P,le,ce,"≏","\\bumpeq",!0);M(P,le,ce,"≎","\\Bumpeq",!0);M(P,le,ce,"≧","\\geqq",!0);M(P,le,ce,"⩾","\\geqslant",!0);M(P,le,ce,"⪖","\\eqslantgtr",!0);M(P,le,ce,"≳","\\gtrsim",!0);M(P,le,ce,"⪆","\\gtrapprox",!0);M(P,le,it,"⋗","\\gtrdot");M(P,le,ce,"⋙","\\ggg",!0);M(P,le,ce,"≷","\\gtrless",!0);M(P,le,ce,"⋛","\\gtreqless",!0);M(P,le,ce,"⪌","\\gtreqqless",!0);M(P,le,ce,"≖","\\eqcirc",!0);M(P,le,ce,"≗","\\circeq",!0);M(P,le,ce,"≜","\\triangleq",!0);M(P,le,ce,"∼","\\thicksim");M(P,le,ce,"≈","\\thickapprox");M(P,le,ce,"⫆","\\supseteqq",!0);M(P,le,ce,"⋑","\\Supset",!0);M(P,le,ce,"⊐","\\sqsupset",!0);M(P,le,ce,"≽","\\succcurlyeq",!0);M(P,le,ce,"⋟","\\curlyeqsucc",!0);M(P,le,ce,"≿","\\succsim",!0);M(P,le,ce,"⪸","\\succapprox",!0);M(P,le,ce,"⊳","\\vartriangleright");M(P,le,ce,"⊵","\\trianglerighteq");M(P,le,ce,"⊩","\\Vdash",!0);M(P,le,ce,"∣","\\shortmid");M(P,le,ce,"∥","\\shortparallel");M(P,le,ce,"≬","\\between",!0);M(P,le,ce,"⋔","\\pitchfork",!0);M(P,le,ce,"∝","\\varpropto");M(P,le,ce,"◀","\\blacktriangleleft");M(P,le,ce,"∴","\\therefore",!0);M(P,le,ce,"∍","\\backepsilon");M(P,le,ce,"▶","\\blacktriangleright");M(P,le,ce,"∵","\\because",!0);M(P,le,ce,"⋘","\\llless");M(P,le,ce,"⋙","\\gggtr");M(P,le,it,"⊲","\\lhd");M(P,le,it,"⊳","\\rhd");M(P,le,ce,"≂","\\eqsim",!0);M(P,Q,ce,"⋈","\\Join");M(P,le,ce,"≑","\\Doteq",!0);M(P,le,it,"∔","\\dotplus",!0);M(P,le,it,"∖","\\smallsetminus");M(P,le,it,"⋒","\\Cap",!0);M(P,le,it,"⋓","\\Cup",!0);M(P,le,it,"⩞","\\doublebarwedge",!0);M(P,le,it,"⊟","\\boxminus",!0);M(P,le,it,"⊞","\\boxplus",!0);M(P,le,it,"⋇","\\divideontimes",!0);M(P,le,it,"⋉","\\ltimes",!0);M(P,le,it,"⋊","\\rtimes",!0);M(P,le,it,"⋋","\\leftthreetimes",!0);M(P,le,it,"⋌","\\rightthreetimes",!0);M(P,le,it,"⋏","\\curlywedge",!0);M(P,le,it,"⋎","\\curlyvee",!0);M(P,le,it,"⊝","\\circleddash",!0);M(P,le,it,"⊛","\\circledast",!0);M(P,le,it,"⋅","\\centerdot");M(P,le,it,"⊺","\\intercal",!0);M(P,le,it,"⋒","\\doublecap");M(P,le,it,"⋓","\\doublecup");M(P,le,it,"⊠","\\boxtimes",!0);M(P,le,ce,"⇢","\\dashrightarrow",!0);M(P,le,ce,"⇠","\\dashleftarrow",!0);M(P,le,ce,"⇇","\\leftleftarrows",!0);M(P,le,ce,"⇆","\\leftrightarrows",!0);M(P,le,ce,"⇚","\\Lleftarrow",!0);M(P,le,ce,"↞","\\twoheadleftarrow",!0);M(P,le,ce,"↢","\\leftarrowtail",!0);M(P,le,ce,"↫","\\looparrowleft",!0);M(P,le,ce,"⇋","\\leftrightharpoons",!0);M(P,le,ce,"↶","\\curvearrowleft",!0);M(P,le,ce,"↺","\\circlearrowleft",!0);M(P,le,ce,"↰","\\Lsh",!0);M(P,le,ce,"⇈","\\upuparrows",!0);M(P,le,ce,"↿","\\upharpoonleft",!0);M(P,le,ce,"⇃","\\downharpoonleft",!0);M(P,Q,ce,"⊶","\\origof",!0);M(P,Q,ce,"⊷","\\imageof",!0);M(P,le,ce,"⊸","\\multimap",!0);M(P,le,ce,"↭","\\leftrightsquigarrow",!0);M(P,le,ce,"⇉","\\rightrightarrows",!0);M(P,le,ce,"⇄","\\rightleftarrows",!0);M(P,le,ce,"↠","\\twoheadrightarrow",!0);M(P,le,ce,"↣","\\rightarrowtail",!0);M(P,le,ce,"↬","\\looparrowright",!0);M(P,le,ce,"↷","\\curvearrowright",!0);M(P,le,ce,"↻","\\circlearrowright",!0);M(P,le,ce,"↱","\\Rsh",!0);M(P,le,ce,"⇊","\\downdownarrows",!0);M(P,le,ce,"↾","\\upharpoonright",!0);M(P,le,ce,"⇂","\\downharpoonright",!0);M(P,le,ce,"⇝","\\rightsquigarrow",!0);M(P,le,ce,"⇝","\\leadsto");M(P,le,ce,"⇛","\\Rrightarrow",!0);M(P,le,ce,"↾","\\restriction");M(P,Q,me,"‘","`");M(P,Q,me,"$","\\$");M(Le,Q,me,"$","\\$");M(Le,Q,me,"$","\\textdollar");M(P,Q,me,"%","\\%");M(Le,Q,me,"%","\\%");M(P,Q,me,"_","\\_");M(Le,Q,me,"_","\\_");M(Le,Q,me,"_","\\textunderscore");M(P,Q,me,"∠","\\angle",!0);M(P,Q,me,"∞","\\infty",!0);M(P,Q,me,"′","\\prime");M(P,Q,me,"△","\\triangle");M(P,Q,me,"Γ","\\Gamma",!0);M(P,Q,me,"Δ","\\Delta",!0);M(P,Q,me,"Θ","\\Theta",!0);M(P,Q,me,"Λ","\\Lambda",!0);M(P,Q,me,"Ξ","\\Xi",!0);M(P,Q,me,"Π","\\Pi",!0);M(P,Q,me,"Σ","\\Sigma",!0);M(P,Q,me,"Υ","\\Upsilon",!0);M(P,Q,me,"Φ","\\Phi",!0);M(P,Q,me,"Ψ","\\Psi",!0);M(P,Q,me,"Ω","\\Omega",!0);M(P,Q,me,"A","Α");M(P,Q,me,"B","Β");M(P,Q,me,"E","Ε");M(P,Q,me,"Z","Ζ");M(P,Q,me,"H","Η");M(P,Q,me,"I","Ι");M(P,Q,me,"K","Κ");M(P,Q,me,"M","Μ");M(P,Q,me,"N","Ν");M(P,Q,me,"O","Ο");M(P,Q,me,"P","Ρ");M(P,Q,me,"T","Τ");M(P,Q,me,"X","Χ");M(P,Q,me,"¬","\\neg",!0);M(P,Q,me,"¬","\\lnot");M(P,Q,me,"⊤","\\top");M(P,Q,me,"⊥","\\bot");M(P,Q,me,"∅","\\emptyset");M(P,le,me,"∅","\\varnothing");M(P,Q,_t,"α","\\alpha",!0);M(P,Q,_t,"β","\\beta",!0);M(P,Q,_t,"γ","\\gamma",!0);M(P,Q,_t,"δ","\\delta",!0);M(P,Q,_t,"ϵ","\\epsilon",!0);M(P,Q,_t,"ζ","\\zeta",!0);M(P,Q,_t,"η","\\eta",!0);M(P,Q,_t,"θ","\\theta",!0);M(P,Q,_t,"ι","\\iota",!0);M(P,Q,_t,"κ","\\kappa",!0);M(P,Q,_t,"λ","\\lambda",!0);M(P,Q,_t,"μ","\\mu",!0);M(P,Q,_t,"ν","\\nu",!0);M(P,Q,_t,"ξ","\\xi",!0);M(P,Q,_t,"ο","\\omicron",!0);M(P,Q,_t,"π","\\pi",!0);M(P,Q,_t,"ρ","\\rho",!0);M(P,Q,_t,"σ","\\sigma",!0);M(P,Q,_t,"τ","\\tau",!0);M(P,Q,_t,"υ","\\upsilon",!0);M(P,Q,_t,"ϕ","\\phi",!0);M(P,Q,_t,"χ","\\chi",!0);M(P,Q,_t,"ψ","\\psi",!0);M(P,Q,_t,"ω","\\omega",!0);M(P,Q,_t,"ε","\\varepsilon",!0);M(P,Q,_t,"ϑ","\\vartheta",!0);M(P,Q,_t,"ϖ","\\varpi",!0);M(P,Q,_t,"ϱ","\\varrho",!0);M(P,Q,_t,"ς","\\varsigma",!0);M(P,Q,_t,"φ","\\varphi",!0);M(P,Q,it,"∗","*",!0);M(P,Q,it,"+","+");M(P,Q,it,"−","-",!0);M(P,Q,it,"⋅","\\cdot",!0);M(P,Q,it,"∘","\\circ",!0);M(P,Q,it,"÷","\\div",!0);M(P,Q,it,"±","\\pm",!0);M(P,Q,it,"×","\\times",!0);M(P,Q,it,"∩","\\cap",!0);M(P,Q,it,"∪","\\cup",!0);M(P,Q,it,"∖","\\setminus",!0);M(P,Q,it,"∧","\\land");M(P,Q,it,"∨","\\lor");M(P,Q,it,"∧","\\wedge",!0);M(P,Q,it,"∨","\\vee",!0);M(P,Q,me,"√","\\surd");M(P,Q,ra,"⟨","\\langle",!0);M(P,Q,ra,"∣","\\lvert");M(P,Q,ra,"∥","\\lVert");M(P,Q,li,"?","?");M(P,Q,li,"!","!");M(P,Q,li,"⟩","\\rangle",!0);M(P,Q,li,"∣","\\rvert");M(P,Q,li,"∥","\\rVert");M(P,Q,ce,"=","=");M(P,Q,ce,":",":");M(P,Q,ce,"≈","\\approx",!0);M(P,Q,ce,"≅","\\cong",!0);M(P,Q,ce,"≥","\\ge");M(P,Q,ce,"≥","\\geq",!0);M(P,Q,ce,"←","\\gets");M(P,Q,ce,">","\\gt",!0);M(P,Q,ce,"∈","\\in",!0);M(P,Q,ce,"","\\@not");M(P,Q,ce,"⊂","\\subset",!0);M(P,Q,ce,"⊃","\\supset",!0);M(P,Q,ce,"⊆","\\subseteq",!0);M(P,Q,ce,"⊇","\\supseteq",!0);M(P,le,ce,"⊈","\\nsubseteq",!0);M(P,le,ce,"⊉","\\nsupseteq",!0);M(P,Q,ce,"⊨","\\models");M(P,Q,ce,"←","\\leftarrow",!0);M(P,Q,ce,"≤","\\le");M(P,Q,ce,"≤","\\leq",!0);M(P,Q,ce,"<","\\lt",!0);M(P,Q,ce,"→","\\rightarrow",!0);M(P,Q,ce,"→","\\to");M(P,le,ce,"≱","\\ngeq",!0);M(P,le,ce,"≰","\\nleq",!0);M(P,Q,tc," ","\\ ");M(P,Q,tc," ","\\space");M(P,Q,tc," ","\\nobreakspace");M(Le,Q,tc," ","\\ ");M(Le,Q,tc," "," ");M(Le,Q,tc," ","\\space");M(Le,Q,tc," ","\\nobreakspace");M(P,Q,tc,null,"\\nobreak");M(P,Q,tc,null,"\\allowbreak");M(P,Q,Vb,",",",");M(P,Q,Vb,";",";");M(P,le,it,"⊼","\\barwedge",!0);M(P,le,it,"⊻","\\veebar",!0);M(P,Q,it,"⊙","\\odot",!0);M(P,Q,it,"⊕","\\oplus",!0);M(P,Q,it,"⊗","\\otimes",!0);M(P,Q,me,"∂","\\partial",!0);M(P,Q,it,"⊘","\\oslash",!0);M(P,le,it,"⊚","\\circledcirc",!0);M(P,le,it,"⊡","\\boxdot",!0);M(P,Q,it,"△","\\bigtriangleup");M(P,Q,it,"▽","\\bigtriangledown");M(P,Q,it,"†","\\dagger");M(P,Q,it,"⋄","\\diamond");M(P,Q,it,"⋆","\\star");M(P,Q,it,"◃","\\triangleleft");M(P,Q,it,"▹","\\triangleright");M(P,Q,ra,"{","\\{");M(Le,Q,me,"{","\\{");M(Le,Q,me,"{","\\textbraceleft");M(P,Q,li,"}","\\}");M(Le,Q,me,"}","\\}");M(Le,Q,me,"}","\\textbraceright");M(P,Q,ra,"{","\\lbrace");M(P,Q,li,"}","\\rbrace");M(P,Q,ra,"[","\\lbrack",!0);M(Le,Q,me,"[","\\lbrack",!0);M(P,Q,li,"]","\\rbrack",!0);M(Le,Q,me,"]","\\rbrack",!0);M(P,Q,ra,"(","\\lparen",!0);M(P,Q,li,")","\\rparen",!0);M(Le,Q,me,"<","\\textless",!0);M(Le,Q,me,">","\\textgreater",!0);M(P,Q,ra,"⌊","\\lfloor",!0);M(P,Q,li,"⌋","\\rfloor",!0);M(P,Q,ra,"⌈","\\lceil",!0);M(P,Q,li,"⌉","\\rceil",!0);M(P,Q,me,"\\","\\backslash");M(P,Q,me,"∣","|");M(P,Q,me,"∣","\\vert");M(Le,Q,me,"|","\\textbar",!0);M(P,Q,me,"∥","\\|");M(P,Q,me,"∥","\\Vert");M(Le,Q,me,"∥","\\textbardbl");M(Le,Q,me,"~","\\textasciitilde");M(Le,Q,me,"\\","\\textbackslash");M(Le,Q,me,"^","\\textasciicircum");M(P,Q,ce,"↑","\\uparrow",!0);M(P,Q,ce,"⇑","\\Uparrow",!0);M(P,Q,ce,"↓","\\downarrow",!0);M(P,Q,ce,"⇓","\\Downarrow",!0);M(P,Q,ce,"↕","\\updownarrow",!0);M(P,Q,ce,"⇕","\\Updownarrow",!0);M(P,Q,os,"∐","\\coprod");M(P,Q,os,"⋁","\\bigvee");M(P,Q,os,"⋀","\\bigwedge");M(P,Q,os,"⨄","\\biguplus");M(P,Q,os,"⋂","\\bigcap");M(P,Q,os,"⋃","\\bigcup");M(P,Q,os,"∫","\\int");M(P,Q,os,"∫","\\intop");M(P,Q,os,"∬","\\iint");M(P,Q,os,"∭","\\iiint");M(P,Q,os,"∏","\\prod");M(P,Q,os,"∑","\\sum");M(P,Q,os,"⨂","\\bigotimes");M(P,Q,os,"⨁","\\bigoplus");M(P,Q,os,"⨀","\\bigodot");M(P,Q,os,"∮","\\oint");M(P,Q,os,"∯","\\oiint");M(P,Q,os,"∰","\\oiiint");M(P,Q,os,"⨆","\\bigsqcup");M(P,Q,os,"∫","\\smallint");M(Le,Q,$f,"…","\\textellipsis");M(P,Q,$f,"…","\\mathellipsis");M(Le,Q,$f,"…","\\ldots",!0);M(P,Q,$f,"…","\\ldots",!0);M(P,Q,$f,"⋯","\\@cdots",!0);M(P,Q,$f,"⋱","\\ddots",!0);M(P,Q,me,"⋮","\\varvdots");M(Le,Q,me,"⋮","\\varvdots");M(P,Q,_r,"ˊ","\\acute");M(P,Q,_r,"ˋ","\\grave");M(P,Q,_r,"¨","\\ddot");M(P,Q,_r,"~","\\tilde");M(P,Q,_r,"ˉ","\\bar");M(P,Q,_r,"˘","\\breve");M(P,Q,_r,"ˇ","\\check");M(P,Q,_r,"^","\\hat");M(P,Q,_r,"⃗","\\vec");M(P,Q,_r,"˙","\\dot");M(P,Q,_r,"˚","\\mathring");M(P,Q,_t,"","\\@imath");M(P,Q,_t,"","\\@jmath");M(P,Q,me,"ı","ı");M(P,Q,me,"ȷ","ȷ");M(Le,Q,me,"ı","\\i",!0);M(Le,Q,me,"ȷ","\\j",!0);M(Le,Q,me,"ß","\\ss",!0);M(Le,Q,me,"æ","\\ae",!0);M(Le,Q,me,"œ","\\oe",!0);M(Le,Q,me,"ø","\\o",!0);M(Le,Q,me,"Æ","\\AE",!0);M(Le,Q,me,"Œ","\\OE",!0);M(Le,Q,me,"Ø","\\O",!0);M(Le,Q,_r,"ˊ","\\'");M(Le,Q,_r,"ˋ","\\`");M(Le,Q,_r,"ˆ","\\^");M(Le,Q,_r,"˜","\\~");M(Le,Q,_r,"ˉ","\\=");M(Le,Q,_r,"˘","\\u");M(Le,Q,_r,"˙","\\.");M(Le,Q,_r,"¸","\\c");M(Le,Q,_r,"˚","\\r");M(Le,Q,_r,"ˇ","\\v");M(Le,Q,_r,"¨",'\\"');M(Le,Q,_r,"˝","\\H");M(Le,Q,_r,"◯","\\textcircled");var sU={"--":!0,"---":!0,"``":!0,"''":!0};M(Le,Q,me,"–","--",!0);M(Le,Q,me,"–","\\textendash");M(Le,Q,me,"—","---",!0);M(Le,Q,me,"—","\\textemdash");M(Le,Q,me,"‘","`",!0);M(Le,Q,me,"‘","\\textquoteleft");M(Le,Q,me,"’","'",!0);M(Le,Q,me,"’","\\textquoteright");M(Le,Q,me,"“","``",!0);M(Le,Q,me,"“","\\textquotedblleft");M(Le,Q,me,"”","''",!0);M(Le,Q,me,"”","\\textquotedblright");M(P,Q,me,"°","\\degree",!0);M(Le,Q,me,"°","\\degree");M(Le,Q,me,"°","\\textdegree",!0);M(P,Q,me,"£","\\pounds");M(P,Q,me,"£","\\mathsterling",!0);M(Le,Q,me,"£","\\pounds");M(Le,Q,me,"£","\\textsterling",!0);M(P,le,me,"✠","\\maltese");M(Le,le,me,"✠","\\maltese");var wR='0123456789/@."';for(var YS=0;YS<wR.length;YS++){var SR=wR.charAt(YS);M(P,Q,me,SR,SR)}var kR='0123456789!@*()-=+";:?/.,';for(var KS=0;KS<kR.length;KS++){var OR=kR.charAt(KS);M(Le,Q,me,OR,OR)}var Ty="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(var ZS=0;ZS<Ty.length;ZS++){var I1=Ty.charAt(ZS);M(P,Q,_t,I1,I1),M(Le,Q,me,I1,I1)}M(P,le,me,"C","ℂ");M(Le,le,me,"C","ℂ");M(P,le,me,"H","ℍ");M(Le,le,me,"H","ℍ");M(P,le,me,"N","ℕ");M(Le,le,me,"N","ℕ");M(P,le,me,"P","ℙ");M(Le,le,me,"P","ℙ");M(P,le,me,"Q","ℚ");M(Le,le,me,"Q","ℚ");M(P,le,me,"R","ℝ");M(Le,le,me,"R","ℝ");M(P,le,me,"Z","ℤ");M(Le,le,me,"Z","ℤ");M(P,Q,_t,"h","ℎ");M(Le,Q,_t,"h","ℎ");var It="";for(var Zs=0;Zs<Ty.length;Zs++){var qr=Ty.charAt(Zs);It=String.fromCharCode(55349,56320+Zs),M(P,Q,_t,qr,It),M(Le,Q,me,qr,It),It=String.fromCharCode(55349,56372+Zs),M(P,Q,_t,qr,It),M(Le,Q,me,qr,It),It=String.fromCharCode(55349,56424+Zs),M(P,Q,_t,qr,It),M(Le,Q,me,qr,It),It=String.fromCharCode(55349,56580+Zs),M(P,Q,_t,qr,It),M(Le,Q,me,qr,It),It=String.fromCharCode(55349,56684+Zs),M(P,Q,_t,qr,It),M(Le,Q,me,qr,It),It=String.fromCharCode(55349,56736+Zs),M(P,Q,_t,qr,It),M(Le,Q,me,qr,It),It=String.fromCharCode(55349,56788+Zs),M(P,Q,_t,qr,It),M(Le,Q,me,qr,It),It=String.fromCharCode(55349,56840+Zs),M(P,Q,_t,qr,It),M(Le,Q,me,qr,It),It=String.fromCharCode(55349,56944+Zs),M(P,Q,_t,qr,It),M(Le,Q,me,qr,It),Zs<26&&(It=String.fromCharCode(55349,56632+Zs),M(P,Q,_t,qr,It),M(Le,Q,me,qr,It),It=String.fromCharCode(55349,56476+Zs),M(P,Q,_t,qr,It),M(Le,Q,me,qr,It))}It="𝕜";M(P,Q,_t,"k",It);M(Le,Q,me,"k",It);for(var Lu=0;Lu<10;Lu++){var Ac=Lu.toString();It=String.fromCharCode(55349,57294+Lu),M(P,Q,_t,Ac,It),M(Le,Q,me,Ac,It),It=String.fromCharCode(55349,57314+Lu),M(P,Q,_t,Ac,It),M(Le,Q,me,Ac,It),It=String.fromCharCode(55349,57324+Lu),M(P,Q,_t,Ac,It),M(Le,Q,me,Ac,It),It=String.fromCharCode(55349,57334+Lu),M(P,Q,_t,Ac,It),M(Le,Q,me,Ac,It)}var QO="ÐÞþ";for(var JS=0;JS<QO.length;JS++){var L1=QO.charAt(JS);M(P,Q,_t,L1,L1),M(Le,Q,me,L1,L1)}var B1=[["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"]],jR=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],f3e=function(e,n){var r=e.charCodeAt(0),s=e.charCodeAt(1),i=(r-55296)*1024+(s-56320)+65536,a=n==="math"?0:1;if(119808<=i&&i<120484){var l=Math.floor((i-119808)/26);return[B1[l][2],B1[l][a]]}else if(120782<=i&&i<=120831){var c=Math.floor((i-120782)/10);return[jR[c][2],jR[c][a]]}else{if(i===120485||i===120486)return[B1[0][2],B1[0][a]];if(120486<i&&i<120782)return["",""];throw new qe("Unsupported character: "+e)}},Ub=function(e,n,r){return pr[r][e]&&pr[r][e].replace&&(e=pr[r][e].replace),{value:e,metrics:MN(e,n,r)}},Ha=function(e,n,r,s,i){var a=Ub(e,n,r),l=a.metrics;e=a.value;var c;if(l){var d=l.italic;(r==="text"||s&&s.font==="mathit")&&(d=0),c=new Ma(e,l.height,l.depth,d,l.skew,l.width,i)}else typeof console<"u"&&console.warn("No character metrics "+("for '"+e+"' in style '"+n+"' and mode '"+r+"'")),c=new Ma(e,0,0,0,0,0,i);if(s){c.maxFontSize=s.sizeMultiplier,s.style.isTight()&&c.classes.push("mtight");var h=s.getColor();h&&(c.style.color=h)}return c},m3e=function(e,n,r,s){return s===void 0&&(s=[]),r.font==="boldsymbol"&&Ub(e,"Main-Bold",n).metrics?Ha(e,"Main-Bold",n,r,s.concat(["mathbf"])):e==="\\"||pr[n][e].font==="main"?Ha(e,"Main-Regular",n,r,s):Ha(e,"AMS-Regular",n,r,s.concat(["amsrm"]))},p3e=function(e,n,r,s,i){return i!=="textord"&&Ub(e,"Math-BoldItalic",n).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},g3e=function(e,n,r){var s=e.mode,i=e.text,a=["mord"],l=s==="math"||s==="text"&&n.font,c=l?n.font:n.fontFamily,d="",h="";if(i.charCodeAt(0)===55349&&([d,h]=f3e(i,s)),d.length>0)return Ha(i,d,s,n,a.concat(h));if(c){var m,g;if(c==="boldsymbol"){var x=p3e(i,s,n,a,r);m=x.fontName,g=[x.fontClass]}else l?(m=oU[c].fontName,g=[c]):(m=F1(c,n.fontWeight,n.fontShape),g=[c,n.fontWeight,n.fontShape]);if(Ub(i,m,s).metrics)return Ha(i,m,s,n,a.concat(g));if(sU.hasOwnProperty(i)&&m.slice(0,10)==="Typewriter"){for(var y=[],w=0;w<i.length;w++)y.push(Ha(i[w],m,s,n,a.concat(g)));return aU(y)}}if(r==="mathord")return Ha(i,"Math-Italic",s,n,a.concat(["mathnormal"]));if(r==="textord"){var S=pr[s][i]&&pr[s][i].font;if(S==="ams"){var k=F1("amsrm",n.fontWeight,n.fontShape);return Ha(i,k,s,n,a.concat("amsrm",n.fontWeight,n.fontShape))}else if(S==="main"||!S){var j=F1("textrm",n.fontWeight,n.fontShape);return Ha(i,j,s,n,a.concat(n.fontWeight,n.fontShape))}else{var N=F1(S,n.fontWeight,n.fontShape);return Ha(i,N,s,n,a.concat(N,n.fontWeight,n.fontShape))}}else throw new Error("unexpected type: "+r+" in makeOrd")},x3e=(t,e)=>{if(ru(t.classes)!==ru(e.classes)||t.skew!==e.skew||t.maxFontSize!==e.maxFontSize)return!1;if(t.classes.length===1){var n=t.classes[0];if(n==="mbin"||n==="mord")return!1}for(var r in t.style)if(t.style.hasOwnProperty(r)&&t.style[r]!==e.style[r])return!1;for(var s in e.style)if(e.style.hasOwnProperty(s)&&t.style[s]!==e.style[s])return!1;return!0},v3e=t=>{for(var e=0;e<t.length-1;e++){var n=t[e],r=t[e+1];n instanceof Ma&&r instanceof Ma&&x3e(n,r)&&(n.text+=r.text,n.height=Math.max(n.height,r.height),n.depth=Math.max(n.depth,r.depth),n.italic=r.italic,t.splice(e+1,1),e--)}return t},DN=function(e){for(var n=0,r=0,s=0,i=0;i<e.children.length;i++){var a=e.children[i];a.height>n&&(n=a.height),a.depth>r&&(r=a.depth),a.maxFontSize>s&&(s=a.maxFontSize)}e.height=n,e.depth=r,e.maxFontSize=s},gi=function(e,n,r,s){var i=new bg(e,n,r,s);return DN(i),i},iU=(t,e,n,r)=>new bg(t,e,n,r),y3e=function(e,n,r){var s=gi([e],[],n);return s.height=Math.max(r||n.fontMetrics().defaultRuleThickness,n.minRuleThickness),s.style.borderBottomWidth=Xe(s.height),s.maxFontSize=1,s},b3e=function(e,n,r,s){var i=new RN(e,n,r,s);return DN(i),i},aU=function(e){var n=new yg(e);return DN(n),n},w3e=function(e,n){return e instanceof yg?gi([],[e],n):e},S3e=function(e){if(e.positionType==="individualShift"){for(var n=e.children,r=[n[0]],s=-n[0].shift-n[0].elem.depth,i=s,a=1;a<n.length;a++){var l=-n[a].shift-i-n[a].elem.depth,c=l-(n[a-1].elem.height+n[a-1].elem.depth);i=i+l,r.push({type:"kern",size:c}),r.push(n[a])}return{children:r,depth:s}}var d;if(e.positionType==="top"){for(var h=e.positionData,m=0;m<e.children.length;m++){var g=e.children[m];h-=g.type==="kern"?g.size:g.elem.height+g.elem.depth}d=h}else if(e.positionType==="bottom")d=-e.positionData;else{var x=e.children[0];if(x.type!=="elem")throw new Error('First child must have type "elem".');if(e.positionType==="shift")d=-x.elem.depth-e.positionData;else if(e.positionType==="firstBaseline")d=-x.elem.depth;else throw new Error("Invalid positionType "+e.positionType+".")}return{children:e.children,depth:d}},k3e=function(e,n){for(var{children:r,depth:s}=S3e(e),i=0,a=0;a<r.length;a++){var l=r[a];if(l.type==="elem"){var c=l.elem;i=Math.max(i,c.maxFontSize,c.height)}}i+=2;var d=gi(["pstrut"],[]);d.style.height=Xe(i);for(var h=[],m=s,g=s,x=s,y=0;y<r.length;y++){var w=r[y];if(w.type==="kern")x+=w.size;else{var S=w.elem,k=w.wrapperClasses||[],j=w.wrapperStyle||{},N=gi(k,[d,S],void 0,j);N.style.top=Xe(-i-x-S.depth),w.marginLeft&&(N.style.marginLeft=w.marginLeft),w.marginRight&&(N.style.marginRight=w.marginRight),h.push(N),x+=S.height+S.depth}m=Math.min(m,x),g=Math.max(g,x)}var T=gi(["vlist"],h);T.style.height=Xe(g);var E;if(m<0){var _=gi([],[]),A=gi(["vlist"],[_]);A.style.height=Xe(-m);var D=gi(["vlist-s"],[new Ma("")]);E=[gi(["vlist-r"],[T,D]),gi(["vlist-r"],[A])]}else E=[gi(["vlist-r"],[T])];var q=gi(["vlist-t"],E);return E.length===2&&q.classes.push("vlist-t2"),q.height=g,q.depth=-m,q},O3e=(t,e)=>{var n=gi(["mspace"],[],e),r=Ir(t,e);return n.style.marginRight=Xe(r),n},F1=function(e,n,r){var s="";switch(e){case"amsrm":s="AMS";break;case"textrm":s="Main";break;case"textsf":s="SansSerif";break;case"texttt":s="Typewriter";break;default:s=e}var i;return n==="textbf"&&r==="textit"?i="BoldItalic":n==="textbf"?i="Bold":n==="textit"?i="Italic":i="Regular",s+"-"+i},oU={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"}},lU={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},j3e=function(e,n){var[r,s,i]=lU[e],a=new su(r),l=new Ul([a],{width:Xe(s),height:Xe(i),style:"width:"+Xe(s),viewBox:"0 0 "+1e3*s+" "+1e3*i,preserveAspectRatio:"xMinYMin"}),c=iU(["overlay"],[l],n);return c.height=i,c.style.height=Xe(i),c.style.width=Xe(s),c},we={fontMap:oU,makeSymbol:Ha,mathsym:m3e,makeSpan:gi,makeSvgSpan:iU,makeLineSpan:y3e,makeAnchor:b3e,makeFragment:aU,wrapFragment:w3e,makeVList:k3e,makeOrd:g3e,makeGlue:O3e,staticSvg:j3e,svgData:lU,tryCombineChars:v3e},Pr={number:3,unit:"mu"},Bu={number:4,unit:"mu"},Sl={number:5,unit:"mu"},N3e={mord:{mop:Pr,mbin:Bu,mrel:Sl,minner:Pr},mop:{mord:Pr,mop:Pr,mrel:Sl,minner:Pr},mbin:{mord:Bu,mop:Bu,mopen:Bu,minner:Bu},mrel:{mord:Sl,mop:Sl,mopen:Sl,minner:Sl},mopen:{},mclose:{mop:Pr,mbin:Bu,mrel:Sl,minner:Pr},mpunct:{mord:Pr,mop:Pr,mrel:Sl,mopen:Pr,mclose:Pr,mpunct:Pr,minner:Pr},minner:{mord:Pr,mop:Pr,mbin:Bu,mrel:Sl,mopen:Pr,mpunct:Pr,minner:Pr}},C3e={mord:{mop:Pr},mop:{mord:Pr,mop:Pr},mbin:{},mrel:{},mopen:{},mclose:{mop:Pr},mpunct:{},minner:{mop:Pr}},cU={},Ey={},_y={};function tt(t){for(var{type:e,names:n,props:r,handler:s,htmlBuilder:i,mathmlBuilder:a}=t,l={type:e,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:r.allowedInMath===void 0?!0:r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:s},c=0;c<n.length;++c)cU[n[c]]=l;e&&(i&&(Ey[e]=i),a&&(_y[e]=a))}function Od(t){var{type:e,htmlBuilder:n,mathmlBuilder:r}=t;tt({type:e,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:n,mathmlBuilder:r})}var Ay=function(e){return e.type==="ordgroup"&&e.body.length===1?e.body[0]:e},Gr=function(e){return e.type==="ordgroup"?e.body:[e]},Wl=we.makeSpan,T3e=["leftmost","mbin","mopen","mrel","mop","mpunct"],E3e=["rightmost","mrel","mclose","mpunct"],_3e={display:At.DISPLAY,text:At.TEXT,script:At.SCRIPT,scriptscript:At.SCRIPTSCRIPT},A3e={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},ms=function(e,n,r,s){s===void 0&&(s=[null,null]);for(var i=[],a=0;a<e.length;a++){var l=qn(e[a],n);if(l instanceof yg){var c=l.children;i.push(...c)}else i.push(l)}if(we.tryCombineChars(i),!r)return i;var d=n;if(e.length===1){var h=e[0];h.type==="sizing"?d=n.havingSize(h.size):h.type==="styling"&&(d=n.havingStyle(_3e[h.style]))}var m=Wl([s[0]||"leftmost"],[],n),g=Wl([s[1]||"rightmost"],[],n),x=r==="root";return NR(i,(y,w)=>{var S=w.classes[0],k=y.classes[0];S==="mbin"&&E3e.includes(k)?w.classes[0]="mord":k==="mbin"&&T3e.includes(S)&&(y.classes[0]="mord")},{node:m},g,x),NR(i,(y,w)=>{var S=VO(w),k=VO(y),j=S&&k?y.hasClass("mtight")?C3e[S][k]:N3e[S][k]:null;if(j)return we.makeGlue(j,d)},{node:m},g,x),i},NR=function t(e,n,r,s,i){s&&e.push(s);for(var a=0;a<e.length;a++){var l=e[a],c=uU(l);if(c){t(c.children,n,r,null,i);continue}var d=!l.hasClass("mspace");if(d){var h=n(l,r.node);h&&(r.insertAfter?r.insertAfter(h):(e.unshift(h),a++))}d?r.node=l:i&&l.hasClass("newline")&&(r.node=Wl(["leftmost"])),r.insertAfter=(m=>g=>{e.splice(m+1,0,g),a++})(a)}s&&e.pop()},uU=function(e){return e instanceof yg||e instanceof RN||e instanceof bg&&e.hasClass("enclosing")?e:null},M3e=function t(e,n){var r=uU(e);if(r){var s=r.children;if(s.length){if(n==="right")return t(s[s.length-1],"right");if(n==="left")return t(s[0],"left")}}return e},VO=function(e,n){return e?(n&&(e=M3e(e,n)),A3e[e.classes[0]]||null):null},Sp=function(e,n){var r=["nulldelimiter"].concat(e.baseSizingClasses());return Wl(n.concat(r))},qn=function(e,n,r){if(!e)return Wl();if(Ey[e.type]){var s=Ey[e.type](e,n);if(r&&n.size!==r.size){s=Wl(n.sizingClasses(r),[s],n);var i=n.sizeMultiplier/r.sizeMultiplier;s.height*=i,s.depth*=i}return s}else throw new qe("Got group of unknown type: '"+e.type+"'")};function q1(t,e){var n=Wl(["base"],t,e),r=Wl(["strut"]);return r.style.height=Xe(n.height+n.depth),n.depth&&(r.style.verticalAlign=Xe(-n.depth)),n.children.unshift(r),n}function UO(t,e){var n=null;t.length===1&&t[0].type==="tag"&&(n=t[0].tag,t=t[0].body);var r=ms(t,e,"root"),s;r.length===2&&r[1].hasClass("tag")&&(s=r.pop());for(var i=[],a=[],l=0;l<r.length;l++)if(a.push(r[l]),r[l].hasClass("mbin")||r[l].hasClass("mrel")||r[l].hasClass("allowbreak")){for(var c=!1;l<r.length-1&&r[l+1].hasClass("mspace")&&!r[l+1].hasClass("newline");)l++,a.push(r[l]),r[l].hasClass("nobreak")&&(c=!0);c||(i.push(q1(a,e)),a=[])}else r[l].hasClass("newline")&&(a.pop(),a.length>0&&(i.push(q1(a,e)),a=[]),i.push(r[l]));a.length>0&&i.push(q1(a,e));var d;n?(d=q1(ms(n,e,!0)),d.classes=["tag"],i.push(d)):s&&i.push(s);var h=Wl(["katex-html"],i);if(h.setAttribute("aria-hidden","true"),d){var m=d.children[0];m.style.height=Xe(h.height+h.depth),h.depth&&(m.style.verticalAlign=Xe(-h.depth))}return h}function dU(t){return new yg(t)}class Ui{constructor(e,n,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=n||[],this.classes=r||[]}setAttribute(e,n){this.attributes[e]=n}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&e.setAttribute(n,this.attributes[n]);this.classes.length>0&&(e.className=ru(this.classes));for(var r=0;r<this.children.length;r++)if(this.children[r]instanceof Ro&&this.children[r+1]instanceof Ro){for(var s=this.children[r].toText()+this.children[++r].toText();this.children[r+1]instanceof Ro;)s+=this.children[++r].toText();e.appendChild(new Ro(s).toNode())}else e.appendChild(this.children[r].toNode());return e}toMarkup(){var e="<"+this.type;for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&(e+=" "+n+'="',e+=Wn.escape(this.attributes[n]),e+='"');this.classes.length>0&&(e+=' class ="'+Wn.escape(ru(this.classes))+'"'),e+=">";for(var r=0;r<this.children.length;r++)e+=this.children[r].toMarkup();return e+="</"+this.type+">",e}toText(){return this.children.map(e=>e.toText()).join("")}}class Ro{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return Wn.escape(this.toText())}toText(){return this.text}}class R3e{constructor(e){this.width=void 0,this.character=void 0,this.width=e,e>=.05555&&e<=.05556?this.character=" ":e>=.1666&&e<=.1667?this.character=" ":e>=.2222&&e<=.2223?this.character=" ":e>=.2777&&e<=.2778?this.character=" ":e>=-.05556&&e<=-.05555?this.character=" ":e>=-.1667&&e<=-.1666?this.character=" ":e>=-.2223&&e<=-.2222?this.character=" ":e>=-.2778&&e<=-.2777?this.character=" ":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",Xe(this.width)),e}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+Xe(this.width)+'"/>'}toText(){return this.character?this.character:" "}}var Fe={MathNode:Ui,TextNode:Ro,SpaceNode:R3e,newDocumentFragment:dU},Ra=function(e,n,r){return pr[n][e]&&pr[n][e].replace&&e.charCodeAt(0)!==55349&&!(sU.hasOwnProperty(e)&&r&&(r.fontFamily&&r.fontFamily.slice(4,6)==="tt"||r.font&&r.font.slice(4,6)==="tt"))&&(e=pr[n][e].replace),new Fe.TextNode(e)},PN=function(e){return e.length===1?e[0]:new Fe.MathNode("mrow",e)},zN=function(e,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 r=n.font;if(!r||r==="mathnormal")return null;var s=e.mode;if(r==="mathit")return"italic";if(r==="boldsymbol")return e.type==="textord"?"bold":"bold-italic";if(r==="mathbf")return"bold";if(r==="mathbb")return"double-struck";if(r==="mathsfit")return"sans-serif-italic";if(r==="mathfrak")return"fraktur";if(r==="mathscr"||r==="mathcal")return"script";if(r==="mathsf")return"sans-serif";if(r==="mathtt")return"monospace";var i=e.text;if(["\\imath","\\jmath"].includes(i))return null;pr[s][i]&&pr[s][i].replace&&(i=pr[s][i].replace);var a=we.fontMap[r].fontName;return MN(i,a,s)?we.fontMap[r].variant:null};function e5(t){if(!t)return!1;if(t.type==="mi"&&t.children.length===1){var e=t.children[0];return e instanceof Ro&&e.text==="."}else if(t.type==="mo"&&t.children.length===1&&t.getAttribute("separator")==="true"&&t.getAttribute("lspace")==="0em"&&t.getAttribute("rspace")==="0em"){var n=t.children[0];return n instanceof Ro&&n.text===","}else return!1}var Mi=function(e,n,r){if(e.length===1){var s=hr(e[0],n);return r&&s instanceof Ui&&s.type==="mo"&&(s.setAttribute("lspace","0em"),s.setAttribute("rspace","0em")),[s]}for(var i=[],a,l=0;l<e.length;l++){var c=hr(e[l],n);if(c instanceof Ui&&a instanceof Ui){if(c.type==="mtext"&&a.type==="mtext"&&c.getAttribute("mathvariant")===a.getAttribute("mathvariant")){a.children.push(...c.children);continue}else if(c.type==="mn"&&a.type==="mn"){a.children.push(...c.children);continue}else if(e5(c)&&a.type==="mn"){a.children.push(...c.children);continue}else if(c.type==="mn"&&e5(a))c.children=[...a.children,...c.children],i.pop();else if((c.type==="msup"||c.type==="msub")&&c.children.length>=1&&(a.type==="mn"||e5(a))){var d=c.children[0];d instanceof Ui&&d.type==="mn"&&(d.children=[...a.children,...d.children],i.pop())}else if(a.type==="mi"&&a.children.length===1){var h=a.children[0];if(h instanceof Ro&&h.text==="̸"&&(c.type==="mo"||c.type==="mi"||c.type==="mn")){var m=c.children[0];m instanceof Ro&&m.text.length>0&&(m.text=m.text.slice(0,1)+"̸"+m.text.slice(1),i.pop())}}}i.push(c),a=c}return i},iu=function(e,n,r){return PN(Mi(e,n,r))},hr=function(e,n){if(!e)return new Fe.MathNode("mrow");if(_y[e.type]){var r=_y[e.type](e,n);return r}else throw new qe("Got group of unknown type: '"+e.type+"'")};function CR(t,e,n,r,s){var i=Mi(t,n),a;i.length===1&&i[0]instanceof Ui&&["mrow","mtable"].includes(i[0].type)?a=i[0]:a=new Fe.MathNode("mrow",i);var l=new Fe.MathNode("annotation",[new Fe.TextNode(e)]);l.setAttribute("encoding","application/x-tex");var c=new Fe.MathNode("semantics",[a,l]),d=new Fe.MathNode("math",[c]);d.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&d.setAttribute("display","block");var h=s?"katex":"katex-mathml";return we.makeSpan([h],[d])}var hU=function(e){return new Al({style:e.displayMode?At.DISPLAY:At.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},fU=function(e,n){if(n.displayMode){var r=["katex-display"];n.leqno&&r.push("leqno"),n.fleqn&&r.push("fleqn"),e=we.makeSpan(r,[e])}return e},D3e=function(e,n,r){var s=hU(r),i;if(r.output==="mathml")return CR(e,n,s,r.displayMode,!0);if(r.output==="html"){var a=UO(e,s);i=we.makeSpan(["katex"],[a])}else{var l=CR(e,n,s,r.displayMode,!1),c=UO(e,s);i=we.makeSpan(["katex"],[l,c])}return fU(i,r)},P3e=function(e,n,r){var s=hU(r),i=UO(e,s),a=we.makeSpan(["katex"],[i]);return fU(a,r)},z3e={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":"="},I3e=function(e){var n=new Fe.MathNode("mo",[new Fe.TextNode(z3e[e.replace(/^\\/,"")])]);return n.setAttribute("stretchy","true"),n},L3e={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]},B3e=function(e){return e.type==="ordgroup"?e.body.length:1},F3e=function(e,n){function r(){var l=4e5,c=e.label.slice(1);if(["widehat","widecheck","widetilde","utilde"].includes(c)){var d=e,h=B3e(d.base),m,g,x;if(h>5)c==="widehat"||c==="widecheck"?(m=420,l=2364,x=.42,g=c+"4"):(m=312,l=2340,x=.34,g="tilde4");else{var y=[1,1,2,2,3,3][h];c==="widehat"||c==="widecheck"?(l=[0,1062,2364,2364,2364][y],m=[0,239,300,360,420][y],x=[0,.24,.3,.3,.36,.42][y],g=c+y):(l=[0,600,1033,2339,2340][y],m=[0,260,286,306,312][y],x=[0,.26,.286,.3,.306,.34][y],g="tilde"+y)}var w=new su(g),S=new Ul([w],{width:"100%",height:Xe(x),viewBox:"0 0 "+l+" "+m,preserveAspectRatio:"none"});return{span:we.makeSvgSpan([],[S],n),minWidth:0,height:x}}else{var k=[],j=L3e[c],[N,T,E]=j,_=E/1e3,A=N.length,D,q;if(A===1){var B=j[3];D=["hide-tail"],q=[B]}else if(A===2)D=["halfarrow-left","halfarrow-right"],q=["xMinYMin","xMaxYMin"];else if(A===3)D=["brace-left","brace-center","brace-right"],q=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
|
||
`+A+" children.");for(var H=0;H<A;H++){var W=new su(N[H]),ee=new Ul([W],{width:"400em",height:Xe(_),viewBox:"0 0 "+l+" "+E,preserveAspectRatio:q[H]+" slice"}),I=we.makeSvgSpan([D[H]],[ee],n);if(A===1)return{span:I,minWidth:T,height:_};I.style.height=Xe(_),k.push(I)}return{span:we.makeSpan(["stretchy"],k,n),minWidth:T,height:_}}}var{span:s,minWidth:i,height:a}=r();return s.height=a,s.style.height=Xe(a),i>0&&(s.style.minWidth=Xe(i)),s},q3e=function(e,n,r,s,i){var a,l=e.height+e.depth+r+s;if(/fbox|color|angl/.test(n)){if(a=we.makeSpan(["stretchy",n],[],i),n==="fbox"){var c=i.color&&i.getColor();c&&(a.style.borderColor=c)}}else{var d=[];/^[bx]cancel$/.test(n)&&d.push(new HO({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(n)&&d.push(new HO({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var h=new Ul(d,{width:"100%",height:Xe(l)});a=we.makeSvgSpan([],[h],i)}return a.height=l,a.style.height=Xe(l),a},Gl={encloseSpan:q3e,mathMLnode:I3e,svgSpan:F3e};function nn(t,e){if(!t||t.type!==e)throw new Error("Expected node of type "+e+", but got "+(t?"node of type "+t.type:String(t)));return t}function IN(t){var e=Wb(t);if(!e)throw new Error("Expected node of symbol group type, but got "+(t?"node of type "+t.type:String(t)));return e}function Wb(t){return t&&(t.type==="atom"||h3e.hasOwnProperty(t.type))?t:null}var LN=(t,e)=>{var n,r,s;t&&t.type==="supsub"?(r=nn(t.base,"accent"),n=r.base,t.base=n,s=u3e(qn(t,e)),t.base=r):(r=nn(t,"accent"),n=r.base);var i=qn(n,e.havingCrampedStyle()),a=r.isShifty&&Wn.isCharacterBox(n),l=0;if(a){var c=Wn.getBaseElem(n),d=qn(c,e.havingCrampedStyle());l=bR(d).skew}var h=r.label==="\\c",m=h?i.height+i.depth:Math.min(i.height,e.fontMetrics().xHeight),g;if(r.isStretchy)g=Gl.svgSpan(r,e),g=we.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:g,wrapperClasses:["svg-align"],wrapperStyle:l>0?{width:"calc(100% - "+Xe(2*l)+")",marginLeft:Xe(2*l)}:void 0}]},e);else{var x,y;r.label==="\\vec"?(x=we.staticSvg("vec",e),y=we.svgData.vec[1]):(x=we.makeOrd({mode:r.mode,text:r.label},e,"textord"),x=bR(x),x.italic=0,y=x.width,h&&(m+=x.depth)),g=we.makeSpan(["accent-body"],[x]);var w=r.label==="\\textcircled";w&&(g.classes.push("accent-full"),m=i.height);var S=l;w||(S-=y/2),g.style.left=Xe(S),r.label==="\\textcircled"&&(g.style.top=".2em"),g=we.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-m},{type:"elem",elem:g}]},e)}var k=we.makeSpan(["mord","accent"],[g],e);return s?(s.children[0]=k,s.height=Math.max(k.height,s.height),s.classes[0]="mord",s):k},mU=(t,e)=>{var n=t.isStretchy?Gl.mathMLnode(t.label):new Fe.MathNode("mo",[Ra(t.label,t.mode)]),r=new Fe.MathNode("mover",[hr(t.base,e),n]);return r.setAttribute("accent","true"),r},$3e=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));tt({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:(t,e)=>{var n=Ay(e[0]),r=!$3e.test(t.funcName),s=!r||t.funcName==="\\widehat"||t.funcName==="\\widetilde"||t.funcName==="\\widecheck";return{type:"accent",mode:t.parser.mode,label:t.funcName,isStretchy:r,isShifty:s,base:n}},htmlBuilder:LN,mathmlBuilder:mU});tt({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(t,e)=>{var n=e[0],r=t.parser.mode;return r==="math"&&(t.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+t.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:t.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:LN,mathmlBuilder:mU});tt({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(t,e)=>{var{parser:n,funcName:r}=t,s=e[0];return{type:"accentUnder",mode:n.mode,label:r,base:s}},htmlBuilder:(t,e)=>{var n=qn(t.base,e),r=Gl.svgSpan(t,e),s=t.label==="\\utilde"?.12:0,i=we.makeVList({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:s},{type:"elem",elem:n}]},e);return we.makeSpan(["mord","accentunder"],[i],e)},mathmlBuilder:(t,e)=>{var n=Gl.mathMLnode(t.label),r=new Fe.MathNode("munder",[hr(t.base,e),n]);return r.setAttribute("accentunder","true"),r}});var $1=t=>{var e=new Fe.MathNode("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};tt({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(t,e,n){var{parser:r,funcName:s}=t;return{type:"xArrow",mode:r.mode,label:s,body:e[0],below:n[0]}},htmlBuilder(t,e){var n=e.style,r=e.havingStyle(n.sup()),s=we.wrapFragment(qn(t.body,r,e),e),i=t.label.slice(0,2)==="\\x"?"x":"cd";s.classes.push(i+"-arrow-pad");var a;t.below&&(r=e.havingStyle(n.sub()),a=we.wrapFragment(qn(t.below,r,e),e),a.classes.push(i+"-arrow-pad"));var l=Gl.svgSpan(t,e),c=-e.fontMetrics().axisHeight+.5*l.height,d=-e.fontMetrics().axisHeight-.5*l.height-.111;(s.depth>.25||t.label==="\\xleftequilibrium")&&(d-=s.depth);var h;if(a){var m=-e.fontMetrics().axisHeight+a.height+.5*l.height+.111;h=we.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:d},{type:"elem",elem:l,shift:c},{type:"elem",elem:a,shift:m}]},e)}else h=we.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:d},{type:"elem",elem:l,shift:c}]},e);return h.children[0].children[0].children[1].classes.push("svg-align"),we.makeSpan(["mrel","x-arrow"],[h],e)},mathmlBuilder(t,e){var n=Gl.mathMLnode(t.label);n.setAttribute("minsize",t.label.charAt(0)==="x"?"1.75em":"3.0em");var r;if(t.body){var s=$1(hr(t.body,e));if(t.below){var i=$1(hr(t.below,e));r=new Fe.MathNode("munderover",[n,i,s])}else r=new Fe.MathNode("mover",[n,s])}else if(t.below){var a=$1(hr(t.below,e));r=new Fe.MathNode("munder",[n,a])}else r=$1(),r=new Fe.MathNode("mover",[n,r]);return r}});var H3e=we.makeSpan;function pU(t,e){var n=ms(t.body,e,!0);return H3e([t.mclass],n,e)}function gU(t,e){var n,r=Mi(t.body,e);return t.mclass==="minner"?n=new Fe.MathNode("mpadded",r):t.mclass==="mord"?t.isCharacterBox?(n=r[0],n.type="mi"):n=new Fe.MathNode("mi",r):(t.isCharacterBox?(n=r[0],n.type="mo"):n=new Fe.MathNode("mo",r),t.mclass==="mbin"?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):t.mclass==="mpunct"?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):t.mclass==="mopen"||t.mclass==="mclose"?(n.attributes.lspace="0em",n.attributes.rspace="0em"):t.mclass==="minner"&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em")),n}tt({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(t,e){var{parser:n,funcName:r}=t,s=e[0];return{type:"mclass",mode:n.mode,mclass:"m"+r.slice(5),body:Gr(s),isCharacterBox:Wn.isCharacterBox(s)}},htmlBuilder:pU,mathmlBuilder:gU});var Gb=t=>{var e=t.type==="ordgroup"&&t.body.length?t.body[0]:t;return e.type==="atom"&&(e.family==="bin"||e.family==="rel")?"m"+e.family:"mord"};tt({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(t,e){var{parser:n}=t;return{type:"mclass",mode:n.mode,mclass:Gb(e[0]),body:Gr(e[1]),isCharacterBox:Wn.isCharacterBox(e[1])}}});tt({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(t,e){var{parser:n,funcName:r}=t,s=e[1],i=e[0],a;r!=="\\stackrel"?a=Gb(s):a="mrel";var l={type:"op",mode:s.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!=="\\stackrel",body:Gr(s)},c={type:"supsub",mode:i.mode,base:l,sup:r==="\\underset"?null:i,sub:r==="\\underset"?i:null};return{type:"mclass",mode:n.mode,mclass:a,body:[c],isCharacterBox:Wn.isCharacterBox(c)}},htmlBuilder:pU,mathmlBuilder:gU});tt({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:n}=t;return{type:"pmb",mode:n.mode,mclass:Gb(e[0]),body:Gr(e[0])}},htmlBuilder(t,e){var n=ms(t.body,e,!0),r=we.makeSpan([t.mclass],n,e);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(t,e){var n=Mi(t.body,e),r=new Fe.MathNode("mstyle",n);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var Q3e={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},TR=()=>({type:"styling",body:[],mode:"math",style:"display"}),ER=t=>t.type==="textord"&&t.text==="@",V3e=(t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e;function U3e(t,e,n){var r=Q3e[t];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(r,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var s=n.callFunction("\\\\cdleft",[e[0]],[]),i={type:"atom",text:r,mode:"math",family:"rel"},a=n.callFunction("\\Big",[i],[]),l=n.callFunction("\\\\cdright",[e[1]],[]),c={type:"ordgroup",mode:"math",body:[s,a,l]};return n.callFunction("\\\\cdparent",[c],[])}case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var d={type:"textord",text:"\\Vert",mode:"math"};return n.callFunction("\\Big",[d],[])}default:return{type:"textord",text:" ",mode:"math"}}}function W3e(t){var e=[];for(t.gullet.beginGroup(),t.gullet.macros.set("\\cr","\\\\\\relax"),t.gullet.beginGroup();;){e.push(t.parseExpression(!1,"\\\\")),t.gullet.endGroup(),t.gullet.beginGroup();var n=t.fetch().text;if(n==="&"||n==="\\\\")t.consume();else if(n==="\\end"){e[e.length-1].length===0&&e.pop();break}else throw new qe("Expected \\\\ or \\cr or \\end",t.nextToken)}for(var r=[],s=[r],i=0;i<e.length;i++){for(var a=e[i],l=TR(),c=0;c<a.length;c++)if(!ER(a[c]))l.body.push(a[c]);else{r.push(l),c+=1;var d=IN(a[c]).text,h=new Array(2);if(h[0]={type:"ordgroup",mode:"math",body:[]},h[1]={type:"ordgroup",mode:"math",body:[]},!("=|.".indexOf(d)>-1))if("<>AV".indexOf(d)>-1)for(var m=0;m<2;m++){for(var g=!0,x=c+1;x<a.length;x++){if(V3e(a[x],d)){g=!1,c=x;break}if(ER(a[x]))throw new qe("Missing a "+d+" character to complete a CD arrow.",a[x]);h[m].body.push(a[x])}if(g)throw new qe("Missing a "+d+" character to complete a CD arrow.",a[c])}else throw new qe('Expected one of "<>AV=|." after @',a[c]);var y=U3e(d,h,t),w={type:"styling",body:[y],mode:"math",style:"display"};r.push(w),l=TR()}i%2===0?r.push(l):r.shift(),r=[],s.push(r)}t.gullet.endGroup(),t.gullet.endGroup();var S=new Array(s[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:s,arraystretch:1,addJot:!0,rowGaps:[null],cols:S,colSeparationType:"CD",hLinesBeforeRow:new Array(s.length+1).fill([])}}tt({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(t,e){var{parser:n,funcName:r}=t;return{type:"cdlabel",mode:n.mode,side:r.slice(4),label:e[0]}},htmlBuilder(t,e){var n=e.havingStyle(e.style.sup()),r=we.wrapFragment(qn(t.label,n,e),e);return r.classes.push("cd-label-"+t.side),r.style.bottom=Xe(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(t,e){var n=new Fe.MathNode("mrow",[hr(t.label,e)]);return n=new Fe.MathNode("mpadded",[n]),n.setAttribute("width","0"),t.side==="left"&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),n=new Fe.MathNode("mstyle",[n]),n.setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}});tt({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(t,e){var{parser:n}=t;return{type:"cdlabelparent",mode:n.mode,fragment:e[0]}},htmlBuilder(t,e){var n=we.wrapFragment(qn(t.fragment,e),e);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder(t,e){return new Fe.MathNode("mrow",[hr(t.fragment,e)])}});tt({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(t,e){for(var{parser:n}=t,r=nn(e[0],"ordgroup"),s=r.body,i="",a=0;a<s.length;a++){var l=nn(s[a],"textord");i+=l.text}var c=parseInt(i),d;if(isNaN(c))throw new qe("\\@char has non-numeric argument "+i);if(c<0||c>=1114111)throw new qe("\\@char with invalid code point "+i);return c<=65535?d=String.fromCharCode(c):(c-=65536,d=String.fromCharCode((c>>10)+55296,(c&1023)+56320)),{type:"textord",mode:n.mode,text:d}}});var xU=(t,e)=>{var n=ms(t.body,e.withColor(t.color),!1);return we.makeFragment(n)},vU=(t,e)=>{var n=Mi(t.body,e.withColor(t.color)),r=new Fe.MathNode("mstyle",n);return r.setAttribute("mathcolor",t.color),r};tt({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(t,e){var{parser:n}=t,r=nn(e[0],"color-token").color,s=e[1];return{type:"color",mode:n.mode,color:r,body:Gr(s)}},htmlBuilder:xU,mathmlBuilder:vU});tt({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(t,e){var{parser:n,breakOnTokenText:r}=t,s=nn(e[0],"color-token").color;n.gullet.macros.set("\\current@color",s);var i=n.parseExpression(!0,r);return{type:"color",mode:n.mode,color:s,body:i}},htmlBuilder:xU,mathmlBuilder:vU});tt({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(t,e,n){var{parser:r}=t,s=r.gullet.future().text==="["?r.parseSizeGroup(!0):null,i=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:i,size:s&&nn(s,"size").value}},htmlBuilder(t,e){var n=we.makeSpan(["mspace"],[],e);return t.newLine&&(n.classes.push("newline"),t.size&&(n.style.marginTop=Xe(Ir(t.size,e)))),n},mathmlBuilder(t,e){var n=new Fe.MathNode("mspace");return t.newLine&&(n.setAttribute("linebreak","newline"),t.size&&n.setAttribute("height",Xe(Ir(t.size,e)))),n}});var WO={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},yU=t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new qe("Expected a control sequence",t);return e},G3e=t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},bU=(t,e,n,r)=>{var s=t.gullet.macros.get(n.text);s==null&&(n.noexpand=!0,s={tokens:[n],numArgs:0,unexpandable:!t.gullet.isExpandable(n.text)}),t.gullet.macros.set(e,s,r)};tt({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(t){var{parser:e,funcName:n}=t;e.consumeSpaces();var r=e.fetch();if(WO[r.text])return(n==="\\global"||n==="\\\\globallong")&&(r.text=WO[r.text]),nn(e.parseFunction(),"internal");throw new qe("Invalid token after macro prefix",r)}});tt({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:n}=t,r=e.gullet.popToken(),s=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(s))throw new qe("Expected a control sequence",r);for(var i=0,a,l=[[]];e.gullet.future().text!=="{";)if(r=e.gullet.popToken(),r.text==="#"){if(e.gullet.future().text==="{"){a=e.gullet.future(),l[i].push("{");break}if(r=e.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new qe('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==i+1)throw new qe('Argument number "'+r.text+'" out of order');i++,l.push([])}else{if(r.text==="EOF")throw new qe("Expected a macro definition");l[i].push(r.text)}var{tokens:c}=e.gullet.consumeArg();return a&&c.unshift(a),(n==="\\edef"||n==="\\xdef")&&(c=e.gullet.expandTokens(c),c.reverse()),e.gullet.macros.set(s,{tokens:c,numArgs:i,delimiters:l},n===WO[n]),{type:"internal",mode:e.mode}}});tt({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:n}=t,r=yU(e.gullet.popToken());e.gullet.consumeSpaces();var s=G3e(e);return bU(e,r,s,n==="\\\\globallet"),{type:"internal",mode:e.mode}}});tt({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:n}=t,r=yU(e.gullet.popToken()),s=e.gullet.popToken(),i=e.gullet.popToken();return bU(e,r,i,n==="\\\\globalfuture"),e.gullet.pushToken(i),e.gullet.pushToken(s),{type:"internal",mode:e.mode}}});var f0=function(e,n,r){var s=pr.math[e]&&pr.math[e].replace,i=MN(s||e,n,r);if(!i)throw new Error("Unsupported symbol "+e+" and font size "+n+".");return i},BN=function(e,n,r,s){var i=r.havingBaseStyle(n),a=we.makeSpan(s.concat(i.sizingClasses(r)),[e],r),l=i.sizeMultiplier/r.sizeMultiplier;return a.height*=l,a.depth*=l,a.maxFontSize=i.sizeMultiplier,a},wU=function(e,n,r){var s=n.havingBaseStyle(r),i=(1-n.sizeMultiplier/s.sizeMultiplier)*n.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=Xe(i),e.height-=i,e.depth+=i},X3e=function(e,n,r,s,i,a){var l=we.makeSymbol(e,"Main-Regular",i,s),c=BN(l,n,s,a);return r&&wU(c,s,n),c},Y3e=function(e,n,r,s){return we.makeSymbol(e,"Size"+n+"-Regular",r,s)},SU=function(e,n,r,s,i,a){var l=Y3e(e,n,i,s),c=BN(we.makeSpan(["delimsizing","size"+n],[l],s),At.TEXT,s,a);return r&&wU(c,s,At.TEXT),c},t5=function(e,n,r){var s;n==="Size1-Regular"?s="delim-size1":s="delim-size4";var i=we.makeSpan(["delimsizinginner",s],[we.makeSpan([],[we.makeSymbol(e,n,r)])]);return{type:"elem",elem:i}},n5=function(e,n,r){var s=Mo["Size4-Regular"][e.charCodeAt(0)]?Mo["Size4-Regular"][e.charCodeAt(0)][4]:Mo["Size1-Regular"][e.charCodeAt(0)][4],i=new su("inner",t3e(e,Math.round(1e3*n))),a=new Ul([i],{width:Xe(s),height:Xe(n),style:"width:"+Xe(s),viewBox:"0 0 "+1e3*s+" "+Math.round(1e3*n),preserveAspectRatio:"xMinYMin"}),l=we.makeSvgSpan([],[a],r);return l.height=n,l.style.height=Xe(n),l.style.width=Xe(s),{type:"elem",elem:l}},GO=.008,H1={type:"kern",size:-1*GO},K3e=["|","\\lvert","\\rvert","\\vert"],Z3e=["\\|","\\lVert","\\rVert","\\Vert"],kU=function(e,n,r,s,i,a){var l,c,d,h,m="",g=0;l=d=h=e,c=null;var x="Size1-Regular";e==="\\uparrow"?d=h="⏐":e==="\\Uparrow"?d=h="‖":e==="\\downarrow"?l=d="⏐":e==="\\Downarrow"?l=d="‖":e==="\\updownarrow"?(l="\\uparrow",d="⏐",h="\\downarrow"):e==="\\Updownarrow"?(l="\\Uparrow",d="‖",h="\\Downarrow"):K3e.includes(e)?(d="∣",m="vert",g=333):Z3e.includes(e)?(d="∥",m="doublevert",g=556):e==="["||e==="\\lbrack"?(l="⎡",d="⎢",h="⎣",x="Size4-Regular",m="lbrack",g=667):e==="]"||e==="\\rbrack"?(l="⎤",d="⎥",h="⎦",x="Size4-Regular",m="rbrack",g=667):e==="\\lfloor"||e==="⌊"?(d=l="⎢",h="⎣",x="Size4-Regular",m="lfloor",g=667):e==="\\lceil"||e==="⌈"?(l="⎡",d=h="⎢",x="Size4-Regular",m="lceil",g=667):e==="\\rfloor"||e==="⌋"?(d=l="⎥",h="⎦",x="Size4-Regular",m="rfloor",g=667):e==="\\rceil"||e==="⌉"?(l="⎤",d=h="⎥",x="Size4-Regular",m="rceil",g=667):e==="("||e==="\\lparen"?(l="⎛",d="⎜",h="⎝",x="Size4-Regular",m="lparen",g=875):e===")"||e==="\\rparen"?(l="⎞",d="⎟",h="⎠",x="Size4-Regular",m="rparen",g=875):e==="\\{"||e==="\\lbrace"?(l="⎧",c="⎨",h="⎩",d="⎪",x="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(l="⎫",c="⎬",h="⎭",d="⎪",x="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(l="⎧",h="⎩",d="⎪",x="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(l="⎫",h="⎭",d="⎪",x="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(l="⎧",h="⎭",d="⎪",x="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(l="⎫",h="⎩",d="⎪",x="Size4-Regular");var y=f0(l,x,i),w=y.height+y.depth,S=f0(d,x,i),k=S.height+S.depth,j=f0(h,x,i),N=j.height+j.depth,T=0,E=1;if(c!==null){var _=f0(c,x,i);T=_.height+_.depth,E=2}var A=w+N+T,D=Math.max(0,Math.ceil((n-A)/(E*k))),q=A+D*E*k,B=s.fontMetrics().axisHeight;r&&(B*=s.sizeMultiplier);var H=q/2-B,W=[];if(m.length>0){var ee=q-w-N,I=Math.round(q*1e3),V=n3e(m,Math.round(ee*1e3)),L=new su(m,V),$=(g/1e3).toFixed(3)+"em",K=(I/1e3).toFixed(3)+"em",Y=new Ul([L],{width:$,height:K,viewBox:"0 0 "+g+" "+I}),R=we.makeSvgSpan([],[Y],s);R.height=I/1e3,R.style.width=$,R.style.height=K,W.push({type:"elem",elem:R})}else{if(W.push(t5(h,x,i)),W.push(H1),c===null){var ie=q-w-N+2*GO;W.push(n5(d,ie,s))}else{var X=(q-w-N-T)/2+2*GO;W.push(n5(d,X,s)),W.push(H1),W.push(t5(c,x,i)),W.push(H1),W.push(n5(d,X,s))}W.push(H1),W.push(t5(l,x,i))}var z=s.havingBaseStyle(At.TEXT),U=we.makeVList({positionType:"bottom",positionData:H,children:W},z);return BN(we.makeSpan(["delimsizing","mult"],[U],z),At.TEXT,s,a)},r5=80,s5=.08,i5=function(e,n,r,s,i){var a=e3e(e,s,r),l=new su(e,a),c=new Ul([l],{width:"400em",height:Xe(n),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return we.makeSvgSpan(["hide-tail"],[c],i)},J3e=function(e,n){var r=n.havingBaseSizing(),s=CU("\\surd",e*r.sizeMultiplier,NU,r),i=r.sizeMultiplier,a=Math.max(0,n.minRuleThickness-n.fontMetrics().sqrtRuleThickness),l,c=0,d=0,h=0,m;return s.type==="small"?(h=1e3+1e3*a+r5,e<1?i=1:e<1.4&&(i=.7),c=(1+a+s5)/i,d=(1+a)/i,l=i5("sqrtMain",c,h,a,n),l.style.minWidth="0.853em",m=.833/i):s.type==="large"?(h=(1e3+r5)*z0[s.size],d=(z0[s.size]+a)/i,c=(z0[s.size]+a+s5)/i,l=i5("sqrtSize"+s.size,c,h,a,n),l.style.minWidth="1.02em",m=1/i):(c=e+a+s5,d=e+a,h=Math.floor(1e3*e+a)+r5,l=i5("sqrtTall",c,h,a,n),l.style.minWidth="0.742em",m=1.056),l.height=d,l.style.height=Xe(c),{span:l,advanceWidth:m,ruleWidth:(n.fontMetrics().sqrtRuleThickness+a)*i}},OU=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],eke=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],jU=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],z0=[0,1.2,1.8,2.4,3],tke=function(e,n,r,s,i){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),OU.includes(e)||jU.includes(e))return SU(e,n,!1,r,s,i);if(eke.includes(e))return kU(e,z0[n],!1,r,s,i);throw new qe("Illegal delimiter: '"+e+"'")},nke=[{type:"small",style:At.SCRIPTSCRIPT},{type:"small",style:At.SCRIPT},{type:"small",style:At.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],rke=[{type:"small",style:At.SCRIPTSCRIPT},{type:"small",style:At.SCRIPT},{type:"small",style:At.TEXT},{type:"stack"}],NU=[{type:"small",style:At.SCRIPTSCRIPT},{type:"small",style:At.SCRIPT},{type:"small",style:At.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],ske=function(e){if(e.type==="small")return"Main-Regular";if(e.type==="large")return"Size"+e.size+"-Regular";if(e.type==="stack")return"Size4-Regular";throw new Error("Add support for delim type '"+e.type+"' here.")},CU=function(e,n,r,s){for(var i=Math.min(2,3-s.style.size),a=i;a<r.length&&r[a].type!=="stack";a++){var l=f0(e,ske(r[a]),"math"),c=l.height+l.depth;if(r[a].type==="small"){var d=s.havingBaseStyle(r[a].style);c*=d.sizeMultiplier}if(c>n)return r[a]}return r[r.length-1]},TU=function(e,n,r,s,i,a){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var l;jU.includes(e)?l=nke:OU.includes(e)?l=NU:l=rke;var c=CU(e,n,l,s);return c.type==="small"?X3e(e,c.style,r,s,i,a):c.type==="large"?SU(e,c.size,r,s,i,a):kU(e,n,r,s,i,a)},ike=function(e,n,r,s,i,a){var l=s.fontMetrics().axisHeight*s.sizeMultiplier,c=901,d=5/s.fontMetrics().ptPerEm,h=Math.max(n-l,r+l),m=Math.max(h/500*c,2*h-d);return TU(e,m,!0,s,i,a)},ql={sqrtImage:J3e,sizedDelim:tke,sizeToMaxHeight:z0,customSizedDelim:TU,leftRightDelim:ike},_R={"\\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}},ake=["(","\\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 Xb(t,e){var n=Wb(t);if(n&&ake.includes(n.text))return n;throw n?new qe("Invalid delimiter '"+n.text+"' after '"+e.funcName+"'",t):new qe("Invalid delimiter type '"+t.type+"'",t)}tt({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:(t,e)=>{var n=Xb(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:_R[t.funcName].size,mclass:_R[t.funcName].mclass,delim:n.text}},htmlBuilder:(t,e)=>t.delim==="."?we.makeSpan([t.mclass]):ql.sizedDelim(t.delim,t.size,e,t.mode,[t.mclass]),mathmlBuilder:t=>{var e=[];t.delim!=="."&&e.push(Ra(t.delim,t.mode));var n=new Fe.MathNode("mo",e);t.mclass==="mopen"||t.mclass==="mclose"?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=Xe(ql.sizeToMaxHeight[t.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}});function AR(t){if(!t.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}tt({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var n=t.parser.gullet.macros.get("\\current@color");if(n&&typeof n!="string")throw new qe("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:t.parser.mode,delim:Xb(e[0],t).text,color:n}}});tt({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var n=Xb(e[0],t),r=t.parser;++r.leftrightDepth;var s=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var i=nn(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:s,left:n.text,right:i.delim,rightColor:i.color}},htmlBuilder:(t,e)=>{AR(t);for(var n=ms(t.body,e,!0,["mopen","mclose"]),r=0,s=0,i=!1,a=0;a<n.length;a++)n[a].isMiddle?i=!0:(r=Math.max(n[a].height,r),s=Math.max(n[a].depth,s));r*=e.sizeMultiplier,s*=e.sizeMultiplier;var l;if(t.left==="."?l=Sp(e,["mopen"]):l=ql.leftRightDelim(t.left,r,s,e,t.mode,["mopen"]),n.unshift(l),i)for(var c=1;c<n.length;c++){var d=n[c],h=d.isMiddle;h&&(n[c]=ql.leftRightDelim(h.delim,r,s,h.options,t.mode,[]))}var m;if(t.right===".")m=Sp(e,["mclose"]);else{var g=t.rightColor?e.withColor(t.rightColor):e;m=ql.leftRightDelim(t.right,r,s,g,t.mode,["mclose"])}return n.push(m),we.makeSpan(["minner"],n,e)},mathmlBuilder:(t,e)=>{AR(t);var n=Mi(t.body,e);if(t.left!=="."){var r=new Fe.MathNode("mo",[Ra(t.left,t.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if(t.right!=="."){var s=new Fe.MathNode("mo",[Ra(t.right,t.mode)]);s.setAttribute("fence","true"),t.rightColor&&s.setAttribute("mathcolor",t.rightColor),n.push(s)}return PN(n)}});tt({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var n=Xb(e[0],t);if(!t.parser.leftrightDepth)throw new qe("\\middle without preceding \\left",n);return{type:"middle",mode:t.parser.mode,delim:n.text}},htmlBuilder:(t,e)=>{var n;if(t.delim===".")n=Sp(e,[]);else{n=ql.sizedDelim(t.delim,1,e,t.mode,[]);var r={delim:t.delim,options:e};n.isMiddle=r}return n},mathmlBuilder:(t,e)=>{var n=t.delim==="\\vert"||t.delim==="|"?Ra("|","text"):Ra(t.delim,t.mode),r=new Fe.MathNode("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var FN=(t,e)=>{var n=we.wrapFragment(qn(t.body,e),e),r=t.label.slice(1),s=e.sizeMultiplier,i,a=0,l=Wn.isCharacterBox(t.body);if(r==="sout")i=we.makeSpan(["stretchy","sout"]),i.height=e.fontMetrics().defaultRuleThickness/s,a=-.5*e.fontMetrics().xHeight;else if(r==="phase"){var c=Ir({number:.6,unit:"pt"},e),d=Ir({number:.35,unit:"ex"},e),h=e.havingBaseSizing();s=s/h.sizeMultiplier;var m=n.height+n.depth+c+d;n.style.paddingLeft=Xe(m/2+c);var g=Math.floor(1e3*m*s),x=Z5e(g),y=new Ul([new su("phase",x)],{width:"400em",height:Xe(g/1e3),viewBox:"0 0 400000 "+g,preserveAspectRatio:"xMinYMin slice"});i=we.makeSvgSpan(["hide-tail"],[y],e),i.style.height=Xe(m),a=n.depth+c+d}else{/cancel/.test(r)?l||n.classes.push("cancel-pad"):r==="angl"?n.classes.push("anglpad"):n.classes.push("boxpad");var w=0,S=0,k=0;/box/.test(r)?(k=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),w=e.fontMetrics().fboxsep+(r==="colorbox"?0:k),S=w):r==="angl"?(k=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),w=4*k,S=Math.max(0,.25-n.depth)):(w=l?.2:0,S=w),i=Gl.encloseSpan(n,r,w,S,e),/fbox|boxed|fcolorbox/.test(r)?(i.style.borderStyle="solid",i.style.borderWidth=Xe(k)):r==="angl"&&k!==.049&&(i.style.borderTopWidth=Xe(k),i.style.borderRightWidth=Xe(k)),a=n.depth+S,t.backgroundColor&&(i.style.backgroundColor=t.backgroundColor,t.borderColor&&(i.style.borderColor=t.borderColor))}var j;if(t.backgroundColor)j=we.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:a},{type:"elem",elem:n,shift:0}]},e);else{var N=/cancel|phase/.test(r)?["svg-align"]:[];j=we.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:0},{type:"elem",elem:i,shift:a,wrapperClasses:N}]},e)}return/cancel/.test(r)&&(j.height=n.height,j.depth=n.depth),/cancel/.test(r)&&!l?we.makeSpan(["mord","cancel-lap"],[j],e):we.makeSpan(["mord"],[j],e)},qN=(t,e)=>{var n=0,r=new Fe.MathNode(t.label.indexOf("colorbox")>-1?"mpadded":"menclose",[hr(t.body,e)]);switch(t.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*n+"pt"),r.setAttribute("height","+"+2*n+"pt"),r.setAttribute("lspace",n+"pt"),r.setAttribute("voffset",n+"pt"),t.label==="\\fcolorbox"){var s=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);r.setAttribute("style","border: "+s+"em solid "+String(t.borderColor))}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return t.backgroundColor&&r.setAttribute("mathbackground",t.backgroundColor),r};tt({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(t,e,n){var{parser:r,funcName:s}=t,i=nn(e[0],"color-token").color,a=e[1];return{type:"enclose",mode:r.mode,label:s,backgroundColor:i,body:a}},htmlBuilder:FN,mathmlBuilder:qN});tt({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(t,e,n){var{parser:r,funcName:s}=t,i=nn(e[0],"color-token").color,a=nn(e[1],"color-token").color,l=e[2];return{type:"enclose",mode:r.mode,label:s,backgroundColor:a,borderColor:i,body:l}},htmlBuilder:FN,mathmlBuilder:qN});tt({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(t,e){var{parser:n}=t;return{type:"enclose",mode:n.mode,label:"\\fbox",body:e[0]}}});tt({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(t,e){var{parser:n,funcName:r}=t,s=e[0];return{type:"enclose",mode:n.mode,label:r,body:s}},htmlBuilder:FN,mathmlBuilder:qN});tt({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(t,e){var{parser:n}=t;return{type:"enclose",mode:n.mode,label:"\\angl",body:e[0]}}});var EU={};function Go(t){for(var{type:e,names:n,props:r,handler:s,htmlBuilder:i,mathmlBuilder:a}=t,l={type:e,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:s},c=0;c<n.length;++c)EU[n[c]]=l;i&&(Ey[e]=i),a&&(_y[e]=a)}var _U={};function J(t,e){_U[t]=e}function MR(t){var e=[];t.consumeSpaces();var n=t.fetch().text;for(n==="\\relax"&&(t.consume(),t.consumeSpaces(),n=t.fetch().text);n==="\\hline"||n==="\\hdashline";)t.consume(),e.push(n==="\\hdashline"),t.consumeSpaces(),n=t.fetch().text;return e}var Yb=t=>{var e=t.parser.settings;if(!e.displayMode)throw new qe("{"+t.envName+"} can be used only in display mode.")};function $N(t){if(t.indexOf("ed")===-1)return t.indexOf("*")===-1}function mu(t,e,n){var{hskipBeforeAndAfter:r,addJot:s,cols:i,arraystretch:a,colSeparationType:l,autoTag:c,singleRow:d,emptySingleRow:h,maxNumCols:m,leqno:g}=e;if(t.gullet.beginGroup(),d||t.gullet.macros.set("\\cr","\\\\\\relax"),!a){var x=t.gullet.expandMacroAsText("\\arraystretch");if(x==null)a=1;else if(a=parseFloat(x),!a||a<0)throw new qe("Invalid \\arraystretch: "+x)}t.gullet.beginGroup();var y=[],w=[y],S=[],k=[],j=c!=null?[]:void 0;function N(){c&&t.gullet.macros.set("\\@eqnsw","1",!0)}function T(){j&&(t.gullet.macros.get("\\df@tag")?(j.push(t.subparse([new Zi("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):j.push(!!c&&t.gullet.macros.get("\\@eqnsw")==="1"))}for(N(),k.push(MR(t));;){var E=t.parseExpression(!1,d?"\\end":"\\\\");t.gullet.endGroup(),t.gullet.beginGroup(),E={type:"ordgroup",mode:t.mode,body:E},n&&(E={type:"styling",mode:t.mode,style:n,body:[E]}),y.push(E);var _=t.fetch().text;if(_==="&"){if(m&&y.length===m){if(d||l)throw new qe("Too many tab characters: &",t.nextToken);t.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}t.consume()}else if(_==="\\end"){T(),y.length===1&&E.type==="styling"&&E.body[0].body.length===0&&(w.length>1||!h)&&w.pop(),k.length<w.length+1&&k.push([]);break}else if(_==="\\\\"){t.consume();var A=void 0;t.gullet.future().text!==" "&&(A=t.parseSizeGroup(!0)),S.push(A?A.value:null),T(),k.push(MR(t)),y=[],w.push(y),N()}else throw new qe("Expected & or \\\\ or \\cr or \\end",t.nextToken)}return t.gullet.endGroup(),t.gullet.endGroup(),{type:"array",mode:t.mode,addJot:s,arraystretch:a,body:w,cols:i,rowGaps:S,hskipBeforeAndAfter:r,hLinesBeforeRow:k,colSeparationType:l,tags:j,leqno:g}}function HN(t){return t.slice(0,1)==="d"?"display":"text"}var Xo=function(e,n){var r,s,i=e.body.length,a=e.hLinesBeforeRow,l=0,c=new Array(i),d=[],h=Math.max(n.fontMetrics().arrayRuleWidth,n.minRuleThickness),m=1/n.fontMetrics().ptPerEm,g=5*m;if(e.colSeparationType&&e.colSeparationType==="small"){var x=n.havingStyle(At.SCRIPT).sizeMultiplier;g=.2778*(x/n.sizeMultiplier)}var y=e.colSeparationType==="CD"?Ir({number:3,unit:"ex"},n):12*m,w=3*m,S=e.arraystretch*y,k=.7*S,j=.3*S,N=0;function T($e){for(var jt=0;jt<$e.length;++jt)jt>0&&(N+=.25),d.push({pos:N,isDashed:$e[jt]})}for(T(a[0]),r=0;r<e.body.length;++r){var E=e.body[r],_=k,A=j;l<E.length&&(l=E.length);var D=new Array(E.length);for(s=0;s<E.length;++s){var q=qn(E[s],n);A<q.depth&&(A=q.depth),_<q.height&&(_=q.height),D[s]=q}var B=e.rowGaps[r],H=0;B&&(H=Ir(B,n),H>0&&(H+=j,A<H&&(A=H),H=0)),e.addJot&&(A+=w),D.height=_,D.depth=A,N+=_,D.pos=N,N+=A+H,c[r]=D,T(a[r+1])}var W=N/2+n.fontMetrics().axisHeight,ee=e.cols||[],I=[],V,L,$=[];if(e.tags&&e.tags.some($e=>$e))for(r=0;r<i;++r){var K=c[r],Y=K.pos-W,R=e.tags[r],ie=void 0;R===!0?ie=we.makeSpan(["eqn-num"],[],n):R===!1?ie=we.makeSpan([],[],n):ie=we.makeSpan([],ms(R,n,!0),n),ie.depth=K.depth,ie.height=K.height,$.push({type:"elem",elem:ie,shift:Y})}for(s=0,L=0;s<l||L<ee.length;++s,++L){for(var X=ee[L]||{},z=!0;X.type==="separator";){if(z||(V=we.makeSpan(["arraycolsep"],[]),V.style.width=Xe(n.fontMetrics().doubleRuleSep),I.push(V)),X.separator==="|"||X.separator===":"){var U=X.separator==="|"?"solid":"dashed",te=we.makeSpan(["vertical-separator"],[],n);te.style.height=Xe(N),te.style.borderRightWidth=Xe(h),te.style.borderRightStyle=U,te.style.margin="0 "+Xe(-h/2);var ne=N-W;ne&&(te.style.verticalAlign=Xe(-ne)),I.push(te)}else throw new qe("Invalid separator type: "+X.separator);L++,X=ee[L]||{},z=!1}if(!(s>=l)){var G=void 0;(s>0||e.hskipBeforeAndAfter)&&(G=Wn.deflt(X.pregap,g),G!==0&&(V=we.makeSpan(["arraycolsep"],[]),V.style.width=Xe(G),I.push(V)));var se=[];for(r=0;r<i;++r){var re=c[r],ae=re[s];if(ae){var _e=re.pos-W;ae.depth=re.depth,ae.height=re.height,se.push({type:"elem",elem:ae,shift:_e})}}se=we.makeVList({positionType:"individualShift",children:se},n),se=we.makeSpan(["col-align-"+(X.align||"c")],[se]),I.push(se),(s<l-1||e.hskipBeforeAndAfter)&&(G=Wn.deflt(X.postgap,g),G!==0&&(V=we.makeSpan(["arraycolsep"],[]),V.style.width=Xe(G),I.push(V)))}}if(c=we.makeSpan(["mtable"],I),d.length>0){for(var Be=we.makeLineSpan("hline",n,h),Ye=we.makeLineSpan("hdashline",n,h),Je=[{type:"elem",elem:c,shift:0}];d.length>0;){var Oe=d.pop(),Ve=Oe.pos-W;Oe.isDashed?Je.push({type:"elem",elem:Ye,shift:Ve}):Je.push({type:"elem",elem:Be,shift:Ve})}c=we.makeVList({positionType:"individualShift",children:Je},n)}if($.length===0)return we.makeSpan(["mord"],[c],n);var Ue=we.makeVList({positionType:"individualShift",children:$},n);return Ue=we.makeSpan(["tag"],[Ue],n),we.makeFragment([c,Ue])},oke={c:"center ",l:"left ",r:"right "},Yo=function(e,n){for(var r=[],s=new Fe.MathNode("mtd",[],["mtr-glue"]),i=new Fe.MathNode("mtd",[],["mml-eqn-num"]),a=0;a<e.body.length;a++){for(var l=e.body[a],c=[],d=0;d<l.length;d++)c.push(new Fe.MathNode("mtd",[hr(l[d],n)]));e.tags&&e.tags[a]&&(c.unshift(s),c.push(s),e.leqno?c.unshift(i):c.push(i)),r.push(new Fe.MathNode("mtr",c))}var h=new Fe.MathNode("mtable",r),m=e.arraystretch===.5?.1:.16+e.arraystretch-1+(e.addJot?.09:0);h.setAttribute("rowspacing",Xe(m));var g="",x="";if(e.cols&&e.cols.length>0){var y=e.cols,w="",S=!1,k=0,j=y.length;y[0].type==="separator"&&(g+="top ",k=1),y[y.length-1].type==="separator"&&(g+="bottom ",j-=1);for(var N=k;N<j;N++)y[N].type==="align"?(x+=oke[y[N].align],S&&(w+="none "),S=!0):y[N].type==="separator"&&S&&(w+=y[N].separator==="|"?"solid ":"dashed ",S=!1);h.setAttribute("columnalign",x.trim()),/[sd]/.test(w)&&h.setAttribute("columnlines",w.trim())}if(e.colSeparationType==="align"){for(var T=e.cols||[],E="",_=1;_<T.length;_++)E+=_%2?"0em ":"1em ";h.setAttribute("columnspacing",E.trim())}else e.colSeparationType==="alignat"||e.colSeparationType==="gather"?h.setAttribute("columnspacing","0em"):e.colSeparationType==="small"?h.setAttribute("columnspacing","0.2778em"):e.colSeparationType==="CD"?h.setAttribute("columnspacing","0.5em"):h.setAttribute("columnspacing","1em");var A="",D=e.hLinesBeforeRow;g+=D[0].length>0?"left ":"",g+=D[D.length-1].length>0?"right ":"";for(var q=1;q<D.length-1;q++)A+=D[q].length===0?"none ":D[q][0]?"dashed ":"solid ";return/[sd]/.test(A)&&h.setAttribute("rowlines",A.trim()),g!==""&&(h=new Fe.MathNode("menclose",[h]),h.setAttribute("notation",g.trim())),e.arraystretch&&e.arraystretch<1&&(h=new Fe.MathNode("mstyle",[h]),h.setAttribute("scriptlevel","1")),h},AU=function(e,n){e.envName.indexOf("ed")===-1&&Yb(e);var r=[],s=e.envName.indexOf("at")>-1?"alignat":"align",i=e.envName==="split",a=mu(e.parser,{cols:r,addJot:!0,autoTag:i?void 0:$N(e.envName),emptySingleRow:!0,colSeparationType:s,maxNumCols:i?2:void 0,leqno:e.parser.settings.leqno},"display"),l,c=0,d={type:"ordgroup",mode:e.mode,body:[]};if(n[0]&&n[0].type==="ordgroup"){for(var h="",m=0;m<n[0].body.length;m++){var g=nn(n[0].body[m],"textord");h+=g.text}l=Number(h),c=l*2}var x=!c;a.body.forEach(function(k){for(var j=1;j<k.length;j+=2){var N=nn(k[j],"styling"),T=nn(N.body[0],"ordgroup");T.body.unshift(d)}if(x)c<k.length&&(c=k.length);else{var E=k.length/2;if(l<E)throw new qe("Too many math in a row: "+("expected "+l+", but got "+E),k[0])}});for(var y=0;y<c;++y){var w="r",S=0;y%2===1?w="l":y>0&&x&&(S=1),r[y]={type:"align",align:w,pregap:S,postgap:0}}return a.colSeparationType=x?"align":"alignat",a};Go({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var n=Wb(e[0]),r=n?[e[0]]:nn(e[0],"ordgroup").body,s=r.map(function(a){var l=IN(a),c=l.text;if("lcr".indexOf(c)!==-1)return{type:"align",align:c};if(c==="|")return{type:"separator",separator:"|"};if(c===":")return{type:"separator",separator:":"};throw new qe("Unknown column alignment: "+c,a)}),i={cols:s,hskipBeforeAndAfter:!0,maxNumCols:s.length};return mu(t.parser,i,HN(t.envName))},htmlBuilder:Xo,mathmlBuilder:Yo});Go({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(t){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[t.envName.replace("*","")],n="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if(t.envName.charAt(t.envName.length-1)==="*"){var s=t.parser;if(s.consumeSpaces(),s.fetch().text==="["){if(s.consume(),s.consumeSpaces(),n=s.fetch().text,"lcr".indexOf(n)===-1)throw new qe("Expected l or c or r",s.nextToken);s.consume(),s.consumeSpaces(),s.expect("]"),s.consume(),r.cols=[{type:"align",align:n}]}}var i=mu(t.parser,r,HN(t.envName)),a=Math.max(0,...i.body.map(l=>l.length));return i.cols=new Array(a).fill({type:"align",align:n}),e?{type:"leftright",mode:t.mode,body:[i],left:e[0],right:e[1],rightColor:void 0}:i},htmlBuilder:Xo,mathmlBuilder:Yo});Go({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e={arraystretch:.5},n=mu(t.parser,e,"script");return n.colSeparationType="small",n},htmlBuilder:Xo,mathmlBuilder:Yo});Go({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var n=Wb(e[0]),r=n?[e[0]]:nn(e[0],"ordgroup").body,s=r.map(function(a){var l=IN(a),c=l.text;if("lc".indexOf(c)!==-1)return{type:"align",align:c};throw new qe("Unknown column alignment: "+c,a)});if(s.length>1)throw new qe("{subarray} can contain only one column");var i={cols:s,hskipBeforeAndAfter:!1,arraystretch:.5};if(i=mu(t.parser,i,"script"),i.body.length>0&&i.body[0].length>1)throw new qe("{subarray} can contain only one column");return i},htmlBuilder:Xo,mathmlBuilder:Yo});Go({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(t){var e={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},n=mu(t.parser,e,HN(t.envName));return{type:"leftright",mode:t.mode,body:[n],left:t.envName.indexOf("r")>-1?".":"\\{",right:t.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:Xo,mathmlBuilder:Yo});Go({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:AU,htmlBuilder:Xo,mathmlBuilder:Yo});Go({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){["gather","gather*"].includes(t.envName)&&Yb(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:$N(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return mu(t.parser,e,"display")},htmlBuilder:Xo,mathmlBuilder:Yo});Go({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:AU,htmlBuilder:Xo,mathmlBuilder:Yo});Go({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){Yb(t);var e={autoTag:$N(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return mu(t.parser,e,"display")},htmlBuilder:Xo,mathmlBuilder:Yo});Go({type:"array",names:["CD"],props:{numArgs:0},handler(t){return Yb(t),W3e(t.parser)},htmlBuilder:Xo,mathmlBuilder:Yo});J("\\nonumber","\\gdef\\@eqnsw{0}");J("\\notag","\\nonumber");tt({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(t,e){throw new qe(t.funcName+" valid only within array environment")}});var RR=EU;tt({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(t,e){var{parser:n,funcName:r}=t,s=e[0];if(s.type!=="ordgroup")throw new qe("Invalid environment name",s);for(var i="",a=0;a<s.body.length;++a)i+=nn(s.body[a],"textord").text;if(r==="\\begin"){if(!RR.hasOwnProperty(i))throw new qe("No such environment: "+i,s);var l=RR[i],{args:c,optArgs:d}=n.parseArguments("\\begin{"+i+"}",l),h={mode:n.mode,envName:i,parser:n},m=l.handler(h,c,d);n.expect("\\end",!1);var g=n.nextToken,x=nn(n.parseFunction(),"environment");if(x.name!==i)throw new qe("Mismatch: \\begin{"+i+"} matched by \\end{"+x.name+"}",g);return m}return{type:"environment",mode:n.mode,name:i,nameGroup:s}}});var MU=(t,e)=>{var n=t.font,r=e.withFont(n);return qn(t.body,r)},RU=(t,e)=>{var n=t.font,r=e.withFont(n);return hr(t.body,r)},DR={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};tt({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(t,e)=>{var{parser:n,funcName:r}=t,s=Ay(e[0]),i=r;return i in DR&&(i=DR[i]),{type:"font",mode:n.mode,font:i.slice(1),body:s}},htmlBuilder:MU,mathmlBuilder:RU});tt({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(t,e)=>{var{parser:n}=t,r=e[0],s=Wn.isCharacterBox(r);return{type:"mclass",mode:n.mode,mclass:Gb(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:s}}});tt({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{parser:n,funcName:r,breakOnTokenText:s}=t,{mode:i}=n,a=n.parseExpression(!0,s),l="math"+r.slice(1);return{type:"font",mode:i,font:l,body:{type:"ordgroup",mode:n.mode,body:a}}},htmlBuilder:MU,mathmlBuilder:RU});var DU=(t,e)=>{var n=e;return t==="display"?n=n.id>=At.SCRIPT.id?n.text():At.DISPLAY:t==="text"&&n.size===At.DISPLAY.size?n=At.TEXT:t==="script"?n=At.SCRIPT:t==="scriptscript"&&(n=At.SCRIPTSCRIPT),n},QN=(t,e)=>{var n=DU(t.size,e.style),r=n.fracNum(),s=n.fracDen(),i;i=e.havingStyle(r);var a=qn(t.numer,i,e);if(t.continued){var l=8.5/e.fontMetrics().ptPerEm,c=3.5/e.fontMetrics().ptPerEm;a.height=a.height<l?l:a.height,a.depth=a.depth<c?c:a.depth}i=e.havingStyle(s);var d=qn(t.denom,i,e),h,m,g;t.hasBarLine?(t.barSize?(m=Ir(t.barSize,e),h=we.makeLineSpan("frac-line",e,m)):h=we.makeLineSpan("frac-line",e),m=h.height,g=h.height):(h=null,m=0,g=e.fontMetrics().defaultRuleThickness);var x,y,w;n.size===At.DISPLAY.size||t.size==="display"?(x=e.fontMetrics().num1,m>0?y=3*g:y=7*g,w=e.fontMetrics().denom1):(m>0?(x=e.fontMetrics().num2,y=g):(x=e.fontMetrics().num3,y=3*g),w=e.fontMetrics().denom2);var S;if(h){var j=e.fontMetrics().axisHeight;x-a.depth-(j+.5*m)<y&&(x+=y-(x-a.depth-(j+.5*m))),j-.5*m-(d.height-w)<y&&(w+=y-(j-.5*m-(d.height-w)));var N=-(j-.5*m);S=we.makeVList({positionType:"individualShift",children:[{type:"elem",elem:d,shift:w},{type:"elem",elem:h,shift:N},{type:"elem",elem:a,shift:-x}]},e)}else{var k=x-a.depth-(d.height-w);k<y&&(x+=.5*(y-k),w+=.5*(y-k)),S=we.makeVList({positionType:"individualShift",children:[{type:"elem",elem:d,shift:w},{type:"elem",elem:a,shift:-x}]},e)}i=e.havingStyle(n),S.height*=i.sizeMultiplier/e.sizeMultiplier,S.depth*=i.sizeMultiplier/e.sizeMultiplier;var T;n.size===At.DISPLAY.size?T=e.fontMetrics().delim1:n.size===At.SCRIPTSCRIPT.size?T=e.havingStyle(At.SCRIPT).fontMetrics().delim2:T=e.fontMetrics().delim2;var E,_;return t.leftDelim==null?E=Sp(e,["mopen"]):E=ql.customSizedDelim(t.leftDelim,T,!0,e.havingStyle(n),t.mode,["mopen"]),t.continued?_=we.makeSpan([]):t.rightDelim==null?_=Sp(e,["mclose"]):_=ql.customSizedDelim(t.rightDelim,T,!0,e.havingStyle(n),t.mode,["mclose"]),we.makeSpan(["mord"].concat(i.sizingClasses(e)),[E,we.makeSpan(["mfrac"],[S]),_],e)},VN=(t,e)=>{var n=new Fe.MathNode("mfrac",[hr(t.numer,e),hr(t.denom,e)]);if(!t.hasBarLine)n.setAttribute("linethickness","0px");else if(t.barSize){var r=Ir(t.barSize,e);n.setAttribute("linethickness",Xe(r))}var s=DU(t.size,e.style);if(s.size!==e.style.size){n=new Fe.MathNode("mstyle",[n]);var i=s.size===At.DISPLAY.size?"true":"false";n.setAttribute("displaystyle",i),n.setAttribute("scriptlevel","0")}if(t.leftDelim!=null||t.rightDelim!=null){var a=[];if(t.leftDelim!=null){var l=new Fe.MathNode("mo",[new Fe.TextNode(t.leftDelim.replace("\\",""))]);l.setAttribute("fence","true"),a.push(l)}if(a.push(n),t.rightDelim!=null){var c=new Fe.MathNode("mo",[new Fe.TextNode(t.rightDelim.replace("\\",""))]);c.setAttribute("fence","true"),a.push(c)}return PN(a)}return n};tt({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(t,e)=>{var{parser:n,funcName:r}=t,s=e[0],i=e[1],a,l=null,c=null,d="auto";switch(r){case"\\dfrac":case"\\frac":case"\\tfrac":a=!0;break;case"\\\\atopfrac":a=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":a=!1,l="(",c=")";break;case"\\\\bracefrac":a=!1,l="\\{",c="\\}";break;case"\\\\brackfrac":a=!1,l="[",c="]";break;default:throw new Error("Unrecognized genfrac command")}switch(r){case"\\dfrac":case"\\dbinom":d="display";break;case"\\tfrac":case"\\tbinom":d="text";break}return{type:"genfrac",mode:n.mode,continued:!1,numer:s,denom:i,hasBarLine:a,leftDelim:l,rightDelim:c,size:d,barSize:null}},htmlBuilder:QN,mathmlBuilder:VN});tt({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(t,e)=>{var{parser:n,funcName:r}=t,s=e[0],i=e[1];return{type:"genfrac",mode:n.mode,continued:!0,numer:s,denom:i,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}});tt({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(t){var{parser:e,funcName:n,token:r}=t,s;switch(n){case"\\over":s="\\frac";break;case"\\choose":s="\\binom";break;case"\\atop":s="\\\\atopfrac";break;case"\\brace":s="\\\\bracefrac";break;case"\\brack":s="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:e.mode,replaceWith:s,token:r}}});var PR=["display","text","script","scriptscript"],zR=function(e){var n=null;return e.length>0&&(n=e,n=n==="."?null:n),n};tt({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(t,e){var{parser:n}=t,r=e[4],s=e[5],i=Ay(e[0]),a=i.type==="atom"&&i.family==="open"?zR(i.text):null,l=Ay(e[1]),c=l.type==="atom"&&l.family==="close"?zR(l.text):null,d=nn(e[2],"size"),h,m=null;d.isBlank?h=!0:(m=d.value,h=m.number>0);var g="auto",x=e[3];if(x.type==="ordgroup"){if(x.body.length>0){var y=nn(x.body[0],"textord");g=PR[Number(y.text)]}}else x=nn(x,"textord"),g=PR[Number(x.text)];return{type:"genfrac",mode:n.mode,numer:r,denom:s,continued:!1,hasBarLine:h,barSize:m,leftDelim:a,rightDelim:c,size:g}},htmlBuilder:QN,mathmlBuilder:VN});tt({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(t,e){var{parser:n,funcName:r,token:s}=t;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:nn(e[0],"size").value,token:s}}});tt({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(t,e)=>{var{parser:n,funcName:r}=t,s=e[0],i=I5e(nn(e[1],"infix").size),a=e[2],l=i.number>0;return{type:"genfrac",mode:n.mode,numer:s,denom:a,continued:!1,hasBarLine:l,barSize:i,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:QN,mathmlBuilder:VN});var PU=(t,e)=>{var n=e.style,r,s;t.type==="supsub"?(r=t.sup?qn(t.sup,e.havingStyle(n.sup()),e):qn(t.sub,e.havingStyle(n.sub()),e),s=nn(t.base,"horizBrace")):s=nn(t,"horizBrace");var i=qn(s.base,e.havingBaseStyle(At.DISPLAY)),a=Gl.svgSpan(s,e),l;if(s.isOver?(l=we.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:.1},{type:"elem",elem:a}]},e),l.children[0].children[0].children[1].classes.push("svg-align")):(l=we.makeVList({positionType:"bottom",positionData:i.depth+.1+a.height,children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:i}]},e),l.children[0].children[0].children[0].classes.push("svg-align")),r){var c=we.makeSpan(["mord",s.isOver?"mover":"munder"],[l],e);s.isOver?l=we.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:c},{type:"kern",size:.2},{type:"elem",elem:r}]},e):l=we.makeVList({positionType:"bottom",positionData:c.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:c}]},e)}return we.makeSpan(["mord",s.isOver?"mover":"munder"],[l],e)},lke=(t,e)=>{var n=Gl.mathMLnode(t.label);return new Fe.MathNode(t.isOver?"mover":"munder",[hr(t.base,e),n])};tt({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(t,e){var{parser:n,funcName:r}=t;return{type:"horizBrace",mode:n.mode,label:r,isOver:/^\\over/.test(r),base:e[0]}},htmlBuilder:PU,mathmlBuilder:lke});tt({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=e[1],s=nn(e[0],"url").url;return n.settings.isTrusted({command:"\\href",url:s})?{type:"href",mode:n.mode,href:s,body:Gr(r)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(t,e)=>{var n=ms(t.body,e,!1);return we.makeAnchor(t.href,[],n,e)},mathmlBuilder:(t,e)=>{var n=iu(t.body,e);return n instanceof Ui||(n=new Ui("mrow",[n])),n.setAttribute("href",t.href),n}});tt({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=nn(e[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:r}))return n.formatUnsupportedCmd("\\url");for(var s=[],i=0;i<r.length;i++){var a=r[i];a==="~"&&(a="\\textasciitilde"),s.push({type:"textord",mode:"text",text:a})}var l={type:"text",mode:n.mode,font:"\\texttt",body:s};return{type:"href",mode:n.mode,href:r,body:Gr(l)}}});tt({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0},handler(t,e){var{parser:n}=t;return{type:"hbox",mode:n.mode,body:Gr(e[0])}},htmlBuilder(t,e){var n=ms(t.body,e,!1);return we.makeFragment(n)},mathmlBuilder(t,e){return new Fe.MathNode("mrow",Mi(t.body,e))}});tt({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(t,e)=>{var{parser:n,funcName:r,token:s}=t,i=nn(e[0],"raw").string,a=e[1];n.settings.strict&&n.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var l,c={};switch(r){case"\\htmlClass":c.class=i,l={command:"\\htmlClass",class:i};break;case"\\htmlId":c.id=i,l={command:"\\htmlId",id:i};break;case"\\htmlStyle":c.style=i,l={command:"\\htmlStyle",style:i};break;case"\\htmlData":{for(var d=i.split(","),h=0;h<d.length;h++){var m=d[h].split("=");if(m.length!==2)throw new qe("Error parsing key-value for \\htmlData");c["data-"+m[0].trim()]=m[1].trim()}l={command:"\\htmlData",attributes:c};break}default:throw new Error("Unrecognized html command")}return n.settings.isTrusted(l)?{type:"html",mode:n.mode,attributes:c,body:Gr(a)}:n.formatUnsupportedCmd(r)},htmlBuilder:(t,e)=>{var n=ms(t.body,e,!1),r=["enclosing"];t.attributes.class&&r.push(...t.attributes.class.trim().split(/\s+/));var s=we.makeSpan(r,n,e);for(var i in t.attributes)i!=="class"&&t.attributes.hasOwnProperty(i)&&s.setAttribute(i,t.attributes[i]);return s},mathmlBuilder:(t,e)=>iu(t.body,e)});tt({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(t,e)=>{var{parser:n}=t;return{type:"htmlmathml",mode:n.mode,html:Gr(e[0]),mathml:Gr(e[1])}},htmlBuilder:(t,e)=>{var n=ms(t.html,e,!1);return we.makeFragment(n)},mathmlBuilder:(t,e)=>iu(t.mathml,e)});var a5=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var n=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!n)throw new qe("Invalid size: '"+e+"' in \\includegraphics");var r={number:+(n[1]+n[2]),unit:n[3]};if(!eU(r))throw new qe("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r};tt({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(t,e,n)=>{var{parser:r}=t,s={number:0,unit:"em"},i={number:.9,unit:"em"},a={number:0,unit:"em"},l="";if(n[0])for(var c=nn(n[0],"raw").string,d=c.split(","),h=0;h<d.length;h++){var m=d[h].split("=");if(m.length===2){var g=m[1].trim();switch(m[0].trim()){case"alt":l=g;break;case"width":s=a5(g);break;case"height":i=a5(g);break;case"totalheight":a=a5(g);break;default:throw new qe("Invalid key: '"+m[0]+"' in \\includegraphics.")}}}var x=nn(e[0],"url").url;return l===""&&(l=x,l=l.replace(/^.*[\\/]/,""),l=l.substring(0,l.lastIndexOf("."))),r.settings.isTrusted({command:"\\includegraphics",url:x})?{type:"includegraphics",mode:r.mode,alt:l,width:s,height:i,totalheight:a,src:x}:r.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(t,e)=>{var n=Ir(t.height,e),r=0;t.totalheight.number>0&&(r=Ir(t.totalheight,e)-n);var s=0;t.width.number>0&&(s=Ir(t.width,e));var i={height:Xe(n+r)};s>0&&(i.width=Xe(s)),r>0&&(i.verticalAlign=Xe(-r));var a=new l3e(t.src,t.alt,i);return a.height=n,a.depth=r,a},mathmlBuilder:(t,e)=>{var n=new Fe.MathNode("mglyph",[]);n.setAttribute("alt",t.alt);var r=Ir(t.height,e),s=0;if(t.totalheight.number>0&&(s=Ir(t.totalheight,e)-r,n.setAttribute("valign",Xe(-s))),n.setAttribute("height",Xe(r+s)),t.width.number>0){var i=Ir(t.width,e);n.setAttribute("width",Xe(i))}return n.setAttribute("src",t.src),n}});tt({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(t,e){var{parser:n,funcName:r}=t,s=nn(e[0],"size");if(n.settings.strict){var i=r[1]==="m",a=s.value.unit==="mu";i?(a||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, "+("not "+s.value.unit+" units")),n.mode!=="math"&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):a&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:s.value}},htmlBuilder(t,e){return we.makeGlue(t.dimension,e)},mathmlBuilder(t,e){var n=Ir(t.dimension,e);return new Fe.SpaceNode(n)}});tt({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:n,funcName:r}=t,s=e[0];return{type:"lap",mode:n.mode,alignment:r.slice(5),body:s}},htmlBuilder:(t,e)=>{var n;t.alignment==="clap"?(n=we.makeSpan([],[qn(t.body,e)]),n=we.makeSpan(["inner"],[n],e)):n=we.makeSpan(["inner"],[qn(t.body,e)]);var r=we.makeSpan(["fix"],[]),s=we.makeSpan([t.alignment],[n,r],e),i=we.makeSpan(["strut"]);return i.style.height=Xe(s.height+s.depth),s.depth&&(i.style.verticalAlign=Xe(-s.depth)),s.children.unshift(i),s=we.makeSpan(["thinbox"],[s],e),we.makeSpan(["mord","vbox"],[s],e)},mathmlBuilder:(t,e)=>{var n=new Fe.MathNode("mpadded",[hr(t.body,e)]);if(t.alignment!=="rlap"){var r=t.alignment==="llap"?"-1":"-0.5";n.setAttribute("lspace",r+"width")}return n.setAttribute("width","0px"),n}});tt({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){var{funcName:n,parser:r}=t,s=r.mode;r.switchMode("math");var i=n==="\\("?"\\)":"$",a=r.parseExpression(!1,i);return r.expect(i),r.switchMode(s),{type:"styling",mode:r.mode,style:"text",body:a}}});tt({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){throw new qe("Mismatched "+t.funcName)}});var IR=(t,e)=>{switch(e.style.size){case At.DISPLAY.size:return t.display;case At.TEXT.size:return t.text;case At.SCRIPT.size:return t.script;case At.SCRIPTSCRIPT.size:return t.scriptscript;default:return t.text}};tt({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(t,e)=>{var{parser:n}=t;return{type:"mathchoice",mode:n.mode,display:Gr(e[0]),text:Gr(e[1]),script:Gr(e[2]),scriptscript:Gr(e[3])}},htmlBuilder:(t,e)=>{var n=IR(t,e),r=ms(n,e,!1);return we.makeFragment(r)},mathmlBuilder:(t,e)=>{var n=IR(t,e);return iu(n,e)}});var zU=(t,e,n,r,s,i,a)=>{t=we.makeSpan([],[t]);var l=n&&Wn.isCharacterBox(n),c,d;if(e){var h=qn(e,r.havingStyle(s.sup()),r);d={elem:h,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-h.depth)}}if(n){var m=qn(n,r.havingStyle(s.sub()),r);c={elem:m,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-m.height)}}var g;if(d&&c){var x=r.fontMetrics().bigOpSpacing5+c.elem.height+c.elem.depth+c.kern+t.depth+a;g=we.makeVList({positionType:"bottom",positionData:x,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:c.elem,marginLeft:Xe(-i)},{type:"kern",size:c.kern},{type:"elem",elem:t},{type:"kern",size:d.kern},{type:"elem",elem:d.elem,marginLeft:Xe(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}else if(c){var y=t.height-a;g=we.makeVList({positionType:"top",positionData:y,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:c.elem,marginLeft:Xe(-i)},{type:"kern",size:c.kern},{type:"elem",elem:t}]},r)}else if(d){var w=t.depth+a;g=we.makeVList({positionType:"bottom",positionData:w,children:[{type:"elem",elem:t},{type:"kern",size:d.kern},{type:"elem",elem:d.elem,marginLeft:Xe(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}else return t;var S=[g];if(c&&i!==0&&!l){var k=we.makeSpan(["mspace"],[],r);k.style.marginRight=Xe(i),S.unshift(k)}return we.makeSpan(["mop","op-limits"],S,r)},IU=["\\smallint"],Hf=(t,e)=>{var n,r,s=!1,i;t.type==="supsub"?(n=t.sup,r=t.sub,i=nn(t.base,"op"),s=!0):i=nn(t,"op");var a=e.style,l=!1;a.size===At.DISPLAY.size&&i.symbol&&!IU.includes(i.name)&&(l=!0);var c;if(i.symbol){var d=l?"Size2-Regular":"Size1-Regular",h="";if((i.name==="\\oiint"||i.name==="\\oiiint")&&(h=i.name.slice(1),i.name=h==="oiint"?"\\iint":"\\iiint"),c=we.makeSymbol(i.name,d,"math",e,["mop","op-symbol",l?"large-op":"small-op"]),h.length>0){var m=c.italic,g=we.staticSvg(h+"Size"+(l?"2":"1"),e);c=we.makeVList({positionType:"individualShift",children:[{type:"elem",elem:c,shift:0},{type:"elem",elem:g,shift:l?.08:0}]},e),i.name="\\"+h,c.classes.unshift("mop"),c.italic=m}}else if(i.body){var x=ms(i.body,e,!0);x.length===1&&x[0]instanceof Ma?(c=x[0],c.classes[0]="mop"):c=we.makeSpan(["mop"],x,e)}else{for(var y=[],w=1;w<i.name.length;w++)y.push(we.mathsym(i.name[w],i.mode,e));c=we.makeSpan(["mop"],y,e)}var S=0,k=0;return(c instanceof Ma||i.name==="\\oiint"||i.name==="\\oiiint")&&!i.suppressBaseShift&&(S=(c.height-c.depth)/2-e.fontMetrics().axisHeight,k=c.italic),s?zU(c,n,r,e,a,k,S):(S&&(c.style.position="relative",c.style.top=Xe(S)),c)},wg=(t,e)=>{var n;if(t.symbol)n=new Ui("mo",[Ra(t.name,t.mode)]),IU.includes(t.name)&&n.setAttribute("largeop","false");else if(t.body)n=new Ui("mo",Mi(t.body,e));else{n=new Ui("mi",[new Ro(t.name.slice(1))]);var r=new Ui("mo",[Ra("","text")]);t.parentIsSupSub?n=new Ui("mrow",[n,r]):n=dU([n,r])}return n},cke={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};tt({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(t,e)=>{var{parser:n,funcName:r}=t,s=r;return s.length===1&&(s=cke[s]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:s}},htmlBuilder:Hf,mathmlBuilder:wg});tt({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var{parser:n}=t,r=e[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Gr(r)}},htmlBuilder:Hf,mathmlBuilder:wg});var uke={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};tt({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(t){var{parser:e,funcName:n}=t;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:Hf,mathmlBuilder:wg});tt({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(t){var{parser:e,funcName:n}=t;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:Hf,mathmlBuilder:wg});tt({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0},handler(t){var{parser:e,funcName:n}=t,r=n;return r.length===1&&(r=uke[r]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:Hf,mathmlBuilder:wg});var LU=(t,e)=>{var n,r,s=!1,i;t.type==="supsub"?(n=t.sup,r=t.sub,i=nn(t.base,"operatorname"),s=!0):i=nn(t,"operatorname");var a;if(i.body.length>0){for(var l=i.body.map(m=>{var g=m.text;return typeof g=="string"?{type:"textord",mode:m.mode,text:g}:m}),c=ms(l,e.withFont("mathrm"),!0),d=0;d<c.length;d++){var h=c[d];h instanceof Ma&&(h.text=h.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}a=we.makeSpan(["mop"],c,e)}else a=we.makeSpan(["mop"],[],e);return s?zU(a,n,r,e,e.style,0,0):a},dke=(t,e)=>{for(var n=Mi(t.body,e.withFont("mathrm")),r=!0,s=0;s<n.length;s++){var i=n[s];if(!(i instanceof Fe.SpaceNode))if(i instanceof Fe.MathNode)switch(i.type){case"mi":case"mn":case"ms":case"mspace":case"mtext":break;case"mo":{var a=i.children[0];i.children.length===1&&a instanceof Fe.TextNode?a.text=a.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):r=!1;break}default:r=!1}else r=!1}if(r){var l=n.map(h=>h.toText()).join("");n=[new Fe.TextNode(l)]}var c=new Fe.MathNode("mi",n);c.setAttribute("mathvariant","normal");var d=new Fe.MathNode("mo",[Ra("","text")]);return t.parentIsSupSub?new Fe.MathNode("mrow",[c,d]):Fe.newDocumentFragment([c,d])};tt({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(t,e)=>{var{parser:n,funcName:r}=t,s=e[0];return{type:"operatorname",mode:n.mode,body:Gr(s),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:LU,mathmlBuilder:dke});J("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");Od({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?we.makeFragment(ms(t.body,e,!1)):we.makeSpan(["mord"],ms(t.body,e,!0),e)},mathmlBuilder(t,e){return iu(t.body,e,!0)}});tt({type:"overline",names:["\\overline"],props:{numArgs:1},handler(t,e){var{parser:n}=t,r=e[0];return{type:"overline",mode:n.mode,body:r}},htmlBuilder(t,e){var n=qn(t.body,e.havingCrampedStyle()),r=we.makeLineSpan("overline-line",e),s=e.fontMetrics().defaultRuleThickness,i=we.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*s},{type:"elem",elem:r},{type:"kern",size:s}]},e);return we.makeSpan(["mord","overline"],[i],e)},mathmlBuilder(t,e){var n=new Fe.MathNode("mo",[new Fe.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new Fe.MathNode("mover",[hr(t.body,e),n]);return r.setAttribute("accent","true"),r}});tt({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=e[0];return{type:"phantom",mode:n.mode,body:Gr(r)}},htmlBuilder:(t,e)=>{var n=ms(t.body,e.withPhantom(),!1);return we.makeFragment(n)},mathmlBuilder:(t,e)=>{var n=Mi(t.body,e);return new Fe.MathNode("mphantom",n)}});tt({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=e[0];return{type:"hphantom",mode:n.mode,body:r}},htmlBuilder:(t,e)=>{var n=we.makeSpan([],[qn(t.body,e.withPhantom())]);if(n.height=0,n.depth=0,n.children)for(var r=0;r<n.children.length;r++)n.children[r].height=0,n.children[r].depth=0;return n=we.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},e),we.makeSpan(["mord"],[n],e)},mathmlBuilder:(t,e)=>{var n=Mi(Gr(t.body),e),r=new Fe.MathNode("mphantom",n),s=new Fe.MathNode("mpadded",[r]);return s.setAttribute("height","0px"),s.setAttribute("depth","0px"),s}});tt({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=e[0];return{type:"vphantom",mode:n.mode,body:r}},htmlBuilder:(t,e)=>{var n=we.makeSpan(["inner"],[qn(t.body,e.withPhantom())]),r=we.makeSpan(["fix"],[]);return we.makeSpan(["mord","rlap"],[n,r],e)},mathmlBuilder:(t,e)=>{var n=Mi(Gr(t.body),e),r=new Fe.MathNode("mphantom",n),s=new Fe.MathNode("mpadded",[r]);return s.setAttribute("width","0px"),s}});tt({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(t,e){var{parser:n}=t,r=nn(e[0],"size").value,s=e[1];return{type:"raisebox",mode:n.mode,dy:r,body:s}},htmlBuilder(t,e){var n=qn(t.body,e),r=Ir(t.dy,e);return we.makeVList({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]},e)},mathmlBuilder(t,e){var n=new Fe.MathNode("mpadded",[hr(t.body,e)]),r=t.dy.number+t.dy.unit;return n.setAttribute("voffset",r),n}});tt({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(t){var{parser:e}=t;return{type:"internal",mode:e.mode}}});tt({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(t,e,n){var{parser:r}=t,s=n[0],i=nn(e[0],"size"),a=nn(e[1],"size");return{type:"rule",mode:r.mode,shift:s&&nn(s,"size").value,width:i.value,height:a.value}},htmlBuilder(t,e){var n=we.makeSpan(["mord","rule"],[],e),r=Ir(t.width,e),s=Ir(t.height,e),i=t.shift?Ir(t.shift,e):0;return n.style.borderRightWidth=Xe(r),n.style.borderTopWidth=Xe(s),n.style.bottom=Xe(i),n.width=r,n.height=s+i,n.depth=-i,n.maxFontSize=s*1.125*e.sizeMultiplier,n},mathmlBuilder(t,e){var n=Ir(t.width,e),r=Ir(t.height,e),s=t.shift?Ir(t.shift,e):0,i=e.color&&e.getColor()||"black",a=new Fe.MathNode("mspace");a.setAttribute("mathbackground",i),a.setAttribute("width",Xe(n)),a.setAttribute("height",Xe(r));var l=new Fe.MathNode("mpadded",[a]);return s>=0?l.setAttribute("height",Xe(s)):(l.setAttribute("height",Xe(s)),l.setAttribute("depth",Xe(-s))),l.setAttribute("voffset",Xe(s)),l}});function BU(t,e,n){for(var r=ms(t,e,!1),s=e.sizeMultiplier/n.sizeMultiplier,i=0;i<r.length;i++){var a=r[i].classes.indexOf("sizing");a<0?Array.prototype.push.apply(r[i].classes,e.sizingClasses(n)):r[i].classes[a+1]==="reset-size"+e.size&&(r[i].classes[a+1]="reset-size"+n.size),r[i].height*=s,r[i].depth*=s}return we.makeFragment(r)}var LR=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],hke=(t,e)=>{var n=e.havingSize(t.size);return BU(t.body,n,e)};tt({type:"sizing",names:LR,props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{breakOnTokenText:n,funcName:r,parser:s}=t,i=s.parseExpression(!1,n);return{type:"sizing",mode:s.mode,size:LR.indexOf(r)+1,body:i}},htmlBuilder:hke,mathmlBuilder:(t,e)=>{var n=e.havingSize(t.size),r=Mi(t.body,n),s=new Fe.MathNode("mstyle",r);return s.setAttribute("mathsize",Xe(n.sizeMultiplier)),s}});tt({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(t,e,n)=>{var{parser:r}=t,s=!1,i=!1,a=n[0]&&nn(n[0],"ordgroup");if(a)for(var l="",c=0;c<a.body.length;++c){var d=a.body[c];if(l=d.text,l==="t")s=!0;else if(l==="b")i=!0;else{s=!1,i=!1;break}}else s=!0,i=!0;var h=e[0];return{type:"smash",mode:r.mode,body:h,smashHeight:s,smashDepth:i}},htmlBuilder:(t,e)=>{var n=we.makeSpan([],[qn(t.body,e)]);if(!t.smashHeight&&!t.smashDepth)return n;if(t.smashHeight&&(n.height=0,n.children))for(var r=0;r<n.children.length;r++)n.children[r].height=0;if(t.smashDepth&&(n.depth=0,n.children))for(var s=0;s<n.children.length;s++)n.children[s].depth=0;var i=we.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},e);return we.makeSpan(["mord"],[i],e)},mathmlBuilder:(t,e)=>{var n=new Fe.MathNode("mpadded",[hr(t.body,e)]);return t.smashHeight&&n.setAttribute("height","0px"),t.smashDepth&&n.setAttribute("depth","0px"),n}});tt({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,n){var{parser:r}=t,s=n[0],i=e[0];return{type:"sqrt",mode:r.mode,body:i,index:s}},htmlBuilder(t,e){var n=qn(t.body,e.havingCrampedStyle());n.height===0&&(n.height=e.fontMetrics().xHeight),n=we.wrapFragment(n,e);var r=e.fontMetrics(),s=r.defaultRuleThickness,i=s;e.style.id<At.TEXT.id&&(i=e.fontMetrics().xHeight);var a=s+i/4,l=n.height+n.depth+a+s,{span:c,ruleWidth:d,advanceWidth:h}=ql.sqrtImage(l,e),m=c.height-d;m>n.height+n.depth+a&&(a=(a+m-n.height-n.depth)/2);var g=c.height-n.height-a-d;n.style.paddingLeft=Xe(h);var x=we.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+g)},{type:"elem",elem:c},{type:"kern",size:d}]},e);if(t.index){var y=e.havingStyle(At.SCRIPTSCRIPT),w=qn(t.index,y,e),S=.6*(x.height-x.depth),k=we.makeVList({positionType:"shift",positionData:-S,children:[{type:"elem",elem:w}]},e),j=we.makeSpan(["root"],[k]);return we.makeSpan(["mord","sqrt"],[j,x],e)}else return we.makeSpan(["mord","sqrt"],[x],e)},mathmlBuilder(t,e){var{body:n,index:r}=t;return r?new Fe.MathNode("mroot",[hr(n,e),hr(r,e)]):new Fe.MathNode("msqrt",[hr(n,e)])}});var BR={display:At.DISPLAY,text:At.TEXT,script:At.SCRIPT,scriptscript:At.SCRIPTSCRIPT};tt({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t,e){var{breakOnTokenText:n,funcName:r,parser:s}=t,i=s.parseExpression(!0,n),a=r.slice(1,r.length-5);return{type:"styling",mode:s.mode,style:a,body:i}},htmlBuilder(t,e){var n=BR[t.style],r=e.havingStyle(n).withFont("");return BU(t.body,r,e)},mathmlBuilder(t,e){var n=BR[t.style],r=e.havingStyle(n),s=Mi(t.body,r),i=new Fe.MathNode("mstyle",s),a={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},l=a[t.style];return i.setAttribute("scriptlevel",l[0]),i.setAttribute("displaystyle",l[1]),i}});var fke=function(e,n){var r=e.base;if(r)if(r.type==="op"){var s=r.limits&&(n.style.size===At.DISPLAY.size||r.alwaysHandleSupSub);return s?Hf:null}else if(r.type==="operatorname"){var i=r.alwaysHandleSupSub&&(n.style.size===At.DISPLAY.size||r.limits);return i?LU:null}else{if(r.type==="accent")return Wn.isCharacterBox(r.base)?LN:null;if(r.type==="horizBrace"){var a=!e.sub;return a===r.isOver?PU:null}else return null}else return null};Od({type:"supsub",htmlBuilder(t,e){var n=fke(t,e);if(n)return n(t,e);var{base:r,sup:s,sub:i}=t,a=qn(r,e),l,c,d=e.fontMetrics(),h=0,m=0,g=r&&Wn.isCharacterBox(r);if(s){var x=e.havingStyle(e.style.sup());l=qn(s,x,e),g||(h=a.height-x.fontMetrics().supDrop*x.sizeMultiplier/e.sizeMultiplier)}if(i){var y=e.havingStyle(e.style.sub());c=qn(i,y,e),g||(m=a.depth+y.fontMetrics().subDrop*y.sizeMultiplier/e.sizeMultiplier)}var w;e.style===At.DISPLAY?w=d.sup1:e.style.cramped?w=d.sup3:w=d.sup2;var S=e.sizeMultiplier,k=Xe(.5/d.ptPerEm/S),j=null;if(c){var N=t.base&&t.base.type==="op"&&t.base.name&&(t.base.name==="\\oiint"||t.base.name==="\\oiiint");(a instanceof Ma||N)&&(j=Xe(-a.italic))}var T;if(l&&c){h=Math.max(h,w,l.depth+.25*d.xHeight),m=Math.max(m,d.sub2);var E=d.defaultRuleThickness,_=4*E;if(h-l.depth-(c.height-m)<_){m=_-(h-l.depth)+c.height;var A=.8*d.xHeight-(h-l.depth);A>0&&(h+=A,m-=A)}var D=[{type:"elem",elem:c,shift:m,marginRight:k,marginLeft:j},{type:"elem",elem:l,shift:-h,marginRight:k}];T=we.makeVList({positionType:"individualShift",children:D},e)}else if(c){m=Math.max(m,d.sub1,c.height-.8*d.xHeight);var q=[{type:"elem",elem:c,marginLeft:j,marginRight:k}];T=we.makeVList({positionType:"shift",positionData:m,children:q},e)}else if(l)h=Math.max(h,w,l.depth+.25*d.xHeight),T=we.makeVList({positionType:"shift",positionData:-h,children:[{type:"elem",elem:l,marginRight:k}]},e);else throw new Error("supsub must have either sup or sub.");var B=VO(a,"right")||"mord";return we.makeSpan([B],[a,we.makeSpan(["msupsub"],[T])],e)},mathmlBuilder(t,e){var n=!1,r,s;t.base&&t.base.type==="horizBrace"&&(s=!!t.sup,s===t.base.isOver&&(n=!0,r=t.base.isOver)),t.base&&(t.base.type==="op"||t.base.type==="operatorname")&&(t.base.parentIsSupSub=!0);var i=[hr(t.base,e)];t.sub&&i.push(hr(t.sub,e)),t.sup&&i.push(hr(t.sup,e));var a;if(n)a=r?"mover":"munder";else if(t.sub)if(t.sup){var d=t.base;d&&d.type==="op"&&d.limits&&e.style===At.DISPLAY||d&&d.type==="operatorname"&&d.alwaysHandleSupSub&&(e.style===At.DISPLAY||d.limits)?a="munderover":a="msubsup"}else{var c=t.base;c&&c.type==="op"&&c.limits&&(e.style===At.DISPLAY||c.alwaysHandleSupSub)||c&&c.type==="operatorname"&&c.alwaysHandleSupSub&&(c.limits||e.style===At.DISPLAY)?a="munder":a="msub"}else{var l=t.base;l&&l.type==="op"&&l.limits&&(e.style===At.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||e.style===At.DISPLAY)?a="mover":a="msup"}return new Fe.MathNode(a,i)}});Od({type:"atom",htmlBuilder(t,e){return we.mathsym(t.text,t.mode,e,["m"+t.family])},mathmlBuilder(t,e){var n=new Fe.MathNode("mo",[Ra(t.text,t.mode)]);if(t.family==="bin"){var r=zN(t,e);r==="bold-italic"&&n.setAttribute("mathvariant",r)}else t.family==="punct"?n.setAttribute("separator","true"):(t.family==="open"||t.family==="close")&&n.setAttribute("stretchy","false");return n}});var FU={mi:"italic",mn:"normal",mtext:"normal"};Od({type:"mathord",htmlBuilder(t,e){return we.makeOrd(t,e,"mathord")},mathmlBuilder(t,e){var n=new Fe.MathNode("mi",[Ra(t.text,t.mode,e)]),r=zN(t,e)||"italic";return r!==FU[n.type]&&n.setAttribute("mathvariant",r),n}});Od({type:"textord",htmlBuilder(t,e){return we.makeOrd(t,e,"textord")},mathmlBuilder(t,e){var n=Ra(t.text,t.mode,e),r=zN(t,e)||"normal",s;return t.mode==="text"?s=new Fe.MathNode("mtext",[n]):/[0-9]/.test(t.text)?s=new Fe.MathNode("mn",[n]):t.text==="\\prime"?s=new Fe.MathNode("mo",[n]):s=new Fe.MathNode("mi",[n]),r!==FU[s.type]&&s.setAttribute("mathvariant",r),s}});var o5={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},l5={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Od({type:"spacing",htmlBuilder(t,e){if(l5.hasOwnProperty(t.text)){var n=l5[t.text].className||"";if(t.mode==="text"){var r=we.makeOrd(t,e,"textord");return r.classes.push(n),r}else return we.makeSpan(["mspace",n],[we.mathsym(t.text,t.mode,e)],e)}else{if(o5.hasOwnProperty(t.text))return we.makeSpan(["mspace",o5[t.text]],[],e);throw new qe('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var n;if(l5.hasOwnProperty(t.text))n=new Fe.MathNode("mtext",[new Fe.TextNode(" ")]);else{if(o5.hasOwnProperty(t.text))return new Fe.MathNode("mspace");throw new qe('Unknown type of space "'+t.text+'"')}return n}});var FR=()=>{var t=new Fe.MathNode("mtd",[]);return t.setAttribute("width","50%"),t};Od({type:"tag",mathmlBuilder(t,e){var n=new Fe.MathNode("mtable",[new Fe.MathNode("mtr",[FR(),new Fe.MathNode("mtd",[iu(t.body,e)]),FR(),new Fe.MathNode("mtd",[iu(t.tag,e)])])]);return n.setAttribute("width","100%"),n}});var qR={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},$R={"\\textbf":"textbf","\\textmd":"textmd"},mke={"\\textit":"textit","\\textup":"textup"},HR=(t,e)=>{var n=t.font;if(n){if(qR[n])return e.withTextFontFamily(qR[n]);if($R[n])return e.withTextFontWeight($R[n]);if(n==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(mke[n])};tt({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(t,e){var{parser:n,funcName:r}=t,s=e[0];return{type:"text",mode:n.mode,body:Gr(s),font:r}},htmlBuilder(t,e){var n=HR(t,e),r=ms(t.body,n,!0);return we.makeSpan(["mord","text"],r,n)},mathmlBuilder(t,e){var n=HR(t,e);return iu(t.body,n)}});tt({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:n}=t;return{type:"underline",mode:n.mode,body:e[0]}},htmlBuilder(t,e){var n=qn(t.body,e),r=we.makeLineSpan("underline-line",e),s=e.fontMetrics().defaultRuleThickness,i=we.makeVList({positionType:"top",positionData:n.height,children:[{type:"kern",size:s},{type:"elem",elem:r},{type:"kern",size:3*s},{type:"elem",elem:n}]},e);return we.makeSpan(["mord","underline"],[i],e)},mathmlBuilder(t,e){var n=new Fe.MathNode("mo",[new Fe.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new Fe.MathNode("munder",[hr(t.body,e),n]);return r.setAttribute("accentunder","true"),r}});tt({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(t,e){var{parser:n}=t;return{type:"vcenter",mode:n.mode,body:e[0]}},htmlBuilder(t,e){var n=qn(t.body,e),r=e.fontMetrics().axisHeight,s=.5*(n.height-r-(n.depth+r));return we.makeVList({positionType:"shift",positionData:s,children:[{type:"elem",elem:n}]},e)},mathmlBuilder(t,e){return new Fe.MathNode("mpadded",[hr(t.body,e)],["vcenter"])}});tt({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(t,e,n){throw new qe("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(t,e){for(var n=QR(t),r=[],s=e.havingStyle(e.style.text()),i=0;i<n.length;i++){var a=n[i];a==="~"&&(a="\\textasciitilde"),r.push(we.makeSymbol(a,"Typewriter-Regular",t.mode,s,["mord","texttt"]))}return we.makeSpan(["mord","text"].concat(s.sizingClasses(e)),we.tryCombineChars(r),s)},mathmlBuilder(t,e){var n=new Fe.TextNode(QR(t)),r=new Fe.MathNode("mtext",[n]);return r.setAttribute("mathvariant","monospace"),r}});var QR=t=>t.body.replace(/ /g,t.star?"␣":" "),Qc=cU,qU=`[ \r
|
||
]`,pke="\\\\[a-zA-Z@]+",gke="\\\\[^\uD800-\uDFFF]",xke="("+pke+")"+qU+"*",vke=`\\\\(
|
||
|[ \r ]+
|
||
?)[ \r ]*`,XO="[̀-ͯ]",yke=new RegExp(XO+"+$"),bke="("+qU+"+)|"+(vke+"|")+"([!-\\[\\]-‧-豈-]"+(XO+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(XO+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+xke)+("|"+gke+")");class VR{constructor(e,n){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=n,this.tokenRegex=new RegExp(bke,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,n){this.catcodes[e]=n}lex(){var e=this.input,n=this.tokenRegex.lastIndex;if(n===e.length)return new Zi("EOF",new xi(this,n,n));var r=this.tokenRegex.exec(e);if(r===null||r.index!==n)throw new qe("Unexpected character: '"+e[n]+"'",new Zi(e[n],new xi(this,n,n+1)));var s=r[6]||r[3]||(r[2]?"\\ ":" ");if(this.catcodes[s]===14){var i=e.indexOf(`
|
||
`,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=e.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=i+1,this.lex()}return new Zi(s,new xi(this,n,this.tokenRegex.lastIndex))}}class wke{constructor(e,n){e===void 0&&(e={}),n===void 0&&(n={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=n,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new qe("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var n in e)e.hasOwnProperty(n)&&(e[n]==null?delete this.current[n]:this.current[n]=e[n])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,n,r){if(r===void 0&&(r=!1),r){for(var s=0;s<this.undefStack.length;s++)delete this.undefStack[s][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=n)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(e)&&(i[e]=this.current[e])}n==null?delete this.current[e]:this.current[e]=n}}var Ske=_U;J("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});J("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}});J("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}});J("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}});J("\\@ifnextchar",function(t){var e=t.consumeArgs(3);t.consumeSpaces();var n=t.future();return e[0].length===1&&e[0][0].text===n.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}});J("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");J("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var UR={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};J("\\char",function(t){var e=t.popToken(),n,r="";if(e.text==="'")n=8,e=t.popToken();else if(e.text==='"')n=16,e=t.popToken();else if(e.text==="`")if(e=t.popToken(),e.text[0]==="\\")r=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new qe("\\char` missing argument");r=e.text.charCodeAt(0)}else n=10;if(n){if(r=UR[e.text],r==null||r>=n)throw new qe("Invalid base-"+n+" digit "+e.text);for(var s;(s=UR[t.future().text])!=null&&s<n;)r*=n,r+=s,t.popToken()}return"\\@char{"+r+"}"});var UN=(t,e,n,r)=>{var s=t.consumeArg().tokens;if(s.length!==1)throw new qe("\\newcommand's first argument must be a macro name");var i=s[0].text,a=t.isDefined(i);if(a&&!e)throw new qe("\\newcommand{"+i+"} attempting to redefine "+(i+"; use \\renewcommand"));if(!a&&!n)throw new qe("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var l=0;if(s=t.consumeArg().tokens,s.length===1&&s[0].text==="["){for(var c="",d=t.expandNextToken();d.text!=="]"&&d.text!=="EOF";)c+=d.text,d=t.expandNextToken();if(!c.match(/^\s*[0-9]+\s*$/))throw new qe("Invalid number of arguments: "+c);l=parseInt(c),s=t.consumeArg().tokens}return a&&r||t.macros.set(i,{tokens:s,numArgs:l}),""};J("\\newcommand",t=>UN(t,!1,!0,!1));J("\\renewcommand",t=>UN(t,!0,!1,!1));J("\\providecommand",t=>UN(t,!0,!0,!0));J("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(n=>n.text).join("")),""});J("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(n=>n.text).join("")),""});J("\\show",t=>{var e=t.popToken(),n=e.text;return console.log(e,t.macros.get(n),Qc[n],pr.math[n],pr.text[n]),""});J("\\bgroup","{");J("\\egroup","}");J("~","\\nobreakspace");J("\\lq","`");J("\\rq","'");J("\\aa","\\r a");J("\\AA","\\r A");J("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");J("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");J("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");J("ℬ","\\mathscr{B}");J("ℰ","\\mathscr{E}");J("ℱ","\\mathscr{F}");J("ℋ","\\mathscr{H}");J("ℐ","\\mathscr{I}");J("ℒ","\\mathscr{L}");J("ℳ","\\mathscr{M}");J("ℛ","\\mathscr{R}");J("ℭ","\\mathfrak{C}");J("ℌ","\\mathfrak{H}");J("ℨ","\\mathfrak{Z}");J("\\Bbbk","\\Bbb{k}");J("·","\\cdotp");J("\\llap","\\mathllap{\\textrm{#1}}");J("\\rlap","\\mathrlap{\\textrm{#1}}");J("\\clap","\\mathclap{\\textrm{#1}}");J("\\mathstrut","\\vphantom{(}");J("\\underbar","\\underline{\\text{#1}}");J("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}');J("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");J("\\ne","\\neq");J("≠","\\neq");J("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");J("∉","\\notin");J("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");J("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");J("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");J("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");J("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");J("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");J("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");J("⟂","\\perp");J("‼","\\mathclose{!\\mkern-0.8mu!}");J("∌","\\notni");J("⌜","\\ulcorner");J("⌝","\\urcorner");J("⌞","\\llcorner");J("⌟","\\lrcorner");J("©","\\copyright");J("®","\\textregistered");J("️","\\textregistered");J("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');J("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');J("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');J("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');J("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");J("⋮","\\vdots");J("\\varGamma","\\mathit{\\Gamma}");J("\\varDelta","\\mathit{\\Delta}");J("\\varTheta","\\mathit{\\Theta}");J("\\varLambda","\\mathit{\\Lambda}");J("\\varXi","\\mathit{\\Xi}");J("\\varPi","\\mathit{\\Pi}");J("\\varSigma","\\mathit{\\Sigma}");J("\\varUpsilon","\\mathit{\\Upsilon}");J("\\varPhi","\\mathit{\\Phi}");J("\\varPsi","\\mathit{\\Psi}");J("\\varOmega","\\mathit{\\Omega}");J("\\substack","\\begin{subarray}{c}#1\\end{subarray}");J("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");J("\\boxed","\\fbox{$\\displaystyle{#1}$}");J("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");J("\\implies","\\DOTSB\\;\\Longrightarrow\\;");J("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");J("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");J("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var WR={",":"\\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"};J("\\dots",function(t){var e="\\dotso",n=t.expandAfterFuture().text;return n in WR?e=WR[n]:(n.slice(0,4)==="\\not"||n in pr.math&&["bin","rel"].includes(pr.math[n].group))&&(e="\\dotsb"),e});var WN={")":!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};J("\\dotso",function(t){var e=t.future().text;return e in WN?"\\ldots\\,":"\\ldots"});J("\\dotsc",function(t){var e=t.future().text;return e in WN&&e!==","?"\\ldots\\,":"\\ldots"});J("\\cdots",function(t){var e=t.future().text;return e in WN?"\\@cdots\\,":"\\@cdots"});J("\\dotsb","\\cdots");J("\\dotsm","\\cdots");J("\\dotsi","\\!\\cdots");J("\\dotsx","\\ldots\\,");J("\\DOTSI","\\relax");J("\\DOTSB","\\relax");J("\\DOTSX","\\relax");J("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");J("\\,","\\tmspace+{3mu}{.1667em}");J("\\thinspace","\\,");J("\\>","\\mskip{4mu}");J("\\:","\\tmspace+{4mu}{.2222em}");J("\\medspace","\\:");J("\\;","\\tmspace+{5mu}{.2777em}");J("\\thickspace","\\;");J("\\!","\\tmspace-{3mu}{.1667em}");J("\\negthinspace","\\!");J("\\negmedspace","\\tmspace-{4mu}{.2222em}");J("\\negthickspace","\\tmspace-{5mu}{.277em}");J("\\enspace","\\kern.5em ");J("\\enskip","\\hskip.5em\\relax");J("\\quad","\\hskip1em\\relax");J("\\qquad","\\hskip2em\\relax");J("\\tag","\\@ifstar\\tag@literal\\tag@paren");J("\\tag@paren","\\tag@literal{({#1})}");J("\\tag@literal",t=>{if(t.macros.get("\\df@tag"))throw new qe("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});J("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");J("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");J("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");J("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");J("\\newline","\\\\\\relax");J("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var $U=Xe(Mo["Main-Regular"][84][1]-.7*Mo["Main-Regular"][65][1]);J("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+$U+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");J("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+$U+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");J("\\hspace","\\@ifstar\\@hspacer\\@hspace");J("\\@hspace","\\hskip #1\\relax");J("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");J("\\ordinarycolon",":");J("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");J("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');J("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');J("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');J("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');J("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');J("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');J("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');J("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');J("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');J("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');J("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');J("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');J("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');J("∷","\\dblcolon");J("∹","\\eqcolon");J("≔","\\coloneqq");J("≕","\\eqqcolon");J("⩴","\\Coloneqq");J("\\ratio","\\vcentcolon");J("\\coloncolon","\\dblcolon");J("\\colonequals","\\coloneqq");J("\\coloncolonequals","\\Coloneqq");J("\\equalscolon","\\eqqcolon");J("\\equalscoloncolon","\\Eqqcolon");J("\\colonminus","\\coloneq");J("\\coloncolonminus","\\Coloneq");J("\\minuscolon","\\eqcolon");J("\\minuscoloncolon","\\Eqcolon");J("\\coloncolonapprox","\\Colonapprox");J("\\coloncolonsim","\\Colonsim");J("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");J("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");J("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");J("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");J("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");J("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");J("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");J("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");J("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");J("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");J("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");J("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");J("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");J("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");J("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");J("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");J("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");J("\\nleqq","\\html@mathml{\\@nleqq}{≰}");J("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");J("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");J("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");J("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");J("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");J("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");J("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");J("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");J("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");J("\\imath","\\html@mathml{\\@imath}{ı}");J("\\jmath","\\html@mathml{\\@jmath}{ȷ}");J("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");J("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");J("⟦","\\llbracket");J("⟧","\\rrbracket");J("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");J("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");J("⦃","\\lBrace");J("⦄","\\rBrace");J("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");J("⦵","\\minuso");J("\\darr","\\downarrow");J("\\dArr","\\Downarrow");J("\\Darr","\\Downarrow");J("\\lang","\\langle");J("\\rang","\\rangle");J("\\uarr","\\uparrow");J("\\uArr","\\Uparrow");J("\\Uarr","\\Uparrow");J("\\N","\\mathbb{N}");J("\\R","\\mathbb{R}");J("\\Z","\\mathbb{Z}");J("\\alef","\\aleph");J("\\alefsym","\\aleph");J("\\Alpha","\\mathrm{A}");J("\\Beta","\\mathrm{B}");J("\\bull","\\bullet");J("\\Chi","\\mathrm{X}");J("\\clubs","\\clubsuit");J("\\cnums","\\mathbb{C}");J("\\Complex","\\mathbb{C}");J("\\Dagger","\\ddagger");J("\\diamonds","\\diamondsuit");J("\\empty","\\emptyset");J("\\Epsilon","\\mathrm{E}");J("\\Eta","\\mathrm{H}");J("\\exist","\\exists");J("\\harr","\\leftrightarrow");J("\\hArr","\\Leftrightarrow");J("\\Harr","\\Leftrightarrow");J("\\hearts","\\heartsuit");J("\\image","\\Im");J("\\infin","\\infty");J("\\Iota","\\mathrm{I}");J("\\isin","\\in");J("\\Kappa","\\mathrm{K}");J("\\larr","\\leftarrow");J("\\lArr","\\Leftarrow");J("\\Larr","\\Leftarrow");J("\\lrarr","\\leftrightarrow");J("\\lrArr","\\Leftrightarrow");J("\\Lrarr","\\Leftrightarrow");J("\\Mu","\\mathrm{M}");J("\\natnums","\\mathbb{N}");J("\\Nu","\\mathrm{N}");J("\\Omicron","\\mathrm{O}");J("\\plusmn","\\pm");J("\\rarr","\\rightarrow");J("\\rArr","\\Rightarrow");J("\\Rarr","\\Rightarrow");J("\\real","\\Re");J("\\reals","\\mathbb{R}");J("\\Reals","\\mathbb{R}");J("\\Rho","\\mathrm{P}");J("\\sdot","\\cdot");J("\\sect","\\S");J("\\spades","\\spadesuit");J("\\sub","\\subset");J("\\sube","\\subseteq");J("\\supe","\\supseteq");J("\\Tau","\\mathrm{T}");J("\\thetasym","\\vartheta");J("\\weierp","\\wp");J("\\Zeta","\\mathrm{Z}");J("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");J("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");J("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");J("\\bra","\\mathinner{\\langle{#1}|}");J("\\ket","\\mathinner{|{#1}\\rangle}");J("\\braket","\\mathinner{\\langle{#1}\\rangle}");J("\\Bra","\\left\\langle#1\\right|");J("\\Ket","\\left|#1\\right\\rangle");var HU=t=>e=>{var n=e.consumeArg().tokens,r=e.consumeArg().tokens,s=e.consumeArg().tokens,i=e.consumeArg().tokens,a=e.macros.get("|"),l=e.macros.get("\\|");e.macros.beginGroup();var c=m=>g=>{t&&(g.macros.set("|",a),s.length&&g.macros.set("\\|",l));var x=m;if(!m&&s.length){var y=g.future();y.text==="|"&&(g.popToken(),x=!0)}return{tokens:x?s:r,numArgs:0}};e.macros.set("|",c(!1)),s.length&&e.macros.set("\\|",c(!0));var d=e.consumeArg().tokens,h=e.expandTokens([...i,...d,...n]);return e.macros.endGroup(),{tokens:h.reverse(),numArgs:0}};J("\\bra@ket",HU(!1));J("\\bra@set",HU(!0));J("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");J("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");J("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");J("\\angln","{\\angl n}");J("\\blue","\\textcolor{##6495ed}{#1}");J("\\orange","\\textcolor{##ffa500}{#1}");J("\\pink","\\textcolor{##ff00af}{#1}");J("\\red","\\textcolor{##df0030}{#1}");J("\\green","\\textcolor{##28ae7b}{#1}");J("\\gray","\\textcolor{gray}{#1}");J("\\purple","\\textcolor{##9d38bd}{#1}");J("\\blueA","\\textcolor{##ccfaff}{#1}");J("\\blueB","\\textcolor{##80f6ff}{#1}");J("\\blueC","\\textcolor{##63d9ea}{#1}");J("\\blueD","\\textcolor{##11accd}{#1}");J("\\blueE","\\textcolor{##0c7f99}{#1}");J("\\tealA","\\textcolor{##94fff5}{#1}");J("\\tealB","\\textcolor{##26edd5}{#1}");J("\\tealC","\\textcolor{##01d1c1}{#1}");J("\\tealD","\\textcolor{##01a995}{#1}");J("\\tealE","\\textcolor{##208170}{#1}");J("\\greenA","\\textcolor{##b6ffb0}{#1}");J("\\greenB","\\textcolor{##8af281}{#1}");J("\\greenC","\\textcolor{##74cf70}{#1}");J("\\greenD","\\textcolor{##1fab54}{#1}");J("\\greenE","\\textcolor{##0d923f}{#1}");J("\\goldA","\\textcolor{##ffd0a9}{#1}");J("\\goldB","\\textcolor{##ffbb71}{#1}");J("\\goldC","\\textcolor{##ff9c39}{#1}");J("\\goldD","\\textcolor{##e07d10}{#1}");J("\\goldE","\\textcolor{##a75a05}{#1}");J("\\redA","\\textcolor{##fca9a9}{#1}");J("\\redB","\\textcolor{##ff8482}{#1}");J("\\redC","\\textcolor{##f9685d}{#1}");J("\\redD","\\textcolor{##e84d39}{#1}");J("\\redE","\\textcolor{##bc2612}{#1}");J("\\maroonA","\\textcolor{##ffbde0}{#1}");J("\\maroonB","\\textcolor{##ff92c6}{#1}");J("\\maroonC","\\textcolor{##ed5fa6}{#1}");J("\\maroonD","\\textcolor{##ca337c}{#1}");J("\\maroonE","\\textcolor{##9e034e}{#1}");J("\\purpleA","\\textcolor{##ddd7ff}{#1}");J("\\purpleB","\\textcolor{##c6b9fc}{#1}");J("\\purpleC","\\textcolor{##aa87ff}{#1}");J("\\purpleD","\\textcolor{##7854ab}{#1}");J("\\purpleE","\\textcolor{##543b78}{#1}");J("\\mintA","\\textcolor{##f5f9e8}{#1}");J("\\mintB","\\textcolor{##edf2df}{#1}");J("\\mintC","\\textcolor{##e0e5cc}{#1}");J("\\grayA","\\textcolor{##f6f7f7}{#1}");J("\\grayB","\\textcolor{##f0f1f2}{#1}");J("\\grayC","\\textcolor{##e3e5e6}{#1}");J("\\grayD","\\textcolor{##d6d8da}{#1}");J("\\grayE","\\textcolor{##babec2}{#1}");J("\\grayF","\\textcolor{##888d93}{#1}");J("\\grayG","\\textcolor{##626569}{#1}");J("\\grayH","\\textcolor{##3b3e40}{#1}");J("\\grayI","\\textcolor{##21242c}{#1}");J("\\kaBlue","\\textcolor{##314453}{#1}");J("\\kaGreen","\\textcolor{##71B307}{#1}");var QU={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class kke{constructor(e,n,r){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(e),this.macros=new wke(Ske,n.macros),this.mode=r,this.stack=[]}feed(e){this.lexer=new VR(e,this.settings)}switchMode(e){this.mode=e}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(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var n,r,s;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;n=this.popToken(),{tokens:s,end:r}=this.consumeArg(["]"])}else({tokens:s,start:n,end:r}=this.consumeArg());return this.pushToken(new Zi("EOF",r.loc)),this.pushTokens(s),new Zi("",xi.range(n,r))}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var n=[],r=e&&e.length>0;r||this.consumeSpaces();var s=this.future(),i,a=0,l=0;do{if(i=this.popToken(),n.push(i),i.text==="{")++a;else if(i.text==="}"){if(--a,a===-1)throw new qe("Extra }",i)}else if(i.text==="EOF")throw new qe("Unexpected end of input in a macro argument, expected '"+(e&&r?e[l]:"}")+"'",i);if(e&&r)if((a===0||a===1&&e[l]==="{")&&i.text===e[l]){if(++l,l===e.length){n.splice(-l,l);break}}else l=0}while(a!==0||r);return s.text==="{"&&n[n.length-1].text==="}"&&(n.pop(),n.shift()),n.reverse(),{tokens:n,start:s,end:i}}consumeArgs(e,n){if(n){if(n.length!==e+1)throw new qe("The length of delimiters doesn't match the number of args!");for(var r=n[0],s=0;s<r.length;s++){var i=this.popToken();if(r[s]!==i.text)throw new qe("Use of the macro doesn't match its definition",i)}}for(var a=[],l=0;l<e;l++)a.push(this.consumeArg(n&&n[l+1]).tokens);return a}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new qe("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var n=this.popToken(),r=n.text,s=n.noexpand?null:this._getExpansion(r);if(s==null||e&&s.unexpandable){if(e&&s==null&&r[0]==="\\"&&!this.isDefined(r))throw new qe("Undefined control sequence: "+r);return this.pushToken(n),!1}this.countExpansion(1);var i=s.tokens,a=this.consumeArgs(s.numArgs,s.delimiters);if(s.numArgs){i=i.slice();for(var l=i.length-1;l>=0;--l){var c=i[l];if(c.text==="#"){if(l===0)throw new qe("Incomplete placeholder at end of macro body",c);if(c=i[--l],c.text==="#")i.splice(l+1,1);else if(/^[1-9]$/.test(c.text))i.splice(l,2,...a[+c.text-1]);else throw new qe("Not a valid argument number",c)}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}throw new Error}expandMacro(e){return this.macros.has(e)?this.expandTokens([new Zi(e)]):void 0}expandTokens(e){var n=[],r=this.stack.length;for(this.pushTokens(e);this.stack.length>r;)if(this.expandOnce(!0)===!1){var s=this.stack.pop();s.treatAsRelax&&(s.noexpand=!1,s.treatAsRelax=!1),n.push(s)}return this.countExpansion(n.length),n}expandMacroAsText(e){var n=this.expandMacro(e);return n&&n.map(r=>r.text).join("")}_getExpansion(e){var n=this.macros.get(e);if(n==null)return n;if(e.length===1){var r=this.lexer.catcodes[e];if(r!=null&&r!==13)return}var s=typeof n=="function"?n(this):n;if(typeof s=="string"){var i=0;if(s.indexOf("#")!==-1)for(var a=s.replace(/##/g,"");a.indexOf("#"+(i+1))!==-1;)++i;for(var l=new VR(s,this.settings),c=[],d=l.lex();d.text!=="EOF";)c.push(d),d=l.lex();c.reverse();var h={tokens:c,numArgs:i};return h}return s}isDefined(e){return this.macros.has(e)||Qc.hasOwnProperty(e)||pr.math.hasOwnProperty(e)||pr.text.hasOwnProperty(e)||QU.hasOwnProperty(e)}isExpandable(e){var n=this.macros.get(e);return n!=null?typeof n=="string"||typeof n=="function"||!n.unexpandable:Qc.hasOwnProperty(e)&&!Qc[e].primitive}}var GR=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,Q1=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","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),c5={"́":{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"}},XR={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class Kb{constructor(e,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 kke(e,n,this.mode),this.settings=n,this.leftrightDepth=0}expect(e,n){if(n===void 0&&(n=!0),this.fetch().text!==e)throw new qe("Expected '"+e+"', 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(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var n=this.nextToken;this.consume(),this.gullet.pushToken(new Zi("}")),this.gullet.pushTokens(e);var r=this.parseExpression(!1);return this.expect("}"),this.nextToken=n,r}parseExpression(e,n){for(var r=[];;){this.mode==="math"&&this.consumeSpaces();var s=this.fetch();if(Kb.endOfExpression.indexOf(s.text)!==-1||n&&s.text===n||e&&Qc[s.text]&&Qc[s.text].infix)break;var i=this.parseAtom(n);if(i){if(i.type==="internal")continue}else break;r.push(i)}return this.mode==="text"&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(e){for(var n=-1,r,s=0;s<e.length;s++)if(e[s].type==="infix"){if(n!==-1)throw new qe("only one infix operator per group",e[s].token);n=s,r=e[s].replaceWith}if(n!==-1&&r){var i,a,l=e.slice(0,n),c=e.slice(n+1);l.length===1&&l[0].type==="ordgroup"?i=l[0]:i={type:"ordgroup",mode:this.mode,body:l},c.length===1&&c[0].type==="ordgroup"?a=c[0]:a={type:"ordgroup",mode:this.mode,body:c};var d;return r==="\\\\abovefrac"?d=this.callFunction(r,[i,e[n],a],[]):d=this.callFunction(r,[i,a],[]),[d]}else return e}handleSupSubscript(e){var n=this.fetch(),r=n.text;this.consume(),this.consumeSpaces();var s;do{var i;s=this.parseGroup(e)}while(((i=s)==null?void 0:i.type)==="internal");if(!s)throw new qe("Expected group after '"+r+"'",n);return s}formatUnsupportedCmd(e){for(var n=[],r=0;r<e.length;r++)n.push({type:"textord",mode:"text",text:e[r]});var s={type:"text",mode:this.mode,body:n},i={type:"color",mode:this.mode,color:this.settings.errorColor,body:[s]};return i}parseAtom(e){var n=this.parseGroup("atom",e);if(n?.type==="internal"||this.mode==="text")return n;for(var r,s;;){this.consumeSpaces();var i=this.fetch();if(i.text==="\\limits"||i.text==="\\nolimits"){if(n&&n.type==="op"){var a=i.text==="\\limits";n.limits=a,n.alwaysHandleSupSub=!0}else if(n&&n.type==="operatorname")n.alwaysHandleSupSub&&(n.limits=i.text==="\\limits");else throw new qe("Limit controls must follow a math operator",i);this.consume()}else if(i.text==="^"){if(r)throw new qe("Double superscript",i);r=this.handleSupSubscript("superscript")}else if(i.text==="_"){if(s)throw new qe("Double subscript",i);s=this.handleSupSubscript("subscript")}else if(i.text==="'"){if(r)throw new qe("Double superscript",i);var l={type:"textord",mode:this.mode,text:"\\prime"},c=[l];for(this.consume();this.fetch().text==="'";)c.push(l),this.consume();this.fetch().text==="^"&&c.push(this.handleSupSubscript("superscript")),r={type:"ordgroup",mode:this.mode,body:c}}else if(Q1[i.text]){var d=GR.test(i.text),h=[];for(h.push(new Zi(Q1[i.text])),this.consume();;){var m=this.fetch().text;if(!Q1[m]||GR.test(m)!==d)break;h.unshift(new Zi(Q1[m])),this.consume()}var g=this.subparse(h);d?s={type:"ordgroup",mode:"math",body:g}:r={type:"ordgroup",mode:"math",body:g}}else break}return r||s?{type:"supsub",mode:this.mode,base:n,sup:r,sub:s}:n}parseFunction(e,n){var r=this.fetch(),s=r.text,i=Qc[s];if(!i)return null;if(this.consume(),n&&n!=="atom"&&!i.allowedInArgument)throw new qe("Got function '"+s+"' with no arguments"+(n?" as "+n:""),r);if(this.mode==="text"&&!i.allowedInText)throw new qe("Can't use function '"+s+"' in text mode",r);if(this.mode==="math"&&i.allowedInMath===!1)throw new qe("Can't use function '"+s+"' in math mode",r);var{args:a,optArgs:l}=this.parseArguments(s,i);return this.callFunction(s,a,l,r,e)}callFunction(e,n,r,s,i){var a={funcName:e,parser:this,token:s,breakOnTokenText:i},l=Qc[e];if(l&&l.handler)return l.handler(a,n,r);throw new qe("No function handler for "+e)}parseArguments(e,n){var r=n.numArgs+n.numOptionalArgs;if(r===0)return{args:[],optArgs:[]};for(var s=[],i=[],a=0;a<r;a++){var l=n.argTypes&&n.argTypes[a],c=a<n.numOptionalArgs;(n.primitive&&l==null||n.type==="sqrt"&&a===1&&i[0]==null)&&(l="primitive");var d=this.parseGroupOfType("argument to '"+e+"'",l,c);if(c)i.push(d);else if(d!=null)s.push(d);else throw new qe("Null argument, please report this as a bug")}return{args:s,optArgs:i}}parseGroupOfType(e,n,r){switch(n){case"color":return this.parseColorGroup(r);case"size":return this.parseSizeGroup(r);case"url":return this.parseUrlGroup(r);case"math":case"text":return this.parseArgumentGroup(r,n);case"hbox":{var s=this.parseArgumentGroup(r,"text");return s!=null?{type:"styling",mode:s.mode,body:[s],style:"text"}:null}case"raw":{var i=this.parseStringGroup("raw",r);return i!=null?{type:"raw",mode:"text",string:i.text}:null}case"primitive":{if(r)throw new qe("A primitive argument cannot be optional");var a=this.parseGroup(e);if(a==null)throw new qe("Expected group as "+e,this.fetch());return a}case"original":case null:case void 0:return this.parseArgumentGroup(r);default:throw new qe("Unknown group type as "+e,this.fetch())}}consumeSpaces(){for(;this.fetch().text===" ";)this.consume()}parseStringGroup(e,n){var r=this.gullet.scanArgument(n);if(r==null)return null;for(var s="",i;(i=this.fetch()).text!=="EOF";)s+=i.text,this.consume();return this.consume(),r.text=s,r}parseRegexGroup(e,n){for(var r=this.fetch(),s=r,i="",a;(a=this.fetch()).text!=="EOF"&&e.test(i+a.text);)s=a,i+=s.text,this.consume();if(i==="")throw new qe("Invalid "+n+": '"+r.text+"'",r);return r.range(s,i)}parseColorGroup(e){var n=this.parseStringGroup("color",e);if(n==null)return null;var r=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(n.text);if(!r)throw new qe("Invalid color: '"+n.text+"'",n);var s=r[0];return/^[0-9a-f]{6}$/i.test(s)&&(s="#"+s),{type:"color-token",mode:this.mode,color:s}}parseSizeGroup(e){var n,r=!1;if(this.gullet.consumeSpaces(),!e&&this.gullet.future().text!=="{"?n=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"):n=this.parseStringGroup("size",e),!n)return null;!e&&n.text.length===0&&(n.text="0pt",r=!0);var s=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(n.text);if(!s)throw new qe("Invalid size: '"+n.text+"'",n);var i={number:+(s[1]+s[2]),unit:s[3]};if(!eU(i))throw new qe("Invalid unit: '"+i.unit+"'",n);return{type:"size",mode:this.mode,value:i,isBlank:r}}parseUrlGroup(e){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var n=this.parseStringGroup("url",e);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),n==null)return null;var r=n.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:r}}parseArgumentGroup(e,n){var r=this.gullet.scanArgument(e);if(r==null)return null;var s=this.mode;n&&this.switchMode(n),this.gullet.beginGroup();var i=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var a={type:"ordgroup",mode:this.mode,loc:r.loc,body:i};return n&&this.switchMode(s),a}parseGroup(e,n){var r=this.fetch(),s=r.text,i;if(s==="{"||s==="\\begingroup"){this.consume();var a=s==="{"?"}":"\\endgroup";this.gullet.beginGroup();var l=this.parseExpression(!1,a),c=this.fetch();this.expect(a),this.gullet.endGroup(),i={type:"ordgroup",mode:this.mode,loc:xi.range(r,c),body:l,semisimple:s==="\\begingroup"||void 0}}else if(i=this.parseFunction(n,e)||this.parseSymbol(),i==null&&s[0]==="\\"&&!QU.hasOwnProperty(s)){if(this.settings.throwOnError)throw new qe("Undefined control sequence: "+s,r);i=this.formatUnsupportedCmd(s),this.consume()}return i}formLigatures(e){for(var n=e.length-1,r=0;r<n;++r){var s=e[r],i=s.text;i==="-"&&e[r+1].text==="-"&&(r+1<n&&e[r+2].text==="-"?(e.splice(r,3,{type:"textord",mode:"text",loc:xi.range(s,e[r+2]),text:"---"}),n-=2):(e.splice(r,2,{type:"textord",mode:"text",loc:xi.range(s,e[r+1]),text:"--"}),n-=1)),(i==="'"||i==="`")&&e[r+1].text===i&&(e.splice(r,2,{type:"textord",mode:"text",loc:xi.range(s,e[r+1]),text:i+i}),n-=1)}}parseSymbol(){var e=this.fetch(),n=e.text;if(/^\\verb[^a-zA-Z]/.test(n)){this.consume();var r=n.slice(5),s=r.charAt(0)==="*";if(s&&(r=r.slice(1)),r.length<2||r.charAt(0)!==r.slice(-1))throw new qe(`\\verb assertion failed --
|
||
please report what input caused this bug`);return r=r.slice(1,-1),{type:"verb",mode:"text",body:r,star:s}}XR.hasOwnProperty(n[0])&&!pr[this.mode][n[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+n[0]+'" used in math mode',e),n=XR[n[0]]+n.slice(1));var i=yke.exec(n);i&&(n=n.substring(0,i.index),n==="i"?n="ı":n==="j"&&(n="ȷ"));var a;if(pr[this.mode][n]){this.settings.strict&&this.mode==="math"&&QO.indexOf(n)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+n[0]+'" used in math mode',e);var l=pr[this.mode][n].group,c=xi.range(e),d;if(d3e.hasOwnProperty(l)){var h=l;d={type:"atom",mode:this.mode,family:h,loc:c,text:n}}else d={type:l,mode:this.mode,loc:c,text:n};a=d}else if(n.charCodeAt(0)>=128)this.settings.strict&&(JV(n.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+n[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+n[0]+'"'+(" ("+n.charCodeAt(0)+")"),e)),a={type:"textord",mode:"text",loc:xi.range(e),text:n};else return null;if(this.consume(),i)for(var m=0;m<i[0].length;m++){var g=i[0][m];if(!c5[g])throw new qe("Unknown accent ' "+g+"'",e);var x=c5[g][this.mode]||c5[g].text;if(!x)throw new qe("Accent "+g+" unsupported in "+this.mode+" mode",e);a={type:"accent",mode:this.mode,loc:xi.range(e),label:x,isStretchy:!1,isShifty:!0,base:a}}return a}}Kb.endOfExpression=["}","\\endgroup","\\end","\\right","&"];var GN=function(e,n){if(!(typeof e=="string"||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var r=new Kb(e,n);delete r.gullet.macros.current["\\df@tag"];var s=r.parse();if(delete r.gullet.macros.current["\\current@color"],delete r.gullet.macros.current["\\color"],r.gullet.macros.get("\\df@tag")){if(!n.displayMode)throw new qe("\\tag works only in display equations");s=[{type:"tag",mode:"text",body:s,tag:r.subparse([new Zi("\\df@tag")])}]}return s},VU=function(e,n,r){n.textContent="";var s=XN(e,r).toNode();n.appendChild(s)};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."),VU=function(){throw new qe("KaTeX doesn't work in quirks mode.")});var Oke=function(e,n){var r=XN(e,n).toMarkup();return r},jke=function(e,n){var r=new _N(n);return GN(e,r)},UU=function(e,n,r){if(r.throwOnError||!(e instanceof qe))throw e;var s=we.makeSpan(["katex-error"],[new Ma(n)]);return s.setAttribute("title",e.toString()),s.setAttribute("style","color:"+r.errorColor),s},XN=function(e,n){var r=new _N(n);try{var s=GN(e,r);return D3e(s,e,r)}catch(i){return UU(i,e,r)}},Nke=function(e,n){var r=new _N(n);try{var s=GN(e,r);return P3e(s,e,r)}catch(i){return UU(i,e,r)}},Cke="0.16.25",Tke={Span:bg,Anchor:RN,SymbolNode:Ma,SvgNode:Ul,PathNode:su,LineNode:HO},YR={version:Cke,render:VU,renderToString:Oke,ParseError:qe,SETTINGS_SCHEMA:Tv,__parse:jke,__renderToDomTree:XN,__renderToHTMLTree:Nke,__setFontMetrics:r3e,__defineSymbol:M,__defineFunction:tt,__defineMacro:J,__domTree:Tke};const Eke={};function _ke(t){const e=this,n=t||Eke,r=e.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(E5e(n)),i.push(w5e()),a.push(S5e(n))}const KR=/[#.]/g;function Ake(t,e){const n=t||"",r={};let s=0,i,a;for(;s<n.length;){KR.lastIndex=s;const l=KR.exec(n),c=n.slice(s,l?l.index:n.length);c&&(i?i==="#"?r.id=c:Array.isArray(r.className)?r.className.push(c):r.className=[c]:a=c,s+=c.length),l&&(i=l[0],s++)}return{type:"element",tagName:a||e||"div",properties:r,children:[]}}function WU(t,e,n){const r=n?Pke(n):void 0;function s(i,a,...l){let c;if(i==null){c={type:"root",children:[]};const d=a;l.unshift(d)}else{c=Ake(i,e);const d=c.tagName.toLowerCase(),h=r?r.get(d):void 0;if(c.tagName=h||d,Mke(a))l.unshift(a);else for(const[m,g]of Object.entries(a))Rke(t,c.properties,m,g)}for(const d of l)YO(c.children,d);return c.type==="element"&&c.tagName==="template"&&(c.content={type:"root",children:c.children},c.children=[]),c}return s}function Mke(t){if(t===null||typeof t!="object"||Array.isArray(t))return!0;if(typeof t.type!="string")return!1;const e=t,n=Object.keys(t);for(const r of n){const s=e[r];if(s&&typeof s=="object"){if(!Array.isArray(s))return!0;const i=s;for(const a of i)if(typeof a!="number"&&typeof a!="string")return!0}}return!!("children"in t&&Array.isArray(t.children))}function Rke(t,e,n,r){const s=ZQ(t,n);let i;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;i=r}else typeof r=="boolean"?i=r:typeof r=="string"?s.spaceSeparated?i=EM(r):s.commaSeparated?i=OM(r):s.commaOrSpaceSeparated?i=EM(OM(r).join(" ")):i=ZR(s,s.property,r):Array.isArray(r)?i=[...r]:i=s.property==="style"?Dke(r):String(r);if(Array.isArray(i)){const a=[];for(const l of i)a.push(ZR(s,s.property,l));i=a}s.property==="className"&&Array.isArray(e.className)&&(i=e.className.concat(i)),e[s.property]=i}}function YO(t,e){if(e!=null)if(typeof e=="number"||typeof e=="string")t.push({type:"text",value:String(e)});else if(Array.isArray(e))for(const n of e)YO(t,n);else if(typeof e=="object"&&"type"in e)e.type==="root"?YO(t,e.children):t.push(e);else throw new Error("Expected node, nodes, or string, got `"+e+"`")}function ZR(t,e,n){if(typeof n=="string"){if(t.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((t.boolean||t.overloadedBoolean)&&(n===""||vp(n)===vp(e)))return!0}return n}function Dke(t){const e=[];for(const[n,r]of Object.entries(t))e.push([n,r].join(": "));return e.join("; ")}function Pke(t){const e=new Map;for(const n of t)e.set(n.toLowerCase(),n);return e}const zke=["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"],Ike=WU(JQ,"div"),Lke=WU(Fb,"g",zke),u5={html:"http://www.w3.org/1999/xhtml",svg:"http://www.w3.org/2000/svg"};function Bke(t,e){return GU(t,{})||{type:"root",children:[]}}function GU(t,e){const n=Fke(t,e);return n&&e.afterTransform&&e.afterTransform(t,n),n}function Fke(t,e){switch(t.nodeType){case 1:return Qke(t,e);case 3:return $ke(t);case 8:return Hke(t);case 9:return JR(t,e);case 10:return qke();case 11:return JR(t,e);default:return}}function JR(t,e){return{type:"root",children:XU(t,e)}}function qke(){return{type:"doctype"}}function $ke(t){return{type:"text",value:t.nodeValue||""}}function Hke(t){return{type:"comment",value:t.nodeValue||""}}function Qke(t,e){const n=t.namespaceURI,r=n===u5.svg?Lke:Ike,s=n===u5.html?t.tagName.toLowerCase():t.tagName,i=n===u5.html&&s==="template"?t.content:t,a=t.getAttributeNames(),l={};let c=-1;for(;++c<a.length;)l[a[c]]=t.getAttribute(a[c])||"";return r(s,l,XU(i,e))}function XU(t,e){const n=t.childNodes,r=[];let s=-1;for(;++s<n.length;){const i=GU(n[s],e);i!==void 0&&r.push(i)}return r}new DOMParser;function Vke(t,e){const n=Uke(t);return Bke(n)}function Uke(t){const e=document.createElement("template");return e.innerHTML=t,e.content}const eD=(function(t,e,n){const r=xg(n);if(!t||!t.type||!t.children)throw new Error("Expected parent node");if(typeof e=="number"){if(e<0||e===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(e=t.children.indexOf(e),e<0)throw new Error("Expected child node or index");for(;++e<t.children.length;)if(r(t.children[e],e,t))return t.children[e]}),jd=(function(t){if(t==null)return Xke;if(typeof t=="string")return Gke(t);if(typeof t=="object")return Wke(t);if(typeof t=="function")return YN(t);throw new Error("Expected function, string, or array as `test`")});function Wke(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=jd(t[n]);return YN(r);function r(...s){let i=-1;for(;++i<e.length;)if(e[i].apply(this,s))return!0;return!1}}function Gke(t){return YN(e);function e(n){return n.tagName===t}}function YN(t){return e;function e(n,r,s){return!!(Yke(n)&&t.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function Xke(t){return!!(t&&typeof t=="object"&&"type"in t&&t.type==="element"&&"tagName"in t&&typeof t.tagName=="string")}function Yke(t){return t!==null&&typeof t=="object"&&"type"in t&&"tagName"in t}const tD=/\n/g,nD=/[\t ]+/g,KO=jd("br"),rD=jd(sOe),Kke=jd("p"),sD=jd("tr"),Zke=jd(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",rOe,iOe]),YU=jd(["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 Jke(t,e){const n=e||{},r="children"in t?t.children:[],s=YU(t),i=JU(t,{whitespace:n.whitespace||"normal"}),a=[];(t.type==="text"||t.type==="comment")&&a.push(...ZU(t,{breakBefore:!0,breakAfter:!0}));let l=-1;for(;++l<r.length;)a.push(...KU(r[l],t,{whitespace:i,breakBefore:l?void 0:s,breakAfter:l<r.length-1?KO(r[l+1]):s}));const c=[];let d;for(l=-1;++l<a.length;){const h=a[l];typeof h=="number"?d!==void 0&&h>d&&(d=h):h&&(d!==void 0&&d>-1&&c.push(`
|
||
`.repeat(d)||" "),d=-1,c.push(h))}return c.join("")}function KU(t,e,n){return t.type==="element"?eOe(t,e,n):t.type==="text"?n.whitespace==="normal"?ZU(t,n):tOe(t):[]}function eOe(t,e,n){const r=JU(t,n),s=t.children||[];let i=-1,a=[];if(Zke(t))return a;let l,c;for(KO(t)||sD(t)&&eD(e,t,sD)?c=`
|
||
`:Kke(t)?(l=2,c=2):YU(t)&&(l=1,c=1);++i<s.length;)a=a.concat(KU(s[i],t,{whitespace:r,breakBefore:i?void 0:l,breakAfter:i<s.length-1?KO(s[i+1]):c}));return rD(t)&&eD(e,t,rD)&&a.push(" "),l&&a.unshift(l),c&&a.push(c),a}function ZU(t,e){const n=String(t.value),r=[],s=[];let i=0;for(;i<=n.length;){tD.lastIndex=i;const c=tD.exec(n),d=c&&"index"in c?c.index:n.length;r.push(nOe(n.slice(i,d).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),i===0?e.breakBefore:!0,d===n.length?e.breakAfter:!0)),i=d+1}let a=-1,l;for(;++a<r.length;)r[a].charCodeAt(r[a].length-1)===8203||a<r.length-1&&r[a+1].charCodeAt(0)===8203?(s.push(r[a]),l=void 0):r[a]?(typeof l=="number"&&s.push(l),s.push(r[a]),l=0):(a===0||a===r.length-1)&&s.push(0);return s}function tOe(t){return[String(t.value)]}function nOe(t,e,n){const r=[];let s=0,i;for(;s<t.length;){nD.lastIndex=s;const a=nD.exec(t);i=a?a.index:t.length,!s&&!i&&a&&!e&&r.push(""),s!==i&&r.push(t.slice(s,i)),s=a?i+a[0].length:i}return s!==i&&!n&&r.push(""),r.join(" ")}function JU(t,e){if(t.type==="element"){const n=t.properties||{};switch(t.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":e.whitespace;case"textarea":return"pre-wrap"}}return e.whitespace}function rOe(t){return!!(t.properties||{}).hidden}function sOe(t){return t.tagName==="td"||t.tagName==="th"}function iOe(t){return t.tagName==="dialog"&&!(t.properties||{}).open}const aOe={},oOe=[];function lOe(t){const e=t||aOe;return function(n,r){ON(n,"element",function(s,i){const a=Array.isArray(s.properties.className)?s.properties.className:oOe,l=a.includes("language-math"),c=a.includes("math-display"),d=a.includes("math-inline");let h=c;if(!l&&!c&&!d)return;let m=i[i.length-1],g=s;if(s.tagName==="code"&&l&&m&&m.type==="element"&&m.tagName==="pre"&&(g=m,m=i[i.length-2],h=!0),!m)return;const x=Jke(g,{whitespace:"pre"});let y;try{y=YR.renderToString(x,{...e,displayMode:h,throwOnError:!0})}catch(S){const k=S,j=k.name.toLowerCase();r.message("Could not render math with KaTeX",{ancestors:[...i,s],cause:k,place:s.position,ruleId:j,source:"rehype-katex"});try{y=YR.renderToString(x,{...e,displayMode:h,strict:"ignore",throwOnError:!1})}catch{y=[{type:"element",tagName:"span",properties:{className:["katex-error"],style:"color:"+(e.errorColor||"#cc0000"),title:String(S)},children:[{type:"text",value:x}]}]}}typeof y=="string"&&(y=Vke(y).children);const w=m.children.indexOf(g);return m.children.splice(w,1,...y),NV})}}function cOe({content:t,className:e=""}){return o.jsx("div",{className:`prose prose-sm dark:prose-invert max-w-none ${e}`,children:o.jsx(l4e,{remarkPlugins:[b5e,_ke],rehypePlugins:[lOe],components:{code({inline:n,className:r,children:s,...i}){return n?o.jsx("code",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",...i,children:s}):o.jsx("code",{className:`${r} block bg-muted p-4 rounded-lg overflow-x-auto`,...i,children:s})},table({children:n,...r}){return o.jsx("div",{className:"overflow-x-auto",children:o.jsx("table",{className:"border-collapse border border-border",...r,children:n})})},th({children:n,...r}){return o.jsx("th",{className:"border border-border bg-muted px-4 py-2 text-left font-semibold",...r,children:n})},td({children:n,...r}){return o.jsx("td",{className:"border border-border px-4 py-2",...r,children:n})},a({children:n,...r}){return o.jsx("a",{className:"text-primary hover:underline",target:"_blank",rel:"noopener noreferrer",...r,children:n})},blockquote({children:n,...r}){return o.jsx("blockquote",{className:"border-l-4 border-primary pl-4 italic text-muted-foreground",...r,children:n})},h1({children:n,...r}){return o.jsx("h1",{className:"text-3xl font-bold mt-6 mb-4",...r,children:n})},h2({children:n,...r}){return o.jsx("h2",{className:"text-2xl font-bold mt-5 mb-3",...r,children:n})},h3({children:n,...r}){return o.jsx("h3",{className:"text-xl font-bold mt-4 mb-2",...r,children:n})},h4({children:n,...r}){return o.jsx("h4",{className:"text-lg font-semibold mt-3 mb-2",...r,children:n})},ul({children:n,...r}){return o.jsx("ul",{className:"list-disc list-inside space-y-1 my-2",...r,children:n})},ol({children:n,...r}){return o.jsx("ol",{className:"list-decimal list-inside space-y-1 my-2",...r,children:n})},p({children:n,...r}){return o.jsx("p",{className:"my-2 leading-relaxed",...r,children:n})},hr({...n}){return o.jsx("hr",{className:"my-4 border-border",...n})}},children:t})})}function uOe({children:t,className:e}){return o.jsx(cOe,{content:t,className:e})}const nc="/api/webui/emoji";async function dOe(t){const e=new URLSearchParams;t.page&&e.append("page",t.page.toString()),t.page_size&&e.append("page_size",t.page_size.toString()),t.search&&e.append("search",t.search),t.is_registered!==void 0&&e.append("is_registered",t.is_registered.toString()),t.is_banned!==void 0&&e.append("is_banned",t.is_banned.toString()),t.format&&e.append("format",t.format),t.sort_by&&e.append("sort_by",t.sort_by),t.sort_order&&e.append("sort_order",t.sort_order);const n=await gt(`${nc}/list?${e}`,{headers:Tt()});if(!n.ok)throw new Error(`获取表情包列表失败: ${n.statusText}`);return n.json()}async function hOe(t){const e=await gt(`${nc}/${t}`,{headers:Tt()});if(!e.ok)throw new Error(`获取表情包详情失败: ${e.statusText}`);return e.json()}async function fOe(t,e){const n=await gt(`${nc}/${t}`,{method:"PATCH",headers:Tt(),body:JSON.stringify(e)});if(!n.ok)throw new Error(`更新表情包失败: ${n.statusText}`);return n.json()}async function mOe(t){const e=await gt(`${nc}/${t}`,{method:"DELETE",headers:Tt()});if(!e.ok)throw new Error(`删除表情包失败: ${e.statusText}`);return e.json()}async function pOe(){const t=await gt(`${nc}/stats/summary`,{headers:Tt()});if(!t.ok)throw new Error(`获取统计数据失败: ${t.statusText}`);return t.json()}async function gOe(t){const e=await gt(`${nc}/${t}/register`,{method:"POST",headers:Tt()});if(!e.ok)throw new Error(`注册表情包失败: ${e.statusText}`);return e.json()}async function xOe(t){const e=await gt(`${nc}/${t}/ban`,{method:"POST",headers:Tt()});if(!e.ok)throw new Error(`封禁表情包失败: ${e.statusText}`);return e.json()}function eW(t){const e=localStorage.getItem("access-token");return`${nc}/${t}/thumbnail?token=${encodeURIComponent(e||"")}`}async function vOe(t){const e=await gt(`${nc}/batch/delete`,{method:"POST",headers:Tt(),body:JSON.stringify({emoji_ids:t})});if(!e.ok){const n=await e.json();throw new Error(n.detail||"批量删除失败")}return e.json()}function yOe(){const[t,e]=b.useState([]),[n,r]=b.useState(null),[s,i]=b.useState(!1),[a,l]=b.useState(1),[c,d]=b.useState(0),[h,m]=b.useState(20),[g,x]=b.useState("all"),[y,w]=b.useState("all"),[S,k]=b.useState("all"),[j,N]=b.useState("usage_count"),[T,E]=b.useState("desc"),[_,A]=b.useState(null),[D,q]=b.useState(!1),[B,H]=b.useState(!1),[W,ee]=b.useState(!1),[I,V]=b.useState(new Set),[L,$]=b.useState(!1),[K,Y]=b.useState(""),[R,ie]=b.useState("medium"),{toast:X}=Lr(),z=b.useCallback(async()=>{try{i(!0);const Oe=await dOe({page:a,page_size:h,is_registered:g==="all"?void 0:g==="registered",is_banned:y==="all"?void 0:y==="banned",format:S==="all"?void 0:S,sort_by:j,sort_order:T});e(Oe.data),d(Oe.total)}catch(Oe){const Ve=Oe instanceof Error?Oe.message:"加载表情包列表失败";X({title:"错误",description:Ve,variant:"destructive"})}finally{i(!1)}},[a,h,g,y,S,j,T,X]),U=async()=>{try{const Oe=await pOe();r(Oe.data)}catch(Oe){console.error("加载统计数据失败:",Oe)}};b.useEffect(()=>{z()},[z]),b.useEffect(()=>{U()},[]);const te=async Oe=>{try{const Ve=await hOe(Oe.id);A(Ve.data),q(!0)}catch(Ve){const Ue=Ve instanceof Error?Ve.message:"加载详情失败";X({title:"错误",description:Ue,variant:"destructive"})}},ne=Oe=>{A(Oe),H(!0)},G=Oe=>{A(Oe),ee(!0)},se=async()=>{if(_)try{await mOe(_.id),X({title:"成功",description:"表情包已删除"}),ee(!1),A(null),z(),U()}catch(Oe){const Ve=Oe instanceof Error?Oe.message:"删除失败";X({title:"错误",description:Ve,variant:"destructive"})}},re=async Oe=>{try{await gOe(Oe.id),X({title:"成功",description:"表情包已注册"}),z(),U()}catch(Ve){const Ue=Ve instanceof Error?Ve.message:"注册失败";X({title:"错误",description:Ue,variant:"destructive"})}},ae=async Oe=>{try{await xOe(Oe.id),X({title:"成功",description:"表情包已封禁"}),z(),U()}catch(Ve){const Ue=Ve instanceof Error?Ve.message:"封禁失败";X({title:"错误",description:Ue,variant:"destructive"})}},_e=Oe=>{const Ve=new Set(I);Ve.has(Oe)?Ve.delete(Oe):Ve.add(Oe),V(Ve)},Be=async()=>{try{const Oe=await vOe(Array.from(I));X({title:"批量删除完成",description:Oe.message}),V(new Set),$(!1),z(),U()}catch(Oe){X({title:"批量删除失败",description:Oe instanceof Error?Oe.message:"批量删除失败",variant:"destructive"})}},Ye=()=>{const Oe=parseInt(K),Ve=Math.ceil(c/h);Oe>=1&&Oe<=Ve?(l(Oe),Y("")):X({title:"无效的页码",description:`请输入1-${Ve}之间的页码`,variant:"destructive"})},Je=n?.formats?Object.keys(n.formats):[];return o.jsxs("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:[o.jsxs("div",{className:"mb-4 sm:mb-6",children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"表情包管理"}),o.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"管理麦麦的表情包资源"})]}),o.jsx(pn,{className:"flex-1",children:o.jsxs("div",{className:"space-y-4 sm:space-y-6 pr-4",children:[n&&o.jsxs("div",{className:"grid gap-4 grid-cols-2 lg:grid-cols-4",children:[o.jsx(Lt,{children:o.jsxs(En,{className:"pb-2",children:[o.jsx(Wr,{children:"总数"}),o.jsx(_n,{className:"text-2xl",children:n.total})]})}),o.jsx(Lt,{children:o.jsxs(En,{className:"pb-2",children:[o.jsx(Wr,{children:"已注册"}),o.jsx(_n,{className:"text-2xl text-green-600",children:n.registered})]})}),o.jsx(Lt,{children:o.jsxs(En,{className:"pb-2",children:[o.jsx(Wr,{children:"已封禁"}),o.jsx(_n,{className:"text-2xl text-red-600",children:n.banned})]})}),o.jsx(Lt,{children:o.jsxs(En,{className:"pb-2",children:[o.jsx(Wr,{children:"未注册"}),o.jsx(_n,{className:"text-2xl text-gray-600",children:n.unregistered})]})})]}),o.jsxs(Lt,{children:[o.jsx(En,{children:o.jsxs(_n,{className:"flex items-center gap-2",children:[o.jsx(ok,{className:"h-5 w-5"}),"筛选和排序"]})}),o.jsxs(Xn,{className:"space-y-4",children:[o.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{children:"排序方式"}),o.jsxs(Vt,{value:`${j}-${T}`,onValueChange:Oe=>{const[Ve,Ue]=Oe.split("-");N(Ve),E(Ue),l(1)},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"usage_count-desc",children:"使用次数 (多→少)"}),o.jsx(De,{value:"usage_count-asc",children:"使用次数 (少→多)"}),o.jsx(De,{value:"register_time-desc",children:"注册时间 (新→旧)"}),o.jsx(De,{value:"register_time-asc",children:"注册时间 (旧→新)"}),o.jsx(De,{value:"record_time-desc",children:"记录时间 (新→旧)"}),o.jsx(De,{value:"record_time-asc",children:"记录时间 (旧→新)"}),o.jsx(De,{value:"last_used_time-desc",children:"最后使用 (新→旧)"}),o.jsx(De,{value:"last_used_time-asc",children:"最后使用 (旧→新)"})]})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{children:"注册状态"}),o.jsxs(Vt,{value:g,onValueChange:Oe=>{x(Oe),l(1)},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"all",children:"全部"}),o.jsx(De,{value:"registered",children:"已注册"}),o.jsx(De,{value:"unregistered",children:"未注册"})]})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{children:"封禁状态"}),o.jsxs(Vt,{value:y,onValueChange:Oe=>{w(Oe),l(1)},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"all",children:"全部"}),o.jsx(De,{value:"banned",children:"已封禁"}),o.jsx(De,{value:"unbanned",children:"未封禁"})]})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{children:"格式"}),o.jsxs(Vt,{value:S,onValueChange:Oe=>{k(Oe),l(1)},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"all",children:"全部"}),Je.map(Oe=>o.jsxs(De,{value:Oe,children:[Oe.toUpperCase()," (",n?.formats[Oe],")"]},Oe))]})]})]})]}),o.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 pt-4 border-t",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[I.size>0&&o.jsxs("span",{className:"text-sm text-muted-foreground",children:["已选择 ",I.size," 个表情包"]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(he,{className:"text-sm whitespace-nowrap",children:"卡片大小"}),o.jsxs(Vt,{value:R,onValueChange:Oe=>ie(Oe),children:[o.jsx($t,{className:"w-24",children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"small",children:"小"}),o.jsx(De,{value:"medium",children:"中"}),o.jsx(De,{value:"large",children:"大"})]})]})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(he,{htmlFor:"emoji-page-size",className:"text-sm whitespace-nowrap",children:"每页显示"}),o.jsxs(Vt,{value:h.toString(),onValueChange:Oe=>{m(parseInt(Oe)),l(1),V(new Set)},children:[o.jsx($t,{id:"emoji-page-size",className:"w-20",children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"20",children:"20"}),o.jsx(De,{value:"40",children:"40"}),o.jsx(De,{value:"60",children:"60"}),o.jsx(De,{value:"100",children:"100"})]})]}),I.size>0&&o.jsxs(o.Fragment,{children:[o.jsx(ue,{variant:"outline",size:"sm",onClick:()=>V(new Set),children:"取消选择"}),o.jsxs(ue,{variant:"destructive",size:"sm",onClick:()=>$(!0),children:[o.jsx(Cn,{className:"h-4 w-4 mr-1"}),"批量删除"]})]})]})]}),o.jsx("div",{className:"flex justify-end pt-4 border-t",children:o.jsxs(ue,{variant:"outline",size:"sm",onClick:z,disabled:s,children:[o.jsx(Qs,{className:`h-4 w-4 mr-2 ${s?"animate-spin":""}`}),"刷新"]})})]})]}),o.jsxs(Lt,{children:[o.jsxs(En,{children:[o.jsx(_n,{children:"表情包列表"}),o.jsxs(Wr,{children:["共 ",c," 个表情包,当前第 ",a," 页"]})]}),o.jsxs(Xn,{children:[t.length===0?o.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"暂无数据"}):o.jsx("div",{className:`grid gap-3 ${R==="small"?"grid-cols-3 sm:grid-cols-4 md:grid-cols-6 lg:grid-cols-8 xl:grid-cols-10":R==="medium"?"grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 xl:grid-cols-8":"grid-cols-2 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5"}`,children:t.map(Oe=>o.jsxs("div",{className:`group relative rounded-lg border bg-card overflow-hidden hover:ring-2 hover:ring-primary transition-all cursor-pointer ${I.has(Oe.id)?"ring-2 ring-primary bg-primary/5":""}`,onClick:()=>_e(Oe.id),children:[o.jsx("div",{className:`absolute top-1 left-1 z-10 transition-opacity ${I.has(Oe.id)?"opacity-100":"opacity-0 group-hover:opacity-100"}`,children:o.jsx("div",{className:`w-5 h-5 rounded-full border-2 flex items-center justify-center ${I.has(Oe.id)?"bg-primary border-primary text-primary-foreground":"bg-background/80 border-muted-foreground/50"}`,children:I.has(Oe.id)&&o.jsx(Ya,{className:"h-3 w-3"})})}),o.jsxs("div",{className:"absolute top-1 right-1 z-10 flex flex-col gap-0.5",children:[Oe.is_registered&&o.jsx(tn,{variant:"default",className:"bg-green-600 text-[10px] px-1 py-0",children:"已注册"}),Oe.is_banned&&o.jsx(tn,{variant:"destructive",className:"text-[10px] px-1 py-0",children:"已封禁"})]}),o.jsx("div",{className:`aspect-square bg-muted flex items-center justify-center overflow-hidden ${R==="small"?"p-1":R==="medium"?"p-2":"p-3"}`,children:o.jsx("img",{src:eW(Oe.id),alt:"表情包",className:"w-full h-full object-contain",loading:"lazy",onError:Ve=>{const Ue=Ve.target;Ue.style.display="none";const $e=Ue.parentElement;$e&&($e.innerHTML='<svg class="h-8 w-8 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>')}})}),o.jsxs("div",{className:`border-t bg-card ${R==="small"?"p-1":"p-2"}`,children:[o.jsxs("div",{className:"flex items-center justify-between gap-1 text-xs text-muted-foreground mb-1",children:[o.jsx(tn,{variant:"outline",className:"text-[10px] px-1 py-0",children:Oe.format.toUpperCase()}),o.jsxs("span",{className:"font-mono",children:[Oe.usage_count,"次"]})]}),o.jsxs("div",{className:`flex gap-1 justify-center opacity-0 group-hover:opacity-100 transition-opacity ${R==="small"?"flex-wrap":""}`,children:[o.jsx(ue,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:Ve=>{Ve.stopPropagation(),ne(Oe)},title:"编辑",children:o.jsx(F0,{className:"h-3 w-3"})}),o.jsx(ue,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:Ve=>{Ve.stopPropagation(),te(Oe)},title:"详情",children:o.jsx(Xi,{className:"h-3 w-3"})}),!Oe.is_registered&&o.jsx(ue,{variant:"ghost",size:"icon",className:"h-6 w-6 text-green-600 hover:text-green-700",onClick:Ve=>{Ve.stopPropagation(),re(Oe)},title:"注册",children:o.jsx(Ya,{className:"h-3 w-3"})}),!Oe.is_banned&&o.jsx(ue,{variant:"ghost",size:"icon",className:"h-6 w-6 text-orange-600 hover:text-orange-700",onClick:Ve=>{Ve.stopPropagation(),ae(Oe)},title:"封禁",children:o.jsx(tte,{className:"h-3 w-3"})}),o.jsx(ue,{variant:"ghost",size:"icon",className:"h-6 w-6 text-red-600 hover:text-red-700",onClick:Ve=>{Ve.stopPropagation(),G(Oe)},title:"删除",children:o.jsx(Cn,{className:"h-3 w-3"})})]})]})]},Oe.id))}),c>0&&o.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 mt-4",children:[o.jsxs("div",{className:"text-sm text-muted-foreground",children:["显示 ",(a-1)*h+1," 到"," ",Math.min(a*h,c)," 条,共 ",c," 条"]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ue,{variant:"outline",size:"sm",onClick:()=>l(1),disabled:a===1,className:"hidden sm:flex",children:o.jsx(Ip,{className:"h-4 w-4"})}),o.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>l(Oe=>Math.max(1,Oe-1)),disabled:a===1,children:[o.jsx(wd,{className:"h-4 w-4 sm:mr-1"}),o.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Pe,{type:"number",value:K,onChange:Oe=>Y(Oe.target.value),onKeyDown:Oe=>Oe.key==="Enter"&&Ye(),placeholder:a.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(c/h)}),o.jsx(ue,{variant:"outline",size:"sm",onClick:Ye,disabled:!K,className:"h-8",children:"跳转"})]}),o.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>l(Oe=>Oe+1),disabled:a>=Math.ceil(c/h),children:[o.jsx("span",{className:"hidden sm:inline",children:"下一页"}),o.jsx(Zl,{className:"h-4 w-4 sm:ml-1"})]}),o.jsx(ue,{variant:"outline",size:"sm",onClick:()=>l(Math.ceil(c/h)),disabled:a>=Math.ceil(c/h),className:"hidden sm:flex",children:o.jsx(Lp,{className:"h-4 w-4"})})]})]})]})]}),o.jsx(bOe,{emoji:_,open:D,onOpenChange:q}),o.jsx(wOe,{emoji:_,open:B,onOpenChange:H,onSuccess:()=>{z(),U()}})]})}),o.jsx(Fn,{open:L,onOpenChange:$,children:o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认批量删除"}),o.jsxs(zn,{children:["你确定要删除选中的 ",I.size," 个表情包吗?此操作不可撤销。"]})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:Be,children:"确认删除"})]})]})}),o.jsx(Er,{open:W,onOpenChange:ee,children:o.jsxs(wr,{children:[o.jsxs(Sr,{children:[o.jsx(kr,{children:"确认删除"}),o.jsx(Xr,{children:"确定要删除这个表情包吗?此操作无法撤销。"})]}),o.jsxs(fs,{children:[o.jsx(ue,{variant:"outline",onClick:()=>ee(!1),children:"取消"}),o.jsx(ue,{variant:"destructive",onClick:se,children:"删除"})]})]})})]})}function bOe({emoji:t,open:e,onOpenChange:n}){if(!t)return null;const r=s=>s?new Date(s*1e3).toLocaleString("zh-CN"):"-";return o.jsx(Er,{open:e,onOpenChange:n,children:o.jsxs(wr,{className:"max-w-2xl max-h-[90vh]",children:[o.jsx(Sr,{children:o.jsx(kr,{children:"表情包详情"})}),o.jsx(pn,{className:"max-h-[calc(90vh-8rem)] pr-4",children:o.jsxs("div",{className:"space-y-4",children:[o.jsx("div",{className:"flex justify-center",children:o.jsx("div",{className:"w-32 h-32 bg-muted rounded-lg flex items-center justify-center overflow-hidden",children:o.jsx("img",{src:eW(t.id),alt:t.description||"表情包",className:"w-full h-full object-cover",onError:s=>{const i=s.target;i.style.display="none";const a=i.parentElement;a&&(a.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>')}})})}),o.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[o.jsxs("div",{children:[o.jsx(he,{className:"text-muted-foreground",children:"ID"}),o.jsx("div",{className:"mt-1 font-mono",children:t.id})]}),o.jsxs("div",{children:[o.jsx(he,{className:"text-muted-foreground",children:"格式"}),o.jsx("div",{className:"mt-1",children:o.jsx(tn,{variant:"outline",children:t.format.toUpperCase()})})]})]}),o.jsxs("div",{children:[o.jsx(he,{className:"text-muted-foreground",children:"文件路径"}),o.jsx("div",{className:"mt-1 font-mono text-sm break-all bg-muted p-2 rounded",children:t.full_path})]}),o.jsxs("div",{children:[o.jsx(he,{className:"text-muted-foreground",children:"哈希值"}),o.jsx("div",{className:"mt-1 font-mono text-sm break-all bg-muted p-2 rounded",children:t.emoji_hash})]}),o.jsxs("div",{children:[o.jsx(he,{className:"text-muted-foreground",children:"描述"}),t.description?o.jsx("div",{className:"mt-1 rounded-lg border bg-muted/50 p-3",children:o.jsx(uOe,{className:"prose-sm",children:t.description})}):o.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:"-"})]}),o.jsxs("div",{children:[o.jsx(he,{className:"text-muted-foreground",children:"情绪"}),o.jsx("div",{className:"mt-1",children:t.emotion?o.jsx("span",{className:"text-sm",children:t.emotion}):o.jsx("span",{className:"text-sm text-muted-foreground",children:"-"})})]}),o.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[o.jsxs("div",{children:[o.jsx(he,{className:"text-muted-foreground",children:"状态"}),o.jsxs("div",{className:"mt-2 flex gap-2",children:[t.is_registered&&o.jsx(tn,{variant:"default",className:"bg-green-600",children:"已注册"}),t.is_banned&&o.jsx(tn,{variant:"destructive",children:"已封禁"}),!t.is_registered&&!t.is_banned&&o.jsx(tn,{variant:"outline",children:"未注册"})]})]}),o.jsxs("div",{children:[o.jsx(he,{className:"text-muted-foreground",children:"使用次数"}),o.jsx("div",{className:"mt-1 font-mono text-lg",children:t.usage_count})]})]}),o.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[o.jsxs("div",{children:[o.jsx(he,{className:"text-muted-foreground",children:"记录时间"}),o.jsx("div",{className:"mt-1 text-sm",children:r(t.record_time)})]}),o.jsxs("div",{children:[o.jsx(he,{className:"text-muted-foreground",children:"注册时间"}),o.jsx("div",{className:"mt-1 text-sm",children:r(t.register_time)})]})]}),o.jsxs("div",{children:[o.jsx(he,{className:"text-muted-foreground",children:"最后使用"}),o.jsx("div",{className:"mt-1 text-sm",children:r(t.last_used_time)})]})]})})]})})}function wOe({emoji:t,open:e,onOpenChange:n,onSuccess:r}){const[s,i]=b.useState(""),[a,l]=b.useState(!1),[c,d]=b.useState(!1),[h,m]=b.useState(!1),{toast:g}=Lr();b.useEffect(()=>{t&&(i(t.emotion||""),l(t.is_registered),d(t.is_banned))},[t]);const x=async()=>{if(t)try{m(!0);const y=s.split(/[,,]/).map(w=>w.trim()).filter(Boolean).join(",");await fOe(t.id,{emotion:y||void 0,is_registered:a,is_banned:c}),g({title:"成功",description:"表情包信息已更新"}),n(!1),r()}catch(y){const w=y instanceof Error?y.message:"保存失败";g({title:"错误",description:w,variant:"destructive"})}finally{m(!1)}};return t?o.jsx(Er,{open:e,onOpenChange:n,children:o.jsxs(wr,{className:"max-w-2xl",children:[o.jsxs(Sr,{children:[o.jsx(kr,{children:"编辑表情包"}),o.jsx(Xr,{children:"修改表情包的情绪和状态信息"})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx(he,{children:"情绪"}),o.jsx(Nr,{value:s,onChange:y=>i(y.target.value),placeholder:"输入情绪描述...",rows:2,className:"mt-1"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"输入情绪相关的文本描述"})]}),o.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Ci,{id:"is_registered",checked:a,onCheckedChange:y=>{y===!0?(l(!0),d(!1)):l(!1)}}),o.jsx(he,{htmlFor:"is_registered",className:"cursor-pointer",children:"已注册"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Ci,{id:"is_banned",checked:c,onCheckedChange:y=>{y===!0?(d(!0),l(!1)):d(!1)}}),o.jsx(he,{htmlFor:"is_banned",className:"cursor-pointer",children:"已封禁"})]})]})]}),o.jsxs(fs,{children:[o.jsx(ue,{variant:"outline",onClick:()=>n(!1),children:"取消"}),o.jsx(ue,{onClick:x,disabled:h,children:h?"保存中...":"保存"})]})]})}):null}const pu="/api/webui/expression";async function SOe(){const t=await gt(`${pu}/chats`,{headers:Tt()});if(!t.ok){const e=await t.json();throw new Error(e.detail||"获取聊天列表失败")}return t.json()}async function kOe(t){const e=new URLSearchParams;t.page&&e.append("page",t.page.toString()),t.page_size&&e.append("page_size",t.page_size.toString()),t.search&&e.append("search",t.search),t.chat_id&&e.append("chat_id",t.chat_id);const n=await gt(`${pu}/list?${e}`,{headers:Tt()});if(!n.ok){const r=await n.json();throw new Error(r.detail||"获取表达方式列表失败")}return n.json()}async function OOe(t){const e=await gt(`${pu}/${t}`,{headers:Tt()});if(!e.ok){const n=await e.json();throw new Error(n.detail||"获取表达方式详情失败")}return e.json()}async function jOe(t){const e=await gt(`${pu}/`,{method:"POST",headers:Tt(),body:JSON.stringify(t)});if(!e.ok){const n=await e.json();throw new Error(n.detail||"创建表达方式失败")}return e.json()}async function NOe(t,e){const n=await gt(`${pu}/${t}`,{method:"PATCH",headers:Tt(),body:JSON.stringify(e)});if(!n.ok){const r=await n.json();throw new Error(r.detail||"更新表达方式失败")}return n.json()}async function COe(t){const e=await gt(`${pu}/${t}`,{method:"DELETE",headers:Tt()});if(!e.ok){const n=await e.json();throw new Error(n.detail||"删除表达方式失败")}return e.json()}async function TOe(t){const e=await gt(`${pu}/batch/delete`,{method:"POST",headers:Tt(),body:JSON.stringify({ids:t})});if(!e.ok){const n=await e.json();throw new Error(n.detail||"批量删除表达方式失败")}return e.json()}async function EOe(){const t=await gt(`${pu}/stats/summary`,{headers:Tt()});if(!t.ok){const e=await t.json();throw new Error(e.detail||"获取统计数据失败")}return t.json()}function _Oe(){const[t,e]=b.useState([]),[n,r]=b.useState(!0),[s,i]=b.useState(0),[a,l]=b.useState(1),[c,d]=b.useState(20),[h,m]=b.useState(""),[g,x]=b.useState(null),[y,w]=b.useState(!1),[S,k]=b.useState(!1),[j,N]=b.useState(!1),[T,E]=b.useState(null),[_,A]=b.useState(new Set),[D,q]=b.useState(!1),[B,H]=b.useState(""),[W,ee]=b.useState({total:0,recent_7days:0,chat_count:0,top_chats:{}}),[I,V]=b.useState([]),[L,$]=b.useState(new Map),{toast:K}=Lr(),Y=async()=>{try{r(!0);const ae=await kOe({page:a,page_size:c,search:h||void 0});e(ae.data),i(ae.total)}catch(ae){K({title:"加载失败",description:ae instanceof Error?ae.message:"无法加载表达方式",variant:"destructive"})}finally{r(!1)}},R=async()=>{try{const ae=await EOe();ae?.data&&ee(ae.data)}catch(ae){console.error("加载统计数据失败:",ae)}},ie=async()=>{try{const ae=await SOe();if(ae?.data){V(ae.data);const _e=new Map;ae.data.forEach(Be=>{_e.set(Be.chat_id,Be.chat_name)}),$(_e)}}catch(ae){console.error("加载聊天列表失败:",ae)}},X=ae=>L.get(ae)||ae;b.useEffect(()=>{Y(),R(),ie()},[a,c,h]);const z=async ae=>{try{const _e=await OOe(ae.id);x(_e.data),w(!0)}catch(_e){K({title:"加载详情失败",description:_e instanceof Error?_e.message:"无法加载表达方式详情",variant:"destructive"})}},U=ae=>{x(ae),k(!0)},te=async ae=>{try{await COe(ae.id),K({title:"删除成功",description:`已删除表达方式: ${ae.situation}`}),E(null),Y(),R()}catch(_e){K({title:"删除失败",description:_e instanceof Error?_e.message:"无法删除表达方式",variant:"destructive"})}},ne=ae=>{const _e=new Set(_);_e.has(ae)?_e.delete(ae):_e.add(ae),A(_e)},G=()=>{_.size===t.length&&t.length>0?A(new Set):A(new Set(t.map(ae=>ae.id)))},se=async()=>{try{await TOe(Array.from(_)),K({title:"批量删除成功",description:`已删除 ${_.size} 个表达方式`}),A(new Set),q(!1),Y(),R()}catch(ae){K({title:"批量删除失败",description:ae instanceof Error?ae.message:"无法批量删除表达方式",variant:"destructive"})}},re=()=>{const ae=parseInt(B),_e=Math.ceil(s/c);ae>=1&&ae<=_e?(l(ae),H("")):K({title:"无效的页码",description:`请输入1-${_e}之间的页码`,variant:"destructive"})};return o.jsxs("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:[o.jsx("div",{className:"mb-4 sm:mb-6",children:o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[o.jsxs("div",{children:[o.jsxs("h1",{className:"text-2xl sm:text-3xl font-bold flex items-center gap-2",children:[o.jsx(Gh,{className:"h-8 w-8",strokeWidth:2}),"表达方式管理"]}),o.jsx("p",{className:"text-muted-foreground mt-1 text-sm sm:text-base",children:"管理麦麦的表达方式和话术模板"})]}),o.jsxs(ue,{onClick:()=>N(!0),className:"gap-2",children:[o.jsx(Is,{className:"h-4 w-4"}),"新增表达方式"]})]})}),o.jsx(pn,{className:"flex-1",children:o.jsxs("div",{className:"space-y-4 sm:space-y-6 pr-4",children:[o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[o.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"总数量"}),o.jsx("div",{className:"text-2xl font-bold mt-1",children:W.total})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"近7天新增"}),o.jsx("div",{className:"text-2xl font-bold mt-1 text-green-600",children:W.recent_7days})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"关联聊天数"}),o.jsx("div",{className:"text-2xl font-bold mt-1 text-blue-600",children:W.chat_count})]})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[o.jsx(he,{htmlFor:"search",children:"搜索"}),o.jsx("div",{className:"flex flex-col sm:flex-row gap-2 mt-1.5",children:o.jsxs("div",{className:"flex-1 relative",children:[o.jsx(ii,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),o.jsx(Pe,{id:"search",placeholder:"搜索情境、风格或上下文...",value:h,onChange:ae=>m(ae.target.value),className:"pl-9"})]})}),o.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:[o.jsx("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:_.size>0&&o.jsxs("span",{children:["已选择 ",_.size," 个表达方式"]})}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(he,{htmlFor:"page-size",className:"text-sm whitespace-nowrap",children:"每页显示"}),o.jsxs(Vt,{value:c.toString(),onValueChange:ae=>{d(parseInt(ae)),l(1),A(new Set)},children:[o.jsx($t,{id:"page-size",className:"w-20",children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"10",children:"10"}),o.jsx(De,{value:"20",children:"20"}),o.jsx(De,{value:"50",children:"50"}),o.jsx(De,{value:"100",children:"100"})]})]}),_.size>0&&o.jsxs(o.Fragment,{children:[o.jsx(ue,{variant:"outline",size:"sm",onClick:()=>A(new Set),children:"取消选择"}),o.jsxs(ue,{variant:"destructive",size:"sm",onClick:()=>q(!0),children:[o.jsx(Cn,{className:"h-4 w-4 mr-1"}),"批量删除"]})]})]})]})]}),o.jsxs("div",{className:"rounded-lg border bg-card",children:[o.jsx("div",{className:"hidden md:block",children:o.jsxs(Af,{children:[o.jsx(Mf,{children:o.jsxs(zs,{children:[o.jsx(mn,{className:"w-12",children:o.jsx(Ci,{checked:_.size===t.length&&t.length>0,onCheckedChange:G})}),o.jsx(mn,{children:"情境"}),o.jsx(mn,{children:"风格"}),o.jsx(mn,{children:"聊天"}),o.jsx(mn,{className:"text-right",children:"操作"})]})}),o.jsx(Rf,{children:n?o.jsx(zs,{children:o.jsx(Yt,{colSpan:5,className:"text-center py-8 text-muted-foreground",children:"加载中..."})}):t.length===0?o.jsx(zs,{children:o.jsx(Yt,{colSpan:5,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):t.map(ae=>o.jsxs(zs,{children:[o.jsx(Yt,{children:o.jsx(Ci,{checked:_.has(ae.id),onCheckedChange:()=>ne(ae.id)})}),o.jsx(Yt,{className:"font-medium max-w-xs truncate",children:ae.situation}),o.jsx(Yt,{className:"max-w-xs truncate",children:ae.style}),o.jsx(Yt,{className:"max-w-[200px] truncate",title:X(ae.chat_id),style:{wordBreak:"keep-all"},children:o.jsx("span",{className:"whitespace-nowrap overflow-hidden text-ellipsis block",children:X(ae.chat_id)})}),o.jsx(Yt,{className:"text-right",children:o.jsxs("div",{className:"flex justify-end gap-2",children:[o.jsxs(ue,{variant:"default",size:"sm",onClick:()=>U(ae),children:[o.jsx(F0,{className:"h-4 w-4 mr-1"}),"编辑"]}),o.jsx(ue,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>z(ae),title:"查看详情",children:o.jsx(Ji,{className:"h-4 w-4"})}),o.jsxs(ue,{size:"sm",onClick:()=>E(ae),className:"bg-red-600 hover:bg-red-700 text-white",children:[o.jsx(Cn,{className:"h-4 w-4 mr-1"}),"删除"]})]})})]},ae.id))})]})}),o.jsx("div",{className:"md:hidden space-y-3 p-4",children:n?o.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"加载中..."}):t.length===0?o.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"暂无数据"}):t.map(ae=>o.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3 overflow-hidden",children:[o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx(Ci,{checked:_.has(ae.id),onCheckedChange:()=>ne(ae.id),className:"mt-1"}),o.jsxs("div",{className:"min-w-0 flex-1 overflow-hidden space-y-2",children:[o.jsxs("div",{children:[o.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"情境"}),o.jsx("h3",{className:"font-semibold text-sm line-clamp-2 w-full break-all",title:ae.situation,children:ae.situation})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"风格"}),o.jsx("p",{className:"text-sm line-clamp-2 w-full break-all",title:ae.style,children:ae.style})]})]})]}),o.jsxs("div",{className:"text-sm",children:[o.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"聊天"}),o.jsx("p",{className:"text-sm truncate",title:X(ae.chat_id),style:{wordBreak:"keep-all"},children:X(ae.chat_id)})]}),o.jsxs("div",{className:"flex flex-wrap gap-1 pt-2 border-t overflow-hidden",children:[o.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>U(ae),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[o.jsx(F0,{className:"h-3 w-3 mr-1"}),"编辑"]}),o.jsx(ue,{variant:"outline",size:"sm",onClick:()=>z(ae),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:o.jsx(Ji,{className:"h-3 w-3"})}),o.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>E(ae),className:"text-xs px-2 py-1 h-auto flex-shrink-0 text-destructive hover:text-destructive",children:[o.jsx(Cn,{className:"h-3 w-3 mr-1"}),"删除"]})]})]},ae.id))}),s>0&&o.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 px-4 py-3 border-t",children:[o.jsxs("div",{className:"text-sm text-muted-foreground",children:["共 ",s," 条记录,第 ",a," / ",Math.ceil(s/c)," 页"]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ue,{variant:"outline",size:"sm",onClick:()=>l(1),disabled:a===1,className:"hidden sm:flex",children:o.jsx(Ip,{className:"h-4 w-4"})}),o.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>l(a-1),disabled:a===1,children:[o.jsx(wd,{className:"h-4 w-4 sm:mr-1"}),o.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Pe,{type:"number",value:B,onChange:ae=>H(ae.target.value),onKeyDown:ae=>ae.key==="Enter"&&re(),placeholder:a.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(s/c)}),o.jsx(ue,{variant:"outline",size:"sm",onClick:re,disabled:!B,className:"h-8",children:"跳转"})]}),o.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>l(a+1),disabled:a>=Math.ceil(s/c),children:[o.jsx("span",{className:"hidden sm:inline",children:"下一页"}),o.jsx(Zl,{className:"h-4 w-4 sm:ml-1"})]}),o.jsx(ue,{variant:"outline",size:"sm",onClick:()=>l(Math.ceil(s/c)),disabled:a>=Math.ceil(s/c),className:"hidden sm:flex",children:o.jsx(Lp,{className:"h-4 w-4"})})]})]})]})]})}),o.jsx(AOe,{expression:g,open:y,onOpenChange:w,chatNameMap:L}),o.jsx(MOe,{open:j,onOpenChange:N,chatList:I,onSuccess:()=>{Y(),R(),N(!1)}}),o.jsx(ROe,{expression:g,open:S,onOpenChange:k,chatList:I,onSuccess:()=>{Y(),R(),k(!1)}}),o.jsx(Fn,{open:!!T,onOpenChange:()=>E(null),children:o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认删除"}),o.jsxs(zn,{children:['确定要删除表达方式 "',T?.situation,'" 吗? 此操作不可撤销。']})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:()=>T&&te(T),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"删除"})]})]})}),o.jsx(DOe,{open:D,onOpenChange:q,onConfirm:se,count:_.size})]})}function AOe({expression:t,open:e,onOpenChange:n,chatNameMap:r}){if(!t)return null;const s=a=>a?new Date(a*1e3).toLocaleString("zh-CN"):"-",i=a=>r.get(a)||a;return o.jsx(Er,{open:e,onOpenChange:n,children:o.jsxs(wr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[o.jsxs(Sr,{children:[o.jsx(kr,{children:"表达方式详情"}),o.jsx(Xr,{children:"查看表达方式的完整信息"})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsx(t0,{label:"情境",value:t.situation}),o.jsx(t0,{label:"风格",value:t.style}),o.jsx(t0,{label:"聊天",value:i(t.chat_id)}),o.jsx(t0,{icon:lk,label:"记录ID",value:t.id.toString(),mono:!0})]}),o.jsx("div",{className:"grid grid-cols-2 gap-4",children:o.jsx(t0,{icon:Mh,label:"创建时间",value:s(t.create_date)})})]}),o.jsx(fs,{children:o.jsx(ue,{onClick:()=>n(!1),children:"关闭"})})]})})}function t0({icon:t,label:e,value:n,mono:r=!1}){return o.jsxs("div",{className:"space-y-1",children:[o.jsxs(he,{className:"text-xs text-muted-foreground flex items-center gap-1",children:[t&&o.jsx(t,{className:"h-3 w-3"}),e]}),o.jsx("div",{className:xe("text-sm",r&&"font-mono",!n&&"text-muted-foreground"),children:n||"-"})]})}function MOe({open:t,onOpenChange:e,chatList:n,onSuccess:r}){const[s,i]=b.useState({situation:"",style:"",chat_id:""}),[a,l]=b.useState(!1),{toast:c}=Lr(),d=async()=>{if(!s.situation||!s.style||!s.chat_id){c({title:"验证失败",description:"请填写必填字段:情境、风格和聊天",variant:"destructive"});return}try{l(!0),await jOe(s),c({title:"创建成功",description:"表达方式已创建"}),i({situation:"",style:"",chat_id:""}),r()}catch(h){c({title:"创建失败",description:h instanceof Error?h.message:"无法创建表达方式",variant:"destructive"})}finally{l(!1)}};return o.jsx(Er,{open:t,onOpenChange:e,children:o.jsxs(wr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[o.jsxs(Sr,{children:[o.jsx(kr,{children:"新增表达方式"}),o.jsx(Xr,{children:"创建新的表达方式记录"})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsxs(he,{htmlFor:"situation",children:["情境 ",o.jsx("span",{className:"text-destructive",children:"*"})]}),o.jsx(Pe,{id:"situation",value:s.situation,onChange:h=>i({...s,situation:h.target.value}),placeholder:"描述使用场景"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsxs(he,{htmlFor:"style",children:["风格 ",o.jsx("span",{className:"text-destructive",children:"*"})]}),o.jsx(Pe,{id:"style",value:s.style,onChange:h=>i({...s,style:h.target.value}),placeholder:"描述表达风格"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsxs(he,{htmlFor:"chat_id",children:["聊天 ",o.jsx("span",{className:"text-destructive",children:"*"})]}),o.jsxs(Vt,{value:s.chat_id,onValueChange:h=>i({...s,chat_id:h}),children:[o.jsx($t,{children:o.jsx(Ut,{placeholder:"选择关联的聊天"})}),o.jsx(Ht,{children:n.map(h=>o.jsx(De,{value:h.chat_id,children:o.jsxs("span",{className:"truncate",style:{wordBreak:"keep-all"},children:[h.chat_name,h.is_group&&o.jsx("span",{className:"text-muted-foreground ml-1",children:"(群聊)"})]})},h.chat_id))})]})]})]}),o.jsxs(fs,{children:[o.jsx(ue,{variant:"outline",onClick:()=>e(!1),children:"取消"}),o.jsx(ue,{onClick:d,disabled:a,children:a?"创建中...":"创建"})]})]})})}function ROe({expression:t,open:e,onOpenChange:n,chatList:r,onSuccess:s}){const[i,a]=b.useState({}),[l,c]=b.useState(!1),{toast:d}=Lr();b.useEffect(()=>{t&&a({situation:t.situation,style:t.style,chat_id:t.chat_id})},[t]);const h=async()=>{if(t)try{c(!0),await NOe(t.id,i),d({title:"保存成功",description:"表达方式已更新"}),s()}catch(m){d({title:"保存失败",description:m instanceof Error?m.message:"无法更新表达方式",variant:"destructive"})}finally{c(!1)}};return t?o.jsx(Er,{open:e,onOpenChange:n,children:o.jsxs(wr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[o.jsxs(Sr,{children:[o.jsx(kr,{children:"编辑表达方式"}),o.jsx(Xr,{children:"修改表达方式的信息"})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"edit_situation",children:"情境"}),o.jsx(Pe,{id:"edit_situation",value:i.situation||"",onChange:m=>a({...i,situation:m.target.value}),placeholder:"描述使用场景"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"edit_style",children:"风格"}),o.jsx(Pe,{id:"edit_style",value:i.style||"",onChange:m=>a({...i,style:m.target.value}),placeholder:"描述表达风格"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"edit_chat_id",children:"聊天"}),o.jsxs(Vt,{value:i.chat_id||"",onValueChange:m=>a({...i,chat_id:m}),children:[o.jsx($t,{children:o.jsx(Ut,{placeholder:"选择关联的聊天"})}),o.jsx(Ht,{children:r.map(m=>o.jsx(De,{value:m.chat_id,children:o.jsxs("span",{className:"truncate",style:{wordBreak:"keep-all"},children:[m.chat_name,m.is_group&&o.jsx("span",{className:"text-muted-foreground ml-1",children:"(群聊)"})]})},m.chat_id))})]})]})]}),o.jsxs(fs,{children:[o.jsx(ue,{variant:"outline",onClick:()=>n(!1),children:"取消"}),o.jsx(ue,{onClick:h,disabled:l,children:l?"保存中...":"保存"})]})]})}):null}function DOe({open:t,onOpenChange:e,onConfirm:n,count:r}){return o.jsx(Fn,{open:t,onOpenChange:e,children:o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认批量删除"}),o.jsxs(zn,{children:["您即将删除 ",r," 个表达方式,此操作无法撤销。确定要继续吗?"]})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:n,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"确认删除"})]})]})})}const Qf="/api/webui/person";async function POe(t){const e=new URLSearchParams;t.page&&e.append("page",t.page.toString()),t.page_size&&e.append("page_size",t.page_size.toString()),t.search&&e.append("search",t.search),t.is_known!==void 0&&e.append("is_known",t.is_known.toString()),t.platform&&e.append("platform",t.platform);const n=await gt(`${Qf}/list?${e}`,{headers:Tt()});if(!n.ok){const r=await n.json();throw new Error(r.detail||"获取人物列表失败")}return n.json()}async function zOe(t){const e=await gt(`${Qf}/${t}`,{headers:Tt()});if(!e.ok){const n=await e.json();throw new Error(n.detail||"获取人物详情失败")}return e.json()}async function IOe(t,e){const n=await gt(`${Qf}/${t}`,{method:"PATCH",headers:Tt(),body:JSON.stringify(e)});if(!n.ok){const r=await n.json();throw new Error(r.detail||"更新人物信息失败")}return n.json()}async function LOe(t){const e=await gt(`${Qf}/${t}`,{method:"DELETE",headers:Tt()});if(!e.ok){const n=await e.json();throw new Error(n.detail||"删除人物信息失败")}return e.json()}async function BOe(){const t=await gt(`${Qf}/stats/summary`,{headers:Tt()});if(!t.ok){const e=await t.json();throw new Error(e.detail||"获取统计数据失败")}return t.json()}async function FOe(t){const e=await gt(`${Qf}/batch/delete`,{method:"POST",headers:Tt(),body:JSON.stringify({person_ids:t})});if(!e.ok){const n=await e.json();throw new Error(n.detail||"批量删除失败")}return e.json()}function qOe(){const[t,e]=b.useState([]),[n,r]=b.useState(!0),[s,i]=b.useState(0),[a,l]=b.useState(1),[c,d]=b.useState(20),[h,m]=b.useState(""),[g,x]=b.useState(void 0),[y,w]=b.useState(void 0),[S,k]=b.useState(null),[j,N]=b.useState(!1),[T,E]=b.useState(!1),[_,A]=b.useState(null),[D,q]=b.useState({total:0,known:0,unknown:0,platforms:{}}),[B,H]=b.useState(new Set),[W,ee]=b.useState(!1),[I,V]=b.useState(""),{toast:L}=Lr(),$=async()=>{try{r(!0);const re=await POe({page:a,page_size:c,search:h||void 0,is_known:g,platform:y});e(re.data),i(re.total)}catch(re){L({title:"加载失败",description:re instanceof Error?re.message:"无法加载人物信息",variant:"destructive"})}finally{r(!1)}},K=async()=>{try{const re=await BOe();re?.data&&q(re.data)}catch(re){console.error("加载统计数据失败:",re)}};b.useEffect(()=>{$(),K()},[a,c,h,g,y]);const Y=async re=>{try{const ae=await zOe(re.person_id);k(ae.data),N(!0)}catch(ae){L({title:"加载详情失败",description:ae instanceof Error?ae.message:"无法加载人物详情",variant:"destructive"})}},R=re=>{k(re),E(!0)},ie=async re=>{try{await LOe(re.person_id),L({title:"删除成功",description:`已删除人物信息: ${re.person_name||re.nickname||re.user_id}`}),A(null),$(),K()}catch(ae){L({title:"删除失败",description:ae instanceof Error?ae.message:"无法删除人物信息",variant:"destructive"})}},X=b.useMemo(()=>Object.keys(D.platforms),[D.platforms]),z=re=>{const ae=new Set(B);ae.has(re)?ae.delete(re):ae.add(re),H(ae)},U=()=>{B.size===t.length&&t.length>0?H(new Set):H(new Set(t.map(re=>re.person_id)))},te=()=>{if(B.size===0){L({title:"未选择任何人物",description:"请先选择要删除的人物",variant:"destructive"});return}ee(!0)},ne=async()=>{try{const re=await FOe(Array.from(B));L({title:"批量删除完成",description:re.message}),H(new Set),ee(!1),$(),K()}catch(re){L({title:"批量删除失败",description:re instanceof Error?re.message:"批量删除失败",variant:"destructive"})}},G=()=>{const re=parseInt(I),ae=Math.ceil(s/c);re>=1&&re<=ae?(l(re),V("")):L({title:"无效的页码",description:`请输入1-${ae}之间的页码`,variant:"destructive"})},se=re=>re?new Date(re*1e3).toLocaleString("zh-CN"):"-";return o.jsxs("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:[o.jsx("div",{className:"mb-4 sm:mb-6",children:o.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:o.jsxs("div",{children:[o.jsxs("h1",{className:"text-2xl sm:text-3xl font-bold flex items-center gap-2",children:[o.jsx(nte,{className:"h-8 w-8",strokeWidth:2}),"人物信息管理"]}),o.jsx("p",{className:"text-muted-foreground mt-1 text-sm sm:text-base",children:"管理麦麦认识的所有人物信息"})]})})}),o.jsx(pn,{className:"flex-1",children:o.jsxs("div",{className:"space-y-4 sm:space-y-6 pr-4",children:[o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[o.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"总人数"}),o.jsx("div",{className:"text-2xl font-bold mt-1",children:D.total})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"已认识"}),o.jsx("div",{className:"text-2xl font-bold mt-1 text-green-600",children:D.known})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"未认识"}),o.jsx("div",{className:"text-2xl font-bold mt-1 text-muted-foreground",children:D.unknown})]})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-4 gap-4",children:[o.jsxs("div",{className:"sm:col-span-2",children:[o.jsx(he,{htmlFor:"search",children:"搜索"}),o.jsxs("div",{className:"relative mt-1.5",children:[o.jsx(ii,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),o.jsx(Pe,{id:"search",placeholder:"搜索名称、昵称或用户ID...",value:h,onChange:re=>m(re.target.value),className:"pl-9"})]})]}),o.jsxs("div",{children:[o.jsx(he,{htmlFor:"filter-known",children:"认识状态"}),o.jsxs(Vt,{value:g===void 0?"all":g.toString(),onValueChange:re=>{x(re==="all"?void 0:re==="true"),l(1)},children:[o.jsx($t,{id:"filter-known",className:"mt-1.5",children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"all",children:"全部"}),o.jsx(De,{value:"true",children:"已认识"}),o.jsx(De,{value:"false",children:"未认识"})]})]})]}),o.jsxs("div",{children:[o.jsx(he,{htmlFor:"filter-platform",children:"平台"}),o.jsxs(Vt,{value:y||"all",onValueChange:re=>{w(re==="all"?void 0:re),l(1)},children:[o.jsx($t,{id:"filter-platform",className:"mt-1.5",children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"all",children:"全部平台"}),X.map(re=>o.jsxs(De,{value:re,children:[re," (",D.platforms[re],")"]},re))]})]})]})]}),o.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:[o.jsx("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:B.size>0&&o.jsxs("span",{children:["已选择 ",B.size," 个人物"]})}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(he,{htmlFor:"page-size",className:"text-sm whitespace-nowrap",children:"每页显示"}),o.jsxs(Vt,{value:c.toString(),onValueChange:re=>{d(parseInt(re)),l(1),H(new Set)},children:[o.jsx($t,{id:"page-size",className:"w-20",children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"10",children:"10"}),o.jsx(De,{value:"20",children:"20"}),o.jsx(De,{value:"50",children:"50"}),o.jsx(De,{value:"100",children:"100"})]})]}),B.size>0&&o.jsxs(o.Fragment,{children:[o.jsx(ue,{variant:"outline",size:"sm",onClick:()=>H(new Set),children:"取消选择"}),o.jsxs(ue,{variant:"destructive",size:"sm",onClick:te,children:[o.jsx(Cn,{className:"h-4 w-4 mr-1"}),"批量删除"]})]})]})]})]}),o.jsxs("div",{className:"rounded-lg border bg-card",children:[o.jsx("div",{className:"hidden md:block",children:o.jsxs(Af,{children:[o.jsx(Mf,{children:o.jsxs(zs,{children:[o.jsx(mn,{className:"w-12",children:o.jsx(Ci,{checked:t.length>0&&B.size===t.length,onCheckedChange:U,"aria-label":"全选"})}),o.jsx(mn,{children:"状态"}),o.jsx(mn,{children:"名称"}),o.jsx(mn,{children:"昵称"}),o.jsx(mn,{children:"平台"}),o.jsx(mn,{children:"用户ID"}),o.jsx(mn,{children:"最后更新"}),o.jsx(mn,{className:"text-right",children:"操作"})]})}),o.jsx(Rf,{children:n?o.jsx(zs,{children:o.jsx(Yt,{colSpan:8,className:"text-center py-8 text-muted-foreground",children:"加载中..."})}):t.length===0?o.jsx(zs,{children:o.jsx(Yt,{colSpan:8,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):t.map(re=>o.jsxs(zs,{children:[o.jsx(Yt,{children:o.jsx(Ci,{checked:B.has(re.person_id),onCheckedChange:()=>z(re.person_id),"aria-label":`选择 ${re.person_name||re.nickname||re.user_id}`})}),o.jsx(Yt,{children:o.jsx("div",{className:xe("inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium",re.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:re.is_known?"已认识":"未认识"})}),o.jsx(Yt,{className:"font-medium",children:re.person_name||o.jsx("span",{className:"text-muted-foreground",children:"-"})}),o.jsx(Yt,{children:re.nickname||"-"}),o.jsx(Yt,{children:re.platform}),o.jsx(Yt,{className:"font-mono text-sm",children:re.user_id}),o.jsx(Yt,{className:"text-sm text-muted-foreground",children:se(re.last_know)}),o.jsx(Yt,{className:"text-right",children:o.jsxs("div",{className:"flex justify-end gap-2",children:[o.jsxs(ue,{variant:"default",size:"sm",onClick:()=>Y(re),children:[o.jsx(Ji,{className:"h-4 w-4 mr-1"}),"详情"]}),o.jsxs(ue,{variant:"default",size:"sm",onClick:()=>R(re),children:[o.jsx(F0,{className:"h-4 w-4 mr-1"}),"编辑"]}),o.jsxs(ue,{size:"sm",onClick:()=>A(re),className:"bg-red-600 hover:bg-red-700 text-white",children:[o.jsx(Cn,{className:"h-4 w-4 mr-1"}),"删除"]})]})})]},re.id))})]})}),o.jsx("div",{className:"md:hidden space-y-3 p-4",children:n?o.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"加载中..."}):t.length===0?o.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"暂无数据"}):t.map(re=>o.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3 overflow-hidden",children:[o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx(Ci,{checked:B.has(re.person_id),onCheckedChange:()=>z(re.person_id),className:"mt-1"}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("div",{className:xe("inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium mb-2",re.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:re.is_known?"已认识":"未认识"}),o.jsx("h3",{className:"font-semibold text-sm line-clamp-1 w-full break-all",children:re.person_name||o.jsx("span",{className:"text-muted-foreground",children:"未命名"})}),re.nickname&&o.jsxs("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-1 w-full break-all",children:["昵称: ",re.nickname]})]})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[o.jsxs("div",{children:[o.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"平台"}),o.jsx("p",{className:"font-medium text-xs",children:re.platform})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"用户ID"}),o.jsx("p",{className:"font-mono text-xs truncate",title:re.user_id,children:re.user_id})]}),o.jsxs("div",{className:"col-span-2",children:[o.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"最后更新"}),o.jsx("p",{className:"text-xs",children:se(re.last_know)})]})]}),o.jsxs("div",{className:"flex flex-wrap gap-1 pt-2 border-t overflow-hidden",children:[o.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>Y(re),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[o.jsx(Ji,{className:"h-3 w-3 mr-1"}),"查看"]}),o.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>R(re),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[o.jsx(F0,{className:"h-3 w-3 mr-1"}),"编辑"]}),o.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>A(re),className:"text-xs px-2 py-1 h-auto flex-shrink-0 text-destructive hover:text-destructive",children:[o.jsx(Cn,{className:"h-3 w-3 mr-1"}),"删除"]})]})]},re.id))}),s>0&&o.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 px-4 py-3 border-t",children:[o.jsxs("div",{className:"text-sm text-muted-foreground",children:["共 ",s," 条记录,第 ",a," / ",Math.ceil(s/c)," 页"]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ue,{variant:"outline",size:"sm",onClick:()=>l(1),disabled:a===1,className:"hidden sm:flex",children:o.jsx(Ip,{className:"h-4 w-4"})}),o.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>l(a-1),disabled:a===1,children:[o.jsx(wd,{className:"h-4 w-4 sm:mr-1"}),o.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Pe,{type:"number",value:I,onChange:re=>V(re.target.value),onKeyDown:re=>re.key==="Enter"&&G(),placeholder:a.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(s/c)}),o.jsx(ue,{variant:"outline",size:"sm",onClick:G,disabled:!I,className:"h-8",children:"跳转"})]}),o.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>l(a+1),disabled:a>=Math.ceil(s/c),children:[o.jsx("span",{className:"hidden sm:inline",children:"下一页"}),o.jsx(Zl,{className:"h-4 w-4 sm:ml-1"})]}),o.jsx(ue,{variant:"outline",size:"sm",onClick:()=>l(Math.ceil(s/c)),disabled:a>=Math.ceil(s/c),className:"hidden sm:flex",children:o.jsx(Lp,{className:"h-4 w-4"})})]})]})]})]})}),o.jsx($Oe,{person:S,open:j,onOpenChange:N}),o.jsx(HOe,{person:S,open:T,onOpenChange:E,onSuccess:()=>{$(),K(),E(!1)}}),o.jsx(Fn,{open:!!_,onOpenChange:()=>A(null),children:o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认删除"}),o.jsxs(zn,{children:['确定要删除人物信息 "',_?.person_name||_?.nickname||_?.user_id,'" 吗? 此操作不可撤销。']})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:()=>_&&ie(_),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"删除"})]})]})}),o.jsx(Fn,{open:W,onOpenChange:ee,children:o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"确认批量删除"}),o.jsxs(zn,{children:["确定要删除选中的 ",B.size," 个人物信息吗? 此操作不可撤销。"]})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{children:"取消"}),o.jsx(In,{onClick:ne,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})})]})}function $Oe({person:t,open:e,onOpenChange:n}){if(!t)return null;const r=s=>s?new Date(s*1e3).toLocaleString("zh-CN"):"-";return o.jsx(Er,{open:e,onOpenChange:n,children:o.jsxs(wr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[o.jsxs(Sr,{children:[o.jsx(kr,{children:"人物详情"}),o.jsxs(Xr,{children:["查看 ",t.person_name||t.nickname||t.user_id," 的完整信息"]})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsx(kl,{icon:Lv,label:"人物名称",value:t.person_name}),o.jsx(kl,{icon:Gh,label:"昵称",value:t.nickname}),o.jsx(kl,{icon:lk,label:"用户ID",value:t.user_id,mono:!0}),o.jsx(kl,{icon:lk,label:"人物ID",value:t.person_id,mono:!0}),o.jsx(kl,{label:"平台",value:t.platform}),o.jsx(kl,{label:"状态",value:t.is_known?"已认识":"未认识"})]}),t.name_reason&&o.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[o.jsx(he,{className:"text-xs text-muted-foreground",children:"名称设定原因"}),o.jsx("p",{className:"mt-1 text-sm",children:t.name_reason})]}),t.memory_points&&o.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[o.jsx(he,{className:"text-xs text-muted-foreground",children:"个人印象"}),o.jsx("p",{className:"mt-1 text-sm whitespace-pre-wrap",children:t.memory_points})]}),t.group_nick_name&&t.group_nick_name.length>0&&o.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[o.jsx(he,{className:"text-xs text-muted-foreground",children:"群昵称"}),o.jsx("div",{className:"mt-2 space-y-1",children:t.group_nick_name.map((s,i)=>o.jsxs("div",{className:"text-sm flex items-center gap-2",children:[o.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:s.group_id}),o.jsx("span",{children:"→"}),o.jsx("span",{children:s.group_nick_name})]},i))})]}),o.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[o.jsx(kl,{icon:Mh,label:"认识时间",value:r(t.know_times)}),o.jsx(kl,{icon:Mh,label:"首次记录",value:r(t.know_since)}),o.jsx(kl,{icon:Mh,label:"最后更新",value:r(t.last_know)})]})]}),o.jsx(fs,{children:o.jsx(ue,{onClick:()=>n(!1),children:"关闭"})})]})})}function kl({icon:t,label:e,value:n,mono:r=!1}){return o.jsxs("div",{className:"space-y-1",children:[o.jsxs(he,{className:"text-xs text-muted-foreground flex items-center gap-1",children:[t&&o.jsx(t,{className:"h-3 w-3"}),e]}),o.jsx("div",{className:xe("text-sm",r&&"font-mono",!n&&"text-muted-foreground"),children:n||"-"})]})}function HOe({person:t,open:e,onOpenChange:n,onSuccess:r}){const[s,i]=b.useState({}),[a,l]=b.useState(!1),{toast:c}=Lr();b.useEffect(()=>{t&&i({person_name:t.person_name||"",name_reason:t.name_reason||"",nickname:t.nickname||"",memory_points:t.memory_points||"",is_known:t.is_known})},[t]);const d=async()=>{if(t)try{l(!0),await IOe(t.person_id,s),c({title:"保存成功",description:"人物信息已更新"}),r()}catch(h){c({title:"保存失败",description:h instanceof Error?h.message:"无法更新人物信息",variant:"destructive"})}finally{l(!1)}};return t?o.jsx(Er,{open:e,onOpenChange:n,children:o.jsxs(wr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[o.jsxs(Sr,{children:[o.jsx(kr,{children:"编辑人物信息"}),o.jsxs(Xr,{children:["修改 ",t.person_name||t.nickname||t.user_id," 的信息"]})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"person_name",children:"人物名称"}),o.jsx(Pe,{id:"person_name",value:s.person_name||"",onChange:h=>i({...s,person_name:h.target.value}),placeholder:"为这个人设置一个名称"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"nickname",children:"昵称"}),o.jsx(Pe,{id:"nickname",value:s.nickname||"",onChange:h=>i({...s,nickname:h.target.value}),placeholder:"昵称"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"name_reason",children:"名称设定原因"}),o.jsx(Nr,{id:"name_reason",value:s.name_reason||"",onChange:h=>i({...s,name_reason:h.target.value}),placeholder:"为什么这样称呼这个人?",rows:2})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"memory_points",children:"个人印象"}),o.jsx(Nr,{id:"memory_points",value:s.memory_points||"",onChange:h=>i({...s,memory_points:h.target.value}),placeholder:"对这个人的印象和记忆点...",rows:4})]}),o.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[o.jsxs("div",{children:[o.jsx(he,{htmlFor:"is_known",className:"text-base font-medium",children:"已认识"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"标记是否已经认识这个人"})]}),o.jsx(Ft,{id:"is_known",checked:s.is_known,onCheckedChange:h=>i({...s,is_known:h})})]})]}),o.jsxs(fs,{children:[o.jsx(ue,{variant:"outline",onClick:()=>n(!1),children:"取消"}),o.jsx(ue,{onClick:d,disabled:a,children:a?"保存中...":"保存"})]})]})}):null}function Ls(t){if(typeof t=="string"||typeof t=="number")return""+t;let e="";if(Array.isArray(t))for(let n=0,r;n<t.length;n++)(r=Ls(t[n]))!==""&&(e+=(e&&" ")+r);else for(let n in t)t[n]&&(e+=(e&&" ")+n);return e}const QOe={},iD=t=>{let e;const n=new Set,r=(h,m)=>{const g=typeof h=="function"?h(e):h;if(!Object.is(g,e)){const x=e;e=m??(typeof g!="object"||g===null)?g:Object.assign({},e,g),n.forEach(y=>y(e,x))}},s=()=>e,c={setState:r,getState:s,getInitialState:()=>d,subscribe:h=>(n.add(h),()=>n.delete(h)),destroy:()=>{(QOe?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},d=e=t(r,s,c);return c},VOe=t=>t?iD(t):iD,{useDebugValue:UOe}=oe,{useSyncExternalStoreWithSelector:WOe}=yJ,GOe=t=>t;function tW(t,e=GOe,n){const r=WOe(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return UOe(r),r}const aD=(t,e)=>{const n=VOe(t),r=(s,i=e)=>tW(n,s,i);return Object.assign(r,n),r},XOe=(t,e)=>t?aD(t,e):aD;function ks(t,e){if(Object.is(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(const[r,s]of t)if(!Object.is(s,e.get(r)))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(const r of t)if(!e.has(r))return!1;return!0}const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(e,r)||!Object.is(t[r],e[r]))return!1;return!0}var YOe={value:()=>{}};function Zb(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new _v(n)}function _v(t){this._=t}function KOe(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",s=n.indexOf(".");if(s>=0&&(r=n.slice(s+1),n=n.slice(0,s)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}_v.prototype=Zb.prototype={constructor:_v,on:function(t,e){var n=this._,r=KOe(t+"",n),s,i=-1,a=r.length;if(arguments.length<2){for(;++i<a;)if((s=(t=r[i]).type)&&(s=ZOe(n[s],t.name)))return s;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++i<a;)if(s=(t=r[i]).type)n[s]=oD(n[s],t.name,e);else if(e==null)for(s in n)n[s]=oD(n[s],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new _v(t)},call:function(t,e){if((s=arguments.length-2)>0)for(var n=new Array(s),r=0,s,i;r<s;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(i=this._[t],r=0,s=i.length;r<s;++r)i[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],s=0,i=r.length;s<i;++s)r[s].value.apply(e,n)}};function ZOe(t,e){for(var n=0,r=t.length,s;n<r;++n)if((s=t[n]).name===e)return s.value}function oD(t,e,n){for(var r=0,s=t.length;r<s;++r)if(t[r].name===e){t[r]=YOe,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var ZO="http://www.w3.org/1999/xhtml";const lD={svg:"http://www.w3.org/2000/svg",xhtml:ZO,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Jb(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),lD.hasOwnProperty(e)?{space:lD[e],local:t}:t}function JOe(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===ZO&&e.documentElement.namespaceURI===ZO?e.createElement(t):e.createElementNS(n,t)}}function eje(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function nW(t){var e=Jb(t);return(e.local?eje:JOe)(e)}function tje(){}function KN(t){return t==null?tje:function(){return this.querySelector(t)}}function nje(t){typeof t!="function"&&(t=KN(t));for(var e=this._groups,n=e.length,r=new Array(n),s=0;s<n;++s)for(var i=e[s],a=i.length,l=r[s]=new Array(a),c,d,h=0;h<a;++h)(c=i[h])&&(d=t.call(c,c.__data__,h,i))&&("__data__"in c&&(d.__data__=c.__data__),l[h]=d);return new ea(r,this._parents)}function rje(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function sje(){return[]}function rW(t){return t==null?sje:function(){return this.querySelectorAll(t)}}function ije(t){return function(){return rje(t.apply(this,arguments))}}function aje(t){typeof t=="function"?t=ije(t):t=rW(t);for(var e=this._groups,n=e.length,r=[],s=[],i=0;i<n;++i)for(var a=e[i],l=a.length,c,d=0;d<l;++d)(c=a[d])&&(r.push(t.call(c,c.__data__,d,a)),s.push(c));return new ea(r,s)}function sW(t){return function(){return this.matches(t)}}function iW(t){return function(e){return e.matches(t)}}var oje=Array.prototype.find;function lje(t){return function(){return oje.call(this.children,t)}}function cje(){return this.firstElementChild}function uje(t){return this.select(t==null?cje:lje(typeof t=="function"?t:iW(t)))}var dje=Array.prototype.filter;function hje(){return Array.from(this.children)}function fje(t){return function(){return dje.call(this.children,t)}}function mje(t){return this.selectAll(t==null?hje:fje(typeof t=="function"?t:iW(t)))}function pje(t){typeof t!="function"&&(t=sW(t));for(var e=this._groups,n=e.length,r=new Array(n),s=0;s<n;++s)for(var i=e[s],a=i.length,l=r[s]=[],c,d=0;d<a;++d)(c=i[d])&&t.call(c,c.__data__,d,i)&&l.push(c);return new ea(r,this._parents)}function aW(t){return new Array(t.length)}function gje(){return new ea(this._enter||this._groups.map(aW),this._parents)}function My(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}My.prototype={constructor:My,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function xje(t){return function(){return t}}function vje(t,e,n,r,s,i){for(var a=0,l,c=e.length,d=i.length;a<d;++a)(l=e[a])?(l.__data__=i[a],r[a]=l):n[a]=new My(t,i[a]);for(;a<c;++a)(l=e[a])&&(s[a]=l)}function yje(t,e,n,r,s,i,a){var l,c,d=new Map,h=e.length,m=i.length,g=new Array(h),x;for(l=0;l<h;++l)(c=e[l])&&(g[l]=x=a.call(c,c.__data__,l,e)+"",d.has(x)?s[l]=c:d.set(x,c));for(l=0;l<m;++l)x=a.call(t,i[l],l,i)+"",(c=d.get(x))?(r[l]=c,c.__data__=i[l],d.delete(x)):n[l]=new My(t,i[l]);for(l=0;l<h;++l)(c=e[l])&&d.get(g[l])===c&&(s[l]=c)}function bje(t){return t.__data__}function wje(t,e){if(!arguments.length)return Array.from(this,bje);var n=e?yje:vje,r=this._parents,s=this._groups;typeof t!="function"&&(t=xje(t));for(var i=s.length,a=new Array(i),l=new Array(i),c=new Array(i),d=0;d<i;++d){var h=r[d],m=s[d],g=m.length,x=Sje(t.call(h,h&&h.__data__,d,r)),y=x.length,w=l[d]=new Array(y),S=a[d]=new Array(y),k=c[d]=new Array(g);n(h,m,w,S,k,x,e);for(var j=0,N=0,T,E;j<y;++j)if(T=w[j]){for(j>=N&&(N=j+1);!(E=S[N])&&++N<y;);T._next=E||null}}return a=new ea(a,r),a._enter=l,a._exit=c,a}function Sje(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function kje(){return new ea(this._exit||this._groups.map(aW),this._parents)}function Oje(t,e,n){var r=this.enter(),s=this,i=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(s=e(s),s&&(s=s.selection())),n==null?i.remove():n(i),r&&s?r.merge(s).order():s}function jje(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,s=n.length,i=r.length,a=Math.min(s,i),l=new Array(s),c=0;c<a;++c)for(var d=n[c],h=r[c],m=d.length,g=l[c]=new Array(m),x,y=0;y<m;++y)(x=d[y]||h[y])&&(g[y]=x);for(;c<s;++c)l[c]=n[c];return new ea(l,this._parents)}function Nje(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],s=r.length-1,i=r[s],a;--s>=0;)(a=r[s])&&(i&&a.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(a,i),i=a);return this}function Cje(t){t||(t=Tje);function e(m,g){return m&&g?t(m.__data__,g.__data__):!m-!g}for(var n=this._groups,r=n.length,s=new Array(r),i=0;i<r;++i){for(var a=n[i],l=a.length,c=s[i]=new Array(l),d,h=0;h<l;++h)(d=a[h])&&(c[h]=d);c.sort(e)}return new ea(s,this._parents).order()}function Tje(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Eje(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function _je(){return Array.from(this)}function Aje(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],s=0,i=r.length;s<i;++s){var a=r[s];if(a)return a}return null}function Mje(){let t=0;for(const e of this)++t;return t}function Rje(){return!this.node()}function Dje(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var s=e[n],i=0,a=s.length,l;i<a;++i)(l=s[i])&&t.call(l,l.__data__,i,s);return this}function Pje(t){return function(){this.removeAttribute(t)}}function zje(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Ije(t,e){return function(){this.setAttribute(t,e)}}function Lje(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Bje(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function Fje(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function qje(t,e){var n=Jb(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?zje:Pje:typeof e=="function"?n.local?Fje:Bje:n.local?Lje:Ije)(n,e))}function oW(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function $je(t){return function(){this.style.removeProperty(t)}}function Hje(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Qje(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function Vje(t,e,n){return arguments.length>1?this.each((e==null?$je:typeof e=="function"?Qje:Hje)(t,e,n??"")):mf(this.node(),t)}function mf(t,e){return t.style.getPropertyValue(e)||oW(t).getComputedStyle(t,null).getPropertyValue(e)}function Uje(t){return function(){delete this[t]}}function Wje(t,e){return function(){this[t]=e}}function Gje(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function Xje(t,e){return arguments.length>1?this.each((e==null?Uje:typeof e=="function"?Gje:Wje)(t,e)):this.node()[t]}function lW(t){return t.trim().split(/^|\s+/)}function ZN(t){return t.classList||new cW(t)}function cW(t){this._node=t,this._names=lW(t.getAttribute("class")||"")}cW.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function uW(t,e){for(var n=ZN(t),r=-1,s=e.length;++r<s;)n.add(e[r])}function dW(t,e){for(var n=ZN(t),r=-1,s=e.length;++r<s;)n.remove(e[r])}function Yje(t){return function(){uW(this,t)}}function Kje(t){return function(){dW(this,t)}}function Zje(t,e){return function(){(e.apply(this,arguments)?uW:dW)(this,t)}}function Jje(t,e){var n=lW(t+"");if(arguments.length<2){for(var r=ZN(this.node()),s=-1,i=n.length;++s<i;)if(!r.contains(n[s]))return!1;return!0}return this.each((typeof e=="function"?Zje:e?Yje:Kje)(n,e))}function e6e(){this.textContent=""}function t6e(t){return function(){this.textContent=t}}function n6e(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function r6e(t){return arguments.length?this.each(t==null?e6e:(typeof t=="function"?n6e:t6e)(t)):this.node().textContent}function s6e(){this.innerHTML=""}function i6e(t){return function(){this.innerHTML=t}}function a6e(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function o6e(t){return arguments.length?this.each(t==null?s6e:(typeof t=="function"?a6e:i6e)(t)):this.node().innerHTML}function l6e(){this.nextSibling&&this.parentNode.appendChild(this)}function c6e(){return this.each(l6e)}function u6e(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function d6e(){return this.each(u6e)}function h6e(t){var e=typeof t=="function"?t:nW(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function f6e(){return null}function m6e(t,e){var n=typeof t=="function"?t:nW(t),r=e==null?f6e:typeof e=="function"?e:KN(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function p6e(){var t=this.parentNode;t&&t.removeChild(this)}function g6e(){return this.each(p6e)}function x6e(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function v6e(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function y6e(t){return this.select(t?v6e:x6e)}function b6e(t){return arguments.length?this.property("__data__",t):this.node().__data__}function w6e(t){return function(e){t.call(this,e,this.__data__)}}function S6e(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function k6e(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,s=e.length,i;n<s;++n)i=e[n],(!t.type||i.type===t.type)&&i.name===t.name?this.removeEventListener(i.type,i.listener,i.options):e[++r]=i;++r?e.length=r:delete this.__on}}}function O6e(t,e,n){return function(){var r=this.__on,s,i=w6e(e);if(r){for(var a=0,l=r.length;a<l;++a)if((s=r[a]).type===t.type&&s.name===t.name){this.removeEventListener(s.type,s.listener,s.options),this.addEventListener(s.type,s.listener=i,s.options=n),s.value=e;return}}this.addEventListener(t.type,i,n),s={type:t.type,name:t.name,value:e,listener:i,options:n},r?r.push(s):this.__on=[s]}}function j6e(t,e,n){var r=S6e(t+""),s,i=r.length,a;if(arguments.length<2){var l=this.node().__on;if(l){for(var c=0,d=l.length,h;c<d;++c)for(s=0,h=l[c];s<i;++s)if((a=r[s]).type===h.type&&a.name===h.name)return h.value}return}for(l=e?O6e:k6e,s=0;s<i;++s)this.each(l(r[s],e,n));return this}function hW(t,e,n){var r=oW(t),s=r.CustomEvent;typeof s=="function"?s=new s(e,n):(s=r.document.createEvent("Event"),n?(s.initEvent(e,n.bubbles,n.cancelable),s.detail=n.detail):s.initEvent(e,!1,!1)),t.dispatchEvent(s)}function N6e(t,e){return function(){return hW(this,t,e)}}function C6e(t,e){return function(){return hW(this,t,e.apply(this,arguments))}}function T6e(t,e){return this.each((typeof e=="function"?C6e:N6e)(t,e))}function*E6e(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],s=0,i=r.length,a;s<i;++s)(a=r[s])&&(yield a)}var fW=[null];function ea(t,e){this._groups=t,this._parents=e}function Sg(){return new ea([[document.documentElement]],fW)}function _6e(){return this}ea.prototype=Sg.prototype={constructor:ea,select:nje,selectAll:aje,selectChild:uje,selectChildren:mje,filter:pje,data:wje,enter:gje,exit:kje,join:Oje,merge:jje,selection:_6e,order:Nje,sort:Cje,call:Eje,nodes:_je,node:Aje,size:Mje,empty:Rje,each:Dje,attr:qje,style:Vje,property:Xje,classed:Jje,text:r6e,html:o6e,raise:c6e,lower:d6e,append:h6e,insert:m6e,remove:g6e,clone:y6e,datum:b6e,on:j6e,dispatch:T6e,[Symbol.iterator]:E6e};function va(t){return typeof t=="string"?new ea([[document.querySelector(t)]],[document.documentElement]):new ea([[t]],fW)}function A6e(t){let e;for(;e=t.sourceEvent;)t=e;return t}function Qa(t,e){if(t=A6e(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]}if(e.getBoundingClientRect){var s=e.getBoundingClientRect();return[t.clientX-s.left-e.clientLeft,t.clientY-s.top-e.clientTop]}}return[t.pageX,t.pageY]}const M6e={passive:!1},kp={capture:!0,passive:!1};function d5(t){t.stopImmediatePropagation()}function Qh(t){t.preventDefault(),t.stopImmediatePropagation()}function mW(t){var e=t.document.documentElement,n=va(t).on("dragstart.drag",Qh,kp);"onselectstart"in e?n.on("selectstart.drag",Qh,kp):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function pW(t,e){var n=t.document.documentElement,r=va(t).on("dragstart.drag",null);e&&(r.on("click.drag",Qh,kp),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const V1=t=>()=>t;function JO(t,{sourceEvent:e,subject:n,target:r,identifier:s,active:i,x:a,y:l,dx:c,dy:d,dispatch:h}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:h}})}JO.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function R6e(t){return!t.ctrlKey&&!t.button}function D6e(){return this.parentNode}function P6e(t,e){return e??{x:t.x,y:t.y}}function z6e(){return navigator.maxTouchPoints||"ontouchstart"in this}function I6e(){var t=R6e,e=D6e,n=P6e,r=z6e,s={},i=Zb("start","drag","end"),a=0,l,c,d,h,m=0;function g(T){T.on("mousedown.drag",x).filter(r).on("touchstart.drag",S).on("touchmove.drag",k,M6e).on("touchend.drag touchcancel.drag",j).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(T,E){if(!(h||!t.call(this,T,E))){var _=N(this,e.call(this,T,E),T,E,"mouse");_&&(va(T.view).on("mousemove.drag",y,kp).on("mouseup.drag",w,kp),mW(T.view),d5(T),d=!1,l=T.clientX,c=T.clientY,_("start",T))}}function y(T){if(Qh(T),!d){var E=T.clientX-l,_=T.clientY-c;d=E*E+_*_>m}s.mouse("drag",T)}function w(T){va(T.view).on("mousemove.drag mouseup.drag",null),pW(T.view,d),Qh(T),s.mouse("end",T)}function S(T,E){if(t.call(this,T,E)){var _=T.changedTouches,A=e.call(this,T,E),D=_.length,q,B;for(q=0;q<D;++q)(B=N(this,A,T,E,_[q].identifier,_[q]))&&(d5(T),B("start",T,_[q]))}}function k(T){var E=T.changedTouches,_=E.length,A,D;for(A=0;A<_;++A)(D=s[E[A].identifier])&&(Qh(T),D("drag",T,E[A]))}function j(T){var E=T.changedTouches,_=E.length,A,D;for(h&&clearTimeout(h),h=setTimeout(function(){h=null},500),A=0;A<_;++A)(D=s[E[A].identifier])&&(d5(T),D("end",T,E[A]))}function N(T,E,_,A,D,q){var B=i.copy(),H=Qa(q||_,E),W,ee,I;if((I=n.call(T,new JO("beforestart",{sourceEvent:_,target:g,identifier:D,active:a,x:H[0],y:H[1],dx:0,dy:0,dispatch:B}),A))!=null)return W=I.x-H[0]||0,ee=I.y-H[1]||0,function V(L,$,K){var Y=H,R;switch(L){case"start":s[D]=V,R=a++;break;case"end":delete s[D],--a;case"drag":H=Qa(K||$,E),R=a;break}B.call(L,T,new JO(L,{sourceEvent:$,subject:I,target:g,identifier:D,active:R,x:H[0]+W,y:H[1]+ee,dx:H[0]-Y[0],dy:H[1]-Y[1],dispatch:B}),A)}}return g.filter=function(T){return arguments.length?(t=typeof T=="function"?T:V1(!!T),g):t},g.container=function(T){return arguments.length?(e=typeof T=="function"?T:V1(T),g):e},g.subject=function(T){return arguments.length?(n=typeof T=="function"?T:V1(T),g):n},g.touchable=function(T){return arguments.length?(r=typeof T=="function"?T:V1(!!T),g):r},g.on=function(){var T=i.on.apply(i,arguments);return T===i?g:T},g.clickDistance=function(T){return arguments.length?(m=(T=+T)*T,g):Math.sqrt(m)},g}var pf=0,m0=0,n0=0,gW=1e3,Ry,p0,Dy=0,xd=0,ew=0,Op=typeof performance=="object"&&performance.now?performance:Date,xW=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function JN(){return xd||(xW(L6e),xd=Op.now()+ew)}function L6e(){xd=0}function Py(){this._call=this._time=this._next=null}Py.prototype=vW.prototype={constructor:Py,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?JN():+n)+(e==null?0:+e),!this._next&&p0!==this&&(p0?p0._next=this:Ry=this,p0=this),this._call=t,this._time=n,ej()},stop:function(){this._call&&(this._call=null,this._time=1/0,ej())}};function vW(t,e,n){var r=new Py;return r.restart(t,e,n),r}function B6e(){JN(),++pf;for(var t=Ry,e;t;)(e=xd-t._time)>=0&&t._call.call(void 0,e),t=t._next;--pf}function cD(){xd=(Dy=Op.now())+ew,pf=m0=0;try{B6e()}finally{pf=0,q6e(),xd=0}}function F6e(){var t=Op.now(),e=t-Dy;e>gW&&(ew-=e,Dy=t)}function q6e(){for(var t,e=Ry,n,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Ry=n);p0=t,ej(r)}function ej(t){if(!pf){m0&&(m0=clearTimeout(m0));var e=t-xd;e>24?(t<1/0&&(m0=setTimeout(cD,t-Op.now()-ew)),n0&&(n0=clearInterval(n0))):(n0||(Dy=Op.now(),n0=setInterval(F6e,gW)),pf=1,xW(cD))}}function uD(t,e,n){var r=new Py;return e=e==null?0:+e,r.restart(s=>{r.stop(),t(s+e)},e,n),r}var $6e=Zb("start","end","cancel","interrupt"),H6e=[],yW=0,dD=1,tj=2,Av=3,hD=4,nj=5,Mv=6;function tw(t,e,n,r,s,i){var a=t.__transition;if(!a)t.__transition={};else if(n in a)return;Q6e(t,n,{name:e,index:r,group:s,on:$6e,tween:H6e,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:yW})}function e7(t,e){var n=oo(t,e);if(n.state>yW)throw new Error("too late; already scheduled");return n}function Ko(t,e){var n=oo(t,e);if(n.state>Av)throw new Error("too late; already running");return n}function oo(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Q6e(t,e,n){var r=t.__transition,s;r[e]=n,n.timer=vW(i,0,n.time);function i(d){n.state=dD,n.timer.restart(a,n.delay,n.time),n.delay<=d&&a(d-n.delay)}function a(d){var h,m,g,x;if(n.state!==dD)return c();for(h in r)if(x=r[h],x.name===n.name){if(x.state===Av)return uD(a);x.state===hD?(x.state=Mv,x.timer.stop(),x.on.call("interrupt",t,t.__data__,x.index,x.group),delete r[h]):+h<e&&(x.state=Mv,x.timer.stop(),x.on.call("cancel",t,t.__data__,x.index,x.group),delete r[h])}if(uD(function(){n.state===Av&&(n.state=hD,n.timer.restart(l,n.delay,n.time),l(d))}),n.state=tj,n.on.call("start",t,t.__data__,n.index,n.group),n.state===tj){for(n.state=Av,s=new Array(g=n.tween.length),h=0,m=-1;h<g;++h)(x=n.tween[h].value.call(t,t.__data__,n.index,n.group))&&(s[++m]=x);s.length=m+1}}function l(d){for(var h=d<n.duration?n.ease.call(null,d/n.duration):(n.timer.restart(c),n.state=nj,1),m=-1,g=s.length;++m<g;)s[m].call(t,h);n.state===nj&&(n.on.call("end",t,t.__data__,n.index,n.group),c())}function c(){n.state=Mv,n.timer.stop(),delete r[e];for(var d in r)return;delete t.__transition}}function Rv(t,e){var n=t.__transition,r,s,i=!0,a;if(n){e=e==null?null:e+"";for(a in n){if((r=n[a]).name!==e){i=!1;continue}s=r.state>tj&&r.state<nj,r.state=Mv,r.timer.stop(),r.on.call(s?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[a]}i&&delete t.__transition}}function V6e(t){return this.each(function(){Rv(this,t)})}function U6e(t,e){var n,r;return function(){var s=Ko(this,t),i=s.tween;if(i!==n){r=n=i;for(var a=0,l=r.length;a<l;++a)if(r[a].name===e){r=r.slice(),r.splice(a,1);break}}s.tween=r}}function W6e(t,e,n){var r,s;if(typeof n!="function")throw new Error;return function(){var i=Ko(this,t),a=i.tween;if(a!==r){s=(r=a).slice();for(var l={name:e,value:n},c=0,d=s.length;c<d;++c)if(s[c].name===e){s[c]=l;break}c===d&&s.push(l)}i.tween=s}}function G6e(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=oo(this.node(),n).tween,s=0,i=r.length,a;s<i;++s)if((a=r[s]).name===t)return a.value;return null}return this.each((e==null?U6e:W6e)(n,t,e))}function t7(t,e,n){var r=t._id;return t.each(function(){var s=Ko(this,r);(s.value||(s.value={}))[e]=n.apply(this,arguments)}),function(s){return oo(s,r).value[e]}}function bW(t,e){var n;return(typeof e=="number"?LJ:e instanceof O9?k9:(n=O9(e))?(e=n,k9):BJ)(t,e)}function X6e(t){return function(){this.removeAttribute(t)}}function Y6e(t){return function(){this.removeAttributeNS(t.space,t.local)}}function K6e(t,e,n){var r,s=n+"",i;return function(){var a=this.getAttribute(t);return a===s?null:a===r?i:i=e(r=a,n)}}function Z6e(t,e,n){var r,s=n+"",i;return function(){var a=this.getAttributeNS(t.space,t.local);return a===s?null:a===r?i:i=e(r=a,n)}}function J6e(t,e,n){var r,s,i;return function(){var a,l=n(this),c;return l==null?void this.removeAttribute(t):(a=this.getAttribute(t),c=l+"",a===c?null:a===r&&c===s?i:(s=c,i=e(r=a,l)))}}function eNe(t,e,n){var r,s,i;return function(){var a,l=n(this),c;return l==null?void this.removeAttributeNS(t.space,t.local):(a=this.getAttributeNS(t.space,t.local),c=l+"",a===c?null:a===r&&c===s?i:(s=c,i=e(r=a,l)))}}function tNe(t,e){var n=Jb(t),r=n==="transform"?FJ:bW;return this.attrTween(t,typeof e=="function"?(n.local?eNe:J6e)(n,r,t7(this,"attr."+t,e)):e==null?(n.local?Y6e:X6e)(n):(n.local?Z6e:K6e)(n,r,e))}function nNe(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function rNe(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function sNe(t,e){var n,r;function s(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&rNe(t,i)),n}return s._value=e,s}function iNe(t,e){var n,r;function s(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&nNe(t,i)),n}return s._value=e,s}function aNe(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var r=Jb(t);return this.tween(n,(r.local?sNe:iNe)(r,e))}function oNe(t,e){return function(){e7(this,t).delay=+e.apply(this,arguments)}}function lNe(t,e){return e=+e,function(){e7(this,t).delay=e}}function cNe(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?oNe:lNe)(e,t)):oo(this.node(),e).delay}function uNe(t,e){return function(){Ko(this,t).duration=+e.apply(this,arguments)}}function dNe(t,e){return e=+e,function(){Ko(this,t).duration=e}}function hNe(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?uNe:dNe)(e,t)):oo(this.node(),e).duration}function fNe(t,e){if(typeof e!="function")throw new Error;return function(){Ko(this,t).ease=e}}function mNe(t){var e=this._id;return arguments.length?this.each(fNe(e,t)):oo(this.node(),e).ease}function pNe(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;Ko(this,t).ease=n}}function gNe(t){if(typeof t!="function")throw new Error;return this.each(pNe(this._id,t))}function xNe(t){typeof t!="function"&&(t=sW(t));for(var e=this._groups,n=e.length,r=new Array(n),s=0;s<n;++s)for(var i=e[s],a=i.length,l=r[s]=[],c,d=0;d<a;++d)(c=i[d])&&t.call(c,c.__data__,d,i)&&l.push(c);return new Xl(r,this._parents,this._name,this._id)}function vNe(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,s=n.length,i=Math.min(r,s),a=new Array(r),l=0;l<i;++l)for(var c=e[l],d=n[l],h=c.length,m=a[l]=new Array(h),g,x=0;x<h;++x)(g=c[x]||d[x])&&(m[x]=g);for(;l<r;++l)a[l]=e[l];return new Xl(a,this._parents,this._name,this._id)}function yNe(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function bNe(t,e,n){var r,s,i=yNe(e)?e7:Ko;return function(){var a=i(this,t),l=a.on;l!==r&&(s=(r=l).copy()).on(e,n),a.on=s}}function wNe(t,e){var n=this._id;return arguments.length<2?oo(this.node(),n).on.on(t):this.each(bNe(n,t,e))}function SNe(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function kNe(){return this.on("end.remove",SNe(this._id))}function ONe(t){var e=this._name,n=this._id;typeof t!="function"&&(t=KN(t));for(var r=this._groups,s=r.length,i=new Array(s),a=0;a<s;++a)for(var l=r[a],c=l.length,d=i[a]=new Array(c),h,m,g=0;g<c;++g)(h=l[g])&&(m=t.call(h,h.__data__,g,l))&&("__data__"in h&&(m.__data__=h.__data__),d[g]=m,tw(d[g],e,n,g,d,oo(h,n)));return new Xl(i,this._parents,e,n)}function jNe(t){var e=this._name,n=this._id;typeof t!="function"&&(t=rW(t));for(var r=this._groups,s=r.length,i=[],a=[],l=0;l<s;++l)for(var c=r[l],d=c.length,h,m=0;m<d;++m)if(h=c[m]){for(var g=t.call(h,h.__data__,m,c),x,y=oo(h,n),w=0,S=g.length;w<S;++w)(x=g[w])&&tw(x,e,n,w,g,y);i.push(g),a.push(h)}return new Xl(i,a,e,n)}var NNe=Sg.prototype.constructor;function CNe(){return new NNe(this._groups,this._parents)}function TNe(t,e){var n,r,s;return function(){var i=mf(this,t),a=(this.style.removeProperty(t),mf(this,t));return i===a?null:i===n&&a===r?s:s=e(n=i,r=a)}}function wW(t){return function(){this.style.removeProperty(t)}}function ENe(t,e,n){var r,s=n+"",i;return function(){var a=mf(this,t);return a===s?null:a===r?i:i=e(r=a,n)}}function _Ne(t,e,n){var r,s,i;return function(){var a=mf(this,t),l=n(this),c=l+"";return l==null&&(c=l=(this.style.removeProperty(t),mf(this,t))),a===c?null:a===r&&c===s?i:(s=c,i=e(r=a,l))}}function ANe(t,e){var n,r,s,i="style."+e,a="end."+i,l;return function(){var c=Ko(this,t),d=c.on,h=c.value[i]==null?l||(l=wW(e)):void 0;(d!==n||s!==h)&&(r=(n=d).copy()).on(a,s=h),c.on=r}}function MNe(t,e,n){var r=(t+="")=="transform"?qJ:bW;return e==null?this.styleTween(t,TNe(t,r)).on("end.style."+t,wW(t)):typeof e=="function"?this.styleTween(t,_Ne(t,r,t7(this,"style."+t,e))).each(ANe(this._id,t)):this.styleTween(t,ENe(t,r,e),n).on("end.style."+t,null)}function RNe(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function DNe(t,e,n){var r,s;function i(){var a=e.apply(this,arguments);return a!==s&&(r=(s=a)&&RNe(t,a,n)),r}return i._value=e,i}function PNe(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;return this.tween(r,DNe(t,e,n??""))}function zNe(t){return function(){this.textContent=t}}function INe(t){return function(){var e=t(this);this.textContent=e??""}}function LNe(t){return this.tween("text",typeof t=="function"?INe(t7(this,"text",t)):zNe(t==null?"":t+""))}function BNe(t){return function(e){this.textContent=t.call(this,e)}}function FNe(t){var e,n;function r(){var s=t.apply(this,arguments);return s!==n&&(e=(n=s)&&BNe(s)),e}return r._value=t,r}function qNe(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,FNe(t))}function $Ne(){for(var t=this._name,e=this._id,n=SW(),r=this._groups,s=r.length,i=0;i<s;++i)for(var a=r[i],l=a.length,c,d=0;d<l;++d)if(c=a[d]){var h=oo(c,e);tw(c,t,n,d,a,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new Xl(r,this._parents,t,n)}function HNe(){var t,e,n=this,r=n._id,s=n.size();return new Promise(function(i,a){var l={value:a},c={value:function(){--s===0&&i()}};n.each(function(){var d=Ko(this,r),h=d.on;h!==t&&(e=(t=h).copy(),e._.cancel.push(l),e._.interrupt.push(l),e._.end.push(c)),d.on=e}),s===0&&i()})}var QNe=0;function Xl(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function SW(){return++QNe}var Ol=Sg.prototype;Xl.prototype={constructor:Xl,select:ONe,selectAll:jNe,selectChild:Ol.selectChild,selectChildren:Ol.selectChildren,filter:xNe,merge:vNe,selection:CNe,transition:$Ne,call:Ol.call,nodes:Ol.nodes,node:Ol.node,size:Ol.size,empty:Ol.empty,each:Ol.each,on:wNe,attr:tNe,attrTween:aNe,style:MNe,styleTween:PNe,text:LNe,textTween:qNe,remove:kNe,tween:G6e,delay:cNe,duration:hNe,ease:mNe,easeVarying:gNe,end:HNe,[Symbol.iterator]:Ol[Symbol.iterator]};function VNe(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var UNe={time:null,delay:0,duration:250,ease:VNe};function WNe(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function GNe(t){var e,n;t instanceof Xl?(e=t._id,t=t._name):(e=SW(),(n=UNe).time=JN(),t=t==null?null:t+"");for(var r=this._groups,s=r.length,i=0;i<s;++i)for(var a=r[i],l=a.length,c,d=0;d<l;++d)(c=a[d])&&tw(c,t,e,d,a,n||WNe(c,e));return new Xl(r,this._parents,t,e)}Sg.prototype.interrupt=V6e;Sg.prototype.transition=GNe;const U1=t=>()=>t;function XNe(t,{sourceEvent:e,target:n,transform:r,dispatch:s}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function zl(t,e,n){this.k=t,this.x=e,this.y=n}zl.prototype={constructor:zl,scale:function(t){return t===1?this:new zl(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new zl(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var $l=new zl(1,0,0);zl.prototype;function h5(t){t.stopImmediatePropagation()}function r0(t){t.preventDefault(),t.stopImmediatePropagation()}function YNe(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function KNe(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function fD(){return this.__zoom||$l}function ZNe(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function JNe(){return navigator.maxTouchPoints||"ontouchstart"in this}function e7e(t,e,n){var r=t.invertX(e[0][0])-n[0][0],s=t.invertX(e[1][0])-n[1][0],i=t.invertY(e[0][1])-n[0][1],a=t.invertY(e[1][1])-n[1][1];return t.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function kW(){var t=YNe,e=KNe,n=e7e,r=ZNe,s=JNe,i=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],l=250,c=$J,d=Zb("start","zoom","end"),h,m,g,x=500,y=150,w=0,S=10;function k(I){I.property("__zoom",fD).on("wheel.zoom",D,{passive:!1}).on("mousedown.zoom",q).on("dblclick.zoom",B).filter(s).on("touchstart.zoom",H).on("touchmove.zoom",W).on("touchend.zoom touchcancel.zoom",ee).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}k.transform=function(I,V,L,$){var K=I.selection?I.selection():I;K.property("__zoom",fD),I!==K?E(I,V,L,$):K.interrupt().each(function(){_(this,arguments).event($).start().zoom(null,typeof V=="function"?V.apply(this,arguments):V).end()})},k.scaleBy=function(I,V,L,$){k.scaleTo(I,function(){var K=this.__zoom.k,Y=typeof V=="function"?V.apply(this,arguments):V;return K*Y},L,$)},k.scaleTo=function(I,V,L,$){k.transform(I,function(){var K=e.apply(this,arguments),Y=this.__zoom,R=L==null?T(K):typeof L=="function"?L.apply(this,arguments):L,ie=Y.invert(R),X=typeof V=="function"?V.apply(this,arguments):V;return n(N(j(Y,X),R,ie),K,a)},L,$)},k.translateBy=function(I,V,L,$){k.transform(I,function(){return n(this.__zoom.translate(typeof V=="function"?V.apply(this,arguments):V,typeof L=="function"?L.apply(this,arguments):L),e.apply(this,arguments),a)},null,$)},k.translateTo=function(I,V,L,$,K){k.transform(I,function(){var Y=e.apply(this,arguments),R=this.__zoom,ie=$==null?T(Y):typeof $=="function"?$.apply(this,arguments):$;return n($l.translate(ie[0],ie[1]).scale(R.k).translate(typeof V=="function"?-V.apply(this,arguments):-V,typeof L=="function"?-L.apply(this,arguments):-L),Y,a)},$,K)};function j(I,V){return V=Math.max(i[0],Math.min(i[1],V)),V===I.k?I:new zl(V,I.x,I.y)}function N(I,V,L){var $=V[0]-L[0]*I.k,K=V[1]-L[1]*I.k;return $===I.x&&K===I.y?I:new zl(I.k,$,K)}function T(I){return[(+I[0][0]+ +I[1][0])/2,(+I[0][1]+ +I[1][1])/2]}function E(I,V,L,$){I.on("start.zoom",function(){_(this,arguments).event($).start()}).on("interrupt.zoom end.zoom",function(){_(this,arguments).event($).end()}).tween("zoom",function(){var K=this,Y=arguments,R=_(K,Y).event($),ie=e.apply(K,Y),X=L==null?T(ie):typeof L=="function"?L.apply(K,Y):L,z=Math.max(ie[1][0]-ie[0][0],ie[1][1]-ie[0][1]),U=K.__zoom,te=typeof V=="function"?V.apply(K,Y):V,ne=c(U.invert(X).concat(z/U.k),te.invert(X).concat(z/te.k));return function(G){if(G===1)G=te;else{var se=ne(G),re=z/se[2];G=new zl(re,X[0]-se[0]*re,X[1]-se[1]*re)}R.zoom(null,G)}})}function _(I,V,L){return!L&&I.__zooming||new A(I,V)}function A(I,V){this.that=I,this.args=V,this.active=0,this.sourceEvent=null,this.extent=e.apply(I,V),this.taps=0}A.prototype={event:function(I){return I&&(this.sourceEvent=I),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(I,V){return this.mouse&&I!=="mouse"&&(this.mouse[1]=V.invert(this.mouse[0])),this.touch0&&I!=="touch"&&(this.touch0[1]=V.invert(this.touch0[0])),this.touch1&&I!=="touch"&&(this.touch1[1]=V.invert(this.touch1[0])),this.that.__zoom=V,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(I){var V=va(this.that).datum();d.call(I,this.that,new XNe(I,{sourceEvent:this.sourceEvent,target:k,transform:this.that.__zoom,dispatch:d}),V)}};function D(I,...V){if(!t.apply(this,arguments))return;var L=_(this,V).event(I),$=this.__zoom,K=Math.max(i[0],Math.min(i[1],$.k*Math.pow(2,r.apply(this,arguments)))),Y=Qa(I);if(L.wheel)(L.mouse[0][0]!==Y[0]||L.mouse[0][1]!==Y[1])&&(L.mouse[1]=$.invert(L.mouse[0]=Y)),clearTimeout(L.wheel);else{if($.k===K)return;L.mouse=[Y,$.invert(Y)],Rv(this),L.start()}r0(I),L.wheel=setTimeout(R,y),L.zoom("mouse",n(N(j($,K),L.mouse[0],L.mouse[1]),L.extent,a));function R(){L.wheel=null,L.end()}}function q(I,...V){if(g||!t.apply(this,arguments))return;var L=I.currentTarget,$=_(this,V,!0).event(I),K=va(I.view).on("mousemove.zoom",X,!0).on("mouseup.zoom",z,!0),Y=Qa(I,L),R=I.clientX,ie=I.clientY;mW(I.view),h5(I),$.mouse=[Y,this.__zoom.invert(Y)],Rv(this),$.start();function X(U){if(r0(U),!$.moved){var te=U.clientX-R,ne=U.clientY-ie;$.moved=te*te+ne*ne>w}$.event(U).zoom("mouse",n(N($.that.__zoom,$.mouse[0]=Qa(U,L),$.mouse[1]),$.extent,a))}function z(U){K.on("mousemove.zoom mouseup.zoom",null),pW(U.view,$.moved),r0(U),$.event(U).end()}}function B(I,...V){if(t.apply(this,arguments)){var L=this.__zoom,$=Qa(I.changedTouches?I.changedTouches[0]:I,this),K=L.invert($),Y=L.k*(I.shiftKey?.5:2),R=n(N(j(L,Y),$,K),e.apply(this,V),a);r0(I),l>0?va(this).transition().duration(l).call(E,R,$,I):va(this).call(k.transform,R,$,I)}}function H(I,...V){if(t.apply(this,arguments)){var L=I.touches,$=L.length,K=_(this,V,I.changedTouches.length===$).event(I),Y,R,ie,X;for(h5(I),R=0;R<$;++R)ie=L[R],X=Qa(ie,this),X=[X,this.__zoom.invert(X),ie.identifier],K.touch0?!K.touch1&&K.touch0[2]!==X[2]&&(K.touch1=X,K.taps=0):(K.touch0=X,Y=!0,K.taps=1+!!h);h&&(h=clearTimeout(h)),Y&&(K.taps<2&&(m=X[0],h=setTimeout(function(){h=null},x)),Rv(this),K.start())}}function W(I,...V){if(this.__zooming){var L=_(this,V).event(I),$=I.changedTouches,K=$.length,Y,R,ie,X;for(r0(I),Y=0;Y<K;++Y)R=$[Y],ie=Qa(R,this),L.touch0&&L.touch0[2]===R.identifier?L.touch0[0]=ie:L.touch1&&L.touch1[2]===R.identifier&&(L.touch1[0]=ie);if(R=L.that.__zoom,L.touch1){var z=L.touch0[0],U=L.touch0[1],te=L.touch1[0],ne=L.touch1[1],G=(G=te[0]-z[0])*G+(G=te[1]-z[1])*G,se=(se=ne[0]-U[0])*se+(se=ne[1]-U[1])*se;R=j(R,Math.sqrt(G/se)),ie=[(z[0]+te[0])/2,(z[1]+te[1])/2],X=[(U[0]+ne[0])/2,(U[1]+ne[1])/2]}else if(L.touch0)ie=L.touch0[0],X=L.touch0[1];else return;L.zoom("touch",n(N(R,ie,X),L.extent,a))}}function ee(I,...V){if(this.__zooming){var L=_(this,V).event(I),$=I.changedTouches,K=$.length,Y,R;for(h5(I),g&&clearTimeout(g),g=setTimeout(function(){g=null},x),Y=0;Y<K;++Y)R=$[Y],L.touch0&&L.touch0[2]===R.identifier?delete L.touch0:L.touch1&&L.touch1[2]===R.identifier&&delete L.touch1;if(L.touch1&&!L.touch0&&(L.touch0=L.touch1,delete L.touch1),L.touch0)L.touch0[1]=this.__zoom.invert(L.touch0[0]);else if(L.end(),L.taps===2&&(R=Qa(R,this),Math.hypot(m[0]-R[0],m[1]-R[1])<S)){var ie=va(this).on("dblclick.zoom");ie&&ie.apply(this,arguments)}}}return k.wheelDelta=function(I){return arguments.length?(r=typeof I=="function"?I:U1(+I),k):r},k.filter=function(I){return arguments.length?(t=typeof I=="function"?I:U1(!!I),k):t},k.touchable=function(I){return arguments.length?(s=typeof I=="function"?I:U1(!!I),k):s},k.extent=function(I){return arguments.length?(e=typeof I=="function"?I:U1([[+I[0][0],+I[0][1]],[+I[1][0],+I[1][1]]]),k):e},k.scaleExtent=function(I){return arguments.length?(i[0]=+I[0],i[1]=+I[1],k):[i[0],i[1]]},k.translateExtent=function(I){return arguments.length?(a[0][0]=+I[0][0],a[1][0]=+I[1][0],a[0][1]=+I[0][1],a[1][1]=+I[1][1],k):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},k.constrain=function(I){return arguments.length?(n=I,k):n},k.duration=function(I){return arguments.length?(l=+I,k):l},k.interpolate=function(I){return arguments.length?(c=I,k):c},k.on=function(){var I=d.on.apply(d,arguments);return I===d?k:I},k.clickDistance=function(I){return arguments.length?(w=(I=+I)*I,k):Math.sqrt(w)},k.tapDistance=function(I){return arguments.length?(S=+I,k):S},k}const nw=b.createContext(null),t7e=nw.Provider,Yl={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:t=>`Node type "${t}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:t=>`The old edge with id=${t} does not exist.`,error009:t=>`Marker type "${t}" doesn't exist.`,error008:(t,e)=>`Couldn't create edge for ${t?"target":"source"} handle id: "${t?e.targetHandle:e.sourceHandle}", edge id: ${e.id}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:t=>`Edge type "${t}" not found. Using fallback type "default".`,error012:t=>`Node with id "${t}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`},OW=Yl.error001();function gr(t,e){const n=b.useContext(nw);if(n===null)throw new Error(OW);return tW(n,t,e)}const gs=()=>{const t=b.useContext(nw);if(t===null)throw new Error(OW);return b.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe,destroy:t.destroy}),[t])},n7e=t=>t.userSelectionActive?"none":"all";function rw({position:t,children:e,className:n,style:r,...s}){const i=gr(n7e),a=`${t}`.split("-");return oe.createElement("div",{className:Ls(["react-flow__panel",n,...a]),style:{...r,pointerEvents:i},...s},e)}function r7e({proOptions:t,position:e="bottom-right"}){return t?.hideAttribution?null:oe.createElement(rw,{position:e,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},oe.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}const s7e=({x:t,y:e,label:n,labelStyle:r={},labelShowBg:s=!0,labelBgStyle:i={},labelBgPadding:a=[2,4],labelBgBorderRadius:l=2,children:c,className:d,...h})=>{const m=b.useRef(null),[g,x]=b.useState({x:0,y:0,width:0,height:0}),y=Ls(["react-flow__edge-textwrapper",d]);return b.useEffect(()=>{if(m.current){const w=m.current.getBBox();x({x:w.x,y:w.y,width:w.width,height:w.height})}},[n]),typeof n>"u"||!n?null:oe.createElement("g",{transform:`translate(${t-g.width/2} ${e-g.height/2})`,className:y,visibility:g.width?"visible":"hidden",...h},s&&oe.createElement("rect",{width:g.width+2*a[0],x:-a[0],y:-a[1],height:g.height+2*a[1],className:"react-flow__edge-textbg",style:i,rx:l,ry:l}),oe.createElement("text",{className:"react-flow__edge-text",y:g.height/2,dy:"0.3em",ref:m,style:r},n),c)};var i7e=b.memo(s7e);const n7=t=>({width:t.offsetWidth,height:t.offsetHeight}),gf=(t,e=0,n=1)=>Math.min(Math.max(t,e),n),r7=(t={x:0,y:0},e)=>({x:gf(t.x,e[0][0],e[1][0]),y:gf(t.y,e[0][1],e[1][1])}),mD=(t,e,n)=>t<e?gf(Math.abs(t-e),1,50)/50:t>n?-gf(Math.abs(t-n),1,50)/50:0,jW=(t,e)=>{const n=mD(t.x,35,e.width-35)*20,r=mD(t.y,35,e.height-35)*20;return[n,r]},NW=t=>t.getRootNode?.()||window?.document,CW=(t,e)=>({x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),x2:Math.max(t.x2,e.x2),y2:Math.max(t.y2,e.y2)}),jp=({x:t,y:e,width:n,height:r})=>({x:t,y:e,x2:t+n,y2:e+r}),TW=({x:t,y:e,x2:n,y2:r})=>({x:t,y:e,width:n-t,height:r-e}),pD=t=>({...t.positionAbsolute||{x:0,y:0},width:t.width||0,height:t.height||0}),a7e=(t,e)=>TW(CW(jp(t),jp(e))),rj=(t,e)=>{const n=Math.max(0,Math.min(t.x+t.width,e.x+e.width)-Math.max(t.x,e.x)),r=Math.max(0,Math.min(t.y+t.height,e.y+e.height)-Math.max(t.y,e.y));return Math.ceil(n*r)},o7e=t=>Ca(t.width)&&Ca(t.height)&&Ca(t.x)&&Ca(t.y),Ca=t=>!isNaN(t)&&isFinite(t),$r=Symbol.for("internals"),EW=["Enter"," ","Escape"],l7e=(t,e)=>{},c7e=t=>"nativeEvent"in t;function sj(t){const n=(c7e(t)?t.nativeEvent:t).composedPath?.()?.[0]||t.target;return["INPUT","SELECT","TEXTAREA"].includes(n?.nodeName)||n?.hasAttribute("contenteditable")||!!n?.closest(".nokey")}const _W=t=>"clientX"in t,Wc=(t,e)=>{const n=_W(t),r=n?t.clientX:t.touches?.[0].clientX,s=n?t.clientY:t.touches?.[0].clientY;return{x:r-(e?.left??0),y:s-(e?.top??0)}},zy=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0,kg=({id:t,path:e,labelX:n,labelY:r,label:s,labelStyle:i,labelShowBg:a,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:d,style:h,markerEnd:m,markerStart:g,interactionWidth:x=20})=>oe.createElement(oe.Fragment,null,oe.createElement("path",{id:t,style:h,d:e,fill:"none",className:"react-flow__edge-path",markerEnd:m,markerStart:g}),x&&oe.createElement("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:x,className:"react-flow__edge-interaction"}),s&&Ca(n)&&Ca(r)?oe.createElement(i7e,{x:n,y:r,label:s,labelStyle:i,labelShowBg:a,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:d}):null);kg.displayName="BaseEdge";function s0(t,e,n){return n===void 0?n:r=>{const s=e().edges.find(i=>i.id===t);s&&n(r,{...s})}}function AW({sourceX:t,sourceY:e,targetX:n,targetY:r}){const s=Math.abs(n-t)/2,i=n<t?n+s:n-s,a=Math.abs(r-e)/2,l=r<e?r+a:r-a;return[i,l,s,a]}function MW({sourceX:t,sourceY:e,targetX:n,targetY:r,sourceControlX:s,sourceControlY:i,targetControlX:a,targetControlY:l}){const c=t*.125+s*.375+a*.375+n*.125,d=e*.125+i*.375+l*.375+r*.125,h=Math.abs(c-t),m=Math.abs(d-e);return[c,d,h,m]}var vd;(function(t){t.Strict="strict",t.Loose="loose"})(vd||(vd={}));var Yu;(function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"})(Yu||(Yu={}));var Np;(function(t){t.Partial="partial",t.Full="full"})(Np||(Np={}));var qc;(function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"})(qc||(qc={}));var Iy;(function(t){t.Arrow="arrow",t.ArrowClosed="arrowclosed"})(Iy||(Iy={}));var kt;(function(t){t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom"})(kt||(kt={}));function gD({pos:t,x1:e,y1:n,x2:r,y2:s}){return t===kt.Left||t===kt.Right?[.5*(e+r),n]:[e,.5*(n+s)]}function RW({sourceX:t,sourceY:e,sourcePosition:n=kt.Bottom,targetX:r,targetY:s,targetPosition:i=kt.Top}){const[a,l]=gD({pos:n,x1:t,y1:e,x2:r,y2:s}),[c,d]=gD({pos:i,x1:r,y1:s,x2:t,y2:e}),[h,m,g,x]=MW({sourceX:t,sourceY:e,targetX:r,targetY:s,sourceControlX:a,sourceControlY:l,targetControlX:c,targetControlY:d});return[`M${t},${e} C${a},${l} ${c},${d} ${r},${s}`,h,m,g,x]}const s7=b.memo(({sourceX:t,sourceY:e,targetX:n,targetY:r,sourcePosition:s=kt.Bottom,targetPosition:i=kt.Top,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:x,markerStart:y,interactionWidth:w})=>{const[S,k,j]=RW({sourceX:t,sourceY:e,sourcePosition:s,targetX:n,targetY:r,targetPosition:i});return oe.createElement(kg,{path:S,labelX:k,labelY:j,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:x,markerStart:y,interactionWidth:w})});s7.displayName="SimpleBezierEdge";const xD={[kt.Left]:{x:-1,y:0},[kt.Right]:{x:1,y:0},[kt.Top]:{x:0,y:-1},[kt.Bottom]:{x:0,y:1}},u7e=({source:t,sourcePosition:e=kt.Bottom,target:n})=>e===kt.Left||e===kt.Right?t.x<n.x?{x:1,y:0}:{x:-1,y:0}:t.y<n.y?{x:0,y:1}:{x:0,y:-1},vD=(t,e)=>Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2));function d7e({source:t,sourcePosition:e=kt.Bottom,target:n,targetPosition:r=kt.Top,center:s,offset:i}){const a=xD[e],l=xD[r],c={x:t.x+a.x*i,y:t.y+a.y*i},d={x:n.x+l.x*i,y:n.y+l.y*i},h=u7e({source:c,sourcePosition:e,target:d}),m=h.x!==0?"x":"y",g=h[m];let x=[],y,w;const S={x:0,y:0},k={x:0,y:0},[j,N,T,E]=AW({sourceX:t.x,sourceY:t.y,targetX:n.x,targetY:n.y});if(a[m]*l[m]===-1){y=s.x??j,w=s.y??N;const A=[{x:y,y:c.y},{x:y,y:d.y}],D=[{x:c.x,y:w},{x:d.x,y:w}];a[m]===g?x=m==="x"?A:D:x=m==="x"?D:A}else{const A=[{x:c.x,y:d.y}],D=[{x:d.x,y:c.y}];if(m==="x"?x=a.x===g?D:A:x=a.y===g?A:D,e===r){const ee=Math.abs(t[m]-n[m]);if(ee<=i){const I=Math.min(i-1,i-ee);a[m]===g?S[m]=(c[m]>t[m]?-1:1)*I:k[m]=(d[m]>n[m]?-1:1)*I}}if(e!==r){const ee=m==="x"?"y":"x",I=a[m]===l[ee],V=c[ee]>d[ee],L=c[ee]<d[ee];(a[m]===1&&(!I&&V||I&&L)||a[m]!==1&&(!I&&L||I&&V))&&(x=m==="x"?A:D)}const q={x:c.x+S.x,y:c.y+S.y},B={x:d.x+k.x,y:d.y+k.y},H=Math.max(Math.abs(q.x-x[0].x),Math.abs(B.x-x[0].x)),W=Math.max(Math.abs(q.y-x[0].y),Math.abs(B.y-x[0].y));H>=W?(y=(q.x+B.x)/2,w=x[0].y):(y=x[0].x,w=(q.y+B.y)/2)}return[[t,{x:c.x+S.x,y:c.y+S.y},...x,{x:d.x+k.x,y:d.y+k.y},n],y,w,T,E]}function h7e(t,e,n,r){const s=Math.min(vD(t,e)/2,vD(e,n)/2,r),{x:i,y:a}=e;if(t.x===i&&i===n.x||t.y===a&&a===n.y)return`L${i} ${a}`;if(t.y===a){const d=t.x<n.x?-1:1,h=t.y<n.y?1:-1;return`L ${i+s*d},${a}Q ${i},${a} ${i},${a+s*h}`}const l=t.x<n.x?1:-1,c=t.y<n.y?-1:1;return`L ${i},${a+s*c}Q ${i},${a} ${i+s*l},${a}`}function ij({sourceX:t,sourceY:e,sourcePosition:n=kt.Bottom,targetX:r,targetY:s,targetPosition:i=kt.Top,borderRadius:a=5,centerX:l,centerY:c,offset:d=20}){const[h,m,g,x,y]=d7e({source:{x:t,y:e},sourcePosition:n,target:{x:r,y:s},targetPosition:i,center:{x:l,y:c},offset:d});return[h.reduce((S,k,j)=>{let N="";return j>0&&j<h.length-1?N=h7e(h[j-1],k,h[j+1],a):N=`${j===0?"M":"L"}${k.x} ${k.y}`,S+=N,S},""),m,g,x,y]}const sw=b.memo(({sourceX:t,sourceY:e,targetX:n,targetY:r,label:s,labelStyle:i,labelShowBg:a,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:d,style:h,sourcePosition:m=kt.Bottom,targetPosition:g=kt.Top,markerEnd:x,markerStart:y,pathOptions:w,interactionWidth:S})=>{const[k,j,N]=ij({sourceX:t,sourceY:e,sourcePosition:m,targetX:n,targetY:r,targetPosition:g,borderRadius:w?.borderRadius,offset:w?.offset});return oe.createElement(kg,{path:k,labelX:j,labelY:N,label:s,labelStyle:i,labelShowBg:a,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:d,style:h,markerEnd:x,markerStart:y,interactionWidth:S})});sw.displayName="SmoothStepEdge";const i7=b.memo(t=>oe.createElement(sw,{...t,pathOptions:b.useMemo(()=>({borderRadius:0,offset:t.pathOptions?.offset}),[t.pathOptions?.offset])}));i7.displayName="StepEdge";function f7e({sourceX:t,sourceY:e,targetX:n,targetY:r}){const[s,i,a,l]=AW({sourceX:t,sourceY:e,targetX:n,targetY:r});return[`M ${t},${e}L ${n},${r}`,s,i,a,l]}const a7=b.memo(({sourceX:t,sourceY:e,targetX:n,targetY:r,label:s,labelStyle:i,labelShowBg:a,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:d,style:h,markerEnd:m,markerStart:g,interactionWidth:x})=>{const[y,w,S]=f7e({sourceX:t,sourceY:e,targetX:n,targetY:r});return oe.createElement(kg,{path:y,labelX:w,labelY:S,label:s,labelStyle:i,labelShowBg:a,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:d,style:h,markerEnd:m,markerStart:g,interactionWidth:x})});a7.displayName="StraightEdge";function W1(t,e){return t>=0?.5*t:e*25*Math.sqrt(-t)}function yD({pos:t,x1:e,y1:n,x2:r,y2:s,c:i}){switch(t){case kt.Left:return[e-W1(e-r,i),n];case kt.Right:return[e+W1(r-e,i),n];case kt.Top:return[e,n-W1(n-s,i)];case kt.Bottom:return[e,n+W1(s-n,i)]}}function DW({sourceX:t,sourceY:e,sourcePosition:n=kt.Bottom,targetX:r,targetY:s,targetPosition:i=kt.Top,curvature:a=.25}){const[l,c]=yD({pos:n,x1:t,y1:e,x2:r,y2:s,c:a}),[d,h]=yD({pos:i,x1:r,y1:s,x2:t,y2:e,c:a}),[m,g,x,y]=MW({sourceX:t,sourceY:e,targetX:r,targetY:s,sourceControlX:l,sourceControlY:c,targetControlX:d,targetControlY:h});return[`M${t},${e} C${l},${c} ${d},${h} ${r},${s}`,m,g,x,y]}const Ly=b.memo(({sourceX:t,sourceY:e,targetX:n,targetY:r,sourcePosition:s=kt.Bottom,targetPosition:i=kt.Top,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:x,markerStart:y,pathOptions:w,interactionWidth:S})=>{const[k,j,N]=DW({sourceX:t,sourceY:e,sourcePosition:s,targetX:n,targetY:r,targetPosition:i,curvature:w?.curvature});return oe.createElement(kg,{path:k,labelX:j,labelY:N,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:x,markerStart:y,interactionWidth:S})});Ly.displayName="BezierEdge";const o7=b.createContext(null),m7e=o7.Provider;o7.Consumer;const p7e=()=>b.useContext(o7),g7e=t=>"id"in t&&"source"in t&&"target"in t,x7e=({source:t,sourceHandle:e,target:n,targetHandle:r})=>`reactflow__edge-${t}${e||""}-${n}${r||""}`,aj=(t,e)=>typeof t>"u"?"":typeof t=="string"?t:`${e?`${e}__`:""}${Object.keys(t).sort().map(r=>`${r}=${t[r]}`).join("&")}`,v7e=(t,e)=>e.some(n=>n.source===t.source&&n.target===t.target&&(n.sourceHandle===t.sourceHandle||!n.sourceHandle&&!t.sourceHandle)&&(n.targetHandle===t.targetHandle||!n.targetHandle&&!t.targetHandle)),y7e=(t,e)=>{if(!t.source||!t.target)return e;let n;return g7e(t)?n={...t}:n={...t,id:x7e(t)},v7e(n,e)?e:e.concat(n)},oj=({x:t,y:e},[n,r,s],i,[a,l])=>{const c={x:(t-n)/s,y:(e-r)/s};return i?{x:a*Math.round(c.x/a),y:l*Math.round(c.y/l)}:c},PW=({x:t,y:e},[n,r,s])=>({x:t*s+n,y:e*s+r}),id=(t,e=[0,0])=>{if(!t)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(t.width??0)*e[0],r=(t.height??0)*e[1],s={x:t.position.x-n,y:t.position.y-r};return{...s,positionAbsolute:t.positionAbsolute?{x:t.positionAbsolute.x-n,y:t.positionAbsolute.y-r}:s}},iw=(t,e=[0,0])=>{if(t.length===0)return{x:0,y:0,width:0,height:0};const n=t.reduce((r,s)=>{const{x:i,y:a}=id(s,e).positionAbsolute;return CW(r,jp({x:i,y:a,width:s.width||0,height:s.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return TW(n)},zW=(t,e,[n,r,s]=[0,0,1],i=!1,a=!1,l=[0,0])=>{const c={x:(e.x-n)/s,y:(e.y-r)/s,width:e.width/s,height:e.height/s},d=[];return t.forEach(h=>{const{width:m,height:g,selectable:x=!0,hidden:y=!1}=h;if(a&&!x||y)return!1;const{positionAbsolute:w}=id(h,l),S={x:w.x,y:w.y,width:m||0,height:g||0},k=rj(c,S),j=typeof m>"u"||typeof g>"u"||m===null||g===null,N=i&&k>0,T=(m||0)*(g||0);(j||N||k>=T||h.dragging)&&d.push(h)}),d},IW=(t,e)=>{const n=t.map(r=>r.id);return e.filter(r=>n.includes(r.source)||n.includes(r.target))},LW=(t,e,n,r,s,i=.1)=>{const a=e/(t.width*(1+i)),l=n/(t.height*(1+i)),c=Math.min(a,l),d=gf(c,r,s),h=t.x+t.width/2,m=t.y+t.height/2,g=e/2-h*d,x=n/2-m*d;return{x:g,y:x,zoom:d}},qu=(t,e=0)=>t.transition().duration(e);function bD(t,e,n,r){return(e[n]||[]).reduce((s,i)=>(`${t.id}-${i.id}-${n}`!==r&&s.push({id:i.id||null,type:n,nodeId:t.id,x:(t.positionAbsolute?.x??0)+i.x+i.width/2,y:(t.positionAbsolute?.y??0)+i.y+i.height/2}),s),[])}function b7e(t,e,n,r,s,i){const{x:a,y:l}=Wc(t),d=e.elementsFromPoint(a,l).find(y=>y.classList.contains("react-flow__handle"));if(d){const y=d.getAttribute("data-nodeid");if(y){const w=l7(void 0,d),S=d.getAttribute("data-handleid"),k=i({nodeId:y,id:S,type:w});if(k){const j=s.find(N=>N.nodeId===y&&N.type===w&&N.id===S);return{handle:{id:S,type:w,nodeId:y,x:j?.x||n.x,y:j?.y||n.y},validHandleResult:k}}}}let h=[],m=1/0;if(s.forEach(y=>{const w=Math.sqrt((y.x-n.x)**2+(y.y-n.y)**2);if(w<=r){const S=i(y);w<=m&&(w<m?h=[{handle:y,validHandleResult:S}]:w===m&&h.push({handle:y,validHandleResult:S}),m=w)}}),!h.length)return{handle:null,validHandleResult:BW()};if(h.length===1)return h[0];const g=h.some(({validHandleResult:y})=>y.isValid),x=h.some(({handle:y})=>y.type==="target");return h.find(({handle:y,validHandleResult:w})=>x?y.type==="target":g?w.isValid:!0)||h[0]}const w7e={source:null,target:null,sourceHandle:null,targetHandle:null},BW=()=>({handleDomNode:null,isValid:!1,connection:w7e,endHandle:null});function FW(t,e,n,r,s,i,a){const l=s==="target",c=a.querySelector(`.react-flow__handle[data-id="${t?.nodeId}-${t?.id}-${t?.type}"]`),d={...BW(),handleDomNode:c};if(c){const h=l7(void 0,c),m=c.getAttribute("data-nodeid"),g=c.getAttribute("data-handleid"),x=c.classList.contains("connectable"),y=c.classList.contains("connectableend"),w={source:l?m:n,sourceHandle:l?g:r,target:l?n:m,targetHandle:l?r:g};d.connection=w,x&&y&&(e===vd.Strict?l&&h==="source"||!l&&h==="target":m!==n||g!==r)&&(d.endHandle={nodeId:m,handleId:g,type:h},d.isValid=i(w))}return d}function S7e({nodes:t,nodeId:e,handleId:n,handleType:r}){return t.reduce((s,i)=>{if(i[$r]){const{handleBounds:a}=i[$r];let l=[],c=[];a&&(l=bD(i,a,"source",`${e}-${n}-${r}`),c=bD(i,a,"target",`${e}-${n}-${r}`)),s.push(...l,...c)}return s},[])}function l7(t,e){return t||(e?.classList.contains("target")?"target":e?.classList.contains("source")?"source":null)}function f5(t){t?.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function k7e(t,e){let n=null;return e?n="valid":t&&!e&&(n="invalid"),n}function qW({event:t,handleId:e,nodeId:n,onConnect:r,isTarget:s,getState:i,setState:a,isValidConnection:l,edgeUpdaterType:c,onReconnectEnd:d}){const h=NW(t.target),{connectionMode:m,domNode:g,autoPanOnConnect:x,connectionRadius:y,onConnectStart:w,panBy:S,getNodes:k,cancelConnection:j}=i();let N=0,T;const{x:E,y:_}=Wc(t),A=h?.elementFromPoint(E,_),D=l7(c,A),q=g?.getBoundingClientRect();if(!q||!D)return;let B,H=Wc(t,q),W=!1,ee=null,I=!1,V=null;const L=S7e({nodes:k(),nodeId:n,handleId:e,handleType:D}),$=()=>{if(!x)return;const[R,ie]=jW(H,q);S({x:R,y:ie}),N=requestAnimationFrame($)};a({connectionPosition:H,connectionStatus:null,connectionNodeId:n,connectionHandleId:e,connectionHandleType:D,connectionStartHandle:{nodeId:n,handleId:e,type:D},connectionEndHandle:null}),w?.(t,{nodeId:n,handleId:e,handleType:D});function K(R){const{transform:ie}=i();H=Wc(R,q);const{handle:X,validHandleResult:z}=b7e(R,h,oj(H,ie,!1,[1,1]),y,L,U=>FW(U,m,n,e,s?"target":"source",l,h));if(T=X,W||($(),W=!0),V=z.handleDomNode,ee=z.connection,I=z.isValid,a({connectionPosition:T&&I?PW({x:T.x,y:T.y},ie):H,connectionStatus:k7e(!!T,I),connectionEndHandle:z.endHandle}),!T&&!I&&!V)return f5(B);ee.source!==ee.target&&V&&(f5(B),B=V,V.classList.add("connecting","react-flow__handle-connecting"),V.classList.toggle("valid",I),V.classList.toggle("react-flow__handle-valid",I))}function Y(R){(T||V)&&ee&&I&&r?.(ee),i().onConnectEnd?.(R),c&&d?.(R),f5(B),j(),cancelAnimationFrame(N),W=!1,I=!1,ee=null,V=null,h.removeEventListener("mousemove",K),h.removeEventListener("mouseup",Y),h.removeEventListener("touchmove",K),h.removeEventListener("touchend",Y)}h.addEventListener("mousemove",K),h.addEventListener("mouseup",Y),h.addEventListener("touchmove",K),h.addEventListener("touchend",Y)}const wD=()=>!0,O7e=t=>({connectionStartHandle:t.connectionStartHandle,connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName}),j7e=(t,e,n)=>r=>{const{connectionStartHandle:s,connectionEndHandle:i,connectionClickStartHandle:a}=r;return{connecting:s?.nodeId===t&&s?.handleId===e&&s?.type===n||i?.nodeId===t&&i?.handleId===e&&i?.type===n,clickConnecting:a?.nodeId===t&&a?.handleId===e&&a?.type===n}},$W=b.forwardRef(({type:t="source",position:e=kt.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:i=!0,id:a,onConnect:l,children:c,className:d,onMouseDown:h,onTouchStart:m,...g},x)=>{const y=a||null,w=t==="target",S=gs(),k=p7e(),{connectOnClick:j,noPanClassName:N}=gr(O7e,ks),{connecting:T,clickConnecting:E}=gr(j7e(k,y,t),ks);k||S.getState().onError?.("010",Yl.error010());const _=q=>{const{defaultEdgeOptions:B,onConnect:H,hasDefaultEdges:W}=S.getState(),ee={...B,...q};if(W){const{edges:I,setEdges:V}=S.getState();V(y7e(ee,I))}H?.(ee),l?.(ee)},A=q=>{if(!k)return;const B=_W(q);s&&(B&&q.button===0||!B)&&qW({event:q,handleId:y,nodeId:k,onConnect:_,isTarget:w,getState:S.getState,setState:S.setState,isValidConnection:n||S.getState().isValidConnection||wD}),B?h?.(q):m?.(q)},D=q=>{const{onClickConnectStart:B,onClickConnectEnd:H,connectionClickStartHandle:W,connectionMode:ee,isValidConnection:I}=S.getState();if(!k||!W&&!s)return;if(!W){B?.(q,{nodeId:k,handleId:y,handleType:t}),S.setState({connectionClickStartHandle:{nodeId:k,type:t,handleId:y}});return}const V=NW(q.target),L=n||I||wD,{connection:$,isValid:K}=FW({nodeId:k,id:y,type:t},ee,W.nodeId,W.handleId||null,W.type,L,V);K&&_($),H?.(q),S.setState({connectionClickStartHandle:null})};return oe.createElement("div",{"data-handleid":y,"data-nodeid":k,"data-handlepos":e,"data-id":`${k}-${y}-${t}`,className:Ls(["react-flow__handle",`react-flow__handle-${e}`,"nodrag",N,d,{source:!w,target:w,connectable:r,connectablestart:s,connectableend:i,connecting:E,connectionindicator:r&&(s&&!T||i&&T)}]),onMouseDown:A,onTouchStart:A,onClick:j?D:void 0,ref:x,...g},c)});$W.displayName="Handle";var au=b.memo($W);const HW=({data:t,isConnectable:e,targetPosition:n=kt.Top,sourcePosition:r=kt.Bottom})=>oe.createElement(oe.Fragment,null,oe.createElement(au,{type:"target",position:n,isConnectable:e}),t?.label,oe.createElement(au,{type:"source",position:r,isConnectable:e}));HW.displayName="DefaultNode";var lj=b.memo(HW);const QW=({data:t,isConnectable:e,sourcePosition:n=kt.Bottom})=>oe.createElement(oe.Fragment,null,t?.label,oe.createElement(au,{type:"source",position:n,isConnectable:e}));QW.displayName="InputNode";var VW=b.memo(QW);const UW=({data:t,isConnectable:e,targetPosition:n=kt.Top})=>oe.createElement(oe.Fragment,null,oe.createElement(au,{type:"target",position:n,isConnectable:e}),t?.label);UW.displayName="OutputNode";var WW=b.memo(UW);const c7=()=>null;c7.displayName="GroupNode";const N7e=t=>({selectedNodes:t.getNodes().filter(e=>e.selected),selectedEdges:t.edges.filter(e=>e.selected).map(e=>({...e}))}),G1=t=>t.id;function C7e(t,e){return ks(t.selectedNodes.map(G1),e.selectedNodes.map(G1))&&ks(t.selectedEdges.map(G1),e.selectedEdges.map(G1))}const GW=b.memo(({onSelectionChange:t})=>{const e=gs(),{selectedNodes:n,selectedEdges:r}=gr(N7e,C7e);return b.useEffect(()=>{const s={nodes:n,edges:r};t?.(s),e.getState().onSelectionChange.forEach(i=>i(s))},[n,r,t]),null});GW.displayName="SelectionListener";const T7e=t=>!!t.onSelectionChange;function E7e({onSelectionChange:t}){const e=gr(T7e);return t||e?oe.createElement(GW,{onSelectionChange:t}):null}const _7e=t=>({setNodes:t.setNodes,setEdges:t.setEdges,setDefaultNodesAndEdges:t.setDefaultNodesAndEdges,setMinZoom:t.setMinZoom,setMaxZoom:t.setMaxZoom,setTranslateExtent:t.setTranslateExtent,setNodeExtent:t.setNodeExtent,reset:t.reset});function hh(t,e){b.useEffect(()=>{typeof t<"u"&&e(t)},[t])}function on(t,e,n){b.useEffect(()=>{typeof e<"u"&&n({[t]:e})},[e])}const A7e=({nodes:t,edges:e,defaultNodes:n,defaultEdges:r,onConnect:s,onConnectStart:i,onConnectEnd:a,onClickConnectStart:l,onClickConnectEnd:c,nodesDraggable:d,nodesConnectable:h,nodesFocusable:m,edgesFocusable:g,edgesUpdatable:x,elevateNodesOnSelect:y,minZoom:w,maxZoom:S,nodeExtent:k,onNodesChange:j,onEdgesChange:N,elementsSelectable:T,connectionMode:E,snapGrid:_,snapToGrid:A,translateExtent:D,connectOnClick:q,defaultEdgeOptions:B,fitView:H,fitViewOptions:W,onNodesDelete:ee,onEdgesDelete:I,onNodeDrag:V,onNodeDragStart:L,onNodeDragStop:$,onSelectionDrag:K,onSelectionDragStart:Y,onSelectionDragStop:R,noPanClassName:ie,nodeOrigin:X,rfId:z,autoPanOnConnect:U,autoPanOnNodeDrag:te,onError:ne,connectionRadius:G,isValidConnection:se,nodeDragThreshold:re})=>{const{setNodes:ae,setEdges:_e,setDefaultNodesAndEdges:Be,setMinZoom:Ye,setMaxZoom:Je,setTranslateExtent:Oe,setNodeExtent:Ve,reset:Ue}=gr(_7e,ks),$e=gs();return b.useEffect(()=>{const jt=r?.map(vt=>({...vt,...B}));return Be(n,jt),()=>{Ue()}},[]),on("defaultEdgeOptions",B,$e.setState),on("connectionMode",E,$e.setState),on("onConnect",s,$e.setState),on("onConnectStart",i,$e.setState),on("onConnectEnd",a,$e.setState),on("onClickConnectStart",l,$e.setState),on("onClickConnectEnd",c,$e.setState),on("nodesDraggable",d,$e.setState),on("nodesConnectable",h,$e.setState),on("nodesFocusable",m,$e.setState),on("edgesFocusable",g,$e.setState),on("edgesUpdatable",x,$e.setState),on("elementsSelectable",T,$e.setState),on("elevateNodesOnSelect",y,$e.setState),on("snapToGrid",A,$e.setState),on("snapGrid",_,$e.setState),on("onNodesChange",j,$e.setState),on("onEdgesChange",N,$e.setState),on("connectOnClick",q,$e.setState),on("fitViewOnInit",H,$e.setState),on("fitViewOnInitOptions",W,$e.setState),on("onNodesDelete",ee,$e.setState),on("onEdgesDelete",I,$e.setState),on("onNodeDrag",V,$e.setState),on("onNodeDragStart",L,$e.setState),on("onNodeDragStop",$,$e.setState),on("onSelectionDrag",K,$e.setState),on("onSelectionDragStart",Y,$e.setState),on("onSelectionDragStop",R,$e.setState),on("noPanClassName",ie,$e.setState),on("nodeOrigin",X,$e.setState),on("rfId",z,$e.setState),on("autoPanOnConnect",U,$e.setState),on("autoPanOnNodeDrag",te,$e.setState),on("onError",ne,$e.setState),on("connectionRadius",G,$e.setState),on("isValidConnection",se,$e.setState),on("nodeDragThreshold",re,$e.setState),hh(t,ae),hh(e,_e),hh(w,Ye),hh(S,Je),hh(D,Oe),hh(k,Ve),null},SD={display:"none"},M7e={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},XW="react-flow__node-desc",YW="react-flow__edge-desc",R7e="react-flow__aria-live",D7e=t=>t.ariaLiveMessage;function P7e({rfId:t}){const e=gr(D7e);return oe.createElement("div",{id:`${R7e}-${t}`,"aria-live":"assertive","aria-atomic":"true",style:M7e},e)}function z7e({rfId:t,disableKeyboardA11y:e}){return oe.createElement(oe.Fragment,null,oe.createElement("div",{id:`${XW}-${t}`,style:SD},"Press enter or space to select a node.",!e&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),oe.createElement("div",{id:`${YW}-${t}`,style:SD},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!e&&oe.createElement(P7e,{rfId:t}))}var Cp=(t=null,e={actInsideInputWithModifier:!0})=>{const[n,r]=b.useState(!1),s=b.useRef(!1),i=b.useRef(new Set([])),[a,l]=b.useMemo(()=>{if(t!==null){const d=(Array.isArray(t)?t:[t]).filter(m=>typeof m=="string").map(m=>m.split("+")),h=d.reduce((m,g)=>m.concat(...g),[]);return[d,h]}return[[],[]]},[t]);return b.useEffect(()=>{const c=typeof document<"u"?document:null,d=e?.target||c;if(t!==null){const h=x=>{if(s.current=x.ctrlKey||x.metaKey||x.shiftKey,(!s.current||s.current&&!e.actInsideInputWithModifier)&&sj(x))return!1;const w=OD(x.code,l);i.current.add(x[w]),kD(a,i.current,!1)&&(x.preventDefault(),r(!0))},m=x=>{if((!s.current||s.current&&!e.actInsideInputWithModifier)&&sj(x))return!1;const w=OD(x.code,l);kD(a,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(x[w]),x.key==="Meta"&&i.current.clear(),s.current=!1},g=()=>{i.current.clear(),r(!1)};return d?.addEventListener("keydown",h),d?.addEventListener("keyup",m),window.addEventListener("blur",g),()=>{d?.removeEventListener("keydown",h),d?.removeEventListener("keyup",m),window.removeEventListener("blur",g)}}},[t,r]),n};function kD(t,e,n){return t.filter(r=>n||r.length===e.size).some(r=>r.every(s=>e.has(s)))}function OD(t,e){return e.includes(t)?"code":"key"}function KW(t,e,n,r){const s=t.parentNode||t.parentId;if(!s)return n;const i=e.get(s),a=id(i,r);return KW(i,e,{x:(n.x??0)+a.x,y:(n.y??0)+a.y,z:(i[$r]?.z??0)>(n.z??0)?i[$r]?.z??0:n.z??0},r)}function ZW(t,e,n){t.forEach(r=>{const s=r.parentNode||r.parentId;if(s&&!t.has(s))throw new Error(`Parent node ${s} not found`);if(s||n?.[r.id]){const{x:i,y:a,z:l}=KW(r,t,{...r.position,z:r[$r]?.z??0},e);r.positionAbsolute={x:i,y:a},r[$r].z=l,n?.[r.id]&&(r[$r].isParent=!0)}})}function m5(t,e,n,r){const s=new Map,i={},a=r?1e3:0;return t.forEach(l=>{const c=(Ca(l.zIndex)?l.zIndex:0)+(l.selected?a:0),d=e.get(l.id),h={...l,positionAbsolute:{x:l.position.x,y:l.position.y}},m=l.parentNode||l.parentId;m&&(i[m]=!0);const g=d?.type&&d?.type!==l.type;Object.defineProperty(h,$r,{enumerable:!1,value:{handleBounds:g?void 0:d?.[$r]?.handleBounds,z:c}}),s.set(l.id,h)}),ZW(s,n,i),s}function JW(t,e={}){const{getNodes:n,width:r,height:s,minZoom:i,maxZoom:a,d3Zoom:l,d3Selection:c,fitViewOnInitDone:d,fitViewOnInit:h,nodeOrigin:m}=t(),g=e.initial&&!d&&h;if(l&&c&&(g||!e.initial)){const y=n().filter(S=>{const k=e.includeHiddenNodes?S.width&&S.height:!S.hidden;return e.nodes?.length?k&&e.nodes.some(j=>j.id===S.id):k}),w=y.every(S=>S.width&&S.height);if(y.length>0&&w){const S=iw(y,m),{x:k,y:j,zoom:N}=LW(S,r,s,e.minZoom??i,e.maxZoom??a,e.padding??.1),T=$l.translate(k,j).scale(N);return typeof e.duration=="number"&&e.duration>0?l.transform(qu(c,e.duration),T):l.transform(c,T),!0}}return!1}function I7e(t,e){return t.forEach(n=>{const r=e.get(n.id);r&&e.set(r.id,{...r,[$r]:r[$r],selected:n.selected})}),new Map(e)}function L7e(t,e){return e.map(n=>{const r=t.find(s=>s.id===n.id);return r&&(n.selected=r.selected),n})}function X1({changedNodes:t,changedEdges:e,get:n,set:r}){const{nodeInternals:s,edges:i,onNodesChange:a,onEdgesChange:l,hasDefaultNodes:c,hasDefaultEdges:d}=n();t?.length&&(c&&r({nodeInternals:I7e(t,s)}),a?.(t)),e?.length&&(d&&r({edges:L7e(e,i)}),l?.(e))}const fh=()=>{},B7e={zoomIn:fh,zoomOut:fh,zoomTo:fh,getZoom:()=>1,setViewport:fh,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:fh,fitBounds:fh,project:t=>t,screenToFlowPosition:t=>t,flowToScreenPosition:t=>t,viewportInitialized:!1},F7e=t=>({d3Zoom:t.d3Zoom,d3Selection:t.d3Selection}),q7e=()=>{const t=gs(),{d3Zoom:e,d3Selection:n}=gr(F7e,ks);return b.useMemo(()=>n&&e?{zoomIn:s=>e.scaleBy(qu(n,s?.duration),1.2),zoomOut:s=>e.scaleBy(qu(n,s?.duration),1/1.2),zoomTo:(s,i)=>e.scaleTo(qu(n,i?.duration),s),getZoom:()=>t.getState().transform[2],setViewport:(s,i)=>{const[a,l,c]=t.getState().transform,d=$l.translate(s.x??a,s.y??l).scale(s.zoom??c);e.transform(qu(n,i?.duration),d)},getViewport:()=>{const[s,i,a]=t.getState().transform;return{x:s,y:i,zoom:a}},fitView:s=>JW(t.getState,s),setCenter:(s,i,a)=>{const{width:l,height:c,maxZoom:d}=t.getState(),h=typeof a?.zoom<"u"?a.zoom:d,m=l/2-s*h,g=c/2-i*h,x=$l.translate(m,g).scale(h);e.transform(qu(n,a?.duration),x)},fitBounds:(s,i)=>{const{width:a,height:l,minZoom:c,maxZoom:d}=t.getState(),{x:h,y:m,zoom:g}=LW(s,a,l,c,d,i?.padding??.1),x=$l.translate(h,m).scale(g);e.transform(qu(n,i?.duration),x)},project:s=>{const{transform:i,snapToGrid:a,snapGrid:l}=t.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),oj(s,i,a,l)},screenToFlowPosition:s=>{const{transform:i,snapToGrid:a,snapGrid:l,domNode:c}=t.getState();if(!c)return s;const{x:d,y:h}=c.getBoundingClientRect(),m={x:s.x-d,y:s.y-h};return oj(m,i,a,l)},flowToScreenPosition:s=>{const{transform:i,domNode:a}=t.getState();if(!a)return s;const{x:l,y:c}=a.getBoundingClientRect(),d=PW(s,i);return{x:d.x+l,y:d.y+c}},viewportInitialized:!0}:B7e,[e,n])};function u7(){const t=q7e(),e=gs(),n=b.useCallback(()=>e.getState().getNodes().map(w=>({...w})),[]),r=b.useCallback(w=>e.getState().nodeInternals.get(w),[]),s=b.useCallback(()=>{const{edges:w=[]}=e.getState();return w.map(S=>({...S}))},[]),i=b.useCallback(w=>{const{edges:S=[]}=e.getState();return S.find(k=>k.id===w)},[]),a=b.useCallback(w=>{const{getNodes:S,setNodes:k,hasDefaultNodes:j,onNodesChange:N}=e.getState(),T=S(),E=typeof w=="function"?w(T):w;if(j)k(E);else if(N){const _=E.length===0?T.map(A=>({type:"remove",id:A.id})):E.map(A=>({item:A,type:"reset"}));N(_)}},[]),l=b.useCallback(w=>{const{edges:S=[],setEdges:k,hasDefaultEdges:j,onEdgesChange:N}=e.getState(),T=typeof w=="function"?w(S):w;if(j)k(T);else if(N){const E=T.length===0?S.map(_=>({type:"remove",id:_.id})):T.map(_=>({item:_,type:"reset"}));N(E)}},[]),c=b.useCallback(w=>{const S=Array.isArray(w)?w:[w],{getNodes:k,setNodes:j,hasDefaultNodes:N,onNodesChange:T}=e.getState();if(N){const _=[...k(),...S];j(_)}else if(T){const E=S.map(_=>({item:_,type:"add"}));T(E)}},[]),d=b.useCallback(w=>{const S=Array.isArray(w)?w:[w],{edges:k=[],setEdges:j,hasDefaultEdges:N,onEdgesChange:T}=e.getState();if(N)j([...k,...S]);else if(T){const E=S.map(_=>({item:_,type:"add"}));T(E)}},[]),h=b.useCallback(()=>{const{getNodes:w,edges:S=[],transform:k}=e.getState(),[j,N,T]=k;return{nodes:w().map(E=>({...E})),edges:S.map(E=>({...E})),viewport:{x:j,y:N,zoom:T}}},[]),m=b.useCallback(({nodes:w,edges:S})=>{const{nodeInternals:k,getNodes:j,edges:N,hasDefaultNodes:T,hasDefaultEdges:E,onNodesDelete:_,onEdgesDelete:A,onNodesChange:D,onEdgesChange:q}=e.getState(),B=(w||[]).map(V=>V.id),H=(S||[]).map(V=>V.id),W=j().reduce((V,L)=>{const $=L.parentNode||L.parentId,K=!B.includes(L.id)&&$&&V.find(R=>R.id===$);return(typeof L.deletable=="boolean"?L.deletable:!0)&&(B.includes(L.id)||K)&&V.push(L),V},[]),ee=N.filter(V=>typeof V.deletable=="boolean"?V.deletable:!0),I=ee.filter(V=>H.includes(V.id));if(W||I){const V=IW(W,ee),L=[...I,...V],$=L.reduce((K,Y)=>(K.includes(Y.id)||K.push(Y.id),K),[]);if((E||T)&&(E&&e.setState({edges:N.filter(K=>!$.includes(K.id))}),T&&(W.forEach(K=>{k.delete(K.id)}),e.setState({nodeInternals:new Map(k)}))),$.length>0&&(A?.(L),q&&q($.map(K=>({id:K,type:"remove"})))),W.length>0&&(_?.(W),D)){const K=W.map(Y=>({id:Y.id,type:"remove"}));D(K)}}},[]),g=b.useCallback(w=>{const S=o7e(w),k=S?null:e.getState().nodeInternals.get(w.id);return!S&&!k?[null,null,S]:[S?w:pD(k),k,S]},[]),x=b.useCallback((w,S=!0,k)=>{const[j,N,T]=g(w);return j?(k||e.getState().getNodes()).filter(E=>{if(!T&&(E.id===N.id||!E.positionAbsolute))return!1;const _=pD(E),A=rj(_,j);return S&&A>0||A>=j.width*j.height}):[]},[]),y=b.useCallback((w,S,k=!0)=>{const[j]=g(w);if(!j)return!1;const N=rj(j,S);return k&&N>0||N>=j.width*j.height},[]);return b.useMemo(()=>({...t,getNodes:n,getNode:r,getEdges:s,getEdge:i,setNodes:a,setEdges:l,addNodes:c,addEdges:d,toObject:h,deleteElements:m,getIntersectingNodes:x,isNodeIntersecting:y}),[t,n,r,s,i,a,l,c,d,h,m,x,y])}const $7e={actInsideInputWithModifier:!1};var H7e=({deleteKeyCode:t,multiSelectionKeyCode:e})=>{const n=gs(),{deleteElements:r}=u7(),s=Cp(t,$7e),i=Cp(e);b.useEffect(()=>{if(s){const{edges:a,getNodes:l}=n.getState(),c=l().filter(h=>h.selected),d=a.filter(h=>h.selected);r({nodes:c,edges:d}),n.setState({nodesSelectionActive:!1})}},[s]),b.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])};function Q7e(t){const e=gs();b.useEffect(()=>{let n;const r=()=>{if(!t.current)return;const s=n7(t.current);(s.height===0||s.width===0)&&e.getState().onError?.("004",Yl.error004()),e.setState({width:s.width||500,height:s.height||500})};return r(),window.addEventListener("resize",r),t.current&&(n=new ResizeObserver(()=>r()),n.observe(t.current)),()=>{window.removeEventListener("resize",r),n&&t.current&&n.unobserve(t.current)}},[])}const d7={position:"absolute",width:"100%",height:"100%",top:0,left:0},V7e=(t,e)=>t.x!==e.x||t.y!==e.y||t.zoom!==e.k,Y1=t=>({x:t.x,y:t.y,zoom:t.k}),mh=(t,e)=>t.target.closest(`.${e}`),jD=(t,e)=>e===2&&Array.isArray(t)&&t.includes(2),ND=t=>{const e=t.ctrlKey&&zy()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*e},U7e=t=>({d3Zoom:t.d3Zoom,d3Selection:t.d3Selection,d3ZoomHandler:t.d3ZoomHandler,userSelectionActive:t.userSelectionActive}),W7e=({onMove:t,onMoveStart:e,onMoveEnd:n,onPaneContextMenu:r,zoomOnScroll:s=!0,zoomOnPinch:i=!0,panOnScroll:a=!1,panOnScrollSpeed:l=.5,panOnScrollMode:c=Yu.Free,zoomOnDoubleClick:d=!0,elementsSelectable:h,panOnDrag:m=!0,defaultViewport:g,translateExtent:x,minZoom:y,maxZoom:w,zoomActivationKeyCode:S,preventScrolling:k=!0,children:j,noWheelClassName:N,noPanClassName:T})=>{const E=b.useRef(),_=gs(),A=b.useRef(!1),D=b.useRef(!1),q=b.useRef(null),B=b.useRef({x:0,y:0,zoom:0}),{d3Zoom:H,d3Selection:W,d3ZoomHandler:ee,userSelectionActive:I}=gr(U7e,ks),V=Cp(S),L=b.useRef(0),$=b.useRef(!1),K=b.useRef();return Q7e(q),b.useEffect(()=>{if(q.current){const Y=q.current.getBoundingClientRect(),R=kW().scaleExtent([y,w]).translateExtent(x),ie=va(q.current).call(R),X=$l.translate(g.x,g.y).scale(gf(g.zoom,y,w)),z=[[0,0],[Y.width,Y.height]],U=R.constrain()(X,z,x);R.transform(ie,U),R.wheelDelta(ND),_.setState({d3Zoom:R,d3Selection:ie,d3ZoomHandler:ie.on("wheel.zoom"),transform:[U.x,U.y,U.k],domNode:q.current.closest(".react-flow")})}},[]),b.useEffect(()=>{W&&H&&(a&&!V&&!I?W.on("wheel.zoom",Y=>{if(mh(Y,N))return!1;Y.preventDefault(),Y.stopImmediatePropagation();const R=W.property("__zoom").k||1;if(Y.ctrlKey&&i){const se=Qa(Y),re=ND(Y),ae=R*Math.pow(2,re);H.scaleTo(W,ae,se,Y);return}const ie=Y.deltaMode===1?20:1;let X=c===Yu.Vertical?0:Y.deltaX*ie,z=c===Yu.Horizontal?0:Y.deltaY*ie;!zy()&&Y.shiftKey&&c!==Yu.Vertical&&(X=Y.deltaY*ie,z=0),H.translateBy(W,-(X/R)*l,-(z/R)*l,{internal:!0});const U=Y1(W.property("__zoom")),{onViewportChangeStart:te,onViewportChange:ne,onViewportChangeEnd:G}=_.getState();clearTimeout(K.current),$.current||($.current=!0,e?.(Y,U),te?.(U)),$.current&&(t?.(Y,U),ne?.(U),K.current=setTimeout(()=>{n?.(Y,U),G?.(U),$.current=!1},150))},{passive:!1}):typeof ee<"u"&&W.on("wheel.zoom",function(Y,R){if(!k&&Y.type==="wheel"&&!Y.ctrlKey||mh(Y,N))return null;Y.preventDefault(),ee.call(this,Y,R)},{passive:!1}))},[I,a,c,W,H,ee,V,i,k,N,e,t,n]),b.useEffect(()=>{H&&H.on("start",Y=>{if(!Y.sourceEvent||Y.sourceEvent.internal)return null;L.current=Y.sourceEvent?.button;const{onViewportChangeStart:R}=_.getState(),ie=Y1(Y.transform);A.current=!0,B.current=ie,Y.sourceEvent?.type==="mousedown"&&_.setState({paneDragging:!0}),R?.(ie),e?.(Y.sourceEvent,ie)})},[H,e]),b.useEffect(()=>{H&&(I&&!A.current?H.on("zoom",null):I||H.on("zoom",Y=>{const{onViewportChange:R}=_.getState();if(_.setState({transform:[Y.transform.x,Y.transform.y,Y.transform.k]}),D.current=!!(r&&jD(m,L.current??0)),(t||R)&&!Y.sourceEvent?.internal){const ie=Y1(Y.transform);R?.(ie),t?.(Y.sourceEvent,ie)}}))},[I,H,t,m,r]),b.useEffect(()=>{H&&H.on("end",Y=>{if(!Y.sourceEvent||Y.sourceEvent.internal)return null;const{onViewportChangeEnd:R}=_.getState();if(A.current=!1,_.setState({paneDragging:!1}),r&&jD(m,L.current??0)&&!D.current&&r(Y.sourceEvent),D.current=!1,(n||R)&&V7e(B.current,Y.transform)){const ie=Y1(Y.transform);B.current=ie,clearTimeout(E.current),E.current=setTimeout(()=>{R?.(ie),n?.(Y.sourceEvent,ie)},a?150:0)}})},[H,a,m,n,r]),b.useEffect(()=>{H&&H.filter(Y=>{const R=V||s,ie=i&&Y.ctrlKey;if((m===!0||Array.isArray(m)&&m.includes(1))&&Y.button===1&&Y.type==="mousedown"&&(mh(Y,"react-flow__node")||mh(Y,"react-flow__edge")))return!0;if(!m&&!R&&!a&&!d&&!i||I||!d&&Y.type==="dblclick"||mh(Y,N)&&Y.type==="wheel"||mh(Y,T)&&(Y.type!=="wheel"||a&&Y.type==="wheel"&&!V)||!i&&Y.ctrlKey&&Y.type==="wheel"||!R&&!a&&!ie&&Y.type==="wheel"||!m&&(Y.type==="mousedown"||Y.type==="touchstart")||Array.isArray(m)&&!m.includes(Y.button)&&Y.type==="mousedown")return!1;const X=Array.isArray(m)&&m.includes(Y.button)||!Y.button||Y.button<=1;return(!Y.ctrlKey||Y.type==="wheel")&&X})},[I,H,s,i,a,d,m,h,V]),oe.createElement("div",{className:"react-flow__renderer",ref:q,style:d7},j)},G7e=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function X7e(){const{userSelectionActive:t,userSelectionRect:e}=gr(G7e,ks);return t&&e?oe.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:e.width,height:e.height,transform:`translate(${e.x}px, ${e.y}px)`}}):null}function CD(t,e){const n=e.parentNode||e.parentId,r=t.find(s=>s.id===n);if(r){const s=e.position.x+e.width-r.width,i=e.position.y+e.height-r.height;if(s>0||i>0||e.position.x<0||e.position.y<0){if(r.style={...r.style},r.style.width=r.style.width??r.width,r.style.height=r.style.height??r.height,s>0&&(r.style.width+=s),i>0&&(r.style.height+=i),e.position.x<0){const a=Math.abs(e.position.x);r.position.x=r.position.x-a,r.style.width+=a,e.position.x=0}if(e.position.y<0){const a=Math.abs(e.position.y);r.position.y=r.position.y-a,r.style.height+=a,e.position.y=0}r.width=r.style.width,r.height=r.style.height}}}function eG(t,e){if(t.some(r=>r.type==="reset"))return t.filter(r=>r.type==="reset").map(r=>r.item);const n=t.filter(r=>r.type==="add").map(r=>r.item);return e.reduce((r,s)=>{const i=t.filter(l=>l.id===s.id);if(i.length===0)return r.push(s),r;const a={...s};for(const l of i)if(l)switch(l.type){case"select":{a.selected=l.selected;break}case"position":{typeof l.position<"u"&&(a.position=l.position),typeof l.positionAbsolute<"u"&&(a.positionAbsolute=l.positionAbsolute),typeof l.dragging<"u"&&(a.dragging=l.dragging),a.expandParent&&CD(r,a);break}case"dimensions":{typeof l.dimensions<"u"&&(a.width=l.dimensions.width,a.height=l.dimensions.height),typeof l.updateStyle<"u"&&(a.style={...a.style||{},...l.dimensions}),typeof l.resizing=="boolean"&&(a.resizing=l.resizing),a.expandParent&&CD(r,a);break}case"remove":return r}return r.push(a),r},n)}function tG(t,e){return eG(t,e)}function Y7e(t,e){return eG(t,e)}const Lc=(t,e)=>({id:t,type:"select",selected:e});function Ah(t,e){return t.reduce((n,r)=>{const s=e.includes(r.id);return!r.selected&&s?(r.selected=!0,n.push(Lc(r.id,!0))):r.selected&&!s&&(r.selected=!1,n.push(Lc(r.id,!1))),n},[])}const p5=(t,e)=>n=>{n.target===e.current&&t?.(n)},K7e=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,dragging:t.paneDragging}),nG=b.memo(({isSelecting:t,selectionMode:e=Np.Full,panOnDrag:n,onSelectionStart:r,onSelectionEnd:s,onPaneClick:i,onPaneContextMenu:a,onPaneScroll:l,onPaneMouseEnter:c,onPaneMouseMove:d,onPaneMouseLeave:h,children:m})=>{const g=b.useRef(null),x=gs(),y=b.useRef(0),w=b.useRef(0),S=b.useRef(),{userSelectionActive:k,elementsSelectable:j,dragging:N}=gr(K7e,ks),T=()=>{x.setState({userSelectionActive:!1,userSelectionRect:null}),y.current=0,w.current=0},E=ee=>{i?.(ee),x.getState().resetSelectedElements(),x.setState({nodesSelectionActive:!1})},_=ee=>{if(Array.isArray(n)&&n?.includes(2)){ee.preventDefault();return}a?.(ee)},A=l?ee=>l(ee):void 0,D=ee=>{const{resetSelectedElements:I,domNode:V}=x.getState();if(S.current=V?.getBoundingClientRect(),!j||!t||ee.button!==0||ee.target!==g.current||!S.current)return;const{x:L,y:$}=Wc(ee,S.current);I(),x.setState({userSelectionRect:{width:0,height:0,startX:L,startY:$,x:L,y:$}}),r?.(ee)},q=ee=>{const{userSelectionRect:I,nodeInternals:V,edges:L,transform:$,onNodesChange:K,onEdgesChange:Y,nodeOrigin:R,getNodes:ie}=x.getState();if(!t||!S.current||!I)return;x.setState({userSelectionActive:!0,nodesSelectionActive:!1});const X=Wc(ee,S.current),z=I.startX??0,U=I.startY??0,te={...I,x:X.x<z?X.x:z,y:X.y<U?X.y:U,width:Math.abs(X.x-z),height:Math.abs(X.y-U)},ne=ie(),G=zW(V,te,$,e===Np.Partial,!0,R),se=IW(G,L).map(ae=>ae.id),re=G.map(ae=>ae.id);if(y.current!==re.length){y.current=re.length;const ae=Ah(ne,re);ae.length&&K?.(ae)}if(w.current!==se.length){w.current=se.length;const ae=Ah(L,se);ae.length&&Y?.(ae)}x.setState({userSelectionRect:te})},B=ee=>{if(ee.button!==0)return;const{userSelectionRect:I}=x.getState();!k&&I&&ee.target===g.current&&E?.(ee),x.setState({nodesSelectionActive:y.current>0}),T(),s?.(ee)},H=ee=>{k&&(x.setState({nodesSelectionActive:y.current>0}),s?.(ee)),T()},W=j&&(t||k);return oe.createElement("div",{className:Ls(["react-flow__pane",{dragging:N,selection:t}]),onClick:W?void 0:p5(E,g),onContextMenu:p5(_,g),onWheel:p5(A,g),onMouseEnter:W?void 0:c,onMouseDown:W?D:void 0,onMouseMove:W?q:d,onMouseUp:W?B:void 0,onMouseLeave:W?H:h,ref:g,style:d7},m,oe.createElement(X7e,null))});nG.displayName="Pane";function rG(t,e){const n=t.parentNode||t.parentId;if(!n)return!1;const r=e.get(n);return r?r.selected?!0:rG(r,e):!1}function TD(t,e,n){let r=t;do{if(r?.matches(e))return!0;if(r===n.current)return!1;r=r.parentElement}while(r);return!1}function Z7e(t,e,n,r){return Array.from(t.values()).filter(s=>(s.selected||s.id===r)&&(!s.parentNode||s.parentId||!rG(s,t))&&(s.draggable||e&&typeof s.draggable>"u")).map(s=>({id:s.id,position:s.position||{x:0,y:0},positionAbsolute:s.positionAbsolute||{x:0,y:0},distance:{x:n.x-(s.positionAbsolute?.x??0),y:n.y-(s.positionAbsolute?.y??0)},delta:{x:0,y:0},extent:s.extent,parentNode:s.parentNode||s.parentId,parentId:s.parentNode||s.parentId,width:s.width,height:s.height,expandParent:s.expandParent}))}function J7e(t,e){return!e||e==="parent"?e:[e[0],[e[1][0]-(t.width||0),e[1][1]-(t.height||0)]]}function sG(t,e,n,r,s=[0,0],i){const a=J7e(t,t.extent||r);let l=a;const c=t.parentNode||t.parentId;if(t.extent==="parent"&&!t.expandParent)if(c&&t.width&&t.height){const m=n.get(c),{x:g,y:x}=id(m,s).positionAbsolute;l=m&&Ca(g)&&Ca(x)&&Ca(m.width)&&Ca(m.height)?[[g+t.width*s[0],x+t.height*s[1]],[g+m.width-t.width+t.width*s[0],x+m.height-t.height+t.height*s[1]]]:l}else i?.("005",Yl.error005()),l=a;else if(t.extent&&c&&t.extent!=="parent"){const m=n.get(c),{x:g,y:x}=id(m,s).positionAbsolute;l=[[t.extent[0][0]+g,t.extent[0][1]+x],[t.extent[1][0]+g,t.extent[1][1]+x]]}let d={x:0,y:0};if(c){const m=n.get(c);d=id(m,s).positionAbsolute}const h=l&&l!=="parent"?r7(e,l):e;return{position:{x:h.x-d.x,y:h.y-d.y},positionAbsolute:h}}function g5({nodeId:t,dragItems:e,nodeInternals:n}){const r=e.map(s=>({...n.get(s.id),position:s.position,positionAbsolute:s.positionAbsolute}));return[t?r.find(s=>s.id===t):r[0],r]}const ED=(t,e,n,r)=>{const s=e.querySelectorAll(t);if(!s||!s.length)return null;const i=Array.from(s),a=e.getBoundingClientRect(),l={x:a.width*r[0],y:a.height*r[1]};return i.map(c=>{const d=c.getBoundingClientRect();return{id:c.getAttribute("data-handleid"),position:c.getAttribute("data-handlepos"),x:(d.left-a.left-l.x)/n,y:(d.top-a.top-l.y)/n,...n7(c)}})};function i0(t,e,n){return n===void 0?n:r=>{const s=e().nodeInternals.get(t);s&&n(r,{...s})}}function cj({id:t,store:e,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:i,multiSelectionActive:a,nodeInternals:l,onError:c}=e.getState(),d=l.get(t);if(!d){c?.("012",Yl.error012(t));return}e.setState({nodesSelectionActive:!1}),d.selected?(n||d.selected&&a)&&(i({nodes:[d],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):s([t])}function eCe(){const t=gs();return b.useCallback(({sourceEvent:n})=>{const{transform:r,snapGrid:s,snapToGrid:i}=t.getState(),a=n.touches?n.touches[0].clientX:n.clientX,l=n.touches?n.touches[0].clientY:n.clientY,c={x:(a-r[0])/r[2],y:(l-r[1])/r[2]};return{xSnapped:i?s[0]*Math.round(c.x/s[0]):c.x,ySnapped:i?s[1]*Math.round(c.y/s[1]):c.y,...c}},[])}function x5(t){return(e,n,r)=>t?.(e,r)}function iG({nodeRef:t,disabled:e=!1,noDragClassName:n,handleSelector:r,nodeId:s,isSelectable:i,selectNodesOnDrag:a}){const l=gs(),[c,d]=b.useState(!1),h=b.useRef([]),m=b.useRef({x:null,y:null}),g=b.useRef(0),x=b.useRef(null),y=b.useRef({x:0,y:0}),w=b.useRef(null),S=b.useRef(!1),k=b.useRef(!1),j=b.useRef(!1),N=eCe();return b.useEffect(()=>{if(t?.current){const T=va(t.current),E=({x:D,y:q})=>{const{nodeInternals:B,onNodeDrag:H,onSelectionDrag:W,updateNodePositions:ee,nodeExtent:I,snapGrid:V,snapToGrid:L,nodeOrigin:$,onError:K}=l.getState();m.current={x:D,y:q};let Y=!1,R={x:0,y:0,x2:0,y2:0};if(h.current.length>1&&I){const X=iw(h.current,$);R=jp(X)}if(h.current=h.current.map(X=>{const z={x:D-X.distance.x,y:q-X.distance.y};L&&(z.x=V[0]*Math.round(z.x/V[0]),z.y=V[1]*Math.round(z.y/V[1]));const U=[[I[0][0],I[0][1]],[I[1][0],I[1][1]]];h.current.length>1&&I&&!X.extent&&(U[0][0]=X.positionAbsolute.x-R.x+I[0][0],U[1][0]=X.positionAbsolute.x+(X.width??0)-R.x2+I[1][0],U[0][1]=X.positionAbsolute.y-R.y+I[0][1],U[1][1]=X.positionAbsolute.y+(X.height??0)-R.y2+I[1][1]);const te=sG(X,z,B,U,$,K);return Y=Y||X.position.x!==te.position.x||X.position.y!==te.position.y,X.position=te.position,X.positionAbsolute=te.positionAbsolute,X}),!Y)return;ee(h.current,!0,!0),d(!0);const ie=s?H:x5(W);if(ie&&w.current){const[X,z]=g5({nodeId:s,dragItems:h.current,nodeInternals:B});ie(w.current,X,z)}},_=()=>{if(!x.current)return;const[D,q]=jW(y.current,x.current);if(D!==0||q!==0){const{transform:B,panBy:H}=l.getState();m.current.x=(m.current.x??0)-D/B[2],m.current.y=(m.current.y??0)-q/B[2],H({x:D,y:q})&&E(m.current)}g.current=requestAnimationFrame(_)},A=D=>{const{nodeInternals:q,multiSelectionActive:B,nodesDraggable:H,unselectNodesAndEdges:W,onNodeDragStart:ee,onSelectionDragStart:I}=l.getState();k.current=!0;const V=s?ee:x5(I);(!a||!i)&&!B&&s&&(q.get(s)?.selected||W()),s&&i&&a&&cj({id:s,store:l,nodeRef:t});const L=N(D);if(m.current=L,h.current=Z7e(q,H,L,s),V&&h.current){const[$,K]=g5({nodeId:s,dragItems:h.current,nodeInternals:q});V(D.sourceEvent,$,K)}};if(e)T.on(".drag",null);else{const D=I6e().on("start",q=>{const{domNode:B,nodeDragThreshold:H}=l.getState();H===0&&A(q),j.current=!1;const W=N(q);m.current=W,x.current=B?.getBoundingClientRect()||null,y.current=Wc(q.sourceEvent,x.current)}).on("drag",q=>{const B=N(q),{autoPanOnNodeDrag:H,nodeDragThreshold:W}=l.getState();if(q.sourceEvent.type==="touchmove"&&q.sourceEvent.touches.length>1&&(j.current=!0),!j.current){if(!S.current&&k.current&&H&&(S.current=!0,_()),!k.current){const ee=B.xSnapped-(m?.current?.x??0),I=B.ySnapped-(m?.current?.y??0);Math.sqrt(ee*ee+I*I)>W&&A(q)}(m.current.x!==B.xSnapped||m.current.y!==B.ySnapped)&&h.current&&k.current&&(w.current=q.sourceEvent,y.current=Wc(q.sourceEvent,x.current),E(B))}}).on("end",q=>{if(!(!k.current||j.current)&&(d(!1),S.current=!1,k.current=!1,cancelAnimationFrame(g.current),h.current)){const{updateNodePositions:B,nodeInternals:H,onNodeDragStop:W,onSelectionDragStop:ee}=l.getState(),I=s?W:x5(ee);if(B(h.current,!1,!1),I){const[V,L]=g5({nodeId:s,dragItems:h.current,nodeInternals:H});I(q.sourceEvent,V,L)}}}).filter(q=>{const B=q.target;return!q.button&&(!n||!TD(B,`.${n}`,t))&&(!r||TD(B,r,t))});return T.call(D),()=>{T.on(".drag",null)}}}},[t,e,n,r,i,l,s,a,N]),c}function aG(){const t=gs();return b.useCallback(n=>{const{nodeInternals:r,nodeExtent:s,updateNodePositions:i,getNodes:a,snapToGrid:l,snapGrid:c,onError:d,nodesDraggable:h}=t.getState(),m=a().filter(j=>j.selected&&(j.draggable||h&&typeof j.draggable>"u")),g=l?c[0]:5,x=l?c[1]:5,y=n.isShiftPressed?4:1,w=n.x*g*y,S=n.y*x*y,k=m.map(j=>{if(j.positionAbsolute){const N={x:j.positionAbsolute.x+w,y:j.positionAbsolute.y+S};l&&(N.x=c[0]*Math.round(N.x/c[0]),N.y=c[1]*Math.round(N.y/c[1]));const{positionAbsolute:T,position:E}=sG(j,N,r,s,void 0,d);j.position=E,j.positionAbsolute=T}return j});i(k,!0,!1)},[])}const Vh={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var a0=t=>{const e=({id:n,type:r,data:s,xPos:i,yPos:a,xPosOrigin:l,yPosOrigin:c,selected:d,onClick:h,onMouseEnter:m,onMouseMove:g,onMouseLeave:x,onContextMenu:y,onDoubleClick:w,style:S,className:k,isDraggable:j,isSelectable:N,isConnectable:T,isFocusable:E,selectNodesOnDrag:_,sourcePosition:A,targetPosition:D,hidden:q,resizeObserver:B,dragHandle:H,zIndex:W,isParent:ee,noDragClassName:I,noPanClassName:V,initialized:L,disableKeyboardA11y:$,ariaLabel:K,rfId:Y,hasHandleBounds:R})=>{const ie=gs(),X=b.useRef(null),z=b.useRef(null),U=b.useRef(A),te=b.useRef(D),ne=b.useRef(r),G=N||j||h||m||g||x,se=aG(),re=i0(n,ie.getState,m),ae=i0(n,ie.getState,g),_e=i0(n,ie.getState,x),Be=i0(n,ie.getState,y),Ye=i0(n,ie.getState,w),Je=Ue=>{const{nodeDragThreshold:$e}=ie.getState();if(N&&(!_||!j||$e>0)&&cj({id:n,store:ie,nodeRef:X}),h){const jt=ie.getState().nodeInternals.get(n);jt&&h(Ue,{...jt})}},Oe=Ue=>{if(!sj(Ue)&&!$)if(EW.includes(Ue.key)&&N){const $e=Ue.key==="Escape";cj({id:n,store:ie,unselect:$e,nodeRef:X})}else j&&d&&Object.prototype.hasOwnProperty.call(Vh,Ue.key)&&(ie.setState({ariaLiveMessage:`Moved selected node ${Ue.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~i}, y: ${~~a}`}),se({x:Vh[Ue.key].x,y:Vh[Ue.key].y,isShiftPressed:Ue.shiftKey}))};b.useEffect(()=>()=>{z.current&&(B?.unobserve(z.current),z.current=null)},[]),b.useEffect(()=>{if(X.current&&!q){const Ue=X.current;(!L||!R||z.current!==Ue)&&(z.current&&B?.unobserve(z.current),B?.observe(Ue),z.current=Ue)}},[q,L,R]),b.useEffect(()=>{const Ue=ne.current!==r,$e=U.current!==A,jt=te.current!==D;X.current&&(Ue||$e||jt)&&(Ue&&(ne.current=r),$e&&(U.current=A),jt&&(te.current=D),ie.getState().updateNodeDimensions([{id:n,nodeElement:X.current,forceUpdate:!0}]))},[n,r,A,D]);const Ve=iG({nodeRef:X,disabled:q||!j,noDragClassName:I,handleSelector:H,nodeId:n,isSelectable:N,selectNodesOnDrag:_});return q?null:oe.createElement("div",{className:Ls(["react-flow__node",`react-flow__node-${r}`,{[V]:j},k,{selected:d,selectable:N,parent:ee,dragging:Ve}]),ref:X,style:{zIndex:W,transform:`translate(${l}px,${c}px)`,pointerEvents:G?"all":"none",visibility:L?"visible":"hidden",...S},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:re,onMouseMove:ae,onMouseLeave:_e,onContextMenu:Be,onClick:Je,onDoubleClick:Ye,onKeyDown:E?Oe:void 0,tabIndex:E?0:void 0,role:E?"button":void 0,"aria-describedby":$?void 0:`${XW}-${Y}`,"aria-label":K},oe.createElement(m7e,{value:n},oe.createElement(t,{id:n,data:s,type:r,xPos:i,yPos:a,selected:d,isConnectable:T,sourcePosition:A,targetPosition:D,dragging:Ve,dragHandle:H,zIndex:W})))};return e.displayName="NodeWrapper",b.memo(e)};const tCe=t=>{const e=t.getNodes().filter(n=>n.selected);return{...iw(e,t.nodeOrigin),transformString:`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`,userSelectionActive:t.userSelectionActive}};function nCe({onSelectionContextMenu:t,noPanClassName:e,disableKeyboardA11y:n}){const r=gs(),{width:s,height:i,x:a,y:l,transformString:c,userSelectionActive:d}=gr(tCe,ks),h=aG(),m=b.useRef(null);if(b.useEffect(()=>{n||m.current?.focus({preventScroll:!0})},[n]),iG({nodeRef:m}),d||!s||!i)return null;const g=t?y=>{const w=r.getState().getNodes().filter(S=>S.selected);t(y,w)}:void 0,x=y=>{Object.prototype.hasOwnProperty.call(Vh,y.key)&&h({x:Vh[y.key].x,y:Vh[y.key].y,isShiftPressed:y.shiftKey})};return oe.createElement("div",{className:Ls(["react-flow__nodesselection","react-flow__container",e]),style:{transform:c}},oe.createElement("div",{ref:m,className:"react-flow__nodesselection-rect",onContextMenu:g,tabIndex:n?void 0:-1,onKeyDown:n?void 0:x,style:{width:s,height:i,top:l,left:a}}))}var rCe=b.memo(nCe);const sCe=t=>t.nodesSelectionActive,oG=({children:t,onPaneClick:e,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,deleteKeyCode:l,onMove:c,onMoveStart:d,onMoveEnd:h,selectionKeyCode:m,selectionOnDrag:g,selectionMode:x,onSelectionStart:y,onSelectionEnd:w,multiSelectionKeyCode:S,panActivationKeyCode:k,zoomActivationKeyCode:j,elementsSelectable:N,zoomOnScroll:T,zoomOnPinch:E,panOnScroll:_,panOnScrollSpeed:A,panOnScrollMode:D,zoomOnDoubleClick:q,panOnDrag:B,defaultViewport:H,translateExtent:W,minZoom:ee,maxZoom:I,preventScrolling:V,onSelectionContextMenu:L,noWheelClassName:$,noPanClassName:K,disableKeyboardA11y:Y})=>{const R=gr(sCe),ie=Cp(m),X=Cp(k),z=X||B,U=X||_,te=ie||g&&z!==!0;return H7e({deleteKeyCode:l,multiSelectionKeyCode:S}),oe.createElement(W7e,{onMove:c,onMoveStart:d,onMoveEnd:h,onPaneContextMenu:i,elementsSelectable:N,zoomOnScroll:T,zoomOnPinch:E,panOnScroll:U,panOnScrollSpeed:A,panOnScrollMode:D,zoomOnDoubleClick:q,panOnDrag:!ie&&z,defaultViewport:H,translateExtent:W,minZoom:ee,maxZoom:I,zoomActivationKeyCode:j,preventScrolling:V,noWheelClassName:$,noPanClassName:K},oe.createElement(nG,{onSelectionStart:y,onSelectionEnd:w,onPaneClick:e,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,panOnDrag:z,isSelecting:!!te,selectionMode:x},t,R&&oe.createElement(rCe,{onSelectionContextMenu:L,noPanClassName:K,disableKeyboardA11y:Y})))};oG.displayName="FlowRenderer";var iCe=b.memo(oG);function aCe(t){return gr(b.useCallback(n=>t?zW(n.nodeInternals,{x:0,y:0,width:n.width,height:n.height},n.transform,!0):n.getNodes(),[t]))}function oCe(t){const e={input:a0(t.input||VW),default:a0(t.default||lj),output:a0(t.output||WW),group:a0(t.group||c7)},n={},r=Object.keys(t).filter(s=>!["input","default","output","group"].includes(s)).reduce((s,i)=>(s[i]=a0(t[i]||lj),s),n);return{...e,...r}}const lCe=({x:t,y:e,width:n,height:r,origin:s})=>!n||!r?{x:t,y:e}:s[0]<0||s[1]<0||s[0]>1||s[1]>1?{x:t,y:e}:{x:t-n*s[0],y:e-r*s[1]},cCe=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,updateNodeDimensions:t.updateNodeDimensions,onError:t.onError}),lG=t=>{const{nodesDraggable:e,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,updateNodeDimensions:i,onError:a}=gr(cCe,ks),l=aCe(t.onlyRenderVisibleElements),c=b.useRef(),d=b.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const h=new ResizeObserver(m=>{const g=m.map(x=>({id:x.target.getAttribute("data-id"),nodeElement:x.target,forceUpdate:!0}));i(g)});return c.current=h,h},[]);return b.useEffect(()=>()=>{c?.current?.disconnect()},[]),oe.createElement("div",{className:"react-flow__nodes",style:d7},l.map(h=>{let m=h.type||"default";t.nodeTypes[m]||(a?.("003",Yl.error003(m)),m="default");const g=t.nodeTypes[m]||t.nodeTypes.default,x=!!(h.draggable||e&&typeof h.draggable>"u"),y=!!(h.selectable||s&&typeof h.selectable>"u"),w=!!(h.connectable||n&&typeof h.connectable>"u"),S=!!(h.focusable||r&&typeof h.focusable>"u"),k=t.nodeExtent?r7(h.positionAbsolute,t.nodeExtent):h.positionAbsolute,j=k?.x??0,N=k?.y??0,T=lCe({x:j,y:N,width:h.width??0,height:h.height??0,origin:t.nodeOrigin});return oe.createElement(g,{key:h.id,id:h.id,className:h.className,style:h.style,type:m,data:h.data,sourcePosition:h.sourcePosition||kt.Bottom,targetPosition:h.targetPosition||kt.Top,hidden:h.hidden,xPos:j,yPos:N,xPosOrigin:T.x,yPosOrigin:T.y,selectNodesOnDrag:t.selectNodesOnDrag,onClick:t.onNodeClick,onMouseEnter:t.onNodeMouseEnter,onMouseMove:t.onNodeMouseMove,onMouseLeave:t.onNodeMouseLeave,onContextMenu:t.onNodeContextMenu,onDoubleClick:t.onNodeDoubleClick,selected:!!h.selected,isDraggable:x,isSelectable:y,isConnectable:w,isFocusable:S,resizeObserver:d,dragHandle:h.dragHandle,zIndex:h[$r]?.z??0,isParent:!!h[$r]?.isParent,noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,initialized:!!h.width&&!!h.height,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,ariaLabel:h.ariaLabel,hasHandleBounds:!!h[$r]?.handleBounds})}))};lG.displayName="NodeRenderer";var uCe=b.memo(lG);const dCe=(t,e,n)=>n===kt.Left?t-e:n===kt.Right?t+e:t,hCe=(t,e,n)=>n===kt.Top?t-e:n===kt.Bottom?t+e:t,_D="react-flow__edgeupdater",AD=({position:t,centerX:e,centerY:n,radius:r=10,onMouseDown:s,onMouseEnter:i,onMouseOut:a,type:l})=>oe.createElement("circle",{onMouseDown:s,onMouseEnter:i,onMouseOut:a,className:Ls([_D,`${_D}-${l}`]),cx:dCe(e,r,t),cy:hCe(n,r,t),r,stroke:"transparent",fill:"transparent"}),fCe=()=>!0;var ph=t=>{const e=({id:n,className:r,type:s,data:i,onClick:a,onEdgeDoubleClick:l,selected:c,animated:d,label:h,labelStyle:m,labelShowBg:g,labelBgStyle:x,labelBgPadding:y,labelBgBorderRadius:w,style:S,source:k,target:j,sourceX:N,sourceY:T,targetX:E,targetY:_,sourcePosition:A,targetPosition:D,elementsSelectable:q,hidden:B,sourceHandleId:H,targetHandleId:W,onContextMenu:ee,onMouseEnter:I,onMouseMove:V,onMouseLeave:L,reconnectRadius:$,onReconnect:K,onReconnectStart:Y,onReconnectEnd:R,markerEnd:ie,markerStart:X,rfId:z,ariaLabel:U,isFocusable:te,isReconnectable:ne,pathOptions:G,interactionWidth:se,disableKeyboardA11y:re})=>{const ae=b.useRef(null),[_e,Be]=b.useState(!1),[Ye,Je]=b.useState(!1),Oe=gs(),Ve=b.useMemo(()=>`url('#${aj(X,z)}')`,[X,z]),Ue=b.useMemo(()=>`url('#${aj(ie,z)}')`,[ie,z]);if(B)return null;const $e=Rt=>{const{edges:Hn,addSelectedEdges:We,unselectNodesAndEdges:ot,multiSelectionActive:dn}=Oe.getState(),Pt=Hn.find(xn=>xn.id===n);Pt&&(q&&(Oe.setState({nodesSelectionActive:!1}),Pt.selected&&dn?(ot({nodes:[],edges:[Pt]}),ae.current?.blur()):We([n])),a&&a(Rt,Pt))},jt=s0(n,Oe.getState,l),vt=s0(n,Oe.getState,ee),$n=s0(n,Oe.getState,I),qt=s0(n,Oe.getState,V),un=s0(n,Oe.getState,L),Mt=(Rt,Hn)=>{if(Rt.button!==0)return;const{edges:We,isValidConnection:ot}=Oe.getState(),dn=Hn?j:k,Pt=(Hn?W:H)||null,xn=Hn?"target":"source",dt=ot||fCe,rn=Hn,wt=We.find(lt=>lt.id===n);Je(!0),Y?.(Rt,wt,xn);const Wt=lt=>{Je(!1),R?.(lt,wt,xn)};qW({event:Rt,handleId:Pt,nodeId:dn,onConnect:lt=>K?.(wt,lt),isTarget:rn,getState:Oe.getState,setState:Oe.setState,isValidConnection:dt,edgeUpdaterType:xn,onReconnectEnd:Wt})},ct=Rt=>Mt(Rt,!0),Ne=Rt=>Mt(Rt,!1),ze=()=>Be(!0),rt=()=>Be(!1),bt=!q&&!a,zt=Rt=>{if(!re&&EW.includes(Rt.key)&&q){const{unselectNodesAndEdges:Hn,addSelectedEdges:We,edges:ot}=Oe.getState();Rt.key==="Escape"?(ae.current?.blur(),Hn({edges:[ot.find(Pt=>Pt.id===n)]})):We([n])}};return oe.createElement("g",{className:Ls(["react-flow__edge",`react-flow__edge-${s}`,r,{selected:c,animated:d,inactive:bt,updating:_e}]),onClick:$e,onDoubleClick:jt,onContextMenu:vt,onMouseEnter:$n,onMouseMove:qt,onMouseLeave:un,onKeyDown:te?zt:void 0,tabIndex:te?0:void 0,role:te?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":U===null?void 0:U||`Edge from ${k} to ${j}`,"aria-describedby":te?`${YW}-${z}`:void 0,ref:ae},!Ye&&oe.createElement(t,{id:n,source:k,target:j,selected:c,animated:d,label:h,labelStyle:m,labelShowBg:g,labelBgStyle:x,labelBgPadding:y,labelBgBorderRadius:w,data:i,style:S,sourceX:N,sourceY:T,targetX:E,targetY:_,sourcePosition:A,targetPosition:D,sourceHandleId:H,targetHandleId:W,markerStart:Ve,markerEnd:Ue,pathOptions:G,interactionWidth:se}),ne&&oe.createElement(oe.Fragment,null,(ne==="source"||ne===!0)&&oe.createElement(AD,{position:A,centerX:N,centerY:T,radius:$,onMouseDown:ct,onMouseEnter:ze,onMouseOut:rt,type:"source"}),(ne==="target"||ne===!0)&&oe.createElement(AD,{position:D,centerX:E,centerY:_,radius:$,onMouseDown:Ne,onMouseEnter:ze,onMouseOut:rt,type:"target"})))};return e.displayName="EdgeWrapper",b.memo(e)};function mCe(t){const e={default:ph(t.default||Ly),straight:ph(t.bezier||a7),step:ph(t.step||i7),smoothstep:ph(t.step||sw),simplebezier:ph(t.simplebezier||s7)},n={},r=Object.keys(t).filter(s=>!["default","bezier"].includes(s)).reduce((s,i)=>(s[i]=ph(t[i]||Ly),s),n);return{...e,...r}}function MD(t,e,n=null){const r=(n?.x||0)+e.x,s=(n?.y||0)+e.y,i=n?.width||e.width,a=n?.height||e.height;switch(t){case kt.Top:return{x:r+i/2,y:s};case kt.Right:return{x:r+i,y:s+a/2};case kt.Bottom:return{x:r+i/2,y:s+a};case kt.Left:return{x:r,y:s+a/2}}}function RD(t,e){return t?t.length===1||!e?t[0]:e&&t.find(n=>n.id===e)||null:null}const pCe=(t,e,n,r,s,i)=>{const a=MD(n,t,e),l=MD(i,r,s);return{sourceX:a.x,sourceY:a.y,targetX:l.x,targetY:l.y}};function gCe({sourcePos:t,targetPos:e,sourceWidth:n,sourceHeight:r,targetWidth:s,targetHeight:i,width:a,height:l,transform:c}){const d={x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),x2:Math.max(t.x+n,e.x+s),y2:Math.max(t.y+r,e.y+i)};d.x===d.x2&&(d.x2+=1),d.y===d.y2&&(d.y2+=1);const h=jp({x:(0-c[0])/c[2],y:(0-c[1])/c[2],width:a/c[2],height:l/c[2]}),m=Math.max(0,Math.min(h.x2,d.x2)-Math.max(h.x,d.x)),g=Math.max(0,Math.min(h.y2,d.y2)-Math.max(h.y,d.y));return Math.ceil(m*g)>0}function DD(t){const e=t?.[$r]?.handleBounds||null,n=e&&t?.width&&t?.height&&typeof t?.positionAbsolute?.x<"u"&&typeof t?.positionAbsolute?.y<"u";return[{x:t?.positionAbsolute?.x||0,y:t?.positionAbsolute?.y||0,width:t?.width||0,height:t?.height||0},e,!!n]}const xCe=[{level:0,isMaxLevel:!0,edges:[]}];function vCe(t,e,n=!1){let r=-1;const s=t.reduce((a,l)=>{const c=Ca(l.zIndex);let d=c?l.zIndex:0;if(n){const h=e.get(l.target),m=e.get(l.source),g=l.selected||h?.selected||m?.selected,x=Math.max(m?.[$r]?.z||0,h?.[$r]?.z||0,1e3);d=(c?l.zIndex:0)+(g?x:0)}return a[d]?a[d].push(l):a[d]=[l],r=d>r?d:r,a},{}),i=Object.entries(s).map(([a,l])=>{const c=+a;return{edges:l,level:c,isMaxLevel:c===r}});return i.length===0?xCe:i}function yCe(t,e,n){const r=gr(b.useCallback(s=>t?s.edges.filter(i=>{const a=e.get(i.source),l=e.get(i.target);return a?.width&&a?.height&&l?.width&&l?.height&&gCe({sourcePos:a.positionAbsolute||{x:0,y:0},targetPos:l.positionAbsolute||{x:0,y:0},sourceWidth:a.width,sourceHeight:a.height,targetWidth:l.width,targetHeight:l.height,width:s.width,height:s.height,transform:s.transform})}):s.edges,[t,e]));return vCe(r,e,n)}const bCe=({color:t="none",strokeWidth:e=1})=>oe.createElement("polyline",{style:{stroke:t,strokeWidth:e},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),wCe=({color:t="none",strokeWidth:e=1})=>oe.createElement("polyline",{style:{stroke:t,fill:t,strokeWidth:e},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),PD={[Iy.Arrow]:bCe,[Iy.ArrowClosed]:wCe};function SCe(t){const e=gs();return b.useMemo(()=>Object.prototype.hasOwnProperty.call(PD,t)?PD[t]:(e.getState().onError?.("009",Yl.error009(t)),null),[t])}const kCe=({id:t,type:e,color:n,width:r=12.5,height:s=12.5,markerUnits:i="strokeWidth",strokeWidth:a,orient:l="auto-start-reverse"})=>{const c=SCe(e);return c?oe.createElement("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:l,refX:"0",refY:"0"},oe.createElement(c,{color:n,strokeWidth:a})):null},OCe=({defaultColor:t,rfId:e})=>n=>{const r=[];return n.edges.reduce((s,i)=>([i.markerStart,i.markerEnd].forEach(a=>{if(a&&typeof a=="object"){const l=aj(a,e);r.includes(l)||(s.push({id:l,color:a.color||t,...a}),r.push(l))}}),s),[]).sort((s,i)=>s.id.localeCompare(i.id))},cG=({defaultColor:t,rfId:e})=>{const n=gr(b.useCallback(OCe({defaultColor:t,rfId:e}),[t,e]),(r,s)=>!(r.length!==s.length||r.some((i,a)=>i.id!==s[a].id)));return oe.createElement("defs",null,n.map(r=>oe.createElement(kCe,{id:r.id,key:r.id,type:r.type,color:r.color,width:r.width,height:r.height,markerUnits:r.markerUnits,strokeWidth:r.strokeWidth,orient:r.orient})))};cG.displayName="MarkerDefinitions";var jCe=b.memo(cG);const NCe=t=>({nodesConnectable:t.nodesConnectable,edgesFocusable:t.edgesFocusable,edgesUpdatable:t.edgesUpdatable,elementsSelectable:t.elementsSelectable,width:t.width,height:t.height,connectionMode:t.connectionMode,nodeInternals:t.nodeInternals,onError:t.onError}),uG=({defaultMarkerColor:t,onlyRenderVisibleElements:e,elevateEdgesOnSelect:n,rfId:r,edgeTypes:s,noPanClassName:i,onEdgeContextMenu:a,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:d,onEdgeClick:h,onEdgeDoubleClick:m,onReconnect:g,onReconnectStart:x,onReconnectEnd:y,reconnectRadius:w,children:S,disableKeyboardA11y:k})=>{const{edgesFocusable:j,edgesUpdatable:N,elementsSelectable:T,width:E,height:_,connectionMode:A,nodeInternals:D,onError:q}=gr(NCe,ks),B=yCe(e,D,n);return E?oe.createElement(oe.Fragment,null,B.map(({level:H,edges:W,isMaxLevel:ee})=>oe.createElement("svg",{key:H,style:{zIndex:H},width:E,height:_,className:"react-flow__edges react-flow__container"},ee&&oe.createElement(jCe,{defaultColor:t,rfId:r}),oe.createElement("g",null,W.map(I=>{const[V,L,$]=DD(D.get(I.source)),[K,Y,R]=DD(D.get(I.target));if(!$||!R)return null;let ie=I.type||"default";s[ie]||(q?.("011",Yl.error011(ie)),ie="default");const X=s[ie]||s.default,z=A===vd.Strict?Y.target:(Y.target??[]).concat(Y.source??[]),U=RD(L.source,I.sourceHandle),te=RD(z,I.targetHandle),ne=U?.position||kt.Bottom,G=te?.position||kt.Top,se=!!(I.focusable||j&&typeof I.focusable>"u"),re=I.reconnectable||I.updatable,ae=typeof g<"u"&&(re||N&&typeof re>"u");if(!U||!te)return q?.("008",Yl.error008(U,I)),null;const{sourceX:_e,sourceY:Be,targetX:Ye,targetY:Je}=pCe(V,U,ne,K,te,G);return oe.createElement(X,{key:I.id,id:I.id,className:Ls([I.className,i]),type:ie,data:I.data,selected:!!I.selected,animated:!!I.animated,hidden:!!I.hidden,label:I.label,labelStyle:I.labelStyle,labelShowBg:I.labelShowBg,labelBgStyle:I.labelBgStyle,labelBgPadding:I.labelBgPadding,labelBgBorderRadius:I.labelBgBorderRadius,style:I.style,source:I.source,target:I.target,sourceHandleId:I.sourceHandle,targetHandleId:I.targetHandle,markerEnd:I.markerEnd,markerStart:I.markerStart,sourceX:_e,sourceY:Be,targetX:Ye,targetY:Je,sourcePosition:ne,targetPosition:G,elementsSelectable:T,onContextMenu:a,onMouseEnter:l,onMouseMove:c,onMouseLeave:d,onClick:h,onEdgeDoubleClick:m,onReconnect:g,onReconnectStart:x,onReconnectEnd:y,reconnectRadius:w,rfId:r,ariaLabel:I.ariaLabel,isFocusable:se,isReconnectable:ae,pathOptions:"pathOptions"in I?I.pathOptions:void 0,interactionWidth:I.interactionWidth,disableKeyboardA11y:k})})))),S):null};uG.displayName="EdgeRenderer";var CCe=b.memo(uG);const TCe=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function ECe({children:t}){const e=gr(TCe);return oe.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:e}},t)}function _Ce(t){const e=u7(),n=b.useRef(!1);b.useEffect(()=>{!n.current&&e.viewportInitialized&&t&&(setTimeout(()=>t(e),1),n.current=!0)},[t,e.viewportInitialized])}const ACe={[kt.Left]:kt.Right,[kt.Right]:kt.Left,[kt.Top]:kt.Bottom,[kt.Bottom]:kt.Top},dG=({nodeId:t,handleType:e,style:n,type:r=qc.Bezier,CustomComponent:s,connectionStatus:i})=>{const{fromNode:a,handleId:l,toX:c,toY:d,connectionMode:h}=gr(b.useCallback(_=>({fromNode:_.nodeInternals.get(t),handleId:_.connectionHandleId,toX:(_.connectionPosition.x-_.transform[0])/_.transform[2],toY:(_.connectionPosition.y-_.transform[1])/_.transform[2],connectionMode:_.connectionMode}),[t]),ks),m=a?.[$r]?.handleBounds;let g=m?.[e];if(h===vd.Loose&&(g=g||m?.[e==="source"?"target":"source"]),!a||!g)return null;const x=l?g.find(_=>_.id===l):g[0],y=x?x.x+x.width/2:(a.width??0)/2,w=x?x.y+x.height/2:a.height??0,S=(a.positionAbsolute?.x??0)+y,k=(a.positionAbsolute?.y??0)+w,j=x?.position,N=j?ACe[j]:null;if(!j||!N)return null;if(s)return oe.createElement(s,{connectionLineType:r,connectionLineStyle:n,fromNode:a,fromHandle:x,fromX:S,fromY:k,toX:c,toY:d,fromPosition:j,toPosition:N,connectionStatus:i});let T="";const E={sourceX:S,sourceY:k,sourcePosition:j,targetX:c,targetY:d,targetPosition:N};return r===qc.Bezier?[T]=DW(E):r===qc.Step?[T]=ij({...E,borderRadius:0}):r===qc.SmoothStep?[T]=ij(E):r===qc.SimpleBezier?[T]=RW(E):T=`M${S},${k} ${c},${d}`,oe.createElement("path",{d:T,fill:"none",className:"react-flow__connection-path",style:n})};dG.displayName="ConnectionLine";const MCe=t=>({nodeId:t.connectionNodeId,handleType:t.connectionHandleType,nodesConnectable:t.nodesConnectable,connectionStatus:t.connectionStatus,width:t.width,height:t.height});function RCe({containerStyle:t,style:e,type:n,component:r}){const{nodeId:s,handleType:i,nodesConnectable:a,width:l,height:c,connectionStatus:d}=gr(MCe,ks);return!(s&&i&&l&&a)?null:oe.createElement("svg",{style:t,width:l,height:c,className:"react-flow__edges react-flow__connectionline react-flow__container"},oe.createElement("g",{className:Ls(["react-flow__connection",d])},oe.createElement(dG,{nodeId:s,handleType:i,style:e,type:n,CustomComponent:r,connectionStatus:d})))}function zD(t,e){return b.useRef(null),gs(),b.useMemo(()=>e(t),[t])}const hG=({nodeTypes:t,edgeTypes:e,onMove:n,onMoveStart:r,onMoveEnd:s,onInit:i,onNodeClick:a,onEdgeClick:l,onNodeDoubleClick:c,onEdgeDoubleClick:d,onNodeMouseEnter:h,onNodeMouseMove:m,onNodeMouseLeave:g,onNodeContextMenu:x,onSelectionContextMenu:y,onSelectionStart:w,onSelectionEnd:S,connectionLineType:k,connectionLineStyle:j,connectionLineComponent:N,connectionLineContainerStyle:T,selectionKeyCode:E,selectionOnDrag:_,selectionMode:A,multiSelectionKeyCode:D,panActivationKeyCode:q,zoomActivationKeyCode:B,deleteKeyCode:H,onlyRenderVisibleElements:W,elementsSelectable:ee,selectNodesOnDrag:I,defaultViewport:V,translateExtent:L,minZoom:$,maxZoom:K,preventScrolling:Y,defaultMarkerColor:R,zoomOnScroll:ie,zoomOnPinch:X,panOnScroll:z,panOnScrollSpeed:U,panOnScrollMode:te,zoomOnDoubleClick:ne,panOnDrag:G,onPaneClick:se,onPaneMouseEnter:re,onPaneMouseMove:ae,onPaneMouseLeave:_e,onPaneScroll:Be,onPaneContextMenu:Ye,onEdgeContextMenu:Je,onEdgeMouseEnter:Oe,onEdgeMouseMove:Ve,onEdgeMouseLeave:Ue,onReconnect:$e,onReconnectStart:jt,onReconnectEnd:vt,reconnectRadius:$n,noDragClassName:qt,noWheelClassName:un,noPanClassName:Mt,elevateEdgesOnSelect:ct,disableKeyboardA11y:Ne,nodeOrigin:ze,nodeExtent:rt,rfId:bt})=>{const zt=zD(t,oCe),Rt=zD(e,mCe);return _Ce(i),oe.createElement(iCe,{onPaneClick:se,onPaneMouseEnter:re,onPaneMouseMove:ae,onPaneMouseLeave:_e,onPaneContextMenu:Ye,onPaneScroll:Be,deleteKeyCode:H,selectionKeyCode:E,selectionOnDrag:_,selectionMode:A,onSelectionStart:w,onSelectionEnd:S,multiSelectionKeyCode:D,panActivationKeyCode:q,zoomActivationKeyCode:B,elementsSelectable:ee,onMove:n,onMoveStart:r,onMoveEnd:s,zoomOnScroll:ie,zoomOnPinch:X,zoomOnDoubleClick:ne,panOnScroll:z,panOnScrollSpeed:U,panOnScrollMode:te,panOnDrag:G,defaultViewport:V,translateExtent:L,minZoom:$,maxZoom:K,onSelectionContextMenu:y,preventScrolling:Y,noDragClassName:qt,noWheelClassName:un,noPanClassName:Mt,disableKeyboardA11y:Ne},oe.createElement(ECe,null,oe.createElement(CCe,{edgeTypes:Rt,onEdgeClick:l,onEdgeDoubleClick:d,onlyRenderVisibleElements:W,onEdgeContextMenu:Je,onEdgeMouseEnter:Oe,onEdgeMouseMove:Ve,onEdgeMouseLeave:Ue,onReconnect:$e,onReconnectStart:jt,onReconnectEnd:vt,reconnectRadius:$n,defaultMarkerColor:R,noPanClassName:Mt,elevateEdgesOnSelect:!!ct,disableKeyboardA11y:Ne,rfId:bt},oe.createElement(RCe,{style:j,type:k,component:N,containerStyle:T})),oe.createElement("div",{className:"react-flow__edgelabel-renderer"}),oe.createElement(uCe,{nodeTypes:zt,onNodeClick:a,onNodeDoubleClick:c,onNodeMouseEnter:h,onNodeMouseMove:m,onNodeMouseLeave:g,onNodeContextMenu:x,selectNodesOnDrag:I,onlyRenderVisibleElements:W,noPanClassName:Mt,noDragClassName:qt,disableKeyboardA11y:Ne,nodeOrigin:ze,nodeExtent:rt,rfId:bt})))};hG.displayName="GraphView";var DCe=b.memo(hG);const uj=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Mc={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:uj,nodeExtent:uj,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:vd.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:l7e,isValidConnection:void 0},PCe=()=>XOe((t,e)=>({...Mc,setNodes:n=>{const{nodeInternals:r,nodeOrigin:s,elevateNodesOnSelect:i}=e();t({nodeInternals:m5(n,r,s,i)})},getNodes:()=>Array.from(e().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:r={}}=e();t({edges:n.map(s=>({...r,...s}))})},setDefaultNodesAndEdges:(n,r)=>{const s=typeof n<"u",i=typeof r<"u",a=s?m5(n,new Map,e().nodeOrigin,e().elevateNodesOnSelect):new Map;t({nodeInternals:a,edges:i?r:[],hasDefaultNodes:s,hasDefaultEdges:i})},updateNodeDimensions:n=>{const{onNodesChange:r,nodeInternals:s,fitViewOnInit:i,fitViewOnInitDone:a,fitViewOnInitOptions:l,domNode:c,nodeOrigin:d}=e(),h=c?.querySelector(".react-flow__viewport");if(!h)return;const m=window.getComputedStyle(h),{m22:g}=new window.DOMMatrixReadOnly(m.transform),x=n.reduce((w,S)=>{const k=s.get(S.id);if(k?.hidden)s.set(k.id,{...k,[$r]:{...k[$r],handleBounds:void 0}});else if(k){const j=n7(S.nodeElement);!!(j.width&&j.height&&(k.width!==j.width||k.height!==j.height||S.forceUpdate))&&(s.set(k.id,{...k,[$r]:{...k[$r],handleBounds:{source:ED(".source",S.nodeElement,g,d),target:ED(".target",S.nodeElement,g,d)}},...j}),w.push({id:k.id,type:"dimensions",dimensions:j}))}return w},[]);ZW(s,d);const y=a||i&&!a&&JW(e,{initial:!0,...l});t({nodeInternals:new Map(s),fitViewOnInitDone:y}),x?.length>0&&r?.(x)},updateNodePositions:(n,r=!0,s=!1)=>{const{triggerNodeChanges:i}=e(),a=n.map(l=>{const c={id:l.id,type:"position",dragging:s};return r&&(c.positionAbsolute=l.positionAbsolute,c.position=l.position),c});i(a)},triggerNodeChanges:n=>{const{onNodesChange:r,nodeInternals:s,hasDefaultNodes:i,nodeOrigin:a,getNodes:l,elevateNodesOnSelect:c}=e();if(n?.length){if(i){const d=tG(n,l()),h=m5(d,s,a,c);t({nodeInternals:h})}r?.(n)}},addSelectedNodes:n=>{const{multiSelectionActive:r,edges:s,getNodes:i}=e();let a,l=null;r?a=n.map(c=>Lc(c,!0)):(a=Ah(i(),n),l=Ah(s,[])),X1({changedNodes:a,changedEdges:l,get:e,set:t})},addSelectedEdges:n=>{const{multiSelectionActive:r,edges:s,getNodes:i}=e();let a,l=null;r?a=n.map(c=>Lc(c,!0)):(a=Ah(s,n),l=Ah(i(),[])),X1({changedNodes:l,changedEdges:a,get:e,set:t})},unselectNodesAndEdges:({nodes:n,edges:r}={})=>{const{edges:s,getNodes:i}=e(),a=n||i(),l=r||s,c=a.map(h=>(h.selected=!1,Lc(h.id,!1))),d=l.map(h=>Lc(h.id,!1));X1({changedNodes:c,changedEdges:d,get:e,set:t})},setMinZoom:n=>{const{d3Zoom:r,maxZoom:s}=e();r?.scaleExtent([n,s]),t({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:r,minZoom:s}=e();r?.scaleExtent([s,n]),t({maxZoom:n})},setTranslateExtent:n=>{e().d3Zoom?.translateExtent(n),t({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:r}=e(),i=r().filter(l=>l.selected).map(l=>Lc(l.id,!1)),a=n.filter(l=>l.selected).map(l=>Lc(l.id,!1));X1({changedNodes:i,changedEdges:a,get:e,set:t})},setNodeExtent:n=>{const{nodeInternals:r}=e();r.forEach(s=>{s.positionAbsolute=r7(s.position,n)}),t({nodeExtent:n,nodeInternals:new Map(r)})},panBy:n=>{const{transform:r,width:s,height:i,d3Zoom:a,d3Selection:l,translateExtent:c}=e();if(!a||!l||!n.x&&!n.y)return!1;const d=$l.translate(r[0]+n.x,r[1]+n.y).scale(r[2]),h=[[0,0],[s,i]],m=a?.constrain()(d,h,c);return a.transform(l,m),r[0]!==m.x||r[1]!==m.y||r[2]!==m.k},cancelConnection:()=>t({connectionNodeId:Mc.connectionNodeId,connectionHandleId:Mc.connectionHandleId,connectionHandleType:Mc.connectionHandleType,connectionStatus:Mc.connectionStatus,connectionStartHandle:Mc.connectionStartHandle,connectionEndHandle:Mc.connectionEndHandle}),reset:()=>t({...Mc})}),Object.is),fG=({children:t})=>{const e=b.useRef(null);return e.current||(e.current=PCe()),oe.createElement(t7e,{value:e.current},t)};fG.displayName="ReactFlowProvider";const mG=({children:t})=>b.useContext(nw)?oe.createElement(oe.Fragment,null,t):oe.createElement(fG,null,t);mG.displayName="ReactFlowWrapper";const zCe={input:VW,default:lj,output:WW,group:c7},ICe={default:Ly,straight:a7,step:i7,smoothstep:sw,simplebezier:s7},LCe=[0,0],BCe=[15,15],FCe={x:0,y:0,zoom:1},qCe={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},pG=b.forwardRef(({nodes:t,edges:e,defaultNodes:n,defaultEdges:r,className:s,nodeTypes:i=zCe,edgeTypes:a=ICe,onNodeClick:l,onEdgeClick:c,onInit:d,onMove:h,onMoveStart:m,onMoveEnd:g,onConnect:x,onConnectStart:y,onConnectEnd:w,onClickConnectStart:S,onClickConnectEnd:k,onNodeMouseEnter:j,onNodeMouseMove:N,onNodeMouseLeave:T,onNodeContextMenu:E,onNodeDoubleClick:_,onNodeDragStart:A,onNodeDrag:D,onNodeDragStop:q,onNodesDelete:B,onEdgesDelete:H,onSelectionChange:W,onSelectionDragStart:ee,onSelectionDrag:I,onSelectionDragStop:V,onSelectionContextMenu:L,onSelectionStart:$,onSelectionEnd:K,connectionMode:Y=vd.Strict,connectionLineType:R=qc.Bezier,connectionLineStyle:ie,connectionLineComponent:X,connectionLineContainerStyle:z,deleteKeyCode:U="Backspace",selectionKeyCode:te="Shift",selectionOnDrag:ne=!1,selectionMode:G=Np.Full,panActivationKeyCode:se="Space",multiSelectionKeyCode:re=zy()?"Meta":"Control",zoomActivationKeyCode:ae=zy()?"Meta":"Control",snapToGrid:_e=!1,snapGrid:Be=BCe,onlyRenderVisibleElements:Ye=!1,selectNodesOnDrag:Je=!0,nodesDraggable:Oe,nodesConnectable:Ve,nodesFocusable:Ue,nodeOrigin:$e=LCe,edgesFocusable:jt,edgesUpdatable:vt,elementsSelectable:$n,defaultViewport:qt=FCe,minZoom:un=.5,maxZoom:Mt=2,translateExtent:ct=uj,preventScrolling:Ne=!0,nodeExtent:ze,defaultMarkerColor:rt="#b1b1b7",zoomOnScroll:bt=!0,zoomOnPinch:zt=!0,panOnScroll:Rt=!1,panOnScrollSpeed:Hn=.5,panOnScrollMode:We=Yu.Free,zoomOnDoubleClick:ot=!0,panOnDrag:dn=!0,onPaneClick:Pt,onPaneMouseEnter:xn,onPaneMouseMove:dt,onPaneMouseLeave:rn,onPaneScroll:wt,onPaneContextMenu:Wt,children:Gt,onEdgeContextMenu:lt,onEdgeDoubleClick:ve,onEdgeMouseEnter:He,onEdgeMouseMove:ht,onEdgeMouseLeave:vn,onEdgeUpdate:Qn,onEdgeUpdateStart:fr,onEdgeUpdateEnd:ar,onReconnect:xs,onReconnectStart:vs,onReconnectEnd:js,reconnectRadius:ge=10,edgeUpdaterRadius:Ie=10,onNodesChange:Et,onEdgesChange:kn,noDragClassName:Hr="nodrag",noWheelClassName:Mr="nowheel",noPanClassName:Rr="nopan",fitView:Ns=!1,fitViewOptions:Vf,connectOnClick:hw=!0,attributionPosition:fw,proOptions:Dg,defaultEdgeOptions:xu,elevateNodesOnSelect:Uf=!0,elevateEdgesOnSelect:rc=!1,disableKeyboardA11y:Jo=!1,autoPanOnConnect:vu=!0,autoPanOnNodeDrag:sc=!0,connectionRadius:Kr=20,isValidConnection:Pg,onError:zg,style:el,id:tl,nodeDragThreshold:mw,...Ig},Lg)=>{const Wf=tl||"1";return oe.createElement("div",{...Ig,style:{...el,...qCe},ref:Lg,className:Ls(["react-flow",s]),"data-testid":"rf__wrapper",id:tl},oe.createElement(mG,null,oe.createElement(DCe,{onInit:d,onMove:h,onMoveStart:m,onMoveEnd:g,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:j,onNodeMouseMove:N,onNodeMouseLeave:T,onNodeContextMenu:E,onNodeDoubleClick:_,nodeTypes:i,edgeTypes:a,connectionLineType:R,connectionLineStyle:ie,connectionLineComponent:X,connectionLineContainerStyle:z,selectionKeyCode:te,selectionOnDrag:ne,selectionMode:G,deleteKeyCode:U,multiSelectionKeyCode:re,panActivationKeyCode:se,zoomActivationKeyCode:ae,onlyRenderVisibleElements:Ye,selectNodesOnDrag:Je,defaultViewport:qt,translateExtent:ct,minZoom:un,maxZoom:Mt,preventScrolling:Ne,zoomOnScroll:bt,zoomOnPinch:zt,zoomOnDoubleClick:ot,panOnScroll:Rt,panOnScrollSpeed:Hn,panOnScrollMode:We,panOnDrag:dn,onPaneClick:Pt,onPaneMouseEnter:xn,onPaneMouseMove:dt,onPaneMouseLeave:rn,onPaneScroll:wt,onPaneContextMenu:Wt,onSelectionContextMenu:L,onSelectionStart:$,onSelectionEnd:K,onEdgeContextMenu:lt,onEdgeDoubleClick:ve,onEdgeMouseEnter:He,onEdgeMouseMove:ht,onEdgeMouseLeave:vn,onReconnect:xs??Qn,onReconnectStart:vs??fr,onReconnectEnd:js??ar,reconnectRadius:ge??Ie,defaultMarkerColor:rt,noDragClassName:Hr,noWheelClassName:Mr,noPanClassName:Rr,elevateEdgesOnSelect:rc,rfId:Wf,disableKeyboardA11y:Jo,nodeOrigin:$e,nodeExtent:ze}),oe.createElement(A7e,{nodes:t,edges:e,defaultNodes:n,defaultEdges:r,onConnect:x,onConnectStart:y,onConnectEnd:w,onClickConnectStart:S,onClickConnectEnd:k,nodesDraggable:Oe,nodesConnectable:Ve,nodesFocusable:Ue,edgesFocusable:jt,edgesUpdatable:vt,elementsSelectable:$n,elevateNodesOnSelect:Uf,minZoom:un,maxZoom:Mt,nodeExtent:ze,onNodesChange:Et,onEdgesChange:kn,snapToGrid:_e,snapGrid:Be,connectionMode:Y,translateExtent:ct,connectOnClick:hw,defaultEdgeOptions:xu,fitView:Ns,fitViewOptions:Vf,onNodesDelete:B,onEdgesDelete:H,onNodeDragStart:A,onNodeDrag:D,onNodeDragStop:q,onSelectionDrag:I,onSelectionDragStart:ee,onSelectionDragStop:V,noPanClassName:Rr,nodeOrigin:$e,rfId:Wf,autoPanOnConnect:vu,autoPanOnNodeDrag:sc,onError:zg,connectionRadius:Kr,isValidConnection:Pg,nodeDragThreshold:mw}),oe.createElement(E7e,{onSelectionChange:W}),Gt,oe.createElement(r7e,{proOptions:Dg,position:fw}),oe.createElement(z7e,{rfId:Wf,disableKeyboardA11y:Jo})))});pG.displayName="ReactFlow";function gG(t){return e=>{const[n,r]=b.useState(e),s=b.useCallback(i=>r(a=>t(i,a)),[]);return[n,r,s]}}const $Ce=gG(tG),HCe=gG(Y7e),xG=({id:t,x:e,y:n,width:r,height:s,style:i,color:a,strokeColor:l,strokeWidth:c,className:d,borderRadius:h,shapeRendering:m,onClick:g,selected:x})=>{const{background:y,backgroundColor:w}=i||{},S=a||y||w;return oe.createElement("rect",{className:Ls(["react-flow__minimap-node",{selected:x},d]),x:e,y:n,rx:h,ry:h,width:r,height:s,fill:S,stroke:l,strokeWidth:c,shapeRendering:m,onClick:g?k=>g(k,t):void 0})};xG.displayName="MiniMapNode";var QCe=b.memo(xG);const VCe=t=>t.nodeOrigin,UCe=t=>t.getNodes().filter(e=>!e.hidden&&e.width&&e.height),v5=t=>t instanceof Function?t:()=>t;function WCe({nodeStrokeColor:t="transparent",nodeColor:e="#e2e2e2",nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:s=2,nodeComponent:i=QCe,onClick:a}){const l=gr(UCe,ks),c=gr(VCe),d=v5(e),h=v5(t),m=v5(n),g=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return oe.createElement(oe.Fragment,null,l.map(x=>{const{x:y,y:w}=id(x,c).positionAbsolute;return oe.createElement(i,{key:x.id,x:y,y:w,width:x.width,height:x.height,style:x.style,selected:x.selected,className:m(x),color:d(x),borderRadius:r,strokeColor:h(x),strokeWidth:s,shapeRendering:g,onClick:a,id:x.id})}))}var GCe=b.memo(WCe);const XCe=200,YCe=150,KCe=t=>{const e=t.getNodes(),n={x:-t.transform[0]/t.transform[2],y:-t.transform[1]/t.transform[2],width:t.width/t.transform[2],height:t.height/t.transform[2]};return{viewBB:n,boundingRect:e.length>0?a7e(iw(e,t.nodeOrigin),n):n,rfId:t.rfId}},ZCe="react-flow__minimap-desc";function vG({style:t,className:e,nodeStrokeColor:n="transparent",nodeColor:r="#e2e2e2",nodeClassName:s="",nodeBorderRadius:i=5,nodeStrokeWidth:a=2,nodeComponent:l,maskColor:c="rgb(240, 240, 240, 0.6)",maskStrokeColor:d="none",maskStrokeWidth:h=1,position:m="bottom-right",onClick:g,onNodeClick:x,pannable:y=!1,zoomable:w=!1,ariaLabel:S="React Flow mini map",inversePan:k=!1,zoomStep:j=10,offsetScale:N=5}){const T=gs(),E=b.useRef(null),{boundingRect:_,viewBB:A,rfId:D}=gr(KCe,ks),q=t?.width??XCe,B=t?.height??YCe,H=_.width/q,W=_.height/B,ee=Math.max(H,W),I=ee*q,V=ee*B,L=N*ee,$=_.x-(I-_.width)/2-L,K=_.y-(V-_.height)/2-L,Y=I+L*2,R=V+L*2,ie=`${ZCe}-${D}`,X=b.useRef(0);X.current=ee,b.useEffect(()=>{if(E.current){const te=va(E.current),ne=re=>{const{transform:ae,d3Selection:_e,d3Zoom:Be}=T.getState();if(re.sourceEvent.type!=="wheel"||!_e||!Be)return;const Ye=-re.sourceEvent.deltaY*(re.sourceEvent.deltaMode===1?.05:re.sourceEvent.deltaMode?1:.002)*j,Je=ae[2]*Math.pow(2,Ye);Be.scaleTo(_e,Je)},G=re=>{const{transform:ae,d3Selection:_e,d3Zoom:Be,translateExtent:Ye,width:Je,height:Oe}=T.getState();if(re.sourceEvent.type!=="mousemove"||!_e||!Be)return;const Ve=X.current*Math.max(1,ae[2])*(k?-1:1),Ue={x:ae[0]-re.sourceEvent.movementX*Ve,y:ae[1]-re.sourceEvent.movementY*Ve},$e=[[0,0],[Je,Oe]],jt=$l.translate(Ue.x,Ue.y).scale(ae[2]),vt=Be.constrain()(jt,$e,Ye);Be.transform(_e,vt)},se=kW().on("zoom",y?G:null).on("zoom.wheel",w?ne:null);return te.call(se),()=>{te.on("zoom",null)}}},[y,w,k,j]);const z=g?te=>{const ne=Qa(te);g(te,{x:ne[0],y:ne[1]})}:void 0,U=x?(te,ne)=>{const G=T.getState().nodeInternals.get(ne);x(te,G)}:void 0;return oe.createElement(rw,{position:m,style:t,className:Ls(["react-flow__minimap",e]),"data-testid":"rf__minimap"},oe.createElement("svg",{width:q,height:B,viewBox:`${$} ${K} ${Y} ${R}`,role:"img","aria-labelledby":ie,ref:E,onClick:z},S&&oe.createElement("title",{id:ie},S),oe.createElement(GCe,{onClick:U,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:s,nodeStrokeWidth:a,nodeComponent:l}),oe.createElement("path",{className:"react-flow__minimap-mask",d:`M${$-L},${K-L}h${Y+L*2}v${R+L*2}h${-Y-L*2}z
|
||
M${A.x},${A.y}h${A.width}v${A.height}h${-A.width}z`,fill:c,fillRule:"evenodd",stroke:d,strokeWidth:h,pointerEvents:"none"})))}vG.displayName="MiniMap";var JCe=b.memo(vG);function e8e(){return oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},oe.createElement("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"}))}function t8e(){return oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},oe.createElement("path",{d:"M0 0h32v4.2H0z"}))}function n8e(){return oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},oe.createElement("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"}))}function r8e(){return oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},oe.createElement("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"}))}function s8e(){return oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},oe.createElement("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"}))}const g0=({children:t,className:e,...n})=>oe.createElement("button",{type:"button",className:Ls(["react-flow__controls-button",e]),...n},t);g0.displayName="ControlButton";const i8e=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom}),yG=({style:t,showZoom:e=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:i,onZoomOut:a,onFitView:l,onInteractiveChange:c,className:d,children:h,position:m="bottom-left"})=>{const g=gs(),[x,y]=b.useState(!1),{isInteractive:w,minZoomReached:S,maxZoomReached:k}=gr(i8e,ks),{zoomIn:j,zoomOut:N,fitView:T}=u7();if(b.useEffect(()=>{y(!0)},[]),!x)return null;const E=()=>{j(),i?.()},_=()=>{N(),a?.()},A=()=>{T(s),l?.()},D=()=>{g.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),c?.(!w)};return oe.createElement(rw,{className:Ls(["react-flow__controls",d]),position:m,style:t,"data-testid":"rf__controls"},e&&oe.createElement(oe.Fragment,null,oe.createElement(g0,{onClick:E,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:k},oe.createElement(e8e,null)),oe.createElement(g0,{onClick:_,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:S},oe.createElement(t8e,null))),n&&oe.createElement(g0,{className:"react-flow__controls-fitview",onClick:A,title:"fit view","aria-label":"fit view"},oe.createElement(n8e,null)),r&&oe.createElement(g0,{className:"react-flow__controls-interactive",onClick:D,title:"toggle interactivity","aria-label":"toggle interactivity"},w?oe.createElement(s8e,null):oe.createElement(r8e,null)),h)};yG.displayName="Controls";var a8e=b.memo(yG),Ea;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(Ea||(Ea={}));function o8e({color:t,dimensions:e,lineWidth:n}){return oe.createElement("path",{stroke:t,strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`})}function l8e({color:t,radius:e}){return oe.createElement("circle",{cx:e,cy:e,r:e,fill:t})}const c8e={[Ea.Dots]:"#91919a",[Ea.Lines]:"#eee",[Ea.Cross]:"#e2e2e2"},u8e={[Ea.Dots]:1,[Ea.Lines]:1,[Ea.Cross]:6},d8e=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function bG({id:t,variant:e=Ea.Dots,gap:n=20,size:r,lineWidth:s=1,offset:i=2,color:a,style:l,className:c}){const d=b.useRef(null),{transform:h,patternId:m}=gr(d8e,ks),g=a||c8e[e],x=r||u8e[e],y=e===Ea.Dots,w=e===Ea.Cross,S=Array.isArray(n)?n:[n,n],k=[S[0]*h[2]||1,S[1]*h[2]||1],j=x*h[2],N=w?[j,j]:k,T=y?[j/i,j/i]:[N[0]/i,N[1]/i];return oe.createElement("svg",{className:Ls(["react-flow__background",c]),style:{...l,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:d,"data-testid":"rf__background"},oe.createElement("pattern",{id:m+t,x:h[0]%k[0],y:h[1]%k[1],width:k[0],height:k[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${T[0]},-${T[1]})`},y?oe.createElement(l8e,{color:g,radius:j/i}):oe.createElement(o8e,{dimensions:N,color:g,lineWidth:s})),oe.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${m+t})`}))}bG.displayName="Background";var h8e=b.memo(bG);function h7(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var y5,ID;function f8e(){if(ID)return y5;ID=1;var t=Vz(),e=4;function n(r){return t(r,e)}return y5=n,y5}var b5,LD;function wG(){if(LD)return b5;LD=1;var t=HJ();function e(n){return typeof n=="function"?n:t}return b5=e,b5}var w5,BD;function SG(){if(BD)return w5;BD=1;var t=Uz(),e=wj(),n=wG(),r=bd();function s(i,a){var l=r(i)?t:e;return l(i,n(a))}return w5=s,w5}var S5,FD;function kG(){return FD||(FD=1,S5=SG()),S5}var k5,qD;function m8e(){if(qD)return k5;qD=1;var t=wj();function e(n,r){var s=[];return t(n,function(i,a,l){r(i,a,l)&&s.push(i)}),s}return k5=e,k5}var O5,$D;function OG(){if($D)return O5;$D=1;var t=QJ(),e=m8e(),n=Sj(),r=bd();function s(i,a){var l=r(i)?t:e;return l(i,n(a,3))}return O5=s,O5}var j5,HD;function p8e(){if(HD)return j5;HD=1;var t=Object.prototype,e=t.hasOwnProperty;function n(r,s){return r!=null&&e.call(r,s)}return j5=n,j5}var N5,QD;function jG(){if(QD)return N5;QD=1;var t=p8e(),e=VJ();function n(r,s){return r!=null&&e(r,s,t)}return N5=n,N5}var C5,VD;function g8e(){if(VD)return C5;VD=1;var t=Wz(),e=Gz(),n=Xz(),r=bd(),s=kj(),i=Oj(),a=UJ(),l=jj(),c="[object Map]",d="[object Set]",h=Object.prototype,m=h.hasOwnProperty;function g(x){if(x==null)return!0;if(s(x)&&(r(x)||typeof x=="string"||typeof x.splice=="function"||i(x)||l(x)||n(x)))return!x.length;var y=e(x);if(y==c||y==d)return!x.size;if(a(x))return!t(x).length;for(var w in x)if(m.call(x,w))return!1;return!0}return C5=g,C5}var T5,UD;function NG(){if(UD)return T5;UD=1;function t(e){return e===void 0}return T5=t,T5}var E5,WD;function x8e(){if(WD)return E5;WD=1;function t(e,n,r,s){var i=-1,a=e==null?0:e.length;for(s&&a&&(r=e[++i]);++i<a;)r=n(r,e[i],i,e);return r}return E5=t,E5}var _5,GD;function v8e(){if(GD)return _5;GD=1;function t(e,n,r,s,i){return i(e,function(a,l,c){r=s?(s=!1,a):n(r,a,l,c)}),r}return _5=t,_5}var A5,XD;function CG(){if(XD)return A5;XD=1;var t=x8e(),e=wj(),n=Sj(),r=v8e(),s=bd();function i(a,l,c){var d=s(a)?t:r,h=arguments.length<3;return d(a,n(l,4),c,h,e)}return A5=i,A5}var M5,YD;function y8e(){if(YD)return M5;YD=1;var t=WJ(),e=t("length");return M5=e,M5}var R5,KD;function b8e(){if(KD)return R5;KD=1;var t="\\ud800-\\udfff",e="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",s=e+n+r,i="\\ufe0e\\ufe0f",a="["+t+"]",l="["+s+"]",c="\\ud83c[\\udffb-\\udfff]",d="(?:"+l+"|"+c+")",h="[^"+t+"]",m="(?:\\ud83c[\\udde6-\\uddff]){2}",g="[\\ud800-\\udbff][\\udc00-\\udfff]",x="\\u200d",y=d+"?",w="["+i+"]?",S="(?:"+x+"(?:"+[h,m,g].join("|")+")"+w+y+")*",k=w+y+S,j="(?:"+[h+l+"?",l,m,g,a].join("|")+")",N=RegExp(c+"(?="+c+")|"+j+k,"g");function T(E){for(var _=N.lastIndex=0;N.test(E);)++_;return _}return R5=T,R5}var D5,ZD;function w8e(){if(ZD)return D5;ZD=1;var t=y8e(),e=GJ(),n=b8e();function r(s){return e(s)?n(s):t(s)}return D5=r,D5}var P5,JD;function S8e(){if(JD)return P5;JD=1;var t=Wz(),e=Gz(),n=kj(),r=XJ(),s=w8e(),i="[object Map]",a="[object Set]";function l(c){if(c==null)return 0;if(n(c))return r(c)?s(c):c.length;var d=e(c);return d==i||d==a?c.size:t(c).length}return P5=l,P5}var z5,eP;function k8e(){if(eP)return z5;eP=1;var t=Uz(),e=YJ(),n=KJ(),r=Sj(),s=ZJ(),i=bd(),a=Oj(),l=Nj(),c=$y(),d=jj();function h(m,g,x){var y=i(m),w=y||a(m)||d(m);if(g=r(g,4),x==null){var S=m&&m.constructor;w?x=y?new S:[]:c(m)?x=l(S)?e(s(m)):{}:x={}}return(w?t:n)(m,function(k,j,N){return g(x,k,j,N)}),x}return z5=h,z5}var I5,tP;function TG(){if(tP)return I5;tP=1;var t=kj(),e=JJ();function n(r){return e(r)&&t(r)}return I5=n,I5}var L5,nP;function O8e(){if(nP)return L5;nP=1;var t=eee(),e=Cj(),n=tee(),r=TG(),s=e(function(i){return n(t(i,1,r,!0))});return L5=s,L5}var B5,rP;function j8e(){if(rP)return B5;rP=1;var t=nee();function e(n,r){return t(r,function(s){return n[s]})}return B5=e,B5}var F5,sP;function EG(){if(sP)return F5;sP=1;var t=j8e(),e=Yz();function n(r){return r==null?[]:t(r,e(r))}return F5=n,F5}var q5,iP;function Ia(){if(iP)return q5;iP=1;var t;if(typeof h7=="function")try{t={clone:f8e(),constant:Zz(),each:kG(),filter:OG(),has:jG(),isArray:bd(),isEmpty:g8e(),isFunction:Nj(),isUndefined:NG(),keys:Yz(),map:Kz(),reduce:CG(),size:S8e(),transform:k8e(),union:O8e(),values:EG()}}catch{}return t||(t=window._),q5=t,q5}var $5,aP;function f7(){if(aP)return $5;aP=1;var t=Ia();$5=s;var e="\0",n="\0",r="";function s(h){this._isDirected=t.has(h,"directed")?h.directed:!0,this._isMultigraph=t.has(h,"multigraph")?h.multigraph:!1,this._isCompound=t.has(h,"compound")?h.compound:!1,this._label=void 0,this._defaultNodeLabelFn=t.constant(void 0),this._defaultEdgeLabelFn=t.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[n]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}s.prototype._nodeCount=0,s.prototype._edgeCount=0,s.prototype.isDirected=function(){return this._isDirected},s.prototype.isMultigraph=function(){return this._isMultigraph},s.prototype.isCompound=function(){return this._isCompound},s.prototype.setGraph=function(h){return this._label=h,this},s.prototype.graph=function(){return this._label},s.prototype.setDefaultNodeLabel=function(h){return t.isFunction(h)||(h=t.constant(h)),this._defaultNodeLabelFn=h,this},s.prototype.nodeCount=function(){return this._nodeCount},s.prototype.nodes=function(){return t.keys(this._nodes)},s.prototype.sources=function(){var h=this;return t.filter(this.nodes(),function(m){return t.isEmpty(h._in[m])})},s.prototype.sinks=function(){var h=this;return t.filter(this.nodes(),function(m){return t.isEmpty(h._out[m])})},s.prototype.setNodes=function(h,m){var g=arguments,x=this;return t.each(h,function(y){g.length>1?x.setNode(y,m):x.setNode(y)}),this},s.prototype.setNode=function(h,m){return t.has(this._nodes,h)?(arguments.length>1&&(this._nodes[h]=m),this):(this._nodes[h]=arguments.length>1?m:this._defaultNodeLabelFn(h),this._isCompound&&(this._parent[h]=n,this._children[h]={},this._children[n][h]=!0),this._in[h]={},this._preds[h]={},this._out[h]={},this._sucs[h]={},++this._nodeCount,this)},s.prototype.node=function(h){return this._nodes[h]},s.prototype.hasNode=function(h){return t.has(this._nodes,h)},s.prototype.removeNode=function(h){var m=this;if(t.has(this._nodes,h)){var g=function(x){m.removeEdge(m._edgeObjs[x])};delete this._nodes[h],this._isCompound&&(this._removeFromParentsChildList(h),delete this._parent[h],t.each(this.children(h),function(x){m.setParent(x)}),delete this._children[h]),t.each(t.keys(this._in[h]),g),delete this._in[h],delete this._preds[h],t.each(t.keys(this._out[h]),g),delete this._out[h],delete this._sucs[h],--this._nodeCount}return this},s.prototype.setParent=function(h,m){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(t.isUndefined(m))m=n;else{m+="";for(var g=m;!t.isUndefined(g);g=this.parent(g))if(g===h)throw new Error("Setting "+m+" as parent of "+h+" would create a cycle");this.setNode(m)}return this.setNode(h),this._removeFromParentsChildList(h),this._parent[h]=m,this._children[m][h]=!0,this},s.prototype._removeFromParentsChildList=function(h){delete this._children[this._parent[h]][h]},s.prototype.parent=function(h){if(this._isCompound){var m=this._parent[h];if(m!==n)return m}},s.prototype.children=function(h){if(t.isUndefined(h)&&(h=n),this._isCompound){var m=this._children[h];if(m)return t.keys(m)}else{if(h===n)return this.nodes();if(this.hasNode(h))return[]}},s.prototype.predecessors=function(h){var m=this._preds[h];if(m)return t.keys(m)},s.prototype.successors=function(h){var m=this._sucs[h];if(m)return t.keys(m)},s.prototype.neighbors=function(h){var m=this.predecessors(h);if(m)return t.union(m,this.successors(h))},s.prototype.isLeaf=function(h){var m;return this.isDirected()?m=this.successors(h):m=this.neighbors(h),m.length===0},s.prototype.filterNodes=function(h){var m=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});m.setGraph(this.graph());var g=this;t.each(this._nodes,function(w,S){h(S)&&m.setNode(S,w)}),t.each(this._edgeObjs,function(w){m.hasNode(w.v)&&m.hasNode(w.w)&&m.setEdge(w,g.edge(w))});var x={};function y(w){var S=g.parent(w);return S===void 0||m.hasNode(S)?(x[w]=S,S):S in x?x[S]:y(S)}return this._isCompound&&t.each(m.nodes(),function(w){m.setParent(w,y(w))}),m},s.prototype.setDefaultEdgeLabel=function(h){return t.isFunction(h)||(h=t.constant(h)),this._defaultEdgeLabelFn=h,this},s.prototype.edgeCount=function(){return this._edgeCount},s.prototype.edges=function(){return t.values(this._edgeObjs)},s.prototype.setPath=function(h,m){var g=this,x=arguments;return t.reduce(h,function(y,w){return x.length>1?g.setEdge(y,w,m):g.setEdge(y,w),w}),this},s.prototype.setEdge=function(){var h,m,g,x,y=!1,w=arguments[0];typeof w=="object"&&w!==null&&"v"in w?(h=w.v,m=w.w,g=w.name,arguments.length===2&&(x=arguments[1],y=!0)):(h=w,m=arguments[1],g=arguments[3],arguments.length>2&&(x=arguments[2],y=!0)),h=""+h,m=""+m,t.isUndefined(g)||(g=""+g);var S=l(this._isDirected,h,m,g);if(t.has(this._edgeLabels,S))return y&&(this._edgeLabels[S]=x),this;if(!t.isUndefined(g)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(h),this.setNode(m),this._edgeLabels[S]=y?x:this._defaultEdgeLabelFn(h,m,g);var k=c(this._isDirected,h,m,g);return h=k.v,m=k.w,Object.freeze(k),this._edgeObjs[S]=k,i(this._preds[m],h),i(this._sucs[h],m),this._in[m][S]=k,this._out[h][S]=k,this._edgeCount++,this},s.prototype.edge=function(h,m,g){var x=arguments.length===1?d(this._isDirected,arguments[0]):l(this._isDirected,h,m,g);return this._edgeLabels[x]},s.prototype.hasEdge=function(h,m,g){var x=arguments.length===1?d(this._isDirected,arguments[0]):l(this._isDirected,h,m,g);return t.has(this._edgeLabels,x)},s.prototype.removeEdge=function(h,m,g){var x=arguments.length===1?d(this._isDirected,arguments[0]):l(this._isDirected,h,m,g),y=this._edgeObjs[x];return y&&(h=y.v,m=y.w,delete this._edgeLabels[x],delete this._edgeObjs[x],a(this._preds[m],h),a(this._sucs[h],m),delete this._in[m][x],delete this._out[h][x],this._edgeCount--),this},s.prototype.inEdges=function(h,m){var g=this._in[h];if(g){var x=t.values(g);return m?t.filter(x,function(y){return y.v===m}):x}},s.prototype.outEdges=function(h,m){var g=this._out[h];if(g){var x=t.values(g);return m?t.filter(x,function(y){return y.w===m}):x}},s.prototype.nodeEdges=function(h,m){var g=this.inEdges(h,m);if(g)return g.concat(this.outEdges(h,m))};function i(h,m){h[m]?h[m]++:h[m]=1}function a(h,m){--h[m]||delete h[m]}function l(h,m,g,x){var y=""+m,w=""+g;if(!h&&y>w){var S=y;y=w,w=S}return y+r+w+r+(t.isUndefined(x)?e:x)}function c(h,m,g,x){var y=""+m,w=""+g;if(!h&&y>w){var S=y;y=w,w=S}var k={v:y,w};return x&&(k.name=x),k}function d(h,m){return l(h,m.v,m.w,m.name)}return $5}var H5,oP;function N8e(){return oP||(oP=1,H5="2.1.8"),H5}var Q5,lP;function C8e(){return lP||(lP=1,Q5={Graph:f7(),version:N8e()}),Q5}var V5,cP;function T8e(){if(cP)return V5;cP=1;var t=Ia(),e=f7();V5={write:n,read:i};function n(a){var l={options:{directed:a.isDirected(),multigraph:a.isMultigraph(),compound:a.isCompound()},nodes:r(a),edges:s(a)};return t.isUndefined(a.graph())||(l.value=t.clone(a.graph())),l}function r(a){return t.map(a.nodes(),function(l){var c=a.node(l),d=a.parent(l),h={v:l};return t.isUndefined(c)||(h.value=c),t.isUndefined(d)||(h.parent=d),h})}function s(a){return t.map(a.edges(),function(l){var c=a.edge(l),d={v:l.v,w:l.w};return t.isUndefined(l.name)||(d.name=l.name),t.isUndefined(c)||(d.value=c),d})}function i(a){var l=new e(a.options).setGraph(a.value);return t.each(a.nodes,function(c){l.setNode(c.v,c.value),c.parent&&l.setParent(c.v,c.parent)}),t.each(a.edges,function(c){l.setEdge({v:c.v,w:c.w,name:c.name},c.value)}),l}return V5}var U5,uP;function E8e(){if(uP)return U5;uP=1;var t=Ia();U5=e;function e(n){var r={},s=[],i;function a(l){t.has(r,l)||(r[l]=!0,i.push(l),t.each(n.successors(l),a),t.each(n.predecessors(l),a))}return t.each(n.nodes(),function(l){i=[],a(l),i.length&&s.push(i)}),s}return U5}var W5,dP;function _G(){if(dP)return W5;dP=1;var t=Ia();W5=e;function e(){this._arr=[],this._keyIndices={}}return e.prototype.size=function(){return this._arr.length},e.prototype.keys=function(){return this._arr.map(function(n){return n.key})},e.prototype.has=function(n){return t.has(this._keyIndices,n)},e.prototype.priority=function(n){var r=this._keyIndices[n];if(r!==void 0)return this._arr[r].priority},e.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},e.prototype.add=function(n,r){var s=this._keyIndices;if(n=String(n),!t.has(s,n)){var i=this._arr,a=i.length;return s[n]=a,i.push({key:n,priority:r}),this._decrease(a),!0}return!1},e.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var n=this._arr.pop();return delete this._keyIndices[n.key],this._heapify(0),n.key},e.prototype.decrease=function(n,r){var s=this._keyIndices[n];if(r>this._arr[s].priority)throw new Error("New priority is greater than current priority. Key: "+n+" Old: "+this._arr[s].priority+" New: "+r);this._arr[s].priority=r,this._decrease(s)},e.prototype._heapify=function(n){var r=this._arr,s=2*n,i=s+1,a=n;s<r.length&&(a=r[s].priority<r[a].priority?s:a,i<r.length&&(a=r[i].priority<r[a].priority?i:a),a!==n&&(this._swap(n,a),this._heapify(a)))},e.prototype._decrease=function(n){for(var r=this._arr,s=r[n].priority,i;n!==0&&(i=n>>1,!(r[i].priority<s));)this._swap(n,i),n=i},e.prototype._swap=function(n,r){var s=this._arr,i=this._keyIndices,a=s[n],l=s[r];s[n]=l,s[r]=a,i[l.key]=n,i[a.key]=r},W5}var G5,hP;function AG(){if(hP)return G5;hP=1;var t=Ia(),e=_G();G5=r;var n=t.constant(1);function r(i,a,l,c){return s(i,String(a),l||n,c||function(d){return i.outEdges(d)})}function s(i,a,l,c){var d={},h=new e,m,g,x=function(y){var w=y.v!==m?y.v:y.w,S=d[w],k=l(y),j=g.distance+k;if(k<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+y+" Weight: "+k);j<S.distance&&(S.distance=j,S.predecessor=m,h.decrease(w,j))};for(i.nodes().forEach(function(y){var w=y===a?0:Number.POSITIVE_INFINITY;d[y]={distance:w},h.add(y,w)});h.size()>0&&(m=h.removeMin(),g=d[m],g.distance!==Number.POSITIVE_INFINITY);)c(m).forEach(x);return d}return G5}var X5,fP;function _8e(){if(fP)return X5;fP=1;var t=AG(),e=Ia();X5=n;function n(r,s,i){return e.transform(r.nodes(),function(a,l){a[l]=t(r,l,s,i)},{})}return X5}var Y5,mP;function MG(){if(mP)return Y5;mP=1;var t=Ia();Y5=e;function e(n){var r=0,s=[],i={},a=[];function l(c){var d=i[c]={onStack:!0,lowlink:r,index:r++};if(s.push(c),n.successors(c).forEach(function(g){t.has(i,g)?i[g].onStack&&(d.lowlink=Math.min(d.lowlink,i[g].index)):(l(g),d.lowlink=Math.min(d.lowlink,i[g].lowlink))}),d.lowlink===d.index){var h=[],m;do m=s.pop(),i[m].onStack=!1,h.push(m);while(c!==m);a.push(h)}}return n.nodes().forEach(function(c){t.has(i,c)||l(c)}),a}return Y5}var K5,pP;function A8e(){if(pP)return K5;pP=1;var t=Ia(),e=MG();K5=n;function n(r){return t.filter(e(r),function(s){return s.length>1||s.length===1&&r.hasEdge(s[0],s[0])})}return K5}var Z5,gP;function M8e(){if(gP)return Z5;gP=1;var t=Ia();Z5=n;var e=t.constant(1);function n(s,i,a){return r(s,i||e,a||function(l){return s.outEdges(l)})}function r(s,i,a){var l={},c=s.nodes();return c.forEach(function(d){l[d]={},l[d][d]={distance:0},c.forEach(function(h){d!==h&&(l[d][h]={distance:Number.POSITIVE_INFINITY})}),a(d).forEach(function(h){var m=h.v===d?h.w:h.v,g=i(h);l[d][m]={distance:g,predecessor:d}})}),c.forEach(function(d){var h=l[d];c.forEach(function(m){var g=l[m];c.forEach(function(x){var y=g[d],w=h[x],S=g[x],k=y.distance+w.distance;k<S.distance&&(S.distance=k,S.predecessor=w.predecessor)})})}),l}return Z5}var J5,xP;function RG(){if(xP)return J5;xP=1;var t=Ia();J5=e,e.CycleException=n;function e(r){var s={},i={},a=[];function l(c){if(t.has(i,c))throw new n;t.has(s,c)||(i[c]=!0,s[c]=!0,t.each(r.predecessors(c),l),delete i[c],a.push(c))}if(t.each(r.sinks(),l),t.size(s)!==r.nodeCount())throw new n;return a}function n(){}return n.prototype=new Error,J5}var e3,vP;function R8e(){if(vP)return e3;vP=1;var t=RG();e3=e;function e(n){try{t(n)}catch(r){if(r instanceof t.CycleException)return!1;throw r}return!0}return e3}var t3,yP;function DG(){if(yP)return t3;yP=1;var t=Ia();t3=e;function e(r,s,i){t.isArray(s)||(s=[s]);var a=(r.isDirected()?r.successors:r.neighbors).bind(r),l=[],c={};return t.each(s,function(d){if(!r.hasNode(d))throw new Error("Graph does not have node: "+d);n(r,d,i==="post",c,a,l)}),l}function n(r,s,i,a,l,c){t.has(a,s)||(a[s]=!0,i||c.push(s),t.each(l(s),function(d){n(r,d,i,a,l,c)}),i&&c.push(s))}return t3}var n3,bP;function D8e(){if(bP)return n3;bP=1;var t=DG();n3=e;function e(n,r){return t(n,r,"post")}return n3}var r3,wP;function P8e(){if(wP)return r3;wP=1;var t=DG();r3=e;function e(n,r){return t(n,r,"pre")}return r3}var s3,SP;function z8e(){if(SP)return s3;SP=1;var t=Ia(),e=f7(),n=_G();s3=r;function r(s,i){var a=new e,l={},c=new n,d;function h(g){var x=g.v===d?g.w:g.v,y=c.priority(x);if(y!==void 0){var w=i(g);w<y&&(l[x]=d,c.decrease(x,w))}}if(s.nodeCount()===0)return a;t.each(s.nodes(),function(g){c.add(g,Number.POSITIVE_INFINITY),a.setNode(g)}),c.decrease(s.nodes()[0],0);for(var m=!1;c.size()>0;){if(d=c.removeMin(),t.has(l,d))a.setEdge(d,l[d]);else{if(m)throw new Error("Input graph is not connected: "+s);m=!0}s.nodeEdges(d).forEach(h)}return a}return s3}var i3,kP;function I8e(){return kP||(kP=1,i3={components:E8e(),dijkstra:AG(),dijkstraAll:_8e(),findCycles:A8e(),floydWarshall:M8e(),isAcyclic:R8e(),postorder:D8e(),preorder:P8e(),prim:z8e(),tarjan:MG(),topsort:RG()}),i3}var a3,OP;function L8e(){if(OP)return a3;OP=1;var t=C8e();return a3={Graph:t.Graph,json:T8e(),alg:I8e(),version:t.version},a3}var o3,jP;function to(){if(jP)return o3;jP=1;var t;if(typeof h7=="function")try{t=L8e()}catch{}return t||(t=window.graphlib),o3=t,o3}var l3,NP;function B8e(){if(NP)return l3;NP=1;var t=Vz(),e=1,n=4;function r(s){return t(s,e|n)}return l3=r,l3}var c3,CP;function F8e(){if(CP)return c3;CP=1;var t=Cj(),e=eI(),n=Jz(),r=Hy(),s=Object.prototype,i=s.hasOwnProperty,a=t(function(l,c){l=Object(l);var d=-1,h=c.length,m=h>2?c[2]:void 0;for(m&&n(c[0],c[1],m)&&(h=1);++d<h;)for(var g=c[d],x=r(g),y=-1,w=x.length;++y<w;){var S=x[y],k=l[S];(k===void 0||e(k,s[S])&&!i.call(l,S))&&(l[S]=g[S])}return l});return c3=a,c3}var u3,TP;function q8e(){if(TP)return u3;TP=1;var t=tI(),e=wG(),n=Hy();function r(s,i){return s==null?s:t(s,e(i),n)}return u3=r,u3}var d3,EP;function PG(){if(EP)return d3;EP=1;var t=ree(),e=eI();function n(r,s,i){(i!==void 0&&!e(r[s],i)||i===void 0&&!(s in r))&&t(r,s,i)}return d3=n,d3}var h3,_P;function zG(){if(_P)return h3;_P=1;function t(e,n){if(!(n==="constructor"&&typeof e[n]=="function")&&n!="__proto__")return e[n]}return h3=t,h3}var f3,AP;function $8e(){if(AP)return f3;AP=1;var t=see(),e=Hy();function n(r){return t(r,e(r))}return f3=n,f3}var m3,MP;function H8e(){if(MP)return m3;MP=1;var t=PG(),e=iee(),n=aee(),r=cee(),s=oee(),i=Xz(),a=bd(),l=TG(),c=Oj(),d=Nj(),h=$y(),m=lee(),g=jj(),x=zG(),y=$8e();function w(S,k,j,N,T,E,_){var A=x(S,j),D=x(k,j),q=_.get(D);if(q){t(S,j,q);return}var B=E?E(A,D,j+"",S,k,_):void 0,H=B===void 0;if(H){var W=a(D),ee=!W&&c(D),I=!W&&!ee&&g(D);B=D,W||ee||I?a(A)?B=A:l(A)?B=r(A):ee?(H=!1,B=e(D,!0)):I?(H=!1,B=n(D,!0)):B=[]:m(D)||i(D)?(B=A,i(A)?B=y(A):(!h(A)||d(A))&&(B=s(D))):H=!1}H&&(_.set(D,B),T(B,D,N,E,_),_.delete(D)),t(S,j,B)}return m3=w,m3}var p3,RP;function Q8e(){if(RP)return p3;RP=1;var t=uee(),e=PG(),n=tI(),r=H8e(),s=$y(),i=Hy(),a=zG();function l(c,d,h,m,g){c!==d&&n(d,function(x,y){if(g||(g=new t),s(x))r(c,d,y,h,l,m,g);else{var w=m?m(a(c,y),x,y+"",c,d,g):void 0;w===void 0&&(w=x),e(c,y,w)}},i)}return p3=l,p3}var g3,DP;function V8e(){if(DP)return g3;DP=1;var t=Cj(),e=Jz();function n(r){return t(function(s,i){var a=-1,l=i.length,c=l>1?i[l-1]:void 0,d=l>2?i[2]:void 0;for(c=r.length>3&&typeof c=="function"?(l--,c):void 0,d&&e(i[0],i[1],d)&&(c=l<3?void 0:c,l=1),s=Object(s);++a<l;){var h=i[a];h&&r(s,h,a,c)}return s})}return g3=n,g3}var x3,PP;function U8e(){if(PP)return x3;PP=1;var t=Q8e(),e=V8e(),n=e(function(r,s,i){t(r,s,i)});return x3=n,x3}var v3,zP;function W8e(){if(zP)return v3;zP=1;var t=nI(),e=rI(),n=dee(),r=$y(),s=hee();function i(a,l,c,d){if(!r(a))return a;l=e(l,a);for(var h=-1,m=l.length,g=m-1,x=a;x!=null&&++h<m;){var y=s(l[h]),w=c;if(y==="__proto__"||y==="constructor"||y==="prototype")return a;if(h!=g){var S=x[y];w=d?d(S,y,x):void 0,w===void 0&&(w=r(S)?S:n(l[h+1])?[]:{})}t(x,y,w),x=x[y]}return a}return v3=i,v3}var y3,IP;function G8e(){if(IP)return y3;IP=1;var t=fee(),e=W8e(),n=rI();function r(s,i,a){for(var l=-1,c=i.length,d={};++l<c;){var h=i[l],m=t(s,h);a(m,h)&&e(d,n(h,s),m)}return d}return y3=r,y3}var b3,LP;function X8e(){if(LP)return b3;LP=1;var t=G8e(),e=mee();function n(r,s){return t(r,s,function(i,a){return e(r,a)})}return b3=n,b3}var w3,BP;function Y8e(){if(BP)return w3;BP=1;var t=X8e(),e=pee(),n=e(function(r,s){return r==null?{}:t(r,s)});return w3=n,w3}var S3,FP;function K8e(){if(FP)return S3;FP=1;var t=gee(),e=0;function n(r){var s=++e;return t(r)+s}return S3=n,S3}var k3,qP;function Z8e(){if(qP)return k3;qP=1;function t(e,n,r){for(var s=-1,i=e.length,a=n.length,l={};++s<i;){var c=s<a?n[s]:void 0;r(l,e[s],c)}return l}return k3=t,k3}var O3,$P;function J8e(){if($P)return O3;$P=1;var t=nI(),e=Z8e();function n(r,s){return e(r||[],s||[],t)}return O3=n,O3}var j3,HP;function Ar(){if(HP)return j3;HP=1;var t;if(typeof h7=="function")try{t={cloneDeep:B8e(),constant:Zz(),defaults:F8e(),each:kG(),filter:OG(),find:Nee(),flatten:jee(),forEach:SG(),forIn:q8e(),has:jG(),isUndefined:NG(),last:Oee(),map:Kz(),mapValues:kee(),max:See(),merge:U8e(),min:wee(),minBy:bee(),now:yee(),pick:Y8e(),range:vee(),reduce:CG(),sortBy:xee(),uniqueId:K8e(),values:EG(),zipObject:J8e()}}catch{}return t||(t=window._),j3=t,j3}var N3,QP;function eTe(){if(QP)return N3;QP=1,N3=t;function t(){var r={};r._next=r._prev=r,this._sentinel=r}t.prototype.dequeue=function(){var r=this._sentinel,s=r._prev;if(s!==r)return e(s),s},t.prototype.enqueue=function(r){var s=this._sentinel;r._prev&&r._next&&e(r),r._next=s._next,s._next._prev=r,s._next=r,r._prev=s},t.prototype.toString=function(){for(var r=[],s=this._sentinel,i=s._prev;i!==s;)r.push(JSON.stringify(i,n)),i=i._prev;return"["+r.join(", ")+"]"};function e(r){r._prev._next=r._next,r._next._prev=r._prev,delete r._next,delete r._prev}function n(r,s){if(r!=="_next"&&r!=="_prev")return s}return N3}var C3,VP;function tTe(){if(VP)return C3;VP=1;var t=Ar(),e=to().Graph,n=eTe();C3=s;var r=t.constant(1);function s(d,h){if(d.nodeCount()<=1)return[];var m=l(d,h||r),g=i(m.graph,m.buckets,m.zeroIdx);return t.flatten(t.map(g,function(x){return d.outEdges(x.v,x.w)}),!0)}function i(d,h,m){for(var g=[],x=h[h.length-1],y=h[0],w;d.nodeCount();){for(;w=y.dequeue();)a(d,h,m,w);for(;w=x.dequeue();)a(d,h,m,w);if(d.nodeCount()){for(var S=h.length-2;S>0;--S)if(w=h[S].dequeue(),w){g=g.concat(a(d,h,m,w,!0));break}}}return g}function a(d,h,m,g,x){var y=x?[]:void 0;return t.forEach(d.inEdges(g.v),function(w){var S=d.edge(w),k=d.node(w.v);x&&y.push({v:w.v,w:w.w}),k.out-=S,c(h,m,k)}),t.forEach(d.outEdges(g.v),function(w){var S=d.edge(w),k=w.w,j=d.node(k);j.in-=S,c(h,m,j)}),d.removeNode(g.v),y}function l(d,h){var m=new e,g=0,x=0;t.forEach(d.nodes(),function(S){m.setNode(S,{v:S,in:0,out:0})}),t.forEach(d.edges(),function(S){var k=m.edge(S.v,S.w)||0,j=h(S),N=k+j;m.setEdge(S.v,S.w,N),x=Math.max(x,m.node(S.v).out+=j),g=Math.max(g,m.node(S.w).in+=j)});var y=t.range(x+g+3).map(function(){return new n}),w=g+1;return t.forEach(m.nodes(),function(S){c(y,w,m.node(S))}),{graph:m,buckets:y,zeroIdx:w}}function c(d,h,m){m.out?m.in?d[m.out-m.in+h].enqueue(m):d[d.length-1].enqueue(m):d[0].enqueue(m)}return C3}var T3,UP;function nTe(){if(UP)return T3;UP=1;var t=Ar(),e=tTe();T3={run:n,undo:s};function n(i){var a=i.graph().acyclicer==="greedy"?e(i,l(i)):r(i);t.forEach(a,function(c){var d=i.edge(c);i.removeEdge(c),d.forwardName=c.name,d.reversed=!0,i.setEdge(c.w,c.v,d,t.uniqueId("rev"))});function l(c){return function(d){return c.edge(d).weight}}}function r(i){var a=[],l={},c={};function d(h){t.has(c,h)||(c[h]=!0,l[h]=!0,t.forEach(i.outEdges(h),function(m){t.has(l,m.w)?a.push(m):d(m.w)}),delete l[h])}return t.forEach(i.nodes(),d),a}function s(i){t.forEach(i.edges(),function(a){var l=i.edge(a);if(l.reversed){i.removeEdge(a);var c=l.forwardName;delete l.reversed,delete l.forwardName,i.setEdge(a.w,a.v,l,c)}})}return T3}var E3,WP;function Ti(){if(WP)return E3;WP=1;var t=Ar(),e=to().Graph;E3={addDummyNode:n,simplify:r,asNonCompoundGraph:s,successorWeights:i,predecessorWeights:a,intersectRect:l,buildLayerMatrix:c,normalizeRanks:d,removeEmptyRanks:h,addBorderNode:m,maxRank:g,partition:x,time:y,notime:w};function n(S,k,j,N){var T;do T=t.uniqueId(N);while(S.hasNode(T));return j.dummy=k,S.setNode(T,j),T}function r(S){var k=new e().setGraph(S.graph());return t.forEach(S.nodes(),function(j){k.setNode(j,S.node(j))}),t.forEach(S.edges(),function(j){var N=k.edge(j.v,j.w)||{weight:0,minlen:1},T=S.edge(j);k.setEdge(j.v,j.w,{weight:N.weight+T.weight,minlen:Math.max(N.minlen,T.minlen)})}),k}function s(S){var k=new e({multigraph:S.isMultigraph()}).setGraph(S.graph());return t.forEach(S.nodes(),function(j){S.children(j).length||k.setNode(j,S.node(j))}),t.forEach(S.edges(),function(j){k.setEdge(j,S.edge(j))}),k}function i(S){var k=t.map(S.nodes(),function(j){var N={};return t.forEach(S.outEdges(j),function(T){N[T.w]=(N[T.w]||0)+S.edge(T).weight}),N});return t.zipObject(S.nodes(),k)}function a(S){var k=t.map(S.nodes(),function(j){var N={};return t.forEach(S.inEdges(j),function(T){N[T.v]=(N[T.v]||0)+S.edge(T).weight}),N});return t.zipObject(S.nodes(),k)}function l(S,k){var j=S.x,N=S.y,T=k.x-j,E=k.y-N,_=S.width/2,A=S.height/2;if(!T&&!E)throw new Error("Not possible to find intersection inside of the rectangle");var D,q;return Math.abs(E)*_>Math.abs(T)*A?(E<0&&(A=-A),D=A*T/E,q=A):(T<0&&(_=-_),D=_,q=_*E/T),{x:j+D,y:N+q}}function c(S){var k=t.map(t.range(g(S)+1),function(){return[]});return t.forEach(S.nodes(),function(j){var N=S.node(j),T=N.rank;t.isUndefined(T)||(k[T][N.order]=j)}),k}function d(S){var k=t.min(t.map(S.nodes(),function(j){return S.node(j).rank}));t.forEach(S.nodes(),function(j){var N=S.node(j);t.has(N,"rank")&&(N.rank-=k)})}function h(S){var k=t.min(t.map(S.nodes(),function(E){return S.node(E).rank})),j=[];t.forEach(S.nodes(),function(E){var _=S.node(E).rank-k;j[_]||(j[_]=[]),j[_].push(E)});var N=0,T=S.graph().nodeRankFactor;t.forEach(j,function(E,_){t.isUndefined(E)&&_%T!==0?--N:N&&t.forEach(E,function(A){S.node(A).rank+=N})})}function m(S,k,j,N){var T={width:0,height:0};return arguments.length>=4&&(T.rank=j,T.order=N),n(S,"border",T,k)}function g(S){return t.max(t.map(S.nodes(),function(k){var j=S.node(k).rank;if(!t.isUndefined(j))return j}))}function x(S,k){var j={lhs:[],rhs:[]};return t.forEach(S,function(N){k(N)?j.lhs.push(N):j.rhs.push(N)}),j}function y(S,k){var j=t.now();try{return k()}finally{console.log(S+" time: "+(t.now()-j)+"ms")}}function w(S,k){return k()}return E3}var _3,GP;function rTe(){if(GP)return _3;GP=1;var t=Ar(),e=Ti();_3={run:n,undo:s};function n(i){i.graph().dummyChains=[],t.forEach(i.edges(),function(a){r(i,a)})}function r(i,a){var l=a.v,c=i.node(l).rank,d=a.w,h=i.node(d).rank,m=a.name,g=i.edge(a),x=g.labelRank;if(h!==c+1){i.removeEdge(a);var y,w,S;for(S=0,++c;c<h;++S,++c)g.points=[],w={width:0,height:0,edgeLabel:g,edgeObj:a,rank:c},y=e.addDummyNode(i,"edge",w,"_d"),c===x&&(w.width=g.width,w.height=g.height,w.dummy="edge-label",w.labelpos=g.labelpos),i.setEdge(l,y,{weight:g.weight},m),S===0&&i.graph().dummyChains.push(y),l=y;i.setEdge(l,d,{weight:g.weight},m)}}function s(i){t.forEach(i.graph().dummyChains,function(a){var l=i.node(a),c=l.edgeLabel,d;for(i.setEdge(l.edgeObj,c);l.dummy;)d=i.successors(a)[0],i.removeNode(a),c.points.push({x:l.x,y:l.y}),l.dummy==="edge-label"&&(c.x=l.x,c.y=l.y,c.width=l.width,c.height=l.height),a=d,l=i.node(a)})}return _3}var A3,XP;function By(){if(XP)return A3;XP=1;var t=Ar();A3={longestPath:e,slack:n};function e(r){var s={};function i(a){var l=r.node(a);if(t.has(s,a))return l.rank;s[a]=!0;var c=t.min(t.map(r.outEdges(a),function(d){return i(d.w)-r.edge(d).minlen}));return(c===Number.POSITIVE_INFINITY||c===void 0||c===null)&&(c=0),l.rank=c}t.forEach(r.sources(),i)}function n(r,s){return r.node(s.w).rank-r.node(s.v).rank-r.edge(s).minlen}return A3}var M3,YP;function IG(){if(YP)return M3;YP=1;var t=Ar(),e=to().Graph,n=By().slack;M3=r;function r(l){var c=new e({directed:!1}),d=l.nodes()[0],h=l.nodeCount();c.setNode(d,{});for(var m,g;s(c,l)<h;)m=i(c,l),g=c.hasNode(m.v)?n(l,m):-n(l,m),a(c,l,g);return c}function s(l,c){function d(h){t.forEach(c.nodeEdges(h),function(m){var g=m.v,x=h===g?m.w:g;!l.hasNode(x)&&!n(c,m)&&(l.setNode(x,{}),l.setEdge(h,x,{}),d(x))})}return t.forEach(l.nodes(),d),l.nodeCount()}function i(l,c){return t.minBy(c.edges(),function(d){if(l.hasNode(d.v)!==l.hasNode(d.w))return n(c,d)})}function a(l,c,d){t.forEach(l.nodes(),function(h){c.node(h).rank+=d})}return M3}var R3,KP;function sTe(){if(KP)return R3;KP=1;var t=Ar(),e=IG(),n=By().slack,r=By().longestPath,s=to().alg.preorder,i=to().alg.postorder,a=Ti().simplify;R3=l,l.initLowLimValues=m,l.initCutValues=c,l.calcCutValue=h,l.leaveEdge=x,l.enterEdge=y,l.exchangeEdges=w;function l(N){N=a(N),r(N);var T=e(N);m(T),c(T,N);for(var E,_;E=x(T);)_=y(T,N,E),w(T,N,E,_)}function c(N,T){var E=i(N,N.nodes());E=E.slice(0,E.length-1),t.forEach(E,function(_){d(N,T,_)})}function d(N,T,E){var _=N.node(E),A=_.parent;N.edge(E,A).cutvalue=h(N,T,E)}function h(N,T,E){var _=N.node(E),A=_.parent,D=!0,q=T.edge(E,A),B=0;return q||(D=!1,q=T.edge(A,E)),B=q.weight,t.forEach(T.nodeEdges(E),function(H){var W=H.v===E,ee=W?H.w:H.v;if(ee!==A){var I=W===D,V=T.edge(H).weight;if(B+=I?V:-V,k(N,E,ee)){var L=N.edge(E,ee).cutvalue;B+=I?-L:L}}}),B}function m(N,T){arguments.length<2&&(T=N.nodes()[0]),g(N,{},1,T)}function g(N,T,E,_,A){var D=E,q=N.node(_);return T[_]=!0,t.forEach(N.neighbors(_),function(B){t.has(T,B)||(E=g(N,T,E,B,_))}),q.low=D,q.lim=E++,A?q.parent=A:delete q.parent,E}function x(N){return t.find(N.edges(),function(T){return N.edge(T).cutvalue<0})}function y(N,T,E){var _=E.v,A=E.w;T.hasEdge(_,A)||(_=E.w,A=E.v);var D=N.node(_),q=N.node(A),B=D,H=!1;D.lim>q.lim&&(B=q,H=!0);var W=t.filter(T.edges(),function(ee){return H===j(N,N.node(ee.v),B)&&H!==j(N,N.node(ee.w),B)});return t.minBy(W,function(ee){return n(T,ee)})}function w(N,T,E,_){var A=E.v,D=E.w;N.removeEdge(A,D),N.setEdge(_.v,_.w,{}),m(N),c(N,T),S(N,T)}function S(N,T){var E=t.find(N.nodes(),function(A){return!T.node(A).parent}),_=s(N,E);_=_.slice(1),t.forEach(_,function(A){var D=N.node(A).parent,q=T.edge(A,D),B=!1;q||(q=T.edge(D,A),B=!0),T.node(A).rank=T.node(D).rank+(B?q.minlen:-q.minlen)})}function k(N,T,E){return N.hasEdge(T,E)}function j(N,T,E){return E.low<=T.lim&&T.lim<=E.lim}return R3}var D3,ZP;function iTe(){if(ZP)return D3;ZP=1;var t=By(),e=t.longestPath,n=IG(),r=sTe();D3=s;function s(c){switch(c.graph().ranker){case"network-simplex":l(c);break;case"tight-tree":a(c);break;case"longest-path":i(c);break;default:l(c)}}var i=e;function a(c){e(c),n(c)}function l(c){r(c)}return D3}var P3,JP;function aTe(){if(JP)return P3;JP=1;var t=Ar();P3=e;function e(s){var i=r(s);t.forEach(s.graph().dummyChains,function(a){for(var l=s.node(a),c=l.edgeObj,d=n(s,i,c.v,c.w),h=d.path,m=d.lca,g=0,x=h[g],y=!0;a!==c.w;){if(l=s.node(a),y){for(;(x=h[g])!==m&&s.node(x).maxRank<l.rank;)g++;x===m&&(y=!1)}if(!y){for(;g<h.length-1&&s.node(x=h[g+1]).minRank<=l.rank;)g++;x=h[g]}s.setParent(a,x),a=s.successors(a)[0]}})}function n(s,i,a,l){var c=[],d=[],h=Math.min(i[a].low,i[l].low),m=Math.max(i[a].lim,i[l].lim),g,x;g=a;do g=s.parent(g),c.push(g);while(g&&(i[g].low>h||m>i[g].lim));for(x=g,g=l;(g=s.parent(g))!==x;)d.push(g);return{path:c.concat(d.reverse()),lca:x}}function r(s){var i={},a=0;function l(c){var d=a;t.forEach(s.children(c),l),i[c]={low:d,lim:a++}}return t.forEach(s.children(),l),i}return P3}var z3,ez;function oTe(){if(ez)return z3;ez=1;var t=Ar(),e=Ti();z3={run:n,cleanup:a};function n(l){var c=e.addDummyNode(l,"root",{},"_root"),d=s(l),h=t.max(t.values(d))-1,m=2*h+1;l.graph().nestingRoot=c,t.forEach(l.edges(),function(x){l.edge(x).minlen*=m});var g=i(l)+1;t.forEach(l.children(),function(x){r(l,c,m,g,h,d,x)}),l.graph().nodeRankFactor=m}function r(l,c,d,h,m,g,x){var y=l.children(x);if(!y.length){x!==c&&l.setEdge(c,x,{weight:0,minlen:d});return}var w=e.addBorderNode(l,"_bt"),S=e.addBorderNode(l,"_bb"),k=l.node(x);l.setParent(w,x),k.borderTop=w,l.setParent(S,x),k.borderBottom=S,t.forEach(y,function(j){r(l,c,d,h,m,g,j);var N=l.node(j),T=N.borderTop?N.borderTop:j,E=N.borderBottom?N.borderBottom:j,_=N.borderTop?h:2*h,A=T!==E?1:m-g[x]+1;l.setEdge(w,T,{weight:_,minlen:A,nestingEdge:!0}),l.setEdge(E,S,{weight:_,minlen:A,nestingEdge:!0})}),l.parent(x)||l.setEdge(c,w,{weight:0,minlen:m+g[x]})}function s(l){var c={};function d(h,m){var g=l.children(h);g&&g.length&&t.forEach(g,function(x){d(x,m+1)}),c[h]=m}return t.forEach(l.children(),function(h){d(h,1)}),c}function i(l){return t.reduce(l.edges(),function(c,d){return c+l.edge(d).weight},0)}function a(l){var c=l.graph();l.removeNode(c.nestingRoot),delete c.nestingRoot,t.forEach(l.edges(),function(d){var h=l.edge(d);h.nestingEdge&&l.removeEdge(d)})}return z3}var I3,tz;function lTe(){if(tz)return I3;tz=1;var t=Ar(),e=Ti();I3=n;function n(s){function i(a){var l=s.children(a),c=s.node(a);if(l.length&&t.forEach(l,i),t.has(c,"minRank")){c.borderLeft=[],c.borderRight=[];for(var d=c.minRank,h=c.maxRank+1;d<h;++d)r(s,"borderLeft","_bl",a,c,d),r(s,"borderRight","_br",a,c,d)}}t.forEach(s.children(),i)}function r(s,i,a,l,c,d){var h={width:0,height:0,rank:d,borderType:i},m=c[i][d-1],g=e.addDummyNode(s,"border",h,a);c[i][d]=g,s.setParent(g,l),m&&s.setEdge(m,g,{weight:1})}return I3}var L3,nz;function cTe(){if(nz)return L3;nz=1;var t=Ar();L3={adjust:e,undo:n};function e(d){var h=d.graph().rankdir.toLowerCase();(h==="lr"||h==="rl")&&r(d)}function n(d){var h=d.graph().rankdir.toLowerCase();(h==="bt"||h==="rl")&&i(d),(h==="lr"||h==="rl")&&(l(d),r(d))}function r(d){t.forEach(d.nodes(),function(h){s(d.node(h))}),t.forEach(d.edges(),function(h){s(d.edge(h))})}function s(d){var h=d.width;d.width=d.height,d.height=h}function i(d){t.forEach(d.nodes(),function(h){a(d.node(h))}),t.forEach(d.edges(),function(h){var m=d.edge(h);t.forEach(m.points,a),t.has(m,"y")&&a(m)})}function a(d){d.y=-d.y}function l(d){t.forEach(d.nodes(),function(h){c(d.node(h))}),t.forEach(d.edges(),function(h){var m=d.edge(h);t.forEach(m.points,c),t.has(m,"x")&&c(m)})}function c(d){var h=d.x;d.x=d.y,d.y=h}return L3}var B3,rz;function uTe(){if(rz)return B3;rz=1;var t=Ar();B3=e;function e(n){var r={},s=t.filter(n.nodes(),function(d){return!n.children(d).length}),i=t.max(t.map(s,function(d){return n.node(d).rank})),a=t.map(t.range(i+1),function(){return[]});function l(d){if(!t.has(r,d)){r[d]=!0;var h=n.node(d);a[h.rank].push(d),t.forEach(n.successors(d),l)}}var c=t.sortBy(s,function(d){return n.node(d).rank});return t.forEach(c,l),a}return B3}var F3,sz;function dTe(){if(sz)return F3;sz=1;var t=Ar();F3=e;function e(r,s){for(var i=0,a=1;a<s.length;++a)i+=n(r,s[a-1],s[a]);return i}function n(r,s,i){for(var a=t.zipObject(i,t.map(i,function(g,x){return x})),l=t.flatten(t.map(s,function(g){return t.sortBy(t.map(r.outEdges(g),function(x){return{pos:a[x.w],weight:r.edge(x).weight}}),"pos")}),!0),c=1;c<i.length;)c<<=1;var d=2*c-1;c-=1;var h=t.map(new Array(d),function(){return 0}),m=0;return t.forEach(l.forEach(function(g){var x=g.pos+c;h[x]+=g.weight;for(var y=0;x>0;)x%2&&(y+=h[x+1]),x=x-1>>1,h[x]+=g.weight;m+=g.weight*y})),m}return F3}var q3,iz;function hTe(){if(iz)return q3;iz=1;var t=Ar();q3=e;function e(n,r){return t.map(r,function(s){var i=n.inEdges(s);if(i.length){var a=t.reduce(i,function(l,c){var d=n.edge(c),h=n.node(c.v);return{sum:l.sum+d.weight*h.order,weight:l.weight+d.weight}},{sum:0,weight:0});return{v:s,barycenter:a.sum/a.weight,weight:a.weight}}else return{v:s}})}return q3}var $3,az;function fTe(){if(az)return $3;az=1;var t=Ar();$3=e;function e(s,i){var a={};t.forEach(s,function(c,d){var h=a[c.v]={indegree:0,in:[],out:[],vs:[c.v],i:d};t.isUndefined(c.barycenter)||(h.barycenter=c.barycenter,h.weight=c.weight)}),t.forEach(i.edges(),function(c){var d=a[c.v],h=a[c.w];!t.isUndefined(d)&&!t.isUndefined(h)&&(h.indegree++,d.out.push(a[c.w]))});var l=t.filter(a,function(c){return!c.indegree});return n(l)}function n(s){var i=[];function a(d){return function(h){h.merged||(t.isUndefined(h.barycenter)||t.isUndefined(d.barycenter)||h.barycenter>=d.barycenter)&&r(d,h)}}function l(d){return function(h){h.in.push(d),--h.indegree===0&&s.push(h)}}for(;s.length;){var c=s.pop();i.push(c),t.forEach(c.in.reverse(),a(c)),t.forEach(c.out,l(c))}return t.map(t.filter(i,function(d){return!d.merged}),function(d){return t.pick(d,["vs","i","barycenter","weight"])})}function r(s,i){var a=0,l=0;s.weight&&(a+=s.barycenter*s.weight,l+=s.weight),i.weight&&(a+=i.barycenter*i.weight,l+=i.weight),s.vs=i.vs.concat(s.vs),s.barycenter=a/l,s.weight=l,s.i=Math.min(i.i,s.i),i.merged=!0}return $3}var H3,oz;function mTe(){if(oz)return H3;oz=1;var t=Ar(),e=Ti();H3=n;function n(i,a){var l=e.partition(i,function(w){return t.has(w,"barycenter")}),c=l.lhs,d=t.sortBy(l.rhs,function(w){return-w.i}),h=[],m=0,g=0,x=0;c.sort(s(!!a)),x=r(h,d,x),t.forEach(c,function(w){x+=w.vs.length,h.push(w.vs),m+=w.barycenter*w.weight,g+=w.weight,x=r(h,d,x)});var y={vs:t.flatten(h,!0)};return g&&(y.barycenter=m/g,y.weight=g),y}function r(i,a,l){for(var c;a.length&&(c=t.last(a)).i<=l;)a.pop(),i.push(c.vs),l++;return l}function s(i){return function(a,l){return a.barycenter<l.barycenter?-1:a.barycenter>l.barycenter?1:i?l.i-a.i:a.i-l.i}}return H3}var Q3,lz;function pTe(){if(lz)return Q3;lz=1;var t=Ar(),e=hTe(),n=fTe(),r=mTe();Q3=s;function s(l,c,d,h){var m=l.children(c),g=l.node(c),x=g?g.borderLeft:void 0,y=g?g.borderRight:void 0,w={};x&&(m=t.filter(m,function(E){return E!==x&&E!==y}));var S=e(l,m);t.forEach(S,function(E){if(l.children(E.v).length){var _=s(l,E.v,d,h);w[E.v]=_,t.has(_,"barycenter")&&a(E,_)}});var k=n(S,d);i(k,w);var j=r(k,h);if(x&&(j.vs=t.flatten([x,j.vs,y],!0),l.predecessors(x).length)){var N=l.node(l.predecessors(x)[0]),T=l.node(l.predecessors(y)[0]);t.has(j,"barycenter")||(j.barycenter=0,j.weight=0),j.barycenter=(j.barycenter*j.weight+N.order+T.order)/(j.weight+2),j.weight+=2}return j}function i(l,c){t.forEach(l,function(d){d.vs=t.flatten(d.vs.map(function(h){return c[h]?c[h].vs:h}),!0)})}function a(l,c){t.isUndefined(l.barycenter)?(l.barycenter=c.barycenter,l.weight=c.weight):(l.barycenter=(l.barycenter*l.weight+c.barycenter*c.weight)/(l.weight+c.weight),l.weight+=c.weight)}return Q3}var V3,cz;function gTe(){if(cz)return V3;cz=1;var t=Ar(),e=to().Graph;V3=n;function n(s,i,a){var l=r(s),c=new e({compound:!0}).setGraph({root:l}).setDefaultNodeLabel(function(d){return s.node(d)});return t.forEach(s.nodes(),function(d){var h=s.node(d),m=s.parent(d);(h.rank===i||h.minRank<=i&&i<=h.maxRank)&&(c.setNode(d),c.setParent(d,m||l),t.forEach(s[a](d),function(g){var x=g.v===d?g.w:g.v,y=c.edge(x,d),w=t.isUndefined(y)?0:y.weight;c.setEdge(x,d,{weight:s.edge(g).weight+w})}),t.has(h,"minRank")&&c.setNode(d,{borderLeft:h.borderLeft[i],borderRight:h.borderRight[i]}))}),c}function r(s){for(var i;s.hasNode(i=t.uniqueId("_root")););return i}return V3}var U3,uz;function xTe(){if(uz)return U3;uz=1;var t=Ar();U3=e;function e(n,r,s){var i={},a;t.forEach(s,function(l){for(var c=n.parent(l),d,h;c;){if(d=n.parent(c),d?(h=i[d],i[d]=c):(h=a,a=c),h&&h!==c){r.setEdge(h,c);return}c=d}})}return U3}var W3,dz;function vTe(){if(dz)return W3;dz=1;var t=Ar(),e=uTe(),n=dTe(),r=pTe(),s=gTe(),i=xTe(),a=to().Graph,l=Ti();W3=c;function c(g){var x=l.maxRank(g),y=d(g,t.range(1,x+1),"inEdges"),w=d(g,t.range(x-1,-1,-1),"outEdges"),S=e(g);m(g,S);for(var k=Number.POSITIVE_INFINITY,j,N=0,T=0;T<4;++N,++T){h(N%2?y:w,N%4>=2),S=l.buildLayerMatrix(g);var E=n(g,S);E<k&&(T=0,j=t.cloneDeep(S),k=E)}m(g,j)}function d(g,x,y){return t.map(x,function(w){return s(g,w,y)})}function h(g,x){var y=new a;t.forEach(g,function(w){var S=w.graph().root,k=r(w,S,y,x);t.forEach(k.vs,function(j,N){w.node(j).order=N}),i(w,y,k.vs)})}function m(g,x){t.forEach(x,function(y){t.forEach(y,function(w,S){g.node(w).order=S})})}return W3}var G3,hz;function yTe(){if(hz)return G3;hz=1;var t=Ar(),e=to().Graph,n=Ti();G3={positionX:y,findType1Conflicts:r,findType2Conflicts:s,addConflict:a,hasConflict:l,verticalAlignment:c,horizontalCompaction:d,alignCoordinates:g,findSmallestWidthAlignment:m,balance:x};function r(k,j){var N={};function T(E,_){var A=0,D=0,q=E.length,B=t.last(_);return t.forEach(_,function(H,W){var ee=i(k,H),I=ee?k.node(ee).order:q;(ee||H===B)&&(t.forEach(_.slice(D,W+1),function(V){t.forEach(k.predecessors(V),function(L){var $=k.node(L),K=$.order;(K<A||I<K)&&!($.dummy&&k.node(V).dummy)&&a(N,L,V)})}),D=W+1,A=I)}),_}return t.reduce(j,T),N}function s(k,j){var N={};function T(_,A,D,q,B){var H;t.forEach(t.range(A,D),function(W){H=_[W],k.node(H).dummy&&t.forEach(k.predecessors(H),function(ee){var I=k.node(ee);I.dummy&&(I.order<q||I.order>B)&&a(N,ee,H)})})}function E(_,A){var D=-1,q,B=0;return t.forEach(A,function(H,W){if(k.node(H).dummy==="border"){var ee=k.predecessors(H);ee.length&&(q=k.node(ee[0]).order,T(A,B,W,D,q),B=W,D=q)}T(A,B,A.length,q,_.length)}),A}return t.reduce(j,E),N}function i(k,j){if(k.node(j).dummy)return t.find(k.predecessors(j),function(N){return k.node(N).dummy})}function a(k,j,N){if(j>N){var T=j;j=N,N=T}var E=k[j];E||(k[j]=E={}),E[N]=!0}function l(k,j,N){if(j>N){var T=j;j=N,N=T}return t.has(k[j],N)}function c(k,j,N,T){var E={},_={},A={};return t.forEach(j,function(D){t.forEach(D,function(q,B){E[q]=q,_[q]=q,A[q]=B})}),t.forEach(j,function(D){var q=-1;t.forEach(D,function(B){var H=T(B);if(H.length){H=t.sortBy(H,function(L){return A[L]});for(var W=(H.length-1)/2,ee=Math.floor(W),I=Math.ceil(W);ee<=I;++ee){var V=H[ee];_[B]===B&&q<A[V]&&!l(N,B,V)&&(_[V]=B,_[B]=E[B]=E[V],q=A[V])}}})}),{root:E,align:_}}function d(k,j,N,T,E){var _={},A=h(k,j,N,E),D=E?"borderLeft":"borderRight";function q(W,ee){for(var I=A.nodes(),V=I.pop(),L={};V;)L[V]?W(V):(L[V]=!0,I.push(V),I=I.concat(ee(V))),V=I.pop()}function B(W){_[W]=A.inEdges(W).reduce(function(ee,I){return Math.max(ee,_[I.v]+A.edge(I))},0)}function H(W){var ee=A.outEdges(W).reduce(function(V,L){return Math.min(V,_[L.w]-A.edge(L))},Number.POSITIVE_INFINITY),I=k.node(W);ee!==Number.POSITIVE_INFINITY&&I.borderType!==D&&(_[W]=Math.max(_[W],ee))}return q(B,A.predecessors.bind(A)),q(H,A.successors.bind(A)),t.forEach(T,function(W){_[W]=_[N[W]]}),_}function h(k,j,N,T){var E=new e,_=k.graph(),A=w(_.nodesep,_.edgesep,T);return t.forEach(j,function(D){var q;t.forEach(D,function(B){var H=N[B];if(E.setNode(H),q){var W=N[q],ee=E.edge(W,H);E.setEdge(W,H,Math.max(A(k,B,q),ee||0))}q=B})}),E}function m(k,j){return t.minBy(t.values(j),function(N){var T=Number.NEGATIVE_INFINITY,E=Number.POSITIVE_INFINITY;return t.forIn(N,function(_,A){var D=S(k,A)/2;T=Math.max(_+D,T),E=Math.min(_-D,E)}),T-E})}function g(k,j){var N=t.values(j),T=t.min(N),E=t.max(N);t.forEach(["u","d"],function(_){t.forEach(["l","r"],function(A){var D=_+A,q=k[D],B;if(q!==j){var H=t.values(q);B=A==="l"?T-t.min(H):E-t.max(H),B&&(k[D]=t.mapValues(q,function(W){return W+B}))}})})}function x(k,j){return t.mapValues(k.ul,function(N,T){if(j)return k[j.toLowerCase()][T];var E=t.sortBy(t.map(k,T));return(E[1]+E[2])/2})}function y(k){var j=n.buildLayerMatrix(k),N=t.merge(r(k,j),s(k,j)),T={},E;t.forEach(["u","d"],function(A){E=A==="u"?j:t.values(j).reverse(),t.forEach(["l","r"],function(D){D==="r"&&(E=t.map(E,function(W){return t.values(W).reverse()}));var q=(A==="u"?k.predecessors:k.successors).bind(k),B=c(k,E,N,q),H=d(k,E,B.root,B.align,D==="r");D==="r"&&(H=t.mapValues(H,function(W){return-W})),T[A+D]=H})});var _=m(k,T);return g(T,_),x(T,k.graph().align)}function w(k,j,N){return function(T,E,_){var A=T.node(E),D=T.node(_),q=0,B;if(q+=A.width/2,t.has(A,"labelpos"))switch(A.labelpos.toLowerCase()){case"l":B=-A.width/2;break;case"r":B=A.width/2;break}if(B&&(q+=N?B:-B),B=0,q+=(A.dummy?j:k)/2,q+=(D.dummy?j:k)/2,q+=D.width/2,t.has(D,"labelpos"))switch(D.labelpos.toLowerCase()){case"l":B=D.width/2;break;case"r":B=-D.width/2;break}return B&&(q+=N?B:-B),B=0,q}}function S(k,j){return k.node(j).width}return G3}var X3,fz;function bTe(){if(fz)return X3;fz=1;var t=Ar(),e=Ti(),n=yTe().positionX;X3=r;function r(i){i=e.asNonCompoundGraph(i),s(i),t.forEach(n(i),function(a,l){i.node(l).x=a})}function s(i){var a=e.buildLayerMatrix(i),l=i.graph().ranksep,c=0;t.forEach(a,function(d){var h=t.max(t.map(d,function(m){return i.node(m).height}));t.forEach(d,function(m){i.node(m).y=c+h/2}),c+=h+l})}return X3}var Y3,mz;function wTe(){if(mz)return Y3;mz=1;var t=Ar(),e=nTe(),n=rTe(),r=iTe(),s=Ti().normalizeRanks,i=aTe(),a=Ti().removeEmptyRanks,l=oTe(),c=lTe(),d=cTe(),h=vTe(),m=bTe(),g=Ti(),x=to().Graph;Y3=y;function y(U,te){var ne=te&&te.debugTiming?g.time:g.notime;ne("layout",function(){var G=ne(" buildLayoutGraph",function(){return q(U)});ne(" runLayout",function(){w(G,ne)}),ne(" updateInputGraph",function(){S(U,G)})})}function w(U,te){te(" makeSpaceForEdgeLabels",function(){B(U)}),te(" removeSelfEdges",function(){Y(U)}),te(" acyclic",function(){e.run(U)}),te(" nestingGraph.run",function(){l.run(U)}),te(" rank",function(){r(g.asNonCompoundGraph(U))}),te(" injectEdgeLabelProxies",function(){H(U)}),te(" removeEmptyRanks",function(){a(U)}),te(" nestingGraph.cleanup",function(){l.cleanup(U)}),te(" normalizeRanks",function(){s(U)}),te(" assignRankMinMax",function(){W(U)}),te(" removeEdgeLabelProxies",function(){ee(U)}),te(" normalize.run",function(){n.run(U)}),te(" parentDummyChains",function(){i(U)}),te(" addBorderSegments",function(){c(U)}),te(" order",function(){h(U)}),te(" insertSelfEdges",function(){R(U)}),te(" adjustCoordinateSystem",function(){d.adjust(U)}),te(" position",function(){m(U)}),te(" positionSelfEdges",function(){ie(U)}),te(" removeBorderNodes",function(){K(U)}),te(" normalize.undo",function(){n.undo(U)}),te(" fixupEdgeLabelCoords",function(){L(U)}),te(" undoCoordinateSystem",function(){d.undo(U)}),te(" translateGraph",function(){I(U)}),te(" assignNodeIntersects",function(){V(U)}),te(" reversePoints",function(){$(U)}),te(" acyclic.undo",function(){e.undo(U)})}function S(U,te){t.forEach(U.nodes(),function(ne){var G=U.node(ne),se=te.node(ne);G&&(G.x=se.x,G.y=se.y,te.children(ne).length&&(G.width=se.width,G.height=se.height))}),t.forEach(U.edges(),function(ne){var G=U.edge(ne),se=te.edge(ne);G.points=se.points,t.has(se,"x")&&(G.x=se.x,G.y=se.y)}),U.graph().width=te.graph().width,U.graph().height=te.graph().height}var k=["nodesep","edgesep","ranksep","marginx","marginy"],j={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},N=["acyclicer","ranker","rankdir","align"],T=["width","height"],E={width:0,height:0},_=["minlen","weight","width","height","labeloffset"],A={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},D=["labelpos"];function q(U){var te=new x({multigraph:!0,compound:!0}),ne=z(U.graph());return te.setGraph(t.merge({},j,X(ne,k),t.pick(ne,N))),t.forEach(U.nodes(),function(G){var se=z(U.node(G));te.setNode(G,t.defaults(X(se,T),E)),te.setParent(G,U.parent(G))}),t.forEach(U.edges(),function(G){var se=z(U.edge(G));te.setEdge(G,t.merge({},A,X(se,_),t.pick(se,D)))}),te}function B(U){var te=U.graph();te.ranksep/=2,t.forEach(U.edges(),function(ne){var G=U.edge(ne);G.minlen*=2,G.labelpos.toLowerCase()!=="c"&&(te.rankdir==="TB"||te.rankdir==="BT"?G.width+=G.labeloffset:G.height+=G.labeloffset)})}function H(U){t.forEach(U.edges(),function(te){var ne=U.edge(te);if(ne.width&&ne.height){var G=U.node(te.v),se=U.node(te.w),re={rank:(se.rank-G.rank)/2+G.rank,e:te};g.addDummyNode(U,"edge-proxy",re,"_ep")}})}function W(U){var te=0;t.forEach(U.nodes(),function(ne){var G=U.node(ne);G.borderTop&&(G.minRank=U.node(G.borderTop).rank,G.maxRank=U.node(G.borderBottom).rank,te=t.max(te,G.maxRank))}),U.graph().maxRank=te}function ee(U){t.forEach(U.nodes(),function(te){var ne=U.node(te);ne.dummy==="edge-proxy"&&(U.edge(ne.e).labelRank=ne.rank,U.removeNode(te))})}function I(U){var te=Number.POSITIVE_INFINITY,ne=0,G=Number.POSITIVE_INFINITY,se=0,re=U.graph(),ae=re.marginx||0,_e=re.marginy||0;function Be(Ye){var Je=Ye.x,Oe=Ye.y,Ve=Ye.width,Ue=Ye.height;te=Math.min(te,Je-Ve/2),ne=Math.max(ne,Je+Ve/2),G=Math.min(G,Oe-Ue/2),se=Math.max(se,Oe+Ue/2)}t.forEach(U.nodes(),function(Ye){Be(U.node(Ye))}),t.forEach(U.edges(),function(Ye){var Je=U.edge(Ye);t.has(Je,"x")&&Be(Je)}),te-=ae,G-=_e,t.forEach(U.nodes(),function(Ye){var Je=U.node(Ye);Je.x-=te,Je.y-=G}),t.forEach(U.edges(),function(Ye){var Je=U.edge(Ye);t.forEach(Je.points,function(Oe){Oe.x-=te,Oe.y-=G}),t.has(Je,"x")&&(Je.x-=te),t.has(Je,"y")&&(Je.y-=G)}),re.width=ne-te+ae,re.height=se-G+_e}function V(U){t.forEach(U.edges(),function(te){var ne=U.edge(te),G=U.node(te.v),se=U.node(te.w),re,ae;ne.points?(re=ne.points[0],ae=ne.points[ne.points.length-1]):(ne.points=[],re=se,ae=G),ne.points.unshift(g.intersectRect(G,re)),ne.points.push(g.intersectRect(se,ae))})}function L(U){t.forEach(U.edges(),function(te){var ne=U.edge(te);if(t.has(ne,"x"))switch((ne.labelpos==="l"||ne.labelpos==="r")&&(ne.width-=ne.labeloffset),ne.labelpos){case"l":ne.x-=ne.width/2+ne.labeloffset;break;case"r":ne.x+=ne.width/2+ne.labeloffset;break}})}function $(U){t.forEach(U.edges(),function(te){var ne=U.edge(te);ne.reversed&&ne.points.reverse()})}function K(U){t.forEach(U.nodes(),function(te){if(U.children(te).length){var ne=U.node(te),G=U.node(ne.borderTop),se=U.node(ne.borderBottom),re=U.node(t.last(ne.borderLeft)),ae=U.node(t.last(ne.borderRight));ne.width=Math.abs(ae.x-re.x),ne.height=Math.abs(se.y-G.y),ne.x=re.x+ne.width/2,ne.y=G.y+ne.height/2}}),t.forEach(U.nodes(),function(te){U.node(te).dummy==="border"&&U.removeNode(te)})}function Y(U){t.forEach(U.edges(),function(te){if(te.v===te.w){var ne=U.node(te.v);ne.selfEdges||(ne.selfEdges=[]),ne.selfEdges.push({e:te,label:U.edge(te)}),U.removeEdge(te)}})}function R(U){var te=g.buildLayerMatrix(U);t.forEach(te,function(ne){var G=0;t.forEach(ne,function(se,re){var ae=U.node(se);ae.order=re+G,t.forEach(ae.selfEdges,function(_e){g.addDummyNode(U,"selfedge",{width:_e.label.width,height:_e.label.height,rank:ae.rank,order:re+ ++G,e:_e.e,label:_e.label},"_se")}),delete ae.selfEdges})})}function ie(U){t.forEach(U.nodes(),function(te){var ne=U.node(te);if(ne.dummy==="selfedge"){var G=U.node(ne.e.v),se=G.x+G.width/2,re=G.y,ae=ne.x-se,_e=G.height/2;U.setEdge(ne.e,ne.label),U.removeNode(te),ne.label.points=[{x:se+2*ae/3,y:re-_e},{x:se+5*ae/6,y:re-_e},{x:se+ae,y:re},{x:se+5*ae/6,y:re+_e},{x:se+2*ae/3,y:re+_e}],ne.label.x=ne.x,ne.label.y=ne.y}})}function X(U,te){return t.mapValues(t.pick(U,te),Number)}function z(U){var te={};return t.forEach(U,function(ne,G){te[G.toLowerCase()]=ne}),te}return Y3}var K3,pz;function STe(){if(pz)return K3;pz=1;var t=Ar(),e=Ti(),n=to().Graph;K3={debugOrdering:r};function r(s){var i=e.buildLayerMatrix(s),a=new n({compound:!0,multigraph:!0}).setGraph({});return t.forEach(s.nodes(),function(l){a.setNode(l,{label:l}),a.setParent(l,"layer"+s.node(l).rank)}),t.forEach(s.edges(),function(l){a.setEdge(l.v,l.w,{},l.name)}),t.forEach(i,function(l,c){var d="layer"+c;a.setNode(d,{rank:"same"}),t.reduce(l,function(h,m){return a.setEdge(h,m,{style:"invis"}),m})}),a}return K3}var Z3,gz;function kTe(){return gz||(gz=1,Z3="0.8.5"),Z3}var J3,xz;function OTe(){return xz||(xz=1,J3={graphlib:to(),layout:wTe(),debug:STe(),util:{time:Ti().time,notime:Ti().notime},version:kTe()}),J3}var jTe=OTe();const vz=yd(jTe),m7="/api/webui";async function NTe(t=100,e="all"){const n=`${m7}/knowledge/graph?limit=${t}&node_type=${e}`,r=await fetch(n);if(!r.ok)throw new Error(`获取知识图谱失败: ${r.status}`);return r.json()}async function CTe(){const t=await fetch(`${m7}/knowledge/stats`);if(!t.ok)throw new Error("获取知识图谱统计信息失败");return t.json()}async function TTe(t){const e=await fetch(`${m7}/knowledge/search?query=${encodeURIComponent(t)}`);if(!e.ok)throw new Error("搜索知识节点失败");return e.json()}const LG=b.memo(({data:t})=>o.jsxs("div",{className:"px-4 py-2 shadow-md rounded-lg bg-gradient-to-br from-blue-500 to-blue-600 border-2 border-blue-700 min-w-[120px]",children:[o.jsx(au,{type:"target",position:kt.Top}),o.jsx("div",{className:"font-semibold text-white text-sm truncate max-w-[200px]",title:t.content,children:t.label}),o.jsx(au,{type:"source",position:kt.Bottom})]}));LG.displayName="EntityNode";const BG=b.memo(({data:t})=>o.jsxs("div",{className:"px-3 py-2 shadow-md rounded-md bg-gradient-to-br from-green-500 to-green-600 border-2 border-green-700 min-w-[100px]",children:[o.jsx(au,{type:"target",position:kt.Top}),o.jsx("div",{className:"font-medium text-white text-xs truncate max-w-[150px]",title:t.content,children:t.label}),o.jsx(au,{type:"source",position:kt.Bottom})]}));BG.displayName="ParagraphNode";const ETe={entity:LG,paragraph:BG};function _Te(t,e){const n=new vz.graphlib.Graph;n.setDefaultEdgeLabel(()=>({})),n.setGraph({rankdir:"TB",ranksep:100,nodesep:80});const r=[],s=[];return t.forEach(i=>{n.setNode(i.id,{width:150,height:50})}),e.forEach(i=>{n.setEdge(i.source,i.target)}),vz.layout(n),t.forEach(i=>{const a=n.node(i.id);r.push({id:i.id,type:i.type,position:{x:a.x-75,y:a.y-25},data:{label:i.content.slice(0,20)+(i.content.length>20?"...":""),content:i.content}})}),e.forEach((i,a)=>{const l={id:`edge-${a}`,source:i.source,target:i.target,animated:t.length<=200&&i.weight>5,style:{strokeWidth:Math.min(i.weight/2,5),opacity:.6}};i.weight>10&&t.length<100&&(l.label=`${i.weight.toFixed(0)}`),s.push(l)}),{nodes:r,edges:s}}function ATe(){const t=na(),[e,n]=b.useState(!1),[r,s]=b.useState(null),[i,a]=b.useState(""),[l,c]=b.useState("all"),[d,h]=b.useState(50),[m,g]=b.useState("50"),[x,y]=b.useState(!1),[w,S]=b.useState(!0),[k,j]=b.useState(!1),[N,T]=b.useState(!1),[E,_,A]=$Ce([]),[D,q,B]=HCe([]),[H,W]=b.useState(0),[ee,I]=b.useState(null),[V,L]=b.useState(null),{toast:$}=Lr(),K=b.useCallback(ne=>ne.type==="entity"?"#6366f1":ne.type==="paragraph"?"#10b981":"#6b7280",[]),Y=b.useCallback(async(ne=!1)=>{try{if(!ne&&d>200){T(!0);return}n(!0);const[G,se]=await Promise.all([NTe(d,l),CTe()]);if(s(se),G.nodes.length===0){$({title:"提示",description:"知识库为空,请先导入知识数据"}),_([]),q([]);return}const{nodes:re,edges:ae}=_Te(G.nodes,G.edges);_(re),q(ae),W(re.length),se&&se.total_nodes>d&&$({title:"提示",description:`知识图谱包含 ${se.total_nodes} 个节点,当前显示 ${re.length} 个`}),$({title:"加载成功",description:`已加载 ${re.length} 个节点,${ae.length} 条边`})}catch(G){console.error("加载知识图谱失败:",G),$({title:"加载失败",description:G instanceof Error?G.message:"未知错误",variant:"destructive"})}finally{n(!1)}},[d,l,$]),R=b.useCallback(async()=>{if(!i.trim()){$({title:"提示",description:"请输入搜索关键词"});return}try{const ne=await TTe(i);if(ne.length===0){$({title:"未找到",description:"没有找到匹配的节点"});return}const G=new Set(ne.map(se=>se.id));_(se=>se.map(re=>({...re,style:{...re.style,opacity:G.has(re.id)?1:.3,filter:G.has(re.id)?"brightness(1.2)":"brightness(0.8)"}}))),$({title:"搜索完成",description:`找到 ${ne.length} 个匹配节点`})}catch(ne){console.error("搜索失败:",ne),$({title:"搜索失败",description:ne instanceof Error?ne.message:"未知错误",variant:"destructive"})}},[i,$]),ie=b.useCallback(()=>{_(ne=>ne.map(G=>({...G,style:{...G.style,opacity:1,filter:"brightness(1)"}})))},[]),X=b.useCallback(()=>{S(!1),j(!0),Y()},[Y]),z=b.useCallback(()=>{T(!1),setTimeout(()=>{Y(!0)},0)},[Y]),U=b.useCallback((ne,G)=>{E.find(re=>re.id===G.id)&&I({id:G.id,type:G.type,content:G.data.content})},[E]);b.useEffect(()=>{w||k&&Y()},[d,l,w,k]);const te=b.useCallback((ne,G)=>{const se=E.find(_e=>_e.id===G.source),re=E.find(_e=>_e.id===G.target),ae=D.find(_e=>_e.id===G.id);se&&re&&ae&&L({source:{id:se.id,type:se.type,content:se.data.content},target:{id:re.id,type:re.type,content:re.data.content},edge:{source:G.source,target:G.target,weight:parseFloat(G.label||"0")}})},[E,D]);return o.jsxs("div",{className:"h-full flex flex-col",children:[o.jsxs("div",{className:"flex-shrink-0 p-4 border-b bg-background",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"麦麦知识库图谱"}),o.jsx("p",{className:"text-muted-foreground mt-1",children:"可视化知识实体与关系网络"})]}),r&&o.jsxs("div",{className:"flex gap-2 flex-wrap",children:[o.jsxs(tn,{variant:"outline",className:"gap-1",children:[o.jsx(sk,{className:"h-3 w-3"}),"节点: ",r.total_nodes]}),o.jsxs(tn,{variant:"outline",className:"gap-1",children:[o.jsx(NI,{className:"h-3 w-3"}),"边: ",r.total_edges]}),o.jsxs(tn,{variant:"outline",className:"gap-1",children:[o.jsx(Xi,{className:"h-3 w-3"}),"实体: ",r.entity_nodes]}),o.jsxs(tn,{variant:"outline",className:"gap-1",children:[o.jsx(Po,{className:"h-3 w-3"}),"段落: ",r.paragraph_nodes]})]})]}),o.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 mt-4",children:[o.jsxs("div",{className:"flex-1 flex gap-2",children:[o.jsx(Pe,{placeholder:"搜索节点内容...",value:i,onChange:ne=>a(ne.target.value),onKeyDown:ne=>ne.key==="Enter"&&R(),className:"flex-1"}),o.jsx(ue,{onClick:R,size:"sm",children:o.jsx(ii,{className:"h-4 w-4"})}),o.jsx(ue,{onClick:ie,variant:"outline",size:"sm",children:"重置"})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsxs(Vt,{value:l,onValueChange:ne=>c(ne),children:[o.jsx($t,{className:"w-[120px]",children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"all",children:"全部节点"}),o.jsx(De,{value:"entity",children:"仅实体"}),o.jsx(De,{value:"paragraph",children:"仅段落"})]})]}),o.jsxs(Vt,{value:d===1e4?"all":x?"custom":d.toString(),onValueChange:ne=>{ne==="custom"?(y(!0),g(d.toString())):ne==="all"?(y(!1),h(1e4)):(y(!1),h(Number(ne)))},children:[o.jsx($t,{className:"w-[120px]",children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"50",children:"50 节点"}),o.jsx(De,{value:"100",children:"100 节点"}),o.jsx(De,{value:"200",children:"200 节点"}),o.jsx(De,{value:"500",children:"500 节点"}),o.jsx(De,{value:"1000",children:"1000 节点"}),o.jsx(De,{value:"all",children:"全部 (最多10000)"}),o.jsx(De,{value:"custom",children:"自定义..."})]})]}),x&&o.jsx(Pe,{type:"number",min:"50",value:m,onChange:ne=>g(ne.target.value),onBlur:()=>{const ne=parseInt(m);!isNaN(ne)&&ne>=50?h(ne):(g("50"),h(50))},onKeyDown:ne=>{if(ne.key==="Enter"){const G=parseInt(m);!isNaN(G)&&G>=50?h(G):(g("50"),h(50))}},placeholder:"最少50个",className:"w-[120px]"}),o.jsx(ue,{onClick:()=>Y(),variant:"outline",size:"sm",disabled:e,children:o.jsx(Qs,{className:xe("h-4 w-4",e&&"animate-spin")})})]})]})]}),o.jsx("div",{className:"flex-1 relative",children:e?o.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:o.jsxs("div",{className:"text-center",children:[o.jsx(Qs,{className:"h-8 w-8 animate-spin mx-auto mb-2 text-muted-foreground"}),o.jsx("p",{className:"text-muted-foreground",children:"加载知识图谱中..."})]})}):E.length===0?o.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:o.jsxs("div",{className:"text-center",children:[o.jsx(sk,{className:"h-12 w-12 mx-auto mb-4 text-muted-foreground"}),o.jsx("h3",{className:"text-lg font-semibold mb-2",children:"知识库为空"}),o.jsx("p",{className:"text-muted-foreground",children:"请先导入知识数据"})]})}):o.jsxs(pG,{nodes:E,edges:D,onNodesChange:A,onEdgesChange:B,onNodeClick:U,onEdgeClick:te,nodeTypes:ETe,fitView:!0,minZoom:.05,maxZoom:1.5,defaultViewport:{x:0,y:0,zoom:.5},elevateNodesOnSelect:H<=500,nodesDraggable:H<=1e3,attributionPosition:"bottom-left",children:[o.jsx(h8e,{variant:Ea.Dots,gap:12,size:1}),o.jsx(a8e,{}),H<=500&&o.jsx(JCe,{nodeColor:K,nodeBorderRadius:8,pannable:!0,zoomable:!0}),o.jsxs(rw,{position:"top-right",className:"bg-background/95 backdrop-blur-sm rounded-lg border p-3 shadow-lg",children:[o.jsx("div",{className:"text-sm font-semibold mb-2",children:"图例"}),o.jsxs("div",{className:"space-y-2 text-xs",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"w-4 h-4 rounded bg-gradient-to-br from-blue-500 to-blue-600 border-2 border-blue-700"}),o.jsx("span",{children:"实体节点"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"w-4 h-4 rounded bg-gradient-to-br from-green-500 to-green-600 border-2 border-green-700"}),o.jsx("span",{children:"段落节点"})]}),H>200&&o.jsxs("div",{className:"mt-2 pt-2 border-t text-yellow-600 dark:text-yellow-500",children:[o.jsx("div",{className:"font-semibold",children:"性能模式"}),o.jsx("div",{children:"已禁用动画"}),H>500&&o.jsx("div",{children:"已禁用缩略图"})]})]})]})]})}),o.jsx(Er,{open:!!ee,onOpenChange:ne=>!ne&&I(null),children:o.jsxs(wr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[o.jsx(Sr,{children:o.jsx(kr,{children:"节点详情"})}),ee&&o.jsxs("div",{className:"space-y-4",children:[o.jsx("div",{className:"grid grid-cols-2 gap-4",children:o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"类型"}),o.jsx("div",{className:"mt-1",children:o.jsx(tn,{variant:ee.type==="entity"?"default":"secondary",children:ee.type==="entity"?"🏷️ 实体":"📄 段落"})})]})}),o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"ID"}),o.jsx("code",{className:"mt-1 block p-2 bg-muted rounded text-xs break-all",children:ee.id})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"内容"}),o.jsx(pn,{className:"mt-1 h-40 p-3 bg-muted rounded",children:o.jsx("p",{className:"text-sm whitespace-pre-wrap",children:ee.content})})]})]})]})}),o.jsx(Er,{open:!!V,onOpenChange:ne=>!ne&&L(null),children:o.jsxs(wr,{className:"max-w-2xl max-h-[80vh] overflow-hidden flex flex-col",children:[o.jsx(Sr,{children:o.jsx(kr,{children:"边详情"})}),V&&o.jsx(pn,{className:"flex-1 pr-4",children:o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsxs("div",{className:"flex-1 min-w-0 p-3 bg-blue-50 dark:bg-blue-950 rounded border-2 border-blue-200 dark:border-blue-800",children:[o.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"源节点"}),o.jsx("div",{className:"font-medium text-sm mb-2 truncate",children:V.source.content}),o.jsxs("code",{className:"text-xs text-muted-foreground truncate block",children:[V.source.id.slice(0,40),"..."]})]}),o.jsx("div",{className:"text-2xl text-muted-foreground flex-shrink-0",children:"→"}),o.jsxs("div",{className:"flex-1 min-w-0 p-3 bg-green-50 dark:bg-green-950 rounded border-2 border-green-200 dark:border-green-800",children:[o.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"目标节点"}),o.jsx("div",{className:"font-medium text-sm mb-2 truncate",children:V.target.content}),o.jsxs("code",{className:"text-xs text-muted-foreground truncate block",children:[V.target.id.slice(0,40),"..."]})]})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"权重"}),o.jsx("div",{className:"mt-1",children:o.jsx(tn,{variant:"outline",className:"text-base font-mono",children:V.edge.weight.toFixed(4)})})]})]})})]})}),o.jsx(Fn,{open:w,onOpenChange:S,children:o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"加载知识图谱"}),o.jsxs(zn,{children:["知识图谱的动态展示会消耗较多系统资源。",o.jsx("br",{}),"确定要加载知识图谱吗?"]})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{onClick:()=>t({to:"/"}),children:"取消 (返回首页)"}),o.jsx(In,{onClick:X,children:"确认加载"})]})]})}),o.jsx(Fn,{open:N,onOpenChange:T,children:o.jsxs(Mn,{children:[o.jsxs(Rn,{children:[o.jsx(Pn,{children:"⚠️ 节点数量较多"}),o.jsx(zn,{asChild:!0,children:o.jsxs("div",{children:[o.jsxs("p",{children:["您正在尝试加载 ",o.jsx("strong",{className:"text-orange-600",children:d>=1e4?"全部 (最多10000个)":d})," 个节点。"]}),o.jsx("p",{className:"mt-4",children:"节点数量过多可能导致:"}),o.jsxs("ul",{className:"list-disc list-inside mt-2 space-y-1",children:[o.jsx("li",{children:"页面加载时间较长"}),o.jsx("li",{children:"浏览器卡顿或崩溃"}),o.jsx("li",{children:"系统资源占用过高"})]}),o.jsx("p",{className:"mt-4",children:"建议先选择较少的节点数量 (50-200 个)。"})]})})]}),o.jsxs(Dn,{children:[o.jsx(Ln,{onClick:()=>{T(!1),d>200&&(h(50),y(!1))},children:"取消"}),o.jsx(In,{onClick:z,className:"bg-orange-600 hover:bg-orange-700",children:"我了解风险,继续加载"})]})]})})]})}function gh(t,e,n){let r=n.initialDeps??[],s;function i(){var a,l,c,d;let h;n.key&&((a=n.debug)!=null&&a.call(n))&&(h=Date.now());const m=t();if(!(m.length!==r.length||m.some((y,w)=>r[w]!==y)))return s;r=m;let x;if(n.key&&((l=n.debug)!=null&&l.call(n))&&(x=Date.now()),s=e(...m),n.key&&((c=n.debug)!=null&&c.call(n))){const y=Math.round((Date.now()-h)*100)/100,w=Math.round((Date.now()-x)*100)/100,S=w/16,k=(j,N)=>{for(j=String(j);j.length<N;)j=" "+j;return j};console.info(`%c⏱ ${k(w,5)} /${k(y,5)} ms`,`
|
||
font-size: .6rem;
|
||
font-weight: bold;
|
||
color: hsl(${Math.max(0,Math.min(120-120*S,120))}deg 100% 31%);`,n?.key)}return(d=n?.onChange)==null||d.call(n,s),s}return i.updateDeps=a=>{r=a},i}function yz(t,e){if(t===void 0)throw new Error("Unexpected undefined");return t}const MTe=(t,e)=>Math.abs(t-e)<1.01,RTe=(t,e,n)=>{let r;return function(...s){t.clearTimeout(r),r=t.setTimeout(()=>e.apply(this,s),n)}},bz=t=>{const{offsetWidth:e,offsetHeight:n}=t;return{width:e,height:n}},DTe=t=>t,PTe=t=>{const e=Math.max(t.startIndex-t.overscan,0),n=Math.min(t.endIndex+t.overscan,t.count-1),r=[];for(let s=e;s<=n;s++)r.push(s);return r},zTe=(t,e)=>{const n=t.scrollElement;if(!n)return;const r=t.targetWindow;if(!r)return;const s=a=>{const{width:l,height:c}=a;e({width:Math.round(l),height:Math.round(c)})};if(s(bz(n)),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(a=>{const l=()=>{const c=a[0];if(c?.borderBoxSize){const d=c.borderBoxSize[0];if(d){s({width:d.inlineSize,height:d.blockSize});return}}s(bz(n))};t.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},wz={passive:!0},Sz=typeof window>"u"?!0:"onscrollend"in window,ITe=(t,e)=>{const n=t.scrollElement;if(!n)return;const r=t.targetWindow;if(!r)return;let s=0;const i=t.options.useScrollendEvent&&Sz?()=>{}:RTe(r,()=>{e(s,!1)},t.options.isScrollingResetDelay),a=h=>()=>{const{horizontal:m,isRtl:g}=t.options;s=m?n.scrollLeft*(g&&-1||1):n.scrollTop,i(),e(s,h)},l=a(!0),c=a(!1);c(),n.addEventListener("scroll",l,wz);const d=t.options.useScrollendEvent&&Sz;return d&&n.addEventListener("scrollend",c,wz),()=>{n.removeEventListener("scroll",l),d&&n.removeEventListener("scrollend",c)}},LTe=(t,e,n)=>{if(e?.borderBoxSize){const r=e.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return t[n.options.horizontal?"offsetWidth":"offsetHeight"]},BTe=(t,{adjustments:e=0,behavior:n},r)=>{var s,i;const a=t+e;(i=(s=r.scrollElement)==null?void 0:s.scrollTo)==null||i.call(s,{[r.options.horizontal?"left":"top"]:a,behavior:n})};class FTe{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(s=>{s.forEach(i=>{const a=()=>{this._measureElement(i.target,i)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var s;(s=r())==null||s.disconnect(),n=null},observe:s=>{var i;return(i=r())==null?void 0:i.observe(s,{box:"border-box"})},unobserve:s=>{var i;return(i=r())==null?void 0:i.unobserve(s)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,s])=>{typeof s>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:DTe,rangeExtractor:PTe,onChange:()=>{},measureElement:LTe,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var r,s;(s=(r=this.options).onChange)==null||s.call(r,this,n)},this.maybeNotify=gh(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(s=>{this.observer.observe(s)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,s=>{this.scrollRect=s,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(s,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<s?"forward":"backward":null,this.scrollOffset=s,this.isScrolling=i,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const s=new Map,i=new Map;for(let a=r-1;a>=0;a--){const l=n[a];if(s.has(l.lane))continue;const c=i.get(l.lane);if(c==null||l.end>c.end?i.set(l.lane,l):l.end<c.end&&s.set(l.lane,!0),s.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((a,l)=>a.end===l.end?a.index-l.index:a.end-l.end)[0]:void 0},this.getMeasurementOptions=gh(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(n,r,s,i,a)=>(this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:s,getItemKey:i,enabled:a}),{key:!1}),this.getMeasurements=gh(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:s,getItemKey:i,enabled:a},l)=>{if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(h=>{this.itemSizeCache.set(h.key,h.size)}));const c=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const d=this.measurementsCache.slice(0,c);for(let h=c;h<n;h++){const m=i(h),g=this.options.lanes===1?d[h-1]:this.getFurthestMeasurement(d,h),x=g?g.end+this.options.gap:r+s,y=l.get(m),w=typeof y=="number"?y:this.options.estimateSize(h),S=x+w,k=g?g.lane:h%this.options.lanes;d[h]={index:h,start:x,size:w,end:S,key:m,lane:k}}return this.measurementsCache=d,d},{key:!1,debug:()=>this.options.debug}),this.calculateRange=gh(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,s,i)=>this.range=n.length>0&&r>0?qTe({measurements:n,outerSize:r,scrollOffset:s,lanes:i}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=gh(()=>{let n=null,r=null;const s=this.calculateRange();return s&&(n=s.startIndex,r=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,s,i,a)=>i===null||a===null?[]:n({startIndex:i,endIndex:a,overscan:r,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,s=n.getAttribute(r);return s?parseInt(s,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(n,r)=>{const s=this.indexFromElement(n),i=this.measurementsCache[s];if(!i)return;const a=i.key,l=this.elementsCache.get(a);l!==n&&(l&&this.observer.unobserve(l),this.observer.observe(n),this.elementsCache.set(a,n)),n.isConnected&&this.resizeItem(s,this.options.measureElement(n,r,this))},this.resizeItem=(n,r)=>{const s=this.measurementsCache[n];if(!s)return;const i=this.itemSizeCache.get(s.key)??s.size,a=r-i;a!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(s,a,this):s.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(s.index),this.itemSizeCache=new Map(this.itemSizeCache.set(s.key,r)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((r,s)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(s))});return}this._measureElement(n,void 0)},this.getVirtualItems=gh(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const s=[];for(let i=0,a=n.length;i<a;i++){const l=n[i],c=r[l];s.push(c)}return s},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return yz(r[FG(0,r.length-1,s=>yz(r[s]).start,n)])},this.getOffsetForAlignment=(n,r,s=0)=>{const i=this.getSize(),a=this.getScrollOffset();r==="auto"&&(r=n>=a+i?"end":"start"),r==="center"?n+=(s-i)/2:r==="end"&&(n-=i);const l=this.getTotalSize()+this.options.scrollMargin-i;return Math.max(Math.min(l,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const s=this.measurementsCache[n];if(!s)return;const i=this.getSize(),a=this.getScrollOffset();if(r==="auto")if(s.end>=a+i-this.options.scrollPaddingEnd)r="end";else if(s.start<=a+this.options.scrollPaddingStart)r="start";else return[a,r];const l=r==="end"?s.end+this.options.scrollPaddingEnd:s.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(l,r,s.size),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(n,{align:r="start",behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,r),{adjustments:void 0,behavior:s})},this.scrollToIndex=(n,{align:r="auto",behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n=Math.max(0,Math.min(n,this.options.count-1));let i=0;const a=10,l=d=>{if(!this.targetWindow)return;const h=this.getOffsetForIndex(n,d);if(!h){console.warn("Failed to get offset for index:",n);return}const[m,g]=h;this._scrollToOffset(m,{adjustments:void 0,behavior:s}),this.targetWindow.requestAnimationFrame(()=>{const x=this.getScrollOffset(),y=this.getOffsetForIndex(n,g);if(!y){console.warn("Failed to get offset for index:",n);return}MTe(y[0],x)||c(g)})},c=d=>{this.targetWindow&&(i++,i<a?this.targetWindow.requestAnimationFrame(()=>l(d)):console.warn(`Failed to scroll to index ${n} after ${a} attempts.`))};l(r)},this.scrollBy=(n,{behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let s;if(r.length===0)s=this.options.paddingStart;else if(this.options.lanes===1)s=((n=r[r.length-1])==null?void 0:n.end)??0;else{const i=Array(this.options.lanes).fill(null);let a=r.length-1;for(;a>=0&&i.some(l=>l===null);){const l=r[a];i[l.lane]===null&&(i[l.lane]=l.end),a--}s=Math.max(...i.filter(l=>l!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:s})=>{this.options.scrollToFn(n,{behavior:s,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(e)}}const FG=(t,e,n,r)=>{for(;t<=e;){const s=(t+e)/2|0,i=n(s);if(i<r)t=s+1;else if(i>r)e=s-1;else return s}return t>0?t-1:0};function qTe({measurements:t,outerSize:e,scrollOffset:n,lanes:r}){const s=t.length-1,i=c=>t[c].start;if(t.length<=r)return{startIndex:0,endIndex:s};let a=FG(0,s,i,n),l=a;if(r===1)for(;l<s&&t[l].end<n+e;)l++;else if(r>1){const c=Array(r).fill(0);for(;l<s&&c.some(h=>h<n+e);){const h=t[l];c[h.lane]=h.end,l++}const d=Array(r).fill(n+e);for(;a>=0&&d.some(h=>h>=n);){const h=t[a];d[h.lane]=h.start,a--}a=Math.max(0,a-a%r),l=Math.min(s,l+(r-1-l%r))}return{startIndex:a,endIndex:l}}const kz=typeof document<"u"?b.useLayoutEffect:b.useEffect;function $Te(t){const e=b.useReducer(()=>({}),{})[1],n={...t,onChange:(s,i)=>{var a;i?ya.flushSync(e):e(),(a=t.onChange)==null||a.call(t,s,i)}},[r]=b.useState(()=>new FTe(n));return r.setOptions(n),kz(()=>r._didMount(),[]),kz(()=>r._willUpdate()),r}function HTe(t){return $Te({observeElementRect:zTe,observeElementOffset:ITe,scrollToFn:BTe,...t})}function QTe(t,e,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:t,timeZoneName:n}).format(e).split(/\s/g).slice(2).join(" ")}const VTe={},x0={};function Ku(t,e){try{const r=(VTe[t]||=new Intl.DateTimeFormat("en-US",{timeZone:t,timeZoneName:"longOffset"}).format)(e).split("GMT")[1];return r in x0?x0[r]:Oz(r,r.split(":"))}catch{if(t in x0)return x0[t];const n=t?.match(UTe);return n?Oz(t,n.slice(1)):NaN}}const UTe=/([+-]\d\d):?(\d\d)?/;function Oz(t,e){const n=+(e[0]||0),r=+(e[1]||0),s=+(e[2]||0)/60;return x0[t]=n*60+r>0?n*60+r+s:n*60-r-s}class Do extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]=="string"&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(Ku(this.timeZone,this))?this.setTime(NaN):e.length?typeof e[0]=="number"&&(e.length===1||e.length===2&&typeof e[1]!="number")?this.setTime(e[0]):typeof e[0]=="string"?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),qG(this),dj(this)):this.setTime(Date.now())}static tz(e,...n){return n.length?new Do(...n,e):new Do(Date.now(),e)}withTimeZone(e){return new Do(+this,e)}getTimezoneOffset(){const e=-Ku(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),dj(this),+this}[Symbol.for("constructDateFrom")](e){return new Do(+new Date(e),this.timeZone)}}const jz=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(t=>{if(!jz.test(t))return;const e=t.replace(jz,"$1UTC");Do.prototype[e]&&(t.startsWith("get")?Do.prototype[t]=function(){return this.internal[e]()}:(Do.prototype[t]=function(){return Date.prototype[e].apply(this.internal,arguments),WTe(this),+this},Do.prototype[e]=function(){return Date.prototype[e].apply(this,arguments),dj(this),+this}))});function dj(t){t.internal.setTime(+t),t.internal.setUTCSeconds(t.internal.getUTCSeconds()-Math.round(-Ku(t.timeZone,t)*60))}function WTe(t){Date.prototype.setFullYear.call(t,t.internal.getUTCFullYear(),t.internal.getUTCMonth(),t.internal.getUTCDate()),Date.prototype.setHours.call(t,t.internal.getUTCHours(),t.internal.getUTCMinutes(),t.internal.getUTCSeconds(),t.internal.getUTCMilliseconds()),qG(t)}function qG(t){const e=Ku(t.timeZone,t),n=e>0?Math.floor(e):Math.ceil(e),r=new Date(+t);r.setUTCHours(r.getUTCHours()-1);const s=-new Date(+t).getTimezoneOffset(),i=-new Date(+r).getTimezoneOffset(),a=s-i,l=Date.prototype.getHours.apply(t)!==t.internal.getUTCHours();a&&l&&t.internal.setUTCMinutes(t.internal.getUTCMinutes()+a);const c=s-n;c&&Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+c);const d=new Date(+t);d.setUTCSeconds(0);const h=s>0?d.getSeconds():(d.getSeconds()-60)%60,m=Math.round(-(Ku(t.timeZone,t)*60))%60;(m||h)&&(t.internal.setUTCSeconds(t.internal.getUTCSeconds()+m),Date.prototype.setUTCSeconds.call(t,Date.prototype.getUTCSeconds.call(t)+m+h));const g=Ku(t.timeZone,t),x=g>0?Math.floor(g):Math.ceil(g),w=-new Date(+t).getTimezoneOffset()-x,S=x!==n,k=w-c;if(S&&k){Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+k);const j=Ku(t.timeZone,t),N=j>0?Math.floor(j):Math.ceil(j),T=x-N;T&&(t.internal.setUTCMinutes(t.internal.getUTCMinutes()+T),Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+T))}}class Bs extends Do{static tz(e,...n){return n.length?new Bs(...n,e):new Bs(Date.now(),e)}toISOString(){const[e,n,r]=this.tzComponents(),s=`${e}${n}:${r}`;return this.internal.toISOString().slice(0,-1)+s}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[e,n,r,s]=this.internal.toUTCString().split(" ");return`${e?.slice(0,-1)} ${r} ${n} ${s}`}toTimeString(){const e=this.internal.toUTCString().split(" ")[4],[n,r,s]=this.tzComponents();return`${e} GMT${n}${r}${s} (${QTe(this.timeZone,this)})`}toLocaleString(e,n){return Date.prototype.toLocaleString.call(this,e,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleDateString(e,n){return Date.prototype.toLocaleDateString.call(this,e,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleTimeString(e,n){return Date.prototype.toLocaleTimeString.call(this,e,{...n,timeZone:n?.timeZone||this.timeZone})}tzComponents(){const e=this.getTimezoneOffset(),n=e>0?"-":"+",r=String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),s=String(Math.abs(e)%60).padStart(2,"0");return[n,r,s]}withTimeZone(e){return new Bs(+this,e)}[Symbol.for("constructDateFrom")](e){return new Bs(+new Date(e),this.timeZone)}}const $G=6048e5,GTe=864e5,Nz=Symbol.for("constructDateFrom");function as(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&Nz in t?t[Nz](e):t instanceof Date?new t.constructor(e):new Date(e)}function ir(t,e){return as(e||t,t)}function HG(t,e,n){const r=ir(t,n?.in);return isNaN(e)?as(t,NaN):(e&&r.setDate(r.getDate()+e),r)}function QG(t,e,n){const r=ir(t,n?.in);if(isNaN(e))return as(t,NaN);if(!e)return r;const s=r.getDate(),i=as(t,r.getTime());i.setMonth(r.getMonth()+e+1,0);const a=i.getDate();return s>=a?i:(r.setFullYear(i.getFullYear(),i.getMonth(),s),r)}let XTe={};function Og(){return XTe}function ou(t,e){const n=Og(),r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=ir(t,e?.in),i=s.getDay(),a=(i<r?7:0)+i-r;return s.setDate(s.getDate()-a),s.setHours(0,0,0,0),s}function Tp(t,e){return ou(t,{...e,weekStartsOn:1})}function VG(t,e){const n=ir(t,e?.in),r=n.getFullYear(),s=as(n,0);s.setFullYear(r+1,0,4),s.setHours(0,0,0,0);const i=Tp(s),a=as(n,0);a.setFullYear(r,0,4),a.setHours(0,0,0,0);const l=Tp(a);return n.getTime()>=i.getTime()?r+1:n.getTime()>=l.getTime()?r:r-1}function Cz(t){const e=ir(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function Nd(t,...e){const n=as.bind(null,t||e.find(r=>typeof r=="object"));return e.map(n)}function Ep(t,e){const n=ir(t,e?.in);return n.setHours(0,0,0,0),n}function UG(t,e,n){const[r,s]=Nd(n?.in,t,e),i=Ep(r),a=Ep(s),l=+i-Cz(i),c=+a-Cz(a);return Math.round((l-c)/GTe)}function YTe(t,e){const n=VG(t,e),r=as(t,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Tp(r)}function KTe(t,e,n){return HG(t,e*7,n)}function ZTe(t,e,n){return QG(t,e*12,n)}function JTe(t,e){let n,r=e?.in;return t.forEach(s=>{!r&&typeof s=="object"&&(r=as.bind(null,s));const i=ir(s,r);(!n||n<i||isNaN(+i))&&(n=i)}),as(r,n||NaN)}function e9e(t,e){let n,r=e?.in;return t.forEach(s=>{!r&&typeof s=="object"&&(r=as.bind(null,s));const i=ir(s,r);(!n||n>i||isNaN(+i))&&(n=i)}),as(r,n||NaN)}function t9e(t,e,n){const[r,s]=Nd(n?.in,t,e);return+Ep(r)==+Ep(s)}function WG(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function n9e(t){return!(!WG(t)&&typeof t!="number"||isNaN(+ir(t)))}function r9e(t,e,n){const[r,s]=Nd(n?.in,t,e),i=r.getFullYear()-s.getFullYear(),a=r.getMonth()-s.getMonth();return i*12+a}function s9e(t,e){const n=ir(t,e?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function GG(t,e){const[n,r]=Nd(t,e.start,e.end);return{start:n,end:r}}function i9e(t,e){const{start:n,end:r}=GG(e?.in,t);let s=+n>+r;const i=s?+n:+r,a=s?r:n;a.setHours(0,0,0,0),a.setDate(1);let l=1;const c=[];for(;+a<=i;)c.push(as(n,a)),a.setMonth(a.getMonth()+l);return s?c.reverse():c}function a9e(t,e){const n=ir(t,e?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function o9e(t,e){const n=ir(t,e?.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function XG(t,e){const n=ir(t,e?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function l9e(t,e){const{start:n,end:r}=GG(e?.in,t);let s=+n>+r;const i=s?+n:+r,a=s?r:n;a.setHours(0,0,0,0),a.setMonth(0,1);let l=1;const c=[];for(;+a<=i;)c.push(as(n,a)),a.setFullYear(a.getFullYear()+l);return s?c.reverse():c}function YG(t,e){const n=Og(),r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=ir(t,e?.in),i=s.getDay(),a=(i<r?-7:0)+6-(i-r);return s.setDate(s.getDate()+a),s.setHours(23,59,59,999),s}function c9e(t,e){return YG(t,{...e,weekStartsOn:1})}const u9e={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"}},d9e=(t,e,n)=>{let r;const s=u9e[t];return typeof s=="string"?r=s:e===1?r=s.one:r=s.other.replace("{{count}}",e.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Uh(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const h9e={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},f9e={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},m9e={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},p9e={date:Uh({formats:h9e,defaultWidth:"full"}),time:Uh({formats:f9e,defaultWidth:"full"}),dateTime:Uh({formats:m9e,defaultWidth:"full"})},g9e={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},x9e=(t,e,n,r)=>g9e[t];function jo(t){return(e,n)=>{const r=n?.context?String(n.context):"standalone";let s;if(r==="formatting"&&t.formattingValues){const a=t.defaultFormattingWidth||t.defaultWidth,l=n?.width?String(n.width):a;s=t.formattingValues[l]||t.formattingValues[a]}else{const a=t.defaultWidth,l=n?.width?String(n.width):t.defaultWidth;s=t.values[l]||t.values[a]}const i=t.argumentCallback?t.argumentCallback(e):e;return s[i]}}const v9e={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},y9e={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},b9e={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"]},w9e={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"]},S9e={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"}},k9e={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"}},O9e=(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},j9e={ordinalNumber:O9e,era:jo({values:v9e,defaultWidth:"wide"}),quarter:jo({values:y9e,defaultWidth:"wide",argumentCallback:t=>t-1}),month:jo({values:b9e,defaultWidth:"wide"}),day:jo({values:w9e,defaultWidth:"wide"}),dayPeriod:jo({values:S9e,defaultWidth:"wide",formattingValues:k9e,defaultFormattingWidth:"wide"})};function No(t){return(e,n={})=>{const r=n.width,s=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=e.match(s);if(!i)return null;const a=i[0],l=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?C9e(l,m=>m.test(a)):N9e(l,m=>m.test(a));let d;d=t.valueCallback?t.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const h=e.slice(a.length);return{value:d,rest:h}}}function N9e(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function C9e(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function KG(t){return(e,n={})=>{const r=e.match(t.matchPattern);if(!r)return null;const s=r[0],i=e.match(t.parsePattern);if(!i)return null;let a=t.valueCallback?t.valueCallback(i[0]):i[0];a=n.valueCallback?n.valueCallback(a):a;const l=e.slice(s.length);return{value:a,rest:l}}}const T9e=/^(\d+)(th|st|nd|rd)?/i,E9e=/\d+/i,_9e={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},A9e={any:[/^b/i,/^(a|c)/i]},M9e={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},R9e={any:[/1/i,/2/i,/3/i,/4/i]},D9e={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},P9e={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]},z9e={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},I9e={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]},L9e={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},B9e={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}},F9e={ordinalNumber:KG({matchPattern:T9e,parsePattern:E9e,valueCallback:t=>parseInt(t,10)}),era:No({matchPatterns:_9e,defaultMatchWidth:"wide",parsePatterns:A9e,defaultParseWidth:"any"}),quarter:No({matchPatterns:M9e,defaultMatchWidth:"wide",parsePatterns:R9e,defaultParseWidth:"any",valueCallback:t=>t+1}),month:No({matchPatterns:D9e,defaultMatchWidth:"wide",parsePatterns:P9e,defaultParseWidth:"any"}),day:No({matchPatterns:z9e,defaultMatchWidth:"wide",parsePatterns:I9e,defaultParseWidth:"any"}),dayPeriod:No({matchPatterns:L9e,defaultMatchWidth:"any",parsePatterns:B9e,defaultParseWidth:"any"})},p7={code:"en-US",formatDistance:d9e,formatLong:p9e,formatRelative:x9e,localize:j9e,match:F9e,options:{weekStartsOn:0,firstWeekContainsDate:1}};function q9e(t,e){const n=ir(t,e?.in);return UG(n,XG(n))+1}function ZG(t,e){const n=ir(t,e?.in),r=+Tp(n)-+YTe(n);return Math.round(r/$G)+1}function JG(t,e){const n=ir(t,e?.in),r=n.getFullYear(),s=Og(),i=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,a=as(e?.in||t,0);a.setFullYear(r+1,0,i),a.setHours(0,0,0,0);const l=ou(a,e),c=as(e?.in||t,0);c.setFullYear(r,0,i),c.setHours(0,0,0,0);const d=ou(c,e);return+n>=+l?r+1:+n>=+d?r:r-1}function $9e(t,e){const n=Og(),r=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,s=JG(t,e),i=as(e?.in||t,0);return i.setFullYear(s,0,r),i.setHours(0,0,0,0),ou(i,e)}function eX(t,e){const n=ir(t,e?.in),r=+ou(n,e)-+$9e(n,e);return Math.round(r/$G)+1}function Jn(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const Rc={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return Jn(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):Jn(n+1,2)},d(t,e){return Jn(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){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(t,e){return Jn(t.getHours()%12||12,e.length)},H(t,e){return Jn(t.getHours(),e.length)},m(t,e){return Jn(t.getMinutes(),e.length)},s(t,e){return Jn(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),s=Math.trunc(r*Math.pow(10,n-3));return Jn(s,e.length)}},xh={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Tz={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),s=r>0?r:1-r;return n.ordinalNumber(s,{unit:"year"})}return Rc.y(t,e)},Y:function(t,e,n,r){const s=JG(t,r),i=s>0?s:1-s;if(e==="YY"){const a=i%100;return Jn(a,2)}return e==="Yo"?n.ordinalNumber(i,{unit:"year"}):Jn(i,e.length)},R:function(t,e){const n=VG(t);return Jn(n,e.length)},u:function(t,e){const n=t.getFullYear();return Jn(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return Jn(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return Jn(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return Rc.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return Jn(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const s=eX(t,r);return e==="wo"?n.ordinalNumber(s,{unit:"week"}):Jn(s,e.length)},I:function(t,e,n){const r=ZG(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):Jn(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):Rc.d(t,e)},D:function(t,e,n){const r=q9e(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Jn(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const s=t.getDay(),i=(s-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return Jn(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});case"eeee":default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const s=t.getDay(),i=(s-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return Jn(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});case"cccc":default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),s=r===0?7:r;switch(e){case"i":return String(s);case"ii":return Jn(s,e.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const s=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let s;switch(r===12?s=xh.noon:r===0?s=xh.midnight:s=r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let s;switch(r>=17?s=xh.evening:r>=12?s=xh.afternoon:r>=4?s=xh.morning:s=xh.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Rc.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):Rc.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Jn(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):Jn(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):Rc.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):Rc.s(t,e)},S:function(t,e){return Rc.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return _z(r);case"XXXX":case"XX":return $u(r);case"XXXXX":case"XXX":default:return $u(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return _z(r);case"xxxx":case"xx":return $u(r);case"xxxxx":case"xxx":default:return $u(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Ez(r,":");case"OOOO":default:return"GMT"+$u(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Ez(r,":");case"zzzz":default:return"GMT"+$u(r,":")}},t:function(t,e,n){const r=Math.trunc(+t/1e3);return Jn(r,e.length)},T:function(t,e,n){return Jn(+t,e.length)}};function Ez(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),s=Math.trunc(r/60),i=r%60;return i===0?n+String(s):n+String(s)+e+Jn(i,2)}function _z(t,e){return t%60===0?(t>0?"-":"+")+Jn(Math.abs(t)/60,2):$u(t,e)}function $u(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),s=Jn(Math.trunc(r/60),2),i=Jn(r%60,2);return n+s+e+i}const Az=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},tX=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},H9e=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],s=n[2];if(!s)return Az(t,e);let i;switch(r){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",Az(r,e)).replace("{{time}}",tX(s,e))},Q9e={p:tX,P:H9e},V9e=/^D+$/,U9e=/^Y+$/,W9e=["D","DD","YY","YYYY"];function G9e(t){return V9e.test(t)}function X9e(t){return U9e.test(t)}function Y9e(t,e,n){const r=K9e(t,e,n);if(console.warn(r),W9e.includes(t))throw new RangeError(r)}function K9e(t,e,n){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Z9e=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,J9e=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,eEe=/^'([^]*?)'?$/,tEe=/''/g,nEe=/[a-zA-Z]/;function Dv(t,e,n){const r=Og(),s=n?.locale??r.locale??p7,i=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,l=ir(t,n?.in);if(!n9e(l))throw new RangeError("Invalid time value");let c=e.match(J9e).map(h=>{const m=h[0];if(m==="p"||m==="P"){const g=Q9e[m];return g(h,s.formatLong)}return h}).join("").match(Z9e).map(h=>{if(h==="''")return{isToken:!1,value:"'"};const m=h[0];if(m==="'")return{isToken:!1,value:rEe(h)};if(Tz[m])return{isToken:!0,value:h};if(m.match(nEe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:h}});s.localize.preprocessor&&(c=s.localize.preprocessor(l,c));const d={firstWeekContainsDate:i,weekStartsOn:a,locale:s};return c.map(h=>{if(!h.isToken)return h.value;const m=h.value;(!n?.useAdditionalWeekYearTokens&&X9e(m)||!n?.useAdditionalDayOfYearTokens&&G9e(m))&&Y9e(m,e,String(t));const g=Tz[m[0]];return g(l,m,s.localize,d)}).join("")}function rEe(t){const e=t.match(eEe);return e?e[1].replace(tEe,"'"):t}function sEe(t,e){const n=ir(t,e?.in),r=n.getFullYear(),s=n.getMonth(),i=as(n,0);return i.setFullYear(r,s+1,0),i.setHours(0,0,0,0),i.getDate()}function iEe(t,e){return ir(t,e?.in).getMonth()}function aEe(t,e){return ir(t,e?.in).getFullYear()}function oEe(t,e){return+ir(t)>+ir(e)}function lEe(t,e){return+ir(t)<+ir(e)}function cEe(t,e,n){const[r,s]=Nd(n?.in,t,e);return+ou(r,n)==+ou(s,n)}function uEe(t,e,n){const[r,s]=Nd(n?.in,t,e);return r.getFullYear()===s.getFullYear()&&r.getMonth()===s.getMonth()}function dEe(t,e,n){const[r,s]=Nd(n?.in,t,e);return r.getFullYear()===s.getFullYear()}function hEe(t,e,n){const r=ir(t,n?.in),s=r.getFullYear(),i=r.getDate(),a=as(t,0);a.setFullYear(s,e,15),a.setHours(0,0,0,0);const l=sEe(a);return r.setMonth(e,Math.min(i,l)),r}function fEe(t,e,n){const r=ir(t,n?.in);return isNaN(+r)?as(t,NaN):(r.setFullYear(e),r)}const Mz=5,mEe=4;function pEe(t,e){const n=e.startOfMonth(t),r=n.getDay()>0?n.getDay():7,s=e.addDays(t,-r+1),i=e.addDays(s,Mz*7-1);return e.getMonth(t)===e.getMonth(i)?Mz:mEe}function nX(t,e){const n=e.startOfMonth(t),r=n.getDay();return r===1?n:r===0?e.addDays(n,-6):e.addDays(n,-1*(r-1))}function gEe(t,e){const n=nX(t,e),r=pEe(t,e);return e.addDays(n,r*7-1)}class ta{constructor(e,n){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?Bs.tz(this.options.timeZone):new this.Date,this.newDate=(r,s,i)=>this.overrides?.newDate?this.overrides.newDate(r,s,i):this.options.timeZone?new Bs(r,s,i,this.options.timeZone):new Date(r,s,i),this.addDays=(r,s)=>this.overrides?.addDays?this.overrides.addDays(r,s):HG(r,s),this.addMonths=(r,s)=>this.overrides?.addMonths?this.overrides.addMonths(r,s):QG(r,s),this.addWeeks=(r,s)=>this.overrides?.addWeeks?this.overrides.addWeeks(r,s):KTe(r,s),this.addYears=(r,s)=>this.overrides?.addYears?this.overrides.addYears(r,s):ZTe(r,s),this.differenceInCalendarDays=(r,s)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,s):UG(r,s),this.differenceInCalendarMonths=(r,s)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,s):r9e(r,s),this.eachMonthOfInterval=r=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(r):i9e(r),this.eachYearOfInterval=r=>{const s=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(r):l9e(r),i=new Set(s.map(l=>this.getYear(l)));if(i.size===s.length)return s;const a=[];return i.forEach(l=>{a.push(new Date(l,0,1))}),a},this.endOfBroadcastWeek=r=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(r):gEe(r,this),this.endOfISOWeek=r=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(r):c9e(r),this.endOfMonth=r=>this.overrides?.endOfMonth?this.overrides.endOfMonth(r):s9e(r),this.endOfWeek=(r,s)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(r,s):YG(r,this.options),this.endOfYear=r=>this.overrides?.endOfYear?this.overrides.endOfYear(r):o9e(r),this.format=(r,s,i)=>{const a=this.overrides?.format?this.overrides.format(r,s,this.options):Dv(r,s,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(a):a},this.getISOWeek=r=>this.overrides?.getISOWeek?this.overrides.getISOWeek(r):ZG(r),this.getMonth=(r,s)=>this.overrides?.getMonth?this.overrides.getMonth(r,this.options):iEe(r,this.options),this.getYear=(r,s)=>this.overrides?.getYear?this.overrides.getYear(r,this.options):aEe(r,this.options),this.getWeek=(r,s)=>this.overrides?.getWeek?this.overrides.getWeek(r,this.options):eX(r,this.options),this.isAfter=(r,s)=>this.overrides?.isAfter?this.overrides.isAfter(r,s):oEe(r,s),this.isBefore=(r,s)=>this.overrides?.isBefore?this.overrides.isBefore(r,s):lEe(r,s),this.isDate=r=>this.overrides?.isDate?this.overrides.isDate(r):WG(r),this.isSameDay=(r,s)=>this.overrides?.isSameDay?this.overrides.isSameDay(r,s):t9e(r,s),this.isSameMonth=(r,s)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(r,s):uEe(r,s),this.isSameYear=(r,s)=>this.overrides?.isSameYear?this.overrides.isSameYear(r,s):dEe(r,s),this.max=r=>this.overrides?.max?this.overrides.max(r):JTe(r),this.min=r=>this.overrides?.min?this.overrides.min(r):e9e(r),this.setMonth=(r,s)=>this.overrides?.setMonth?this.overrides.setMonth(r,s):hEe(r,s),this.setYear=(r,s)=>this.overrides?.setYear?this.overrides.setYear(r,s):fEe(r,s),this.startOfBroadcastWeek=(r,s)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):nX(r,this),this.startOfDay=r=>this.overrides?.startOfDay?this.overrides.startOfDay(r):Ep(r),this.startOfISOWeek=r=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(r):Tp(r),this.startOfMonth=r=>this.overrides?.startOfMonth?this.overrides.startOfMonth(r):a9e(r),this.startOfWeek=(r,s)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(r,this.options):ou(r,this.options),this.startOfYear=r=>this.overrides?.startOfYear?this.overrides.startOfYear(r):XG(r),this.options={locale:p7,...e},this.overrides=n}getDigitMap(){const{numerals:e="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:e}),r={};for(let s=0;s<10;s++)r[s.toString()]=n.format(s);return r}replaceDigits(e){const n=this.getDigitMap();return e.replace(/\d/g,r=>n[r]||r)}formatNumber(e){return this.replaceDigits(e.toString())}getMonthYearOrder(){const e=this.options.locale?.code;return e&&ta.yearFirstLocales.has(e)?"year-first":"month-first"}formatMonthYear(e){const{locale:n,timeZone:r,numerals:s}=this.options,i=n?.code;if(i&&ta.yearFirstLocales.has(i))try{return new Intl.DateTimeFormat(i,{month:"long",year:"numeric",timeZone:r,numberingSystem:s}).format(e)}catch{}const a=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(e,a)}}ta.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 Zo=new ta;class rX{constructor(e,n,r=Zo){this.date=e,this.displayMonth=n,this.outside=!!(n&&!r.isSameMonth(e,n)),this.dateLib=r}isEqualTo(e){return this.dateLib.isSameDay(e.date,this.date)&&this.dateLib.isSameMonth(e.displayMonth,this.displayMonth)}}class xEe{constructor(e,n){this.date=e,this.weeks=n}}class vEe{constructor(e,n){this.days=n,this.weekNumber=e}}function yEe(t){return oe.createElement("button",{...t})}function bEe(t){return oe.createElement("span",{...t})}function wEe(t){const{size:e=24,orientation:n="left",className:r}=t;return oe.createElement("svg",{className:r,width:e,height:e,viewBox:"0 0 24 24"},n==="up"&&oe.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&oe.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&oe.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&oe.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function SEe(t){const{day:e,modifiers:n,...r}=t;return oe.createElement("td",{...r})}function kEe(t){const{day:e,modifiers:n,...r}=t,s=oe.useRef(null);return oe.useEffect(()=>{n.focused&&s.current?.focus()},[n.focused]),oe.createElement("button",{ref:s,...r})}var Nt;(function(t){t.Root="root",t.Chevron="chevron",t.Day="day",t.DayButton="day_button",t.CaptionLabel="caption_label",t.Dropdowns="dropdowns",t.Dropdown="dropdown",t.DropdownRoot="dropdown_root",t.Footer="footer",t.MonthGrid="month_grid",t.MonthCaption="month_caption",t.MonthsDropdown="months_dropdown",t.Month="month",t.Months="months",t.Nav="nav",t.NextMonthButton="button_next",t.PreviousMonthButton="button_previous",t.Week="week",t.Weeks="weeks",t.Weekday="weekday",t.Weekdays="weekdays",t.WeekNumber="week_number",t.WeekNumberHeader="week_number_header",t.YearsDropdown="years_dropdown"})(Nt||(Nt={}));var zr;(function(t){t.disabled="disabled",t.hidden="hidden",t.outside="outside",t.focused="focused",t.today="today"})(zr||(zr={}));var Wa;(function(t){t.range_end="range_end",t.range_middle="range_middle",t.range_start="range_start",t.selected="selected"})(Wa||(Wa={}));var Vi;(function(t){t.weeks_before_enter="weeks_before_enter",t.weeks_before_exit="weeks_before_exit",t.weeks_after_enter="weeks_after_enter",t.weeks_after_exit="weeks_after_exit",t.caption_after_enter="caption_after_enter",t.caption_after_exit="caption_after_exit",t.caption_before_enter="caption_before_enter",t.caption_before_exit="caption_before_exit"})(Vi||(Vi={}));function OEe(t){const{options:e,className:n,components:r,classNames:s,...i}=t,a=[s[Nt.Dropdown],n].join(" "),l=e?.find(({value:c})=>c===i.value);return oe.createElement("span",{"data-disabled":i.disabled,className:s[Nt.DropdownRoot]},oe.createElement(r.Select,{className:a,...i},e?.map(({value:c,label:d,disabled:h})=>oe.createElement(r.Option,{key:c,value:c,disabled:h},d))),oe.createElement("span",{className:s[Nt.CaptionLabel],"aria-hidden":!0},l?.label,oe.createElement(r.Chevron,{orientation:"down",size:18,className:s[Nt.Chevron]})))}function jEe(t){return oe.createElement("div",{...t})}function NEe(t){return oe.createElement("div",{...t})}function CEe(t){const{calendarMonth:e,displayIndex:n,...r}=t;return oe.createElement("div",{...r},t.children)}function TEe(t){const{calendarMonth:e,displayIndex:n,...r}=t;return oe.createElement("div",{...r})}function EEe(t){return oe.createElement("table",{...t})}function _Ee(t){return oe.createElement("div",{...t})}const sX=b.createContext(void 0);function jg(){const t=b.useContext(sX);if(t===void 0)throw new Error("useDayPicker() must be used within a custom component.");return t}function AEe(t){const{components:e}=jg();return oe.createElement(e.Dropdown,{...t})}function MEe(t){const{onPreviousClick:e,onNextClick:n,previousMonth:r,nextMonth:s,...i}=t,{components:a,classNames:l,labels:{labelPrevious:c,labelNext:d}}=jg(),h=b.useCallback(g=>{s&&n?.(g)},[s,n]),m=b.useCallback(g=>{r&&e?.(g)},[r,e]);return oe.createElement("nav",{...i},oe.createElement(a.PreviousMonthButton,{type:"button",className:l[Nt.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":c(r),onClick:m},oe.createElement(a.Chevron,{disabled:r?void 0:!0,className:l[Nt.Chevron],orientation:"left"})),oe.createElement(a.NextMonthButton,{type:"button",className:l[Nt.NextMonthButton],tabIndex:s?void 0:-1,"aria-disabled":s?void 0:!0,"aria-label":d(s),onClick:h},oe.createElement(a.Chevron,{disabled:s?void 0:!0,orientation:"right",className:l[Nt.Chevron]})))}function REe(t){const{components:e}=jg();return oe.createElement(e.Button,{...t})}function DEe(t){return oe.createElement("option",{...t})}function PEe(t){const{components:e}=jg();return oe.createElement(e.Button,{...t})}function zEe(t){const{rootRef:e,...n}=t;return oe.createElement("div",{...n,ref:e})}function IEe(t){return oe.createElement("select",{...t})}function LEe(t){const{week:e,...n}=t;return oe.createElement("tr",{...n})}function BEe(t){return oe.createElement("th",{...t})}function FEe(t){return oe.createElement("thead",{"aria-hidden":!0},oe.createElement("tr",{...t}))}function qEe(t){const{week:e,...n}=t;return oe.createElement("th",{...n})}function $Ee(t){return oe.createElement("th",{...t})}function HEe(t){return oe.createElement("tbody",{...t})}function QEe(t){const{components:e}=jg();return oe.createElement(e.Dropdown,{...t})}const VEe=Object.freeze(Object.defineProperty({__proto__:null,Button:yEe,CaptionLabel:bEe,Chevron:wEe,Day:SEe,DayButton:kEe,Dropdown:OEe,DropdownNav:jEe,Footer:NEe,Month:CEe,MonthCaption:TEe,MonthGrid:EEe,Months:_Ee,MonthsDropdown:AEe,Nav:MEe,NextMonthButton:REe,Option:DEe,PreviousMonthButton:PEe,Root:zEe,Select:IEe,Week:LEe,WeekNumber:qEe,WeekNumberHeader:$Ee,Weekday:BEe,Weekdays:FEe,Weeks:HEe,YearsDropdown:QEe},Symbol.toStringTag,{value:"Module"}));function Il(t,e,n=!1,r=Zo){let{from:s,to:i}=t;const{differenceInCalendarDays:a,isSameDay:l}=r;return s&&i?(a(i,s)<0&&([s,i]=[i,s]),a(e,s)>=(n?1:0)&&a(i,e)>=(n?1:0)):!n&&i?l(i,e):!n&&s?l(s,e):!1}function iX(t){return!!(t&&typeof t=="object"&&"before"in t&&"after"in t)}function g7(t){return!!(t&&typeof t=="object"&&"from"in t)}function aX(t){return!!(t&&typeof t=="object"&&"after"in t)}function oX(t){return!!(t&&typeof t=="object"&&"before"in t)}function lX(t){return!!(t&&typeof t=="object"&&"dayOfWeek"in t)}function cX(t,e){return Array.isArray(t)&&t.every(e.isDate)}function Ll(t,e,n=Zo){const r=Array.isArray(e)?e:[e],{isSameDay:s,differenceInCalendarDays:i,isAfter:a}=n;return r.some(l=>{if(typeof l=="boolean")return l;if(n.isDate(l))return s(t,l);if(cX(l,n))return l.includes(t);if(g7(l))return Il(l,t,!1,n);if(lX(l))return Array.isArray(l.dayOfWeek)?l.dayOfWeek.includes(t.getDay()):l.dayOfWeek===t.getDay();if(iX(l)){const c=i(l.before,t),d=i(l.after,t),h=c>0,m=d<0;return a(l.before,l.after)?m&&h:h||m}return aX(l)?i(t,l.after)>0:oX(l)?i(l.before,t)>0:typeof l=="function"?l(t):!1})}function UEe(t,e,n,r,s){const{disabled:i,hidden:a,modifiers:l,showOutsideDays:c,broadcastCalendar:d,today:h}=e,{isSameDay:m,isSameMonth:g,startOfMonth:x,isBefore:y,endOfMonth:w,isAfter:S}=s,k=n&&x(n),j=r&&w(r),N={[zr.focused]:[],[zr.outside]:[],[zr.disabled]:[],[zr.hidden]:[],[zr.today]:[]},T={};for(const E of t){const{date:_,displayMonth:A}=E,D=!!(A&&!g(_,A)),q=!!(k&&y(_,k)),B=!!(j&&S(_,j)),H=!!(i&&Ll(_,i,s)),W=!!(a&&Ll(_,a,s))||q||B||!d&&!c&&D||d&&c===!1&&D,ee=m(_,h??s.today());D&&N.outside.push(E),H&&N.disabled.push(E),W&&N.hidden.push(E),ee&&N.today.push(E),l&&Object.keys(l).forEach(I=>{const V=l?.[I];V&&Ll(_,V,s)&&(T[I]?T[I].push(E):T[I]=[E])})}return E=>{const _={[zr.focused]:!1,[zr.disabled]:!1,[zr.hidden]:!1,[zr.outside]:!1,[zr.today]:!1},A={};for(const D in N){const q=N[D];_[D]=q.some(B=>B===E)}for(const D in T)A[D]=T[D].some(q=>q===E);return{..._,...A}}}function WEe(t,e,n={}){return Object.entries(t).filter(([,s])=>s===!0).reduce((s,[i])=>(n[i]?s.push(n[i]):e[zr[i]]?s.push(e[zr[i]]):e[Wa[i]]&&s.push(e[Wa[i]]),s),[e[Nt.Day]])}function GEe(t){return{...VEe,...t}}function XEe(t){const e={"data-mode":t.mode??void 0,"data-required":"required"in t?t.required:void 0,"data-multiple-months":t.numberOfMonths&&t.numberOfMonths>1||void 0,"data-week-numbers":t.showWeekNumber||void 0,"data-broadcast-calendar":t.broadcastCalendar||void 0,"data-nav-layout":t.navLayout||void 0};return Object.entries(t).forEach(([n,r])=>{n.startsWith("data-")&&(e[n]=r)}),e}function x7(){const t={};for(const e in Nt)t[Nt[e]]=`rdp-${Nt[e]}`;for(const e in zr)t[zr[e]]=`rdp-${zr[e]}`;for(const e in Wa)t[Wa[e]]=`rdp-${Wa[e]}`;for(const e in Vi)t[Vi[e]]=`rdp-${Vi[e]}`;return t}function uX(t,e,n){return(n??new ta(e)).formatMonthYear(t)}const YEe=uX;function KEe(t,e,n){return(n??new ta(e)).format(t,"d")}function ZEe(t,e=Zo){return e.format(t,"LLLL")}function JEe(t,e,n){return(n??new ta(e)).format(t,"cccccc")}function e_e(t,e=Zo){return t<10?e.formatNumber(`0${t.toLocaleString()}`):e.formatNumber(`${t.toLocaleString()}`)}function t_e(){return""}function dX(t,e=Zo){return e.format(t,"yyyy")}const n_e=dX,r_e=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:uX,formatDay:KEe,formatMonthCaption:YEe,formatMonthDropdown:ZEe,formatWeekNumber:e_e,formatWeekNumberHeader:t_e,formatWeekdayName:JEe,formatYearCaption:n_e,formatYearDropdown:dX},Symbol.toStringTag,{value:"Module"}));function s_e(t){return t?.formatMonthCaption&&!t.formatCaption&&(t.formatCaption=t.formatMonthCaption),t?.formatYearCaption&&!t.formatYearDropdown&&(t.formatYearDropdown=t.formatYearCaption),{...r_e,...t}}function i_e(t,e,n,r,s){const{startOfMonth:i,startOfYear:a,endOfYear:l,eachMonthOfInterval:c,getMonth:d}=s;return c({start:a(t),end:l(t)}).map(g=>{const x=r.formatMonthDropdown(g,s),y=d(g),w=e&&g<i(e)||n&&g>i(n)||!1;return{value:y,label:x,disabled:w}})}function a_e(t,e={},n={}){let r={...e?.[Nt.Day]};return Object.entries(t).filter(([,s])=>s===!0).forEach(([s])=>{r={...r,...n?.[s]}}),r}function o_e(t,e,n){const r=t.today(),s=e?t.startOfISOWeek(r):t.startOfWeek(r),i=[];for(let a=0;a<7;a++){const l=t.addDays(s,a);i.push(l)}return i}function l_e(t,e,n,r,s=!1){if(!t||!e)return;const{startOfYear:i,endOfYear:a,eachYearOfInterval:l,getYear:c}=r,d=i(t),h=a(e),m=l({start:d,end:h});return s&&m.reverse(),m.map(g=>{const x=n.formatYearDropdown(g,r);return{value:c(g),label:x,disabled:!1}})}function hX(t,e,n,r){let s=(r??new ta(n)).format(t,"PPPP");return e.today&&(s=`Today, ${s}`),e.selected&&(s=`${s}, selected`),s}const c_e=hX;function fX(t,e,n){return(n??new ta(e)).formatMonthYear(t)}const u_e=fX;function d_e(t,e,n,r){let s=(r??new ta(n)).format(t,"PPPP");return e?.today&&(s=`Today, ${s}`),s}function h_e(t){return"Choose the Month"}function f_e(){return""}function m_e(t){return"Go to the Next Month"}function p_e(t){return"Go to the Previous Month"}function g_e(t,e,n){return(n??new ta(e)).format(t,"cccc")}function x_e(t,e){return`Week ${t}`}function v_e(t){return"Week Number"}function y_e(t){return"Choose the Year"}const b_e=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:u_e,labelDay:c_e,labelDayButton:hX,labelGrid:fX,labelGridcell:d_e,labelMonthDropdown:h_e,labelNav:f_e,labelNext:m_e,labelPrevious:p_e,labelWeekNumber:x_e,labelWeekNumberHeader:v_e,labelWeekday:g_e,labelYearDropdown:y_e},Symbol.toStringTag,{value:"Module"})),Ng=t=>t instanceof HTMLElement?t:null,ek=t=>[...t.querySelectorAll("[data-animated-month]")??[]],w_e=t=>Ng(t.querySelector("[data-animated-month]")),tk=t=>Ng(t.querySelector("[data-animated-caption]")),nk=t=>Ng(t.querySelector("[data-animated-weeks]")),S_e=t=>Ng(t.querySelector("[data-animated-nav]")),k_e=t=>Ng(t.querySelector("[data-animated-weekdays]"));function O_e(t,e,{classNames:n,months:r,focused:s,dateLib:i}){const a=b.useRef(null),l=b.useRef(r),c=b.useRef(!1);b.useLayoutEffect(()=>{const d=l.current;if(l.current=r,!e||!t.current||!(t.current instanceof HTMLElement)||r.length===0||d.length===0||r.length!==d.length)return;const h=i.isSameMonth(r[0].date,d[0].date),m=i.isAfter(r[0].date,d[0].date),g=m?n[Vi.caption_after_enter]:n[Vi.caption_before_enter],x=m?n[Vi.weeks_after_enter]:n[Vi.weeks_before_enter],y=a.current,w=t.current.cloneNode(!0);if(w instanceof HTMLElement?(ek(w).forEach(N=>{if(!(N instanceof HTMLElement))return;const T=w_e(N);T&&N.contains(T)&&N.removeChild(T);const E=tk(N);E&&E.classList.remove(g);const _=nk(N);_&&_.classList.remove(x)}),a.current=w):a.current=null,c.current||h||s)return;const S=y instanceof HTMLElement?ek(y):[],k=ek(t.current);if(k?.every(j=>j instanceof HTMLElement)&&S&&S.every(j=>j instanceof HTMLElement)){c.current=!0,t.current.style.isolation="isolate";const j=S_e(t.current);j&&(j.style.zIndex="1"),k.forEach((N,T)=>{const E=S[T];if(!E)return;N.style.position="relative",N.style.overflow="hidden";const _=tk(N);_&&_.classList.add(g);const A=nk(N);A&&A.classList.add(x);const D=()=>{c.current=!1,t.current&&(t.current.style.isolation=""),j&&(j.style.zIndex=""),_&&_.classList.remove(g),A&&A.classList.remove(x),N.style.position="",N.style.overflow="",N.contains(E)&&N.removeChild(E)};E.style.pointerEvents="none",E.style.position="absolute",E.style.overflow="hidden",E.setAttribute("aria-hidden","true");const q=k_e(E);q&&(q.style.opacity="0");const B=tk(E);B&&(B.classList.add(m?n[Vi.caption_before_exit]:n[Vi.caption_after_exit]),B.addEventListener("animationend",D));const H=nk(E);H&&H.classList.add(m?n[Vi.weeks_before_exit]:n[Vi.weeks_after_exit]),N.insertBefore(E,N.firstChild)})}})}function j_e(t,e,n,r){const s=t[0],i=t[t.length-1],{ISOWeek:a,fixedWeeks:l,broadcastCalendar:c}=n??{},{addDays:d,differenceInCalendarDays:h,differenceInCalendarMonths:m,endOfBroadcastWeek:g,endOfISOWeek:x,endOfMonth:y,endOfWeek:w,isAfter:S,startOfBroadcastWeek:k,startOfISOWeek:j,startOfWeek:N}=r,T=c?k(s,r):a?j(s):N(s),E=c?g(i):a?x(y(i)):w(y(i)),_=h(E,T),A=m(i,s)+1,D=[];for(let H=0;H<=_;H++){const W=d(T,H);if(e&&S(W,e))break;D.push(W)}const B=(c?35:42)*A;if(l&&D.length<B){const H=B-D.length;for(let W=0;W<H;W++){const ee=d(D[D.length-1],1);D.push(ee)}}return D}function N_e(t){const e=[];return t.reduce((n,r)=>{const s=r.weeks.reduce((i,a)=>i.concat(a.days.slice()),e.slice());return n.concat(s.slice())},e.slice())}function C_e(t,e,n,r){const{numberOfMonths:s=1}=n,i=[];for(let a=0;a<s;a++){const l=r.addMonths(t,a);if(e&&l>e)break;i.push(l)}return i}function Rz(t,e,n,r){const{month:s,defaultMonth:i,today:a=r.today(),numberOfMonths:l=1}=t;let c=s||i||a;const{differenceInCalendarMonths:d,addMonths:h,startOfMonth:m}=r;if(n&&d(n,c)<l-1){const g=-1*(l-1);c=h(n,g)}return e&&d(c,e)<0&&(c=e),m(c)}function T_e(t,e,n,r){const{addDays:s,endOfBroadcastWeek:i,endOfISOWeek:a,endOfMonth:l,endOfWeek:c,getISOWeek:d,getWeek:h,startOfBroadcastWeek:m,startOfISOWeek:g,startOfWeek:x}=r,y=t.reduce((w,S)=>{const k=n.broadcastCalendar?m(S,r):n.ISOWeek?g(S):x(S),j=n.broadcastCalendar?i(S):n.ISOWeek?a(l(S)):c(l(S)),N=e.filter(A=>A>=k&&A<=j),T=n.broadcastCalendar?35:42;if(n.fixedWeeks&&N.length<T){const A=e.filter(D=>{const q=T-N.length;return D>j&&D<=s(j,q)});N.push(...A)}const E=N.reduce((A,D)=>{const q=n.ISOWeek?d(D):h(D),B=A.find(W=>W.weekNumber===q),H=new rX(D,S,r);return B?B.days.push(H):A.push(new vEe(q,[H])),A},[]),_=new xEe(S,E);return w.push(_),w},[]);return n.reverseMonths?y.reverse():y}function E_e(t,e){let{startMonth:n,endMonth:r}=t;const{startOfYear:s,startOfDay:i,startOfMonth:a,endOfMonth:l,addYears:c,endOfYear:d,newDate:h,today:m}=e,{fromYear:g,toYear:x,fromMonth:y,toMonth:w}=t;!n&&y&&(n=y),!n&&g&&(n=e.newDate(g,0,1)),!r&&w&&(r=w),!r&&x&&(r=h(x,11,31));const S=t.captionLayout==="dropdown"||t.captionLayout==="dropdown-years";return n?n=a(n):g?n=h(g,0,1):!n&&S&&(n=s(c(t.today??m(),-100))),r?r=l(r):x?r=h(x,11,31):!r&&S&&(r=d(t.today??m())),[n&&i(n),r&&i(r)]}function __e(t,e,n,r){if(n.disableNavigation)return;const{pagedNavigation:s,numberOfMonths:i=1}=n,{startOfMonth:a,addMonths:l,differenceInCalendarMonths:c}=r,d=s?i:1,h=a(t);if(!e)return l(h,d);if(!(c(e,t)<i))return l(h,d)}function A_e(t,e,n,r){if(n.disableNavigation)return;const{pagedNavigation:s,numberOfMonths:i}=n,{startOfMonth:a,addMonths:l,differenceInCalendarMonths:c}=r,d=s?i??1:1,h=a(t);if(!e)return l(h,-d);if(!(c(h,e)<=0))return l(h,-d)}function M_e(t){const e=[];return t.reduce((n,r)=>n.concat(r.weeks.slice()),e.slice())}function aw(t,e){const[n,r]=b.useState(t);return[e===void 0?n:e,r]}function R_e(t,e){const[n,r]=E_e(t,e),{startOfMonth:s,endOfMonth:i}=e,a=Rz(t,n,r,e),[l,c]=aw(a,t.month?a:void 0);b.useEffect(()=>{const _=Rz(t,n,r,e);c(_)},[t.timeZone]);const d=C_e(l,r,t,e),h=j_e(d,t.endMonth?i(t.endMonth):void 0,t,e),m=T_e(d,h,t,e),g=M_e(m),x=N_e(m),y=A_e(l,n,t,e),w=__e(l,r,t,e),{disableNavigation:S,onMonthChange:k}=t,j=_=>g.some(A=>A.days.some(D=>D.isEqualTo(_))),N=_=>{if(S)return;let A=s(_);n&&A<s(n)&&(A=s(n)),r&&A>s(r)&&(A=s(r)),c(A),k?.(A)};return{months:m,weeks:g,days:x,navStart:n,navEnd:r,previousMonth:y,nextMonth:w,goToMonth:N,goToDay:_=>{j(_)||N(_.date)}}}var yo;(function(t){t[t.Today=0]="Today",t[t.Selected=1]="Selected",t[t.LastFocused=2]="LastFocused",t[t.FocusedModifier=3]="FocusedModifier"})(yo||(yo={}));function Dz(t){return!t[zr.disabled]&&!t[zr.hidden]&&!t[zr.outside]}function D_e(t,e,n,r){let s,i=-1;for(const a of t){const l=e(a);Dz(l)&&(l[zr.focused]&&i<yo.FocusedModifier?(s=a,i=yo.FocusedModifier):r?.isEqualTo(a)&&i<yo.LastFocused?(s=a,i=yo.LastFocused):n(a.date)&&i<yo.Selected?(s=a,i=yo.Selected):l[zr.today]&&i<yo.Today&&(s=a,i=yo.Today))}return s||(s=t.find(a=>Dz(e(a)))),s}function P_e(t,e,n,r,s,i,a){const{ISOWeek:l,broadcastCalendar:c}=i,{addDays:d,addMonths:h,addWeeks:m,addYears:g,endOfBroadcastWeek:x,endOfISOWeek:y,endOfWeek:w,max:S,min:k,startOfBroadcastWeek:j,startOfISOWeek:N,startOfWeek:T}=a;let _={day:d,week:m,month:h,year:g,startOfWeek:A=>c?j(A,a):l?N(A):T(A),endOfWeek:A=>c?x(A):l?y(A):w(A)}[t](n,e==="after"?1:-1);return e==="before"&&r?_=S([r,_]):e==="after"&&s&&(_=k([s,_])),_}function mX(t,e,n,r,s,i,a,l=0){if(l>365)return;const c=P_e(t,e,n.date,r,s,i,a),d=!!(i.disabled&&Ll(c,i.disabled,a)),h=!!(i.hidden&&Ll(c,i.hidden,a)),m=c,g=new rX(c,m,a);return!d&&!h?g:mX(t,e,g,r,s,i,a,l+1)}function z_e(t,e,n,r,s){const{autoFocus:i}=t,[a,l]=b.useState(),c=D_e(e.days,n,r||(()=>!1),a),[d,h]=b.useState(i?c:void 0);return{isFocusTarget:w=>!!c?.isEqualTo(w),setFocused:h,focused:d,blur:()=>{l(d),h(void 0)},moveFocus:(w,S)=>{if(!d)return;const k=mX(w,S,d,e.navStart,e.navEnd,t,s);k&&(t.disableNavigation&&!e.days.some(N=>N.isEqualTo(k))||(e.goToDay(k),h(k)))}}}function I_e(t,e){const{selected:n,required:r,onSelect:s}=t,[i,a]=aw(n,s?n:void 0),l=s?n:i,{isSameDay:c}=e,d=x=>l?.some(y=>c(y,x))??!1,{min:h,max:m}=t;return{selected:l,select:(x,y,w)=>{let S=[...l??[]];if(d(x)){if(l?.length===h||r&&l?.length===1)return;S=l?.filter(k=>!c(k,x))}else l?.length===m?S=[x]:S=[...S,x];return s||a(S),s?.(S,x,y,w),S},isSelected:d}}function L_e(t,e,n=0,r=0,s=!1,i=Zo){const{from:a,to:l}=e||{},{isSameDay:c,isAfter:d,isBefore:h}=i;let m;if(!a&&!l)m={from:t,to:n>0?void 0:t};else if(a&&!l)c(a,t)?n===0?m={from:a,to:t}:s?m={from:a,to:void 0}:m=void 0:h(t,a)?m={from:t,to:a}:m={from:a,to:t};else if(a&&l)if(c(a,t)&&c(l,t))s?m={from:a,to:l}:m=void 0;else if(c(a,t))m={from:a,to:n>0?void 0:t};else if(c(l,t))m={from:t,to:n>0?void 0:t};else if(h(t,a))m={from:t,to:l};else if(d(t,a))m={from:a,to:t};else if(d(t,l))m={from:a,to:t};else throw new Error("Invalid range");if(m?.from&&m?.to){const g=i.differenceInCalendarDays(m.to,m.from);r>0&&g>r?m={from:t,to:void 0}:n>1&&g<n&&(m={from:t,to:void 0})}return m}function B_e(t,e,n=Zo){const r=Array.isArray(e)?e:[e];let s=t.from;const i=n.differenceInCalendarDays(t.to,t.from),a=Math.min(i,6);for(let l=0;l<=a;l++){if(r.includes(s.getDay()))return!0;s=n.addDays(s,1)}return!1}function Pz(t,e,n=Zo){return Il(t,e.from,!1,n)||Il(t,e.to,!1,n)||Il(e,t.from,!1,n)||Il(e,t.to,!1,n)}function F_e(t,e,n=Zo){const r=Array.isArray(e)?e:[e];if(r.filter(l=>typeof l!="function").some(l=>typeof l=="boolean"?l:n.isDate(l)?Il(t,l,!1,n):cX(l,n)?l.some(c=>Il(t,c,!1,n)):g7(l)?l.from&&l.to?Pz(t,{from:l.from,to:l.to},n):!1:lX(l)?B_e(t,l.dayOfWeek,n):iX(l)?n.isAfter(l.before,l.after)?Pz(t,{from:n.addDays(l.after,1),to:n.addDays(l.before,-1)},n):Ll(t.from,l,n)||Ll(t.to,l,n):aX(l)||oX(l)?Ll(t.from,l,n)||Ll(t.to,l,n):!1))return!0;const a=r.filter(l=>typeof l=="function");if(a.length){let l=t.from;const c=n.differenceInCalendarDays(t.to,t.from);for(let d=0;d<=c;d++){if(a.some(h=>h(l)))return!0;l=n.addDays(l,1)}}return!1}function q_e(t,e){const{disabled:n,excludeDisabled:r,selected:s,required:i,onSelect:a}=t,[l,c]=aw(s,a?s:void 0),d=a?s:l;return{selected:d,select:(g,x,y)=>{const{min:w,max:S}=t,k=g?L_e(g,d,w,S,i,e):void 0;return r&&n&&k?.from&&k.to&&F_e({from:k.from,to:k.to},n,e)&&(k.from=g,k.to=void 0),a||c(k),a?.(k,g,x,y),k},isSelected:g=>d&&Il(d,g,!1,e)}}function $_e(t,e){const{selected:n,required:r,onSelect:s}=t,[i,a]=aw(n,s?n:void 0),l=s?n:i,{isSameDay:c}=e;return{selected:l,select:(m,g,x)=>{let y=m;return!r&&l&&l&&c(m,l)&&(y=void 0),s||a(y),s?.(y,m,g,x),y},isSelected:m=>l?c(l,m):!1}}function H_e(t,e){const n=$_e(t,e),r=I_e(t,e),s=q_e(t,e);switch(t.mode){case"single":return n;case"multiple":return r;case"range":return s;default:return}}function Q_e(t){let e=t;e.timeZone&&(e={...t},e.today&&(e.today=new Bs(e.today,e.timeZone)),e.month&&(e.month=new Bs(e.month,e.timeZone)),e.defaultMonth&&(e.defaultMonth=new Bs(e.defaultMonth,e.timeZone)),e.startMonth&&(e.startMonth=new Bs(e.startMonth,e.timeZone)),e.endMonth&&(e.endMonth=new Bs(e.endMonth,e.timeZone)),e.mode==="single"&&e.selected?e.selected=new Bs(e.selected,e.timeZone):e.mode==="multiple"&&e.selected?e.selected=e.selected?.map(dt=>new Bs(dt,e.timeZone)):e.mode==="range"&&e.selected&&(e.selected={from:e.selected.from?new Bs(e.selected.from,e.timeZone):void 0,to:e.selected.to?new Bs(e.selected.to,e.timeZone):void 0}));const{components:n,formatters:r,labels:s,dateLib:i,locale:a,classNames:l}=b.useMemo(()=>{const dt={...p7,...e.locale};return{dateLib:new ta({locale:dt,weekStartsOn:e.broadcastCalendar?1:e.weekStartsOn,firstWeekContainsDate:e.firstWeekContainsDate,useAdditionalWeekYearTokens:e.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:e.useAdditionalDayOfYearTokens,timeZone:e.timeZone,numerals:e.numerals},e.dateLib),components:GEe(e.components),formatters:s_e(e.formatters),labels:{...b_e,...e.labels},locale:dt,classNames:{...x7(),...e.classNames}}},[e.locale,e.broadcastCalendar,e.weekStartsOn,e.firstWeekContainsDate,e.useAdditionalWeekYearTokens,e.useAdditionalDayOfYearTokens,e.timeZone,e.numerals,e.dateLib,e.components,e.formatters,e.labels,e.classNames]),{captionLayout:c,mode:d,navLayout:h,numberOfMonths:m=1,onDayBlur:g,onDayClick:x,onDayFocus:y,onDayKeyDown:w,onDayMouseEnter:S,onDayMouseLeave:k,onNextClick:j,onPrevClick:N,showWeekNumber:T,styles:E}=e,{formatCaption:_,formatDay:A,formatMonthDropdown:D,formatWeekNumber:q,formatWeekNumberHeader:B,formatWeekdayName:H,formatYearDropdown:W}=r,ee=R_e(e,i),{days:I,months:V,navStart:L,navEnd:$,previousMonth:K,nextMonth:Y,goToMonth:R}=ee,ie=UEe(I,e,L,$,i),{isSelected:X,select:z,selected:U}=H_e(e,i)??{},{blur:te,focused:ne,isFocusTarget:G,moveFocus:se,setFocused:re}=z_e(e,ee,ie,X??(()=>!1),i),{labelDayButton:ae,labelGridcell:_e,labelGrid:Be,labelMonthDropdown:Ye,labelNav:Je,labelPrevious:Oe,labelNext:Ve,labelWeekday:Ue,labelWeekNumber:$e,labelWeekNumberHeader:jt,labelYearDropdown:vt}=s,$n=b.useMemo(()=>o_e(i,e.ISOWeek),[i,e.ISOWeek]),qt=d!==void 0||x!==void 0,un=b.useCallback(()=>{K&&(R(K),N?.(K))},[K,R,N]),Mt=b.useCallback(()=>{Y&&(R(Y),j?.(Y))},[R,Y,j]),ct=b.useCallback((dt,rn)=>wt=>{wt.preventDefault(),wt.stopPropagation(),re(dt),z?.(dt.date,rn,wt),x?.(dt.date,rn,wt)},[z,x,re]),Ne=b.useCallback((dt,rn)=>wt=>{re(dt),y?.(dt.date,rn,wt)},[y,re]),ze=b.useCallback((dt,rn)=>wt=>{te(),g?.(dt.date,rn,wt)},[te,g]),rt=b.useCallback((dt,rn)=>wt=>{const Wt={ArrowLeft:[wt.shiftKey?"month":"day",e.dir==="rtl"?"after":"before"],ArrowRight:[wt.shiftKey?"month":"day",e.dir==="rtl"?"before":"after"],ArrowDown:[wt.shiftKey?"year":"week","after"],ArrowUp:[wt.shiftKey?"year":"week","before"],PageUp:[wt.shiftKey?"year":"month","before"],PageDown:[wt.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(Wt[wt.key]){wt.preventDefault(),wt.stopPropagation();const[Gt,lt]=Wt[wt.key];se(Gt,lt)}w?.(dt.date,rn,wt)},[se,w,e.dir]),bt=b.useCallback((dt,rn)=>wt=>{S?.(dt.date,rn,wt)},[S]),zt=b.useCallback((dt,rn)=>wt=>{k?.(dt.date,rn,wt)},[k]),Rt=b.useCallback(dt=>rn=>{const wt=Number(rn.target.value),Wt=i.setMonth(i.startOfMonth(dt),wt);R(Wt)},[i,R]),Hn=b.useCallback(dt=>rn=>{const wt=Number(rn.target.value),Wt=i.setYear(i.startOfMonth(dt),wt);R(Wt)},[i,R]),{className:We,style:ot}=b.useMemo(()=>({className:[l[Nt.Root],e.className].filter(Boolean).join(" "),style:{...E?.[Nt.Root],...e.style}}),[l,e.className,e.style,E]),dn=XEe(e),Pt=b.useRef(null);O_e(Pt,!!e.animate,{classNames:l,months:V,focused:ne,dateLib:i});const xn={dayPickerProps:e,selected:U,select:z,isSelected:X,months:V,nextMonth:Y,previousMonth:K,goToMonth:R,getModifiers:ie,components:n,classNames:l,styles:E,labels:s,formatters:r};return oe.createElement(sX.Provider,{value:xn},oe.createElement(n.Root,{rootRef:e.animate?Pt:void 0,className:We,style:ot,dir:e.dir,id:e.id,lang:e.lang,nonce:e.nonce,title:e.title,role:e.role,"aria-label":e["aria-label"],"aria-labelledby":e["aria-labelledby"],...dn},oe.createElement(n.Months,{className:l[Nt.Months],style:E?.[Nt.Months]},!e.hideNavigation&&!h&&oe.createElement(n.Nav,{"data-animated-nav":e.animate?"true":void 0,className:l[Nt.Nav],style:E?.[Nt.Nav],"aria-label":Je(),onPreviousClick:un,onNextClick:Mt,previousMonth:K,nextMonth:Y}),V.map((dt,rn)=>oe.createElement(n.Month,{"data-animated-month":e.animate?"true":void 0,className:l[Nt.Month],style:E?.[Nt.Month],key:rn,displayIndex:rn,calendarMonth:dt},h==="around"&&!e.hideNavigation&&rn===0&&oe.createElement(n.PreviousMonthButton,{type:"button",className:l[Nt.PreviousMonthButton],tabIndex:K?void 0:-1,"aria-disabled":K?void 0:!0,"aria-label":Oe(K),onClick:un,"data-animated-button":e.animate?"true":void 0},oe.createElement(n.Chevron,{disabled:K?void 0:!0,className:l[Nt.Chevron],orientation:e.dir==="rtl"?"right":"left"})),oe.createElement(n.MonthCaption,{"data-animated-caption":e.animate?"true":void 0,className:l[Nt.MonthCaption],style:E?.[Nt.MonthCaption],calendarMonth:dt,displayIndex:rn},c?.startsWith("dropdown")?oe.createElement(n.DropdownNav,{className:l[Nt.Dropdowns],style:E?.[Nt.Dropdowns]},(()=>{const wt=c==="dropdown"||c==="dropdown-months"?oe.createElement(n.MonthsDropdown,{key:"month",className:l[Nt.MonthsDropdown],"aria-label":Ye(),classNames:l,components:n,disabled:!!e.disableNavigation,onChange:Rt(dt.date),options:i_e(dt.date,L,$,r,i),style:E?.[Nt.Dropdown],value:i.getMonth(dt.date)}):oe.createElement("span",{key:"month"},D(dt.date,i)),Wt=c==="dropdown"||c==="dropdown-years"?oe.createElement(n.YearsDropdown,{key:"year",className:l[Nt.YearsDropdown],"aria-label":vt(i.options),classNames:l,components:n,disabled:!!e.disableNavigation,onChange:Hn(dt.date),options:l_e(L,$,r,i,!!e.reverseYears),style:E?.[Nt.Dropdown],value:i.getYear(dt.date)}):oe.createElement("span",{key:"year"},W(dt.date,i));return i.getMonthYearOrder()==="year-first"?[Wt,wt]:[wt,Wt]})(),oe.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"}},_(dt.date,i.options,i))):oe.createElement(n.CaptionLabel,{className:l[Nt.CaptionLabel],role:"status","aria-live":"polite"},_(dt.date,i.options,i))),h==="around"&&!e.hideNavigation&&rn===m-1&&oe.createElement(n.NextMonthButton,{type:"button",className:l[Nt.NextMonthButton],tabIndex:Y?void 0:-1,"aria-disabled":Y?void 0:!0,"aria-label":Ve(Y),onClick:Mt,"data-animated-button":e.animate?"true":void 0},oe.createElement(n.Chevron,{disabled:Y?void 0:!0,className:l[Nt.Chevron],orientation:e.dir==="rtl"?"left":"right"})),rn===m-1&&h==="after"&&!e.hideNavigation&&oe.createElement(n.Nav,{"data-animated-nav":e.animate?"true":void 0,className:l[Nt.Nav],style:E?.[Nt.Nav],"aria-label":Je(),onPreviousClick:un,onNextClick:Mt,previousMonth:K,nextMonth:Y}),oe.createElement(n.MonthGrid,{role:"grid","aria-multiselectable":d==="multiple"||d==="range","aria-label":Be(dt.date,i.options,i)||void 0,className:l[Nt.MonthGrid],style:E?.[Nt.MonthGrid]},!e.hideWeekdays&&oe.createElement(n.Weekdays,{"data-animated-weekdays":e.animate?"true":void 0,className:l[Nt.Weekdays],style:E?.[Nt.Weekdays]},T&&oe.createElement(n.WeekNumberHeader,{"aria-label":jt(i.options),className:l[Nt.WeekNumberHeader],style:E?.[Nt.WeekNumberHeader],scope:"col"},B()),$n.map(wt=>oe.createElement(n.Weekday,{"aria-label":Ue(wt,i.options,i),className:l[Nt.Weekday],key:String(wt),style:E?.[Nt.Weekday],scope:"col"},H(wt,i.options,i)))),oe.createElement(n.Weeks,{"data-animated-weeks":e.animate?"true":void 0,className:l[Nt.Weeks],style:E?.[Nt.Weeks]},dt.weeks.map(wt=>oe.createElement(n.Week,{className:l[Nt.Week],key:wt.weekNumber,style:E?.[Nt.Week],week:wt},T&&oe.createElement(n.WeekNumber,{week:wt,style:E?.[Nt.WeekNumber],"aria-label":$e(wt.weekNumber,{locale:a}),className:l[Nt.WeekNumber],scope:"row",role:"rowheader"},q(wt.weekNumber,i)),wt.days.map(Wt=>{const{date:Gt}=Wt,lt=ie(Wt);if(lt[zr.focused]=!lt.hidden&&!!ne?.isEqualTo(Wt),lt[Wa.selected]=X?.(Gt)||lt.selected,g7(U)){const{from:vn,to:Qn}=U;lt[Wa.range_start]=!!(vn&&Qn&&i.isSameDay(Gt,vn)),lt[Wa.range_end]=!!(vn&&Qn&&i.isSameDay(Gt,Qn)),lt[Wa.range_middle]=Il(U,Gt,!0,i)}const ve=a_e(lt,E,e.modifiersStyles),He=WEe(lt,l,e.modifiersClassNames),ht=!qt&&!lt.hidden?_e(Gt,lt,i.options,i):void 0;return oe.createElement(n.Day,{key:`${i.format(Gt,"yyyy-MM-dd")}_${i.format(Wt.displayMonth,"yyyy-MM")}`,day:Wt,modifiers:lt,className:He.join(" "),style:ve,role:"gridcell","aria-selected":lt.selected||void 0,"aria-label":ht,"data-day":i.format(Gt,"yyyy-MM-dd"),"data-month":Wt.outside?i.format(Gt,"yyyy-MM"):void 0,"data-selected":lt.selected||void 0,"data-disabled":lt.disabled||void 0,"data-hidden":lt.hidden||void 0,"data-outside":Wt.outside||void 0,"data-focused":lt.focused||void 0,"data-today":lt.today||void 0},!lt.hidden&&qt?oe.createElement(n.DayButton,{className:l[Nt.DayButton],style:E?.[Nt.DayButton],type:"button",day:Wt,modifiers:lt,disabled:lt.disabled||void 0,tabIndex:G(Wt)?0:-1,"aria-label":ae(Gt,lt,i.options,i),onClick:ct(Wt,lt),onBlur:ze(Wt,lt),onFocus:Ne(Wt,lt),onKeyDown:rt(Wt,lt),onMouseEnter:bt(Wt,lt),onMouseLeave:zt(Wt,lt)},A(Gt,i.options,i)):!lt.hidden&&A(Wt.date,i.options,i))})))))))),e.footer&&oe.createElement(n.Footer,{className:l[Nt.Footer],style:E?.[Nt.Footer],role:"status","aria-live":"polite"},e.footer)))}function zz({className:t,classNames:e,showOutsideDays:n=!0,captionLayout:r="label",buttonVariant:s="ghost",formatters:i,components:a,...l}){const c=x7();return o.jsx(Q_e,{showOutsideDays:n,className:xe("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`,t),captionLayout:r,formatters:{formatMonthDropdown:d=>d.toLocaleString("default",{month:"short"}),...i},classNames:{root:xe("w-fit",c.root),months:xe("relative flex flex-col gap-4 md:flex-row",c.months),month:xe("flex w-full flex-col gap-4",c.month),nav:xe("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",c.nav),button_previous:xe(q0({variant:s}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",c.button_previous),button_next:xe(q0({variant:s}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",c.button_next),month_caption:xe("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",c.month_caption),dropdowns:xe("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",c.dropdowns),dropdown_root:xe("has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border",c.dropdown_root),dropdown:xe("bg-popover absolute inset-0 opacity-0",c.dropdown),caption_label:xe("select-none font-medium",r==="label"?"text-sm":"[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5",c.caption_label),table:"w-full border-collapse",weekdays:xe("flex",c.weekdays),weekday:xe("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",c.weekday),week:xe("mt-2 flex w-full",c.week),week_number_header:xe("w-[--cell-size] select-none",c.week_number_header),week_number:xe("text-muted-foreground select-none text-[0.8rem]",c.week_number),day:xe("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",c.day),range_start:xe("bg-accent rounded-l-md",c.range_start),range_middle:xe("rounded-none",c.range_middle),range_end:xe("bg-accent rounded-r-md",c.range_end),today:xe("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",c.today),outside:xe("text-muted-foreground aria-selected:text-muted-foreground",c.outside),disabled:xe("text-muted-foreground opacity-50",c.disabled),hidden:xe("invisible",c.hidden),...e},components:{Root:({className:d,rootRef:h,...m})=>o.jsx("div",{"data-slot":"calendar",ref:h,className:xe(d),...m}),Chevron:({className:d,orientation:h,...m})=>h==="left"?o.jsx(wd,{className:xe("size-4",d),...m}):h==="right"?o.jsx(Zl,{className:xe("size-4",d),...m}):o.jsx(Xc,{className:xe("size-4",d),...m}),DayButton:V_e,WeekNumber:({children:d,...h})=>o.jsx("td",{...h,children:o.jsx("div",{className:"flex size-[--cell-size] items-center justify-center text-center",children:d})}),...a},...l})}function V_e({className:t,day:e,modifiers:n,...r}){const s=x7(),i=b.useRef(null);return b.useEffect(()=>{n.focused&&i.current?.focus()},[n.focused]),o.jsx(ue,{ref:i,variant:"ghost",size:"icon","data-day":e.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:xe("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",s.day,t),...r})}class U_e{ws=null;reconnectTimeout=null;reconnectAttempts=0;maxReconnectAttempts=10;heartbeatInterval=null;logCallbacks=new Set;connectionCallbacks=new Set;isConnected=!1;logCache=[];maxCacheSize=1e3;getWebSocketUrl(){{const e=window.location.protocol==="https:"?"wss:":"ws:",n=window.location.host;return`${e}//${n}/ws/logs`}}connect(){if(this.ws?.readyState===WebSocket.OPEN||this.ws?.readyState===WebSocket.CONNECTING)return;const e=this.getWebSocketUrl();try{this.ws=new WebSocket(e),this.ws.onopen=()=>{this.isConnected=!0,this.reconnectAttempts=0,this.notifyConnection(!0),this.startHeartbeat()},this.ws.onmessage=n=>{try{if(n.data==="pong")return;const r=JSON.parse(n.data);this.notifyLog(r)}catch(r){console.error("解析日志消息失败:",r)}},this.ws.onerror=n=>{console.error("❌ WebSocket 错误:",n),this.isConnected=!1,this.notifyConnection(!1)},this.ws.onclose=()=>{this.isConnected=!1,this.notifyConnection(!1),this.stopHeartbeat(),this.attemptReconnect()}}catch(n){console.error("创建 WebSocket 连接失败:",n),this.attemptReconnect()}}attemptReconnect(){if(this.reconnectAttempts>=this.maxReconnectAttempts)return;this.reconnectAttempts+=1;const e=Math.min(1e3*this.reconnectAttempts,1e4);this.reconnectTimeout=window.setTimeout(()=>{this.connect()},e)}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(e){return this.logCallbacks.add(e),()=>this.logCallbacks.delete(e)}onConnectionChange(e){return this.connectionCallbacks.add(e),e(this.isConnected),()=>this.connectionCallbacks.delete(e)}notifyLog(e){this.logCache.some(r=>r.id===e.id)||(this.logCache.push(e),this.logCache.length>this.maxCacheSize&&(this.logCache=this.logCache.slice(-this.maxCacheSize)),this.logCallbacks.forEach(r=>{try{r(e)}catch(s){console.error("日志回调执行失败:",s)}}))}notifyConnection(e){this.connectionCallbacks.forEach(n=>{try{n(e)}catch(r){console.error("连接状态回调执行失败:",r)}})}getAllLogs(){return[...this.logCache]}clearLogs(){this.logCache=[]}getConnectionStatus(){return this.isConnected}}const Nh=new U_e;typeof window<"u"&&Nh.connect();const W_e={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}} 年"}},G_e=(t,e,n)=>{let r;const s=W_e[t];return typeof s=="string"?r=s:e===1?r=s.one:r=s.other.replace("{{count}}",String(e)),n?.addSuffix?n.comparison&&n.comparison>0?r+"内":r+"前":r},X_e={full:"y'年'M'月'd'日' EEEE",long:"y'年'M'月'd'日'",medium:"yyyy-MM-dd",short:"yy-MM-dd"},Y_e={full:"zzzz a h:mm:ss",long:"z a h:mm:ss",medium:"a h:mm:ss",short:"a h:mm"},K_e={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},Z_e={date:Uh({formats:X_e,defaultWidth:"full"}),time:Uh({formats:Y_e,defaultWidth:"full"}),dateTime:Uh({formats:K_e,defaultWidth:"full"})};function Iz(t,e,n){const r="eeee p";return cEe(t,e,n)?r:t.getTime()>e.getTime()?"'下个'"+r:"'上个'"+r}const J_e={lastWeek:Iz,yesterday:"'昨天' p",today:"'今天' p",tomorrow:"'明天' p",nextWeek:Iz,other:"PP p"},eAe=(t,e,n,r)=>{const s=J_e[t];return typeof s=="function"?s(e,n,r):s},tAe={narrow:["前","公元"],abbreviated:["前","公元"],wide:["公元前","公元"]},nAe={narrow:["1","2","3","4"],abbreviated:["第一季","第二季","第三季","第四季"],wide:["第一季度","第二季度","第三季度","第四季度"]},rAe={narrow:["一","二","三","四","五","六","七","八","九","十","十一","十二"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},sAe={narrow:["日","一","二","三","四","五","六"],short:["日","一","二","三","四","五","六"],abbreviated:["周日","周一","周二","周三","周四","周五","周六"],wide:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},iAe={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:"夜间"}},aAe={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:"夜间"}},oAe=(t,e)=>{const n=Number(t);switch(e?.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()}},lAe={ordinalNumber:oAe,era:jo({values:tAe,defaultWidth:"wide"}),quarter:jo({values:nAe,defaultWidth:"wide",argumentCallback:t=>t-1}),month:jo({values:rAe,defaultWidth:"wide"}),day:jo({values:sAe,defaultWidth:"wide"}),dayPeriod:jo({values:iAe,defaultWidth:"wide",formattingValues:aAe,defaultFormattingWidth:"wide"})},cAe=/^(第\s*)?\d+(日|时|分|秒)?/i,uAe=/\d+/i,dAe={narrow:/^(前)/i,abbreviated:/^(前)/i,wide:/^(公元前|公元)/i},hAe={any:[/^(前)/i,/^(公元)/i]},fAe={narrow:/^[1234]/i,abbreviated:/^第[一二三四]刻/i,wide:/^第[一二三四]刻钟/i},mAe={any:[/(1|一)/i,/(2|二)/i,/(3|三)/i,/(4|四)/i]},pAe={narrow:/^(一|二|三|四|五|六|七|八|九|十[二一])/i,abbreviated:/^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,wide:/^(一|二|三|四|五|六|七|八|九|十[二一])月/i},gAe={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]},xAe={narrow:/^[一二三四五六日]/i,short:/^[一二三四五六日]/i,abbreviated:/^周[一二三四五六日]/i,wide:/^星期[一二三四五六日]/i},vAe={any:[/日/i,/一/i,/二/i,/三/i,/四/i,/五/i,/六/i]},yAe={any:/^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i},bAe={any:{am:/^上午?/i,pm:/^下午?/i,midnight:/^午夜/i,noon:/^[中正]午/i,morning:/^早上/i,afternoon:/^下午/i,evening:/^晚上?/i,night:/^凌晨/i}},wAe={ordinalNumber:KG({matchPattern:cAe,parsePattern:uAe,valueCallback:t=>parseInt(t,10)}),era:No({matchPatterns:dAe,defaultMatchWidth:"wide",parsePatterns:hAe,defaultParseWidth:"any"}),quarter:No({matchPatterns:fAe,defaultMatchWidth:"wide",parsePatterns:mAe,defaultParseWidth:"any",valueCallback:t=>t+1}),month:No({matchPatterns:pAe,defaultMatchWidth:"wide",parsePatterns:gAe,defaultParseWidth:"any"}),day:No({matchPatterns:xAe,defaultMatchWidth:"wide",parsePatterns:vAe,defaultParseWidth:"any"}),dayPeriod:No({matchPatterns:yAe,defaultMatchWidth:"any",parsePatterns:bAe,defaultParseWidth:"any"})},K1={code:"zh-CN",formatDistance:G_e,formatLong:Z_e,formatRelative:eAe,localize:lAe,match:wAe,options:{weekStartsOn:1,firstWeekContainsDate:4}},Z1={xs:{label:"小",rowHeight:28,class:"text-[10px] sm:text-xs"},sm:{label:"中",rowHeight:36,class:"text-xs sm:text-sm"},base:{label:"大",rowHeight:44,class:"text-sm sm:text-base"}};function SAe(){const[t,e]=b.useState([]),[n,r]=b.useState(""),[s,i]=b.useState("all"),[a,l]=b.useState("all"),[c,d]=b.useState(void 0),[h,m]=b.useState(void 0),[g,x]=b.useState(!0),[y,w]=b.useState(!1),[S,k]=b.useState("xs"),[j,N]=b.useState(4),T=b.useRef(null);b.useEffect(()=>{const L=Nh.getAllLogs();e(L);const $=Nh.onLog(()=>{e(Nh.getAllLogs())}),K=Nh.onConnectionChange(Y=>{w(Y)});return()=>{$(),K()}},[]);const E=b.useMemo(()=>{const L=new Set(t.map($=>$.module));return Array.from(L).sort()},[t]),_=L=>{switch(L){case"DEBUG":return"text-muted-foreground";case"INFO":return"text-blue-500 dark:text-blue-400";case"WARNING":return"text-yellow-600 dark:text-yellow-500";case"ERROR":return"text-red-600 dark:text-red-500";case"CRITICAL":return"text-red-700 dark:text-red-400 font-bold";default:return"text-foreground"}},A=L=>{switch(L){case"DEBUG":return"bg-gray-800/30 dark:bg-gray-800/50";case"INFO":return"bg-blue-900/20 dark:bg-blue-500/20";case"WARNING":return"bg-yellow-900/20 dark:bg-yellow-500/20";case"ERROR":return"bg-red-900/20 dark:bg-red-500/20";case"CRITICAL":return"bg-red-900/30 dark:bg-red-600/30";default:return"bg-gray-800/20 dark:bg-gray-800/30"}},D=()=>{window.location.reload()},q=()=>{Nh.clearLogs(),e([])},B=()=>{const L=ee.map(R=>`${R.timestamp} [${R.level.padEnd(8)}] [${R.module}] ${R.message}`).join(`
|
||
`),$=new Blob([L],{type:"text/plain;charset=utf-8"}),K=URL.createObjectURL($),Y=document.createElement("a");Y.href=K,Y.download=`logs-${Dv(new Date,"yyyy-MM-dd-HHmmss")}.txt`,Y.click(),URL.revokeObjectURL(K)},H=()=>{x(!g)},W=()=>{d(void 0),m(void 0)},ee=b.useMemo(()=>t.filter(L=>{const $=n===""||L.message.toLowerCase().includes(n.toLowerCase())||L.module.toLowerCase().includes(n.toLowerCase()),K=s==="all"||L.level===s,Y=a==="all"||L.module===a;let R=!0;if(c||h){const ie=new Date(L.timestamp);if(c){const X=new Date(c);X.setHours(0,0,0,0),R=R&&ie>=X}if(h){const X=new Date(h);X.setHours(23,59,59,999),R=R&&ie<=X}}return $&&K&&Y&&R}),[t,n,s,a,c,h]),I=Z1[S].rowHeight+j,V=HTe({count:ee.length,getScrollElement:()=>T.current,estimateSize:()=>I,overscan:15});return b.useEffect(()=>{g&&ee.length>0&&V.scrollToIndex(ee.length-1,{align:"end",behavior:"auto"})},[ee.length,g,V]),o.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[o.jsxs("div",{className:"flex-shrink-0 space-y-4 p-3 sm:p-4 lg:p-6",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-xl sm:text-2xl lg:text-3xl font-bold",children:"日志查看器"}),o.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mt-1",children:"实时查看和分析麦麦运行日志"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:xe("h-2.5 w-2.5 sm:h-3 sm:w-3 rounded-full",y?"bg-green-500 animate-pulse":"bg-red-500")}),o.jsx("span",{className:"text-xs sm:text-sm text-muted-foreground",children:y?"已连接":"未连接"})]})]}),o.jsx(Lt,{className:"p-3 sm:p-4",children:o.jsxs("div",{className:"flex flex-col gap-3 sm:gap-4",children:[o.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:gap-4",children:[o.jsxs("div",{className:"flex-1 relative",children:[o.jsx(ii,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),o.jsx(Pe,{placeholder:"搜索日志...",value:n,onChange:L=>r(L.target.value),className:"pl-9 h-9 text-sm"})]}),o.jsxs(Vt,{value:s,onValueChange:i,children:[o.jsxs($t,{className:"w-full sm:w-[140px] lg:w-[180px] h-9 text-sm",children:[o.jsx(ok,{className:"h-4 w-4 mr-2"}),o.jsx(Ut,{placeholder:"级别"})]}),o.jsxs(Ht,{children:[o.jsx(De,{value:"all",children:"全部级别"}),o.jsx(De,{value:"DEBUG",children:"DEBUG"}),o.jsx(De,{value:"INFO",children:"INFO"}),o.jsx(De,{value:"WARNING",children:"WARNING"}),o.jsx(De,{value:"ERROR",children:"ERROR"}),o.jsx(De,{value:"CRITICAL",children:"CRITICAL"})]})]}),o.jsxs(Vt,{value:a,onValueChange:l,children:[o.jsxs($t,{className:"w-full sm:w-[160px] lg:w-[200px] h-9 text-sm",children:[o.jsx(ok,{className:"h-4 w-4 mr-2"}),o.jsx(Ut,{placeholder:"模块"})]}),o.jsxs(Ht,{children:[o.jsx(De,{value:"all",children:"全部模块"}),E.map(L=>o.jsx(De,{value:L,children:L},L))]})]})]}),o.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:gap-4",children:[o.jsxs(Bo,{children:[o.jsx(Fo,{asChild:!0,children:o.jsxs(ue,{variant:"outline",size:"sm",className:xe("w-full sm:w-[200px] lg:w-[240px] justify-start text-left font-normal h-9",!c&&"text-muted-foreground"),children:[o.jsx(C9,{className:"mr-2 h-4 w-4"}),o.jsx("span",{className:"text-xs sm:text-sm",children:c?Dv(c,"PPP",{locale:K1}):"开始日期"})]})}),o.jsx(Ka,{className:"w-auto p-0",align:"start",children:o.jsx(zz,{mode:"single",selected:c,onSelect:d,initialFocus:!0,locale:K1})})]}),o.jsxs(Bo,{children:[o.jsx(Fo,{asChild:!0,children:o.jsxs(ue,{variant:"outline",size:"sm",className:xe("w-full sm:w-[200px] lg:w-[240px] justify-start text-left font-normal h-9",!h&&"text-muted-foreground"),children:[o.jsx(C9,{className:"mr-2 h-4 w-4"}),o.jsx("span",{className:"text-xs sm:text-sm",children:h?Dv(h,"PPP",{locale:K1}):"结束日期"})]})}),o.jsx(Ka,{className:"w-auto p-0",align:"start",children:o.jsx(zz,{mode:"single",selected:h,onSelect:m,initialFocus:!0,locale:K1})})]}),(c||h)&&o.jsxs(ue,{variant:"outline",size:"sm",onClick:W,className:"w-full sm:w-auto h-9",children:[o.jsx(Pp,{className:"h-4 w-4 sm:mr-2"}),o.jsx("span",{className:"hidden sm:inline text-sm",children:"清除时间筛选"}),o.jsx("span",{className:"sm:hidden text-sm",children:"清除"})]})]}),o.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center",children:[o.jsxs("div",{className:"flex gap-2 flex-wrap",children:[o.jsxs(ue,{variant:g?"default":"outline",size:"sm",onClick:H,className:"flex-1 sm:flex-none h-9",children:[g?o.jsx(rte,{className:"h-4 w-4"}):o.jsx(ste,{className:"h-4 w-4"}),o.jsx("span",{className:"ml-2 text-sm",children:g?"自动滚动":"已暂停"})]}),o.jsxs(ue,{variant:"outline",size:"sm",onClick:D,className:"flex-1 sm:flex-none h-9",children:[o.jsx(Qs,{className:"h-4 w-4"}),o.jsx("span",{className:"ml-2 text-sm",children:"刷新"})]}),o.jsxs(ue,{variant:"outline",size:"sm",onClick:q,className:"flex-1 sm:flex-none h-9",children:[o.jsx(Cn,{className:"h-4 w-4"}),o.jsx("span",{className:"ml-2 text-sm",children:"清空"})]}),o.jsxs(ue,{variant:"outline",size:"sm",onClick:B,className:"flex-1 sm:flex-none h-9",children:[o.jsx(td,{className:"h-4 w-4"}),o.jsx("span",{className:"ml-2 text-sm",children:"导出"})]})]}),o.jsx("div",{className:"flex-1 hidden sm:block"}),o.jsxs("div",{className:"text-xs sm:text-sm text-muted-foreground flex items-center justify-center sm:justify-end",children:[o.jsxs("span",{className:"font-mono",children:[ee.length," / ",t.length]}),o.jsx("span",{className:"ml-1",children:"条日志"})]})]}),o.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-6 pt-2 border-t border-border/50",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[o.jsx(ite,{className:"h-4 w-4"}),o.jsx("span",{children:"字号"})]}),o.jsx("div",{className:"flex gap-1",children:Object.keys(Z1).map(L=>o.jsx(ue,{variant:S===L?"default":"outline",size:"sm",onClick:()=>k(L),className:"h-7 px-3 text-xs",children:Z1[L].label},L))})]}),o.jsxs("div",{className:"flex items-center gap-3 flex-1 max-w-xs",children:[o.jsx("span",{className:"text-sm text-muted-foreground whitespace-nowrap",children:"行距"}),o.jsx(Nf,{value:[j],onValueChange:([L])=>N(L),min:0,max:12,step:2,className:"flex-1"}),o.jsxs("span",{className:"text-xs text-muted-foreground w-8",children:[j,"px"]})]})]})]})})]}),o.jsx("div",{className:"flex-1 min-h-0 px-3 sm:px-4 lg:px-6 pb-3 sm:pb-4 lg:pb-6",children:o.jsx(Lt,{className:"bg-black dark:bg-gray-950 border-gray-800 dark:border-gray-900 h-full",children:o.jsx(pn,{viewportRef:T,className:"h-full",children:o.jsx("div",{className:xe("p-2 sm:p-3 font-mono relative",Z1[S].class),style:{height:`${V.getTotalSize()}px`},children:ee.length===0?o.jsx("div",{className:"text-gray-500 dark:text-gray-600 text-center py-8 text-sm",children:"暂无日志数据"}):V.getVirtualItems().map(L=>{const $=ee[L.index];return o.jsxs("div",{"data-index":L.index,ref:V.measureElement,className:xe("absolute top-0 left-0 w-full px-2 sm:px-3 rounded hover:bg-white/5 transition-colors group",A($.level)),style:{transform:`translateY(${L.start}px)`,paddingTop:`${j/2}px`,paddingBottom:`${j/2}px`},children:[o.jsxs("div",{className:"flex flex-col gap-0.5 sm:hidden",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-gray-500 dark:text-gray-600",children:$.timestamp}),o.jsxs("span",{className:xe("font-semibold",_($.level)),children:["[",$.level,"]"]})]}),o.jsx("div",{className:"text-cyan-400 dark:text-cyan-500 truncate",children:$.module}),o.jsx("div",{className:"text-gray-300 dark:text-gray-400 whitespace-pre-wrap break-words",children:$.message})]}),o.jsxs("div",{className:"hidden sm:flex gap-2 items-start",children:[o.jsx("span",{className:"text-gray-500 dark:text-gray-600 flex-shrink-0 w-[130px] lg:w-[160px]",children:$.timestamp}),o.jsxs("span",{className:xe("flex-shrink-0 w-[65px] lg:w-[75px] font-semibold",_($.level)),children:["[",$.level,"]"]}),o.jsx("span",{className:"text-cyan-400 dark:text-cyan-500 flex-shrink-0 w-[100px] lg:w-[130px] truncate",children:$.module}),o.jsx("span",{className:"text-gray-300 dark:text-gray-400 flex-1 whitespace-pre-wrap break-words",children:$.message})]})]},L.key)})})})})})]})}const kAe="Mai-with-u",OAe="plugin-repo",jAe="main",NAe="plugin_details.json";async function CAe(){try{const t=await gt("/api/webui/plugins/fetch-raw",{method:"POST",headers:Tt(),body:JSON.stringify({owner:kAe,repo:OAe,branch:jAe,file_path:NAe})});if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);const e=await t.json();if(!e.success||!e.data)throw new Error(e.error||"获取插件列表失败");return JSON.parse(e.data).filter(s=>!s?.id||!s?.manifest?(console.warn("跳过无效插件数据:",s),!1):!s.manifest.name||!s.manifest.version?(console.warn("跳过缺少必需字段的插件:",s.id),!1):!0).map(s=>({id:s.id,manifest:{manifest_version:s.manifest.manifest_version||1,name:s.manifest.name,version:s.manifest.version,description:s.manifest.description||"",author:s.manifest.author||{name:"Unknown"},license:s.manifest.license||"Unknown",host_application:s.manifest.host_application||{min_version:"0.0.0"},homepage_url:s.manifest.homepage_url,repository_url:s.manifest.repository_url,keywords:s.manifest.keywords||[],categories:s.manifest.categories||[],default_locale:s.manifest.default_locale||"zh-CN",locales_path:s.manifest.locales_path},downloads:0,rating:0,review_count:0,installed:!1,published_at:new Date().toISOString(),updated_at:new Date().toISOString()}))}catch(t){throw console.error("Failed to fetch plugin list:",t),t}}async function TAe(){try{const t=await gt("/api/webui/plugins/git-status");if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);return await t.json()}catch(t){return console.error("Failed to check Git status:",t),{installed:!1,error:"无法检测 Git 安装状态"}}}async function EAe(){try{const t=await gt("/api/webui/plugins/version");if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);return await t.json()}catch(t){return console.error("Failed to get Maimai version:",t),{version:"0.0.0",version_major:0,version_minor:0,version_patch:0}}}function _Ae(t,e,n){const r=t.split(".").map(l=>parseInt(l)||0),s=r[0]||0,i=r[1]||0,a=r[2]||0;if(n.version_major<s||n.version_major===s&&n.version_minor<i||n.version_major===s&&n.version_minor===i&&n.version_patch<a)return!1;if(e){const l=e.split(".").map(m=>parseInt(m)||0),c=l[0]||0,d=l[1]||0,h=l[2]||0;if(n.version_major>c||n.version_major===c&&n.version_minor>d||n.version_major===c&&n.version_minor===d&&n.version_patch>h)return!1}return!0}function AAe(t,e){const n=window.location.protocol==="https:"?"wss:":"ws:",r=window.location.host,s=new WebSocket(`${n}//${r}/api/webui/ws/plugin-progress`);return s.onopen=()=>{console.log("Plugin progress WebSocket connected");const i=setInterval(()=>{s.readyState===WebSocket.OPEN?s.send("ping"):clearInterval(i)},3e4)},s.onmessage=i=>{try{if(i.data==="pong")return;const a=JSON.parse(i.data);t(a)}catch(a){console.error("Failed to parse progress data:",a)}},s.onerror=i=>{console.error("Plugin progress WebSocket error:",i),e?.(i)},s.onclose=()=>{console.log("Plugin progress WebSocket disconnected")},s}async function v0(){try{const t=await gt("/api/webui/plugins/installed",{headers:Tt()});if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);const e=await t.json();if(!e.success)throw new Error(e.message||"获取已安装插件列表失败");return e.plugins||[]}catch(t){return console.error("Failed to get installed plugins:",t),[]}}function J1(t,e){return e.some(n=>n.id===t)}function ev(t,e){const n=e.find(r=>r.id===t);if(n)return n.manifest?.version||n.version}async function MAe(t,e,n="main"){const r=await gt("/api/webui/plugins/install",{method:"POST",headers:Tt(),body:JSON.stringify({plugin_id:t,repository_url:e,branch:n})});if(!r.ok){const s=await r.json();throw new Error(s.detail||"安装失败")}return await r.json()}async function RAe(t){const e=await gt("/api/webui/plugins/uninstall",{method:"POST",headers:Tt(),body:JSON.stringify({plugin_id:t})});if(!e.ok){const n=await e.json();throw new Error(n.detail||"卸载失败")}return await e.json()}async function DAe(t,e,n="main"){const r=await gt("/api/webui/plugins/update",{method:"POST",headers:Tt(),body:JSON.stringify({plugin_id:t,repository_url:e,branch:n})});if(!r.ok){const s=await r.json();throw new Error(s.detail||"更新失败")}return await r.json()}async function PAe(t){const e=await gt(`/api/webui/plugins/config/${t}/schema`,{headers:Tt()});if(!e.ok){const r=await e.json();throw new Error(r.detail||"获取配置 Schema 失败")}const n=await e.json();if(!n.success)throw new Error(n.message||"获取配置 Schema 失败");return n.schema}async function zAe(t){const e=await gt(`/api/webui/plugins/config/${t}`,{headers:Tt()});if(!e.ok){const r=await e.json();throw new Error(r.detail||"获取配置失败")}const n=await e.json();if(!n.success)throw new Error(n.message||"获取配置失败");return n.config}async function IAe(t,e){const n=await gt(`/api/webui/plugins/config/${t}`,{method:"PUT",headers:Tt(),body:JSON.stringify({config:e})});if(!n.ok){const r=await n.json();throw new Error(r.detail||"保存配置失败")}return await n.json()}async function LAe(t){const e=await gt(`/api/webui/plugins/config/${t}/reset`,{method:"POST",headers:Tt()});if(!e.ok){const n=await e.json();throw new Error(n.detail||"重置配置失败")}return await e.json()}async function BAe(t){const e=await gt(`/api/webui/plugins/config/${t}/toggle`,{method:"POST",headers:Tt()});if(!e.ok){const n=await e.json();throw new Error(n.detail||"切换状态失败")}return await e.json()}const Cg="https://maibot-plugin-stats.maibot-webui.workers.dev";async function pX(t){try{const e=await fetch(`${Cg}/stats/${t}`);return e.ok?await e.json():(console.error("Failed to fetch plugin stats:",e.statusText),null)}catch(e){return console.error("Error fetching plugin stats:",e),null}}async function FAe(t,e){try{const n=e||v7(),r=await fetch(`${Cg}/stats/like`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:t,user_id:n})}),s=await r.json();return r.status===429?{success:!1,error:"操作过于频繁,请稍后再试"}:r.ok?{success:!0,...s}:{success:!1,error:s.error||"点赞失败"}}catch(n){return console.error("Error liking plugin:",n),{success:!1,error:"网络错误"}}}async function qAe(t,e){try{const n=e||v7(),r=await fetch(`${Cg}/stats/dislike`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:t,user_id:n})}),s=await r.json();return r.status===429?{success:!1,error:"操作过于频繁,请稍后再试"}:r.ok?{success:!0,...s}:{success:!1,error:s.error||"点踩失败"}}catch(n){return console.error("Error disliking plugin:",n),{success:!1,error:"网络错误"}}}async function $Ae(t,e,n,r){if(e<1||e>5)return{success:!1,error:"评分必须在 1-5 之间"};try{const s=r||v7(),i=await fetch(`${Cg}/stats/rate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:t,rating:e,comment:n,user_id:s})}),a=await i.json();return i.status===429?{success:!1,error:"每天最多评分 3 次"}:i.ok?{success:!0,...a}:{success:!1,error:a.error||"评分失败"}}catch(s){return console.error("Error rating plugin:",s),{success:!1,error:"网络错误"}}}async function HAe(t){try{const e=await fetch(`${Cg}/stats/download`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:t})}),n=await e.json();return e.status===429?(console.warn("Download recording rate limited"),{success:!0}):e.ok?{success:!0,...n}:(console.error("Failed to record download:",n.error),{success:!1,error:n.error})}catch(e){return console.error("Error recording download:",e),{success:!1,error:"网络错误"}}}function QAe(){const t=navigator,e=[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,t.deviceMemory||0].join("|");let n=0;for(let r=0;r<e.length;r++){const s=e.charCodeAt(r);n=(n<<5)-n+s,n=n&n}return`fp_${Math.abs(n).toString(36)}`}function v7(){const t="maibot_user_id";let e=localStorage.getItem(t);if(!e){const n=QAe(),r=Date.now().toString(36),s=Math.random().toString(36).substring(2,15);e=`${n}_${r}_${s}`,localStorage.setItem(t,e)}return e}function VAe({pluginId:t,compact:e=!1}){const[n,r]=b.useState(null),[s,i]=b.useState(!0),[a,l]=b.useState(0),[c,d]=b.useState(""),[h,m]=b.useState(!1),{toast:g}=Lr(),x=async()=>{i(!0);const k=await pX(t);k&&r(k),i(!1)};b.useEffect(()=>{x()},[t]);const y=async()=>{const k=await FAe(t);k.success?(g({title:"已点赞",description:"感谢你的支持!"}),x()):g({title:"点赞失败",description:k.error||"未知错误",variant:"destructive"})},w=async()=>{const k=await qAe(t);k.success?(g({title:"已反馈",description:"感谢你的反馈!"}),x()):g({title:"操作失败",description:k.error||"未知错误",variant:"destructive"})},S=async()=>{if(a===0){g({title:"请选择评分",description:"至少选择 1 颗星",variant:"destructive"});return}const k=await $Ae(t,a,c||void 0);k.success?(g({title:"评分成功",description:"感谢你的评价!"}),m(!1),l(0),d(""),x()):g({title:"评分失败",description:k.error||"未知错误",variant:"destructive"})};return s?o.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(td,{className:"h-4 w-4"}),o.jsx("span",{children:"-"})]}),o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(Dc,{className:"h-4 w-4"}),o.jsx("span",{children:"-"})]})]}):n?e?o.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[o.jsxs("div",{className:"flex items-center gap-1",title:`下载量: ${n.downloads.toLocaleString()}`,children:[o.jsx(td,{className:"h-4 w-4"}),o.jsx("span",{children:n.downloads.toLocaleString()})]}),o.jsxs("div",{className:"flex items-center gap-1",title:`评分: ${n.rating.toFixed(1)} (${n.rating_count} 条评价)`,children:[o.jsx(Dc,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),o.jsx("span",{children:n.rating.toFixed(1)})]}),o.jsxs("div",{className:"flex items-center gap-1",title:`点赞数: ${n.likes}`,children:[o.jsx(k4,{className:"h-4 w-4"}),o.jsx("span",{children:n.likes})]})]}):o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-4",children:[o.jsxs("div",{className:"flex flex-col items-center p-3 rounded-lg border bg-card",children:[o.jsx(td,{className:"h-5 w-5 text-muted-foreground mb-1"}),o.jsx("span",{className:"text-2xl font-bold",children:n.downloads.toLocaleString()}),o.jsx("span",{className:"text-xs text-muted-foreground",children:"下载量"})]}),o.jsxs("div",{className:"flex flex-col items-center p-3 rounded-lg border bg-card",children:[o.jsx(Dc,{className:"h-5 w-5 text-yellow-400 mb-1 fill-yellow-400"}),o.jsx("span",{className:"text-2xl font-bold",children:n.rating.toFixed(1)}),o.jsxs("span",{className:"text-xs text-muted-foreground",children:[n.rating_count," 条评价"]})]}),o.jsxs("div",{className:"flex flex-col items-center p-3 rounded-lg border bg-card",children:[o.jsx(k4,{className:"h-5 w-5 text-green-500 mb-1"}),o.jsx("span",{className:"text-2xl font-bold",children:n.likes}),o.jsx("span",{className:"text-xs text-muted-foreground",children:"点赞"})]}),o.jsxs("div",{className:"flex flex-col items-center p-3 rounded-lg border bg-card",children:[o.jsx(T9,{className:"h-5 w-5 text-red-500 mb-1"}),o.jsx("span",{className:"text-2xl font-bold",children:n.dislikes}),o.jsx("span",{className:"text-xs text-muted-foreground",children:"点踩"})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs(ue,{variant:"outline",size:"sm",onClick:y,children:[o.jsx(k4,{className:"h-4 w-4 mr-1"}),"点赞"]}),o.jsxs(ue,{variant:"outline",size:"sm",onClick:w,children:[o.jsx(T9,{className:"h-4 w-4 mr-1"}),"点踩"]}),o.jsxs(Er,{open:h,onOpenChange:m,children:[o.jsx(Of,{asChild:!0,children:o.jsxs(ue,{variant:"default",size:"sm",children:[o.jsx(Dc,{className:"h-4 w-4 mr-1"}),"评分"]})}),o.jsxs(wr,{children:[o.jsxs(Sr,{children:[o.jsx(kr,{children:"为插件评分"}),o.jsx(Xr,{children:"分享你的使用体验,帮助其他用户"})]}),o.jsxs("div",{className:"space-y-4 py-4",children:[o.jsxs("div",{className:"flex flex-col items-center gap-2",children:[o.jsx("div",{className:"flex gap-2",children:[1,2,3,4,5].map(k=>o.jsx("button",{onClick:()=>l(k),className:"focus:outline-none",children:o.jsx(Dc,{className:`h-8 w-8 transition-colors ${k<=a?"fill-yellow-400 text-yellow-400":"text-muted-foreground hover:text-yellow-300"}`})},k))}),o.jsxs("span",{className:"text-sm text-muted-foreground",children:[a===0&&"点击星星进行评分",a===1&&"很差",a===2&&"一般",a===3&&"还行",a===4&&"不错",a===5&&"非常好"]})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium mb-2 block",children:"评论(可选)"}),o.jsx(Nr,{value:c,onChange:k=>d(k.target.value),placeholder:"分享你的使用体验...",rows:4,maxLength:500}),o.jsxs("div",{className:"text-xs text-muted-foreground mt-1 text-right",children:[c.length," / 500"]})]})]}),o.jsxs(fs,{children:[o.jsx(ue,{variant:"outline",onClick:()=>m(!1),children:"取消"}),o.jsx(ue,{onClick:S,disabled:a===0,children:"提交评分"})]})]})]})]}),n.recent_ratings&&n.recent_ratings.length>0&&o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"text-sm font-semibold",children:"最近评价"}),o.jsx("div",{className:"space-y-3",children:n.recent_ratings.map((k,j)=>o.jsxs("div",{className:"p-3 rounded-lg border bg-muted/50",children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsx("div",{className:"flex gap-1",children:[1,2,3,4,5].map(N=>o.jsx(Dc,{className:`h-3 w-3 ${N<=k.rating?"fill-yellow-400 text-yellow-400":"text-muted-foreground"}`},N))}),o.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(k.created_at).toLocaleDateString()})]}),k.comment&&o.jsx("p",{className:"text-sm text-muted-foreground",children:k.comment})]},j))})]})]}):null}const Lz={"Group Management":"群组管理","Entertainment & Interaction":"娱乐互动","Utility Tools":"实用工具","Content Generation":"内容生成",Multimedia:"多媒体","External Integration":"外部集成","Data Analysis & Insights":"数据分析与洞察",Other:"其他"};function UAe(){const t=na(),[e,n]=b.useState(null),[r,s]=b.useState(""),[i,a]=b.useState("all"),[l,c]=b.useState("all"),[d,h]=b.useState(!0),[m,g]=b.useState([]),[x,y]=b.useState(!0),[w,S]=b.useState(null),[k,j]=b.useState(null),[N,T]=b.useState(null),[E,_]=b.useState(null),[,A]=b.useState([]),[D,q]=b.useState({}),{toast:B}=Lr(),H=async R=>{const ie=R.map(async U=>{try{const te=await pX(U.id);return{id:U.id,stats:te}}catch(te){return console.warn(`Failed to load stats for ${U.id}:`,te),{id:U.id,stats:null}}}),X=await Promise.all(ie),z={};X.forEach(({id:U,stats:te})=>{te&&(z[U]=te)}),q(z)};b.useEffect(()=>{let R=null,ie=!1;return(async()=>{if(R=AAe(z=>{ie||(T(z),z.stage==="success"?setTimeout(()=>{ie||T(null)},2e3):z.stage==="error"&&(y(!1),S(z.error||"加载失败")))},z=>{console.error("WebSocket error:",z),ie||B({title:"WebSocket 连接失败",description:"无法实时显示加载进度",variant:"destructive"})}),await new Promise(z=>{if(!R){z();return}const U=()=>{R&&R.readyState===WebSocket.OPEN?(console.log("WebSocket connected, starting to load plugins"),z()):R&&R.readyState===WebSocket.CLOSED?(console.warn("WebSocket closed before loading plugins"),z()):setTimeout(U,100)};U()}),!ie){const z=await TAe();j(z),z.installed||B({title:"Git 未安装",description:z.error||"请先安装 Git 才能使用插件安装功能",variant:"destructive"})}if(!ie){const z=await EAe();_(z)}if(!ie)try{y(!0),S(null);const z=await CAe();if(!ie){const U=await v0();A(U);const te=z.map(ne=>{const G=J1(ne.id,U),se=ev(ne.id,U);return{...ne,installed:G,installed_version:se}});for(const ne of U)!te.some(se=>se.id===ne.id)&&ne.manifest&&te.push({id:ne.id,manifest:{manifest_version:ne.manifest.manifest_version||1,name:ne.manifest.name,version:ne.manifest.version,description:ne.manifest.description||"",author:ne.manifest.author,license:ne.manifest.license||"Unknown",host_application:ne.manifest.host_application,homepage_url:ne.manifest.homepage_url,repository_url:ne.manifest.repository_url,keywords:ne.manifest.keywords||[],categories:ne.manifest.categories||[],default_locale:ne.manifest.default_locale||"zh-CN",locales_path:ne.manifest.locales_path},downloads:0,rating:0,review_count:0,installed:!0,installed_version:ne.manifest.version,published_at:new Date().toISOString(),updated_at:new Date().toISOString()});g(te),H(te)}}catch(z){if(!ie){const U=z instanceof Error?z.message:"加载插件列表失败";S(U),B({title:"加载失败",description:U,variant:"destructive"})}}finally{ie||y(!1)}})(),()=>{ie=!0,R&&R.close()}},[B]);const W=R=>{if(!R.installed&&E&&!ee(R))return o.jsxs(tn,{variant:"destructive",className:"gap-1",children:[o.jsx(Lo,{className:"h-3 w-3"}),"不兼容"]});if(R.installed){const ie=R.installed_version?.trim(),X=R.manifest.version?.trim();if(ie!==X){const z=ie?.split(".").map(Number)||[0,0,0],U=X?.split(".").map(Number)||[0,0,0];for(let te=0;te<3;te++){if((U[te]||0)>(z[te]||0))return o.jsxs(tn,{variant:"outline",className:"gap-1 text-orange-600 border-orange-600",children:[o.jsx(Lo,{className:"h-3 w-3"}),"可更新"]});if((U[te]||0)<(z[te]||0))break}}return o.jsxs(tn,{variant:"default",className:"gap-1",children:[o.jsx(Ya,{className:"h-3 w-3"}),"已安装"]})}return null},ee=R=>!E||!R.manifest?.host_application?!0:_Ae(R.manifest.host_application.min_version,R.manifest.host_application.max_version,E),I=R=>{if(!R.installed||!R.installed_version||!R.manifest?.version)return!1;const ie=R.installed_version.trim(),X=R.manifest.version.trim();if(ie===X)return!1;const z=ie.split(".").map(Number),U=X.split(".").map(Number);for(let te=0;te<3;te++){if((U[te]||0)>(z[te]||0))return!0;if((U[te]||0)<(z[te]||0))return!1}return!1},V=m.filter(R=>{if(!R.manifest)return console.warn("[过滤] 跳过无 manifest 的插件:",R.id),!1;const ie=r===""||R.manifest.name?.toLowerCase().includes(r.toLowerCase())||R.manifest.description?.toLowerCase().includes(r.toLowerCase())||R.manifest.keywords&&R.manifest.keywords.some(te=>te.toLowerCase().includes(r.toLowerCase())),X=i==="all"||R.manifest.categories&&R.manifest.categories.includes(i);let z=!0;l==="installed"?z=R.installed===!0:l==="updates"&&(z=R.installed===!0&&I(R));const U=!d||!E||ee(R);return ie&&X&&z&&U}),L=()=>{n(null)},$=async R=>{if(!k?.installed){B({title:"无法安装",description:"Git 未安装",variant:"destructive"});return}if(E&&!ee(R)){B({title:"无法安装",description:"插件与当前麦麦版本不兼容",variant:"destructive"});return}try{await MAe(R.id,R.manifest.repository_url||"","main"),HAe(R.id).catch(X=>{console.warn("Failed to record download:",X)}),B({title:"安装成功",description:`${R.manifest.name} 已成功安装`});const ie=await v0();A(ie),g(X=>X.map(z=>{if(z.id===R.id){const U=J1(z.id,ie),te=ev(z.id,ie);return{...z,installed:U,installed_version:te}}return z}))}catch(ie){B({title:"安装失败",description:ie instanceof Error?ie.message:"未知错误",variant:"destructive"})}},K=async R=>{try{await RAe(R.id),B({title:"卸载成功",description:`${R.manifest.name} 已成功卸载`});const ie=await v0();A(ie),g(X=>X.map(z=>{if(z.id===R.id){const U=J1(z.id,ie),te=ev(z.id,ie);return{...z,installed:U,installed_version:te}}return z}))}catch(ie){B({title:"卸载失败",description:ie instanceof Error?ie.message:"未知错误",variant:"destructive"})}},Y=async R=>{if(!k?.installed){B({title:"无法更新",description:"Git 未安装",variant:"destructive"});return}try{const ie=await DAe(R.id,R.manifest.repository_url||"","main");B({title:"更新成功",description:`${R.manifest.name} 已从 ${ie.old_version} 更新到 ${ie.new_version}`});const X=await v0();A(X),g(z=>z.map(U=>{if(U.id===R.id){const te=J1(U.id,X),ne=ev(U.id,X);return{...U,installed:te,installed_version:ne}}return U}))}catch(ie){B({title:"更新失败",description:ie instanceof Error?ie.message:"未知错误",variant:"destructive"})}};return o.jsx(pn,{className:"h-full",children:o.jsxs("div",{className:"space-y-6 p-4 sm:p-6",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"插件市场"}),o.jsx("p",{className:"text-muted-foreground mt-2",children:"浏览和管理麦麦的插件"})]}),o.jsxs(ue,{onClick:()=>t({to:"/plugin-mirrors"}),children:[o.jsx(ate,{className:"h-4 w-4 mr-2"}),"配置镜像源"]})]}),k&&!k.installed&&o.jsxs(Lt,{className:"border-orange-600 bg-orange-50 dark:bg-orange-950/20",children:[o.jsx(En,{children:o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(Ga,{className:"h-5 w-5 text-orange-600"}),o.jsxs("div",{children:[o.jsx(_n,{className:"text-lg text-orange-900 dark:text-orange-100",children:"Git 未安装"}),o.jsx(Wr,{className:"text-orange-800 dark:text-orange-200",children:k.error||"请先安装 Git 才能使用插件安装功能"})]})]})}),o.jsx(Xn,{children:o.jsxs("p",{className:"text-sm text-orange-800 dark:text-orange-200",children:["您可以从 ",o.jsx("a",{href:"https://git-scm.com/downloads",target:"_blank",rel:"noopener noreferrer",className:"underline font-medium",children:"git-scm.com"})," 下载并安装 Git。 安装完成后,请重启麦麦应用。"]})})]}),o.jsx(Lt,{className:"p-4",children:o.jsxs("div",{className:"flex flex-col gap-4",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[o.jsxs("div",{className:"flex-1 relative",children:[o.jsx(ii,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),o.jsx(Pe,{placeholder:"搜索插件...",value:r,onChange:R=>s(R.target.value),className:"pl-9"})]}),o.jsxs(Vt,{value:i,onValueChange:a,children:[o.jsx($t,{className:"w-full sm:w-[200px]",children:o.jsx(Ut,{placeholder:"选择分类"})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"all",children:"全部分类"}),o.jsx(De,{value:"Group Management",children:"群组管理"}),o.jsx(De,{value:"Entertainment & Interaction",children:"娱乐互动"}),o.jsx(De,{value:"Utility Tools",children:"实用工具"}),o.jsx(De,{value:"Content Generation",children:"内容生成"}),o.jsx(De,{value:"Multimedia",children:"多媒体"}),o.jsx(De,{value:"External Integration",children:"外部集成"}),o.jsx(De,{value:"Data Analysis & Insights",children:"数据分析与洞察"}),o.jsx(De,{value:"Other",children:"其他"})]})]})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Ci,{id:"compatible-only",checked:d,onCheckedChange:R=>h(R===!0)}),o.jsx("label",{htmlFor:"compatible-only",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer",children:"只显示兼容当前版本的插件"})]})]})}),o.jsx(Yi,{value:l,onValueChange:c,className:"w-full",children:o.jsxs(ji,{className:"grid w-full grid-cols-3",children:[o.jsxs(Bt,{value:"all",children:["全部插件 (",m.filter(R=>{if(!R.manifest)return!1;const ie=r===""||R.manifest.name?.toLowerCase().includes(r.toLowerCase())||R.manifest.description?.toLowerCase().includes(r.toLowerCase())||R.manifest.keywords&&R.manifest.keywords.some(U=>U.toLowerCase().includes(r.toLowerCase())),X=i==="all"||R.manifest.categories&&R.manifest.categories.includes(i),z=!d||!E||ee(R);return ie&&X&&z}).length,")"]}),o.jsxs(Bt,{value:"installed",children:["已安装 (",m.filter(R=>{if(!R.manifest)return!1;const ie=r===""||R.manifest.name?.toLowerCase().includes(r.toLowerCase())||R.manifest.description?.toLowerCase().includes(r.toLowerCase())||R.manifest.keywords&&R.manifest.keywords.some(U=>U.toLowerCase().includes(r.toLowerCase())),X=i==="all"||R.manifest.categories&&R.manifest.categories.includes(i),z=!d||!E||ee(R);return R.installed&&ie&&X&&z}).length,")"]}),o.jsxs(Bt,{value:"updates",children:["可更新 (",m.filter(R=>{if(!R.manifest)return!1;const ie=r===""||R.manifest.name?.toLowerCase().includes(r.toLowerCase())||R.manifest.description?.toLowerCase().includes(r.toLowerCase())||R.manifest.keywords&&R.manifest.keywords.some(U=>U.toLowerCase().includes(r.toLowerCase())),X=i==="all"||R.manifest.categories&&R.manifest.categories.includes(i),z=!d||!E||ee(R);return R.installed&&I(R)&&ie&&X&&z}).length,")"]})]})}),N&&N.stage==="loading"&&o.jsx(Lt,{className:"p-4",children:o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Us,{className:"h-4 w-4 animate-spin"}),o.jsxs("span",{className:"text-sm font-medium",children:[N.operation==="fetch"&&"加载插件列表",N.operation==="install"&&`安装插件${N.plugin_id?`: ${N.plugin_id}`:""}`,N.operation==="uninstall"&&`卸载插件${N.plugin_id?`: ${N.plugin_id}`:""}`,N.operation==="update"&&`更新插件${N.plugin_id?`: ${N.plugin_id}`:""}`]})]}),o.jsxs("span",{className:"text-sm font-medium",children:[N.progress,"%"]})]}),o.jsx(Qp,{value:N.progress,className:"h-2"}),o.jsx("div",{className:"text-xs text-muted-foreground",children:N.message}),N.operation==="fetch"&&N.total_plugins>0&&o.jsxs("div",{className:"text-xs text-muted-foreground text-center",children:["已加载 ",N.loaded_plugins," / ",N.total_plugins," 个插件"]})]})}),N&&N.stage==="error"&&N.error&&o.jsx(Lt,{className:"border-destructive bg-destructive/10",children:o.jsx(En,{children:o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(Ga,{className:"h-5 w-5 text-destructive"}),o.jsxs("div",{children:[o.jsx(_n,{className:"text-lg text-destructive",children:"加载失败"}),o.jsx(Wr,{className:"text-destructive/80",children:N.error})]})]})})}),x?o.jsxs("div",{className:"flex items-center justify-center py-12",children:[o.jsx(Us,{className:"h-8 w-8 animate-spin text-muted-foreground"}),o.jsx("span",{className:"ml-3 text-muted-foreground",children:"加载插件列表中..."})]}):w?o.jsx(Lt,{className:"p-6",children:o.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[o.jsx(Ga,{className:"h-12 w-12 text-destructive mb-4"}),o.jsx("h3",{className:"text-lg font-semibold mb-2",children:"加载失败"}),o.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:w}),o.jsx(ue,{onClick:()=>window.location.reload(),children:"重新加载"})]})}):V.length===0?o.jsx(Lt,{className:"p-6",children:o.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[o.jsx(ii,{className:"h-12 w-12 text-muted-foreground mb-4"}),o.jsx("h3",{className:"text-lg font-semibold mb-2",children:"未找到插件"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:r||i!=="all"?"尝试调整搜索条件或筛选器":"暂无可用插件"})]})}):o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:V.map(R=>o.jsxs(Lt,{className:"flex flex-col hover:shadow-lg transition-shadow h-full",children:[o.jsxs(En,{children:[o.jsxs("div",{className:"flex items-start justify-between gap-2",children:[o.jsx(_n,{className:"text-xl",children:R.manifest?.name||R.id}),o.jsxs("div",{className:"flex flex-col gap-1",children:[R.manifest?.categories&&R.manifest.categories[0]&&o.jsx(tn,{variant:"secondary",className:"text-xs whitespace-nowrap",children:Lz[R.manifest.categories[0]]||R.manifest.categories[0]}),W(R)]})]}),o.jsx(Wr,{className:"line-clamp-2",children:R.manifest?.description||"无描述"})]}),o.jsx(Xn,{className:"flex-1",children:o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(td,{className:"h-4 w-4"}),o.jsx("span",{children:(D[R.id]?.downloads??R.downloads??0).toLocaleString()})]}),o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(Dc,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),o.jsx("span",{children:(D[R.id]?.rating??R.rating??0).toFixed(1)})]})]}),o.jsxs("div",{className:"flex flex-wrap gap-2",children:[R.manifest?.keywords&&R.manifest.keywords.slice(0,3).map(ie=>o.jsx(tn,{variant:"outline",className:"text-xs",children:ie},ie)),R.manifest?.keywords&&R.manifest.keywords.length>3&&o.jsxs(tn,{variant:"outline",className:"text-xs",children:["+",R.manifest.keywords.length-3]})]}),o.jsxs("div",{className:"text-xs text-muted-foreground pt-2 border-t space-y-1",children:[o.jsxs("div",{children:["v",R.manifest?.version||"unknown"," · ",R.manifest?.author?.name||"Unknown"]}),R.manifest?.host_application&&o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("span",{children:"支持:"}),o.jsxs("span",{className:"font-medium",children:[R.manifest.host_application.min_version,R.manifest.host_application.max_version?` - ${R.manifest.host_application.max_version}`:" - 最新版本"]})]})]})]})}),o.jsx(hL,{className:"pt-4",children:o.jsxs("div",{className:"flex items-center justify-end gap-2 w-full",children:[o.jsx(ue,{variant:"outline",size:"sm",onClick:()=>n(R),children:"查看详情"}),R.installed?I(R)?o.jsxs(ue,{size:"sm",disabled:!k?.installed,title:k?.installed?void 0:"Git 未安装",onClick:()=>Y(R),children:[o.jsx(Qs,{className:"h-4 w-4 mr-1"}),"更新"]}):o.jsxs(ue,{variant:"destructive",size:"sm",disabled:!k?.installed,title:k?.installed?void 0:"Git 未安装",onClick:()=>K(R),children:[o.jsx(Cn,{className:"h-4 w-4 mr-1"}),"卸载"]}):o.jsxs(ue,{size:"sm",disabled:!k?.installed||N?.operation==="install"||E!==null&&!ee(R),title:k?.installed?E!==null&&!ee(R)?`不兼容当前版本 (需要 ${R.manifest?.host_application?.min_version||"未知"}${R.manifest?.host_application?.max_version?` - ${R.manifest.host_application.max_version}`:"+"},当前 ${E?.version})`:void 0:"Git 未安装",onClick:()=>$(R),children:[o.jsx(td,{className:"h-4 w-4 mr-1"}),N?.operation==="install"&&N?.plugin_id===R.id?"安装中...":"安装"]})]})})]},R.id))}),o.jsx(Er,{open:e!==null,onOpenChange:L,children:e&&e.manifest&&o.jsxs(wr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[o.jsx(Sr,{children:o.jsxs("div",{className:"flex items-start justify-between gap-4",children:[o.jsxs("div",{className:"space-y-2 flex-1",children:[o.jsx(kr,{className:"text-2xl",children:e.manifest.name}),o.jsxs(Xr,{children:["作者: ",e.manifest.author?.name||"Unknown",e.manifest.author?.url&&o.jsx("a",{href:e.manifest.author.url,target:"_blank",rel:"noopener noreferrer",className:"ml-2 text-primary hover:underline",children:o.jsx(w0,{className:"h-3 w-3 inline"})})]})]}),o.jsxs("div",{className:"flex flex-col gap-2",children:[e.manifest.categories&&e.manifest.categories[0]&&o.jsx(tn,{variant:"secondary",children:Lz[e.manifest.categories[0]]||e.manifest.categories[0]}),W(e)]})]})}),o.jsxs("div",{className:"space-y-6",children:[o.jsx(VAe,{pluginId:e.id}),o.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-4",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium",children:"版本"}),o.jsxs("p",{className:"text-sm text-muted-foreground",children:["v",e.manifest?.version||"unknown"]}),e.installed&&e.installed_version&&o.jsxs("p",{className:"text-xs text-muted-foreground",children:["已安装: v",e.installed_version]})]}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium",children:"下载量"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:(D[e.id]?.downloads??e.downloads??0).toLocaleString()})]}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium",children:"评分"}),o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(Dc,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),o.jsxs("span",{className:"text-sm text-muted-foreground",children:[(D[e.id]?.rating??e.rating??0).toFixed(1)," (",D[e.id]?.rating_count??e.review_count??0,")"]})]})]}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium",children:"许可证"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:e.manifest.license||"Unknown"})]}),o.jsxs("div",{className:"col-span-2",children:[o.jsx("p",{className:"text-sm font-medium",children:"支持版本"}),o.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.manifest.host_application?.min_version||"未知",e.manifest.host_application?.max_version?` - ${e.manifest.host_application.max_version}`:" - 最新版本"]})]})]}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium mb-2",children:"关键词"}),o.jsx("div",{className:"flex flex-wrap gap-2",children:e.manifest.keywords&&e.manifest.keywords.map(R=>o.jsx(tn,{variant:"outline",children:R},R))})]}),e.detailed_description&&o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium mb-2",children:"详细说明"}),o.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-line",children:e.detailed_description})]}),!e.detailed_description&&o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium mb-2",children:"说明"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:e.manifest.description||"无描述"})]}),o.jsxs("div",{className:"space-y-2",children:[e.manifest.homepage_url&&o.jsxs("div",{className:"text-sm",children:[o.jsx("span",{className:"font-medium",children:"主页: "}),o.jsx("a",{href:e.manifest.homepage_url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:e.manifest.homepage_url})]}),e.manifest.repository_url&&o.jsxs("div",{className:"text-sm",children:[o.jsx("span",{className:"font-medium",children:"仓库: "}),o.jsx("a",{href:e.manifest.repository_url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:e.manifest.repository_url})]})]})]}),o.jsxs(fs,{children:[e.manifest.homepage_url&&o.jsxs(ue,{onClick:()=>window.open(e.manifest.homepage_url,"_blank"),children:[o.jsx(w0,{className:"h-4 w-4 mr-2"}),"访问主页"]}),e.manifest.repository_url&&o.jsxs(ue,{variant:"outline",onClick:()=>window.open(e.manifest.repository_url,"_blank"),children:[o.jsx(w0,{className:"h-4 w-4 mr-2"}),"查看仓库"]})]})]})})]})})}var ow="Collapsible",[WAe]=Da(ow),[GAe,y7]=WAe(ow),gX=b.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:i,onOpenChange:a,...l}=t,[c,d]=Kl({prop:r,defaultProp:s??!1,onChange:a,caller:ow});return o.jsx(GAe,{scope:n,disabled:i,contentId:Gi(),open:c,onOpenToggle:b.useCallback(()=>d(h=>!h),[d]),children:o.jsx(Sn.div,{"data-state":w7(c),"data-disabled":i?"":void 0,...l,ref:e})})});gX.displayName=ow;var xX="CollapsibleTrigger",vX=b.forwardRef((t,e)=>{const{__scopeCollapsible:n,...r}=t,s=y7(xX,n);return o.jsx(Sn.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":w7(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:e,onClick:nt(t.onClick,s.onOpenToggle)})});vX.displayName=xX;var b7="CollapsibleContent",yX=b.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=y7(b7,t.__scopeCollapsible);return o.jsx(oi,{present:n||s.open,children:({present:i})=>o.jsx(XAe,{...r,ref:e,present:i})})});yX.displayName=b7;var XAe=b.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:r,children:s,...i}=t,a=y7(b7,n),[l,c]=b.useState(r),d=b.useRef(null),h=er(e,d),m=b.useRef(0),g=m.current,x=b.useRef(0),y=x.current,w=a.open||l,S=b.useRef(w),k=b.useRef(void 0);return b.useEffect(()=>{const j=requestAnimationFrame(()=>S.current=!1);return()=>cancelAnimationFrame(j)},[]),Wh(()=>{const j=d.current;if(j){k.current=k.current||{transitionDuration:j.style.transitionDuration,animationName:j.style.animationName},j.style.transitionDuration="0s",j.style.animationName="none";const N=j.getBoundingClientRect();m.current=N.height,x.current=N.width,S.current||(j.style.transitionDuration=k.current.transitionDuration,j.style.animationName=k.current.animationName),c(r)}},[a.open,r]),o.jsx(Sn.div,{"data-state":w7(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!w,...i,ref:h,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,"--radix-collapsible-content-width":y?`${y}px`:void 0,...t.style},children:w&&s})});function w7(t){return t?"open":"closed"}var YAe=gX;const hj=YAe,fj=vX,mj=yX;function KAe({field:t,value:e,onChange:n}){const[r,s]=b.useState(!1);switch(t.ui_type){case"switch":return o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(he,{children:t.label}),t.hint&&o.jsx("p",{className:"text-xs text-muted-foreground",children:t.hint})]}),o.jsx(Ft,{checked:!!e,onCheckedChange:n,disabled:t.disabled})]});case"number":return o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{children:t.label}),o.jsx(Pe,{type:"number",value:e??t.default,onChange:i=>n(parseFloat(i.target.value)||0),min:t.min,max:t.max,step:t.step??1,placeholder:t.placeholder,disabled:t.disabled}),t.hint&&o.jsx("p",{className:"text-xs text-muted-foreground",children:t.hint})]});case"slider":return o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(he,{children:t.label}),o.jsx("span",{className:"text-sm text-muted-foreground",children:e??t.default})]}),o.jsx(Nf,{value:[e??t.default],onValueChange:i=>n(i[0]),min:t.min??0,max:t.max??100,step:t.step??1,disabled:t.disabled}),t.hint&&o.jsx("p",{className:"text-xs text-muted-foreground",children:t.hint})]});case"select":return o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{children:t.label}),o.jsxs(Vt,{value:String(e??t.default),onValueChange:n,disabled:t.disabled,children:[o.jsx($t,{children:o.jsx(Ut,{placeholder:t.placeholder??"请选择"})}),o.jsx(Ht,{children:t.choices?.map(i=>o.jsx(De,{value:String(i),children:String(i)},String(i)))})]}),t.hint&&o.jsx("p",{className:"text-xs text-muted-foreground",children:t.hint})]});case"textarea":return o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{children:t.label}),o.jsx(Nr,{value:e??t.default,onChange:i=>n(i.target.value),placeholder:t.placeholder,rows:t.rows??3,disabled:t.disabled}),t.hint&&o.jsx("p",{className:"text-xs text-muted-foreground",children:t.hint})]});case"password":return o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{children:t.label}),o.jsxs("div",{className:"relative",children:[o.jsx(Pe,{type:r?"text":"password",value:e??"",onChange:i=>n(i.target.value),placeholder:t.placeholder,disabled:t.disabled,className:"pr-10"}),o.jsx(ue,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3",onClick:()=>s(!r),children:r?o.jsx(I0,{className:"h-4 w-4"}):o.jsx(Ji,{className:"h-4 w-4"})})]}),t.hint&&o.jsx("p",{className:"text-xs text-muted-foreground",children:t.hint})]});case"text":default:return o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{children:t.label}),o.jsx(Pe,{type:"text",value:e??t.default??"",onChange:i=>n(i.target.value),placeholder:t.placeholder,maxLength:t.max_length,disabled:t.disabled}),t.hint&&o.jsx("p",{className:"text-xs text-muted-foreground",children:t.hint})]})}}function Bz({section:t,config:e,onChange:n}){const[r,s]=b.useState(!t.collapsed),i=Object.entries(t.fields).filter(([,a])=>!a.hidden).sort(([,a],[,l])=>a.order-l.order);return o.jsx(hj,{open:r,onOpenChange:s,children:o.jsxs(Lt,{children:[o.jsx(fj,{asChild:!0,children:o.jsxs(En,{className:"cursor-pointer hover:bg-muted/50 transition-colors",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[r?o.jsx(Xc,{className:"h-4 w-4 text-muted-foreground"}):o.jsx(Zl,{className:"h-4 w-4 text-muted-foreground"}),o.jsx(_n,{className:"text-lg",children:t.title})]}),o.jsxs(tn,{variant:"secondary",className:"text-xs",children:[i.length," 项"]})]}),t.description&&o.jsx(Wr,{className:"ml-6",children:t.description})]})}),o.jsx(mj,{children:o.jsx(Xn,{className:"space-y-4 pt-0",children:i.map(([a,l])=>o.jsx(KAe,{field:l,value:e[t.name]?.[a],onChange:c=>n(t.name,a,c),sectionName:t.name},a))})})]})})}function ZAe({plugin:t,onBack:e}){const{toast:n}=Lr(),[r,s]=b.useState(null),[i,a]=b.useState({}),[l,c]=b.useState({}),[d,h]=b.useState(!0),[m,g]=b.useState(!1),[x,y]=b.useState(!1),[w,S]=b.useState(!1),k=b.useCallback(async()=>{h(!0);try{const[D,q]=await Promise.all([PAe(t.id),zAe(t.id)]);s(D),a(q),c(JSON.parse(JSON.stringify(q)))}catch(D){n({title:"加载配置失败",description:D instanceof Error?D.message:"未知错误",variant:"destructive"})}finally{h(!1)}},[t.id,n]);b.useEffect(()=>{k()},[k]),b.useEffect(()=>{y(JSON.stringify(i)!==JSON.stringify(l))},[i,l]);const j=(D,q,B)=>{a(H=>({...H,[D]:{...H[D]||{},[q]:B}}))},N=async()=>{g(!0);try{await IAe(t.id,i),c(JSON.parse(JSON.stringify(i))),n({title:"配置已保存",description:"更改将在插件重新加载后生效"})}catch(D){n({title:"保存失败",description:D instanceof Error?D.message:"未知错误",variant:"destructive"})}finally{g(!1)}},T=async()=>{try{await LAe(t.id),n({title:"配置已重置",description:"下次加载插件时将使用默认配置"}),S(!1),k()}catch(D){n({title:"重置失败",description:D instanceof Error?D.message:"未知错误",variant:"destructive"})}},E=async()=>{try{const D=await BAe(t.id);n({title:D.message,description:D.note}),k()}catch(D){n({title:"切换状态失败",description:D instanceof Error?D.message:"未知错误",variant:"destructive"})}};if(d)return o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx(Us,{className:"h-8 w-8 animate-spin text-muted-foreground"})});if(!r)return o.jsxs("div",{className:"flex flex-col items-center justify-center h-64 space-y-4",children:[o.jsx(Lo,{className:"h-12 w-12 text-muted-foreground"}),o.jsx("p",{className:"text-muted-foreground",children:"无法加载配置"}),o.jsxs(ue,{onClick:e,variant:"outline",children:[o.jsx(Bv,{className:"h-4 w-4 mr-2"}),"返回"]})]});const _=Object.values(r.sections).sort((D,q)=>D.order-q.order),A=i.plugin?.enabled!==!1;return o.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",children:[o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx(ue,{variant:"ghost",size:"icon",onClick:e,children:o.jsx(Bv,{className:"h-5 w-5"})}),o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:r.plugin_info.name||t.manifest.name}),o.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[o.jsx(tn,{variant:A?"default":"secondary",children:A?"已启用":"已禁用"}),o.jsxs("span",{className:"text-sm text-muted-foreground",children:["v",r.plugin_info.version||t.manifest.version]})]})]})]}),o.jsxs("div",{className:"flex gap-2 ml-10 sm:ml-0",children:[o.jsxs(ue,{variant:"outline",size:"sm",onClick:E,children:[o.jsx(Dp,{className:"h-4 w-4 mr-2"}),A?"禁用":"启用"]}),o.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>S(!0),children:[o.jsx(zj,{className:"h-4 w-4 mr-2"}),"重置"]}),o.jsxs(ue,{size:"sm",onClick:N,disabled:!x||m,children:[m?o.jsx(Us,{className:"h-4 w-4 mr-2 animate-spin"}):o.jsx(zp,{className:"h-4 w-4 mr-2"}),"保存"]})]})]}),x&&o.jsx(Lt,{className:"border-orange-200 bg-orange-50 dark:bg-orange-950/20 dark:border-orange-900",children:o.jsx(Xn,{className:"py-3",children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Xi,{className:"h-4 w-4 text-orange-600"}),o.jsx("p",{className:"text-sm text-orange-800 dark:text-orange-200",children:"有未保存的更改"})]})})}),r.layout.type==="tabs"&&r.layout.tabs.length>0?o.jsxs(Yi,{defaultValue:r.layout.tabs[0]?.id,children:[o.jsx(ji,{children:r.layout.tabs.map(D=>o.jsxs(Bt,{value:D.id,children:[D.title,D.badge&&o.jsx(tn,{variant:"secondary",className:"ml-2 text-xs",children:D.badge})]},D.id))}),r.layout.tabs.map(D=>o.jsx(ln,{value:D.id,className:"space-y-4 mt-4",children:D.sections.map(q=>{const B=r.sections[q];return B?o.jsx(Bz,{section:B,config:i,onChange:j},q):null})},D.id))]}):o.jsx("div",{className:"space-y-4",children:_.map(D=>o.jsx(Bz,{section:D,config:i,onChange:j},D.name))}),o.jsx(Er,{open:w,onOpenChange:S,children:o.jsxs(wr,{children:[o.jsxs(Sr,{children:[o.jsx(kr,{children:"确认重置配置"}),o.jsx(Xr,{children:"这将删除当前配置文件,下次加载插件时将使用默认配置。此操作不可撤销。"})]}),o.jsxs(fs,{children:[o.jsx(ue,{variant:"outline",onClick:()=>S(!1),children:"取消"}),o.jsx(ue,{variant:"destructive",onClick:T,children:"确认重置"})]})]})})]})}function JAe(){const{toast:t}=Lr(),[e,n]=b.useState([]),[r,s]=b.useState(!0),[i,a]=b.useState(""),[l,c]=b.useState(null),d=async()=>{s(!0);try{const x=await v0();n(x)}catch(x){t({title:"加载插件列表失败",description:x instanceof Error?x.message:"未知错误",variant:"destructive"})}finally{s(!1)}};b.useEffect(()=>{d()},[]);const h=e.filter(x=>{const y=i.toLowerCase();return x.id.toLowerCase().includes(y)||x.manifest.name.toLowerCase().includes(y)||x.manifest.description?.toLowerCase().includes(y)}),m=e.length,g=0;return l?o.jsx(pn,{className:"h-full",children:o.jsx("div",{className:"p-4 sm:p-6",children:o.jsx(ZAe,{plugin:l,onBack:()=>c(null)})})}):o.jsx(pn,{className:"h-full",children:o.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"插件配置"}),o.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理和配置已安装的插件"})]}),o.jsxs(ue,{variant:"outline",size:"sm",onClick:d,children:[o.jsx(Qs,{className:`h-4 w-4 mr-2 ${r?"animate-spin":""}`}),"刷新"]})]}),o.jsxs("div",{className:"grid gap-4 grid-cols-1 xs:grid-cols-2 lg:grid-cols-3",children:[o.jsxs(Lt,{children:[o.jsxs(En,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(_n,{className:"text-sm font-medium",children:"已安装插件"}),o.jsx(ed,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsxs(Xn,{children:[o.jsx("div",{className:"text-2xl font-bold",children:e.length}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:r?"正在加载...":"个插件"})]})]}),o.jsxs(Lt,{children:[o.jsxs(En,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(_n,{className:"text-sm font-medium",children:"已启用"}),o.jsx(Ya,{className:"h-4 w-4 text-green-600"})]}),o.jsxs(Xn,{children:[o.jsx("div",{className:"text-2xl font-bold",children:m}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"运行中的插件"})]})]}),o.jsxs(Lt,{children:[o.jsxs(En,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(_n,{className:"text-sm font-medium",children:"已禁用"}),o.jsx(Lo,{className:"h-4 w-4 text-orange-600"})]}),o.jsxs(Xn,{children:[o.jsx("div",{className:"text-2xl font-bold",children:g}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"未激活的插件"})]})]})]}),o.jsxs("div",{className:"relative",children:[o.jsx(ii,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),o.jsx(Pe,{placeholder:"搜索插件...",value:i,onChange:x=>a(x.target.value),className:"pl-9"})]}),o.jsxs(Lt,{children:[o.jsxs(En,{children:[o.jsx(_n,{children:"已安装的插件"}),o.jsx(Wr,{children:"点击插件查看和编辑配置"})]}),o.jsx(Xn,{children:r?o.jsx("div",{className:"flex items-center justify-center py-12",children:o.jsx(Us,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):h.length===0?o.jsxs("div",{className:"flex flex-col items-center justify-center py-12 space-y-4",children:[o.jsx(ed,{className:"h-16 w-16 text-muted-foreground/50"}),o.jsxs("div",{className:"text-center space-y-2",children:[o.jsx("p",{className:"text-lg font-medium text-muted-foreground",children:i?"没有找到匹配的插件":"暂无已安装的插件"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:i?"尝试其他搜索关键词":"前往插件市场安装插件"})]})]}):o.jsx("div",{className:"space-y-2",children:h.map(x=>o.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg border hover:bg-muted/50 cursor-pointer transition-colors",onClick:()=>c(x),children:[o.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[o.jsx("div",{className:"h-10 w-10 rounded-lg bg-primary/10 flex items-center justify-center flex-shrink-0",children:o.jsx(ed,{className:"h-5 w-5 text-primary"})}),o.jsxs("div",{className:"min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("h3",{className:"font-medium truncate",children:x.manifest.name}),o.jsxs(tn,{variant:"secondary",className:"text-xs flex-shrink-0",children:["v",x.manifest.version]})]}),o.jsx("p",{className:"text-sm text-muted-foreground truncate",children:x.manifest.description||"暂无描述"})]})]}),o.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[o.jsx(ue,{variant:"ghost",size:"sm",children:o.jsx(Vc,{className:"h-4 w-4"})}),o.jsx(Zl,{className:"h-4 w-4 text-muted-foreground"})]})]},x.id))})})]})]})})}function eMe(){const t=na(),{toast:e}=Lr(),[n,r]=b.useState([]),[s,i]=b.useState(!0),[a,l]=b.useState(null),[c,d]=b.useState(null),[h,m]=b.useState(!1),[g,x]=b.useState(!1),[y,w]=b.useState({id:"",name:"",raw_prefix:"",clone_prefix:"",enabled:!0,priority:1}),S=b.useCallback(async()=>{try{i(!0),l(null);const A=localStorage.getItem("access-token"),D=await fetch("/api/webui/plugins/mirrors",{headers:{Authorization:`Bearer ${A}`}});if(!D.ok)throw new Error("获取镜像源列表失败");const q=await D.json();r(q.mirrors||[])}catch(A){const D=A instanceof Error?A.message:"加载镜像源失败";l(D),e({title:"加载失败",description:D,variant:"destructive"})}finally{i(!1)}},[e]);b.useEffect(()=>{S()},[S]);const k=async()=>{try{const A=localStorage.getItem("access-token"),D=await fetch("/api/webui/plugins/mirrors",{method:"POST",headers:{Authorization:`Bearer ${A}`,"Content-Type":"application/json"},body:JSON.stringify(y)});if(!D.ok){const q=await D.json();throw new Error(q.detail||"添加镜像源失败")}e({title:"添加成功",description:"镜像源已添加"}),m(!1),w({id:"",name:"",raw_prefix:"",clone_prefix:"",enabled:!0,priority:1}),S()}catch(A){e({title:"添加失败",description:A instanceof Error?A.message:"未知错误",variant:"destructive"})}},j=async()=>{if(c)try{const A=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${c.id}`,{method:"PUT",headers:{Authorization:`Bearer ${A}`,"Content-Type":"application/json"},body:JSON.stringify({name:y.name,raw_prefix:y.raw_prefix,clone_prefix:y.clone_prefix,enabled:y.enabled,priority:y.priority})})).ok)throw new Error("更新镜像源失败");e({title:"更新成功",description:"镜像源已更新"}),x(!1),d(null),S()}catch(A){e({title:"更新失败",description:A instanceof Error?A.message:"未知错误",variant:"destructive"})}},N=async A=>{if(confirm("确定要删除这个镜像源吗?"))try{const D=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${A}`,{method:"DELETE",headers:{Authorization:`Bearer ${D}`}})).ok)throw new Error("删除镜像源失败");e({title:"删除成功",description:"镜像源已删除"}),S()}catch(D){e({title:"删除失败",description:D instanceof Error?D.message:"未知错误",variant:"destructive"})}},T=async A=>{try{const D=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${A.id}`,{method:"PUT",headers:{Authorization:`Bearer ${D}`,"Content-Type":"application/json"},body:JSON.stringify({enabled:!A.enabled})})).ok)throw new Error("更新状态失败");S()}catch(D){e({title:"更新失败",description:D instanceof Error?D.message:"未知错误",variant:"destructive"})}},E=A=>{d(A),w({id:A.id,name:A.name,raw_prefix:A.raw_prefix,clone_prefix:A.clone_prefix,enabled:A.enabled,priority:A.priority}),x(!0)},_=async(A,D)=>{const q=D==="up"?A.priority-1:A.priority+1;if(!(q<1))try{const B=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${A.id}`,{method:"PUT",headers:{Authorization:`Bearer ${B}`,"Content-Type":"application/json"},body:JSON.stringify({priority:q})})).ok)throw new Error("更新优先级失败");S()}catch(B){e({title:"更新失败",description:B instanceof Error?B.message:"未知错误",variant:"destructive"})}};return o.jsx(pn,{className:"h-full",children:o.jsxs("div",{className:"space-y-6 p-4 sm:p-6",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx(ue,{variant:"ghost",size:"icon",onClick:()=>t({to:"/plugins"}),children:o.jsx(Bv,{className:"h-5 w-5"})}),o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"镜像源配置"}),o.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"管理 Git 克隆和文件下载的镜像源"})]})]}),o.jsxs(ue,{onClick:()=>m(!0),children:[o.jsx(Is,{className:"h-4 w-4 mr-2"}),"添加镜像源"]})]}),s?o.jsx(Lt,{className:"p-6",children:o.jsx("div",{className:"flex items-center justify-center py-8",children:o.jsx(Us,{className:"h-8 w-8 animate-spin text-primary"})})}):a?o.jsx(Lt,{className:"p-6",children:o.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[o.jsx(Ga,{className:"h-12 w-12 text-destructive mb-4"}),o.jsx("h3",{className:"text-lg font-semibold mb-2",children:"加载失败"}),o.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:a}),o.jsx(ue,{onClick:S,children:"重新加载"})]})}):o.jsxs(Lt,{children:[o.jsx("div",{className:"hidden md:block",children:o.jsxs(Af,{children:[o.jsx(Mf,{children:o.jsxs(zs,{children:[o.jsx(mn,{children:"状态"}),o.jsx(mn,{children:"名称"}),o.jsx(mn,{children:"ID"}),o.jsx(mn,{children:"优先级"}),o.jsx(mn,{className:"text-right",children:"操作"})]})}),o.jsx(Rf,{children:n.map(A=>o.jsxs(zs,{children:[o.jsx(Yt,{children:o.jsx(Ft,{checked:A.enabled,onCheckedChange:()=>T(A)})}),o.jsx(Yt,{children:o.jsxs("div",{children:[o.jsx("div",{className:"font-medium",children:A.name}),o.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Raw: ",A.raw_prefix]})]})}),o.jsx(Yt,{children:o.jsx(tn,{variant:"outline",children:A.id})}),o.jsx(Yt,{children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"font-mono",children:A.priority}),o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx(ue,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:()=>_(A,"up"),disabled:A.priority===1,children:o.jsx(B0,{className:"h-3 w-3"})}),o.jsx(ue,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:()=>_(A,"down"),children:o.jsx(Xc,{className:"h-3 w-3"})})]})]})}),o.jsx(Yt,{className:"text-right",children:o.jsxs("div",{className:"flex items-center justify-end gap-2",children:[o.jsx(ue,{variant:"ghost",size:"icon",onClick:()=>E(A),children:o.jsx(Ju,{className:"h-4 w-4"})}),o.jsx(ue,{variant:"ghost",size:"icon",onClick:()=>N(A.id),children:o.jsx(Cn,{className:"h-4 w-4 text-destructive"})})]})})]},A.id))})]})}),o.jsx("div",{className:"md:hidden p-4 space-y-4",children:n.map(A=>o.jsx(Lt,{className:"p-4",children:o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-start justify-between",children:[o.jsxs("div",{className:"flex-1",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("h3",{className:"font-semibold",children:A.name}),A.enabled&&o.jsx(tn,{variant:"default",className:"text-xs",children:"启用"})]}),o.jsx(tn,{variant:"outline",className:"mt-1 text-xs",children:A.id})]}),o.jsx(Ft,{checked:A.enabled,onCheckedChange:()=>T(A)})]}),o.jsxs("div",{className:"text-sm space-y-1",children:[o.jsxs("div",{className:"text-muted-foreground",children:[o.jsx("span",{className:"font-medium",children:"Raw: "}),o.jsx("span",{className:"break-all",children:A.raw_prefix})]}),o.jsxs("div",{className:"text-muted-foreground",children:[o.jsx("span",{className:"font-medium",children:"优先级: "}),o.jsx("span",{className:"font-mono",children:A.priority})]})]}),o.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t",children:[o.jsxs(ue,{variant:"outline",size:"sm",className:"flex-1",onClick:()=>E(A),children:[o.jsx(Ju,{className:"h-4 w-4 mr-1"}),"编辑"]}),o.jsx(ue,{variant:"outline",size:"sm",onClick:()=>_(A,"up"),disabled:A.priority===1,children:o.jsx(B0,{className:"h-4 w-4"})}),o.jsx(ue,{variant:"outline",size:"sm",onClick:()=>_(A,"down"),children:o.jsx(Xc,{className:"h-4 w-4"})}),o.jsx(ue,{variant:"destructive",size:"sm",onClick:()=>N(A.id),children:o.jsx(Cn,{className:"h-4 w-4"})})]})]})},A.id))})]}),o.jsx(Er,{open:h,onOpenChange:m,children:o.jsxs(wr,{className:"max-w-lg",children:[o.jsxs(Sr,{children:[o.jsx(kr,{children:"添加镜像源"}),o.jsx(Xr,{children:"添加新的 Git 镜像源配置"})]}),o.jsxs("div",{className:"space-y-4 py-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"add-id",children:"镜像源 ID *"}),o.jsx(Pe,{id:"add-id",placeholder:"例如: my-mirror",value:y.id,onChange:A=>w({...y,id:A.target.value})})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"add-name",children:"名称 *"}),o.jsx(Pe,{id:"add-name",placeholder:"例如: 我的镜像源",value:y.name,onChange:A=>w({...y,name:A.target.value})})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"add-raw",children:"Raw 文件前缀 *"}),o.jsx(Pe,{id:"add-raw",placeholder:"https://example.com/raw",value:y.raw_prefix,onChange:A=>w({...y,raw_prefix:A.target.value})})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"add-clone",children:"克隆前缀 *"}),o.jsx(Pe,{id:"add-clone",placeholder:"https://example.com/clone",value:y.clone_prefix,onChange:A=>w({...y,clone_prefix:A.target.value})})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"add-priority",children:"优先级"}),o.jsx(Pe,{id:"add-priority",type:"number",min:"1",value:y.priority,onChange:A=>w({...y,priority:parseInt(A.target.value)||1})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"数字越小优先级越高"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Ft,{id:"add-enabled",checked:y.enabled,onCheckedChange:A=>w({...y,enabled:A})}),o.jsx(he,{htmlFor:"add-enabled",children:"启用此镜像源"})]})]}),o.jsxs(fs,{children:[o.jsx(ue,{variant:"outline",onClick:()=>m(!1),children:"取消"}),o.jsx(ue,{onClick:k,children:"添加"})]})]})}),o.jsx(Er,{open:g,onOpenChange:x,children:o.jsxs(wr,{className:"max-w-lg",children:[o.jsxs(Sr,{children:[o.jsx(kr,{children:"编辑镜像源"}),o.jsx(Xr,{children:"修改镜像源配置"})]}),o.jsxs("div",{className:"space-y-4 py-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{children:"镜像源 ID"}),o.jsx(Pe,{value:y.id,disabled:!0})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"edit-name",children:"名称 *"}),o.jsx(Pe,{id:"edit-name",value:y.name,onChange:A=>w({...y,name:A.target.value})})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"edit-raw",children:"Raw 文件前缀 *"}),o.jsx(Pe,{id:"edit-raw",value:y.raw_prefix,onChange:A=>w({...y,raw_prefix:A.target.value})})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"edit-clone",children:"克隆前缀 *"}),o.jsx(Pe,{id:"edit-clone",value:y.clone_prefix,onChange:A=>w({...y,clone_prefix:A.target.value})})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"edit-priority",children:"优先级"}),o.jsx(Pe,{id:"edit-priority",type:"number",min:"1",value:y.priority,onChange:A=>w({...y,priority:parseInt(A.target.value)||1})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"数字越小优先级越高"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Ft,{id:"edit-enabled",checked:y.enabled,onCheckedChange:A=>w({...y,enabled:A})}),o.jsx(he,{htmlFor:"edit-enabled",children:"启用此镜像源"})]})]}),o.jsxs(fs,{children:[o.jsx(ue,{variant:"outline",onClick:()=>x(!1),children:"取消"}),o.jsx(ue,{onClick:j,children:"保存"})]})]})})]})})}function tMe(t,e=[]){let n=[];function r(i,a){const l=b.createContext(a);l.displayName=i+"Context";const c=n.length;n=[...n,a];const d=m=>{const{scope:g,children:x,...y}=m,w=g?.[t]?.[c]||l,S=b.useMemo(()=>y,Object.values(y));return o.jsx(w.Provider,{value:S,children:x})};d.displayName=i+"Provider";function h(m,g){const x=g?.[t]?.[c]||l,y=b.useContext(x);if(y)return y;if(a!==void 0)return a;throw new Error(`\`${m}\` must be used within \`${i}\``)}return[d,h]}const s=()=>{const i=n.map(a=>b.createContext(a));return function(l){const c=l?.[t]||i;return b.useMemo(()=>({[`__scope${t}`]:{...l,[t]:c}}),[l,c])}};return s.scopeName=t,[r,nMe(s,...e)]}function nMe(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const a=r.reduce((l,{useScope:c,scopeName:d})=>{const m=c(i)[`__scope${d}`];return{...l,...m}},{});return b.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}var rMe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],S7=rMe.reduce((t,e)=>{const n=Vy(`Primitive.${e}`),r=b.forwardRef((s,i)=>{const{asChild:a,...l}=s,c=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...l,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{}),sMe=bJ();function iMe(){return sMe.useSyncExternalStore(aMe,()=>!0,()=>!1)}function aMe(){return()=>{}}var k7="Avatar",[oMe]=tMe(k7),[lMe,bX]=oMe(k7),wX=b.forwardRef((t,e)=>{const{__scopeAvatar:n,...r}=t,[s,i]=b.useState("idle");return o.jsx(lMe,{scope:n,imageLoadingStatus:s,onImageLoadingStatusChange:i,children:o.jsx(S7.span,{...r,ref:e})})});wX.displayName=k7;var SX="AvatarImage",kX=b.forwardRef((t,e)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:s=()=>{},...i}=t,a=bX(SX,n),l=cMe(r,i),c=Rs(d=>{s(d),a.onImageLoadingStatusChange(d)});return Wh(()=>{l!=="idle"&&c(l)},[l,c]),l==="loaded"?o.jsx(S7.img,{...i,ref:e,src:r}):null});kX.displayName=SX;var OX="AvatarFallback",jX=b.forwardRef((t,e)=>{const{__scopeAvatar:n,delayMs:r,...s}=t,i=bX(OX,n),[a,l]=b.useState(r===void 0);return b.useEffect(()=>{if(r!==void 0){const c=window.setTimeout(()=>l(!0),r);return()=>window.clearTimeout(c)}},[r]),a&&i.imageLoadingStatus!=="loaded"?o.jsx(S7.span,{...s,ref:e}):null});jX.displayName=OX;function Fz(t,e){return t?e?(t.src!==e&&(t.src=e),t.complete&&t.naturalWidth>0?"loaded":"loading"):"error":"idle"}function cMe(t,{referrerPolicy:e,crossOrigin:n}){const r=iMe(),s=b.useRef(null),i=r?(s.current||(s.current=new window.Image),s.current):null,[a,l]=b.useState(()=>Fz(i,t));return Wh(()=>{l(Fz(i,t))},[i,t]),Wh(()=>{const c=m=>()=>{l(m)};if(!i)return;const d=c("loaded"),h=c("error");return i.addEventListener("load",d),i.addEventListener("error",h),e&&(i.referrerPolicy=e),typeof n=="string"&&(i.crossOrigin=n),()=>{i.removeEventListener("load",d),i.removeEventListener("error",h)}},[i,n,e]),a}var NX=wX,CX=kX,TX=jX;const Pv=b.forwardRef(({className:t,...e},n)=>o.jsx(NX,{ref:n,className:xe("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...e}));Pv.displayName=NX.displayName;const uMe=b.forwardRef(({className:t,...e},n)=>o.jsx(CX,{ref:n,className:xe("aspect-square h-full w-full",t),...e}));uMe.displayName=CX.displayName;const zv=b.forwardRef(({className:t,...e},n)=>o.jsx(TX,{ref:n,className:xe("flex h-full w-full items-center justify-center rounded-full bg-muted",t),...e}));zv.displayName=TX.displayName;function dMe(){return"webui_"+Math.random().toString(36).substr(2,9)+"_"+Date.now().toString(36)}function hMe(){const t="maibot_webui_user_id";let e=localStorage.getItem(t);return e||(e=dMe(),localStorage.setItem(t,e)),e}function fMe(){return localStorage.getItem("maibot_webui_user_name")||"WebUI用户"}function mMe(t){localStorage.setItem("maibot_webui_user_name",t)}function pMe(){const[t,e]=b.useState([]),[n,r]=b.useState(""),[s,i]=b.useState(!1),[a,l]=b.useState(!1),[c,d]=b.useState(!1),[h,m]=b.useState(!0),[g,x]=b.useState(fMe()),[y,w]=b.useState(!1),[S,k]=b.useState(""),[j,N]=b.useState({}),T=b.useRef(hMe()),E=b.useRef(null),_=b.useRef(null),A=b.useRef(null),D=b.useRef(0),q=b.useRef(new Set),{toast:B}=Lr(),H=z=>(D.current+=1,`${z}-${Date.now()}-${D.current}-${Math.random().toString(36).substr(2,9)}`),W=b.useCallback(()=>{_.current?.scrollIntoView({behavior:"smooth"})},[]);b.useEffect(()=>{W()},[t,W]);const ee=b.useCallback(async()=>{m(!0);try{const z=`/api/chat/history?user_id=${T.current}&limit=50`;console.log("[Chat] 正在加载历史消息:",z);const U=await fetch(z);if(console.log("[Chat] 历史消息响应状态:",U.status,U.statusText),console.log("[Chat] 响应 Content-Type:",U.headers.get("content-type")),U.ok){const te=await U.text();console.log("[Chat] 响应内容前100字符:",te.substring(0,100));try{const ne=JSON.parse(te);if(console.log("[Chat] 解析后的数据:",ne),ne.messages&&ne.messages.length>0){const G=ne.messages.map(se=>({id:se.id,type:se.type,content:se.content,timestamp:se.timestamp,sender:{name:se.sender_name||(se.is_bot?"麦麦":"WebUI用户"),user_id:se.user_id,is_bot:se.is_bot}}));e(G),console.log("[Chat] 已加载历史消息数量:",G.length),G.forEach(se=>{if(se.type==="bot"){const re=`bot-${se.content}-${Math.floor(se.timestamp*1e3)}`;q.current.add(re)}})}else console.log("[Chat] 没有历史消息")}catch(ne){console.error("[Chat] JSON 解析失败:",ne),console.error("[Chat] 原始响应内容:",te)}}else{console.error("[Chat] 响应失败:",U.status);const te=await U.text();console.error("[Chat] 错误响应内容:",te.substring(0,200))}}catch(z){console.error("[Chat] 加载历史消息失败:",z)}finally{m(!1)}},[]),I=b.useCallback(()=>{if(E.current?.readyState===WebSocket.OPEN||E.current?.readyState===WebSocket.CONNECTING){console.log("WebSocket 已存在,跳过连接");return}l(!0);const U=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/chat/ws?user_id=${encodeURIComponent(T.current)}&user_name=${encodeURIComponent(g)}`;console.log("正在连接 WebSocket:",U);try{const te=new WebSocket(U);E.current=te,te.onopen=()=>{i(!0),l(!1),console.log("WebSocket 已连接")},te.onmessage=ne=>{try{const G=JSON.parse(ne.data);switch(G.type){case"session_info":N({session_id:G.session_id,user_id:G.user_id,user_name:G.user_name,bot_name:G.bot_name});break;case"system":e(se=>[...se,{id:H("sys"),type:"system",content:G.content||"",timestamp:G.timestamp||Date.now()/1e3}]);break;case"user_message":e(se=>[...se,{id:G.message_id||H("user"),type:"user",content:G.content||"",timestamp:G.timestamp||Date.now()/1e3,sender:G.sender}]);break;case"bot_message":{d(!1);const se=`bot-${G.content}-${Math.floor((G.timestamp||0)*1e3)}`;if(q.current.has(se)){console.log("跳过重复的机器人消息");break}if(q.current.add(se),q.current.size>100){const re=q.current.values().next().value;re&&q.current.delete(re)}e(re=>[...re,{id:H("bot"),type:"bot",content:G.content||"",timestamp:G.timestamp||Date.now()/1e3,sender:G.sender}]);break}case"typing":d(G.is_typing||!1);break;case"error":e(se=>[...se,{id:H("error"),type:"error",content:G.content||"发生错误",timestamp:G.timestamp||Date.now()/1e3}]),B({title:"错误",description:G.content,variant:"destructive"});break;case"pong":break;default:console.log("未知消息类型:",G.type)}}catch(G){console.error("解析消息失败:",G)}},te.onclose=()=>{i(!1),l(!1),E.current=null,console.log("WebSocket 已断开"),A.current&&clearTimeout(A.current),A.current=window.setTimeout(()=>{V.current||I()},5e3)},te.onerror=ne=>{console.error("WebSocket 错误:",ne),l(!1)}}catch(te){console.error("创建 WebSocket 失败:",te),l(!1)}},[B,g]),V=b.useRef(!1);b.useEffect(()=>{V.current=!1,ee();const z=setTimeout(()=>{V.current||I()},100),U=setInterval(()=>{E.current?.readyState===WebSocket.OPEN&&E.current.send(JSON.stringify({type:"ping"}))},3e4);return()=>{V.current=!0,clearTimeout(z),clearInterval(U),A.current&&(clearTimeout(A.current),A.current=null),E.current&&(E.current.close(),E.current=null)}},[I,ee]);const L=b.useCallback(()=>{!n.trim()||!E.current||E.current.readyState!==WebSocket.OPEN||(E.current.send(JSON.stringify({type:"message",content:n.trim(),user_name:g})),r(""))},[n,g]),$=z=>{z.key==="Enter"&&!z.shiftKey&&(z.preventDefault(),L())},K=()=>{k(g),w(!0)},Y=()=>{const z=S.trim()||"WebUI用户";x(z),mMe(z),w(!1),E.current?.readyState===WebSocket.OPEN&&E.current.send(JSON.stringify({type:"update_nickname",user_name:z}))},R=()=>{k(""),w(!1)},ie=z=>new Date(z*1e3).toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"}),X=()=>{E.current&&E.current.close(),I()};return o.jsxs("div",{className:"h-full flex flex-col",children:[o.jsx("div",{className:"shrink-0 border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:o.jsxs("div",{className:"p-3 sm:p-4 max-w-4xl mx-auto",children:[o.jsxs("div",{className:"flex items-center justify-between gap-2",children:[o.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 min-w-0",children:[o.jsx(Pv,{className:"h-8 w-8 sm:h-10 sm:w-10 shrink-0",children:o.jsx(zv,{className:"bg-primary/10 text-primary",children:o.jsx(o0,{className:"h-4 w-4 sm:h-5 sm:w-5"})})}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("h1",{className:"text-base sm:text-lg font-semibold truncate",children:j.bot_name||"麦麦"}),o.jsx("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:s?o.jsxs(o.Fragment,{children:[o.jsx(ote,{className:"h-3 w-3 text-green-500"}),o.jsx("span",{className:"text-green-600 dark:text-green-400",children:"已连接"})]}):a?o.jsxs(o.Fragment,{children:[o.jsx(Us,{className:"h-3 w-3 animate-spin"}),o.jsx("span",{children:"连接中..."})]}):o.jsxs(o.Fragment,{children:[o.jsx(lte,{className:"h-3 w-3 text-red-500"}),o.jsx("span",{className:"text-red-600 dark:text-red-400",children:"未连接"})]})})]})]}),o.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[h&&o.jsx(Us,{className:"h-4 w-4 animate-spin text-muted-foreground"}),o.jsx(ue,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:X,disabled:a,title:"重新连接",children:o.jsx(Qs,{className:xe("h-4 w-4",a&&"animate-spin")})})]})]}),o.jsxs("div",{className:"hidden sm:flex items-center gap-2 mt-2 text-sm text-muted-foreground",children:[o.jsx(Lv,{className:"h-3 w-3"}),o.jsx("span",{children:"当前身份:"}),y?o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Pe,{value:S,onChange:z=>k(z.target.value),onKeyDown:z=>{z.key==="Enter"&&Y(),z.key==="Escape"&&R()},className:"h-7 w-32",placeholder:"输入昵称",autoFocus:!0}),o.jsx(ue,{size:"sm",variant:"ghost",className:"h-7 px-2",onClick:Y,children:"保存"}),o.jsx(ue,{size:"sm",variant:"ghost",className:"h-7 px-2",onClick:R,children:"取消"})]}):o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("span",{className:"font-medium text-foreground",children:g}),o.jsx(ue,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",onClick:K,title:"修改昵称",children:o.jsx(cte,{className:"h-3 w-3"})})]})]})]})}),o.jsx("div",{className:"flex-1 overflow-hidden",children:o.jsx(pn,{className:"h-full",children:o.jsxs("div",{className:"p-3 sm:p-4 max-w-4xl mx-auto space-y-3 sm:space-y-4",children:[t.length===0&&!h&&o.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground",children:[o.jsx(o0,{className:"h-12 w-12 mb-4 opacity-50"}),o.jsxs("p",{className:"text-sm",children:["开始与 ",j.bot_name||"麦麦"," 对话吧!"]})]}),t.map(z=>o.jsxs("div",{className:xe("flex gap-2 sm:gap-3",z.type==="user"&&"flex-row-reverse",z.type==="system"&&"justify-center",z.type==="error"&&"justify-center"),children:[z.type==="system"&&o.jsx("div",{className:"text-xs text-muted-foreground bg-muted/50 px-3 py-1 rounded-full max-w-[90%]",children:z.content}),z.type==="error"&&o.jsx("div",{className:"text-xs text-red-600 dark:text-red-400 bg-red-100 dark:bg-red-900/30 px-3 py-1 rounded-full max-w-[90%]",children:z.content}),(z.type==="user"||z.type==="bot")&&o.jsxs(o.Fragment,{children:[o.jsx(Pv,{className:"h-7 w-7 sm:h-8 sm:w-8 shrink-0",children:o.jsx(zv,{className:xe("text-xs",z.type==="bot"?"bg-primary/10 text-primary":"bg-secondary text-secondary-foreground"),children:z.type==="bot"?o.jsx(o0,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4"}):o.jsx(Lv,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4"})})}),o.jsxs("div",{className:xe("flex flex-col gap-1 max-w-[75%] sm:max-w-[70%]",z.type==="user"&&"items-end"),children:[o.jsxs("div",{className:"flex items-center gap-2 text-[10px] sm:text-xs text-muted-foreground",children:[o.jsx("span",{className:"hidden sm:inline",children:z.sender?.name||(z.type==="bot"?j.bot_name:g)}),o.jsx("span",{children:ie(z.timestamp)})]}),o.jsx("div",{className:xe("rounded-2xl px-3 py-2 text-sm whitespace-pre-wrap break-words",z.type==="bot"?"bg-muted rounded-tl-sm":"bg-primary text-primary-foreground rounded-tr-sm"),children:z.content})]})]})]},z.id)),c&&o.jsxs("div",{className:"flex gap-2 sm:gap-3",children:[o.jsx(Pv,{className:"h-7 w-7 sm:h-8 sm:w-8 shrink-0",children:o.jsx(zv,{className:"bg-primary/10 text-primary",children:o.jsx(o0,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4"})})}),o.jsx("div",{className:"bg-muted rounded-2xl rounded-tl-sm px-4 py-3",children:o.jsxs("div",{className:"flex gap-1",children:[o.jsx("span",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0ms"}}),o.jsx("span",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"150ms"}}),o.jsx("span",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"300ms"}})]})})]}),o.jsx("div",{ref:_})]})})}),o.jsx("div",{className:"shrink-0 border-t bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:o.jsx("div",{className:"p-3 sm:p-4 max-w-4xl mx-auto",children:o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Pe,{value:n,onChange:z=>r(z.target.value),onKeyDown:$,placeholder:s?"输入消息...":"等待连接...",disabled:!s,className:"flex-1 h-10 sm:h-10"}),o.jsx(ue,{onClick:L,disabled:!s||!n.trim(),size:"icon",className:"h-10 w-10 shrink-0",children:o.jsx(ute,{className:"h-4 w-4"})})]})})})]})}const gMe=kf("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"}}),EX=b.forwardRef(({className:t,size:e,abbrTitle:n,children:r,...s},i)=>o.jsx("kbd",{className:xe(gMe({size:e,className:t})),ref:i,...s,children:n?o.jsx("abbr",{title:n,children:r}):r}));EX.displayName="Kbd";const xMe=[{icon:L0,title:"首页",description:"查看仪表板概览",path:"/",category:"概览"},{icon:Po,title:"麦麦主程序配置",description:"配置麦麦的核心设置",path:"/config/bot",category:"配置"},{icon:CI,title:"麦麦模型提供商配置",description:"配置模型提供商",path:"/config/modelProvider",category:"配置"},{icon:TI,title:"麦麦模型配置",description:"配置模型参数",path:"/config/model",category:"配置"},{icon:Ij,title:"表情包管理",description:"管理麦麦的表情包",path:"/resource/emoji",category:"资源"},{icon:Gh,title:"表达方式管理",description:"管理麦麦的表达方式",path:"/resource/expression",category:"资源"},{icon:EI,title:"人物信息管理",description:"管理人物信息",path:"/resource/person",category:"资源"},{icon:dte,title:"统计信息",description:"查看使用统计",path:"/statistics",category:"监控"},{icon:ed,title:"插件市场",description:"浏览和安装插件",path:"/plugins",category:"扩展"},{icon:Fv,title:"日志查看器",description:"查看系统日志",path:"/logs",category:"监控"},{icon:Vc,title:"系统设置",description:"配置系统参数",path:"/settings",category:"系统"}];function vMe({open:t,onOpenChange:e}){const[n,r]=b.useState(""),[s,i]=b.useState(0),a=na(),l=xMe.filter(h=>h.title.toLowerCase().includes(n.toLowerCase())||h.description.toLowerCase().includes(n.toLowerCase())||h.category.toLowerCase().includes(n.toLowerCase()));b.useEffect(()=>{t&&(r(""),i(0))},[t]);const c=b.useCallback(h=>{a({to:h}),e(!1)},[a,e]),d=b.useCallback(h=>{h.key==="ArrowDown"?(h.preventDefault(),i(m=>(m+1)%l.length)):h.key==="ArrowUp"?(h.preventDefault(),i(m=>(m-1+l.length)%l.length)):h.key==="Enter"&&l[s]&&(h.preventDefault(),c(l[s].path))},[l,s,c]);return o.jsx(Er,{open:t,onOpenChange:e,children:o.jsxs(wr,{className:"max-w-2xl p-0 gap-0",children:[o.jsxs(Sr,{className:"px-4 pt-4 pb-0",children:[o.jsx(kr,{className:"sr-only",children:"搜索"}),o.jsxs("div",{className:"relative",children:[o.jsx(ii,{className:"absolute left-3 top-1/2 h-5 w-5 -translate-y-1/2 text-muted-foreground"}),o.jsx(Pe,{value:n,onChange:h=>{r(h.target.value),i(0)},onKeyDown:d,placeholder:"搜索页面...",className:"h-12 pl-11 text-base border-0 focus-visible:ring-0 shadow-none",autoFocus:!0})]})]}),o.jsx("div",{className:"border-t",children:o.jsx(pn,{className:"h-[400px]",children:l.length>0?o.jsx("div",{className:"p-2",children:l.map((h,m)=>{const g=h.icon;return o.jsxs("button",{onClick:()=>c(h.path),onMouseEnter:()=>i(m),className:xe("w-full flex items-center gap-3 px-3 py-2.5 rounded-md text-left transition-colors",m===s?"bg-accent text-accent-foreground":"hover:bg-accent/50"),children:[o.jsx(g,{className:"h-5 w-5 flex-shrink-0"}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("div",{className:"font-medium text-sm",children:h.title}),o.jsx("div",{className:"text-xs text-muted-foreground truncate",children:h.description})]}),o.jsx("div",{className:"text-xs text-muted-foreground px-2 py-1 bg-muted rounded",children:h.category})]},h.path)})}):o.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[o.jsx(ii,{className:"h-12 w-12 text-muted-foreground/50 mb-4"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:n?"未找到匹配的页面":"输入关键词开始搜索"})]})})}),o.jsx("div",{className:"border-t px-4 py-3 flex items-center justify-between text-xs text-muted-foreground",children:o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"↑"}),o.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"↓"}),"导航"]}),o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"Enter"}),"选择"]}),o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"Esc"}),"关闭"]})]})})]})})}function yMe(t){const e=bMe(t),n=b.forwardRef((r,s)=>{const{children:i,...a}=r,l=b.Children.toArray(i),c=l.find(SMe);if(c){const d=c.props.children,h=l.map(m=>m===c?b.Children.count(d)>1?b.Children.only(null):b.isValidElement(d)?d.props.children:null:m);return o.jsx(e,{...a,ref:s,children:b.isValidElement(d)?b.cloneElement(d,void 0,h):null})}return o.jsx(e,{...a,ref:s,children:i})});return n.displayName=`${t}.Slot`,n}function bMe(t){const e=b.forwardRef((n,r)=>{const{children:s,...i}=n;if(b.isValidElement(s)){const a=OMe(s),l=kMe(i,s.props);return s.type!==b.Fragment&&(l.ref=r?Gc(r,a):a),b.cloneElement(s,l)}return b.Children.count(s)>1?b.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var wMe=Symbol("radix.slottable");function SMe(t){return b.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===wMe}function kMe(t,e){const n={...e};for(const r in e){const s=t[r],i=e[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...l)=>{const c=i(...l);return s(...l),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}function OMe(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var pj=["Enter"," "],jMe=["ArrowDown","PageUp","Home"],_X=["ArrowUp","PageDown","End"],NMe=[...jMe,..._X],CMe={ltr:[...pj,"ArrowRight"],rtl:[...pj,"ArrowLeft"]},TMe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Tg="Menu",[_p,EMe,_Me]=Qy(Tg),[Cd,AX]=Da(Tg,[_Me,vf,sb]),Eg=vf(),MX=sb(),[RX,gu]=Cd(Tg),[AMe,_g]=Cd(Tg),DX=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:s,onOpenChange:i,modal:a=!0}=t,l=Eg(e),[c,d]=b.useState(null),h=b.useRef(!1),m=Rs(i),g=Rp(s);return b.useEffect(()=>{const x=()=>{h.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>h.current=!1;return document.addEventListener("keydown",x,{capture:!0}),()=>{document.removeEventListener("keydown",x,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),o.jsx(Yy,{...l,children:o.jsx(RX,{scope:e,open:n,onOpenChange:m,content:c,onContentChange:d,children:o.jsx(AMe,{scope:e,onClose:b.useCallback(()=>m(!1),[m]),isUsingKeyboardRef:h,dir:g,modal:a,children:r})})})};DX.displayName=Tg;var MMe="MenuAnchor",O7=b.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,s=Eg(n);return o.jsx(Ky,{...s,...r,ref:e})});O7.displayName=MMe;var j7="MenuPortal",[RMe,PX]=Cd(j7,{forceMount:void 0}),zX=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:s}=t,i=gu(j7,e);return o.jsx(RMe,{scope:e,forceMount:n,children:o.jsx(oi,{present:n||i.open,children:o.jsx(Xy,{asChild:!0,container:s,children:r})})})};zX.displayName=j7;var _a="MenuContent",[DMe,N7]=Cd(_a),IX=b.forwardRef((t,e)=>{const n=PX(_a,t.__scopeMenu),{forceMount:r=n.forceMount,...s}=t,i=gu(_a,t.__scopeMenu),a=_g(_a,t.__scopeMenu);return o.jsx(_p.Provider,{scope:t.__scopeMenu,children:o.jsx(oi,{present:r||i.open,children:o.jsx(_p.Slot,{scope:t.__scopeMenu,children:a.modal?o.jsx(PMe,{...s,ref:e}):o.jsx(zMe,{...s,ref:e})})})})}),PMe=b.forwardRef((t,e)=>{const n=gu(_a,t.__scopeMenu),r=b.useRef(null),s=er(e,r);return b.useEffect(()=>{const i=r.current;if(i)return gI(i)},[]),o.jsx(C7,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:nt(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),zMe=b.forwardRef((t,e)=>{const n=gu(_a,t.__scopeMenu);return o.jsx(C7,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),IMe=yMe("MenuContent.ScrollLock"),C7=b.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:m,onInteractOutside:g,onDismiss:x,disableOutsideScroll:y,...w}=t,S=gu(_a,n),k=_g(_a,n),j=Eg(n),N=MX(n),T=EMe(n),[E,_]=b.useState(null),A=b.useRef(null),D=er(e,A,S.onContentChange),q=b.useRef(0),B=b.useRef(""),H=b.useRef(0),W=b.useRef(null),ee=b.useRef("right"),I=b.useRef(0),V=y?xI:b.Fragment,L=y?{as:IMe,allowPinchZoom:!0}:void 0,$=Y=>{const R=B.current+Y,ie=T().filter(G=>!G.disabled),X=document.activeElement,z=ie.find(G=>G.ref.current===X)?.textValue,U=ie.map(G=>G.textValue),te=XMe(U,R,z),ne=ie.find(G=>G.textValue===te)?.ref.current;(function G(se){B.current=se,window.clearTimeout(q.current),se!==""&&(q.current=window.setTimeout(()=>G(""),1e3))})(R),ne&&setTimeout(()=>ne.focus())};b.useEffect(()=>()=>window.clearTimeout(q.current),[]),vI();const K=b.useCallback(Y=>ee.current===W.current?.side&&KMe(Y,W.current?.area),[]);return o.jsx(DMe,{scope:n,searchRef:B,onItemEnter:b.useCallback(Y=>{K(Y)&&Y.preventDefault()},[K]),onItemLeave:b.useCallback(Y=>{K(Y)||(A.current?.focus(),_(null))},[K]),onTriggerLeave:b.useCallback(Y=>{K(Y)&&Y.preventDefault()},[K]),pointerGraceTimerRef:H,onPointerGraceIntentChange:b.useCallback(Y=>{W.current=Y},[]),children:o.jsx(V,{...L,children:o.jsx(yI,{asChild:!0,trapped:s,onMountAutoFocus:nt(i,Y=>{Y.preventDefault(),A.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:o.jsx(Rj,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:m,onInteractOutside:g,onDismiss:x,children:o.jsx(vL,{asChild:!0,...N,dir:k.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:_,onEntryFocus:nt(c,Y=>{k.isUsingKeyboardRef.current||Y.preventDefault()}),preventScrollOnEntryFocus:!0,children:o.jsx(Dj,{role:"menu","aria-orientation":"vertical","data-state":eY(S.open),"data-radix-menu-content":"",dir:k.dir,...j,...w,ref:D,style:{outline:"none",...w.style},onKeyDown:nt(w.onKeyDown,Y=>{const ie=Y.target.closest("[data-radix-menu-content]")===Y.currentTarget,X=Y.ctrlKey||Y.altKey||Y.metaKey,z=Y.key.length===1;ie&&(Y.key==="Tab"&&Y.preventDefault(),!X&&z&&$(Y.key));const U=A.current;if(Y.target!==U||!NMe.includes(Y.key))return;Y.preventDefault();const ne=T().filter(G=>!G.disabled).map(G=>G.ref.current);_X.includes(Y.key)&&ne.reverse(),WMe(ne)}),onBlur:nt(t.onBlur,Y=>{Y.currentTarget.contains(Y.target)||(window.clearTimeout(q.current),B.current="")}),onPointerMove:nt(t.onPointerMove,Ap(Y=>{const R=Y.target,ie=I.current!==Y.clientX;if(Y.currentTarget.contains(R)&&ie){const X=Y.clientX>I.current?"right":"left";ee.current=X,I.current=Y.clientX}}))})})})})})})});IX.displayName=_a;var LMe="MenuGroup",T7=b.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return o.jsx(Sn.div,{role:"group",...r,ref:e})});T7.displayName=LMe;var BMe="MenuLabel",LX=b.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return o.jsx(Sn.div,{...r,ref:e})});LX.displayName=BMe;var Fy="MenuItem",qz="menu.itemSelect",lw=b.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...s}=t,i=b.useRef(null),a=_g(Fy,t.__scopeMenu),l=N7(Fy,t.__scopeMenu),c=er(e,i),d=b.useRef(!1),h=()=>{const m=i.current;if(!n&&m){const g=new CustomEvent(qz,{bubbles:!0,cancelable:!0});m.addEventListener(qz,x=>r?.(x),{once:!0}),wI(m,g),g.defaultPrevented?d.current=!1:a.onClose()}};return o.jsx(BX,{...s,ref:c,disabled:n,onClick:nt(t.onClick,h),onPointerDown:m=>{t.onPointerDown?.(m),d.current=!0},onPointerUp:nt(t.onPointerUp,m=>{d.current||m.currentTarget?.click()}),onKeyDown:nt(t.onKeyDown,m=>{const g=l.searchRef.current!=="";n||g&&m.key===" "||pj.includes(m.key)&&(m.currentTarget.click(),m.preventDefault())})})});lw.displayName=Fy;var BX=b.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...i}=t,a=N7(Fy,n),l=MX(n),c=b.useRef(null),d=er(e,c),[h,m]=b.useState(!1),[g,x]=b.useState("");return b.useEffect(()=>{const y=c.current;y&&x((y.textContent??"").trim())},[i.children]),o.jsx(_p.ItemSlot,{scope:n,disabled:r,textValue:s??g,children:o.jsx(yL,{asChild:!0,...l,focusable:!r,children:o.jsx(Sn.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:d,onPointerMove:nt(t.onPointerMove,Ap(y=>{r?a.onItemLeave(y):(a.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:nt(t.onPointerLeave,Ap(y=>a.onItemLeave(y))),onFocus:nt(t.onFocus,()=>m(!0)),onBlur:nt(t.onBlur,()=>m(!1))})})})}),FMe="MenuCheckboxItem",FX=b.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...s}=t;return o.jsx(VX,{scope:t.__scopeMenu,checked:n,children:o.jsx(lw,{role:"menuitemcheckbox","aria-checked":qy(n)?"mixed":n,...s,ref:e,"data-state":A7(n),onSelect:nt(s.onSelect,()=>r?.(qy(n)?!0:!n),{checkForDefaultPrevented:!1})})})});FX.displayName=FMe;var qX="MenuRadioGroup",[qMe,$Me]=Cd(qX,{value:void 0,onValueChange:()=>{}}),$X=b.forwardRef((t,e)=>{const{value:n,onValueChange:r,...s}=t,i=Rs(r);return o.jsx(qMe,{scope:t.__scopeMenu,value:n,onValueChange:i,children:o.jsx(T7,{...s,ref:e})})});$X.displayName=qX;var HX="MenuRadioItem",QX=b.forwardRef((t,e)=>{const{value:n,...r}=t,s=$Me(HX,t.__scopeMenu),i=n===s.value;return o.jsx(VX,{scope:t.__scopeMenu,checked:i,children:o.jsx(lw,{role:"menuitemradio","aria-checked":i,...r,ref:e,"data-state":A7(i),onSelect:nt(r.onSelect,()=>s.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});QX.displayName=HX;var E7="MenuItemIndicator",[VX,HMe]=Cd(E7,{checked:!1}),UX=b.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...s}=t,i=HMe(E7,n);return o.jsx(oi,{present:r||qy(i.checked)||i.checked===!0,children:o.jsx(Sn.span,{...s,ref:e,"data-state":A7(i.checked)})})});UX.displayName=E7;var QMe="MenuSeparator",WX=b.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return o.jsx(Sn.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});WX.displayName=QMe;var VMe="MenuArrow",GX=b.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,s=Eg(n);return o.jsx(Pj,{...s,...r,ref:e})});GX.displayName=VMe;var _7="MenuSub",[UMe,XX]=Cd(_7),YX=t=>{const{__scopeMenu:e,children:n,open:r=!1,onOpenChange:s}=t,i=gu(_7,e),a=Eg(e),[l,c]=b.useState(null),[d,h]=b.useState(null),m=Rs(s);return b.useEffect(()=>(i.open===!1&&m(!1),()=>m(!1)),[i.open,m]),o.jsx(Yy,{...a,children:o.jsx(RX,{scope:e,open:r,onOpenChange:m,content:d,onContentChange:h,children:o.jsx(UMe,{scope:e,contentId:Gi(),triggerId:Gi(),trigger:l,onTriggerChange:c,children:n})})})};YX.displayName=_7;var y0="MenuSubTrigger",KX=b.forwardRef((t,e)=>{const n=gu(y0,t.__scopeMenu),r=_g(y0,t.__scopeMenu),s=XX(y0,t.__scopeMenu),i=N7(y0,t.__scopeMenu),a=b.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=i,d={__scopeMenu:t.__scopeMenu},h=b.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return b.useEffect(()=>h,[h]),b.useEffect(()=>{const m=l.current;return()=>{window.clearTimeout(m),c(null)}},[l,c]),o.jsx(O7,{asChild:!0,...d,children:o.jsx(BX,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":eY(n.open),...t,ref:Gc(e,s.onTriggerChange),onClick:m=>{t.onClick?.(m),!(t.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:nt(t.onPointerMove,Ap(m=>{i.onItemEnter(m),!m.defaultPrevented&&!t.disabled&&!n.open&&!a.current&&(i.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),h()},100))})),onPointerLeave:nt(t.onPointerLeave,Ap(m=>{h();const g=n.content?.getBoundingClientRect();if(g){const x=n.content?.dataset.side,y=x==="right",w=y?-5:5,S=g[y?"left":"right"],k=g[y?"right":"left"];i.onPointerGraceIntentChange({area:[{x:m.clientX+w,y:m.clientY},{x:S,y:g.top},{x:k,y:g.top},{x:k,y:g.bottom},{x:S,y:g.bottom}],side:x}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(m),m.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:nt(t.onKeyDown,m=>{const g=i.searchRef.current!=="";t.disabled||g&&m.key===" "||CMe[r.dir].includes(m.key)&&(n.onOpenChange(!0),n.content?.focus(),m.preventDefault())})})})});KX.displayName=y0;var ZX="MenuSubContent",JX=b.forwardRef((t,e)=>{const n=PX(_a,t.__scopeMenu),{forceMount:r=n.forceMount,...s}=t,i=gu(_a,t.__scopeMenu),a=_g(_a,t.__scopeMenu),l=XX(ZX,t.__scopeMenu),c=b.useRef(null),d=er(e,c);return o.jsx(_p.Provider,{scope:t.__scopeMenu,children:o.jsx(oi,{present:r||i.open,children:o.jsx(_p.Slot,{scope:t.__scopeMenu,children:o.jsx(C7,{id:l.contentId,"aria-labelledby":l.triggerId,...s,ref:d,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:h=>{a.isUsingKeyboardRef.current&&c.current?.focus(),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:nt(t.onFocusOutside,h=>{h.target!==l.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:nt(t.onEscapeKeyDown,h=>{a.onClose(),h.preventDefault()}),onKeyDown:nt(t.onKeyDown,h=>{const m=h.currentTarget.contains(h.target),g=TMe[a.dir].includes(h.key);m&&g&&(i.onOpenChange(!1),l.trigger?.focus(),h.preventDefault())})})})})})});JX.displayName=ZX;function eY(t){return t?"open":"closed"}function qy(t){return t==="indeterminate"}function A7(t){return qy(t)?"indeterminate":t?"checked":"unchecked"}function WMe(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function GMe(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function XMe(t,e,n){const s=e.length>1&&Array.from(e).every(d=>d===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let a=GMe(t,Math.max(i,0));s.length===1&&(a=a.filter(d=>d!==n));const c=a.find(d=>d.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function YMe(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,a=e.length-1;i<e.length;a=i++){const l=e[i],c=e[a],d=l.x,h=l.y,m=c.x,g=c.y;h>r!=g>r&&n<(m-d)*(r-h)/(g-h)+d&&(s=!s)}return s}function KMe(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return YMe(n,e)}function Ap(t){return e=>e.pointerType==="mouse"?t(e):void 0}var ZMe=DX,JMe=O7,eRe=zX,tRe=IX,nRe=T7,rRe=LX,sRe=lw,iRe=FX,aRe=$X,oRe=QX,lRe=UX,cRe=WX,uRe=GX,dRe=YX,hRe=KX,fRe=JX,M7="ContextMenu",[mRe]=Da(M7,[AX]),Xs=AX(),[pRe,tY]=mRe(M7),nY=t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,dir:s,modal:i=!0}=t,[a,l]=b.useState(!1),c=Xs(e),d=Rs(r),h=b.useCallback(m=>{l(m),d(m)},[d]);return o.jsx(pRe,{scope:e,open:a,onOpenChange:h,modal:i,children:o.jsx(ZMe,{...c,dir:s,open:a,onOpenChange:h,modal:i,children:n})})};nY.displayName=M7;var rY="ContextMenuTrigger",sY=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,disabled:r=!1,...s}=t,i=tY(rY,n),a=Xs(n),l=b.useRef({x:0,y:0}),c=b.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...l.current})}),d=b.useRef(0),h=b.useCallback(()=>window.clearTimeout(d.current),[]),m=g=>{l.current={x:g.clientX,y:g.clientY},i.onOpenChange(!0)};return b.useEffect(()=>h,[h]),b.useEffect(()=>void(r&&h()),[r,h]),o.jsxs(o.Fragment,{children:[o.jsx(JMe,{...a,virtualRef:c}),o.jsx(Sn.span,{"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,...s,ref:e,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:r?t.onContextMenu:nt(t.onContextMenu,g=>{h(),m(g),g.preventDefault()}),onPointerDown:r?t.onPointerDown:nt(t.onPointerDown,tv(g=>{h(),d.current=window.setTimeout(()=>m(g),700)})),onPointerMove:r?t.onPointerMove:nt(t.onPointerMove,tv(h)),onPointerCancel:r?t.onPointerCancel:nt(t.onPointerCancel,tv(h)),onPointerUp:r?t.onPointerUp:nt(t.onPointerUp,tv(h))})]})});sY.displayName=rY;var gRe="ContextMenuPortal",iY=t=>{const{__scopeContextMenu:e,...n}=t,r=Xs(e);return o.jsx(eRe,{...r,...n})};iY.displayName=gRe;var aY="ContextMenuContent",oY=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=tY(aY,n),i=Xs(n),a=b.useRef(!1);return o.jsx(tRe,{...i,...r,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:l=>{t.onCloseAutoFocus?.(l),!l.defaultPrevented&&a.current&&l.preventDefault(),a.current=!1},onInteractOutside:l=>{t.onInteractOutside?.(l),!l.defaultPrevented&&!s.modal&&(a.current=!0)},style:{...t.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)"}})});oY.displayName=aY;var xRe="ContextMenuGroup",vRe=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Xs(n);return o.jsx(nRe,{...s,...r,ref:e})});vRe.displayName=xRe;var yRe="ContextMenuLabel",lY=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Xs(n);return o.jsx(rRe,{...s,...r,ref:e})});lY.displayName=yRe;var bRe="ContextMenuItem",cY=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Xs(n);return o.jsx(sRe,{...s,...r,ref:e})});cY.displayName=bRe;var wRe="ContextMenuCheckboxItem",uY=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Xs(n);return o.jsx(iRe,{...s,...r,ref:e})});uY.displayName=wRe;var SRe="ContextMenuRadioGroup",kRe=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Xs(n);return o.jsx(aRe,{...s,...r,ref:e})});kRe.displayName=SRe;var ORe="ContextMenuRadioItem",dY=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Xs(n);return o.jsx(oRe,{...s,...r,ref:e})});dY.displayName=ORe;var jRe="ContextMenuItemIndicator",hY=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Xs(n);return o.jsx(lRe,{...s,...r,ref:e})});hY.displayName=jRe;var NRe="ContextMenuSeparator",fY=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Xs(n);return o.jsx(cRe,{...s,...r,ref:e})});fY.displayName=NRe;var CRe="ContextMenuArrow",TRe=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Xs(n);return o.jsx(uRe,{...s,...r,ref:e})});TRe.displayName=CRe;var mY="ContextMenuSub",pY=t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,open:s,defaultOpen:i}=t,a=Xs(e),[l,c]=Kl({prop:s,defaultProp:i??!1,onChange:r,caller:mY});return o.jsx(dRe,{...a,open:l,onOpenChange:c,children:n})};pY.displayName=mY;var ERe="ContextMenuSubTrigger",gY=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Xs(n);return o.jsx(hRe,{...s,...r,ref:e})});gY.displayName=ERe;var _Re="ContextMenuSubContent",xY=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Xs(n);return o.jsx(fRe,{...s,...r,ref:e,style:{...t.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)"}})});xY.displayName=_Re;function tv(t){return e=>e.pointerType!=="mouse"?t(e):void 0}var ARe=nY,MRe=sY,RRe=iY,vY=oY,yY=lY,bY=cY,wY=uY,SY=dY,kY=hY,OY=fY,DRe=pY,jY=gY,NY=xY;const PRe=ARe,zRe=MRe,IRe=DRe,CY=b.forwardRef(({className:t,inset:e,children:n,...r},s)=>o.jsxs(jY,{ref:s,className:xe("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",e&&"pl-8",t),...r,children:[n,o.jsx(Zl,{className:"ml-auto h-4 w-4"})]}));CY.displayName=jY.displayName;const TY=b.forwardRef(({className:t,...e},n)=>o.jsx(NY,{ref:n,className:xe("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]",t),...e}));TY.displayName=NY.displayName;const EY=b.forwardRef(({className:t,...e},n)=>o.jsx(RRe,{children:o.jsx(vY,{ref:n,className:xe("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]",t),...e})}));EY.displayName=vY.displayName;const $a=b.forwardRef(({className:t,inset:e,...n},r)=>o.jsx(bY,{ref:r,className:xe("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",e&&"pl-8",t),...n}));$a.displayName=bY.displayName;const LRe=b.forwardRef(({className:t,children:e,checked:n,...r},s)=>o.jsxs(wY,{ref:s,className:xe("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",t),checked:n,...r,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(kY,{children:o.jsx(zo,{className:"h-4 w-4"})})}),e]}));LRe.displayName=wY.displayName;const BRe=b.forwardRef(({className:t,children:e,...n},r)=>o.jsxs(SY,{ref:r,className:xe("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",t),...n,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(kY,{children:o.jsx(hte,{className:"h-2 w-2 fill-current"})})}),e]}));BRe.displayName=SY.displayName;const FRe=b.forwardRef(({className:t,inset:e,...n},r)=>o.jsx(yY,{ref:r,className:xe("px-2 py-1.5 text-sm font-semibold text-foreground",e&&"pl-8",t),...n}));FRe.displayName=yY.displayName;const b0=b.forwardRef(({className:t,...e},n)=>o.jsx(OY,{ref:n,className:xe("-mx-1 my-1 h-px bg-border",t),...e}));b0.displayName=OY.displayName;const Ch=({className:t,...e})=>o.jsx("span",{className:xe("ml-auto text-xs tracking-widest text-muted-foreground",t),...e});Ch.displayName="ContextMenuShortcut";var qRe=Symbol("radix.slottable");function $Re(t){const e=({children:n})=>o.jsx(o.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=qRe,e}var[cw]=Da("Tooltip",[vf]),uw=vf(),_Y="TooltipProvider",HRe=700,gj="tooltip.open",[QRe,R7]=cw(_Y),AY=t=>{const{__scopeTooltip:e,delayDuration:n=HRe,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=t,a=b.useRef(!0),l=b.useRef(!1),c=b.useRef(0);return b.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),o.jsx(QRe,{scope:e,isOpenDelayedRef:a,delayDuration:n,onOpen:b.useCallback(()=>{window.clearTimeout(c.current),a.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:b.useCallback(d=>{l.current=d},[]),disableHoverableContent:s,children:i})};AY.displayName=_Y;var Mp="Tooltip",[VRe,Ag]=cw(Mp),MY=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:a,delayDuration:l}=t,c=R7(Mp,t.__scopeTooltip),d=uw(e),[h,m]=b.useState(null),g=Gi(),x=b.useRef(0),y=a??c.disableHoverableContent,w=l??c.delayDuration,S=b.useRef(!1),[k,j]=Kl({prop:r,defaultProp:s??!1,onChange:A=>{A?(c.onOpen(),document.dispatchEvent(new CustomEvent(gj))):c.onClose(),i?.(A)},caller:Mp}),N=b.useMemo(()=>k?S.current?"delayed-open":"instant-open":"closed",[k]),T=b.useCallback(()=>{window.clearTimeout(x.current),x.current=0,S.current=!1,j(!0)},[j]),E=b.useCallback(()=>{window.clearTimeout(x.current),x.current=0,j(!1)},[j]),_=b.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>{S.current=!0,j(!0),x.current=0},w)},[w,j]);return b.useEffect(()=>()=>{x.current&&(window.clearTimeout(x.current),x.current=0)},[]),o.jsx(Yy,{...d,children:o.jsx(VRe,{scope:e,contentId:g,open:k,stateAttribute:N,trigger:h,onTriggerChange:m,onTriggerEnter:b.useCallback(()=>{c.isOpenDelayedRef.current?_():T()},[c.isOpenDelayedRef,_,T]),onTriggerLeave:b.useCallback(()=>{y?E():(window.clearTimeout(x.current),x.current=0)},[E,y]),onOpen:T,onClose:E,disableHoverableContent:y,children:n})})};MY.displayName=Mp;var xj="TooltipTrigger",RY=b.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=Ag(xj,n),i=R7(xj,n),a=uw(n),l=b.useRef(null),c=er(e,l,s.onTriggerChange),d=b.useRef(!1),h=b.useRef(!1),m=b.useCallback(()=>d.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),o.jsx(Ky,{asChild:!0,...a,children:o.jsx(Sn.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:c,onPointerMove:nt(t.onPointerMove,g=>{g.pointerType!=="touch"&&!h.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),h.current=!0)}),onPointerLeave:nt(t.onPointerLeave,()=>{s.onTriggerLeave(),h.current=!1}),onPointerDown:nt(t.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:nt(t.onFocus,()=>{d.current||s.onOpen()}),onBlur:nt(t.onBlur,s.onClose),onClick:nt(t.onClick,s.onClose)})})});RY.displayName=xj;var D7="TooltipPortal",[URe,WRe]=cw(D7,{forceMount:void 0}),DY=t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:s}=t,i=Ag(D7,e);return o.jsx(URe,{scope:e,forceMount:n,children:o.jsx(oi,{present:n||i.open,children:o.jsx(Xy,{asChild:!0,container:s,children:r})})})};DY.displayName=D7;var xf="TooltipContent",PY=b.forwardRef((t,e)=>{const n=WRe(xf,t.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=t,a=Ag(xf,t.__scopeTooltip);return o.jsx(oi,{present:r||a.open,children:a.disableHoverableContent?o.jsx(zY,{side:s,...i,ref:e}):o.jsx(GRe,{side:s,...i,ref:e})})}),GRe=b.forwardRef((t,e)=>{const n=Ag(xf,t.__scopeTooltip),r=R7(xf,t.__scopeTooltip),s=b.useRef(null),i=er(e,s),[a,l]=b.useState(null),{trigger:c,onClose:d}=n,h=s.current,{onPointerInTransitChange:m}=r,g=b.useCallback(()=>{l(null),m(!1)},[m]),x=b.useCallback((y,w)=>{const S=y.currentTarget,k={x:y.clientX,y:y.clientY},j=JRe(k,S.getBoundingClientRect()),N=eDe(k,j),T=tDe(w.getBoundingClientRect()),E=rDe([...N,...T]);l(E),m(!0)},[m]);return b.useEffect(()=>()=>g(),[g]),b.useEffect(()=>{if(c&&h){const y=S=>x(S,h),w=S=>x(S,c);return c.addEventListener("pointerleave",y),h.addEventListener("pointerleave",w),()=>{c.removeEventListener("pointerleave",y),h.removeEventListener("pointerleave",w)}}},[c,h,x,g]),b.useEffect(()=>{if(a){const y=w=>{const S=w.target,k={x:w.clientX,y:w.clientY},j=c?.contains(S)||h?.contains(S),N=!nDe(k,a);j?g():N&&(g(),d())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[c,h,a,d,g]),o.jsx(zY,{...t,ref:i})}),[XRe,YRe]=cw(Mp,{isInside:!1}),KRe=$Re("TooltipContent"),zY=b.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:a,...l}=t,c=Ag(xf,n),d=uw(n),{onClose:h}=c;return b.useEffect(()=>(document.addEventListener(gj,h),()=>document.removeEventListener(gj,h)),[h]),b.useEffect(()=>{if(c.trigger){const m=g=>{g.target?.contains(c.trigger)&&h()};return window.addEventListener("scroll",m,{capture:!0}),()=>window.removeEventListener("scroll",m,{capture:!0})}},[c.trigger,h]),o.jsx(Rj,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:m=>m.preventDefault(),onDismiss:h,children:o.jsxs(Dj,{"data-state":c.stateAttribute,...d,...l,ref:e,style:{...l.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:[o.jsx(KRe,{children:r}),o.jsx(XRe,{scope:n,isInside:!0,children:o.jsx(Iee,{id:c.contentId,role:"tooltip",children:s||r})})]})})});PY.displayName=xf;var IY="TooltipArrow",ZRe=b.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=uw(n);return YRe(IY,n).isInside?null:o.jsx(Pj,{...s,...r,ref:e})});ZRe.displayName=IY;function JRe(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),s=Math.abs(e.right-t.x),i=Math.abs(e.left-t.x);switch(Math.min(n,r,s,i)){case i:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function eDe(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function tDe(t){const{top:e,right:n,bottom:r,left:s}=t;return[{x:s,y:e},{x:n,y:e},{x:n,y:r},{x:s,y:r}]}function nDe(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,a=e.length-1;i<e.length;a=i++){const l=e[i],c=e[a],d=l.x,h=l.y,m=c.x,g=c.y;h>r!=g>r&&n<(m-d)*(r-h)/(g-h)+d&&(s=!s)}return s}function rDe(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),sDe(e)}function sDe(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const s=t[r];for(;e.length>=2;){const i=e[e.length-1],a=e[e.length-2];if((i.x-a.x)*(s.y-a.y)>=(i.y-a.y)*(s.x-a.x))e.pop();else break}e.push(s)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const s=t[r];for(;n.length>=2;){const i=n[n.length-1],a=n[n.length-2];if((i.x-a.x)*(s.y-a.y)>=(i.y-a.y)*(s.x-a.x))n.pop();else break}n.push(s)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var iDe=AY,aDe=MY,oDe=RY,lDe=DY,LY=PY;const cDe=iDe,uDe=aDe,dDe=oDe,BY=b.forwardRef(({className:t,sideOffset:e=4,...n},r)=>o.jsx(lDe,{children:o.jsx(LY,{ref:r,sideOffset:e,className:xe("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]",t),...n})}));BY.displayName=LY.displayName;function hDe({children:t}){mie();const[e,n]=b.useState(!0),[r,s]=b.useState(!1),[i,a]=b.useState(!1),{theme:l,setTheme:c}=Kj(),d=wJ(),h=na();b.useEffect(()=>{const w=S=>{(S.metaKey||S.ctrlKey)&&S.key==="k"&&(S.preventDefault(),a(!0))};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[]);const m=[{title:"概览",items:[{icon:L0,label:"首页",path:"/"}]},{title:"麦麦配置编辑",items:[{icon:Po,label:"麦麦主程序配置",path:"/config/bot"},{icon:CI,label:"AI模型厂商配置",path:"/config/modelProvider",tourId:"sidebar-model-provider"},{icon:TI,label:"模型管理与分配",path:"/config/model",tourId:"sidebar-model-management"},{icon:E9,label:"麦麦适配器配置",path:"/config/adapter"}]},{title:"麦麦资源管理",items:[{icon:Ij,label:"表情包管理",path:"/resource/emoji"},{icon:Gh,label:"表达方式管理",path:"/resource/expression"},{icon:EI,label:"人物信息管理",path:"/resource/person"},{icon:NI,label:"知识库图谱可视化",path:"/resource/knowledge-graph"}]},{title:"扩展与监控",items:[{icon:ed,label:"插件市场",path:"/plugins"},{icon:E9,label:"插件配置",path:"/plugin-config"},{icon:Fv,label:"日志查看器",path:"/logs"},{icon:Gh,label:"本地聊天室",path:"/chat"}]},{title:"系统",items:[{icon:Vc,label:"系统设置",path:"/settings"}]}],x=l==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":l,y=()=>{localStorage.removeItem("access-token"),h({to:"/auth"})};return o.jsx(cDe,{delayDuration:300,children:o.jsxs("div",{className:"flex h-screen overflow-hidden",children:[o.jsxs("aside",{className:xe("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",e?"lg:w-64":"lg:w-16",r?"translate-x-0":"-translate-x-full lg:translate-x-0"),children:[o.jsx("div",{className:"flex h-16 items-center border-b px-4",children:o.jsxs("div",{className:xe("relative flex items-center justify-center flex-1 transition-all overflow-hidden","lg:flex-1",!e&&"lg:flex-none lg:w-8"),children:[o.jsxs("div",{className:xe("flex items-baseline gap-2",!e&&"lg:hidden"),children:[o.jsx("span",{className:"font-bold text-xl text-primary-gradient whitespace-nowrap",children:"MaiBot WebUI"}),o.jsx("span",{className:"text-xs text-primary/60 whitespace-nowrap",children:Qse()})]}),!e&&o.jsx("span",{className:"hidden lg:block font-bold text-primary-gradient text-2xl",children:"M"})]})}),o.jsx(pn,{className:xe("flex-1 overflow-x-hidden",!e&&"lg:w-16"),children:o.jsx("nav",{className:xe("p-4",!e&&"lg:p-2 lg:w-16"),children:o.jsx("ul",{className:xe("space-y-6",!e&&"lg:space-y-3 lg:w-full"),children:m.map((w,S)=>o.jsxs("li",{children:[o.jsx("div",{className:xe("px-3 h-[1.25rem]","mb-2",!e&&"lg:mb-1 lg:invisible"),children:o.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground/60 whitespace-nowrap",children:w.title})}),!e&&S>0&&o.jsx("div",{className:"hidden lg:block mb-2 border-t border-border"}),o.jsx("ul",{className:"space-y-1",children:w.items.map(k=>{const j=d({to:k.path}),N=k.icon,T=o.jsxs(o.Fragment,{children:[j&&o.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"}),o.jsxs("div",{className:xe("flex items-center transition-all duration-300",e?"gap-3":"gap-3 lg:gap-0"),children:[o.jsx(N,{className:xe("h-5 w-5 flex-shrink-0",j&&"text-primary"),strokeWidth:2,fill:"none"}),o.jsx("span",{className:xe("text-sm font-medium whitespace-nowrap transition-all duration-300",j&&"font-semibold",e?"opacity-100 max-w-[200px]":"opacity-100 max-w-[200px] lg:opacity-0 lg:max-w-0 lg:overflow-hidden"),children:k.label})]})]});return o.jsx("li",{className:"relative",children:o.jsxs(uDe,{children:[o.jsx(dDe,{asChild:!0,children:o.jsx(rv,{to:k.path,"data-tour":k.tourId,className:xe("relative flex items-center rounded-lg py-2 transition-all duration-300","hover:bg-accent hover:text-accent-foreground",j?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground",e?"px-3":"px-3 lg:px-0 lg:justify-center lg:w-12 lg:mx-auto"),onClick:()=>s(!1),children:T})}),!e&&o.jsx(BY,{side:"right",className:"hidden lg:block",children:o.jsx("p",{children:k.label})})]})},k.path)})})]},w.title))})})})]}),r&&o.jsx("div",{className:"fixed inset-0 z-40 bg-black/50 lg:hidden",onClick:()=>s(!1)}),o.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[o.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:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("button",{onClick:()=>s(!r),className:"rounded-lg p-2 hover:bg-accent lg:hidden",children:o.jsx(fte,{className:"h-5 w-5"})}),o.jsx("button",{onClick:()=>n(!e),className:"hidden rounded-lg p-2 hover:bg-accent lg:block",title:e?"收起侧边栏":"展开侧边栏",children:o.jsx(wd,{className:xe("h-5 w-5 transition-transform",!e&&"rotate-180")})})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("button",{onClick:()=>a(!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:[o.jsx(ii,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),o.jsx("span",{className:"text-sm text-muted-foreground",children:"搜索..."}),o.jsxs(EX,{size:"sm",className:"absolute right-2 top-1/2 -translate-y-1/2",children:[o.jsx("span",{className:"text-xs",children:"⌘"}),"K"]})]}),o.jsx(vMe,{open:i,onOpenChange:a}),o.jsxs(ue,{variant:"ghost",size:"sm",onClick:()=>window.open("https://docs.mai-mai.org","_blank"),className:"gap-2",title:"查看麦麦文档",children:[o.jsx(mte,{className:"h-4 w-4"}),o.jsx("span",{className:"hidden sm:inline",children:"麦麦文档"})]}),o.jsx("button",{onClick:w=>{Dse(x==="dark"?"light":"dark",c,w)},className:"rounded-lg p-2 hover:bg-accent",title:x==="dark"?"切换到浅色模式":"切换到深色模式",children:x==="dark"?o.jsx(ik,{className:"h-5 w-5"}):o.jsx(ak,{className:"h-5 w-5"})}),o.jsx("div",{className:"h-6 w-px bg-border"}),o.jsxs(ue,{variant:"ghost",size:"sm",onClick:y,className:"gap-2",title:"登出系统",children:[o.jsx(_9,{className:"h-4 w-4"}),o.jsx("span",{className:"hidden sm:inline",children:"登出"})]})]})]}),o.jsxs(PRe,{children:[o.jsx(zRe,{asChild:!0,children:o.jsx("main",{className:"flex-1 overflow-hidden bg-background",children:t})}),o.jsxs(EY,{className:"w-64",children:[o.jsxs($a,{onClick:()=>h({to:"/"}),children:[o.jsx(L0,{className:"mr-2 h-4 w-4"}),"首页"]}),o.jsxs($a,{onClick:()=>h({to:"/settings"}),children:[o.jsx(Vc,{className:"mr-2 h-4 w-4"}),"系统设置"]}),o.jsxs($a,{onClick:()=>h({to:"/logs"}),children:[o.jsx(Fv,{className:"mr-2 h-4 w-4"}),"日志查看器"]}),o.jsx(b0,{}),o.jsxs(IRe,{children:[o.jsxs(CY,{children:[o.jsx(kI,{className:"mr-2 h-4 w-4"}),"切换主题"]}),o.jsxs(TY,{className:"w-48",children:[o.jsxs($a,{onClick:()=>c("light"),disabled:l==="light",children:[o.jsx(ik,{className:"mr-2 h-4 w-4"}),"浅色",l==="light"&&o.jsx(Ch,{children:"✓"})]}),o.jsxs($a,{onClick:()=>c("dark"),disabled:l==="dark",children:[o.jsx(ak,{className:"mr-2 h-4 w-4"}),"深色",l==="dark"&&o.jsx(Ch,{children:"✓"})]}),o.jsxs($a,{onClick:()=>c("system"),disabled:l==="system",children:[o.jsx(Vc,{className:"mr-2 h-4 w-4"}),"跟随系统",l==="system"&&o.jsx(Ch,{children:"✓"})]})]})]}),o.jsx(b0,{}),o.jsxs($a,{onClick:()=>window.location.reload(),children:[o.jsx(pte,{className:"mr-2 h-4 w-4"}),"刷新页面",o.jsx(Ch,{children:"⌘R"})]}),o.jsxs($a,{onClick:()=>a(!0),children:[o.jsx(ii,{className:"mr-2 h-4 w-4"}),"搜索",o.jsx(Ch,{children:"⌘K"})]}),o.jsx(b0,{}),o.jsxs($a,{onClick:()=>window.open("https://docs.mai-mai.org","_blank"),children:[o.jsx(w0,{className:"mr-2 h-4 w-4"}),"麦麦文档"]}),o.jsx(b0,{}),o.jsxs($a,{onClick:y,className:"text-destructive focus:text-destructive",children:[o.jsx(_9,{className:"mr-2 h-4 w-4"}),"登出系统"]})]})]})]})]})})}function fDe(t){const e=t.split(`
|
||
`).slice(1),n=[];for(const r of e){const s=r.trim();if(!s.startsWith("at "))continue;const i=s.match(/at\s+(?:(.+?)\s+\()?(.+?):(\d+):(\d+)\)?$/);i?n.push({functionName:i[1]||"<anonymous>",fileName:i[2],lineNumber:i[3],columnNumber:i[4],raw:s}):n.push({functionName:"<unknown>",fileName:"",lineNumber:"",columnNumber:"",raw:s})}return n}function mDe({error:t,errorInfo:e}){const[n,r]=b.useState(!0),[s,i]=b.useState(!1),[a,l]=b.useState(!1),c=t.stack?fDe(t.stack):[],d=async()=>{const h=`
|
||
Error: ${t.name}
|
||
Message: ${t.message}
|
||
|
||
Stack Trace:
|
||
${t.stack||"No stack trace available"}
|
||
|
||
Component Stack:
|
||
${e?.componentStack||"No component stack available"}
|
||
|
||
URL: ${window.location.href}
|
||
User Agent: ${navigator.userAgent}
|
||
Time: ${new Date().toISOString()}
|
||
`.trim();try{await navigator.clipboard.writeText(h),l(!0),setTimeout(()=>l(!1),2e3)}catch(m){console.error("Failed to copy:",m)}};return o.jsxs("div",{className:"space-y-4",children:[o.jsxs(ba,{variant:"destructive",className:"border-red-500/50 bg-red-500/10",children:[o.jsx(Ga,{className:"h-4 w-4"}),o.jsxs(wa,{className:"font-mono text-sm",children:[o.jsxs("span",{className:"font-semibold",children:[t.name,":"]})," ",t.message]})]}),c.length>0&&o.jsxs(hj,{open:n,onOpenChange:r,children:[o.jsx(fj,{asChild:!0,children:o.jsxs(ue,{variant:"ghost",className:"w-full justify-between p-3 h-auto",children:[o.jsxs("span",{className:"font-semibold text-sm flex items-center gap-2",children:[o.jsx(gte,{className:"h-4 w-4"}),"Stack Trace (",c.length," frames)"]}),n?o.jsx(B0,{className:"h-4 w-4"}):o.jsx(Xc,{className:"h-4 w-4"})]})}),o.jsx(mj,{children:o.jsx(pn,{className:"h-[280px] rounded-md border bg-muted/30",children:o.jsx("div",{className:"p-3 space-y-1",children:c.map((h,m)=>o.jsx("div",{className:"font-mono text-xs p-2 rounded hover:bg-muted/50 transition-colors",children:o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsxs("span",{className:"text-muted-foreground w-6 text-right flex-shrink-0",children:[m+1,"."]}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("span",{className:"text-primary font-medium",children:h.functionName}),h.fileName&&o.jsxs("div",{className:"text-muted-foreground mt-0.5 break-all",children:[h.fileName,h.lineNumber&&o.jsxs("span",{className:"text-yellow-600 dark:text-yellow-400",children:[":",h.lineNumber,":",h.columnNumber]})]})]})]})},m))})})})]}),e?.componentStack&&o.jsxs(hj,{open:s,onOpenChange:i,children:[o.jsx(fj,{asChild:!0,children:o.jsxs(ue,{variant:"ghost",className:"w-full justify-between p-3 h-auto",children:[o.jsxs("span",{className:"font-semibold text-sm flex items-center gap-2",children:[o.jsx(Ga,{className:"h-4 w-4"}),"Component Stack"]}),s?o.jsx(B0,{className:"h-4 w-4"}):o.jsx(Xc,{className:"h-4 w-4"})]})}),o.jsx(mj,{children:o.jsx(pn,{className:"h-[200px] rounded-md border bg-muted/30",children:o.jsx("pre",{className:"p-3 font-mono text-xs whitespace-pre-wrap text-muted-foreground",children:e.componentStack})})})]}),o.jsx(ue,{variant:"outline",size:"sm",onClick:d,className:"w-full",children:a?o.jsxs(o.Fragment,{children:[o.jsx(zo,{className:"mr-2 h-4 w-4 text-green-500"}),"已复制到剪贴板"]}):o.jsxs(o.Fragment,{children:[o.jsx(Iv,{className:"mr-2 h-4 w-4"}),"复制错误信息"]})})]})}function FY({error:t,errorInfo:e}){const n=()=>{window.location.href="/"},r=()=>{window.location.reload()};return o.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-4",children:o.jsxs(Lt,{className:"w-full max-w-2xl shadow-lg",children:[o.jsxs(En,{className:"text-center pb-2",children:[o.jsx("div",{className:"mx-auto flex h-16 w-16 items-center justify-center rounded-full bg-red-100 dark:bg-red-900/30 mb-4",children:o.jsx(Ga,{className:"h-8 w-8 text-red-600 dark:text-red-400"})}),o.jsx(_n,{className:"text-2xl font-bold",children:"页面出现了问题"}),o.jsx(Wr,{className:"text-base mt-2",children:"应用程序遇到了意外错误。您可以尝试刷新页面或返回首页。"})]}),o.jsxs(Xn,{className:"space-y-4",children:[o.jsx(mDe,{error:t,errorInfo:e}),o.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 pt-2",children:[o.jsxs(ue,{onClick:r,className:"flex-1",children:[o.jsx(Qs,{className:"mr-2 h-4 w-4"}),"刷新页面"]}),o.jsxs(ue,{onClick:n,variant:"outline",className:"flex-1",children:[o.jsx(L0,{className:"mr-2 h-4 w-4"}),"返回首页"]})]}),o.jsx("p",{className:"text-xs text-center text-muted-foreground pt-2",children:"如果问题持续存在,请将错误信息复制并反馈给开发者"})]})]})})}class pDe extends b.Component{constructor(e){super(e),this.state={hasError:!1,error:null,errorInfo:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,n){console.error("ErrorBoundary caught an error:",e,n),this.setState({errorInfo:n})}handleReset=()=>{this.setState({hasError:!1,error:null,errorInfo:null})};render(){return this.state.hasError&&this.state.error?this.props.fallback?this.props.fallback:o.jsx(FY,{error:this.state.error,errorInfo:this.state.errorInfo}):this.props.children}}function qY({error:t}){return o.jsx(FY,{error:t,errorInfo:null})}const Mg=SJ({component:()=>o.jsxs(o.Fragment,{children:[o.jsx(Hz,{}),!1]}),beforeLoad:()=>{if(window.location.pathname==="/"&&!AB())throw OJ({to:"/auth"})}}),gDe=ps({getParentRoute:()=>Mg,path:"/auth",component:pie}),xDe=ps({getParentRoute:()=>Mg,path:"/setup",component:Iie}),Ys=ps({getParentRoute:()=>Mg,id:"protected",component:()=>o.jsx(hDe,{children:o.jsx(Hz,{})}),errorComponent:({error:t})=>o.jsx(qY,{error:t})}),vDe=ps({getParentRoute:()=>Ys,path:"/",component:Mse}),yDe=ps({getParentRoute:()=>Ys,path:"/config/bot",component:z0e}),bDe=ps({getParentRoute:()=>Ys,path:"/config/modelProvider",component:n1e}),wDe=ps({getParentRoute:()=>Ys,path:"/config/model",component:Wve}),SDe=ps({getParentRoute:()=>Ys,path:"/config/adapter",component:Xve}),kDe=ps({getParentRoute:()=>Ys,path:"/resource/emoji",component:yOe}),ODe=ps({getParentRoute:()=>Ys,path:"/resource/expression",component:_Oe}),jDe=ps({getParentRoute:()=>Ys,path:"/resource/person",component:qOe}),NDe=ps({getParentRoute:()=>Ys,path:"/resource/knowledge-graph",component:ATe}),CDe=ps({getParentRoute:()=>Ys,path:"/logs",component:SAe}),TDe=ps({getParentRoute:()=>Ys,path:"/chat",component:pMe}),EDe=ps({getParentRoute:()=>Ys,path:"/plugins",component:UAe}),_De=ps({getParentRoute:()=>Ys,path:"/plugin-config",component:JAe}),ADe=ps({getParentRoute:()=>Ys,path:"/plugin-mirrors",component:eMe}),MDe=ps({getParentRoute:()=>Ys,path:"/settings",component:oie}),RDe=ps({getParentRoute:()=>Mg,path:"*",component:DB}),DDe=Mg.addChildren([gDe,xDe,Ys.addChildren([vDe,yDe,bDe,wDe,SDe,kDe,ODe,jDe,NDe,EDe,_De,ADe,CDe,TDe,MDe]),RDe]),PDe=kJ({routeTree:DDe,defaultNotFoundComponent:DB,defaultErrorComponent:({error:t})=>o.jsx(qY,{error:t})});function zDe({children:t,defaultTheme:e="system",storageKey:n="ui-theme",...r}){const[s,i]=b.useState(()=>localStorage.getItem(n)||e);b.useEffect(()=>{const l=window.document.documentElement;if(l.classList.remove("light","dark"),s==="system"){const c=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";l.classList.add(c);return}l.classList.add(s)},[s]),b.useEffect(()=>{const l=localStorage.getItem("accent-color");if(l){const c=document.documentElement,h={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%)"}}[l];h&&(c.style.setProperty("--primary",h.hsl),h.gradient?(c.style.setProperty("--primary-gradient",h.gradient),c.classList.add("has-gradient")):(c.style.removeProperty("--primary-gradient"),c.classList.remove("has-gradient")))}},[]);const a={theme:s,setTheme:l=>{localStorage.setItem(n,l),i(l)}};return o.jsx(tB.Provider,{...r,value:a,children:t})}function IDe({children:t,defaultEnabled:e=!0,defaultWavesEnabled:n=!0,storageKey:r="enable-animations",wavesStorageKey:s="enable-waves-background"}){const[i,a]=b.useState(()=>{const h=localStorage.getItem(r);return h!==null?h==="true":e}),[l,c]=b.useState(()=>{const h=localStorage.getItem(s);return h!==null?h==="true":n});b.useEffect(()=>{const h=document.documentElement;i?h.classList.remove("no-animations"):h.classList.add("no-animations"),localStorage.setItem(r,String(i))},[i,r]),b.useEffect(()=>{localStorage.setItem(s,String(l))},[l,s]);const d={enableAnimations:i,setEnableAnimations:a,enableWavesBackground:l,setEnableWavesBackground:c};return o.jsx(nB.Provider,{value:d,children:t})}var P7="ToastProvider",[z7,LDe,BDe]=Qy("Toast"),[$Y]=Da("Toast",[BDe]),[FDe,dw]=$Y(P7),HY=t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:s="right",swipeThreshold:i=50,children:a}=t,[l,c]=b.useState(null),[d,h]=b.useState(0),m=b.useRef(!1),g=b.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${P7}\`. Expected non-empty \`string\`.`),o.jsx(z7.Provider,{scope:e,children:o.jsx(FDe,{scope:e,label:n,duration:r,swipeDirection:s,swipeThreshold:i,toastCount:d,viewport:l,onViewportChange:c,onToastAdd:b.useCallback(()=>h(x=>x+1),[]),onToastRemove:b.useCallback(()=>h(x=>x-1),[]),isFocusedToastEscapeKeyDownRef:m,isClosePausedRef:g,children:a})})};HY.displayName=P7;var QY="ToastViewport",qDe=["F8"],vj="toast.viewportPause",yj="toast.viewportResume",VY=b.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=qDe,label:s="Notifications ({hotkey})",...i}=t,a=dw(QY,n),l=LDe(n),c=b.useRef(null),d=b.useRef(null),h=b.useRef(null),m=b.useRef(null),g=er(e,m,a.onViewportChange),x=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),y=a.toastCount>0;b.useEffect(()=>{const S=k=>{r.length!==0&&r.every(N=>k[N]||k.code===N)&&m.current?.focus()};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[r]),b.useEffect(()=>{const S=c.current,k=m.current;if(y&&S&&k){const j=()=>{if(!a.isClosePausedRef.current){const _=new CustomEvent(vj);k.dispatchEvent(_),a.isClosePausedRef.current=!0}},N=()=>{if(a.isClosePausedRef.current){const _=new CustomEvent(yj);k.dispatchEvent(_),a.isClosePausedRef.current=!1}},T=_=>{!S.contains(_.relatedTarget)&&N()},E=()=>{S.contains(document.activeElement)||N()};return S.addEventListener("focusin",j),S.addEventListener("focusout",T),S.addEventListener("pointermove",j),S.addEventListener("pointerleave",E),window.addEventListener("blur",j),window.addEventListener("focus",N),()=>{S.removeEventListener("focusin",j),S.removeEventListener("focusout",T),S.removeEventListener("pointermove",j),S.removeEventListener("pointerleave",E),window.removeEventListener("blur",j),window.removeEventListener("focus",N)}}},[y,a.isClosePausedRef]);const w=b.useCallback(({tabbingDirection:S})=>{const j=l().map(N=>{const T=N.ref.current,E=[T,...ePe(T)];return S==="forwards"?E:E.reverse()});return(S==="forwards"?j.reverse():j).flat()},[l]);return b.useEffect(()=>{const S=m.current;if(S){const k=j=>{const N=j.altKey||j.ctrlKey||j.metaKey;if(j.key==="Tab"&&!N){const E=document.activeElement,_=j.shiftKey;if(j.target===S&&_){d.current?.focus();return}const q=w({tabbingDirection:_?"backwards":"forwards"}),B=q.findIndex(H=>H===E);rk(q.slice(B+1))?j.preventDefault():_?d.current?.focus():h.current?.focus()}};return S.addEventListener("keydown",k),()=>S.removeEventListener("keydown",k)}},[l,w]),o.jsxs(Lee,{ref:c,role:"region","aria-label":s.replace("{hotkey}",x),tabIndex:-1,style:{pointerEvents:y?void 0:"none"},children:[y&&o.jsx(bj,{ref:d,onFocusFromOutsideViewport:()=>{const S=w({tabbingDirection:"forwards"});rk(S)}}),o.jsx(z7.Slot,{scope:n,children:o.jsx(Sn.ol,{tabIndex:-1,...i,ref:g})}),y&&o.jsx(bj,{ref:h,onFocusFromOutsideViewport:()=>{const S=w({tabbingDirection:"backwards"});rk(S)}})]})});VY.displayName=QY;var UY="ToastFocusProxy",bj=b.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...s}=t,i=dw(UY,n);return o.jsx(SI,{tabIndex:0,...s,ref:e,style:{position:"fixed"},onFocus:a=>{const l=a.relatedTarget;!i.viewport?.contains(l)&&r()}})});bj.displayName=UY;var Rg="Toast",$De="toast.swipeStart",HDe="toast.swipeMove",QDe="toast.swipeCancel",VDe="toast.swipeEnd",WY=b.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:s,onOpenChange:i,...a}=t,[l,c]=Kl({prop:r,defaultProp:s??!0,onChange:i,caller:Rg});return o.jsx(oi,{present:n||l,children:o.jsx(GDe,{open:l,...a,ref:e,onClose:()=>c(!1),onPause:Rs(t.onPause),onResume:Rs(t.onResume),onSwipeStart:nt(t.onSwipeStart,d=>{d.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:nt(t.onSwipeMove,d=>{const{x:h,y:m}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","move"),d.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${h}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${m}px`)}),onSwipeCancel:nt(t.onSwipeCancel,d=>{d.currentTarget.setAttribute("data-swipe","cancel"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:nt(t.onSwipeEnd,d=>{const{x:h,y:m}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","end"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${h}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${m}px`),c(!1)})})})});WY.displayName=Rg;var[UDe,WDe]=$Y(Rg,{onClose(){}}),GDe=b.forwardRef((t,e)=>{const{__scopeToast:n,type:r="foreground",duration:s,open:i,onClose:a,onEscapeKeyDown:l,onPause:c,onResume:d,onSwipeStart:h,onSwipeMove:m,onSwipeCancel:g,onSwipeEnd:x,...y}=t,w=dw(Rg,n),[S,k]=b.useState(null),j=er(e,I=>k(I)),N=b.useRef(null),T=b.useRef(null),E=s||w.duration,_=b.useRef(0),A=b.useRef(E),D=b.useRef(0),{onToastAdd:q,onToastRemove:B}=w,H=Rs(()=>{S?.contains(document.activeElement)&&w.viewport?.focus(),a()}),W=b.useCallback(I=>{!I||I===1/0||(window.clearTimeout(D.current),_.current=new Date().getTime(),D.current=window.setTimeout(H,I))},[H]);b.useEffect(()=>{const I=w.viewport;if(I){const V=()=>{W(A.current),d?.()},L=()=>{const $=new Date().getTime()-_.current;A.current=A.current-$,window.clearTimeout(D.current),c?.()};return I.addEventListener(vj,L),I.addEventListener(yj,V),()=>{I.removeEventListener(vj,L),I.removeEventListener(yj,V)}}},[w.viewport,E,c,d,W]),b.useEffect(()=>{i&&!w.isClosePausedRef.current&&W(E)},[i,E,w.isClosePausedRef,W]),b.useEffect(()=>(q(),()=>B()),[q,B]);const ee=b.useMemo(()=>S?eK(S):null,[S]);return w.viewport?o.jsxs(o.Fragment,{children:[ee&&o.jsx(XDe,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:ee}),o.jsx(UDe,{scope:n,onClose:H,children:ya.createPortal(o.jsx(z7.ItemSlot,{scope:n,children:o.jsx(Bee,{asChild:!0,onEscapeKeyDown:nt(l,()=>{w.isFocusedToastEscapeKeyDownRef.current||H(),w.isFocusedToastEscapeKeyDownRef.current=!1}),children:o.jsx(Sn.li,{tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":w.swipeDirection,...y,ref:j,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:nt(t.onKeyDown,I=>{I.key==="Escape"&&(l?.(I.nativeEvent),I.nativeEvent.defaultPrevented||(w.isFocusedToastEscapeKeyDownRef.current=!0,H()))}),onPointerDown:nt(t.onPointerDown,I=>{I.button===0&&(N.current={x:I.clientX,y:I.clientY})}),onPointerMove:nt(t.onPointerMove,I=>{if(!N.current)return;const V=I.clientX-N.current.x,L=I.clientY-N.current.y,$=!!T.current,K=["left","right"].includes(w.swipeDirection),Y=["left","up"].includes(w.swipeDirection)?Math.min:Math.max,R=K?Y(0,V):0,ie=K?0:Y(0,L),X=I.pointerType==="touch"?10:2,z={x:R,y:ie},U={originalEvent:I,delta:z};$?(T.current=z,nv(HDe,m,U,{discrete:!1})):$z(z,w.swipeDirection,X)?(T.current=z,nv($De,h,U,{discrete:!1}),I.target.setPointerCapture(I.pointerId)):(Math.abs(V)>X||Math.abs(L)>X)&&(N.current=null)}),onPointerUp:nt(t.onPointerUp,I=>{const V=T.current,L=I.target;if(L.hasPointerCapture(I.pointerId)&&L.releasePointerCapture(I.pointerId),T.current=null,N.current=null,V){const $=I.currentTarget,K={originalEvent:I,delta:V};$z(V,w.swipeDirection,w.swipeThreshold)?nv(VDe,x,K,{discrete:!0}):nv(QDe,g,K,{discrete:!0}),$.addEventListener("click",Y=>Y.preventDefault(),{once:!0})}})})})}),w.viewport)})]}):null}),XDe=t=>{const{__scopeToast:e,children:n,...r}=t,s=dw(Rg,e),[i,a]=b.useState(!1),[l,c]=b.useState(!1);return ZDe(()=>a(!0)),b.useEffect(()=>{const d=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(d)},[]),l?null:o.jsx(Xy,{asChild:!0,children:o.jsx(SI,{...r,children:i&&o.jsxs(o.Fragment,{children:[s.label," ",n]})})})},YDe="ToastTitle",GY=b.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return o.jsx(Sn.div,{...r,ref:e})});GY.displayName=YDe;var KDe="ToastDescription",XY=b.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return o.jsx(Sn.div,{...r,ref:e})});XY.displayName=KDe;var YY="ToastAction",KY=b.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?o.jsx(JY,{altText:n,asChild:!0,children:o.jsx(I7,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${YY}\`. Expected non-empty \`string\`.`),null)});KY.displayName=YY;var ZY="ToastClose",I7=b.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,s=WDe(ZY,n);return o.jsx(JY,{asChild:!0,children:o.jsx(Sn.button,{type:"button",...r,ref:e,onClick:nt(t.onClick,s.onClose)})})});I7.displayName=ZY;var JY=b.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...s}=t;return o.jsx(Sn.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:e})});function eK(t){const e=[];return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),JDe(r)){const s=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!s)if(i){const a=r.dataset.radixToastAnnounceAlt;a&&e.push(a)}else e.push(...eK(r))}}),e}function nv(t,e,n,{discrete:r}){const s=n.originalEvent.currentTarget,i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),r?wI(s,i):s.dispatchEvent(i)}var $z=(t,e,n=0)=>{const r=Math.abs(t.x),s=Math.abs(t.y),i=r>s;return e==="left"||e==="right"?i&&r>n:!i&&s>n};function ZDe(t=()=>{}){const e=Rs(t);Wh(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[e])}function JDe(t){return t.nodeType===t.ELEMENT_NODE}function ePe(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function rk(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var tPe=HY,tK=VY,nK=WY,rK=GY,sK=XY,iK=KY,aK=I7;const nPe=tPe,oK=b.forwardRef(({className:t,...e},n)=>o.jsx(tK,{ref:n,className:xe("fixed bottom-0 right-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:max-w-[420px] gap-2",t),...e}));oK.displayName=tK.displayName;const rPe=kf("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-slide-in-from-right data-[state=open]:animate-fade-in data-[state=closed]:animate-slide-out-to-right data-[state=closed]:animate-fade-out data-[swipe=end]:animate-slide-out-to-right",{variants:{variant:{default:"border bg-primary/5 text-foreground backdrop-blur-sm",destructive:"destructive group border-destructive bg-destructive/10 text-destructive-foreground backdrop-blur-sm"}},defaultVariants:{variant:"default"}}),lK=b.forwardRef(({className:t,variant:e,...n},r)=>o.jsx(nK,{ref:r,className:xe(rPe({variant:e}),t),...n}));lK.displayName=nK.displayName;const sPe=b.forwardRef(({className:t,...e},n)=>o.jsx(iK,{ref:n,className:xe("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",t),...e}));sPe.displayName=iK.displayName;const cK=b.forwardRef(({className:t,...e},n)=>o.jsx(aK,{ref:n,className:xe("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",t),"toast-close":"",...e,children:o.jsx(Pp,{className:"h-4 w-4"})}));cK.displayName=aK.displayName;const uK=b.forwardRef(({className:t,...e},n)=>o.jsx(rK,{ref:n,className:xe("text-sm font-semibold [&+div]:text-xs",t),...e}));uK.displayName=rK.displayName;const dK=b.forwardRef(({className:t,...e},n)=>o.jsx(sK,{ref:n,className:xe("text-sm opacity-90",t),...e}));dK.displayName=sK.displayName;function iPe(){const{toasts:t}=Lr();return o.jsxs(nPe,{children:[t.map(function({id:e,title:n,description:r,action:s,...i}){return o.jsxs(lK,{...i,children:[o.jsxs("div",{className:"grid gap-1",children:[n&&o.jsx(uK,{children:n}),r&&o.jsx(dK,{children:r})]}),s,o.jsx(cK,{})]},e)}),o.jsx(oK,{})]})}wte.createRoot(document.getElementById("root")).render(o.jsx(b.StrictMode,{children:o.jsx(pDe,{children:o.jsx(zDe,{defaultTheme:"system",children:o.jsx(IDe,{children:o.jsxs(Npe,{children:[o.jsx(jJ,{router:PDe}),o.jsx(e1e,{}),o.jsx(iPe,{})]})})})})}));
|