@deepseekcode/cli 1.0.37 → 1.0.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -1
- package/package.json +9 -9
- package/web/dist/assets/AssistantsView-Bh6ajWIo.js +1 -0
- package/web/dist/assets/AutomationView-D2Z-_4qe.js +1 -0
- package/web/dist/assets/{ChannelConfigView-JDljUn42.js → ChannelConfigView-DlakOI5z.js} +5 -5
- package/web/dist/assets/ConnectorsView-ELXDmM9m.js +1 -0
- package/web/dist/assets/FileTreeView-Ciq1vhTf.js +11 -0
- package/web/dist/assets/HookConfigView-DR8TP3QG.js +1 -0
- package/web/dist/assets/ModelsView-BW6eRUwf.js +1 -0
- package/web/dist/assets/PluginsView-CrHGk_JC.js +1 -0
- package/web/dist/assets/SessionGrid-DYYsm2dT.js +52 -0
- package/web/dist/assets/SettingsModal-DNxIKsKC.js +10 -0
- package/web/dist/assets/SkillsView-DS0nnKig.js +1 -0
- package/web/dist/assets/TemplatesTab-pXElHCnz.js +1 -0
- package/web/dist/assets/{ThreeScene-CMqkpyKO.js → ThreeScene-DFL_qzB1.js} +1 -1
- package/web/dist/assets/ToolsView-Bk4hckku.js +1 -0
- package/web/dist/assets/{icons-f1hlMKvD.js → icons-YJcunJnw.js} +195 -140
- package/web/dist/assets/index-CtPliI0f.css +1 -0
- package/web/dist/assets/index-D1N4vQ9I.js +591 -0
- package/web/dist/assets/{markdown-DEtuzEyz.js → markdown-CrVimah5.js} +1 -1
- package/web/dist/assets/{panels-Bn-2wCur.js → panels-BykQW6E1.js} +1 -1
- package/web/dist/assets/{react-vendor-ClBKp0t-.js → react-vendor-DM-M1fu_.js} +1 -1
- package/web/dist/assets/{state-xD58vmym.js → state-D8omNTWe.js} +1 -1
- package/web/dist/assets/sttLanguages-D4JbRJc6.js +1 -0
- package/web/dist/index.html +7 -7
- package/web/dist/assets/AssistantsView-OMdgsTIj.js +0 -1
- package/web/dist/assets/AutomationView-BPwjLbkL.js +0 -1
- package/web/dist/assets/ConnectorsView-AemNT1Ae.js +0 -1
- package/web/dist/assets/FileTreeView-DYx-0jFV.js +0 -11
- package/web/dist/assets/HookConfigView-CS1QqgPx.js +0 -1
- package/web/dist/assets/ModelsView-B3nHezvJ.js +0 -1
- package/web/dist/assets/PluginsView-C4Xc70ec.js +0 -1
- package/web/dist/assets/SessionGrid-C9-LeJH0.js +0 -47
- package/web/dist/assets/SettingsModal-CjWT1C66.js +0 -4
- package/web/dist/assets/SkillsView-DTZyXald.js +0 -1
- package/web/dist/assets/TemplatesTab-CE-CfCf2.js +0 -1
- package/web/dist/assets/ToolsView-CrEHDTEO.js +0 -1
- package/web/dist/assets/index-BCHbHIbw.css +0 -1
- package/web/dist/assets/index-u1vYyqna.js +0 -592
- package/web/dist/assets/sttLanguages-BNRptAQA.js +0 -1
|
@@ -0,0 +1,591 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-DA-rfuFy.js","assets/html-pp8916En.js","assets/javascript-wDzz0qaB.js","assets/css-CLj8gQPS.js","assets/angular-ts-BrjP3tb8.js","assets/scss-D5BDwBP9.js","assets/apl-CORt7UWP.js","assets/xml-sdJ4AIDG.js","assets/java-CylS5w8V.js","assets/json-Cp-IABpG.js","assets/astro-HNnZUWAn.js","assets/typescript-BPQ3VLAy.js","assets/postcss-CXtECtnM.js","assets/tsx-COt5Ahok.js","assets/blade-2xfisSek.js","assets/html-derivative-DlHx6ybY.js","assets/sql-CRqJ_cUM.js","assets/bsl-DlhNcFeZ.js","assets/sdbl-DVxCFoDh.js","assets/cairo-KRGpt6FW.js","assets/python-B6aJPvgy.js","assets/chapel-DTp_pixX.js","assets/c-BIGW1oBm.js","assets/cobol-nBiQ_Alo.js","assets/coffee-Ch7k5sss.js","assets/cpp-BMRokrvK.js","assets/regexp-CDVJQ6XC.js","assets/glsl-DplSGwfg.js","assets/crystal-DGywbUpC.js","assets/shellscript-Yzrsuije.js","assets/edge-FbVlp4U3.js","assets/elixir-CkH2-t6x.js","assets/elm-DbKCFpqz.js","assets/erb-DXfck5VN.js","assets/ruby-C0TQ7zu5.js","assets/haml-D5jkg6IW.js","assets/graphql-ChdNCCLP.js","assets/jsx-g9-lgVsj.js","assets/lua-BaeVxFsk.js","assets/yaml-Buea-lGh.js","assets/erlang-DsQrWhSR.js","assets/markdown-Cvjx9yec.js","assets/fortran-fixed-form-CkoXwp7k.js","assets/fortran-free-form-BxgE0vQu.js","assets/fsharp-CXgrBDvD.js","assets/gdresource-TyuKm33G.js","assets/gdshader-DkwncUOv.js","assets/gdscript-DqcFQ5yU.js","assets/git-commit-F4YmCXRG.js","assets/diff-D97Zzqfu.js","assets/git-rebase-r7XF79zn.js","assets/glimmer-js-ByusRIyA.js","assets/glimmer-ts-BfAWNZQY.js","assets/hack-BWmVpMyf.js","assets/handlebars-BpdQsYii.js","assets/http-jrhK8wxY.js","assets/hurl-irOxFIW8.js","assets/csv-fuZLfV_i.js","assets/hxml-2-FPmUDs.js","assets/haxe-CfZj7gIn.js","assets/jinja-f2NsQr07.js","assets/jison-wvAkD_A8.js","assets/julia-5Bft2YPA.js","assets/r-Cf5RLm7j.js","assets/just-Cwhn7H3k.js","assets/perl-B9cMNwum.js","assets/latex-D5pSuvFb.js","assets/tex-D96PA37w.js","assets/liquid-C0sCDyMI.js","assets/marko-DjSrsDqO.js","assets/less-B1dDrJ26.js","assets/mdc-D1_yUvq7.js","assets/nextflow-C-mBbutL.js","assets/nextflow-groovy-vE_lwT2v.js","assets/nginx-BpAMiNFr.js","assets/nim-BIad80T-.js","assets/org-DM6o9KBp.js","assets/ini-BEwlwnbL.js","assets/make-CHLpvVh8.js","assets/php-Csjmro_R.js","assets/vb-Cu-pLBUe.js","assets/clojure-P80f7IUj.js","assets/objective-c-DXmwc3jG.js","assets/docker-BcOcwvcX.js","assets/go-C27-OAKa.js","assets/groovy-gcz8RCvz.js","assets/raku-DXvB9xmW.js","assets/rust-B1yitclQ.js","assets/scala-CqE71os6.js","assets/csharp-DSvCPggb.js","assets/dart-bE4Kk8sk.js","assets/ocaml-C0hk2d4L.js","assets/zig-VOosw3JB.js","assets/xsl-CtQFsRM5.js","assets/pug-DKIMFp6K.js","assets/qml-3beO22l8.js","assets/razor-BjBPvh-w.js","assets/rst-bs7f0vWN.js","assets/cmake-D1j8_8rp.js","assets/sas-DEy46yEz.js","assets/shaderlab-Dg9Lc6iA.js","assets/hlsl-D3lLCCz7.js","assets/shellsession-BADoaaVG.js","assets/soy-8wufbnw4.js","assets/sparql-rVzFXLq3.js","assets/turtle-BsS91CYL.js","assets/stata-DI20mbqo.js","assets/surrealql-Cjom0U5J.js","assets/svelte-Cy7k_4gC.js","assets/templ-DhtptRzy.js","assets/ts-tags-D351s5mN.js","assets/twig-27uCiNez.js","assets/typst-BUadGCkm.js","assets/bat-CickPsom.js","assets/bibtex-CHM0blh-.js","assets/jsonc-Des-eS-w.js","assets/log-2UxHyX5q.js","assets/powershell-BmBUJMz7.js","assets/swift-C2oV4EkX.js","assets/verilog-nZwndyjY.js","assets/system-verilog-0hqHdDBg.js","assets/vue-BqiEGhQt.js","assets/vue-html-AaS7Mt5G.js","assets/vue-vine-BoDAl6tE.js","assets/stylus-BEDo0Tqx.js","assets/FileTreeView-Ciq1vhTf.js","assets/markdown-CrVimah5.js","assets/icons-YJcunJnw.js","assets/react-vendor-DM-M1fu_.js","assets/state-D8omNTWe.js","assets/panels-BykQW6E1.js","assets/ModelsView-BW6eRUwf.js","assets/ToolsView-Bk4hckku.js","assets/SkillsView-DS0nnKig.js","assets/TemplatesTab-pXElHCnz.js","assets/HookConfigView-DR8TP3QG.js","assets/SessionGrid-DYYsm2dT.js","assets/sttLanguages-D4JbRJc6.js","assets/SessionGrid-BGpz0-op.css","assets/SettingsModal-DNxIKsKC.js","assets/ChannelConfigView-DlakOI5z.js","assets/AssistantsView-Bh6ajWIo.js","assets/ConnectorsView-ELXDmM9m.js","assets/AutomationView-D2Z-_4qe.js","assets/PluginsView-CrHGk_JC.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var b8=Object.defineProperty;var v8=Object.getPrototypeOf;var x8=Reflect.get;var Ox=t=>{throw TypeError(t)};var w8=(t,e,n)=>e in t?b8(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var ne=(t,e,n)=>w8(t,typeof e!="symbol"?e+"":e,n),Zh=(t,e,n)=>e.has(t)||Ox("Cannot "+n);var ea=(t,e,n)=>(Zh(t,e,"read from private field"),n?n.call(t):e.get(t)),no=(t,e,n)=>e.has(t)?Ox("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),gr=(t,e,n,a)=>(Zh(t,e,"write to private field"),a?a.call(t,n):e.set(t,n),n),Xh=(t,e,n)=>(Zh(t,e,"access private method"),n);var Lx=(t,e,n)=>x8(v8(t),n,e);import{o as Oc,f as Zd,m as io,a as Dk,p as jx,b as Bx,n as Ix,h as Mk,s as l1,c as k8,v as S8,S as _8,w as c1,d as C8,e as A8,j as g,M as T8,g as E8,r as N8}from"./markdown-CrVimah5.js";import{r as R8,g as Ok,a as N,X as yn,E as yp,b as lu,F as z0,M as D8,C as Au,D as Sl,d as wo,e as Lk,f as _s,P as Xm,h as M8,L as Hn,i as bp,j as vp,S as O8,G as jk,A as xp,k as L8,l as u1,m as d1,n as j8,B as B8,H as Bk,o as Ik,p as I8,q as wp,s as Pk,t as Tu,u as zk,v as Eu,w as p1,x as $k,y as P8,z as z8,I as $8,J as F8,K as Fk,N as H8,O as Hk,Q as U8,T as G8,U as f1,V as q8,Y as V8,Z as W8,_ as K8,$ as Y8,a0 as Z8,a1 as X8,a2 as Uk,a3 as Gk,a4 as Q8,a5 as J8,a6 as e_,a7 as h1,a8 as t_,a9 as n_,aa as a_,ab as m1,ac as vo,ad as Qm,ae as g1,af as qk,ag as Vk,ah as Px,ai as r_,aj as Xd,ak as s_,al as i_,am as Zc,an as o_,ao as l_,ap as c_,aq as u_,ar as d_,as as Wk,at as p_,au as f_,av as h_,aw as m_,ax as g_,ay as y_,az as b_,aA as v_,aB as x_,aC as w_,aD as Kk,aE as k_,aF as S_,W as __}from"./icons-YJcunJnw.js";import{r as Yk}from"./react-vendor-DM-M1fu_.js";import{r as C_,c as Nn}from"./state-D8omNTWe.js";import{P as A_,a as zx,b as T_}from"./panels-BykQW6E1.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))a(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&a(l)}).observe(document,{childList:!0,subtree:!0});function n(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function a(r){if(r.ep)return;r.ep=!0;const i=n(r);fetch(r.href,i)}})();var Qh={exports:{}},Lc={},Jh={exports:{}},em={};/**
|
|
3
|
+
* @license React
|
|
4
|
+
* scheduler.production.js
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the MIT license found in the
|
|
9
|
+
* LICENSE file in the root directory of this source tree.
|
|
10
|
+
*/var $x;function E_(){return $x||($x=1,(function(t){function e(P,oe){var he=P.length;P.push(oe);e:for(;0<he;){var ke=he-1>>>1,Be=P[ke];if(0<r(Be,oe))P[ke]=oe,P[he]=Be,he=ke;else break e}}function n(P){return P.length===0?null:P[0]}function a(P){if(P.length===0)return null;var oe=P[0],he=P.pop();if(he!==oe){P[0]=he;e:for(var ke=0,Be=P.length,Pe=Be>>>1;ke<Pe;){var He=2*(ke+1)-1,$e=P[He],ft=He+1,tn=P[ft];if(0>r($e,he))ft<Be&&0>r(tn,$e)?(P[ke]=tn,P[ft]=he,ke=ft):(P[ke]=$e,P[He]=he,ke=He);else if(ft<Be&&0>r(tn,he))P[ke]=tn,P[ft]=he,ke=ft;else break e}}return oe}function r(P,oe){var he=P.sortIndex-oe.sortIndex;return he!==0?he:P.id-oe.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 l=Date,c=l.now();t.unstable_now=function(){return l.now()-c}}var d=[],p=[],h=1,m=null,b=3,x=!1,w=!1,S=!1,C=!1,E=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;function D(P){for(var oe=n(p);oe!==null;){if(oe.callback===null)a(p);else if(oe.startTime<=P)a(p),oe.sortIndex=oe.expirationTime,e(d,oe);else break;oe=n(p)}}function B(P){if(S=!1,D(P),!w)if(n(d)!==null)w=!0,H||(H=!0,G());else{var oe=n(p);oe!==null&&ye(B,oe.startTime-P)}}var H=!1,K=-1,U=5,q=-1;function re(){return C?!0:!(t.unstable_now()-q<U)}function _e(){if(C=!1,H){var P=t.unstable_now();q=P;var oe=!0;try{e:{w=!1,S&&(S=!1,T(K),K=-1),x=!0;var he=b;try{t:{for(D(P),m=n(d);m!==null&&!(m.expirationTime>P&&re());){var ke=m.callback;if(typeof ke=="function"){m.callback=null,b=m.priorityLevel;var Be=ke(m.expirationTime<=P);if(P=t.unstable_now(),typeof Be=="function"){m.callback=Be,D(P),oe=!0;break t}m===n(d)&&a(d),D(P)}else a(d);m=n(d)}if(m!==null)oe=!0;else{var Pe=n(p);Pe!==null&&ye(B,Pe.startTime-P),oe=!1}}break e}finally{m=null,b=he,x=!1}oe=void 0}}finally{oe?G():H=!1}}}var G;if(typeof L=="function")G=function(){L(_e)};else if(typeof MessageChannel<"u"){var me=new MessageChannel,ge=me.port2;me.port1.onmessage=_e,G=function(){ge.postMessage(null)}}else G=function(){E(_e,0)};function ye(P,oe){K=E(function(){P(t.unstable_now())},oe)}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(P){P.callback=null},t.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<P?Math.floor(1e3/P):5},t.unstable_getCurrentPriorityLevel=function(){return b},t.unstable_next=function(P){switch(b){case 1:case 2:case 3:var oe=3;break;default:oe=b}var he=b;b=oe;try{return P()}finally{b=he}},t.unstable_requestPaint=function(){C=!0},t.unstable_runWithPriority=function(P,oe){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var he=b;b=P;try{return oe()}finally{b=he}},t.unstable_scheduleCallback=function(P,oe,he){var ke=t.unstable_now();switch(typeof he=="object"&&he!==null?(he=he.delay,he=typeof he=="number"&&0<he?ke+he:ke):he=ke,P){case 1:var Be=-1;break;case 2:Be=250;break;case 5:Be=1073741823;break;case 4:Be=1e4;break;default:Be=5e3}return Be=he+Be,P={id:h++,callback:oe,priorityLevel:P,startTime:he,expirationTime:Be,sortIndex:-1},he>ke?(P.sortIndex=he,e(p,P),n(d)===null&&P===n(p)&&(S?(T(K),K=-1):S=!0,ye(B,he-ke))):(P.sortIndex=Be,e(d,P),w||x||(w=!0,H||(H=!0,G()))),P},t.unstable_shouldYield=re,t.unstable_wrapCallback=function(P){var oe=b;return function(){var he=b;b=oe;try{return P.apply(this,arguments)}finally{b=he}}}})(em)),em}var Fx;function N_(){return Fx||(Fx=1,Jh.exports=E_()),Jh.exports}/**
|
|
11
|
+
* @license React
|
|
12
|
+
* react-dom-client.production.js
|
|
13
|
+
*
|
|
14
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
15
|
+
*
|
|
16
|
+
* This source code is licensed under the MIT license found in the
|
|
17
|
+
* LICENSE file in the root directory of this source tree.
|
|
18
|
+
*/var Hx;function R_(){if(Hx)return Lc;Hx=1;var t=N_(),e=R8(),n=Yk();function a(s){var o="https://react.dev/errors/"+s;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)o+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+s+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function i(s){var o=s,u=s;if(s.alternate)for(;o.return;)o=o.return;else{s=o;do o=s,(o.flags&4098)!==0&&(u=o.return),s=o.return;while(s)}return o.tag===3?u:null}function l(s){if(s.tag===13){var o=s.memoizedState;if(o===null&&(s=s.alternate,s!==null&&(o=s.memoizedState)),o!==null)return o.dehydrated}return null}function c(s){if(s.tag===31){var o=s.memoizedState;if(o===null&&(s=s.alternate,s!==null&&(o=s.memoizedState)),o!==null)return o.dehydrated}return null}function d(s){if(i(s)!==s)throw Error(a(188))}function p(s){var o=s.alternate;if(!o){if(o=i(s),o===null)throw Error(a(188));return o!==s?null:s}for(var u=s,f=o;;){var y=u.return;if(y===null)break;var v=y.alternate;if(v===null){if(f=y.return,f!==null){u=f;continue}break}if(y.child===v.child){for(v=y.child;v;){if(v===u)return d(y),s;if(v===f)return d(y),o;v=v.sibling}throw Error(a(188))}if(u.return!==f.return)u=y,f=v;else{for(var A=!1,M=y.child;M;){if(M===u){A=!0,u=y,f=v;break}if(M===f){A=!0,f=y,u=v;break}M=M.sibling}if(!A){for(M=v.child;M;){if(M===u){A=!0,u=v,f=y;break}if(M===f){A=!0,f=v,u=y;break}M=M.sibling}if(!A)throw Error(a(189))}}if(u.alternate!==f)throw Error(a(190))}if(u.tag!==3)throw Error(a(188));return u.stateNode.current===u?s:o}function h(s){var o=s.tag;if(o===5||o===26||o===27||o===6)return s;for(s=s.child;s!==null;){if(o=h(s),o!==null)return o;s=s.sibling}return null}var m=Object.assign,b=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),L=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),H=Symbol.for("react.suspense_list"),K=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),q=Symbol.for("react.activity"),re=Symbol.for("react.memo_cache_sentinel"),_e=Symbol.iterator;function G(s){return s===null||typeof s!="object"?null:(s=_e&&s[_e]||s["@@iterator"],typeof s=="function"?s:null)}var me=Symbol.for("react.client.reference");function ge(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===me?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case S:return"Fragment";case E:return"Profiler";case C:return"StrictMode";case B:return"Suspense";case H:return"SuspenseList";case q:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case w:return"Portal";case L:return s.displayName||"Context";case T:return(s._context.displayName||"Context")+".Consumer";case D:var o=s.render;return s=s.displayName,s||(s=o.displayName||o.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case K:return o=s.displayName||null,o!==null?o:ge(s.type)||"Memo";case U:o=s._payload,s=s._init;try{return ge(s(o))}catch{}}return null}var ye=Array.isArray,P=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,he={pending:!1,data:null,method:null,action:null},ke=[],Be=-1;function Pe(s){return{current:s}}function He(s){0>Be||(s.current=ke[Be],ke[Be]=null,Be--)}function $e(s,o){Be++,ke[Be]=s.current,s.current=o}var ft=Pe(null),tn=Pe(null),Kn=Pe(null),Dn=Pe(null);function Un(s,o){switch($e(Kn,o),$e(tn,s),$e(ft,null),o.nodeType){case 9:case 11:s=(s=o.documentElement)&&(s=s.namespaceURI)?nx(s):0;break;default:if(s=o.tagName,o=o.namespaceURI)o=nx(o),s=ax(o,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}He(ft),$e(ft,s)}function Ye(){He(ft),He(tn),He(Kn)}function cn(s){s.memoizedState!==null&&$e(Dn,s);var o=ft.current,u=ax(o,s.type);o!==u&&($e(tn,s),$e(ft,u))}function oa(s){tn.current===s&&(He(ft),He(tn)),Dn.current===s&&(He(Dn),Nc._currentValue=he)}var la,$a;function un(s){if(la===void 0)try{throw Error()}catch(u){var o=u.stack.trim().match(/\n( *(at )?)/);la=o&&o[1]||"",$a=-1<u.stack.indexOf(`
|
|
19
|
+
at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
20
|
+
`+la+s+$a}var Le=!1;function cr(s,o){if(!s||Le)return"";Le=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var f={DetermineComponentFrameRoot:function(){try{if(o){var ue=function(){throw Error()};if(Object.defineProperty(ue.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ue,[])}catch(ie){var te=ie}Reflect.construct(s,[],ue)}else{try{ue.call()}catch(ie){te=ie}s.call(ue.prototype)}}else{try{throw Error()}catch(ie){te=ie}(ue=s())&&typeof ue.catch=="function"&&ue.catch(function(){})}}catch(ie){if(ie&&te&&typeof ie.stack=="string")return[ie.stack,te.stack]}return[null,null]}};f.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(f.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(f.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=f.DetermineComponentFrameRoot(),A=v[0],M=v[1];if(A&&M){var F=A.split(`
|
|
21
|
+
`),J=M.split(`
|
|
22
|
+
`);for(y=f=0;f<F.length&&!F[f].includes("DetermineComponentFrameRoot");)f++;for(;y<J.length&&!J[y].includes("DetermineComponentFrameRoot");)y++;if(f===F.length||y===J.length)for(f=F.length-1,y=J.length-1;1<=f&&0<=y&&F[f]!==J[y];)y--;for(;1<=f&&0<=y;f--,y--)if(F[f]!==J[y]){if(f!==1||y!==1)do if(f--,y--,0>y||F[f]!==J[y]){var le=`
|
|
23
|
+
`+F[f].replace(" at new "," at ");return s.displayName&&le.includes("<anonymous>")&&(le=le.replace("<anonymous>",s.displayName)),le}while(1<=f&&0<=y);break}}}finally{Le=!1,Error.prepareStackTrace=u}return(u=s?s.displayName||s.name:"")?un(u):""}function ca(s,o){switch(s.tag){case 26:case 27:case 5:return un(s.type);case 16:return un("Lazy");case 13:return s.child!==o&&o!==null?un("Suspense Fallback"):un("Suspense");case 19:return un("SuspenseList");case 0:case 15:return cr(s.type,!1);case 11:return cr(s.type.render,!1);case 1:return cr(s.type,!0);case 31:return un("Activity");default:return""}}function wr(s){try{var o="",u=null;do o+=ca(s,u),u=s,s=s.return;while(s);return o}catch(f){return`
|
|
24
|
+
Error generating stack: `+f.message+`
|
|
25
|
+
`+f.stack}}var Sa=Object.prototype.hasOwnProperty,_a=t.unstable_scheduleCallback,kr=t.unstable_cancelCallback,ur=t.unstable_shouldYield,Fa=t.unstable_requestPaint,It=t.unstable_now,Ha=t.unstable_getCurrentPriorityLevel,Sr=t.unstable_ImmediatePriority,wn=t.unstable_UserBlockingPriority,Yn=t.unstable_NormalPriority,Ua=t.unstable_LowPriority,Bn=t.unstable_IdlePriority,Ds=t.log,Mi=t.unstable_setDisableYieldValue,Zn=null,nn=null;function se(s){if(typeof Ds=="function"&&Mi(s),nn&&typeof nn.setStrictMode=="function")try{nn.setStrictMode(Zn,s)}catch{}}var Ce=Math.clz32?Math.clz32:wt,ht=Math.log,Fe=Math.LN2;function wt(s){return s>>>=0,s===0?32:31-(ht(s)/Fe|0)|0}var Dt=256,dn=262144,ua=4194304;function Ne(s){var o=s&42;if(o!==0)return o;switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function Rt(s,o,u){var f=s.pendingLanes;if(f===0)return 0;var y=0,v=s.suspendedLanes,A=s.pingedLanes;s=s.warmLanes;var M=f&134217727;return M!==0?(f=M&~v,f!==0?y=Ne(f):(A&=M,A!==0?y=Ne(A):u||(u=M&~s,u!==0&&(y=Ne(u))))):(M=f&~v,M!==0?y=Ne(M):A!==0?y=Ne(A):u||(u=f&~s,u!==0&&(y=Ne(u)))),y===0?0:o!==0&&o!==y&&(o&v)===0&&(v=y&-y,u=o&-o,v>=u||v===32&&(u&4194048)!==0)?o:y}function Ft(s,o){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&o)===0}function In(s,o){switch(s){case 1:case 2:case 4:case 8:case 64:return o+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 o+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 Oi(){var s=ua;return ua<<=1,(ua&62914560)===0&&(ua=4194304),s}function _r(s){for(var o=[],u=0;31>u;u++)o.push(s);return o}function dr(s,o){s.pendingLanes|=o,o!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function an(s,o,u,f,y,v){var A=s.pendingLanes;s.pendingLanes=u,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=u,s.entangledLanes&=u,s.errorRecoveryDisabledLanes&=u,s.shellSuspendCounter=0;var M=s.entanglements,F=s.expirationTimes,J=s.hiddenUpdates;for(u=A&~u;0<u;){var le=31-Ce(u),ue=1<<le;M[le]=0,F[le]=-1;var te=J[le];if(te!==null)for(J[le]=null,le=0;le<te.length;le++){var ie=te[le];ie!==null&&(ie.lane&=-536870913)}u&=~ue}f!==0&&Ms(s,f,0),v!==0&&y===0&&s.tag!==0&&(s.suspendedLanes|=v&~(A&~o))}function Ms(s,o,u){s.pendingLanes|=o,s.suspendedLanes&=~o;var f=31-Ce(o);s.entangledLanes|=o,s.entanglements[f]=s.entanglements[f]|1073741824|u&261930}function No(s,o){var u=s.entangledLanes|=o;for(s=s.entanglements;u;){var f=31-Ce(u),y=1<<f;y&o|s[f]&o&&(s[f]|=o),u&=~y}}function zl(s,o){var u=o&-o;return u=(u&42)!==0?1:$l(u),(u&(s.suspendedLanes|o))!==0?0:u}function $l(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function Fl(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function Ro(){var s=oe.p;return s!==0?s:(s=window.event,s===void 0?32:Ax(s.type))}function ju(s,o){var u=oe.p;try{return oe.p=s,o()}finally{oe.p=u}}var Cr=Math.random().toString(36).slice(2),kn="__reactFiber$"+Cr,Sn="__reactProps$"+Cr,Ar="__reactContainer$"+Cr,Li="__reactEvents$"+Cr,Hl="__reactListeners$"+Cr,Bu="__reactHandles$"+Cr,Iu="__reactResources$"+Cr,Os="__reactMarker$"+Cr;function Ls(s){delete s[kn],delete s[Sn],delete s[Li],delete s[Hl],delete s[Bu]}function qr(s){var o=s[kn];if(o)return o;for(var u=s.parentNode;u;){if(o=u[Ar]||u[kn]){if(u=o.alternate,o.child!==null||u!==null&&u.child!==null)for(s=ux(s);s!==null;){if(u=s[kn])return u;s=ux(s)}return o}s=u,u=s.parentNode}return null}function pr(s){if(s=s[kn]||s[Ar]){var o=s.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return s}return null}function js(s){var o=s.tag;if(o===5||o===26||o===27||o===6)return s.stateNode;throw Error(a(33))}function Xn(s){var o=s[Iu];return o||(o=s[Iu]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function rn(s){s[Os]=!0}var Ul=new Set,Pu={};function Vr(s,o){Wr(s,o),Wr(s+"Capture",o)}function Wr(s,o){for(Pu[s]=o,s=0;s<o.length;s++)Ul.add(o[s])}var Gl=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]*$"),ql={},ji={};function zu(s){return Sa.call(ji,s)?!0:Sa.call(ql,s)?!1:Gl.test(s)?ji[s]=!0:(ql[s]=!0,!1)}function Do(s,o,u){if(zu(o))if(u===null)s.removeAttribute(o);else{switch(typeof u){case"undefined":case"function":case"symbol":s.removeAttribute(o);return;case"boolean":var f=o.toLowerCase().slice(0,5);if(f!=="data-"&&f!=="aria-"){s.removeAttribute(o);return}}s.setAttribute(o,""+u)}}function Bs(s,o,u){if(u===null)s.removeAttribute(o);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(o);return}s.setAttribute(o,""+u)}}function Ca(s,o,u,f){if(f===null)s.removeAttribute(u);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(u);return}s.setAttributeNS(o,u,""+f)}}function Gn(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function Bi(s){var o=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function Zp(s,o,u){var f=Object.getOwnPropertyDescriptor(s.constructor.prototype,o);if(!s.hasOwnProperty(o)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var y=f.get,v=f.set;return Object.defineProperty(s,o,{configurable:!0,get:function(){return y.call(this)},set:function(A){u=""+A,v.call(this,A)}}),Object.defineProperty(s,o,{enumerable:f.enumerable}),{getValue:function(){return u},setValue:function(A){u=""+A},stopTracking:function(){s._valueTracker=null,delete s[o]}}}}function Is(s){if(!s._valueTracker){var o=Bi(s)?"checked":"value";s._valueTracker=Zp(s,o,""+s[o])}}function Kr(s){if(!s)return!1;var o=s._valueTracker;if(!o)return!0;var u=o.getValue(),f="";return s&&(f=Bi(s)?s.checked?"true":"false":s.value),s=f,s!==u?(o.setValue(s),!0):!1}function Ii(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var $u=/[\n"\\]/g;function Qn(s){return s.replace($u,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function Mo(s,o,u,f,y,v,A,M){s.name="",A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?s.type=A:s.removeAttribute("type"),o!=null?A==="number"?(o===0&&s.value===""||s.value!=o)&&(s.value=""+Gn(o)):s.value!==""+Gn(o)&&(s.value=""+Gn(o)):A!=="submit"&&A!=="reset"||s.removeAttribute("value"),o!=null?Oo(s,A,Gn(o)):u!=null?Oo(s,A,Gn(u)):f!=null&&s.removeAttribute("value"),y==null&&v!=null&&(s.defaultChecked=!!v),y!=null&&(s.checked=y&&typeof y!="function"&&typeof y!="symbol"),M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?s.name=""+Gn(M):s.removeAttribute("name")}function Vl(s,o,u,f,y,v,A,M){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(s.type=v),o!=null||u!=null){if(!(v!=="submit"&&v!=="reset"||o!=null)){Is(s);return}u=u!=null?""+Gn(u):"",o=o!=null?""+Gn(o):u,M||o===s.value||(s.value=o),s.defaultValue=o}f=f??y,f=typeof f!="function"&&typeof f!="symbol"&&!!f,s.checked=M?s.checked:!!f,s.defaultChecked=!!f,A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(s.name=A),Is(s)}function Oo(s,o,u){o==="number"&&Ii(s.ownerDocument)===s||s.defaultValue===""+u||(s.defaultValue=""+u)}function Yr(s,o,u,f){if(s=s.options,o){o={};for(var y=0;y<u.length;y++)o["$"+u[y]]=!0;for(u=0;u<s.length;u++)y=o.hasOwnProperty("$"+s[u].value),s[u].selected!==y&&(s[u].selected=y),y&&f&&(s[u].defaultSelected=!0)}else{for(u=""+Gn(u),o=null,y=0;y<s.length;y++){if(s[y].value===u){s[y].selected=!0,f&&(s[y].defaultSelected=!0);return}o!==null||s[y].disabled||(o=s[y])}o!==null&&(o.selected=!0)}}function Fu(s,o,u){if(o!=null&&(o=""+Gn(o),o!==s.value&&(s.value=o),u==null)){s.defaultValue!==o&&(s.defaultValue=o);return}s.defaultValue=u!=null?""+Gn(u):""}function Lo(s,o,u,f){if(o==null){if(f!=null){if(u!=null)throw Error(a(92));if(ye(f)){if(1<f.length)throw Error(a(93));f=f[0]}u=f}u==null&&(u=""),o=u}u=Gn(o),s.defaultValue=u,f=s.textContent,f===u&&f!==""&&f!==null&&(s.value=f),Is(s)}function Ps(s,o){if(o){var u=s.firstChild;if(u&&u===s.lastChild&&u.nodeType===3){u.nodeValue=o;return}}s.textContent=o}var $=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 X(s,o,u){var f=o.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?f?s.setProperty(o,""):o==="float"?s.cssFloat="":s[o]="":f?s.setProperty(o,u):typeof u!="number"||u===0||$.has(o)?o==="float"?s.cssFloat=u:s[o]=(""+u).trim():s[o]=u+"px"}function de(s,o,u){if(o!=null&&typeof o!="object")throw Error(a(62));if(s=s.style,u!=null){for(var f in u)!u.hasOwnProperty(f)||o!=null&&o.hasOwnProperty(f)||(f.indexOf("--")===0?s.setProperty(f,""):f==="float"?s.cssFloat="":s[f]="");for(var y in o)f=o[y],o.hasOwnProperty(y)&&u[y]!==f&&X(s,y,f)}else for(var v in o)o.hasOwnProperty(v)&&X(s,v,o[v])}function Se(s){if(s.indexOf("-")===-1)return!1;switch(s){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var je=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"]]),st=/^[\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 bt(s){return st.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function lt(){}var Wt=null;function Pi(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Xt=null,da=null;function Tr(s){var o=pr(s);if(o&&(s=o.stateNode)){var u=s[Sn]||null;e:switch(s=o.stateNode,o.type){case"input":if(Mo(s,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),o=u.name,u.type==="radio"&&o!=null){for(u=s;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+Qn(""+o)+'"][type="radio"]'),o=0;o<u.length;o++){var f=u[o];if(f!==s&&f.form===s.form){var y=f[Sn]||null;if(!y)throw Error(a(90));Mo(f,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(o=0;o<u.length;o++)f=u[o],f.form===s.form&&Kr(f)}break e;case"textarea":Fu(s,u.value,u.defaultValue);break e;case"select":o=u.value,o!=null&&Yr(s,!!u.multiple,o,!1)}}}var jo=!1;function Wl(s,o,u){if(jo)return s(o,u);jo=!0;try{var f=s(o);return f}finally{if(jo=!1,(Xt!==null||da!==null)&&(Ed(),Xt&&(o=Xt,s=da,da=Xt=null,Tr(o),s)))for(o=0;o<s.length;o++)Tr(s[o])}}function Zr(s,o){var u=s.stateNode;if(u===null)return null;var f=u[Sn]||null;if(f===null)return null;u=f[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(f=!f.disabled)||(s=s.type,f=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!f;break e;default:s=!1}if(s)return null;if(u&&typeof u!="function")throw Error(a(231,o,typeof u));return u}var Aa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ga=!1;if(Aa)try{var Xr={};Object.defineProperty(Xr,"passive",{get:function(){Ga=!0}}),window.addEventListener("test",Xr,Xr),window.removeEventListener("test",Xr,Xr)}catch{Ga=!1}var Mn=null,Ta=null,zi=null;function Hu(){if(zi)return zi;var s,o=Ta,u=o.length,f,y="value"in Mn?Mn.value:Mn.textContent,v=y.length;for(s=0;s<u&&o[s]===y[s];s++);var A=u-s;for(f=1;f<=A&&o[u-f]===y[v-f];f++);return zi=y.slice(s,1<f?1-f:void 0)}function Uu(s){var o=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&o===13&&(s=13)):s=o,s===10&&(s=13),32<=s||s===13?s:0}function Gu(){return!0}function ry(){return!1}function pa(s){function o(u,f,y,v,A){this._reactName=u,this._targetInst=y,this.type=f,this.nativeEvent=v,this.target=A,this.currentTarget=null;for(var M in s)s.hasOwnProperty(M)&&(u=s[M],this[M]=u?u(v):v[M]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?Gu:ry,this.isPropagationStopped=ry,this}return m(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=Gu)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Gu)},persist:function(){},isPersistent:Gu}),o}var $i={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},qu=pa($i),Kl=m({},$i,{view:0,detail:0}),g6=pa(Kl),Xp,Qp,Yl,Vu=m({},Kl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ef,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==Yl&&(Yl&&s.type==="mousemove"?(Xp=s.screenX-Yl.screenX,Qp=s.screenY-Yl.screenY):Qp=Xp=0,Yl=s),Xp)},movementY:function(s){return"movementY"in s?s.movementY:Qp}}),sy=pa(Vu),y6=m({},Vu,{dataTransfer:0}),b6=pa(y6),v6=m({},Kl,{relatedTarget:0}),Jp=pa(v6),x6=m({},$i,{animationName:0,elapsedTime:0,pseudoElement:0}),w6=pa(x6),k6=m({},$i,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),S6=pa(k6),_6=m({},$i,{data:0}),iy=pa(_6),C6={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},A6={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"},T6={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function E6(s){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(s):(s=T6[s])?!!o[s]:!1}function ef(){return E6}var N6=m({},Kl,{key:function(s){if(s.key){var o=C6[s.key]||s.key;if(o!=="Unidentified")return o}return s.type==="keypress"?(s=Uu(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?A6[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ef,charCode:function(s){return s.type==="keypress"?Uu(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?Uu(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),R6=pa(N6),D6=m({},Vu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),oy=pa(D6),M6=m({},Kl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ef}),O6=pa(M6),L6=m({},$i,{propertyName:0,elapsedTime:0,pseudoElement:0}),j6=pa(L6),B6=m({},Vu,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),I6=pa(B6),P6=m({},$i,{newState:0,oldState:0}),z6=pa(P6),$6=[9,13,27,32],tf=Aa&&"CompositionEvent"in window,Zl=null;Aa&&"documentMode"in document&&(Zl=document.documentMode);var F6=Aa&&"TextEvent"in window&&!Zl,ly=Aa&&(!tf||Zl&&8<Zl&&11>=Zl),cy=" ",uy=!1;function dy(s,o){switch(s){case"keyup":return $6.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function py(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Bo=!1;function H6(s,o){switch(s){case"compositionend":return py(o);case"keypress":return o.which!==32?null:(uy=!0,cy);case"textInput":return s=o.data,s===cy&&uy?null:s;default:return null}}function U6(s,o){if(Bo)return s==="compositionend"||!tf&&dy(s,o)?(s=Hu(),zi=Ta=Mn=null,Bo=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return ly&&o.locale!=="ko"?null:o.data;default:return null}}var G6={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 fy(s){var o=s&&s.nodeName&&s.nodeName.toLowerCase();return o==="input"?!!G6[s.type]:o==="textarea"}function hy(s,o,u,f){Xt?da?da.push(f):da=[f]:Xt=f,o=jd(o,"onChange"),0<o.length&&(u=new qu("onChange","change",null,u,f),s.push({event:u,listeners:o}))}var Xl=null,Ql=null;function q6(s){Zv(s,0)}function Wu(s){var o=js(s);if(Kr(o))return s}function my(s,o){if(s==="change")return o}var gy=!1;if(Aa){var nf;if(Aa){var af="oninput"in document;if(!af){var yy=document.createElement("div");yy.setAttribute("oninput","return;"),af=typeof yy.oninput=="function"}nf=af}else nf=!1;gy=nf&&(!document.documentMode||9<document.documentMode)}function by(){Xl&&(Xl.detachEvent("onpropertychange",vy),Ql=Xl=null)}function vy(s){if(s.propertyName==="value"&&Wu(Ql)){var o=[];hy(o,Ql,s,Pi(s)),Wl(q6,o)}}function V6(s,o,u){s==="focusin"?(by(),Xl=o,Ql=u,Xl.attachEvent("onpropertychange",vy)):s==="focusout"&&by()}function W6(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return Wu(Ql)}function K6(s,o){if(s==="click")return Wu(o)}function Y6(s,o){if(s==="input"||s==="change")return Wu(o)}function Z6(s,o){return s===o&&(s!==0||1/s===1/o)||s!==s&&o!==o}var Ea=typeof Object.is=="function"?Object.is:Z6;function Jl(s,o){if(Ea(s,o))return!0;if(typeof s!="object"||s===null||typeof o!="object"||o===null)return!1;var u=Object.keys(s),f=Object.keys(o);if(u.length!==f.length)return!1;for(f=0;f<u.length;f++){var y=u[f];if(!Sa.call(o,y)||!Ea(s[y],o[y]))return!1}return!0}function xy(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function wy(s,o){var u=xy(s);s=0;for(var f;u;){if(u.nodeType===3){if(f=s+u.textContent.length,s<=o&&f>=o)return{node:u,offset:o-s};s=f}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=xy(u)}}function ky(s,o){return s&&o?s===o?!0:s&&s.nodeType===3?!1:o&&o.nodeType===3?ky(s,o.parentNode):"contains"in s?s.contains(o):s.compareDocumentPosition?!!(s.compareDocumentPosition(o)&16):!1:!1}function Sy(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var o=Ii(s.document);o instanceof s.HTMLIFrameElement;){try{var u=typeof o.contentWindow.location.href=="string"}catch{u=!1}if(u)s=o.contentWindow;else break;o=Ii(s.document)}return o}function rf(s){var o=s&&s.nodeName&&s.nodeName.toLowerCase();return o&&(o==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||o==="textarea"||s.contentEditable==="true")}var X6=Aa&&"documentMode"in document&&11>=document.documentMode,Io=null,sf=null,ec=null,of=!1;function _y(s,o,u){var f=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;of||Io==null||Io!==Ii(f)||(f=Io,"selectionStart"in f&&rf(f)?f={start:f.selectionStart,end:f.selectionEnd}:(f=(f.ownerDocument&&f.ownerDocument.defaultView||window).getSelection(),f={anchorNode:f.anchorNode,anchorOffset:f.anchorOffset,focusNode:f.focusNode,focusOffset:f.focusOffset}),ec&&Jl(ec,f)||(ec=f,f=jd(sf,"onSelect"),0<f.length&&(o=new qu("onSelect","select",null,o,u),s.push({event:o,listeners:f}),o.target=Io)))}function Fi(s,o){var u={};return u[s.toLowerCase()]=o.toLowerCase(),u["Webkit"+s]="webkit"+o,u["Moz"+s]="moz"+o,u}var Po={animationend:Fi("Animation","AnimationEnd"),animationiteration:Fi("Animation","AnimationIteration"),animationstart:Fi("Animation","AnimationStart"),transitionrun:Fi("Transition","TransitionRun"),transitionstart:Fi("Transition","TransitionStart"),transitioncancel:Fi("Transition","TransitionCancel"),transitionend:Fi("Transition","TransitionEnd")},lf={},Cy={};Aa&&(Cy=document.createElement("div").style,"AnimationEvent"in window||(delete Po.animationend.animation,delete Po.animationiteration.animation,delete Po.animationstart.animation),"TransitionEvent"in window||delete Po.transitionend.transition);function Hi(s){if(lf[s])return lf[s];if(!Po[s])return s;var o=Po[s],u;for(u in o)if(o.hasOwnProperty(u)&&u in Cy)return lf[s]=o[u];return s}var Ay=Hi("animationend"),Ty=Hi("animationiteration"),Ey=Hi("animationstart"),Q6=Hi("transitionrun"),J6=Hi("transitionstart"),e7=Hi("transitioncancel"),Ny=Hi("transitionend"),Ry=new Map,cf="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(" ");cf.push("scrollEnd");function fr(s,o){Ry.set(s,o),Vr(o,[s])}var Ku=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},qa=[],zo=0,uf=0;function Yu(){for(var s=zo,o=uf=zo=0;o<s;){var u=qa[o];qa[o++]=null;var f=qa[o];qa[o++]=null;var y=qa[o];qa[o++]=null;var v=qa[o];if(qa[o++]=null,f!==null&&y!==null){var A=f.pending;A===null?y.next=y:(y.next=A.next,A.next=y),f.pending=y}v!==0&&Dy(u,y,v)}}function Zu(s,o,u,f){qa[zo++]=s,qa[zo++]=o,qa[zo++]=u,qa[zo++]=f,uf|=f,s.lanes|=f,s=s.alternate,s!==null&&(s.lanes|=f)}function df(s,o,u,f){return Zu(s,o,u,f),Xu(s)}function Ui(s,o){return Zu(s,null,null,o),Xu(s)}function Dy(s,o,u){s.lanes|=u;var f=s.alternate;f!==null&&(f.lanes|=u);for(var y=!1,v=s.return;v!==null;)v.childLanes|=u,f=v.alternate,f!==null&&(f.childLanes|=u),v.tag===22&&(s=v.stateNode,s===null||s._visibility&1||(y=!0)),s=v,v=v.return;return s.tag===3?(v=s.stateNode,y&&o!==null&&(y=31-Ce(u),s=v.hiddenUpdates,f=s[y],f===null?s[y]=[o]:f.push(o),o.lane=u|536870912),v):null}function Xu(s){if(50<kc)throw kc=0,xh=null,Error(a(185));for(var o=s.return;o!==null;)s=o,o=s.return;return s.tag===3?s.stateNode:null}var $o={};function t7(s,o,u,f){this.tag=s,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=f,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Na(s,o,u,f){return new t7(s,o,u,f)}function pf(s){return s=s.prototype,!(!s||!s.isReactComponent)}function Qr(s,o){var u=s.alternate;return u===null?(u=Na(s.tag,o,s.key,s.mode),u.elementType=s.elementType,u.type=s.type,u.stateNode=s.stateNode,u.alternate=s,s.alternate=u):(u.pendingProps=o,u.type=s.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=s.flags&65011712,u.childLanes=s.childLanes,u.lanes=s.lanes,u.child=s.child,u.memoizedProps=s.memoizedProps,u.memoizedState=s.memoizedState,u.updateQueue=s.updateQueue,o=s.dependencies,u.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},u.sibling=s.sibling,u.index=s.index,u.ref=s.ref,u.refCleanup=s.refCleanup,u}function My(s,o){s.flags&=65011714;var u=s.alternate;return u===null?(s.childLanes=0,s.lanes=o,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=u.childLanes,s.lanes=u.lanes,s.child=u.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=u.memoizedProps,s.memoizedState=u.memoizedState,s.updateQueue=u.updateQueue,s.type=u.type,o=u.dependencies,s.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),s}function Qu(s,o,u,f,y,v){var A=0;if(f=s,typeof s=="function")pf(s)&&(A=1);else if(typeof s=="string")A=i8(s,u,ft.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case q:return s=Na(31,u,o,y),s.elementType=q,s.lanes=v,s;case S:return Gi(u.children,y,v,o);case C:A=8,y|=24;break;case E:return s=Na(12,u,o,y|2),s.elementType=E,s.lanes=v,s;case B:return s=Na(13,u,o,y),s.elementType=B,s.lanes=v,s;case H:return s=Na(19,u,o,y),s.elementType=H,s.lanes=v,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case L:A=10;break e;case T:A=9;break e;case D:A=11;break e;case K:A=14;break e;case U:A=16,f=null;break e}A=29,u=Error(a(130,s===null?"null":typeof s,"")),f=null}return o=Na(A,u,o,y),o.elementType=s,o.type=f,o.lanes=v,o}function Gi(s,o,u,f){return s=Na(7,s,f,o),s.lanes=u,s}function ff(s,o,u){return s=Na(6,s,null,o),s.lanes=u,s}function Oy(s){var o=Na(18,null,null,0);return o.stateNode=s,o}function hf(s,o,u){return o=Na(4,s.children!==null?s.children:[],s.key,o),o.lanes=u,o.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},o}var Ly=new WeakMap;function Va(s,o){if(typeof s=="object"&&s!==null){var u=Ly.get(s);return u!==void 0?u:(o={value:s,source:o,stack:wr(o)},Ly.set(s,o),o)}return{value:s,source:o,stack:wr(o)}}var Fo=[],Ho=0,Ju=null,tc=0,Wa=[],Ka=0,zs=null,Er=1,Nr="";function Jr(s,o){Fo[Ho++]=tc,Fo[Ho++]=Ju,Ju=s,tc=o}function jy(s,o,u){Wa[Ka++]=Er,Wa[Ka++]=Nr,Wa[Ka++]=zs,zs=s;var f=Er;s=Nr;var y=32-Ce(f)-1;f&=~(1<<y),u+=1;var v=32-Ce(o)+y;if(30<v){var A=y-y%5;v=(f&(1<<A)-1).toString(32),f>>=A,y-=A,Er=1<<32-Ce(o)+y|u<<y|f,Nr=v+s}else Er=1<<v|u<<y|f,Nr=s}function mf(s){s.return!==null&&(Jr(s,1),jy(s,1,0))}function gf(s){for(;s===Ju;)Ju=Fo[--Ho],Fo[Ho]=null,tc=Fo[--Ho],Fo[Ho]=null;for(;s===zs;)zs=Wa[--Ka],Wa[Ka]=null,Nr=Wa[--Ka],Wa[Ka]=null,Er=Wa[--Ka],Wa[Ka]=null}function By(s,o){Wa[Ka++]=Er,Wa[Ka++]=Nr,Wa[Ka++]=zs,Er=o.id,Nr=o.overflow,zs=s}var Pn=null,Ht=null,kt=!1,$s=null,Ya=!1,yf=Error(a(519));function Fs(s){var o=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw nc(Va(o,s)),yf}function Iy(s){var o=s.stateNode,u=s.type,f=s.memoizedProps;switch(o[kn]=s,o[Sn]=f,u){case"dialog":yt("cancel",o),yt("close",o);break;case"iframe":case"object":case"embed":yt("load",o);break;case"video":case"audio":for(u=0;u<_c.length;u++)yt(_c[u],o);break;case"source":yt("error",o);break;case"img":case"image":case"link":yt("error",o),yt("load",o);break;case"details":yt("toggle",o);break;case"input":yt("invalid",o),Vl(o,f.value,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name,!0);break;case"select":yt("invalid",o);break;case"textarea":yt("invalid",o),Lo(o,f.value,f.defaultValue,f.children)}u=f.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||o.textContent===""+u||f.suppressHydrationWarning===!0||ex(o.textContent,u)?(f.popover!=null&&(yt("beforetoggle",o),yt("toggle",o)),f.onScroll!=null&&yt("scroll",o),f.onScrollEnd!=null&&yt("scrollend",o),f.onClick!=null&&(o.onclick=lt),o=!0):o=!1,o||Fs(s,!0)}function Py(s){for(Pn=s.return;Pn;)switch(Pn.tag){case 5:case 31:case 13:Ya=!1;return;case 27:case 3:Ya=!0;return;default:Pn=Pn.return}}function Uo(s){if(s!==Pn)return!1;if(!kt)return Py(s),kt=!0,!1;var o=s.tag,u;if((u=o!==3&&o!==27)&&((u=o===5)&&(u=s.type,u=!(u!=="form"&&u!=="button")||jh(s.type,s.memoizedProps)),u=!u),u&&Ht&&Fs(s),Py(s),o===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(a(317));Ht=cx(s)}else if(o===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(a(317));Ht=cx(s)}else o===27?(o=Ht,ti(s.type)?(s=$h,$h=null,Ht=s):Ht=o):Ht=Pn?Xa(s.stateNode.nextSibling):null;return!0}function qi(){Ht=Pn=null,kt=!1}function bf(){var s=$s;return s!==null&&(ga===null?ga=s:ga.push.apply(ga,s),$s=null),s}function nc(s){$s===null?$s=[s]:$s.push(s)}var vf=Pe(null),Vi=null,es=null;function Hs(s,o,u){$e(vf,o._currentValue),o._currentValue=u}function ts(s){s._currentValue=vf.current,He(vf)}function xf(s,o,u){for(;s!==null;){var f=s.alternate;if((s.childLanes&o)!==o?(s.childLanes|=o,f!==null&&(f.childLanes|=o)):f!==null&&(f.childLanes&o)!==o&&(f.childLanes|=o),s===u)break;s=s.return}}function wf(s,o,u,f){var y=s.child;for(y!==null&&(y.return=s);y!==null;){var v=y.dependencies;if(v!==null){var A=y.child;v=v.firstContext;e:for(;v!==null;){var M=v;v=y;for(var F=0;F<o.length;F++)if(M.context===o[F]){v.lanes|=u,M=v.alternate,M!==null&&(M.lanes|=u),xf(v.return,u,s),f||(A=null);break e}v=M.next}}else if(y.tag===18){if(A=y.return,A===null)throw Error(a(341));A.lanes|=u,v=A.alternate,v!==null&&(v.lanes|=u),xf(A,u,s),A=null}else A=y.child;if(A!==null)A.return=y;else for(A=y;A!==null;){if(A===s){A=null;break}if(y=A.sibling,y!==null){y.return=A.return,A=y;break}A=A.return}y=A}}function Go(s,o,u,f){s=null;for(var y=o,v=!1;y!==null;){if(!v){if((y.flags&524288)!==0)v=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var A=y.alternate;if(A===null)throw Error(a(387));if(A=A.memoizedProps,A!==null){var M=y.type;Ea(y.pendingProps.value,A.value)||(s!==null?s.push(M):s=[M])}}else if(y===Dn.current){if(A=y.alternate,A===null)throw Error(a(387));A.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(s!==null?s.push(Nc):s=[Nc])}y=y.return}s!==null&&wf(o,s,u,f),o.flags|=262144}function ed(s){for(s=s.firstContext;s!==null;){if(!Ea(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function Wi(s){Vi=s,es=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function zn(s){return zy(Vi,s)}function td(s,o){return Vi===null&&Wi(s),zy(s,o)}function zy(s,o){var u=o._currentValue;if(o={context:o,memoizedValue:u,next:null},es===null){if(s===null)throw Error(a(308));es=o,s.dependencies={lanes:0,firstContext:o},s.flags|=524288}else es=es.next=o;return u}var n7=typeof AbortController<"u"?AbortController:function(){var s=[],o=this.signal={aborted:!1,addEventListener:function(u,f){s.push(f)}};this.abort=function(){o.aborted=!0,s.forEach(function(u){return u()})}},a7=t.unstable_scheduleCallback,r7=t.unstable_NormalPriority,pn={$$typeof:L,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function kf(){return{controller:new n7,data:new Map,refCount:0}}function ac(s){s.refCount--,s.refCount===0&&a7(r7,function(){s.controller.abort()})}var rc=null,Sf=0,qo=0,Vo=null;function s7(s,o){if(rc===null){var u=rc=[];Sf=0,qo=Ah(),Vo={status:"pending",value:void 0,then:function(f){u.push(f)}}}return Sf++,o.then($y,$y),o}function $y(){if(--Sf===0&&rc!==null){Vo!==null&&(Vo.status="fulfilled");var s=rc;rc=null,qo=0,Vo=null;for(var o=0;o<s.length;o++)(0,s[o])()}}function i7(s,o){var u=[],f={status:"pending",value:null,reason:null,then:function(y){u.push(y)}};return s.then(function(){f.status="fulfilled",f.value=o;for(var y=0;y<u.length;y++)(0,u[y])(o)},function(y){for(f.status="rejected",f.reason=y,y=0;y<u.length;y++)(0,u[y])(void 0)}),f}var Fy=P.S;P.S=function(s,o){_v=It(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&s7(s,o),Fy!==null&&Fy(s,o)};var Ki=Pe(null);function _f(){var s=Ki.current;return s!==null?s:Pt.pooledCache}function nd(s,o){o===null?$e(Ki,Ki.current):$e(Ki,o.pool)}function Hy(){var s=_f();return s===null?null:{parent:pn._currentValue,pool:s}}var Wo=Error(a(460)),Cf=Error(a(474)),ad=Error(a(542)),rd={then:function(){}};function Uy(s){return s=s.status,s==="fulfilled"||s==="rejected"}function Gy(s,o,u){switch(u=s[u],u===void 0?s.push(o):u!==o&&(o.then(lt,lt),o=u),o.status){case"fulfilled":return o.value;case"rejected":throw s=o.reason,Vy(s),s;default:if(typeof o.status=="string")o.then(lt,lt);else{if(s=Pt,s!==null&&100<s.shellSuspendCounter)throw Error(a(482));s=o,s.status="pending",s.then(function(f){if(o.status==="pending"){var y=o;y.status="fulfilled",y.value=f}},function(f){if(o.status==="pending"){var y=o;y.status="rejected",y.reason=f}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw s=o.reason,Vy(s),s}throw Zi=o,Wo}}function Yi(s){try{var o=s._init;return o(s._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(Zi=u,Wo):u}}var Zi=null;function qy(){if(Zi===null)throw Error(a(459));var s=Zi;return Zi=null,s}function Vy(s){if(s===Wo||s===ad)throw Error(a(483))}var Ko=null,sc=0;function sd(s){var o=sc;return sc+=1,Ko===null&&(Ko=[]),Gy(Ko,s,o)}function ic(s,o){o=o.props.ref,s.ref=o!==void 0?o:null}function id(s,o){throw o.$$typeof===b?Error(a(525)):(s=Object.prototype.toString.call(o),Error(a(31,s==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":s)))}function Wy(s){function o(Z,V){if(s){var Q=Z.deletions;Q===null?(Z.deletions=[V],Z.flags|=16):Q.push(V)}}function u(Z,V){if(!s)return null;for(;V!==null;)o(Z,V),V=V.sibling;return null}function f(Z){for(var V=new Map;Z!==null;)Z.key!==null?V.set(Z.key,Z):V.set(Z.index,Z),Z=Z.sibling;return V}function y(Z,V){return Z=Qr(Z,V),Z.index=0,Z.sibling=null,Z}function v(Z,V,Q){return Z.index=Q,s?(Q=Z.alternate,Q!==null?(Q=Q.index,Q<V?(Z.flags|=67108866,V):Q):(Z.flags|=67108866,V)):(Z.flags|=1048576,V)}function A(Z){return s&&Z.alternate===null&&(Z.flags|=67108866),Z}function M(Z,V,Q,ce){return V===null||V.tag!==6?(V=ff(Q,Z.mode,ce),V.return=Z,V):(V=y(V,Q),V.return=Z,V)}function F(Z,V,Q,ce){var Ue=Q.type;return Ue===S?le(Z,V,Q.props.children,ce,Q.key):V!==null&&(V.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===U&&Yi(Ue)===V.type)?(V=y(V,Q.props),ic(V,Q),V.return=Z,V):(V=Qu(Q.type,Q.key,Q.props,null,Z.mode,ce),ic(V,Q),V.return=Z,V)}function J(Z,V,Q,ce){return V===null||V.tag!==4||V.stateNode.containerInfo!==Q.containerInfo||V.stateNode.implementation!==Q.implementation?(V=hf(Q,Z.mode,ce),V.return=Z,V):(V=y(V,Q.children||[]),V.return=Z,V)}function le(Z,V,Q,ce,Ue){return V===null||V.tag!==7?(V=Gi(Q,Z.mode,ce,Ue),V.return=Z,V):(V=y(V,Q),V.return=Z,V)}function ue(Z,V,Q){if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return V=ff(""+V,Z.mode,Q),V.return=Z,V;if(typeof V=="object"&&V!==null){switch(V.$$typeof){case x:return Q=Qu(V.type,V.key,V.props,null,Z.mode,Q),ic(Q,V),Q.return=Z,Q;case w:return V=hf(V,Z.mode,Q),V.return=Z,V;case U:return V=Yi(V),ue(Z,V,Q)}if(ye(V)||G(V))return V=Gi(V,Z.mode,Q,null),V.return=Z,V;if(typeof V.then=="function")return ue(Z,sd(V),Q);if(V.$$typeof===L)return ue(Z,td(Z,V),Q);id(Z,V)}return null}function te(Z,V,Q,ce){var Ue=V!==null?V.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Ue!==null?null:M(Z,V,""+Q,ce);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case x:return Q.key===Ue?F(Z,V,Q,ce):null;case w:return Q.key===Ue?J(Z,V,Q,ce):null;case U:return Q=Yi(Q),te(Z,V,Q,ce)}if(ye(Q)||G(Q))return Ue!==null?null:le(Z,V,Q,ce,null);if(typeof Q.then=="function")return te(Z,V,sd(Q),ce);if(Q.$$typeof===L)return te(Z,V,td(Z,Q),ce);id(Z,Q)}return null}function ie(Z,V,Q,ce,Ue){if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return Z=Z.get(Q)||null,M(V,Z,""+ce,Ue);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case x:return Z=Z.get(ce.key===null?Q:ce.key)||null,F(V,Z,ce,Ue);case w:return Z=Z.get(ce.key===null?Q:ce.key)||null,J(V,Z,ce,Ue);case U:return ce=Yi(ce),ie(Z,V,Q,ce,Ue)}if(ye(ce)||G(ce))return Z=Z.get(Q)||null,le(V,Z,ce,Ue,null);if(typeof ce.then=="function")return ie(Z,V,Q,sd(ce),Ue);if(ce.$$typeof===L)return ie(Z,V,Q,td(V,ce),Ue);id(V,ce)}return null}function Re(Z,V,Q,ce){for(var Ue=null,_t=null,Ie=V,ct=V=0,xt=null;Ie!==null&&ct<Q.length;ct++){Ie.index>ct?(xt=Ie,Ie=null):xt=Ie.sibling;var Ct=te(Z,Ie,Q[ct],ce);if(Ct===null){Ie===null&&(Ie=xt);break}s&&Ie&&Ct.alternate===null&&o(Z,Ie),V=v(Ct,V,ct),_t===null?Ue=Ct:_t.sibling=Ct,_t=Ct,Ie=xt}if(ct===Q.length)return u(Z,Ie),kt&&Jr(Z,ct),Ue;if(Ie===null){for(;ct<Q.length;ct++)Ie=ue(Z,Q[ct],ce),Ie!==null&&(V=v(Ie,V,ct),_t===null?Ue=Ie:_t.sibling=Ie,_t=Ie);return kt&&Jr(Z,ct),Ue}for(Ie=f(Ie);ct<Q.length;ct++)xt=ie(Ie,Z,ct,Q[ct],ce),xt!==null&&(s&&xt.alternate!==null&&Ie.delete(xt.key===null?ct:xt.key),V=v(xt,V,ct),_t===null?Ue=xt:_t.sibling=xt,_t=xt);return s&&Ie.forEach(function(ii){return o(Z,ii)}),kt&&Jr(Z,ct),Ue}function We(Z,V,Q,ce){if(Q==null)throw Error(a(151));for(var Ue=null,_t=null,Ie=V,ct=V=0,xt=null,Ct=Q.next();Ie!==null&&!Ct.done;ct++,Ct=Q.next()){Ie.index>ct?(xt=Ie,Ie=null):xt=Ie.sibling;var ii=te(Z,Ie,Ct.value,ce);if(ii===null){Ie===null&&(Ie=xt);break}s&&Ie&&ii.alternate===null&&o(Z,Ie),V=v(ii,V,ct),_t===null?Ue=ii:_t.sibling=ii,_t=ii,Ie=xt}if(Ct.done)return u(Z,Ie),kt&&Jr(Z,ct),Ue;if(Ie===null){for(;!Ct.done;ct++,Ct=Q.next())Ct=ue(Z,Ct.value,ce),Ct!==null&&(V=v(Ct,V,ct),_t===null?Ue=Ct:_t.sibling=Ct,_t=Ct);return kt&&Jr(Z,ct),Ue}for(Ie=f(Ie);!Ct.done;ct++,Ct=Q.next())Ct=ie(Ie,Z,ct,Ct.value,ce),Ct!==null&&(s&&Ct.alternate!==null&&Ie.delete(Ct.key===null?ct:Ct.key),V=v(Ct,V,ct),_t===null?Ue=Ct:_t.sibling=Ct,_t=Ct);return s&&Ie.forEach(function(y8){return o(Z,y8)}),kt&&Jr(Z,ct),Ue}function Bt(Z,V,Q,ce){if(typeof Q=="object"&&Q!==null&&Q.type===S&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case x:e:{for(var Ue=Q.key;V!==null;){if(V.key===Ue){if(Ue=Q.type,Ue===S){if(V.tag===7){u(Z,V.sibling),ce=y(V,Q.props.children),ce.return=Z,Z=ce;break e}}else if(V.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===U&&Yi(Ue)===V.type){u(Z,V.sibling),ce=y(V,Q.props),ic(ce,Q),ce.return=Z,Z=ce;break e}u(Z,V);break}else o(Z,V);V=V.sibling}Q.type===S?(ce=Gi(Q.props.children,Z.mode,ce,Q.key),ce.return=Z,Z=ce):(ce=Qu(Q.type,Q.key,Q.props,null,Z.mode,ce),ic(ce,Q),ce.return=Z,Z=ce)}return A(Z);case w:e:{for(Ue=Q.key;V!==null;){if(V.key===Ue)if(V.tag===4&&V.stateNode.containerInfo===Q.containerInfo&&V.stateNode.implementation===Q.implementation){u(Z,V.sibling),ce=y(V,Q.children||[]),ce.return=Z,Z=ce;break e}else{u(Z,V);break}else o(Z,V);V=V.sibling}ce=hf(Q,Z.mode,ce),ce.return=Z,Z=ce}return A(Z);case U:return Q=Yi(Q),Bt(Z,V,Q,ce)}if(ye(Q))return Re(Z,V,Q,ce);if(G(Q)){if(Ue=G(Q),typeof Ue!="function")throw Error(a(150));return Q=Ue.call(Q),We(Z,V,Q,ce)}if(typeof Q.then=="function")return Bt(Z,V,sd(Q),ce);if(Q.$$typeof===L)return Bt(Z,V,td(Z,Q),ce);id(Z,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,V!==null&&V.tag===6?(u(Z,V.sibling),ce=y(V,Q),ce.return=Z,Z=ce):(u(Z,V),ce=ff(Q,Z.mode,ce),ce.return=Z,Z=ce),A(Z)):u(Z,V)}return function(Z,V,Q,ce){try{sc=0;var Ue=Bt(Z,V,Q,ce);return Ko=null,Ue}catch(Ie){if(Ie===Wo||Ie===ad)throw Ie;var _t=Na(29,Ie,null,Z.mode);return _t.lanes=ce,_t.return=Z,_t}finally{}}}var Xi=Wy(!0),Ky=Wy(!1),Us=!1;function Af(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Tf(s,o){s=s.updateQueue,o.updateQueue===s&&(o.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function Gs(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function qs(s,o,u){var f=s.updateQueue;if(f===null)return null;if(f=f.shared,(Tt&2)!==0){var y=f.pending;return y===null?o.next=o:(o.next=y.next,y.next=o),f.pending=o,o=Xu(s),Dy(s,null,u),o}return Zu(s,f,o,u),Xu(s)}function oc(s,o,u){if(o=o.updateQueue,o!==null&&(o=o.shared,(u&4194048)!==0)){var f=o.lanes;f&=s.pendingLanes,u|=f,o.lanes=u,No(s,u)}}function Ef(s,o){var u=s.updateQueue,f=s.alternate;if(f!==null&&(f=f.updateQueue,u===f)){var y=null,v=null;if(u=u.firstBaseUpdate,u!==null){do{var A={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};v===null?y=v=A:v=v.next=A,u=u.next}while(u!==null);v===null?y=v=o:v=v.next=o}else y=v=o;u={baseState:f.baseState,firstBaseUpdate:y,lastBaseUpdate:v,shared:f.shared,callbacks:f.callbacks},s.updateQueue=u;return}s=u.lastBaseUpdate,s===null?u.firstBaseUpdate=o:s.next=o,u.lastBaseUpdate=o}var Nf=!1;function lc(){if(Nf){var s=Vo;if(s!==null)throw s}}function cc(s,o,u,f){Nf=!1;var y=s.updateQueue;Us=!1;var v=y.firstBaseUpdate,A=y.lastBaseUpdate,M=y.shared.pending;if(M!==null){y.shared.pending=null;var F=M,J=F.next;F.next=null,A===null?v=J:A.next=J,A=F;var le=s.alternate;le!==null&&(le=le.updateQueue,M=le.lastBaseUpdate,M!==A&&(M===null?le.firstBaseUpdate=J:M.next=J,le.lastBaseUpdate=F))}if(v!==null){var ue=y.baseState;A=0,le=J=F=null,M=v;do{var te=M.lane&-536870913,ie=te!==M.lane;if(ie?(vt&te)===te:(f&te)===te){te!==0&&te===qo&&(Nf=!0),le!==null&&(le=le.next={lane:0,tag:M.tag,payload:M.payload,callback:null,next:null});e:{var Re=s,We=M;te=o;var Bt=u;switch(We.tag){case 1:if(Re=We.payload,typeof Re=="function"){ue=Re.call(Bt,ue,te);break e}ue=Re;break e;case 3:Re.flags=Re.flags&-65537|128;case 0:if(Re=We.payload,te=typeof Re=="function"?Re.call(Bt,ue,te):Re,te==null)break e;ue=m({},ue,te);break e;case 2:Us=!0}}te=M.callback,te!==null&&(s.flags|=64,ie&&(s.flags|=8192),ie=y.callbacks,ie===null?y.callbacks=[te]:ie.push(te))}else ie={lane:te,tag:M.tag,payload:M.payload,callback:M.callback,next:null},le===null?(J=le=ie,F=ue):le=le.next=ie,A|=te;if(M=M.next,M===null){if(M=y.shared.pending,M===null)break;ie=M,M=ie.next,ie.next=null,y.lastBaseUpdate=ie,y.shared.pending=null}}while(!0);le===null&&(F=ue),y.baseState=F,y.firstBaseUpdate=J,y.lastBaseUpdate=le,v===null&&(y.shared.lanes=0),Zs|=A,s.lanes=A,s.memoizedState=ue}}function Yy(s,o){if(typeof s!="function")throw Error(a(191,s));s.call(o)}function Zy(s,o){var u=s.callbacks;if(u!==null)for(s.callbacks=null,s=0;s<u.length;s++)Yy(u[s],o)}var Yo=Pe(null),od=Pe(0);function Xy(s,o){s=us,$e(od,s),$e(Yo,o),us=s|o.baseLanes}function Rf(){$e(od,us),$e(Yo,Yo.current)}function Df(){us=od.current,He(Yo),He(od)}var Ra=Pe(null),Za=null;function Vs(s){var o=s.alternate;$e(sn,sn.current&1),$e(Ra,s),Za===null&&(o===null||Yo.current!==null||o.memoizedState!==null)&&(Za=s)}function Mf(s){$e(sn,sn.current),$e(Ra,s),Za===null&&(Za=s)}function Qy(s){s.tag===22?($e(sn,sn.current),$e(Ra,s),Za===null&&(Za=s)):Ws()}function Ws(){$e(sn,sn.current),$e(Ra,Ra.current)}function Da(s){He(Ra),Za===s&&(Za=null),He(sn)}var sn=Pe(0);function ld(s){for(var o=s;o!==null;){if(o.tag===13){var u=o.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||Ph(u)||zh(u)))return o}else if(o.tag===19&&(o.memoizedProps.revealOrder==="forwards"||o.memoizedProps.revealOrder==="backwards"||o.memoizedProps.revealOrder==="unstable_legacy-backwards"||o.memoizedProps.revealOrder==="together")){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===s)break;for(;o.sibling===null;){if(o.return===null||o.return===s)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var ns=0,it=null,Lt=null,fn=null,cd=!1,Zo=!1,Qi=!1,ud=0,uc=0,Xo=null,o7=0;function Qt(){throw Error(a(321))}function Of(s,o){if(o===null)return!1;for(var u=0;u<o.length&&u<s.length;u++)if(!Ea(s[u],o[u]))return!1;return!0}function Lf(s,o,u,f,y,v){return ns=v,it=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,P.H=s===null||s.memoizedState===null?jb:Yf,Qi=!1,v=u(f,y),Qi=!1,Zo&&(v=eb(o,u,f,y)),Jy(s),v}function Jy(s){P.H=fc;var o=Lt!==null&&Lt.next!==null;if(ns=0,fn=Lt=it=null,cd=!1,uc=0,Xo=null,o)throw Error(a(300));s===null||hn||(s=s.dependencies,s!==null&&ed(s)&&(hn=!0))}function eb(s,o,u,f){it=s;var y=0;do{if(Zo&&(Xo=null),uc=0,Zo=!1,25<=y)throw Error(a(301));if(y+=1,fn=Lt=null,s.updateQueue!=null){var v=s.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}P.H=Bb,v=o(u,f)}while(Zo);return v}function l7(){var s=P.H,o=s.useState()[0];return o=typeof o.then=="function"?dc(o):o,s=s.useState()[0],(Lt!==null?Lt.memoizedState:null)!==s&&(it.flags|=1024),o}function jf(){var s=ud!==0;return ud=0,s}function Bf(s,o,u){o.updateQueue=s.updateQueue,o.flags&=-2053,s.lanes&=~u}function If(s){if(cd){for(s=s.memoizedState;s!==null;){var o=s.queue;o!==null&&(o.pending=null),s=s.next}cd=!1}ns=0,fn=Lt=it=null,Zo=!1,uc=ud=0,Xo=null}function Jn(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return fn===null?it.memoizedState=fn=s:fn=fn.next=s,fn}function on(){if(Lt===null){var s=it.alternate;s=s!==null?s.memoizedState:null}else s=Lt.next;var o=fn===null?it.memoizedState:fn.next;if(o!==null)fn=o,Lt=s;else{if(s===null)throw it.alternate===null?Error(a(467)):Error(a(310));Lt=s,s={memoizedState:Lt.memoizedState,baseState:Lt.baseState,baseQueue:Lt.baseQueue,queue:Lt.queue,next:null},fn===null?it.memoizedState=fn=s:fn=fn.next=s}return fn}function dd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function dc(s){var o=uc;return uc+=1,Xo===null&&(Xo=[]),s=Gy(Xo,s,o),o=it,(fn===null?o.memoizedState:fn.next)===null&&(o=o.alternate,P.H=o===null||o.memoizedState===null?jb:Yf),s}function pd(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return dc(s);if(s.$$typeof===L)return zn(s)}throw Error(a(438,String(s)))}function Pf(s){var o=null,u=it.updateQueue;if(u!==null&&(o=u.memoCache),o==null){var f=it.alternate;f!==null&&(f=f.updateQueue,f!==null&&(f=f.memoCache,f!=null&&(o={data:f.data.map(function(y){return y.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),u===null&&(u=dd(),it.updateQueue=u),u.memoCache=o,u=o.data[o.index],u===void 0)for(u=o.data[o.index]=Array(s),f=0;f<s;f++)u[f]=re;return o.index++,u}function as(s,o){return typeof o=="function"?o(s):o}function fd(s){var o=on();return zf(o,Lt,s)}function zf(s,o,u){var f=s.queue;if(f===null)throw Error(a(311));f.lastRenderedReducer=u;var y=s.baseQueue,v=f.pending;if(v!==null){if(y!==null){var A=y.next;y.next=v.next,v.next=A}o.baseQueue=y=v,f.pending=null}if(v=s.baseState,y===null)s.memoizedState=v;else{o=y.next;var M=A=null,F=null,J=o,le=!1;do{var ue=J.lane&-536870913;if(ue!==J.lane?(vt&ue)===ue:(ns&ue)===ue){var te=J.revertLane;if(te===0)F!==null&&(F=F.next={lane:0,revertLane:0,gesture:null,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null}),ue===qo&&(le=!0);else if((ns&te)===te){J=J.next,te===qo&&(le=!0);continue}else ue={lane:0,revertLane:J.revertLane,gesture:null,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},F===null?(M=F=ue,A=v):F=F.next=ue,it.lanes|=te,Zs|=te;ue=J.action,Qi&&u(v,ue),v=J.hasEagerState?J.eagerState:u(v,ue)}else te={lane:ue,revertLane:J.revertLane,gesture:J.gesture,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},F===null?(M=F=te,A=v):F=F.next=te,it.lanes|=ue,Zs|=ue;J=J.next}while(J!==null&&J!==o);if(F===null?A=v:F.next=M,!Ea(v,s.memoizedState)&&(hn=!0,le&&(u=Vo,u!==null)))throw u;s.memoizedState=v,s.baseState=A,s.baseQueue=F,f.lastRenderedState=v}return y===null&&(f.lanes=0),[s.memoizedState,f.dispatch]}function $f(s){var o=on(),u=o.queue;if(u===null)throw Error(a(311));u.lastRenderedReducer=s;var f=u.dispatch,y=u.pending,v=o.memoizedState;if(y!==null){u.pending=null;var A=y=y.next;do v=s(v,A.action),A=A.next;while(A!==y);Ea(v,o.memoizedState)||(hn=!0),o.memoizedState=v,o.baseQueue===null&&(o.baseState=v),u.lastRenderedState=v}return[v,f]}function tb(s,o,u){var f=it,y=on(),v=kt;if(v){if(u===void 0)throw Error(a(407));u=u()}else u=o();var A=!Ea((Lt||y).memoizedState,u);if(A&&(y.memoizedState=u,hn=!0),y=y.queue,Uf(rb.bind(null,f,y,s),[s]),y.getSnapshot!==o||A||fn!==null&&fn.memoizedState.tag&1){if(f.flags|=2048,Qo(9,{destroy:void 0},ab.bind(null,f,y,u,o),null),Pt===null)throw Error(a(349));v||(ns&127)!==0||nb(f,o,u)}return u}function nb(s,o,u){s.flags|=16384,s={getSnapshot:o,value:u},o=it.updateQueue,o===null?(o=dd(),it.updateQueue=o,o.stores=[s]):(u=o.stores,u===null?o.stores=[s]:u.push(s))}function ab(s,o,u,f){o.value=u,o.getSnapshot=f,sb(o)&&ib(s)}function rb(s,o,u){return u(function(){sb(o)&&ib(s)})}function sb(s){var o=s.getSnapshot;s=s.value;try{var u=o();return!Ea(s,u)}catch{return!0}}function ib(s){var o=Ui(s,2);o!==null&&ya(o,s,2)}function Ff(s){var o=Jn();if(typeof s=="function"){var u=s;if(s=u(),Qi){se(!0);try{u()}finally{se(!1)}}}return o.memoizedState=o.baseState=s,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:as,lastRenderedState:s},o}function ob(s,o,u,f){return s.baseState=u,zf(s,Lt,typeof f=="function"?f:as)}function c7(s,o,u,f,y){if(gd(s))throw Error(a(485));if(s=o.action,s!==null){var v={payload:y,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(A){v.listeners.push(A)}};P.T!==null?u(!0):v.isTransition=!1,f(v),u=o.pending,u===null?(v.next=o.pending=v,lb(o,v)):(v.next=u.next,o.pending=u.next=v)}}function lb(s,o){var u=o.action,f=o.payload,y=s.state;if(o.isTransition){var v=P.T,A={};P.T=A;try{var M=u(y,f),F=P.S;F!==null&&F(A,M),cb(s,o,M)}catch(J){Hf(s,o,J)}finally{v!==null&&A.types!==null&&(v.types=A.types),P.T=v}}else try{v=u(y,f),cb(s,o,v)}catch(J){Hf(s,o,J)}}function cb(s,o,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(f){ub(s,o,f)},function(f){return Hf(s,o,f)}):ub(s,o,u)}function ub(s,o,u){o.status="fulfilled",o.value=u,db(o),s.state=u,o=s.pending,o!==null&&(u=o.next,u===o?s.pending=null:(u=u.next,o.next=u,lb(s,u)))}function Hf(s,o,u){var f=s.pending;if(s.pending=null,f!==null){f=f.next;do o.status="rejected",o.reason=u,db(o),o=o.next;while(o!==f)}s.action=null}function db(s){s=s.listeners;for(var o=0;o<s.length;o++)(0,s[o])()}function pb(s,o){return o}function fb(s,o){if(kt){var u=Pt.formState;if(u!==null){e:{var f=it;if(kt){if(Ht){t:{for(var y=Ht,v=Ya;y.nodeType!==8;){if(!v){y=null;break t}if(y=Xa(y.nextSibling),y===null){y=null;break t}}v=y.data,y=v==="F!"||v==="F"?y:null}if(y){Ht=Xa(y.nextSibling),f=y.data==="F!";break e}}Fs(f)}f=!1}f&&(o=u[0])}}return u=Jn(),u.memoizedState=u.baseState=o,f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:pb,lastRenderedState:o},u.queue=f,u=Mb.bind(null,it,f),f.dispatch=u,f=Ff(!1),v=Kf.bind(null,it,!1,f.queue),f=Jn(),y={state:o,dispatch:null,action:s,pending:null},f.queue=y,u=c7.bind(null,it,y,v,u),y.dispatch=u,f.memoizedState=s,[o,u,!1]}function hb(s){var o=on();return mb(o,Lt,s)}function mb(s,o,u){if(o=zf(s,o,pb)[0],s=fd(as)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var f=dc(o)}catch(A){throw A===Wo?ad:A}else f=o;o=on();var y=o.queue,v=y.dispatch;return u!==o.memoizedState&&(it.flags|=2048,Qo(9,{destroy:void 0},u7.bind(null,y,u),null)),[f,v,s]}function u7(s,o){s.action=o}function gb(s){var o=on(),u=Lt;if(u!==null)return mb(o,u,s);on(),o=o.memoizedState,u=on();var f=u.queue.dispatch;return u.memoizedState=s,[o,f,!1]}function Qo(s,o,u,f){return s={tag:s,create:u,deps:f,inst:o,next:null},o=it.updateQueue,o===null&&(o=dd(),it.updateQueue=o),u=o.lastEffect,u===null?o.lastEffect=s.next=s:(f=u.next,u.next=s,s.next=f,o.lastEffect=s),s}function yb(){return on().memoizedState}function hd(s,o,u,f){var y=Jn();it.flags|=s,y.memoizedState=Qo(1|o,{destroy:void 0},u,f===void 0?null:f)}function md(s,o,u,f){var y=on();f=f===void 0?null:f;var v=y.memoizedState.inst;Lt!==null&&f!==null&&Of(f,Lt.memoizedState.deps)?y.memoizedState=Qo(o,v,u,f):(it.flags|=s,y.memoizedState=Qo(1|o,v,u,f))}function bb(s,o){hd(8390656,8,s,o)}function Uf(s,o){md(2048,8,s,o)}function d7(s){it.flags|=4;var o=it.updateQueue;if(o===null)o=dd(),it.updateQueue=o,o.events=[s];else{var u=o.events;u===null?o.events=[s]:u.push(s)}}function vb(s){var o=on().memoizedState;return d7({ref:o,nextImpl:s}),function(){if((Tt&2)!==0)throw Error(a(440));return o.impl.apply(void 0,arguments)}}function xb(s,o){return md(4,2,s,o)}function wb(s,o){return md(4,4,s,o)}function kb(s,o){if(typeof o=="function"){s=s();var u=o(s);return function(){typeof u=="function"?u():o(null)}}if(o!=null)return s=s(),o.current=s,function(){o.current=null}}function Sb(s,o,u){u=u!=null?u.concat([s]):null,md(4,4,kb.bind(null,o,s),u)}function Gf(){}function _b(s,o){var u=on();o=o===void 0?null:o;var f=u.memoizedState;return o!==null&&Of(o,f[1])?f[0]:(u.memoizedState=[s,o],s)}function Cb(s,o){var u=on();o=o===void 0?null:o;var f=u.memoizedState;if(o!==null&&Of(o,f[1]))return f[0];if(f=s(),Qi){se(!0);try{s()}finally{se(!1)}}return u.memoizedState=[f,o],f}function qf(s,o,u){return u===void 0||(ns&1073741824)!==0&&(vt&261930)===0?s.memoizedState=o:(s.memoizedState=u,s=Av(),it.lanes|=s,Zs|=s,u)}function Ab(s,o,u,f){return Ea(u,o)?u:Yo.current!==null?(s=qf(s,u,f),Ea(s,o)||(hn=!0),s):(ns&42)===0||(ns&1073741824)!==0&&(vt&261930)===0?(hn=!0,s.memoizedState=u):(s=Av(),it.lanes|=s,Zs|=s,o)}function Tb(s,o,u,f,y){var v=oe.p;oe.p=v!==0&&8>v?v:8;var A=P.T,M={};P.T=M,Kf(s,!1,o,u);try{var F=y(),J=P.S;if(J!==null&&J(M,F),F!==null&&typeof F=="object"&&typeof F.then=="function"){var le=i7(F,f);pc(s,o,le,La(s))}else pc(s,o,f,La(s))}catch(ue){pc(s,o,{then:function(){},status:"rejected",reason:ue},La())}finally{oe.p=v,A!==null&&M.types!==null&&(A.types=M.types),P.T=A}}function p7(){}function Vf(s,o,u,f){if(s.tag!==5)throw Error(a(476));var y=Eb(s).queue;Tb(s,y,o,he,u===null?p7:function(){return Nb(s),u(f)})}function Eb(s){var o=s.memoizedState;if(o!==null)return o;o={memoizedState:he,baseState:he,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:as,lastRenderedState:he},next:null};var u={};return o.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:as,lastRenderedState:u},next:null},s.memoizedState=o,s=s.alternate,s!==null&&(s.memoizedState=o),o}function Nb(s){var o=Eb(s);o.next===null&&(o=s.alternate.memoizedState),pc(s,o.next.queue,{},La())}function Wf(){return zn(Nc)}function Rb(){return on().memoizedState}function Db(){return on().memoizedState}function f7(s){for(var o=s.return;o!==null;){switch(o.tag){case 24:case 3:var u=La();s=Gs(u);var f=qs(o,s,u);f!==null&&(ya(f,o,u),oc(f,o,u)),o={cache:kf()},s.payload=o;return}o=o.return}}function h7(s,o,u){var f=La();u={lane:f,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},gd(s)?Ob(o,u):(u=df(s,o,u,f),u!==null&&(ya(u,s,f),Lb(u,o,f)))}function Mb(s,o,u){var f=La();pc(s,o,u,f)}function pc(s,o,u,f){var y={lane:f,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(gd(s))Ob(o,y);else{var v=s.alternate;if(s.lanes===0&&(v===null||v.lanes===0)&&(v=o.lastRenderedReducer,v!==null))try{var A=o.lastRenderedState,M=v(A,u);if(y.hasEagerState=!0,y.eagerState=M,Ea(M,A))return Zu(s,o,y,0),Pt===null&&Yu(),!1}catch{}finally{}if(u=df(s,o,y,f),u!==null)return ya(u,s,f),Lb(u,o,f),!0}return!1}function Kf(s,o,u,f){if(f={lane:2,revertLane:Ah(),gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},gd(s)){if(o)throw Error(a(479))}else o=df(s,u,f,2),o!==null&&ya(o,s,2)}function gd(s){var o=s.alternate;return s===it||o!==null&&o===it}function Ob(s,o){Zo=cd=!0;var u=s.pending;u===null?o.next=o:(o.next=u.next,u.next=o),s.pending=o}function Lb(s,o,u){if((u&4194048)!==0){var f=o.lanes;f&=s.pendingLanes,u|=f,o.lanes=u,No(s,u)}}var fc={readContext:zn,use:pd,useCallback:Qt,useContext:Qt,useEffect:Qt,useImperativeHandle:Qt,useLayoutEffect:Qt,useInsertionEffect:Qt,useMemo:Qt,useReducer:Qt,useRef:Qt,useState:Qt,useDebugValue:Qt,useDeferredValue:Qt,useTransition:Qt,useSyncExternalStore:Qt,useId:Qt,useHostTransitionStatus:Qt,useFormState:Qt,useActionState:Qt,useOptimistic:Qt,useMemoCache:Qt,useCacheRefresh:Qt};fc.useEffectEvent=Qt;var jb={readContext:zn,use:pd,useCallback:function(s,o){return Jn().memoizedState=[s,o===void 0?null:o],s},useContext:zn,useEffect:bb,useImperativeHandle:function(s,o,u){u=u!=null?u.concat([s]):null,hd(4194308,4,kb.bind(null,o,s),u)},useLayoutEffect:function(s,o){return hd(4194308,4,s,o)},useInsertionEffect:function(s,o){hd(4,2,s,o)},useMemo:function(s,o){var u=Jn();o=o===void 0?null:o;var f=s();if(Qi){se(!0);try{s()}finally{se(!1)}}return u.memoizedState=[f,o],f},useReducer:function(s,o,u){var f=Jn();if(u!==void 0){var y=u(o);if(Qi){se(!0);try{u(o)}finally{se(!1)}}}else y=o;return f.memoizedState=f.baseState=y,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:y},f.queue=s,s=s.dispatch=h7.bind(null,it,s),[f.memoizedState,s]},useRef:function(s){var o=Jn();return s={current:s},o.memoizedState=s},useState:function(s){s=Ff(s);var o=s.queue,u=Mb.bind(null,it,o);return o.dispatch=u,[s.memoizedState,u]},useDebugValue:Gf,useDeferredValue:function(s,o){var u=Jn();return qf(u,s,o)},useTransition:function(){var s=Ff(!1);return s=Tb.bind(null,it,s.queue,!0,!1),Jn().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,o,u){var f=it,y=Jn();if(kt){if(u===void 0)throw Error(a(407));u=u()}else{if(u=o(),Pt===null)throw Error(a(349));(vt&127)!==0||nb(f,o,u)}y.memoizedState=u;var v={value:u,getSnapshot:o};return y.queue=v,bb(rb.bind(null,f,v,s),[s]),f.flags|=2048,Qo(9,{destroy:void 0},ab.bind(null,f,v,u,o),null),u},useId:function(){var s=Jn(),o=Pt.identifierPrefix;if(kt){var u=Nr,f=Er;u=(f&~(1<<32-Ce(f)-1)).toString(32)+u,o="_"+o+"R_"+u,u=ud++,0<u&&(o+="H"+u.toString(32)),o+="_"}else u=o7++,o="_"+o+"r_"+u.toString(32)+"_";return s.memoizedState=o},useHostTransitionStatus:Wf,useFormState:fb,useActionState:fb,useOptimistic:function(s){var o=Jn();o.memoizedState=o.baseState=s;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=u,o=Kf.bind(null,it,!0,u),u.dispatch=o,[s,o]},useMemoCache:Pf,useCacheRefresh:function(){return Jn().memoizedState=f7.bind(null,it)},useEffectEvent:function(s){var o=Jn(),u={impl:s};return o.memoizedState=u,function(){if((Tt&2)!==0)throw Error(a(440));return u.impl.apply(void 0,arguments)}}},Yf={readContext:zn,use:pd,useCallback:_b,useContext:zn,useEffect:Uf,useImperativeHandle:Sb,useInsertionEffect:xb,useLayoutEffect:wb,useMemo:Cb,useReducer:fd,useRef:yb,useState:function(){return fd(as)},useDebugValue:Gf,useDeferredValue:function(s,o){var u=on();return Ab(u,Lt.memoizedState,s,o)},useTransition:function(){var s=fd(as)[0],o=on().memoizedState;return[typeof s=="boolean"?s:dc(s),o]},useSyncExternalStore:tb,useId:Rb,useHostTransitionStatus:Wf,useFormState:hb,useActionState:hb,useOptimistic:function(s,o){var u=on();return ob(u,Lt,s,o)},useMemoCache:Pf,useCacheRefresh:Db};Yf.useEffectEvent=vb;var Bb={readContext:zn,use:pd,useCallback:_b,useContext:zn,useEffect:Uf,useImperativeHandle:Sb,useInsertionEffect:xb,useLayoutEffect:wb,useMemo:Cb,useReducer:$f,useRef:yb,useState:function(){return $f(as)},useDebugValue:Gf,useDeferredValue:function(s,o){var u=on();return Lt===null?qf(u,s,o):Ab(u,Lt.memoizedState,s,o)},useTransition:function(){var s=$f(as)[0],o=on().memoizedState;return[typeof s=="boolean"?s:dc(s),o]},useSyncExternalStore:tb,useId:Rb,useHostTransitionStatus:Wf,useFormState:gb,useActionState:gb,useOptimistic:function(s,o){var u=on();return Lt!==null?ob(u,Lt,s,o):(u.baseState=s,[s,u.queue.dispatch])},useMemoCache:Pf,useCacheRefresh:Db};Bb.useEffectEvent=vb;function Zf(s,o,u,f){o=s.memoizedState,u=u(f,o),u=u==null?o:m({},o,u),s.memoizedState=u,s.lanes===0&&(s.updateQueue.baseState=u)}var Xf={enqueueSetState:function(s,o,u){s=s._reactInternals;var f=La(),y=Gs(f);y.payload=o,u!=null&&(y.callback=u),o=qs(s,y,f),o!==null&&(ya(o,s,f),oc(o,s,f))},enqueueReplaceState:function(s,o,u){s=s._reactInternals;var f=La(),y=Gs(f);y.tag=1,y.payload=o,u!=null&&(y.callback=u),o=qs(s,y,f),o!==null&&(ya(o,s,f),oc(o,s,f))},enqueueForceUpdate:function(s,o){s=s._reactInternals;var u=La(),f=Gs(u);f.tag=2,o!=null&&(f.callback=o),o=qs(s,f,u),o!==null&&(ya(o,s,u),oc(o,s,u))}};function Ib(s,o,u,f,y,v,A){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(f,v,A):o.prototype&&o.prototype.isPureReactComponent?!Jl(u,f)||!Jl(y,v):!0}function Pb(s,o,u,f){s=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(u,f),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(u,f),o.state!==s&&Xf.enqueueReplaceState(o,o.state,null)}function Ji(s,o){var u=o;if("ref"in o){u={};for(var f in o)f!=="ref"&&(u[f]=o[f])}if(s=s.defaultProps){u===o&&(u=m({},u));for(var y in s)u[y]===void 0&&(u[y]=s[y])}return u}function zb(s){Ku(s)}function $b(s){console.error(s)}function Fb(s){Ku(s)}function yd(s,o){try{var u=s.onUncaughtError;u(o.value,{componentStack:o.stack})}catch(f){setTimeout(function(){throw f})}}function Hb(s,o,u){try{var f=s.onCaughtError;f(u.value,{componentStack:u.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function Qf(s,o,u){return u=Gs(u),u.tag=3,u.payload={element:null},u.callback=function(){yd(s,o)},u}function Ub(s){return s=Gs(s),s.tag=3,s}function Gb(s,o,u,f){var y=u.type.getDerivedStateFromError;if(typeof y=="function"){var v=f.value;s.payload=function(){return y(v)},s.callback=function(){Hb(o,u,f)}}var A=u.stateNode;A!==null&&typeof A.componentDidCatch=="function"&&(s.callback=function(){Hb(o,u,f),typeof y!="function"&&(Xs===null?Xs=new Set([this]):Xs.add(this));var M=f.stack;this.componentDidCatch(f.value,{componentStack:M!==null?M:""})})}function m7(s,o,u,f,y){if(u.flags|=32768,f!==null&&typeof f=="object"&&typeof f.then=="function"){if(o=u.alternate,o!==null&&Go(o,u,y,!0),u=Ra.current,u!==null){switch(u.tag){case 31:case 13:return Za===null?Nd():u.alternate===null&&Jt===0&&(Jt=3),u.flags&=-257,u.flags|=65536,u.lanes=y,f===rd?u.flags|=16384:(o=u.updateQueue,o===null?u.updateQueue=new Set([f]):o.add(f),Sh(s,f,y)),!1;case 22:return u.flags|=65536,f===rd?u.flags|=16384:(o=u.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([f])},u.updateQueue=o):(u=o.retryQueue,u===null?o.retryQueue=new Set([f]):u.add(f)),Sh(s,f,y)),!1}throw Error(a(435,u.tag))}return Sh(s,f,y),Nd(),!1}if(kt)return o=Ra.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=y,f!==yf&&(s=Error(a(422),{cause:f}),nc(Va(s,u)))):(f!==yf&&(o=Error(a(423),{cause:f}),nc(Va(o,u))),s=s.current.alternate,s.flags|=65536,y&=-y,s.lanes|=y,f=Va(f,u),y=Qf(s.stateNode,f,y),Ef(s,y),Jt!==4&&(Jt=2)),!1;var v=Error(a(520),{cause:f});if(v=Va(v,u),wc===null?wc=[v]:wc.push(v),Jt!==4&&(Jt=2),o===null)return!0;f=Va(f,u),u=o;do{switch(u.tag){case 3:return u.flags|=65536,s=y&-y,u.lanes|=s,s=Qf(u.stateNode,f,s),Ef(u,s),!1;case 1:if(o=u.type,v=u.stateNode,(u.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Xs===null||!Xs.has(v))))return u.flags|=65536,y&=-y,u.lanes|=y,y=Ub(y),Gb(y,s,u,f),Ef(u,y),!1}u=u.return}while(u!==null);return!1}var Jf=Error(a(461)),hn=!1;function $n(s,o,u,f){o.child=s===null?Ky(o,null,u,f):Xi(o,s.child,u,f)}function qb(s,o,u,f,y){u=u.render;var v=o.ref;if("ref"in f){var A={};for(var M in f)M!=="ref"&&(A[M]=f[M])}else A=f;return Wi(o),f=Lf(s,o,u,A,v,y),M=jf(),s!==null&&!hn?(Bf(s,o,y),rs(s,o,y)):(kt&&M&&mf(o),o.flags|=1,$n(s,o,f,y),o.child)}function Vb(s,o,u,f,y){if(s===null){var v=u.type;return typeof v=="function"&&!pf(v)&&v.defaultProps===void 0&&u.compare===null?(o.tag=15,o.type=v,Wb(s,o,v,f,y)):(s=Qu(u.type,null,f,o,o.mode,y),s.ref=o.ref,s.return=o,o.child=s)}if(v=s.child,!oh(s,y)){var A=v.memoizedProps;if(u=u.compare,u=u!==null?u:Jl,u(A,f)&&s.ref===o.ref)return rs(s,o,y)}return o.flags|=1,s=Qr(v,f),s.ref=o.ref,s.return=o,o.child=s}function Wb(s,o,u,f,y){if(s!==null){var v=s.memoizedProps;if(Jl(v,f)&&s.ref===o.ref)if(hn=!1,o.pendingProps=f=v,oh(s,y))(s.flags&131072)!==0&&(hn=!0);else return o.lanes=s.lanes,rs(s,o,y)}return eh(s,o,u,f,y)}function Kb(s,o,u,f){var y=f.children,v=s!==null?s.memoizedState:null;if(s===null&&o.stateNode===null&&(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),f.mode==="hidden"){if((o.flags&128)!==0){if(v=v!==null?v.baseLanes|u:u,s!==null){for(f=o.child=s.child,y=0;f!==null;)y=y|f.lanes|f.childLanes,f=f.sibling;f=y&~v}else f=0,o.child=null;return Yb(s,o,v,u,f)}if((u&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},s!==null&&nd(o,v!==null?v.cachePool:null),v!==null?Xy(o,v):Rf(),Qy(o);else return f=o.lanes=536870912,Yb(s,o,v!==null?v.baseLanes|u:u,u,f)}else v!==null?(nd(o,v.cachePool),Xy(o,v),Ws(),o.memoizedState=null):(s!==null&&nd(o,null),Rf(),Ws());return $n(s,o,y,u),o.child}function hc(s,o){return s!==null&&s.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function Yb(s,o,u,f,y){var v=_f();return v=v===null?null:{parent:pn._currentValue,pool:v},o.memoizedState={baseLanes:u,cachePool:v},s!==null&&nd(o,null),Rf(),Qy(o),s!==null&&Go(s,o,f,!0),o.childLanes=y,null}function bd(s,o){return o=xd({mode:o.mode,children:o.children},s.mode),o.ref=s.ref,s.child=o,o.return=s,o}function Zb(s,o,u){return Xi(o,s.child,null,u),s=bd(o,o.pendingProps),s.flags|=2,Da(o),o.memoizedState=null,s}function g7(s,o,u){var f=o.pendingProps,y=(o.flags&128)!==0;if(o.flags&=-129,s===null){if(kt){if(f.mode==="hidden")return s=bd(o,f),o.lanes=536870912,hc(null,s);if(Mf(o),(s=Ht)?(s=lx(s,Ya),s=s!==null&&s.data==="&"?s:null,s!==null&&(o.memoizedState={dehydrated:s,treeContext:zs!==null?{id:Er,overflow:Nr}:null,retryLane:536870912,hydrationErrors:null},u=Oy(s),u.return=o,o.child=u,Pn=o,Ht=null)):s=null,s===null)throw Fs(o);return o.lanes=536870912,null}return bd(o,f)}var v=s.memoizedState;if(v!==null){var A=v.dehydrated;if(Mf(o),y)if(o.flags&256)o.flags&=-257,o=Zb(s,o,u);else if(o.memoizedState!==null)o.child=s.child,o.flags|=128,o=null;else throw Error(a(558));else if(hn||Go(s,o,u,!1),y=(u&s.childLanes)!==0,hn||y){if(f=Pt,f!==null&&(A=zl(f,u),A!==0&&A!==v.retryLane))throw v.retryLane=A,Ui(s,A),ya(f,s,A),Jf;Nd(),o=Zb(s,o,u)}else s=v.treeContext,Ht=Xa(A.nextSibling),Pn=o,kt=!0,$s=null,Ya=!1,s!==null&&By(o,s),o=bd(o,f),o.flags|=4096;return o}return s=Qr(s.child,{mode:f.mode,children:f.children}),s.ref=o.ref,o.child=s,s.return=o,s}function vd(s,o){var u=o.ref;if(u===null)s!==null&&s.ref!==null&&(o.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(a(284));(s===null||s.ref!==u)&&(o.flags|=4194816)}}function eh(s,o,u,f,y){return Wi(o),u=Lf(s,o,u,f,void 0,y),f=jf(),s!==null&&!hn?(Bf(s,o,y),rs(s,o,y)):(kt&&f&&mf(o),o.flags|=1,$n(s,o,u,y),o.child)}function Xb(s,o,u,f,y,v){return Wi(o),o.updateQueue=null,u=eb(o,f,u,y),Jy(s),f=jf(),s!==null&&!hn?(Bf(s,o,v),rs(s,o,v)):(kt&&f&&mf(o),o.flags|=1,$n(s,o,u,v),o.child)}function Qb(s,o,u,f,y){if(Wi(o),o.stateNode===null){var v=$o,A=u.contextType;typeof A=="object"&&A!==null&&(v=zn(A)),v=new u(f,v),o.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=Xf,o.stateNode=v,v._reactInternals=o,v=o.stateNode,v.props=f,v.state=o.memoizedState,v.refs={},Af(o),A=u.contextType,v.context=typeof A=="object"&&A!==null?zn(A):$o,v.state=o.memoizedState,A=u.getDerivedStateFromProps,typeof A=="function"&&(Zf(o,u,A,f),v.state=o.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(A=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),A!==v.state&&Xf.enqueueReplaceState(v,v.state,null),cc(o,f,v,y),lc(),v.state=o.memoizedState),typeof v.componentDidMount=="function"&&(o.flags|=4194308),f=!0}else if(s===null){v=o.stateNode;var M=o.memoizedProps,F=Ji(u,M);v.props=F;var J=v.context,le=u.contextType;A=$o,typeof le=="object"&&le!==null&&(A=zn(le));var ue=u.getDerivedStateFromProps;le=typeof ue=="function"||typeof v.getSnapshotBeforeUpdate=="function",M=o.pendingProps!==M,le||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(M||J!==A)&&Pb(o,v,f,A),Us=!1;var te=o.memoizedState;v.state=te,cc(o,f,v,y),lc(),J=o.memoizedState,M||te!==J||Us?(typeof ue=="function"&&(Zf(o,u,ue,f),J=o.memoizedState),(F=Us||Ib(o,u,F,f,te,J,A))?(le||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(o.flags|=4194308)):(typeof v.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=f,o.memoizedState=J),v.props=f,v.state=J,v.context=A,f=F):(typeof v.componentDidMount=="function"&&(o.flags|=4194308),f=!1)}else{v=o.stateNode,Tf(s,o),A=o.memoizedProps,le=Ji(u,A),v.props=le,ue=o.pendingProps,te=v.context,J=u.contextType,F=$o,typeof J=="object"&&J!==null&&(F=zn(J)),M=u.getDerivedStateFromProps,(J=typeof M=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(A!==ue||te!==F)&&Pb(o,v,f,F),Us=!1,te=o.memoizedState,v.state=te,cc(o,f,v,y),lc();var ie=o.memoizedState;A!==ue||te!==ie||Us||s!==null&&s.dependencies!==null&&ed(s.dependencies)?(typeof M=="function"&&(Zf(o,u,M,f),ie=o.memoizedState),(le=Us||Ib(o,u,le,f,te,ie,F)||s!==null&&s.dependencies!==null&&ed(s.dependencies))?(J||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(f,ie,F),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(f,ie,F)),typeof v.componentDidUpdate=="function"&&(o.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof v.componentDidUpdate!="function"||A===s.memoizedProps&&te===s.memoizedState||(o.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||A===s.memoizedProps&&te===s.memoizedState||(o.flags|=1024),o.memoizedProps=f,o.memoizedState=ie),v.props=f,v.state=ie,v.context=F,f=le):(typeof v.componentDidUpdate!="function"||A===s.memoizedProps&&te===s.memoizedState||(o.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||A===s.memoizedProps&&te===s.memoizedState||(o.flags|=1024),f=!1)}return v=f,vd(s,o),f=(o.flags&128)!==0,v||f?(v=o.stateNode,u=f&&typeof u.getDerivedStateFromError!="function"?null:v.render(),o.flags|=1,s!==null&&f?(o.child=Xi(o,s.child,null,y),o.child=Xi(o,null,u,y)):$n(s,o,u,y),o.memoizedState=v.state,s=o.child):s=rs(s,o,y),s}function Jb(s,o,u,f){return qi(),o.flags|=256,$n(s,o,u,f),o.child}var th={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function nh(s){return{baseLanes:s,cachePool:Hy()}}function ah(s,o,u){return s=s!==null?s.childLanes&~u:0,o&&(s|=Oa),s}function ev(s,o,u){var f=o.pendingProps,y=!1,v=(o.flags&128)!==0,A;if((A=v)||(A=s!==null&&s.memoizedState===null?!1:(sn.current&2)!==0),A&&(y=!0,o.flags&=-129),A=(o.flags&32)!==0,o.flags&=-33,s===null){if(kt){if(y?Vs(o):Ws(),(s=Ht)?(s=lx(s,Ya),s=s!==null&&s.data!=="&"?s:null,s!==null&&(o.memoizedState={dehydrated:s,treeContext:zs!==null?{id:Er,overflow:Nr}:null,retryLane:536870912,hydrationErrors:null},u=Oy(s),u.return=o,o.child=u,Pn=o,Ht=null)):s=null,s===null)throw Fs(o);return zh(s)?o.lanes=32:o.lanes=536870912,null}var M=f.children;return f=f.fallback,y?(Ws(),y=o.mode,M=xd({mode:"hidden",children:M},y),f=Gi(f,y,u,null),M.return=o,f.return=o,M.sibling=f,o.child=M,f=o.child,f.memoizedState=nh(u),f.childLanes=ah(s,A,u),o.memoizedState=th,hc(null,f)):(Vs(o),rh(o,M))}var F=s.memoizedState;if(F!==null&&(M=F.dehydrated,M!==null)){if(v)o.flags&256?(Vs(o),o.flags&=-257,o=sh(s,o,u)):o.memoizedState!==null?(Ws(),o.child=s.child,o.flags|=128,o=null):(Ws(),M=f.fallback,y=o.mode,f=xd({mode:"visible",children:f.children},y),M=Gi(M,y,u,null),M.flags|=2,f.return=o,M.return=o,f.sibling=M,o.child=f,Xi(o,s.child,null,u),f=o.child,f.memoizedState=nh(u),f.childLanes=ah(s,A,u),o.memoizedState=th,o=hc(null,f));else if(Vs(o),zh(M)){if(A=M.nextSibling&&M.nextSibling.dataset,A)var J=A.dgst;A=J,f=Error(a(419)),f.stack="",f.digest=A,nc({value:f,source:null,stack:null}),o=sh(s,o,u)}else if(hn||Go(s,o,u,!1),A=(u&s.childLanes)!==0,hn||A){if(A=Pt,A!==null&&(f=zl(A,u),f!==0&&f!==F.retryLane))throw F.retryLane=f,Ui(s,f),ya(A,s,f),Jf;Ph(M)||Nd(),o=sh(s,o,u)}else Ph(M)?(o.flags|=192,o.child=s.child,o=null):(s=F.treeContext,Ht=Xa(M.nextSibling),Pn=o,kt=!0,$s=null,Ya=!1,s!==null&&By(o,s),o=rh(o,f.children),o.flags|=4096);return o}return y?(Ws(),M=f.fallback,y=o.mode,F=s.child,J=F.sibling,f=Qr(F,{mode:"hidden",children:f.children}),f.subtreeFlags=F.subtreeFlags&65011712,J!==null?M=Qr(J,M):(M=Gi(M,y,u,null),M.flags|=2),M.return=o,f.return=o,f.sibling=M,o.child=f,hc(null,f),f=o.child,M=s.child.memoizedState,M===null?M=nh(u):(y=M.cachePool,y!==null?(F=pn._currentValue,y=y.parent!==F?{parent:F,pool:F}:y):y=Hy(),M={baseLanes:M.baseLanes|u,cachePool:y}),f.memoizedState=M,f.childLanes=ah(s,A,u),o.memoizedState=th,hc(s.child,f)):(Vs(o),u=s.child,s=u.sibling,u=Qr(u,{mode:"visible",children:f.children}),u.return=o,u.sibling=null,s!==null&&(A=o.deletions,A===null?(o.deletions=[s],o.flags|=16):A.push(s)),o.child=u,o.memoizedState=null,u)}function rh(s,o){return o=xd({mode:"visible",children:o},s.mode),o.return=s,s.child=o}function xd(s,o){return s=Na(22,s,null,o),s.lanes=0,s}function sh(s,o,u){return Xi(o,s.child,null,u),s=rh(o,o.pendingProps.children),s.flags|=2,o.memoizedState=null,s}function tv(s,o,u){s.lanes|=o;var f=s.alternate;f!==null&&(f.lanes|=o),xf(s.return,o,u)}function ih(s,o,u,f,y,v){var A=s.memoizedState;A===null?s.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:f,tail:u,tailMode:y,treeForkCount:v}:(A.isBackwards=o,A.rendering=null,A.renderingStartTime=0,A.last=f,A.tail=u,A.tailMode=y,A.treeForkCount=v)}function nv(s,o,u){var f=o.pendingProps,y=f.revealOrder,v=f.tail;f=f.children;var A=sn.current,M=(A&2)!==0;if(M?(A=A&1|2,o.flags|=128):A&=1,$e(sn,A),$n(s,o,f,u),f=kt?tc:0,!M&&s!==null&&(s.flags&128)!==0)e:for(s=o.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&tv(s,u,o);else if(s.tag===19)tv(s,u,o);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===o)break e;for(;s.sibling===null;){if(s.return===null||s.return===o)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(y){case"forwards":for(u=o.child,y=null;u!==null;)s=u.alternate,s!==null&&ld(s)===null&&(y=u),u=u.sibling;u=y,u===null?(y=o.child,o.child=null):(y=u.sibling,u.sibling=null),ih(o,!1,y,u,v,f);break;case"backwards":case"unstable_legacy-backwards":for(u=null,y=o.child,o.child=null;y!==null;){if(s=y.alternate,s!==null&&ld(s)===null){o.child=y;break}s=y.sibling,y.sibling=u,u=y,y=s}ih(o,!0,u,null,v,f);break;case"together":ih(o,!1,null,null,void 0,f);break;default:o.memoizedState=null}return o.child}function rs(s,o,u){if(s!==null&&(o.dependencies=s.dependencies),Zs|=o.lanes,(u&o.childLanes)===0)if(s!==null){if(Go(s,o,u,!1),(u&o.childLanes)===0)return null}else return null;if(s!==null&&o.child!==s.child)throw Error(a(153));if(o.child!==null){for(s=o.child,u=Qr(s,s.pendingProps),o.child=u,u.return=o;s.sibling!==null;)s=s.sibling,u=u.sibling=Qr(s,s.pendingProps),u.return=o;u.sibling=null}return o.child}function oh(s,o){return(s.lanes&o)!==0?!0:(s=s.dependencies,!!(s!==null&&ed(s)))}function y7(s,o,u){switch(o.tag){case 3:Un(o,o.stateNode.containerInfo),Hs(o,pn,s.memoizedState.cache),qi();break;case 27:case 5:cn(o);break;case 4:Un(o,o.stateNode.containerInfo);break;case 10:Hs(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,Mf(o),null;break;case 13:var f=o.memoizedState;if(f!==null)return f.dehydrated!==null?(Vs(o),o.flags|=128,null):(u&o.child.childLanes)!==0?ev(s,o,u):(Vs(o),s=rs(s,o,u),s!==null?s.sibling:null);Vs(o);break;case 19:var y=(s.flags&128)!==0;if(f=(u&o.childLanes)!==0,f||(Go(s,o,u,!1),f=(u&o.childLanes)!==0),y){if(f)return nv(s,o,u);o.flags|=128}if(y=o.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),$e(sn,sn.current),f)break;return null;case 22:return o.lanes=0,Kb(s,o,u,o.pendingProps);case 24:Hs(o,pn,s.memoizedState.cache)}return rs(s,o,u)}function av(s,o,u){if(s!==null)if(s.memoizedProps!==o.pendingProps)hn=!0;else{if(!oh(s,u)&&(o.flags&128)===0)return hn=!1,y7(s,o,u);hn=(s.flags&131072)!==0}else hn=!1,kt&&(o.flags&1048576)!==0&&jy(o,tc,o.index);switch(o.lanes=0,o.tag){case 16:e:{var f=o.pendingProps;if(s=Yi(o.elementType),o.type=s,typeof s=="function")pf(s)?(f=Ji(s,f),o.tag=1,o=Qb(null,o,s,f,u)):(o.tag=0,o=eh(null,o,s,f,u));else{if(s!=null){var y=s.$$typeof;if(y===D){o.tag=11,o=qb(null,o,s,f,u);break e}else if(y===K){o.tag=14,o=Vb(null,o,s,f,u);break e}}throw o=ge(s)||s,Error(a(306,o,""))}}return o;case 0:return eh(s,o,o.type,o.pendingProps,u);case 1:return f=o.type,y=Ji(f,o.pendingProps),Qb(s,o,f,y,u);case 3:e:{if(Un(o,o.stateNode.containerInfo),s===null)throw Error(a(387));f=o.pendingProps;var v=o.memoizedState;y=v.element,Tf(s,o),cc(o,f,null,u);var A=o.memoizedState;if(f=A.cache,Hs(o,pn,f),f!==v.cache&&wf(o,[pn],u,!0),lc(),f=A.element,v.isDehydrated)if(v={element:f,isDehydrated:!1,cache:A.cache},o.updateQueue.baseState=v,o.memoizedState=v,o.flags&256){o=Jb(s,o,f,u);break e}else if(f!==y){y=Va(Error(a(424)),o),nc(y),o=Jb(s,o,f,u);break e}else{switch(s=o.stateNode.containerInfo,s.nodeType){case 9:s=s.body;break;default:s=s.nodeName==="HTML"?s.ownerDocument.body:s}for(Ht=Xa(s.firstChild),Pn=o,kt=!0,$s=null,Ya=!0,u=Ky(o,null,f,u),o.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(qi(),f===y){o=rs(s,o,u);break e}$n(s,o,f,u)}o=o.child}return o;case 26:return vd(s,o),s===null?(u=hx(o.type,null,o.pendingProps,null))?o.memoizedState=u:kt||(u=o.type,s=o.pendingProps,f=Bd(Kn.current).createElement(u),f[kn]=o,f[Sn]=s,Fn(f,u,s),rn(f),o.stateNode=f):o.memoizedState=hx(o.type,s.memoizedProps,o.pendingProps,s.memoizedState),null;case 27:return cn(o),s===null&&kt&&(f=o.stateNode=dx(o.type,o.pendingProps,Kn.current),Pn=o,Ya=!0,y=Ht,ti(o.type)?($h=y,Ht=Xa(f.firstChild)):Ht=y),$n(s,o,o.pendingProps.children,u),vd(s,o),s===null&&(o.flags|=4194304),o.child;case 5:return s===null&&kt&&((y=f=Ht)&&(f=W7(f,o.type,o.pendingProps,Ya),f!==null?(o.stateNode=f,Pn=o,Ht=Xa(f.firstChild),Ya=!1,y=!0):y=!1),y||Fs(o)),cn(o),y=o.type,v=o.pendingProps,A=s!==null?s.memoizedProps:null,f=v.children,jh(y,v)?f=null:A!==null&&jh(y,A)&&(o.flags|=32),o.memoizedState!==null&&(y=Lf(s,o,l7,null,null,u),Nc._currentValue=y),vd(s,o),$n(s,o,f,u),o.child;case 6:return s===null&&kt&&((s=u=Ht)&&(u=K7(u,o.pendingProps,Ya),u!==null?(o.stateNode=u,Pn=o,Ht=null,s=!0):s=!1),s||Fs(o)),null;case 13:return ev(s,o,u);case 4:return Un(o,o.stateNode.containerInfo),f=o.pendingProps,s===null?o.child=Xi(o,null,f,u):$n(s,o,f,u),o.child;case 11:return qb(s,o,o.type,o.pendingProps,u);case 7:return $n(s,o,o.pendingProps,u),o.child;case 8:return $n(s,o,o.pendingProps.children,u),o.child;case 12:return $n(s,o,o.pendingProps.children,u),o.child;case 10:return f=o.pendingProps,Hs(o,o.type,f.value),$n(s,o,f.children,u),o.child;case 9:return y=o.type._context,f=o.pendingProps.children,Wi(o),y=zn(y),f=f(y),o.flags|=1,$n(s,o,f,u),o.child;case 14:return Vb(s,o,o.type,o.pendingProps,u);case 15:return Wb(s,o,o.type,o.pendingProps,u);case 19:return nv(s,o,u);case 31:return g7(s,o,u);case 22:return Kb(s,o,u,o.pendingProps);case 24:return Wi(o),f=zn(pn),s===null?(y=_f(),y===null&&(y=Pt,v=kf(),y.pooledCache=v,v.refCount++,v!==null&&(y.pooledCacheLanes|=u),y=v),o.memoizedState={parent:f,cache:y},Af(o),Hs(o,pn,y)):((s.lanes&u)!==0&&(Tf(s,o),cc(o,null,null,u),lc()),y=s.memoizedState,v=o.memoizedState,y.parent!==f?(y={parent:f,cache:f},o.memoizedState=y,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=y),Hs(o,pn,f)):(f=v.cache,Hs(o,pn,f),f!==y.cache&&wf(o,[pn],u,!0))),$n(s,o,o.pendingProps.children,u),o.child;case 29:throw o.pendingProps}throw Error(a(156,o.tag))}function ss(s){s.flags|=4}function lh(s,o,u,f,y){if((o=(s.mode&32)!==0)&&(o=!1),o){if(s.flags|=16777216,(y&335544128)===y)if(s.stateNode.complete)s.flags|=8192;else if(Rv())s.flags|=8192;else throw Zi=rd,Cf}else s.flags&=-16777217}function rv(s,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!vx(o))if(Rv())s.flags|=8192;else throw Zi=rd,Cf}function wd(s,o){o!==null&&(s.flags|=4),s.flags&16384&&(o=s.tag!==22?Oi():536870912,s.lanes|=o,nl|=o)}function mc(s,o){if(!kt)switch(s.tailMode){case"hidden":o=s.tail;for(var u=null;o!==null;)o.alternate!==null&&(u=o),o=o.sibling;u===null?s.tail=null:u.sibling=null;break;case"collapsed":u=s.tail;for(var f=null;u!==null;)u.alternate!==null&&(f=u),u=u.sibling;f===null?o||s.tail===null?s.tail=null:s.tail.sibling=null:f.sibling=null}}function Ut(s){var o=s.alternate!==null&&s.alternate.child===s.child,u=0,f=0;if(o)for(var y=s.child;y!==null;)u|=y.lanes|y.childLanes,f|=y.subtreeFlags&65011712,f|=y.flags&65011712,y.return=s,y=y.sibling;else for(y=s.child;y!==null;)u|=y.lanes|y.childLanes,f|=y.subtreeFlags,f|=y.flags,y.return=s,y=y.sibling;return s.subtreeFlags|=f,s.childLanes=u,o}function b7(s,o,u){var f=o.pendingProps;switch(gf(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ut(o),null;case 1:return Ut(o),null;case 3:return u=o.stateNode,f=null,s!==null&&(f=s.memoizedState.cache),o.memoizedState.cache!==f&&(o.flags|=2048),ts(pn),Ye(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(s===null||s.child===null)&&(Uo(o)?ss(o):s===null||s.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,bf())),Ut(o),null;case 26:var y=o.type,v=o.memoizedState;return s===null?(ss(o),v!==null?(Ut(o),rv(o,v)):(Ut(o),lh(o,y,null,f,u))):v?v!==s.memoizedState?(ss(o),Ut(o),rv(o,v)):(Ut(o),o.flags&=-16777217):(s=s.memoizedProps,s!==f&&ss(o),Ut(o),lh(o,y,s,f,u)),null;case 27:if(oa(o),u=Kn.current,y=o.type,s!==null&&o.stateNode!=null)s.memoizedProps!==f&&ss(o);else{if(!f){if(o.stateNode===null)throw Error(a(166));return Ut(o),null}s=ft.current,Uo(o)?Iy(o):(s=dx(y,f,u),o.stateNode=s,ss(o))}return Ut(o),null;case 5:if(oa(o),y=o.type,s!==null&&o.stateNode!=null)s.memoizedProps!==f&&ss(o);else{if(!f){if(o.stateNode===null)throw Error(a(166));return Ut(o),null}if(v=ft.current,Uo(o))Iy(o);else{var A=Bd(Kn.current);switch(v){case 1:v=A.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:v=A.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":v=A.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":v=A.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":v=A.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof f.is=="string"?A.createElement("select",{is:f.is}):A.createElement("select"),f.multiple?v.multiple=!0:f.size&&(v.size=f.size);break;default:v=typeof f.is=="string"?A.createElement(y,{is:f.is}):A.createElement(y)}}v[kn]=o,v[Sn]=f;e:for(A=o.child;A!==null;){if(A.tag===5||A.tag===6)v.appendChild(A.stateNode);else if(A.tag!==4&&A.tag!==27&&A.child!==null){A.child.return=A,A=A.child;continue}if(A===o)break e;for(;A.sibling===null;){if(A.return===null||A.return===o)break e;A=A.return}A.sibling.return=A.return,A=A.sibling}o.stateNode=v;e:switch(Fn(v,y,f),y){case"button":case"input":case"select":case"textarea":f=!!f.autoFocus;break e;case"img":f=!0;break e;default:f=!1}f&&ss(o)}}return Ut(o),lh(o,o.type,s===null?null:s.memoizedProps,o.pendingProps,u),null;case 6:if(s&&o.stateNode!=null)s.memoizedProps!==f&&ss(o);else{if(typeof f!="string"&&o.stateNode===null)throw Error(a(166));if(s=Kn.current,Uo(o)){if(s=o.stateNode,u=o.memoizedProps,f=null,y=Pn,y!==null)switch(y.tag){case 27:case 5:f=y.memoizedProps}s[kn]=o,s=!!(s.nodeValue===u||f!==null&&f.suppressHydrationWarning===!0||ex(s.nodeValue,u)),s||Fs(o,!0)}else s=Bd(s).createTextNode(f),s[kn]=o,o.stateNode=s}return Ut(o),null;case 31:if(u=o.memoizedState,s===null||s.memoizedState!==null){if(f=Uo(o),u!==null){if(s===null){if(!f)throw Error(a(318));if(s=o.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(a(557));s[kn]=o}else qi(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Ut(o),s=!1}else u=bf(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=u),s=!0;if(!s)return o.flags&256?(Da(o),o):(Da(o),null);if((o.flags&128)!==0)throw Error(a(558))}return Ut(o),null;case 13:if(f=o.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(y=Uo(o),f!==null&&f.dehydrated!==null){if(s===null){if(!y)throw Error(a(318));if(y=o.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(a(317));y[kn]=o}else qi(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Ut(o),y=!1}else y=bf(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=y),y=!0;if(!y)return o.flags&256?(Da(o),o):(Da(o),null)}return Da(o),(o.flags&128)!==0?(o.lanes=u,o):(u=f!==null,s=s!==null&&s.memoizedState!==null,u&&(f=o.child,y=null,f.alternate!==null&&f.alternate.memoizedState!==null&&f.alternate.memoizedState.cachePool!==null&&(y=f.alternate.memoizedState.cachePool.pool),v=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(v=f.memoizedState.cachePool.pool),v!==y&&(f.flags|=2048)),u!==s&&u&&(o.child.flags|=8192),wd(o,o.updateQueue),Ut(o),null);case 4:return Ye(),s===null&&Rh(o.stateNode.containerInfo),Ut(o),null;case 10:return ts(o.type),Ut(o),null;case 19:if(He(sn),f=o.memoizedState,f===null)return Ut(o),null;if(y=(o.flags&128)!==0,v=f.rendering,v===null)if(y)mc(f,!1);else{if(Jt!==0||s!==null&&(s.flags&128)!==0)for(s=o.child;s!==null;){if(v=ld(s),v!==null){for(o.flags|=128,mc(f,!1),s=v.updateQueue,o.updateQueue=s,wd(o,s),o.subtreeFlags=0,s=u,u=o.child;u!==null;)My(u,s),u=u.sibling;return $e(sn,sn.current&1|2),kt&&Jr(o,f.treeForkCount),o.child}s=s.sibling}f.tail!==null&&It()>Ad&&(o.flags|=128,y=!0,mc(f,!1),o.lanes=4194304)}else{if(!y)if(s=ld(v),s!==null){if(o.flags|=128,y=!0,s=s.updateQueue,o.updateQueue=s,wd(o,s),mc(f,!0),f.tail===null&&f.tailMode==="hidden"&&!v.alternate&&!kt)return Ut(o),null}else 2*It()-f.renderingStartTime>Ad&&u!==536870912&&(o.flags|=128,y=!0,mc(f,!1),o.lanes=4194304);f.isBackwards?(v.sibling=o.child,o.child=v):(s=f.last,s!==null?s.sibling=v:o.child=v,f.last=v)}return f.tail!==null?(s=f.tail,f.rendering=s,f.tail=s.sibling,f.renderingStartTime=It(),s.sibling=null,u=sn.current,$e(sn,y?u&1|2:u&1),kt&&Jr(o,f.treeForkCount),s):(Ut(o),null);case 22:case 23:return Da(o),Df(),f=o.memoizedState!==null,s!==null?s.memoizedState!==null!==f&&(o.flags|=8192):f&&(o.flags|=8192),f?(u&536870912)!==0&&(o.flags&128)===0&&(Ut(o),o.subtreeFlags&6&&(o.flags|=8192)):Ut(o),u=o.updateQueue,u!==null&&wd(o,u.retryQueue),u=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(u=s.memoizedState.cachePool.pool),f=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(f=o.memoizedState.cachePool.pool),f!==u&&(o.flags|=2048),s!==null&&He(Ki),null;case 24:return u=null,s!==null&&(u=s.memoizedState.cache),o.memoizedState.cache!==u&&(o.flags|=2048),ts(pn),Ut(o),null;case 25:return null;case 30:return null}throw Error(a(156,o.tag))}function v7(s,o){switch(gf(o),o.tag){case 1:return s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 3:return ts(pn),Ye(),s=o.flags,(s&65536)!==0&&(s&128)===0?(o.flags=s&-65537|128,o):null;case 26:case 27:case 5:return oa(o),null;case 31:if(o.memoizedState!==null){if(Da(o),o.alternate===null)throw Error(a(340));qi()}return s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 13:if(Da(o),s=o.memoizedState,s!==null&&s.dehydrated!==null){if(o.alternate===null)throw Error(a(340));qi()}return s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 19:return He(sn),null;case 4:return Ye(),null;case 10:return ts(o.type),null;case 22:case 23:return Da(o),Df(),s!==null&&He(Ki),s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 24:return ts(pn),null;case 25:return null;default:return null}}function sv(s,o){switch(gf(o),o.tag){case 3:ts(pn),Ye();break;case 26:case 27:case 5:oa(o);break;case 4:Ye();break;case 31:o.memoizedState!==null&&Da(o);break;case 13:Da(o);break;case 19:He(sn);break;case 10:ts(o.type);break;case 22:case 23:Da(o),Df(),s!==null&&He(Ki);break;case 24:ts(pn)}}function gc(s,o){try{var u=o.updateQueue,f=u!==null?u.lastEffect:null;if(f!==null){var y=f.next;u=y;do{if((u.tag&s)===s){f=void 0;var v=u.create,A=u.inst;f=v(),A.destroy=f}u=u.next}while(u!==y)}}catch(M){Ot(o,o.return,M)}}function Ks(s,o,u){try{var f=o.updateQueue,y=f!==null?f.lastEffect:null;if(y!==null){var v=y.next;f=v;do{if((f.tag&s)===s){var A=f.inst,M=A.destroy;if(M!==void 0){A.destroy=void 0,y=o;var F=u,J=M;try{J()}catch(le){Ot(y,F,le)}}}f=f.next}while(f!==v)}}catch(le){Ot(o,o.return,le)}}function iv(s){var o=s.updateQueue;if(o!==null){var u=s.stateNode;try{Zy(o,u)}catch(f){Ot(s,s.return,f)}}}function ov(s,o,u){u.props=Ji(s.type,s.memoizedProps),u.state=s.memoizedState;try{u.componentWillUnmount()}catch(f){Ot(s,o,f)}}function yc(s,o){try{var u=s.ref;if(u!==null){switch(s.tag){case 26:case 27:case 5:var f=s.stateNode;break;case 30:f=s.stateNode;break;default:f=s.stateNode}typeof u=="function"?s.refCleanup=u(f):u.current=f}}catch(y){Ot(s,o,y)}}function Rr(s,o){var u=s.ref,f=s.refCleanup;if(u!==null)if(typeof f=="function")try{f()}catch(y){Ot(s,o,y)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(y){Ot(s,o,y)}else u.current=null}function lv(s){var o=s.type,u=s.memoizedProps,f=s.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":u.autoFocus&&f.focus();break e;case"img":u.src?f.src=u.src:u.srcSet&&(f.srcset=u.srcSet)}}catch(y){Ot(s,s.return,y)}}function ch(s,o,u){try{var f=s.stateNode;F7(f,s.type,u,o),f[Sn]=o}catch(y){Ot(s,s.return,y)}}function cv(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&ti(s.type)||s.tag===4}function uh(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||cv(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&ti(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function dh(s,o,u){var f=s.tag;if(f===5||f===6)s=s.stateNode,o?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(s,o):(o=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,o.appendChild(s),u=u._reactRootContainer,u!=null||o.onclick!==null||(o.onclick=lt));else if(f!==4&&(f===27&&ti(s.type)&&(u=s.stateNode,o=null),s=s.child,s!==null))for(dh(s,o,u),s=s.sibling;s!==null;)dh(s,o,u),s=s.sibling}function kd(s,o,u){var f=s.tag;if(f===5||f===6)s=s.stateNode,o?u.insertBefore(s,o):u.appendChild(s);else if(f!==4&&(f===27&&ti(s.type)&&(u=s.stateNode),s=s.child,s!==null))for(kd(s,o,u),s=s.sibling;s!==null;)kd(s,o,u),s=s.sibling}function uv(s){var o=s.stateNode,u=s.memoizedProps;try{for(var f=s.type,y=o.attributes;y.length;)o.removeAttributeNode(y[0]);Fn(o,f,u),o[kn]=s,o[Sn]=u}catch(v){Ot(s,s.return,v)}}var is=!1,mn=!1,ph=!1,dv=typeof WeakSet=="function"?WeakSet:Set,On=null;function x7(s,o){if(s=s.containerInfo,Oh=Ud,s=Sy(s),rf(s)){if("selectionStart"in s)var u={start:s.selectionStart,end:s.selectionEnd};else e:{u=(u=s.ownerDocument)&&u.defaultView||window;var f=u.getSelection&&u.getSelection();if(f&&f.rangeCount!==0){u=f.anchorNode;var y=f.anchorOffset,v=f.focusNode;f=f.focusOffset;try{u.nodeType,v.nodeType}catch{u=null;break e}var A=0,M=-1,F=-1,J=0,le=0,ue=s,te=null;t:for(;;){for(var ie;ue!==u||y!==0&&ue.nodeType!==3||(M=A+y),ue!==v||f!==0&&ue.nodeType!==3||(F=A+f),ue.nodeType===3&&(A+=ue.nodeValue.length),(ie=ue.firstChild)!==null;)te=ue,ue=ie;for(;;){if(ue===s)break t;if(te===u&&++J===y&&(M=A),te===v&&++le===f&&(F=A),(ie=ue.nextSibling)!==null)break;ue=te,te=ue.parentNode}ue=ie}u=M===-1||F===-1?null:{start:M,end:F}}else u=null}u=u||{start:0,end:0}}else u=null;for(Lh={focusedElem:s,selectionRange:u},Ud=!1,On=o;On!==null;)if(o=On,s=o.child,(o.subtreeFlags&1028)!==0&&s!==null)s.return=o,On=s;else for(;On!==null;){switch(o=On,v=o.alternate,s=o.flags,o.tag){case 0:if((s&4)!==0&&(s=o.updateQueue,s=s!==null?s.events:null,s!==null))for(u=0;u<s.length;u++)y=s[u],y.ref.impl=y.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&v!==null){s=void 0,u=o,y=v.memoizedProps,v=v.memoizedState,f=u.stateNode;try{var Re=Ji(u.type,y);s=f.getSnapshotBeforeUpdate(Re,v),f.__reactInternalSnapshotBeforeUpdate=s}catch(We){Ot(u,u.return,We)}}break;case 3:if((s&1024)!==0){if(s=o.stateNode.containerInfo,u=s.nodeType,u===9)Ih(s);else if(u===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":Ih(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((s&1024)!==0)throw Error(a(163))}if(s=o.sibling,s!==null){s.return=o.return,On=s;break}On=o.return}}function pv(s,o,u){var f=u.flags;switch(u.tag){case 0:case 11:case 15:ls(s,u),f&4&&gc(5,u);break;case 1:if(ls(s,u),f&4)if(s=u.stateNode,o===null)try{s.componentDidMount()}catch(A){Ot(u,u.return,A)}else{var y=Ji(u.type,o.memoizedProps);o=o.memoizedState;try{s.componentDidUpdate(y,o,s.__reactInternalSnapshotBeforeUpdate)}catch(A){Ot(u,u.return,A)}}f&64&&iv(u),f&512&&yc(u,u.return);break;case 3:if(ls(s,u),f&64&&(s=u.updateQueue,s!==null)){if(o=null,u.child!==null)switch(u.child.tag){case 27:case 5:o=u.child.stateNode;break;case 1:o=u.child.stateNode}try{Zy(s,o)}catch(A){Ot(u,u.return,A)}}break;case 27:o===null&&f&4&&uv(u);case 26:case 5:ls(s,u),o===null&&f&4&&lv(u),f&512&&yc(u,u.return);break;case 12:ls(s,u);break;case 31:ls(s,u),f&4&&mv(s,u);break;case 13:ls(s,u),f&4&&gv(s,u),f&64&&(s=u.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(u=N7.bind(null,u),Y7(s,u))));break;case 22:if(f=u.memoizedState!==null||is,!f){o=o!==null&&o.memoizedState!==null||mn,y=is;var v=mn;is=f,(mn=o)&&!v?cs(s,u,(u.subtreeFlags&8772)!==0):ls(s,u),is=y,mn=v}break;case 30:break;default:ls(s,u)}}function fv(s){var o=s.alternate;o!==null&&(s.alternate=null,fv(o)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(o=s.stateNode,o!==null&&Ls(o)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var Gt=null,fa=!1;function os(s,o,u){for(u=u.child;u!==null;)hv(s,o,u),u=u.sibling}function hv(s,o,u){if(nn&&typeof nn.onCommitFiberUnmount=="function")try{nn.onCommitFiberUnmount(Zn,u)}catch{}switch(u.tag){case 26:mn||Rr(u,o),os(s,o,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:mn||Rr(u,o);var f=Gt,y=fa;ti(u.type)&&(Gt=u.stateNode,fa=!1),os(s,o,u),Ac(u.stateNode),Gt=f,fa=y;break;case 5:mn||Rr(u,o);case 6:if(f=Gt,y=fa,Gt=null,os(s,o,u),Gt=f,fa=y,Gt!==null)if(fa)try{(Gt.nodeType===9?Gt.body:Gt.nodeName==="HTML"?Gt.ownerDocument.body:Gt).removeChild(u.stateNode)}catch(v){Ot(u,o,v)}else try{Gt.removeChild(u.stateNode)}catch(v){Ot(u,o,v)}break;case 18:Gt!==null&&(fa?(s=Gt,ix(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,u.stateNode),ul(s)):ix(Gt,u.stateNode));break;case 4:f=Gt,y=fa,Gt=u.stateNode.containerInfo,fa=!0,os(s,o,u),Gt=f,fa=y;break;case 0:case 11:case 14:case 15:Ks(2,u,o),mn||Ks(4,u,o),os(s,o,u);break;case 1:mn||(Rr(u,o),f=u.stateNode,typeof f.componentWillUnmount=="function"&&ov(u,o,f)),os(s,o,u);break;case 21:os(s,o,u);break;case 22:mn=(f=mn)||u.memoizedState!==null,os(s,o,u),mn=f;break;default:os(s,o,u)}}function mv(s,o){if(o.memoizedState===null&&(s=o.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{ul(s)}catch(u){Ot(o,o.return,u)}}}function gv(s,o){if(o.memoizedState===null&&(s=o.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{ul(s)}catch(u){Ot(o,o.return,u)}}function w7(s){switch(s.tag){case 31:case 13:case 19:var o=s.stateNode;return o===null&&(o=s.stateNode=new dv),o;case 22:return s=s.stateNode,o=s._retryCache,o===null&&(o=s._retryCache=new dv),o;default:throw Error(a(435,s.tag))}}function Sd(s,o){var u=w7(s);o.forEach(function(f){if(!u.has(f)){u.add(f);var y=R7.bind(null,s,f);f.then(y,y)}})}function ha(s,o){var u=o.deletions;if(u!==null)for(var f=0;f<u.length;f++){var y=u[f],v=s,A=o,M=A;e:for(;M!==null;){switch(M.tag){case 27:if(ti(M.type)){Gt=M.stateNode,fa=!1;break e}break;case 5:Gt=M.stateNode,fa=!1;break e;case 3:case 4:Gt=M.stateNode.containerInfo,fa=!0;break e}M=M.return}if(Gt===null)throw Error(a(160));hv(v,A,y),Gt=null,fa=!1,v=y.alternate,v!==null&&(v.return=null),y.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)yv(o,s),o=o.sibling}var hr=null;function yv(s,o){var u=s.alternate,f=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:ha(o,s),ma(s),f&4&&(Ks(3,s,s.return),gc(3,s),Ks(5,s,s.return));break;case 1:ha(o,s),ma(s),f&512&&(mn||u===null||Rr(u,u.return)),f&64&&is&&(s=s.updateQueue,s!==null&&(f=s.callbacks,f!==null&&(u=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=u===null?f:u.concat(f))));break;case 26:var y=hr;if(ha(o,s),ma(s),f&512&&(mn||u===null||Rr(u,u.return)),f&4){var v=u!==null?u.memoizedState:null;if(f=s.memoizedState,u===null)if(f===null)if(s.stateNode===null){e:{f=s.type,u=s.memoizedProps,y=y.ownerDocument||y;t:switch(f){case"title":v=y.getElementsByTagName("title")[0],(!v||v[Os]||v[kn]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=y.createElement(f),y.head.insertBefore(v,y.querySelector("head > title"))),Fn(v,f,u),v[kn]=s,rn(v),f=v;break e;case"link":var A=yx("link","href",y).get(f+(u.href||""));if(A){for(var M=0;M<A.length;M++)if(v=A[M],v.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&v.getAttribute("rel")===(u.rel==null?null:u.rel)&&v.getAttribute("title")===(u.title==null?null:u.title)&&v.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){A.splice(M,1);break t}}v=y.createElement(f),Fn(v,f,u),y.head.appendChild(v);break;case"meta":if(A=yx("meta","content",y).get(f+(u.content||""))){for(M=0;M<A.length;M++)if(v=A[M],v.getAttribute("content")===(u.content==null?null:""+u.content)&&v.getAttribute("name")===(u.name==null?null:u.name)&&v.getAttribute("property")===(u.property==null?null:u.property)&&v.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&v.getAttribute("charset")===(u.charSet==null?null:u.charSet)){A.splice(M,1);break t}}v=y.createElement(f),Fn(v,f,u),y.head.appendChild(v);break;default:throw Error(a(468,f))}v[kn]=s,rn(v),f=v}s.stateNode=f}else bx(y,s.type,s.stateNode);else s.stateNode=gx(y,f,s.memoizedProps);else v!==f?(v===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):v.count--,f===null?bx(y,s.type,s.stateNode):gx(y,f,s.memoizedProps)):f===null&&s.stateNode!==null&&ch(s,s.memoizedProps,u.memoizedProps)}break;case 27:ha(o,s),ma(s),f&512&&(mn||u===null||Rr(u,u.return)),u!==null&&f&4&&ch(s,s.memoizedProps,u.memoizedProps);break;case 5:if(ha(o,s),ma(s),f&512&&(mn||u===null||Rr(u,u.return)),s.flags&32){y=s.stateNode;try{Ps(y,"")}catch(Re){Ot(s,s.return,Re)}}f&4&&s.stateNode!=null&&(y=s.memoizedProps,ch(s,y,u!==null?u.memoizedProps:y)),f&1024&&(ph=!0);break;case 6:if(ha(o,s),ma(s),f&4){if(s.stateNode===null)throw Error(a(162));f=s.memoizedProps,u=s.stateNode;try{u.nodeValue=f}catch(Re){Ot(s,s.return,Re)}}break;case 3:if(zd=null,y=hr,hr=Id(o.containerInfo),ha(o,s),hr=y,ma(s),f&4&&u!==null&&u.memoizedState.isDehydrated)try{ul(o.containerInfo)}catch(Re){Ot(s,s.return,Re)}ph&&(ph=!1,bv(s));break;case 4:f=hr,hr=Id(s.stateNode.containerInfo),ha(o,s),ma(s),hr=f;break;case 12:ha(o,s),ma(s);break;case 31:ha(o,s),ma(s),f&4&&(f=s.updateQueue,f!==null&&(s.updateQueue=null,Sd(s,f)));break;case 13:ha(o,s),ma(s),s.child.flags&8192&&s.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Cd=It()),f&4&&(f=s.updateQueue,f!==null&&(s.updateQueue=null,Sd(s,f)));break;case 22:y=s.memoizedState!==null;var F=u!==null&&u.memoizedState!==null,J=is,le=mn;if(is=J||y,mn=le||F,ha(o,s),mn=le,is=J,ma(s),f&8192)e:for(o=s.stateNode,o._visibility=y?o._visibility&-2:o._visibility|1,y&&(u===null||F||is||mn||eo(s)),u=null,o=s;;){if(o.tag===5||o.tag===26){if(u===null){F=u=o;try{if(v=F.stateNode,y)A=v.style,typeof A.setProperty=="function"?A.setProperty("display","none","important"):A.display="none";else{M=F.stateNode;var ue=F.memoizedProps.style,te=ue!=null&&ue.hasOwnProperty("display")?ue.display:null;M.style.display=te==null||typeof te=="boolean"?"":(""+te).trim()}}catch(Re){Ot(F,F.return,Re)}}}else if(o.tag===6){if(u===null){F=o;try{F.stateNode.nodeValue=y?"":F.memoizedProps}catch(Re){Ot(F,F.return,Re)}}}else if(o.tag===18){if(u===null){F=o;try{var ie=F.stateNode;y?ox(ie,!0):ox(F.stateNode,!1)}catch(Re){Ot(F,F.return,Re)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===s)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===s)break e;for(;o.sibling===null;){if(o.return===null||o.return===s)break e;u===o&&(u=null),o=o.return}u===o&&(u=null),o.sibling.return=o.return,o=o.sibling}f&4&&(f=s.updateQueue,f!==null&&(u=f.retryQueue,u!==null&&(f.retryQueue=null,Sd(s,u))));break;case 19:ha(o,s),ma(s),f&4&&(f=s.updateQueue,f!==null&&(s.updateQueue=null,Sd(s,f)));break;case 30:break;case 21:break;default:ha(o,s),ma(s)}}function ma(s){var o=s.flags;if(o&2){try{for(var u,f=s.return;f!==null;){if(cv(f)){u=f;break}f=f.return}if(u==null)throw Error(a(160));switch(u.tag){case 27:var y=u.stateNode,v=uh(s);kd(s,v,y);break;case 5:var A=u.stateNode;u.flags&32&&(Ps(A,""),u.flags&=-33);var M=uh(s);kd(s,M,A);break;case 3:case 4:var F=u.stateNode.containerInfo,J=uh(s);dh(s,J,F);break;default:throw Error(a(161))}}catch(le){Ot(s,s.return,le)}s.flags&=-3}o&4096&&(s.flags&=-4097)}function bv(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var o=s;bv(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),s=s.sibling}}function ls(s,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)pv(s,o.alternate,o),o=o.sibling}function eo(s){for(s=s.child;s!==null;){var o=s;switch(o.tag){case 0:case 11:case 14:case 15:Ks(4,o,o.return),eo(o);break;case 1:Rr(o,o.return);var u=o.stateNode;typeof u.componentWillUnmount=="function"&&ov(o,o.return,u),eo(o);break;case 27:Ac(o.stateNode);case 26:case 5:Rr(o,o.return),eo(o);break;case 22:o.memoizedState===null&&eo(o);break;case 30:eo(o);break;default:eo(o)}s=s.sibling}}function cs(s,o,u){for(u=u&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var f=o.alternate,y=s,v=o,A=v.flags;switch(v.tag){case 0:case 11:case 15:cs(y,v,u),gc(4,v);break;case 1:if(cs(y,v,u),f=v,y=f.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(J){Ot(f,f.return,J)}if(f=v,y=f.updateQueue,y!==null){var M=f.stateNode;try{var F=y.shared.hiddenCallbacks;if(F!==null)for(y.shared.hiddenCallbacks=null,y=0;y<F.length;y++)Yy(F[y],M)}catch(J){Ot(f,f.return,J)}}u&&A&64&&iv(v),yc(v,v.return);break;case 27:uv(v);case 26:case 5:cs(y,v,u),u&&f===null&&A&4&&lv(v),yc(v,v.return);break;case 12:cs(y,v,u);break;case 31:cs(y,v,u),u&&A&4&&mv(y,v);break;case 13:cs(y,v,u),u&&A&4&&gv(y,v);break;case 22:v.memoizedState===null&&cs(y,v,u),yc(v,v.return);break;case 30:break;default:cs(y,v,u)}o=o.sibling}}function fh(s,o){var u=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(u=s.memoizedState.cachePool.pool),s=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(s=o.memoizedState.cachePool.pool),s!==u&&(s!=null&&s.refCount++,u!=null&&ac(u))}function hh(s,o){s=null,o.alternate!==null&&(s=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==s&&(o.refCount++,s!=null&&ac(s))}function mr(s,o,u,f){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)vv(s,o,u,f),o=o.sibling}function vv(s,o,u,f){var y=o.flags;switch(o.tag){case 0:case 11:case 15:mr(s,o,u,f),y&2048&&gc(9,o);break;case 1:mr(s,o,u,f);break;case 3:mr(s,o,u,f),y&2048&&(s=null,o.alternate!==null&&(s=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==s&&(o.refCount++,s!=null&&ac(s)));break;case 12:if(y&2048){mr(s,o,u,f),s=o.stateNode;try{var v=o.memoizedProps,A=v.id,M=v.onPostCommit;typeof M=="function"&&M(A,o.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(F){Ot(o,o.return,F)}}else mr(s,o,u,f);break;case 31:mr(s,o,u,f);break;case 13:mr(s,o,u,f);break;case 23:break;case 22:v=o.stateNode,A=o.alternate,o.memoizedState!==null?v._visibility&2?mr(s,o,u,f):bc(s,o):v._visibility&2?mr(s,o,u,f):(v._visibility|=2,Jo(s,o,u,f,(o.subtreeFlags&10256)!==0||!1)),y&2048&&fh(A,o);break;case 24:mr(s,o,u,f),y&2048&&hh(o.alternate,o);break;default:mr(s,o,u,f)}}function Jo(s,o,u,f,y){for(y=y&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var v=s,A=o,M=u,F=f,J=A.flags;switch(A.tag){case 0:case 11:case 15:Jo(v,A,M,F,y),gc(8,A);break;case 23:break;case 22:var le=A.stateNode;A.memoizedState!==null?le._visibility&2?Jo(v,A,M,F,y):bc(v,A):(le._visibility|=2,Jo(v,A,M,F,y)),y&&J&2048&&fh(A.alternate,A);break;case 24:Jo(v,A,M,F,y),y&&J&2048&&hh(A.alternate,A);break;default:Jo(v,A,M,F,y)}o=o.sibling}}function bc(s,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var u=s,f=o,y=f.flags;switch(f.tag){case 22:bc(u,f),y&2048&&fh(f.alternate,f);break;case 24:bc(u,f),y&2048&&hh(f.alternate,f);break;default:bc(u,f)}o=o.sibling}}var vc=8192;function el(s,o,u){if(s.subtreeFlags&vc)for(s=s.child;s!==null;)xv(s,o,u),s=s.sibling}function xv(s,o,u){switch(s.tag){case 26:el(s,o,u),s.flags&vc&&s.memoizedState!==null&&o8(u,hr,s.memoizedState,s.memoizedProps);break;case 5:el(s,o,u);break;case 3:case 4:var f=hr;hr=Id(s.stateNode.containerInfo),el(s,o,u),hr=f;break;case 22:s.memoizedState===null&&(f=s.alternate,f!==null&&f.memoizedState!==null?(f=vc,vc=16777216,el(s,o,u),vc=f):el(s,o,u));break;default:el(s,o,u)}}function wv(s){var o=s.alternate;if(o!==null&&(s=o.child,s!==null)){o.child=null;do o=s.sibling,s.sibling=null,s=o;while(s!==null)}}function xc(s){var o=s.deletions;if((s.flags&16)!==0){if(o!==null)for(var u=0;u<o.length;u++){var f=o[u];On=f,Sv(f,s)}wv(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)kv(s),s=s.sibling}function kv(s){switch(s.tag){case 0:case 11:case 15:xc(s),s.flags&2048&&Ks(9,s,s.return);break;case 3:xc(s);break;case 12:xc(s);break;case 22:var o=s.stateNode;s.memoizedState!==null&&o._visibility&2&&(s.return===null||s.return.tag!==13)?(o._visibility&=-3,_d(s)):xc(s);break;default:xc(s)}}function _d(s){var o=s.deletions;if((s.flags&16)!==0){if(o!==null)for(var u=0;u<o.length;u++){var f=o[u];On=f,Sv(f,s)}wv(s)}for(s=s.child;s!==null;){switch(o=s,o.tag){case 0:case 11:case 15:Ks(8,o,o.return),_d(o);break;case 22:u=o.stateNode,u._visibility&2&&(u._visibility&=-3,_d(o));break;default:_d(o)}s=s.sibling}}function Sv(s,o){for(;On!==null;){var u=On;switch(u.tag){case 0:case 11:case 15:Ks(8,u,o);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var f=u.memoizedState.cachePool.pool;f!=null&&f.refCount++}break;case 24:ac(u.memoizedState.cache)}if(f=u.child,f!==null)f.return=u,On=f;else e:for(u=s;On!==null;){f=On;var y=f.sibling,v=f.return;if(fv(f),f===u){On=null;break e}if(y!==null){y.return=v,On=y;break e}On=v}}}var k7={getCacheForType:function(s){var o=zn(pn),u=o.data.get(s);return u===void 0&&(u=s(),o.data.set(s,u)),u},cacheSignal:function(){return zn(pn).controller.signal}},S7=typeof WeakMap=="function"?WeakMap:Map,Tt=0,Pt=null,gt=null,vt=0,Mt=0,Ma=null,Ys=!1,tl=!1,mh=!1,us=0,Jt=0,Zs=0,to=0,gh=0,Oa=0,nl=0,wc=null,ga=null,yh=!1,Cd=0,_v=0,Ad=1/0,Td=null,Xs=null,_n=0,Qs=null,al=null,ds=0,bh=0,vh=null,Cv=null,kc=0,xh=null;function La(){return(Tt&2)!==0&&vt!==0?vt&-vt:P.T!==null?Ah():Ro()}function Av(){if(Oa===0)if((vt&536870912)===0||kt){var s=dn;dn<<=1,(dn&3932160)===0&&(dn=262144),Oa=s}else Oa=536870912;return s=Ra.current,s!==null&&(s.flags|=32),Oa}function ya(s,o,u){(s===Pt&&(Mt===2||Mt===9)||s.cancelPendingCommit!==null)&&(rl(s,0),Js(s,vt,Oa,!1)),dr(s,u),((Tt&2)===0||s!==Pt)&&(s===Pt&&((Tt&2)===0&&(to|=u),Jt===4&&Js(s,vt,Oa,!1)),Dr(s))}function Tv(s,o,u){if((Tt&6)!==0)throw Error(a(327));var f=!u&&(o&127)===0&&(o&s.expiredLanes)===0||Ft(s,o),y=f?A7(s,o):kh(s,o,!0),v=f;do{if(y===0){tl&&!f&&Js(s,o,0,!1);break}else{if(u=s.current.alternate,v&&!_7(u)){y=kh(s,o,!1),v=!1;continue}if(y===2){if(v=o,s.errorRecoveryDisabledLanes&v)var A=0;else A=s.pendingLanes&-536870913,A=A!==0?A:A&536870912?536870912:0;if(A!==0){o=A;e:{var M=s;y=wc;var F=M.current.memoizedState.isDehydrated;if(F&&(rl(M,A).flags|=256),A=kh(M,A,!1),A!==2){if(mh&&!F){M.errorRecoveryDisabledLanes|=v,to|=v,y=4;break e}v=ga,ga=y,v!==null&&(ga===null?ga=v:ga.push.apply(ga,v))}y=A}if(v=!1,y!==2)continue}}if(y===1){rl(s,0),Js(s,o,0,!0);break}e:{switch(f=s,v=y,v){case 0:case 1:throw Error(a(345));case 4:if((o&4194048)!==o)break;case 6:Js(f,o,Oa,!Ys);break e;case 2:ga=null;break;case 3:case 5:break;default:throw Error(a(329))}if((o&62914560)===o&&(y=Cd+300-It(),10<y)){if(Js(f,o,Oa,!Ys),Rt(f,0,!0)!==0)break e;ds=o,f.timeoutHandle=rx(Ev.bind(null,f,u,ga,Td,yh,o,Oa,to,nl,Ys,v,"Throttled",-0,0),y);break e}Ev(f,u,ga,Td,yh,o,Oa,to,nl,Ys,v,null,-0,0)}}break}while(!0);Dr(s)}function Ev(s,o,u,f,y,v,A,M,F,J,le,ue,te,ie){if(s.timeoutHandle=-1,ue=o.subtreeFlags,ue&8192||(ue&16785408)===16785408){ue={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:lt},xv(o,v,ue);var Re=(v&62914560)===v?Cd-It():(v&4194048)===v?_v-It():0;if(Re=l8(ue,Re),Re!==null){ds=v,s.cancelPendingCommit=Re(Bv.bind(null,s,o,v,u,f,y,A,M,F,le,ue,null,te,ie)),Js(s,v,A,!J);return}}Bv(s,o,v,u,f,y,A,M,F)}function _7(s){for(var o=s;;){var u=o.tag;if((u===0||u===11||u===15)&&o.flags&16384&&(u=o.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var f=0;f<u.length;f++){var y=u[f],v=y.getSnapshot;y=y.value;try{if(!Ea(v(),y))return!1}catch{return!1}}if(u=o.child,o.subtreeFlags&16384&&u!==null)u.return=o,o=u;else{if(o===s)break;for(;o.sibling===null;){if(o.return===null||o.return===s)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function Js(s,o,u,f){o&=~gh,o&=~to,s.suspendedLanes|=o,s.pingedLanes&=~o,f&&(s.warmLanes|=o),f=s.expirationTimes;for(var y=o;0<y;){var v=31-Ce(y),A=1<<v;f[v]=-1,y&=~A}u!==0&&Ms(s,u,o)}function Ed(){return(Tt&6)===0?(Sc(0),!1):!0}function wh(){if(gt!==null){if(Mt===0)var s=gt.return;else s=gt,es=Vi=null,If(s),Ko=null,sc=0,s=gt;for(;s!==null;)sv(s.alternate,s),s=s.return;gt=null}}function rl(s,o){var u=s.timeoutHandle;u!==-1&&(s.timeoutHandle=-1,G7(u)),u=s.cancelPendingCommit,u!==null&&(s.cancelPendingCommit=null,u()),ds=0,wh(),Pt=s,gt=u=Qr(s.current,null),vt=o,Mt=0,Ma=null,Ys=!1,tl=Ft(s,o),mh=!1,nl=Oa=gh=to=Zs=Jt=0,ga=wc=null,yh=!1,(o&8)!==0&&(o|=o&32);var f=s.entangledLanes;if(f!==0)for(s=s.entanglements,f&=o;0<f;){var y=31-Ce(f),v=1<<y;o|=s[y],f&=~v}return us=o,Yu(),u}function Nv(s,o){it=null,P.H=fc,o===Wo||o===ad?(o=qy(),Mt=3):o===Cf?(o=qy(),Mt=4):Mt=o===Jf?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,Ma=o,gt===null&&(Jt=1,yd(s,Va(o,s.current)))}function Rv(){var s=Ra.current;return s===null?!0:(vt&4194048)===vt?Za===null:(vt&62914560)===vt||(vt&536870912)!==0?s===Za:!1}function Dv(){var s=P.H;return P.H=fc,s===null?fc:s}function Mv(){var s=P.A;return P.A=k7,s}function Nd(){Jt=4,Ys||(vt&4194048)!==vt&&Ra.current!==null||(tl=!0),(Zs&134217727)===0&&(to&134217727)===0||Pt===null||Js(Pt,vt,Oa,!1)}function kh(s,o,u){var f=Tt;Tt|=2;var y=Dv(),v=Mv();(Pt!==s||vt!==o)&&(Td=null,rl(s,o)),o=!1;var A=Jt;e:do try{if(Mt!==0&>!==null){var M=gt,F=Ma;switch(Mt){case 8:wh(),A=6;break e;case 3:case 2:case 9:case 6:Ra.current===null&&(o=!0);var J=Mt;if(Mt=0,Ma=null,sl(s,M,F,J),u&&tl){A=0;break e}break;default:J=Mt,Mt=0,Ma=null,sl(s,M,F,J)}}C7(),A=Jt;break}catch(le){Nv(s,le)}while(!0);return o&&s.shellSuspendCounter++,es=Vi=null,Tt=f,P.H=y,P.A=v,gt===null&&(Pt=null,vt=0,Yu()),A}function C7(){for(;gt!==null;)Ov(gt)}function A7(s,o){var u=Tt;Tt|=2;var f=Dv(),y=Mv();Pt!==s||vt!==o?(Td=null,Ad=It()+500,rl(s,o)):tl=Ft(s,o);e:do try{if(Mt!==0&>!==null){o=gt;var v=Ma;t:switch(Mt){case 1:Mt=0,Ma=null,sl(s,o,v,1);break;case 2:case 9:if(Uy(v)){Mt=0,Ma=null,Lv(o);break}o=function(){Mt!==2&&Mt!==9||Pt!==s||(Mt=7),Dr(s)},v.then(o,o);break e;case 3:Mt=7;break e;case 4:Mt=5;break e;case 7:Uy(v)?(Mt=0,Ma=null,Lv(o)):(Mt=0,Ma=null,sl(s,o,v,7));break;case 5:var A=null;switch(gt.tag){case 26:A=gt.memoizedState;case 5:case 27:var M=gt;if(A?vx(A):M.stateNode.complete){Mt=0,Ma=null;var F=M.sibling;if(F!==null)gt=F;else{var J=M.return;J!==null?(gt=J,Rd(J)):gt=null}break t}}Mt=0,Ma=null,sl(s,o,v,5);break;case 6:Mt=0,Ma=null,sl(s,o,v,6);break;case 8:wh(),Jt=6;break e;default:throw Error(a(462))}}T7();break}catch(le){Nv(s,le)}while(!0);return es=Vi=null,P.H=f,P.A=y,Tt=u,gt!==null?0:(Pt=null,vt=0,Yu(),Jt)}function T7(){for(;gt!==null&&!ur();)Ov(gt)}function Ov(s){var o=av(s.alternate,s,us);s.memoizedProps=s.pendingProps,o===null?Rd(s):gt=o}function Lv(s){var o=s,u=o.alternate;switch(o.tag){case 15:case 0:o=Xb(u,o,o.pendingProps,o.type,void 0,vt);break;case 11:o=Xb(u,o,o.pendingProps,o.type.render,o.ref,vt);break;case 5:If(o);default:sv(u,o),o=gt=My(o,us),o=av(u,o,us)}s.memoizedProps=s.pendingProps,o===null?Rd(s):gt=o}function sl(s,o,u,f){es=Vi=null,If(o),Ko=null,sc=0;var y=o.return;try{if(m7(s,y,o,u,vt)){Jt=1,yd(s,Va(u,s.current)),gt=null;return}}catch(v){if(y!==null)throw gt=y,v;Jt=1,yd(s,Va(u,s.current)),gt=null;return}o.flags&32768?(kt||f===1?s=!0:tl||(vt&536870912)!==0?s=!1:(Ys=s=!0,(f===2||f===9||f===3||f===6)&&(f=Ra.current,f!==null&&f.tag===13&&(f.flags|=16384))),jv(o,s)):Rd(o)}function Rd(s){var o=s;do{if((o.flags&32768)!==0){jv(o,Ys);return}s=o.return;var u=b7(o.alternate,o,us);if(u!==null){gt=u;return}if(o=o.sibling,o!==null){gt=o;return}gt=o=s}while(o!==null);Jt===0&&(Jt=5)}function jv(s,o){do{var u=v7(s.alternate,s);if(u!==null){u.flags&=32767,gt=u;return}if(u=s.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!o&&(s=s.sibling,s!==null)){gt=s;return}gt=s=u}while(s!==null);Jt=6,gt=null}function Bv(s,o,u,f,y,v,A,M,F){s.cancelPendingCommit=null;do Dd();while(_n!==0);if((Tt&6)!==0)throw Error(a(327));if(o!==null){if(o===s.current)throw Error(a(177));if(v=o.lanes|o.childLanes,v|=uf,an(s,u,v,A,M,F),s===Pt&&(gt=Pt=null,vt=0),al=o,Qs=s,ds=u,bh=v,vh=y,Cv=f,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,D7(Yn,function(){return Fv(),null})):(s.callbackNode=null,s.callbackPriority=0),f=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||f){f=P.T,P.T=null,y=oe.p,oe.p=2,A=Tt,Tt|=4;try{x7(s,o,u)}finally{Tt=A,oe.p=y,P.T=f}}_n=1,Iv(),Pv(),zv()}}function Iv(){if(_n===1){_n=0;var s=Qs,o=al,u=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||u){u=P.T,P.T=null;var f=oe.p;oe.p=2;var y=Tt;Tt|=4;try{yv(o,s);var v=Lh,A=Sy(s.containerInfo),M=v.focusedElem,F=v.selectionRange;if(A!==M&&M&&M.ownerDocument&&ky(M.ownerDocument.documentElement,M)){if(F!==null&&rf(M)){var J=F.start,le=F.end;if(le===void 0&&(le=J),"selectionStart"in M)M.selectionStart=J,M.selectionEnd=Math.min(le,M.value.length);else{var ue=M.ownerDocument||document,te=ue&&ue.defaultView||window;if(te.getSelection){var ie=te.getSelection(),Re=M.textContent.length,We=Math.min(F.start,Re),Bt=F.end===void 0?We:Math.min(F.end,Re);!ie.extend&&We>Bt&&(A=Bt,Bt=We,We=A);var Z=wy(M,We),V=wy(M,Bt);if(Z&&V&&(ie.rangeCount!==1||ie.anchorNode!==Z.node||ie.anchorOffset!==Z.offset||ie.focusNode!==V.node||ie.focusOffset!==V.offset)){var Q=ue.createRange();Q.setStart(Z.node,Z.offset),ie.removeAllRanges(),We>Bt?(ie.addRange(Q),ie.extend(V.node,V.offset)):(Q.setEnd(V.node,V.offset),ie.addRange(Q))}}}}for(ue=[],ie=M;ie=ie.parentNode;)ie.nodeType===1&&ue.push({element:ie,left:ie.scrollLeft,top:ie.scrollTop});for(typeof M.focus=="function"&&M.focus(),M=0;M<ue.length;M++){var ce=ue[M];ce.element.scrollLeft=ce.left,ce.element.scrollTop=ce.top}}Ud=!!Oh,Lh=Oh=null}finally{Tt=y,oe.p=f,P.T=u}}s.current=o,_n=2}}function Pv(){if(_n===2){_n=0;var s=Qs,o=al,u=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||u){u=P.T,P.T=null;var f=oe.p;oe.p=2;var y=Tt;Tt|=4;try{pv(s,o.alternate,o)}finally{Tt=y,oe.p=f,P.T=u}}_n=3}}function zv(){if(_n===4||_n===3){_n=0,Fa();var s=Qs,o=al,u=ds,f=Cv;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?_n=5:(_n=0,al=Qs=null,$v(s,s.pendingLanes));var y=s.pendingLanes;if(y===0&&(Xs=null),Fl(u),o=o.stateNode,nn&&typeof nn.onCommitFiberRoot=="function")try{nn.onCommitFiberRoot(Zn,o,void 0,(o.current.flags&128)===128)}catch{}if(f!==null){o=P.T,y=oe.p,oe.p=2,P.T=null;try{for(var v=s.onRecoverableError,A=0;A<f.length;A++){var M=f[A];v(M.value,{componentStack:M.stack})}}finally{P.T=o,oe.p=y}}(ds&3)!==0&&Dd(),Dr(s),y=s.pendingLanes,(u&261930)!==0&&(y&42)!==0?s===xh?kc++:(kc=0,xh=s):kc=0,Sc(0)}}function $v(s,o){(s.pooledCacheLanes&=o)===0&&(o=s.pooledCache,o!=null&&(s.pooledCache=null,ac(o)))}function Dd(){return Iv(),Pv(),zv(),Fv()}function Fv(){if(_n!==5)return!1;var s=Qs,o=bh;bh=0;var u=Fl(ds),f=P.T,y=oe.p;try{oe.p=32>u?32:u,P.T=null,u=vh,vh=null;var v=Qs,A=ds;if(_n=0,al=Qs=null,ds=0,(Tt&6)!==0)throw Error(a(331));var M=Tt;if(Tt|=4,kv(v.current),vv(v,v.current,A,u),Tt=M,Sc(0,!1),nn&&typeof nn.onPostCommitFiberRoot=="function")try{nn.onPostCommitFiberRoot(Zn,v)}catch{}return!0}finally{oe.p=y,P.T=f,$v(s,o)}}function Hv(s,o,u){o=Va(u,o),o=Qf(s.stateNode,o,2),s=qs(s,o,2),s!==null&&(dr(s,2),Dr(s))}function Ot(s,o,u){if(s.tag===3)Hv(s,s,u);else for(;o!==null;){if(o.tag===3){Hv(o,s,u);break}else if(o.tag===1){var f=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(Xs===null||!Xs.has(f))){s=Va(u,s),u=Ub(2),f=qs(o,u,2),f!==null&&(Gb(u,f,o,s),dr(f,2),Dr(f));break}}o=o.return}}function Sh(s,o,u){var f=s.pingCache;if(f===null){f=s.pingCache=new S7;var y=new Set;f.set(o,y)}else y=f.get(o),y===void 0&&(y=new Set,f.set(o,y));y.has(u)||(mh=!0,y.add(u),s=E7.bind(null,s,o,u),o.then(s,s))}function E7(s,o,u){var f=s.pingCache;f!==null&&f.delete(o),s.pingedLanes|=s.suspendedLanes&u,s.warmLanes&=~u,Pt===s&&(vt&u)===u&&(Jt===4||Jt===3&&(vt&62914560)===vt&&300>It()-Cd?(Tt&2)===0&&rl(s,0):gh|=u,nl===vt&&(nl=0)),Dr(s)}function Uv(s,o){o===0&&(o=Oi()),s=Ui(s,o),s!==null&&(dr(s,o),Dr(s))}function N7(s){var o=s.memoizedState,u=0;o!==null&&(u=o.retryLane),Uv(s,u)}function R7(s,o){var u=0;switch(s.tag){case 31:case 13:var f=s.stateNode,y=s.memoizedState;y!==null&&(u=y.retryLane);break;case 19:f=s.stateNode;break;case 22:f=s.stateNode._retryCache;break;default:throw Error(a(314))}f!==null&&f.delete(o),Uv(s,u)}function D7(s,o){return _a(s,o)}var Md=null,il=null,_h=!1,Od=!1,Ch=!1,ei=0;function Dr(s){s!==il&&s.next===null&&(il===null?Md=il=s:il=il.next=s),Od=!0,_h||(_h=!0,O7())}function Sc(s,o){if(!Ch&&Od){Ch=!0;do for(var u=!1,f=Md;f!==null;){if(s!==0){var y=f.pendingLanes;if(y===0)var v=0;else{var A=f.suspendedLanes,M=f.pingedLanes;v=(1<<31-Ce(42|s)+1)-1,v&=y&~(A&~M),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(u=!0,Wv(f,v))}else v=vt,v=Rt(f,f===Pt?v:0,f.cancelPendingCommit!==null||f.timeoutHandle!==-1),(v&3)===0||Ft(f,v)||(u=!0,Wv(f,v));f=f.next}while(u);Ch=!1}}function M7(){Gv()}function Gv(){Od=_h=!1;var s=0;ei!==0&&U7()&&(s=ei);for(var o=It(),u=null,f=Md;f!==null;){var y=f.next,v=qv(f,o);v===0?(f.next=null,u===null?Md=y:u.next=y,y===null&&(il=u)):(u=f,(s!==0||(v&3)!==0)&&(Od=!0)),f=y}_n!==0&&_n!==5||Sc(s),ei!==0&&(ei=0)}function qv(s,o){for(var u=s.suspendedLanes,f=s.pingedLanes,y=s.expirationTimes,v=s.pendingLanes&-62914561;0<v;){var A=31-Ce(v),M=1<<A,F=y[A];F===-1?((M&u)===0||(M&f)!==0)&&(y[A]=In(M,o)):F<=o&&(s.expiredLanes|=M),v&=~M}if(o=Pt,u=vt,u=Rt(s,s===o?u:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),f=s.callbackNode,u===0||s===o&&(Mt===2||Mt===9)||s.cancelPendingCommit!==null)return f!==null&&f!==null&&kr(f),s.callbackNode=null,s.callbackPriority=0;if((u&3)===0||Ft(s,u)){if(o=u&-u,o===s.callbackPriority)return o;switch(f!==null&&kr(f),Fl(u)){case 2:case 8:u=wn;break;case 32:u=Yn;break;case 268435456:u=Bn;break;default:u=Yn}return f=Vv.bind(null,s),u=_a(u,f),s.callbackPriority=o,s.callbackNode=u,o}return f!==null&&f!==null&&kr(f),s.callbackPriority=2,s.callbackNode=null,2}function Vv(s,o){if(_n!==0&&_n!==5)return s.callbackNode=null,s.callbackPriority=0,null;var u=s.callbackNode;if(Dd()&&s.callbackNode!==u)return null;var f=vt;return f=Rt(s,s===Pt?f:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),f===0?null:(Tv(s,f,o),qv(s,It()),s.callbackNode!=null&&s.callbackNode===u?Vv.bind(null,s):null)}function Wv(s,o){if(Dd())return null;Tv(s,o,!0)}function O7(){q7(function(){(Tt&6)!==0?_a(Sr,M7):Gv()})}function Ah(){if(ei===0){var s=qo;s===0&&(s=Dt,Dt<<=1,(Dt&261888)===0&&(Dt=256)),ei=s}return ei}function Kv(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:bt(""+s)}function Yv(s,o){var u=o.ownerDocument.createElement("input");return u.name=o.name,u.value=o.value,s.id&&u.setAttribute("form",s.id),o.parentNode.insertBefore(u,o),s=new FormData(s),u.parentNode.removeChild(u),s}function L7(s,o,u,f,y){if(o==="submit"&&u&&u.stateNode===y){var v=Kv((y[Sn]||null).action),A=f.submitter;A&&(o=(o=A[Sn]||null)?Kv(o.formAction):A.getAttribute("formAction"),o!==null&&(v=o,A=null));var M=new qu("action","action",null,f,y);s.push({event:M,listeners:[{instance:null,listener:function(){if(f.defaultPrevented){if(ei!==0){var F=A?Yv(y,A):new FormData(y);Vf(u,{pending:!0,data:F,method:y.method,action:v},null,F)}}else typeof v=="function"&&(M.preventDefault(),F=A?Yv(y,A):new FormData(y),Vf(u,{pending:!0,data:F,method:y.method,action:v},v,F))},currentTarget:y}]})}}for(var Th=0;Th<cf.length;Th++){var Eh=cf[Th],j7=Eh.toLowerCase(),B7=Eh[0].toUpperCase()+Eh.slice(1);fr(j7,"on"+B7)}fr(Ay,"onAnimationEnd"),fr(Ty,"onAnimationIteration"),fr(Ey,"onAnimationStart"),fr("dblclick","onDoubleClick"),fr("focusin","onFocus"),fr("focusout","onBlur"),fr(Q6,"onTransitionRun"),fr(J6,"onTransitionStart"),fr(e7,"onTransitionCancel"),fr(Ny,"onTransitionEnd"),Wr("onMouseEnter",["mouseout","mouseover"]),Wr("onMouseLeave",["mouseout","mouseover"]),Wr("onPointerEnter",["pointerout","pointerover"]),Wr("onPointerLeave",["pointerout","pointerover"]),Vr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Vr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Vr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Vr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Vr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Vr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var _c="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(" "),I7=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(_c));function Zv(s,o){o=(o&4)!==0;for(var u=0;u<s.length;u++){var f=s[u],y=f.event;f=f.listeners;e:{var v=void 0;if(o)for(var A=f.length-1;0<=A;A--){var M=f[A],F=M.instance,J=M.currentTarget;if(M=M.listener,F!==v&&y.isPropagationStopped())break e;v=M,y.currentTarget=J;try{v(y)}catch(le){Ku(le)}y.currentTarget=null,v=F}else for(A=0;A<f.length;A++){if(M=f[A],F=M.instance,J=M.currentTarget,M=M.listener,F!==v&&y.isPropagationStopped())break e;v=M,y.currentTarget=J;try{v(y)}catch(le){Ku(le)}y.currentTarget=null,v=F}}}}function yt(s,o){var u=o[Li];u===void 0&&(u=o[Li]=new Set);var f=s+"__bubble";u.has(f)||(Xv(o,s,2,!1),u.add(f))}function Nh(s,o,u){var f=0;o&&(f|=4),Xv(u,s,f,o)}var Ld="_reactListening"+Math.random().toString(36).slice(2);function Rh(s){if(!s[Ld]){s[Ld]=!0,Ul.forEach(function(u){u!=="selectionchange"&&(I7.has(u)||Nh(u,!1,s),Nh(u,!0,s))});var o=s.nodeType===9?s:s.ownerDocument;o===null||o[Ld]||(o[Ld]=!0,Nh("selectionchange",!1,o))}}function Xv(s,o,u,f){switch(Ax(o)){case 2:var y=d8;break;case 8:y=p8;break;default:y=qh}u=y.bind(null,o,u,s),y=void 0,!Ga||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(y=!0),f?y!==void 0?s.addEventListener(o,u,{capture:!0,passive:y}):s.addEventListener(o,u,!0):y!==void 0?s.addEventListener(o,u,{passive:y}):s.addEventListener(o,u,!1)}function Dh(s,o,u,f,y){var v=f;if((o&1)===0&&(o&2)===0&&f!==null)e:for(;;){if(f===null)return;var A=f.tag;if(A===3||A===4){var M=f.stateNode.containerInfo;if(M===y)break;if(A===4)for(A=f.return;A!==null;){var F=A.tag;if((F===3||F===4)&&A.stateNode.containerInfo===y)return;A=A.return}for(;M!==null;){if(A=qr(M),A===null)return;if(F=A.tag,F===5||F===6||F===26||F===27){f=v=A;continue e}M=M.parentNode}}f=f.return}Wl(function(){var J=v,le=Pi(u),ue=[];e:{var te=Ry.get(s);if(te!==void 0){var ie=qu,Re=s;switch(s){case"keypress":if(Uu(u)===0)break e;case"keydown":case"keyup":ie=R6;break;case"focusin":Re="focus",ie=Jp;break;case"focusout":Re="blur",ie=Jp;break;case"beforeblur":case"afterblur":ie=Jp;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ie=sy;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ie=b6;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ie=O6;break;case Ay:case Ty:case Ey:ie=w6;break;case Ny:ie=j6;break;case"scroll":case"scrollend":ie=g6;break;case"wheel":ie=I6;break;case"copy":case"cut":case"paste":ie=S6;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ie=oy;break;case"toggle":case"beforetoggle":ie=z6}var We=(o&4)!==0,Bt=!We&&(s==="scroll"||s==="scrollend"),Z=We?te!==null?te+"Capture":null:te;We=[];for(var V=J,Q;V!==null;){var ce=V;if(Q=ce.stateNode,ce=ce.tag,ce!==5&&ce!==26&&ce!==27||Q===null||Z===null||(ce=Zr(V,Z),ce!=null&&We.push(Cc(V,ce,Q))),Bt)break;V=V.return}0<We.length&&(te=new ie(te,Re,null,u,le),ue.push({event:te,listeners:We}))}}if((o&7)===0){e:{if(te=s==="mouseover"||s==="pointerover",ie=s==="mouseout"||s==="pointerout",te&&u!==Wt&&(Re=u.relatedTarget||u.fromElement)&&(qr(Re)||Re[Ar]))break e;if((ie||te)&&(te=le.window===le?le:(te=le.ownerDocument)?te.defaultView||te.parentWindow:window,ie?(Re=u.relatedTarget||u.toElement,ie=J,Re=Re?qr(Re):null,Re!==null&&(Bt=i(Re),We=Re.tag,Re!==Bt||We!==5&&We!==27&&We!==6)&&(Re=null)):(ie=null,Re=J),ie!==Re)){if(We=sy,ce="onMouseLeave",Z="onMouseEnter",V="mouse",(s==="pointerout"||s==="pointerover")&&(We=oy,ce="onPointerLeave",Z="onPointerEnter",V="pointer"),Bt=ie==null?te:js(ie),Q=Re==null?te:js(Re),te=new We(ce,V+"leave",ie,u,le),te.target=Bt,te.relatedTarget=Q,ce=null,qr(le)===J&&(We=new We(Z,V+"enter",Re,u,le),We.target=Q,We.relatedTarget=Bt,ce=We),Bt=ce,ie&&Re)t:{for(We=P7,Z=ie,V=Re,Q=0,ce=Z;ce;ce=We(ce))Q++;ce=0;for(var Ue=V;Ue;Ue=We(Ue))ce++;for(;0<Q-ce;)Z=We(Z),Q--;for(;0<ce-Q;)V=We(V),ce--;for(;Q--;){if(Z===V||V!==null&&Z===V.alternate){We=Z;break t}Z=We(Z),V=We(V)}We=null}else We=null;ie!==null&&Qv(ue,te,ie,We,!1),Re!==null&&Bt!==null&&Qv(ue,Bt,Re,We,!0)}}e:{if(te=J?js(J):window,ie=te.nodeName&&te.nodeName.toLowerCase(),ie==="select"||ie==="input"&&te.type==="file")var _t=my;else if(fy(te))if(gy)_t=Y6;else{_t=W6;var Ie=V6}else ie=te.nodeName,!ie||ie.toLowerCase()!=="input"||te.type!=="checkbox"&&te.type!=="radio"?J&&Se(J.elementType)&&(_t=my):_t=K6;if(_t&&(_t=_t(s,J))){hy(ue,_t,u,le);break e}Ie&&Ie(s,te,J),s==="focusout"&&J&&te.type==="number"&&J.memoizedProps.value!=null&&Oo(te,"number",te.value)}switch(Ie=J?js(J):window,s){case"focusin":(fy(Ie)||Ie.contentEditable==="true")&&(Io=Ie,sf=J,ec=null);break;case"focusout":ec=sf=Io=null;break;case"mousedown":of=!0;break;case"contextmenu":case"mouseup":case"dragend":of=!1,_y(ue,u,le);break;case"selectionchange":if(X6)break;case"keydown":case"keyup":_y(ue,u,le)}var ct;if(tf)e:{switch(s){case"compositionstart":var xt="onCompositionStart";break e;case"compositionend":xt="onCompositionEnd";break e;case"compositionupdate":xt="onCompositionUpdate";break e}xt=void 0}else Bo?dy(s,u)&&(xt="onCompositionEnd"):s==="keydown"&&u.keyCode===229&&(xt="onCompositionStart");xt&&(ly&&u.locale!=="ko"&&(Bo||xt!=="onCompositionStart"?xt==="onCompositionEnd"&&Bo&&(ct=Hu()):(Mn=le,Ta="value"in Mn?Mn.value:Mn.textContent,Bo=!0)),Ie=jd(J,xt),0<Ie.length&&(xt=new iy(xt,s,null,u,le),ue.push({event:xt,listeners:Ie}),ct?xt.data=ct:(ct=py(u),ct!==null&&(xt.data=ct)))),(ct=F6?H6(s,u):U6(s,u))&&(xt=jd(J,"onBeforeInput"),0<xt.length&&(Ie=new iy("onBeforeInput","beforeinput",null,u,le),ue.push({event:Ie,listeners:xt}),Ie.data=ct)),L7(ue,s,J,u,le)}Zv(ue,o)})}function Cc(s,o,u){return{instance:s,listener:o,currentTarget:u}}function jd(s,o){for(var u=o+"Capture",f=[];s!==null;){var y=s,v=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||v===null||(y=Zr(s,u),y!=null&&f.unshift(Cc(s,y,v)),y=Zr(s,o),y!=null&&f.push(Cc(s,y,v))),s.tag===3)return f;s=s.return}return[]}function P7(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function Qv(s,o,u,f,y){for(var v=o._reactName,A=[];u!==null&&u!==f;){var M=u,F=M.alternate,J=M.stateNode;if(M=M.tag,F!==null&&F===f)break;M!==5&&M!==26&&M!==27||J===null||(F=J,y?(J=Zr(u,v),J!=null&&A.unshift(Cc(u,J,F))):y||(J=Zr(u,v),J!=null&&A.push(Cc(u,J,F)))),u=u.return}A.length!==0&&s.push({event:o,listeners:A})}var z7=/\r\n?/g,$7=/\u0000|\uFFFD/g;function Jv(s){return(typeof s=="string"?s:""+s).replace(z7,`
|
|
26
|
+
`).replace($7,"")}function ex(s,o){return o=Jv(o),Jv(s)===o}function jt(s,o,u,f,y,v){switch(u){case"children":typeof f=="string"?o==="body"||o==="textarea"&&f===""||Ps(s,f):(typeof f=="number"||typeof f=="bigint")&&o!=="body"&&Ps(s,""+f);break;case"className":Bs(s,"class",f);break;case"tabIndex":Bs(s,"tabindex",f);break;case"dir":case"role":case"viewBox":case"width":case"height":Bs(s,u,f);break;case"style":de(s,f,v);break;case"data":if(o!=="object"){Bs(s,"data",f);break}case"src":case"href":if(f===""&&(o!=="a"||u!=="href")){s.removeAttribute(u);break}if(f==null||typeof f=="function"||typeof f=="symbol"||typeof f=="boolean"){s.removeAttribute(u);break}f=bt(""+f),s.setAttribute(u,f);break;case"action":case"formAction":if(typeof f=="function"){s.setAttribute(u,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof v=="function"&&(u==="formAction"?(o!=="input"&&jt(s,o,"name",y.name,y,null),jt(s,o,"formEncType",y.formEncType,y,null),jt(s,o,"formMethod",y.formMethod,y,null),jt(s,o,"formTarget",y.formTarget,y,null)):(jt(s,o,"encType",y.encType,y,null),jt(s,o,"method",y.method,y,null),jt(s,o,"target",y.target,y,null)));if(f==null||typeof f=="symbol"||typeof f=="boolean"){s.removeAttribute(u);break}f=bt(""+f),s.setAttribute(u,f);break;case"onClick":f!=null&&(s.onclick=lt);break;case"onScroll":f!=null&&yt("scroll",s);break;case"onScrollEnd":f!=null&&yt("scrollend",s);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(a(61));if(u=f.__html,u!=null){if(y.children!=null)throw Error(a(60));s.innerHTML=u}}break;case"multiple":s.multiple=f&&typeof f!="function"&&typeof f!="symbol";break;case"muted":s.muted=f&&typeof f!="function"&&typeof f!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(f==null||typeof f=="function"||typeof f=="boolean"||typeof f=="symbol"){s.removeAttribute("xlink:href");break}u=bt(""+f),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":f!=null&&typeof f!="function"&&typeof f!="symbol"?s.setAttribute(u,""+f):s.removeAttribute(u);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":f&&typeof f!="function"&&typeof f!="symbol"?s.setAttribute(u,""):s.removeAttribute(u);break;case"capture":case"download":f===!0?s.setAttribute(u,""):f!==!1&&f!=null&&typeof f!="function"&&typeof f!="symbol"?s.setAttribute(u,f):s.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":f!=null&&typeof f!="function"&&typeof f!="symbol"&&!isNaN(f)&&1<=f?s.setAttribute(u,f):s.removeAttribute(u);break;case"rowSpan":case"start":f==null||typeof f=="function"||typeof f=="symbol"||isNaN(f)?s.removeAttribute(u):s.setAttribute(u,f);break;case"popover":yt("beforetoggle",s),yt("toggle",s),Do(s,"popover",f);break;case"xlinkActuate":Ca(s,"http://www.w3.org/1999/xlink","xlink:actuate",f);break;case"xlinkArcrole":Ca(s,"http://www.w3.org/1999/xlink","xlink:arcrole",f);break;case"xlinkRole":Ca(s,"http://www.w3.org/1999/xlink","xlink:role",f);break;case"xlinkShow":Ca(s,"http://www.w3.org/1999/xlink","xlink:show",f);break;case"xlinkTitle":Ca(s,"http://www.w3.org/1999/xlink","xlink:title",f);break;case"xlinkType":Ca(s,"http://www.w3.org/1999/xlink","xlink:type",f);break;case"xmlBase":Ca(s,"http://www.w3.org/XML/1998/namespace","xml:base",f);break;case"xmlLang":Ca(s,"http://www.w3.org/XML/1998/namespace","xml:lang",f);break;case"xmlSpace":Ca(s,"http://www.w3.org/XML/1998/namespace","xml:space",f);break;case"is":Do(s,"is",f);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=je.get(u)||u,Do(s,u,f))}}function Mh(s,o,u,f,y,v){switch(u){case"style":de(s,f,v);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(a(61));if(u=f.__html,u!=null){if(y.children!=null)throw Error(a(60));s.innerHTML=u}}break;case"children":typeof f=="string"?Ps(s,f):(typeof f=="number"||typeof f=="bigint")&&Ps(s,""+f);break;case"onScroll":f!=null&&yt("scroll",s);break;case"onScrollEnd":f!=null&&yt("scrollend",s);break;case"onClick":f!=null&&(s.onclick=lt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Pu.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(y=u.endsWith("Capture"),o=u.slice(2,y?u.length-7:void 0),v=s[Sn]||null,v=v!=null?v[u]:null,typeof v=="function"&&s.removeEventListener(o,v,y),typeof f=="function")){typeof v!="function"&&v!==null&&(u in s?s[u]=null:s.hasAttribute(u)&&s.removeAttribute(u)),s.addEventListener(o,f,y);break e}u in s?s[u]=f:f===!0?s.setAttribute(u,""):Do(s,u,f)}}}function Fn(s,o,u){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":yt("error",s),yt("load",s);var f=!1,y=!1,v;for(v in u)if(u.hasOwnProperty(v)){var A=u[v];if(A!=null)switch(v){case"src":f=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,o));default:jt(s,o,v,A,u,null)}}y&&jt(s,o,"srcSet",u.srcSet,u,null),f&&jt(s,o,"src",u.src,u,null);return;case"input":yt("invalid",s);var M=v=A=y=null,F=null,J=null;for(f in u)if(u.hasOwnProperty(f)){var le=u[f];if(le!=null)switch(f){case"name":y=le;break;case"type":A=le;break;case"checked":F=le;break;case"defaultChecked":J=le;break;case"value":v=le;break;case"defaultValue":M=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(a(137,o));break;default:jt(s,o,f,le,u,null)}}Vl(s,v,M,F,J,A,y,!1);return;case"select":yt("invalid",s),f=A=v=null;for(y in u)if(u.hasOwnProperty(y)&&(M=u[y],M!=null))switch(y){case"value":v=M;break;case"defaultValue":A=M;break;case"multiple":f=M;default:jt(s,o,y,M,u,null)}o=v,u=A,s.multiple=!!f,o!=null?Yr(s,!!f,o,!1):u!=null&&Yr(s,!!f,u,!0);return;case"textarea":yt("invalid",s),v=y=f=null;for(A in u)if(u.hasOwnProperty(A)&&(M=u[A],M!=null))switch(A){case"value":f=M;break;case"defaultValue":y=M;break;case"children":v=M;break;case"dangerouslySetInnerHTML":if(M!=null)throw Error(a(91));break;default:jt(s,o,A,M,u,null)}Lo(s,f,y,v);return;case"option":for(F in u)if(u.hasOwnProperty(F)&&(f=u[F],f!=null))switch(F){case"selected":s.selected=f&&typeof f!="function"&&typeof f!="symbol";break;default:jt(s,o,F,f,u,null)}return;case"dialog":yt("beforetoggle",s),yt("toggle",s),yt("cancel",s),yt("close",s);break;case"iframe":case"object":yt("load",s);break;case"video":case"audio":for(f=0;f<_c.length;f++)yt(_c[f],s);break;case"image":yt("error",s),yt("load",s);break;case"details":yt("toggle",s);break;case"embed":case"source":case"link":yt("error",s),yt("load",s);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(J in u)if(u.hasOwnProperty(J)&&(f=u[J],f!=null))switch(J){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,o));default:jt(s,o,J,f,u,null)}return;default:if(Se(o)){for(le in u)u.hasOwnProperty(le)&&(f=u[le],f!==void 0&&Mh(s,o,le,f,u,void 0));return}}for(M in u)u.hasOwnProperty(M)&&(f=u[M],f!=null&&jt(s,o,M,f,u,null))}function F7(s,o,u,f){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,v=null,A=null,M=null,F=null,J=null,le=null;for(ie in u){var ue=u[ie];if(u.hasOwnProperty(ie)&&ue!=null)switch(ie){case"checked":break;case"value":break;case"defaultValue":F=ue;default:f.hasOwnProperty(ie)||jt(s,o,ie,null,f,ue)}}for(var te in f){var ie=f[te];if(ue=u[te],f.hasOwnProperty(te)&&(ie!=null||ue!=null))switch(te){case"type":v=ie;break;case"name":y=ie;break;case"checked":J=ie;break;case"defaultChecked":le=ie;break;case"value":A=ie;break;case"defaultValue":M=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(a(137,o));break;default:ie!==ue&&jt(s,o,te,ie,f,ue)}}Mo(s,A,M,F,J,le,v,y);return;case"select":ie=A=M=te=null;for(v in u)if(F=u[v],u.hasOwnProperty(v)&&F!=null)switch(v){case"value":break;case"multiple":ie=F;default:f.hasOwnProperty(v)||jt(s,o,v,null,f,F)}for(y in f)if(v=f[y],F=u[y],f.hasOwnProperty(y)&&(v!=null||F!=null))switch(y){case"value":te=v;break;case"defaultValue":M=v;break;case"multiple":A=v;default:v!==F&&jt(s,o,y,v,f,F)}o=M,u=A,f=ie,te!=null?Yr(s,!!u,te,!1):!!f!=!!u&&(o!=null?Yr(s,!!u,o,!0):Yr(s,!!u,u?[]:"",!1));return;case"textarea":ie=te=null;for(M in u)if(y=u[M],u.hasOwnProperty(M)&&y!=null&&!f.hasOwnProperty(M))switch(M){case"value":break;case"children":break;default:jt(s,o,M,null,f,y)}for(A in f)if(y=f[A],v=u[A],f.hasOwnProperty(A)&&(y!=null||v!=null))switch(A){case"value":te=y;break;case"defaultValue":ie=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(a(91));break;default:y!==v&&jt(s,o,A,y,f,v)}Fu(s,te,ie);return;case"option":for(var Re in u)if(te=u[Re],u.hasOwnProperty(Re)&&te!=null&&!f.hasOwnProperty(Re))switch(Re){case"selected":s.selected=!1;break;default:jt(s,o,Re,null,f,te)}for(F in f)if(te=f[F],ie=u[F],f.hasOwnProperty(F)&&te!==ie&&(te!=null||ie!=null))switch(F){case"selected":s.selected=te&&typeof te!="function"&&typeof te!="symbol";break;default:jt(s,o,F,te,f,ie)}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 We in u)te=u[We],u.hasOwnProperty(We)&&te!=null&&!f.hasOwnProperty(We)&&jt(s,o,We,null,f,te);for(J in f)if(te=f[J],ie=u[J],f.hasOwnProperty(J)&&te!==ie&&(te!=null||ie!=null))switch(J){case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(a(137,o));break;default:jt(s,o,J,te,f,ie)}return;default:if(Se(o)){for(var Bt in u)te=u[Bt],u.hasOwnProperty(Bt)&&te!==void 0&&!f.hasOwnProperty(Bt)&&Mh(s,o,Bt,void 0,f,te);for(le in f)te=f[le],ie=u[le],!f.hasOwnProperty(le)||te===ie||te===void 0&&ie===void 0||Mh(s,o,le,te,f,ie);return}}for(var Z in u)te=u[Z],u.hasOwnProperty(Z)&&te!=null&&!f.hasOwnProperty(Z)&&jt(s,o,Z,null,f,te);for(ue in f)te=f[ue],ie=u[ue],!f.hasOwnProperty(ue)||te===ie||te==null&&ie==null||jt(s,o,ue,te,f,ie)}function tx(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function H7(){if(typeof performance.getEntriesByType=="function"){for(var s=0,o=0,u=performance.getEntriesByType("resource"),f=0;f<u.length;f++){var y=u[f],v=y.transferSize,A=y.initiatorType,M=y.duration;if(v&&M&&tx(A)){for(A=0,M=y.responseEnd,f+=1;f<u.length;f++){var F=u[f],J=F.startTime;if(J>M)break;var le=F.transferSize,ue=F.initiatorType;le&&tx(ue)&&(F=F.responseEnd,A+=le*(F<M?1:(M-J)/(F-J)))}if(--f,o+=8*(v+A)/(y.duration/1e3),s++,10<s)break}}if(0<s)return o/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var Oh=null,Lh=null;function Bd(s){return s.nodeType===9?s:s.ownerDocument}function nx(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function ax(s,o){if(s===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&o==="foreignObject"?0:s}function jh(s,o){return s==="textarea"||s==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.children=="bigint"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var Bh=null;function U7(){var s=window.event;return s&&s.type==="popstate"?s===Bh?!1:(Bh=s,!0):(Bh=null,!1)}var rx=typeof setTimeout=="function"?setTimeout:void 0,G7=typeof clearTimeout=="function"?clearTimeout:void 0,sx=typeof Promise=="function"?Promise:void 0,q7=typeof queueMicrotask=="function"?queueMicrotask:typeof sx<"u"?function(s){return sx.resolve(null).then(s).catch(V7)}:rx;function V7(s){setTimeout(function(){throw s})}function ti(s){return s==="head"}function ix(s,o){var u=o,f=0;do{var y=u.nextSibling;if(s.removeChild(u),y&&y.nodeType===8)if(u=y.data,u==="/$"||u==="/&"){if(f===0){s.removeChild(y),ul(o);return}f--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")f++;else if(u==="html")Ac(s.ownerDocument.documentElement);else if(u==="head"){u=s.ownerDocument.head,Ac(u);for(var v=u.firstChild;v;){var A=v.nextSibling,M=v.nodeName;v[Os]||M==="SCRIPT"||M==="STYLE"||M==="LINK"&&v.rel.toLowerCase()==="stylesheet"||u.removeChild(v),v=A}}else u==="body"&&Ac(s.ownerDocument.body);u=y}while(u);ul(o)}function ox(s,o){var u=s;s=0;do{var f=u.nextSibling;if(u.nodeType===1?o?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(o?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),f&&f.nodeType===8)if(u=f.data,u==="/$"){if(s===0)break;s--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||s++;u=f}while(u)}function Ih(s){var o=s.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var u=o;switch(o=o.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":Ih(u),Ls(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}s.removeChild(u)}}function W7(s,o,u,f){for(;s.nodeType===1;){var y=u;if(s.nodeName.toLowerCase()!==o.toLowerCase()){if(!f&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(f){if(!s[Os])switch(o){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(v=s.getAttribute("rel"),v==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(v!==y.rel||s.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||s.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||s.getAttribute("title")!==(y.title==null?null:y.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(v=s.getAttribute("src"),(v!==(y.src==null?null:y.src)||s.getAttribute("type")!==(y.type==null?null:y.type)||s.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&v&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(o==="input"&&s.type==="hidden"){var v=y.name==null?null:""+y.name;if(y.type==="hidden"&&s.getAttribute("name")===v)return s}else return s;if(s=Xa(s.nextSibling),s===null)break}return null}function K7(s,o,u){if(o==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!u||(s=Xa(s.nextSibling),s===null))return null;return s}function lx(s,o){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!o||(s=Xa(s.nextSibling),s===null))return null;return s}function Ph(s){return s.data==="$?"||s.data==="$~"}function zh(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function Y7(s,o){var u=s.ownerDocument;if(s.data==="$~")s._reactRetry=o;else if(s.data!=="$?"||u.readyState!=="loading")o();else{var f=function(){o(),u.removeEventListener("DOMContentLoaded",f)};u.addEventListener("DOMContentLoaded",f),s._reactRetry=f}}function Xa(s){for(;s!=null;s=s.nextSibling){var o=s.nodeType;if(o===1||o===3)break;if(o===8){if(o=s.data,o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"||o==="F!"||o==="F")break;if(o==="/$"||o==="/&")return null}}return s}var $h=null;function cx(s){s=s.nextSibling;for(var o=0;s;){if(s.nodeType===8){var u=s.data;if(u==="/$"||u==="/&"){if(o===0)return Xa(s.nextSibling);o--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||o++}s=s.nextSibling}return null}function ux(s){s=s.previousSibling;for(var o=0;s;){if(s.nodeType===8){var u=s.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(o===0)return s;o--}else u!=="/$"&&u!=="/&"||o++}s=s.previousSibling}return null}function dx(s,o,u){switch(o=Bd(u),s){case"html":if(s=o.documentElement,!s)throw Error(a(452));return s;case"head":if(s=o.head,!s)throw Error(a(453));return s;case"body":if(s=o.body,!s)throw Error(a(454));return s;default:throw Error(a(451))}}function Ac(s){for(var o=s.attributes;o.length;)s.removeAttributeNode(o[0]);Ls(s)}var Qa=new Map,px=new Set;function Id(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var ps=oe.d;oe.d={f:Z7,r:X7,D:Q7,C:J7,L:e8,m:t8,X:a8,S:n8,M:r8};function Z7(){var s=ps.f(),o=Ed();return s||o}function X7(s){var o=pr(s);o!==null&&o.tag===5&&o.type==="form"?Nb(o):ps.r(s)}var ol=typeof document>"u"?null:document;function fx(s,o,u){var f=ol;if(f&&typeof o=="string"&&o){var y=Qn(o);y='link[rel="'+s+'"][href="'+y+'"]',typeof u=="string"&&(y+='[crossorigin="'+u+'"]'),px.has(y)||(px.add(y),s={rel:s,crossOrigin:u,href:o},f.querySelector(y)===null&&(o=f.createElement("link"),Fn(o,"link",s),rn(o),f.head.appendChild(o)))}}function Q7(s){ps.D(s),fx("dns-prefetch",s,null)}function J7(s,o){ps.C(s,o),fx("preconnect",s,o)}function e8(s,o,u){ps.L(s,o,u);var f=ol;if(f&&s&&o){var y='link[rel="preload"][as="'+Qn(o)+'"]';o==="image"&&u&&u.imageSrcSet?(y+='[imagesrcset="'+Qn(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(y+='[imagesizes="'+Qn(u.imageSizes)+'"]')):y+='[href="'+Qn(s)+'"]';var v=y;switch(o){case"style":v=ll(s);break;case"script":v=cl(s)}Qa.has(v)||(s=m({rel:"preload",href:o==="image"&&u&&u.imageSrcSet?void 0:s,as:o},u),Qa.set(v,s),f.querySelector(y)!==null||o==="style"&&f.querySelector(Tc(v))||o==="script"&&f.querySelector(Ec(v))||(o=f.createElement("link"),Fn(o,"link",s),rn(o),f.head.appendChild(o)))}}function t8(s,o){ps.m(s,o);var u=ol;if(u&&s){var f=o&&typeof o.as=="string"?o.as:"script",y='link[rel="modulepreload"][as="'+Qn(f)+'"][href="'+Qn(s)+'"]',v=y;switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=cl(s)}if(!Qa.has(v)&&(s=m({rel:"modulepreload",href:s},o),Qa.set(v,s),u.querySelector(y)===null)){switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Ec(v)))return}f=u.createElement("link"),Fn(f,"link",s),rn(f),u.head.appendChild(f)}}}function n8(s,o,u){ps.S(s,o,u);var f=ol;if(f&&s){var y=Xn(f).hoistableStyles,v=ll(s);o=o||"default";var A=y.get(v);if(!A){var M={loading:0,preload:null};if(A=f.querySelector(Tc(v)))M.loading=5;else{s=m({rel:"stylesheet",href:s,"data-precedence":o},u),(u=Qa.get(v))&&Fh(s,u);var F=A=f.createElement("link");rn(F),Fn(F,"link",s),F._p=new Promise(function(J,le){F.onload=J,F.onerror=le}),F.addEventListener("load",function(){M.loading|=1}),F.addEventListener("error",function(){M.loading|=2}),M.loading|=4,Pd(A,o,f)}A={type:"stylesheet",instance:A,count:1,state:M},y.set(v,A)}}}function a8(s,o){ps.X(s,o);var u=ol;if(u&&s){var f=Xn(u).hoistableScripts,y=cl(s),v=f.get(y);v||(v=u.querySelector(Ec(y)),v||(s=m({src:s,async:!0},o),(o=Qa.get(y))&&Hh(s,o),v=u.createElement("script"),rn(v),Fn(v,"link",s),u.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},f.set(y,v))}}function r8(s,o){ps.M(s,o);var u=ol;if(u&&s){var f=Xn(u).hoistableScripts,y=cl(s),v=f.get(y);v||(v=u.querySelector(Ec(y)),v||(s=m({src:s,async:!0,type:"module"},o),(o=Qa.get(y))&&Hh(s,o),v=u.createElement("script"),rn(v),Fn(v,"link",s),u.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},f.set(y,v))}}function hx(s,o,u,f){var y=(y=Kn.current)?Id(y):null;if(!y)throw Error(a(446));switch(s){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(o=ll(u.href),u=Xn(y).hoistableStyles,f=u.get(o),f||(f={type:"style",instance:null,count:0,state:null},u.set(o,f)),f):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){s=ll(u.href);var v=Xn(y).hoistableStyles,A=v.get(s);if(A||(y=y.ownerDocument||y,A={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(s,A),(v=y.querySelector(Tc(s)))&&!v._p&&(A.instance=v,A.state.loading=5),Qa.has(s)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},Qa.set(s,u),v||s8(y,s,u,A.state))),o&&f===null)throw Error(a(528,""));return A}if(o&&f!==null)throw Error(a(529,""));return null;case"script":return o=u.async,u=u.src,typeof u=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=cl(u),u=Xn(y).hoistableScripts,f=u.get(o),f||(f={type:"script",instance:null,count:0,state:null},u.set(o,f)),f):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,s))}}function ll(s){return'href="'+Qn(s)+'"'}function Tc(s){return'link[rel="stylesheet"]['+s+"]"}function mx(s){return m({},s,{"data-precedence":s.precedence,precedence:null})}function s8(s,o,u,f){s.querySelector('link[rel="preload"][as="style"]['+o+"]")?f.loading=1:(o=s.createElement("link"),f.preload=o,o.addEventListener("load",function(){return f.loading|=1}),o.addEventListener("error",function(){return f.loading|=2}),Fn(o,"link",u),rn(o),s.head.appendChild(o))}function cl(s){return'[src="'+Qn(s)+'"]'}function Ec(s){return"script[async]"+s}function gx(s,o,u){if(o.count++,o.instance===null)switch(o.type){case"style":var f=s.querySelector('style[data-href~="'+Qn(u.href)+'"]');if(f)return o.instance=f,rn(f),f;var y=m({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return f=(s.ownerDocument||s).createElement("style"),rn(f),Fn(f,"style",y),Pd(f,u.precedence,s),o.instance=f;case"stylesheet":y=ll(u.href);var v=s.querySelector(Tc(y));if(v)return o.state.loading|=4,o.instance=v,rn(v),v;f=mx(u),(y=Qa.get(y))&&Fh(f,y),v=(s.ownerDocument||s).createElement("link"),rn(v);var A=v;return A._p=new Promise(function(M,F){A.onload=M,A.onerror=F}),Fn(v,"link",f),o.state.loading|=4,Pd(v,u.precedence,s),o.instance=v;case"script":return v=cl(u.src),(y=s.querySelector(Ec(v)))?(o.instance=y,rn(y),y):(f=u,(y=Qa.get(v))&&(f=m({},u),Hh(f,y)),s=s.ownerDocument||s,y=s.createElement("script"),rn(y),Fn(y,"link",f),s.head.appendChild(y),o.instance=y);case"void":return null;default:throw Error(a(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(f=o.instance,o.state.loading|=4,Pd(f,u.precedence,s));return o.instance}function Pd(s,o,u){for(var f=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=f.length?f[f.length-1]:null,v=y,A=0;A<f.length;A++){var M=f[A];if(M.dataset.precedence===o)v=M;else if(v!==y)break}v?v.parentNode.insertBefore(s,v.nextSibling):(o=u.nodeType===9?u.head:u,o.insertBefore(s,o.firstChild))}function Fh(s,o){s.crossOrigin==null&&(s.crossOrigin=o.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=o.referrerPolicy),s.title==null&&(s.title=o.title)}function Hh(s,o){s.crossOrigin==null&&(s.crossOrigin=o.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=o.referrerPolicy),s.integrity==null&&(s.integrity=o.integrity)}var zd=null;function yx(s,o,u){if(zd===null){var f=new Map,y=zd=new Map;y.set(u,f)}else y=zd,f=y.get(u),f||(f=new Map,y.set(u,f));if(f.has(s))return f;for(f.set(s,null),u=u.getElementsByTagName(s),y=0;y<u.length;y++){var v=u[y];if(!(v[Os]||v[kn]||s==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var A=v.getAttribute(o)||"";A=s+A;var M=f.get(A);M?M.push(v):f.set(A,[v])}}return f}function bx(s,o,u){s=s.ownerDocument||s,s.head.insertBefore(u,o==="title"?s.querySelector("head > title"):null)}function i8(s,o,u){if(u===1||o.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;switch(o.rel){case"stylesheet":return s=o.disabled,typeof o.precedence=="string"&&s==null;default:return!0}case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function vx(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function o8(s,o,u,f){if(u.type==="stylesheet"&&(typeof f.media!="string"||matchMedia(f.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var y=ll(f.href),v=o.querySelector(Tc(y));if(v){o=v._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(s.count++,s=$d.bind(s),o.then(s,s)),u.state.loading|=4,u.instance=v,rn(v);return}v=o.ownerDocument||o,f=mx(f),(y=Qa.get(y))&&Fh(f,y),v=v.createElement("link"),rn(v);var A=v;A._p=new Promise(function(M,F){A.onload=M,A.onerror=F}),Fn(v,"link",f),u.instance=v}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(u,o),(o=u.state.preload)&&(u.state.loading&3)===0&&(s.count++,u=$d.bind(s),o.addEventListener("load",u),o.addEventListener("error",u))}}var Uh=0;function l8(s,o){return s.stylesheets&&s.count===0&&Hd(s,s.stylesheets),0<s.count||0<s.imgCount?function(u){var f=setTimeout(function(){if(s.stylesheets&&Hd(s,s.stylesheets),s.unsuspend){var v=s.unsuspend;s.unsuspend=null,v()}},6e4+o);0<s.imgBytes&&Uh===0&&(Uh=62500*H7());var y=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&Hd(s,s.stylesheets),s.unsuspend)){var v=s.unsuspend;s.unsuspend=null,v()}},(s.imgBytes>Uh?50:800)+o);return s.unsuspend=u,function(){s.unsuspend=null,clearTimeout(f),clearTimeout(y)}}:null}function $d(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Hd(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var Fd=null;function Hd(s,o){s.stylesheets=null,s.unsuspend!==null&&(s.count++,Fd=new Map,o.forEach(c8,s),Fd=null,$d.call(s))}function c8(s,o){if(!(o.state.loading&4)){var u=Fd.get(s);if(u)var f=u.get(null);else{u=new Map,Fd.set(s,u);for(var y=s.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<y.length;v++){var A=y[v];(A.nodeName==="LINK"||A.getAttribute("media")!=="not all")&&(u.set(A.dataset.precedence,A),f=A)}f&&u.set(null,f)}y=o.instance,A=y.getAttribute("data-precedence"),v=u.get(A)||f,v===f&&u.set(null,y),u.set(A,y),this.count++,f=$d.bind(this),y.addEventListener("load",f),y.addEventListener("error",f),v?v.parentNode.insertBefore(y,v.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(y,s.firstChild)),o.state.loading|=4}}var Nc={$$typeof:L,Provider:null,Consumer:null,_currentValue:he,_currentValue2:he,_threadCount:0};function u8(s,o,u,f,y,v,A,M,F){this.tag=1,this.containerInfo=s,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=_r(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_r(0),this.hiddenUpdates=_r(null),this.identifierPrefix=f,this.onUncaughtError=y,this.onCaughtError=v,this.onRecoverableError=A,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=F,this.incompleteTransitions=new Map}function xx(s,o,u,f,y,v,A,M,F,J,le,ue){return s=new u8(s,o,u,A,F,J,le,ue,M),o=1,v===!0&&(o|=24),v=Na(3,null,null,o),s.current=v,v.stateNode=s,o=kf(),o.refCount++,s.pooledCache=o,o.refCount++,v.memoizedState={element:f,isDehydrated:u,cache:o},Af(v),s}function wx(s){return s?(s=$o,s):$o}function kx(s,o,u,f,y,v){y=wx(y),f.context===null?f.context=y:f.pendingContext=y,f=Gs(o),f.payload={element:u},v=v===void 0?null:v,v!==null&&(f.callback=v),u=qs(s,f,o),u!==null&&(ya(u,s,o),oc(u,s,o))}function Sx(s,o){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var u=s.retryLane;s.retryLane=u!==0&&u<o?u:o}}function Gh(s,o){Sx(s,o),(s=s.alternate)&&Sx(s,o)}function _x(s){if(s.tag===13||s.tag===31){var o=Ui(s,67108864);o!==null&&ya(o,s,67108864),Gh(s,67108864)}}function Cx(s){if(s.tag===13||s.tag===31){var o=La();o=$l(o);var u=Ui(s,o);u!==null&&ya(u,s,o),Gh(s,o)}}var Ud=!0;function d8(s,o,u,f){var y=P.T;P.T=null;var v=oe.p;try{oe.p=2,qh(s,o,u,f)}finally{oe.p=v,P.T=y}}function p8(s,o,u,f){var y=P.T;P.T=null;var v=oe.p;try{oe.p=8,qh(s,o,u,f)}finally{oe.p=v,P.T=y}}function qh(s,o,u,f){if(Ud){var y=Vh(f);if(y===null)Dh(s,o,f,Gd,u),Tx(s,f);else if(h8(y,s,o,u,f))f.stopPropagation();else if(Tx(s,f),o&4&&-1<f8.indexOf(s)){for(;y!==null;){var v=pr(y);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var A=Ne(v.pendingLanes);if(A!==0){var M=v;for(M.pendingLanes|=2,M.entangledLanes|=2;A;){var F=1<<31-Ce(A);M.entanglements[1]|=F,A&=~F}Dr(v),(Tt&6)===0&&(Ad=It()+500,Sc(0))}}break;case 31:case 13:M=Ui(v,2),M!==null&&ya(M,v,2),Ed(),Gh(v,2)}if(v=Vh(f),v===null&&Dh(s,o,f,Gd,u),v===y)break;y=v}y!==null&&f.stopPropagation()}else Dh(s,o,f,null,u)}}function Vh(s){return s=Pi(s),Wh(s)}var Gd=null;function Wh(s){if(Gd=null,s=qr(s),s!==null){var o=i(s);if(o===null)s=null;else{var u=o.tag;if(u===13){if(s=l(o),s!==null)return s;s=null}else if(u===31){if(s=c(o),s!==null)return s;s=null}else if(u===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;s=null}else o!==s&&(s=null)}}return Gd=s,null}function Ax(s){switch(s){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ha()){case Sr:return 2;case wn:return 8;case Yn:case Ua:return 32;case Bn:return 268435456;default:return 32}default:return 32}}var Kh=!1,ni=null,ai=null,ri=null,Rc=new Map,Dc=new Map,si=[],f8="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 Tx(s,o){switch(s){case"focusin":case"focusout":ni=null;break;case"dragenter":case"dragleave":ai=null;break;case"mouseover":case"mouseout":ri=null;break;case"pointerover":case"pointerout":Rc.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Dc.delete(o.pointerId)}}function Mc(s,o,u,f,y,v){return s===null||s.nativeEvent!==v?(s={blockedOn:o,domEventName:u,eventSystemFlags:f,nativeEvent:v,targetContainers:[y]},o!==null&&(o=pr(o),o!==null&&_x(o)),s):(s.eventSystemFlags|=f,o=s.targetContainers,y!==null&&o.indexOf(y)===-1&&o.push(y),s)}function h8(s,o,u,f,y){switch(o){case"focusin":return ni=Mc(ni,s,o,u,f,y),!0;case"dragenter":return ai=Mc(ai,s,o,u,f,y),!0;case"mouseover":return ri=Mc(ri,s,o,u,f,y),!0;case"pointerover":var v=y.pointerId;return Rc.set(v,Mc(Rc.get(v)||null,s,o,u,f,y)),!0;case"gotpointercapture":return v=y.pointerId,Dc.set(v,Mc(Dc.get(v)||null,s,o,u,f,y)),!0}return!1}function Ex(s){var o=qr(s.target);if(o!==null){var u=i(o);if(u!==null){if(o=u.tag,o===13){if(o=l(u),o!==null){s.blockedOn=o,ju(s.priority,function(){Cx(u)});return}}else if(o===31){if(o=c(u),o!==null){s.blockedOn=o,ju(s.priority,function(){Cx(u)});return}}else if(o===3&&u.stateNode.current.memoizedState.isDehydrated){s.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}s.blockedOn=null}function qd(s){if(s.blockedOn!==null)return!1;for(var o=s.targetContainers;0<o.length;){var u=Vh(s.nativeEvent);if(u===null){u=s.nativeEvent;var f=new u.constructor(u.type,u);Wt=f,u.target.dispatchEvent(f),Wt=null}else return o=pr(u),o!==null&&_x(o),s.blockedOn=u,!1;o.shift()}return!0}function Nx(s,o,u){qd(s)&&u.delete(o)}function m8(){Kh=!1,ni!==null&&qd(ni)&&(ni=null),ai!==null&&qd(ai)&&(ai=null),ri!==null&&qd(ri)&&(ri=null),Rc.forEach(Nx),Dc.forEach(Nx)}function Vd(s,o){s.blockedOn===o&&(s.blockedOn=null,Kh||(Kh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,m8)))}var Wd=null;function Rx(s){Wd!==s&&(Wd=s,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Wd===s&&(Wd=null);for(var o=0;o<s.length;o+=3){var u=s[o],f=s[o+1],y=s[o+2];if(typeof f!="function"){if(Wh(f||u)===null)continue;break}var v=pr(u);v!==null&&(s.splice(o,3),o-=3,Vf(v,{pending:!0,data:y,method:u.method,action:f},f,y))}}))}function ul(s){function o(F){return Vd(F,s)}ni!==null&&Vd(ni,s),ai!==null&&Vd(ai,s),ri!==null&&Vd(ri,s),Rc.forEach(o),Dc.forEach(o);for(var u=0;u<si.length;u++){var f=si[u];f.blockedOn===s&&(f.blockedOn=null)}for(;0<si.length&&(u=si[0],u.blockedOn===null);)Ex(u),u.blockedOn===null&&si.shift();if(u=(s.ownerDocument||s).$$reactFormReplay,u!=null)for(f=0;f<u.length;f+=3){var y=u[f],v=u[f+1],A=y[Sn]||null;if(typeof v=="function")A||Rx(u);else if(A){var M=null;if(v&&v.hasAttribute("formAction")){if(y=v,A=v[Sn]||null)M=A.formAction;else if(Wh(y)!==null)continue}else M=A.action;typeof M=="function"?u[f+1]=M:(u.splice(f,3),f-=3),Rx(u)}}}function Dx(){function s(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(A){return y=A})},focusReset:"manual",scroll:"manual"})}function o(){y!==null&&(y(),y=null),f||setTimeout(u,20)}function u(){if(!f&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var f=!1,y=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(u,100),function(){f=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),y!==null&&(y(),y=null)}}}function Yh(s){this._internalRoot=s}Kd.prototype.render=Yh.prototype.render=function(s){var o=this._internalRoot;if(o===null)throw Error(a(409));var u=o.current,f=La();kx(u,f,s,o,null,null)},Kd.prototype.unmount=Yh.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var o=s.containerInfo;kx(s.current,2,null,s,null,null),Ed(),o[Ar]=null}};function Kd(s){this._internalRoot=s}Kd.prototype.unstable_scheduleHydration=function(s){if(s){var o=Ro();s={blockedOn:null,target:s,priority:o};for(var u=0;u<si.length&&o!==0&&o<si[u].priority;u++);si.splice(u,0,s),u===0&&Ex(s)}};var Mx=e.version;if(Mx!=="19.2.7")throw Error(a(527,Mx,"19.2.7"));oe.findDOMNode=function(s){var o=s._reactInternals;if(o===void 0)throw typeof s.render=="function"?Error(a(188)):(s=Object.keys(s).join(","),Error(a(268,s)));return s=p(o),s=s!==null?h(s):null,s=s===null?null:s.stateNode,s};var g8={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:P,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Yd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yd.isDisabled&&Yd.supportsFiber)try{Zn=Yd.inject(g8),nn=Yd}catch{}}return Lc.createRoot=function(s,o){if(!r(s))throw Error(a(299));var u=!1,f="",y=zb,v=$b,A=Fb;return o!=null&&(o.unstable_strictMode===!0&&(u=!0),o.identifierPrefix!==void 0&&(f=o.identifierPrefix),o.onUncaughtError!==void 0&&(y=o.onUncaughtError),o.onCaughtError!==void 0&&(v=o.onCaughtError),o.onRecoverableError!==void 0&&(A=o.onRecoverableError)),o=xx(s,1,!1,null,null,u,f,null,y,v,A,Dx),s[Ar]=o.current,Rh(s),new Yh(o)},Lc.hydrateRoot=function(s,o,u){if(!r(s))throw Error(a(299));var f=!1,y="",v=zb,A=$b,M=Fb,F=null;return u!=null&&(u.unstable_strictMode===!0&&(f=!0),u.identifierPrefix!==void 0&&(y=u.identifierPrefix),u.onUncaughtError!==void 0&&(v=u.onUncaughtError),u.onCaughtError!==void 0&&(A=u.onCaughtError),u.onRecoverableError!==void 0&&(M=u.onRecoverableError),u.formState!==void 0&&(F=u.formState)),o=xx(s,1,!0,o,u??null,f,y,F,v,A,M,Dx),o.context=wx(null),u=o.current,f=La(),f=$l(f),y=Gs(f),y.callback=null,qs(u,y,f),u=f,o.current.lanes=u,dr(o,u),Dr(o),s[Ar]=o.current,Rh(s),new Kd(o)},Lc.version="19.2.7",Lc}var Ux;function D_(){if(Ux)return Qh.exports;Ux=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(),Qh.exports=R_(),Qh.exports}var M_=D_();const O_=Ok(M_),L_="modulepreload",j_=function(t){return"/"+t},Gx={},j=function(e,n,a){let r=Promise.resolve();if(n&&n.length>0){let l=function(p){return Promise.all(p.map(h=>Promise.resolve(h).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),d=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));r=l(n.map(p=>{if(p=j_(p),p in Gx)return;Gx[p]=!0;const h=p.endsWith(".css"),m=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${m}`))return;const b=document.createElement("link");if(b.rel=h?"stylesheet":L_,h||(b.as="script"),b.crossOrigin="",b.href=p,d&&b.setAttribute("nonce",d),document.head.appendChild(b),h)return new Promise((x,w)=>{b.addEventListener("load",x),b.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${p}`)))})}))}function i(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return r.then(l=>{for(const c of l||[])c.status==="rejected"&&i(c.reason);return e().catch(i)})},Qe=t=>typeof t=="string",jc=()=>{let t,e;const n=new Promise((a,r)=>{t=a,e=r});return n.resolve=t,n.reject=e,n},qx=t=>t==null?"":String(t),B_=(t,e,n)=>{t.forEach(a=>{e[a]&&(n[a]=e[a])})},I_=/###/g,Vx=t=>t&&t.includes("###")?t.replace(I_,"."):t,Wx=t=>!t||Qe(t),Xc=(t,e,n)=>{const a=Qe(e)?e.split("."):e;let r=0;for(;r<a.length-1;){if(Wx(t))return{};const i=Vx(a[r]);!t[i]&&n&&(t[i]=new n),Object.prototype.hasOwnProperty.call(t,i)?t=t[i]:t={},++r}return Wx(t)?{}:{obj:t,k:Vx(a[r])}},Kx=(t,e,n)=>{const{obj:a,k:r}=Xc(t,e,Object);if(a!==void 0||e.length===1){a[r]=n;return}let i=e[e.length-1],l=e.slice(0,e.length-1),c=Xc(t,l,Object);for(;c.obj===void 0&&l.length;)i=`${l[l.length-1]}.${i}`,l=l.slice(0,l.length-1),c=Xc(t,l,Object),c!=null&&c.obj&&typeof c.obj[`${c.k}.${i}`]<"u"&&(c.obj=void 0);c.obj[`${c.k}.${i}`]=n},P_=(t,e,n,a)=>{const{obj:r,k:i}=Xc(t,e,Object);r[i]=r[i]||[],r[i].push(n)},$0=(t,e)=>{const{obj:n,k:a}=Xc(t,e);if(n&&Object.prototype.hasOwnProperty.call(n,a))return n[a]},z_=(t,e,n)=>{const a=$0(t,n);return a!==void 0?a:$0(e,n)},Zk=(t,e,n)=>{for(const a in e)a!=="__proto__"&&a!=="constructor"&&(Object.prototype.hasOwnProperty.call(t,a)?Qe(t[a])||t[a]instanceof String||Qe(e[a])||e[a]instanceof String?n&&(t[a]=e[a]):Zk(t[a],e[a],n):t[a]=e[a]);return t},fs=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),$_={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},F_=t=>Qe(t)?t.replace(/[&<>"'\/]/g,e=>$_[e]):t;class H_{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const n=this.regExpMap.get(e);if(n!==void 0)return n;const a=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,a),this.regExpQueue.push(e),a}}const U_=[" ",",","?","!",";"],G_=new H_(20),q_=(t,e,n)=>{e=e||"",n=n||"";const a=U_.filter(l=>!e.includes(l)&&!n.includes(l));if(a.length===0)return!0;const r=G_.getRegExp(`(${a.map(l=>l==="?"?"\\?":l).join("|")})`);let i=!r.test(t);if(!i){const l=t.indexOf(n);l>0&&!r.test(t.substring(0,l))&&(i=!0)}return i},Jm=(t,e,n=".")=>{if(!t)return;if(t[e])return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;const a=e.split(n);let r=t;for(let i=0;i<a.length;){if(!r||typeof r!="object")return;let l,c="";for(let d=i;d<a.length;++d)if(d!==i&&(c+=n),c+=a[d],l=r[c],l!==void 0){if(["string","number","boolean"].includes(typeof l)&&d<a.length-1)continue;i+=d-i+1;break}r=l}return r},cu=t=>t==null?void 0:t.replace(/_/g,"-"),V_={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){var n,a;(a=(n=console==null?void 0:console[t])==null?void 0:n.apply)==null||a.call(n,console,e)}};class F0{constructor(e,n={}){this.init(e,n)}init(e,n={}){this.prefix=n.prefix||"i18next:",this.logger=e||V_,this.options=n,this.debug=n.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,n,a,r){return r&&!this.debug?null:(e=e.map(i=>Qe(i)?i.replace(/[\r\n\x00-\x1F\x7F]/g," "):i),Qe(e[0])&&(e[0]=`${a}${this.prefix} ${e[0]}`),this.logger[n](e))}create(e){return new F0(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new F0(this.logger,e)}}var Pr=new F0;class kp{constructor(){this.observers={}}on(e,n){return e.split(" ").forEach(a=>{this.observers[a]||(this.observers[a]=new Map);const r=this.observers[a].get(n)||0;this.observers[a].set(n,r+1)}),this}off(e,n){if(this.observers[e]){if(!n){delete this.observers[e];return}this.observers[e].delete(n)}}once(e,n){const a=(...r)=>{n(...r),this.off(e,a)};return this.on(e,a),this}emit(e,...n){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([r,i])=>{for(let l=0;l<i;l++)r(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([r,i])=>{for(let l=0;l<i;l++)r(e,...n)})}}class Yx extends kp{constructor(e,n={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.includes(e)||this.options.ns.push(e)}removeNamespaces(e){const n=this.options.ns.indexOf(e);n>-1&&this.options.ns.splice(n,1)}getResource(e,n,a,r={}){var p,h;const i=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,l=r.ignoreJSONStructure!==void 0?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let c;e.includes(".")?c=e.split("."):(c=[e,n],a&&(Array.isArray(a)?c.push(...a):Qe(a)&&i?c.push(...a.split(i)):c.push(a)));const d=$0(this.data,c);return!d&&!n&&!a&&e.includes(".")&&(e=c[0],n=c[1],a=c.slice(2).join(".")),d||!l||!Qe(a)?d:Jm((h=(p=this.data)==null?void 0:p[e])==null?void 0:h[n],a,i)}addResource(e,n,a,r,i={silent:!1}){const l=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let c=[e,n];a&&(c=c.concat(l?a.split(l):a)),e.includes(".")&&(c=e.split("."),r=n,n=c[1]),this.addNamespaces(n),Kx(this.data,c,r),i.silent||this.emit("added",e,n,a,r)}addResources(e,n,a,r={silent:!1}){for(const i in a)(Qe(a[i])||Array.isArray(a[i]))&&this.addResource(e,n,i,a[i],{silent:!0});r.silent||this.emit("added",e,n,a)}addResourceBundle(e,n,a,r,i,l={silent:!1,skipCopy:!1}){let c=[e,n];e.includes(".")&&(c=e.split("."),r=a,a=n,n=c[1]),this.addNamespaces(n);let d=$0(this.data,c)||{};l.skipCopy||(a=JSON.parse(JSON.stringify(a))),r?Zk(d,a,i):d={...d,...a},Kx(this.data,c,d),l.silent||this.emit("added",e,n,a)}removeResourceBundle(e,n){this.hasResourceBundle(e,n)&&delete this.data[e][n],this.removeNamespaces(n),this.emit("removed",e,n)}hasResourceBundle(e,n){return this.getResource(e,n)!==void 0}getResourceBundle(e,n){return n||(n=this.options.defaultNS),this.getResource(e,n)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const n=this.getDataByLanguage(e);return!!(n&&Object.keys(n)||[]).find(r=>n[r]&&Object.keys(n[r]).length>0)}toJSON(){return this.data}}var Xk={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,n,a,r){return t.forEach(i=>{var l;e=((l=this.processors[i])==null?void 0:l.process(e,n,a,r))??e}),e}};const Qk=Symbol("i18next/PATH_KEY");function W_(){const t=[],e=Object.create(null);let n;return e.get=(a,r)=>{var i;return(i=n==null?void 0:n.revoke)==null||i.call(n),r===Qk?t:(t.push(r),n=Proxy.revocable(a,e),n.proxy)},Proxy.revocable(Object.create(null),e).proxy}function xl(t,e){const{[Qk]:n}=t(W_()),a=(e==null?void 0:e.keySeparator)??".",r=(e==null?void 0:e.nsSeparator)??":",i=(e==null?void 0:e.enableSelector)==="strict";if(n.length>1&&r){const l=e==null?void 0:e.ns,c=i?Array.isArray(l)?l:l?[l]:null:Array.isArray(l)?l:null;if(c&&(i?c:c.length>1?c.slice(1):[]).includes(n[0]))return`${n[0]}${r}${n.slice(1).join(a)}`}return n.join(a)}const tm=t=>!Qe(t)&&typeof t!="boolean"&&typeof t!="number";class H0 extends kp{constructor(e,n={}){super(),B_(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Pr.create("translator"),this.checkedLoadedFor={}}changeLanguage(e){e&&(this.language=e)}exists(e,n={interpolation:{}}){const a={...n};if(e==null)return!1;const r=this.resolve(e,a);if((r==null?void 0:r.res)===void 0)return!1;const i=tm(r.res);return!(a.returnObjects===!1&&i)}extractFromKey(e,n){let a=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;a===void 0&&(a=":");const r=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let i=n.ns||this.options.defaultNS||[];const l=a&&e.includes(a),c=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!q_(e,a,r);if(l&&!c){const d=e.match(this.interpolator.nestingRegexp);if(d&&d.length>0)return{key:e,namespaces:Qe(i)?[i]:i};const p=e.split(a);(a!==r||a===r&&this.options.ns.includes(p[0]))&&(i=p.shift()),e=p.join(r)}return{key:e,namespaces:Qe(i)?[i]:i}}translate(e,n,a){let r=typeof n=="object"?{...n}:n;if(typeof r!="object"&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),typeof r=="object"&&(r={...r}),r||(r={}),e==null)return"";typeof e=="function"&&(e=xl(e,{...this.options,...r})),Array.isArray(e)||(e=[String(e)]),e=e.map(me=>typeof me=="function"?xl(me,{...this.options,...r}):String(me));const i=r.returnDetails!==void 0?r.returnDetails:this.options.returnDetails,l=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,{key:c,namespaces:d}=this.extractFromKey(e[e.length-1],r),p=d[d.length-1];let h=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;h===void 0&&(h=":");const m=r.lng||this.language,b=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((m==null?void 0:m.toLowerCase())==="cimode")return b?i?{res:`${p}${h}${c}`,usedKey:c,exactUsedKey:c,usedLng:m,usedNS:p,usedParams:this.getUsedParamsDetails(r)}:`${p}${h}${c}`:i?{res:c,usedKey:c,exactUsedKey:c,usedLng:m,usedNS:p,usedParams:this.getUsedParamsDetails(r)}:c;const x=this.resolve(e,r);let w=x==null?void 0:x.res;const S=(x==null?void 0:x.usedKey)||c,C=(x==null?void 0:x.exactUsedKey)||c,E=["[object Number]","[object Function]","[object RegExp]"],T=r.joinArrays!==void 0?r.joinArrays:this.options.joinArrays,L=!this.i18nFormat||this.i18nFormat.handleAsObject,D=r.count!==void 0&&!Qe(r.count),B=H0.hasDefaultValue(r),H=D?this.pluralResolver.getSuffix(m,r.count,r):"",K=r.ordinal&&D?this.pluralResolver.getSuffix(m,r.count,{ordinal:!1}):"",U=D&&!r.ordinal&&r.count===0,q=U&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${H}`]||r[`defaultValue${K}`]||r.defaultValue;let re=w;L&&!w&&B&&(re=q);const _e=tm(re),G=Object.prototype.toString.apply(re);if(L&&re&&_e&&!E.includes(G)&&!(Qe(T)&&Array.isArray(re))){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const me=this.options.returnedObjectHandler?this.options.returnedObjectHandler(S,re,{...r,ns:d}):`key '${c} (${this.language})' returned an object instead of string.`;return i?(x.res=me,x.usedParams=this.getUsedParamsDetails(r),x):me}if(l){const me=Array.isArray(re),ge=me?[]:{},ye=me?C:S;for(const P in re)if(Object.prototype.hasOwnProperty.call(re,P)){const oe=`${ye}${l}${P}`;B&&!w?ge[P]=this.translate(oe,{...r,defaultValue:tm(q)?q[P]:void 0,joinArrays:!1,ns:d}):ge[P]=this.translate(oe,{...r,joinArrays:!1,ns:d}),ge[P]===oe&&(ge[P]=re[P])}w=ge}}else if(L&&Qe(T)&&Array.isArray(w))w=w.join(T),w&&(w=this.extendTranslation(w,e,r,a));else{let me=!1,ge=!1;!this.isValidLookup(w)&&B&&(me=!0,w=q),this.isValidLookup(w)||(ge=!0,w=c);const P=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&ge?void 0:w,oe=B&&q!==w&&this.options.updateMissing;if(ge||me||oe){if(this.logger.log(oe?"updateKey":"missingKey",m,p,D&&!oe?`${c}${this.pluralResolver.getSuffix(m,r.count,r)}`:c,oe?q:w),l){const Pe=this.resolve(c,{...r,keySeparator:!1});Pe&&Pe.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let he=[];const ke=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ke&&ke[0])for(let Pe=0;Pe<ke.length;Pe++)he.push(ke[Pe]);else this.options.saveMissingTo==="all"?he=this.languageUtils.toResolveHierarchy(r.lng||this.language):he.push(r.lng||this.language);const Be=(Pe,He,$e)=>{var tn;const ft=B&&$e!==w?$e:P;this.options.missingKeyHandler?this.options.missingKeyHandler(Pe,p,He,ft,oe,r):(tn=this.backendConnector)!=null&&tn.saveMissing&&this.backendConnector.saveMissing(Pe,p,He,ft,oe,r),this.emit("missingKey",Pe,p,He,w)};this.options.saveMissing&&(this.options.saveMissingPlurals&&D?he.forEach(Pe=>{const He=this.pluralResolver.getSuffixes(Pe,r);U&&r[`defaultValue${this.options.pluralSeparator}zero`]&&!He.includes(`${this.options.pluralSeparator}zero`)&&He.push(`${this.options.pluralSeparator}zero`),He.forEach($e=>{Be([Pe],c+$e,r[`defaultValue${$e}`]||q)})}):Be(he,c,q))}w=this.extendTranslation(w,e,r,x,a),ge&&w===c&&this.options.appendNamespaceToMissingKey&&(w=`${p}${h}${c}`),(ge||me)&&this.options.parseMissingKeyHandler&&(w=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${p}${h}${c}`:c,me?w:void 0,r))}return i?(x.res=w,x.usedParams=this.getUsedParamsDetails(r),x):w}extendTranslation(e,n,a,r,i){var d,p;if((d=this.i18nFormat)!=null&&d.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...a},a.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!a.skipInterpolation){a.interpolation&&this.interpolator.init({...a,interpolation:{...this.options.interpolation,...a.interpolation}});const h=Qe(e)&&(((p=a==null?void 0:a.interpolation)==null?void 0:p.skipOnVariables)!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let m;if(h){const x=e.match(this.interpolator.nestingRegexp);m=x&&x.length}let b=a.replace&&!Qe(a.replace)?a.replace:a;if(this.options.interpolation.defaultVariables&&(b={...this.options.interpolation.defaultVariables,...b}),e=this.interpolator.interpolate(e,b,a.lng||this.language||r.usedLng,a),h){const x=e.match(this.interpolator.nestingRegexp),w=x&&x.length;m<w&&(a.nest=!1)}!a.lng&&r&&r.res&&(a.lng=this.language||r.usedLng),a.nest!==!1&&(e=this.interpolator.nest(e,(...x)=>(i==null?void 0:i[0])===x[0]&&!a.context?(this.logger.warn(`It seems you are nesting recursively key: ${x[0]} in key: ${n[0]}`),null):this.translate(...x,n),a)),a.interpolation&&this.interpolator.reset()}const l=a.postProcess||this.options.postProcess,c=Qe(l)?[l]:l;return e!=null&&(c!=null&&c.length)&&a.applyPostProcessor!==!1&&(e=Xk.handle(c,e,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(a)},...a}:a,this)),e}resolve(e,n={}){let a,r,i,l,c;return Qe(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(d=>typeof d=="function"?xl(d,{...this.options,...n}):d)),e.forEach(d=>{if(this.isValidLookup(a))return;const p=this.extractFromKey(d,n),h=p.key;r=h;let m=p.namespaces;this.options.fallbackNS&&(m=m.concat(this.options.fallbackNS));const b=n.count!==void 0&&!Qe(n.count),x=b&&!n.ordinal&&n.count===0,w=n.context!==void 0&&(Qe(n.context)||typeof n.context=="number")&&n.context!=="",S=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);m.forEach(C=>{var E,T;this.isValidLookup(a)||(c=C,!this.checkedLoadedFor[`${S[0]}-${C}`]&&((E=this.utils)!=null&&E.hasLoadedNamespace)&&!((T=this.utils)!=null&&T.hasLoadedNamespace(c))&&(this.checkedLoadedFor[`${S[0]}-${C}`]=!0,this.logger.warn(`key "${r}" for languages "${S.join(", ")}" won't get resolved as namespace "${c}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),S.forEach(L=>{var H;if(this.isValidLookup(a))return;l=L;const D=[h];if((H=this.i18nFormat)!=null&&H.addLookupKeys)this.i18nFormat.addLookupKeys(D,h,L,C,n);else{let K;b&&(K=this.pluralResolver.getSuffix(L,n.count,n));const U=`${this.options.pluralSeparator}zero`,q=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(b&&(n.ordinal&&K.startsWith(q)&&D.push(h+K.replace(q,this.options.pluralSeparator)),D.push(h+K),x&&D.push(h+U)),w){const re=`${h}${this.options.contextSeparator||"_"}${n.context}`;D.push(re),b&&(n.ordinal&&K.startsWith(q)&&D.push(re+K.replace(q,this.options.pluralSeparator)),D.push(re+K),x&&D.push(re+U))}}let B;for(;B=D.pop();)this.isValidLookup(a)||(i=B,a=this.getResource(L,C,B,n))}))})}),{res:a,usedKey:r,exactUsedKey:i,usedLng:l,usedNS:c}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,n,a,r={}){var i;return(i=this.i18nFormat)!=null&&i.getResource?this.i18nFormat.getResource(e,n,a,r):this.resourceStore.getResource(e,n,a,r)}getUsedParamsDetails(e={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],a=e.replace&&!Qe(e.replace);let r=a?e.replace:e;if(a&&typeof e.count<"u"&&(r={...r,count:e.count}),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!a){r={...r};for(const i of n)delete r[i]}return r}static hasDefaultValue(e){const n="defaultValue";for(const a in e)if(Object.prototype.hasOwnProperty.call(e,a)&&a.startsWith(n)&&e[a]!==void 0)return!0;return!1}}class Zx{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Pr.create("languageUtils")}getScriptPartFromCode(e){if(e=cu(e),!e||!e.includes("-"))return null;const n=e.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(e){if(e=cu(e),!e||!e.includes("-"))return e;const n=e.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(e){if(Qe(e)&&e.includes("-")){let n;try{n=Intl.getCanonicalLocales(e)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(e)}getBestMatchFromCodes(e){if(!e)return null;let n;return e.forEach(a=>{if(n)return;const r=this.formatLanguageCode(a);(!this.options.supportedLngs||this.isSupportedCode(r))&&(n=r)}),!n&&this.options.supportedLngs&&e.forEach(a=>{if(n)return;const r=this.getScriptPartFromCode(a);if(this.isSupportedCode(r))return n=r;const i=this.getLanguagePartFromCode(a);if(this.isSupportedCode(i))return n=i;n=this.options.supportedLngs.find(l=>l===i?!0:!l.includes("-")&&!i.includes("-")?!1:!!(l.includes("-")&&!i.includes("-")&&l.slice(0,l.indexOf("-"))===i||l.startsWith(i)&&i.length>1))}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(e,n){if(!e)return[];if(typeof e=="function"&&(e=e(n)),Qe(e)&&(e=[e]),Array.isArray(e))return e;if(!n)return e.default||[];let a=e[n];return a||(a=e[this.getScriptPartFromCode(n)]),a||(a=e[this.formatLanguageCode(n)]),a||(a=e[this.getLanguagePartFromCode(n)]),a||(a=e.default),a||[]}toResolveHierarchy(e,n){const a=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],e),r=[],i=l=>{l&&(this.isSupportedCode(l)?r.push(l):this.logger.warn(`rejecting language code not found in supportedLngs: ${l}`))};return Qe(e)&&(e.includes("-")||e.includes("_"))?(this.options.load!=="languageOnly"&&i(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&i(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&i(this.getLanguagePartFromCode(e))):Qe(e)&&i(this.formatLanguageCode(e)),a.forEach(l=>{r.includes(l)||i(this.formatLanguageCode(l))}),r}}const Xx={zero:0,one:1,two:2,few:3,many:4,other:5},Qx={select:t=>t===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class K_{constructor(e,n={}){this.languageUtils=e,this.options=n,this.logger=Pr.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,n={}){const a=cu(e==="dev"?"en":e),r=n.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:a,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let l;try{l=new Intl.PluralRules(a,{type:r})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),Qx;if(!e.match(/-|_/))return Qx;const d=this.languageUtils.getLanguagePartFromCode(e);l=this.getRule(d,n)}return this.pluralRulesCache[i]=l,l}needsPlural(e,n={}){let a=this.getRule(e,n);return a||(a=this.getRule("dev",n)),(a==null?void 0:a.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(e,n,a={}){return this.getSuffixes(e,a).map(r=>`${n}${r}`)}getSuffixes(e,n={}){let a=this.getRule(e,n);return a||(a=this.getRule("dev",n)),a?a.resolvedOptions().pluralCategories.sort((r,i)=>Xx[r]-Xx[i]).map(r=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r}`):[]}getSuffix(e,n,a={}){const r=this.getRule(e,a);return r?`${this.options.prepend}${a.ordinal?`ordinal${this.options.prepend}`:""}${r.select(n)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",n,a))}}const Jx=(t,e,n,a=".",r=!0)=>{let i=z_(t,e,n);return!i&&r&&Qe(n)&&(i=Jm(t,n,a),i===void 0&&(i=Jm(e,n,a))),i},Y_=t=>t.replace(/\$/g,"$$$$");class e4{constructor(e={}){var n;this.logger=Pr.create("interpolator"),this.options=e,this.format=((n=e==null?void 0:e.interpolation)==null?void 0:n.format)||(a=>a),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:n,escapeValue:a,useRawValueToEscape:r,prefix:i,prefixEscaped:l,suffix:c,suffixEscaped:d,formatSeparator:p,unescapeSuffix:h,unescapePrefix:m,nestingPrefix:b,nestingPrefixEscaped:x,nestingSuffix:w,nestingSuffixEscaped:S,nestingOptionsSeparator:C,maxReplaces:E,alwaysFormat:T}=e.interpolation;this.escape=n!==void 0?n:F_,this.escapeValue=a!==void 0?a:!0,this.useRawValueToEscape=r!==void 0?r:!1,this.prefix=i?fs(i):l||"{{",this.suffix=c?fs(c):d||"}}",this.formatSeparator=p||",",this.unescapePrefix=h?"":m?fs(m):"-",this.unescapeSuffix=this.unescapePrefix?"":h?fs(h):"",this.nestingPrefix=b?fs(b):x||fs("$t("),this.nestingSuffix=w?fs(w):S||fs(")"),this.nestingOptionsSeparator=C||",",this.maxReplaces=E||1e3,this.alwaysFormat=T!==void 0?T:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(n,a)=>(n==null?void 0:n.source)===a?(n.lastIndex=0,n):new RegExp(a,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,n,a,r){var x;let i,l,c;const d=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},p=w=>{if(!w.includes(this.formatSeparator)){const T=Jx(n,d,w,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(T,void 0,a,{...r,...n,interpolationkey:w}):T}const S=w.split(this.formatSeparator),C=S.shift().trim(),E=S.join(this.formatSeparator).trim();return this.format(Jx(n,d,C,this.options.keySeparator,this.options.ignoreJSONStructure),E,a,{...r,...n,interpolationkey:C})};this.resetRegExp(),!this.escapeValue&&typeof e=="string"&&/\$t\([^)]*\{[^}]*\{\{/.test(e)&&this.logger.warn("nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");const h=(r==null?void 0:r.missingInterpolationHandler)||this.options.missingInterpolationHandler,m=((x=r==null?void 0:r.interpolation)==null?void 0:x.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:w=>w},{regex:this.regexp,safeValue:w=>this.escapeValue?this.escape(w):w}].forEach(w=>{for(c=0;i=w.regex.exec(e);){const S=i[1].trim();if(l=p(S),l===void 0)if(typeof h=="function"){const E=h(e,i,r);l=Qe(E)?E:""}else if(r&&Object.prototype.hasOwnProperty.call(r,S))l="";else if(m){l=i[0];continue}else this.logger.warn(`missed to pass in variable ${S} for interpolating ${e}`),l="";else!Qe(l)&&!this.useRawValueToEscape&&(l=qx(l));const C=w.safeValue(l);if(e=e.replace(i[0],Y_(C)),m?(w.regex.lastIndex+=C.length,w.regex.lastIndex-=i[0].length):w.regex.lastIndex=0,c++,c>=this.maxReplaces)break}}),e}nest(e,n,a={}){let r,i,l;const c=(d,p)=>{const h=this.nestingOptionsSeparator;if(!d.includes(h))return d;const m=d.split(new RegExp(`${fs(h)}[ ]*{`));let b=`{${m[1]}`;d=m[0],b=this.interpolate(b,l);const x=b.match(/'/g),w=b.match(/"/g);(((x==null?void 0:x.length)??0)%2===0&&!w||((w==null?void 0:w.length)??0)%2!==0)&&(b=b.replace(/'/g,'"'));try{l=JSON.parse(b),p&&(l={...p,...l})}catch(S){return this.logger.warn(`failed parsing options string in nesting for key ${d}`,S),`${d}${h}${b}`}return l.defaultValue&&l.defaultValue.includes(this.prefix)&&delete l.defaultValue,d};for(;r=this.nestingRegexp.exec(e);){let d=[];l={...a},l=l.replace&&!Qe(l.replace)?l.replace:l,l.applyPostProcessor=!1,delete l.defaultValue;const p=/{.*}/s.test(r[1])?r[1].lastIndexOf("}")+1:r[1].indexOf(this.formatSeparator);if(p!==-1&&(d=r[1].slice(p).split(this.formatSeparator).map(h=>h.trim()).filter(Boolean),r[1]=r[1].slice(0,p)),i=n(c.call(this,r[1].trim(),l),l),i&&r[0]===e&&!Qe(i))return i;Qe(i)||(i=qx(i)),i||(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),i=""),d.length&&(i=d.reduce((h,m)=>this.format(h,m,a.lng,{...a,interpolationkey:r[1].trim()}),i.trim())),e=e.replace(r[0],i),this.regexp.lastIndex=0}return e}}const Z_=t=>{let e=t.toLowerCase().trim();const n={};if(t.includes("(")){const a=t.split("(");e=a[0].toLowerCase().trim();const r=a[1].slice(0,-1);e==="currency"&&!r.includes(":")?n.currency||(n.currency=r.trim()):e==="relativetime"&&!r.includes(":")?n.range||(n.range=r.trim()):r.split(";").forEach(l=>{if(l){const[c,...d]=l.split(":"),p=d.join(":").trim().replace(/^'+|'+$/g,""),h=c.trim();n[h]||(n[h]=p),p==="false"&&(n[h]=!1),p==="true"&&(n[h]=!0),isNaN(p)||(n[h]=parseInt(p,10))}})}return{formatName:e,formatOptions:n}},t4=t=>{const e={};return(n,a,r)=>{let i=r;r&&r.interpolationkey&&r.formatParams&&r.formatParams[r.interpolationkey]&&r[r.interpolationkey]&&(i={...i,[r.interpolationkey]:void 0});const l=a+JSON.stringify(i);let c=e[l];return c||(c=t(cu(a),r),e[l]=c),c(n)}},X_=t=>(e,n,a)=>t(cu(n),a)(e);class Q_{constructor(e={}){this.logger=Pr.create("formatter"),this.options=e,this.init(e)}init(e,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const a=n.cacheInBuiltFormats?t4:X_;this.formats={number:a((r,i)=>{const l=new Intl.NumberFormat(r,{...i});return c=>l.format(c)}),currency:a((r,i)=>{const l=new Intl.NumberFormat(r,{...i,style:"currency"});return c=>l.format(c)}),datetime:a((r,i)=>{const l=new Intl.DateTimeFormat(r,{...i});return c=>l.format(c)}),relativetime:a((r,i)=>{const l=new Intl.RelativeTimeFormat(r,{...i});return c=>l.format(c,i.range||"day")}),list:a((r,i)=>{const l=new Intl.ListFormat(r,{...i});return c=>l.format(c)})}}add(e,n){this.formats[e.toLowerCase().trim()]=n}addCached(e,n){this.formats[e.toLowerCase().trim()]=t4(n)}format(e,n,a,r={}){if(!n||e==null)return e;const i=n.split(this.formatSeparator),l=[];for(let d=0;d<i.length;d++){let p=i[d];for(;p.indexOf("(")>-1&&!p.includes(")")&&d+1<i.length;)p=`${p}${this.formatSeparator}${i[++d]}`;l.push(p)}return l.reduce((d,p)=>{var b;const{formatName:h,formatOptions:m}=Z_(p);if(this.formats[h]){let x=d;try{const w=((b=r==null?void 0:r.formatParams)==null?void 0:b[r.interpolationkey])||{},S=w.locale||w.lng||r.locale||r.lng||a;x=this.formats[h](d,S,{...m,...r,...w})}catch(w){this.logger.warn(w)}return x}else this.logger.warn(`there was no format function for ${h}`);return d},e)}}const J_=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class e9 extends kp{constructor(e,n,a,r={}){var i,l;super(),this.backend=e,this.store=n,this.services=a,this.languageUtils=a.languageUtils,this.options=r,this.logger=Pr.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],(l=(i=this.backend)==null?void 0:i.init)==null||l.call(i,a,r.backend,r)}queueLoad(e,n,a,r){const i={},l={},c={},d={};return e.forEach(p=>{let h=!0;n.forEach(m=>{const b=`${p}|${m}`;!a.reload&&this.store.hasResourceBundle(p,m)?this.state[b]=2:this.state[b]<0||(this.state[b]===1?l[b]===void 0&&(l[b]=!0):(this.state[b]=1,h=!1,l[b]===void 0&&(l[b]=!0),i[b]===void 0&&(i[b]=!0),d[m]===void 0&&(d[m]=!0)))}),h||(c[p]=!0)}),(Object.keys(i).length||Object.keys(l).length)&&this.queue.push({pending:l,pendingCount:Object.keys(l).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(l),toLoadLanguages:Object.keys(c),toLoadNamespaces:Object.keys(d)}}loaded(e,n,a){const r=e.split("|"),i=r[0],l=r[1];n&&this.emit("failedLoading",i,l,n),!n&&a&&this.store.addResourceBundle(i,l,a,void 0,void 0,{skipCopy:!0}),this.state[e]=n?-1:2,n&&a&&(this.state[e]=0);const c={};this.queue.forEach(d=>{P_(d.loaded,[i],l),J_(d,e),n&&d.errors.push(n),d.pendingCount===0&&!d.done&&(Object.keys(d.loaded).forEach(p=>{c[p]||(c[p]={});const h=d.loaded[p];h.length&&h.forEach(m=>{c[p][m]===void 0&&(c[p][m]=!0)})}),d.done=!0,d.errors.length?d.callback(d.errors):d.callback())}),this.emit("loaded",c),this.queue=this.queue.filter(d=>!d.done)}read(e,n,a,r=0,i=this.retryTimeout,l){if(!e.length)return l(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:n,fcName:a,tried:r,wait:i,callback:l});return}this.readingCalls++;const c=(p,h)=>{if(this.readingCalls--,this.waitingReads.length>0){const m=this.waitingReads.shift();this.read(m.lng,m.ns,m.fcName,m.tried,m.wait,m.callback)}if(p&&h&&r<this.maxRetries){setTimeout(()=>{this.read(e,n,a,r+1,i*2,l)},i);return}l(p,h)},d=this.backend[a].bind(this.backend);if(d.length===2){try{const p=d(e,n);p&&typeof p.then=="function"?p.then(h=>c(null,h)).catch(c):c(null,p)}catch(p){c(p)}return}return d(e,n,c)}prepareLoading(e,n,a={},r){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();Qe(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Qe(n)&&(n=[n]);const i=this.queueLoad(e,n,a,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach(l=>{this.loadOne(l)})}load(e,n,a){this.prepareLoading(e,n,{},a)}reload(e,n,a){this.prepareLoading(e,n,{reload:!0},a)}loadOne(e,n=""){const a=e.split("|"),r=a[0],i=a[1];this.read(r,i,"read",void 0,void 0,(l,c)=>{l&&this.logger.warn(`${n}loading namespace ${i} for language ${r} failed`,l),!l&&c&&this.logger.log(`${n}loaded namespace ${i} for language ${r}`,c),this.loaded(e,l,c)})}saveMissing(e,n,a,r,i,l={},c=()=>{}){var d,p,h,m,b;if((p=(d=this.services)==null?void 0:d.utils)!=null&&p.hasLoadedNamespace&&!((m=(h=this.services)==null?void 0:h.utils)!=null&&m.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${a}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(a==null||a==="")){if((b=this.backend)!=null&&b.create){const x={...l,isUpdate:i},w=this.backend.create.bind(this.backend);if(w.length<6)try{let S;w.length===5?S=w(e,n,a,r,x):S=w(e,n,a,r),S&&typeof S.then=="function"?S.then(C=>c(null,C)).catch(c):c(null,S)}catch(S){c(S)}else w(e,n,a,r,c,x)}!e||!e[0]||this.store.addResource(e[0],n,a,r)}}}const nm=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),Qe(t[1])&&(e.defaultValue=t[1]),Qe(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const n=t[3]||t[2];Object.keys(n).forEach(a=>{e[a]=n[a]})}return e},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),n4=t=>(Qe(t.ns)&&(t.ns=[t.ns]),Qe(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),Qe(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&!t.supportedLngs.includes("cimode")&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t),Qd=()=>{},t9=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(n=>{typeof t[n]=="function"&&(t[n]=t[n].bind(t))})};class Qc extends kp{constructor(e={},n){if(super(),this.options=n4(e),this.services={},this.logger=Pr,this.modules={external:[]},t9(this),n&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,n),this;setTimeout(()=>{this.init(e,n)},0)}}init(e={},n){this.isInitializing=!0,typeof e=="function"&&(n=e,e={}),e.defaultNS==null&&e.ns&&(Qe(e.ns)?e.defaultNS=e.ns:e.ns.includes("translation")||(e.defaultNS=e.ns[0]));const a=nm();this.options={...a,...this.options,...n4(e)},this.options.interpolation={...a.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=a.overloadTranslationOptionHandler);const r=p=>p?typeof p=="function"?new p:p:null;if(!this.options.isClone){this.modules.logger?Pr.init(r(this.modules.logger),this.options):Pr.init(null,this.options);let p;this.modules.formatter?p=this.modules.formatter:p=Q_;const h=new Zx(this.options);this.store=new Yx(this.options.resources,this.options);const m=this.services;m.logger=Pr,m.resourceStore=this.store,m.languageUtils=h,m.pluralResolver=new K_(h,{prepend:this.options.pluralSeparator}),p&&(m.formatter=r(p),m.formatter.init&&m.formatter.init(m,this.options),this.options.interpolation.format=m.formatter.format.bind(m.formatter)),m.interpolator=new e4(this.options),m.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},m.backendConnector=new e9(r(this.modules.backend),m.resourceStore,m,this.options),m.backendConnector.on("*",(b,...x)=>{this.emit(b,...x)}),this.modules.languageDetector&&(m.languageDetector=r(this.modules.languageDetector),m.languageDetector.init&&m.languageDetector.init(m,this.options.detection,this.options)),this.modules.i18nFormat&&(m.i18nFormat=r(this.modules.i18nFormat),m.i18nFormat.init&&m.i18nFormat.init(this)),this.translator=new H0(this.services,this.options),this.translator.on("*",(b,...x)=>{this.emit(b,...x)}),this.modules.external.forEach(b=>{b.init&&b.init(this)})}if(this.format=this.options.interpolation.format,n||(n=Qd),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const p=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);p.length>0&&p[0]!=="dev"&&(this.options.lng=p[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(p=>{this[p]=(...h)=>this.store[p](...h)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(p=>{this[p]=(...h)=>(this.store[p](...h),this)});const c=jc(),d=()=>{const p=(h,m)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),c.resolve(m),n(h,m)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return p(null,this.t.bind(this));this.changeLanguage(this.options.lng,p)};return this.options.resources||!this.options.initAsync?d():setTimeout(d,0),c}loadResources(e,n=Qd){var i,l;let a=n;const r=Qe(e)?e:this.language;if(typeof e=="function"&&(a=e),!this.options.resources||this.options.partialBundledLanguages){if((r==null?void 0:r.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return a();const c=[],d=p=>{if(!p||p==="cimode")return;this.services.languageUtils.toResolveHierarchy(p).forEach(m=>{m!=="cimode"&&(c.includes(m)||c.push(m))})};r?d(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(h=>d(h)),(l=(i=this.options.preload)==null?void 0:i.forEach)==null||l.call(i,p=>d(p)),this.services.backendConnector.load(c,this.options.ns,p=>{!p&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),a(p)})}else a(null)}reloadResources(e,n,a){const r=jc();return typeof e=="function"&&(a=e,e=void 0),typeof n=="function"&&(a=n,n=void 0),e||(e=this.languages),n||(n=this.options.ns),a||(a=Qd),this.services.backendConnector.reload(e,n,i=>{r.resolve(),a(i)}),r}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&Xk.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!["cimode","dev"].includes(e)){for(let n=0;n<this.languages.length;n++){const a=this.languages[n];if(!["cimode","dev"].includes(a)&&this.store.hasLanguageSomeTranslations(a)){this.resolvedLanguage=a;break}}!this.resolvedLanguage&&!this.languages.includes(e)&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,n){this.isLanguageChangingTo=e;const a=jc();this.emit("languageChanging",e);const r=c=>{this.language=c,this.languages=this.services.languageUtils.toResolveHierarchy(c),this.resolvedLanguage=void 0,this.setResolvedLanguage(c)},i=(c,d)=>{d?this.isLanguageChangingTo===e&&(r(d),this.translator.changeLanguage(d),this.isLanguageChangingTo=void 0,this.emit("languageChanged",d),this.logger.log("languageChanged",d)):this.isLanguageChangingTo=void 0,a.resolve((...p)=>this.t(...p)),n&&n(c,(...p)=>this.t(...p))},l=c=>{var h,m;!e&&!c&&this.services.languageDetector&&(c=[]);const d=Qe(c)?c:c&&c[0],p=this.store.hasLanguageSomeTranslations(d)?d:this.services.languageUtils.getBestMatchFromCodes(Qe(c)?[c]:c);p&&(this.language||r(p),this.translator.language||this.translator.changeLanguage(p),(m=(h=this.services.languageDetector)==null?void 0:h.cacheUserLanguage)==null||m.call(h,p)),this.loadResources(p,b=>{i(b,p)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?l(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(l):this.services.languageDetector.detect(l):l(e),a}getFixedT(e,n,a,r){const i=r==null?void 0:r.scopeNs,l=(c,d,...p)=>{let h;typeof d!="object"?h=this.options.overloadTranslationOptionHandler([c,d].concat(p)):h={...d},h.lng=h.lng||l.lng,h.lngs=h.lngs||l.lngs;const m=h.ns!==void 0&&h.ns!==null;h.ns=h.ns||l.ns,h.keyPrefix!==""&&(h.keyPrefix=h.keyPrefix||a||l.keyPrefix);const b={...this.options,...h};Array.isArray(i)&&!m&&(b.ns=i),typeof h.keyPrefix=="function"&&(h.keyPrefix=xl(h.keyPrefix,b));const x=this.options.keySeparator||".";let w;return h.keyPrefix&&Array.isArray(c)?w=c.map(S=>(typeof S=="function"&&(S=xl(S,b)),`${h.keyPrefix}${x}${S}`)):(typeof c=="function"&&(c=xl(c,b)),w=h.keyPrefix?`${h.keyPrefix}${x}${c}`:c),this.t(w,h)};return Qe(e)?l.lng=e:l.lngs=e,l.ns=n,l.keyPrefix=a,l}t(...e){var n;return(n=this.translator)==null?void 0:n.translate(...e)}exists(...e){var n;return(n=this.translator)==null?void 0:n.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const a=n.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(a.toLowerCase()==="cimode")return!0;const l=(c,d)=>{const p=this.services.backendConnector.state[`${c}|${d}`];return p===-1||p===0||p===2};if(n.precheck){const c=n.precheck(this,l);if(c!==void 0)return c}return!!(this.hasResourceBundle(a,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||l(a,e)&&(!r||l(i,e)))}loadNamespaces(e,n){const a=jc();return this.options.ns?(Qe(e)&&(e=[e]),e.forEach(r=>{this.options.ns.includes(r)||this.options.ns.push(r)}),this.loadResources(r=>{a.resolve(),n&&n(r)}),a):(n&&n(),Promise.resolve())}loadLanguages(e,n){const a=jc();Qe(e)&&(e=[e]);const r=this.options.preload||[],i=e.filter(l=>!r.includes(l)&&this.services.languageUtils.isSupportedCode(l));return i.length?(this.options.preload=r.concat(i),this.loadResources(l=>{a.resolve(),n&&n(l)}),a):(n&&n(),Promise.resolve())}dir(e){var r,i;if(e||(e=this.resolvedLanguage||(((r=this.languages)==null?void 0:r.length)>0?this.languages[0]:this.language)),!e)return"rtl";try{const l=new Intl.Locale(e);if(l&&l.getTextInfo){const c=l.getTextInfo();if(c&&c.direction)return c.direction}}catch{}const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],a=((i=this.services)==null?void 0:i.languageUtils)||new Zx(nm());return e.toLowerCase().indexOf("-latn")>1?"ltr":n.includes(a.getLanguagePartFromCode(e))||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},n){const a=new Qc(e,n);return a.createInstance=Qc.createInstance,a}cloneInstance(e={},n=Qd){const a=e.forkResourceStore;a&&delete e.forkResourceStore;const r={...this.options,...e,isClone:!0},i=new Qc(r);if((e.debug!==void 0||e.prefix!==void 0)&&(i.logger=i.logger.clone(e)),["store","services","language"].forEach(c=>{i[c]=this[c]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},a){const c=Object.keys(this.store.data).reduce((d,p)=>(d[p]={...this.store.data[p]},d[p]=Object.keys(d[p]).reduce((h,m)=>(h[m]={...d[p][m]},h),d[p]),d),{});i.store=new Yx(c,r),i.services.resourceStore=i.store}if(e.interpolation){const d={...nm().interpolation,...this.options.interpolation,...e.interpolation},p={...r,interpolation:d};i.services.interpolator=new e4(p)}return i.translator=new H0(i.services,r),i.translator.on("*",(c,...d)=>{i.emit(c,...d)}),i.init(r,n),i.translator.options=r,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Zt=Qc.createInstance();Zt.createInstance;Zt.dir;Zt.init;Zt.loadResources;Zt.reloadResources;Zt.use;Zt.changeLanguage;Zt.getFixedT;Zt.t;Zt.exists;Zt.setDefaultNamespace;Zt.hasLoadedNamespace;Zt.loadNamespaces;Zt.loadLanguages;const n9=(t,e,n,a)=>{var i,l,c,d;const r=[n,{code:e,...a||{}}];if((l=(i=t==null?void 0:t.services)==null?void 0:i.logger)!=null&&l.forward)return t.services.logger.forward(r,"warn","react-i18next::",!0);ko(r[0])&&(r[0]=`react-i18next:: ${r[0]}`),(d=(c=t==null?void 0:t.services)==null?void 0:c.logger)!=null&&d.warn?t.services.logger.warn(...r):console!=null&&console.warn&&console.warn(...r)},a4={},eg=(t,e,n,a)=>{ko(n)&&a4[n]||(ko(n)&&(a4[n]=new Date),n9(t,e,n,a))},Jk=(t,e)=>()=>{if(t.isInitialized)e();else{const n=()=>{setTimeout(()=>{t.off("initialized",n)},0),e()};t.on("initialized",n)}},tg=(t,e,n)=>{t.loadNamespaces(e,Jk(t,n))},r4=(t,e,n,a)=>{if(ko(n)&&(n=[n]),t.options.preload&&t.options.preload.indexOf(e)>-1)return tg(t,n,a);n.forEach(r=>{t.options.ns.indexOf(r)<0&&t.options.ns.push(r)}),t.loadLanguages(e,Jk(t,a))},a9=(t,e,n={})=>!e.languages||!e.languages.length?(eg(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(t,{lng:n.lng,precheck:(a,r)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&a.services.backendConnector.backend&&a.isLanguageChangingTo&&!r(a.isLanguageChangingTo,t))return!1}}),ko=t=>typeof t=="string",r9=t=>typeof t=="object"&&t!==null,s9=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,i9={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},o9=t=>i9[t],l9=t=>t.replace(s9,o9);let ng={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:l9,transDefaultProps:void 0};const c9=(t={})=>{ng={...ng,...t}},u9=()=>ng;let e5;const d9=t=>{e5=t},p9=()=>e5,f9={type:"3rdParty",init(t){c9(t.options.react),d9(t)}},h9=N.createContext();class m9{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var g9=C_();const y9=(t,e)=>{if(ko(e))return e;if(r9(e)&&ko(e.defaultValue))return e.defaultValue;if(typeof t=="function")return"";if(Array.isArray(t)){const n=t[t.length-1];return typeof n=="function"?"":n}return t},b9={t:y9,ready:!1},v9=()=>()=>{},at=(t,e={})=>{var q,re,_e;const{i18n:n}=e,{i18n:a,defaultNS:r}=N.useContext(h9)||{},i=n||a||p9();i&&!i.reportNamespaces&&(i.reportNamespaces=new m9),i||eg(i,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const l=N.useMemo(()=>{var G;return{...u9(),...(G=i==null?void 0:i.options)==null?void 0:G.react,...e}},[i,e]),{useSuspense:c,keyPrefix:d}=l,p=t||r||((q=i==null?void 0:i.options)==null?void 0:q.defaultNS),h=ko(p)?[p]:p||["translation"],m=N.useMemo(()=>h,h);(_e=(re=i==null?void 0:i.reportNamespaces)==null?void 0:re.addUsedNamespaces)==null||_e.call(re,m);const b=N.useRef(0),x=N.useCallback(G=>{if(!i)return v9;const{bindI18n:me,bindI18nStore:ge}=l,ye=()=>{b.current+=1,G()};return me&&i.on(me,ye),ge&&i.store.on(ge,ye),()=>{me&&me.split(" ").forEach(P=>i.off(P,ye)),ge&&ge.split(" ").forEach(P=>i.store.off(P,ye))}},[i,l]),w=N.useRef(),S=N.useCallback(()=>{if(!i)return b9;const G=!!(i.isInitialized||i.initializedStoreOnce)&&m.every(he=>a9(he,i,l)),me=e.lng||i.language,ge=b.current,ye=w.current;if(ye&&ye.ready===G&&ye.lng===me&&ye.keyPrefix===d&&ye.revision===ge)return ye;const oe={t:i.getFixedT(me,l.nsMode==="fallback"?m:m[0],d,{scopeNs:m}),ready:G,lng:me,keyPrefix:d,revision:ge};return w.current=oe,oe},[i,m,d,l,e.lng]),[C,E]=N.useState(0),{t:T,ready:L}=g9.useSyncExternalStore(x,S,S);N.useEffect(()=>{if(i&&!L&&!c){const G=()=>E(me=>me+1);e.lng?r4(i,e.lng,m,G):tg(i,m,G)}},[i,e.lng,m,L,c,C]);const D=i||{},B=N.useRef(null),H=N.useRef(),K=G=>{const me=Object.getOwnPropertyDescriptors(G);me.__original&&delete me.__original;const ge=Object.create(Object.getPrototypeOf(G),me);if(!Object.prototype.hasOwnProperty.call(ge,"__original"))try{Object.defineProperty(ge,"__original",{value:G,writable:!1,enumerable:!1,configurable:!1})}catch{}return ge},U=N.useMemo(()=>{const G=D,me=G==null?void 0:G.language;let ge=G;G&&(B.current&&B.current.__original===G?H.current!==me?(ge=K(G),B.current=ge,H.current=me):ge=B.current:(ge=K(G),B.current=ge,H.current=me));const ye=!L&&!c?(...oe)=>(eg(i,"USE_T_BEFORE_READY","useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t."),T(...oe)):T,P=[ye,ge,L];return P.t=ye,P.i18n=ge,P.ready=L,P},[T,D,L,D.resolvedLanguage,D.language,D.languages]);if(i&&c&&!L)throw new Promise(G=>{const me=()=>G();e.lng?r4(i,e.lng,m,me):tg(i,m,me)});return U},x9={};function w9(t,e){let n;try{n=t()}catch{return}return{getItem:r=>{var i;const l=d=>d===null?null:JSON.parse(d,void 0),c=(i=n.getItem(r))!=null?i:null;return c instanceof Promise?c.then(l):l(c)},setItem:(r,i)=>n.setItem(r,JSON.stringify(i,void 0)),removeItem:r=>n.removeItem(r)}}const uu=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(a){return uu(a)(n)},catch(a){return this}}}catch(n){return{then(a){return this},catch(a){return uu(a)(n)}}}},k9=(t,e)=>(n,a,r)=>{let i={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:C=>C,version:0,merge:(C,E)=>({...E,...C}),...e},l=!1;const c=new Set,d=new Set;let p;try{p=i.getStorage()}catch{}if(!p)return t((...C)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...C)},a,r);const h=uu(i.serialize),m=()=>{const C=i.partialize({...a()});let E;const T=h({state:C,version:i.version}).then(L=>p.setItem(i.name,L)).catch(L=>{E=L});if(E)throw E;return T},b=r.setState;r.setState=(C,E)=>{b(C,E),m()};const x=t((...C)=>{n(...C),m()},a,r);let w;const S=()=>{var C;if(!p)return;l=!1,c.forEach(T=>T(a()));const E=((C=i.onRehydrateStorage)==null?void 0:C.call(i,a()))||void 0;return uu(p.getItem.bind(p))(i.name).then(T=>{if(T)return i.deserialize(T)}).then(T=>{if(T)if(typeof T.version=="number"&&T.version!==i.version){if(i.migrate)return i.migrate(T.state,T.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return T.state}).then(T=>{var L;return w=i.merge(T,(L=a())!=null?L:x),n(w,!0),m()}).then(()=>{E==null||E(w,void 0),l=!0,d.forEach(T=>T(w))}).catch(T=>{E==null||E(void 0,T)})};return r.persist={setOptions:C=>{i={...i,...C},C.getStorage&&(p=C.getStorage())},clearStorage:()=>{p==null||p.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>S(),hasHydrated:()=>l,onHydrate:C=>(c.add(C),()=>{c.delete(C)}),onFinishHydration:C=>(d.add(C),()=>{d.delete(C)})},S(),w||x},S9=(t,e)=>(n,a,r)=>{let i={storage:w9(()=>localStorage),partialize:S=>S,version:0,merge:(S,C)=>({...C,...S}),...e},l=!1;const c=new Set,d=new Set;let p=i.storage;if(!p)return t((...S)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...S)},a,r);const h=()=>{const S=i.partialize({...a()});return p.setItem(i.name,{state:S,version:i.version})},m=r.setState;r.setState=(S,C)=>{m(S,C),h()};const b=t((...S)=>{n(...S),h()},a,r);r.getInitialState=()=>b;let x;const w=()=>{var S,C;if(!p)return;l=!1,c.forEach(T=>{var L;return T((L=a())!=null?L:b)});const E=((C=i.onRehydrateStorage)==null?void 0:C.call(i,(S=a())!=null?S:b))||void 0;return uu(p.getItem.bind(p))(i.name).then(T=>{if(T)if(typeof T.version=="number"&&T.version!==i.version){if(i.migrate)return[!0,i.migrate(T.state,T.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,T.state];return[!1,void 0]}).then(T=>{var L;const[D,B]=T;if(x=i.merge(B,(L=a())!=null?L:b),n(x,!0),D)return h()}).then(()=>{E==null||E(x,void 0),x=a(),l=!0,d.forEach(T=>T(x))}).catch(T=>{E==null||E(void 0,T)})};return r.persist={setOptions:S=>{i={...i,...S},S.storage&&(p=S.storage)},clearStorage:()=>{p==null||p.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>w(),hasHydrated:()=>l,onHydrate:S=>(c.add(S),()=>{c.delete(S)}),onFinishHydration:S=>(d.add(S),()=>{d.delete(S)})},i.skipHydration||w(),x||b},_9=(t,e)=>"getStorage"in e||"serialize"in e||"deserialize"in e?((x9?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),k9(t,e)):S9(t,e),Ri=_9;let s4=!1;function ar(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():(s4||(s4=!0,console.warn("[uuid] crypto.randomUUID unavailable (non-secure context) — using Math.random fallback")),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)}))}const C9=4e3,fo=new Map;function i4(t,e){const n=fo.get(t);n&&clearTimeout(n),!(e<=0)&&fo.set(t,setTimeout(()=>{fo.delete(t),ws.setState(a=>({toasts:a.toasts.filter(r=>r.id!==t)}))},e))}const ws=Nn(t=>({toasts:[],addToast:(e,n,a)=>{const r=a??C9;t(i=>{const l=i.toasts.find(p=>p.type===e&&p.message===n);if(l)return i4(l.id,r),{toasts:i.toasts.map(p=>p.id===l.id?{...p,count:p.count+1,createdAt:Date.now()}:p)};const c=`toast-${Date.now()}-${Math.random().toString(36).slice(2,7)}`;i4(c,r);const d={id:c,type:e,message:n,duration:r,createdAt:Date.now(),count:1};return{toasts:[...i.toasts,d].slice(-10)}})},dismissToast:e=>{const n=fo.get(e);n&&(clearTimeout(n),fo.delete(e)),t(a=>({toasts:a.toasts.filter(r=>r.id!==e)}))},clearAll:()=>{for(const e of fo.values())clearTimeout(e);fo.clear(),t({toasts:[]})}})),ut={info:(t,e)=>ws.getState().addToast("info",t,e),success:(t,e)=>ws.getState().addToast("success",t,e),warning:(t,e)=>ws.getState().addToast("warning",t,e),error:(t,e)=>ws.getState().addToast("error",t,e??6e3)};function E0(t){return!!t&&t.type==="user"&&!t.shellRun&&!t.deleted}function G$(t){return!!t&&t.type==="user"&&!!t.shellRun}const bl=24;function Jc(t){if(t.preview){const r=String(t.preview).replace(/\s+/g," ").trim();return r.length>bl?r.slice(0,bl)+"…":r}const e=Me.getState().getMessages(t.id);if(!e||e.length===0)return"";const n=e.find(r=>E0(r))||e.find(r=>!r.deleted)||e[0],a=String((n==null?void 0:n.content)||"").replace(/\s+/g," ").trim();return a?a.length>bl?a.slice(0,bl)+"…":a:""}function t5(t,e){if(!e)return!1;const n=t.replace(/\s+/g," ").replace(/\.\.\.$/,"");return n?!e.startsWith(n):!0}const A9=3e4;function y1(t){let e=0;function n(l,c){try{return localStorage.setItem(l,JSON.stringify(c)),e=0,!0}catch{return!1}}return{getItem:l=>{const c=localStorage.getItem(l);if(!c)return null;try{const d=JSON.parse(c);return d&&typeof d=="object"&&"state"in d?d:{state:d,version:0}}catch{return null}},setItem:(l,c)=>{var h;if(n(l,c))return;let d=c;for(const m of t.trims??[]){try{d=m(d)}catch{continue}if(n(l,d))return}const p=Date.now();if(p-e>A9){e=p;const m=new Error(`localStorage 配额已满或不可用(${t.key}),已降级为仅内存持久化,刷新页面将丢失部分历史。`);console.warn(`[${t.key}] 持久化失败:`,m);try{(h=t.onFailure)==null||h.call(t,m)}catch{}}},removeItem:l=>{try{localStorage.removeItem(l)}catch{}}}}const o4=6,n5=50,l4=50;let c4=0,u4=0;function T9(){const t=Date.now();t!==u4&&(u4=t,c4=0);const e=(++c4).toString(36),n=Math.random().toString(36).slice(2,6);return`s_${t.toString(36)}${e}${n}`}const E9=100,Bc=2e3,Ic=(t,e)=>t&&(t.length>e?`${t.slice(0,e)}…`:t),a5=t=>{const{logs:e,...n}=t;return{...n,description:Ic(n.description,Bc),result:Ic(n.result,Bc),error:Ic(n.error,Bc),stepPrompt:Ic(n.stepPrompt,Bc),context:n.context?Object.fromEntries(Object.entries(n.context).map(([a,r])=>[a,Ic(r,Bc)??""])):void 0,children:n.children?n.children.map(a5):void 0}},N0=t=>[...t].sort((e,n)=>(n.lastActiveAt??n.createdAt??0)-(e.lastActiveAt??e.createdAt??0));function Jd(t,e){const n=new Set(t.map(c=>c.id)),a=[],r=new Set,i=Math.max(0,n5-t.length);let l=0;for(const c of N0(e)){if(n.has(c.id)){a.push(c);continue}if(l>=i){r.add(c.id);continue}a.push(c),l++}return{history:a,droppedIds:r}}function d4(t,e,n,a){return a.size===0?{sessions:t,tasksBySession:e,sessionWorkspaceDirs:n}:{sessions:t.filter(r=>!a.has(r.id)),tasksBySession:Object.fromEntries(Object.entries(e).filter(([r])=>!a.has(r))),sessionWorkspaceDirs:Object.fromEntries(Object.entries(n).filter(([r])=>!a.has(r)))}}const Ge=Nn()(Ri((t,e)=>({sessions:[],activeSessionId:null,sessionTabs:[],layout:"single",sessionWorkspaceDirs:{},tasksBySession:{},historySessions:[],addSession:n=>t(a=>({sessions:[n,...a.sessions].slice(0,l4),activeSessionId:n.id})),removeSession:n=>t(a=>{var r;return{sessions:a.sessions.filter(i=>i.id!==n),activeSessionId:a.activeSessionId===n?((r=a.sessions[0])==null?void 0:r.id)||null:a.activeSessionId}}),updateSession:(n,a)=>t(r=>({sessions:r.sessions.map(i=>i.id===n?{...i,...a}:i)})),setActiveSession:n=>t({activeSessionId:n}),setSessionWorkspaceDir:(n,a)=>t(r=>({sessionWorkspaceDirs:{...r.sessionWorkspaceDirs,[n]:a}})),getSessionWorkspaceDir:n=>e().sessionWorkspaceDirs[n]||"",addSessionTab:(n,a,r)=>{const i=e();if(i.sessionTabs.length>=o4){const S=i.sessionTabs.reduce((C,E)=>C.createdAt<E.createdAt?C:E);e().closeSessionTab(S.id)}const l=r||T9(),c=a&&a.split(/[\\/]/).filter(Boolean).pop()||void 0,d={id:l,title:n||`对话 ${i.sessionTabs.length+1}`,createdAt:Date.now(),lastActiveAt:Date.now(),project:c,status:"done"},p={id:l,title:n||`对话 ${i.sessionTabs.length+1}`,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),messageCount:0},h={...i.sessionWorkspaceDirs};a&&(h[l]=a);const m={...i.tasksBySession};m[l]||(m[l]=[]);const b=N0([d,...i.sessionTabs]),x=Jd(b,[d,...i.historySessions.filter(S=>S.id!==l)]),w=d4([...i.sessions,p].slice(-l4),m,h,x.droppedIds);return t({sessionTabs:b,sessions:w.sessions,sessionWorkspaceDirs:w.sessionWorkspaceDirs,tasksBySession:w.tasksBySession,activeSessionId:l,historySessions:x.history}),l},closeSessionTab:n=>{var h;const a=e(),r=a.sessionTabs.find(m=>m.id===n),i=a.sessionTabs.filter(m=>m.id!==n);if(i.length===0)return;let l=a.historySessions;r&&(l=[r,...l.filter(m=>m.id!==n)]);const c=Jd(i,l),d=d4(a.sessions,a.tasksBySession,a.sessionWorkspaceDirs,c.droppedIds),p=i[i.length-1];t({sessionTabs:i,historySessions:c.history,sessions:d.sessions,tasksBySession:d.tasksBySession,sessionWorkspaceDirs:d.sessionWorkspaceDirs,activeSessionId:a.activeSessionId===n?p?p.id:((h=i[0])==null?void 0:h.id)||null:a.activeSessionId})},renameSessionTab:(n,a)=>t(r=>({sessionTabs:r.sessionTabs.map(i=>i.id===n?{...i,title:a,renamed:!0}:i),sessions:r.sessions.map(i=>i.id===n?{...i,title:a,updatedAt:new Date().toISOString()}:i),historySessions:r.historySessions.map(i=>i.id===n?{...i,title:a,renamed:!0}:i)})),getActiveSessionTab:()=>{const n=e();return n.sessionTabs.find(a=>a.id===n.activeSessionId)||null},getVisibleSessionTabs:()=>{const n=e(),a=n.sessionTabs.find(r=>r.id===n.activeSessionId);return a?[a]:n.sessionTabs.slice(0,1)},addSessionTask:(n,a,r,i)=>t(l=>{const c=l.tasksBySession[n]||[],d={id:`session-task-${Date.now()}-${Math.random().toString(36).slice(2,6)}`,title:a.trim(),completed:!1,createdAt:Date.now(),backendId:r,description:i};return{tasksBySession:{...l.tasksBySession,[n]:[...c,d]}}}),toggleSessionTask:(n,a)=>t(r=>{const i=r.tasksBySession[n]||[];return{tasksBySession:{...r.tasksBySession,[n]:i.map(l=>l.id===a?{...l,completed:!l.completed}:l)}}}),removeSessionTask:(n,a)=>t(r=>({tasksBySession:{...r.tasksBySession,[n]:(r.tasksBySession[n]||[]).filter(i=>i.id!==a)}})),updateSessionTask:(n,a,r)=>t(i=>{const l=i.tasksBySession[n]||[];return{tasksBySession:{...i.tasksBySession,[n]:l.map(c=>c.id===a?{...c,title:r.trim()}:c)}}}),getSessionTasks:n=>e().tasksBySession[n]||[],setSessionTasks:(n,a)=>t(r=>({tasksBySession:{...r.tasksBySession,[n]:a}})),updateTaskPlanStatus:(n,a,r)=>t(i=>{const l=i.tasksBySession[n]||[];return{tasksBySession:{...i.tasksBySession,[n]:l.map(c=>c.id===a?{...c,...r}:c)}}}),autoNameSession:(n,a)=>{const i=e().sessionTabs.find(d=>d.id===n);if(!i||i.renamed||!/^对话 \d+$/.test(i.title))return;const l=a.replace(/\s+/g," ").trim(),c=l.slice(0,20)+(l.length>20?"...":"");c&&e().renameSessionTab(n,c)},updateSessionStatus:(n,a)=>t(r=>({sessionTabs:r.sessionTabs.map(i=>i.id===n?{...i,status:a}:i)})),touchSession:(n,a)=>t(r=>{const i=Date.now();let l;if(a){const d=a.replace(/\s+/g," ").trim();l=d.length>bl?d.slice(0,bl)+"…":d}const c=d=>({...d,lastActiveAt:i,...l&&!d.preview?{preview:l}:{}});return{sessionTabs:N0(r.sessionTabs.map(d=>d.id===n?c(d):d)),sessions:r.sessions.map(d=>d.id===n?{...d,updatedAt:new Date(i).toISOString()}:d),historySessions:r.historySessions.map(d=>d.id===n?c(d):d)}}),getHistorySessions:()=>e().historySessions,restoreHistorySession:n=>{const a=e(),r=a.historySessions.find(d=>d.id===n);if(!r)return;const i=a.historySessions.filter(d=>d.id!==n);if(a.sessionTabs.some(d=>d.id===n)){t({historySessions:i,activeSessionId:n});return}let l=a.sessionTabs;if(l.length>=o4){const d=l.reduce((p,h)=>p.createdAt<h.createdAt?p:h);l=l.filter(p=>p.id!==d.id),i.unshift(d)}const c=N0([r,...l]);t({sessionTabs:c,historySessions:Jd(c,i).history,activeSessionId:n})},clearHistorySessions:()=>t({historySessions:[]}),removeHistorySession:n=>t(a=>({historySessions:a.historySessions.filter(r=>r.id!==n)}))}),{name:"deepseekcode-session-storage",storage:y1({key:"sessionStore",trims:[t=>({...t,state:{...t.state,tasksBySession:Object.fromEntries(Object.entries(t.state.tasksBySession).map(([e,n])=>[e,n.map(a=>({id:a.id,title:a.title,completed:a.completed,createdAt:a.createdAt,planStatus:a.planStatus,backendId:a.backendId,backendStatus:a.backendStatus,agentType:a.agentType,progress:a.progress}))]))}}),t=>{const e=new Set([...(t.state.sessionTabs??[]).map(n=>n.id),...t.state.historySessions.map(n=>n.id)]);return t.state.activeSessionId&&e.add(t.state.activeSessionId),{...t,state:{...t.state,tasksBySession:Object.fromEntries(Object.entries(t.state.tasksBySession).filter(([n])=>e.has(n)))}}},t=>({...t,state:{...t.state,tasksBySession:{}}})],onFailure:()=>{try{ws.getState().addToast("warning","会话数据保存失败:浏览器本地存储已满或不可用。当前数据仅保留在内存中,刷新页面将丢失,建议清理旧会话或导出数据。",8e3)}catch{}}}),partialize:t=>{const e=new Set;for(const r of t.sessionTabs)e.add(r.id);for(const r of t.historySessions)e.add(r.id);t.activeSessionId&&e.add(t.activeSessionId);const n=t.sessions.filter(r=>e.has(r.id)),a={};for(const[r,i]of Object.entries(t.tasksBySession))e.has(r)&&(a[r]=i.slice(0,E9).map(a5));return{sessions:n,layout:t.layout,sessionWorkspaceDirs:t.sessionWorkspaceDirs,tasksBySession:a,historySessions:t.historySessions}},merge:(t,e)=>{const n=t??{},a=Array.isArray(n.sessionTabs)?n.sessionTabs:[],r=Array.isArray(n.historySessions)?n.historySessions:[],i=new Set,l=[];for(const c of[...a,...r])!(c!=null&&c.id)||i.has(c.id)||(i.add(c.id),l.push(c));return{...e,...n,sessionTabs:[],activeSessionId:null,historySessions:Jd([],l).history}}})),ag="auto",N9="zh-CN",b1=[{code:"zh-CN",label:"简体中文",englishLabel:"Chinese (Simplified)",base:"zh",complete:!0},{code:"zh-TW",label:"繁體中文",englishLabel:"Chinese (Traditional)",base:"zh",complete:!1},{code:"en",label:"English",englishLabel:"English",base:"en",complete:!0},{code:"ja",label:"日本語",englishLabel:"Japanese",base:"ja",complete:!1},{code:"ko",label:"한국어",englishLabel:"Korean",base:"ko",complete:!1},{code:"de",label:"Deutsch",englishLabel:"German",base:"de",complete:!1},{code:"fr",label:"Français",englishLabel:"French",base:"fr",complete:!1},{code:"es",label:"Español",englishLabel:"Spanish",base:"es",complete:!1},{code:"pt-BR",label:"Português (Brasil)",englishLabel:"Portuguese (Brazil)",base:"pt",complete:!1},{code:"ru",label:"Русский",englishLabel:"Russian",base:"ru",complete:!1},{code:"it",label:"Italiano",englishLabel:"Italian",base:"it",complete:!1}];b1.map(t=>t.code);const R9=new Map(b1.map(t=>[t.code.toLowerCase(),t])),D9=new Map(b1.map(t=>[t.base,t])),M9=new Set(["tw","hk","mo"]);function O9(t){var i;const e=String(t??"").trim().toLowerCase().replace(/_/g,"-");if(!e)return null;const n=R9.get(e);if(n)return n.code;const[a="",...r]=e.split("-");return a==="zh"?r.includes("hant")||r.some(c=>M9.has(c))?"zh-TW":"zh-CN":((i=D9.get(a))==null?void 0:i.code)??null}function rg(t){for(const e of t??[]){const n=O9(e);if(n)return n}return null}function L9(t,e){const n=rg([String(t??"")]);return n||(rg(e)??N9)}function q$(t){return rg([String(t??"")])??ag}function j9(){try{if(typeof navigator>"u")return[];const t=navigator,e=Array.isArray(t.languages)?t.languages.filter(n=>!!n):[];return e.length>0?e:t.language?[t.language]:[]}catch{return[]}}function Sp(t){return L9(t,j9())}function B9(t){return String(t??"").trim().toLowerCase().startsWith("zh")?"zh":"en"}const p4={bg:"#0d1117",surface:"#161b22",border:"#30363d",text:"#c9d1d9",muted:"#8b949e",accentBlue:"#58a6ff",accentGreen:"#238636",accentRed:"#f85149",accentYellow:"#d29922",accentPurple:"#a855f7"},V$=["off","low","medium","high","extra_high","max"],I9=8,_i=Nn()(Ri(t=>({theme:"light",themePresetId:"linear",language:ag,fontSize:14,streamingEnabled:!0,workspaceDir:"",recentDirs:[],effort:"medium",customTheme:p4,customThemeEnabled:!1,developerView:!1,setTheme:e=>t({theme:e}),setThemePreset:e=>t({themePresetId:e,customThemeEnabled:!1}),setLanguage:e=>t({language:e}),setFontSize:e=>t({fontSize:e}),setStreamingEnabled:e=>t({streamingEnabled:e}),setCustomTheme:e=>t(n=>({customTheme:{...n.customTheme,...e}})),setCustomThemeEnabled:e=>t({customThemeEnabled:e}),resetCustomTheme:()=>t({customTheme:p4}),setDeveloperView:e=>t({developerView:e}),setWorkspaceDir:e=>t(n=>{const a=e.trim();if(!a)return{workspaceDir:""};const r=[a,...n.recentDirs.filter(i=>i!==a)].slice(0,I9);return{workspaceDir:a,recentDirs:r}}),setEffort:e=>t({effort:e})}),{name:"deepseekcode-settings-storage",version:6,migrate:(t,e)=>{const n=t;return e<2&&n&&typeof n=="object"&&((n.themePresetId==="github"||n.themePresetId==="mimo")&&(n.themePresetId="linear"),n.theme==="dark"&&(n.theme="light")),e<3&&n&&typeof n=="object"&&(n.recentDirs=Array.isArray(n.recentDirs)?n.recentDirs:[]),e<4&&n&&typeof n=="object"&&(delete n.yolo,delete n.autoSwarm,delete n.workspaceGuardBypass),e<5&&n&&typeof n=="object"&&(n.developerView=n.developerView===!0),e<6&&n&&typeof n=="object"&&(n.language==="zh-CN"||typeof n.language!="string"||!n.language)&&(n.language=ag),n}})),P9={confirm:"确认",cancel:"取消",save:"保存",saving:"保存中...",delete:"删除",close:"关闭",refresh:"刷新",retry:"重试",loading:"加载中...",collapse:"折叠",expand:"展开",clear:"清空",noData:"暂无数据",noResults:"暂无结果",unknown:"未知",unknownError:"未知错误",connecting:"连接中…",back:"返回",send:"发送",copy:"复制",copied:"已复制",search:"搜索...",filter:"全部",pageInfo:"显示 {{start}}-{{end}} 条,共 {{total}} 条",prevPage:"上一页",nextPage:"下一页",enabled:"已启用",disabled:"已禁用",online:"在线",offline:"离线",busy:"忙碌",away:"离开",default:"默认"},z9={chat:"对话",models:"模型",tools:"工具",skills:"技能",templates:"工作流",hooks:"Hooks",agentFlow:"Agent Flow",settings:"设置",logs:"日志",channels:"频道",assistants:"助理",sessions:"会话",collapseSidebar:"收起侧栏",expandSidebar:"展开侧栏",moreOptions:"更多",scheduled:"定时任务",plugins:"插件",mySessions:"我的会话",sessionRunning:"运行中",sessionWaiting:"待确认",sessionFailed:"失败",sessionDone:"已完成",sessionEnded:"已结束",connectors:"连接器",pin:"置顶",unpin:"取消置顶",pinMore:"置顶「更多」",unpinMore:"取消置顶「更多」",clearSessionSearch:"清除会话搜索",searchSessions:"搜索会话",searchSessionsPlaceholder:"搜索会话...",showMoreSessions:"查看更多",collapseGroup:"收起",expandGroup:"展开",openFolder:"打开文件夹",newTask:"新建任务",sessionActions:"会话操作",groupActions:"项目操作"},$9=JSON.parse('{"newSession":"新建会话","forkSession":"复制会话(fork-原名,上下文全带)","forkSessionFailed":"复制会话失败","newSessionInWorkspace":"在此工作目录新建会话","sessionTabs":"此工作目录下的会话","noSessions":"暂无会话","renameSession":"重命名会话","exportMd":"导出为 Markdown","you":"你","thinkingEllipsis":"思考中…","messageRail":"消息导航","messageIndex":"对话索引","backToBottom":"回到最新消息","generatingPlaceholder":"AI 正在生成… 可直接输入,Enter 将排队发送","pasteExpand":"点击展开粘贴原文","pasteCollapse":"收起粘贴原文","pasteOriginal":"粘贴原文","defaultSessionTitle":"对话 {{n}}","start":{"greetingDawn":"夜深了","greetingMorning":"早上好","greetingNoon":"中午好","greetingAfternoon":"下午好","greetingEvening":"晚上好","withName":"{{greeting}},{{name}}","question":"需要什么帮助吗?","categoriesLabel":"起手分类","more":"更多场景","hide":"收起常用","show":"显示常用","profileOn":"按 {{name}} 的偏好对话","profileAnonymous":"未设置个性化画像","profileEdit":"编辑","profileHint":"个性化画像决定它如何称呼你、以什么风格对话,点开可编辑","frequentTitle":"常用","categoryTitle":"{{label}} · 任务","frequentHint":"点过、收藏或自己写的任务会留在这里","frequentEmpty":"还没有常用任务 — 点上面的「新建」自己写一条,或选个分类、点任务右侧的星标","customAdd":"新建","customLabelPlaceholder":"名称(可留空,自动取提示词开头)","customPromptPlaceholder":"写下你要常驻的提示词…","customSave":"保存","customCancel":"取消","selectedHint":"点标签上的 × 可清除","clearCategory":"清除「{{label}}」选择","addFavorite":"把「{{label}}」加入常用","removeFavorite":"把「{{label}}」从常用移除","categories":[{"id":"code","label":"代码开发","scenarios":[{"id":"code-arch","label":"架构分析","hint":"说明模块职责与依赖方向","prompt":"分析当前仓库的整体架构:说明主要模块划分、各自职责边界与依赖方向,并画出模块依赖图。"},{"id":"code-debug","label":"缺陷定位","hint":"从报错回溯到根因","prompt":"我遇到了这个报错:\\n\\n请先给出最小复现步骤,定位根因,再解释为什么会触发。"},{"id":"code-test","label":"补齐测试","hint":"覆盖边界与异常路径","prompt":"给这段逻辑补齐测试:覆盖主要分支与边界(空值、极值、超限),并说明每条用例想钉住什么行为。"},{"id":"code-refactor","label":"安全重构","hint":"不改外部行为地拆解","prompt":"这个文件太大了:按职责给出拆分方案与风险评估,确认后再实施,保证外部行为不变。"}]},{"id":"doc","label":"文档处理","scenarios":[{"id":"doc-prd","label":"产品需求文档","hint":"覆盖目标、场景与验收标准","prompt":"写一份产品需求文档:覆盖背景与目标、核心使用场景、功能边界、验收标准,以及这次明确不做什么。"},{"id":"doc-report","label":"项目周报","hint":"汇总进展、风险与下周计划","prompt":"写一份项目周报:基于当前仓库的真实改动,汇总本周进展、风险与下周计划。"},{"id":"doc-minutes","label":"会议纪要","hint":"提炼结论与待办责任人","prompt":"把这段会议内容整理成纪要:提炼结论与分歧、列出待办及责任人,每条标注依据。"},{"id":"doc-handover","label":"交接说明","hint":"让接手的人一眼看懂现状","prompt":"写一份交接说明:当前状态、已做的决策与理由、遗留问题,以及接手后建议的第一步。"}]},{"id":"data","label":"数据分析","scenarios":[{"id":"data-attr","label":"指标归因","hint":"定位核心指标异动的原因","prompt":"核心指标出现异动:先列出可能原因并逐一验证,输出归因结论与证据,标出还无法排除的假设。"},{"id":"data-ab","label":"A/B 检验","hint":"判断实验差异是否显著","prompt":"对这次 A/B 结果做显著性分析:说明检验方法、样本量是否足够、置信区间,以及是否该全量。"},{"id":"data-clean","label":"数据清洗","hint":"处理缺失值与异常点","prompt":"清洗这份数据:处理缺失值与异常点,说明每步规则与影响行数,保留可复现的处理日志。"},{"id":"data-chart","label":"图表呈现","hint":"选对图型并标注结论","prompt":"把这批数据做成图表:选合适的图型,标注关键结论与读数口径,避免用图型误导结论。"}]},{"id":"design","label":"设计创意","scenarios":[{"id":"design-proto","label":"交互原型","hint":"把流程落成可点原型","prompt":"把这个流程做成可点的交互原型:覆盖主路径与异常路径,标出每一步的输入输出与状态。"},{"id":"design-visual","label":"视觉方案","hint":"给出配色与排版建议","prompt":"给出视觉方案:配色、层级与排版规则,说明对比度与可读性依据,并给出两版可选方向。"},{"id":"design-copy","label":"文案打磨","hint":"提炼卖点与差异化","prompt":"打磨这段文案:提炼核心卖点、讲清差异化优势,给出三版不同语气的备选。"},{"id":"design-name","label":"命名备选","hint":"给出候选名与理由","prompt":"给这个功能起名字:给出候选名与推荐理由,检查是否与既有概念冲突、是否好读好记。"}]},{"id":"workflow","label":"工作流模板","scenarios":[{"id":"workflow-archive","label":"沉淀模板","hint":"把这次运行存成可复用工作流","prompt":"把刚才这次运行沉淀成工作流模板:固定可复用的节点与参数,说明哪些是输入、哪些要人工确认。"},{"id":"workflow-replay","label":"一键回放","hint":"换参数重跑整条流程","prompt":"用新的参数回放这条工作流:先列出会变与不变的步骤,跑完后给出与上次的差异对照。"},{"id":"workflow-graph","label":"编排拆解","hint":"把重复流程拆成节点与依赖","prompt":"把这段重复流程拆成工作流节点:定义每个节点的输入输出与依赖顺序,标出可以并行的部分。"},{"id":"workflow-guard","label":"失败兜底","hint":"给节点补重试与人工确认","prompt":"给这条工作流补失败处理:哪些节点可自动重试、哪些必须停下来等我确认,失败后怎么恢复。"}]},{"id":"auto","label":"流程自动化","scenarios":[{"id":"auto-organize","label":"批量整理","hint":"写脚本按类型整理目录","prompt":"写一个脚本,按类型整理当前目录下的文件:先给出方案与影响范围,确认后再执行。"},{"id":"auto-schedule","label":"定时任务","hint":"每天自动跑一次检查","prompt":"把这个检查做成定时任务:每天自动运行一次,失败时把原因汇总通知我。"},{"id":"auto-scrape","label":"抓取汇总","hint":"从网页取数汇总成表","prompt":"从指定网页抓取数据并汇总成表格:说明数据来源、字段口径,以及抓取失败时的处理。"},{"id":"auto-ci","label":"构建发布","hint":"把构建与发布会成一条命令","prompt":"把构建与发布串成一条可重复执行的命令:说明每一步的前置条件,以及失败时怎么安全中断。"}]},{"id":"proj","label":"项目协作","scenarios":[{"id":"proj-sync","label":"进度同步","hint":"回顾已完成与未决项","prompt":"同步当前进度:回顾已完成的工作与未决问题,明确下一步要做什么。"},{"id":"proj-todo","label":"待办梳理","hint":"去重排序,标出阻塞项","prompt":"梳理当前会话里的待办事项:去重、按优先级排序,并标出阻塞项与依赖关系。"},{"id":"proj-risk","label":"风险预警","hint":"提前标出会拖期的项","prompt":"评估当前计划的风险:标出最可能拖期的环节与触发条件,给出可以现在就做的对冲动作。"},{"id":"proj-retro","label":"复盘总结","hint":"沉淀可复用的经验","prompt":"做一次复盘:这次哪些判断错了、哪些做法值得沉淀成规范,给出可执行的改进项。"}]}]},"quickCommands":"查看快捷命令","inputPlaceholder":"输入消息... Shift+Enter 换行,/ 命令,@ 引用文件,! 执行命令,↑ 历史","nearLimit":"接近上限","shiftEnter":"Shift+Enter 换行","escHint":"回复中可继续输入排队 · Esc 撤销/暂停 · 连按 Esc 终止","bangHint":"! 执行命令","shellRunning":"执行中…","shellExitCode":"退出码 {{code}}","shellNoExitCode":"已结束(无退出码)","shellTimedOut":"已超时终止","shellTruncated":"输出已截断","shellNoOutput":"(无输出)","shellRequestFailed":"执行失败:{{message}}","shellRequestFailedGeneric":"请求失败","queuedCount":"{{count}} 条排队 — 回复结束后自动发送","queuedEscHint":"Esc 撤销","queuedRevoke":"撤销全部排队消息","queuedSendNow":"跳到队首:回复结束后最先发送","queuedEdit":"取回输入框编辑","queuedDelete":"删除这条排队消息","queuedEmptyPreview":"(附件消息,无正文)","sendQueuedBtn":"发送(排队)","resume":"恢复","resumeGen":"恢复生成","stop":"终止","stopGen":"终止生成","pause":"暂停","pauseGen":"暂停生成","sendBtn":"发送","connected":"已连接","disconnected":"已断线","sessionHistory":"会话历史","removeFromHistory":"从历史移除","removeFromList":"从列表中移除","openFolderFailed":"打开文件夹失败","viewAllSessions":"更多会话","sessionPickerTitle":"选择会话","clickToOpenSession":"打开会话","clickToSwitchDir":"点击切换工作目录","noTasks":"暂无任务,在上方输入添加","taskBoardDragHint":"下拉展开 · 上推收起 · 点击切换","deleteTask":"删除任务","effort":"推理力度","effortOff":"关闭思考","effortLow":"低","effortMedium":"中","effortHigh":"高","effortExtraHigh":"超高","effortMax":"最高","noWorkspaceDir":"未设置工作目录","recentDirs":"最近记录","noRecentDirs":"暂无最近目录","chooseOtherDir":"选择其他目录…","dirPickerTitle":"选择工作目录","dirPickerEnterPath":"输入完整路径后回车跳转","dirPickerGo":"跳转","dirPickerUp":"上一级","dirPickerNoDirs":"无子目录","dirPickerConfirm":"选择此目录","dirPickerLoadError":"目录读取失败","viewOverview":"概览","viewWorkspaceFiles":"工作空间文件","viewChanges":"变更","workspaceHint":"浏览工作区目录树;点文件就地打开编辑器,左上角「返回」回到树。","artifactHint":"点击聊天中的文件 / 路径链接即可在右侧预览;拖拽边缘可调整宽度,右上角可最大化","previewInPanel":"预览","backToArtifacts":"返回清单","openInNewTab":"新标签页打开","copyPath":"复制路径","copiedPath":"已复制路径","copyPathFailed":"复制失败","filePreviewHint":"该文件类型不支持内嵌预览,可下载或在新标签页中打开。","outline":"目录","outlineClose":"关闭目录","previewTabPage":"页面","changesTitle":"变更","switchPanelView":"切换面板视图","changesHint":"点击文件查看行级 diff。改动来自 git 工作区,包含 Agent 的写入。","viewAllArtifacts":"查看所有产物 ({{n}})","viewAllChanges":"查看所有变更 ({{n}})","diffRenderCapped":"补丁过长,仅渲染前 {{rendered}} 行(其余 {{dropped}} 行已省略)","previewTabCode":"源码","copySource":"复制源码","closeTab":"关闭","codeRenderError":"代码高亮失败,已降级为纯文本。","sidebarArtifacts":"概览","sidebarOpen":"打开","sidebarOpenFolder":"打开首个输出文件","sidebarMaximize":"最大化","sidebarRestore":"恢复大小","previewPopOut":"浮窗预览","sidebarWorking":"正在处理…","sidebarWorkingWithAgents":"正在处理({{n}} 个 Agent 运行中)…","sidebarWorkingToolcalls":"正在处理(已调用 {{n}} 次工具)…","sidebarIdle":"多步骤任务运行时,进度会显示在这里:计划、工具调用、审批与产出文件。","sidebarRunningAgents":"{{n}} 个 Agent 运行中","sidebarToolcallsSoFar":"已调用 {{n}} 次工具","tokenRateTitle":"实时输出速率(估算值:CJK ≈1.5 tok/字,其余 ≈0.25 tok/字;provider 不提供逐块 token 数)","tokenRateIdle":"工具执行中,暂无流式输出 —— 底栏转圈正以最慢速旋转,有输出后此处恢复实时 tok/s","totalChars":"总字符数","avgTokens":"平均 token/条","estimatedCost":"预估成本: ${{cost}}","contextManager":"上下文管理","taskBoard":"任务看板","morePending":"还有 {{n}} 个待处理任务...","toolResult":"工具结果: ","memory":"记忆: ","fileReadError":"读取文件失败","clickToSwitchMode":"点击切换模式 (Plan → Goal → Act)","selectModel":"选择模型","clickToSelectModel":"选择模型 / 推理力度","desktopDownloadTitle":"下载桌面客户端 · {{os}}","desktopDownloadRecommend":"推荐下载桌面端","desktopDownloadOtherPlatforms":"下载其他平台客户端","desktopDownloadMenu":"更多下载选项","desktopDownloadOsWindows":"Windows","desktopDownloadOsMacos":"macOS","desktopDownloadOsLinux":"Linux","desktopDownloadOsAndroid":"Android","desktopDownloadOsIos":"iOS","desktopDownloadOsUnknown":"本机系统","desktopDownloadYourSystem":"你的系统 · {{os}}","desktopDownloadOtherSystems":"其他系统","desktopDownloadTrouble":"下载不畅?","desktopDownloadViaMirror":"经镜像下载({{host}})","desktopDownloadViaMirrorToast":"直连不通,已改用镜像下载","desktopDownloadOpenRelease":"打开 Release 页面","desktopDownloadFromMirror":"镜像","desktopDownloadSize":"约 {{size}}","desktopDownloadHandToAi":"让 AI 帮我下载安装","desktopDownloadHandToAiDesc":"一句提示词写进输入框,回车发送","desktopDownloadHandToAiHint":"已把下载安装指令写入输入框,回车即可发送","desktopDownloadArmHint":"暂无 ARM 原生安装包,上面是 x64 版本","desktopDownloadMacUnsignedHint":"首次安装需右键 →「打开」(当前包未做代码签名)","desktopDownloadMobileHint":"移动端装不了桌面客户端,已为你打开下载页","desktopDownloadMobileMenuHint":"移动端无对应安装包,可在下方选择其他系统","desktopDownloadLoading":"正在获取安装包列表…","desktopDownloadFetching":"正在获取安装包地址…","desktopDownloadUnavailable":"安装包地址暂不可用,已为你打开下载页","desktopDownloadPrompt":"请帮我在本机下载并安装 DeepSeekCode 桌面客户端(当前系统:{{os}})。安装包地址:{{url}};若该地址不可达,请依次尝试镜像:{{mirrors}}。安装完成后告诉我如何启动。","desktopDownloadPromptNoMirror":"无","noEnabledModels":"暂无可用模型","globalDefault":"全局默认","planDefault":"Plan 默认","actDefault":"Act 默认","goalDefault":"Goal 默认","followGlobalDefault":"跟随全局默认","followGlobalDefaultHint":"清除本模式默认,回退到全局默认","sessionModel":"会话","sessionModelTitle":"仅本会话生效的模型覆盖(全局默认未改变)","noGlobalDefault":"未设置全局默认","browseMoreModels":"浏览 Provider 更多模型…","backToModels":"返回模型列表","selectProvider":"选择 Provider","searchModels":"搜索模型…","loadingModels":"加载模型列表…","noModelsFound":"未找到匹配的模型","noProviderModels":"该 Provider 暂无可用的模型列表","noConfiguredProviders":"暂未配置 Provider","addAndSwitch":"添加并切换","alreadyAdded":"已添加","addingModel":"添加中…","currentModel":"当前模型","loadModelsFailed":"获取模型列表失败","addModelFailed":"添加模型失败","switchModelFailed":"切换模型失败","modelsSourceProviderApi":"实时从 Provider API 获取","modelsSourceCatalog":"来自模型目录 (models.dev)","assistantLabel":"DeepSeekCode","thoughtProcess":"思维过程","runningSteps":"执行中","stepCount":"步","copyMessage":"复制","regenerate":"重新生成","deleteMessage":"删除消息","messageDeleted":"消息已删除","thinking":"思考中","askAnswerPlaceholder":"输入您的回答...","askAnswered":"✓ 已回答","askAutoContinue":"⏱ {{seconds}}s 后未回答将自动按推荐项继续","askBackToEdit":"返回修改","askBatchTitle":"批量确认","askConfirmQuestion":"确认本题","askCustomDesc":"输入自定义答案","askCustomTag":"(自定义)","askDirectTag":"(直接继续)","askEmptyInputValue":"(用户未输入)","askEnterHint":"Enter 提交,Shift+Enter 换行","askFinishQuestion":"完成本题 ({{count}} 项)","askMultiHintBatch":"点击选项勾选,再点击「完成本题」提交本题;「推进」表示按 AI 判断继续","askMultiHintSingle":"点击选项勾选,再点击「提交所选」提交;「推进」表示按 AI 判断继续","askNextQuestion":"下一题","askNotAnswered":"未回答","askOtherLabel":"其他(我来说明)","askPendingBadge":"待回答","askPrevQuestion":"上一题","askProceedDesc":"不选具体项,按你的最佳判断继续","askProceedLabel":"推进","askReviewTitle":"确认答案","askSingleHintBatch":"点击选项完成本题自动进入下一题,或点击「确认本题」提交当前高亮项","askSingleHintSingle":"点击选项立即提交,或点击下方「提交」确认当前选项","askSingleTitle":"请回答","askSubmit":"提交","askSubmitAll":"提交全部答案","askSubmitSelected":"提交所选 ({{count}} 项)","askSubmitting":"提交中...","askSubmitRetry":"未收到服务端确认(连接可能中断),可再次提交或关闭","askUnansweredValue":"(用户未回答)","askUnansweredWarning":"有 {{count}} 题未回答,将记为「未回答」。点击上方题号可回到对应题目修改。","askViewSubmit":"查看提交","assemblyOrderHint":"按后端上下文组装顺序(上→下):系统提示词 → 系统工具 → MCP 工具 → 技能 → 消息 → 其他(估算差额)","avgCacheHitRate":"平均缓存命中率","byAssemblyOrder":"按组装顺序 ↓","cacheHitTitle":"缓存命中 {{hit}} / 未命中 {{miss}}({{calls}} 次调用)","cacheNoStats":"暂无缓存统计(provider 未返回 prompt_cache_hit/miss 字段)","cacheWaitingRun":"本轮 run 进行中,等待 provider 上报缓存统计","categoryBreakdown":"分类占比","contextCapacity":"上下文容量","ctxMcpTools":"MCP 工具","ctxMessages":"消息","ctxOther":"其他","ctxSkills":"技能","ctxSystemPrompt":"系统提示词","ctxSystemTools":"系统工具","ctxMemory":"记忆","ctxSkillDiscovery":"技能发现","ctxBudget":"预算提醒","enterInsertMulti":"Enter 插入 · 可连续多选","fileMentionHelpMulti":"↑↓ 选择 · Enter 插入(可连续多选)· Esc 关闭","finishMention":"完成引用","lastCompactInfo":"上次压缩: {{orig}}→{{comp}} · {{saved}} tok","mentionFilesGroup":"文件","mentionSessionsGroup":"会话","mentionTabFiles":"文件","mentionTabSessions":"会话","mentionTabUnknownDir":"未知目录","mentionTabHint":"Tab / Shift+Tab 切换","mentionStatusRunning":"运行中","mentionStatusIdle":"空闲","mentionStatusPaused":"暂停","mentionStatusError":"异常","mentionStatusStopped":"已停止","mentionMsgCount":"{{count}} 条","mentionScopeLabel":"范围: ","mentionScopeActive":"活跃","mentionScopeAll":"全部","mentionScopeHint":"Shift+S 切换范围(活跃 = 运行中 + 有客户端在线;全部 = 含历史)","mentionEmptySessions":"当前没有「有客户端在线」的会话,按 S 查看全部","mentionDeliveryLabel":"投递: ","mentionDeliveryEnqueue":"进入队列","mentionDeliveryNextStep":"调整当前任务","mentionDeliveryDirect":"直连","mentionDeliveryHint":"Shift+M 切换投递方式(进入队列 = 等对方空闲后作为新的一轮;调整当前任务 = 插进对方当前这一轮,需对方正在运行;直连 = 不经本会话模型直接投给对方,需无文件引用)","mentionDeliveryChip":"@{{titles}} · {{mode}}","observedTitle":"被 @ 会话","observedRunning":"执行中","observedDone":"已完成","observedFailed":"失败","agentProgress":{"title":"子代理","running":"{{count}} 运行中","paused":"{{count}} 已暂停","more":"+{{count}} 个"},"noMatchingFiles":"未找到匹配的文件","searchingFiles":"搜索文件中...","selectedCountShort":"已选 {{n}}","selectedFilesCount":"已选 {{n}} 个文件","unitWan":"万","unitYi":"亿","viewContextDetail":"查看上下文容量详情","loading":"加载中…","applyScopeGlobal":"全局","applyScopeSession":"仅本会话","sessionScopeHint":"仅对当前会话生效,不改变全局默认","globalScopeHint":"写入全局/当前模式默认模型(影响所有会话)","sessionModelNoSession":"没有活跃会话,无法应用仅本会话的模型切换"}'),F9={title:"键盘快捷键",commandPalette:"打开命令面板",clearLogs:"清空日志",help:"显示快捷键帮助",submit:"提交输入",newline:"换行",closeDialog:"关闭弹窗 / 暂停生成",slashCommand:"快捷命令",fileRef:"引用文件",shellCommand:"执行命令",skillRef:"调用技能",stopGen:"终止生成(连按两次 Esc)",screenshot:"屏幕截图(添加为图片附件)"},H9={placeholder:"搜索命令或跳转面板...",empty:"没有匹配的命令",hint:"↑↓ 选择 · Enter 执行 · Esc 关闭",running:"执行中..."},U9={openMenu:"打开菜单",closeMenu:"关闭菜单",close:"关闭",expand:"展开",collapse:"折叠",delete:"删除",remove:"移除",send:"发送消息",newSession:"新建会话",connectionStatus:"连接状态",loading:"加载中",commandPalette:"命令面板"},G9={mode:"模式",planMode:"Plan 模式 — 只读分析",actMode:"Act 模式",autoMode:"自动模式:自动批准工具调用",goalMode:"Goal 模式",autoApprove:"Auto 自动批准",modeLocked:"已锁定:用户显式选择,自动评估不会改写",modeSuggestionTitle:"Router 建议切换模式",modeSuggestionApply:"切换到 {{mode}}",modeSuggestionKeep:"保持 {{mode}}",modeSuggestionConfidence:"置信度",planContent:"Plan 文件内容",analyzing:"正在分析需求..."},q9={title:"更新内容"},V9={title:"设置",searchPlaceholder:"搜索设置...",noResults:"没有匹配的设置项",nav:{general:"通用",appearance:"个性化",profile:"个人画像",voice:"语音服务",models:"模型与 Provider",connectors:"连接器与能力",context:"上下文",configFiles:"配置文件",network:"网络访问",system:"系统",about:"关于"},network:{description:"控制谁能打开这个 Web 界面。默认只有本机(localhost)能访问;打开开关后,同一个局域网(Wi-Fi / 有线)里的手机、平板、同事电脑都可以打开下面的地址,使用同一个 Agent。",toggleLabel:"允许局域网访问",toggleHint:"关闭时服务只绑定 127.0.0.1,局域网内的设备连不上。",stateLocal:"当前:仅本机可访问",stateLan:"当前:局域网可访问",addresses:"访问地址",noLanAddress:"没有检测到局域网网卡地址(只找到回环地址)",copy:"复制",copied:"已复制",warningTitle:"开启后请注意",warning:"局域网内任何设备打开上面的地址,都能使用这台电脑上的 AI Agent —— 包括读写文件和执行命令。只建议在可信任的网络里开启。",noTokenHint:"当前未设置 API token(DEEPSEEKCODE_API_TOKEN)。设置后,局域网客户端必须携带 token 才能连接。",tokenHint:"已设置 API token:局域网客户端需要携带 token 才能连接。",lockedByHost:"监听地址已被启动参数 --host 锁定为 {{host}},无法在这里切换。去掉 --host(或 DEEPSEEKCODE_HOST)后重启即可用开关控制。",lockedByEnv:"这个开关已由环境变量 {{env}} 接管,运行时不能修改(改 env 后重启生效)。",confirmEnable:`开启局域网访问?
|
|
27
|
+
|
|
28
|
+
同一局域网内的其他设备将能打开本机的 Web 界面,使用同一个 AI Agent(可读写文件、执行命令)。
|
|
29
|
+
|
|
30
|
+
只建议在可信任的网络中开启。`,confirmDisable:`关闭局域网访问?
|
|
31
|
+
|
|
32
|
+
局域网内已连接的其他设备会立刻断开,并且无法再连上(本机不受影响)。`,pendingHint:"正在重新绑定监听地址(约 1 秒),本页会短暂断开并自动重连…",enabledToast:"已开启局域网访问,本页会自动重连",disabledToast:"已关闭局域网访问,现在仅本机可访问",applyFailed:"切换失败,已回滚到原来的状态",rollback:"切换失败,已自动回滚",loadFailed:"读取网络设置失败"},groups:{general:"通用",features:"功能",system:"系统"},profile:{title:"个人画像",hint:"写一段稳定的自我介绍,模型每轮对话都会读到它。与「记忆」不同:不做过期、不做相关度过滤,也不会被自动改写。",enabled:"注入到对话",enabledHint:"开启后,下面这段内容会作为 <user_profile> 加入每一轮系统提示。",path:"文件位置",exists:"已创建",missing:"尚未创建",size:"{{used}} / {{max}} 字节",truncated:"已超出上限,超出部分不会被注入。",empty:"还没有画像内容。点「编辑」写下你的称呼、习惯、常做的项目。",edit:"编辑",clear:"清空",clearConfirm:"删除画像文件?该操作不可撤销。",name:"称呼",namePlaceholder:"模型该怎么称呼你(可留空)",body:"画像内容",bodyPlaceholder:"例如:我是王立华,做后端。回答尽量先给结论和代码,少讲背景。",save:"保存",saving:"保存中…",cancel:"取消",loading:"加载中…",saveOk:"已保存",saveFailed:"保存失败",clearOk:"已删除",clearFailed:"删除失败",loadFailed:"读取失败"},theme:"主题",themeDark:"🌙 深色",themeLight:"☀️ 浅色",themeAuto:"🔄 自动",themePresets:"主题预设",themePresetLinear:"极简 Linear",themePresetLinearDesc:"中性灰 + 单一强调色 — 极简专业",themePresetMimo:"暖纸 Mimo",themePresetMimoDesc:"暖白纸感 + 墨色正文 — 温润素雅",themePresetGithub:"GitHub 默认",themePresetGithubDesc:"中性暗/亮色 — 简洁专业",themePresetCherry:"Cherry Studio",themePresetCherryDesc:"蓝色渐变 — 清爽科技感",themePresetOcean:"海洋 Ocean",themePresetOceanDesc:"深蓝/青色 — 冷静专业",themePresetMint:"薄荷 Mint",themePresetMintDesc:"青绿/薄荷 — 清新爽朗",themePresetLavender:"薰衣草 Lavender",themePresetLavenderDesc:"柔紫 — 优雅精致",themePresetMidnight:"午夜 Midnight",themePresetMidnightDesc:"深海军蓝 — 极简高对比",themePresetSunset:"日落 Sunset",themePresetSunsetDesc:"暖橙/金色 — 活力充沛",themePresetForest:"森林 Forest",themePresetForestDesc:"自然绿 — 大地色系宁静",themePresetCandy:"糖果 Candy",themePresetCandyDesc:"明亮多彩 — 活泼生动",themePresetNord:"Nord",themePresetNordDesc:"北极蓝 — 流行精心设计",customOverrides:"自定义覆盖",customOverridesHint:"调整单个颜色以覆盖当前主题预设",colorBg:"背景色",colorSurface:"面板色",colorBorder:"边框色",colorText:"文字色",colorMuted:"次要文字",colorAccentBlue:"强调蓝",colorAccentGreen:"强调绿",colorAccentRed:"强调红",colorAccentYellow:"强调黄",colorAccentPurple:"强调紫",resetColors:"重置为默认配色",about:"关于",aboutDesc:"基于 Web 的 AI 编码助手界面",whatsNew:"查看更新内容",language:"语言",languageZh:"中文",languageEn:"English",languageAuto:"跟随系统",languageHint:"切换后同步到服务端配置,AI 将用所选语言回复(下一轮对话生效);不约束其内部思考语言。选「跟随系统」时按浏览器语言自动适配。",display:"界面",developerView:"开发者视图(原始细节全展开)",developerViewHint:"默认按时序流展示并自动折叠已完成的思考/工具;开启后不再自动折叠,原始细节保持展开",capabilities:{title:"Agent 能力管理",loadFailed:"能力配置加载失败",toggleFailed:"切换失败"},contextOffload:{title:"Context Offload(工具结果外置)",desc:"大体积工具输出不再整体进入上下文,而是存入磁盘 artifact 存储,上下文中只保留摘要与句柄;AI 需要细节时通过 artifact_query / artifact_read 按需取回。可显著降低长会话的 token 占用并提升缓存命中率。",enableLabel:"启用工具结果外置",currently:"当前生效",maxTotalMb:"存储总容量上限(MB)",ttlDays:"保留天数",outboundBytes:"外置触发阈值(字节,工具输出超过即外置)",turnBudget:"单轮上下文增长预算(token)",dir:"存储目录",optional:"可选,留空使用默认",stats:"当前已存储 {{count}} 个 artifact,共 {{size}} MB",saved:"Context Offload 设置已保存",saveFailed:"保存失败",invalidNumber:"数字字段必须为正整数",envHint:"标有 ⚠ env 的字段被同名环境变量覆盖,修改环境变量后重启生效"}},W9={title:"模型配置",providerConfig:"Provider 配置",configured:"已配置",notConfigured:"未配置",apiKeyHint:"已配置 API Key,输入新 Key 将覆盖旧配置。",apiKeyDefaultPlaceholder:"sk-...",removeConfirm:'确定要移除 "{{providerKey}}" 的配置吗?这将删除其 API Key 和模型。',loadFailed:"加载模型失败",saveFailed:"保存失败",overallStatus:"总体状态",healthy:"健康",degraded:"降级",abnormal:"异常",healthRate:"健康率",onlineInstances:"在线实例",totalRequests:"总请求数",configuredModels:"已配置模型",globalShort:"全局",setDefaultProvider:"设为默认 Provider",deleteProviderConfirm:'确定要删除 "{{key}}" 的配置吗?',deleteProvider:"删除 Provider",catalogTitle:"models.dev 模型目录搜索",catalogSearchPlaceholder:"搜索全厂商模型,如 gpt-4o / deepseek / claude ...(匹配模型 id / 名称 / 厂商)",catalogOnlyToolCall:"仅工具调用",catalogOnlyReasoning:"仅推理模型",searching:"搜索中...",catalogNoResults:"无匹配模型,换个关键词试试",badgeReasoning:"推理",badgeToolCall:"工具",badgeMultimodal:"多模态",ctxLimit:"上下文 {{k}}K",outLimit:"输出 {{k}}K",catalogAddTitle:"添加到模型 ID 输入框",add:"添加",catalogSourceHint:"数据源:models.dev 模型目录(内置快照,离线可用)。点击「添加」将模型 ID 写入「模型 ID」输入框。",baseUrlRequired:"请先填写 Base URL",apiKeySanitized:"API Key 包含非法字符,已自动过滤",fetchedCount:"获取到 {{n}} 个模型",fetchFailed:"获取模型列表失败,请检查 Base URL 和 API Key",requestFailed:"请求失败",hintJoiner:";",connectionFailed:"连接失败",catalogSearchFailed:"目录搜索失败",addedModel:"已添加 {{id}}",operationFailed:"操作失败,请重试",providerNameRequired:"请先输入 Provider 名称",apiKeyRequired:"请至少输入一把 API Key",defaultsAutoUpdated:"已自动更新默认模型",unknownError:"未知错误",loading:"加载中...",providerListRefreshed:"Provider 列表已刷新",refreshFailed:"刷新失败,请稍后重试",refreshListTitle:"从远端刷新 Provider 列表",collapse:"收起",addProvider:"新增 Provider",providerSearchPlaceholder:"搜索 Provider 名称 / 模型...",clear:"清除",clearSearch:"清除搜索",noMatchingProviders:"未找到匹配的 Provider",noMatchingProvidersHint:"没有与「{{query}}」匹配的 Provider,请检查拼写或改用完整列表",noDefaultModel:"无默认模型",configuredCount:"{{n}} 个模型",availableCount:"{{n}} 可用",defaultProviderBadge:"默认 Provider",deleteProviderNamed:"删除 {{name}}",none:"无",loadLabel:"负载",inputPrice:"输入价格",outputPrice:"输出价格",inputTokensLabel:"输入 token",outputTokensLabel:"输出 token",totalTokensLabel:"总 token",tokenUsageLabel:"累计 Token",usageRequestsLabel:"累计请求",setGlobalDefaultTitle:"设为全局默认",setPlanDefaultFailed:"设置 Plan 默认失败",setPlanDefaultTitle:"设为 Plan 默认",unsetPlanDefaultFailed:"取消 Plan 默认失败",unsetPlanDefaultTitle:"取消 Plan 默认(该模式回退到全局默认)",setGoalDefaultFailed:"设置 Goal 默认失败",setGoalDefaultTitle:"设为 Goal 默认",unsetGoalDefaultFailed:"取消 Goal 默认失败",unsetGoalDefaultTitle:"取消 Goal 默认(该模式回退到全局默认)",editModel:"编辑模型",deleteModel:"删除模型",refresh:"刷新",enable:"启用",disable:"禁用",emptyHint:"暂无模型,请先在上方配置 Provider",selectProvider:"选择 Provider",customProvider:"自定义 Provider",customProviderDesc:"手动填写 Provider 名称、Base URL 和模型 ID",editExistingConfig:"编辑已有配置(可选)",newCustomProviderOption:"+ 新建自定义 Provider",editExistingConfigHint:"默认新建空表单;选择已保存的配置可回填继续编辑(API Key 不回显,留空保存即保留原 Key)。",providerNameLabel:"Provider 名称 *",providerNamePlaceholder:"例如: my-provider",apiKeysHintConfigured:",留空则保留已保存的 Key",apiKeysHintNew:"(可配置多把,运行时取第一把,其余备用)",addApiKey:"添加 Key",addApiKeyTitle:"添加一把 API Key",removeApiKeyTitle:"删除这把 API Key",showKeyTitle:"显示 Key",hideKeyTitle:"隐藏 Key",modelIdLabel:"模型 ID",modelIdPlaceholder:"gpt-4o, deepseek-chat (格式: id|名称|别名)",fetchModelsTitle:"从 API 获取模型列表",fetchingModels:"获取中...",fetchModels:"获取模型列表",testConnectionTitle:"探测端点连通性,自动推断 API 类型并修复 Base URL",testingConnection:"测试中...",testConnection:"测试连接",catalogSearchTitle:"搜索 models.dev 全厂商模型目录(含 context/价格/能力元数据)",modelSearchPlaceholder:"搜索模型...",fullPathLabel:"完整路径(不自动拼接 /chat/completions、/responses、/v1/messages)",fullPathHint:"开启后 Base URL 按原样使用(如 https://host/v1/chat/completions),后端不再转换。",apiTypeLabel:"API 类型",apiTypeAutoDetect:"自动探测(推荐)",autoRemovedMissingModels:"已自动移除服务端不存在的模型:{{models}}",autoSkippedMissingModels:"已自动跳过服务端不存在的模型:{{models}}",defaultModelDisableBlocked:"无法禁用 {{name}}:请先将默认模型切换为其他模型",deleteModelConfirm:"确认从配置中删除模型 {{id}}?",connectionSuccessWithHints:"{{message}}。{{hints}}。",loadingProviders:"加载中...",refreshList:"刷新列表",editProviderNamed:"编辑 {{name}}",globalDefault:"全局默认",planDefault:"Plan 默认",actDefault:"Act 默认",goalDefault:"Goal 默认",connectionSuccess:"连接成功",baseUrlAutoCompleted:"Base URL 已自动补全为 {{url}}",apiTypeAutoSelected:"API 类型已自动选择为 {{type}}",hasKey:"已有 Key",noKey:"无 Key",defaultShort:"默认",overrideBadge:"覆盖",overrideTitle:"手动覆盖模型列表",customBaseUrl:"自定义 Base URL",catalogSearch:"搜索目录模型",close:"关闭",apiTypeHint:"留空 = 根据 Base URL 自动识别协议",modelApiTypeLabel:"API 类型(目录模型)",modelApiTypeHint:"目录模型的响应协议,默认跟随 Provider 设置",modelApiTypeEmpty:"当前目录没有可选的 API 类型",addCustomProvider:"新增自定义 Provider",configuredPanelPrefix:"已配置 ",configuredPanelSuffix:" 个模型",configuredPanelHint:"(勾选即时生效,与「模型 ID」输入框双向同步)",fetchedPanelPrefix:"已获取 ",fetchedPanelMiddle:" 个,已选 ",fetchedPanelSuffix:" 个",fetchedPanelHint:"(勾选将写入「模型 ID」输入框)",searchMatchPrefix:"命中 ",searchMatchSuffix:" 个(共 {{total}} 个)",noModelsInProvider:"该 Provider 下暂无模型",reset:"重置",actIsGlobalHint:"全局默认 = Act 默认(二者合并),故不单独提供「设为 Act 默认」",globalDefaultUnsettable:"全局默认不可取消(当前会话必须有生效模型)"},K9={title:"工具列表",searchTools:"搜索工具...",disabled:"禁用",enabled:"启用",params:"参数",loadFailed:"加载工具失败",noTools:"暂无工具",loading:"加载中...",retry:"重试",refresh:"刷新",invalidData:"服务端返回的工具数据格式异常",edit:"编辑",save:"保存",cancel:"取消",saving:"保存中…",saveFailed:"保存失败",reset:"恢复默认",resetDone:"已恢复默认设置",resetFailed:"恢复默认失败",overridden:"已修改",defaultOff:"默认关闭",userInstalled:"已安装",userInstalledHint:"来自你安装的 MCP server 或插件。这里的开关只控制「是否加载」,关闭不等于卸载 —— 卸载请到插件 / 连接器管理。",toggleFailed:"切换失败",exportConfig:"导出配置",importConfig:"导入配置",exportDone:"已导出 {{count}} 项工具配置",exportEmpty:"当前没有自定义配置可导出",importDone:"已导入 {{count}} 项工具配置",importUnknown:"另有 {{count}} 项当前版本不认识,已原样保留在配置文件中",importFailed:"导入失败:{{error}}",importInvalid:"文件内容不是合法的 JSON",importEmpty:"文件中没有可用的工具配置",importTitle:"导入工具配置",importDesc:"发现 {{count}} 项配置,请选择导入方式:",importMerge:"合并",importMergeHint:"保留文件中未提及的工具设置",importReplace:"替换",importReplaceHint:"清空现有设置,只保留文件内容",importPath:"配置文件:{{path}}",groupBy:"分组",groupByCategory:"按分类",groupByRisk:"按风险",groupByState:"按启用状态",groupUncategorized:"未分类",groupEnabled:"已启用 {{on}}/{{total}}",enableGroup:"全部启用",disableGroup:"全部禁用",expandAll:"全部展开",collapseAll:"全部折叠",noMatch:"没有匹配的工具",riskLow:"低风险",riskMedium:"中风险",riskHigh:"高风险",riskCritical:"极高风险",riskUnknown:"未评级",planLocked:"plan 只读模式下不可用",usageHint:"使用指导",fieldName:"显示名",fieldDescription:"描述",fieldCategory:"分类",fieldEnabled:"启用",namePlaceholder:"留空则用默认名称",descriptionPlaceholder:"留空则用默认描述",categoryPlaceholder:"留空则用默认分类",totalTools:"共 {{count}} 个工具",enabledCount:"{{count}} 个已启用",saved:"已保存",exportFailed:"导出失败",profileMinimalHint:"当前为精简档位:{{off}} 个工具默认关闭,按需开启即可(开关会保存到配置文件)。",groupPartial:"{{total}} 个中有 {{failed}} 个切换失败",descriptionHint:"描述会写进模型的工具清单,改动会影响工具选择;留空则用默认值。",cat:{agent:"子代理",browser:"浏览器自动化",code_intelligence:"代码智能",communication:"通信",computer:"桌面操控",context:"上下文管理",filesystem:"文件系统",git:"版本控制",mcp:"MCP 扩展",media:"多媒体",metacognition:"计划与自省",network:"网络访问",planning:"任务规划",remote:"远程触发",search:"检索",system:"系统与元操作",task:"任务面板",team:"团队协作",terminal:"终端执行",utility:"实用工具",workspace:"工作区"}},Y9={title:"技能管理",list:"技能列表",noSkills:"暂无技能",loadFailed:"加载技能失败",loadFailedFallback:"加载失败",enable:"启用",disable:"禁用",enabled:"已启用",disabled:"已关闭",new:"新建技能",import:"导入",importTitle:"导入技能",edit:"编辑",save:"保存",cancel:"取消",retry:"重试",refresh:"刷新",tags:"标签",none:"无",source:"来源",systemPrompt:"系统提示词",fieldId:"ID",fieldName:"名称",fieldCategory:"分类",fieldTrigger:"触发词",fieldTools:"所需工具",description:"描述",saving:"保存中",chooseFile:"选择技能文件",importHint:"支持 .skill.md 文件",marketplace:"技能市场",addMarketplace:"添加市场",marketplaceUrlPlaceholder:"GitHub 仓库 / index.json 链接 / 本地技能文件夹,如 https://github.com/obra/superpowers 或 D:\\agent\\agentic-awesome-skills",marketplaceName:"市场名称(可选)",marketplaceHint:"支持 GitHub 仓库(自动扫描 skills/ 目录)、返回 index.json 的 URL、或本机技能文件夹(完全离线,直接浏览/安装磁盘上的技能库)。GitHub 无法访问时可设置 DEEPSEEKCODE_GITHUB_MIRROR 镜像加速。",marketFilterPlaceholder:"在当前市场搜索技能...",marketCategoryAll:"全部分类",riskCritical:"高危",riskUnknown:"风险未知",refreshMarketplace:"刷新",removeMarketplace:"移除市场",installSkill:"安装",installed:"已安装",installFail:"安装失败",loadMarketplaceFail:"加载技能市场失败",noMarketplaces:"暂无市场,先添加一个",noSkillsInMarket:"该市场暂无技能",marketplaceError:"市场索引加载失败:{{error}}",retryMarket:"重试",presets:"内置市场",marketplaces:"已添加的市场",skillCount:"{{count}} 个技能",addFail:"添加市场失败",installing:"安装中...",adding:"添加中...",marketplaceTab:"技能市场",mineTab:"我的技能",installedTab:"已安装",workshopTab:"技能工坊",workshopHint:"技能提案:从会话/手动生成,审核后一键应用为技能",workshopPropose:"新建提案",workshopName:"技能名 (skill-name) 如 format-json",workshopTrigger:"触发关键词(可选)",workshopDescription:"一句话描述",workshopContent:"技能正文(系统提示 / 工作流指令)",workshopSubmit:"提交提案",workshopApply:"应用",workshopEmpty:"暂无技能提案",workshopFormRequired:"技能名和正文为必填",uninstall:"卸载",uninstallConfirm:"确定卸载已安装技能「{{name}}」?",uninstallFail:"卸载失败",pagePrev:"上一页",pageNext:"下一页",pageOf:"第 {{page}} / {{total}} 页",emptyInstalled:"还没有已安装的市场技能",emptyInstalledHint:"前往「技能市场」浏览并下载安装",browseMarket:"去市场逛逛",use:"使用",useHint:"使用此技能:将 $技能名 插入输入框,补充任务描述后发送",pickTitle:"选择技能",pickPlaceholder:"搜索技能...",pickEmpty:"没有可用的技能",pickUse:"点击使用"},Z9={hookApproval:"Hook 拦截审批",morePending:"还有 {{n}} 项待审批",tool:"工具:",reason:"原因:",allow:"允许",deny:"拒绝",autoMode:"自动模式",moreOptions:"更多选项",highRiskWarning:"此操作可能造成不可逆的影响,请仔细确认",mediumRiskConfirm:"请确认此操作为预期行为",alreadyAllowed:"已允许:",alreadyDenied:"已拒绝:",risk_critical:"破坏性操作 - 可能删除数据",risk_critical_cmd:"高危命令 - 包含系统级操作",risk_high_shell:"Shell 命令执行",risk_high_file:"文件写入操作",risk_high_pkg:"包管理操作",risk_git:"Git 操作",risk_network:"网络请求",risk_low:"只读操作",risk_default:"工具调用",optionAllow:"允许 — 执行此操作",optionAllowHint:"点击或按 Enter 确认",optionDeny:"拒绝 — 取消此操作",optionDenyHint:"点击或按 Esc 取消",optionAllowAlways:"本次会话始终允许",optionAllowAlwaysHint:"不再询问 {{tool}}",optionAllowPathHint:"不再询问该外部路径",timeoutWaitUser:"等待用户输入(无超时)",optionAutoMode:"自动模式 — 全部允许",optionAutoModeHint:"之后所有 Hook 将自动批准",shortcutHint:"快捷键: 1-4 选择 · Enter 允许 · Esc 拒绝",lastItem:"最后一项",clickToSelect:"点击选择 · 1/2/3/4 键盘快捷键",verbRunCommand:"运行命令",verbWriteFile:"写入文件",verbEditFile:"编辑文件",verbReadFile:"读取文件",verbDeleteFile:"删除文件",verbFindFiles:"查找文件",verbSearchContents:"搜索内容",verbFetchUrl:"请求网络",verbSearchWeb:"搜索网络",verbGit:"Git 操作",verbInstall:"安装依赖",verbSendMessage:"发送消息",verbRunTool:"执行操作",scopeLocal:"作用于当前工作区",scopeExternal:"外部路径",showAllLines:"展开全部 {{n}} 行",showAll:"显示完整内容",showLess:"收起",importMergeConfirm:`合并到现有配置吗?
|
|
33
|
+
"确定"=合并 / "取消"=替换`,configTitle:"Hook 配置",configDesc:"在工具执行、任务流转等生命周期事件上挂载拦截器,实现审批与自定义逻辑",import:"导入",export:"导出",newRule:"新增规则",ruleList:"规则列表",ruleCount:"{{n}} 条",implShell:"Shell 脚本",implShellDesc:"执行外部脚本,stdin 接收 JSON,stdout 返回决策",implHttp:"HTTP 端点",implHttpDesc:"POST JSON 到外部端点",implPromptDesc:"发送单轮 Prompt 给 LLM 做风险评估",implAgentDesc:"启动只读子代理做深度调查",stepBasicTitle:"基本信息",stepBasicDesc:"名称、描述、事件",stepImplTitle:"实现配置",stepImplDesc:"执行方式与参数",stepAdvancedTitle:"高级选项",stepAdvancedDesc:"优先级、过滤、测试",editRule:"编辑: {{name}}",addRule:"添加 Hook 规则",fieldName:"名称 *",fieldDescription:"描述",descriptionPlaceholder:"这个 Hook 的作用...",fieldEvents:"事件 *",eventsSelected:"{{n}} 已选",searchEventsPlaceholder:"搜索事件...",toggleAllEvents:"全选/取消",fieldImplType:"实现类型 *",fieldCommand:"命令 *",fieldPromptTemplate:"Prompt 模板 *",promptTemplatePlaceholder:"你是一个安全审计专家,请分析以下工具调用...",selectAgentPlaceholder:"选择 Agent...",agentReadOnlyHint:"Agent 将以只读模式运行(Read/Grep/Glob),不会修改文件",fieldPriority:"优先级",fieldTimeout:"超时 (ms)",labelEnabled:"启用",failOpenLabel:"Fail-open(超时放行)",fieldToolFilter:"工具过滤(正则,可选)",dryRunResultTitle:"Dry-run 结果",dryRunDecision:"决策: ",dryRunReason:"原因: ",dryRunOutput:"输出: ",dryRunButton:"试运行 (Dry Run)",prevStep:"上一步",nextStep:"下一步",saveChanges:"保存修改",createRule:"创建规则",noRules:"暂无 Hook 规则",noRulesHint:'点击右上角"新增规则"创建第一个 Hook',batchDeleteConfirm:"确认删除 {{n}} 条规则?",selectedItems:"已选 {{n}} 项",enableAll:"全部启用",disableAll:"全部禁用",colName:"名称",colEvents:"事件",colType:"类型",colStatus:"状态",colActions:"操作",clickToDisable:"点击禁用",clickToEnable:"点击启用",actionEdit:"编辑",deleteRuleConfirm:'删除规则 "{{name}}"?',statTotal:"总规则数"},X9={pending:"等待",thinking:"思考",action:"执行",result:"结果",running:"运行中",error:"错误",completed:"完成",params:"参数",screenshot:"屏幕截图"},Q9={linesTotal:"… (共 {{n}} 行)",expandAll:"展开全部 ({{n}} 行)",collapse:"收起"},J9={quickCommands:"快捷命令",search:'搜索: "{{filter}}"',help:"↑↓ 选择 · Enter 执行 · Esc 关闭",backend:"后端",backendCommand:"后端命令",chat_desc:"切换到对话面板",chat_result:"已切换到对话面板",files_desc:"打开右侧「工作空间文件」",files_result:"已打开工作空间文件面板",models_desc:"切换到模型面板",models_result:"已切换到模型面板",tools_desc:"列出可用工具",tools_result:"已切换到工具面板",skills_desc:"列出可用技能",skills_result:"已切换到技能面板",settings_desc:"切换到设置面板",settings_result:"已切换到设置面板",logs_desc:"切换到日志面板",logs_result:"已切换到日志面板",new_desc:"创建新会话",new_result:"新会话已创建",clear_desc:"清空当前会话消息",clear_result:"消息已清空",theme_desc:"切换主题 (dark/light/auto)",theme_error:"用法: /theme <dark|light|auto>",theme_result:"主题已切换为 ",theme_preset_result:"主题预设已切换为 ",theme_preset_unavailable:"主题预设切换不可用",logs_clear_desc:"清空日志",logs_clear_result:"日志已清空",doctor_desc:"系统自诊断 (Config/API Key/Network/Docker/Disk)",compact_desc:"压缩当前会话上下文",help_desc:"显示所有快捷命令",review_desc:"代码审查 — 检查变更的正确性、安全性和代码质量",security_review_desc:"安全审查 — OWASP Top 10 + 命令注入/路径遍历/权限提升",memory_desc:"管理 AI 持久记忆 (list/add/delete/clear)",ps_desc:"查看和管理后台任务、子代理和 shell 进程",model_desc:"查看或切换 AI 模型",status_desc:"显示当前会话状态 (会话ID/消息数/模型/工作目录)",config_desc:"管理应用程序配置 (get/set/list/delete)",exit_desc:"退出应用",exit_result:"正在关闭服务...",benchmark_desc:"运行 DeepSeekCode 能力评测 (simple/medium/complex/full/list)",goal_desc:"设置多步工作目标",goal_list_desc:"列出活跃目标",goal_status_desc:"查看目标进度",workflow_list_desc:"列出工作流运行记录",workflow_status_desc:"查看工作流状态",workflow_checkpoints_desc:"列出工作流检查点",mcp_desc:"列出或重新加载 MCP 服务器",sessions_desc:"列出会话",resume_desc:"按 ID 恢复会话",permissions_desc:"显示权限规则和待审批项",init_desc:"生成 agent.md 项目指导文件",self_test_desc:"运行工具能力自测并生成报告",context_desc:"显示上下文分析报告",version_desc:"显示版本信息","check-update_desc":"检查可用更新",upgrade_desc:"升级到最新版本",acceptance_desc:"运行或检查验收工作流 (quick/full/list/report)",diff_desc:"查看未提交的 Git 变更",summary_desc:"总结当前会话内容",effort_desc:"显示或设置推理力度 (low|medium|high)",export_desc:"导出当前会话为 JSON",rename_desc:"重命名当前会话",hooks_desc:"显示活跃钩子配置",sent_command:"已发送命令 ",noActiveSession:"无活跃会话",unknownCommand:"未知命令 {{cmd}} — 输入 /help 查看可用命令"},eC={pageError:"页面出现错误",unknownError:"发生了未知错误,请尝试刷新页面",refreshPage:"刷新页面",genEnded:"生成已结束(工具执行超时或连接中断)",genEndedWs:"生成已结束(连接已断开,回答未能送达;恢复后已自动补发)",genEndedStopped:"已终止(用户停止或发送了新消息)"},tC={backendConnected:"后端已连接",backendDisconnected:"后端连接断开,正在重连...",paused:"已暂停,再按 ESC 终止",terminated:"已终止 (ESC×2)",queueRevoked:"已撤销 {{count}} 条排队消息",queuePromoted:"已置顶:当前回复结束后最先发送",queueRemoved:"已删除 1 条排队消息",terminatedQueued:"已终止,并丢弃 {{count}} 条排队消息",uncaughtError:"未捕获错误:",uncaughtRejection:"未捕获的 Promise 拒绝: ",unknownReason:"未知原因"},nC={title:"频道助理",loading:"正在加载助理…",loadFailed:"助理列表加载失败",empty:"还没有助理",emptyHint:"启动并配置一个频道后,第一条私信或群内 @ 会自动创建对应的助理",goChannels:"去配置频道",openSession:"打开会话",selectHint:"从列表中选择一个频道会话,这里会显示它的会话内容",policy:"触发策略",group:"群聊",dm:"私聊",groupPolicy:"群触发:{{mention}}",mode:{label:"模式",delegate:"委派",direct:"直答"},mentionRequired:"需要 @ 才响应",cooldown:"冷却",keywords:"关键词(逗号分隔,未点名时的逃生口)",keywordsPlaceholder:"如:bot, 助手",trust:{public:"公开",team:"团队",owner:"所有者"},status:{idle:"空闲",running:"运行中",paused:"已暂停",error:"出错",complete:"已完成",stopped:"已停止",interrupted:"已中断"}},aC={title:"频道管理",subtitle:"接入外部 IM 平台,通过微信、飞书、钉钉等与 AI 交互",table:{name:"频道名称",type:"类型",appId:"App ID",status:"连接状态",enabled:"启用",actions:"操作",emptyHint:"点击右上角「新建频道」接入微信、飞书或钉钉"},status:{connected:"已连接",disconnected:"未连接",connecting:"连接中",error:"错误"},empty:"还没有配置任何频道",emptyHint:"点击「新建频道」添加一个 IM 平台机器人",form:{name:"频道名称",namePlaceholder:"例如:公司群机器人",type:"频道类型",credentials:"凭证信息",appId:"App ID / 企业ID",appSecret:"App Secret",token:"Token / Bot Token",encodingAESKey:"EncodingAESKey",enabled:"启用频道",namePlaceholderDev:"例如:研发群机器人",leaveBlankUnchanged:"留空不修改",appSecretValue:"应用密钥",tokenCallback:"回调校验 Token",optionalShort:"选填",wechatIlinkHint:"微信 iLink 机器人通过扫码授权,凭证可留空,保存后扫码登录即可。",enabledOffHint:"关闭后停止收发消息"},actions:{edit:"编辑",delete:"删除",deleteConfirm:"确定要删除此频道?",test:"测试连接",save:"保存频道",cancel:"取消",refresh:"刷新",qrLogin:"扫码登录",deleteConfirmShort:"确认删除该频道?"},errors:{loadFailed:"加载频道列表失败",createFailed:"创建频道失败",notFound:"频道未找到",notImplemented:"尚未实现",nameRequired:"频道名称不能为空"},qr:{title:"微信扫码登录",generating:"二维码生成中...",waiting:"请使用微信扫描二维码",scanned:"已扫描,请在手机上确认",confirmed:"登录成功",expired:"二维码已失效",error:"获取二维码失败",openInNewTab:"在新标签页打开"},typeLabels:{wechat:"微信",feishu:"飞书",dingtalk:"钉钉",telegram:"Telegram",discord:"Discord",slack:"Slack",signal:"Signal",whatsapp:"WhatsApp",line:"LINE",qqbot:"QQ Bot",matrix:"Matrix",mattermost:"Mattermost",msteams:"Teams",googlechat:"Google Chat",irc:"IRC"},viewSubtitle:"接入微信、飞书、钉钉,用户可通过频道发送任务并实时接收进度与结果",experimentalLabel:"实验性",experimentalShort:"实验",experimentalTip:"实验性实现,功能不完整",experimentalDesc:"此频道为基础适配器封装,支持基础消息收发,部分高级功能可能不完整",pluginMissingLabel:"插件未安装",pluginMissingWarning:"该频道类型的插件未安装或未激活,实例无法启动。请到「插件」页安装并激活{{name}}插件后重试。",selectTypeHint:"请从左侧选择一个频道类型",instancesCount:"{{n}} 个配置实例",notConfiguredYet:"尚未配置",createInstance:"新建实例",createShort:"新建",selectInstance:"选择实例",emptyWithType:"还没有配置 {{type}}",wechatBindHint:"点击下方按钮,用微信扫码即可自动完成绑定",startWithCreate:"点击上方「新建实例」开始配置",scanToBind:"扫码绑定",qrLoginReauth:"扫码登录 / 重新授权",editConfig:"编辑配置",createConfig:"新建配置",save:"保存",saving:"保存中...",unknownError:"未知错误",retry:"重试",bindSuccess:"绑定成功",bindTitle:"扫码绑定 · {{name}}",startUsing:"开始使用",clickToRefresh:"点击刷新",connectedReady:"「{{name}}」已连接,可开始使用",createdConnectedReady:"微信频道已创建并连接,可开始使用",waitingAuthorize:"请使用微信扫描二维码授权机器人",scannedConfirming:"已扫描,请在手机上确认...",confirmedClosing:"机器人已授权并启动,即将自动关闭",connectingIlink:"正在连接 iLink 服务...",openInNewTabFallback:"在新标签页打开(备用)",toastReauthSuccess:"微信「{{name}}」重新授权成功,频道已连接",toastBindSuccess:"微信绑定成功,频道已自动创建并连接",pollFailedRefresh:"轮询状态失败次数过多,请刷新二维码重试",pollFailedToast:"微信绑定状态轮询失败,请刷新二维码重试",qrDataMissing:"二维码数据缺失: {{data}}",fetchWechatQrFailed:"获取微信二维码失败:{{error}}",sidebar:{title:"频道列表",configuredCount:"{{n}} 个已配置",clickToConfigure:"点击下方频道开始配置",configuredMissing:"已配置 · 插件未安装",unconfigured:"未配置",empty:"未安装任何频道插件",emptyHint:"安装频道插件后才会在此显示,请前往「插件」页从插件市场安装",partialConnected:"{{connected}}/{{count}} 已连接"},categories:{im:"即时通讯",international:"国际主流",eastAsia:"东亚",collaboration:"协作平台",classic:"经典协议",other:"其他",builtin:"内置",plugins:"插件扩展"}},rC={stageUploaded:"等待处理",stageParsing:"正在解析数据文件",stageMapping:"模板映射",stageRendering:"正在生成文件",stageComplete:"文件处理完成",stageError:"文件处理失败",parsing:"正在解析 {{file}} …",parsedSummary:"{{rows}} 行 · {{fields}} 个字段",mappingTitle:"模板 ↔ 数据字段映射",templatePlaceholder:"模板占位符",dataField:"数据字段",mappingMore:"另有 {{n}} 个映射",rendering:"正在逐条生成 {{current}}/{{total}} …",download:"下载",downloadFailed:"下载失败",error:"处理失败",roleData:"数据文件",roleTemplate:"模板文件",attach:"上传文件或图片,支持多选",dropHint:"松开以添加附件",unsupportedType:"不支持的文件类型: {{name}}",fileTooLarge:"文件过大: {{name}}(≤50MB)",duplicateFile:"重复文件: {{name}}",maxAttachments:"单次最多 {{n}} 个文件",uploadFailed:"上传失败",stillUploading:"附件正在上传中,请稍候…",importFailed:"Import files failed",kindText:"文本",moreRows:"+{{n}} 行",rowsDone:"{{done}}/{{total}} 行",rowsFailed:"{{n}} 行失败",imagePreview:"图片预览",openInPanel:"在右侧面板预览",imageN:"图片 {{n}}",screenshot:"屏幕截图(选择屏幕/窗口/标签页)",screenshotFailed:"截图失败"},sC={reconnecting:"重连中 {{attempt}}/{{max}}",hint:"正在重新连接后端…"},iC={aria:"文件操作",preview:"预览",openExternal:"用默认程序打开",openFailed:"打开失败",reveal:"在文件管理器中显示",revealFailed:"定位失败",addToChat:"添加到对话",copyPath:"复制路径",copied:"路径已复制",noComposer:"请先打开一个会话",download:"下载",downloadFailed:"下载失败"},oC={title:"Full access(自动批准)已开启",desc:"Agent 可不经确认直接编辑文件和执行命令,存在数据丢失风险。",dismiss:"本次关闭",neverShow:"不再显示"},lC={notGitDesc:"当前工作目录不是 Git 仓库,无法展示变更统计。",refresh:"刷新",clean:"工作区干净",branch:"分支",loading:"加载中…",filesChanged:"文件变更",backToList:"返回变更清单",fullFile:"完整文件",changedLines:"仅改动行",binary:"二进制文件,没有可显示的文本差异",noDiff:"该文件没有差异",stagedBadge:"已暂存",untrackedBadge:"新文件",scopeSession:"本会话",scopeAll:"全部",scopeHintSession:"仅显示当前会话改动过的文件",scopeHintAll:"显示工作区所有未提交变更",sessionClean:"本会话还没有改动过文件"},cC={retry:"重试",details:"详情",modelSettings:"模型设置"},uC={notInstalled:"未安装",installed:"已安装",ready:"已连接",connecting:"连接中",installing:"安装中…",error:"错误",disabled:"已禁用",toolCount:"{{count}} 个工具",docs:"文档",official:"官方",cloud:"云端",local:"本地",needCredentials:"此连接器需要凭据才能启动:",connect:"连接",missing:"未配置",envConfigured:"已配置",searchPlaceholder:"搜索连接器(名称、id、描述)…",all:"全部",noResults:"没有匹配的连接器。",custom:"自定义",addCustom:"添加自定义",customTitle:"添加自定义 MCP 服务器(来自 awesome-mcp-servers 或自建)",customName:"名称 (id)",customCommand:"启动命令",customArgs:"参数(空格分隔)",customEnv:"环境变量(KEY=value,逗号分隔)",customUrl:"MCP 端点 URL",customHeaders:"请求头(KEY=value,逗号分隔)",customLocal:"本地命令",customFormRequired:"名称和启动命令/URL 必填。",removeCustom:"删除此自定义连接器",add:"添加"},dC={justNow:"刚刚",minutesAgo:"{{count}}分钟前",hoursAgo:"{{count}}小时前",daysAgo:"{{count}}天前"},pC={title:"语音输入(Whisper:英语等 / FunASR:中文)",stopTitle:"停止录音并转写",generatingTitle:"生成中不可录音",langToggle:"语音识别语言",multiHint:"中文用 FunASR,其他语言用 faster-whisper;未命中时自动识别",noSpeech:"未识别到语音内容,请重试",backendMissing:"语音服务未就绪,已打开设置页引导安装",setup:{title:"语音服务",envCard:"运行环境检测",envChecking:"检测中…",recheck:"重新检测",pythonOk:"Python {{version}} 已就绪",pythonMissing:"未检测到 Python,请先安装 Python 3.10+",pythonGuide:"下载安装 Python",pipOk:"pip 可用",whisperTitle:"Whisper · 英语",whisperDesc:"英语语音识别",funasrTitle:"FunASR · 中文",funasrDesc:"中文语音识别",installed:"已安装",notInstalled:"未安装",install:"一键安装",installing:"安装中…",cancel:"取消安装",installDone:"安装完成,可回到聊天页使用语音输入",installFailed:"安装失败",installTimeout:"安装超时",installCancelled:"安装已取消",jobInProgress:"已有安装任务进行中,正在接管进度",manualCommand:"手动安装命令",copyCommand:"复制命令",copySuccess:"已复制到剪贴板",copyFailed:"复制失败",torchHint:"中文引擎需安装 torch,体积较大,请耐心等待",logWaiting:"正在准备安装…",chooseHint:"环境已就绪,请选择上方引擎进行安装",defaultEngine:"默认识别引擎",defaultEngineHint:"选择语音输入默认使用的引擎,可在聊天输入框随时切换",inUse:"使用中",engineNotInstalledHint:"该引擎尚未安装,选中后录音时会引导安装",probeError:"依赖检测失败:",installDoneButMissing:"安装命令已执行成功,但引擎检测仍不可用",installDoneButMissingHint:"语音服务已自动重启并重新检测;若仍失败,请复制下方手动命令在终端执行排查(常见原因:torch 与系统 DLL 不兼容)。",pipGuide:"请先安装 Python(含 pip),完成后重启应用再重试。",pipMissing:"未找到 pip,请先安装 Python 环境。"},sources:{title:"下载源",hint:"语音引擎的安装包与模型权重默认走境外源(PyPI / HuggingFace / ModelScope)。国内网络下可换成镜像加速:pip 源决定「一键安装」从哪里装包,模型端点决定首次录音时从哪里下载模型。",loading:"读取中…",badgeCustom:"{{count}} 项自定义",pipIndexUrl:"pip 主源",pipExtraIndexUrl:"pip 补充源",proxy:"代理",hfEndpoint:"HuggingFace 端点",modelscopeEndpoint:"ModelScope 端点",phPipIndex:"https://pypi.tuna.tsinghua.edu.cn/simple",phPipExtra:"留空表示不添加(多源合并时使用)",phProxy:"http://127.0.0.1:7890",phHub:"留空使用官方源",preset:"预设",save:"保存",reset:"恢复默认",saved:"下载源已保存",saveFailed:"保存失败",resetDone:"已恢复为默认源",envTitle:"该值由环境变量 {{name}} 决定(环境变量优先级高于此处设置,如需修改请改 shell 配置)",warning:"已启用第三方源:自定义源会决定本机安装哪些软件包,请确认来源可信。",privateBlocked:"当前已开启私网拦截(settings.security.allowPrivateHosts 为 false),内网源会被拒绝;仅 proxy 不受此限制。",httpsOnly:"下载源仅支持 https(proxy 可 http/socks5)"}},fC={verb:{researching:"分析代码",coding:"修改代码",validating:"运行验证",summarizing:"整理结果"},title:{withFile:"{{verb}} {{file}}",withCount:"{{verb}} · {{count}} 项"},toolCallCount:"{{count}} 次工具调用",waitingUser:"等待你的回答",blocked:"被阻塞:{{reason}}",paused:"已暂停,可恢复",evidence:"执行明细",phase:{analysis:"分析",implementation:"实现",optimization:"优化"}},hC={next:"下一步",idle:"空闲"},mC={title:"定时任务",subtitle:"按计划自动执行任务,也可随时手动触发。在任意对话中描述你想定期做的事,即可快速创建",refresh:"刷新",recommendedTitle:"推荐任务",mineTitle:"我的定时任务",new:"新建定时任务",tplMovieName:"每日电影推荐",tplMovieDesc:"给我推荐一部公认的经典电影(评分高、口碑好),简要介绍剧情梗概、亮点所在,以及它为什么值得一看。",tplMovieInstr:"给我推荐一部公认的经典电影(评分高、口碑好),简要介绍剧情梗概、亮点所在,以及它为什么值得一看。",tplHealthName:"健康任务提醒",tplHealthDesc:"发送健康提醒,内容包含「本次健康任务(喝水/起身/护眼)+ 今日已完成打卡次数 + 一句鼓励语」,语气轻松,不超过 50 字。",tplHealthInstr:"发送健康提醒,内容包含「本次健康任务(喝水/起身/护眼)+ 今日已完成打卡次数 + 一句鼓励语」,语气轻松,不超过 50 字。",tplWhyName:"十万个为什么",tplWhyDesc:"请随机生成一个新鲜有趣的冷门知识或生活常识话题,用「先提问、再解答」的方式呈现,选题避免重复。",tplWhyInstr:"请随机生成一个新鲜有趣的冷门知识或生活常识话题,用「先提问、再解答」的方式呈现,选题避免重复。",tplGitName:"工作日 Git 日报",tplGitDesc:"汇总当前工作区 Git 状态:昨日提交记录、未提交改动、当前分支与远端差异,生成一份简短日报。",tplGitInstr:"汇总当前工作区 Git 状态:昨日提交记录、未提交改动、当前分支与远端差异,生成一份简短日报。",emptyTitle:"暂无定时任务",emptyDesc:"创建定时任务来自动化执行周期性 AI 代理工作",createTitle:"新建定时任务",editTitle:"编辑定时任务",nameLabel:"任务名称",namePlaceholder:"如:每早 9 点汇总 Git 状态",scheduleLabel:"计划时间",instructionLabel:"任务指令",instructionsPlaceholder:"描述希望 agent 每次触发时执行的内容…",freqDaily:"每天",freqWeekly:"每周",freqWeekdays:"工作日",freqOnce:"仅一次",freqCustom:"自定义 cron",cancel:"取消",save:"保存",saving:"保存中…",edit:"编辑",enabled:"已启用",disabled:"已停用",enable:"启用",disable:"停用",runNow:"手动触发",delete:"删除",nextRun:"下次执行",badgeDaily:"每天 {{time}}",badgeWeekly:"每周{{day}} {{time}}",badgeWeekdays:"工作日 {{time}}",badgeOnce:"一次:",dow:{monday:"一",tuesday:"二",wednesday:"三",thursday:"四",friday:"五",saturday:"六",sunday:"日"},historyTitle:"运行历史",noRuns:"暂无运行记录",permissionsTitle:"作用域放行(tool target)",permissionsEmpty:"无。未放行的写操作需人工批准,超时后自动拒绝。",permissionPlaceholder:"如:write_file docs/report.md",add:"添加",attachmentsLabel:"附带文件",attachmentsHint:"随任务指令一起送入 agent 的文件路径(相对工作目录)",attachmentsEmpty:"暂未选择文件,点击 + 添加",attachmentsAdd:"添加文件",modelLabel:"使用模型",modelAuto:"跟随默认",modelNoModels:"暂无可用模型,先在「模型」页配置",connectorsLabel:"启用连接器",connectorsHint:"本次 run 临时启用的 MCP / LSP 连接器(不影响全局开关)",connectorsEmpty:"暂未选择连接器",channelsLabel:"通知频道",channelsHint:"任务完成后将结果投递到这些频道(不在此列出则忽略)",channelsEmpty:"暂未选择通知频道",workspaceLabel:"工作目录",workspaceHint:"任务执行时使用的工作目录,未设置则取当前会话工作目录",workspacePick:"选择目录",workspaceClear:"清除",fullAccessLabel:"允许完全访问",fullAccessHint:"开启后只读操作自动放行;写操作仍需进入「作用域放行」逐项授权",permissionAccess:"权限控制"},gC={searchPlaceholder:"搜索...",refresh:"刷新",collapse:"折叠",uploadTo:"上传到 {{dir}}",uploadToRoot:"上传到工作区根目录",setUploadDirHint:"点击设为上传目录并展开",download:"下载",backToList:"返回文件列表",modified:"已修改",discardConfirm:"「{{file}}」有未保存的修改,确定放弃吗?",saving:"保存中...",save:"保存",saved:"文件已保存",saveFail:"保存失败",readFail:"读取文件失败",downloadFail:"下载失败",downloadStarted:"已开始下载",uploadedCount:"已上传 {{count}} 个文件",uploadFailedCount:"{{count}} 个文件上传失败",selectFileHint:"选择文件以预览或编辑"},yC={title:"日志",backendLogs:"后台日志",streamTab:"实时日志流",files:"日志文件",clear:"清空",refresh:"刷新",refreshing:"刷新中...",noLogs:"暂无实时日志",noFiles:"暂无日志文件",preview:"预览",download:"下载",backToList:"返回文件列表",emptyFile:"(空文件)",totalLines:"{{count}} 行",showingLatest:"(显示最新 {{count}} 行)"},bC={installedTab:"已安装 ({{count}})",availableTab:"可安装 ({{count}})",searchPlaceholder:"搜索插件(名称 / id / 描述 / 标签)",clear:"清除",allCategories:"全部",marketFilterAll:"全部来源",marketFilterBuiltin:"内置",prevPage:"上一页",nextPage:"下一页",pageInfo:"第 {{page}} / {{pages}} 页 · 共 {{count}} 条",noMatch:"无匹配插件",emptyInstalled:"暂无插件 — 到「可安装」页从市场安装",emptyMarket:"市场暂无可用插件",applyProviderTitle:"把插件 provider preset 写入 ProviderConfigStore(用户授权)",activate:"激活",deactivate:"停用",uninstall:"卸载",installActivate:"安装并激活",installOnly:"仅安装",uninstallTitle:"卸载插件",uninstallConfirm:"确定要卸载 {{id}} 吗?插件文件将被删除(bundled 除外)。"},vC={starterTitle:"新工作流",starterNodeTitle:"任务",starterNodeDesc:"描述任务",sourceSaved:"沉淀",sourceScript:"脚本",sourceHandwritten:"手写",roleExplore:"探索",rolePlan:"规划",roleExecute:"执行",roleVerify:"校验",roleSummarize:"总结",roleGeneric:"通用",nodeParallel:"并行",nodePipeline:"顺序流水线",nodePhase:"阶段",nodeSynthesize:"综合",nodeCondition:"条件分支",nodeLoop:"循环",nodeCheckpoint:"检查点",nodeRetry:"自动重试",noNodes:"此工作流暂无节点。",filterAll:"全部",noMatchTemplates:"没有匹配的工作流",emptyTemplates:"暂无工作流。完成一次运行后可「保存为工作流」沉淀复用,或手工创建。",aiPromptRequired:"描述不能为空",aiDraftFailed:"AI 起草失败,请重试或改用手写",nameRequired:"工作流名称不能为空",jsonParseFailed:"JSON 解析失败:{{error}}",invalidDefinition:"definition 必须是含 nodes 数组的 WorkflowDefinition",createFailed:"创建工作流失败",loadFailed:"加载工作流失败",uncategorized:"其他",validateNoNodes:"节点列表为空",validateNodeNoId:"存在缺少 id 的节点",validateDupNodeId:"节点 id 重复:{{id}}",validateDanglingDep:"节点「{{node}}」依赖了不存在的节点「{{dep}}」",validateCycle:"节点依赖存在环",validateUndeclaredInput:"引用了未在 inputs 声明的占位符 <<input:{{name}}>>",savedVersion:"已保存(v{{version}})",saveFailed:"保存工作流失败",renderFailed:"预检渲染失败",selectTemplateHint:"从左侧选择一个工作流查看 / 编辑",loading:"加载…",deleteTemplate:"删除该工作流",categoryLabel:"分类(category)",descriptionLabel:"描述(description)",nodeCount:"{{n}} 个节点",topologyHint:"拓扑:串行 / 并行依赖",inputCount:"{{n}} 个输入参数",workflowNodes:"工作流节点",sortedByDeps:"按依赖拓扑排序",launchWithTemplate:"回放该工作流",testRun:"预检渲染",versionHistory:"版本历史",advancedJson:"高级(JSON)",refresh:"刷新",inputsSchemaLabel:"inputs(参数 schema,JSON)— 修改后保存会升版本",definitionLabel:"definition(WorkflowDefinition,JSON)",saveChanges:"保存修改",versionSnapshotLabel:"不可变版本快照(versions/{v}.json)",noVersions:"暂无版本记录",viewingVersion:"当前查看中",newTemplate:"新建工作流",searchPlaceholder:"搜索工作流…",viewing:"查看中",view:"查看",previewModalTitle:"预检「{{name}}」",launch:"启动",renderPreview:"渲染预览",renderSuccess:"预检渲染成功 — 产物 definition 可直接回放",nameLabel:"名称 *",namePlaceholder:"如:Triage Inbox",categoryField:"分类",descriptionField:"描述",aiDraftTab:"让 AI 起草",manualJsonTab:"手写 JSON",aiPromptLabel:"用一句话描述要做什么(AI 会拆成带角色的工作流节点)",aiPromptPlaceholder:"如:审查当前仓库代码的安全/性能/正确性,输出分级报告,全程只读",aiWorking:"AI 拆解中…",generateWorkflow:"生成工作流",aiTimeHint:"约 30-60s(推理模型可能更久),生成后可手动微调",newInputsLabel:"inputs(参数 schema,JSON,用 <<input:name>> 引用)",inputsExamplePlaceholder:'[{ "name": "folder", "label": "目录", "type": "folder", "required": true }]',cancel:"取消",create:"创建",deleteConfirm:"确定删除工作流「{{name}}」?该操作不可恢复。",delete:"删除",typeString:"文本",typeNumber:"数字",typeSelect:"选择",typeBoolean:"开关",typeFolder:"目录",typeConnector:"连接器",noInputsNeeded:"该工作流无需参数,直接回放。",starting:"启动中…",requiredError:"必填",numberError:"请输入数字",selectNone:"(不选)",newSession:"新建会话",newFromTemplateTitle:"用工作流新建",chooseTemplateAria:"选择工作流新建会话",backToList:"返回工作流列表",startSessionHeader:"开始一个会话",directChat:"直接对话",directChatHint:"不选工作流,AI 现场拆解任务(动态工作流)",loadingTemplates:"加载工作流…",noTemplatesYet:"暂无已保存工作流。",libraryMenu:"工作流…",workflowLibraryTitle:"工作流",workflowLibraryHint:"把一次工作流运行沉淀为可复用能力,之后一键回放。",manualCreate:"手工创建",manualCreateTitle:"手工创建工作流(原「新建模板」入口)",viewMode:"查看",backToView:"返回查看",replay:"回放",preflight:"预检",readonly:"只读",readonlyHint:"回放时不会修改任何文件",writable:"可修改文件",riskLow:"风险:低",riskMedium:"风险:中",riskHigh:"风险:高",confirmCount:"{{n}} 项确认",confirmCountNone:"无需确认",parallelCount:"{{n}} 步({{p}} 并行)",stepCount:"{{n}} 步",permissions:"权限",allowDuringReplay:"回放时允许",denyDuringReplay:"回放时禁止",toolWhitelist:"工具白名单",noToolsRestriction:"不限制工具(按会话权限)",exportJson:"导出为模板 JSON",copyId:"复制模板 ID",copied:"已复制",reRecordAsNew:"以此版本重录为新版本",reRecordHint:"不就地回滚:基于 v{{v}} 生成新版本",compare:"比较",more:"更多",degradedBadge:"剪辑不完整",statusDraft:"草稿",statusReady:"就绪",statusDeprecated:"已弃用",statusArchived:"已归档",overviewTab:"概览",flowTab:"流程",permissionsTab:"权限",historyTab:"历史",inputsNeeded:"回放时需要确认",autoDetected:"自动识别",manualInput:"手动输入",outputsProduced:"回放后得到",noOutputsDeclared:"(未声明产出)",replayDrawerTitle:"回放 {{name}}",replayStart:"开始回放 →",edit:"编辑",replayNewSession:"回放会新建会话并启动,可在对话中查看进度"},xC={taskBoard:{title:"任务看板"},card:{collapse:"折叠",expand:"展开",auto:"自动",unpin:"取消固定",pinKeep:"固定(不自动收起)",pin:"固定",close:"关闭此小组件"},workflow:{fallbackTitle:"工作流",statusRunning:"运行中",statusCompleted:"完成",statusFailed:"失败",statusSkipped:"跳过",statusBlocked:"等待",statusPending:"待执行",resume:"恢复",pause:"暂停",cancel:"取消",retryCount:"重试 {{n}} 次",waitingFor:"等待 {{name}}",retryNode:"重试",skipNode:"跳过",recoverFromCheckpoint:"从 checkpoint 重跑",recap:"复盘",recapLine:"复盘:{{text}}",recapAllDone:"✓ 全部完成",recapAllFailed:"✗ 全部失败",recapFailedNodes:"✗{{n}} {{names}}",recapRetried:"↻{{n}} 重试",recapSlowest:"最慢 {{name}} {{duration}}",recapTotalDuration:"总耗时 {{duration}}",recoverHint:"失败 {{n}} · 可逐节点重试/跳过",resultSucceeded:"全部完成",resultFailed:"执行失败",resultCancelled:"已取消",retriedCount:"重试 {{n}} 次"},dwf:{offerFallbackTitle:"动态工作流",promotableSentence:"已验证 {{n}} 次,可保存为可复用模板"},agentFlow:{statusPaused:"已暂停",statusRunning:"运行中",statusCompleted:"完成",statusFailed:"失败",statusIdle:"空闲",moreAgents:"+{{count}} 个 Agent",eventLog:"事件日志({{count}})"},plan:{title:"AI 计划",fallbackTitle:"工作流计划",stepCount:"{{count}} 步",moreSteps:"+{{count}} 步",dependsOn:"依赖 {{count}} 步",start:"开始执行",change:"更换流程",changeHint:"取消此方案,换个说法重新描述",cancelTitle:"取消工作流",cancel:"取消",runtime:"引擎运行",runtimeHint:"在 WorkflowRuntime 中运行(重型出口)"}},wC={drawerCollapseTitle:"折叠抽屉,查看消息",drawerExpandTitle:"展开抽屉,做出选择",openFile:"打开 ›"},kC={viewChat:"会话",viewTrajectory:"轨迹",viewToggleTitle:"切换会话 / 轨迹视图",toolbar:{duration:"时长",actualDuration:"按记录时长显示时间轴块",equalWidth:"按等宽显示时间轴块",turns:"轮次",calls:"调用",collapseTurns:"折叠所有轮次",expandTurns:"展开所有轮次",collapseCalls:"折叠所有工具调用",expandCalls:"展开所有工具调用",search:"搜索轨迹",searchPlaceholder:"搜索轨迹…"},errorBanner:{title:"检测到错误",expand:"展开错误明细",collapse:"收起错误明细",viewLogs:"查看日志",dismiss:"关闭提醒(出现新错误时重新提醒)"}},f4={common:P9,nav:z9,chat:$9,shortcuts:F9,palette:H9,a11y:U9,plan:G9,whatsnew:q9,settings:V9,models:W9,tools:K9,skills:Y9,hook:Z9,step:X9,toolCall:Q9,slashCommands:J9,error:eC,toast:tC,assistants:nC,channels:aC,fileJob:rC,reconnect:sC,fileMenu:iC,autoAccess:oC,git:lC,errorCard:cC,connectors:uC,time:dC,stt:pC,activity:fC,taskbar:hC,automation:mC,fileTree:gC,logs:yC,plugins:bC,templates:vC,widgets:xC,commonUi:wC,trajectory:kC},SC={desktopDownloadTitle:"下載桌面用戶端 · {{os}}",desktopDownloadRecommend:"推薦下載桌面端",desktopDownloadOtherPlatforms:"下載其他平台的用戶端",desktopDownloadMenu:"更多下載選項",desktopDownloadOsWindows:"Windows",desktopDownloadOsMacos:"macOS",desktopDownloadOsLinux:"Linux",desktopDownloadOsAndroid:"Android",desktopDownloadOsIos:"iOS",desktopDownloadOsUnknown:"你的裝置",desktopDownloadYourSystem:"你的系統 · {{os}}",desktopDownloadOtherSystems:"其他系統",desktopDownloadTrouble:"下載不順?",desktopDownloadViaMirror:"經鏡像下載({{host}})",desktopDownloadViaMirrorToast:"直連不通,已改用鏡像下載",desktopDownloadOpenRelease:"開啟 Release 頁面",desktopDownloadFromMirror:"鏡像",desktopDownloadSize:"約 {{size}}",desktopDownloadHandToAi:"讓 AI 幫我下載安裝",desktopDownloadHandToAiDesc:"一句提示詞寫進輸入框,按 Enter 送出",desktopDownloadHandToAiHint:"已把下載安裝指令寫入輸入框,按 Enter 即可送出",desktopDownloadArmHint:"暫無 ARM 原生安裝檔,上面是 x64 版本",desktopDownloadMacUnsignedHint:"首次安裝需右鍵 →「打開」(目前安裝檔未做程式碼簽章)",desktopDownloadMobileHint:"行動裝置裝不了桌面用戶端,已為你開啟下載頁",desktopDownloadMobileMenuHint:"行動裝置無對應安裝檔,可在下方選擇其他系統",desktopDownloadLoading:"正在取得安裝檔清單…",desktopDownloadFetching:"正在取得安裝檔網址…",desktopDownloadUnavailable:"安裝檔網址暫不可用,已為你開啟下載頁",desktopDownloadPrompt:"請幫我在本機下載並安裝 DeepSeekCode 桌面用戶端(目前系統:{{os}})。安裝檔網址:{{url}};若該網址無法連線,請依序嘗試鏡像:{{mirrors}}。安裝完成後告訴我如何啟動。",desktopDownloadPromptNoMirror:"無"},_C={language:"語言",languageAuto:"跟隨系統",languageHint:"切換後同步到服務端設定,AI 將以所選語言回覆(下一輪對話生效);不約束其內部思考語言。選「跟隨系統」時依瀏覽器語言自動適配。"},CC={chat:SC,settings:_C},AC={confirm:"Confirm",cancel:"Cancel",save:"Save",saving:"Saving...",delete:"Delete",close:"Close",refresh:"Refresh",retry:"Retry",loading:"Loading...",collapse:"Collapse",expand:"Expand",clear:"Clear",noData:"No data",noResults:"No results",unknown:"Unknown",unknownError:"Unknown error",connecting:"Connecting…",back:"Back",send:"Send",copy:"Copy",copied:"Copied",search:"Search...",filter:"All",pageInfo:"Showing {{start}}-{{end}} of {{total}}",prevPage:"Previous",nextPage:"Next",enabled:"Enabled",disabled:"Disabled",online:"Online",offline:"Offline",busy:"Busy",away:"Away",default:"Default"},TC={chat:"Chat",models:"Models",tools:"Tools",skills:"Skills",templates:"Workflows",hooks:"Hooks",agentFlow:"Agent Flow",settings:"Settings",logs:"Logs",channels:"Channels",assistants:"Assistants",sessions:"Sessions",collapseSidebar:"Collapse sidebar",expandSidebar:"Expand sidebar",moreOptions:"More",scheduled:"Scheduled",plugins:"Plugins",mySessions:"My sessions",sessionRunning:"Running",sessionWaiting:"Awaiting confirmation",sessionFailed:"Failed",sessionDone:"Completed",sessionEnded:"Ended",connectors:"Connectors",pin:"Pin to top",unpin:"Unpin",pinMore:"Pin 'More' to top",unpinMore:"Unpin 'More'",clearSessionSearch:"Clear session search",searchSessions:"Search sessions",searchSessionsPlaceholder:"Search sessions...",showMoreSessions:"Show more",collapseGroup:"Collapse",expandGroup:"Expand",openFolder:"Open folder",newTask:"New task",sessionActions:"Session actions",groupActions:"Project actions"},EC=JSON.parse(`{"newSession":"New Session","forkSession":"Fork session (fork-original name, full context)","forkSessionFailed":"Failed to fork session","newSessionInWorkspace":"New session in this workspace","sessionTabs":"Sessions in this workspace","noSessions":"No sessions yet","renameSession":"Rename session","exportMd":"Export as Markdown","you":"You","thinkingEllipsis":"Thinking…","messageRail":"Message navigation","messageIndex":"Conversation index","backToBottom":"Back to latest","generatingPlaceholder":"AI is generating… you can still type — Enter will queue the message","pasteExpand":"Click to expand pasted text","pasteCollapse":"Collapse pasted text","pasteOriginal":"Pasted text","defaultSessionTitle":"Chat {{n}}","start":{"greetingDawn":"Up late","greetingMorning":"Good morning","greetingNoon":"Good afternoon","greetingAfternoon":"Good afternoon","greetingEvening":"Good evening","withName":"{{greeting}}, {{name}}","question":"What can I help you with?","categoriesLabel":"Starting categories","more":"More scenarios","hide":"Hide frequent","show":"Show frequent","profileOn":"Replying in {{name}}'s style","profileAnonymous":"No profile configured","profileEdit":"Edit","profileHint":"Your profile sets how it addresses you and talks to you — click to edit","frequentTitle":"Frequent","categoryTitle":"{{label}} · tasks","frequentHint":"Tasks you use, star, or write yourself show up here","frequentEmpty":"Nothing here yet — hit New above to write one, or pick a category and star a task","customAdd":"New","customLabelPlaceholder":"Name (optional — defaults to the start of your prompt)","customPromptPlaceholder":"Write the prompt you want to keep…","customSave":"Save","customCancel":"Cancel","selectedHint":"Click × on the tag to clear","clearCategory":"Clear {{label}} selection","addFavorite":"Add {{label}} to Frequent","removeFavorite":"Remove {{label}} from Frequent","categories":[{"id":"code","label":"Code","scenarios":[{"id":"code-arch","label":"Architecture","hint":"Modules, boundaries, dependencies","prompt":"Analyze this repository's architecture: describe the main modules, their responsibilities and boundaries, and the dependency direction, then draw a module dependency graph."},{"id":"code-debug","label":"Debug","hint":"From the error back to root cause","prompt":"I ran into this error:\\n\\nGive me the minimal reproduction first, then the root cause, then explain why it triggers."},{"id":"code-test","label":"Add tests","hint":"Boundaries and failure paths","prompt":"Add tests for this logic: cover the main branches and boundaries (empty, extremes, over-limit), and state what behavior each case pins down."},{"id":"code-refactor","label":"Refactor safely","hint":"Split without changing behavior","prompt":"This file is too large: propose a split by responsibility with a risk assessment, implement it after confirmation, and keep external behavior unchanged."}]},{"id":"doc","label":"Documents","scenarios":[{"id":"doc-prd","label":"Product spec","hint":"Goals, scenarios, acceptance","prompt":"Write a product requirements document: background and goal, core scenarios, scope boundaries, acceptance criteria, and what we are explicitly not doing."},{"id":"doc-report","label":"Weekly report","hint":"Progress, risks, next week","prompt":"Write a project weekly report: based on the real changes in this repository, summarize this week's progress, risks, and next week's plan."},{"id":"doc-minutes","label":"Meeting notes","hint":"Decisions and owners","prompt":"Turn this meeting into notes: extract the decisions and disagreements, list action items with owners, and cite the evidence for each."},{"id":"doc-handover","label":"Handover notes","hint":"State of play at a glance","prompt":"Write handover notes: the current state, the decisions already made and why, open issues, and the recommended first step for whoever takes over."}]},{"id":"data","label":"Data","scenarios":[{"id":"data-attr","label":"Metric attribution","hint":"Explain a metric move","prompt":"A core metric moved: list the possible causes, verify them one by one, output the attribution with evidence, and flag the hypotheses you cannot rule out."},{"id":"data-ab","label":"A/B test","hint":"Is the difference significant","prompt":"Analyze this A/B result: state the test used, whether the sample is large enough, the confidence interval, and whether to roll it out."},{"id":"data-clean","label":"Data cleaning","hint":"Missing values and outliers","prompt":"Clean this dataset: handle missing values and outliers, explain each rule and how many rows it affects, and keep a reproducible processing log."},{"id":"data-chart","label":"Charts","hint":"Right chart, honest labels","prompt":"Turn this data into charts: pick suitable chart types, label the key readings and the definitions behind them, and avoid misleading encodings."}]},{"id":"design","label":"Design","scenarios":[{"id":"design-proto","label":"Prototype","hint":"Turn a flow into screens","prompt":"Turn this flow into a clickable prototype: cover the happy path and the failure paths, and note the input, output and state of each step."},{"id":"design-visual","label":"Visual direction","hint":"Color, hierarchy, layout","prompt":"Propose a visual direction: color, hierarchy and typography rules, with the reasoning on contrast and readability, plus two alternative directions."},{"id":"design-copy","label":"Copy polish","hint":"Sharpen the value proposition","prompt":"Polish this copy: sharpen the value proposition and the differentiation, and give three variants in different tones."},{"id":"design-name","label":"Naming","hint":"Options and reasoning","prompt":"Name this feature: offer candidates with reasoning, and check for clashes with existing concepts and how easy they are to say and remember."}]},{"id":"workflow","label":"Workflows","scenarios":[{"id":"workflow-archive","label":"Save as template","hint":"Turn this run into a workflow","prompt":"Turn this run into a reusable workflow template: extract the nodes and parameters worth reusing, and mark which are inputs and which need human confirmation."},{"id":"workflow-replay","label":"Replay","hint":"Re-run with new inputs","prompt":"Replay this workflow with new inputs: first list what will change and what will not, then report the diff against the previous run."},{"id":"workflow-graph","label":"Decompose","hint":"Nodes and dependencies","prompt":"Break this repeated process into workflow nodes: define each node's input, output and order, and flag the parts that can run in parallel."},{"id":"workflow-guard","label":"Failure handling","hint":"Retries and confirmations","prompt":"Add failure handling to this workflow: which nodes may retry automatically, which must stop and wait for my confirmation, and how to recover afterwards."}]},{"id":"auto","label":"Automation","scenarios":[{"id":"auto-organize","label":"Tidy up","hint":"Script to sort files by type","prompt":"Write a script that organizes the files in this directory by type: show the plan and the blast radius first, then run it after confirmation."},{"id":"auto-schedule","label":"Scheduled check","hint":"Run this check daily","prompt":"Turn this check into a scheduled task: run it once a day automatically, and summarize the reasons for me when it fails."},{"id":"auto-scrape","label":"Scrape and summarize","hint":"Web data into a table","prompt":"Scrape data from the given pages and summarize it into a table: state the sources, the field definitions, and what happens when a scrape fails."},{"id":"auto-ci","label":"Build and release","hint":"One repeatable command","prompt":"Turn build and release into one repeatable command: state the preconditions of each step and how to abort safely when it fails."}]},{"id":"proj","label":"Teamwork","scenarios":[{"id":"proj-sync","label":"Sync status","hint":"Done and still open","prompt":"Sync the current status: review what is done and what is still open, and state what the next step is."},{"id":"proj-todo","label":"Triage tasks","hint":"Dedupe, rank, flag blockers","prompt":"Triage the todos in this session: dedupe them, rank by priority, and flag blockers and dependencies."},{"id":"proj-risk","label":"Risk warning","hint":"What will slip, and why","prompt":"Assess the risks in this plan: flag what is most likely to slip and under what conditions, and what can be done now to hedge."},{"id":"proj-retro","label":"Retrospective","hint":"Lessons worth reusing","prompt":"Run a retrospective: which judgments were wrong, what should become a standard, and give actionable improvements."}]}]},"quickCommands":"View quick commands","inputPlaceholder":"Type a message... Shift+Enter for newline, / commands, @ file refs, ! shell, ↑ history","nearLimit":"Near limit","shiftEnter":"Shift+Enter newline","escHint":"Keep typing to queue while replying · Esc revoke/pause · Double-Esc stop","bangHint":"! run command","shellRunning":"Running…","shellExitCode":"exit code {{code}}","shellNoExitCode":"finished (no exit code)","shellTimedOut":"timed out","shellTruncated":"output truncated","shellNoOutput":"(no output)","shellRequestFailed":"Failed: {{message}}","shellRequestFailedGeneric":"request failed","queuedCount":"{{count}} queued — sent when this reply ends","queuedEscHint":"Esc revoke","queuedRevoke":"Revoke all queued messages","queuedSendNow":"Jump to front — sent first when this reply ends","queuedEdit":"Edit in input box","queuedDelete":"Delete this queued message","queuedEmptyPreview":"(attachments only, no text)","sendQueuedBtn":"Send (queued)","resume":"Resume","resumeGen":"Resume generation","stop":"Stop","stopGen":"Stop generation","pause":"Pause","pauseGen":"Pause generation","sendBtn":"Send","connected":"Connected","disconnected":"Disconnected","sessionHistory":"Session History","removeFromHistory":"Remove from history","removeFromList":"Remove from list","openFolderFailed":"Failed to open folder","viewAllSessions":"More sessions","sessionPickerTitle":"Select session","clickToOpenSession":"Open session","clickToSwitchDir":"Click to switch working directory","noTasks":"No tasks, add one above","taskBoardDragHint":"Drag down to expand · drag up to collapse · click to toggle","deleteTask":"Delete task","effort":"Effort","effortOff":"Thinking off","effortLow":"Low","effortMedium":"Medium","effortHigh":"High","effortExtraHigh":"Extra high","effortMax":"Max","noWorkspaceDir":"No working directory","recentDirs":"Recent directories","noRecentDirs":"No recent directories","chooseOtherDir":"Choose another directory…","dirPickerTitle":"Select working directory","dirPickerEnterPath":"Type a full path and press Enter","dirPickerGo":"Go","dirPickerUp":"Up","dirPickerNoDirs":"No subdirectories","dirPickerConfirm":"Select this directory","dirPickerLoadError":"Failed to load directory","viewOverview":"Overview","viewWorkspaceFiles":"Workspace files","viewChanges":"Changes","workspaceHint":"Browse the workspace file tree; click a file to edit it in place, use \\"Back\\" to return.","artifactHint":"Click a file/path link in the chat to preview it here — drag the panel edge to resize, or use the maximize button in the corner","previewInPanel":"Preview","backToArtifacts":"Back to list","openInNewTab":"Open in new tab","copyPath":"Copy path","copiedPath":"Path copied","copyPathFailed":"Failed to copy","filePreviewHint":"This file type can't be previewed inline — download it or open it in a new tab.","outline":"Outline","outlineClose":"Close outline","previewTabPage":"Page","changesTitle":"Changes","switchPanelView":"Switch panel view","changesHint":"Click a file to see its line-level diff. Changes come from the git work tree, including the agent's edits.","viewAllArtifacts":"View all artifacts ({{n}})","viewAllChanges":"View all changes ({{n}})","diffRenderCapped":"Patch too long — rendering the first {{rendered}} lines ({{dropped}} more omitted)","previewTabCode":"Source","copySource":"Copy source","closeTab":"Close","codeRenderError":"Code highlighting failed; showing as plain text.","sidebarArtifacts":"Overview","sidebarOpen":"Open","sidebarOpenFolder":"Open first output file","sidebarMaximize":"Maximize","sidebarRestore":"Restore size","previewPopOut":"Pop out preview","sidebarWorking":"Working on this…","sidebarWorkingWithAgents":"Working ({{n}} agent(s) running)…","sidebarWorkingToolcalls":"Working ({{n}} tool call(s))…","sidebarIdle":"Progress for multi-step tasks shows up here: planning, tool calls, approvals, and produced files.","sidebarRunningAgents":"{{n}} agent(s) running","sidebarToolcallsSoFar":"{{n}} tool call(s) so far","tokenRateTitle":"Live output rate (estimated: CJK ≈1.5 tok/char, other ≈0.25 tok/char — the provider sends no per-chunk token counts)","tokenRateIdle":"Tool running, no streaming output right now — the spinner is at its slowest; live tok/s resumes once output streams","totalChars":"Total chars","avgTokens":"Avg tokens/msg","estimatedCost":"Est. cost: \${{cost}}","contextManager":"Context Manager","taskBoard":"Task Board","morePending":"{{n}} more pending...","toolResult":"Tool result: ","memory":"Memory: ","fileReadError":"Failed to read file","clickToSwitchMode":"Click to toggle mode (Plan → Goal → Act)","selectModel":"Select model","clickToSelectModel":"Select model / reasoning effort","desktopDownloadTitle":"Download desktop app · {{os}}","desktopDownloadRecommend":"Get the desktop app","desktopDownloadOtherPlatforms":"Download for another platform","desktopDownloadMenu":"More download options","desktopDownloadOsWindows":"Windows","desktopDownloadOsMacos":"macOS","desktopDownloadOsLinux":"Linux","desktopDownloadOsAndroid":"Android","desktopDownloadOsIos":"iOS","desktopDownloadOsUnknown":"your device","desktopDownloadYourSystem":"Your system · {{os}}","desktopDownloadOtherSystems":"Other platforms","desktopDownloadTrouble":"Download trouble?","desktopDownloadViaMirror":"Download via mirror ({{host}})","desktopDownloadViaMirrorToast":"Direct download unreachable — switched to a mirror","desktopDownloadOpenRelease":"Open the release page","desktopDownloadFromMirror":"mirror","desktopDownloadSize":"~{{size}}","desktopDownloadHandToAi":"Let the AI download & install it","desktopDownloadHandToAiDesc":"Puts a one-line prompt in the input box","desktopDownloadHandToAiHint":"Instruction added to the input box — press Enter to send","desktopDownloadArmHint":"No ARM-native build yet — the entries above are x64","desktopDownloadMacUnsignedHint":"Right-click → Open on first launch (build is unsigned)","desktopDownloadMobileHint":"Desktop apps can't be installed from mobile — opening the download page","desktopDownloadMobileMenuHint":"No mobile build; pick another platform below","desktopDownloadLoading":"Loading installers…","desktopDownloadFetching":"Resolving the download URL…","desktopDownloadUnavailable":"Download URL unavailable — opening the release page","desktopDownloadPrompt":"Please download and install the DeepSeekCode desktop client on this machine (current OS: {{os}}). Installer URL: {{url}}; if it is unreachable, try these mirrors in order: {{mirrors}}. Tell me how to launch it when done.","desktopDownloadPromptNoMirror":"none","noEnabledModels":"No enabled models","globalDefault":"Global default","planDefault":"Plan default","actDefault":"Act default","goalDefault":"Goal default","followGlobalDefault":"Follow global default","followGlobalDefaultHint":"Clear this mode's default and fall back to the global default","sessionModel":"Session","sessionModelTitle":"Session-scoped model override (global default unchanged)","noGlobalDefault":"No global default","browseMoreModels":"Browse more models…","backToModels":"Back to models","selectProvider":"Select provider","searchModels":"Search models…","loadingModels":"Loading models…","noModelsFound":"No matching models","noProviderModels":"No models available for this provider","noConfiguredProviders":"No providers configured","addAndSwitch":"Add & switch","alreadyAdded":"Added","addingModel":"Adding…","currentModel":"Current","loadModelsFailed":"Failed to load models","addModelFailed":"Failed to add model","switchModelFailed":"Failed to switch model","modelsSourceProviderApi":"Fetched live from provider API","modelsSourceCatalog":"From model catalog (models.dev)","assistantLabel":"DeepSeekCode","thoughtProcess":"Thought process","runningSteps":"Running","stepCount":"step","copyMessage":"Copy","regenerate":"Regenerate","deleteMessage":"Delete message","messageDeleted":"Message deleted","thinking":"Thinking","askAnswerPlaceholder":"Type your answer...","askAnswered":"✓ Answered","askAutoContinue":"⏱ Auto-continue with the recommended option in {{seconds}}s if unanswered","askBackToEdit":"Back to edit","askBatchTitle":"Batch confirmation","askConfirmQuestion":"Confirm this question","askCustomDesc":"Enter a custom answer","askCustomTag":"(custom)","askDirectTag":"(continue directly)","askEmptyInputValue":"(no input)","askEnterHint":"Enter to submit, Shift+Enter for newline","askFinishQuestion":"Finish question ({{count}} selected)","askMultiHintBatch":"Click options to check them, then click \\"Finish question\\" to submit; \\"Proceed\\" means continue by AI judgment","askMultiHintSingle":"Click options to check them, then click \\"Submit selected\\" to submit; \\"Proceed\\" means continue by AI judgment","askNextQuestion":"Next","askNotAnswered":"Not answered","askOtherLabel":"Other (I'll explain)","askPendingBadge":"Pending","askPrevQuestion":"Previous","askProceedDesc":"Don't pick a specific option — continue with your best judgment","askProceedLabel":"Proceed","askReviewTitle":"Review answers","askSingleHintBatch":"Click an option to answer and move on, or click \\"Confirm this question\\" to submit the highlighted option","askSingleHintSingle":"Click an option to submit immediately, or click \\"Submit\\" below to confirm the current option","askSingleTitle":"Please answer","askSubmit":"Submit","askSubmitAll":"Submit all answers","askSubmitSelected":"Submit selected ({{count}})","askSubmitting":"Submitting...","askSubmitRetry":"No confirmation from the server (connection may be lost). You can submit again or close.","askUnansweredValue":"(not answered)","askUnansweredWarning":"{{count}} question(s) unanswered — they will be recorded as \\"Not answered\\". Click a question number above to go back and edit.","askViewSubmit":"Review & submit","assemblyOrderHint":"In backend context assembly order (top→bottom): system prompt → system tools → MCP tools → skills → messages → other (estimated gap)","avgCacheHitRate":"Avg cache hit rate","byAssemblyOrder":"By assembly order ↓","cacheHitTitle":"Cache hit {{hit}} / miss {{miss}} ({{calls}} calls)","cacheNoStats":"No cache stats yet (provider did not report prompt_cache_hit/miss fields)","cacheWaitingRun":"Run in progress — waiting for provider cache stats","categoryBreakdown":"Category breakdown","contextCapacity":"Context capacity","ctxMcpTools":"MCP tools","ctxMessages":"Messages","ctxOther":"Other","ctxSkills":"Skills","ctxSystemPrompt":"System prompt","ctxSystemTools":"System tools","ctxMemory":"Memory","ctxSkillDiscovery":"Skill discovery","ctxBudget":"Budget","enterInsertMulti":"Enter to insert · multi-select supported","fileMentionHelpMulti":"↑↓ Select · Enter insert (multi-select) · Esc close","finishMention":"Done","lastCompactInfo":"Last compact: {{orig}}→{{comp}} · {{saved}} tok","mentionFilesGroup":"Files","mentionSessionsGroup":"Sessions","mentionTabFiles":"Files","mentionTabSessions":"Sessions","mentionTabUnknownDir":"Unknown dir","mentionTabHint":"Tab / Shift+Tab switch","mentionStatusRunning":"running","mentionStatusIdle":"idle","mentionStatusPaused":"paused","mentionStatusError":"error","mentionStatusStopped":"stopped","mentionMsgCount":"{{count}} msgs","mentionScopeLabel":"Scope: ","mentionScopeActive":"active","mentionScopeAll":"all","mentionScopeHint":"Shift+S switch scope (active = running + a client attached; all = including history)","mentionEmptySessions":"No session has a client attached right now. Press S for all","mentionDeliveryLabel":"Delivery: ","mentionDeliveryEnqueue":"queue","mentionDeliveryNextStep":"adjust turn","mentionDeliveryDirect":"direct","mentionDeliveryHint":"Shift+M switch delivery (queue = a new turn when the target is idle; adjust turn = injected into the target's current turn, only while it is running; direct = send straight to the target without this session's model, files not allowed)","mentionDeliveryChip":"@{{titles}} · {{mode}}","observedTitle":"Observed sessions","observedRunning":"running","observedDone":"done","observedFailed":"failed","agentProgress":{"title":"Agents","running":"{{count}} running","paused":"{{count}} paused","more":"+{{count}} more"},"noMatchingFiles":"No matching files","searchingFiles":"Searching files...","selectedCountShort":"Selected {{n}}","selectedFilesCount":"{{n}} files selected","unitWan":"×10K","unitYi":"×100M","viewContextDetail":"View context capacity details","loading":"Loading…","applyScopeGlobal":"Global","applyScopeSession":"This session","sessionScopeHint":"Applies to this session only; global default unchanged","globalScopeHint":"Writes the global/mode default model (affects all sessions)","sessionModelNoSession":"No active session — cannot apply a session-scoped model switch"}`),NC={title:"Keyboard Shortcuts",commandPalette:"Open command palette",clearLogs:"Clear logs",help:"Show shortcuts help",submit:"Submit input",newline:"New line",closeDialog:"Close dialog / pause generation",slashCommand:"Quick commands",fileRef:"Reference files",shellCommand:"Run a command",skillRef:"Invoke a skill",stopGen:"Stop generation (double Esc)",screenshot:"Capture screenshot as image attachment"},RC={placeholder:"Search commands or jump to panel...",empty:"No matching commands",hint:"↑↓ Select · Enter Run · Esc Close",running:"Running..."},DC={openMenu:"Open menu",closeMenu:"Close menu",close:"Close",expand:"Expand",collapse:"Collapse",delete:"Delete",remove:"Remove",send:"Send message",newSession:"New session",connectionStatus:"Connection status",loading:"Loading",commandPalette:"Command palette"},MC={mode:"Mode",planMode:"Plan Mode — Read-only analysis",actMode:"Act Mode",autoMode:"Auto mode: auto-approve tool calls",goalMode:"Goal Mode",autoApprove:"Auto Approve",modeLocked:"Locked: explicitly chosen by you; auto-eval will not override it",modeSuggestionTitle:"Router suggests switching mode",modeSuggestionApply:"Switch to {{mode}}",modeSuggestionKeep:"Keep {{mode}}",modeSuggestionConfidence:"confidence",planContent:"Plan file content",analyzing:"Analyzing requirements..."},OC={title:"What's New"},LC={title:"Settings",searchPlaceholder:"Search settings...",noResults:"No matching settings",nav:{general:"General",appearance:"Appearance",profile:"Profile",voice:"Voice",models:"Models & Providers",connectors:"Connectors",context:"Context",configFiles:"Config Files",network:"Network access",system:"System",about:"About"},network:{description:"Controls who can open this web UI. By default only this machine (localhost) can reach it. Turn the switch on and any device on the same LAN (Wi-Fi / Ethernet) — phone, tablet, a colleague's laptop — can open the address below and use the same agent.",toggleLabel:"Allow LAN access",toggleHint:"While off, the server binds 127.0.0.1 only, so other devices cannot connect.",stateLocal:"Now: this machine only",stateLan:"Now: reachable on the LAN",addresses:"Addresses",noLanAddress:"No LAN interface address found (loopback only)",copy:"Copy",copied:"Copied",warningTitle:"Before you turn this on",warning:"Anyone on the same network who opens these addresses can use the AI agent on this machine — including reading/writing files and running commands. Only enable it on a network you trust.",noTokenHint:"No API token is set (DEEPSEEKCODE_API_TOKEN). With one set, LAN clients must supply the token to connect.",tokenHint:"API token is set: LAN clients must supply the token to connect.",lockedByHost:"The listen address is pinned by the --host startup argument ({{host}}) and cannot be changed here. Remove --host (or DEEPSEEKCODE_HOST) and restart to use this switch.",lockedByEnv:"This switch is controlled by the {{env}} environment variable and cannot be changed at runtime (edit the env and restart).",confirmEnable:`Allow LAN access?
|
|
34
|
+
|
|
35
|
+
Other devices on the same network will be able to open this machine's web UI and use the same AI agent (file read/write, command execution).
|
|
36
|
+
|
|
37
|
+
Only enable it on a network you trust.`,confirmDisable:`Turn off LAN access?
|
|
38
|
+
|
|
39
|
+
Devices on the LAN will be disconnected immediately and will not be able to reconnect (this machine is unaffected).`,pendingHint:"Rebinding the listener (about 1 second); this page will briefly disconnect and reconnect automatically…",enabledToast:"LAN access enabled — this page will reconnect automatically",disabledToast:"LAN access disabled — this machine only",applyFailed:"Switch failed and was rolled back",rollback:"Switch failed; rolled back automatically",loadFailed:"Failed to read network settings"},groups:{general:"General",features:"Features",system:"System"},profile:{title:"Profile",hint:"A stable self-description the model reads on every turn. Unlike memory: it never expires, is never relevance-filtered, and is never rewritten automatically.",enabled:"Inject into conversations",enabledHint:"When on, the text below is added as <user_profile> to every system prompt.",path:"File location",exists:"Created",missing:"Not created yet",size:"{{used}} / {{max}} bytes",truncated:"Over the limit — the excess will not be injected.",empty:"No profile yet. Click Edit to write down how you want to be addressed, your habits, and what you work on.",edit:"Edit",clear:"Clear",clearConfirm:"Delete the profile file? This cannot be undone.",name:"Preferred name",namePlaceholder:"How the model should address you (optional)",body:"Profile content",bodyPlaceholder:"e.g. I'm Wang Lihua, a backend engineer. Lead with the conclusion and code, skip the backstory.",save:"Save",saving:"Saving…",cancel:"Cancel",loading:"Loading…",saveOk:"Saved",saveFailed:"Save failed",clearOk:"Deleted",clearFailed:"Delete failed",loadFailed:"Failed to load"},theme:"Theme",themeDark:"🌙 Dark",themeLight:"☀️ Light",themeAuto:"🔄 Auto",themePresets:"Theme Presets",themePresetLinear:"Linear (minimal)",themePresetLinearDesc:"Neutral grays with a single accent — clean and focused",themePresetMimo:"Mimo (warm paper)",themePresetMimoDesc:"Warm off-white paper with ink-toned text — soft and understated",themePresetGithub:"GitHub",themePresetGithubDesc:"Neutral dark/light — clean and professional",themePresetCherry:"Cherry Studio",themePresetCherryDesc:"Blue gradient inspired — clean tech feel",themePresetOcean:"Ocean",themePresetOceanDesc:"Deep blue/cyan — calm and professional",themePresetMint:"Mint",themePresetMintDesc:"Teal/mint green — fresh and refreshing",themePresetLavender:"Lavender",themePresetLavenderDesc:"Soft purple — elegant and sophisticated",themePresetMidnight:"Midnight",themePresetMidnightDesc:"Deep navy — minimal and high contrast",themePresetSunset:"Sunset",themePresetSunsetDesc:"Warm orange/golden — energetic",themePresetForest:"Forest",themePresetForestDesc:"Natural green — earthy and calm",themePresetCandy:"Candy",themePresetCandyDesc:"Bright multi-color — vibrant and lively",themePresetNord:"Nord",themePresetNordDesc:"Arctic blue — popular well-designed palette",customOverrides:"Custom Overrides",customOverridesHint:"Tweak individual colors to override the active preset",colorBg:"Background",colorSurface:"Surface",colorBorder:"Border",colorText:"Text",colorMuted:"Muted Text",colorAccentBlue:"Accent Blue",colorAccentGreen:"Accent Green",colorAccentRed:"Accent Red",colorAccentYellow:"Accent Yellow",colorAccentPurple:"Accent Purple",resetColors:"Reset to default",about:"About",aboutDesc:"Web-based AI coding assistant interface",whatsNew:"What's New",language:"Language",languageZh:"中文",languageEn:"English",languageAuto:"Follow system",languageHint:'Synced to the server config on change — the AI will reply in the selected language (takes effect next turn); internal reasoning language is not constrained. "Follow system" adapts automatically to your browser language.',display:"Display",developerView:"Developer view (expand all raw details)",developerViewHint:"Chronological stream by default with finished steps auto-collapsed; enable to keep raw details expanded",capabilities:{title:"Agent Capabilities",loadFailed:"Failed to load capabilities",toggleFailed:"Toggle failed"},contextOffload:{title:"Context Offload (Artifact Store)",desc:"Large tool outputs are stored on disk as artifacts instead of living in the context forever. Only a summary + handle stays in context; the AI retrieves details on demand via artifact_query / artifact_read. This significantly reduces token usage in long sessions and improves cache hit rate.",enableLabel:"Enable tool-result offloading",currently:"currently",maxTotalMb:"Max total storage (MB)",ttlDays:"Retention (days)",outboundBytes:"Spill threshold (bytes; outputs larger are offloaded)",turnBudget:"Per-turn context growth budget (tokens)",dir:"Storage directory",optional:"optional, defaults to config dir",stats:"{{count}} artifacts stored, {{size}} MB total",saved:"Context Offload settings saved",saveFailed:"Failed to save",invalidNumber:"Number fields must be positive integers",envHint:"Fields marked ⚠ env are overridden by environment variables of the same name"}},jC={title:"Model Configuration",providerConfig:"Provider Config",configured:"Configured",notConfigured:"Not configured",apiKeyHint:"API Key configured. Enter new key to overwrite.",apiKeyDefaultPlaceholder:"sk-...",removeConfirm:'Are you sure you want to remove "{{providerKey}}" configuration? This will delete its API Key and models.',loadFailed:"Failed to load models",saveFailed:"Save failed",overallStatus:"Overall Status",healthy:"Healthy",degraded:"Degraded",abnormal:"Abnormal",healthRate:"Health Rate",onlineInstances:"Online Instances",totalRequests:"Total Requests",configuredModels:"Configured Models",globalShort:"Global",setDefaultProvider:"Set as default provider",deleteProviderConfirm:'Delete the configuration for "{{key}}"?',deleteProvider:"Delete provider",catalogTitle:"models.dev Catalog Search",catalogSearchPlaceholder:"Search models across providers, e.g. gpt-4o / deepseek / claude... (matches model id, name, or provider)",catalogOnlyToolCall:"Tool call only",catalogOnlyReasoning:"Reasoning only",searching:"Searching...",catalogNoResults:"No matching models — try another keyword",badgeReasoning:"Reasoning",badgeToolCall:"Tools",badgeMultimodal:"Multimodal",ctxLimit:"Context {{k}}K",outLimit:"Output {{k}}K",catalogAddTitle:"Add to model ID input",add:"Add",catalogSourceHint:'Source: models.dev model catalog (built-in snapshot, works offline). Click "Add" to write the model ID into the Model ID input.',autoRemovedMissingModels:"Auto-removed models missing on server: {{models}}",autoSkippedMissingModels:"Auto-skipped models missing on server: {{models}}",defaultModelDisableBlocked:"Cannot disable {{name}}: switch the default model to another one first",deleteModelConfirm:"Remove model {{id}} from configuration?",connectionSuccessWithHints:"{{message}}. {{hints}}.",hintJoiner:"; ",loadingProviders:"Loading...",addProvider:"Add Provider",collapse:"Collapse",refreshList:"Refresh list",none:"None",availableCount:"{{n}} available",configuredCount:"{{n}} models",editProviderNamed:"Edit {{name}}",deleteProviderNamed:"Delete {{name}}",globalDefault:"Global default",planDefault:"Plan default",actDefault:"Act default",goalDefault:"Goal default",setPlanDefaultTitle:"Set as Plan default",setGoalDefaultTitle:"Set as Goal default",unsetPlanDefaultTitle:"Unset Plan default (falls back to global default)",unsetGoalDefaultTitle:"Unset Goal default (falls back to global default)",outputPrice:"Output price",inputPrice:"Input price",outputTokensLabel:"Output tokens",inputTokensLabel:"Input tokens",totalTokensLabel:"Total tokens",tokenUsageLabel:"Cumulative tokens",usageRequestsLabel:"Requests",connectionSuccess:"Connected",baseUrlAutoCompleted:"Base URL auto-completed to {{url}}",apiTypeAutoSelected:"API type auto-selected as {{type}}",hasKey:"Key set",noKey:"No key",defaultShort:"Default",overrideBadge:"Override",overrideTitle:"Manually overridden model list",customBaseUrl:"Custom base URL",catalogSearch:"Search catalog models",close:"Close",apiTypeHint:"Leave empty to auto-detect protocol from Base URL",modelApiTypeLabel:"API type (catalog models)",modelApiTypeHint:"Response protocol for catalog models; defaults to provider setting",modelApiTypeEmpty:"No API types available in this catalog",addCustomProvider:"Add custom provider",configuredPanelPrefix:"Configured ",configuredPanelSuffix:" models",configuredPanelHint:"(applies instantly, two-way synced with Model IDs input)",fetchedPanelPrefix:"Fetched ",fetchedPanelMiddle:" models, selected ",fetchedPanelSuffix:"",fetchedPanelHint:"(checked models will be written into the Model IDs input)",searchMatchPrefix:"Matched ",searchMatchSuffix:" of {{total}}",fetchingModels:"Fetching...",fetchModels:"Fetch model list",baseUrlRequired:"Base URL is required",apiKeySanitized:"API Key contains invalid characters; filtered automatically",fetchedCount:"Fetched {{n}} models",fetchFailed:"Failed to fetch model list. Check Base URL and API Key",requestFailed:"Request failed",connectionFailed:"Connection failed",catalogSearchFailed:"Catalog search failed",addedModel:"Added {{id}}",operationFailed:"Operation failed, please retry",providerNameRequired:"Provider name is required",apiKeyRequired:"At least one API Key is required",defaultsAutoUpdated:"Default models updated automatically",unknownError:"Unknown error",loading:"Loading...",providerListRefreshed:"Provider list refreshed",refreshFailed:"Refresh failed, please try again later",refreshListTitle:"Refresh provider list from remote",providerSearchPlaceholder:"Search providers / models...",clear:"Clear",clearSearch:"Clear search",noMatchingProviders:"No matching providers",noMatchingProvidersHint:'No provider matches "{{query}}". Check the spelling or use the full list',noModelsInProvider:"No models in this provider",noDefaultModel:"No default model",defaultProviderBadge:"Default provider",loadLabel:"Load",setGlobalDefaultTitle:"Set as global default",setPlanDefaultFailed:"Failed to set Plan default",unsetPlanDefaultFailed:"Failed to unset Plan default",setGoalDefaultFailed:"Failed to set Goal default",unsetGoalDefaultFailed:"Failed to unset Goal default",editModel:"Edit model",deleteModel:"Delete model",refresh:"Refresh",reset:"Reset",enable:"Enable",disable:"Disable",actIsGlobalHint:'Global default = Act default (merged), so no separate "Set as Act default" is offered',globalDefaultUnsettable:"Global default cannot be cleared (the active session must always have an effective model)",emptyHint:"No models yet. Configure a provider above first",selectProvider:"Select provider",customProvider:"Custom provider",customProviderDesc:"Manually enter provider name, Base URL and model IDs",editExistingConfig:"Edit existing configuration (optional)",newCustomProviderOption:"+ New custom provider",editExistingConfigHint:"Starts empty by default; pick a saved configuration to refill the form (API Keys are never echoed back; leave empty to keep the saved key).",providerNameLabel:"Provider name *",providerNamePlaceholder:"e.g. my-provider",apiKeysHintConfigured:", leave empty to keep the saved key",apiKeysHintNew:"(multiple allowed; first is used at runtime, rest are fallbacks)",addApiKey:"Add key",addApiKeyTitle:"Add another API Key",removeApiKeyTitle:"Remove this API Key",showKeyTitle:"Show key",hideKeyTitle:"Hide key",modelIdLabel:"Model IDs",modelIdPlaceholder:"gpt-4o, deepseek-chat (format: id|name|alias)",fetchModelsTitle:"Fetch model list from API",testConnectionTitle:"Probe endpoint connectivity, auto-detect API type and fix Base URL",testingConnection:"Testing...",testConnection:"Test connection",catalogSearchTitle:"Search the models.dev catalog (context/pricing/capability metadata included)",modelSearchPlaceholder:"Search models...",fullPathLabel:"Full path (no auto-appending of /chat/completions, /responses, /v1/messages)",fullPathHint:"When enabled, the Base URL is used as-is (e.g. https://host/v1/chat/completions); the backend will not transform it.",apiTypeLabel:"API type",apiTypeAutoDetect:"Auto-detect (recommended)"},BC={title:"Tool List",searchTools:"Search tools...",disabled:"Disable",enabled:"Enable",params:"Parameters",loadFailed:"Failed to load tools",noTools:"No tools available",loading:"Loading...",retry:"Retry",refresh:"Refresh",invalidData:"Invalid tool data format returned by server",edit:"Edit",save:"Save",cancel:"Cancel",saving:"Saving...",saveFailed:"Failed to save",reset:"Reset to default",resetDone:"Restored defaults",resetFailed:"Failed to restore defaults",overridden:"Modified",defaultOff:"Off by default",userInstalled:"Installed",userInstalledHint:"From an MCP server or plugin you installed. This toggle only controls loading — turning it off is not uninstalling. To uninstall, use the plugin / connector management page.",toggleFailed:"Failed to toggle",exportConfig:"Export config",importConfig:"Import config",exportDone:"Exported {{count}} tool override(s)",exportEmpty:"No custom configuration to export",importDone:"Imported {{count}} tool override(s)",importUnknown:"{{count}} entry(ies) unknown to this version were kept in the config file",importFailed:"Import failed: {{error}}",importInvalid:"The file is not valid JSON",importEmpty:"The file contains no usable tool configuration",importTitle:"Import tool configuration",importDesc:"Found {{count}} entry(ies). Choose how to import:",importMerge:"Merge",importMergeHint:"Keep settings for tools not mentioned in the file",importReplace:"Replace",importReplaceHint:"Clear current settings and keep only the file contents",importPath:"Config file: {{path}}",groupBy:"Group by",groupByCategory:"Category",groupByRisk:"Risk",groupByState:"State",groupUncategorized:"Uncategorized",groupEnabled:"{{on}}/{{total}} enabled",enableGroup:"Enable all",disableGroup:"Disable all",expandAll:"Expand all",collapseAll:"Collapse all",noMatch:"No matching tools",riskLow:"Low risk",riskMedium:"Medium risk",riskHigh:"High risk",riskCritical:"Critical risk",riskUnknown:"Unrated",planLocked:"Unavailable in plan (read-only) mode",usageHint:"Usage guidance",fieldName:"Display name",fieldDescription:"Description",fieldCategory:"Category",fieldEnabled:"Enabled",namePlaceholder:"Leave empty for the default name",descriptionPlaceholder:"Leave empty for the default description",categoryPlaceholder:"Leave empty for the default category",totalTools:"{{count}} tools",enabledCount:"{{count}} enabled",saved:"Saved",exportFailed:"Export failed",profileMinimalHint:"Minimal profile is active: {{off}} tools are off by default. Enable the ones you need — toggles are saved to the config file.",groupPartial:"{{failed}} of {{total}} failed to toggle",descriptionHint:"The description is sent to the model's tool list; changes affect tool selection. Leave empty for the default.",cat:{agent:"Sub-agents",browser:"Browser automation",code_intelligence:"Code intelligence",communication:"Communication",computer:"Desktop control",context:"Context management",filesystem:"Filesystem",git:"Version control",mcp:"MCP extensions",media:"Media",metacognition:"Planning & reflection",network:"Network access",planning:"Task planning",remote:"Remote triggers",search:"Search",system:"System & meta",task:"Task board",team:"Team collaboration",terminal:"Terminal execution",utility:"Utilities",workspace:"Workspace"}},IC={title:"Skills Manager",list:"Skill List",noSkills:"No skills available",loadFailed:"Failed to load skills",loadFailedFallback:"Load failed",enable:"Enable",disable:"Disable",enabled:"Enabled",disabled:"Disabled",new:"New Skill",import:"Import",importTitle:"Import Skill",edit:"Edit",save:"Save",cancel:"Cancel",retry:"Retry",refresh:"Refresh",tags:"Tags",none:"None",source:"Source",systemPrompt:"System Prompt",fieldId:"ID",fieldName:"Name",fieldCategory:"Category",fieldTrigger:"Trigger",fieldTools:"Tools",description:"Description",saving:"Saving",chooseFile:"Choose skill file",importHint:"Supports `.skill.md` files.",marketplace:"Marketplace",addMarketplace:"Add Marketplace",marketplaceUrlPlaceholder:"GitHub repo / index.json link / local skills folder, e.g. https://github.com/obra/superpowers or D:\\agent\\agentic-awesome-skills",marketplaceName:"Marketplace name (optional)",marketplaceHint:"Supports GitHub repos (auto-scans skills/ dir), an index.json URL, or a local skills folder (fully offline — browse & install from disk). If GitHub is unreachable, set the DEEPSEEKCODE_GITHUB_MIRROR env var to a mirror prefix.",marketFilterPlaceholder:"Search skills in this marketplace...",marketCategoryAll:"All categories",riskCritical:"High risk",riskUnknown:"Risk unknown",refreshMarketplace:"Refresh",removeMarketplace:"Remove",installSkill:"Install",installed:"Installed",installFail:"Install failed",loadMarketplaceFail:"Failed to load skill marketplace",noMarketplaces:"No marketplaces yet — add one",noSkillsInMarket:"No skills in this marketplace",marketplaceError:"Marketplace index failed to load: {{error}}",retryMarket:"Retry",presets:"Built-in marketplaces",marketplaces:"Added marketplaces",skillCount:"{{count}} skills",addFail:"Failed to add marketplace",installing:"Installing...",adding:"Adding...",marketplaceTab:"Marketplace",mineTab:"My Skills",installedTab:"Installed",workshopTab:"Workshop",workshopHint:"Skill proposals: generated from sessions or manually, apply as skills after review",workshopPropose:"New Proposal",workshopName:"Skill name (skill-name) e.g. format-json",workshopTrigger:"Trigger keywords (optional)",workshopDescription:"One-line description",workshopContent:"Skill body (system prompt / workflow instructions)",workshopSubmit:"Submit",workshopApply:"Apply",workshopEmpty:"No skill proposals yet",workshopFormRequired:"Skill name and content are required",uninstall:"Uninstall",uninstallConfirm:'Uninstall installed skill "{{name}}"?',uninstallFail:"Uninstall failed",pagePrev:"Prev",pageNext:"Next",pageOf:"Page {{page}} / {{total}}",emptyInstalled:"No marketplace skills installed yet",emptyInstalledHint:"Head to the Marketplace tab to browse and install",browseMarket:"Go to Marketplace",use:"Use",useHint:"Insert $skill into the input box, then add your task and send",pickTitle:"Pick a Skill",pickPlaceholder:"Search skills...",pickEmpty:"No usable skills",pickUse:"Use it"},PC={hookApproval:"Hook Interception Approval",morePending:"{{n}} more pending",tool:"Tool: ",reason:"Reason: ",allow:"Allow",deny:"Deny",autoMode:"Auto Mode",moreOptions:"More options",highRiskWarning:"This action may cause irreversible effects, please confirm carefully",mediumRiskConfirm:"Please confirm this is the intended action",alreadyAllowed:"Allowed: ",alreadyDenied:"Denied: ",risk_critical:"Destructive operation - may delete data",risk_critical_cmd:"High-risk command - system-level operations",risk_high_shell:"Shell command execution",risk_high_file:"File write operation",risk_high_pkg:"Package management operation",risk_git:"Git operation",risk_network:"Network request",risk_low:"Read-only operation",risk_default:"Tool call",optionAllow:"Allow — execute this operation",optionAllowHint:"Click or press Enter to confirm",optionDeny:"Deny — cancel this operation",optionDenyHint:"Click or press Esc to cancel",optionAllowAlways:"Allow always this session",optionAllowAlwaysHint:"Don't ask again for {{tool}}",optionAllowPathHint:"Don't ask again for this external path",timeoutWaitUser:"waiting for user (no timeout)",optionAutoMode:"Auto mode — allow all hooks",optionAutoModeHint:"All future hooks will be auto-approved",shortcutHint:"Shortcuts: 1-4 select · Enter allow · Esc deny",lastItem:"Last item",clickToSelect:"Click to select · 1/2/3/4 keyboard shortcuts",verbRunCommand:"Run command",verbWriteFile:"Write file",verbEditFile:"Edit file",verbReadFile:"Read file",verbDeleteFile:"Delete file",verbFindFiles:"Find files",verbSearchContents:"Search contents",verbFetchUrl:"Fetch URL",verbSearchWeb:"Search web",verbGit:"Git operation",verbInstall:"Install package",verbSendMessage:"Send message",verbRunTool:"Run operation",scopeLocal:"acts on this workspace",scopeExternal:"external path",showAllLines:"Show all {{n}} lines",showAll:"Show the full message",showLess:"Show less",importMergeConfirm:`Merge into the existing configuration?
|
|
40
|
+
"OK" = merge / "Cancel" = replace`,configTitle:"Hook Configuration",configDesc:"Attach interceptors to lifecycle events such as tool execution and task transitions for approvals and custom logic",import:"Import",export:"Export",newRule:"New Rule",ruleList:"Rules",ruleCount:"{{n}} rules",implShell:"Shell script",implShellDesc:"Run an external script; receives JSON via stdin and returns a decision via stdout",implHttp:"HTTP endpoint",implHttpDesc:"POST JSON to an external endpoint",implPromptDesc:"Send a single-turn prompt to the LLM for risk assessment",implAgentDesc:"Launch a read-only sub-agent for deep investigation",stepBasicTitle:"Basic Info",stepBasicDesc:"Name, description, events",stepImplTitle:"Implementation",stepImplDesc:"Execution type and parameters",stepAdvancedTitle:"Advanced",stepAdvancedDesc:"Priority, filters, testing",editRule:"Edit: {{name}}",addRule:"Add Hook Rule",fieldName:"Name *",fieldDescription:"Description",descriptionPlaceholder:"What this hook does...",fieldEvents:"Events *",eventsSelected:"{{n}} selected",searchEventsPlaceholder:"Search events...",toggleAllEvents:"Select all / none",fieldImplType:"Implementation type *",fieldCommand:"Command *",fieldPromptTemplate:"Prompt template *",promptTemplatePlaceholder:"You are a security audit expert. Please analyze the following tool call...",selectAgentPlaceholder:"Select agent...",agentReadOnlyHint:"The agent runs in read-only mode (Read/Grep/Glob) and cannot modify files",fieldPriority:"Priority",fieldTimeout:"Timeout (ms)",labelEnabled:"Enabled",failOpenLabel:"Fail-open (allow on timeout)",fieldToolFilter:"Tool filter (regex, optional)",dryRunResultTitle:"Dry-run result",dryRunDecision:"Decision: ",dryRunReason:"Reason: ",dryRunOutput:"Output: ",dryRunButton:"Dry Run",prevStep:"Previous",nextStep:"Next",saveChanges:"Save Changes",createRule:"Create Rule",noRules:"No hook rules yet",noRulesHint:'Click "New Rule" in the top-right corner to create your first hook',batchDeleteConfirm:"Delete {{n}} selected rules?",selectedItems:"{{n}} selected",enableAll:"Enable all",disableAll:"Disable all",colName:"Name",colEvents:"Events",colType:"Type",colStatus:"Status",colActions:"Actions",clickToDisable:"Click to disable",clickToEnable:"Click to enable",actionEdit:"Edit",deleteRuleConfirm:'Delete rule "{{name}}"?',statTotal:"Total rules"},zC={pending:"Waiting",thinking:"Thinking",action:"Action",result:"Result",running:"Running",error:"Error",completed:"Completed",params:"Parameters",screenshot:"Screenshot"},$C={linesTotal:"… ({{n}} lines total)",expandAll:"Expand all ({{n}} lines)",collapse:"Collapse"},FC={quickCommands:"Quick Commands",search:'Search: "{{filter}}"',help:"↑↓ Select · Enter Execute · Esc Close",backend:"Backend",backendCommand:"Backend command",chat_desc:"Switch to chat panel",chat_result:"Switched to chat panel",files_desc:'Open "Workspace files" on the right',files_result:"Opened the workspace files panel",models_desc:"Switch to model panel",models_result:"Switched to model panel",tools_desc:"List available tools",tools_result:"Switched to tool panel",skills_desc:"List available skills",skills_result:"Switched to skills panel",settings_desc:"Switch to settings panel",settings_result:"Switched to settings panel",logs_desc:"Switch to logs panel",logs_result:"Switched to logs panel",new_desc:"Create new session",new_result:"New session created",clear_desc:"Clear current session messages",clear_result:"Messages cleared",theme_desc:"Toggle theme (dark/light/auto)",theme_error:"Usage: /theme <dark|light|auto|{{presets}}>",theme_result:"Theme switched to ",theme_preset_result:"Theme preset switched to ",theme_preset_unavailable:"Theme preset switching not available",logs_clear_desc:"Clear logs",logs_clear_result:"Logs cleared",doctor_desc:"System diagnostics (Config/API Key/Network/Docker/Disk)",compact_desc:"Compact current session context",help_desc:"Show all quick commands",review_desc:"Code review — check correctness, security, and code quality",security_review_desc:"Security review — OWASP Top 10 + command injection/path traversal/privilege escalation",memory_desc:"Manage AI persistent memory (list/add/delete/clear)",ps_desc:"View and manage background tasks, sub-agents, and shell processes",model_desc:"View or switch AI models",status_desc:"Show current session status (session ID/message count/model/working directory)",config_desc:"Manage application configuration (get/set/list/delete)",exit_desc:"Exit application",exit_result:"Shutting down...",benchmark_desc:"Run DeepSeekCode capability benchmark (simple/medium/complex/full/list)",goal_desc:"Set a goal for multi-step work",goal_list_desc:"List active goals",goal_status_desc:"Show goal progress",workflow_list_desc:"List workflow runs",workflow_status_desc:"Show workflow status",workflow_checkpoints_desc:"List workflow checkpoints",mcp_desc:"List or reload MCP servers",sessions_desc:"List sessions",resume_desc:"Resume a session by id",permissions_desc:"Show permission rules and pending approvals",init_desc:"Generate agent.md project guidance file",self_test_desc:"Run tool capability self-test and generate a report",context_desc:"Show context analysis report",version_desc:"Show version information","check-update_desc":"Check for available updates",upgrade_desc:"Upgrade to the latest version",acceptance_desc:"Run or inspect acceptance workflows (quick/full/list/report)",diff_desc:"View uncommitted git changes in the workspace",summary_desc:"Summarize the current session conversation",effort_desc:"Show or set reasoning effort level (low|medium|high)",export_desc:"Export the current conversation as JSON",rename_desc:"Rename the current session",hooks_desc:"Show active hook configurations",sent_command:"Command sent: ",noActiveSession:"No active session",unknownCommand:"Unknown command {{cmd}} — type /help to see available commands"},HC={pageError:"Page error",unknownError:"An unknown error occurred, please try refreshing the page",refreshPage:"Refresh page",genEnded:"Generation ended (tool execution timeout or connection lost)",genEndedWs:"Generation ended (connection lost; your answer could not be delivered and will be re-sent after reconnect)",genEndedStopped:"Stopped (user stopped or sent a new message)"},UC={backendConnected:"Backend connected",backendDisconnected:"Backend disconnected, reconnecting...",paused:"Paused, press ESC again to stop",terminated:"Stopped (ESC×2)",queueRevoked:"Revoked {{count}} queued message(s)",queuePromoted:"Moved to front — sent first when this reply ends",queueRemoved:"Deleted 1 queued message",terminatedQueued:"Stopped — dropped {{count}} queued message(s)",uncaughtError:"Uncaught error: ",uncaughtRejection:"Uncaught Promise rejection: ",unknownReason:"Unknown reason"},GC={title:"Channel Assistants",loading:"Loading assistants…",loadFailed:"Failed to load assistants",empty:"No assistants yet",emptyHint:"Once a channel is enabled and configured, the first DM or group @ automatically creates its assistant",goChannels:"Configure channels",openSession:"Open session",selectHint:"Pick a channel conversation from the list to see it here",policy:"Trigger policy",group:"Group",dm:"DM",groupPolicy:"Group trigger: {{mention}}",mode:{label:"Mode",delegate:"Delegate",direct:"Direct"},mentionRequired:"Require @ mention",cooldown:"Cooldown",keywords:"Keywords (comma-separated, escape hatch without mention)",keywordsPlaceholder:"e.g. bot, assistant",trust:{public:"Public",team:"Team",owner:"Owner"},status:{idle:"Idle",running:"Running",paused:"Paused",error:"Error",complete:"Done",stopped:"Stopped",interrupted:"Interrupted"}},qC={title:"Channel Management",subtitle:"Connect external IM platforms to interact with AI via WeChat, Feishu, DingTalk, etc.",table:{name:"Channel Name",type:"Type",appId:"App ID",status:"Status",enabled:"Enabled",actions:"Actions",emptyHint:'Click "New Channel" in the top right to connect WeChat, Feishu or DingTalk'},status:{connected:"Connected",disconnected:"Disconnected",connecting:"Connecting",error:"Error"},empty:"No channels configured yet",emptyHint:'Click "New Channel" to add an IM platform bot',form:{name:"Channel Name",namePlaceholder:"e.g. Office Group Bot",type:"Channel Type",credentials:"Credentials",appId:"App ID",appSecret:"App Secret",token:"Token",encodingAESKey:"EncodingAESKey",enabled:"Enable Channel",namePlaceholderDev:"e.g. Dev Group Bot",leaveBlankUnchanged:"Leave blank to keep unchanged",appSecretValue:"App secret",tokenCallback:"Callback verification token",optionalShort:"Optional",wechatIlinkHint:"The WeChat iLink bot authorizes via QR scan; credentials can be left empty — just save and scan to log in.",enabledOffHint:"Sending and receiving messages stops when disabled"},actions:{edit:"Edit",delete:"Delete",deleteConfirm:"Are you sure you want to delete this channel?",test:"Test Connection",save:"Save Channel",cancel:"Cancel",refresh:"Refresh",qrLogin:"QR Login",deleteConfirmShort:"Delete this channel?"},errors:{loadFailed:"Failed to load channels",createFailed:"Failed to create channel",notFound:"Channel not found",notImplemented:"Not implemented",nameRequired:"Channel name is required"},qr:{title:"WeChat QR Login",generating:"Generating QR code...",waiting:"Scan the QR code with WeChat",scanned:"Scanned, please confirm on your phone",confirmed:"Login successful",expired:"QR code expired",error:"Failed to get QR code",openInNewTab:"Open in new tab"},typeLabels:{wechat:"WeChat",feishu:"Feishu",dingtalk:"DingTalk",telegram:"Telegram",discord:"Discord",slack:"Slack",signal:"Signal",whatsapp:"WhatsApp",line:"LINE",qqbot:"QQ Bot",matrix:"Matrix",mattermost:"Mattermost",msteams:"Teams",googlechat:"Google Chat",irc:"IRC"},viewSubtitle:"Connect WeChat, Feishu and DingTalk so users can send tasks via channels and receive progress and results in real time",experimentalLabel:"Experimental",experimentalShort:"Exp",experimentalTip:"Experimental implementation, features may be incomplete",experimentalDesc:"This channel is a basic adapter wrapper supporting basic message send/receive; some advanced features may be incomplete",pluginMissingLabel:"Plugin missing",pluginMissingWarning:'The plugin for this channel type is not installed or activated, so instances cannot start. Go to the "Plugins" page, install and activate the{{name}}plugin, then retry.',selectTypeHint:"Select a channel type on the left",instancesCount:"{{n}} configured instances",notConfiguredYet:"Not configured yet",createInstance:"New Instance",createShort:"New",selectInstance:"Select Instance",emptyWithType:"No {{type}} configured yet",wechatBindHint:"Click the button below and scan the QR code with WeChat to bind automatically",startWithCreate:'Click "New Instance" above to start configuration',scanToBind:"Scan to Bind",qrLoginReauth:"QR Login / Re-authorize",editConfig:"Edit Config",createConfig:"New Config",save:"Save",saving:"Saving...",unknownError:"Unknown error",retry:"Retry",bindSuccess:"Bound successfully",bindTitle:"Scan to Bind · {{name}}",startUsing:"Start Using",clickToRefresh:"Click to refresh",connectedReady:'"{{name}}" is connected and ready to use',createdConnectedReady:"WeChat channel created and connected, ready to use",waitingAuthorize:"Scan the QR code with WeChat to authorize the bot",scannedConfirming:"Scanned, please confirm on your phone...",confirmedClosing:"Bot authorized and started, closing automatically soon",connectingIlink:"Connecting to iLink service...",openInNewTabFallback:"Open in new tab (fallback)",toastReauthSuccess:'WeChat "{{name}}" re-authorized successfully, channel connected',toastBindSuccess:"WeChat bound successfully, channel created and connected automatically",pollFailedRefresh:"Too many polling failures, please refresh the QR code and retry",pollFailedToast:"Failed to poll WeChat binding status, please refresh the QR code and retry",qrDataMissing:"QR code data missing: {{data}}",fetchWechatQrFailed:"Failed to get WeChat QR code: {{error}}",sidebar:{title:"Channels",configuredCount:"{{n}} configured",clickToConfigure:"Click a channel below to start configuration",configuredMissing:"Configured · plugin missing",unconfigured:"Not configured",empty:"No channel plugins installed",emptyHint:"Channel types appear here after you install their plugins from the Plugins page",partialConnected:"{{connected}}/{{count}} connected"},categories:{im:"Instant Messaging",international:"International",eastAsia:"East Asia",collaboration:"Collaboration Platforms",classic:"Classic Protocols",other:"Others",builtin:"Built-in",plugins:"Plugin Extensions"}},VC={stageUploaded:"Pending",stageParsing:"Parsing data file",stageMapping:"Template mapping",stageRendering:"Generating file",stageComplete:"File processing complete",stageError:"File processing failed",parsing:"Parsing {{file}}…",parsedSummary:"{{rows}} rows · {{fields}} fields",mappingTitle:"Template ↔ data field mapping",templatePlaceholder:"Template placeholder",dataField:"Data field",mappingMore:"{{n}} more mappings",rendering:"Generating {{current}}/{{total}}…",download:"Download",downloadFailed:"Download failed",error:"Processing failed",roleData:"Data file",roleTemplate:"Template file",attach:"Upload files or images (multi-select supported)",dropHint:"Drop to add attachments",unsupportedType:"Unsupported file type: {{name}}",fileTooLarge:"File too large: {{name}} (≤50MB)",duplicateFile:"Duplicate file: {{name}}",maxAttachments:"Up to {{n}} files at a time",uploadFailed:"Upload failed",stillUploading:"Attachments are still uploading, please wait…",importFailed:"Import files failed",kindText:"Text",moreRows:"+{{n}} rows",rowsDone:"{{done}}/{{total}} rows",rowsFailed:"{{n}} rows failed",imagePreview:"Image preview",openInPanel:"Preview in side panel",imageN:"Image {{n}}",screenshot:"Capture screen (choose a screen, window, or tab)",screenshotFailed:"Screenshot failed"},WC={reconnecting:"Reconnecting {{attempt}}/{{max}}",hint:"Reconnecting to backend…"},KC={aria:"File actions",preview:"Preview",openExternal:"Open with default app",openFailed:"Failed to open",reveal:"Reveal in File Explorer",revealFailed:"Failed to reveal",addToChat:"Add to Chat",copyPath:"Copy Path",copied:"Path copied",noComposer:"Open a session first",download:"Download",downloadFailed:"Download failed"},YC={title:"Full access (auto-approve) is on",desc:"The agent can edit files and run commands without confirmation. Risk of data loss.",dismiss:"Dismiss for now",neverShow:"Don't show again"},ZC={notGitDesc:"The current working directory is not a Git repository; change stats are unavailable.",refresh:"Refresh",clean:"Working tree clean",branch:"Branch",loading:"Loading…",filesChanged:"File changes",backToList:"Back to changes",fullFile:"Whole file",changedLines:"Changed lines",binary:"Binary file — no text diff to show",noDiff:"No diff for this file",stagedBadge:"staged",untrackedBadge:"new file",scopeSession:"This session",scopeAll:"All",scopeHintSession:"Only files changed by the current session",scopeHintAll:"All uncommitted changes in the workspace",sessionClean:"This session hasn't changed any files yet"},XC={retry:"Retry",details:"Details",modelSettings:"Model settings"},QC={notInstalled:"Not installed",installed:"Installed",ready:"Ready",connecting:"Connecting",installing:"Installing…",error:"Error",disabled:"Disabled",toolCount:"{{count}} tools",docs:"Docs",official:"Official",cloud:"Cloud",local:"Local",needCredentials:"This connector needs credentials to start:",connect:"Connect",missing:"missing",envConfigured:"credentials set",searchPlaceholder:"Search connectors (name, id, description)…",all:"All",noResults:"No connectors match your search/filter.",custom:"Custom",addCustom:"Add custom",customTitle:"Add custom MCP server (from awesome-mcp-servers or your own)",customName:"Name (id)",customCommand:"Command",customArgs:"Args (space separated)",customEnv:"Env (KEY=value, comma separated)",customUrl:"MCP endpoint URL",customHeaders:"Headers (KEY=value, comma separated)",customLocal:"Local command",customFormRequired:"Name and command/URL are required.",removeCustom:"Remove this custom connector",add:"Add"},JC={justNow:"just now",minutesAgo:"{{count}}m ago",hoursAgo:"{{count}}h ago",daysAgo:"{{count}}d ago"},eA={title:"Voice input (Chinese: FunASR / other languages: whisper)",stopTitle:"Stop recording and transcribe",generatingTitle:"Recording unavailable while generating",langToggle:"Speech recognition language",multiHint:"Chinese uses FunASR; others use faster-whisper; auto-detects if unsupported",noSpeech:"No speech detected, please try again",backendMissing:"STT service not ready — opened settings to guide installation",setup:{title:"Voice Service",envCard:"Environment check",envChecking:"Checking…",recheck:"Re-check",pythonOk:"Python {{version}} ready",pythonMissing:"Python not detected. Please install Python 3.10+ first",pythonGuide:"Download Python",pipOk:"pip available",pipMissing:"pip is missing. Install pip first, then install the speech engine",whisperTitle:"Whisper · English & multilingual",whisperDesc:"English speech recognition",funasrTitle:"FunASR · Chinese",funasrDesc:"Chinese speech recognition",installed:"Installed",notInstalled:"Not installed",install:"Install",installing:"Installing…",cancel:"Cancel install",installDone:"Install complete — voice input is ready",installFailed:"Install failed",installTimeout:"Install timed out",installCancelled:"Install cancelled",jobInProgress:"An install task is already running, taking over its progress",manualCommand:"Manual install command",copyCommand:"Copy",copySuccess:"Copied to clipboard",copyFailed:"Copy failed",torchHint:"Chinese engine requires torch — large download, please wait",logWaiting:"Preparing install…",chooseHint:"Environment ready — pick an engine above to install",defaultEngine:"Default recognition engine",defaultEngineHint:"Choose the default engine for voice input. You can switch anytime in the chat input.",inUse:"In use",engineNotInstalledHint:"This engine is not installed yet. Recording will guide you to install it.",probeError:"Dependency check failed: ",installDoneButMissing:"Install command finished, but the engine is still unavailable",installDoneButMissingHint:"The voice service was restarted and re-checked automatically. If it still fails, run the manual command below in a terminal to diagnose (common cause: torch incompatible with system DLLs).",pipGuide:"Install Python (with pip) first, then restart the app and retry."},sources:{title:"Download sources",hint:"Engine packages and model weights are fetched from overseas sources by default (PyPI / HuggingFace / ModelScope). On slow networks you can switch to a mirror: the pip source decides where the one-click install pulls packages from, and the model endpoints decide where the first transcription downloads weights from.",loading:"Loading…",badgeCustom:"{{count}} customized",pipIndexUrl:"pip index",pipExtraIndexUrl:"pip extra index",proxy:"Proxy",hfEndpoint:"HuggingFace endpoint",modelscopeEndpoint:"ModelScope endpoint",phPipIndex:"https://pypi.org/simple",phPipExtra:"Leave empty to omit (used to merge multiple indexes)",phProxy:"http://127.0.0.1:7890",phHub:"Leave empty to use the official source",preset:"Preset",save:"Save",reset:"Reset to defaults",saved:"Download sources saved",saveFailed:"Failed to save",resetDone:"Reset to the default sources",envTitle:"This value comes from the environment variable {{name}}, which takes precedence over this setting — edit your shell config to change it",warning:"A third-party source is enabled: it decides which packages get installed on this machine. Make sure you trust the source.",privateBlocked:"Private-host blocking is on (settings.security.allowPrivateHosts is false) — intranet sources will be rejected. Only the proxy field is exempt.",httpsOnly:"Sources must use https (proxy may be http/socks5)"}},tA={verb:{researching:"Analyzing code",coding:"Editing code",validating:"Running checks",summarizing:"Wrapping up"},title:{withFile:"{{verb}} {{file}}",withCount:"{{verb}} · {{count}} items"},toolCallCount:"{{count}} tool calls",waitingUser:"Waiting for your answer",blocked:"Blocked: {{reason}}",paused:"Paused — resumable",evidence:"Execution details",phase:{analysis:"Analysis",implementation:"Implement",optimization:"Optimize"}},nA={next:"Next",idle:"Idle"},aA={title:"Scheduled Tasks",subtitle:"Run tasks on a schedule, or trigger manually anytime. Describe what you want done regularly to create one quickly",refresh:"Refresh",recommendedTitle:"Recommended",mineTitle:"My Scheduled Tasks",new:"New Scheduled Task",tplMovieName:"Daily Movie Pick",tplMovieDesc:"Recommend a widely acclaimed classic movie (high ratings, great reviews) with a brief plot summary, highlights, and why it's worth watching.",tplMovieInstr:"Recommend a widely acclaimed classic movie (high ratings, great reviews) with a brief plot summary, highlights, and why it's worth watching.",tplHealthName:"Health Task Reminder",tplHealthDesc:`Send a health reminder including "current health task (water/stretch/eyes) + today's check-in count + one encouraging line", relaxed tone, under 50 words.`,tplHealthInstr:`Send a health reminder including "current health task (water/stretch/eyes) + today's check-in count + one encouraging line", relaxed tone, under 50 words.`,tplWhyName:"Ten Thousand Whys",tplWhyDesc:'Generate a fresh, fun piece of obscure knowledge or life trivia, presented as "question first, then answer", avoiding repeats.',tplWhyInstr:'Generate a fresh, fun piece of obscure knowledge or life trivia, presented as "question first, then answer", avoiding repeats.',tplGitName:"Weekday Git Digest",tplGitDesc:"Summarize workspace Git status: yesterday's commits, uncommitted changes, branch vs. remote divergence — as a short daily digest.",tplGitInstr:"Summarize workspace Git status: yesterday's commits, uncommitted changes, branch vs. remote divergence — as a short daily digest.",emptyTitle:"No scheduled tasks yet",emptyDesc:"Create a scheduled task to automate recurring AI agent work",createTitle:"New Scheduled Task",editTitle:"Edit Scheduled Task",nameLabel:"Task Name",namePlaceholder:"e.g. summarize Git status every morning at 9",scheduleLabel:"Schedule",instructionLabel:"Instructions",instructionsPlaceholder:"Describe what the agent should do on each trigger…",freqDaily:"Every day",freqWeekly:"Weekly",freqWeekdays:"Weekdays",freqOnce:"Once",freqCustom:"Custom cron",cancel:"Cancel",save:"Save",saving:"Saving…",edit:"Edit",enabled:"enabled",disabled:"disabled",enable:"Enable",disable:"Disable",runNow:"Trigger manually",delete:"Delete",nextRun:"Next run",badgeDaily:"Daily {{time}}",badgeWeekly:"{{day}} {{time}}",badgeWeekdays:"Weekdays {{time}}",badgeOnce:"Once:",dow:{monday:"Mon",tuesday:"Tue",wednesday:"Wed",thursday:"Thu",friday:"Fri",saturday:"Sat",sunday:"Sun"},historyTitle:"Run History",noRuns:"No runs recorded yet",permissionsTitle:"Scoped allow rules (tool target)",permissionsEmpty:"None. Write operations not allowed here require manual approval and are auto-rejected after timeout.",permissionPlaceholder:"e.g. write_file docs/report.md",add:"Add",attachmentsLabel:"Attachments",attachmentsHint:"File paths sent to the agent together with the task instructions (relative to the workspace)",attachmentsEmpty:"No files selected. Click + to add.",attachmentsAdd:"Add files",modelLabel:"Model",modelAuto:"Follow default",modelNoModels:"No models available — configure one in the Models tab first",connectorsLabel:"Connectors",connectorsHint:"MCP / LSP connectors to enable for this run only (no effect on global toggles)",connectorsEmpty:"No connectors selected",channelsLabel:"Notification channels",channelsHint:"Run results are pushed to these channels (unknown ids are silently ignored)",channelsEmpty:"No notification channels selected",workspaceLabel:"Workspace",workspaceHint:"Working directory used when this task fires. Falls back to the current session workspace when unset.",workspacePick:"Pick directory",workspaceClear:"Clear",fullAccessLabel:"Allow full access",fullAccessHint:'When on, read operations are auto-allowed; writes still need explicit per-rule entries in "Scoped allow rules".',permissionAccess:"Permissions"},rA={searchPlaceholder:"Search...",refresh:"Refresh",collapse:"Collapse",uploadTo:"Upload to {{dir}}",uploadToRoot:"Upload to workspace root",setUploadDirHint:"Click to set as upload directory and expand",download:"Download",backToList:"Back to file list",modified:"Modified",discardConfirm:'"{{file}}" has unsaved changes. Discard them?',saving:"Saving...",save:"Save",saved:"File saved",saveFail:"Save failed",readFail:"Failed to read file",downloadFail:"Download failed",downloadStarted:"Download started",uploadedCount:"Uploaded {{count}} files",uploadFailedCount:"Failed to upload {{count}} files",selectFileHint:"Select a file to preview or edit"},sA={title:"Logs",backendLogs:"Backend Logs",streamTab:"Live Stream",files:"Log Files",clear:"Clear",refresh:"Refresh",refreshing:"Refreshing...",noLogs:"No live logs",noFiles:"No log files",preview:"Preview",download:"Download",backToList:"Back to file list",emptyFile:"(empty file)",totalLines:"{{count}} lines",showingLatest:"(showing latest {{count}} lines)"},iA={installedTab:"Installed ({{count}})",availableTab:"Available ({{count}})",searchPlaceholder:"Search plugins (name / id / description / tags)",clear:"Clear",allCategories:"All",marketFilterAll:"All sources",marketFilterBuiltin:"Built-in",prevPage:"Prev",nextPage:"Next",pageInfo:"Page {{page}} / {{pages}} · {{count}} items",noMatch:"No matching plugins",emptyInstalled:'No plugins yet — install from the market on the "Available" tab',emptyMarket:"No plugins available in the market",applyProviderTitle:"Write the plugin's provider preset into ProviderConfigStore (user-authorized)",activate:"Activate",deactivate:"Deactivate",uninstall:"Uninstall",installActivate:"Install & Activate",installOnly:"Install only",uninstallTitle:"Uninstall Plugin",uninstallConfirm:"Uninstall {{id}}? Plugin files will be deleted (except bundled)."},oA={starterTitle:"New workflow",starterNodeTitle:"Task",starterNodeDesc:"Describe the task",sourceSaved:"Distilled",sourceScript:"Script",sourceHandwritten:"Handwritten",roleExplore:"Explore",rolePlan:"Plan",roleExecute:"Execute",roleVerify:"Verify",roleSummarize:"Summarize",roleGeneric:"Generic",nodeParallel:"Parallel",nodePipeline:"Pipeline",nodePhase:"Phase",nodeSynthesize:"Synthesize",nodeCondition:"Condition",nodeLoop:"Loop",nodeCheckpoint:"Checkpoint",nodeRetry:"Auto retry",noNodes:"This workflow has no nodes yet.",filterAll:"All",noMatchTemplates:"No matching workflows",emptyTemplates:"No workflows yet. Save a completed run as a workflow, or create one manually.",aiPromptRequired:"Description cannot be empty",aiDraftFailed:"AI drafting failed. Please try again or write the JSON manually.",nameRequired:"Workflow name cannot be empty",jsonParseFailed:"Failed to parse JSON: {{error}}",invalidDefinition:"definition must be a WorkflowDefinition containing a nodes array",createFailed:"Failed to create workflow",loadFailed:"Failed to load workflow",uncategorized:"Other",validateNoNodes:"The definition has no nodes",validateNodeNoId:'A node is missing its "id"',validateDupNodeId:"Duplicate node id: {{id}}",validateDanglingDep:'Node "{{node}}" depends on missing node "{{dep}}"',validateCycle:"The node dependency graph has a cycle",validateUndeclaredInput:"Placeholder <<input:{{name}}>> is not declared in inputs",savedVersion:"Saved (v{{version}})",saveFailed:"Failed to save workflow",renderFailed:"Preflight render failed",selectTemplateHint:"Select a workflow on the left to view or edit",loading:"Loading…",deleteTemplate:"Delete this workflow",categoryLabel:"Category (category)",descriptionLabel:"Description (description)",nodeCount:"{{n}} nodes",topologyHint:"Topology: serial / parallel dependencies",inputCount:"{{n}} input parameters",workflowNodes:"Workflow nodes",sortedByDeps:"Sorted by dependency topology",launchWithTemplate:"Replay this workflow",testRun:"Preflight render",versionHistory:"Version history",advancedJson:"Advanced (JSON)",refresh:"Refresh",inputsSchemaLabel:"inputs (parameter schema, JSON) — saving changes bumps the version",definitionLabel:"definition (WorkflowDefinition, JSON)",saveChanges:"Save changes",versionSnapshotLabel:"Immutable version snapshots (versions/{v}.json)",noVersions:"No versions yet",viewingVersion:"Currently viewing",newTemplate:"New workflow",searchPlaceholder:"Search workflows…",viewing:"Viewing",view:"View",previewModalTitle:'Preflight "{{name}}"',launch:"Launch",renderPreview:"Render preview",renderSuccess:"Preflight render OK — the resulting definition can be replayed directly",nameLabel:"Name *",namePlaceholder:"e.g. Triage Inbox",categoryField:"Category",descriptionField:"Description",aiDraftTab:"Draft with AI",manualJsonTab:"Write JSON manually",aiPromptLabel:"Describe in one sentence what you want (the AI will break it down into role-based workflow nodes)",aiPromptPlaceholder:"e.g. Review the current repo's code for security/performance/correctness and produce a graded report, read-only throughout",aiWorking:"AI is breaking down the task…",generateWorkflow:"Generate workflow",aiTimeHint:"Takes about 30–60s (reasoning models may take longer); you can tweak the result manually afterwards",newInputsLabel:"inputs (parameter schema, JSON; referenced via <<input:name>>)",inputsExamplePlaceholder:'[{ "name": "folder", "label": "Folder", "type": "folder", "required": true }]',cancel:"Cancel",create:"Create",deleteConfirm:'Delete workflow "{{name}}"? This action cannot be undone.',delete:"Delete",typeString:"Text",typeNumber:"Number",typeSelect:"Select",typeBoolean:"Toggle",typeFolder:"Folder",typeConnector:"Connector",noInputsNeeded:"This workflow needs no parameters — replay directly.",starting:"Starting…",requiredError:"Required",numberError:"Please enter a number",selectNone:"(none)",newSession:"New session",newFromTemplateTitle:"New from workflow",chooseTemplateAria:"Choose a workflow to start a session",backToList:"Back to workflow list",startSessionHeader:"Start a session",directChat:"Direct chat",directChatHint:"No workflow — the AI breaks down the task on the fly (dynamic workflow)",loadingTemplates:"Loading workflows…",noTemplatesYet:"No saved workflows yet.",libraryMenu:"Workflows…",workflowLibraryTitle:"Workflows",workflowLibraryHint:"Turn a completed workflow run into a reusable capability, then replay it anytime.",manualCreate:"Manual create",manualCreateTitle:"Manual create (formerly “New template”)",viewMode:"View",backToView:"Back to view",replay:"Replay",preflight:"Preflight",readonly:"Read-only",readonlyHint:"Replay will not modify any files",writable:"Can modify files",riskLow:"Risk: low",riskMedium:"Risk: medium",riskHigh:"Risk: high",confirmCount:"{{n}} to confirm",confirmCountNone:"Nothing to confirm",parallelCount:"{{n}} steps ({{p}} parallel)",stepCount:"{{n}} steps",permissions:"Permissions",allowDuringReplay:"Allowed during replay",denyDuringReplay:"Denied during replay",toolWhitelist:"Tool whitelist",noToolsRestriction:"No tool restriction (session permissions apply)",exportJson:"Export as template JSON",copyId:"Copy template ID",copied:"Copied",reRecordAsNew:"Re-record as new version",reRecordHint:"No in-place rollback: creates a new version from v{{v}}",compare:"Compare",more:"More",degradedBadge:"Cut incomplete",statusDraft:"Draft",statusReady:"Ready",statusDeprecated:"Deprecated",statusArchived:"Archived",overviewTab:"Overview",flowTab:"Flow",permissionsTab:"Permissions",historyTab:"History",inputsNeeded:"To confirm on replay",autoDetected:"Auto-detected",manualInput:"Manual",outputsProduced:"What you get",noOutputsDeclared:"(no outputs declared)",replayDrawerTitle:"Replay {{name}}",replayStart:"Start replay →",edit:"Edit",replayNewSession:"Replay opens a new session; track progress in chat"},lA={taskBoard:{title:"Task Board"},card:{collapse:"Collapse",expand:"Expand",auto:"Auto",unpin:"Unpin",pinKeep:"Pin (won't auto-hide)",pin:"Pin",close:"Close this widget"},workflow:{fallbackTitle:"Workflow",statusRunning:"Running",statusCompleted:"Done",statusFailed:"Failed",statusSkipped:"Skipped",statusBlocked:"Waiting",statusPending:"Pending",resume:"Resume",pause:"Pause",cancel:"Cancel",retryCount:"Retried {{n}}x",waitingFor:"Waiting for {{name}}",retryNode:"Retry",skipNode:"Skip",recoverFromCheckpoint:"Recover from checkpoint",recap:"Recap",recapLine:"Recap: {{text}}",recapAllDone:"✓ all done",recapAllFailed:"✗ all failed",recapFailedNodes:"✗{{n}} {{names}}",recapRetried:"↻{{n}} retried",recapSlowest:"slowest {{name}} {{duration}}",recapTotalDuration:"total {{duration}}",recoverHint:"{{n}} failed · retry or skip per node",resultSucceeded:"All done",resultFailed:"Failed",resultCancelled:"Cancelled",retriedCount:"retried {{n}}"},dwf:{offerFallbackTitle:"Dynamic workflow",promotableSentence:"Validated {{n}} times — save as a reusable template"},agentFlow:{statusPaused:"Paused",statusRunning:"Running",statusCompleted:"Done",statusFailed:"Failed",statusIdle:"Idle",moreAgents:"+{{count}} agents",eventLog:"Event log ({{count}})"},plan:{title:"AI Plan",fallbackTitle:"Workflow plan",stepCount:"{{count}} steps",moreSteps:"+{{count}} steps",dependsOn:"depends on {{count}} steps",start:"Start execution",change:"Change flow",changeHint:"Discard this plan and rephrase your request",cancelTitle:"Cancel workflow",cancel:"Cancel",runtime:"Runtime",runtimeHint:"Run in WorkflowRuntime (heavyweight exit)"}},cA={drawerCollapseTitle:"Collapse drawer to view messages",drawerExpandTitle:"Expand drawer to make a choice",openFile:"Open ›"},uA={viewChat:"Chat",viewTrajectory:"Trajectory",viewToggleTitle:"Switch chat / trajectory view",toolbar:{duration:"Duration",actualDuration:"Show timeline blocks at recorded duration",equalWidth:"Show timeline blocks at equal width",turns:"Turns",calls:"Calls",collapseTurns:"Collapse all turns",expandTurns:"Expand all turns",collapseCalls:"Collapse all tool calls",expandCalls:"Expand all tool calls",search:"Search trajectory",searchPlaceholder:"Search trajectory…"},errorBanner:{title:"Errors detected",expand:"Expand error details",collapse:"Collapse error details",viewLogs:"View logs",dismiss:"Dismiss (reminder re-appears on new errors)"}},h4={common:AC,nav:TC,chat:EC,shortcuts:NC,palette:RC,a11y:DC,plan:MC,whatsnew:OC,settings:LC,models:jC,tools:BC,skills:IC,hook:PC,step:zC,toolCall:$C,slashCommands:FC,error:HC,toast:UC,assistants:GC,channels:qC,fileJob:VC,reconnect:WC,fileMenu:KC,autoAccess:YC,git:ZC,errorCard:XC,connectors:QC,time:JC,stt:eA,activity:tA,taskbar:nA,automation:aA,fileTree:rA,logs:sA,plugins:iA,templates:oA,widgets:lA,commonUi:cA,trajectory:uA},dA={desktopDownloadTitle:"デスクトップアプリをダウンロード · {{os}}",desktopDownloadRecommend:"デスクトップアプリがおすすめ",desktopDownloadOtherPlatforms:"ほかのプラットフォーム版をダウンロード",desktopDownloadMenu:"その他のダウンロード方法",desktopDownloadOsWindows:"Windows",desktopDownloadOsMacos:"macOS",desktopDownloadOsLinux:"Linux",desktopDownloadOsAndroid:"Android",desktopDownloadOsIos:"iOS",desktopDownloadOsUnknown:"お使いの端末",desktopDownloadYourSystem:"お使いのシステム · {{os}}",desktopDownloadOtherSystems:"ほかのシステム",desktopDownloadTrouble:"ダウンロードできない場合",desktopDownloadViaMirror:"ミラー経由でダウンロード({{host}})",desktopDownloadViaMirrorToast:"直接接続できないため、ミラーに切り替えました",desktopDownloadOpenRelease:"リリースページを開く",desktopDownloadFromMirror:"ミラー",desktopDownloadSize:"約 {{size}}",desktopDownloadHandToAi:"AI にダウンロードとインストールを任せる",desktopDownloadHandToAiDesc:"入力欄に一文を入れるだけ。Enter で送信",desktopDownloadHandToAiHint:"インストール手順を入力欄に追加しました。Enter で送信できます",desktopDownloadArmHint:"ARM ネイティブ版は未提供のため、上記は x64 版です",desktopDownloadMacUnsignedHint:"初回起動時は右クリック →「開く」(現在のビルドは署名なし)",desktopDownloadMobileHint:"モバイルではデスクトップアプリをインストールできないため、ダウンロードページを開きました",desktopDownloadMobileMenuHint:"モバイル版はありません。下から別のシステムを選べます",desktopDownloadLoading:"インストーラー一覧を取得しています…",desktopDownloadFetching:"ダウンロード URL を取得しています…",desktopDownloadUnavailable:"ダウンロード URL を取得できません。リリースページを開きました",desktopDownloadPrompt:"このマシンに DeepSeekCode デスクトップアプリをダウンロードしてインストールしてください(現在の OS:{{os}})。インストーラーの URL:{{url}}。この URL に接続できない場合は、次のミラーを順に試してください:{{mirrors}}。インストールが完了したら起動方法を教えてください。",desktopDownloadPromptNoMirror:"なし"},pA={language:"言語",languageAuto:"システムに合わせる",languageHint:"切り替えるとサーバー設定にも同期され、AI は選んだ言語で返信します(次回のやり取りから有効)。内部の思考言語は変わりません。「システムに合わせる」を選ぶとブラウザの言語に自動で合わせます。"},fA={chat:dA,settings:pA},hA={desktopDownloadTitle:"데스크톱 앱 다운로드 · {{os}}",desktopDownloadRecommend:"데스크톱 앱 추천",desktopDownloadOtherPlatforms:"다른 플랫폼용 다운로드",desktopDownloadMenu:"다운로드 옵션 더보기",desktopDownloadOsWindows:"Windows",desktopDownloadOsMacos:"macOS",desktopDownloadOsLinux:"Linux",desktopDownloadOsAndroid:"Android",desktopDownloadOsIos:"iOS",desktopDownloadOsUnknown:"사용 중인 기기",desktopDownloadYourSystem:"사용 중인 시스템 · {{os}}",desktopDownloadOtherSystems:"다른 시스템",desktopDownloadTrouble:"다운로드가 안 되나요?",desktopDownloadViaMirror:"미러로 다운로드 ({{host}})",desktopDownloadViaMirrorToast:"직접 연결이 안 되어 미러로 전환했습니다",desktopDownloadOpenRelease:"릴리스 페이지 열기",desktopDownloadFromMirror:"미러",desktopDownloadSize:"약 {{size}}",desktopDownloadHandToAi:"AI에게 다운로드와 설치를 맡기기",desktopDownloadHandToAiDesc:"한 줄 지시문이 입력창에 들어갑니다. Enter로 전송",desktopDownloadHandToAiHint:"설치 지시문을 입력창에 넣었습니다. Enter로 전송하세요",desktopDownloadArmHint:"ARM 네이티브 설치 파일이 없어 위 항목은 x64 버전입니다",desktopDownloadMacUnsignedHint:"첫 실행 시 우클릭 → '열기' (현재 빌드는 코드 서명이 없습니다)",desktopDownloadMobileHint:"모바일에서는 데스크톱 앱을 설치할 수 없어 다운로드 페이지를 열었습니다",desktopDownloadMobileMenuHint:"모바일용 설치 파일이 없습니다. 아래에서 다른 시스템을 선택하세요",desktopDownloadLoading:"설치 파일 목록을 가져오는 중…",desktopDownloadFetching:"다운로드 주소를 확인하는 중…",desktopDownloadUnavailable:"다운로드 주소를 사용할 수 없어 릴리스 페이지를 열었습니다",desktopDownloadPrompt:"이 컴퓨터에 DeepSeekCode 데스크톱 앱을 다운로드해서 설치해 주세요(현재 OS: {{os}}). 설치 파일 주소: {{url}}. 이 주소에 연결되지 않으면 다음 미러를 순서대로 시도해 주세요: {{mirrors}}. 설치가 끝나면 실행 방법을 알려 주세요.",desktopDownloadPromptNoMirror:"없음"},mA={language:"언어",languageAuto:"시스템 설정 따르기",languageHint:"전환하면 서버 설정에도 반영되어 AI가 선택한 언어로 답합니다(다음 대화부터 적용). 내부 사고 언어는 바뀌지 않습니다. '시스템 설정 따르기'를 고르면 브라우저 언어에 자동으로 맞춥니다."},gA={chat:hA,settings:mA},yA={desktopDownloadTitle:"Desktop-App herunterladen · {{os}}",desktopDownloadRecommend:"Desktop-App empfohlen",desktopDownloadOtherPlatforms:"Für eine andere Plattform herunterladen",desktopDownloadMenu:"Weitere Download-Optionen",desktopDownloadOsWindows:"Windows",desktopDownloadOsMacos:"macOS",desktopDownloadOsLinux:"Linux",desktopDownloadOsAndroid:"Android",desktopDownloadOsIos:"iOS",desktopDownloadOsUnknown:"dein System",desktopDownloadYourSystem:"Dein System · {{os}}",desktopDownloadOtherSystems:"Andere Systeme",desktopDownloadTrouble:"Download funktioniert nicht?",desktopDownloadViaMirror:"Über Mirror herunterladen ({{host}})",desktopDownloadViaMirrorToast:"Direktverbindung fehlgeschlagen – auf Mirror umgestellt",desktopDownloadOpenRelease:"Release-Seite öffnen",desktopDownloadFromMirror:"Mirror",desktopDownloadSize:"ca. {{size}}",desktopDownloadHandToAi:"Die KI herunterladen und installieren lassen",desktopDownloadHandToAiDesc:"Ein Satz landet im Eingabefeld – Enter zum Senden",desktopDownloadHandToAiHint:"Anweisung ins Eingabefeld geschrieben – Enter zum Senden",desktopDownloadArmHint:"Noch kein natives ARM-Paket – die Einträge oben sind x64",desktopDownloadMacUnsignedHint:"Beim ersten Start Rechtsklick → „Öffnen“ (Build ist nicht signiert)",desktopDownloadMobileHint:"Auf Mobilgeräten lässt sich die Desktop-App nicht installieren – Download-Seite geöffnet",desktopDownloadMobileMenuHint:"Kein Mobil-Paket – wähle unten ein anderes System",desktopDownloadLoading:"Installer-Liste wird geladen…",desktopDownloadFetching:"Download-Adresse wird ermittelt…",desktopDownloadUnavailable:"Download-Adresse nicht verfügbar – Release-Seite geöffnet",desktopDownloadPrompt:"Bitte lade DeepSeekCode Desktop auf diesem Rechner herunter und installiere es (aktuelles System: {{os}}). Installer-URL: {{url}}. Falls die Adresse nicht erreichbar ist, versuche der Reihe nach diese Mirrors: {{mirrors}}. Sag mir nach der Installation, wie ich es starte.",desktopDownloadPromptNoMirror:"keine"},bA={language:"Sprache",languageAuto:"Systemeinstellung folgen",languageHint:"Die Wahl wird auch in die Server-Konfiguration übernommen – die KI antwortet in der gewählten Sprache (ab dem nächsten Austausch). Die interne Denksprache bleibt unverändert. Bei „Systemeinstellung folgen“ wird automatisch die Browsersprache verwendet."},vA={chat:yA,settings:bA},xA={desktopDownloadTitle:"Télécharger l'application de bureau · {{os}}",desktopDownloadRecommend:"Application de bureau recommandée",desktopDownloadOtherPlatforms:"Télécharger pour une autre plateforme",desktopDownloadMenu:"Plus d'options de téléchargement",desktopDownloadOsWindows:"Windows",desktopDownloadOsMacos:"macOS",desktopDownloadOsLinux:"Linux",desktopDownloadOsAndroid:"Android",desktopDownloadOsIos:"iOS",desktopDownloadOsUnknown:"votre appareil",desktopDownloadYourSystem:"Votre système · {{os}}",desktopDownloadOtherSystems:"Autres systèmes",desktopDownloadTrouble:"Le téléchargement pose problème ?",desktopDownloadViaMirror:"Télécharger via un miroir ({{host}})",desktopDownloadViaMirrorToast:"Connexion directe impossible — bascule vers un miroir",desktopDownloadOpenRelease:"Ouvrir la page des versions",desktopDownloadFromMirror:"miroir",desktopDownloadSize:"env. {{size}}",desktopDownloadHandToAi:"Laisser l'IA télécharger et installer",desktopDownloadHandToAiDesc:"Une phrase est ajoutée au champ de saisie — Entrée pour envoyer",desktopDownloadHandToAiHint:"Consigne ajoutée au champ de saisie — Entrée pour envoyer",desktopDownloadArmHint:"Pas encore de paquet ARM natif — les entrées ci-dessus sont en x64",desktopDownloadMacUnsignedHint:"Au premier lancement : clic droit → « Ouvrir » (compilation non signée)",desktopDownloadMobileHint:"L'application de bureau ne s'installe pas sur mobile — page de téléchargement ouverte",desktopDownloadMobileMenuHint:"Aucun paquet mobile — choisissez un autre système ci-dessous",desktopDownloadLoading:"Chargement de la liste des installateurs…",desktopDownloadFetching:"Récupération de l'adresse de téléchargement…",desktopDownloadUnavailable:"Adresse de téléchargement indisponible — page des versions ouverte",desktopDownloadPrompt:"Merci de télécharger et d'installer DeepSeekCode Desktop sur cette machine (système actuel : {{os}}). URL de l'installateur : {{url}} ; si elle est injoignable, essayez ces miroirs dans l'ordre : {{mirrors}}. Une fois installé, indiquez-moi comment le lancer.",desktopDownloadPromptNoMirror:"aucun"},wA={language:"Langue",languageAuto:"Suivre le système",languageHint:"Le choix est aussi synchronisé avec la configuration du serveur : l'IA répond dans la langue choisie (dès le prochain échange), sa langue de raisonnement interne reste inchangée. « Suivre le système » s'adapte automatiquement à la langue du navigateur."},kA={chat:xA,settings:wA},SA={desktopDownloadTitle:"Descargar la app de escritorio · {{os}}",desktopDownloadRecommend:"Recomendamos la app de escritorio",desktopDownloadOtherPlatforms:"Descargar para otra plataforma",desktopDownloadMenu:"Más opciones de descarga",desktopDownloadOsWindows:"Windows",desktopDownloadOsMacos:"macOS",desktopDownloadOsLinux:"Linux",desktopDownloadOsAndroid:"Android",desktopDownloadOsIos:"iOS",desktopDownloadOsUnknown:"tu dispositivo",desktopDownloadYourSystem:"Tu sistema · {{os}}",desktopDownloadOtherSystems:"Otros sistemas",desktopDownloadTrouble:"¿Problemas con la descarga?",desktopDownloadViaMirror:"Descargar desde un espejo ({{host}})",desktopDownloadViaMirrorToast:"La conexión directa falló: se cambió a un espejo",desktopDownloadOpenRelease:"Abrir la página de versiones",desktopDownloadFromMirror:"espejo",desktopDownloadSize:"~{{size}}",desktopDownloadHandToAi:"Pedir a la IA que lo descargue e instale",desktopDownloadHandToAiDesc:"Se añade una frase al cuadro de texto: Enter para enviar",desktopDownloadHandToAiHint:"Instrucción añadida al cuadro de texto: pulsa Enter para enviar",desktopDownloadArmHint:"Aún no hay paquete nativo para ARM: los elementos de arriba son x64",desktopDownloadMacUnsignedHint:"En el primer inicio, clic derecho → «Abrir» (compilación sin firmar)",desktopDownloadMobileHint:"La app de escritorio no se instala en móvil: se abrió la página de descarga",desktopDownloadMobileMenuHint:"No hay paquete para móvil: elige otro sistema abajo",desktopDownloadLoading:"Cargando la lista de instaladores…",desktopDownloadFetching:"Obteniendo la dirección de descarga…",desktopDownloadUnavailable:"Dirección de descarga no disponible: se abrió la página de versiones",desktopDownloadPrompt:"Descarga e instala DeepSeekCode para escritorio en este equipo (sistema actual: {{os}}). URL del instalador: {{url}}; si no es accesible, prueba estos espejos en orden: {{mirrors}}. Cuando termines, dime cómo iniciarlo.",desktopDownloadPromptNoMirror:"ninguno"},_A={language:"Idioma",languageAuto:"Seguir el sistema",languageHint:"El cambio también se sincroniza con la configuración del servidor: la IA responde en el idioma elegido (desde el próximo intercambio); su idioma interno de razonamiento no cambia. Con «Seguir el sistema» se adapta automáticamente al idioma del navegador."},CA={chat:SA,settings:_A},AA={desktopDownloadTitle:"Baixar o aplicativo para desktop · {{os}}",desktopDownloadRecommend:"Recomendamos o app para desktop",desktopDownloadOtherPlatforms:"Baixar para outra plataforma",desktopDownloadMenu:"Mais opções de download",desktopDownloadOsWindows:"Windows",desktopDownloadOsMacos:"macOS",desktopDownloadOsLinux:"Linux",desktopDownloadOsAndroid:"Android",desktopDownloadOsIos:"iOS",desktopDownloadOsUnknown:"seu dispositivo",desktopDownloadYourSystem:"Seu sistema · {{os}}",desktopDownloadOtherSystems:"Outros sistemas",desktopDownloadTrouble:"Problemas para baixar?",desktopDownloadViaMirror:"Baixar por espelho ({{host}})",desktopDownloadViaMirrorToast:"A conexão direta falhou — alterado para um espelho",desktopDownloadOpenRelease:"Abrir a página de versões",desktopDownloadFromMirror:"espelho",desktopDownloadSize:"~{{size}}",desktopDownloadHandToAi:"Deixar a IA baixar e instalar",desktopDownloadHandToAiDesc:"Uma frase entra na caixa de texto — Enter para enviar",desktopDownloadHandToAiHint:"Instrução adicionada à caixa de texto — Enter para enviar",desktopDownloadArmHint:"Ainda não há pacote nativo para ARM — os itens acima são x64",desktopDownloadMacUnsignedHint:"Na primeira execução, clique com o botão direito → “Abrir” (build sem assinatura)",desktopDownloadMobileHint:"O aplicativo para desktop não é instalado no celular — abrimos a página de download",desktopDownloadMobileMenuHint:"Não há pacote para celular — escolha outro sistema abaixo",desktopDownloadLoading:"Carregando a lista de instaladores…",desktopDownloadFetching:"Obtendo o endereço de download…",desktopDownloadUnavailable:"Endereço de download indisponível — abrimos a página de versões",desktopDownloadPrompt:"Baixe e instale o DeepSeekCode para desktop nesta máquina (sistema atual: {{os}}). Endereço do instalador: {{url}}; se não estiver acessível, tente estes espelhos na ordem: {{mirrors}}. Quando terminar, me diga como iniciá-lo.",desktopDownloadPromptNoMirror:"nenhum"},TA={language:"Idioma",languageAuto:"Seguir o sistema",languageHint:"A troca também é sincronizada com a configuração do servidor: a IA responde no idioma escolhido (a partir da próxima mensagem); o idioma do raciocínio interno não muda. Com “Seguir o sistema”, o idioma do navegador é usado automaticamente."},EA={chat:AA,settings:TA},NA={desktopDownloadTitle:"Скачать приложение для ПК · {{os}}",desktopDownloadRecommend:"Рекомендуем приложение для ПК",desktopDownloadOtherPlatforms:"Скачать для другой платформы",desktopDownloadMenu:"Другие варианты загрузки",desktopDownloadOsWindows:"Windows",desktopDownloadOsMacos:"macOS",desktopDownloadOsLinux:"Linux",desktopDownloadOsAndroid:"Android",desktopDownloadOsIos:"iOS",desktopDownloadOsUnknown:"ваша система",desktopDownloadYourSystem:"Ваша система · {{os}}",desktopDownloadOtherSystems:"Другие системы",desktopDownloadTrouble:"Не скачивается?",desktopDownloadViaMirror:"Скачать через зеркало ({{host}})",desktopDownloadViaMirrorToast:"Прямое подключение недоступно — переключились на зеркало",desktopDownloadOpenRelease:"Открыть страницу релизов",desktopDownloadFromMirror:"зеркало",desktopDownloadSize:"~{{size}}",desktopDownloadHandToAi:"Поручить ИИ скачать и установить",desktopDownloadHandToAiDesc:"Одна фраза попадёт в поле ввода — Enter, чтобы отправить",desktopDownloadHandToAiHint:"Инструкция добавлена в поле ввода — Enter, чтобы отправить",desktopDownloadArmHint:"Нативной сборки для ARM пока нет — выше версии x64",desktopDownloadMacUnsignedHint:"При первом запуске: правый клик → «Открыть» (сборка без подписи)",desktopDownloadMobileHint:"На мобильном приложение для ПК не установить — открыли страницу загрузки",desktopDownloadMobileMenuHint:"Для мобильных сборки нет — выберите другую систему ниже",desktopDownloadLoading:"Загружаем список установщиков…",desktopDownloadFetching:"Получаем адрес загрузки…",desktopDownloadUnavailable:"Адрес загрузки недоступен — открыли страницу релизов",desktopDownloadPrompt:"Скачай и установи приложение DeepSeekCode для ПК на этой машине (текущая система: {{os}}). Адрес установщика: {{url}}; если он недоступен, попробуй зеркала по порядку: {{mirrors}}. После установки расскажи, как его запустить.",desktopDownloadPromptNoMirror:"нет"},RA={language:"Язык",languageAuto:"Как в системе",languageHint:"Выбор также синхронизируется с настройками сервера — ИИ отвечает на выбранном языке (со следующего сообщения); язык внутренних рассуждений не меняется. Вариант «Как в системе» автоматически подстраивается под язык браузера."},DA={chat:NA,settings:RA},MA={desktopDownloadTitle:"Scarica l'app desktop · {{os}}",desktopDownloadRecommend:"App desktop consigliata",desktopDownloadOtherPlatforms:"Scarica per un'altra piattaforma",desktopDownloadMenu:"Altre opzioni di download",desktopDownloadOsWindows:"Windows",desktopDownloadOsMacos:"macOS",desktopDownloadOsLinux:"Linux",desktopDownloadOsAndroid:"Android",desktopDownloadOsIos:"iOS",desktopDownloadOsUnknown:"il tuo sistema",desktopDownloadYourSystem:"Il tuo sistema · {{os}}",desktopDownloadOtherSystems:"Altri sistemi",desktopDownloadTrouble:"Problemi con il download?",desktopDownloadViaMirror:"Scarica da un mirror ({{host}})",desktopDownloadViaMirrorToast:"Connessione diretta non disponibile — passato a un mirror",desktopDownloadOpenRelease:"Apri la pagina delle release",desktopDownloadFromMirror:"mirror",desktopDownloadSize:"~{{size}}",desktopDownloadHandToAi:"Lascia che l'IA scarichi e installi",desktopDownloadHandToAiDesc:"Una frase finisce nel campo di testo — Invio per inviare",desktopDownloadHandToAiHint:"Istruzione aggiunta al campo di testo — Invio per inviare",desktopDownloadArmHint:"Nessun pacchetto nativo ARM — le voci sopra sono x64",desktopDownloadMacUnsignedHint:"Al primo avvio: clic destro → «Apri» (build non firmata)",desktopDownloadMobileHint:"Su mobile l'app desktop non si installa — aperta la pagina di download",desktopDownloadMobileMenuHint:"Nessun pacchetto per mobile — scegli un altro sistema qui sotto",desktopDownloadLoading:"Caricamento dell'elenco degli installer…",desktopDownloadFetching:"Recupero dell'indirizzo di download…",desktopDownloadUnavailable:"Indirizzo di download non disponibile — aperta la pagina delle release",desktopDownloadPrompt:"Scarica e installa DeepSeekCode desktop su questa macchina (sistema attuale: {{os}}). URL dell'installer: {{url}}; se non è raggiungibile, prova questi mirror in ordine: {{mirrors}}. Al termine, dimmi come avviarlo.",desktopDownloadPromptNoMirror:"nessuno"},OA={language:"Lingua",languageAuto:"Segui il sistema",languageHint:"La scelta viene sincronizzata anche con la configurazione del server: l'IA risponde nella lingua selezionata (dal prossimo scambio), mentre la lingua del ragionamento interno resta invariata. Con «Segui il sistema» si adatta automaticamente alla lingua del browser."},LA={chat:MA,settings:OA},r5=Sp(_i.getState().language),jA={"zh-TW":CC,ja:fA,ko:gA,de:vA,fr:kA,es:CA,"pt-BR":EA,ru:DA,it:LA};Zt.use(f9).init({resources:{"zh-CN":{translation:f4,hook:f4.hook},en:{translation:h4,hook:h4.hook},...Object.fromEntries(Object.entries(jA).map(([t,e])=>[t,{translation:e}]))},lng:r5,fallbackLng:{"zh-TW":["zh-CN","en"],default:["en","zh-CN"]},interpolation:{escapeValue:!1}});function s5(t){try{typeof document<"u"&&(document.documentElement.lang=t)}catch{}}s5(r5);_i.subscribe((t,e)=>{t.language!==e.language&&Zt.changeLanguage(Sp(t.language))});Zt.on("languageChanged",s5);const BA="deepseekcode-chat-store",IA=500,PA=3e4,zA=2e4,U0=4e3;let Br=null,am=0,eu=null;const tu=(t,e)=>!t||t.length<=e?t:t.slice(0,e)+"…",m4=t=>({...t,args:typeof t.args=="string"?tu(t.args,U0)??t.args:t.args,result:typeof t.result=="string"?tu(t.result,U0)??t.result:t.result}),$A=t=>{const e={...t,thinkingBlocks:void 0,textBlocks:void 0,content:tu(t.content,zA)??t.content};return t.steps&&(e.steps=t.steps.map(n=>{var a;return{...n,thought:tu(n.thought,U0),result:tu(n.result,U0),toolCalls:(a=n.toolCalls)==null?void 0:a.map(m4)}})),t.toolCalls&&(e.toolCalls=t.toolCalls.map(m4)),e},FA=/WebSocket disconnected|connection (lost|closed)|disconnect/i,HA=/force|new message|user stop|stop|terminate|paused/i;function i5(t){return t?FA.test(t)?"ws_disconnected":HA.test(t)?"force_stopped":"unknown":"unknown"}function UA(t){switch(i5(t)){case"ws_disconnected":return Zt.t("error.genEndedWs");case"force_stopped":return Zt.t("error.genEndedStopped");default:return Zt.t("error.genEnded")}}const GA=[t=>{const e=Ge.getState(),n=new Set;for(const r of e.sessionTabs)n.add(r.id);for(const r of e.historySessions)n.add(r.id);e.activeSessionId&&n.add(e.activeSessionId);const a={};for(const[r,i]of Object.entries(t.state.messagesBySession||{}))n.has(r)&&Array.isArray(i)&&i.length>0&&(a[r]=i);return{...t,state:{...t.state,messagesBySession:a}}},t=>{const e={};for(const[n,a]of Object.entries(t.state.messagesBySession||{}))e[n]=(Array.isArray(a)?a:[]).slice(-60).map($A);return{...t,state:{...t.state,messagesBySession:e}}},t=>{const e=Ge.getState().activeSessionId||"",n=(t.state.messagesBySession||{})[e]||[],a=(Array.isArray(n)?n:[]).slice(-30).map(r=>({id:r.id,type:r.type,content:r.content,timestamp:r.timestamp,...r.thinking?{thinking:r.thinking}:{}}));return{...t,state:{...t.state,messagesBySession:e?{[e]:a}:{}}}}];function o5(t,e){const n=i=>{try{return localStorage.setItem(t,JSON.stringify(i)),am=0,!0}catch{return!1}};if(n(e))return;let a=e;for(const i of GA){try{a=i(a)}catch{continue}if(n(a))return}const r=Date.now();if(r-am>PA){am=r,console.error("[chatStore] localStorage 持久化失败,刷新页面将丢失历史消息:",new Error("quota exceeded or storage unavailable"));try{ws.getState().addToast("warning","聊天记录保存失败:浏览器本地存储已满或不可用。刷新页面将丢失历史消息,建议导出会话或清理旧会话。",8e3)}catch{}}}function qA(){Br&&(clearTimeout(Br),Br=null);const t=eu;eu=null,t&&o5(t.name,t.value)}const VA={getItem:t=>{const e=localStorage.getItem(t);if(!e)return null;try{const n=JSON.parse(e);return n&&typeof n=="object"&&"state"in n?n:{state:n,version:0}}catch{return null}},setItem:(t,e)=>{eu={name:t,value:e},Br&&clearTimeout(Br),Br=setTimeout(()=>{Br=null,eu=null,o5(t,e)},IA)},removeItem:t=>{eu=null,Br&&(clearTimeout(Br),Br=null);try{localStorage.removeItem(t)}catch{}}};if(typeof window<"u"){const t=()=>qA();window.addEventListener("pagehide",t),window.addEventListener("beforeunload",t)}function l5(t,e,n,a){const r=t!=null&&t.length?t:e;if(!r||r.length===0)return{blocks:[{index:a??0,text:n}],appendedAtEnd:!0};if(typeof a=="number"){const c=r.findIndex(p=>p.index===a),d=r.slice();return c>=0?(d[c]={...r[c],text:r[c].text+n},{blocks:d,appendedAtEnd:c===d.length-1}):(d.push({index:a,text:n}),d[d.length-2].index<=a?{blocks:d,appendedAtEnd:!0}:(d.sort((p,h)=>p.index-h.index),{blocks:d,appendedAtEnd:!1}))}const i=r.length-1,l=r.slice();return l[i]={...r[i],text:r[i].text+n},{blocks:l,appendedAtEnd:!0}}function g4(t,e,n){const{blocks:a,appendedAtEnd:r}=l5(t.thinkingBlocks,t.thinking?[{index:Number.MIN_SAFE_INTEGER,text:t.thinking}]:void 0,e,n);return{...t,thinkingBlocks:a,thinking:r?(t.thinking||"")+e:a.map(i=>i.text).join("")}}function e0(t,e,n){const{blocks:a,appendedAtEnd:r}=l5(t.textBlocks,t.content?[{index:Number.MAX_SAFE_INTEGER,text:t.content}]:void 0,e,n);return{...t,textBlocks:a,content:r?(t.content||"")+e:a.map(i=>i.text).join("")}}const Me=Nn()(Ri((t,e)=>({messagesBySession:{},generatingSessions:[],pausedSessions:[],sessionInputs:{},pendingBySession:{},getMessages:n=>e().messagesBySession[n]||[],replaceMessages:(n,a)=>t(r=>({messagesBySession:{...r.messagesBySession,[n]:a.slice(-200)}})),addMessage:(n,a)=>t(r=>{const l=[...r.messagesBySession[n]||[],a].slice(-200);return{messagesBySession:{...r.messagesBySession,[n]:l}}}),updateMessage:(n,a,r)=>t(i=>{const l=i.messagesBySession[n]||[];return l.some(c=>c.id===a)?{messagesBySession:{...i.messagesBySession,[n]:l.map(c=>c.id===a?{...c,...r}:c)}}:i}),updateLastMessage:(n,a)=>t(r=>{const i=(r.messagesBySession[n]||[]).map((l,c,d)=>c===d.length-1&&l.type==="assistant"?{...l,content:a}:l);return{messagesBySession:{...r.messagesBySession,[n]:i}}}),appendToLastMessage:(n,a)=>t(r=>{const i=r.messagesBySession[n];if(!i||i.length===0)return r;const l=i.length-1,c=i[l];if(c&&c.type==="assistant"){const d=i.slice();return d[l]=e0(c,a),{messagesBySession:{...r.messagesBySession,[n]:d}}}return{messagesBySession:{...r.messagesBySession,[n]:[...i,e0({id:ar(),type:"assistant",content:"",timestamp:Date.now()},a)].slice(-200)}}}),setThinking:(n,a)=>t(r=>{const i=(r.messagesBySession[n]||[]).map((l,c,d)=>{var h;if(c!==d.length-1||l.type!=="assistant")return l;const p=(h=l.steps)==null?void 0:h.findIndex(m=>m.status==="running");if(p!==void 0&&p!==-1&&l.steps&&l.steps[p]){const m=l.steps.map((b,x)=>x===p?{...b,thought:a}:b);return{...l,steps:m}}return{...l,thinking:a,thinkingBlocks:a?[{index:0,text:a}]:[]}});return{messagesBySession:{...r.messagesBySession,[n]:i}}}),appendToLastMessageThinking:(n,a,r)=>t(i=>{const l=i.messagesBySession[n];if(!l||l.length===0)return i;const c=l.length-1,d=l[c];if(!d||d.type!=="assistant")return{messagesBySession:{...i.messagesBySession,[n]:[...l,g4({id:ar(),type:"assistant",content:"",timestamp:Date.now()},a,r)].slice(-200)}};const p=g4(d,a,r),h=l.slice();return h[c]=p,{messagesBySession:{...i.messagesBySession,[n]:h}}}),appendToLastMessageText:(n,a,r)=>t(i=>{const l=i.messagesBySession[n];if(!l||l.length===0)return i;const c=l.length-1,d=l[c];if(!d||d.type!=="assistant")return{messagesBySession:{...i.messagesBySession,[n]:[...l,e0({id:ar(),type:"assistant",content:"",timestamp:Date.now()},a,r)].slice(-200)}};const p=l.slice();return p[c]=e0(d,a,r),{messagesBySession:{...i.messagesBySession,[n]:p}}}),addStep:(n,a)=>t(r=>{const i=(r.messagesBySession[n]||[]).map((l,c,d)=>{var m;if(c!==d.length-1||l.type!=="assistant")return l;const p=(m=l.toolCalls)==null?void 0:m.filter(b=>{var x;return!((x=l.steps)!=null&&x.some(w=>{var S;return(S=w.toolCalls)==null?void 0:S.some(C=>C.id===b.id)}))}),h={...a};return p!=null&&p.length&&(h.toolCalls=[...h.toolCalls||[],...p]),{...l,steps:[...l.steps||[],h]}});return{messagesBySession:{...r.messagesBySession,[n]:i}}}),updateStep:(n,a,r)=>t(i=>{const l=(i.messagesBySession[n]||[]).map((c,d,p)=>{if(d!==p.length-1||!c.steps)return c;const h=c.steps.findIndex(b=>b.id===a);if(h===-1)return c;const m=c.steps.map((b,x)=>x===h?{...b,...r}:b);return{...c,steps:m}});return{messagesBySession:{...i.messagesBySession,[n]:l}}}),addToolCall:(n,a)=>t(r=>{const i=(r.messagesBySession[n]||[]).map((l,c,d)=>{var h;if(c!==d.length-1||l.type!=="assistant")return l;const p=(h=l.steps)==null?void 0:h.findIndex(m=>m.status==="running");if(p!==void 0&&p!==-1&&l.steps&&l.steps[p]){const m=l.steps.map((b,x)=>x===p?{...b,toolCalls:[...b.toolCalls||[],a]}:b);return{...l,steps:m}}if(l.steps&&l.steps.length>0){const m=l.steps.length-1,b=l.steps.map((x,w)=>w===m?{...x,toolCalls:[...x.toolCalls||[],a]}:x);return{...l,steps:b}}return{...l,toolCalls:[...l.toolCalls||[],a]}});return{messagesBySession:{...r.messagesBySession,[n]:i}}}),updateToolCall:(n,a,r)=>t(i=>{const l=d=>{if(!d)return null;const p=d.findIndex(h=>h.id===a);return p===-1?null:d.map((h,m)=>m===p?{...h,...r}:h)},c=(i.messagesBySession[n]||[]).map((d,p,h)=>{var x,w;if(p!==h.length-1||d.type!=="assistant")return d;const m=(x=d.steps)==null?void 0:x.findIndex(S=>S.status==="running");if(m!==void 0&&m!==-1&&d.steps&&d.steps[m]){const S=l((w=d.steps[m])==null?void 0:w.toolCalls);if(S){const C=d.steps.map((E,T)=>T===m?{...E,toolCalls:S}:E);return{...d,steps:C}}}if(d.steps){let S=!1;const C=d.steps.map(E=>{if(S)return E;const T=l(E.toolCalls);return T?(S=!0,{...E,toolCalls:T}):E});if(S)return{...d,steps:C}}const b=l(d.toolCalls);return b?{...d,toolCalls:b}:d});return{messagesBySession:{...i.messagesBySession,[n]:c}}}),markWaitingUserToolCall:(n,a)=>t(r=>{var h,m;const i=r.messagesBySession[n];if(!(i!=null&&i.length))return r;let l=-1;for(let b=i.length-1;b>=0;b--)if(((h=i[b])==null?void 0:h.type)==="assistant"){l=b;break}if(l===-1)return r;const c=i[l];if(!c)return r;const d=b=>{if(!(b!=null&&b.length))return null;for(let x=b.length-1;x>=0;x--){const w=b[x];if(!w||w.status!=="running"||w.waitingUser===!0||a&&w.name!==a)continue;const S=b.slice();return S[x]={...w,waitingUser:!0},S}return null},p=d(c.toolCalls);if(p){const b=i.slice();return b[l]={...c,toolCalls:p},{messagesBySession:{...r.messagesBySession,[n]:b}}}if((m=c.steps)!=null&&m.length)for(let b=c.steps.length-1;b>=0;b--){const x=c.steps[b];if(!x)continue;const w=d(x.toolCalls);if(w){const S=c.steps.slice();S[b]={...x,toolCalls:w};const C=i.slice();return C[l]={...c,steps:S},{messagesBySession:{...r.messagesBySession,[n]:C}}}}return r}),clearWaitingUserToolCalls:n=>t(a=>{const r=a.messagesBySession[n];if(!(r!=null&&r.length))return a;let i=!1;const l=d=>!(d!=null&&d.length)||!d.some(p=>p.waitingUser===!0)?d:(i=!0,d.map(p=>p.waitingUser?{...p,waitingUser:void 0}:p)),c=r.map(d=>{var m;const p=l(d.toolCalls),h=(m=d.steps)==null?void 0:m.map(b=>{const x=l(b.toolCalls);return x!==b.toolCalls?{...b,toolCalls:x}:b});return p===d.toolCalls&&h===d.steps?d:{...d,toolCalls:p,steps:h}});return i?{messagesBySession:{...a.messagesBySession,[n]:c}}:a}),applyToolCallPatches:(n,a)=>t(r=>{if(!(a!=null&&a.length))return r;const i=r.messagesBySession[n];if(!(i!=null&&i.length))return r;const l=new Map(a.map(h=>[h.id,h]));let c=!1;const d=h=>{if(!(h!=null&&h.length))return h;let m=!1;const b=h.map(x=>{const w=l.get(x.id);if(!w)return x;m=!0;const S=Math.max(0,Date.now()-(x.timestamp||Date.now()));return{...x,status:w.status,result:w.result,ended:w.ended,waitingUser:w.waitingUser,duration:S}});return m?(c=!0,b):h},p=i.map(h=>{var x;const m=d(h.toolCalls),b=(x=h.steps)==null?void 0:x.map(w=>{const S=d(w.toolCalls);return S!==w.toolCalls?{...w,toolCalls:S}:w});return m===h.toolCalls&&b===h.steps?h:{...h,toolCalls:m,steps:b}});return c?{messagesBySession:{...r.messagesBySession,[n]:p}}:r}),appendToLastToolCallArgs:(n,a,r,i)=>t(l=>{const c=h=>{let m=h.args;if(typeof m=="string")m=m+r;else if(typeof m=="object"&&m!==null){const b=r.trim();if(b.startsWith("{")&&b.endsWith("}"))try{const x=JSON.parse(b);typeof m=="string"?m={...x}:m={...m,...x}}catch{m=JSON.stringify(m).slice(0,-1)+","+b.slice(1)}else typeof m=="string"?m=m+b:m=JSON.stringify(m)+b}else m=r;return{...h,args:m}},d=h=>{if(!h)return null;const m=h.findIndex(b=>i!==void 0&&b.index===i||b.id===a);return m===-1?null:h.map((b,x)=>x===m?c(b):b)},p=(l.messagesBySession[n]||[]).map((h,m,b)=>{var S,C;if(m!==b.length-1||h.type!=="assistant")return h;const x=(S=h.steps)==null?void 0:S.findIndex(E=>E.status==="running");if(x!==void 0&&x!==-1&&h.steps&&h.steps[x]){const E=d((C=h.steps[x])==null?void 0:C.toolCalls);if(E){const T=h.steps.map((L,D)=>D===x?{...L,toolCalls:E}:L);return{...h,steps:T}}}if(h.steps){let E=!1;const T=h.steps.map(L=>{if(E)return L;const D=d(L.toolCalls);return D?(E=!0,{...L,toolCalls:D}):L});if(E)return{...h,steps:T}}const w=d(h.toolCalls);return w?{...h,toolCalls:w}:h});return{messagesBySession:{...l.messagesBySession,[n]:p}}}),startGeneration:n=>t(a=>({generatingSessions:a.generatingSessions.includes(n)?a.generatingSessions:[...a.generatingSessions,n]})),endGeneration:(n,a,r)=>t(i=>{var w,S,C;const l=i.messagesBySession[n]||[],c=Date.now(),d=UA(a),p=i5(a),h=(r==null?void 0:r.force)===!0,m=E=>!h&&E.waitingUser===!0,b=l.map(E=>{var B,H;let T=!1;const L=(B=E.steps)==null?void 0:B.map(K=>{if(!K.toolCalls)return K;const U=K.toolCalls.map(q=>q.status!=="running"||m(q)?q:(T=!0,{...q,status:"error",result:d,ended:p,duration:Math.max(0,c-(q.timestamp||c))}));return U!==K.toolCalls?{...K,toolCalls:U}:K}),D=(H=E.toolCalls)==null?void 0:H.map(K=>K.status!=="running"||m(K)?K:(T=!0,{...K,status:"error",result:d,ended:p,duration:Math.max(0,c-(K.timestamp||c))}));return T?{...E,steps:L,toolCalls:D}:E}),x=b[b.length-1];if(x&&x.type==="assistant"&&!x.content&&!x.thinking&&!((w=x.thinkingBlocks)!=null&&w.length)&&!((S=x.steps)!=null&&S.length)&&!((C=x.toolCalls)!=null&&C.length)&&!x.hookApproval&&!x.errorCard){const{[n]:E,...T}=i.messagesBySession;return{generatingSessions:i.generatingSessions.filter(L=>L!==n),pausedSessions:i.pausedSessions.filter(L=>L!==n),messagesBySession:{...T,[n]:b.slice(0,-1)}}}return{generatingSessions:i.generatingSessions.filter(E=>E!==n),pausedSessions:i.pausedSessions.filter(E=>E!==n),messagesBySession:{...i.messagesBySession,[n]:b}}}),pauseGeneration:n=>t(a=>({pausedSessions:a.pausedSessions.includes(n)?a.pausedSessions:[...a.pausedSessions,n]})),resumeGeneration:n=>t(a=>({pausedSessions:a.pausedSessions.filter(r=>r!==n)})),clearMessages:n=>t(a=>{const{[n]:r,...i}=a.messagesBySession,{[n]:l,...c}=a.pendingBySession;return{messagesBySession:i,pendingBySession:c}}),removeSession:n=>t(a=>{const{[n]:r,...i}=a.messagesBySession,{[n]:l,...c}=a.sessionInputs,{[n]:d,...p}=a.pendingBySession;return{messagesBySession:i,sessionInputs:c,pendingBySession:p,generatingSessions:a.generatingSessions.filter(h=>h!==n)}}),setSessionInput:(n,a)=>t(r=>({sessionInputs:{...r.sessionInputs,[n]:a}})),getSessionInput:n=>e().sessionInputs[n]||"",enqueuePending:(n,a,r,i,l)=>{const c={id:`queued-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,content:a,files:r,images:i,...l?{display:l}:{},createdAt:Date.now()};t(d=>({pendingBySession:{...d.pendingBySession,[n]:[...d.pendingBySession[n]||[],c]}}))},getPending:n=>e().pendingBySession[n]||[],clearPending:n=>{const a=e().pendingBySession[n];return!a||a.length===0?0:(t(r=>{const{[n]:i,...l}=r.pendingBySession;return{pendingBySession:l}}),a.length)},shiftPending:n=>{const a=e().pendingBySession[n];if(!a||a.length===0)return;const r=a[0],i=a.slice(1);return t(l=>{if(i.length===0){const{[n]:c,...d}=l.pendingBySession;return{pendingBySession:d}}return{pendingBySession:{...l.pendingBySession,[n]:i}}}),r},promotePending:(n,a)=>{const r=e().pendingBySession[n];if(!r||r.length<2)return;const i=r.findIndex(d=>d.id===a);if(i<=0)return;const l=r[i];if(!l)return;const c=r.filter(d=>d.id!==a);t(d=>({pendingBySession:{...d.pendingBySession,[n]:[l,...c]}}))},removePending:(n,a)=>{const r=e().pendingBySession[n],i=r==null?void 0:r.find(l=>l.id===a);if(i)return t(l=>{const c=(l.pendingBySession[n]||[]).filter(d=>d.id!==a);if(c.length===0){const{[n]:d,...p}=l.pendingBySession;return{pendingBySession:p}}return{pendingBySession:{...l.pendingBySession,[n]:c}}}),i},attachHookApproval:(n,a)=>t(r=>{const i=r.messagesBySession[n]||[];if(i.length===0){const p={id:`hook-approval-${a.approvalId||Date.now()}`,type:"assistant",content:"",timestamp:Date.now(),hookApproval:a};return{messagesBySession:{...r.messagesBySession,[n]:[p]}}}const l=i.length-1,c=i[l];if(c&&c.type==="assistant"){const p=i.slice();return p[l]={...c,hookApproval:a},{messagesBySession:{...r.messagesBySession,[n]:p}}}const d={id:`hook-approval-${a.approvalId||Date.now()}`,type:"assistant",content:"",timestamp:Date.now(),hookApproval:a};return{messagesBySession:{...r.messagesBySession,[n]:[...i,d].slice(-200)}}}),updateHookApprovalStatus:(n,a,r)=>t(i=>{const l=i.messagesBySession[n];if(!l)return i;const c=l.map(d=>{var p;return((p=d.hookApproval)==null?void 0:p.approvalId)===a?{...d,hookApproval:{...d.hookApproval,status:r}}:d});return{messagesBySession:{...i.messagesBySession,[n]:c}}}),setMessageFileJob:(n,a)=>t(r=>{const i=r.messagesBySession[n]||[];if(i.length===0){const p={id:`filejob-${a.jobId}`,type:"assistant",content:"",timestamp:Date.now(),fileJob:a};return{messagesBySession:{...r.messagesBySession,[n]:[p]}}}const l=i.length-1,c=i[l];if(c&&c.type==="assistant"){const p=i.slice();return p[l]={...c,fileJob:c.fileJob?{...c.fileJob,...a,attachments:a.attachments??c.fileJob.attachments,jobId:c.fileJob.jobId,updatedAt:Date.now()}:{...a,updatedAt:Date.now()}},{messagesBySession:{...r.messagesBySession,[n]:p}}}const d={id:`filejob-${a.jobId}`,type:"assistant",content:"",timestamp:Date.now(),fileJob:a};return{messagesBySession:{...r.messagesBySession,[n]:[...i,d].slice(-200)}}}),attachErrorCard:(n,a)=>t(r=>{const i=r.messagesBySession[n];if(!i||i.length===0)return r;const l=i.length-1,c=i[l];if(c&&c.type==="assistant"){const d=i.slice();return d[l]={...c,errorCard:a},{messagesBySession:{...r.messagesBySession,[n]:d}}}return r}),setTurnSummary:(n,a)=>t(r=>{const i=r.messagesBySession[n];if(!i||i.length===0)return r;const l=i.length-1,c=i[l];if(!c||c.type!=="assistant")return r;const d=i.slice();return d[l]={...c,summary:a},{messagesBySession:{...r.messagesBySession,[n]:d}}}),applyTombstone:(n,a)=>t(r=>{const i=r.messagesBySession[n];if(!i||i.length===0)return r;const l=new Set(a),c=i.map(d=>l.has(d.id)?{...d,deleted:!0}:d);return{messagesBySession:{...r.messagesBySession,[n]:c}}}),isGenerating:n=>e().generatingSessions.includes(n),isPaused:n=>e().pausedSessions.includes(n),clearGenerating:n=>t(a=>{const r=n?a.generatingSessions.filter(l=>l!==n):[],i=n?a.pausedSessions.filter(l=>l!==n):[];return r.length===a.generatingSessions.length&&i.length===a.pausedSessions.length?a:{generatingSessions:r,pausedSessions:i}})}),{name:BA,storage:VA,partialize:t=>({messagesBySession:t.messagesBySession,sessionInputs:t.sessionInputs})}));let sg=null;function y4(t){sg=t}function b4(t){const e=Me.getState();if(e.isGenerating(t))return;const n=e.shiftPending(t);return n&&sg&&sg(t,n),n}const WA=Nn(t=>({observed:[],setObserved:e=>t({observed:e})}));var At;(function(t){t.assertEqual=r=>{};function e(r){}t.assertIs=e;function n(r){throw new Error}t.assertNever=n,t.arrayToEnum=r=>{const i={};for(const l of r)i[l]=l;return i},t.getValidEnumValues=r=>{const i=t.objectKeys(r).filter(c=>typeof r[r[c]]!="number"),l={};for(const c of i)l[c]=r[c];return t.objectValues(l)},t.objectValues=r=>t.objectKeys(r).map(function(i){return r[i]}),t.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const i=[];for(const l in r)Object.prototype.hasOwnProperty.call(r,l)&&i.push(l);return i},t.find=(r,i)=>{for(const l of r)if(i(l))return l},t.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function a(r,i=" | "){return r.map(l=>typeof l=="string"?`'${l}'`:l).join(i)}t.joinValues=a,t.jsonStringifyReplacer=(r,i)=>typeof i=="bigint"?i.toString():i})(At||(At={}));var v4;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(v4||(v4={}));const Oe=At.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),mi=t=>{switch(typeof t){case"undefined":return Oe.undefined;case"string":return Oe.string;case"number":return Number.isNaN(t)?Oe.nan:Oe.number;case"boolean":return Oe.boolean;case"function":return Oe.function;case"bigint":return Oe.bigint;case"symbol":return Oe.symbol;case"object":return Array.isArray(t)?Oe.array:t===null?Oe.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Oe.promise:typeof Map<"u"&&t instanceof Map?Oe.map:typeof Set<"u"&&t instanceof Set?Oe.set:typeof Date<"u"&&t instanceof Date?Oe.date:Oe.object;default:return Oe.unknown}},xe=At.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class As extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(i){return i.message},a={_errors:[]},r=i=>{for(const l of i.issues)if(l.code==="invalid_union")l.unionErrors.map(r);else if(l.code==="invalid_return_type")r(l.returnTypeError);else if(l.code==="invalid_arguments")r(l.argumentsError);else if(l.path.length===0)a._errors.push(n(l));else{let c=a,d=0;for(;d<l.path.length;){const p=l.path[d];d===l.path.length-1?(c[p]=c[p]||{_errors:[]},c[p]._errors.push(n(l))):c[p]=c[p]||{_errors:[]},c=c[p],d++}}};return r(this),a}static assert(e){if(!(e instanceof As))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,At.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},a=[];for(const r of this.issues)if(r.path.length>0){const i=r.path[0];n[i]=n[i]||[],n[i].push(e(r))}else a.push(e(r));return{formErrors:a,fieldErrors:n}}get formErrors(){return this.flatten()}}As.create=t=>new As(t);const ig=(t,e)=>{let n;switch(t.code){case xe.invalid_type:t.received===Oe.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case xe.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,At.jsonStringifyReplacer)}`;break;case xe.unrecognized_keys:n=`Unrecognized key(s) in object: ${At.joinValues(t.keys,", ")}`;break;case xe.invalid_union:n="Invalid input";break;case xe.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${At.joinValues(t.options)}`;break;case xe.invalid_enum_value:n=`Invalid enum value. Expected ${At.joinValues(t.options)}, received '${t.received}'`;break;case xe.invalid_arguments:n="Invalid function arguments";break;case xe.invalid_return_type:n="Invalid function return type";break;case xe.invalid_date:n="Invalid date";break;case xe.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:At.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case xe.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case xe.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case xe.custom:n="Invalid input";break;case xe.invalid_intersection_types:n="Intersection results could not be merged";break;case xe.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case xe.not_finite:n="Number must be finite";break;default:n=e.defaultError,At.assertNever(t)}return{message:n}};let KA=ig;function YA(){return KA}const ZA=t=>{const{data:e,path:n,errorMaps:a,issueData:r}=t,i=[...n,...r.path||[]],l={...r,path:i};if(r.message!==void 0)return{...r,path:i,message:r.message};let c="";const d=a.filter(p=>!!p).slice().reverse();for(const p of d)c=p(l,{data:e,defaultError:c}).message;return{...r,path:i,message:c}};function Te(t,e){const n=YA(),a=ZA({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===ig?void 0:ig].filter(r=>!!r)});t.common.issues.push(a)}class sa{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const a=[];for(const r of n){if(r.status==="aborted")return tt;r.status==="dirty"&&e.dirty(),a.push(r.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,n){const a=[];for(const r of n){const i=await r.key,l=await r.value;a.push({key:i,value:l})}return sa.mergeObjectSync(e,a)}static mergeObjectSync(e,n){const a={};for(const r of n){const{key:i,value:l}=r;if(i.status==="aborted"||l.status==="aborted")return tt;i.status==="dirty"&&e.dirty(),l.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof l.value<"u"||r.alwaysSet)&&(a[i.value]=l.value)}return{status:e.value,value:a}}}const tt=Object.freeze({status:"aborted"}),Uc=t=>({status:"dirty",value:t}),lr=t=>({status:"valid",value:t}),x4=t=>t.status==="aborted",w4=t=>t.status==="dirty",_l=t=>t.status==="valid",G0=t=>typeof Promise<"u"&&t instanceof Promise;var ze;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(ze||(ze={}));class Fr{constructor(e,n,a,r){this._cachedPath=[],this.parent=e,this.data=n,this._path=a,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const k4=(t,e)=>{if(_l(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new As(t.common.issues);return this._error=n,this._error}}};function mt(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:a,description:r}=t;if(e&&(n||a))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(l,c)=>{const{message:d}=t;return l.code==="invalid_enum_value"?{message:d??c.defaultError}:typeof c.data>"u"?{message:d??a??c.defaultError}:l.code!=="invalid_type"?{message:c.defaultError}:{message:d??n??c.defaultError}},description:r}}class St{get description(){return this._def.description}_getType(e){return mi(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:mi(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new sa,ctx:{common:e.parent.common,data:e.data,parsedType:mi(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(G0(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const a=this.safeParse(e,n);if(a.success)return a.data;throw a.error}safeParse(e,n){const a={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:mi(e)},r=this._parseSync({data:e,path:a.path,parent:a});return k4(a,r)}"~validate"(e){var a,r;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:mi(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:n});return _l(i)?{value:i.value}:{issues:n.common.issues}}catch(i){(r=(a=i==null?void 0:i.message)==null?void 0:a.toLowerCase())!=null&&r.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(i=>_l(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(e,n){const a=await this.safeParseAsync(e,n);if(a.success)return a.data;throw a.error}async safeParseAsync(e,n){const a={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:mi(e)},r=this._parse({data:e,path:a.path,parent:a}),i=await(G0(r)?r:Promise.resolve(r));return k4(a,i)}refine(e,n){const a=r=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(r):n;return this._refinement((r,i)=>{const l=e(r),c=()=>i.addIssue({code:xe.custom,...a(r)});return typeof Promise<"u"&&l instanceof Promise?l.then(d=>d?!0:(c(),!1)):l?!0:(c(),!1)})}refinement(e,n){return this._refinement((a,r)=>e(a)?!0:(r.addIssue(typeof n=="function"?n(a,r):n),!1))}_refinement(e){return new Tl({schema:this,typeName:et.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return wi.create(this,this._def)}nullable(){return El.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return $r.create(this)}promise(){return Y0.create(this,this._def)}or(e){return V0.create([this,e],this._def)}and(e){return W0.create(this,e,this._def)}transform(e){return new Tl({...mt(this._def),schema:this,typeName:et.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new pg({...mt(this._def),innerType:this,defaultValue:n,typeName:et.ZodDefault})}brand(){return new vT({typeName:et.ZodBranded,type:this,...mt(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new fg({...mt(this._def),innerType:this,catchValue:n,typeName:et.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return v1.create(this,e)}readonly(){return hg.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const XA=/^c[^\s-]{8,}$/i,QA=/^[0-9a-z]+$/,JA=/^[0-9A-HJKMNP-TV-Z]{26}$/i,eT=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,tT=/^[a-z0-9_-]{21}$/i,nT=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,aT=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,rT=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,sT="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let rm;const iT=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,oT=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,lT=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,cT=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,uT=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,dT=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,c5="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",pT=new RegExp(`^${c5}$`);function u5(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function fT(t){return new RegExp(`^${u5(t)}$`)}function hT(t){let e=`${c5}T${u5(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function mT(t,e){return!!((e==="v4"||!e)&&iT.test(t)||(e==="v6"||!e)&&lT.test(t))}function gT(t,e){if(!nT.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const a=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(a));return!(typeof r!="object"||r===null||"typ"in r&&(r==null?void 0:r.typ)!=="JWT"||!r.alg||e&&r.alg!==e)}catch{return!1}}function yT(t,e){return!!((e==="v4"||!e)&&oT.test(t)||(e==="v6"||!e)&&cT.test(t))}class ks extends St{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Oe.string){const i=this._getOrReturnCtx(e);return Te(i,{code:xe.invalid_type,expected:Oe.string,received:i.parsedType}),tt}const a=new sa;let r;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(r=this._getOrReturnCtx(e,r),Te(r,{code:xe.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),a.dirty());else if(i.kind==="max")e.data.length>i.value&&(r=this._getOrReturnCtx(e,r),Te(r,{code:xe.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),a.dirty());else if(i.kind==="length"){const l=e.data.length>i.value,c=e.data.length<i.value;(l||c)&&(r=this._getOrReturnCtx(e,r),l?Te(r,{code:xe.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):c&&Te(r,{code:xe.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),a.dirty())}else if(i.kind==="email")rT.test(e.data)||(r=this._getOrReturnCtx(e,r),Te(r,{validation:"email",code:xe.invalid_string,message:i.message}),a.dirty());else if(i.kind==="emoji")rm||(rm=new RegExp(sT,"u")),rm.test(e.data)||(r=this._getOrReturnCtx(e,r),Te(r,{validation:"emoji",code:xe.invalid_string,message:i.message}),a.dirty());else if(i.kind==="uuid")eT.test(e.data)||(r=this._getOrReturnCtx(e,r),Te(r,{validation:"uuid",code:xe.invalid_string,message:i.message}),a.dirty());else if(i.kind==="nanoid")tT.test(e.data)||(r=this._getOrReturnCtx(e,r),Te(r,{validation:"nanoid",code:xe.invalid_string,message:i.message}),a.dirty());else if(i.kind==="cuid")XA.test(e.data)||(r=this._getOrReturnCtx(e,r),Te(r,{validation:"cuid",code:xe.invalid_string,message:i.message}),a.dirty());else if(i.kind==="cuid2")QA.test(e.data)||(r=this._getOrReturnCtx(e,r),Te(r,{validation:"cuid2",code:xe.invalid_string,message:i.message}),a.dirty());else if(i.kind==="ulid")JA.test(e.data)||(r=this._getOrReturnCtx(e,r),Te(r,{validation:"ulid",code:xe.invalid_string,message:i.message}),a.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),Te(r,{validation:"url",code:xe.invalid_string,message:i.message}),a.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),Te(r,{validation:"regex",code:xe.invalid_string,message:i.message}),a.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(r=this._getOrReturnCtx(e,r),Te(r,{code:xe.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),a.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(r=this._getOrReturnCtx(e,r),Te(r,{code:xe.invalid_string,validation:{startsWith:i.value},message:i.message}),a.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(r=this._getOrReturnCtx(e,r),Te(r,{code:xe.invalid_string,validation:{endsWith:i.value},message:i.message}),a.dirty()):i.kind==="datetime"?hT(i).test(e.data)||(r=this._getOrReturnCtx(e,r),Te(r,{code:xe.invalid_string,validation:"datetime",message:i.message}),a.dirty()):i.kind==="date"?pT.test(e.data)||(r=this._getOrReturnCtx(e,r),Te(r,{code:xe.invalid_string,validation:"date",message:i.message}),a.dirty()):i.kind==="time"?fT(i).test(e.data)||(r=this._getOrReturnCtx(e,r),Te(r,{code:xe.invalid_string,validation:"time",message:i.message}),a.dirty()):i.kind==="duration"?aT.test(e.data)||(r=this._getOrReturnCtx(e,r),Te(r,{validation:"duration",code:xe.invalid_string,message:i.message}),a.dirty()):i.kind==="ip"?mT(e.data,i.version)||(r=this._getOrReturnCtx(e,r),Te(r,{validation:"ip",code:xe.invalid_string,message:i.message}),a.dirty()):i.kind==="jwt"?gT(e.data,i.alg)||(r=this._getOrReturnCtx(e,r),Te(r,{validation:"jwt",code:xe.invalid_string,message:i.message}),a.dirty()):i.kind==="cidr"?yT(e.data,i.version)||(r=this._getOrReturnCtx(e,r),Te(r,{validation:"cidr",code:xe.invalid_string,message:i.message}),a.dirty()):i.kind==="base64"?uT.test(e.data)||(r=this._getOrReturnCtx(e,r),Te(r,{validation:"base64",code:xe.invalid_string,message:i.message}),a.dirty()):i.kind==="base64url"?dT.test(e.data)||(r=this._getOrReturnCtx(e,r),Te(r,{validation:"base64url",code:xe.invalid_string,message:i.message}),a.dirty()):At.assertNever(i);return{status:a.value,value:e.data}}_regex(e,n,a){return this.refinement(r=>e.test(r),{validation:n,code:xe.invalid_string,...ze.errToObj(a)})}_addCheck(e){return new ks({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ze.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ze.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ze.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ze.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...ze.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ze.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ze.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ze.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...ze.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...ze.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...ze.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ze.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...ze.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...ze.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...ze.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...ze.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...ze.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...ze.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...ze.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...ze.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...ze.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...ze.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...ze.errToObj(n)})}nonempty(e){return this.min(1,ze.errToObj(e))}trim(){return new ks({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ks({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ks({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}ks.create=t=>new ks({checks:[],typeName:et.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...mt(t)});function bT(t,e){const n=(t.toString().split(".")[1]||"").length,a=(e.toString().split(".")[1]||"").length,r=n>a?n:a,i=Number.parseInt(t.toFixed(r).replace(".","")),l=Number.parseInt(e.toFixed(r).replace(".",""));return i%l/10**r}class Cl extends St{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Oe.number){const i=this._getOrReturnCtx(e);return Te(i,{code:xe.invalid_type,expected:Oe.number,received:i.parsedType}),tt}let a;const r=new sa;for(const i of this._def.checks)i.kind==="int"?At.isInteger(e.data)||(a=this._getOrReturnCtx(e,a),Te(a,{code:xe.invalid_type,expected:"integer",received:"float",message:i.message}),r.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(a=this._getOrReturnCtx(e,a),Te(a,{code:xe.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),r.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(a=this._getOrReturnCtx(e,a),Te(a,{code:xe.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),r.dirty()):i.kind==="multipleOf"?bT(e.data,i.value)!==0&&(a=this._getOrReturnCtx(e,a),Te(a,{code:xe.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(a=this._getOrReturnCtx(e,a),Te(a,{code:xe.not_finite,message:i.message}),r.dirty()):At.assertNever(i);return{status:r.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,ze.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ze.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ze.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ze.toString(n))}setLimit(e,n,a,r){return new Cl({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:a,message:ze.toString(r)}]})}_addCheck(e){return new Cl({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ze.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ze.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ze.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ze.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ze.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ze.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:ze.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ze.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ze.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&At.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(n===null||a.value>n)&&(n=a.value):a.kind==="max"&&(e===null||a.value<e)&&(e=a.value)}return Number.isFinite(n)&&Number.isFinite(e)}}Cl.create=t=>new Cl({checks:[],typeName:et.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...mt(t)});class du extends St{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==Oe.bigint)return this._getInvalidInput(e);let a;const r=new sa;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(a=this._getOrReturnCtx(e,a),Te(a,{code:xe.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),r.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(a=this._getOrReturnCtx(e,a),Te(a,{code:xe.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),r.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(a=this._getOrReturnCtx(e,a),Te(a,{code:xe.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):At.assertNever(i);return{status:r.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return Te(n,{code:xe.invalid_type,expected:Oe.bigint,received:n.parsedType}),tt}gte(e,n){return this.setLimit("min",e,!0,ze.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ze.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ze.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ze.toString(n))}setLimit(e,n,a,r){return new du({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:a,message:ze.toString(r)}]})}_addCheck(e){return new du({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ze.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ze.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ze.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ze.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ze.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}du.create=t=>new du({checks:[],typeName:et.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...mt(t)});class og extends St{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Oe.boolean){const a=this._getOrReturnCtx(e);return Te(a,{code:xe.invalid_type,expected:Oe.boolean,received:a.parsedType}),tt}return lr(e.data)}}og.create=t=>new og({typeName:et.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...mt(t)});class q0 extends St{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Oe.date){const i=this._getOrReturnCtx(e);return Te(i,{code:xe.invalid_type,expected:Oe.date,received:i.parsedType}),tt}if(Number.isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return Te(i,{code:xe.invalid_date}),tt}const a=new sa;let r;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(r=this._getOrReturnCtx(e,r),Te(r,{code:xe.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),a.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(r=this._getOrReturnCtx(e,r),Te(r,{code:xe.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),a.dirty()):At.assertNever(i);return{status:a.value,value:new Date(e.data.getTime())}}_addCheck(e){return new q0({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:ze.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:ze.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}q0.create=t=>new q0({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:et.ZodDate,...mt(t)});class S4 extends St{_parse(e){if(this._getType(e)!==Oe.symbol){const a=this._getOrReturnCtx(e);return Te(a,{code:xe.invalid_type,expected:Oe.symbol,received:a.parsedType}),tt}return lr(e.data)}}S4.create=t=>new S4({typeName:et.ZodSymbol,...mt(t)});class _4 extends St{_parse(e){if(this._getType(e)!==Oe.undefined){const a=this._getOrReturnCtx(e);return Te(a,{code:xe.invalid_type,expected:Oe.undefined,received:a.parsedType}),tt}return lr(e.data)}}_4.create=t=>new _4({typeName:et.ZodUndefined,...mt(t)});class C4 extends St{_parse(e){if(this._getType(e)!==Oe.null){const a=this._getOrReturnCtx(e);return Te(a,{code:xe.invalid_type,expected:Oe.null,received:a.parsedType}),tt}return lr(e.data)}}C4.create=t=>new C4({typeName:et.ZodNull,...mt(t)});class lg extends St{constructor(){super(...arguments),this._any=!0}_parse(e){return lr(e.data)}}lg.create=t=>new lg({typeName:et.ZodAny,...mt(t)});class cg extends St{constructor(){super(...arguments),this._unknown=!0}_parse(e){return lr(e.data)}}cg.create=t=>new cg({typeName:et.ZodUnknown,...mt(t)});class Ci extends St{_parse(e){const n=this._getOrReturnCtx(e);return Te(n,{code:xe.invalid_type,expected:Oe.never,received:n.parsedType}),tt}}Ci.create=t=>new Ci({typeName:et.ZodNever,...mt(t)});class A4 extends St{_parse(e){if(this._getType(e)!==Oe.undefined){const a=this._getOrReturnCtx(e);return Te(a,{code:xe.invalid_type,expected:Oe.void,received:a.parsedType}),tt}return lr(e.data)}}A4.create=t=>new A4({typeName:et.ZodVoid,...mt(t)});class $r extends St{_parse(e){const{ctx:n,status:a}=this._processInputParams(e),r=this._def;if(n.parsedType!==Oe.array)return Te(n,{code:xe.invalid_type,expected:Oe.array,received:n.parsedType}),tt;if(r.exactLength!==null){const l=n.data.length>r.exactLength.value,c=n.data.length<r.exactLength.value;(l||c)&&(Te(n,{code:l?xe.too_big:xe.too_small,minimum:c?r.exactLength.value:void 0,maximum:l?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),a.dirty())}if(r.minLength!==null&&n.data.length<r.minLength.value&&(Te(n,{code:xe.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),a.dirty()),r.maxLength!==null&&n.data.length>r.maxLength.value&&(Te(n,{code:xe.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),a.dirty()),n.common.async)return Promise.all([...n.data].map((l,c)=>r.type._parseAsync(new Fr(n,l,n.path,c)))).then(l=>sa.mergeArray(a,l));const i=[...n.data].map((l,c)=>r.type._parseSync(new Fr(n,l,n.path,c)));return sa.mergeArray(a,i)}get element(){return this._def.type}min(e,n){return new $r({...this._def,minLength:{value:e,message:ze.toString(n)}})}max(e,n){return new $r({...this._def,maxLength:{value:e,message:ze.toString(n)}})}length(e,n){return new $r({...this._def,exactLength:{value:e,message:ze.toString(n)}})}nonempty(e){return this.min(1,e)}}$r.create=(t,e)=>new $r({type:t,minLength:null,maxLength:null,exactLength:null,typeName:et.ZodArray,...mt(e)});function hl(t){if(t instanceof gn){const e={};for(const n in t.shape){const a=t.shape[n];e[n]=wi.create(hl(a))}return new gn({...t._def,shape:()=>e})}else return t instanceof $r?new $r({...t._def,type:hl(t.element)}):t instanceof wi?wi.create(hl(t.unwrap())):t instanceof El?El.create(hl(t.unwrap())):t instanceof So?So.create(t.items.map(e=>hl(e))):t}class gn extends St{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=At.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==Oe.object){const p=this._getOrReturnCtx(e);return Te(p,{code:xe.invalid_type,expected:Oe.object,received:p.parsedType}),tt}const{status:a,ctx:r}=this._processInputParams(e),{shape:i,keys:l}=this._getCached(),c=[];if(!(this._def.catchall instanceof Ci&&this._def.unknownKeys==="strip"))for(const p in r.data)l.includes(p)||c.push(p);const d=[];for(const p of l){const h=i[p],m=r.data[p];d.push({key:{status:"valid",value:p},value:h._parse(new Fr(r,m,r.path,p)),alwaysSet:p in r.data})}if(this._def.catchall instanceof Ci){const p=this._def.unknownKeys;if(p==="passthrough")for(const h of c)d.push({key:{status:"valid",value:h},value:{status:"valid",value:r.data[h]}});else if(p==="strict")c.length>0&&(Te(r,{code:xe.unrecognized_keys,keys:c}),a.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const p=this._def.catchall;for(const h of c){const m=r.data[h];d.push({key:{status:"valid",value:h},value:p._parse(new Fr(r,m,r.path,h)),alwaysSet:h in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const p=[];for(const h of d){const m=await h.key,b=await h.value;p.push({key:m,value:b,alwaysSet:h.alwaysSet})}return p}).then(p=>sa.mergeObjectSync(a,p)):sa.mergeObjectSync(a,d)}get shape(){return this._def.shape()}strict(e){return ze.errToObj,new gn({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,a)=>{var i,l;const r=((l=(i=this._def).errorMap)==null?void 0:l.call(i,n,a).message)??a.defaultError;return n.code==="unrecognized_keys"?{message:ze.errToObj(e).message??r}:{message:r}}}:{}})}strip(){return new gn({...this._def,unknownKeys:"strip"})}passthrough(){return new gn({...this._def,unknownKeys:"passthrough"})}extend(e){return new gn({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new gn({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:et.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new gn({...this._def,catchall:e})}pick(e){const n={};for(const a of At.objectKeys(e))e[a]&&this.shape[a]&&(n[a]=this.shape[a]);return new gn({...this._def,shape:()=>n})}omit(e){const n={};for(const a of At.objectKeys(this.shape))e[a]||(n[a]=this.shape[a]);return new gn({...this._def,shape:()=>n})}deepPartial(){return hl(this)}partial(e){const n={};for(const a of At.objectKeys(this.shape)){const r=this.shape[a];e&&!e[a]?n[a]=r:n[a]=r.optional()}return new gn({...this._def,shape:()=>n})}required(e){const n={};for(const a of At.objectKeys(this.shape))if(e&&!e[a])n[a]=this.shape[a];else{let i=this.shape[a];for(;i instanceof wi;)i=i._def.innerType;n[a]=i}return new gn({...this._def,shape:()=>n})}keyof(){return d5(At.objectKeys(this.shape))}}gn.create=(t,e)=>new gn({shape:()=>t,unknownKeys:"strip",catchall:Ci.create(),typeName:et.ZodObject,...mt(e)});gn.strictCreate=(t,e)=>new gn({shape:()=>t,unknownKeys:"strict",catchall:Ci.create(),typeName:et.ZodObject,...mt(e)});gn.lazycreate=(t,e)=>new gn({shape:t,unknownKeys:"strip",catchall:Ci.create(),typeName:et.ZodObject,...mt(e)});class V0 extends St{_parse(e){const{ctx:n}=this._processInputParams(e),a=this._def.options;function r(i){for(const c of i)if(c.result.status==="valid")return c.result;for(const c of i)if(c.result.status==="dirty")return n.common.issues.push(...c.ctx.common.issues),c.result;const l=i.map(c=>new As(c.ctx.common.issues));return Te(n,{code:xe.invalid_union,unionErrors:l}),tt}if(n.common.async)return Promise.all(a.map(async i=>{const l={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:l}),ctx:l}})).then(r);{let i;const l=[];for(const d of a){const p={...n,common:{...n.common,issues:[]},parent:null},h=d._parseSync({data:n.data,path:n.path,parent:p});if(h.status==="valid")return h;h.status==="dirty"&&!i&&(i={result:h,ctx:p}),p.common.issues.length&&l.push(p.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const c=l.map(d=>new As(d));return Te(n,{code:xe.invalid_union,unionErrors:c}),tt}}get options(){return this._def.options}}V0.create=(t,e)=>new V0({options:t,typeName:et.ZodUnion,...mt(e)});function ug(t,e){const n=mi(t),a=mi(e);if(t===e)return{valid:!0,data:t};if(n===Oe.object&&a===Oe.object){const r=At.objectKeys(e),i=At.objectKeys(t).filter(c=>r.indexOf(c)!==-1),l={...t,...e};for(const c of i){const d=ug(t[c],e[c]);if(!d.valid)return{valid:!1};l[c]=d.data}return{valid:!0,data:l}}else if(n===Oe.array&&a===Oe.array){if(t.length!==e.length)return{valid:!1};const r=[];for(let i=0;i<t.length;i++){const l=t[i],c=e[i],d=ug(l,c);if(!d.valid)return{valid:!1};r.push(d.data)}return{valid:!0,data:r}}else return n===Oe.date&&a===Oe.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class W0 extends St{_parse(e){const{status:n,ctx:a}=this._processInputParams(e),r=(i,l)=>{if(x4(i)||x4(l))return tt;const c=ug(i.value,l.value);return c.valid?((w4(i)||w4(l))&&n.dirty(),{status:n.value,value:c.data}):(Te(a,{code:xe.invalid_intersection_types}),tt)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([i,l])=>r(i,l)):r(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}W0.create=(t,e,n)=>new W0({left:t,right:e,typeName:et.ZodIntersection,...mt(n)});class So extends St{_parse(e){const{status:n,ctx:a}=this._processInputParams(e);if(a.parsedType!==Oe.array)return Te(a,{code:xe.invalid_type,expected:Oe.array,received:a.parsedType}),tt;if(a.data.length<this._def.items.length)return Te(a,{code:xe.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),tt;!this._def.rest&&a.data.length>this._def.items.length&&(Te(a,{code:xe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...a.data].map((l,c)=>{const d=this._def.items[c]||this._def.rest;return d?d._parse(new Fr(a,l,a.path,c)):null}).filter(l=>!!l);return a.common.async?Promise.all(i).then(l=>sa.mergeArray(n,l)):sa.mergeArray(n,i)}get items(){return this._def.items}rest(e){return new So({...this._def,rest:e})}}So.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new So({items:t,typeName:et.ZodTuple,rest:null,...mt(e)})};class K0 extends St{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:a}=this._processInputParams(e);if(a.parsedType!==Oe.object)return Te(a,{code:xe.invalid_type,expected:Oe.object,received:a.parsedType}),tt;const r=[],i=this._def.keyType,l=this._def.valueType;for(const c in a.data)r.push({key:i._parse(new Fr(a,c,a.path,c)),value:l._parse(new Fr(a,a.data[c],a.path,c)),alwaysSet:c in a.data});return a.common.async?sa.mergeObjectAsync(n,r):sa.mergeObjectSync(n,r)}get element(){return this._def.valueType}static create(e,n,a){return n instanceof St?new K0({keyType:e,valueType:n,typeName:et.ZodRecord,...mt(a)}):new K0({keyType:ks.create(),valueType:e,typeName:et.ZodRecord,...mt(n)})}}class T4 extends St{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:a}=this._processInputParams(e);if(a.parsedType!==Oe.map)return Te(a,{code:xe.invalid_type,expected:Oe.map,received:a.parsedType}),tt;const r=this._def.keyType,i=this._def.valueType,l=[...a.data.entries()].map(([c,d],p)=>({key:r._parse(new Fr(a,c,a.path,[p,"key"])),value:i._parse(new Fr(a,d,a.path,[p,"value"]))}));if(a.common.async){const c=new Map;return Promise.resolve().then(async()=>{for(const d of l){const p=await d.key,h=await d.value;if(p.status==="aborted"||h.status==="aborted")return tt;(p.status==="dirty"||h.status==="dirty")&&n.dirty(),c.set(p.value,h.value)}return{status:n.value,value:c}})}else{const c=new Map;for(const d of l){const p=d.key,h=d.value;if(p.status==="aborted"||h.status==="aborted")return tt;(p.status==="dirty"||h.status==="dirty")&&n.dirty(),c.set(p.value,h.value)}return{status:n.value,value:c}}}}T4.create=(t,e,n)=>new T4({valueType:e,keyType:t,typeName:et.ZodMap,...mt(n)});class pu extends St{_parse(e){const{status:n,ctx:a}=this._processInputParams(e);if(a.parsedType!==Oe.set)return Te(a,{code:xe.invalid_type,expected:Oe.set,received:a.parsedType}),tt;const r=this._def;r.minSize!==null&&a.data.size<r.minSize.value&&(Te(a,{code:xe.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),n.dirty()),r.maxSize!==null&&a.data.size>r.maxSize.value&&(Te(a,{code:xe.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty());const i=this._def.valueType;function l(d){const p=new Set;for(const h of d){if(h.status==="aborted")return tt;h.status==="dirty"&&n.dirty(),p.add(h.value)}return{status:n.value,value:p}}const c=[...a.data.values()].map((d,p)=>i._parse(new Fr(a,d,a.path,p)));return a.common.async?Promise.all(c).then(d=>l(d)):l(c)}min(e,n){return new pu({...this._def,minSize:{value:e,message:ze.toString(n)}})}max(e,n){return new pu({...this._def,maxSize:{value:e,message:ze.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}pu.create=(t,e)=>new pu({valueType:t,minSize:null,maxSize:null,typeName:et.ZodSet,...mt(e)});class E4 extends St{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}E4.create=(t,e)=>new E4({getter:t,typeName:et.ZodLazy,...mt(e)});class dg extends St{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return Te(n,{received:n.data,code:xe.invalid_literal,expected:this._def.value}),tt}return{status:"valid",value:e.data}}get value(){return this._def.value}}dg.create=(t,e)=>new dg({value:t,typeName:et.ZodLiteral,...mt(e)});function d5(t,e){return new Al({values:t,typeName:et.ZodEnum,...mt(e)})}class Al extends St{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),a=this._def.values;return Te(n,{expected:At.joinValues(a),received:n.parsedType,code:xe.invalid_type}),tt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),a=this._def.values;return Te(n,{received:n.data,code:xe.invalid_enum_value,options:a}),tt}return lr(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return Al.create(e,{...this._def,...n})}exclude(e,n=this._def){return Al.create(this.options.filter(a=>!e.includes(a)),{...this._def,...n})}}Al.create=d5;class N4 extends St{_parse(e){const n=At.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==Oe.string&&a.parsedType!==Oe.number){const r=At.objectValues(n);return Te(a,{expected:At.joinValues(r),received:a.parsedType,code:xe.invalid_type}),tt}if(this._cache||(this._cache=new Set(At.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const r=At.objectValues(n);return Te(a,{received:a.data,code:xe.invalid_enum_value,options:r}),tt}return lr(e.data)}get enum(){return this._def.values}}N4.create=(t,e)=>new N4({values:t,typeName:et.ZodNativeEnum,...mt(e)});class Y0 extends St{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Oe.promise&&n.common.async===!1)return Te(n,{code:xe.invalid_type,expected:Oe.promise,received:n.parsedType}),tt;const a=n.parsedType===Oe.promise?n.data:Promise.resolve(n.data);return lr(a.then(r=>this._def.type.parseAsync(r,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Y0.create=(t,e)=>new Y0({type:t,typeName:et.ZodPromise,...mt(e)});class Tl extends St{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===et.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:a}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:l=>{Te(a,l),l.fatal?n.abort():n.dirty()},get path(){return a.path}};if(i.addIssue=i.addIssue.bind(i),r.type==="preprocess"){const l=r.transform(a.data,i);if(a.common.async)return Promise.resolve(l).then(async c=>{if(n.value==="aborted")return tt;const d=await this._def.schema._parseAsync({data:c,path:a.path,parent:a});return d.status==="aborted"?tt:d.status==="dirty"||n.value==="dirty"?Uc(d.value):d});{if(n.value==="aborted")return tt;const c=this._def.schema._parseSync({data:l,path:a.path,parent:a});return c.status==="aborted"?tt:c.status==="dirty"||n.value==="dirty"?Uc(c.value):c}}if(r.type==="refinement"){const l=c=>{const d=r.refinement(c,i);if(a.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(a.common.async===!1){const c=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return c.status==="aborted"?tt:(c.status==="dirty"&&n.dirty(),l(c.value),{status:n.value,value:c.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(c=>c.status==="aborted"?tt:(c.status==="dirty"&&n.dirty(),l(c.value).then(()=>({status:n.value,value:c.value}))))}if(r.type==="transform")if(a.common.async===!1){const l=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!_l(l))return tt;const c=r.transform(l.value,i);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:c}}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(l=>_l(l)?Promise.resolve(r.transform(l.value,i)).then(c=>({status:n.value,value:c})):tt);At.assertNever(r)}}Tl.create=(t,e,n)=>new Tl({schema:t,typeName:et.ZodEffects,effect:e,...mt(n)});Tl.createWithPreprocess=(t,e,n)=>new Tl({schema:e,effect:{type:"preprocess",transform:t},typeName:et.ZodEffects,...mt(n)});class wi extends St{_parse(e){return this._getType(e)===Oe.undefined?lr(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}wi.create=(t,e)=>new wi({innerType:t,typeName:et.ZodOptional,...mt(e)});class El extends St{_parse(e){return this._getType(e)===Oe.null?lr(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}El.create=(t,e)=>new El({innerType:t,typeName:et.ZodNullable,...mt(e)});class pg extends St{_parse(e){const{ctx:n}=this._processInputParams(e);let a=n.data;return n.parsedType===Oe.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}pg.create=(t,e)=>new pg({innerType:t,typeName:et.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...mt(e)});class fg extends St{_parse(e){const{ctx:n}=this._processInputParams(e),a={...n,common:{...n.common,issues:[]}},r=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return G0(r)?r.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new As(a.common.issues)},input:a.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new As(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}fg.create=(t,e)=>new fg({innerType:t,typeName:et.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...mt(e)});class R4 extends St{_parse(e){if(this._getType(e)!==Oe.nan){const a=this._getOrReturnCtx(e);return Te(a,{code:xe.invalid_type,expected:Oe.nan,received:a.parsedType}),tt}return{status:"valid",value:e.data}}}R4.create=t=>new R4({typeName:et.ZodNaN,...mt(t)});class vT extends St{_parse(e){const{ctx:n}=this._processInputParams(e),a=n.data;return this._def.type._parse({data:a,path:n.path,parent:n})}unwrap(){return this._def.type}}class v1 extends St{_parse(e){const{status:n,ctx:a}=this._processInputParams(e);if(a.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return i.status==="aborted"?tt:i.status==="dirty"?(n.dirty(),Uc(i.value)):this._def.out._parseAsync({data:i.value,path:a.path,parent:a})})();{const r=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return r.status==="aborted"?tt:r.status==="dirty"?(n.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:a.path,parent:a})}}static create(e,n){return new v1({in:e,out:n,typeName:et.ZodPipeline})}}class hg extends St{_parse(e){const n=this._def.innerType._parse(e),a=r=>(_l(r)&&(r.value=Object.freeze(r.value)),r);return G0(n)?n.then(r=>a(r)):a(n)}unwrap(){return this._def.innerType}}hg.create=(t,e)=>new hg({innerType:t,typeName:et.ZodReadonly,...mt(e)});var et;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(et||(et={}));const ee=ks.create,dt=Cl.create,rr=og.create,oo=lg.create,Nu=cg.create;Ci.create;const yr=$r.create,qe=gn.create,xT=V0.create;W0.create;So.create;const wT=K0.create,x1=dg.create,fu=Al.create;Y0.create;wi.create;El.create;function ae(t){return{schema:Nu(),...t}}const _p=[];let D4=new Set;function wa(t){for(const e of t){if(D4.has(e.type))throw new Error(`[protocol] duplicate event type: ${e.type}`);D4.add(e.type),_p.push(e)}return t}function t0(t){return _p.find(e=>e.type===t)}new Proxy({},{get:(t,e)=>{var n;return typeof e=="string"?(n=t0(e))==null?void 0:n.schema:void 0},has:(t,e)=>{var n;return typeof e=="string"?!!((n=t0(e))!=null&&n.schema):!1},ownKeys:()=>_p.map(t=>t.type),getOwnPropertyDescriptor:(t,e)=>{var n;return typeof e=="string"&&t0(e)?{enumerable:!0,configurable:!0,value:(n=t0(e))==null?void 0:n.schema}:void 0}});wa([ae({type:"connected",description:"WebSocket 已连接",category:"session",emittedBy:["server"],handledByCli:!0,handledByWeb:!0}),ae({type:"session_created",description:"新会话已创建",category:"session",emittedBy:["server","core"],handledByCli:!0,handledByWeb:!0,note:"CLI/Web 均已处理(Web: systemHandlers session_created)",schema:qe({id:ee(),title:ee().optional()}).partial()}),ae({type:"session_resumed",description:"会话从存储中恢复",category:"session",emittedBy:["core","server"],handledByCli:!0,handledByWeb:!0,note:"CLI/Web 均已处理(Web: systemHandlers session_resumed)",schema:qe({id:ee()}).partial()}),ae({type:"auth_required",description:"需要认证",category:"session",emittedBy:["server"],handledByCli:!0,handledByWeb:!0,note:"CLI 已处理(2026-07-18)"}),ae({type:"auth_success",description:"认证成功",category:"session",emittedBy:["server"],handledByCli:!0,handledByWeb:!0,note:"CLI 已处理(2026-07-18)"}),ae({type:"auth_failed",description:"认证失败",category:"session",emittedBy:["server"],handledByCli:!0,handledByWeb:!0,note:"CLI 已处理(2026-07-18)"}),ae({type:"message_ack",description:"消息确认",category:"session",emittedBy:["client"],handledByCli:!1,handledByWeb:!1,note:"CLI 发送给服务器的入站事件,无需 handler"}),ae({type:"workspace_changed",description:"工作空间已切换",category:"session",emittedBy:["server"],handledByCli:!0,handledByWeb:!0,schema:qe({workspaceDir:ee()}).partial()}),ae({type:"session_switched",description:"会话已切换",category:"session",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"CLI 已处理(2026-07-18); Web 已处理(切换 activeSessionId)",schema:qe({id:ee()}).partial()}),ae({type:"disconnected",description:"连接断开",category:"session",emittedBy:["server"],handledByCli:!0,handledByWeb:!0}),ae({type:"session_delegation_start",description:"会话 A 向会话 B 发起委派任务(send_to_session 工具)",category:"session",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"客户端把 task 作为一条系统消息展示在目标会话(B)时间线上;A 阻塞等待 B 完成",schema:qe({fromSessionId:ee(),fromTitle:ee(),toSessionId:ee(),toTitle:ee(),task:ee()}).partial()}),ae({type:"session_delegation_end",description:"会话委派任务完成(成功/失败)",category:"session",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"结果回填到 A 的 send_to_session 工具结果;客户端据此关闭目标会话的委派横幅",schema:qe({fromSessionId:ee(),toSessionId:ee(),ok:rr(),summary:ee()}).partial()}),ae({type:"session_direct_delivered",description:"用户消息经会话 A 直连投递给会话 B(deliverDirectMessage,不经 A 的模型)",category:"session",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"投递卡渲染在 A(邮局)的时间线;queued=true 表示 B 正在跑、已排队作新一轮(复用 delegationQueue 互斥门)",schema:qe({fromSessionId:ee(),fromTitle:ee(),toSessionId:ee(),toTitle:ee(),text:ee(),deliveryId:ee(),traceId:ee(),hopCount:dt(),queued:rr()}).partial()}),ae({type:"session_direct_completed",description:"直连消息在会话 B 执行完成(成功/失败),结果转达回 A",category:"session",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"回复卡渲染在 A 的时间线:summary 是展示优化,outputMessageIds 是事实链(可回溯 B 的原始输出)",schema:qe({fromSessionId:ee(),toSessionId:ee(),deliveryId:ee(),traceId:ee(),hopCount:dt(),ok:rr(),status:ee(),summary:ee(),outputMessageIds:yr(ee())}).partial()})]);wa([ae({type:"start",description:"AI 开始生成",category:"stream",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ae({type:"content",description:"生成内容增量",category:"stream",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,schema:qe({text:ee(),content:ee(),index:dt()}).partial(),note:"载荷 { text, index }:index 为服务端稳定 block index(TurnEngine 每轮分配),客户端据此把多段正文与思考/工具按时间序穿插;content 为兼容旧字段"}),ae({type:"thinking",description:"思考过程增量",category:"stream",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,schema:qe({text:ee(),content:ee(),index:dt()}).partial(),note:"载荷 { text, index }:index 为服务端稳定 block index,客户端按 index upsert 成独立思考块(工具调用前后各一段)"}),ae({type:"tool_call",description:"工具调用流式增量",category:"stream",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ae({type:"tool_result",description:"工具执行结果",category:"stream",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ae({type:"tool_execution_start",description:"工具执行阶段开始(无流事件时段开始)",category:"stream",emittedBy:["core"],handledByCli:!1,handledByWeb:!1,note:"纯 core 内部遥测:供运行时暂停/恢复 stall 心跳与全局看门狗;CLI/Web 无 handler(前端无需展示),仅 queryEngine 消费",intentionalGap:!0}),ae({type:"tool_execution_end",description:"工具执行阶段结束(恢复 stall 心跳与全局看门狗)",category:"stream",emittedBy:["core"],handledByCli:!1,handledByWeb:!1,note:"配合 tool_execution_start:防止 180s 心跳把合法长等待误判为流挂起而 abort + 重放整轮工具调用;CLI/Web 无 handler",intentionalGap:!0}),ae({type:"tool_diff",description:"工具执行中的参数 diff 增量(P0-2 diffConsumer 生产者推送)",category:"stream",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ae({type:"tool_output",description:"工具执行期间的实时输出增量(stdout/stderr chunk,Phase0 OutputStream 生产者推送)",category:"stream",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,schema:qe({toolCallId:ee(),stream:fu(["stdout","stderr"]),chunk:ee(),seq:dt(),timestamp:dt()}).partial(),note:"增量、可丢;权威输出仍是 tool_result,权威时序仍是 ExecutionLedger。生产者侧节流(时间窗聚合 + 每调用字节上限),不得用于 reset stall 心跳。命名对齐 tool_call/tool_result/tool_diff 家族"}),ae({type:"step_start",description:"步骤开始",category:"stream",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ae({type:"step_thinking",description:"步骤思考",category:"stream",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ae({type:"step_action",description:"步骤动作",category:"stream",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ae({type:"step_complete",description:"步骤完成",category:"stream",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ae({type:"turn_summary",description:"回合结束摘要(思考时长+工具计数+头条)",category:"stream",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"CLI/Web 渲染为折叠摘要行(Thought for Ns, ran N …)"}),ae({type:"cache_stats",description:"本轮 run 前缀缓存命中统计(命中/未命中 token、命中率、调用次数)",category:"stream",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"run 结束时由 queryEngine 发送;CLI/Web 在模型名旁展示命中率",schema:qe({cacheHitTokens:dt(),cacheMissTokens:dt(),cacheHitRate:dt().optional(),cacheStatsCalls:dt()}).partial()}),ae({type:"web_search",description:"模型内置联网搜索状态(DeepSeek Responses web_search_call:searching/completed/failed)",category:"stream",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"由服务端执行搜索,客户端仅展示状态(🔍搜索中 → ✅完成)",schema:qe({state:ee()}).partial()}),ae({type:"progress",description:"通用进度(当前未使用)",category:"stream",emittedBy:["none"],handledByCli:!1,handledByWeb:!1,deprecated:!0,note:"已定义但从未发送;SendMessageTool 的 progress 是消息类型而非 WS 事件"}),ae({type:"complete",description:"生成完成",category:"stream",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ae({type:"error",description:"生成错误",category:"stream",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,schema:qe({message:ee()}).partial()}),ae({type:"generation_paused",description:"生成已暂停",category:"stream",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ae({type:"generation_resumed",description:"生成已恢复",category:"stream",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ae({type:"stall_detected",description:"流级卡死检测(自动重试/通知)",category:"stream",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"由 StreamHeartbeat 或 StallDetector 触发;CLI/Web 显示重试进度"}),ae({type:"task_interrupted",description:"任务中断(服务重启/异常退出)",category:"stream",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"服务启动扫描时将 running activeRun 标记为 interrupted 后触发;提示用户使用 /continue 恢复生成,或用 /resume 切换会话"}),ae({type:"step_prompt",description:"步骤提示(Web 路由用)",category:"stream",emittedBy:["none"],handledByCli:!1,handledByWeb:!0,note:"Web 路由的内部事件,不通过 WS 发送"})]);wa([ae({type:"plan_start",description:"计划开始",category:"plan",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"由 EnterPlanMode 工具 emit"}),ae({type:"plan_thinking",description:"计划思考",category:"plan",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ae({type:"plan_tasks",description:"计划任务列表生成",category:"plan",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"由 ExitPlanMode 工具 emit(解析计划内容为任务列表);CLI handler 解析 data.tasks",schema:qe({tasks:yr(oo())}).partial()}),ae({type:"plan_task_start",description:"计划任务开始",category:"plan",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ae({type:"plan_task_update",description:"计划任务更新",category:"plan",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ae({type:"plan_task_result",description:"计划任务结果",category:"plan",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ae({type:"plan_complete",description:"计划完成",category:"plan",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"由 ExitPlanMode 工具 emit(携带 currentPlan/proposedPlan)"}),ae({type:"plan_error",description:"计划错误",category:"plan",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ae({type:"plan_mode_change",description:"计划模式切换",category:"plan",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"CLI 已添加 handler(2026-07-01);Web planHandlers 已处理(2026-08-07)"}),ae({type:"plan_mode_enter",description:"进入计划模式(CLI 遗留)",category:"plan",emittedBy:["none"],handledByCli:!0,handledByWeb:!0,deprecated:!0,note:"兼容遗留代码,应改用 plan_mode_change"}),ae({type:"plan_mode_exit",description:"退出计划模式(CLI 遗留)",category:"plan",emittedBy:["none"],handledByCli:!0,handledByWeb:!0,deprecated:!0,note:"兼容遗留代码,应改用 plan_mode_change"}),ae({type:"plan_confirm",description:"计划等待确认",category:"plan",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"CLI 已处理(2026-07-18); Web planHandlers 已处理(2026-08-07)"}),ae({type:"plan_waiting",description:"计划等待用户输入",category:"plan",emittedBy:["none"],handledByCli:!0,handledByWeb:!1,note:"核心未发射(仅 CLI 兼容订阅),已从 emittedBy 移除 core"}),ae({type:"plan_continue",description:"计划继续执行",category:"plan",emittedBy:["none"],handledByCli:!0,handledByWeb:!1,note:"核心未发射(仅 CLI 兼容订阅),已从 emittedBy 移除 core"}),ae({type:"plan_settled",description:"计划已定稿",category:"plan",emittedBy:["none"],handledByCli:!0,handledByWeb:!1,note:"核心未发射(仅 CLI 兼容订阅),已从 emittedBy 移除 core"}),ae({type:"plan_cleared",description:"计划已清除",category:"plan",emittedBy:["none"],handledByCli:!0,handledByWeb:!1,note:"核心未发射(仅 CLI 兼容订阅),已从 emittedBy 移除 core"}),ae({type:"user_exit_plan_mode",description:"用户手动退出计划模式",category:"plan",emittedBy:["client"],handledByCli:!1,handledByWeb:!1,note:"入站事件(CLI→服务器),客户端无需 handler"}),ae({type:"plan_task_complete",description:"计划任务完成(单个)",category:"plan",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"core TaskUpdateTool 在 completed/failed 时 emit,data 携带 id/title/status/result/error;CLI 与 Web 均更新看板并输出通知(toast / 状态区)",schema:qe({id:ee(),title:ee(),status:ee(),result:ee().optional(),error:ee().optional()}).partial()}),ae({type:"plan_subagent_start",description:"Plan 设计子代理启动",category:"plan",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"PlanSubAgentTool 启动只读设计子代理时 emit;data 携带 scope/agentId/planSlug/title",schema:qe({scope:ee(),agentId:ee(),planSlug:ee().optional(),title:ee().optional()}).partial()}),ae({type:"plan_subagent_done",description:"Plan 设计子代理完成",category:"plan",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"PlanSubAgentTool 子代理完成(成功或失败)时 emit;data 携带 scope/agentId/status/designDocPath/error",schema:qe({scope:ee(),agentId:ee(),status:ee(),designDocPath:ee().optional(),error:ee().optional()}).partial()}),ae({type:"plan_mode_change_ack",description:"模式切换 ACK(服务器确认 plan 模式变更)",category:"plan",emittedBy:["server"],handledByCli:!0,handledByWeb:!1,note:"server app.ts 对 plan_mode_change 消息的应答;data 携带 mode/auto"}),ae({type:"mode_state",description:"模式状态同步(值 + 来源 + 锁定)",category:"plan",emittedBy:["server"],handledByCli:!1,handledByWeb:!0,note:"server 在 ModeManager 任意变更时广播:data 携带 mode/previousMode/source(default|user_override|auto_router)/locked/reason;Web 据此同步模式值与锁定状态——只覆盖基础模式,保留前端 auto 开关(后端四态不含 auto),且不回发 plan_mode_change(否则一次广播会被 server 判成 user_override 误锁模式)",schema:qe({mode:ee(),previousMode:ee(),source:ee(),locked:rr(),reason:ee()}).partial()}),ae({type:"mode_suggestion",description:"自动评估建议切换模式(被用户锁定拦截,待用户确认)",category:"plan",emittedBy:["core"],handledByCli:!1,handledByWeb:!0,note:"queryEngine 仲裁拒绝自动建议时 emit(仅 user_override 场景);Web 弹建议横幅,Apply 走既有 plan_mode_change(user_override 语义)",schema:qe({currentMode:ee(),suggestedMode:ee(),confidence:dt(),reason:ee(),decisionSource:ee()}).partial()})]);wa([ae({type:"token_update",description:"Token 用量更新",category:"context",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ae({type:"context_compressed",description:"上下文已压缩",category:"context",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ae({type:"compaction_progress",description:"压缩进度更新",category:"context",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ae({type:"context_analysis",description:"上下文分布分析",category:"context",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"CLI 已处理(2026-07-18); Web 有 handler 但路由不可达"}),ae({type:"threshold_warning",description:"Token 阈值警告",category:"context",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"CLI 已处理(2026-07-18); Web 有 handler 但路由不可达"}),ae({type:"threshold_error",description:"Token 阈值错误",category:"context",emittedBy:["none"],handledByCli:!1,handledByWeb:!1,deprecated:!0,note:"功能存在但被 context_blocked 覆盖,事件未使用"}),ae({type:"context_blocked",description:"上下文已满,生成被阻止",category:"context",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"CLI 已处理(2026-07-18); Web 有 handler 但路由不可达"}),ae({type:"blocking_limit",description:"已达到阻止极限",category:"context",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"CLI 已处理(2026-07-18); Web 有 handler 但路由不可达"}),ae({type:"compaction_started",description:"压缩任务已启动(phase/trigger)",category:"context",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ae({type:"compaction_finished",description:"压缩任务结束(done/failed/aborted)",category:"context",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ae({type:"tool_retry",description:"工具重试",category:"context",emittedBy:["none"],handledByCli:!1,handledByWeb:!0,deprecated:!0,note:"重试信息已含于 tool_result/error,Web handler 保留但路由不可达"}),ae({type:"model_fallback",description:"模型回退",category:"context",emittedBy:["none"],handledByCli:!1,handledByWeb:!0,deprecated:!0,note:"降级信息已含于 degradation_update,Web handler 保留但路由不可达"}),ae({type:"usage",description:"Token 用量",category:"context",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ae({type:"context_breakdown",description:"上下文容量分类占比(系统提示词/消息/工具/技能/MCP),供 Web 底部上下文条抽屉展示",category:"context",emittedBy:["core"],handledByCli:!1,handledByWeb:!0,note:"每轮 query 上下文组装后估算各组件 token,Web 端点状态栏上下文条上拉展示",intentionalGap:!0})]);wa([ae({type:"workflow_started",description:"工作流已启动",category:"workflow",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"data.nodes 携带 LLM 合成完整节点清单(含 type/children/priority,前端可分层渲染)",schema:qe({workflowId:ee().optional(),title:ee().optional(),goalId:ee().optional(),totalNodes:dt().optional(),nodes:yr(oo()).optional()}).partial()}),ae({type:"workflow_event",description:"工作流事件",category:"workflow",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ae({type:"workflow_progress",description:"工作流进度",category:"workflow",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"nodeStatuses: 逐节点状态全量映射(断线重连可重建视图)",schema:qe({runId:ee().optional(),status:ee().optional(),completedNodes:dt().optional(),totalNodes:dt().optional(),tokensUsed:dt().optional(),tokensRemaining:dt().optional(),currentNodeId:ee().optional(),nodeStatuses:wT(ee(),ee()).optional()}).partial()}),ae({type:"workflow_finished",description:"工作流完成",category:"workflow",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,schema:qe({runId:ee().optional(),status:ee().optional(),output:oo().optional(),error:ee().optional()}).partial()}),ae({type:"workflow_error",description:"工作流错误",category:"workflow",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ae({type:"workflow_checkpoint",description:"工作流检查点",category:"workflow",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ae({type:"workflow_node_start",description:"工作流节点开始",category:"workflow",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,schema:qe({nodeId:ee().optional(),title:ee().optional(),type:ee().optional()}).partial()}),ae({type:"workflow_node_complete",description:"工作流节点完成",category:"workflow",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"durationMs: 节点耗时;attempts: retry 重试次数(retry 原语节点)",schema:qe({nodeId:ee().optional(),title:ee().optional(),status:ee().optional(),result:oo().optional(),error:ee().optional(),durationMs:dt().optional(),attempts:dt().optional()}).partial()}),ae({type:"workflow_node_retry",description:"工作流节点重试(retry 原语每次重试发出)",category:"workflow",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"attempt > 1 时发出;reason 为上一次尝试的失败原因",schema:qe({nodeId:ee().optional(),childId:ee().optional(),attempt:dt().optional(),maxAttempts:dt().optional(),reason:ee().optional()}).partial()}),ae({type:"workflow_paused",description:"工作流已暂停",category:"workflow",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ae({type:"workflow_resumed",description:"工作流已恢复",category:"workflow",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ae({type:"workflow_cancelled",description:"工作流已取消",category:"workflow",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ae({type:"workflow_recovered",description:"工作流已恢复(从故障)",category:"workflow",emittedBy:["none"],handledByCli:!1,handledByWeb:!1,deprecated:!0,note:"已被 workflow_resumed 覆盖,核心从未发送"}),ae({type:"workflow_handoff",description:"ReAct 转交 workflow(范式切换)",category:"workflow",emittedBy:["none"],handledByCli:!0,handledByWeb:!0,deprecated:!0,note:"Agent Loop 单核模型重构后退役:workflow 判定改为计划注入(见 workflow_plan_ready),核心不再发送;CLI/Web 保留 handler 兼容旧服务端回放"}),ae({type:"workflow_plan_ready",description:"范式路由:LLM 合成的执行计划提案就绪(confirm=true 时等待用户确认)",category:"workflow",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"payload 携带 planId/title/nodes/parallelGroups/estimatedTokens/runtimeAvailable;confirm=false 保持兼容的立即执行路径",schema:qe({planId:ee(),title:ee().optional(),reason:ee().optional(),confirm:rr().optional(),nodes:yr(oo()).optional(),parallelGroups:yr(yr(ee())).optional(),estimatedTokens:dt().optional(),runtimeAvailable:rr().optional()}).partial()}),ae({type:"workflow_confirm_ack",description:"工作流提案确认结果(start/cancel/change/runtime)",category:"workflow",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,schema:qe({planId:ee().optional(),action:ee().optional(),ok:rr().optional(),auto:rr().optional()}).partial()}),ae({type:"workflow_status",description:"workflow run 状态查询响应(状态对账:连接/重连后拉取终态)",category:"workflow",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"2026-08-14: 配合 get_workflow_status 请求,修复一次性事件流漏终态导致的 UI 卡死;runs[].nodeStatuses 为逐节点状态映射",schema:qe({runs:yr(oo()).optional()}).partial()})]);wa([ae({type:"dwf_offer",description:"动态工作流确认请求(模型写了 _<name>_workflow.js,询问是否运行)",category:"workflow",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"回合尾嗅探到新写的 workflow 脚本时发出;用户经 dwf_confirm(run|view|no) 应答;执行期进度复用 workflow_* 事件",schema:qe({offerId:ee(),sessionId:ee().optional(),fileName:ee(),filePath:ee().optional(),title:ee().optional(),description:ee().optional(),phases:yr(qe({title:ee(),detail:ee().optional()})).optional(),agentCount:dt().optional(),scriptPreview:ee().optional(),tokenWarning:ee().optional()}).partial()}),ae({type:"dwf_confirm_ack",description:"动态工作流确认应答(服务器处理 dwf_confirm 后回执)",category:"workflow",emittedBy:["server"],handledByCli:!0,handledByWeb:!0,note:"data 携带 offerId/action/ok;view 时 scriptPreview 为全量脚本;未知 offerId → ok:false",schema:qe({offerId:ee(),action:ee(),ok:rr(),scriptPreview:ee().optional(),error:ee().optional()}).partial()}),ae({type:"dwf_cancelled",description:"动态工作流已取消(用户 no / 运行中取消)",category:"workflow",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,schema:qe({offerId:ee().optional(),runId:ee().optional(),reason:ee().optional()}).partial()}),ae({type:"dwf_promotable",description:"动态工作流可沉淀为模板(provenance 账本 successfulRuns ≥3,邀请 Save as template)",category:"workflow",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"run 终态后由 onTerminal 检测发出;门槛按成功 run 数(successfulRuns,COMPLETED 计数)计,总 run 含失败不达标;用户经 dwf_promote { workflowId } 确认沉淀;promote 成功后模板存在 → 不再提示;用户 No/本地 dismiss 仅清除提示不落服务端标记 → 后续成功 run 终态仍会再次提示(幂等提示而非只提示一次)",schema:qe({workflowId:ee(),sessionId:ee().optional(),name:ee().optional(),runs:dt().optional(),successRate:dt().optional(),avgTokens:dt().optional(),lastRunAt:dt().optional()}).partial()}),ae({type:"dwf_promote_ack",description:"沉淀为模板的结果回执(处理 dwf_promote 后)",category:"workflow",emittedBy:["server"],handledByCli:!0,handledByWeb:!0,schema:qe({workflowId:ee(),ok:rr(),templateId:ee().optional(),reason:ee().optional()}).partial()})]);wa([ae({type:"task_update",description:"任务更新",category:"task",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"CLI 已添加 handler(2026-07-01)"}),ae({type:"task_output",description:"任务输出",category:"task",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"CLI 已添加 handler(2026-07-01)"}),ae({type:"task_finished",description:"任务完成",category:"task",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"CLI 已添加 handler(2026-07-01)"}),ae({type:"task_error",description:"任务错误",category:"task",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"CLI 已添加 handler(2026-07-01)"}),ae({type:"filejob_start",description:"文件处理任务开始(解析/渲染)",category:"task",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"对话内嵌文件处理面板;Web 已处理,CLI 已处理(2026-08-07 状态行)"}),ae({type:"filejob_progress",description:"文件处理进度更新",category:"task",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"解析/渲染进度百分比",schema:qe({progress:dt()}).partial()}),ae({type:"filejob_result",description:"文件处理完成(结果文件列表)",category:"task",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"携带 RenderedFileResult[]",schema:yr(oo())}),ae({type:"filejob_error",description:"文件处理失败",category:"task",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"脱敏错误详情"})]);wa([ae({type:"goal_created",description:"目标已创建",category:"goal",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"2026-07-21: Web handled via goal_tasks/goal_task_update"}),ae({type:"goal_tasks",description:"目标任务列表(批量初始化看板)",category:"goal",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"2026-07-21: 统一看板数据源"}),ae({type:"goal_task_update",description:"目标任务更新",category:"goal",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"2026-07-21: Web 已添加 handler"}),ae({type:"goal_update",description:"目标元信息更新(retitle / 看板整体刷新)",category:"goal",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"漂移修复:goalManager.retitle / GoalTool 此前已在发射但未注册;tasks 为空数组时 Web 清空看板"}),ae({type:"goal_completed",description:"目标已完成(workflow 终态自动推导)",category:"goal",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"2026-08-14: 此前 goals.complete() 无任何调用点,goal 工作流跑完后 goal 永远停在 active —— 新增终态事件供两端对账"}),ae({type:"goal_route_decision",description:"Goal 智能路由结果(simple/medium/hard 分流结论)",category:"goal",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"2026-09-06 P1: goal 模式消息不再固定跑 4 子代理流水线。默认层只展示一行结论(tier 标签 + 一句话理由 + 耗时),完整判定细节走 debug 层日志",schema:qe({tier:fu(["simple","medium","hard"]),summary:ee().optional(),source:fu(["override","llm","fallback"]).optional(),latencyMs:dt().optional(),reason:ee().optional(),confidence:dt().optional(),goalId:ee().optional(),runId:ee().optional(),message:ee().optional()}).partial()})]);wa([ae({type:"hook_ask",description:"Hook 审批请求",category:"hook",emittedBy:["server"],handledByCli:!0,handledByWeb:!0}),ae({type:"hook_allow",description:"Hook 允许响应",category:"hook",emittedBy:["client"],handledByCli:!1,handledByWeb:!1,note:"入站事件(CLI→服务器),无需 handler"}),ae({type:"hook_deny",description:"Hook 拒绝响应",category:"hook",emittedBy:["client"],handledByCli:!1,handledByWeb:!1,note:"入站事件(CLI→服务器),无需 handler"}),ae({type:"hook_response_ack",description:"Hook 响应确认",category:"hook",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"CLI 已添加 handler(2026-07-01); Web systemHandlers 已处理(2026-08-07)"}),ae({type:"ask_user_question",description:"向用户提问",category:"hook",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ae({type:"question_answer_ack",description:"提问回答确认",category:"hook",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"Web useWebSocket 已处理(dismiss 提问弹窗)"}),ae({type:"hook_auto_ack",description:"Hook 自动模式确认",category:"hook",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"Web 已处理(2026-08-07 toast 提示)"}),ae({type:"tool.approval_required",description:"工具调用需要审批(无人值守运行触发,未放行即拒绝)",category:"hook",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"无人值守/定时运行写操作需审批的通知;Inbox 审批队列已退役,Web 显式 no-op,CLI 走 hook 链审批"})]);wa([ae({type:"mcp_update",description:"MCP 状态更新",category:"mcp",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"CLI 已添加 handler(2026-07-01)"})]);wa([ae({type:"doctor_result",description:"诊断完成",category:"diagnostic",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ae({type:"degradation",description:"降级状态更新(遗留)",category:"diagnostic",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ae({type:"degradation_update",description:"降级状态更新",category:"diagnostic",emittedBy:["core"],handledByCli:!0,handledByWeb:!0})]);wa([ae({type:"commands_list",description:"命令列表(服务器→客户端)",category:"system",emittedBy:["core","server"],handledByCli:!0,handledByWeb:!0,note:"CLI 已处理(setDynamicCommands); Web systemHandlers 已处理(2026-08-07)"}),ae({type:"ping",description:"心跳 Ping",category:"system",emittedBy:["client"],handledByCli:!1,handledByWeb:!1,note:"由 Server 的 WS 层自动处理"}),ae({type:"pong",description:"心跳 Pong",category:"system",emittedBy:["server"],handledByCli:!1,handledByWeb:!1,note:"由 Client 的 WS 层自动处理"}),ae({type:"log",description:"服务端日志",category:"system",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ae({type:"notification",description:"通知消息",category:"system",emittedBy:["server"],handledByCli:!0,handledByWeb:!0}),ae({type:"channel_message",description:"频道入站消息(转发到 Web UI)",category:"system",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"CLI 已处理(2026-07-18); Web 已处理(2026-08-07 通知)"}),ae({type:"channel_status",description:"频道连接状态变更",category:"system",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"CLI 已处理(2026-07-18); Web 已处理(channelsStore)"}),ae({type:"channel_error",description:"频道运行时错误",category:"system",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"CLI 已处理(2026-07-18); Web 已处理(2026-08-07 通知)"}),ae({type:"todo_update",description:"待办事项更新",category:"system",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ae({type:"todo_item_done",description:"待办项完成",category:"system",emittedBy:["none"],handledByCli:!1,handledByWeb:!0,deprecated:!0,note:"已退役:core/server 无发射点(待办统一走 todo_update 全表替换);Web handler 保留兼容"}),ae({type:"todo_progress",description:"待办进度",category:"system",emittedBy:["none"],handledByCli:!1,handledByWeb:!1,deprecated:!0,note:"已退役:core/server 无发射点,CLI 无 handler,Web 侧为空 case"}),ae({type:"tombstone",description:"消息已删除/墓碑",category:"system",emittedBy:["none"],handledByCli:!1,handledByWeb:!1,deprecated:!0,note:"Web/CLI 本地消息删除渲染概念,无 WS 发射端"}),ae({type:"status",description:"状态更新(modelName/connected/statusText)",category:"system",emittedBy:["core","server"],handledByCli:!0,handledByWeb:!0,schema:qe({modelName:ee(),connected:rr(),statusText:ee()}).partial()}),ae({type:"model_name",description:"当前模型名称",category:"system",emittedBy:["core","server"],handledByCli:!0,handledByWeb:!0,schema:qe({model:ee(),modelRef:ee(),source:fu(["session","mode","global"]),data:ee()}).partial(),note:"model 顶层裸模型 id;modelRef 为 provider:model 复合身份(同 id 多 provider 去歧义,CLI/Web 状态行 + 模型选择器用);source 标记模型来源 session/mode/global(session = 仅本会话切换)"}),ae({type:"models_updated",description:"模型列表已更新(models.dev 快照刷新后广播)",category:"system",emittedBy:["server"],handledByCli:!1,handledByWeb:!1,note:"漂移修复:app.ts 模型端点写入后全量广播,但此前未注册;两端尚未接 handler,先做类型层登记"}),ae({type:"throttle",description:"速率限制状态",category:"system",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"Web 已处理(2026-08-07 toast 提示)"}),ae({type:"code_review_ready",description:"代码审查结果就绪",category:"system",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"Web 已处理(2026-08-07 toast 提示)"}),ae({type:"pdca_phase",description:"PDCA 循环阶段",category:"system",emittedBy:["none"],handledByCli:!0,handledByWeb:!1,deprecated:!0,note:"已退役:5-phase light pipeline 被 WorkflowRuntime 取代"}),ae({type:"command_start",description:"命令开始(Web 路由用)",category:"system",emittedBy:["none"],handledByCli:!1,handledByWeb:!0,deprecated:!0,note:"Web systemHandler 有 case 但核心无发送方,保留兼容"}),ae({type:"command_complete",description:"命令完成(Web 路由用)",category:"system",emittedBy:["none"],handledByCli:!1,handledByWeb:!0,deprecated:!0,note:"Web systemHandler 有 case 但核心无发送方,保留兼容"}),ae({type:"command_error",description:"命令错误(Web 路由用)",category:"system",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"core index.ts:1270 真实 emit;CLI useStreamHandlers:741 与 Web systemHandlers 均已处理"})]);wa([ae({type:"automation.update",description:"自动化任务新增/更新/删除/状态变更",category:"automation",emittedBy:["server"],handledByCli:!0,handledByWeb:!0,note:"REST /api/automations 已可用;Web 自动化视图消费"}),ae({type:"automation.run",description:"自动化触发运行(started/finished/error)",category:"automation",emittedBy:["core","server"],handledByCli:!0,handledByWeb:!0,note:"CLI 状态提示;Web RunDetail 消费"})]);wa([ae({type:"agent_started",description:"Agent 启动(统一生命周期)",category:"system",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"AgentRunner.beginLifecycle 注册控制面时 emit;data 携带 agentId/toolCallId/parentAgentId/rootId/depth/sessionId/scope/state/elapsedMs",schema:qe({agentId:ee(),toolCallId:ee().optional(),parentAgentId:ee().optional(),rootId:ee().optional(),depth:dt().optional(),sessionId:ee().optional(),scope:ee().optional(),state:ee().optional(),elapsedMs:dt().optional()}).partial()}),ae({type:"agent_progress",description:"Agent 实时进度(派生行,零 LLM 成本)",category:"system",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"AgentRunner 包装 onProgress 节流(≥1s 或轮次变化穿透)后 emit;data 携带 agentId/toolCallId/iteration{current,max}/tools{current,recent}/lastContent/elapsedMs",schema:qe({agentId:ee(),toolCallId:ee().optional(),iteration:qe({current:dt(),max:dt().optional()}).optional(),tools:qe({current:ee().optional(),recent:yr(ee()).optional()}).optional(),lastContent:ee().optional(),elapsedMs:dt().optional(),totalTokens:dt().optional()}).partial()}),ae({type:"agent_completed",description:"Agent 正常完成",category:"system",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"AgentRunner endLifecycle(status=completed)时 emit",schema:qe({agentId:ee(),toolCallId:ee().optional(),scope:ee().optional(),state:ee().optional(),elapsedMs:dt().optional()}).partial()}),ae({type:"agent_cancelled",description:"Agent 被用户/控制面停止(partial result 已返回)",category:"system",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"AgentRunner endLifecycle(status=cancelled)时 emit;detail 携带停止原因。语义 = 停止工作、整理已有发现,partial result 已随工具结果回传父 agent",schema:qe({agentId:ee(),toolCallId:ee().optional(),scope:ee().optional(),state:ee().optional(),elapsedMs:dt().optional(),detail:ee().optional()}).partial()}),ae({type:"agent_failed",description:"Agent 失败/超时/被硬杀",category:"system",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"AgentRunner endLifecycle(status=error/timeout/max_iterations/budget_exceeded)或 kill 时 emit;error 携带原因",schema:qe({agentId:ee(),toolCallId:ee().optional(),scope:ee().optional(),state:ee().optional(),elapsedMs:dt().optional(),error:ee().optional()}).partial()})]);const kT=/^[a-z][a-z0-9._-]*$/,Z0=ee().min(1).max(128).regex(kT,"command id must match ^[a-z][a-z0-9._-]*$");qe({id:ee().min(1).max(128),command:Z0,payload:Nu().optional(),timeoutMs:dt().int().positive().max(3e5).optional(),sender:ee().max(128).optional()});qe({success:rr(),requestId:ee(),command:Z0,result:Nu().optional(),error:ee().optional(),durationMs:dt().min(0).optional()});const ST=qe({capability:Z0,command:Z0,description:ee().max(500).optional(),provider:ee().max(128).optional()});qe({version:x1("1"),capabilities:yr(ST)});const _T="1",CT=["ready","select","inspect","screenshot","highlight","command","event"],AT=qe({version:x1(_T),type:fu(CT),requestId:ee().min(1).max(128),payload:Nu().optional()}).passthrough();qe({type:ee().min(1).max(128).regex(/^[a-z][a-z0-9._-]*$/,"event type must match ^[a-z][a-z0-9._-]*$"),payload:Nu().optional(),source:ee().max(128).optional(),timestamp:dt().nonnegative().optional()});const TT="workspace_event";qe({type:x1(TT),sessionId:ee().optional(),data:xT([ee(),AT]).optional(),traceId:ee().optional()});const ET=_p.map(t=>({eventType:t.type,description:t.description,category:t.category,emittedBy:t.emittedBy,handledByCli:t.handledByCli,handledByWeb:t.handledByWeb,...t.deprecated!==void 0?{deprecated:t.deprecated}:{},...t.intentionalGap!==void 0?{intentionalGap:t.intentionalGap}:{},...t.note!==void 0?{note:t.note}:{}})),NT=/^\s*\*\*\*\s+(?:Add|Update|Delete)\s+File:\s*(.+?)\s*$/,RT=/^\s*\*\*\*\s+Move\s+to:\s*(.+?)\s*$/;function p5(t){if(!t)return[];const e=[],n=new Set;for(const a of t.split(/\r?\n/)){const r=a.trim();if(!r.startsWith("***"))continue;const i=NT.exec(r),l=i?null:RT.exec(r),c=(i==null?void 0:i[1])??(l==null?void 0:l[1]);c&&(n.has(c)||(n.add(c),e.push(c)))}return e}const DT=["/etc/","/usr/lib/","/boot/","/dev/","/sys/","/proc/","C:\\Windows\\","C:\\Program Files\\"];function MT(t){if(!t)return!1;const e=t.replace(/\\/g,"/"),n=e.toLowerCase();return DT.some(a=>{const r=a.replace(/\\/g,"/"),i=r.endsWith("/")?r.slice(0,-1):r;return/^[a-z]:\//i.test(r)?n===i.toLowerCase()||n.startsWith(r.toLowerCase()):e===i||e.startsWith(r)})}function M4(t){return t.find(e=>e&&MT(e))??null}const OT=[".npmrc",".pypirc",".netrc",".pgpass",".git-credentials",".gitcookies",".htpasswd","id_rsa","id_dsa","id_ecdsa","id_ed25519","credentials.json","secrets.json","secrets.yaml","secrets.yml",".anthropic_oauth.json",".google_oauth.json","shadow","sudoers"],LT=[".ssh",".aws",".azure",".gcloud",".kube",".docker",".gnupg"],jT=[".pem",".key",".pfx",".p12",".kdbx",".jks",".keystore"],BT=/(^|\/)\.env($|[^\w.])/,IT=/\.(example|sample|template|dist)$|\.pub$/;function PT(t){if(!t)return!1;const e=t.replace(/\\/g,"/"),n=e.toLowerCase(),a=n.split("/").pop()??"";return!a||IT.test(a)?!1:BT.test(n)||a===".env"||a.startsWith(".env.")||OT.some(r=>a===r.toLowerCase())||jT.some(r=>a.endsWith(r))?!0:e.split("/").some(r=>LT.includes(r.toLowerCase()))}function zT(t){return t.find(e=>e&&PT(e))??null}function ja(t){return t==="auto-plan"?"plan":t==="auto-act"?"act":t==="auto-goal"?"goal":t}function lo(t){return t==="auto-plan"||t==="auto-act"||t==="auto-goal"}function $T(t){switch(t){case"plan":return"auto-plan";case"auto-plan":return"plan";case"act":return"auto-act";case"auto-act":return"act";case"goal":return"auto-goal";case"auto-goal":return"goal"}}const W$=["plan","act","goal"];function R0(t,e){return e?t==="plan"?"auto-plan":t==="act"?"auto-act":"auto-goal":t}function FT(t){const e=["plan","act","goal"],n=e.indexOf(ja(t)),a=e[(n+1)%e.length]??"act";return R0(a,lo(t))}const HT={plan:{label:"Plan",accent:"blue"},"auto-plan":{label:"Auto-Plan",accent:"cyan"},act:{label:"Act",accent:"green"},"auto-act":{label:"Auto-Act",accent:"yellow"},goal:{label:"Goal",accent:"magenta"},"auto-goal":{label:"Auto-Goal",accent:"red"}},K$={low:{label:"Low",accent:"green"},medium:{label:"Medium",accent:"cyan"},high:{label:"High",accent:"yellow"},critical:{label:"Critical",accent:"red"}},Y$={allow:{label:"Allow"},deny:{label:"Deny"},allow_session:{label:"Allow session"},auto:{label:"Auto mode"}};function f5(t){return t==="plan"||t==="auto-plan"||t==="act"||t==="auto-act"||t==="goal"||t==="auto-goal"?t:"auto-act"}function Pc(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${Math.round(t/1e3)}K`:String(t)}function UT(t){return t<=0?"":t>=100?`${Math.round(t)}tok/s`:`${t.toFixed(1)}tok/s`}function GT(t){if(!t)return 0;const e=(t.match(/[\u3000-\u303f\u3040-\u30ff\u3400-\u4dbf\u4e00-\u9fff\uf900-\ufaff\uff00-\uffef]/g)||[]).length;return e*1.5+(t.length-e)*.25}function qT(t=4e3){let n=[];const a=r=>{const i=r-t;for(;n.length>0&&n[0].ts<i;)n.shift()};return{feed(r,i=Date.now()){const l=GT(r);l<=0||(a(i),n.push({ts:i,tokens:l}))},rate(r=Date.now()){if(a(r),n.length===0)return 0;let i=0;for(const c of n)i+=c.tokens;const l=Math.max(r-n[0].ts,500);return i/l*1e3},reset(){n=[]}}}function VT(t){if(t<=0)return"";if(t>=60){const e=Math.floor(t/60),n=t%60;return`${e}m${n}s`}return`${t}s`}function WT(t,e){switch(t){case"bash":case"shell":case"PowerShell":return`ran ${e} shell command${e>1?"s":""}`;case"read_file":return`read ${e} file${e>1?"s":""}`;case"write_file":return`wrote ${e} file${e>1?"s":""}`;case"edit_file":case"edit_file_line":return`edited ${e} file${e>1?"s":""}`;case"apply_patch":return`patched ${e} file${e>1?"s":""}`;default:return`ran ${e} ${t}${e>1?"s":""}`}}function Z$(t){const e=Object.entries(t.toolCounts).filter(([,r])=>r>0).sort((r,i)=>i[1]-r[1]),n=t.headline||`Thought for ${VT(Math.max(1,Math.round(t.durationMs/1e3)))}`,a=e.map(([r,i])=>WT(r,i));return a.length>0?`${n}, ${a.join(", ")}`:n}function KT(t,e){const n=t.toLowerCase(),a=new Set(n.split(/[^a-z0-9]+/).filter(Boolean)),r=(...i)=>i.some(l=>a.has(l));return n==="apply_patch"?M4(p5(h5(e)))?"critical":"high":r("rm","del","delete","drop","truncate","format","mkfs")?"critical":r("bash","shell","exec","cmd","powershell","terminal")?/\b(rm\s+-rf|sudo|chmod\s+777|curl.*\|\s*(ba)?sh|wget.*-O|>\/dev\/|mkfs)\b/i.test(e)?"critical":"high":r("write","edit","save","upload","deploy","publish")?M4(O4(e))?"critical":"high":r("install","uninstall","npm","pip","cargo","gem","apt","brew","choco","yum","dnf")?"high":r("git","commit","push","merge","rebase")?/\b(push|force|hard\s*reset|rebase)\b/i.test(e)?"high":"medium":r("http","fetch","curl","wget","api","request","download")?"medium":r("read","open","list","ls","dir","cat","view","search","find","grep","glob")?zT(O4(e))?"high":"low":"medium"}function h5(t){if(!t)return"";try{const e=JSON.parse(t);if(!e||typeof e!="object")return t;const n=e,r=(n.payload&&typeof n.payload=="object"?n.payload:n).patch;return typeof r=="string"?r:t}catch{return t}}const YT=new Set(["file_path","filePath","filepath","path","notebook_path","notebookPath","file"]);function O4(t){if(!t)return[];const e=[],n=new Set,a=i=>{typeof i=="string"&&i.trim()&&!n.has(i)&&(n.add(i),e.push(i))},r=(i,l)=>{if(!(l>4||!i||typeof i!="object")){if(Array.isArray(i)){for(const c of i)a(c),r(c,l+1);return}for(const[c,d]of Object.entries(i))YT.has(c)?(a(d),Array.isArray(d)&&d.forEach(a)):r(d,l+1)}};try{r(JSON.parse(t),0)}catch{}if(e.length===0)for(const i of t.matchAll(/(?:file_path|filePath|path|file)["\s:=]+([^\s",}]+)/gi))a(i[1]);return e}function ZT(t,e){if(e==null)return null;if(/apply_patch/i.test(t)){const n=h5(e),a=p5(n),r=a.length>0?a.join(`
|
|
41
|
+
`):"(no file markers found)",i=n.split(/\r?\n/).slice(0,12).join(`
|
|
42
|
+
`);return`${r}
|
|
43
|
+
${i}`.slice(0,240)}if(/\b(bash|shell|exec|cmd|powershell|terminal)\b/i.test(t))return e||null;if(/\b(write|edit|save|create)\b/i.test(t)){const n=e.match(/(?:file_path|path|file)["\s:=]+([^\s",}]+)/i);return n?`${n[1]}
|
|
44
|
+
${e.slice(0,200)}`:e.slice(0,200)||null}return e&&e.length>0?e.length>200?`${e.slice(0,200)}...`:e:null}const XT="deepseekcode/deepseekwork";function X$(t=XT){return`https://github.com/${t}/releases/latest`}function Q$(t){const e=/\.(exe|msi|dmg|deb|rpm|appimage)$/i.exec(String(t||""));if(!e)return String(t||"");const n=e[1]??"";return n.toLowerCase()==="appimage"?"AppImage":n.toUpperCase()}function L4(t){const n=(String(t||"").trim().replace(/^v/i,"").split(/[-+]/)[0]??"").split(".").map(a=>parseInt(a,10));for(;n.length<3;)n.push(0);return n.map(a=>Number.isFinite(a)?a:0)}function QT(t,e){const n=L4(t),a=L4(e);for(let r=0;r<3;r+=1){const i=n[r]??0,l=a[r]??0;if(i!==l)return i-l}return 0}const X0=[{version:"1.0.38",date:"2026-09-18",title:{zh:"压缩不再卡死 + 子代理判定修正 + ESC 撤销本轮",en:"Un-stuck compaction + sub-agent fixes + ESC undo"},items:[{zh:"上下文压缩加 120s 硬超时并补齐收场事件:摘要模型挂起时不再同步阻塞整个回合,修复「压缩之后任务不再继续」以及状态栏永久停在 compact N% 的问题",en:'Context compaction now has a 120s hard timeout and always emits a finish event — a hung summary model no longer blocks the whole turn, fixing "task stalls after compaction" and the status bar stuck at compact N%'},{zh:"子代理活性判定收紧:只有真实产出(正文/工具调用)才算进展,「只思考不出结果」的推理循环不再无限续命;槽位排队超时与停滞窗口对齐,正常子代理不会被误报 Agent slot unavailable",en:'Stricter sub-agent liveness: only real output (content / tool calls) counts as progress, so a "thinking-only" reasoning loop can no longer prolong itself forever; slot-queue timeout now aligns with the stall window so healthy agents stop failing with Agent slot unavailable'},{zh:"CLI:消息刚发出、AI 尚无任何产出且队列为空时,ESC 可直接撤销本轮(终止 + 撤回气泡 + 原文回填输入框);一旦有产出即退回原有暂停/终止语义",en:"CLI: when a message just went out and the AI has produced nothing yet (empty queue), ESC now undoes the whole turn (abort + retract the bubble + refill the input); once there is any output it falls back to the existing pause/stop behavior"},{zh:"错误与失败更清楚:运行失败渲染成独立的「对话报错」卡片(实时与历史回看同貌),并新增会话归属兜底——漏标会话的事件回填到发起会话,错误落到对应对话而非只弹全局提示",en:"Clearer errors: run failures render as a standalone error card (identical live and when reading history), plus session-attribution fallback — events missing a sessionId are attributed to the originating session so errors land in the right conversation instead of only a global toast"},{zh:"起手页新增四个输入前缀提示(/ 命令、@ 文件、! shell、$ 技能),把「怎么开头」直接教给新用户;Web 日志记录错误堆栈/组件栈,便于定位渲染循环类问题",en:"Start page now teaches the four input prefixes (/ command, @ file, ! shell, $ skill); web logs capture error/component stacks to help diagnose render-loop issues"}]},{version:"1.0.37",date:"2026-09-14",title:{zh:"会话委派可见 + 上下文体积治理",en:"Visible session delegation + context-size control"},items:[{zh:"被 @ 的会话可以看到实时进展了:被委派会话的流式内容/工具调用/完成事件不再被丢弃,CLI 与 Web 都会显示它的进行状态,不必等 A 会话转述",en:"Delegated sessions are now visible in real time: the streamed content / tool calls / completion events of a session you handed work to are no longer dropped — CLI and Web both show its progress instead of waiting for a summary"},{zh:"会话投递新增回执卡与回复卡(append-only 两张卡),投递状态可追溯;投递过期改按「run 世代」判定,不再受时钟影响",en:"Session delivery now writes an append-only ack card and reply card, so delivery state is traceable; staleness is judged by run generation instead of wall-clock time"},{zh:"AI 可自建会话与派活:新增 create_session / fork_session 工具,能 fork 出平行上下文再把任务投递过去(典型链路:fork 自己 → 派活 → 平行线回报)",en:"The agent can create and hand off sessions: new create_session / fork_session tools let it fork a parallel context and deliver work into it (fork yourself → delegate → parallel line reports back)"},{zh:"上下文体积治理:大工具结果在完整发送若干次后,会在请求投影里被替换为短占位符,原件按内容寻址存入 artifact store,需要时用 artifact_read / artifact_query 取回",en:"Context-size control: large tool results are replaced by a short placeholder in the request projection after being sent in full a few times — the original is stored content-addressed and retrievable via artifact_read / artifact_query"},{zh:"工具写入路径加固:移植 Codex apply_patch(写入确认与并发控制),并落地 tool_transaction V1 原型(变更 + 校验 + 证据回执)",en:"Hardened tool write path: ported Codex apply_patch (write approval and concurrency control) plus the tool_transaction V1 prototype (change + validation + evidence receipt)"},{zh:"Web UI:右栏「变更」视图、产出/改动入口行、可拖动缩放的通用浮窗、Markdown 大纲、设置面板;CLI 新增动态工作流界面(计划弹窗 / 进度卡)",en:"Web UI: a right-column Changes view, artifact/diff entry rows, a draggable-resizable floating window, markdown outline and a settings panel; CLI gains dynamic workflow UI (plan modal / progress card)"}]},{version:"1.0.33",date:"2026-09-07",title:{zh:"/clear 新建会话 + goal 模式进度修复",en:"/clear new-session semantics + goal-mode progress fix"},items:[{zh:"/clear 语义升级为「新建会话」(对齐 Claude Code):当前会话原样保存在服务端,可用 /sessions 或 /resume 恢复,不再清空/覆盖历史;Ctrl+N 同步生效",en:"/clear now starts a new session (Claude Code semantics): the current session is left intact and resumable via /sessions or /resume — history is no longer wiped. Ctrl+N behaves the same way"},{zh:"修复本地 CLI goal 模式无进度显示:server 与进程内 TUI 的 emitter sink 并存(addEmitter),workflow 异步节点事件完整送达两端",en:"Fixed missing progress display in local CLI goal mode: the server emitter now composes with the in-process TUI sink (addEmitter), so async workflow node events reach both ends"},{zh:"OpenClaw 插件加载器支持独立编译二进制(bun-standalone)探测:原生二进制下优先加载自包含 dist 产物,插件市场可正常安装/激活插件",en:"OpenClaw plugin loader now detects the compiled standalone binary (bun-standalone) and prefers self-contained dist bundles, keeping the plugin market functional in the native binary"},{zh:"Windows rebuild 后自动重写 PowerShell 的 dscode.ps1 启动器,PowerShell 中 dscode 始终执行最新原生二进制",en:"Windows rebuild now rewrites the PowerShell dscode.ps1 shim so dscode always runs the latest native binary from PowerShell"}]},{version:"1.0.32",title:{zh:"多任务后台工作 + 多模态能力落地",en:"Background multitasking + multimodal support"},items:[{zh:"新增后台工作:bash 工具支持 background:true,长任务在后台运行不阻塞对话,完成后自动通知(background_work_list / background_work_cancel 管理,REST API 同步支持)",en:"New background work: the bash tool supports background:true — long-running tasks keep running while you chat, and notify you on completion (manage via background_work_list / background_work_cancel and the REST API)"},{zh:"后台任务 keep-alive:有正在运行的后台工作时不会提前结束会话,CLI 增加等待状态 UI",en:"Keep-alive for background work: sessions no longer end while tasks are still running; the CLI shows a waiting-state UI"},{zh:"ComputerUse 多模态能力落地:真实桌面截图/点击/键盘操控,支持多显示器坐标换算",en:"Multimodal ComputerUse support: screenshot, click, and keyboard control of the real desktop with multi-monitor coordinate mapping"},{zh:"Web 统一能力管理入口:Agent 能力(工具开关)整合到连接器页,默认槽位分组 UI 重构、Act 默认按钮状态回显修复",en:"Web unified capability management: agent capability toggles moved into the Connectors page; default slot grouping UI rebuilt and Act default-button state fixed"},{zh:"Workflow 轨迹视图:Web 新增虚拟化时间线回放工作流执行过程",en:"Workflow trajectory view: the Web UI adds a virtualized timeline to replay workflow execution"},{zh:"会话级模型覆盖:CLI/Web 可独立为单个会话切换模型,/model --session 快速切换,--reset 清除",en:"Session-level model override: switch the model per-session independently in CLI/Web — /model --session to switch, --reset to clear"},{zh:"配置修复:网关 provider 模型 id 含 / 的写读一致性",en:'Config fix: consistent write/read for gateway provider model ids containing "/"'},{zh:"🌟 欢迎分享本项目!把 DeepSeekCode 推荐给你的朋友和团队(GitHub 与 npm:@deepseekcode/cli),你的每一次转发都是对我们的支持",en:"🌟 Spread the word! Share DeepSeekCode with your friends and team (GitHub repo & npm: @deepseekcode/cli) — every share helps the project grow"}]},{version:"1.0.29",title:{zh:"更新内容提示",en:"What's New notice"},items:[{zh:"CLI 与 Web 新增「更新内容」提示:每次版本升级后首次启动/打开时展示本次更新内容,之后不再打扰",en:`CLI and Web now show a "What's New" notice on first launch after a version upgrade — once per version, never again`},{zh:"CLI 新增 /whatsnew 命令,可随时查看历史更新内容",en:"New /whatsnew command in the CLI to view the changelog anytime"},{zh:"Web 设置页「关于」区域新增「查看更新内容」入口",en:`Web settings "About" section gains a "What's New" entry point`}]}];function JT(t,e){const n=a=>{if(a)return e==="zh"?a.zh:a.en};return{version:t.version,date:t.date,title:n(t.title),items:t.items.map(a=>e==="zh"?a.zh:a.en)}}function eE(t){return t?X0.filter(e=>QT(e.version,t)>0):X0}function tE(){const t=X0[0];return t?t.version:null}function nE(t,e,n,a,r=500){return t>0?"revokeQueue":e||n>0&&a-n<r?"stop":"pause"}const J$=["openai-chat-completions","openai-completions","openai-responses","anthropic-messages","codex-responses","claude-code"];ET.map(t=>t.eventType);function aE(){return`err-${Date.now()}-${Math.random().toString(36).slice(2,7)}`}const vl=Nn(t=>({errors:[],push:(e,n,a,r,i)=>{let l="";return t(c=>{const d=c.errors.find(m=>!m.dismissed&&!m.action&&m.level===e&&m.title===n);if(d)return l=d.id,{errors:c.errors.map(m=>m.id===d.id?{...m,count:m.count+1,timestamp:Date.now()}:m)};const p=aE();l=p;const h={id:p,level:e,title:n,detail:a,action:r,timestamp:Date.now(),dismissed:!1,durationMs:i,count:1};return{errors:[...c.errors.slice(-49),h]}}),l},dismiss:e=>t(n=>({errors:n.errors.map(a=>a.id===e?{...a,dismissed:!0}:a)})),clearAll:()=>t({errors:[]})})),xa={info:(t,e,n)=>vl.getState().push("info",t,e,void 0,n),warn:(t,e,n)=>vl.getState().push("warning",t,e,void 0,n),error:(t,e,n)=>vl.getState().push("error",t,e,void 0,n),critical:(t,e,n)=>vl.getState().push("critical",t,e,void 0,n)},oi=20,m5=15e3,j4=[500,1e3,2e3,5e3,1e4,m5],rE=3,g5="dscode_pending_frames",y5=20,b5=new Set(["question_answer","hook_allow","hook_deny"]);function B4(){try{const t=localStorage.getItem(g5);if(!t)return[];const e=JSON.parse(t);if(!Array.isArray(e))return[];const n=Date.now()-600*1e3;return e.filter(a=>!!a&&typeof a.type=="string"&&b5.has(a.type)&&typeof a.queuedAt=="number"&&a.queuedAt>=n)}catch{return[]}}function sm(t){try{localStorage.setItem(g5,JSON.stringify(t.slice(-y5)))}catch{}}const w1=()=>{const t=window.location.protocol==="https:"?"wss:":"ws:",e=window.location.hostname,n=window.location.port,a=n?String(Number(n)+1):"",r=a?`${e}:${a}`:e;return`${t}//${r}/ws`},sE=w1(),I4="dscode_client_id";function iE(){try{const t=localStorage.getItem(I4);if(t)return t;const e=`web-${typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():Math.random().toString(36).slice(2,10)}`;return localStorage.setItem(I4,e),e}catch{return`web-${Math.random().toString(36).slice(2,10)}`}}class oE{constructor(e){ne(this,"ws",null);ne(this,"url");ne(this,"clientId",iE());ne(this,"messageHandlers",new Set);ne(this,"openHandlers",new Set);ne(this,"closeHandlers",new Set);ne(this,"errorHandlers",new Set);ne(this,"reconnectAttempts",0);ne(this,"reconnectHandlers",new Set);ne(this,"reconnectSuccessHandlers",new Set);ne(this,"reconnectGiveUpHandlers",new Set);ne(this,"isManualClose",!1);ne(this,"authenticated",!1);ne(this,"bfCached",!1);ne(this,"sessionId",null);ne(this,"visibleSessions",new Set);ne(this,"pendingFrames",B4());ne(this,"heartbeatInterval",null);ne(this,"reconnectTimer",null);ne(this,"awaitingPong",0);ne(this,"HEARTBEAT_INTERVAL",15e3);ne(this,"MAX_MISSED_PONGS",3);this.url=e||sE,typeof window<"u"&&(window.addEventListener("pagehide",n=>{n.persisted&&this.enterBfCache()}),window.addEventListener("pageshow",n=>{n.persisted&&this.exitBfCache()}),window.addEventListener("online",()=>this.retryImmediately("网络恢复")),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&this.retryImmediately("标签页恢复可见")}))}setSessionId(e){this.sessionId=e}setVisibleSessions(e){const n=new Set;for(const a of e)a&&n.add(a);if(n.size===this.visibleSessions.size){let a=!0;for(const r of n)if(!this.visibleSessions.has(r)){a=!1;break}if(a)return}this.visibleSessions=n,this.sendSubscribeSessions()}sendSubscribeSessions(){var e;if(this.visibleSessions.size!==0&&((e=this.ws)==null?void 0:e.readyState)===WebSocket.OPEN)try{this.ws.send(JSON.stringify({type:"subscribe_sessions",data:JSON.stringify({sessionIds:[...this.visibleSessions]})}))}catch{}}getSessionId(){return this.sessionId}getPendingFrameCount(){return this.pendingFrames.length}getPendingFrameIds(){return this.pendingFrames.map(e=>e.id||e.type).filter(Boolean)}clearPendingQueue(){this.pendingFrames=[],sm([])}enqueueReliableFrame(e){const n=(()=>{try{return e.data?JSON.parse(e.data):{}}catch{return{}}})(),a={type:e.type,sessionId:e.sessionId,data:e.data,id:typeof n.questionId=="string"?n.questionId:typeof n.approvalId=="string"?n.approvalId:void 0,queuedAt:Date.now()},r=this.pendingFrames.filter(i=>i.id!==a.id||i.type!==a.type);this.pendingFrames=[...r,a].slice(-y5),sm(this.pendingFrames),console.warn(`[WS] NOT CONNECTED — queued ${e.type}${a.id?` (${a.id})`:""} for retry after reconnect`)}flushPendingFrames(){var r,i;if(((r=this.ws)==null?void 0:r.readyState)!==WebSocket.OPEN)return;const e=B4(),n=[...this.pendingFrames];for(const l of e){const c=n.findIndex(d=>d.id===l.id&&d.type===l.type);c>=0?n[c]=l:n.push(l)}if(n.length===0)return;this.pendingFrames=[];const a=[];for(const l of n){if(((i=this.ws)==null?void 0:i.readyState)!==WebSocket.OPEN){a.push(l);continue}try{this.ws.send(JSON.stringify({type:l.type,sessionId:l.sessionId,data:l.data}))}catch(c){console.warn("[WS] Failed to replay pending frame",l.type,String(c)),a.push(l)}}this.pendingFrames=a,sm(a)}getReconnectState(){var e;return{attempts:this.reconnectAttempts,maxAttempts:oi,reconnecting:this.reconnectAttempts>0&&((e=this.ws)==null?void 0:e.readyState)!==WebSocket.OPEN}}onReconnectAttempt(e){return this.reconnectHandlers.add(e),()=>this.reconnectHandlers.delete(e)}onReconnectSuccess(e){return this.reconnectSuccessHandlers.add(e),()=>this.reconnectSuccessHandlers.delete(e)}onReconnectGiveUp(e){return this.reconnectGiveUpHandlers.add(e),()=>this.reconnectGiveUpHandlers.delete(e)}connect(){var a,r;if(((a=this.ws)==null?void 0:a.readyState)===WebSocket.OPEN||((r=this.ws)==null?void 0:r.readyState)===WebSocket.CONNECTING)return;this.isManualClose=!1;const e=new URLSearchParams;this.sessionId&&e.set("sessionId",this.sessionId),e.set("clientId",this.clientId);const n=e.toString()?`${this.url}?${e.toString()}`:this.url;this.ws=new WebSocket(n),this.ws.binaryType="arraybuffer",this.ws.onopen=()=>{var l;const i=this.reconnectAttempts>0;this.reconnectAttempts=0,this.awaitingPong=0,i&&this.reconnectSuccessHandlers.forEach(c=>c()),this.startHeartbeat(),((l=this.ws)==null?void 0:l.readyState)===WebSocket.OPEN&&(this.awaitingPong=1,this.ws.send(JSON.stringify({type:"ping"}))),this.flushPendingFrames(),this.sendSubscribeSessions(),this.openHandlers.forEach(c=>c())},this.ws.onclose=()=>{this.stopHeartbeat(),this.closeHandlers.forEach(i=>i()),!this.isManualClose&&!this.bfCached&&this.scheduleReconnect()},this.ws.onerror=i=>{this.reportConnectionTrouble(i.message||"Connection failed"),this.errorHandlers.forEach(l=>l())},this.ws.onmessage=i=>{this._onMessage(i)}}async _onMessage(e){var n,a;try{let r;if(e.data instanceof Blob?r=await e.data.text():e.data instanceof ArrayBuffer?r=new TextDecoder().decode(e.data):typeof e.data=="string"?r=e.data:r=String(e.data),r=r.trim(),!r)return;const i=JSON.parse(r);if((i.type==="pong"||i.type==="ping")&&(this.awaitingPong=0,i.type==="pong"))return;i.seq!==void 0&&i.seq>=0&&this.send({type:"message_ack",data:JSON.stringify({seq:i.seq})}),this.messageHandlers.forEach(l=>l(i))}catch(r){const i=((a=(n=e.data)==null?void 0:n.constructor)==null?void 0:a.name)||typeof e.data;let l;if(e.data instanceof Blob?l=`[Blob ${e.data.size} bytes]`:e.data instanceof ArrayBuffer?l=`[ArrayBuffer ${e.data.byteLength} bytes]`:l=String(e.data).slice(0,500),typeof e.data=="string"&&e.data.trim()){const c=e.data.trim();try{this.messageHandlers.forEach(d=>d({type:"log",data:JSON.stringify({level:"info",message:c})}));return}catch{}}xa.error("Failed to parse WebSocket message",`type=${i} data=${l} error=${r}`)}}startHeartbeat(){this.stopHeartbeat(),this.awaitingPong=0,this.heartbeatInterval=setInterval(()=>{var e,n;if(!this.bfCached){if(this.awaitingPong>=this.MAX_MISSED_PONGS){console.warn(`[WS] Heartbeat timeout (${this.awaitingPong} missed pongs), reconnecting...`),this.stopHeartbeat(),this.isManualClose=!0,(e=this.ws)==null||e.close(),this.ws=null,this.scheduleReconnect();return}((n=this.ws)==null?void 0:n.readyState)===WebSocket.OPEN&&(this.awaitingPong+=1,this.send({type:"ping"}))}},this.HEARTBEAT_INTERVAL)}stopHeartbeat(){this.heartbeatInterval&&(clearInterval(this.heartbeatInterval),this.heartbeatInterval=null),this.awaitingPong=0}enterBfCache(){this.bfCached=!0,this.stopHeartbeat(),this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}exitBfCache(){var e,n;this.bfCached=!1,this.reconnectAttempts=0,((e=this.ws)==null?void 0:e.readyState)!==WebSocket.OPEN&&((n=this.ws)==null?void 0:n.readyState)!==WebSocket.CONNECTING&&this.connect()}scheduleReconnect(){if(this.reconnectAttempts++,this.reconnectAttempts>oi){console.error(`[WS] Max reconnect attempts (${oi}) reached — giving up.`),xa.error("WebSocket",`Connection lost — max reconnect attempts (${oi}) reached. Refresh the page to try again.`),this.reconnectGiveUpHandlers.forEach(r=>r());return}const e=Math.min(this.reconnectAttempts-1,j4.length-1),n=j4[e]??m5,a=Math.max(100,Math.round(n*(.8+Math.random()*.4)));this.reconnectHandlers.forEach(r=>r(this.reconnectAttempts,oi)),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},a)}reportConnectionTrouble(e){const n=Math.min(this.reconnectAttempts+1,oi);if(this.reconnectAttempts<rE){console.debug(`[WS] connection error (attempt ${n}/${oi}): ${e}`);return}xa.warn("WebSocket 连接不稳定",`正在重连(第 ${n}/${oi} 次):${e}`)}retryImmediately(e){var a;if(this.bfCached)return;const n=(a=this.ws)==null?void 0:a.readyState;n===WebSocket.OPEN||n===WebSocket.CONNECTING||this.reconnectAttempts===0&&this.reconnectTimer===null||(console.debug(`[WS] ${e} → 立即重连(重置退避)`),this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.reconnectAttempts=0,this.connect())}disconnect(){var e;this.isManualClose=!0,this.reconnectAttempts=0,this.stopHeartbeat(),this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),(e=this.ws)==null||e.close(),this.ws=null}send(e){var n,a;if(((n=this.ws)==null?void 0:n.readyState)===WebSocket.OPEN){const r=JSON.stringify(e);this.ws.send(r)}else e.type&&b5.has(e.type)?this.enqueueReliableFrame(e):console.warn("[WS] NOT CONNECTED — dropping:",e.type,e.sessionId,"readyState=",(a=this.ws)==null?void 0:a.readyState)}onMessage(e){return this.messageHandlers.add(e),()=>this.messageHandlers.delete(e)}onOpen(e){return this.openHandlers.add(e),()=>this.openHandlers.delete(e)}onClose(e){return this.closeHandlers.add(e),()=>this.closeHandlers.delete(e)}onError(e){return this.errorHandlers.add(e),()=>this.errorHandlers.delete(e)}get isConnected(){var e;return((e=this.ws)==null?void 0:e.readyState)===WebSocket.OPEN}setToken(e){try{sessionStorage.setItem("auth_token",e)}catch{}}get isAuthenticated(){return this.authenticated}setAuthenticated(e){this.authenticated=e}}const De=new oE;function P4(t,e){return`ext:${t}:${e.toLowerCase()}`}const ys=Nn()(Ri((t,e)=>({pendingApprovals:[],autoMode:!0,sessionAllowList:[],showConfigHint:!0,addApproval:n=>t(a=>({pendingApprovals:[...a.pendingApprovals,n]})),removeApproval:n=>t(a=>({pendingApprovals:a.pendingApprovals.filter(r=>r.approvalId!==n)})),clearApprovals:()=>t({pendingApprovals:[]}),setAutoMode:n=>t({autoMode:n}),addToSessionAllowList:(n,a)=>t(r=>{const i=a?P4(n,a):n;return r.sessionAllowList.includes(i)?r:{sessionAllowList:[...r.sessionAllowList,i]}}),isSessionAllowed:(n,a)=>{const r=e().sessionAllowList;return a?r.includes(P4(n,a)):r.includes(n)},setShowConfigHint:n=>t({showConfigHint:n})}),{name:"deepseekcode-hook-approval",partialize:t=>({autoMode:t.autoMode,showConfigHint:t.showConfigHint})})),Gc=qT();function lE(t){if(!t)return 0;const e=(t.match(/[\u4e00-\u9fff]/g)||[]).length,n=t.length-e;return Math.ceil(e*1.5+n*.25)}const Xe=Nn((t,e)=>({currentUsage:{promptTokens:0,completionTokens:0,totalTokens:0,estimatedCost:0},maxContextTokens:1e6,degradation:null,compactingUntil:0,lastCompactInfo:null,compactionProgress:null,cacheStats:null,showTokenInfo:!1,model:"",modelRef:"",modelSource:"",history:[],_hasBackendData:!1,tokenRate:0,sessionBaseTotal:0,workflowTokens:0,contextDistribution:null,thresholdWarning:null,retryState:null,contextBreakdown:null,setContextDistribution:n=>t({contextDistribution:n}),setContextBreakdown:n=>t({contextBreakdown:n}),setThresholdWarning:n=>t({thresholdWarning:n}),setRetryState:n=>t({retryState:n}),updateUsage:n=>t(a=>({currentUsage:{...a.currentUsage,...n},_hasBackendData:!0})),recordStreamText:n=>{Gc.feed(n);const a=Gc.rate();t({tokenRate:a}),a>0&&uE()},setModel:n=>t({model:n}),setModelRef:n=>t({modelRef:n}),setModelSource:n=>t({modelSource:n}),addWorkflowTokens:n=>t(a=>({workflowTokens:a.workflowTokens+(Number(n)||0)})),setMaxContextTokens:n=>t({maxContextTokens:n}),setDegradation:n=>t({degradation:n}),setCompacting:n=>t({compactingUntil:Date.now()+3e3,lastCompactInfo:n}),setCompactionProgress:n=>t({compactionProgress:n}),setCacheStats:n=>t({cacheStats:n}),accumulateCacheStats:(n,a)=>t(r=>{const i=r.cacheStats,l=((i==null?void 0:i.cacheHitTokens)??0)+n,c=((i==null?void 0:i.cacheMissTokens)??0)+a;return{cacheStats:{cacheHitTokens:l,cacheMissTokens:c,cacheHitRate:l+c>0?l/(l+c):void 0,cacheStatsCalls:((i==null?void 0:i.cacheStatsCalls)??0)+1}}}),setShowTokenInfo:n=>t({showTokenInfo:n}),addToHistory:n=>t(a=>({history:[...a.history.slice(-100),{timestamp:Date.now(),usage:n}]})),estimateTokens:n=>lE(n),recalculateFromMessages:n=>{if(!n||n.length===0){t({currentUsage:{promptTokens:0,completionTokens:0,totalTokens:0,estimatedCost:0},_hasBackendData:!1});return}if(e()._hasBackendData)return;const a=e().estimateTokens;let r=0,i=0;for(const d of n){if(d.shellRun)continue;let p=d.content||"";if(d.thinking&&(p+=" "+d.thinking),d.steps)for(const m of d.steps)m.thought&&(p+=" "+m.thought),m.action&&(p+=" "+m.action),m.result&&(p+=" "+m.result);if(d.toolCalls)for(const m of d.toolCalls)m.args&&(p+=" "+(typeof m.args=="string"?m.args:JSON.stringify(m.args)));const h=a(p);d.type==="user"?r+=h:i+=h}const l=r+i,c=r/1e6*.15+i/1e6*.6;t({currentUsage:{promptTokens:r,completionTokens:i,totalTokens:l,estimatedCost:c}})},resetUsage:()=>{mg(),Gc.reset(),t(n=>({currentUsage:{promptTokens:0,completionTokens:0,totalTokens:0,estimatedCost:0},_hasBackendData:!1,sessionBaseTotal:n.currentUsage.totalTokens,workflowTokens:0,tokenRate:0,contextDistribution:null,thresholdWarning:null,contextBreakdown:null}))},resetTokenRate:()=>{mg(),Gc.reset(),t({tokenRate:0})}})),cE=500;let nu=null;function mg(){nu!==null&&(clearInterval(nu),nu=null)}function uE(){nu===null&&(nu=setInterval(()=>{const t=Gc.rate();Xe.setState({tokenRate:t}),t<=0&&mg()},cE))}const v5="";function Ru(t){return`${v5}${t}`}class dE{constructor(e){ne(this,"baseUrl");this.baseUrl=e}async request(e,n={}){try{const a=sessionStorage.getItem("auth_token")??localStorage.getItem("auth_token"),r={"Content-Type":"application/json",...n.headers};a&&(r.Authorization=`Bearer ${a}`);const i=await fetch(`${this.baseUrl}${e}`,{headers:r,...n}),l=await i.json();return i.ok?l&&typeof l.success=="boolean"?{success:l.success,data:l.data,error:l.error}:{success:!0,data:l}:{success:!1,error:l.error||`HTTP ${i.status}`,data:l.data}}catch(a){return{success:!1,error:a instanceof Error?a.message:"Network error"}}}get(e){return this.request(e,{method:"GET"})}post(e,n){return this.request(e,{method:"POST",body:n?JSON.stringify(n):void 0})}put(e,n){return this.request(e,{method:"PUT",body:n?JSON.stringify(n):void 0})}delete(e,n){return this.request(e,{method:"DELETE",body:n?JSON.stringify(n):void 0})}patch(e,n){return this.request(e,{method:"PATCH",body:n?JSON.stringify(n):void 0})}}const Y=new dE(v5),Je={providers:{presets:()=>Y.get("/api/providers/presets"),refresh:()=>Y.post("/api/providers/refresh"),testConnection:(t,e)=>Y.post("/api/providers/test-connection",{baseUrl:t,apiKey:e})},models:{list:async()=>{var e;const t=await Y.get("/api/models");return t.success&&((e=t.data)!=null&&e.models)&&(t.data.models=t.data.models.map(n=>({...n,isGlobalDefault:n.isDefault===!0}))),t},get:t=>Y.get(`/api/models/${t}`),create:t=>Y.post("/api/models",t),update:(t,e,n)=>Y.post("/api/models/update",{provider:t,modelId:e,...n}),delete:(t,e)=>Y.post("/api/models/delete",{provider:t,modelId:e}),test:t=>Y.post(`/api/models/${t}/test`),fetch:(t,e,n)=>Y.post("/api/models/fetch",{baseUrl:t,apiKey:e,fullPath:n}),byProvider:(t,e)=>{const n=new URLSearchParams({provider:t});return e&&n.set("q",e),Y.get(`/api/models/by-provider?${n.toString()}`)},catalogSearch:t=>{const e=new URLSearchParams;t.q&&e.set("q",t.q),t.toolCall&&e.set("toolCall","1"),t.reasoning&&e.set("reasoning","1"),t.minContext&&e.set("minContext",String(t.minContext)),t.limit&&e.set("limit",String(t.limit));const n=e.toString();return Y.get(`/api/models/catalog${n?`?${n}`:""}`)},toggle:(t,e)=>Y.post("/api/models/toggle",{provider:t,modelId:e}),setDefaults:t=>Y.post("/api/models/defaults",t),getSessionModel:t=>Y.get(`/api/sessions/${encodeURIComponent(t)}/model`),setSessionModel:(t,e,n)=>Y.put(`/api/sessions/${encodeURIComponent(t)}/model`,{provider:e,model:n}),clearSessionModel:t=>Y.delete(`/api/sessions/${encodeURIComponent(t)}/model`)},tools:{list:()=>Y.get("/api/tools"),get:t=>Y.get(`/api/tools/${t}`),update:(t,e)=>Y.put(`/api/tools/${encodeURIComponent(t)}`,e),toggle:(t,e)=>Y.post(`/api/tools/${encodeURIComponent(t)}/toggle`,{enabled:e}),reset:t=>Y.post(`/api/tools/${encodeURIComponent(t)}/reset`,{}),exportConfig:()=>Y.get("/api/tools/config"),importConfig:(t,e="merge")=>Y.put("/api/tools/config",{config:t,mode:e})},connectors:{list:()=>Y.get("/api/connectors"),get:t=>Y.get(`/api/connectors/${encodeURIComponent(t)}`),toggle:(t,e,n)=>Y.post(`/api/connectors/${encodeURIComponent(t)}/toggle`,{enabled:e,env:n}),connect:(t,e)=>Y.post(`/api/connectors/${encodeURIComponent(t)}/connect`,{env:e}),addCustom:t=>Y.post("/api/connectors/custom",t),removeCustom:t=>Y.delete(`/api/connectors/custom/${encodeURIComponent(t)}`)},skills:{list:()=>Y.get("/api/skills"),get:t=>Y.get(`/api/skills/${t}`),create:t=>Y.post("/api/skills",t),update:(t,e)=>Y.put(`/api/skills/${t}`,e),toggle:(t,e)=>Y.post(`/api/skills/${t}/toggle`,{enabled:e}),delete:t=>Y.delete(`/api/skills/${t}`),import:t=>Y.post("/api/skills/import",t),marketplaces:{list:()=>Y.get("/api/skills/marketplaces"),add:t=>Y.post("/api/skills/marketplaces",t),remove:t=>Y.delete(`/api/skills/marketplaces/${t}`),get:t=>Y.get(`/api/skills/marketplaces/${t}`),refresh:t=>Y.post(`/api/skills/marketplaces/${t}/refresh`,{}),install:(t,e)=>Y.post(`/api/skills/marketplaces/${t}/install`,{skillId:e})},workshop:{list:t=>Y.get(`/api/skills/workshop${t?`?status=${t}`:""}`),propose:t=>Y.post("/api/skills/workshop",t),apply:t=>Y.post(`/api/skills/workshop/${t}/apply`,{}),reject:t=>Y.post(`/api/skills/workshop/${t}/reject`,{})},config:{get:t=>Y.get(`/api/skills/${t}/config`),update:(t,e)=>Y.put(`/api/skills/${t}/config`,e)}},shell:{exec:(t,e,n)=>Y.post("/api/shell/exec",{command:t,workspaceDir:e,timeoutMs:n})},terminalFigure:{generate:t=>Y.post("/api/terminal-figure",t)},files:{list:t=>Y.get(`/api/files${t?`?path=${encodeURIComponent(t)}`:""}`),read:t=>Y.get(`/api/files/read?path=${encodeURIComponent(t)}`),previewDocx:t=>Y.get(`/api/files/preview-docx?path=${encodeURIComponent(t)}`),previewXlsx:t=>Y.get(`/api/files/preview-xlsx?path=${encodeURIComponent(t)}`),previewTicket:(t,e)=>Y.post("/api/files/preview-ticket",{path:t,endpoint:e}),create:(t,e)=>Y.post("/api/files",{path:t,content:e}),update:(t,e)=>Y.put("/api/files/write",{path:t,content:e}),delete:t=>Y.delete(`/api/files?path=${encodeURIComponent(t)}`),download:async t=>{try{const e={},n=sessionStorage.getItem("auth_token")??localStorage.getItem("auth_token");n&&(e.Authorization=`Bearer ${n}`);const a=await fetch(Ru(`/api/files/download?path=${encodeURIComponent(t)}`),{headers:e});if(!a.ok){let c=`HTTP ${a.status}`;try{const d=await a.json();d!=null&&d.error&&(c=d.error)}catch{}return{success:!1,error:c}}const r=await a.blob(),i=URL.createObjectURL(r),l=document.createElement("a");return l.href=i,l.download=t.split(/[\\/]/).pop()||"download",l.click(),URL.revokeObjectURL(i),{success:!0}}catch(e){return{success:!1,error:e instanceof Error?e.message:"Download failed"}}},upload:async(t,e)=>{try{const n=await pE(t);return Y.post("/api/files/upload",{path:e,content:n,base64:!0})}catch(n){return{success:!1,error:n instanceof Error?n.message:"Upload failed"}}}},dirs:{list:t=>Y.get(`/api/dirs${t?`?path=${encodeURIComponent(t)}`:""}`)},fs:{open:(t,e)=>Y.post("/api/fs/open",{path:t,mode:e}),openFolder:t=>Y.post("/api/fs/open-folder",{dir:t})},sessions:{list:()=>Y.get("/api/sessions"),get:t=>Y.get(`/api/sessions/${t}`),create:t=>Y.post("/api/sessions",{title:t}),delete:t=>Y.delete(`/api/sessions/${t}`),resume:t=>Y.get(`/api/sessions/${encodeURIComponent(t)}/resume`),fork:(t,e)=>Y.post(`/api/sessions/${encodeURIComponent(t)}/fork`,e?{title:e}:{}),rename:(t,e)=>Y.patch(`/api/sessions/${encodeURIComponent(t)}`,{title:e})},tasks:{list:t=>Y.get(t?`/api/tasks?sessionId=${encodeURIComponent(t)}`:"/api/tasks"),get:t=>Y.get(`/api/tasks/${t}`),create:t=>Y.post("/api/tasks",t),update:(t,e)=>Y.put(`/api/tasks/${t}`,e),updateStatus:(t,e)=>Y.patch(`/api/tasks/${t}/status`,{status:e}),delete:t=>Y.delete(`/api/tasks/${t}`),clearCompleted:()=>Y.delete("/api/tasks")},agentRuns:{list:t=>Y.get(t?`/api/agent-runs?sessionId=${encodeURIComponent(t)}`:"/api/agent-runs"),stop:t=>Y.post(`/api/agent-runs/${encodeURIComponent(t)}/stop`),kill:t=>Y.post(`/api/agent-runs/${encodeURIComponent(t)}/kill`),pause:t=>Y.post(`/api/agent-runs/${encodeURIComponent(t)}/pause`),resume:t=>Y.post(`/api/agent-runs/${encodeURIComponent(t)}/resume`)},config:{provider:{get:()=>Y.get("/api/config/provider"),save:t=>Y.post("/api/config/provider",t),delete:t=>Y.post("/api/config/provider/remove",{provider:t}),setDefault:t=>Y.post("/api/config/provider",{provider:t,setDefault:!0})},files:{list:()=>Y.get("/api/config/files"),read:t=>Y.get(`/api/config/files/read?file=${encodeURIComponent(t)}`),write:(t,e)=>Y.put("/api/config/files/write",{file:t,content:e})},context:{get:()=>Y.get("/api/config/context"),save:t=>Y.post("/api/config/context",t)},language:{get:()=>Y.get("/api/config/language"),set:t=>Y.post("/api/config/language",{language:t})},profile:{get:()=>Y.get("/api/config/profile"),set:t=>Y.post("/api/config/profile",t)}},profile:{get:()=>Y.get("/api/profile"),raw:()=>Y.get("/api/profile/raw"),set:t=>Y.put("/api/profile",t),clear:()=>Y.delete("/api/profile")},git:{status:()=>Y.get("/api/git/status"),diff:(t,e)=>{const n=new URLSearchParams({path:t});return e!=null&&e.mode&&n.set("mode",e.mode),(e==null?void 0:e.context)!=null&&n.set("context",String(e.context)),Y.get(`/api/git/diff?${n.toString()}`)}},fileJob:{parse:t=>Y.post("/api/filejob/parse",{files:t}),parsePaths:t=>Y.post("/api/filejob/parse",{paths:t}),importPaths:t=>Y.post("/api/filejob/import",{paths:t}),render:t=>Y.post("/api/filejob/render",t)},system:{status:()=>Y.get("/api/system/status"),restart:()=>Y.post("/api/system/restart"),shutdown:()=>Y.post("/api/system/shutdown"),network:()=>Y.get("/api/system/network"),setNetwork:t=>Y.put("/api/system/network",{allowLanAccess:t}),desktopDownload:()=>Y.get("/api/system/desktop-download")},observability:{summary:()=>Y.get("/api/observability/summary"),costs:()=>Y.get("/api/observability/costs")},templates:{list:()=>Y.get("/api/templates"),get:t=>Y.get(`/api/templates/${encodeURIComponent(t)}`),create:t=>Y.post("/api/templates",t),update:(t,e)=>Y.put(`/api/templates/${encodeURIComponent(t)}`,e),remove:t=>Y.delete(`/api/templates/${encodeURIComponent(t)}`),versions:t=>Y.get(`/api/templates/${encodeURIComponent(t)}/versions`),getVersion:(t,e)=>Y.get(`/api/templates/${encodeURIComponent(t)}/versions/${e}`),render:(t,e)=>Y.post(`/api/templates/${encodeURIComponent(t)}/render`,{inputs:e}),createFromRun:(t,e)=>Y.post("/api/templates",{sourceRunId:t,generalize:(e==null?void 0:e.generalize)===!0,name:e==null?void 0:e.name,message:e==null?void 0:e.message})},workflows:{list:()=>Y.get("/api/workflows"),start:t=>Y.post("/api/workflows",t),get:t=>Y.get(`/api/workflows/${encodeURIComponent(t)}`),events:t=>Y.get(`/api/workflows/${encodeURIComponent(t)}/events`),synthesize:t=>Y.post("/api/workflows/synthesize",{message:t})},plans:{list:()=>Y.get("/api/plans"),read:t=>Y.get(`/api/plans/${encodeURIComponent(t)}`),delete:t=>Y.delete(`/api/plans/${encodeURIComponent(t)}`)},logs:{list:()=>Y.get("/api/logs"),read:(t,e)=>Y.get(`/api/logs/read?file=${encodeURIComponent(t)}${e?`&maxLines=${e}`:""}`),downloadUrl:t=>`/api/logs/download?file=${encodeURIComponent(t)}`},stt:{status:()=>Y.get("/api/stt/status"),transcribe:(t,e,n="wav")=>Y.post("/api/stt/transcribe",{language:t,audio:e,format:n}),install:t=>Y.post("/api/stt/install",{backend:t}),installStatus:()=>Y.get("/api/stt/install/status"),cancelInstall:()=>Y.post("/api/stt/install/cancel"),getConfig:()=>Y.get("/api/stt/config"),setConfig:t=>Y.put("/api/stt/config",t)},hooks:{list:()=>Y.get("/api/hooks/rules"),get:t=>Y.get(`/api/hooks/rules/${encodeURIComponent(t)}`),create:t=>Y.post("/api/hooks/rules",t),update:(t,e)=>Y.put(`/api/hooks/rules/${encodeURIComponent(t)}`,e),delete:t=>Y.delete(`/api/hooks/rules/${encodeURIComponent(t)}`),batchDelete:t=>Y.post("/api/hooks/rules/batch-delete",{names:t}),toggle:(t,e)=>Y.patch(`/api/hooks/rules/${encodeURIComponent(t)}/toggle`,{enabled:e}),batchToggle:(t,e)=>Y.post("/api/hooks/rules/batch-toggle",{names:t,enabled:e}),dryRun:t=>Y.post("/api/hooks/dry-run",t),stats:()=>Y.get("/api/hooks/stats"),events:()=>Y.get("/api/hooks/events"),agents:()=>Y.get("/api/hooks/agents"),export:()=>Y.get("/api/hooks/export"),import:t=>Y.post("/api/hooks/import",t)},assistants:{list:()=>Y.get("/api/assistants"),get:t=>Y.get(`/api/assistants/${encodeURIComponent(t)}`),update:(t,e)=>Y.patch(`/api/assistants/${encodeURIComponent(t)}`,e)},channels:{list:()=>Y.get("/api/channels"),types:()=>Y.get("/api/channels/types"),catalog:()=>Y.get("/api/channels/catalog"),create:t=>Y.post("/api/channels",t),update:(t,e)=>Y.put(`/api/channels/${encodeURIComponent(t)}`,e),delete:t=>Y.delete(`/api/channels/${encodeURIComponent(t)}`),toggle:(t,e)=>Y.patch(`/api/channels/${encodeURIComponent(t)}/toggle`,{enabled:e}),test:t=>Y.post(`/api/channels/${encodeURIComponent(t)}/test`),wechat:{qrcode:(t,e)=>Y.get(`/api/channels/${encodeURIComponent(t)}/wechat/qrcode?token=${encodeURIComponent(e)}`),qrcodeStatus:(t,e,n)=>Y.get(`/api/channels/${encodeURIComponent(t)}/wechat/qrcode/status?token=${encodeURIComponent(e)}&qrcode=${encodeURIComponent(n)}`)},weixin:{bind:()=>Y.get("/api/weixin/bind"),bindStatus:t=>Y.get(`/api/weixin/bind/status?qrcode=${encodeURIComponent(t)}`)}},automations:{list:()=>Y.get("/api/automations"),create:t=>Y.post("/api/automations",t),update:(t,e)=>Y.put(`/api/automations/${encodeURIComponent(t)}`,e),remove:t=>Y.delete(`/api/automations/${encodeURIComponent(t)}`),toggle:(t,e)=>Y.post(`/api/automations/${encodeURIComponent(t)}/toggle`,{enabled:e}),run:t=>Y.post(`/api/automations/${encodeURIComponent(t)}/run`),runs:t=>Y.get(`/api/automations/${encodeURIComponent(t)}/runs`),addPermission:(t,e,n)=>Y.post(`/api/automations/${encodeURIComponent(t)}/permissions`,{tool:e,target:n}),revokePermission:(t,e)=>Y.delete(`/api/automations/${encodeURIComponent(t)}/permissions`,{entry:e})}};function pE(t){return new Promise((e,n)=>{const a=new FileReader;a.onload=()=>{const r=a.result,i=r.indexOf(",");e(i>=0?r.slice(i+1):r)},a.onerror=()=>n(a.error||new Error("Failed to read file")),a.readAsDataURL(t)})}const im=t=>t==="normal"?"act":t;let n0=0;const fE=t=>t==="normal"?"normal":t==="auto"?"auto-act":f5(typeof t=="string"?t:void 0),hE=["default","user_override","auto_router"],zc=t=>t==="normal"?"act":lo(t)?"auto":ja(t),bi=Nn()(Ri((t,e)=>({mode:"auto-act",modeSource:"default",pendingSuggestion:null,currentPlanContent:null,modeHistory:[],thinkingStatusBySession:{},prePlanMode:null,setMode:n=>{const a=e().mode;if(a===n)return;t(p=>({mode:n,pendingSuggestion:null,modeHistory:[...p.modeHistory,{previousMode:a,newMode:n,description:`Mode changed: ${a} -> ${n}`,timestamp:Date.now()}]})),ys.getState().setAutoMode(n!=="normal"&&lo(n));const r=zc(a),i=zc(n),l=a==="normal"?"act":ja(a),c=n==="normal"?"act":ja(n);if(l===c&&r===i)return;try{const p=Ge.getState().activeSessionId||De.getSessionId();p&&De.send({type:"plan_mode_change",sessionId:p,data:JSON.stringify({previousMode:zc(a),newMode:zc(n),frontendMode:n,timestamp:Date.now()})})}catch(p){console.warn("[ExecutionModeStore] Failed to notify mode change via WS:",p)}const d=++n0;Je.models.list().then(p=>{var S;if(d!==n0||!p.success||!((S=p.data)!=null&&S.models))return;const h=p.data.models.filter(C=>C.enabled!==!1),m=ja(im(n)),b=h.find(C=>C.defaultFor===m),x=h.find(C=>C.isDefault||C.defaultFor==="global"),w=b||x||h[0];w&&(Xe.getState().setModel(w.id),Xe.getState().setModelRef(`${w.provider}:${w.id}`))}).catch(p=>{console.warn("[ExecutionModeStore] Failed to refresh models:",p)})},applyBackendMode:n=>{const a=e().mode;if(a===n)return;t(i=>({mode:n,prePlanMode:n!=="plan"?null:i.prePlanMode,modeHistory:[...i.modeHistory,{previousMode:a,newMode:n,description:`Backend mode changed: ${a} -> ${n}`,timestamp:Date.now()}]})),ys.getState().setAutoMode(n!=="normal"&&lo(n));const r=++n0;Je.models.list().then(i=>{var m;if(r!==n0||!i.success||!((m=i.data)!=null&&m.models))return;const l=i.data.models.filter(b=>b.enabled!==!1),c=ja(im(n)),d=l.find(b=>b.defaultFor===c),p=l.find(b=>b.isDefault||b.defaultFor==="global"),h=d||p||l[0];h&&(Xe.getState().setModel(h.id),Xe.getState().setModelRef(`${h.provider}:${h.id}`))}).catch(i=>{console.warn("[ExecutionModeStore] Failed to refresh models after backend mode change:",i)})},applyModeState:(n,a)=>{const r=hE.includes(a)?a:"default";if(e().modeSource!==r&&t({modeSource:r}),typeof n!="string"||!n)return;const i=e().mode,l=i!=="normal"&&lo(i),c=n==="normal"?"normal":R0(ja(f5(n)),l);c!==i&&(e().pendingSuggestion&&t({pendingSuggestion:null}),e().applyBackendMode(c))},setPendingSuggestion:n=>t({pendingSuggestion:n}),toggleMode:()=>{const n=e().mode,a=n==="normal"?"act":FT(n);e().setMode(a)},setBaseMode:n=>{const a=e().mode,r=a!=="normal"&&lo(a);e().setMode(R0(n,r))},setAuto:n=>{e().setMode(R0(ja(im(e().mode)),n))},toggleAuto:()=>{const n=e().mode;e().setMode(n==="normal"?"auto-act":$T(n))},enterPlanMode:(n,a)=>{const r=e().mode,i=r!=="normal"&&ja(r)!=="plan"?r:e().prePlanMode,l=r!=="normal"&&ja(r)==="goal"?"goal":"plan";t(c=>({mode:l,prePlanMode:i,modeHistory:[...c.modeHistory,{previousMode:r,newMode:l,description:`Enter ${l} mode: ${a}`,timestamp:Date.now()}]})),ys.getState().setAutoMode(!1)},exitPlanMode:(n,a)=>{const r=e().mode,i=e().prePlanMode,l=i&&(i==="normal"||ja(i)!=="plan")?i:"act";t(c=>({mode:l,prePlanMode:null,modeHistory:[...c.modeHistory,{previousMode:r,newMode:l,description:`Exit to ${l} mode: ${a}`,timestamp:Date.now()}]})),ys.getState().setAutoMode(l!=="normal"&&lo(l))},enterGoalMode:(n,a)=>{const r=e().mode;t(i=>({mode:"goal",modeHistory:[...i.modeHistory,{previousMode:r,newMode:"goal",description:`Enter Goal mode: ${a}`,timestamp:Date.now()}]})),ys.getState().setAutoMode(!1);try{const i=Ge.getState().activeSessionId||De.getSessionId()||void 0;De.send({type:"plan_mode_change",sessionId:i,data:JSON.stringify({previousMode:zc(r),newMode:"goal",frontendMode:"goal",goalDescription:a,timestamp:Date.now()})})}catch(i){console.warn("[ExecutionModeStore] Failed to notify goal mode change via WS:",i)}},exitGoalMode:()=>{const n=e().mode;t(a=>({mode:"act",modeHistory:[...a.modeHistory,{previousMode:n,newMode:"act",description:"Exit Goal mode",timestamp:Date.now()}]})),ys.getState().setAutoMode(!1)},setPlanContent:n=>t({currentPlanContent:n}),setThinkingStatus:(n,a)=>t(r=>({thinkingStatusBySession:{...r.thinkingStatusBySession,[n]:a}})),getThinkingStatus:n=>e().thinkingStatusBySession[n]||"",reset:()=>t({mode:"auto-act",modeSource:"default",pendingSuggestion:null,currentPlanContent:null,modeHistory:[],thinkingStatusBySession:{},prePlanMode:null})}),{name:"deepseekcode-plan-storage",version:1,migrate:t=>t,merge:(t,e)=>{const n=t??{};return{...e,...n,mode:fE(n.mode)}},partialize:t=>({mode:t.mode,currentPlanContent:t.currentPlanContent,modeHistory:t.modeHistory})}));function hu(t){window.dispatchEvent(new CustomEvent("preview-file",{detail:{path:t}}))}const mu="dsc-image:",mE=/^dsc-image:[^/]+\/(.+)$/,co=new Map,gE=50;function yE(t){const e=t.slice(0,4096),n=t.length>8192?t.slice(-4096):"",a=`${t.length}|${e}|${n}`;let r=5381;for(let i=0;i<a.length;i++)r=(r<<5)+r+a.charCodeAt(i)>>>0;return r.toString(36)}function x5(t){return(t||"image").replace(/[\\/]/g,"_").replace(/["<>]/g,"").trim()||"image"}function bE(t,e){if(!t)return"";const n=yE(t),a=x5(e),r=co.get(n);if(r)return`${mu}${n}/${r.name}`;if(co.size>=gE){const i=co.keys().next().value;i!==void 0&&co.delete(i)}return co.set(n,{src:t,name:a}),`${mu}${n}/${a}`}function k1(t){return typeof t=="string"&&t.startsWith(mu)}function w5(t){var n;if(!k1(t))return null;const e=t.slice(mu.length).split("/")[0]??"";return((n=co.get(e))==null?void 0:n.src)??null}function S1(t){var n,a;if(!k1(t))return null;const e=t.slice(mu.length).split("/")[0]??"";return((n=co.get(e))==null?void 0:n.name)??((a=mE.exec(t))==null?void 0:a[1])??null}function eF(t){const{src:e,path:n}=t,a=n?n.split(/[\\/]/).pop()||n:"image",r=x5(t.name||a);if(!e)return;if(n&&!e.startsWith("data:")&&!e.startsWith("blob:")){hu(n);return}const i=bE(e,r);i&&hu(i)}function k5(t){var e,n,a="";if(typeof t=="string"||typeof t=="number")a+=t;else if(typeof t=="object")if(Array.isArray(t)){var r=t.length;for(e=0;e<r;e++)t[e]&&(n=k5(t[e]))&&(a&&(a+=" "),a+=n)}else for(n in t)t[n]&&(a&&(a+=" "),a+=n);return a}function vE(){for(var t,e,n=0,a="",r=arguments.length;n<r;n++)(t=arguments[n])&&(e=k5(t))&&(a&&(a+=" "),a+=e);return a}function Ke(...t){return vE(t)}const om=200,z4=50,$4=30;function a0(t,e,n=[]){const a=Object.keys(t);if(a.length<=e)return t;const r=new Set(n),i=a.filter(d=>!r.has(d)).sort((d,p)=>{var h,m;return(((h=t[d])==null?void 0:h.updatedAt)??0)-(((m=t[p])==null?void 0:m.updatedAt)??0)}),l=new Set(i.slice(0,Math.max(0,a.length-e))),c={};for(const d of a)l.has(d)||(c[d]=t[d]);return c}const F4=(t,e)=>({runId:e,sessionId:t,status:"RUNNING",completedPhases:0,totalPhases:0,completedEffects:0,totalEffects:0,tokensUsed:0,tokensRemaining:0,startedAt:Date.now(),updatedAt:Date.now()}),na=()=>Date.now(),vr=(t,e)=>{const n=String(t||"").toLowerCase();return e||n==="done"||n==="success"||n==="completed"||n==="complete"?"completed":n==="running"||n==="in_progress"||n==="started"?"running":n==="failed"||n==="error"?"failed":n==="skipped"||n==="cancelled"||n==="canceled"?"skipped":"pending"},H4=t=>t.id||`${t.type||"event"}-${t.timestamp||na()}-${Math.random().toString(36).slice(2,8)}`;function lm(t){if(!Array.isArray(t)||t.length===0)return{totalPhases:0,completedNodes:0};const e=t.length,n=t.filter(a=>a.status==="completed"||a.status==="skipped"||a.status==="failed").length;return{totalPhases:e,completedNodes:n}}const ot=Nn()(Ri((t,e)=>({bySession:{},byRun:{},agentsBySession:{},tasksBySession:{},eventsBySession:{},plansBySession:{},dwfOffersBySession:{},dwfPromotableBySession:{},upsert:(n,a)=>t(r=>{const i=a.runId,l=r.byRun[i]&&r.byRun[i].runId===i?r.byRun[i]:F4(n,i),c={...l.agentNodes||{}};a.agentNode&&(c[a.agentNode.nodeId]=a.agentNode);const{agentNode:d,...p}=a,h={};for(const[C,E]of Object.entries(p))E!==void 0&&(h[C]=E);const m={...l,...h,agentNodes:c,sessionId:n,runId:i,updatedAt:na()},b={...r.agentsBySession[n]||{}};d&&(b[d.nodeId]={...b[d.nodeId]||{},id:d.nodeId,sessionId:n,name:d.role,role:d.role,source:"workflow",runId:i,phase:d.phase,status:d.status,tokens:d.tokens,error:d.error,updatedAt:d.updatedAt||na()});const x=a.lastEventType||a.status||"workflow_update",S=[{id:H4({type:x}),sessionId:n,type:x,source:"workflow",timestamp:na(),status:m.status,runId:i,agentId:d==null?void 0:d.nodeId,message:m.error,data:p},...r.eventsBySession[n]||[]].slice(0,om);return{bySession:a0({...r.bySession,[n]:m},$4,[n]),byRun:a0({...r.byRun,[i]:m},z4,[i]),agentsBySession:{...r.agentsBySession,[n]:b},eventsBySession:{...r.eventsBySession,[n]:S}}}),fail:(n,a,r)=>e().upsert(n,{runId:a,status:"ERROR",error:r,lastEventType:"workflow_error"}),getForSession:n=>e().bySession[n],setPlan:(n,a)=>t(r=>({plansBySession:{...r.plansBySession,[n]:a}})),clearPlan:n=>t(a=>{if(!a.plansBySession[n])return{};const r={...a.plansBySession};return delete r[n],{plansBySession:r}}),getPlanForSession:n=>e().plansBySession[n],setDwfOffer:(n,a)=>t(r=>({dwfOffersBySession:{...r.dwfOffersBySession,[n]:a}})),clearDwfOffer:(n,a)=>t(r=>{const i=r.dwfOffersBySession[n];if(!i||a&&i.offerId!==a)return{};const l={...r.dwfOffersBySession};return delete l[n],{dwfOffersBySession:l}}),getDwfOfferForSession:n=>e().dwfOffersBySession[n],setDwfPromotable:(n,a)=>t(r=>({dwfPromotableBySession:{...r.dwfPromotableBySession,[n]:a}})),clearDwfPromotable:(n,a)=>t(r=>{const i=r.dwfPromotableBySession[n];if(!i||a&&i.workflowId!==a)return{};const l={...r.dwfPromotableBySession};return delete l[n],{dwfPromotableBySession:l}}),getDwfPromotableForSession:n=>e().dwfPromotableBySession[n],setNodes:(n,a,r)=>t(i=>{const l=i.byRun[a],c=l||i.bySession[n]||F4(n,a),d=r.map(b=>{var x;return((x=c.nodes)==null?void 0:x.find(w=>w.id===b.id))||b}),{totalPhases:p,completedNodes:h}=lm(d),m={...c,runId:a,sessionId:n,nodes:d,totalPhases:p||c.totalPhases,completedPhases:l?h||c.completedPhases:h,startedAt:l?c.startedAt??na():na(),finishedAt:l?c.finishedAt:void 0,updatedAt:na()};return{bySession:{...i.bySession,[n]:m},byRun:{...i.byRun,[a]:m}}}),setNodeStatus:(n,a,r,i)=>t(l=>{const c=l.byRun[a],d=c||l.bySession[n];if(!d)return{};const p=(d.nodes||[]).map(x=>x.id===r?{...x,...i}:x),{totalPhases:h,completedNodes:m}=lm(p),b={...d,nodes:p,totalPhases:h||d.totalPhases,completedPhases:c?m||d.completedPhases:m,updatedAt:na()};return{bySession:{...l.bySession,[n]:b},byRun:{...l.byRun,[a]:b}}}),finalizeNodes:(n,a,r)=>t(i=>{const l=i.byRun[a]||i.bySession[n];if(!l||!Array.isArray(l.nodes))return{};const c=l.nodes.map(m=>m.status==="pending"||m.status==="ready"||m.status==="blocked"?{...m,status:"skipped"}:m),{totalPhases:d,completedNodes:p}=lm(c),h={...l,nodes:c,completedPhases:p||l.completedPhases,totalPhases:d||l.totalPhases,finishedAt:na(),updatedAt:na()};return{bySession:{...i.bySession,[n]:h},byRun:{...i.byRun,[a]:h}}}),upsertAgent:(n,a)=>t(r=>{var c;const i=(c=r.agentsBySession[n])==null?void 0:c[a.id],l={id:a.id,sessionId:n,name:a.name||a.role||(i==null?void 0:i.name)||a.id,role:a.role||(i==null?void 0:i.role)||a.name||a.id,source:a.source||(i==null?void 0:i.source)||"agent",status:a.status||(i==null?void 0:i.status)||"idle",toolCallId:a.toolCallId??(i==null?void 0:i.toolCallId),runId:a.runId??(i==null?void 0:i.runId),phase:a.phase??(i==null?void 0:i.phase),taskId:a.taskId??(i==null?void 0:i.taskId),currentTask:a.currentTask??(i==null?void 0:i.currentTask),round:a.round??(i==null?void 0:i.round),maxRounds:a.maxRounds??(i==null?void 0:i.maxRounds),currentTool:a.currentTool??(i==null?void 0:i.currentTool),elapsedMs:a.elapsedMs??(i==null?void 0:i.elapsedMs),elapsedAt:a.elapsedMs!==void 0?a.elapsedAt??na():i==null?void 0:i.elapsedAt,tokens:a.tokens??(i==null?void 0:i.tokens),error:a.error??(i==null?void 0:i.error),parentId:a.parentId??(i==null?void 0:i.parentId),updatedAt:a.updatedAt||na()};return{agentsBySession:{...r.agentsBySession,[n]:{...r.agentsBySession[n]||{},[a.id]:l}}}}),upsertTask:(n,a)=>t(r=>{var p;const i=(p=r.tasksBySession[n])==null?void 0:p[a.id],l=na(),c=a.status||(i==null?void 0:i.status)||"pending",d={id:a.id,sessionId:n,title:a.title||(i==null?void 0:i.title)||a.description||a.id,status:c,source:a.source||(i==null?void 0:i.source)||"task",description:a.description??(i==null?void 0:i.description),agentType:a.agentType??(i==null?void 0:i.agentType),progress:a.progress??(i==null?void 0:i.progress),result:a.result??(i==null?void 0:i.result),error:a.error??(i==null?void 0:i.error),runId:a.runId??(i==null?void 0:i.runId),dependencies:a.dependencies??(i==null?void 0:i.dependencies),startedAt:a.startedAt??(i==null?void 0:i.startedAt)??(c==="running"?l:void 0),completedAt:a.completedAt??(i==null?void 0:i.completedAt)??(c==="completed"||c==="failed"?l:void 0),createdAt:a.createdAt||(i==null?void 0:i.createdAt)||l,updatedAt:a.updatedAt||l,raw:a.raw??(i==null?void 0:i.raw)};return{tasksBySession:{...r.tasksBySession,[n]:{...r.tasksBySession[n]||{},[a.id]:d}}}}),setTasks:(n,a,r="plan")=>t(i=>{const l=i.tasksBySession[n]||{},c=Object.fromEntries(Object.entries(l).filter(([,h])=>h.source!==r)),d=na(),p=Object.fromEntries(a.map((h,m)=>{const b=l[h.id],x=h.status||(b==null?void 0:b.status)||"pending",w={id:h.id,sessionId:n,title:h.title||(b==null?void 0:b.title)||h.description||`Task ${m+1}`,status:x,source:h.source||r,description:h.description??(b==null?void 0:b.description),agentType:h.agentType??(b==null?void 0:b.agentType),progress:h.progress??(b==null?void 0:b.progress),result:h.result??(b==null?void 0:b.result),error:h.error??(b==null?void 0:b.error),runId:h.runId??(b==null?void 0:b.runId),dependencies:h.dependencies??(b==null?void 0:b.dependencies),startedAt:h.startedAt??(b==null?void 0:b.startedAt),completedAt:h.completedAt??(b==null?void 0:b.completedAt),createdAt:h.createdAt||(b==null?void 0:b.createdAt)||d+m,updatedAt:h.updatedAt||d,raw:h.raw??(b==null?void 0:b.raw)};return[w.id,w]}));return{tasksBySession:{...i.tasksBySession,[n]:{...c,...p}}}}),recordEvent:(n,a)=>t(r=>{const i={id:H4(a),sessionId:n,type:a.type,source:a.source||"system",timestamp:a.timestamp||na(),title:a.title,message:a.message,status:a.status,runId:a.runId,agentId:a.agentId,taskId:a.taskId,data:a.data};return{eventsBySession:{...r.eventsBySession,[n]:[i,...r.eventsBySession[n]||[]].slice(0,om)}}}),getAgentsForSession:n=>Object.values(e().agentsBySession[n]||{}).sort((a,r)=>r.updatedAt-a.updatedAt),getTasksForSession:n=>Object.values(e().tasksBySession[n]||{}).sort((a,r)=>{const i={running:0,pending:1,failed:2,completed:3,skipped:4};return i[a.status]-i[r.status]||a.createdAt-r.createdAt}),getEventsForSession:n=>e().eventsBySession[n]||[],getAgentTree:n=>{const a=Object.values(e().agentsBySession[n]||{}),r=new Map(a.map(d=>[d.id,d])),i=a.filter(d=>!d.parentId||!r.has(d.parentId)),l=d=>a.filter(p=>p.parentId===d),c=d=>({agent:d,children:l(d.id).map(c),isRunning:d.status==="running",tokensUsed:d.tokens||0});return i.map(c)},getAgentByToolCallId:(n,a,r)=>{if(!n)return;const i=e().agentsBySession[n];if(!i)return;const l=Object.values(i);if(a){for(const p of l)if(p.toolCallId===a)return p}if(!r)return;const c=r.slice(0,60),d=l.filter(p=>!p.toolCallId&&p.name===c&&(p.status==="running"||p.status==="scheduled"||p.status==="paused"));return d.length===1?d[0]:void 0},getRunningAgentCount:n=>Object.values(e().agentsBySession[n]||{}).filter(r=>r.status==="running").length}),{name:"deepseekcode-workflow-store",storage:y1({key:"workflowStore",trims:[t=>({...t,state:{...t.state,eventsBySession:Object.fromEntries(Object.entries(t.state.eventsBySession).map(([e,n])=>[e,n.slice(-50)])),tasksBySession:Object.fromEntries(Object.entries(t.state.tasksBySession).map(([e,n])=>[e,Object.fromEntries(Object.entries(n).map(([a,r])=>[a,{...r,result:r.result?String(r.result).slice(0,1e3):void 0,error:r.error?String(r.error).slice(0,1e3):void 0}]))]))}}),t=>({...t,state:{...t.state,eventsBySession:{}}}),t=>({...t,state:{...t.state,tasksBySession:{},agentsBySession:{}}})],onFailure:()=>{try{ws.getState().addToast("warning","任务看板数据保存失败:浏览器本地存储已满或不可用。当前数据仅保留在内存中,刷新页面将丢失。",8e3)}catch{}}}),partialize:t=>{const e=a0(t.bySession,$4),n=a0(t.byRun,z4),a=new Set([...Object.keys(e),...Object.keys(t.plansBySession||{}),...Object.keys(t.dwfOffersBySession||{})]),r=i=>Object.fromEntries(Object.entries(i).filter(([l])=>a.has(l)));return{bySession:e,byRun:n,agentsBySession:r(t.agentsBySession),plansBySession:t.plansBySession,dwfOffersBySession:Object.fromEntries(Object.entries(t.dwfOffersBySession||{}).map(([i,l])=>[i,l.scriptPreview&&l.scriptPreview.length>2e3?{...l,scriptPreview:l.scriptPreview.slice(0,2e3)}:l])),tasksBySession:Object.fromEntries(Object.entries(r(t.tasksBySession)).map(([i,l])=>[i,Object.fromEntries(Object.entries(l).map(([c,d])=>{const{raw:p,...h}=d;return[c,h]}))])),eventsBySession:Object.fromEntries(Object.entries(r(t.eventsBySession)).map(([i,l])=>[i,l.slice(-om).map(c=>{const{data:d,...p}=c;return p})]))}}})),er=Nn()((t,e)=>({status:null,refreshing:!1,changeScope:"session",setChangeScope:n=>t({changeScope:n}),refreshStatus:async()=>{if(e().refreshing)return e().status;t({refreshing:!0});try{const n=await Je.git.status();return n.success&&n.data?(t({status:n.data}),n.data):(t({status:{available:!1,error:n.error||"Failed to load git status"}}),null)}finally{t({refreshing:!1})}}})),U4=["file_path","filePath","path","file"];function gu(t,e){const n=xE(t);if(n)for(const a of e?[...U4,...e]:U4){const r=n[a];if(typeof r=="string"&&r.trim())return r}}function xE(t){if(typeof t=="string")try{const e=JSON.parse(t);return G4(e)?e:null}catch{return null}return G4(t)?t:null}function G4(t){return!!t&&typeof t=="object"&&!Array.isArray(t)}const wE=["write_file","edit_file","edit_file_line","file_write","file_edit","file_create","file_append","notebook_edit","notebook_write","apply_patch","git_apply_patch","git_commit","FileEditTool","FileWriteTool","EditTool","NotebookEditTool","Write","Edit","WriteTool","FileCreateTool"],kE=/(?:^|[_\W])(write|edit|save|create|update|modify|patch|output|export|render|generate|build)(?:[_\W]|$)/i,SE=/(?:^|[_\W])(read|open|cat|view|list|ls|dir|find|grep|glob|search)(?:[_\W]|$)/i;function _o(t){return wE.includes(t)?!0:kE.test(t)&&!SE.test(t)}function S5(t){return t.trim().replace(/\\/g,"/").replace(/^\.\//,"").replace(/^[a-zA-Z]:/,"").replace(/^\/+/,"").toLowerCase()}function _E(t){var r;const e=new Set,n=[],a=i=>{if(!i)return;const l=S5(i);!l||e.has(l)||(e.add(l),n.push(l))};for(const i of t){for(const l of((r=i.fileJob)==null?void 0:r.result)??[])a(l==null?void 0:l.path);for(const l of i.toolCalls??[])!l||l.status==="error"||_o(l.name)&&a(gu(l.args))}return n}function CE(t,e){const n=S5(t);if(!n)return!1;if(e.has(n))return!0;for(const a of e)if(a.endsWith(`/${n}`)||n.endsWith(`/${a}`))return!0;return!1}const AE=new Set;function TE(t){const n=Ge(r=>r.activeSessionId),a=Me(r=>{if(!n)return"";const i=r.messagesBySession[n];return!i||i.length===0?"":_E(i).join(`
|
|
45
|
+
`)});return N.useMemo(()=>a?new Set(a.split(`
|
|
46
|
+
`)):AE,[a])}function _1(){const t=er(r=>r.status),e=er(r=>r.changeScope),n=TE(),a=N.useMemo(()=>(t==null?void 0:t.changes)??[],[t==null?void 0:t.changes]);return N.useMemo(()=>{const r=a.length;if(e==="all")return{changes:a,added:(t==null?void 0:t.totalAdded)??0,removed:(t==null?void 0:t.totalRemoved)??0,allCount:r};const i=n.size===0?[]:a.filter(d=>CE(d.path,n));let l=0,c=0;for(const d of i)l+=d.added||0,c+=d.removed||0;return{changes:i,added:l,removed:c,allCount:r}},[e,a,n,t==null?void 0:t.totalAdded,t==null?void 0:t.totalRemoved])}function EE(t,e){const n=String(t);let a=n.indexOf(e),r=a,i=0,l=0;for(;a!==-1;)a===r?++i>l&&(l=i):i=1,r=a+e.length,a=n.indexOf(e,r);return l}function NE(){return{enter:{mathFlow:t,mathFlowFenceMeta:e,mathText:i},exit:{mathFlow:r,mathFlowFence:a,mathFlowFenceMeta:n,mathFlowValue:c,mathText:l,mathTextData:c}};function t(d){const p={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[p]}},d)}function e(){this.buffer()}function n(){const d=this.resume(),p=this.stack[this.stack.length-1];Oc(p.type==="math"),p.meta=d}function a(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function r(d){const p=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),h=this.stack[this.stack.length-1];Oc(h.type==="math"),this.exit(d),h.value=p;const m=h.data.hChildren[0];Oc(m.type==="element"),Oc(m.tagName==="code"),m.children.push({type:"text",value:p}),this.data.mathFlowInside=void 0}function i(d){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},d),this.buffer()}function l(d){const p=this.resume(),h=this.stack[this.stack.length-1];Oc(h.type==="inlineMath"),this.exit(d),h.value=p,h.data.hChildren.push({type:"text",value:p})}function c(d){this.config.enter.data.call(this,d),this.config.exit.data.call(this,d)}}function RE(t){let e=(t||{}).singleDollarTextMath;return e==null&&(e=!0),a.peek=r,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:`
|
|
47
|
+
`,inConstruct:"mathFlowMeta"},{character:"$",after:e?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:n,inlineMath:a}};function n(i,l,c,d){const p=i.value||"",h=c.createTracker(d),m="$".repeat(Math.max(EE(p,"$")+1,2)),b=c.enter("mathFlow");let x=h.move(m);if(i.meta){const w=c.enter("mathFlowMeta");x+=h.move(c.safe(i.meta,{after:`
|
|
48
|
+
`,before:x,encode:["$"],...h.current()})),w()}return x+=h.move(`
|
|
49
|
+
`),p&&(x+=h.move(p+`
|
|
50
|
+
`)),x+=h.move(m),b(),x}function a(i,l,c){let d=i.value||"",p=1;for(e||p++;new RegExp("(^|[^$])"+"\\$".repeat(p)+"([^$]|$)").test(d);)p++;const h="$".repeat(p);/[^ \r\n]/.test(d)&&(/^[ \r\n]/.test(d)&&/[ \r\n]$/.test(d)||/^\$|\$$/.test(d))&&(d=" "+d+" ");let m=-1;for(;++m<c.unsafe.length;){const b=c.unsafe[m];if(!b.atBreak)continue;const x=c.compilePattern(b);let w;for(;w=x.exec(d);){let S=w.index;d.codePointAt(S)===10&&d.codePointAt(S-1)===13&&S--,d=d.slice(0,S)+" "+d.slice(w.index+1)}}return h+d+h}function r(){return"$"}}const DE={tokenize:ME,concrete:!0,name:"mathFlow"},q4={tokenize:OE,partial:!0};function ME(t,e,n){const a=this,r=a.events[a.events.length-1],i=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0;let l=0;return c;function c(T){return t.enter("mathFlow"),t.enter("mathFlowFence"),t.enter("mathFlowFenceSequence"),d(T)}function d(T){return T===36?(t.consume(T),l++,d):l<2?n(T):(t.exit("mathFlowFenceSequence"),Zd(t,p,"whitespace")(T))}function p(T){return T===null||io(T)?m(T):(t.enter("mathFlowFenceMeta"),t.enter("chunkString",{contentType:"string"}),h(T))}function h(T){return T===null||io(T)?(t.exit("chunkString"),t.exit("mathFlowFenceMeta"),m(T)):T===36?n(T):(t.consume(T),h)}function m(T){return t.exit("mathFlowFence"),a.interrupt?e(T):t.attempt(q4,b,C)(T)}function b(T){return t.attempt({tokenize:E,partial:!0},C,x)(T)}function x(T){return(i?Zd(t,w,"linePrefix",i+1):w)(T)}function w(T){return T===null?C(T):io(T)?t.attempt(q4,b,C)(T):(t.enter("mathFlowValue"),S(T))}function S(T){return T===null||io(T)?(t.exit("mathFlowValue"),w(T)):(t.consume(T),S)}function C(T){return t.exit("mathFlow"),e(T)}function E(T,L,D){let B=0;return Zd(T,H,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function H(q){return T.enter("mathFlowFence"),T.enter("mathFlowFenceSequence"),K(q)}function K(q){return q===36?(B++,T.consume(q),K):B<l?D(q):(T.exit("mathFlowFenceSequence"),Zd(T,U,"whitespace")(q))}function U(q){return q===null||io(q)?(T.exit("mathFlowFence"),L(q)):D(q)}}}function OE(t,e,n){const a=this;return r;function r(l){return l===null?e(l):(t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),i)}function i(l){return a.parser.lazy[a.now().line]?n(l):e(l)}}function LE(t){let n=(t||{}).singleDollarTextMath;return n==null&&(n=!0),{tokenize:a,resolve:jE,previous:BE,name:"mathText"};function a(r,i,l){let c=0,d,p;return h;function h(S){return r.enter("mathText"),r.enter("mathTextSequence"),m(S)}function m(S){return S===36?(r.consume(S),c++,m):c<2&&!n?l(S):(r.exit("mathTextSequence"),b(S))}function b(S){return S===null?l(S):S===36?(p=r.enter("mathTextSequence"),d=0,w(S)):S===32?(r.enter("space"),r.consume(S),r.exit("space"),b):io(S)?(r.enter("lineEnding"),r.consume(S),r.exit("lineEnding"),b):(r.enter("mathTextData"),x(S))}function x(S){return S===null||S===32||S===36||io(S)?(r.exit("mathTextData"),b(S)):(r.consume(S),x)}function w(S){return S===36?(r.consume(S),d++,w):d===c?(r.exit("mathTextSequence"),r.exit("mathText"),i(S)):(p.type="mathTextData",x(S))}}}function jE(t){let e=t.length-4,n=3,a,r;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(a=n;++a<e;)if(t[a][1].type==="mathTextData"){t[e][1].type="mathTextPadding",t[n][1].type="mathTextPadding",n+=2,e-=2;break}}for(a=n-1,e++;++a<=e;)r===void 0?a!==e&&t[a][1].type!=="lineEnding"&&(r=a):(a===e||t[a][1].type==="lineEnding")&&(t[r][1].type="mathTextData",a!==r+2&&(t[r][1].end=t[a-1][1].end,t.splice(r+2,a-r-2),e-=a-r-2,a=r+2),r=void 0);return t}function BE(t){return t!==36||this.events[this.events.length-1][1].type==="characterEscape"}function IE(t){return{flow:{36:DE},text:{36:LE(t)}}}class be extends Error{constructor(e,n){var a="KaTeX parse error: "+e,r,i,l=n&&n.loc;if(l&&l.start<=l.end){var c=l.lexer.input;r=l.start,i=l.end,r===c.length?a+=" at end of input: ":a+=" at position "+(r+1)+": ";var d=c.slice(r,i).replace(/[^]/g,"$&̲"),p;r>15?p="…"+c.slice(r-15,r):p=c.slice(0,r);var h;i+15<c.length?h=c.slice(i,i+15)+"…":h=c.slice(i),a+=p+d+h}super(a),this.name="ParseError",this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,be.prototype),this.position=r,r!=null&&i!=null&&(this.length=i-r),this.rawMessage=e}}var PE=/([A-Z])/g,zE=t=>t.replace(PE,"-$1").toLowerCase(),$E={"&":"&",">":">","<":"<",'"':""","'":"'"},FE=/[&><"']/g,Wn=t=>String(t).replace(FE,e=>$E[e]),D0=t=>t.type==="ordgroup"||t.type==="color"?t.body.length===1?D0(t.body[0]):t:t.type==="font"?D0(t.body):t,HE=new Set(["mathord","textord","atom"]),Es=t=>HE.has(D0(t).type),UE=t=>{var e=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(t);return e?e[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e[1])?null:e[1].toLowerCase():"_relative"},gg={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 GE(t){if(typeof t!="string")return t.enum[0];switch(t){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function qE(t){if(t.default!==void 0)return t.default;var e=Array.isArray(t.type)?t.type[0]:t.type;return GE(e)}function VE(t,e,n,a){var r=n[e];t[e]=r!==void 0?a.processor?a.processor(r):r:qE(a)}class C1{constructor(e){e===void 0&&(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 of Object.keys(gg)){var a=gg[n];a&&VE(this,n,e,a)}}reportNonstrict(e,n,a){var r=this.strict;if(typeof r=="function"&&(r=r(e,n,a)),!(!r||r==="ignore")){if(r===!0||r==="error")throw new be("LaTeX-incompatible input and strict mode is set to 'error': "+(n+" ["+e+"]"),a);r==="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 '"+r+"': "+n+" ["+e+"]"))}}useStrictBehavior(e,n,a){var r=this.strict;if(typeof r=="function")try{r=r(e,n,a)}catch{r="error"}return!r||r==="ignore"?!1:r===!0||r==="error"?!0:r==="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 '"+r+"': "+n+" ["+e+"]")),!1)}isTrusted(e){if("url"in e&&e.url&&!e.protocol){var n=UE(e.url);if(n==null)return!1;e.protocol=n}var a=typeof this.trust=="function"?this.trust(e):this.trust;return!!a}}class li{constructor(e,n,a){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=n,this.cramped=a}sup(){return Ir[WE[this.id]]}sub(){return Ir[KE[this.id]]}fracNum(){return Ir[YE[this.id]]}fracDen(){return Ir[ZE[this.id]]}cramp(){return Ir[XE[this.id]]}text(){return Ir[QE[this.id]]}isTight(){return this.size>=2}}var A1=0,Q0=1,wl=2,Cs=3,yu=4,sr=5,Nl=6,ra=7,Ir=[new li(A1,0,!1),new li(Q0,0,!0),new li(wl,1,!1),new li(Cs,1,!0),new li(yu,2,!1),new li(sr,2,!0),new li(Nl,3,!1),new li(ra,3,!0)],WE=[yu,sr,yu,sr,Nl,ra,Nl,ra],KE=[sr,sr,sr,sr,ra,ra,ra,ra],YE=[wl,Cs,yu,sr,Nl,ra,Nl,ra],ZE=[Cs,Cs,sr,sr,ra,ra,ra,ra],XE=[Q0,Q0,Cs,Cs,sr,sr,ra,ra],QE=[A1,Q0,wl,Cs,wl,Cs,wl,Cs],nt={DISPLAY:Ir[A1],TEXT:Ir[wl],SCRIPT:Ir[yu],SCRIPTSCRIPT:Ir[Nl]},yg=[{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 JE(t){for(var e=0;e<yg.length;e++)for(var n=yg[e],a=0;a<n.blocks.length;a++){var r=n.blocks[a];if(t>=r[0]&&t<=r[1])return n.name}return null}var M0=[];yg.forEach(t=>t.blocks.forEach(e=>M0.push(...e)));function _5(t){for(var e=0;e<M0.length;e+=2)if(t>=M0[e]&&t<=M0[e+1])return!0;return!1}var Cn=t=>t+" "+t,dl=80,eN=function(e,n){return"M95,"+(622+e+n)+`
|
|
51
|
+
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
|
|
52
|
+
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
|
|
53
|
+
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
|
|
54
|
+
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
|
|
55
|
+
c69,-144,104.5,-217.7,106.5,-221
|
|
56
|
+
l`+e/2.075+" -"+e+`
|
|
57
|
+
c5.3,-9.3,12,-14,20,-14
|
|
58
|
+
H400000v`+(40+e)+`H845.2724
|
|
59
|
+
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
|
|
60
|
+
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
|
|
61
|
+
M`+(834+e)+" "+n+"h400000v"+(40+e)+"h-400000z"},tN=function(e,n){return"M263,"+(601+e+n)+`c0.7,0,18,39.7,52,119
|
|
62
|
+
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
|
|
63
|
+
c340,-704.7,510.7,-1060.3,512,-1067
|
|
64
|
+
l`+e/2.084+" -"+e+`
|
|
65
|
+
c4.7,-7.3,11,-11,19,-11
|
|
66
|
+
H40000v`+(40+e)+`H1012.3
|
|
67
|
+
s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
|
|
68
|
+
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
|
|
69
|
+
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
|
|
70
|
+
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
|
|
71
|
+
M`+(1001+e)+" "+n+"h400000v"+(40+e)+"h-400000z"},nN=function(e,n){return"M983 "+(10+e+n)+`
|
|
72
|
+
l`+e/3.13+" -"+e+`
|
|
73
|
+
c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+`
|
|
74
|
+
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
|
|
75
|
+
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
|
|
76
|
+
c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
|
|
77
|
+
c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
|
|
78
|
+
c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
|
|
79
|
+
c53.7,-170.3,84.5,-266.8,92.5,-289.5z
|
|
80
|
+
M`+(1001+e)+" "+n+"h400000v"+(40+e)+"h-400000z"},aN=function(e,n){return"M424,"+(2398+e+n)+`
|
|
81
|
+
c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
|
|
82
|
+
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
|
|
83
|
+
s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
|
|
84
|
+
s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
|
|
85
|
+
l`+e/4.223+" -"+e+`c4,-6.7,10,-10,18,-10 H400000
|
|
86
|
+
v`+(40+e)+`H1014.6
|
|
87
|
+
s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
|
|
88
|
+
c-2,6,-10,9,-24,9
|
|
89
|
+
c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+" "+n+`
|
|
90
|
+
h400000v`+(40+e)+"h-400000z"},rN=function(e,n){return"M473,"+(2713+e+n)+`
|
|
91
|
+
c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+" -"+e+`
|
|
92
|
+
c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7
|
|
93
|
+
s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
|
|
94
|
+
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
|
|
95
|
+
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
|
|
96
|
+
s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
|
|
97
|
+
606zM`+(1001+e)+" "+n+"h400000v"+(40+e)+"H1017.7z"},sN=function(e){var n=e/2;return"M400000 "+e+" H0 L"+n+" 0 l65 45 L145 "+(e-80)+" H400000z"},iN=function(e,n,a){var r=a-54-n-e;return"M702 "+(e+n)+"H400000"+(40+e)+`
|
|
98
|
+
H742v`+r+`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
|
|
99
|
+
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
|
|
100
|
+
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
|
|
101
|
+
219 661 l218 661zM702 `+n+"H400000v"+(40+e)+"H742z"},oN=function(e,n,a){n=1e3*n;var r="";switch(e){case"sqrtMain":r=eN(n,dl);break;case"sqrtSize1":r=tN(n,dl);break;case"sqrtSize2":r=nN(n,dl);break;case"sqrtSize3":r=aN(n,dl);break;case"sqrtSize4":r=rN(n,dl);break;case"sqrtTall":r=iN(n,dl,a)}return r},lN=function(e,n){switch(e){case"⎜":return Cn("M291 0 H417 V"+n+" H291z");case"∣":return Cn("M145 0 H188 V"+n+" H145z");case"∥":return Cn("M145 0 H188 V"+n+" H145z")+Cn("M367 0 H410 V"+n+" H367z");case"⎟":return Cn("M457 0 H583 V"+n+" H457z");case"⎢":return Cn("M319 0 H403 V"+n+" H319z");case"⎥":return Cn("M263 0 H347 V"+n+" H263z");case"⎪":return Cn("M384 0 H504 V"+n+" H384z");case"⏐":return Cn("M312 0 H355 V"+n+" H312z");case"‖":return Cn("M257 0 H300 V"+n+" H257z")+Cn("M478 0 H521 V"+n+" H478z");default:return""}},V4={doubleleftarrow:`M262 157
|
|
102
|
+
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
|
|
103
|
+
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
|
|
104
|
+
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
|
|
105
|
+
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
|
|
106
|
+
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
|
|
107
|
+
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
|
|
108
|
+
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
|
|
109
|
+
m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
|
|
110
|
+
-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
|
|
111
|
+
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
|
|
112
|
+
-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
|
|
113
|
+
-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
|
|
114
|
+
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
|
|
115
|
+
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
|
|
116
|
+
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
|
|
117
|
+
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
|
|
118
|
+
-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
|
|
119
|
+
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
|
|
120
|
+
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
|
|
121
|
+
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
|
|
122
|
+
l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
|
|
123
|
+
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
|
|
124
|
+
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
|
|
125
|
+
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
|
|
126
|
+
0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
|
|
127
|
+
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
|
|
128
|
+
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
|
|
129
|
+
435 0h399565z`,leftgroupunder:`M400000 262
|
|
130
|
+
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
|
|
131
|
+
435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
|
|
132
|
+
-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
|
|
133
|
+
-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
|
|
134
|
+
-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
|
|
135
|
+
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
|
|
136
|
+
-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
|
|
137
|
+
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
|
|
138
|
+
m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
|
|
139
|
+
5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
|
|
140
|
+
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
|
|
141
|
+
-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
|
|
142
|
+
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
|
|
143
|
+
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
|
|
144
|
+
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
|
|
145
|
+
-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
|
|
146
|
+
-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
|
|
147
|
+
71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:Cn("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),leftbracketunder:Cn("M0 0 h120 V290 H399995 v120 H0z"),leftbracketover:Cn("M0 440 h120 V150 H399995 v-120 H0z"),leftmapsto:Cn("M40 281 V448H0V74H40V241H400000v40z"),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
|
|
148
|
+
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
|
|
149
|
+
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
|
|
150
|
+
68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:Cn("M0 50 h400000 v40H0z m0 194h40000v40H0z"),midbrace:`M200428 334
|
|
151
|
+
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
|
|
152
|
+
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
|
|
153
|
+
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
|
|
154
|
+
12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
|
|
155
|
+
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
|
|
156
|
+
53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
|
|
157
|
+
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
|
|
158
|
+
-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
|
|
159
|
+
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
|
|
160
|
+
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
|
|
161
|
+
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
|
|
162
|
+
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
|
|
163
|
+
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
|
|
164
|
+
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
|
|
165
|
+
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
|
|
166
|
+
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
|
|
167
|
+
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
|
|
168
|
+
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
|
|
169
|
+
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
|
|
170
|
+
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
|
|
171
|
+
-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
|
|
172
|
+
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
|
|
173
|
+
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
|
|
174
|
+
-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
|
|
175
|
+
-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
|
|
176
|
+
151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
|
|
177
|
+
-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
|
|
178
|
+
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
|
|
179
|
+
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
|
|
180
|
+
28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
|
|
181
|
+
-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
|
|
182
|
+
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
|
|
183
|
+
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
|
|
184
|
+
-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
|
|
185
|
+
-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
|
|
186
|
+
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
|
|
187
|
+
-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
|
|
188
|
+
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
|
|
189
|
+
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
|
|
190
|
+
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
|
|
191
|
+
-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
|
|
192
|
+
-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
|
|
193
|
+
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
|
|
194
|
+
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
|
|
195
|
+
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
|
|
196
|
+
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
|
|
197
|
+
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
|
|
198
|
+
-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
|
|
199
|
+
66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:Cn("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),rightbracketunder:Cn("M399995 0 h-120 V290 H0 v120 H400000z"),rightbracketover:Cn("M399995 440 h-120 V150 H0 v-120 H399995z"),rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
|
|
200
|
+
1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
|
|
201
|
+
-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
|
|
202
|
+
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
|
|
203
|
+
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
|
|
204
|
+
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
|
|
205
|
+
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
|
|
206
|
+
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
|
|
207
|
+
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
|
|
208
|
+
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
|
|
209
|
+
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
|
|
210
|
+
18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
|
|
211
|
+
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
|
|
212
|
+
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
|
|
213
|
+
-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
|
|
214
|
+
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
|
|
215
|
+
4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
|
|
216
|
+
-68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
|
|
217
|
+
-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
|
|
218
|
+
31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
|
|
219
|
+
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
|
|
220
|
+
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
|
|
221
|
+
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
|
|
222
|
+
411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
|
|
223
|
+
16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
|
|
224
|
+
-338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
|
|
225
|
+
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
|
|
226
|
+
177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
|
|
227
|
+
14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
|
|
228
|
+
-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
|
|
229
|
+
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
|
|
230
|
+
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
|
|
231
|
+
-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
|
|
232
|
+
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
|
|
233
|
+
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
|
|
234
|
+
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
|
|
235
|
+
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
|
|
236
|
+
-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
|
|
237
|
+
-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
|
|
238
|
+
-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,
|
|
239
|
+
-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,
|
|
240
|
+
-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,
|
|
241
|
+
-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,
|
|
242
|
+
-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
|
|
243
|
+
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
|
|
244
|
+
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
|
|
245
|
+
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
|
|
246
|
+
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
|
|
247
|
+
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
|
|
248
|
+
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
|
|
249
|
+
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
|
|
250
|
+
-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
|
|
251
|
+
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
|
|
252
|
+
-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
|
|
253
|
+
-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
|
|
254
|
+
-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
|
|
255
|
+
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
|
|
256
|
+
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
|
|
257
|
+
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
|
|
258
|
+
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
|
|
259
|
+
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
|
|
260
|
+
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
|
|
261
|
+
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,
|
|
262
|
+
-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
|
|
263
|
+
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
|
|
264
|
+
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
|
|
265
|
+
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,
|
|
266
|
+
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,
|
|
267
|
+
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
|
|
268
|
+
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
|
|
269
|
+
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,
|
|
270
|
+
-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
|
|
271
|
+
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
|
|
272
|
+
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},cN=function(e,n){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v1759 v84 h347 v-84
|
|
273
|
+
H403z M403 1759 V0 H319 V1759 v`+n+" v1759 v84 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v1759 H0 v84 H347z
|
|
274
|
+
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
|
|
275
|
+
c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|
276
|
+
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
|
|
277
|
+
c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|
278
|
+
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+` v585 h43z
|
|
279
|
+
M367 15 v585 v`+n+` v585 c2.667,10,9.667,15,21,15
|
|
280
|
+
c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|
281
|
+
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
|
|
282
|
+
MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+n+` v1799 H0 v-84 H319z
|
|
283
|
+
MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v602 h84z
|
|
284
|
+
M403 1759 V0 H319 V1759 v`+n+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v602 h84z
|
|
285
|
+
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
|
|
286
|
+
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,
|
|
287
|
+
-36,557 l0,`+(n+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
|
|
288
|
+
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
|
|
289
|
+
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,
|
|
290
|
+
-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
|
|
291
|
+
l0,-`+(n+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
|
|
292
|
+
-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,
|
|
293
|
+
63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
|
|
294
|
+
c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(n+9)+`
|
|
295
|
+
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
|
|
296
|
+
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
|
|
297
|
+
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
|
|
298
|
+
c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
|
|
299
|
+
l0,-`+(n+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
|
|
300
|
+
-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.")}};function uN(t){return"toText"in t}class Ol{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(){return this.children.map(e=>{if(uN(e))return e.toText();throw new Error("Expected MathDomNode with toText, got "+e.constructor.name)}).join("")}}var bg={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},dN={ex:!0,em:!0,mu:!0},C5=function(e){return typeof e!="string"&&(e=e.unit),e in bg||e in dN||e==="ex"},Yt=function(e,n){var a;if(e.unit in bg)a=bg[e.unit]/n.fontMetrics().ptPerEm/n.sizeMultiplier;else if(e.unit==="mu")a=n.fontMetrics().cssEmPerMu;else{var r;if(n.style.isTight()?r=n.havingStyle(n.style.text()):r=n,e.unit==="ex")a=r.fontMetrics().xHeight;else if(e.unit==="em")a=r.fontMetrics().quad;else throw new be("Invalid unit: '"+e.unit+"'");r!==n&&(a*=r.sizeMultiplier/n.sizeMultiplier)}return Math.min(e.number*a,n.maxSize)},we=function(e){return+e.toFixed(4)+"em"},Ai=function(e){return e.filter(n=>n).join(" ")},T1=function(e){var n="";for(var a of Object.keys(e)){var r=e[a];r!==void 0&&(n+=zE(a)+":"+r+";")}return n},A5=function(e,n,a){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=a||{},n){n.style.isTight()&&this.classes.push("mtight");var r=n.getColor();r&&(this.style.color=r)}},T5=function(e){var n=document.createElement(e);n.className=Ai(this.classes),Object.assign(n.style,this.style);for(var a of Object.keys(this.attributes))n.setAttribute(a,this.attributes[a]);for(var r=0;r<this.children.length;r++)n.appendChild(this.children[r].toNode());return n},pN=/[\s"'>/=\x00-\x1f]/,E5=function(e){var n="<"+e;this.classes.length&&(n+=' class="'+Wn(Ai(this.classes))+'"');var a=T1(this.style);a&&(n+=' style="'+Wn(a)+'"');for(var r of Object.keys(this.attributes)){if(pN.test(r))throw new be("Invalid attribute name '"+r+"'");n+=" "+r+'="'+Wn(this.attributes[r])+'"'}n+=">";for(var i=0;i<this.children.length;i++)n+=this.children[i].toMarkup();return n+="</"+e+">",n};class Ll{constructor(e,n,a,r){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,this.italic=void 0,A5.call(this,e,a,r),this.children=n||[]}setAttribute(e,n){this.attributes[e]=n}hasClass(e){return this.classes.includes(e)}toNode(){return T5.call(this,"span")}toMarkup(){return E5.call(this,"span")}}class Cp{constructor(e,n,a,r){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,A5.call(this,n,r),this.children=a||[],this.setAttribute("href",e)}setAttribute(e,n){this.attributes[e]=n}hasClass(e){return this.classes.includes(e)}toNode(){return T5.call(this,"a")}toMarkup(){return E5.call(this,"a")}}class fN{constructor(e,n,a){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=n,this.src=e,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=a}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement("img");return e.src=this.src,e.alt=this.alt,e.className="mord",Object.assign(e.style,this.style),e}toMarkup(){var e='<img src="'+Wn(this.src)+'"'+(' alt="'+Wn(this.alt)+'"'),n=T1(this.style);return n&&(e+=' style="'+Wn(n)+'"'),e+="'/>",e}}var hN={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class Ia{constructor(e,n,a,r,i,l,c,d){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=a||0,this.italic=r||0,this.skew=i||0,this.width=l||0,this.classes=c||[],this.style=d||{},this.maxFontSize=0;var p=JE(this.text.charCodeAt(0));p&&this.classes.push(p+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=hN[this.text])}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createTextNode(this.text),n=null;return this.italic>0&&(n=document.createElement("span"),n.style.marginRight=we(this.italic)),this.classes.length>0&&(n=n||document.createElement("span"),n.className=Ai(this.classes)),Object.keys(this.style).length>0&&(n=n||document.createElement("span"),Object.assign(n.style,this.style)),n?(n.appendChild(e),n):e}toMarkup(){var e=!1,n="<span";this.classes.length&&(e=!0,n+=' class="',n+=Wn(Ai(this.classes)),n+='"');var a="";this.italic>0&&(a+="margin-right:"+we(this.italic)+";"),a+=T1(this.style),a&&(e=!0,n+=' style="'+Wn(a)+'"');var r=Wn(this.text);return e?(n+=">",n+=r,n+="</span>",n):r}}class Ts{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 a of Object.keys(this.attributes))n.setAttribute(a,this.attributes[a]);for(var r=0;r<this.children.length;r++)n.appendChild(this.children[r].toNode());return n}toMarkup(){var e='<svg xmlns="http://www.w3.org/2000/svg"';for(var n of Object.keys(this.attributes))e+=" "+n+'="'+Wn(this.attributes[n])+'"';e+=">";for(var a=0;a<this.children.length;a++)e+=this.children[a].toMarkup();return e+="</svg>",e}}class Ti{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",V4[this.pathName]),n}toMarkup(){return this.alternate?'<path d="'+Wn(this.alternate)+'"/>':'<path d="'+Wn(V4[this.pathName])+'"/>'}}class vg{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 a of Object.keys(this.attributes))n.setAttribute(a,this.attributes[a]);return n}toMarkup(){var e="<line";for(var n of Object.keys(this.attributes))e+=" "+n+'="'+Wn(this.attributes[n])+'"';return e+="/>",e}}function mN(t){if(t instanceof Ia)return t;throw new Error("Expected symbolNode but got "+String(t)+".")}function gN(t){if(t instanceof Ll)return t;throw new Error("Expected span<HtmlDomNode> but got "+String(t)+".")}var yN=t=>t instanceof Ll||t instanceof Cp||t instanceof Ol,zr={"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]}},r0={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]},W4={Å:"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 bN(t,e){zr[t]=e}function E1(t,e,n){if(!zr[e])throw new Error("Font metrics not found for font: "+e+".");var a=t.charCodeAt(0),r=zr[e][a];if(!r&&t[0]in W4&&(a=W4[t[0]].charCodeAt(0),r=zr[e][a]),!r&&n==="text"&&_5(a)&&(r=zr[e][77]),r)return{depth:r[0],height:r[1],italic:r[2],skew:r[3],width:r[4]}}var cm={};function vN(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!cm[e]){var n=cm[e]={cssEmPerMu:r0.quad[e]/18};for(var a in r0)r0.hasOwnProperty(a)&&(n[a]=r0[a][e])}return cm[e]}var qt={math:{},text:{}};function k(t,e,n,a,r,i){qt[t][r]={font:e,group:n,replace:a},i&&a&&(qt[t][a]=qt[t][r])}var _="math",pe="text",R="main",I="ams",Vt="accent-token",Ee="bin",ia="close",jl="inner",Ve="mathord",xn="op-token",Pa="open",Du="punct",z="rel",Ns="spacing",W="textord";k(_,R,z,"≡","\\equiv",!0);k(_,R,z,"≺","\\prec",!0);k(_,R,z,"≻","\\succ",!0);k(_,R,z,"∼","\\sim",!0);k(_,R,z,"⊥","\\perp");k(_,R,z,"⪯","\\preceq",!0);k(_,R,z,"⪰","\\succeq",!0);k(_,R,z,"≃","\\simeq",!0);k(_,R,z,"∣","\\mid",!0);k(_,R,z,"≪","\\ll",!0);k(_,R,z,"≫","\\gg",!0);k(_,R,z,"≍","\\asymp",!0);k(_,R,z,"∥","\\parallel");k(_,R,z,"⋈","\\bowtie",!0);k(_,R,z,"⌣","\\smile",!0);k(_,R,z,"⊑","\\sqsubseteq",!0);k(_,R,z,"⊒","\\sqsupseteq",!0);k(_,R,z,"≐","\\doteq",!0);k(_,R,z,"⌢","\\frown",!0);k(_,R,z,"∋","\\ni",!0);k(_,R,z,"∝","\\propto",!0);k(_,R,z,"⊢","\\vdash",!0);k(_,R,z,"⊣","\\dashv",!0);k(_,R,z,"∋","\\owns");k(_,R,Du,".","\\ldotp");k(_,R,Du,"⋅","\\cdotp");k(_,R,Du,"⋅","·");k(pe,R,W,"⋅","·");k(_,R,W,"#","\\#");k(pe,R,W,"#","\\#");k(_,R,W,"&","\\&");k(pe,R,W,"&","\\&");k(_,R,W,"ℵ","\\aleph",!0);k(_,R,W,"∀","\\forall",!0);k(_,R,W,"ℏ","\\hbar",!0);k(_,R,W,"∃","\\exists",!0);k(_,R,W,"∇","\\nabla",!0);k(_,R,W,"♭","\\flat",!0);k(_,R,W,"ℓ","\\ell",!0);k(_,R,W,"♮","\\natural",!0);k(_,R,W,"♣","\\clubsuit",!0);k(_,R,W,"℘","\\wp",!0);k(_,R,W,"♯","\\sharp",!0);k(_,R,W,"♢","\\diamondsuit",!0);k(_,R,W,"ℜ","\\Re",!0);k(_,R,W,"♡","\\heartsuit",!0);k(_,R,W,"ℑ","\\Im",!0);k(_,R,W,"♠","\\spadesuit",!0);k(_,R,W,"§","\\S",!0);k(pe,R,W,"§","\\S");k(_,R,W,"¶","\\P",!0);k(pe,R,W,"¶","\\P");k(_,R,W,"†","\\dag");k(pe,R,W,"†","\\dag");k(pe,R,W,"†","\\textdagger");k(_,R,W,"‡","\\ddag");k(pe,R,W,"‡","\\ddag");k(pe,R,W,"‡","\\textdaggerdbl");k(_,R,ia,"⎱","\\rmoustache",!0);k(_,R,Pa,"⎰","\\lmoustache",!0);k(_,R,ia,"⟯","\\rgroup",!0);k(_,R,Pa,"⟮","\\lgroup",!0);k(_,R,Ee,"∓","\\mp",!0);k(_,R,Ee,"⊖","\\ominus",!0);k(_,R,Ee,"⊎","\\uplus",!0);k(_,R,Ee,"⊓","\\sqcap",!0);k(_,R,Ee,"∗","\\ast");k(_,R,Ee,"⊔","\\sqcup",!0);k(_,R,Ee,"◯","\\bigcirc",!0);k(_,R,Ee,"∙","\\bullet",!0);k(_,R,Ee,"‡","\\ddagger");k(_,R,Ee,"≀","\\wr",!0);k(_,R,Ee,"⨿","\\amalg");k(_,R,Ee,"&","\\And");k(_,R,z,"⟵","\\longleftarrow",!0);k(_,R,z,"⇐","\\Leftarrow",!0);k(_,R,z,"⟸","\\Longleftarrow",!0);k(_,R,z,"⟶","\\longrightarrow",!0);k(_,R,z,"⇒","\\Rightarrow",!0);k(_,R,z,"⟹","\\Longrightarrow",!0);k(_,R,z,"↔","\\leftrightarrow",!0);k(_,R,z,"⟷","\\longleftrightarrow",!0);k(_,R,z,"⇔","\\Leftrightarrow",!0);k(_,R,z,"⟺","\\Longleftrightarrow",!0);k(_,R,z,"↦","\\mapsto",!0);k(_,R,z,"⟼","\\longmapsto",!0);k(_,R,z,"↗","\\nearrow",!0);k(_,R,z,"↩","\\hookleftarrow",!0);k(_,R,z,"↪","\\hookrightarrow",!0);k(_,R,z,"↘","\\searrow",!0);k(_,R,z,"↼","\\leftharpoonup",!0);k(_,R,z,"⇀","\\rightharpoonup",!0);k(_,R,z,"↙","\\swarrow",!0);k(_,R,z,"↽","\\leftharpoondown",!0);k(_,R,z,"⇁","\\rightharpoondown",!0);k(_,R,z,"↖","\\nwarrow",!0);k(_,R,z,"⇌","\\rightleftharpoons",!0);k(_,I,z,"≮","\\nless",!0);k(_,I,z,"","\\@nleqslant");k(_,I,z,"","\\@nleqq");k(_,I,z,"⪇","\\lneq",!0);k(_,I,z,"≨","\\lneqq",!0);k(_,I,z,"","\\@lvertneqq");k(_,I,z,"⋦","\\lnsim",!0);k(_,I,z,"⪉","\\lnapprox",!0);k(_,I,z,"⊀","\\nprec",!0);k(_,I,z,"⋠","\\npreceq",!0);k(_,I,z,"⋨","\\precnsim",!0);k(_,I,z,"⪹","\\precnapprox",!0);k(_,I,z,"≁","\\nsim",!0);k(_,I,z,"","\\@nshortmid");k(_,I,z,"∤","\\nmid",!0);k(_,I,z,"⊬","\\nvdash",!0);k(_,I,z,"⊭","\\nvDash",!0);k(_,I,z,"⋪","\\ntriangleleft");k(_,I,z,"⋬","\\ntrianglelefteq",!0);k(_,I,z,"⊊","\\subsetneq",!0);k(_,I,z,"","\\@varsubsetneq");k(_,I,z,"⫋","\\subsetneqq",!0);k(_,I,z,"","\\@varsubsetneqq");k(_,I,z,"≯","\\ngtr",!0);k(_,I,z,"","\\@ngeqslant");k(_,I,z,"","\\@ngeqq");k(_,I,z,"⪈","\\gneq",!0);k(_,I,z,"≩","\\gneqq",!0);k(_,I,z,"","\\@gvertneqq");k(_,I,z,"⋧","\\gnsim",!0);k(_,I,z,"⪊","\\gnapprox",!0);k(_,I,z,"⊁","\\nsucc",!0);k(_,I,z,"⋡","\\nsucceq",!0);k(_,I,z,"⋩","\\succnsim",!0);k(_,I,z,"⪺","\\succnapprox",!0);k(_,I,z,"≆","\\ncong",!0);k(_,I,z,"","\\@nshortparallel");k(_,I,z,"∦","\\nparallel",!0);k(_,I,z,"⊯","\\nVDash",!0);k(_,I,z,"⋫","\\ntriangleright");k(_,I,z,"⋭","\\ntrianglerighteq",!0);k(_,I,z,"","\\@nsupseteqq");k(_,I,z,"⊋","\\supsetneq",!0);k(_,I,z,"","\\@varsupsetneq");k(_,I,z,"⫌","\\supsetneqq",!0);k(_,I,z,"","\\@varsupsetneqq");k(_,I,z,"⊮","\\nVdash",!0);k(_,I,z,"⪵","\\precneqq",!0);k(_,I,z,"⪶","\\succneqq",!0);k(_,I,z,"","\\@nsubseteqq");k(_,I,Ee,"⊴","\\unlhd");k(_,I,Ee,"⊵","\\unrhd");k(_,I,z,"↚","\\nleftarrow",!0);k(_,I,z,"↛","\\nrightarrow",!0);k(_,I,z,"⇍","\\nLeftarrow",!0);k(_,I,z,"⇏","\\nRightarrow",!0);k(_,I,z,"↮","\\nleftrightarrow",!0);k(_,I,z,"⇎","\\nLeftrightarrow",!0);k(_,I,z,"△","\\vartriangle");k(_,I,W,"ℏ","\\hslash");k(_,I,W,"▽","\\triangledown");k(_,I,W,"◊","\\lozenge");k(_,I,W,"Ⓢ","\\circledS");k(_,I,W,"®","\\circledR");k(pe,I,W,"®","\\circledR");k(_,I,W,"∡","\\measuredangle",!0);k(_,I,W,"∄","\\nexists");k(_,I,W,"℧","\\mho");k(_,I,W,"Ⅎ","\\Finv",!0);k(_,I,W,"⅁","\\Game",!0);k(_,I,W,"‵","\\backprime");k(_,I,W,"▲","\\blacktriangle");k(_,I,W,"▼","\\blacktriangledown");k(_,I,W,"■","\\blacksquare");k(_,I,W,"⧫","\\blacklozenge");k(_,I,W,"★","\\bigstar");k(_,I,W,"∢","\\sphericalangle",!0);k(_,I,W,"∁","\\complement",!0);k(_,I,W,"ð","\\eth",!0);k(pe,R,W,"ð","ð");k(_,I,W,"╱","\\diagup");k(_,I,W,"╲","\\diagdown");k(_,I,W,"□","\\square");k(_,I,W,"□","\\Box");k(_,I,W,"◊","\\Diamond");k(_,I,W,"¥","\\yen",!0);k(pe,I,W,"¥","\\yen",!0);k(_,I,W,"✓","\\checkmark",!0);k(pe,I,W,"✓","\\checkmark");k(_,I,W,"ℶ","\\beth",!0);k(_,I,W,"ℸ","\\daleth",!0);k(_,I,W,"ℷ","\\gimel",!0);k(_,I,W,"ϝ","\\digamma",!0);k(_,I,W,"ϰ","\\varkappa");k(_,I,Pa,"┌","\\@ulcorner",!0);k(_,I,ia,"┐","\\@urcorner",!0);k(_,I,Pa,"└","\\@llcorner",!0);k(_,I,ia,"┘","\\@lrcorner",!0);k(_,I,z,"≦","\\leqq",!0);k(_,I,z,"⩽","\\leqslant",!0);k(_,I,z,"⪕","\\eqslantless",!0);k(_,I,z,"≲","\\lesssim",!0);k(_,I,z,"⪅","\\lessapprox",!0);k(_,I,z,"≊","\\approxeq",!0);k(_,I,Ee,"⋖","\\lessdot");k(_,I,z,"⋘","\\lll",!0);k(_,I,z,"≶","\\lessgtr",!0);k(_,I,z,"⋚","\\lesseqgtr",!0);k(_,I,z,"⪋","\\lesseqqgtr",!0);k(_,I,z,"≑","\\doteqdot");k(_,I,z,"≓","\\risingdotseq",!0);k(_,I,z,"≒","\\fallingdotseq",!0);k(_,I,z,"∽","\\backsim",!0);k(_,I,z,"⋍","\\backsimeq",!0);k(_,I,z,"⫅","\\subseteqq",!0);k(_,I,z,"⋐","\\Subset",!0);k(_,I,z,"⊏","\\sqsubset",!0);k(_,I,z,"≼","\\preccurlyeq",!0);k(_,I,z,"⋞","\\curlyeqprec",!0);k(_,I,z,"≾","\\precsim",!0);k(_,I,z,"⪷","\\precapprox",!0);k(_,I,z,"⊲","\\vartriangleleft");k(_,I,z,"⊴","\\trianglelefteq");k(_,I,z,"⊨","\\vDash",!0);k(_,I,z,"⊪","\\Vvdash",!0);k(_,I,z,"⌣","\\smallsmile");k(_,I,z,"⌢","\\smallfrown");k(_,I,z,"≏","\\bumpeq",!0);k(_,I,z,"≎","\\Bumpeq",!0);k(_,I,z,"≧","\\geqq",!0);k(_,I,z,"⩾","\\geqslant",!0);k(_,I,z,"⪖","\\eqslantgtr",!0);k(_,I,z,"≳","\\gtrsim",!0);k(_,I,z,"⪆","\\gtrapprox",!0);k(_,I,Ee,"⋗","\\gtrdot");k(_,I,z,"⋙","\\ggg",!0);k(_,I,z,"≷","\\gtrless",!0);k(_,I,z,"⋛","\\gtreqless",!0);k(_,I,z,"⪌","\\gtreqqless",!0);k(_,I,z,"≖","\\eqcirc",!0);k(_,I,z,"≗","\\circeq",!0);k(_,I,z,"≜","\\triangleq",!0);k(_,I,z,"∼","\\thicksim");k(_,I,z,"≈","\\thickapprox");k(_,I,z,"⫆","\\supseteqq",!0);k(_,I,z,"⋑","\\Supset",!0);k(_,I,z,"⊐","\\sqsupset",!0);k(_,I,z,"≽","\\succcurlyeq",!0);k(_,I,z,"⋟","\\curlyeqsucc",!0);k(_,I,z,"≿","\\succsim",!0);k(_,I,z,"⪸","\\succapprox",!0);k(_,I,z,"⊳","\\vartriangleright");k(_,I,z,"⊵","\\trianglerighteq");k(_,I,z,"⊩","\\Vdash",!0);k(_,I,z,"∣","\\shortmid");k(_,I,z,"∥","\\shortparallel");k(_,I,z,"≬","\\between",!0);k(_,I,z,"⋔","\\pitchfork",!0);k(_,I,z,"∝","\\varpropto");k(_,I,z,"◀","\\blacktriangleleft");k(_,I,z,"∴","\\therefore",!0);k(_,I,z,"∍","\\backepsilon");k(_,I,z,"▶","\\blacktriangleright");k(_,I,z,"∵","\\because",!0);k(_,I,z,"⋘","\\llless");k(_,I,z,"⋙","\\gggtr");k(_,I,Ee,"⊲","\\lhd");k(_,I,Ee,"⊳","\\rhd");k(_,I,z,"≂","\\eqsim",!0);k(_,R,z,"⋈","\\Join");k(_,I,z,"≑","\\Doteq",!0);k(_,I,Ee,"∔","\\dotplus",!0);k(_,I,Ee,"∖","\\smallsetminus");k(_,I,Ee,"⋒","\\Cap",!0);k(_,I,Ee,"⋓","\\Cup",!0);k(_,I,Ee,"⩞","\\doublebarwedge",!0);k(_,I,Ee,"⊟","\\boxminus",!0);k(_,I,Ee,"⊞","\\boxplus",!0);k(_,I,Ee,"⋇","\\divideontimes",!0);k(_,I,Ee,"⋉","\\ltimes",!0);k(_,I,Ee,"⋊","\\rtimes",!0);k(_,I,Ee,"⋋","\\leftthreetimes",!0);k(_,I,Ee,"⋌","\\rightthreetimes",!0);k(_,I,Ee,"⋏","\\curlywedge",!0);k(_,I,Ee,"⋎","\\curlyvee",!0);k(_,I,Ee,"⊝","\\circleddash",!0);k(_,I,Ee,"⊛","\\circledast",!0);k(_,I,Ee,"⋅","\\centerdot");k(_,I,Ee,"⊺","\\intercal",!0);k(_,I,Ee,"⋒","\\doublecap");k(_,I,Ee,"⋓","\\doublecup");k(_,I,Ee,"⊠","\\boxtimes",!0);k(_,I,z,"⇢","\\dashrightarrow",!0);k(_,I,z,"⇠","\\dashleftarrow",!0);k(_,I,z,"⇇","\\leftleftarrows",!0);k(_,I,z,"⇆","\\leftrightarrows",!0);k(_,I,z,"⇚","\\Lleftarrow",!0);k(_,I,z,"↞","\\twoheadleftarrow",!0);k(_,I,z,"↢","\\leftarrowtail",!0);k(_,I,z,"↫","\\looparrowleft",!0);k(_,I,z,"⇋","\\leftrightharpoons",!0);k(_,I,z,"↶","\\curvearrowleft",!0);k(_,I,z,"↺","\\circlearrowleft",!0);k(_,I,z,"↰","\\Lsh",!0);k(_,I,z,"⇈","\\upuparrows",!0);k(_,I,z,"↿","\\upharpoonleft",!0);k(_,I,z,"⇃","\\downharpoonleft",!0);k(_,R,z,"⊶","\\origof",!0);k(_,R,z,"⊷","\\imageof",!0);k(_,I,z,"⊸","\\multimap",!0);k(_,I,z,"↭","\\leftrightsquigarrow",!0);k(_,I,z,"⇉","\\rightrightarrows",!0);k(_,I,z,"⇄","\\rightleftarrows",!0);k(_,I,z,"↠","\\twoheadrightarrow",!0);k(_,I,z,"↣","\\rightarrowtail",!0);k(_,I,z,"↬","\\looparrowright",!0);k(_,I,z,"↷","\\curvearrowright",!0);k(_,I,z,"↻","\\circlearrowright",!0);k(_,I,z,"↱","\\Rsh",!0);k(_,I,z,"⇊","\\downdownarrows",!0);k(_,I,z,"↾","\\upharpoonright",!0);k(_,I,z,"⇂","\\downharpoonright",!0);k(_,I,z,"⇝","\\rightsquigarrow",!0);k(_,I,z,"⇝","\\leadsto");k(_,I,z,"⇛","\\Rrightarrow",!0);k(_,I,z,"↾","\\restriction");k(_,R,W,"‘","`");k(_,R,W,"$","\\$");k(pe,R,W,"$","\\$");k(pe,R,W,"$","\\textdollar");k(_,R,W,"%","\\%");k(pe,R,W,"%","\\%");k(_,R,W,"_","\\_");k(pe,R,W,"_","\\_");k(pe,R,W,"_","\\textunderscore");k(_,R,W,"∠","\\angle",!0);k(_,R,W,"∞","\\infty",!0);k(_,R,W,"′","\\prime");k(_,R,W,"△","\\triangle");k(_,R,W,"Γ","\\Gamma",!0);k(_,R,W,"Δ","\\Delta",!0);k(_,R,W,"Θ","\\Theta",!0);k(_,R,W,"Λ","\\Lambda",!0);k(_,R,W,"Ξ","\\Xi",!0);k(_,R,W,"Π","\\Pi",!0);k(_,R,W,"Σ","\\Sigma",!0);k(_,R,W,"Υ","\\Upsilon",!0);k(_,R,W,"Φ","\\Phi",!0);k(_,R,W,"Ψ","\\Psi",!0);k(_,R,W,"Ω","\\Omega",!0);k(_,R,W,"A","Α");k(_,R,W,"B","Β");k(_,R,W,"E","Ε");k(_,R,W,"Z","Ζ");k(_,R,W,"H","Η");k(_,R,W,"I","Ι");k(_,R,W,"K","Κ");k(_,R,W,"M","Μ");k(_,R,W,"N","Ν");k(_,R,W,"O","Ο");k(_,R,W,"P","Ρ");k(_,R,W,"T","Τ");k(_,R,W,"X","Χ");k(_,R,W,"¬","\\neg",!0);k(_,R,W,"¬","\\lnot");k(_,R,W,"⊤","\\top");k(_,R,W,"⊥","\\bot");k(_,R,W,"∅","\\emptyset");k(_,I,W,"∅","\\varnothing");k(_,R,Ve,"α","\\alpha",!0);k(_,R,Ve,"β","\\beta",!0);k(_,R,Ve,"γ","\\gamma",!0);k(_,R,Ve,"δ","\\delta",!0);k(_,R,Ve,"ϵ","\\epsilon",!0);k(_,R,Ve,"ζ","\\zeta",!0);k(_,R,Ve,"η","\\eta",!0);k(_,R,Ve,"θ","\\theta",!0);k(_,R,Ve,"ι","\\iota",!0);k(_,R,Ve,"κ","\\kappa",!0);k(_,R,Ve,"λ","\\lambda",!0);k(_,R,Ve,"μ","\\mu",!0);k(_,R,Ve,"ν","\\nu",!0);k(_,R,Ve,"ξ","\\xi",!0);k(_,R,Ve,"ο","\\omicron",!0);k(_,R,Ve,"π","\\pi",!0);k(_,R,Ve,"ρ","\\rho",!0);k(_,R,Ve,"σ","\\sigma",!0);k(_,R,Ve,"τ","\\tau",!0);k(_,R,Ve,"υ","\\upsilon",!0);k(_,R,Ve,"ϕ","\\phi",!0);k(_,R,Ve,"χ","\\chi",!0);k(_,R,Ve,"ψ","\\psi",!0);k(_,R,Ve,"ω","\\omega",!0);k(_,R,Ve,"ε","\\varepsilon",!0);k(_,R,Ve,"ϑ","\\vartheta",!0);k(_,R,Ve,"ϖ","\\varpi",!0);k(_,R,Ve,"ϱ","\\varrho",!0);k(_,R,Ve,"ς","\\varsigma",!0);k(_,R,Ve,"φ","\\varphi",!0);k(_,R,Ee,"∗","*",!0);k(_,R,Ee,"+","+");k(_,R,Ee,"−","-",!0);k(_,R,Ee,"⋅","\\cdot",!0);k(_,R,Ee,"∘","\\circ",!0);k(_,R,Ee,"÷","\\div",!0);k(_,R,Ee,"±","\\pm",!0);k(_,R,Ee,"×","\\times",!0);k(_,R,Ee,"∩","\\cap",!0);k(_,R,Ee,"∪","\\cup",!0);k(_,R,Ee,"∖","\\setminus",!0);k(_,R,Ee,"∧","\\land");k(_,R,Ee,"∨","\\lor");k(_,R,Ee,"∧","\\wedge",!0);k(_,R,Ee,"∨","\\vee",!0);k(_,R,W,"√","\\surd");k(_,R,Pa,"⟨","\\langle",!0);k(_,R,Pa,"∣","\\lvert");k(_,R,Pa,"∥","\\lVert");k(_,R,ia,"?","?");k(_,R,ia,"!","!");k(_,R,ia,"⟩","\\rangle",!0);k(_,R,ia,"∣","\\rvert");k(_,R,ia,"∥","\\rVert");k(_,R,z,"=","=");k(_,R,z,":",":");k(_,R,z,"≈","\\approx",!0);k(_,R,z,"≅","\\cong",!0);k(_,R,z,"≥","\\ge");k(_,R,z,"≥","\\geq",!0);k(_,R,z,"←","\\gets");k(_,R,z,">","\\gt",!0);k(_,R,z,"∈","\\in",!0);k(_,R,z,"","\\@not");k(_,R,z,"⊂","\\subset",!0);k(_,R,z,"⊃","\\supset",!0);k(_,R,z,"⊆","\\subseteq",!0);k(_,R,z,"⊇","\\supseteq",!0);k(_,I,z,"⊈","\\nsubseteq",!0);k(_,I,z,"⊉","\\nsupseteq",!0);k(_,R,z,"⊨","\\models");k(_,R,z,"←","\\leftarrow",!0);k(_,R,z,"≤","\\le");k(_,R,z,"≤","\\leq",!0);k(_,R,z,"<","\\lt",!0);k(_,R,z,"→","\\rightarrow",!0);k(_,R,z,"→","\\to");k(_,I,z,"≱","\\ngeq",!0);k(_,I,z,"≰","\\nleq",!0);k(_,R,Ns," ","\\ ");k(_,R,Ns," ","\\space");k(_,R,Ns," ","\\nobreakspace");k(pe,R,Ns," ","\\ ");k(pe,R,Ns," "," ");k(pe,R,Ns," ","\\space");k(pe,R,Ns," ","\\nobreakspace");k(_,R,Ns,"","\\nobreak");k(_,R,Ns,"","\\allowbreak");k(_,R,Du,",",",");k(_,R,Du,";",";");k(_,I,Ee,"⊼","\\barwedge",!0);k(_,I,Ee,"⊻","\\veebar",!0);k(_,R,Ee,"⊙","\\odot",!0);k(_,R,Ee,"⊕","\\oplus",!0);k(_,R,Ee,"⊗","\\otimes",!0);k(_,R,W,"∂","\\partial",!0);k(_,R,Ee,"⊘","\\oslash",!0);k(_,I,Ee,"⊚","\\circledcirc",!0);k(_,I,Ee,"⊡","\\boxdot",!0);k(_,R,Ee,"△","\\bigtriangleup");k(_,R,Ee,"▽","\\bigtriangledown");k(_,R,Ee,"†","\\dagger");k(_,R,Ee,"⋄","\\diamond");k(_,R,Ee,"⋆","\\star");k(_,R,Ee,"◃","\\triangleleft");k(_,R,Ee,"▹","\\triangleright");k(_,R,Pa,"{","\\{");k(pe,R,W,"{","\\{");k(pe,R,W,"{","\\textbraceleft");k(_,R,ia,"}","\\}");k(pe,R,W,"}","\\}");k(pe,R,W,"}","\\textbraceright");k(_,R,Pa,"{","\\lbrace");k(_,R,ia,"}","\\rbrace");k(_,R,Pa,"[","\\lbrack",!0);k(pe,R,W,"[","\\lbrack",!0);k(_,R,ia,"]","\\rbrack",!0);k(pe,R,W,"]","\\rbrack",!0);k(_,R,Pa,"(","\\lparen",!0);k(_,R,ia,")","\\rparen",!0);k(pe,R,W,"<","\\textless",!0);k(pe,R,W,">","\\textgreater",!0);k(_,R,Pa,"⌊","\\lfloor",!0);k(_,R,ia,"⌋","\\rfloor",!0);k(_,R,Pa,"⌈","\\lceil",!0);k(_,R,ia,"⌉","\\rceil",!0);k(_,R,W,"\\","\\backslash");k(_,R,W,"∣","|");k(_,R,W,"∣","\\vert");k(pe,R,W,"|","\\textbar",!0);k(_,R,W,"∥","\\|");k(_,R,W,"∥","\\Vert");k(pe,R,W,"∥","\\textbardbl");k(pe,R,W,"~","\\textasciitilde");k(pe,R,W,"\\","\\textbackslash");k(pe,R,W,"^","\\textasciicircum");k(_,R,z,"↑","\\uparrow",!0);k(_,R,z,"⇑","\\Uparrow",!0);k(_,R,z,"↓","\\downarrow",!0);k(_,R,z,"⇓","\\Downarrow",!0);k(_,R,z,"↕","\\updownarrow",!0);k(_,R,z,"⇕","\\Updownarrow",!0);k(_,R,xn,"∐","\\coprod");k(_,R,xn,"⋁","\\bigvee");k(_,R,xn,"⋀","\\bigwedge");k(_,R,xn,"⨄","\\biguplus");k(_,R,xn,"⋂","\\bigcap");k(_,R,xn,"⋃","\\bigcup");k(_,R,xn,"∫","\\int");k(_,R,xn,"∫","\\intop");k(_,R,xn,"∬","\\iint");k(_,R,xn,"∭","\\iiint");k(_,R,xn,"∏","\\prod");k(_,R,xn,"∑","\\sum");k(_,R,xn,"⨂","\\bigotimes");k(_,R,xn,"⨁","\\bigoplus");k(_,R,xn,"⨀","\\bigodot");k(_,R,xn,"∮","\\oint");k(_,R,xn,"∯","\\oiint");k(_,R,xn,"∰","\\oiiint");k(_,R,xn,"⨆","\\bigsqcup");k(_,R,xn,"∫","\\smallint");k(pe,R,jl,"…","\\textellipsis");k(_,R,jl,"…","\\mathellipsis");k(pe,R,jl,"…","\\ldots",!0);k(_,R,jl,"…","\\ldots",!0);k(_,R,jl,"⋯","\\@cdots",!0);k(_,R,jl,"⋱","\\ddots",!0);k(_,R,W,"⋮","\\varvdots");k(pe,R,W,"⋮","\\varvdots");k(_,R,Vt,"ˊ","\\acute");k(_,R,Vt,"ˋ","\\grave");k(_,R,Vt,"¨","\\ddot");k(_,R,Vt,"~","\\tilde");k(_,R,Vt,"ˉ","\\bar");k(_,R,Vt,"˘","\\breve");k(_,R,Vt,"ˇ","\\check");k(_,R,Vt,"^","\\hat");k(_,R,Vt,"⃗","\\vec");k(_,R,Vt,"˙","\\dot");k(_,R,Vt,"˚","\\mathring");k(_,R,Ve,"","\\@imath");k(_,R,Ve,"","\\@jmath");k(_,R,W,"ı","ı");k(_,R,W,"ȷ","ȷ");k(pe,R,W,"ı","\\i",!0);k(pe,R,W,"ȷ","\\j",!0);k(pe,R,W,"ß","\\ss",!0);k(pe,R,W,"æ","\\ae",!0);k(pe,R,W,"œ","\\oe",!0);k(pe,R,W,"ø","\\o",!0);k(pe,R,W,"Æ","\\AE",!0);k(pe,R,W,"Œ","\\OE",!0);k(pe,R,W,"Ø","\\O",!0);k(pe,R,Vt,"ˊ","\\'");k(pe,R,Vt,"ˋ","\\`");k(pe,R,Vt,"ˆ","\\^");k(pe,R,Vt,"˜","\\~");k(pe,R,Vt,"ˉ","\\=");k(pe,R,Vt,"˘","\\u");k(pe,R,Vt,"˙","\\.");k(pe,R,Vt,"¸","\\c");k(pe,R,Vt,"˚","\\r");k(pe,R,Vt,"ˇ","\\v");k(pe,R,Vt,"¨",'\\"');k(pe,R,Vt,"˝","\\H");k(pe,R,Vt,"◯","\\textcircled");var N5={"--":!0,"---":!0,"``":!0,"''":!0};k(pe,R,W,"–","--",!0);k(pe,R,W,"–","\\textendash");k(pe,R,W,"—","---",!0);k(pe,R,W,"—","\\textemdash");k(pe,R,W,"‘","`",!0);k(pe,R,W,"‘","\\textquoteleft");k(pe,R,W,"’","'",!0);k(pe,R,W,"’","\\textquoteright");k(pe,R,W,"“","``",!0);k(pe,R,W,"“","\\textquotedblleft");k(pe,R,W,"”","''",!0);k(pe,R,W,"”","\\textquotedblright");k(_,R,W,"°","\\degree",!0);k(pe,R,W,"°","\\degree");k(pe,R,W,"°","\\textdegree",!0);k(_,R,W,"£","\\pounds");k(_,R,W,"£","\\mathsterling",!0);k(pe,R,W,"£","\\pounds");k(pe,R,W,"£","\\textsterling",!0);k(_,I,W,"✠","\\maltese");k(pe,I,W,"✠","\\maltese");var K4='0123456789/@."';for(var um=0;um<K4.length;um++){var Y4=K4.charAt(um);k(_,R,W,Y4,Y4)}var Z4='0123456789!@*()-=+";:?/.,';for(var dm=0;dm<Z4.length;dm++){var X4=Z4.charAt(dm);k(pe,R,W,X4,X4)}var J0="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(var pm=0;pm<J0.length;pm++){var s0=J0.charAt(pm);k(_,R,Ve,s0,s0),k(pe,R,W,s0,s0)}k(_,I,W,"C","ℂ");k(pe,I,W,"C","ℂ");k(_,I,W,"H","ℍ");k(pe,I,W,"H","ℍ");k(_,I,W,"N","ℕ");k(pe,I,W,"N","ℕ");k(_,I,W,"P","ℙ");k(pe,I,W,"P","ℙ");k(_,I,W,"Q","ℚ");k(pe,I,W,"Q","ℚ");k(_,I,W,"R","ℝ");k(pe,I,W,"R","ℝ");k(_,I,W,"Z","ℤ");k(pe,I,W,"Z","ℤ");k(_,R,Ve,"h","ℎ");k(pe,R,Ve,"h","ℎ");var Ze;for(var ta=0;ta<J0.length;ta++){var en=J0.charAt(ta);Ze=String.fromCharCode(55349,56320+ta),k(_,R,Ve,en,Ze),k(pe,R,W,en,Ze),Ze=String.fromCharCode(55349,56372+ta),k(_,R,Ve,en,Ze),k(pe,R,W,en,Ze),Ze=String.fromCharCode(55349,56424+ta),k(_,R,Ve,en,Ze),k(pe,R,W,en,Ze),Ze=String.fromCharCode(55349,56580+ta),k(_,R,Ve,en,Ze),k(pe,R,W,en,Ze),Ze=String.fromCharCode(55349,56684+ta),k(_,R,Ve,en,Ze),k(pe,R,W,en,Ze),Ze=String.fromCharCode(55349,56736+ta),k(_,R,Ve,en,Ze),k(pe,R,W,en,Ze),Ze=String.fromCharCode(55349,56788+ta),k(_,R,Ve,en,Ze),k(pe,R,W,en,Ze),Ze=String.fromCharCode(55349,56840+ta),k(_,R,Ve,en,Ze),k(pe,R,W,en,Ze),Ze=String.fromCharCode(55349,56944+ta),k(_,R,Ve,en,Ze),k(pe,R,W,en,Ze),ta<26&&(Ze=String.fromCharCode(55349,56632+ta),k(_,R,Ve,en,Ze),k(pe,R,W,en,Ze),Ze=String.fromCharCode(55349,56476+ta),k(_,R,Ve,en,Ze),k(pe,R,W,en,Ze))}Ze="𝕜";k(_,R,Ve,"k",Ze);k(pe,R,W,"k",Ze);for(var ao=0;ao<10;ao++){var ci=ao.toString();Ze=String.fromCharCode(55349,57294+ao),k(_,R,Ve,ci,Ze),k(pe,R,W,ci,Ze),Ze=String.fromCharCode(55349,57314+ao),k(_,R,Ve,ci,Ze),k(pe,R,W,ci,Ze),Ze=String.fromCharCode(55349,57324+ao),k(_,R,Ve,ci,Ze),k(pe,R,W,ci,Ze),Ze=String.fromCharCode(55349,57334+ao),k(_,R,Ve,ci,Ze),k(pe,R,W,ci,Ze)}var xg="ÐÞþ";for(var fm=0;fm<xg.length;fm++){var i0=xg.charAt(fm);k(_,R,Ve,i0,i0),k(pe,R,W,i0,i0)}var wg={mathClass:"mathbf",textClass:"textbf",font:"Main-Bold"},Q4={mathClass:"mathnormal",textClass:"textit",font:"Math-Italic"},J4={mathClass:"boldsymbol",textClass:"boldsymbol",font:"Main-BoldItalic"},xN={mathClass:"mathscr",textClass:"textscr",font:"Script-Regular"},uo={mathClass:"",textClass:"",font:""},e2={mathClass:"mathfrak",textClass:"textfrak",font:"Fraktur-Regular"},t2={mathClass:"mathbb",textClass:"textbb",font:"AMS-Regular"},n2={mathClass:"mathboldfrak",textClass:"textboldfrak",font:"Fraktur-Regular"},kg={mathClass:"mathsf",textClass:"textsf",font:"SansSerif-Regular"},Sg={mathClass:"mathboldsf",textClass:"textboldsf",font:"SansSerif-Bold"},a2={mathClass:"mathitsf",textClass:"textitsf",font:"SansSerif-Italic"},_g={mathClass:"mathtt",textClass:"texttt",font:"Typewriter-Regular"},r2=[wg,wg,Q4,Q4,J4,J4,xN,uo,uo,uo,e2,e2,t2,t2,n2,n2,kg,kg,Sg,Sg,a2,a2,uo,uo,_g,_g],wN=[wg,uo,kg,Sg,_g],kN=t=>{var e=t.charCodeAt(0),n=t.charCodeAt(1),a=(e-55296)*1024+(n-56320)+65536;if(119808<=a&&a<120484){var r=Math.floor((a-119808)/26);return r2[r]}else if(120782<=a&&a<=120831){var i=Math.floor((a-120782)/10);return wN[i]}else{if(a===120485||a===120486)return r2[0];if(120486<a&&a<120782)return uo;throw new be("Unsupported character: "+t)}},Ap=function(e,n,a){if(qt[a][e]){var r=qt[a][e].replace;r&&(e=r)}return{value:e,metrics:E1(e,n,a)}},aa=function(e,n,a,r,i){var l=Ap(e,n,a),c=l.metrics;e=l.value;var d;if(c){var p=c.italic;(a==="text"||r&&r.font==="mathit")&&(p=0),d=new Ia(e,c.height,c.depth,p,c.skew,c.width,i)}else typeof console<"u"&&console.warn("No character metrics "+("for '"+e+"' in style '"+n+"' and mode '"+a+"'")),d=new Ia(e,0,0,0,0,0,i);if(r){d.maxFontSize=r.sizeMultiplier,r.style.isTight()&&d.classes.push("mtight");var h=r.getColor();h&&(d.style.color=h)}return d},N1=function(e,n,a,r){return r===void 0&&(r=[]),a.font==="boldsymbol"&&Ap(e,"Main-Bold",n).metrics?aa(e,"Main-Bold",n,a,r.concat(["mathbf"])):e==="\\"||qt[n][e].font==="main"?aa(e,"Main-Regular",n,a,r):aa(e,"AMS-Regular",n,a,r.concat(["amsrm"]))},SN=function(e,n,a){return a!=="textord"&&Ap(e,"Math-BoldItalic",n).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},Tp=function(e,n,a){var r=e.mode,i=e.text,l=["mord"],{font:c,fontFamily:d,fontWeight:p,fontShape:h}=n,m=r==="math"||r==="text"&&!!c,b=m?c:d,x="",w="";if(i.charCodeAt(0)===55349){var S=kN(i);x=S.font,w=S[r+"Class"]}if(x)return aa(i,x,r,n,l.concat(w));if(b){var C,E;if(b==="boldsymbol"){var T=SN(i,r,a);C=T.fontName,E=[T.fontClass]}else m?(C=Cg[c].fontName,E=[c]):(C=o0(d,p,h),E=[d,p,h]);if(Ap(i,C,r).metrics)return aa(i,C,r,n,l.concat(E));if(N5.hasOwnProperty(i)&&C.slice(0,10)==="Typewriter"){for(var L=[],D=0;D<i.length;D++)L.push(aa(i[D],C,r,n,l.concat(E)));return Rs(L)}}if(a==="mathord")return aa(i,"Math-Italic",r,n,l.concat(["mathnormal"]));if(a==="textord"){var B=qt[r][i]&&qt[r][i].font;if(B==="ams"){var H=o0("amsrm",p,h);return aa(i,H,r,n,l.concat("amsrm",p,h))}else if(B==="main"||!B){var K=o0("textrm",p,h);return aa(i,K,r,n,l.concat(p,h))}else{var U=o0(B,p,h);return aa(i,U,r,n,l.concat(U,p,h))}}else throw new Error("unexpected type: "+a+" in makeOrd")},_N=(t,e)=>{if(Ai(t.classes)!==Ai(e.classes)||t.skew!==e.skew||t.maxFontSize!==e.maxFontSize||t.italic!==0&&t.hasClass("mathnormal"))return!1;if(t.classes.length===1){var n=t.classes[0];if(n==="mbin"||n==="mord")return!1}for(var a of Object.keys(t.style))if(t.style[a]!==e.style[a])return!1;for(var r of Object.keys(e.style))if(t.style[r]!==e.style[r])return!1;return!0},R5=t=>{for(var e=0;e<t.length-1;e++){var n=t[e],a=t[e+1];n instanceof Ia&&a instanceof Ia&&_N(n,a)&&(n.text+=a.text,n.height=Math.max(n.height,a.height),n.depth=Math.max(n.depth,a.depth),n.italic=a.italic,t.splice(e+1,1),e--)}return t},R1=function(e){for(var n=0,a=0,r=0,i=0;i<e.children.length;i++){var l=e.children[i];l.height>n&&(n=l.height),l.depth>a&&(a=l.depth),l.maxFontSize>r&&(r=l.maxFontSize)}e.height=n,e.depth=a,e.maxFontSize=r},fe=function(e,n,a,r){var i=new Ll(e,n,a,r);return R1(i),i},Ei=(t,e,n,a)=>new Ll(t,e,n,a),Rl=function(e,n,a){var r=fe([e],[],n);return r.height=Math.max(a||n.fontMetrics().defaultRuleThickness,n.minRuleThickness),r.style.borderBottomWidth=we(r.height),r.maxFontSize=1,r},CN=function(e,n,a,r){var i=new Cp(e,n,a,r);return R1(i),i},Rs=function(e){var n=new Ol(e);return R1(n),n},Dl=function(e,n){return e instanceof Ol?fe([],[e],n):e},AN=function(e){if(e.positionType==="individualShift"){for(var n=e.children,a=[n[0]],r=-n[0].shift-n[0].elem.depth,i=r,l=1;l<n.length;l++){var c=-n[l].shift-i-n[l].elem.depth,d=c-(n[l-1].elem.height+n[l-1].elem.depth);i=i+c,a.push({type:"kern",size:d}),a.push(n[l])}return{children:a,depth:r}}var p;if(e.positionType==="top"){for(var h=e.positionData,m=0;m<e.children.length;m++){var b=e.children[m];h-=b.type==="kern"?b.size:b.elem.height+b.elem.depth}p=h}else if(e.positionType==="bottom")p=-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")p=-x.elem.depth-e.positionData;else if(e.positionType==="firstBaseline")p=-x.elem.depth;else throw new Error("Invalid positionType "+e.positionType+".")}return{children:e.children,depth:p}},Et=function(e,n){for(var{children:a,depth:r}=AN(e),i=0,l=0;l<a.length;l++){var c=a[l];if(c.type==="elem"){var d=c.elem;i=Math.max(i,d.maxFontSize,d.height)}}i+=2;var p=fe(["pstrut"],[]);p.style.height=we(i);for(var h=[],m=r,b=r,x=r,w=0;w<a.length;w++){var S=a[w];if(S.type==="kern")x+=S.size;else{var C=S.elem,E=S.wrapperClasses||[],T=S.wrapperStyle||{},L=fe(E,[p,C],void 0,T);L.style.top=we(-i-x-C.depth),S.marginLeft&&(L.style.marginLeft=S.marginLeft),S.marginRight&&(L.style.marginRight=S.marginRight),h.push(L),x+=C.height+C.depth}m=Math.min(m,x),b=Math.max(b,x)}var D=fe(["vlist"],h);D.style.height=we(b);var B;if(m<0){var H=fe([],[]),K=fe(["vlist"],[H]);K.style.height=we(-m);var U=fe(["vlist-s"],[new Ia("")]);B=[fe(["vlist-r"],[D,U]),fe(["vlist-r"],[K])]}else B=[fe(["vlist-r"],[D])];var q=fe(["vlist-t"],B);return B.length===2&&q.classes.push("vlist-t2"),q.height=b,q.depth=-m,q},D5=(t,e)=>{var n=fe(["mspace"],[],e),a=Yt(t,e);return n.style.marginRight=we(a),n},o0=(t,e,n)=>{var a,r;switch(t){case"amsrm":a="AMS";break;case"textrm":a="Main";break;case"textsf":a="SansSerif";break;case"texttt":a="Typewriter";break;default:a=t}return e==="textbf"&&n==="textit"?r="BoldItalic":e==="textbf"?r="Bold":n==="textit"?r="Italic":r="Regular",a+"-"+r},Cg={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"}},M5={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},O5=function(e,n){var[a,r,i]=M5[e],l=new Ti(a),c=new Ts([l],{width:we(r),height:we(i),style:"width:"+we(r),viewBox:"0 0 "+1e3*r+" "+1e3*i,preserveAspectRatio:"xMinYMin"}),d=Ei(["overlay"],[c],n);return d.height=i,d.style.height=we(i),d.style.width=we(r),d},Kt={number:3,unit:"mu"},ro={number:4,unit:"mu"},hs={number:5,unit:"mu"},TN={mord:{mop:Kt,mbin:ro,mrel:hs,minner:Kt},mop:{mord:Kt,mop:Kt,mrel:hs,minner:Kt},mbin:{mord:ro,mop:ro,mopen:ro,minner:ro},mrel:{mord:hs,mop:hs,mopen:hs,minner:hs},mopen:{},mclose:{mop:Kt,mbin:ro,mrel:hs,minner:Kt},mpunct:{mord:Kt,mop:Kt,mrel:hs,mopen:Kt,mclose:Kt,mpunct:Kt,minner:Kt},minner:{mord:Kt,mop:Kt,mbin:ro,mrel:hs,mopen:Kt,mpunct:Kt,minner:Kt}},EN={mord:{mop:Kt},mop:{mord:Kt,mop:Kt},mbin:{},mrel:{},mopen:{},mclose:{mop:Kt},mpunct:{},minner:{mop:Kt}},L5={},ep={},tp={};function Ae(t){for(var{type:e,names:n,props:a,handler:r,htmlBuilder:i,mathmlBuilder:l}=t,c={type:e,numArgs:a.numArgs,argTypes:a.argTypes,allowedInArgument:!!a.allowedInArgument,allowedInText:!!a.allowedInText,allowedInMath:a.allowedInMath===void 0?!0:a.allowedInMath,numOptionalArgs:a.numOptionalArgs||0,infix:!!a.infix,primitive:!!a.primitive,handler:r},d=0;d<n.length;++d)L5[n[d]]=c;e&&(i&&(ep[e]=i),l&&(tp[e]=l))}function Ao(t){var{type:e,htmlBuilder:n,mathmlBuilder:a}=t;Ae({type:e,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:n,mathmlBuilder:a})}var np=function(e){return e.type==="ordgroup"&&e.body.length===1?e.body[0]:e},bn=function(e){return e.type==="ordgroup"?e.body:[e]},NN=new Set(["leftmost","mbin","mopen","mrel","mop","mpunct"]),RN=new Set(["rightmost","mrel","mclose","mpunct"]),DN={display:nt.DISPLAY,text:nt.TEXT,script:nt.SCRIPT,scriptscript:nt.SCRIPTSCRIPT},MN={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},En=function(e,n,a,r){r===void 0&&(r=[null,null]);for(var i=[],l=0;l<e.length;l++){var c=Nt(e[l],n);if(c instanceof Ol){var d=c.children;i.push(...d)}else i.push(c)}if(R5(i),!a)return i;var p=n;if(e.length===1){var h=e[0];h.type==="sizing"?p=n.havingSize(h.size):h.type==="styling"&&(p=n.havingStyle(DN[h.style]))}var m=fe([r[0]||"leftmost"],[],n),b=fe([r[1]||"rightmost"],[],n),x=a==="root";return Ag(i,(w,S)=>{var C=S.classes[0],E=w.classes[0];C==="mbin"&&RN.has(E)?S.classes[0]="mord":E==="mbin"&&NN.has(C)&&(w.classes[0]="mord")},{node:m},b,x),Ag(i,(w,S)=>{var C,E,T=Eg(S),L=Eg(w),D=T&&L?w.hasClass("mtight")?(C=EN[T])==null?void 0:C[L]:(E=TN[T])==null?void 0:E[L]:null;if(D)return D5(D,p)},{node:m},b,x),i},Ag=function(e,n,a,r,i){r&&e.push(r);for(var l=0;l<e.length;l++){var c=e[l],d=j5(c);if(d){Ag(d.children,n,a,null,i);continue}var p=!c.hasClass("mspace");if(p){var h=n(c,a.node);h&&(a.insertAfter?a.insertAfter(h):(e.unshift(h),l++))}p?a.node=c:i&&c.hasClass("newline")&&(a.node=fe(["leftmost"])),a.insertAfter=(m=>b=>{e.splice(m+1,0,b),l++})(l)}r&&e.pop()},j5=function(e){return e instanceof Ol||e instanceof Cp||e instanceof Ll&&e.hasClass("enclosing")?e:null},Tg=function(e,n){var a=j5(e);if(a){var r=a.children;if(r.length){if(n==="right")return Tg(r[r.length-1],"right");if(n==="left")return Tg(r[0],"left")}}return e},Eg=function(e,n){if(!e)return null;n&&(e=Tg(e,n));var a=e.classes[0];return MN[a]||null},bu=function(e,n){var a=["nulldelimiter"].concat(e.baseSizingClasses());return fe(n.concat(a))},Nt=function(e,n,a){if(!e)return fe();if(ep[e.type]){var r=ep[e.type](e,n);if(a&&n.size!==a.size){r=fe(n.sizingClasses(a),[r],n);var i=n.sizeMultiplier/a.sizeMultiplier;r.height*=i,r.depth*=i}return r}else throw new be("Got group of unknown type: '"+e.type+"'")};function l0(t,e){var n=fe(["base"],t,e),a=fe(["strut"]);return a.style.height=we(n.height+n.depth),n.depth&&(a.style.verticalAlign=we(-n.depth)),n.children.unshift(a),n}function Ng(t,e){var n=null;t.length===1&&t[0].type==="tag"&&(n=t[0].tag,t=t[0].body);var a=En(t,e,"root"),r;a.length===2&&a[1].hasClass("tag")&&(r=a.pop());for(var i=[],l=[],c=0;c<a.length;c++)if(l.push(a[c]),a[c].hasClass("mbin")||a[c].hasClass("mrel")||a[c].hasClass("allowbreak")){for(var d=!1;c<a.length-1&&a[c+1].hasClass("mspace")&&!a[c+1].hasClass("newline");)c++,l.push(a[c]),a[c].hasClass("nobreak")&&(d=!0);d||(i.push(l0(l,e)),l=[])}else a[c].hasClass("newline")&&(l.pop(),l.length>0&&(i.push(l0(l,e)),l=[]),i.push(a[c]));l.length>0&&i.push(l0(l,e));var p;n?(p=l0(En(n,e,!0),e),p.classes=["tag"],i.push(p)):r&&i.push(r);var h=fe(["katex-html"],i);if(h.setAttribute("aria-hidden","true"),p){var m=p.children[0];m.style.height=we(h.height+h.depth),h.depth&&(m.style.verticalAlign=we(-h.depth))}return h}function B5(t){return new Ol(t)}class ve{constructor(e,n,a){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=a||[]}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=Ai(this.classes));for(var a=0;a<this.children.length;a++)if(this.children[a]instanceof vn&&this.children[a+1]instanceof vn){for(var r=this.children[a].toText()+this.children[++a].toText();this.children[a+1]instanceof vn;)r+=this.children[++a].toText();e.appendChild(new vn(r).toNode())}else e.appendChild(this.children[a].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(this.attributes[n]),e+='"');this.classes.length>0&&(e+=' class ="'+Wn(Ai(this.classes))+'"'),e+=">";for(var a=0;a<this.children.length;a++)e+=this.children[a].toMarkup();return e+="</"+this.type+">",e}toText(){return this.children.map(e=>e.toText()).join("")}}class vn{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return Wn(this.toText())}toText(){return this.text}}class I5{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",we(this.width)),e}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+we(this.width)+'"/>'}toText(){return this.character?this.character:" "}}var ON=new Set(["\\imath","\\jmath"]),LN=new Set(["mrow","mtable"]),or=function(e,n,a){return qt[n][e]&&qt[n][e].replace&&e.charCodeAt(0)!==55349&&!(N5.hasOwnProperty(e)&&a&&(a.fontFamily&&a.fontFamily.slice(4,6)==="tt"||a.font&&a.font.slice(4,6)==="tt"))&&(e=qt[n][e].replace),new vn(e)},D1=function(e){return e.length===1?e[0]:new ve("mrow",e)},jN={mathit:"italic",boldsymbol:t=>t.type==="textord"?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},M1=(t,e)=>{if(t.mode==="text"){if(e.fontFamily==="texttt")return"monospace";if(e.fontFamily==="textsf")return e.fontShape==="textit"&&e.fontWeight==="textbf"?"sans-serif-bold-italic":e.fontShape==="textit"?"sans-serif-italic":e.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(e.fontShape==="textit"&&e.fontWeight==="textbf")return"bold-italic";if(e.fontShape==="textit")return"italic";if(e.fontWeight==="textbf")return"bold"}var n=e.font;if(!n||n==="mathnormal")return null;var a=t.mode,r=jN[n];if(r)return typeof r=="function"?r(t):r;var i=t.text;if(ON.has(i))return null;if(qt[a][i]){var l=qt[a][i].replace;l&&(i=l)}var c=Cg[n].fontName;return E1(i,c,a)?Cg[n].variant:null};function hm(t){if(!t)return!1;if(t.type==="mi"&&t.children.length===1){var e=t.children[0];return e instanceof vn&&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 vn&&n.text===","}else return!1}var za=function(e,n,a){if(e.length===1){var r=zt(e[0],n);return a&&r instanceof ve&&r.type==="mo"&&(r.setAttribute("lspace","0em"),r.setAttribute("rspace","0em")),[r]}for(var i=[],l,c=0;c<e.length;c++){var d=zt(e[c],n);if(d instanceof ve&&l instanceof ve){if(d.type==="mtext"&&l.type==="mtext"&&d.getAttribute("mathvariant")===l.getAttribute("mathvariant")){l.children.push(...d.children);continue}else if(d.type==="mn"&&l.type==="mn"){l.children.push(...d.children);continue}else if(hm(d)&&l.type==="mn"){l.children.push(...d.children);continue}else if(d.type==="mn"&&hm(l))d.children=[...l.children,...d.children],i.pop();else if((d.type==="msup"||d.type==="msub")&&d.children.length>=1&&(l.type==="mn"||hm(l))){var p=d.children[0];p instanceof ve&&p.type==="mn"&&(p.children=[...l.children,...p.children],i.pop())}else if(l.type==="mi"&&l.children.length===1){var h=l.children[0];if(h instanceof vn&&h.text==="̸"&&(d.type==="mo"||d.type==="mi"||d.type==="mn")){var m=d.children[0];m instanceof vn&&m.text.length>0&&(m.text=m.text.slice(0,1)+"̸"+m.text.slice(1),i.pop())}}}i.push(d),l=d}return i},Ni=function(e,n,a){return D1(za(e,n,a))},zt=function(e,n){if(!e)return new ve("mrow");if(tp[e.type])return tp[e.type](e,n);throw new be("Got group of unknown type: '"+e.type+"'")};function s2(t,e,n,a,r){var i=za(t,n),l;i.length===1&&i[0]instanceof ve&&LN.has(i[0].type)?l=i[0]:l=new ve("mrow",i);var c=new ve("annotation",[new vn(e)]);c.setAttribute("encoding","application/x-tex");var d=new ve("semantics",[l,c]),p=new ve("math",[d]);p.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),a&&p.setAttribute("display","block");var h=r?"katex":"katex-mathml";return fe([h],[p])}var BN=[[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]],i2=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],o2=function(e,n){return n.size<2?e:BN[e-1][n.size-1]};class bs{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||bs.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=i2[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};return Object.assign(n,e),new bs(n)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:o2(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:i2[e-1]})}havingBaseStyle(e){e=e||this.style.text();var n=o2(bs.BASESIZE,e);return this.size===n&&this.textSize===bs.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!==bs.BASESIZE?["sizing","reset-size"+this.size,"size"+bs.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=vN(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}bs.BASESIZE=6;var P5=function(e){return new bs({style:e.displayMode?nt.DISPLAY:nt.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},z5=function(e,n){if(n.displayMode){var a=["katex-display"];n.leqno&&a.push("leqno"),n.fleqn&&a.push("fleqn"),e=fe(a,[e])}return e},IN=function(e,n,a){var r=P5(a),i;if(a.output==="mathml")return s2(e,n,r,a.displayMode,!0);if(a.output==="html"){var l=Ng(e,r);i=fe(["katex"],[l])}else{var c=s2(e,n,r,a.displayMode,!1),d=Ng(e,r);i=fe(["katex"],[c,d])}return z5(i,a)},PN=function(e,n,a){var r=P5(a),i=Ng(e,r),l=fe(["katex"],[i]);return z5(l,a)},zN={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",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":"="},Ep=function(e){var n=new ve("mo",[new vn(zN[e.replace(/^\\/,"")])]);return n.setAttribute("stretchy","true"),n},$N={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],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],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]},FN=new Set(["widehat","widecheck","widetilde","utilde"]),Np=function(e,n){function a(){var c=4e5,d=e.label.slice(1);if(FN.has(d)&&"base"in e){var p=e.base.type==="ordgroup"?e.base.body.length:1,h,m,b;if(p>5)d==="widehat"||d==="widecheck"?(h=420,c=2364,b=.42,m=d+"4"):(h=312,c=2340,b=.34,m="tilde4");else{var x=[1,1,2,2,3,3][p];d==="widehat"||d==="widecheck"?(c=[0,1062,2364,2364,2364][x],h=[0,239,300,360,420][x],b=[0,.24,.3,.3,.36,.42][x],m=d+x):(c=[0,600,1033,2339,2340][x],h=[0,260,286,306,312][x],b=[0,.26,.286,.3,.306,.34][x],m="tilde"+x)}var w=new Ti(m),S=new Ts([w],{width:"100%",height:we(b),viewBox:"0 0 "+c+" "+h,preserveAspectRatio:"none"});return{span:Ei([],[S],n),minWidth:0,height:b}}else{var C=[],E=$N[d];if(!E)throw new Error('No SVG data for "'+d+'".');var[T,L,D]=E,B=D/1e3,H=T.length,K,U;if(H===1){if(E.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+d+'".');K=["hide-tail"],U=[E[3]]}else if(H===2)K=["halfarrow-left","halfarrow-right"],U=["xMinYMin","xMaxYMin"];else if(H===3)K=["brace-left","brace-center","brace-right"],U=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
|
|
301
|
+
`+H+" children.");for(var q=0;q<H;q++){var re=new Ti(T[q]),_e=new Ts([re],{width:"400em",height:we(B),viewBox:"0 0 "+c+" "+D,preserveAspectRatio:U[q]+" slice"}),G=Ei([K[q]],[_e],n);if(H===1)return{span:G,minWidth:L,height:B};G.style.height=we(B),C.push(G)}return{span:fe(["stretchy"],C,n),minWidth:L,height:B}}}var{span:r,minWidth:i,height:l}=a();return r.height=l,r.style.height=we(l),i>0&&(r.style.minWidth=we(i)),r},HN=function(e,n,a,r,i){var l,c=e.height+e.depth+a+r;if(/fbox|color|angl/.test(n)){if(l=fe(["stretchy",n],[],i),n==="fbox"){var d=i.color&&i.getColor();d&&(l.style.borderColor=d)}}else{var p=[];/^[bx]cancel$/.test(n)&&p.push(new vg({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(n)&&p.push(new vg({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var h=new Ts(p,{width:"100%",height:we(c)});l=Ei([],[h],i)}return l.height=c,l.style.height=we(c),l},UN={bin:1,close:1,inner:1,open:1,punct:1,rel:1},GN={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function qN(t){return t in UN}function pt(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 Rp(t){var e=Dp(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 Dp(t){return t&&(t.type==="atom"||GN.hasOwnProperty(t.type))?t:null}var $5=t=>{if(t instanceof Ia)return t;if(yN(t)&&t.children.length===1)return $5(t.children[0])},O1=(t,e)=>{var n,a,r;t&&t.type==="supsub"?(a=pt(t.base,"accent"),n=a.base,t.base=n,r=gN(Nt(t,e)),t.base=a):(a=pt(t,"accent"),n=a.base);var i=Nt(n,e.havingCrampedStyle()),l=a.isShifty&&Es(n),c=0;if(l){var d,p;c=(d=(p=$5(i))==null?void 0:p.skew)!=null?d:0}var h=a.label==="\\c",m=h?i.height+i.depth:Math.min(i.height,e.fontMetrics().xHeight),b;if(a.isStretchy)b=Np(a,e),b=Et({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:b,wrapperClasses:["svg-align"],wrapperStyle:c>0?{width:"calc(100% - "+we(2*c)+")",marginLeft:we(2*c)}:void 0}]});else{var x,w;a.label==="\\vec"?(x=O5("vec",e),w=M5.vec[1]):(x=Tp({mode:a.mode,text:a.label},e,"textord"),x=mN(x),x.italic=0,w=x.width,h&&(m+=x.depth)),b=fe(["accent-body"],[x]);var S=a.label==="\\textcircled";S&&(b.classes.push("accent-full"),m=i.height);var C=c;S||(C-=w/2),b.style.left=we(C),a.label==="\\textcircled"&&(b.style.top=".2em"),b=Et({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-m},{type:"elem",elem:b}]})}var E=fe(["mord","accent"],[b],e);return r?(r.children[0]=E,r.height=Math.max(E.height,r.height),r.classes[0]="mord",r):E},F5=(t,e)=>{var n=t.isStretchy?Ep(t.label):new ve("mo",[or(t.label,t.mode)]),a=new ve("mover",[zt(t.base,e),n]);return a.setAttribute("accent","true"),a},VN=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));Ae({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=np(e[0]),a=!VN.test(t.funcName),r=!a||t.funcName==="\\widehat"||t.funcName==="\\widetilde"||t.funcName==="\\widecheck";return{type:"accent",mode:t.parser.mode,label:t.funcName,isStretchy:a,isShifty:r,base:n}},htmlBuilder:O1,mathmlBuilder:F5});Ae({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],a=t.parser.mode;return a==="math"&&(t.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+t.funcName+" works only in text mode"),a="text"),{type:"accent",mode:a,label:t.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:O1,mathmlBuilder:F5});Ae({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(t,e)=>{var{parser:n,funcName:a}=t,r=e[0];return{type:"accentUnder",mode:n.mode,label:a,base:r}},htmlBuilder:(t,e)=>{var n=Nt(t.base,e),a=Np(t,e),r=t.label==="\\utilde"?.12:0,i=Et({positionType:"top",positionData:n.height,children:[{type:"elem",elem:a,wrapperClasses:["svg-align"]},{type:"kern",size:r},{type:"elem",elem:n}]});return fe(["mord","accentunder"],[i],e)},mathmlBuilder:(t,e)=>{var n=Ep(t.label),a=new ve("munder",[zt(t.base,e),n]);return a.setAttribute("accentunder","true"),a}});var c0=t=>{var e=new ve("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};Ae({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:a,funcName:r}=t;return{type:"xArrow",mode:a.mode,label:r,body:e[0],below:n[0]}},htmlBuilder(t,e){var n=e.style,a=e.havingStyle(n.sup()),r=Dl(Nt(t.body,a,e),e),i=t.label.slice(0,2)==="\\x"?"x":"cd";r.classes.push(i+"-arrow-pad");var l;t.below&&(a=e.havingStyle(n.sub()),l=Dl(Nt(t.below,a,e),e),l.classes.push(i+"-arrow-pad"));var c=Np(t,e),d=-e.fontMetrics().axisHeight+.5*c.height,p=-e.fontMetrics().axisHeight-.5*c.height-.111;(r.depth>.25||t.label==="\\xleftequilibrium")&&(p-=r.depth);var h;if(l){var m=-e.fontMetrics().axisHeight+l.height+.5*c.height+.111;h=Et({positionType:"individualShift",children:[{type:"elem",elem:r,shift:p},{type:"elem",elem:c,shift:d,wrapperClasses:["svg-align"]},{type:"elem",elem:l,shift:m}]})}else h=Et({positionType:"individualShift",children:[{type:"elem",elem:r,shift:p},{type:"elem",elem:c,shift:d,wrapperClasses:["svg-align"]}]});return fe(["mrel","x-arrow"],[h],e)},mathmlBuilder(t,e){var n=Ep(t.label);n.setAttribute("minsize",t.label.charAt(0)==="x"?"1.75em":"3.0em");var a;if(t.body){var r=c0(zt(t.body,e));if(t.below){var i=c0(zt(t.below,e));a=new ve("munderover",[n,i,r])}else a=new ve("mover",[n,r])}else if(t.below){var l=c0(zt(t.below,e));a=new ve("munder",[n,l])}else a=c0(),a=new ve("mover",[n,a]);return a}});function H5(t,e){var n=En(t.body,e,!0);return fe([t.mclass],n,e)}function U5(t,e){var n,a=za(t.body,e);return t.mclass==="minner"?n=new ve("mpadded",a):t.mclass==="mord"?t.isCharacterBox?(n=a[0],n.type="mi"):n=new ve("mi",a):(t.isCharacterBox?(n=a[0],n.type="mo"):n=new ve("mo",a),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}Ae({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(t,e){var{parser:n,funcName:a}=t,r=e[0];return{type:"mclass",mode:n.mode,mclass:"m"+a.slice(5),body:bn(r),isCharacterBox:Es(r)}},htmlBuilder:H5,mathmlBuilder:U5});var Mp=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"};Ae({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(t,e){var{parser:n}=t;return{type:"mclass",mode:n.mode,mclass:Mp(e[0]),body:bn(e[1]),isCharacterBox:Es(e[1])}}});Ae({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(t,e){var{parser:n,funcName:a}=t,r=e[1],i=e[0],l;a!=="\\stackrel"?l=Mp(r):l="mrel";var c={type:"op",mode:r.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:a!=="\\stackrel",body:bn(r)},d={type:"supsub",mode:i.mode,base:c,sup:a==="\\underset"?null:i,sub:a==="\\underset"?i:null};return{type:"mclass",mode:n.mode,mclass:l,body:[d],isCharacterBox:Es(d)}},htmlBuilder:H5,mathmlBuilder:U5});Ae({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:n}=t;return{type:"pmb",mode:n.mode,mclass:Mp(e[0]),body:bn(e[0])}},htmlBuilder(t,e){var n=En(t.body,e,!0),a=fe([t.mclass],n,e);return a.style.textShadow="0.02em 0.01em 0.04px",a},mathmlBuilder(t,e){var n=za(t.body,e),a=new ve("mstyle",n);return a.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),a}});var WN={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},l2=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),c2=t=>t.type==="textord"&&t.text==="@",KN=(t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e;function YN(t,e,n){var a=WN[t];switch(a){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(a,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var r=n.callFunction("\\\\cdleft",[e[0]],[]),i={type:"atom",text:a,mode:"math",family:"rel"},l=n.callFunction("\\Big",[i],[]),c=n.callFunction("\\\\cdright",[e[1]],[]),d={type:"ordgroup",mode:"math",body:[r,l,c]};return n.callFunction("\\\\cdparent",[d],[])}case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var p={type:"textord",text:"\\Vert",mode:"math"};return n.callFunction("\\Big",[p],[])}default:return{type:"textord",text:" ",mode:"math"}}}function ZN(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 be("Expected \\\\ or \\cr or \\end",t.nextToken)}for(var a=[],r=[a],i=0;i<e.length;i++){for(var l=e[i],c=l2(),d=0;d<l.length;d++)if(!c2(l[d]))c.body.push(l[d]);else{a.push(c),d+=1;var p=Rp(l[d]).text,h=new Array(2);if(h[0]={type:"ordgroup",mode:"math",body:[]},h[1]={type:"ordgroup",mode:"math",body:[]},!"=|.".includes(p))if("<>AV".includes(p))for(var m=0;m<2;m++){for(var b=!0,x=d+1;x<l.length;x++){if(KN(l[x],p)){b=!1,d=x;break}if(c2(l[x]))throw new be("Missing a "+p+" character to complete a CD arrow.",l[x]);h[m].body.push(l[x])}if(b)throw new be("Missing a "+p+" character to complete a CD arrow.",l[d])}else throw new be('Expected one of "<>AV=|." after @',l[d]);var w=YN(p,h,t),S={type:"styling",body:[w],mode:"math",style:"display",resetFont:!0};a.push(S),c=l2()}i%2===0?a.push(c):a.shift(),a=[],r.push(a)}t.gullet.endGroup(),t.gullet.endGroup();var C=new Array(r[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:r,arraystretch:1,addJot:!0,rowGaps:[null],cols:C,colSeparationType:"CD",hLinesBeforeRow:new Array(r.length+1).fill([])}}Ae({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(t,e){var{parser:n,funcName:a}=t;return{type:"cdlabel",mode:n.mode,side:a.slice(4),label:e[0]}},htmlBuilder(t,e){var n=e.havingStyle(e.style.sup()),a=Dl(Nt(t.label,n,e),e);return a.classes.push("cd-label-"+t.side),a.style.bottom=we(.8-a.depth),a.height=0,a.depth=0,a},mathmlBuilder(t,e){var n=new ve("mrow",[zt(t.label,e)]);return n=new ve("mpadded",[n]),n.setAttribute("width","0"),t.side==="left"&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),n=new ve("mstyle",[n]),n.setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}});Ae({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=Dl(Nt(t.fragment,e),e);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder(t,e){return new ve("mrow",[zt(t.fragment,e)])}});Ae({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(t,e){for(var{parser:n}=t,a=pt(e[0],"ordgroup"),r=a.body,i="",l=0;l<r.length;l++){var c=pt(r[l],"textord");i+=c.text}var d=parseInt(i),p;if(isNaN(d))throw new be("\\@char has non-numeric argument "+i);if(d<0||d>=1114111)throw new be("\\@char with invalid code point "+i);return d<=65535?p=String.fromCharCode(d):(d-=65536,p=String.fromCharCode((d>>10)+55296,(d&1023)+56320)),{type:"textord",mode:n.mode,text:p}}});var G5=(t,e)=>{var n=En(t.body,e.withColor(t.color),!1);return Rs(n)},q5=(t,e)=>{var n=za(t.body,e.withColor(t.color)),a=new ve("mstyle",n);return a.setAttribute("mathcolor",t.color),a};Ae({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(t,e){var{parser:n}=t,a=pt(e[0],"color-token").color,r=e[1];return{type:"color",mode:n.mode,color:a,body:bn(r)}},htmlBuilder:G5,mathmlBuilder:q5});Ae({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(t,e){var{parser:n,breakOnTokenText:a}=t,r=pt(e[0],"color-token").color;n.gullet.macros.set("\\current@color",r);var i=n.parseExpression(!0,a);return{type:"color",mode:n.mode,color:r,body:i}},htmlBuilder:G5,mathmlBuilder:q5});Ae({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(t,e,n){var{parser:a}=t,r=a.gullet.future().text==="["?a.parseSizeGroup(!0):null,i=!a.settings.displayMode||!a.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:a.mode,newLine:i,size:r&&pt(r,"size").value}},htmlBuilder(t,e){var n=fe(["mspace"],[],e);return t.newLine&&(n.classes.push("newline"),t.size&&(n.style.marginTop=we(Yt(t.size,e)))),n},mathmlBuilder(t,e){var n=new ve("mspace");return t.newLine&&(n.setAttribute("linebreak","newline"),t.size&&n.setAttribute("height",we(Yt(t.size,e)))),n}});var Rg={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},V5=t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new be("Expected a control sequence",t);return e},XN=t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},W5=(t,e,n,a)=>{var r=t.gullet.macros.get(n.text);r==null&&(n.noexpand=!0,r={tokens:[n],numArgs:0,unexpandable:!t.gullet.isExpandable(n.text)}),t.gullet.macros.set(e,r,a)};Ae({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(t){var{parser:e,funcName:n}=t;e.consumeSpaces();var a=e.fetch();if(Rg[a.text])return(n==="\\global"||n==="\\\\globallong")&&(a.text=Rg[a.text]),pt(e.parseFunction(),"internal");throw new be("Invalid token after macro prefix",a)}});Ae({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:n}=t,a=e.gullet.popToken(),r=a.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(r))throw new be("Expected a control sequence",a);for(var i=0,l,c=[[]];e.gullet.future().text!=="{";)if(a=e.gullet.popToken(),a.text==="#"){if(e.gullet.future().text==="{"){l=e.gullet.future(),c[i].push("{");break}if(a=e.gullet.popToken(),!/^[1-9]$/.test(a.text))throw new be('Invalid argument number "'+a.text+'"');if(parseInt(a.text)!==i+1)throw new be('Argument number "'+a.text+'" out of order');i++,c.push([])}else{if(a.text==="EOF")throw new be("Expected a macro definition");c[i].push(a.text)}var{tokens:d}=e.gullet.consumeArg();return l&&d.unshift(l),(n==="\\edef"||n==="\\xdef")&&(d=e.gullet.expandTokens(d),d.reverse()),e.gullet.macros.set(r,{tokens:d,numArgs:i,delimiters:c},n===Rg[n]),{type:"internal",mode:e.mode}}});Ae({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:n}=t,a=V5(e.gullet.popToken());e.gullet.consumeSpaces();var r=XN(e);return W5(e,a,r,n==="\\\\globallet"),{type:"internal",mode:e.mode}}});Ae({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:n}=t,a=V5(e.gullet.popToken()),r=e.gullet.popToken(),i=e.gullet.popToken();return W5(e,a,i,n==="\\\\globalfuture"),e.gullet.pushToken(i),e.gullet.pushToken(r),{type:"internal",mode:e.mode}}});var qc=function(e,n,a){var r=qt.math[e]&&qt.math[e].replace,i=E1(r||e,n,a);if(!i)throw new Error("Unsupported symbol "+e+" and font size "+n+".");return i},L1=function(e,n,a,r){var i=a.havingBaseStyle(n),l=fe(r.concat(i.sizingClasses(a)),[e],a),c=i.sizeMultiplier/a.sizeMultiplier;return l.height*=c,l.depth*=c,l.maxFontSize=i.sizeMultiplier,l},K5=function(e,n,a){var r=n.havingBaseStyle(a),i=(1-n.sizeMultiplier/r.sizeMultiplier)*n.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=we(i),e.height-=i,e.depth+=i},QN=function(e,n,a,r,i,l){var c=aa(e,"Main-Regular",i,r),d=L1(c,n,r,l);return K5(d,r,n),d},JN=function(e,n,a,r){return aa(e,"Size"+n+"-Regular",a,r)},Y5=function(e,n,a,r,i,l){var c=JN(e,n,i,r),d=L1(fe(["delimsizing","size"+n],[c],r),nt.TEXT,r,l);return a&&K5(d,r,nt.TEXT),d},mm=function(e,n,a){var r;n==="Size1-Regular"?r="delim-size1":r="delim-size4";var i=fe(["delimsizinginner",r],[fe([],[aa(e,n,a)])]);return{type:"elem",elem:i}},gm=function(e,n,a){var r=zr["Size4-Regular"][e.charCodeAt(0)]?zr["Size4-Regular"][e.charCodeAt(0)][4]:zr["Size1-Regular"][e.charCodeAt(0)][4],i=new Ti("inner",lN(e,Math.round(1e3*n))),l=new Ts([i],{width:we(r),height:we(n),style:"width:"+we(r),viewBox:"0 0 "+1e3*r+" "+Math.round(1e3*n),preserveAspectRatio:"xMinYMin"}),c=Ei([],[l],a);return c.height=n,c.style.height=we(n),c.style.width=we(r),{type:"elem",elem:c}},Dg=.008,u0={type:"kern",size:-1*Dg},eR=new Set(["|","\\lvert","\\rvert","\\vert"]),tR=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),Z5=function(e,n,a,r,i,l){var c,d,p,h,m="",b=0;c=p=h=e,d=null;var x="Size1-Regular";e==="\\uparrow"?p=h="⏐":e==="\\Uparrow"?p=h="‖":e==="\\downarrow"?c=p="⏐":e==="\\Downarrow"?c=p="‖":e==="\\updownarrow"?(c="\\uparrow",p="⏐",h="\\downarrow"):e==="\\Updownarrow"?(c="\\Uparrow",p="‖",h="\\Downarrow"):eR.has(e)?(p="∣",m="vert",b=333):tR.has(e)?(p="∥",m="doublevert",b=556):e==="["||e==="\\lbrack"?(c="⎡",p="⎢",h="⎣",x="Size4-Regular",m="lbrack",b=667):e==="]"||e==="\\rbrack"?(c="⎤",p="⎥",h="⎦",x="Size4-Regular",m="rbrack",b=667):e==="\\lfloor"||e==="⌊"?(p=c="⎢",h="⎣",x="Size4-Regular",m="lfloor",b=667):e==="\\lceil"||e==="⌈"?(c="⎡",p=h="⎢",x="Size4-Regular",m="lceil",b=667):e==="\\rfloor"||e==="⌋"?(p=c="⎥",h="⎦",x="Size4-Regular",m="rfloor",b=667):e==="\\rceil"||e==="⌉"?(c="⎤",p=h="⎥",x="Size4-Regular",m="rceil",b=667):e==="("||e==="\\lparen"?(c="⎛",p="⎜",h="⎝",x="Size4-Regular",m="lparen",b=875):e===")"||e==="\\rparen"?(c="⎞",p="⎟",h="⎠",x="Size4-Regular",m="rparen",b=875):e==="\\{"||e==="\\lbrace"?(c="⎧",d="⎨",h="⎩",p="⎪",x="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(c="⎫",d="⎬",h="⎭",p="⎪",x="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(c="⎧",h="⎩",p="⎪",x="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(c="⎫",h="⎭",p="⎪",x="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(c="⎧",h="⎭",p="⎪",x="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(c="⎫",h="⎩",p="⎪",x="Size4-Regular");var w=qc(c,x,i),S=w.height+w.depth,C=qc(p,x,i),E=C.height+C.depth,T=qc(h,x,i),L=T.height+T.depth,D=0,B=1;if(d!==null){var H=qc(d,x,i);D=H.height+H.depth,B=2}var K=S+L+D,U=Math.max(0,Math.ceil((n-K)/(B*E))),q=K+U*B*E,re=r.fontMetrics().axisHeight;a&&(re*=r.sizeMultiplier);var _e=q/2-re,G=[];if(m.length>0){var me=q-S-L,ge=Math.round(q*1e3),ye=cN(m,Math.round(me*1e3)),P=new Ti(m,ye),oe=we(b/1e3),he=we(ge/1e3),ke=new Ts([P],{width:oe,height:he,viewBox:"0 0 "+b+" "+ge}),Be=Ei([],[ke],r);Be.height=ge/1e3,Be.style.width=oe,Be.style.height=he,G.push({type:"elem",elem:Be})}else{if(G.push(mm(h,x,i)),G.push(u0),d===null){var Pe=q-S-L+2*Dg;G.push(gm(p,Pe,r))}else{var He=(q-S-L-D)/2+2*Dg;G.push(gm(p,He,r)),G.push(u0),G.push(mm(d,x,i)),G.push(u0),G.push(gm(p,He,r))}G.push(u0),G.push(mm(c,x,i))}var $e=r.havingBaseStyle(nt.TEXT),ft=Et({positionType:"bottom",positionData:_e,children:G});return L1(fe(["delimsizing","mult"],[ft],$e),nt.TEXT,r,l)},ym=80,bm=.08,vm=function(e,n,a,r,i){var l=oN(e,r,a),c=new Ti(e,l),d=new Ts([c],{width:"400em",height:we(n),viewBox:"0 0 400000 "+a,preserveAspectRatio:"xMinYMin slice"});return Ei(["hide-tail"],[d],i)},nR=function(e,n){var a=n.havingBaseSizing(),r=t3("\\surd",e*a.sizeMultiplier,e3,a),i=a.sizeMultiplier,l=Math.max(0,n.minRuleThickness-n.fontMetrics().sqrtRuleThickness),c,d,p,h,m;return r.type==="small"?(h=1e3+1e3*l+ym,e<1?i=1:e<1.4&&(i=.7),d=(1+l+bm)/i,p=(1+l)/i,c=vm("sqrtMain",d,h,l,n),c.style.minWidth="0.853em",m=.833/i):r.type==="large"?(h=(1e3+ym)*au[r.size],p=(au[r.size]+l)/i,d=(au[r.size]+l+bm)/i,c=vm("sqrtSize"+r.size,d,h,l,n),c.style.minWidth="1.02em",m=1/i):(d=e+l+bm,p=e+l,h=Math.floor(1e3*e+l)+ym,c=vm("sqrtTall",d,h,l,n),c.style.minWidth="0.742em",m=1.056),c.height=p,c.style.height=we(d),{span:c,advanceWidth:m,ruleWidth:(n.fontMetrics().sqrtRuleThickness+l)*i}},X5=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),aR=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),Q5=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),au=[0,1.2,1.8,2.4,3],J5=function(e,n,a,r,i){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),X5.has(e)||Q5.has(e))return Y5(e,n,!1,a,r,i);if(aR.has(e))return Z5(e,au[n],!1,a,r,i);throw new be("Illegal delimiter: '"+e+"'")},rR=[{type:"small",style:nt.SCRIPTSCRIPT},{type:"small",style:nt.SCRIPT},{type:"small",style:nt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],sR=[{type:"small",style:nt.SCRIPTSCRIPT},{type:"small",style:nt.SCRIPT},{type:"small",style:nt.TEXT},{type:"stack"}],e3=[{type:"small",style:nt.SCRIPTSCRIPT},{type:"small",style:nt.SCRIPT},{type:"small",style:nt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],iR=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";var n=e.type;throw new Error("Add support for delim type '"+n+"' here.")},t3=function(e,n,a,r){for(var i=Math.min(2,3-r.style.size),l=i;l<a.length;l++){var c=a[l];if(c.type==="stack")break;var d=qc(e,iR(c),"math"),p=d.height+d.depth;if(c.type==="small"){var h=r.havingBaseStyle(c.style);p*=h.sizeMultiplier}if(p>n)return c}return a[a.length-1]},Mg=function(e,n,a,r,i,l){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var c;Q5.has(e)?c=rR:X5.has(e)?c=e3:c=sR;var d=t3(e,n,c,r);return d.type==="small"?QN(e,d.style,a,r,i,l):d.type==="large"?Y5(e,d.size,a,r,i,l):Z5(e,n,a,r,i,l)},xm=function(e,n,a,r,i,l){var c=r.fontMetrics().axisHeight*r.sizeMultiplier,d=901,p=5/r.fontMetrics().ptPerEm,h=Math.max(n-c,a+c),m=Math.max(h/500*d,2*h-p);return Mg(e,m,!0,r,i,l)},u2={"\\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}},oR=new Set(["(","\\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 d2(t){return"isMiddle"in t}function Op(t,e){var n=Dp(t);if(n&&oR.has(n.text))return n;throw n?new be("Invalid delimiter '"+n.text+"' after '"+e.funcName+"'",t):new be("Invalid delimiter type '"+t.type+"'",t)}Ae({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=Op(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:u2[t.funcName].size,mclass:u2[t.funcName].mclass,delim:n.text}},htmlBuilder:(t,e)=>t.delim==="."?fe([t.mclass]):J5(t.delim,t.size,e,t.mode,[t.mclass]),mathmlBuilder:t=>{var e=[];t.delim!=="."&&e.push(or(t.delim,t.mode));var n=new ve("mo",e);t.mclass==="mopen"||t.mclass==="mclose"?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var a=we(au[t.size]);return n.setAttribute("minsize",a),n.setAttribute("maxsize",a),n}});function p2(t){if(!t.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Ae({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 be("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:t.parser.mode,delim:Op(e[0],t).text,color:n}}});Ae({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var n=Op(e[0],t),a=t.parser;++a.leftrightDepth;var r=a.parseExpression(!1);--a.leftrightDepth,a.expect("\\right",!1);var i=pt(a.parseFunction(),"leftright-right");return{type:"leftright",mode:a.mode,body:r,left:n.text,right:i.delim,rightColor:i.color}},htmlBuilder:(t,e)=>{p2(t);for(var n=En(t.body,e,!0,["mopen","mclose"]),a=0,r=0,i=!1,l=0;l<n.length;l++){var c=n[l];d2(c)?i=!0:(a=Math.max(n[l].height,a),r=Math.max(n[l].depth,r))}a*=e.sizeMultiplier,r*=e.sizeMultiplier;var d;if(t.left==="."?d=bu(e,["mopen"]):d=xm(t.left,a,r,e,t.mode,["mopen"]),n.unshift(d),i)for(var p=1;p<n.length;p++){var h=n[p];if(d2(h)){var m=h.isMiddle;n[p]=xm(m.delim,a,r,m.options,t.mode,[])}}var b;if(t.right===".")b=bu(e,["mclose"]);else{var x=t.rightColor?e.withColor(t.rightColor):e;b=xm(t.right,a,r,x,t.mode,["mclose"])}return n.push(b),fe(["minner"],n,e)},mathmlBuilder:(t,e)=>{p2(t);var n=za(t.body,e);if(t.left!=="."){var a=new ve("mo",[or(t.left,t.mode)]);a.setAttribute("fence","true"),n.unshift(a)}if(t.right!=="."){var r=new ve("mo",[or(t.right,t.mode)]);r.setAttribute("fence","true"),t.rightColor&&r.setAttribute("mathcolor",t.rightColor),n.push(r)}return D1(n)}});Ae({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var n=Op(e[0],t);if(!t.parser.leftrightDepth)throw new be("\\middle without preceding \\left",n);return{type:"middle",mode:t.parser.mode,delim:n.text}},htmlBuilder:(t,e)=>{var n;return t.delim==="."?n=bu(e,[]):(n=J5(t.delim,1,e,t.mode,[]),n.isMiddle={delim:t.delim,options:e}),n},mathmlBuilder:(t,e)=>{var n=t.delim==="\\vert"||t.delim==="|"?or("|","text"):or(t.delim,t.mode),a=new ve("mo",[n]);return a.setAttribute("fence","true"),a.setAttribute("lspace","0.05em"),a.setAttribute("rspace","0.05em"),a}});var Lp=(t,e)=>{var n=Dl(Nt(t.body,e),e),a=t.label.slice(1),r=e.sizeMultiplier,i,l,c=Es(t.body);if(a==="sout")i=fe(["stretchy","sout"]),i.height=e.fontMetrics().defaultRuleThickness/r,l=-.5*e.fontMetrics().xHeight;else if(a==="phase"){var d=Yt({number:.6,unit:"pt"},e),p=Yt({number:.35,unit:"ex"},e),h=e.havingBaseSizing();r=r/h.sizeMultiplier;var m=n.height+n.depth+d+p;n.style.paddingLeft=we(m/2+d);var b=Math.floor(1e3*m*r),x=sN(b),w=new Ts([new Ti("phase",x)],{width:"400em",height:we(b/1e3),viewBox:"0 0 400000 "+b,preserveAspectRatio:"xMinYMin slice"});i=Ei(["hide-tail"],[w],e),i.style.height=we(m),l=n.depth+d+p}else{/cancel/.test(a)?c||n.classes.push("cancel-pad"):a==="angl"?n.classes.push("anglpad"):n.classes.push("boxpad");var S,C,E=0;/box/.test(a)?(E=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),S=e.fontMetrics().fboxsep+(a==="colorbox"?0:E),C=S):a==="angl"?(E=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),S=4*E,C=Math.max(0,.25-n.depth)):(S=c?.2:0,C=S),i=HN(n,a,S,C,e),/fbox|boxed|fcolorbox/.test(a)?(i.style.borderStyle="solid",i.style.borderWidth=we(E)):a==="angl"&&E!==.049&&(i.style.borderTopWidth=we(E),i.style.borderRightWidth=we(E)),l=n.depth+C,t.backgroundColor&&(i.style.backgroundColor=t.backgroundColor,t.borderColor&&(i.style.borderColor=t.borderColor))}var T;if(t.backgroundColor)T=Et({positionType:"individualShift",children:[{type:"elem",elem:i,shift:l},{type:"elem",elem:n,shift:0}]});else{var L=/cancel|phase/.test(a)?["svg-align"]:[];T=Et({positionType:"individualShift",children:[{type:"elem",elem:n,shift:0},{type:"elem",elem:i,shift:l,wrapperClasses:L}]})}return/cancel/.test(a)&&(T.height=n.height,T.depth=n.depth),/cancel/.test(a)&&!c?fe(["mord","cancel-lap"],[T],e):fe(["mord"],[T],e)},jp=(t,e)=>{var n,a=new ve(t.label.includes("colorbox")?"mpadded":"menclose",[zt(t.body,e)]);switch(t.label){case"\\cancel":a.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":a.setAttribute("notation","downdiagonalstrike");break;case"\\phase":a.setAttribute("notation","phasorangle");break;case"\\sout":a.setAttribute("notation","horizontalstrike");break;case"\\fbox":a.setAttribute("notation","box");break;case"\\angl":a.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,a.setAttribute("width","+"+2*n+"pt"),a.setAttribute("height","+"+2*n+"pt"),a.setAttribute("lspace",n+"pt"),a.setAttribute("voffset",n+"pt"),t.label==="\\fcolorbox"){var r=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);a.setAttribute("style","border: "+we(r)+" solid "+t.borderColor)}break;case"\\xcancel":a.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return t.backgroundColor&&a.setAttribute("mathbackground",t.backgroundColor),a};Ae({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(t,e,n){var{parser:a,funcName:r}=t,i=pt(e[0],"color-token").color,l=e[1];return{type:"enclose",mode:a.mode,label:r,backgroundColor:i,body:l}},htmlBuilder:Lp,mathmlBuilder:jp});Ae({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(t,e,n){var{parser:a,funcName:r}=t,i=pt(e[0],"color-token").color,l=pt(e[1],"color-token").color,c=e[2];return{type:"enclose",mode:a.mode,label:r,backgroundColor:l,borderColor:i,body:c}},htmlBuilder:Lp,mathmlBuilder:jp});Ae({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]}}});Ae({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(t,e){var{parser:n,funcName:a}=t,r=e[0];return{type:"enclose",mode:n.mode,label:a,body:r}},htmlBuilder:Lp,mathmlBuilder:jp});Ae({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:n,funcName:a}=t;n.mode==="math"&&n.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var r=e[0];return{type:"enclose",mode:n.mode,label:a,body:r}},htmlBuilder:Lp,mathmlBuilder:jp});Ae({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 n3={};function Hr(t){for(var{type:e,names:n,props:a,handler:r,htmlBuilder:i,mathmlBuilder:l}=t,c={type:e,numArgs:a.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:r},d=0;d<n.length;++d)n3[n[d]]=c;i&&(ep[e]=i),l&&(tp[e]=l)}var a3={};function O(t,e){a3[t]=e}class va{constructor(e,n,a){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=n,this.end=a}static range(e,n){return n?!e||!e.loc||!n.loc||e.loc.lexer!==n.loc.lexer?null:new va(e.loc.lexer,e.loc.start,n.loc.end):e&&e.loc}}class Ba{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 Ba(n,va.range(this,e))}}function f2(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 Bp=t=>{var e=t.parser.settings;if(!e.displayMode)throw new be("{"+t.envName+"} can be used only in display mode.")},lR=new Set(["gather","gather*"]);function j1(t){if(!t.includes("ed"))return!t.includes("*")}function Di(t,e,n){var{hskipBeforeAndAfter:a,addJot:r,cols:i,arraystretch:l,colSeparationType:c,autoTag:d,singleRow:p,emptySingleRow:h,maxNumCols:m,leqno:b}=e;if(t.gullet.beginGroup(),p||t.gullet.macros.set("\\cr","\\\\\\relax"),!l){var x=t.gullet.expandMacroAsText("\\arraystretch");if(x==null)l=1;else if(l=parseFloat(x),!l||l<0)throw new be("Invalid \\arraystretch: "+x)}t.gullet.beginGroup();var w=[],S=[w],C=[],E=[],T=d!=null?[]:void 0;function L(){d&&t.gullet.macros.set("\\@eqnsw","1",!0)}function D(){T&&(t.gullet.macros.get("\\df@tag")?(T.push(t.subparse([new Ba("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):T.push(!!d&&t.gullet.macros.get("\\@eqnsw")==="1"))}for(L(),E.push(f2(t));;){var B=t.parseExpression(!1,p?"\\end":"\\\\");t.gullet.endGroup(),t.gullet.beginGroup();var H={type:"ordgroup",mode:t.mode,body:B};n&&(H={type:"styling",mode:t.mode,style:n,resetFont:!0,body:[H]}),w.push(H);var K=t.fetch().text;if(K==="&"){if(m&&w.length===m){if(p||c)throw new be("Too many tab characters: &",t.nextToken);t.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}t.consume()}else if(K==="\\end"){D(),w.length===1&&H.type==="styling"&&H.body.length===1&&H.body[0].type==="ordgroup"&&H.body[0].body.length===0&&(S.length>1||!h)&&S.pop(),E.length<S.length+1&&E.push([]);break}else if(K==="\\\\"){t.consume();var U=void 0;t.gullet.future().text!==" "&&(U=t.parseSizeGroup(!0)),C.push(U?U.value:null),D(),E.push(f2(t)),w=[],S.push(w),L()}else throw new be("Expected & or \\\\ or \\cr or \\end",t.nextToken)}return t.gullet.endGroup(),t.gullet.endGroup(),{type:"array",mode:t.mode,addJot:r,arraystretch:l,body:S,cols:i,rowGaps:C,hskipBeforeAndAfter:a,hLinesBeforeRow:E,colSeparationType:c,tags:T,leqno:b}}function B1(t){return t.slice(0,1)==="d"?"display":"text"}var Ur=function(e,n){var a,r,i=e.body.length,l=e.hLinesBeforeRow,c=0,d=new Array(i),p=[],h=Math.max(n.fontMetrics().arrayRuleWidth,n.minRuleThickness),m=1/n.fontMetrics().ptPerEm,b=5*m;if(e.colSeparationType&&e.colSeparationType==="small"){var x=n.havingStyle(nt.SCRIPT).sizeMultiplier;b=.2778*(x/n.sizeMultiplier)}var w=e.colSeparationType==="CD"?Yt({number:3,unit:"ex"},n):12*m,S=3*m,C=e.arraystretch*w,E=.7*C,T=.3*C,L=0;function D(Yn){for(var Ua=0;Ua<Yn.length;++Ua)Ua>0&&(L+=.25),p.push({pos:L,isDashed:Yn[Ua]})}for(D(l[0]),a=0;a<e.body.length;++a){var B=e.body[a],H=E,K=T;c<B.length&&(c=B.length);var U={cells:new Array(B.length),height:0,depth:0,pos:0};for(r=0;r<B.length;++r){var q=Nt(B[r],n);K<q.depth&&(K=q.depth),H<q.height&&(H=q.height),U.cells[r]=q}var re=e.rowGaps[a],_e=0;re&&(_e=Yt(re,n),_e>0&&(_e+=T,K<_e&&(K=_e),_e=0)),e.addJot&&a<e.body.length-1&&(K+=S),U.height=H,U.depth=K,L+=H,U.pos=L,L+=K+_e,d[a]=U,D(l[a+1])}var G=L/2+n.fontMetrics().axisHeight,me=e.cols||[],ge=[],ye,P,oe=[];if(e.tags&&e.tags.some(Yn=>Yn))for(a=0;a<i;++a){var he=d[a],ke=he.pos-G,Be=e.tags[a],Pe=void 0;Be===!0?Pe=fe(["eqn-num"],[],n):Be===!1?Pe=fe([],[],n):Pe=fe([],En(Be,n,!0),n),Pe.depth=he.depth,Pe.height=he.height,oe.push({type:"elem",elem:Pe,shift:ke})}for(r=0,P=0;r<c||P<me.length;++r,++P){for(var He,$e=me[P],ft=!0;((tn=$e)==null?void 0:tn.type)==="separator";){var tn;if(ft||(ye=fe(["arraycolsep"],[]),ye.style.width=we(n.fontMetrics().doubleRuleSep),ge.push(ye)),$e.separator==="|"||$e.separator===":"){var Kn=$e.separator==="|"?"solid":"dashed",Dn=fe(["vertical-separator"],[],n);Dn.style.height=we(L),Dn.style.borderRightWidth=we(h),Dn.style.borderRightStyle=Kn,Dn.style.margin="0 "+we(-h/2);var Un=L-G;Un&&(Dn.style.verticalAlign=we(-Un)),ge.push(Dn)}else throw new be("Invalid separator type: "+$e.separator);P++,$e=me[P],ft=!1}if(!(r>=c)){var Ye=void 0;if(r>0||e.hskipBeforeAndAfter){var cn,oa;Ye=(cn=(oa=$e)==null?void 0:oa.pregap)!=null?cn:b,Ye!==0&&(ye=fe(["arraycolsep"],[]),ye.style.width=we(Ye),ge.push(ye))}var la=[];for(a=0;a<i;++a){var $a=d[a],un=$a.cells[r];if(un){var Le=$a.pos-G;un.depth=$a.depth,un.height=$a.height,la.push({type:"elem",elem:un,shift:Le})}}var cr=Et({positionType:"individualShift",children:la}),ca=fe(["col-align-"+(((He=$e)==null?void 0:He.align)||"c")],[cr]);if(ge.push(ca),r<c-1||e.hskipBeforeAndAfter){var wr,Sa;Ye=(wr=(Sa=$e)==null?void 0:Sa.postgap)!=null?wr:b,Ye!==0&&(ye=fe(["arraycolsep"],[]),ye.style.width=we(Ye),ge.push(ye))}}}var _a=fe(["mtable"],ge);if(p.length>0){for(var kr=Rl("hline",n,h),ur=Rl("hdashline",n,h),Fa=[{type:"elem",elem:_a,shift:0}];p.length>0;){var It=p.pop(),Ha=It.pos-G;It.isDashed?Fa.push({type:"elem",elem:ur,shift:Ha}):Fa.push({type:"elem",elem:kr,shift:Ha})}_a=Et({positionType:"individualShift",children:Fa})}if(oe.length===0)return fe(["mord"],[_a],n);var Sr=Et({positionType:"individualShift",children:oe}),wn=fe(["tag"],[Sr],n);return Rs([_a,wn])},cR={c:"center ",l:"left ",r:"right "},Gr=function(e,n){for(var a=[],r=new ve("mtd",[],["mtr-glue"]),i=new ve("mtd",[],["mml-eqn-num"]),l=0;l<e.body.length;l++){for(var c=e.body[l],d=[],p=0;p<c.length;p++)d.push(new ve("mtd",[zt(c[p],n)]));e.tags&&e.tags[l]&&(d.unshift(r),d.push(r),e.leqno?d.unshift(i):d.push(i)),a.push(new ve("mtr",d))}var h=new ve("mtable",a),m=e.arraystretch===.5?.1:.16+e.arraystretch-1+(e.addJot?.09:0);h.setAttribute("rowspacing",we(m));var b="",x="";if(e.cols&&e.cols.length>0){var w=e.cols,S="",C=!1,E=0,T=w.length;w[0].type==="separator"&&(b+="top ",E=1),w[w.length-1].type==="separator"&&(b+="bottom ",T-=1);for(var L=E;L<T;L++){var D=w[L];D.type==="align"?(x+=cR[D.align],C&&(S+="none "),C=!0):D.type==="separator"&&C&&(S+=D.separator==="|"?"solid ":"dashed ",C=!1)}h.setAttribute("columnalign",x.trim()),/[sd]/.test(S)&&h.setAttribute("columnlines",S.trim())}if(e.colSeparationType==="align"){for(var B=e.cols||[],H="",K=1;K<B.length;K++)H+=K%2?"0em ":"1em ";h.setAttribute("columnspacing",H.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 U="",q=e.hLinesBeforeRow;b+=q[0].length>0?"left ":"",b+=q[q.length-1].length>0?"right ":"";for(var re=1;re<q.length-1;re++)U+=q[re].length===0?"none ":q[re][0]?"dashed ":"solid ";return/[sd]/.test(U)&&h.setAttribute("rowlines",U.trim()),b!==""&&(h=new ve("menclose",[h]),h.setAttribute("notation",b.trim())),e.arraystretch&&e.arraystretch<1&&(h=new ve("mstyle",[h]),h.setAttribute("scriptlevel","1")),h},r3=function(e,n){e.envName.includes("ed")||Bp(e);var a=[],r=e.envName.includes("at")?"alignat":"align",i=e.envName==="split",l=Di(e.parser,{cols:a,addJot:!0,autoTag:i?void 0:j1(e.envName),emptySingleRow:!0,colSeparationType:r,maxNumCols:i?2:void 0,leqno:e.parser.settings.leqno},"display"),c=0,d=0,p={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 b=pt(n[0].body[m],"textord");h+=b.text}c=Number(h),d=c*2}var x=!d;l.body.forEach(function(E){for(var T=1;T<E.length;T+=2){var L=pt(E[T],"styling"),D=pt(L.body[0],"ordgroup");D.body.unshift(p)}if(x)d<E.length&&(d=E.length);else{var B=E.length/2;if(c<B)throw new be("Too many math in a row: "+("expected "+c+", but got "+B),E[0])}});for(var w=0;w<d;++w){var S="r",C=0;w%2===1?S="l":w>0&&x&&(C=1),a[w]={type:"align",align:S,pregap:C,postgap:0}}return l.colSeparationType=x?"align":"alignat",l};Hr({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var n=Dp(e[0]),a=n?[e[0]]:pt(e[0],"ordgroup").body,r=a.map(function(l){var c=Rp(l),d=c.text;if("lcr".includes(d))return{type:"align",align:d};if(d==="|")return{type:"separator",separator:"|"};if(d===":")return{type:"separator",separator:":"};throw new be("Unknown column alignment: "+d,l)}),i={cols:r,hskipBeforeAndAfter:!0,maxNumCols:r.length};return Di(t.parser,i,B1(t.envName))},htmlBuilder:Ur,mathmlBuilder:Gr});Hr({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",a={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if(t.envName.charAt(t.envName.length-1)==="*"){var r=t.parser;if(r.consumeSpaces(),r.fetch().text==="["){if(r.consume(),r.consumeSpaces(),n=r.fetch().text,!"lcr".includes(n))throw new be("Expected l or c or r",r.nextToken);r.consume(),r.consumeSpaces(),r.expect("]"),r.consume(),a.cols=[{type:"align",align:n}]}}var i=Di(t.parser,a,B1(t.envName)),l=Math.max(0,...i.body.map(c=>c.length));return i.cols=new Array(l).fill({type:"align",align:n}),e?{type:"leftright",mode:t.mode,body:[i],left:e[0],right:e[1],rightColor:void 0}:i},htmlBuilder:Ur,mathmlBuilder:Gr});Hr({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e={arraystretch:.5},n=Di(t.parser,e,"script");return n.colSeparationType="small",n},htmlBuilder:Ur,mathmlBuilder:Gr});Hr({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var n=Dp(e[0]),a=n?[e[0]]:pt(e[0],"ordgroup").body,r=a.map(function(c){var d=Rp(c),p=d.text;if("lc".includes(p))return{type:"align",align:p};throw new be("Unknown column alignment: "+p,c)});if(r.length>1)throw new be("{subarray} can contain only one column");var i={cols:r,hskipBeforeAndAfter:!1,arraystretch:.5},l=Di(t.parser,i,"script");if(l.body.length>0&&l.body[0].length>1)throw new be("{subarray} can contain only one column");return l},htmlBuilder:Ur,mathmlBuilder:Gr});Hr({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=Di(t.parser,e,B1(t.envName));return{type:"leftright",mode:t.mode,body:[n],left:t.envName.includes("r")?".":"\\{",right:t.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:Ur,mathmlBuilder:Gr});Hr({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:r3,htmlBuilder:Ur,mathmlBuilder:Gr});Hr({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){lR.has(t.envName)&&Bp(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:j1(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return Di(t.parser,e,"display")},htmlBuilder:Ur,mathmlBuilder:Gr});Hr({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:r3,htmlBuilder:Ur,mathmlBuilder:Gr});Hr({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){Bp(t);var e={autoTag:j1(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return Di(t.parser,e,"display")},htmlBuilder:Ur,mathmlBuilder:Gr});Hr({type:"array",names:["CD"],props:{numArgs:0},handler(t){return Bp(t),ZN(t.parser)},htmlBuilder:Ur,mathmlBuilder:Gr});O("\\nonumber","\\gdef\\@eqnsw{0}");O("\\notag","\\nonumber");Ae({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(t,e){throw new be(t.funcName+" valid only within array environment")}});var h2=n3;Ae({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(t,e){var{parser:n,funcName:a}=t,r=e[0];if(r.type!=="ordgroup")throw new be("Invalid environment name",r);for(var i="",l=0;l<r.body.length;++l)i+=pt(r.body[l],"textord").text;if(a==="\\begin"){if(!h2.hasOwnProperty(i))throw new be("No such environment: "+i,r);var c=h2[i],{args:d,optArgs:p}=n.parseArguments("\\begin{"+i+"}",c),h={mode:n.mode,envName:i,parser:n},m=c.handler(h,d,p);n.expect("\\end",!1);var b=n.nextToken,x=pt(n.parseFunction(),"environment");if(x.name!==i)throw new be("Mismatch: \\begin{"+i+"} matched by \\end{"+x.name+"}",b);return m}return{type:"environment",mode:n.mode,name:i,nameGroup:r}}});var s3=(t,e)=>{var n=t.font,a=e.withFont(n);return Nt(t.body,a)},i3=(t,e)=>{var n=t.font,a=e.withFont(n);return zt(t.body,a)},m2={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};Ae({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:a}=t,r=np(e[0]),i=a;return i in m2&&(i=m2[i]),{type:"font",mode:n.mode,font:i.slice(1),body:r}},htmlBuilder:s3,mathmlBuilder:i3});Ae({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(t,e)=>{var{parser:n}=t,a=e[0];return{type:"mclass",mode:n.mode,mclass:Mp(a),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:a}],isCharacterBox:Es(a)}}});Ae({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{parser:n,funcName:a,breakOnTokenText:r}=t,{mode:i}=n,l=n.parseExpression(!0,r);return{type:"font",mode:i,font:"math"+a.slice(1),body:{type:"ordgroup",mode:n.mode,body:l}}},htmlBuilder:s3,mathmlBuilder:i3});var uR=(t,e)=>{var n=e.style,a=n.fracNum(),r=n.fracDen(),i;i=e.havingStyle(a);var l=Nt(t.numer,i,e);if(t.continued){var c=8.5/e.fontMetrics().ptPerEm,d=3.5/e.fontMetrics().ptPerEm;l.height=l.height<c?c:l.height,l.depth=l.depth<d?d:l.depth}i=e.havingStyle(r);var p=Nt(t.denom,i,e),h,m,b;t.hasBarLine?(t.barSize?(m=Yt(t.barSize,e),h=Rl("frac-line",e,m)):h=Rl("frac-line",e),m=h.height,b=h.height):(h=null,m=0,b=e.fontMetrics().defaultRuleThickness);var x,w,S;n.size===nt.DISPLAY.size?(x=e.fontMetrics().num1,m>0?w=3*b:w=7*b,S=e.fontMetrics().denom1):(m>0?(x=e.fontMetrics().num2,w=b):(x=e.fontMetrics().num3,w=3*b),S=e.fontMetrics().denom2);var C;if(h){var T=e.fontMetrics().axisHeight;x-l.depth-(T+.5*m)<w&&(x+=w-(x-l.depth-(T+.5*m))),T-.5*m-(p.height-S)<w&&(S+=w-(T-.5*m-(p.height-S)));var L=-(T-.5*m);C=Et({positionType:"individualShift",children:[{type:"elem",elem:p,shift:S},{type:"elem",elem:h,shift:L},{type:"elem",elem:l,shift:-x}]})}else{var E=x-l.depth-(p.height-S);E<w&&(x+=.5*(w-E),S+=.5*(w-E)),C=Et({positionType:"individualShift",children:[{type:"elem",elem:p,shift:S},{type:"elem",elem:l,shift:-x}]})}i=e.havingStyle(n),C.height*=i.sizeMultiplier/e.sizeMultiplier,C.depth*=i.sizeMultiplier/e.sizeMultiplier;var D;n.size===nt.DISPLAY.size?D=e.fontMetrics().delim1:n.size===nt.SCRIPTSCRIPT.size?D=e.havingStyle(nt.SCRIPT).fontMetrics().delim2:D=e.fontMetrics().delim2;var B,H;return t.leftDelim==null?B=bu(e,["mopen"]):B=Mg(t.leftDelim,D,!0,e.havingStyle(n),t.mode,["mopen"]),t.continued?H=fe([]):t.rightDelim==null?H=bu(e,["mclose"]):H=Mg(t.rightDelim,D,!0,e.havingStyle(n),t.mode,["mclose"]),fe(["mord"].concat(i.sizingClasses(e)),[B,fe(["mfrac"],[C]),H],e)},dR=(t,e)=>{var n=new ve("mfrac",[zt(t.numer,e),zt(t.denom,e)]);if(!t.hasBarLine)n.setAttribute("linethickness","0px");else if(t.barSize){var a=Yt(t.barSize,e);n.setAttribute("linethickness",we(a))}if(t.leftDelim!=null||t.rightDelim!=null){var r=[];if(t.leftDelim!=null){var i=new ve("mo",[new vn(t.leftDelim.replace("\\",""))]);i.setAttribute("fence","true"),r.push(i)}if(r.push(n),t.rightDelim!=null){var l=new ve("mo",[new vn(t.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),r.push(l)}return D1(r)}return n},o3=(t,e)=>{if(!e)return t;var n={type:"styling",mode:t.mode,style:e,body:[t]};return n};Ae({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(t,e)=>{var{parser:n,funcName:a}=t,r=e[0],i=e[1],l,c=null,d=null;switch(a){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":l=!0;break;case"\\\\atopfrac":l=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":l=!1,c="(",d=")";break;case"\\\\bracefrac":l=!1,c="\\{",d="\\}";break;case"\\\\brackfrac":l=!1,c="[",d="]";break;default:throw new Error("Unrecognized genfrac command")}var p=a==="\\cfrac",h=null;return p||a.startsWith("\\d")?h="display":a.startsWith("\\t")&&(h="text"),o3({type:"genfrac",mode:n.mode,numer:r,denom:i,continued:p,hasBarLine:l,leftDelim:c,rightDelim:d,barSize:null},h)},htmlBuilder:uR,mathmlBuilder:dR});Ae({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(t){var{parser:e,funcName:n,token:a}=t,r;switch(n){case"\\over":r="\\frac";break;case"\\choose":r="\\binom";break;case"\\atop":r="\\\\atopfrac";break;case"\\brace":r="\\\\bracefrac";break;case"\\brack":r="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:e.mode,replaceWith:r,token:a}}});var g2=["display","text","script","scriptscript"],y2=function(e){var n=null;return e.length>0&&(n=e,n=n==="."?null:n),n};Ae({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(t,e){var{parser:n}=t,a=e[4],r=e[5],i=np(e[0]),l=i.type==="atom"&&i.family==="open"?y2(i.text):null,c=np(e[1]),d=c.type==="atom"&&c.family==="close"?y2(c.text):null,p=pt(e[2],"size"),h,m=null;p.isBlank?h=!0:(m=p.value,h=m.number>0);var b=null,x=e[3];if(x.type==="ordgroup"){if(x.body.length>0){var w=pt(x.body[0],"textord");b=g2[Number(w.text)]}}else x=pt(x,"textord"),b=g2[Number(x.text)];return o3({type:"genfrac",mode:n.mode,numer:a,denom:r,continued:!1,hasBarLine:h,barSize:m,leftDelim:l,rightDelim:d},b)}});Ae({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(t,e){var{parser:n,funcName:a,token:r}=t;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:pt(e[0],"size").value,token:r}}});Ae({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(t,e)=>{var{parser:n,funcName:a}=t,r=e[0],i=pt(e[1],"infix").size;if(!i)throw new Error("\\\\abovefrac expected size, but got "+String(i));var l=e[2],c=i.number>0;return{type:"genfrac",mode:n.mode,numer:r,denom:l,continued:!1,hasBarLine:c,barSize:i,leftDelim:null,rightDelim:null}}});var l3=(t,e)=>{var n=e.style,a,r;t.type==="supsub"?(a=t.sup?Nt(t.sup,e.havingStyle(n.sup()),e):Nt(t.sub,e.havingStyle(n.sub()),e),r=pt(t.base,"horizBrace")):r=pt(t,"horizBrace");var i=Nt(r.base,e.havingBaseStyle(nt.DISPLAY)),l=Np(r,e),c;if(r.isOver?c=Et({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:.1},{type:"elem",elem:l,wrapperClasses:["svg-align"]}]}):c=Et({positionType:"bottom",positionData:i.depth+.1+l.height,children:[{type:"elem",elem:l,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:i}]}),a){var d=fe(["minner",r.isOver?"mover":"munder"],[c],e);r.isOver?c=Et({positionType:"firstBaseline",children:[{type:"elem",elem:d},{type:"kern",size:.2},{type:"elem",elem:a}]}):c=Et({positionType:"bottom",positionData:d.depth+.2+a.height+a.depth,children:[{type:"elem",elem:a},{type:"kern",size:.2},{type:"elem",elem:d}]})}return fe(["minner",r.isOver?"mover":"munder"],[c],e)},pR=(t,e)=>{var n=Ep(t.label);return new ve(t.isOver?"mover":"munder",[zt(t.base,e),n])};Ae({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(t,e){var{parser:n,funcName:a}=t;return{type:"horizBrace",mode:n.mode,label:a,isOver:a.includes("\\over"),base:e[0]}},htmlBuilder:l3,mathmlBuilder:pR});Ae({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,a=e[1],r=pt(e[0],"url").url;return n.settings.isTrusted({command:"\\href",url:r})?{type:"href",mode:n.mode,href:r,body:bn(a)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(t,e)=>{var n=En(t.body,e,!1);return CN(t.href,[],n,e)},mathmlBuilder:(t,e)=>{var n=Ni(t.body,e);return n instanceof ve||(n=new ve("mrow",[n])),n.setAttribute("href",t.href),n}});Ae({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,a=pt(e[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:a}))return n.formatUnsupportedCmd("\\url");for(var r=[],i=0;i<a.length;i++){var l=a[i];l==="~"&&(l="\\textasciitilde"),r.push({type:"textord",mode:"text",text:l})}var c={type:"text",mode:n.mode,font:"\\texttt",body:r};return{type:"href",mode:n.mode,href:a,body:bn(c)}}});Ae({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:bn(e[0])}},htmlBuilder(t,e){var n=En(t.body,e.withFont(""),!1);return Rs(n)},mathmlBuilder(t,e){return new ve("mrow",za(t.body,e.withFont("")))}});Ae({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(t,e)=>{var{parser:n,funcName:a,token:r}=t,i=pt(e[0],"raw").string,l=e[1];n.settings.strict&&n.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var c,d={};switch(a){case"\\htmlClass":d.class=i,c={command:"\\htmlClass",class:i};break;case"\\htmlId":d.id=i,c={command:"\\htmlId",id:i};break;case"\\htmlStyle":d.style=i,c={command:"\\htmlStyle",style:i};break;case"\\htmlData":{for(var p=i.split(","),h=0;h<p.length;h++){var m=p[h],b=m.indexOf("=");if(b<0)throw new be("\\htmlData key/value '"+m+"' missing equals sign");var x=m.slice(0,b),w=m.slice(b+1);d["data-"+x.trim()]=w}c={command:"\\htmlData",attributes:d};break}default:throw new Error("Unrecognized html command")}return n.settings.isTrusted(c)?{type:"html",mode:n.mode,attributes:d,body:bn(l)}:n.formatUnsupportedCmd(a)},htmlBuilder:(t,e)=>{var n=En(t.body,e,!1),a=["enclosing"];t.attributes.class&&a.push(...t.attributes.class.trim().split(/\s+/));var r=fe(a,n,e);for(var i in t.attributes)i!=="class"&&t.attributes.hasOwnProperty(i)&&r.setAttribute(i,t.attributes[i]);return r},mathmlBuilder:(t,e)=>Ni(t.body,e)});Ae({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(t,e)=>{var{parser:n}=t;return{type:"htmlmathml",mode:n.mode,html:bn(e[0]),mathml:bn(e[1])}},htmlBuilder:(t,e)=>{var n=En(t.html,e,!1);return Rs(n)},mathmlBuilder:(t,e)=>Ni(t.mathml,e)});var wm=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 be("Invalid size: '"+e+"' in \\includegraphics");var a={number:+(n[1]+n[2]),unit:n[3]};if(!C5(a))throw new be("Invalid unit: '"+a.unit+"' in \\includegraphics.");return a};Ae({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(t,e,n)=>{var{parser:a}=t,r={number:0,unit:"em"},i={number:.9,unit:"em"},l={number:0,unit:"em"},c="";if(n[0])for(var d=pt(n[0],"raw").string,p=d.split(","),h=0;h<p.length;h++){var m=p[h].split("=");if(m.length===2){var b=m[1].trim();switch(m[0].trim()){case"alt":c=b;break;case"width":r=wm(b);break;case"height":i=wm(b);break;case"totalheight":l=wm(b);break;default:throw new be("Invalid key: '"+m[0]+"' in \\includegraphics.")}}}var x=pt(e[0],"url").url;return c===""&&(c=x,c=c.replace(/^.*[\\/]/,""),c=c.substring(0,c.lastIndexOf("."))),a.settings.isTrusted({command:"\\includegraphics",url:x})?{type:"includegraphics",mode:a.mode,alt:c,width:r,height:i,totalheight:l,src:x}:a.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(t,e)=>{var n=Yt(t.height,e),a=0;t.totalheight.number>0&&(a=Yt(t.totalheight,e)-n);var r=0;t.width.number>0&&(r=Yt(t.width,e));var i={height:we(n+a)};r>0&&(i.width=we(r)),a>0&&(i.verticalAlign=we(-a));var l=new fN(t.src,t.alt,i);return l.height=n,l.depth=a,l},mathmlBuilder:(t,e)=>{var n=new ve("mglyph",[]);n.setAttribute("alt",t.alt);var a=Yt(t.height,e),r=0;if(t.totalheight.number>0&&(r=Yt(t.totalheight,e)-a,n.setAttribute("valign",we(-r))),n.setAttribute("height",we(a+r)),t.width.number>0){var i=Yt(t.width,e);n.setAttribute("width",we(i))}return n.setAttribute("src",t.src),n}});Ae({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(t,e){var{parser:n,funcName:a}=t,r=pt(e[0],"size");if(n.settings.strict){var i=a[1]==="m",l=r.value.unit==="mu";i?(l||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" supports only mu units, "+("not "+r.value.unit+" units")),n.mode!=="math"&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" works only in math mode")):l&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:r.value}},htmlBuilder(t,e){return D5(t.dimension,e)},mathmlBuilder(t,e){var n=Yt(t.dimension,e);return new I5(n)}});Ae({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:n,funcName:a}=t,r=e[0];return{type:"lap",mode:n.mode,alignment:a.slice(5),body:r}},htmlBuilder:(t,e)=>{var n;t.alignment==="clap"?(n=fe([],[Nt(t.body,e)]),n=fe(["inner"],[n],e)):n=fe(["inner"],[Nt(t.body,e)]);var a=fe(["fix"],[]),r=fe([t.alignment],[n,a],e),i=fe(["strut"]);return i.style.height=we(r.height+r.depth),r.depth&&(i.style.verticalAlign=we(-r.depth)),r.children.unshift(i),r=fe(["thinbox"],[r],e),fe(["mord","vbox"],[r],e)},mathmlBuilder:(t,e)=>{var n=new ve("mpadded",[zt(t.body,e)]);if(t.alignment!=="rlap"){var a=t.alignment==="llap"?"-1":"-0.5";n.setAttribute("lspace",a+"width")}return n.setAttribute("width","0px"),n}});Ae({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){var{funcName:n,parser:a}=t,r=a.mode;a.switchMode("math");var i=n==="\\("?"\\)":"$",l=a.parseExpression(!1,i);return a.expect(i),a.switchMode(r),{type:"styling",mode:a.mode,style:"text",resetFont:!0,body:l}}});Ae({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){throw new be("Mismatched "+t.funcName)}});var b2=(t,e)=>{switch(e.style.size){case nt.DISPLAY.size:return t.display;case nt.TEXT.size:return t.text;case nt.SCRIPT.size:return t.script;case nt.SCRIPTSCRIPT.size:return t.scriptscript;default:return t.text}};Ae({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(t,e)=>{var{parser:n}=t;return{type:"mathchoice",mode:n.mode,display:bn(e[0]),text:bn(e[1]),script:bn(e[2]),scriptscript:bn(e[3])}},htmlBuilder:(t,e)=>{var n=b2(t,e),a=En(n,e,!1);return Rs(a)},mathmlBuilder:(t,e)=>{var n=b2(t,e);return Ni(n,e)}});var c3=(t,e,n,a,r,i,l)=>{t=fe([],[t]);var c=n&&Es(n),d,p;if(e){var h=Nt(e,a.havingStyle(r.sup()),a);p={elem:h,kern:Math.max(a.fontMetrics().bigOpSpacing1,a.fontMetrics().bigOpSpacing3-h.depth)}}if(n){var m=Nt(n,a.havingStyle(r.sub()),a);d={elem:m,kern:Math.max(a.fontMetrics().bigOpSpacing2,a.fontMetrics().bigOpSpacing4-m.height)}}var b;if(p&&d){var x=a.fontMetrics().bigOpSpacing5+d.elem.height+d.elem.depth+d.kern+t.depth+l;b=Et({positionType:"bottom",positionData:x,children:[{type:"kern",size:a.fontMetrics().bigOpSpacing5},{type:"elem",elem:d.elem,marginLeft:we(-i)},{type:"kern",size:d.kern},{type:"elem",elem:t},{type:"kern",size:p.kern},{type:"elem",elem:p.elem,marginLeft:we(i)},{type:"kern",size:a.fontMetrics().bigOpSpacing5}]})}else if(d){var w=t.height-l;b=Et({positionType:"top",positionData:w,children:[{type:"kern",size:a.fontMetrics().bigOpSpacing5},{type:"elem",elem:d.elem,marginLeft:we(-i)},{type:"kern",size:d.kern},{type:"elem",elem:t}]})}else if(p){var S=t.depth+l;b=Et({positionType:"bottom",positionData:S,children:[{type:"elem",elem:t},{type:"kern",size:p.kern},{type:"elem",elem:p.elem,marginLeft:we(i)},{type:"kern",size:a.fontMetrics().bigOpSpacing5}]})}else return t;var C=[b];if(d&&i!==0&&!c){var E=fe(["mspace"],[],a);E.style.marginRight=we(i),C.unshift(E)}return fe(["mop","op-limits"],C,a)},u3=new Set(["\\smallint"]),Bl=(t,e)=>{var n,a,r=!1,i;t.type==="supsub"?(n=t.sup,a=t.sub,i=pt(t.base,"op"),r=!0):i=pt(t,"op");var l=e.style,c=!1;l.size===nt.DISPLAY.size&&i.symbol&&!u3.has(i.name)&&(c=!0);var d,p;if(i.symbol){var h=c?"Size2-Regular":"Size1-Regular",m="";if((i.name==="\\oiint"||i.name==="\\oiiint")&&(m=i.name.slice(1),i.name=m==="oiint"?"\\iint":"\\iiint"),d=aa(i.name,h,"math",e,["mop","op-symbol",c?"large-op":"small-op"]),p=d.italic,m.length>0){var b=O5(m+"Size"+(c?"2":"1"),e);d=Et({positionType:"individualShift",children:[{type:"elem",elem:d,shift:0},{type:"elem",elem:b,shift:c?.08:0}]}),i.name="\\"+m,d.classes.unshift("mop"),d.italic=p}}else if(i.body){var x=En(i.body,e,!0);x.length===1&&x[0]instanceof Ia?(d=x[0],d.classes[0]="mop"):d=fe(["mop"],x,e)}else{for(var w=[],S=1;S<i.name.length;S++)w.push(N1(i.name[S],i.mode,e));d=fe(["mop"],w,e)}var C=0,E=0;if((d instanceof Ia||i.name==="\\oiint"||i.name==="\\oiiint")&&!i.suppressBaseShift){var T;C=(d.height-d.depth)/2-e.fontMetrics().axisHeight,E=(T=d.italic)!=null?T:0}return r?c3(d,n,a,e,l,E,C):(C&&(d.style.position="relative",d.style.top=we(C)),d)},Mu=(t,e)=>{var n;if(t.symbol)n=new ve("mo",[or(t.name,t.mode)]),u3.has(t.name)&&n.setAttribute("largeop","false");else if(t.body)n=new ve("mo",za(t.body,e));else{n=new ve("mi",[new vn(t.name.slice(1))]);var a=new ve("mo",[or("","text")]);t.parentIsSupSub?n=new ve("mrow",[n,a]):n=B5([n,a])}return n},fR={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Ae({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:a}=t,r=a;return r.length===1&&(r=fR[r]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:Bl,mathmlBuilder:Mu});Ae({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var{parser:n}=t,a=e[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:bn(a)}},htmlBuilder:Bl,mathmlBuilder:Mu});var hR={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Ae({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:Bl,mathmlBuilder:Mu});Ae({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:Bl,mathmlBuilder:Mu});Ae({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(t){var{parser:e,funcName:n}=t,a=n;return a.length===1&&(a=hR[a]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:a}},htmlBuilder:Bl,mathmlBuilder:Mu});var d3=(t,e)=>{var n,a,r=!1,i;t.type==="supsub"?(n=t.sup,a=t.sub,i=pt(t.base,"operatorname"),r=!0):i=pt(t,"operatorname");var l;if(i.body.length>0){for(var c=i.body.map(m=>{var b="text"in m?m.text:void 0;return typeof b=="string"?{type:"textord",mode:m.mode,text:b}:m}),d=En(c,e.withFont("mathrm"),!0),p=0;p<d.length;p++){var h=d[p];h instanceof Ia&&(h.text=h.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}l=fe(["mop"],d,e)}else l=fe(["mop"],[],e);return r?c3(l,n,a,e,e.style,0,0):l},mR=(t,e)=>{for(var n=za(t.body,e.withFont("mathrm")),a=!0,r=0;r<n.length;r++){var i=n[r];if(!(i instanceof I5))if(i instanceof ve)switch(i.type){case"mi":case"mn":case"mspace":case"mtext":break;case"mo":{var l=i.children[0];i.children.length===1&&l instanceof vn?l.text=l.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):a=!1;break}default:a=!1}else a=!1}if(a){var c=n.map(h=>h.toText()).join("");n=[new vn(c)]}var d=new ve("mi",n);d.setAttribute("mathvariant","normal");var p=new ve("mo",[or("","text")]);return t.parentIsSupSub?new ve("mrow",[d,p]):B5([d,p])};Ae({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(t,e)=>{var{parser:n,funcName:a}=t,r=e[0];return{type:"operatorname",mode:n.mode,body:bn(r),alwaysHandleSupSub:a==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:d3,mathmlBuilder:mR});O("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");Ao({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?Rs(En(t.body,e,!1)):fe(["mord"],En(t.body,e,!0),e)},mathmlBuilder(t,e){return Ni(t.body,e,!0)}});Ae({type:"overline",names:["\\overline"],props:{numArgs:1},handler(t,e){var{parser:n}=t,a=e[0];return{type:"overline",mode:n.mode,body:a}},htmlBuilder(t,e){var n=Nt(t.body,e.havingCrampedStyle()),a=Rl("overline-line",e),r=e.fontMetrics().defaultRuleThickness,i=Et({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*r},{type:"elem",elem:a},{type:"kern",size:r}]});return fe(["mord","overline"],[i],e)},mathmlBuilder(t,e){var n=new ve("mo",[new vn("‾")]);n.setAttribute("stretchy","true");var a=new ve("mover",[zt(t.body,e),n]);return a.setAttribute("accent","true"),a}});Ae({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,a=e[0];return{type:"phantom",mode:n.mode,body:bn(a)}},htmlBuilder:(t,e)=>{var n=En(t.body,e.withPhantom(),!1);return Rs(n)},mathmlBuilder:(t,e)=>{var n=za(t.body,e);return new ve("mphantom",n)}});O("\\hphantom","\\smash{\\phantom{#1}}");Ae({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,a=e[0];return{type:"vphantom",mode:n.mode,body:a}},htmlBuilder:(t,e)=>{var n=fe(["inner"],[Nt(t.body,e.withPhantom())]),a=fe(["fix"],[]);return fe(["mord","rlap"],[n,a],e)},mathmlBuilder:(t,e)=>{var n=za(bn(t.body),e),a=new ve("mphantom",n),r=new ve("mpadded",[a]);return r.setAttribute("width","0px"),r}});Ae({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(t,e){var{parser:n}=t,a=pt(e[0],"size").value,r=e[1];return{type:"raisebox",mode:n.mode,dy:a,body:r}},htmlBuilder(t,e){var n=Nt(t.body,e),a=Yt(t.dy,e);return Et({positionType:"shift",positionData:-a,children:[{type:"elem",elem:n}]})},mathmlBuilder(t,e){var n=new ve("mpadded",[zt(t.body,e)]),a=t.dy.number+t.dy.unit;return n.setAttribute("voffset",a),n}});Ae({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(t){var{parser:e}=t;return{type:"internal",mode:e.mode}}});Ae({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(t,e,n){var{parser:a}=t,r=n[0],i=pt(e[0],"size"),l=pt(e[1],"size");return{type:"rule",mode:a.mode,shift:r&&pt(r,"size").value,width:i.value,height:l.value}},htmlBuilder(t,e){var n=fe(["mord","rule"],[],e),a=Yt(t.width,e),r=Yt(t.height,e),i=t.shift?Yt(t.shift,e):0;return n.style.borderRightWidth=we(a),n.style.borderTopWidth=we(r),n.style.bottom=we(i),n.width=a,n.height=r+i,n.depth=-i,n.maxFontSize=r*1.125*e.sizeMultiplier,n},mathmlBuilder(t,e){var n=Yt(t.width,e),a=Yt(t.height,e),r=t.shift?Yt(t.shift,e):0,i=e.color&&e.getColor()||"black",l=new ve("mspace");l.setAttribute("mathbackground",i),l.setAttribute("width",we(n)),l.setAttribute("height",we(a));var c=new ve("mpadded",[l]);return r>=0?c.setAttribute("height",we(r)):(c.setAttribute("height",we(r)),c.setAttribute("depth",we(-r))),c.setAttribute("voffset",we(r)),c}});function p3(t,e,n){for(var a=En(t,e,!1),r=e.sizeMultiplier/n.sizeMultiplier,i=0;i<a.length;i++){var l=a[i].classes.indexOf("sizing");l<0?Array.prototype.push.apply(a[i].classes,e.sizingClasses(n)):a[i].classes[l+1]==="reset-size"+e.size&&(a[i].classes[l+1]="reset-size"+n.size),a[i].height*=r,a[i].depth*=r}return Rs(a)}var v2=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],gR=(t,e)=>{var n=e.havingSize(t.size);return p3(t.body,n,e)};Ae({type:"sizing",names:v2,props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{breakOnTokenText:n,funcName:a,parser:r}=t,i=r.parseExpression(!1,n);return{type:"sizing",mode:r.mode,size:v2.indexOf(a)+1,body:i}},htmlBuilder:gR,mathmlBuilder:(t,e)=>{var n=e.havingSize(t.size),a=za(t.body,n),r=new ve("mstyle",a);return r.setAttribute("mathsize",we(n.sizeMultiplier)),r}});Ae({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(t,e,n)=>{var{parser:a}=t,r=!1,i=!1,l=n[0]&&pt(n[0],"ordgroup");if(l)for(var c,d=0;d<l.body.length;++d){var p=l.body[d];if(c=Rp(p).text,c==="t")r=!0;else if(c==="b")i=!0;else{r=!1,i=!1;break}}else r=!0,i=!0;var h=e[0];return{type:"smash",mode:a.mode,body:h,smashHeight:r,smashDepth:i}},htmlBuilder:(t,e)=>{var n=fe([],[Nt(t.body,e)]);if(!t.smashHeight&&!t.smashDepth)return n;if(t.smashHeight&&(n.height=0),t.smashDepth&&(n.depth=0),t.smashHeight&&t.smashDepth)return fe(["mord","smash"],[n],e);if(n.children)for(var a=0;a<n.children.length;a++)t.smashHeight&&(n.children[a].height=0),t.smashDepth&&(n.children[a].depth=0);var r=Et({positionType:"firstBaseline",children:[{type:"elem",elem:n}]});return fe(["mord"],[r],e)},mathmlBuilder:(t,e)=>{var n=new ve("mpadded",[zt(t.body,e)]);return t.smashHeight&&n.setAttribute("height","0px"),t.smashDepth&&n.setAttribute("depth","0px"),n}});Ae({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,n){var{parser:a}=t,r=n[0],i=e[0];return{type:"sqrt",mode:a.mode,body:i,index:r}},htmlBuilder(t,e){var n=Nt(t.body,e.havingCrampedStyle());n.height===0&&(n.height=e.fontMetrics().xHeight),n=Dl(n,e);var a=e.fontMetrics(),r=a.defaultRuleThickness,i=r;e.style.id<nt.TEXT.id&&(i=e.fontMetrics().xHeight);var l=r+i/4,c=n.height+n.depth+l+r,{span:d,ruleWidth:p,advanceWidth:h}=nR(c,e),m=d.height-p;m>n.height+n.depth+l&&(l=(l+m-n.height-n.depth)/2);var b=d.height-n.height-l-p;n.style.paddingLeft=we(h);var x=Et({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+b)},{type:"elem",elem:d},{type:"kern",size:p}]});if(t.index){var w=e.havingStyle(nt.SCRIPTSCRIPT),S=Nt(t.index,w,e),C=.6*(x.height-x.depth),E=Et({positionType:"shift",positionData:-C,children:[{type:"elem",elem:S}]}),T=fe(["root"],[E]);return fe(["mord","sqrt"],[T,x],e)}else return fe(["mord","sqrt"],[x],e)},mathmlBuilder(t,e){var{body:n,index:a}=t;return a?new ve("mroot",[zt(n,e),zt(a,e)]):new ve("msqrt",[zt(n,e)])}});var Og={display:nt.DISPLAY,text:nt.TEXT,script:nt.SCRIPT,scriptscript:nt.SCRIPTSCRIPT};function yR(t){return t in Og}Ae({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t,e){var{breakOnTokenText:n,funcName:a,parser:r}=t,i=r.parseExpression(!0,n),l=a.slice(1,a.length-5);if(!yR(l))throw new Error("Unknown style: "+l);return{type:"styling",mode:r.mode,style:l,body:i}},htmlBuilder(t,e){var n=Og[t.style],a=e.havingStyle(n);return t.resetFont&&(a=a.withFont("")),p3(t.body,a,e)},mathmlBuilder(t,e){var n=Og[t.style],a=e.havingStyle(n);t.resetFont&&(a=a.withFont(""));var r=za(t.body,a),i=new ve("mstyle",r),l={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},c=l[t.style];return i.setAttribute("scriptlevel",c[0]),i.setAttribute("displaystyle",c[1]),i}});var bR=function(e,n){var a=e.base;if(a)if(a.type==="op"){var r=a.limits&&(n.style.size===nt.DISPLAY.size||a.alwaysHandleSupSub);return r?Bl:null}else if(a.type==="operatorname"){var i=a.alwaysHandleSupSub&&(n.style.size===nt.DISPLAY.size||a.limits);return i?d3:null}else{if(a.type==="accent")return Es(a.base)?O1:null;if(a.type==="horizBrace"){var l=!e.sub;return l===a.isOver?l3:null}else return null}else return null};Ao({type:"supsub",htmlBuilder(t,e){var n=bR(t,e);if(n)return n(t,e);var{base:a,sup:r,sub:i}=t,l=Nt(a,e),c,d,p=e.fontMetrics(),h=0,m=0,b=a&&Es(a);if(r){var x=e.havingStyle(e.style.sup());c=Nt(r,x,e),b||(h=l.height-x.fontMetrics().supDrop*x.sizeMultiplier/e.sizeMultiplier)}if(i){var w=e.havingStyle(e.style.sub());d=Nt(i,w,e),b||(m=l.depth+w.fontMetrics().subDrop*w.sizeMultiplier/e.sizeMultiplier)}var S;e.style===nt.DISPLAY?S=p.sup1:e.style.cramped?S=p.sup3:S=p.sup2;var C=e.sizeMultiplier,E=we(.5/p.ptPerEm/C),T=null;if(d){var L=t.base&&t.base.type==="op"&&t.base.name&&(t.base.name==="\\oiint"||t.base.name==="\\oiiint");if(l instanceof Ia||L){var D;T=we(-((D=l.italic)!=null?D:0))}}var B;if(c&&d){h=Math.max(h,S,c.depth+.25*p.xHeight),m=Math.max(m,p.sub2);var H=p.defaultRuleThickness,K=4*H;if(h-c.depth-(d.height-m)<K){m=K-(h-c.depth)+d.height;var U=.8*p.xHeight-(h-c.depth);U>0&&(h+=U,m-=U)}var q=[{type:"elem",elem:d,shift:m,marginRight:E,marginLeft:T},{type:"elem",elem:c,shift:-h,marginRight:E}];B=Et({positionType:"individualShift",children:q})}else if(d){m=Math.max(m,p.sub1,d.height-.8*p.xHeight);var re=[{type:"elem",elem:d,marginLeft:T,marginRight:E}];B=Et({positionType:"shift",positionData:m,children:re})}else if(c)h=Math.max(h,S,c.depth+.25*p.xHeight),B=Et({positionType:"shift",positionData:-h,children:[{type:"elem",elem:c,marginRight:E}]});else throw new Error("supsub must have either sup or sub.");var _e=Eg(l,"right")||"mord";return fe([_e],[l,fe(["msupsub"],[B])],e)},mathmlBuilder(t,e){var n=!1,a,r;t.base&&t.base.type==="horizBrace"&&(r=!!t.sup,r===t.base.isOver&&(n=!0,a=t.base.isOver)),t.base&&(t.base.type==="op"||t.base.type==="operatorname")&&(t.base.parentIsSupSub=!0);var i=[zt(t.base,e)];t.sub&&i.push(zt(t.sub,e)),t.sup&&i.push(zt(t.sup,e));var l;if(n)l=a?"mover":"munder";else if(t.sub)if(t.sup){var p=t.base;p&&p.type==="op"&&p.limits&&e.style===nt.DISPLAY||p&&p.type==="operatorname"&&p.alwaysHandleSupSub&&(e.style===nt.DISPLAY||p.limits)?l="munderover":l="msubsup"}else{var d=t.base;d&&d.type==="op"&&d.limits&&(e.style===nt.DISPLAY||d.alwaysHandleSupSub)||d&&d.type==="operatorname"&&d.alwaysHandleSupSub&&(d.limits||e.style===nt.DISPLAY)?l="munder":l="msub"}else{var c=t.base;c&&c.type==="op"&&c.limits&&(e.style===nt.DISPLAY||c.alwaysHandleSupSub)||c&&c.type==="operatorname"&&c.alwaysHandleSupSub&&(c.limits||e.style===nt.DISPLAY)?l="mover":l="msup"}return new ve(l,i)}});Ao({type:"atom",htmlBuilder(t,e){return N1(t.text,t.mode,e,["m"+t.family])},mathmlBuilder(t,e){var n=new ve("mo",[or(t.text,t.mode)]);if(t.family==="bin"){var a=M1(t,e);a==="bold-italic"&&n.setAttribute("mathvariant",a)}else t.family==="punct"?n.setAttribute("separator","true"):(t.family==="open"||t.family==="close")&&n.setAttribute("stretchy","false");return n}});var f3={mi:"italic",mn:"normal",mtext:"normal"};Ao({type:"mathord",htmlBuilder(t,e){return Tp(t,e,"mathord")},mathmlBuilder(t,e){var n=new ve("mi",[or(t.text,t.mode,e)]),a=M1(t,e)||"italic";return a!==f3[n.type]&&n.setAttribute("mathvariant",a),n}});Ao({type:"textord",htmlBuilder(t,e){return Tp(t,e,"textord")},mathmlBuilder(t,e){var n=or(t.text,t.mode,e),a=M1(t,e)||"normal",r;return t.mode==="text"?r=new ve("mtext",[n]):/[0-9]/.test(t.text)?r=new ve("mn",[n]):t.text==="\\prime"?r=new ve("mo",[n]):r=new ve("mi",[n]),a!==f3[r.type]&&r.setAttribute("mathvariant",a),r}});var km={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Sm={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Ao({type:"spacing",htmlBuilder(t,e){if(Sm.hasOwnProperty(t.text)){var n=Sm[t.text].className||"";if(t.mode==="text"){var a=Tp(t,e,"textord");return a.classes.push(n),a}else return fe(["mspace",n],[N1(t.text,t.mode,e)],e)}else{if(km.hasOwnProperty(t.text))return fe(["mspace",km[t.text]],[],e);throw new be('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var n;if(Sm.hasOwnProperty(t.text))n=new ve("mtext",[new vn(" ")]);else{if(km.hasOwnProperty(t.text))return new ve("mspace");throw new be('Unknown type of space "'+t.text+'"')}return n}});var x2=()=>{var t=new ve("mtd",[]);return t.setAttribute("width","50%"),t};Ao({type:"tag",mathmlBuilder(t,e){var n=new ve("mtable",[new ve("mtr",[x2(),new ve("mtd",[Ni(t.body,e)]),x2(),new ve("mtd",[Ni(t.tag,e)])])]);return n.setAttribute("width","100%"),n}});var w2={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},k2={"\\textbf":"textbf","\\textmd":"textmd"},vR={"\\textit":"textit","\\textup":"textup"},S2=(t,e)=>{var n=t.font;if(n){if(w2[n])return e.withTextFontFamily(w2[n]);if(k2[n])return e.withTextFontWeight(k2[n]);if(n==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(vR[n])};Ae({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:a}=t,r=e[0];return{type:"text",mode:n.mode,body:bn(r),font:a}},htmlBuilder(t,e){var n=S2(t,e),a=En(t.body,n,!0);return fe(["mord","text"],a,n)},mathmlBuilder(t,e){var n=S2(t,e);return Ni(t.body,n)}});Ae({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=Nt(t.body,e),a=Rl("underline-line",e),r=e.fontMetrics().defaultRuleThickness,i=Et({positionType:"top",positionData:n.height,children:[{type:"kern",size:r},{type:"elem",elem:a},{type:"kern",size:3*r},{type:"elem",elem:n}]});return fe(["mord","underline"],[i],e)},mathmlBuilder(t,e){var n=new ve("mo",[new vn("‾")]);n.setAttribute("stretchy","true");var a=new ve("munder",[zt(t.body,e),n]);return a.setAttribute("accentunder","true"),a}});Ae({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=Nt(t.body,e),a=e.fontMetrics().axisHeight,r=.5*(n.height-a-(n.depth+a));return Et({positionType:"shift",positionData:r,children:[{type:"elem",elem:n}]})},mathmlBuilder(t,e){var n=new ve("mpadded",[zt(t.body,e)],["vcenter"]);return new ve("mrow",[n])}});Ae({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(t,e,n){throw new be("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(t,e){for(var n=_2(t),a=[],r=e.havingStyle(e.style.text()),i=0;i<n.length;i++){var l=n[i];l==="~"&&(l="\\textasciitilde"),a.push(aa(l,"Typewriter-Regular",t.mode,r,["mord","texttt"]))}return fe(["mord","text"].concat(r.sizingClasses(e)),R5(a),r)},mathmlBuilder(t,e){var n=new vn(_2(t)),a=new ve("mtext",[n]);return a.setAttribute("mathvariant","monospace"),a}});var _2=t=>t.body.replace(/ /g,t.star?"␣":" "),vi=L5,h3=`[ \r
|
|
302
|
+
]`,xR="\\\\[a-zA-Z@]+",wR="\\\\[^\uD800-\uDFFF]",kR="("+xR+")"+h3+"*",SR=`\\\\(
|
|
303
|
+
|[ \r ]+
|
|
304
|
+
?)[ \r ]*`,Lg="[̀-ͯ]",_R=new RegExp(Lg+"+$"),CR="("+h3+"+)|"+(SR+"|")+"([!-\\[\\]-‧-豈-]"+(Lg+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(Lg+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+kR)+("|"+wR+")");class C2{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(CR,"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 Ba("EOF",new va(this,n,n));var a=this.tokenRegex.exec(e);if(a===null||a.index!==n)throw new be("Unexpected character: '"+e[n]+"'",new Ba(e[n],new va(this,n,n+1)));var r=a[6]||a[3]||(a[2]?"\\ ":" ");if(this.catcodes[r]===14){var i=e.indexOf(`
|
|
305
|
+
`,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 Ba(r,new va(this,n,this.tokenRegex.lastIndex))}}class AR{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 be("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,a){if(a===void 0&&(a=!1),a){for(var r=0;r<this.undefStack.length;r++)delete this.undefStack[r][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 TR=a3;O("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});O("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}});O("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}});O("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}});O("\\@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}});O("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");O("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var A2={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};O("\\char",function(t){var e=t.popToken(),n,a=0;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]==="\\")a=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new be("\\char` missing argument");a=e.text.charCodeAt(0)}else n=10;if(n){if(a=A2[e.text],a==null||a>=n)throw new be("Invalid base-"+n+" digit "+e.text);for(var r;(r=A2[t.future().text])!=null&&r<n;)a*=n,a+=r,t.popToken()}return"\\@char{"+a+"}"});var I1=(t,e,n,a)=>{var r=t.consumeArg().tokens;if(r.length!==1)throw new be("\\newcommand's first argument must be a macro name");var i=r[0].text,l=t.isDefined(i);if(l&&!e)throw new be("\\newcommand{"+i+"} attempting to redefine "+(i+"; use \\renewcommand"));if(!l&&!n)throw new be("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var c=0;if(r=t.consumeArg().tokens,r.length===1&&r[0].text==="["){for(var d="",p=t.expandNextToken();p.text!=="]"&&p.text!=="EOF";)d+=p.text,p=t.expandNextToken();if(!d.match(/^\s*[0-9]+\s*$/))throw new be("Invalid number of arguments: "+d);c=parseInt(d),r=t.consumeArg().tokens}return l&&a||t.macros.set(i,{tokens:r,numArgs:c}),""};O("\\newcommand",t=>I1(t,!1,!0,!1));O("\\renewcommand",t=>I1(t,!0,!1,!1));O("\\providecommand",t=>I1(t,!0,!0,!0));O("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(n=>n.text).join("")),""});O("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(n=>n.text).join("")),""});O("\\show",t=>{var e=t.popToken(),n=e.text;return console.log(e,t.macros.get(n),vi[n],qt.math[n],qt.text[n]),""});O("\\bgroup","{");O("\\egroup","}");O("~","\\nobreakspace");O("\\lq","`");O("\\rq","'");O("\\aa","\\r a");O("\\AA","\\r A");O("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");O("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");O("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");O("ℬ","\\mathscr{B}");O("ℰ","\\mathscr{E}");O("ℱ","\\mathscr{F}");O("ℋ","\\mathscr{H}");O("ℐ","\\mathscr{I}");O("ℒ","\\mathscr{L}");O("ℳ","\\mathscr{M}");O("ℛ","\\mathscr{R}");O("ℭ","\\mathfrak{C}");O("ℌ","\\mathfrak{H}");O("ℨ","\\mathfrak{Z}");O("\\Bbbk","\\Bbb{k}");O("\\llap","\\mathllap{\\textrm{#1}}");O("\\rlap","\\mathrlap{\\textrm{#1}}");O("\\clap","\\mathclap{\\textrm{#1}}");O("\\mathstrut","\\vphantom{(}");O("\\underbar","\\underline{\\text{#1}}");O("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');O("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");O("\\ne","\\neq");O("≠","\\neq");O("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");O("∉","\\notin");O("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");O("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");O("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");O("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");O("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");O("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");O("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");O("⟂","\\perp");O("‼","\\mathclose{!\\mkern-0.8mu!}");O("∌","\\notni");O("⌜","\\ulcorner");O("⌝","\\urcorner");O("⌞","\\llcorner");O("⌟","\\lrcorner");O("©","\\copyright");O("®","\\textregistered");O("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');O("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');O("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');O("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');O("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");O("⋮","\\vdots");O("\\varGamma","\\mathit{\\Gamma}");O("\\varDelta","\\mathit{\\Delta}");O("\\varTheta","\\mathit{\\Theta}");O("\\varLambda","\\mathit{\\Lambda}");O("\\varXi","\\mathit{\\Xi}");O("\\varPi","\\mathit{\\Pi}");O("\\varSigma","\\mathit{\\Sigma}");O("\\varUpsilon","\\mathit{\\Upsilon}");O("\\varPhi","\\mathit{\\Phi}");O("\\varPsi","\\mathit{\\Psi}");O("\\varOmega","\\mathit{\\Omega}");O("\\substack","\\begin{subarray}{c}#1\\end{subarray}");O("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");O("\\boxed","\\fbox{$\\displaystyle{#1}$}");O("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");O("\\implies","\\DOTSB\\;\\Longrightarrow\\;");O("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");O("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");O("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var T2={",":"\\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"},ER=new Set(["bin","rel"]);O("\\dots",function(t){var e="\\dotso",n=t.expandAfterFuture().text;return n in T2?e=T2[n]:(n.slice(0,4)==="\\not"||n in qt.math&&ER.has(qt.math[n].group))&&(e="\\dotsb"),e});var P1={")":!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};O("\\dotso",function(t){var e=t.future().text;return e in P1?"\\ldots\\,":"\\ldots"});O("\\dotsc",function(t){var e=t.future().text;return e in P1&&e!==","?"\\ldots\\,":"\\ldots"});O("\\cdots",function(t){var e=t.future().text;return e in P1?"\\@cdots\\,":"\\@cdots"});O("\\dotsb","\\cdots");O("\\dotsm","\\cdots");O("\\dotsi","\\!\\cdots");O("\\dotsx","\\ldots\\,");O("\\DOTSI","\\relax");O("\\DOTSB","\\relax");O("\\DOTSX","\\relax");O("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");O("\\,","\\tmspace+{3mu}{.1667em}");O("\\thinspace","\\,");O("\\>","\\mskip{4mu}");O("\\:","\\tmspace+{4mu}{.2222em}");O("\\medspace","\\:");O("\\;","\\tmspace+{5mu}{.2777em}");O("\\thickspace","\\;");O("\\!","\\tmspace-{3mu}{.1667em}");O("\\negthinspace","\\!");O("\\negmedspace","\\tmspace-{4mu}{.2222em}");O("\\negthickspace","\\tmspace-{5mu}{.277em}");O("\\enspace","\\kern.5em ");O("\\enskip","\\hskip.5em\\relax");O("\\quad","\\hskip1em\\relax");O("\\qquad","\\hskip2em\\relax");O("\\tag","\\@ifstar\\tag@literal\\tag@paren");O("\\tag@paren","\\tag@literal{({#1})}");O("\\tag@literal",t=>{if(t.macros.get("\\df@tag"))throw new be("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});O("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");O("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");O("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");O("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");O("\\newline","\\\\\\relax");O("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var m3=we(zr["Main-Regular"][84][1]-.7*zr["Main-Regular"][65][1]);O("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+m3+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");O("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+m3+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");O("\\hspace","\\@ifstar\\@hspacer\\@hspace");O("\\@hspace","\\hskip #1\\relax");O("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");O("\\ordinarycolon",":");O("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");O("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');O("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');O("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');O("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');O("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');O("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');O("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');O("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');O("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');O("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');O("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');O("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');O("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');O("∷","\\dblcolon");O("∹","\\eqcolon");O("≔","\\coloneqq");O("≕","\\eqqcolon");O("⩴","\\Coloneqq");O("\\ratio","\\vcentcolon");O("\\coloncolon","\\dblcolon");O("\\colonequals","\\coloneqq");O("\\coloncolonequals","\\Coloneqq");O("\\equalscolon","\\eqqcolon");O("\\equalscoloncolon","\\Eqqcolon");O("\\colonminus","\\coloneq");O("\\coloncolonminus","\\Coloneq");O("\\minuscolon","\\eqcolon");O("\\minuscoloncolon","\\Eqcolon");O("\\coloncolonapprox","\\Colonapprox");O("\\coloncolonsim","\\Colonsim");O("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");O("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");O("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");O("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");O("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");O("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");O("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");O("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");O("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");O("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");O("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");O("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");O("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");O("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");O("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");O("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");O("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");O("\\nleqq","\\html@mathml{\\@nleqq}{≰}");O("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");O("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");O("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");O("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");O("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");O("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");O("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");O("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");O("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");O("\\imath","\\html@mathml{\\@imath}{ı}");O("\\jmath","\\html@mathml{\\@jmath}{ȷ}");O("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");O("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");O("⟦","\\llbracket");O("⟧","\\rrbracket");O("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");O("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");O("⦃","\\lBrace");O("⦄","\\rBrace");O("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");O("⦵","\\minuso");O("\\darr","\\downarrow");O("\\dArr","\\Downarrow");O("\\Darr","\\Downarrow");O("\\lang","\\langle");O("\\rang","\\rangle");O("\\uarr","\\uparrow");O("\\uArr","\\Uparrow");O("\\Uarr","\\Uparrow");O("\\N","\\mathbb{N}");O("\\R","\\mathbb{R}");O("\\Z","\\mathbb{Z}");O("\\alef","\\aleph");O("\\alefsym","\\aleph");O("\\Alpha","\\mathrm{A}");O("\\Beta","\\mathrm{B}");O("\\bull","\\bullet");O("\\Chi","\\mathrm{X}");O("\\clubs","\\clubsuit");O("\\cnums","\\mathbb{C}");O("\\Complex","\\mathbb{C}");O("\\Dagger","\\ddagger");O("\\diamonds","\\diamondsuit");O("\\empty","\\emptyset");O("\\Epsilon","\\mathrm{E}");O("\\Eta","\\mathrm{H}");O("\\exist","\\exists");O("\\harr","\\leftrightarrow");O("\\hArr","\\Leftrightarrow");O("\\Harr","\\Leftrightarrow");O("\\hearts","\\heartsuit");O("\\image","\\Im");O("\\infin","\\infty");O("\\Iota","\\mathrm{I}");O("\\isin","\\in");O("\\Kappa","\\mathrm{K}");O("\\larr","\\leftarrow");O("\\lArr","\\Leftarrow");O("\\Larr","\\Leftarrow");O("\\lrarr","\\leftrightarrow");O("\\lrArr","\\Leftrightarrow");O("\\Lrarr","\\Leftrightarrow");O("\\Mu","\\mathrm{M}");O("\\natnums","\\mathbb{N}");O("\\Nu","\\mathrm{N}");O("\\Omicron","\\mathrm{O}");O("\\plusmn","\\pm");O("\\rarr","\\rightarrow");O("\\rArr","\\Rightarrow");O("\\Rarr","\\Rightarrow");O("\\real","\\Re");O("\\reals","\\mathbb{R}");O("\\Reals","\\mathbb{R}");O("\\Rho","\\mathrm{P}");O("\\sdot","\\cdot");O("\\sect","\\S");O("\\spades","\\spadesuit");O("\\sub","\\subset");O("\\sube","\\subseteq");O("\\supe","\\supseteq");O("\\Tau","\\mathrm{T}");O("\\thetasym","\\vartheta");O("\\weierp","\\wp");O("\\Zeta","\\mathrm{Z}");O("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");O("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");O("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");O("\\bra","\\mathinner{\\langle{#1}|}");O("\\ket","\\mathinner{|{#1}\\rangle}");O("\\braket","\\mathinner{\\langle{#1}\\rangle}");O("\\Bra","\\left\\langle#1\\right|");O("\\Ket","\\left|#1\\right\\rangle");var g3=t=>e=>{var n=e.consumeArg().tokens,a=e.consumeArg().tokens,r=e.consumeArg().tokens,i=e.consumeArg().tokens,l=e.macros.get("|"),c=e.macros.get("\\|");e.macros.beginGroup();var d=m=>b=>{t&&(b.macros.set("|",l),r.length&&b.macros.set("\\|",c));var x=m;if(!m&&r.length){var w=b.future();w.text==="|"&&(b.popToken(),x=!0)}return{tokens:x?r:a,numArgs:0}};e.macros.set("|",d(!1)),r.length&&e.macros.set("\\|",d(!0));var p=e.consumeArg().tokens,h=e.expandTokens([...i,...p,...n]);return e.macros.endGroup(),{tokens:h.reverse(),numArgs:0}};O("\\bra@ket",g3(!1));O("\\bra@set",g3(!0));O("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");O("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");O("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");O("\\angln","{\\angl n}");O("\\blue","\\textcolor{##6495ed}{#1}");O("\\orange","\\textcolor{##ffa500}{#1}");O("\\pink","\\textcolor{##ff00af}{#1}");O("\\red","\\textcolor{##df0030}{#1}");O("\\green","\\textcolor{##28ae7b}{#1}");O("\\gray","\\textcolor{gray}{#1}");O("\\purple","\\textcolor{##9d38bd}{#1}");O("\\blueA","\\textcolor{##ccfaff}{#1}");O("\\blueB","\\textcolor{##80f6ff}{#1}");O("\\blueC","\\textcolor{##63d9ea}{#1}");O("\\blueD","\\textcolor{##11accd}{#1}");O("\\blueE","\\textcolor{##0c7f99}{#1}");O("\\tealA","\\textcolor{##94fff5}{#1}");O("\\tealB","\\textcolor{##26edd5}{#1}");O("\\tealC","\\textcolor{##01d1c1}{#1}");O("\\tealD","\\textcolor{##01a995}{#1}");O("\\tealE","\\textcolor{##208170}{#1}");O("\\greenA","\\textcolor{##b6ffb0}{#1}");O("\\greenB","\\textcolor{##8af281}{#1}");O("\\greenC","\\textcolor{##74cf70}{#1}");O("\\greenD","\\textcolor{##1fab54}{#1}");O("\\greenE","\\textcolor{##0d923f}{#1}");O("\\goldA","\\textcolor{##ffd0a9}{#1}");O("\\goldB","\\textcolor{##ffbb71}{#1}");O("\\goldC","\\textcolor{##ff9c39}{#1}");O("\\goldD","\\textcolor{##e07d10}{#1}");O("\\goldE","\\textcolor{##a75a05}{#1}");O("\\redA","\\textcolor{##fca9a9}{#1}");O("\\redB","\\textcolor{##ff8482}{#1}");O("\\redC","\\textcolor{##f9685d}{#1}");O("\\redD","\\textcolor{##e84d39}{#1}");O("\\redE","\\textcolor{##bc2612}{#1}");O("\\maroonA","\\textcolor{##ffbde0}{#1}");O("\\maroonB","\\textcolor{##ff92c6}{#1}");O("\\maroonC","\\textcolor{##ed5fa6}{#1}");O("\\maroonD","\\textcolor{##ca337c}{#1}");O("\\maroonE","\\textcolor{##9e034e}{#1}");O("\\purpleA","\\textcolor{##ddd7ff}{#1}");O("\\purpleB","\\textcolor{##c6b9fc}{#1}");O("\\purpleC","\\textcolor{##aa87ff}{#1}");O("\\purpleD","\\textcolor{##7854ab}{#1}");O("\\purpleE","\\textcolor{##543b78}{#1}");O("\\mintA","\\textcolor{##f5f9e8}{#1}");O("\\mintB","\\textcolor{##edf2df}{#1}");O("\\mintC","\\textcolor{##e0e5cc}{#1}");O("\\grayA","\\textcolor{##f6f7f7}{#1}");O("\\grayB","\\textcolor{##f0f1f2}{#1}");O("\\grayC","\\textcolor{##e3e5e6}{#1}");O("\\grayD","\\textcolor{##d6d8da}{#1}");O("\\grayE","\\textcolor{##babec2}{#1}");O("\\grayF","\\textcolor{##888d93}{#1}");O("\\grayG","\\textcolor{##626569}{#1}");O("\\grayH","\\textcolor{##3b3e40}{#1}");O("\\grayI","\\textcolor{##21242c}{#1}");O("\\kaBlue","\\textcolor{##314453}{#1}");O("\\kaGreen","\\textcolor{##71B307}{#1}");var y3={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class NR{constructor(e,n,a){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=n,this.expansionCount=0,this.feed(e),this.macros=new AR(TR,n.macros),this.mode=a,this.stack=[]}feed(e){this.lexer=new C2(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,a,r;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;n=this.popToken(),{tokens:r,end:a}=this.consumeArg(["]"])}else({tokens:r,start:n,end:a}=this.consumeArg());return this.pushToken(new Ba("EOF",a.loc)),this.pushTokens(r),new Ba("",va.range(n,a))}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var n=[],a=e&&e.length>0;a||this.consumeSpaces();var r=this.future(),i,l=0,c=0;do{if(i=this.popToken(),n.push(i),i.text==="{")++l;else if(i.text==="}"){if(--l,l===-1)throw new be("Extra }",i)}else if(i.text==="EOF")throw new be("Unexpected end of input in a macro argument, expected '"+(e&&a?e[c]:"}")+"'",i);if(e&&a)if((l===0||l===1&&e[c]==="{")&&i.text===e[c]){if(++c,c===e.length){n.splice(-c,c);break}}else c=0}while(l!==0||a);return r.text==="{"&&n[n.length-1].text==="}"&&(n.pop(),n.shift()),n.reverse(),{tokens:n,start:r,end:i}}consumeArgs(e,n){if(n){if(n.length!==e+1)throw new be("The length of delimiters doesn't match the number of args!");for(var a=n[0],r=0;r<a.length;r++){var i=this.popToken();if(a[r]!==i.text)throw new be("Use of the macro doesn't match its definition",i)}}for(var l=[],c=0;c<e;c++)l.push(this.consumeArg(n&&n[c+1]).tokens);return l}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new be("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var n=this.popToken(),a=n.text,r=n.noexpand?null:this._getExpansion(a);if(r==null||e&&r.unexpandable){if(e&&r==null&&a[0]==="\\"&&!this.isDefined(a))throw new be("Undefined control sequence: "+a);return this.pushToken(n),!1}this.countExpansion(1);var i=r.tokens,l=this.consumeArgs(r.numArgs,r.delimiters);if(r.numArgs){i=i.slice();for(var c=i.length-1;c>=0;--c){var d=i[c];if(d.text==="#"){if(c===0)throw new be("Incomplete placeholder at end of macro body",d);if(d=i[--c],d.text==="#")i.splice(c+1,1);else if(/^[1-9]$/.test(d.text))i.splice(c,2,...l[+d.text-1]);else throw new be("Not a valid argument number",d)}}}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}}expandMacro(e){return this.macros.has(e)?this.expandTokens([new Ba(e)]):void 0}expandTokens(e){var n=[],a=this.stack.length;for(this.pushTokens(e);this.stack.length>a;)if(this.expandOnce(!0)===!1){var r=this.stack.pop();r.treatAsRelax&&(r.noexpand=!1,r.treatAsRelax=!1),n.push(r)}return this.countExpansion(n.length),n}expandMacroAsText(e){var n=this.expandMacro(e);return n&&n.map(a=>a.text).join("")}_getExpansion(e){var n=this.macros.get(e);if(n==null)return n;if(e.length===1){var a=this.lexer.catcodes[e];if(a!=null&&a!==13)return}var r=typeof n=="function"?n(this):n;if(typeof r=="string"){var i=0;if(r.includes("#"))for(var l=r.replace(/##/g,"");l.includes("#"+(i+1));)++i;for(var c=new C2(r,this.settings),d=[],p=c.lex();p.text!=="EOF";)d.push(p),p=c.lex();d.reverse();var h={tokens:d,numArgs:i};return h}return r}isDefined(e){return this.macros.has(e)||vi.hasOwnProperty(e)||qt.math.hasOwnProperty(e)||qt.text.hasOwnProperty(e)||y3.hasOwnProperty(e)}isExpandable(e){var n=this.macros.get(e);return n!=null?typeof n=="string"||typeof n=="function"||!n.unexpandable:vi.hasOwnProperty(e)&&!vi[e].primitive}}var E2=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,d0=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","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),_m={"́":{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"}},N2={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class Ip{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 NR(e,n,this.mode),this.settings=n,this.leftrightDepth=0,this.nextToken=null}expect(e,n){if(n===void 0&&(n=!0),this.fetch().text!==e)throw new be("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 Ba("}")),this.gullet.pushTokens(e);var a=this.parseExpression(!1);return this.expect("}"),this.nextToken=n,a}parseExpression(e,n){for(var a=[];;){this.mode==="math"&&this.consumeSpaces();var r=this.fetch();if(Ip.endOfExpression.has(r.text)||n&&r.text===n||e&&vi[r.text]&&vi[r.text].infix)break;var i=this.parseAtom(n);if(i){if(i.type==="internal")continue}else break;a.push(i)}return this.mode==="text"&&this.formLigatures(a),this.handleInfixNodes(a)}handleInfixNodes(e){for(var n=-1,a,r=0;r<e.length;r++){var i=e[r];if(i.type==="infix"){if(n!==-1)throw new be("only one infix operator per group",i.token);n=r,a=i.replaceWith}}if(n!==-1&&a){var l,c,d=e.slice(0,n),p=e.slice(n+1);d.length===1&&d[0].type==="ordgroup"?l=d[0]:l={type:"ordgroup",mode:this.mode,body:d},p.length===1&&p[0].type==="ordgroup"?c=p[0]:c={type:"ordgroup",mode:this.mode,body:p};var h;return a==="\\\\abovefrac"?h=this.callFunction(a,[l,e[n],c],[]):h=this.callFunction(a,[l,c],[]),[h]}else return e}handleSupSubscript(e){var n=this.fetch(),a=n.text;this.consume(),this.consumeSpaces();var r;do{var i;r=this.parseGroup(e)}while(((i=r)==null?void 0:i.type)==="internal");if(!r)throw new be("Expected group after '"+a+"'",n);return r}formatUnsupportedCmd(e){for(var n=[],a=0;a<e.length;a++)n.push({type:"textord",mode:"text",text:e[a]});var r={type:"text",mode:this.mode,body:n},i={type:"color",mode:this.mode,color:this.settings.errorColor,body:[r]};return i}parseAtom(e){var n=this.parseGroup("atom",e);if((n==null?void 0:n.type)==="internal"||this.mode==="text")return n;for(var a,r;;){this.consumeSpaces();var i=this.fetch();if(i.text==="\\limits"||i.text==="\\nolimits"){if(n&&n.type==="op"){var l=i.text==="\\limits";n.limits=l,n.alwaysHandleSupSub=!0}else if(n&&n.type==="operatorname")n.alwaysHandleSupSub&&(n.limits=i.text==="\\limits");else throw new be("Limit controls must follow a math operator",i);this.consume()}else if(i.text==="^"){if(a)throw new be("Double superscript",i);a=this.handleSupSubscript("superscript")}else if(i.text==="_"){if(r)throw new be("Double subscript",i);r=this.handleSupSubscript("subscript")}else if(i.text==="'"){if(a)throw new be("Double superscript",i);var c={type:"textord",mode:this.mode,text:"\\prime"},d=[c];for(this.consume();this.fetch().text==="'";)d.push(c),this.consume();this.fetch().text==="^"&&d.push(this.handleSupSubscript("superscript")),a={type:"ordgroup",mode:this.mode,body:d}}else if(d0[i.text]){var p=E2.test(i.text),h=[];for(h.push(new Ba(d0[i.text])),this.consume();;){var m=this.fetch().text;if(!d0[m]||E2.test(m)!==p)break;h.unshift(new Ba(d0[m])),this.consume()}var b=this.subparse(h);p?r={type:"ordgroup",mode:"math",body:b}:a={type:"ordgroup",mode:"math",body:b}}else break}return a||r?{type:"supsub",mode:this.mode,base:n,sup:a,sub:r}:n}parseFunction(e,n){var a=this.fetch(),r=a.text,i=vi[r];if(!i)return null;if(this.consume(),n&&n!=="atom"&&!i.allowedInArgument)throw new be("Got function '"+r+"' with no arguments"+(n?" as "+n:""),a);if(this.mode==="text"&&!i.allowedInText)throw new be("Can't use function '"+r+"' in text mode",a);if(this.mode==="math"&&i.allowedInMath===!1)throw new be("Can't use function '"+r+"' in math mode",a);var{args:l,optArgs:c}=this.parseArguments(r,i);return this.callFunction(r,l,c,a,e)}callFunction(e,n,a,r,i){var l={funcName:e,parser:this,token:r,breakOnTokenText:i},c=vi[e];if(c&&c.handler)return c.handler(l,n,a);throw new be("No function handler for "+e)}parseArguments(e,n){var a=n.numArgs+n.numOptionalArgs;if(a===0)return{args:[],optArgs:[]};for(var r=[],i=[],l=0;l<a;l++){var c=n.argTypes&&n.argTypes[l],d=l<n.numOptionalArgs;("primitive"in n&&n.primitive&&c==null||n.type==="sqrt"&&l===1&&i[0]==null)&&(c="primitive");var p=this.parseGroupOfType("argument to '"+e+"'",c,d);if(d)i.push(p);else if(p!=null)r.push(p);else throw new be("Null argument, please report this as a bug")}return{args:r,optArgs:i}}parseGroupOfType(e,n,a){switch(n){case"color":return this.parseColorGroup(a);case"size":return this.parseSizeGroup(a);case"url":return this.parseUrlGroup(a);case"math":case"text":return this.parseArgumentGroup(a,n);case"hbox":{var r=this.parseArgumentGroup(a,"text");return r!=null?{type:"styling",mode:r.mode,body:[r],style:"text",resetFont:!0}:null}case"raw":{var i=this.parseStringGroup("raw",a);return i!=null?{type:"raw",mode:"text",string:i.text}:null}case"primitive":{if(a)throw new be("A primitive argument cannot be optional");var l=this.parseGroup(e);if(l==null)throw new be("Expected group as "+e,this.fetch());return l}case"original":case null:case void 0:return this.parseArgumentGroup(a);default:throw new be("Unknown group type as "+e,this.fetch())}}consumeSpaces(){for(;this.fetch().text===" ";)this.consume()}parseStringGroup(e,n){var a=this.gullet.scanArgument(n);if(a==null)return null;for(var r="",i;(i=this.fetch()).text!=="EOF";)r+=i.text,this.consume();return this.consume(),a.text=r,a}parseRegexGroup(e,n){for(var a=this.fetch(),r=a,i="",l;(l=this.fetch()).text!=="EOF"&&e.test(i+l.text);)r=l,i+=r.text,this.consume();if(i==="")throw new be("Invalid "+n+": '"+a.text+"'",a);return a.range(r,i)}parseColorGroup(e){var n=this.parseStringGroup("color",e);if(n==null)return null;var a=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(n.text);if(!a)throw new be("Invalid color: '"+n.text+"'",n);var r=a[0];return/^[0-9a-f]{6}$/i.test(r)&&(r="#"+r),{type:"color-token",mode:this.mode,color:r}}parseSizeGroup(e){var n,a=!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",a=!0);var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(n.text);if(!r)throw new be("Invalid size: '"+n.text+"'",n);var i={number:+(r[1]+r[2]),unit:r[3]};if(!C5(i))throw new be("Invalid unit: '"+i.unit+"'",n);return{type:"size",mode:this.mode,value:i,isBlank:a}}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 a=n.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:a}}parseArgumentGroup(e,n){var a=this.gullet.scanArgument(e);if(a==null)return null;var r=this.mode;n&&this.switchMode(n),this.gullet.beginGroup();var i=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var l={type:"ordgroup",mode:this.mode,loc:a.loc,body:i};return n&&this.switchMode(r),l}parseGroup(e,n){var a=this.fetch(),r=a.text,i;if(r==="{"||r==="\\begingroup"){this.consume();var l=r==="{"?"}":"\\endgroup";this.gullet.beginGroup();var c=this.parseExpression(!1,l),d=this.fetch();this.expect(l),this.gullet.endGroup(),i={type:"ordgroup",mode:this.mode,loc:va.range(a,d),body:c,semisimple:r==="\\begingroup"||void 0}}else if(i=this.parseFunction(n,e)||this.parseSymbol(),i==null&&r[0]==="\\"&&!y3.hasOwnProperty(r)){if(this.settings.throwOnError)throw new be("Undefined control sequence: "+r,a);i=this.formatUnsupportedCmd(r),this.consume()}return i}formLigatures(e){for(var n=e.length-1,a=0;a<n;++a){var r=e[a];if(r.type==="textord"){var i=r.text,l=e[a+1];if(!(!l||l.type!=="textord")){if(i==="-"&&l.text==="-"){var c=e[a+2];a+1<n&&c&&c.type==="textord"&&c.text==="-"?(e.splice(a,3,{type:"textord",mode:"text",loc:va.range(r,c),text:"---"}),n-=2):(e.splice(a,2,{type:"textord",mode:"text",loc:va.range(r,l),text:"--"}),n-=1)}(i==="'"||i==="`")&&l.text===i&&(e.splice(a,2,{type:"textord",mode:"text",loc:va.range(r,l),text:i+i}),n-=1)}}}}parseSymbol(){var e=this.fetch(),n=e.text;if(/^\\verb[^a-zA-Z]/.test(n)){this.consume();var a=n.slice(5),r=a.charAt(0)==="*";if(r&&(a=a.slice(1)),a.length<2||a.charAt(0)!==a.slice(-1))throw new be(`\\verb assertion failed --
|
|
306
|
+
please report what input caused this bug`);return a=a.slice(1,-1),{type:"verb",mode:"text",body:a,star:r}}N2.hasOwnProperty(n[0])&&!qt[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=N2[n[0]]+n.slice(1));var i=_R.exec(n);i&&(n=n.substring(0,i.index),n==="i"?n="ı":n==="j"&&(n="ȷ"));var l;if(qt[this.mode][n]){this.settings.strict&&this.mode==="math"&&xg.includes(n)&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+n[0]+'" used in math mode',e);var c=qt[this.mode][n].group,d=va.range(e),p;qN(c)?p={type:"atom",mode:this.mode,family:c,loc:d,text:n}:p={type:c,mode:this.mode,loc:d,text:n},l=p}else if(n.charCodeAt(0)>=128)this.settings.strict&&(_5(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)),l={type:"textord",mode:"text",loc:va.range(e),text:n};else return null;if(this.consume(),i)for(var h=0;h<i[0].length;h++){var m=i[0][h];if(!_m[m])throw new be("Unknown accent ' "+m+"'",e);var b=_m[m][this.mode]||_m[m].text;if(!b)throw new be("Accent "+m+" unsupported in "+this.mode+" mode",e);l={type:"accent",mode:this.mode,loc:va.range(e),label:b,isStretchy:!1,isShifty:!0,base:l}}return l}}Ip.endOfExpression=new Set(["}","\\endgroup","\\end","\\right","&"]);var z1=function(e,n){if(!(typeof e=="string"||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var a=new Ip(e,n);delete a.gullet.macros.current["\\df@tag"];var r=a.parse();if(delete a.gullet.macros.current["\\current@color"],delete a.gullet.macros.current["\\color"],a.gullet.macros.get("\\df@tag")){if(!n.displayMode)throw new be("\\tag works only in display equations");r=[{type:"tag",mode:"text",body:r,tag:a.subparse([new Ba("\\df@tag")])}]}return r},b3=function(e,n,a){n.textContent="";var r=$1(e,a).toNode();n.appendChild(r)};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."),b3=function(){throw new be("KaTeX doesn't work in quirks mode.")});var RR=function(e,n){var a=$1(e,n).toMarkup();return a},DR=function(e,n){var a=new C1(n);return z1(e,a)},v3=function(e,n,a){if(a.throwOnError||!(e instanceof be))throw e;var r=fe(["katex-error"],[new Ia(n)]);return r.setAttribute("title",e.toString()),r.setAttribute("style","color:"+a.errorColor),r},$1=function(e,n){var a=new C1(n);try{var r=z1(e,a);return IN(r,e,a)}catch(i){return v3(i,e,a)}},MR=function(e,n){var a=new C1(n);try{var r=z1(e,a);return PN(r,e,a)}catch(i){return v3(i,e,a)}},OR="0.16.47",LR={Span:Ll,Anchor:Cp,SymbolNode:Ia,SvgNode:Ts,PathNode:Ti,LineNode:vg},R2={version:OR,render:b3,renderToString:RR,ParseError:be,SETTINGS_SCHEMA:gg,__parse:DR,__renderToDomTree:$1,__renderToHTMLTree:MR,__setFontMetrics:bN,__defineSymbol:k,__defineFunction:Ae,__defineMacro:O,__domTree:LR};const jR={};function BR(t){const e=this,n=t||jR,a=e.data(),r=a.micromarkExtensions||(a.micromarkExtensions=[]),i=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),l=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);r.push(IE(n)),i.push(NE()),l.push(RE(n))}const D2=/[#.]/g;function IR(t,e){const n=t||"",a={};let r=0,i,l;for(;r<n.length;){D2.lastIndex=r;const c=D2.exec(n),d=n.slice(r,c?c.index:n.length);d&&(i?i==="#"?a.id=d:Array.isArray(a.className)?a.className.push(d):a.className=[d]:l=d,r+=d.length),c&&(i=c[0],r++)}return{type:"element",tagName:l||e||"div",properties:a,children:[]}}function x3(t,e,n){const a=n?FR(n):void 0;function r(i,l,...c){let d;if(i==null){d={type:"root",children:[]};const p=l;c.unshift(p)}else{d=IR(i,e);const p=d.tagName.toLowerCase(),h=a?a.get(p):void 0;if(d.tagName=h||p,PR(l))c.unshift(l);else for(const[m,b]of Object.entries(l))zR(t,d.properties,m,b)}for(const p of c)jg(d.children,p);return d.type==="element"&&d.tagName==="template"&&(d.content={type:"root",children:d.children},d.children=[]),d}return r}function PR(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 a of n){const r=e[a];if(r&&typeof r=="object"){if(!Array.isArray(r))return!0;const i=r;for(const l of i)if(typeof l!="number"&&typeof l!="string")return!0}}return!!("children"in t&&Array.isArray(t.children))}function zR(t,e,n,a){const r=Dk(t,n);let i;if(a!=null){if(typeof a=="number"){if(Number.isNaN(a))return;i=a}else typeof a=="boolean"?i=a:typeof a=="string"?r.spaceSeparated?i=jx(a):r.commaSeparated?i=Bx(a):r.commaOrSpaceSeparated?i=jx(Bx(a).join(" ")):i=M2(r,r.property,a):Array.isArray(a)?i=[...a]:i=r.property==="style"?$R(a):String(a);if(Array.isArray(i)){const l=[];for(const c of i)l.push(M2(r,r.property,c));i=l}r.property==="className"&&Array.isArray(e.className)&&(i=e.className.concat(i)),e[r.property]=i}}function jg(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)jg(t,n);else if(typeof e=="object"&&"type"in e)e.type==="root"?jg(t,e.children):t.push(e);else throw new Error("Expected node, nodes, or string, got `"+e+"`")}function M2(t,e,n){if(typeof n=="string"){if(t.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((t.boolean||t.overloadedBoolean)&&(n===""||Ix(n)===Ix(e)))return!0}return n}function $R(t){const e=[];for(const[n,a]of Object.entries(t))e.push([n,a].join(": "));return e.join("; ")}function FR(t){const e=new Map;for(const n of t)e.set(n.toLowerCase(),n);return e}const HR=["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"],UR=x3(Mk,"div"),GR=x3(l1,"g",HR),Cm={html:"http://www.w3.org/1999/xhtml",svg:"http://www.w3.org/2000/svg"};function qR(t,e){return w3(t,{})||{type:"root",children:[]}}function w3(t,e){const n=VR(t,e);return n&&e.afterTransform&&e.afterTransform(t,n),n}function VR(t,e){switch(t.nodeType){case 1:return ZR(t,e);case 3:return KR(t);case 8:return YR(t);case 9:return O2(t,e);case 10:return WR();case 11:return O2(t,e);default:return}}function O2(t,e){return{type:"root",children:k3(t,e)}}function WR(){return{type:"doctype"}}function KR(t){return{type:"text",value:t.nodeValue||""}}function YR(t){return{type:"comment",value:t.nodeValue||""}}function ZR(t,e){const n=t.namespaceURI,a=n===Cm.svg?GR:UR,r=n===Cm.html?t.tagName.toLowerCase():t.tagName,i=n===Cm.html&&r==="template"?t.content:t,l=t.getAttributeNames(),c={};let d=-1;for(;++d<l.length;)c[l[d]]=t.getAttribute(l[d])||"";return a(r,c,k3(i,e))}function k3(t,e){const n=t.childNodes,a=[];let r=-1;for(;++r<n.length;){const i=w3(n[r],e);i!==void 0&&a.push(i)}return a}new DOMParser;function XR(t,e){const n=QR(t);return qR(n)}function QR(t){const e=document.createElement("template");return e.innerHTML=t,e.content}const L2=(function(t,e,n){const a=k8(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(a(t.children[e],e,t))return t.children[e]}),To=(function(t){if(t==null)return tD;if(typeof t=="string")return eD(t);if(typeof t=="object")return JR(t);if(typeof t=="function")return F1(t);throw new Error("Expected function, string, or array as `test`")});function JR(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=To(t[n]);return F1(a);function a(...r){let i=-1;for(;++i<e.length;)if(e[i].apply(this,r))return!0;return!1}}function eD(t){return F1(e);function e(n){return n.tagName===t}}function F1(t){return e;function e(n,a,r){return!!(nD(n)&&t.call(this,n,typeof a=="number"?a:void 0,r||void 0))}}function tD(t){return!!(t&&typeof t=="object"&&"type"in t&&t.type==="element"&&"tagName"in t&&typeof t.tagName=="string")}function nD(t){return t!==null&&typeof t=="object"&&"type"in t&&"tagName"in t}const j2=/\n/g,B2=/[\t ]+/g,Bg=To("br"),I2=To(uD),aD=To("p"),P2=To("tr"),rD=To(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",cD,dD]),S3=To(["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 sD(t,e){const n=e||{},a="children"in t?t.children:[],r=S3(t),i=A3(t,{whitespace:n.whitespace||"normal"}),l=[];(t.type==="text"||t.type==="comment")&&l.push(...C3(t,{breakBefore:!0,breakAfter:!0}));let c=-1;for(;++c<a.length;)l.push(..._3(a[c],t,{whitespace:i,breakBefore:c?void 0:r,breakAfter:c<a.length-1?Bg(a[c+1]):r}));const d=[];let p;for(c=-1;++c<l.length;){const h=l[c];typeof h=="number"?p!==void 0&&h>p&&(p=h):h&&(p!==void 0&&p>-1&&d.push(`
|
|
307
|
+
`.repeat(p)||" "),p=-1,d.push(h))}return d.join("")}function _3(t,e,n){return t.type==="element"?iD(t,e,n):t.type==="text"?n.whitespace==="normal"?C3(t,n):oD(t):[]}function iD(t,e,n){const a=A3(t,n),r=t.children||[];let i=-1,l=[];if(rD(t))return l;let c,d;for(Bg(t)||P2(t)&&L2(e,t,P2)?d=`
|
|
308
|
+
`:aD(t)?(c=2,d=2):S3(t)&&(c=1,d=1);++i<r.length;)l=l.concat(_3(r[i],t,{whitespace:a,breakBefore:i?void 0:c,breakAfter:i<r.length-1?Bg(r[i+1]):d}));return I2(t)&&L2(e,t,I2)&&l.push(" "),c&&l.unshift(c),d&&l.push(d),l}function C3(t,e){const n=String(t.value),a=[],r=[];let i=0;for(;i<=n.length;){j2.lastIndex=i;const d=j2.exec(n),p=d&&"index"in d?d.index:n.length;a.push(lD(n.slice(i,p).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),i===0?e.breakBefore:!0,p===n.length?e.breakAfter:!0)),i=p+1}let l=-1,c;for(;++l<a.length;)a[l].charCodeAt(a[l].length-1)===8203||l<a.length-1&&a[l+1].charCodeAt(0)===8203?(r.push(a[l]),c=void 0):a[l]?(typeof c=="number"&&r.push(c),r.push(a[l]),c=0):(l===0||l===a.length-1)&&r.push(0);return r}function oD(t){return[String(t.value)]}function lD(t,e,n){const a=[];let r=0,i;for(;r<t.length;){B2.lastIndex=r;const l=B2.exec(t);i=l?l.index:t.length,!r&&!i&&l&&!e&&a.push(""),r!==i&&a.push(t.slice(r,i)),r=l?i+l[0].length:i}return r!==i&&!n&&a.push(""),a.join(" ")}function A3(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 cD(t){return!!(t.properties||{}).hidden}function uD(t){return t.tagName==="td"||t.tagName==="th"}function dD(t){return t.tagName==="dialog"&&!(t.properties||{}).open}const pD={},fD=[];function hD(t){const e=t||pD;return function(n,a){S8(n,"element",function(r,i){const l=Array.isArray(r.properties.className)?r.properties.className:fD,c=l.includes("language-math"),d=l.includes("math-display"),p=l.includes("math-inline");let h=d;if(!c&&!d&&!p)return;let m=i[i.length-1],b=r;if(r.tagName==="code"&&c&&m&&m.type==="element"&&m.tagName==="pre"&&(b=m,m=i[i.length-2],h=!0),!m)return;const x=sD(b,{whitespace:"pre"});let w;try{w=R2.renderToString(x,{...e,displayMode:h,throwOnError:!0})}catch(C){const E=C,T=E.name.toLowerCase();a.message("Could not render math with KaTeX",{ancestors:[...i,r],cause:E,place:r.position,ruleId:T,source:"rehype-katex"});try{w=R2.renderToString(x,{...e,displayMode:h,strict:"ignore",throwOnError:!1})}catch{w=[{type:"element",tagName:"span",properties:{className:["katex-error"],style:"color:"+(e.errorColor||"#cc0000"),title:String(C)},children:[{type:"text",value:x}]}]}}typeof w=="string"&&(w=XR(w).children);const S=m.children.indexOf(b);return m.children.splice(S,1,...w),_8})}}var Ig=Object.defineProperty,mD=Object.getOwnPropertyDescriptor,gD=Object.getOwnPropertyNames,yD=Object.prototype.hasOwnProperty,bD=(t,e)=>{let n={};for(var a in t)Ig(n,a,{get:t[a],enumerable:!0});return Ig(n,Symbol.toStringTag,{value:"Module"}),n},vD=(t,e,n,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(var r=gD(e),i=0,l=r.length,c;i<l;i++)c=r[i],!yD.call(t,c)&&c!==n&&Ig(t,c,{get:(d=>e[d]).bind(null,c),enumerable:!(a=mD(e,c))||a.enumerable});return t},xD=(t,e,n)=>(vD(t,e,"default"),n);const T3=[{id:"abap",name:"ABAP",import:(()=>j(()=>import("./abap-BdImnpbu.js"),[]))},{id:"actionscript-3",name:"ActionScript",aliases:["actionscript","as3"],import:(()=>j(()=>import("./actionscript-3-B3316cI-.js"),[]))},{id:"ada",name:"Ada",import:(()=>j(()=>import("./ada-bCR0ucgS.js"),[]))},{id:"ahk",name:"AutoHotkey",aliases:["ahk1"],import:(()=>j(()=>import("./ahk-CsyLZFj1.js"),[]))},{id:"ahk2",name:"AutoHotkey2",import:(()=>j(()=>import("./ahk2-8Zs4aa1G.js"),[]))},{id:"angular-html",name:"Angular HTML",import:(()=>j(()=>import("./angular-html-DA-rfuFy.js").then(t=>t.f),__vite__mapDeps([0,1,2,3])))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>j(()=>import("./angular-ts-BrjP3tb8.js"),__vite__mapDeps([4,0,1,2,3,5])))},{id:"apache",name:"Apache Conf",import:(()=>j(()=>import("./apache-Pmp26Uib.js"),[]))},{id:"apex",name:"Apex",import:(()=>j(()=>import("./apex-DhZFqWV2.js"),[]))},{id:"apl",name:"APL",import:(()=>j(()=>import("./apl-CORt7UWP.js"),__vite__mapDeps([6,1,2,3,7,8,9])))},{id:"applescript",name:"AppleScript",import:(()=>j(()=>import("./applescript-Co6uUVPk.js"),[]))},{id:"ara",name:"Ara",import:(()=>j(()=>import("./ara-BRHolxvo.js"),[]))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>j(()=>import("./asciidoc-CSVQ5wI8.js"),[]))},{id:"asm",name:"Assembly",import:(()=>j(()=>import("./asm-D_Q5rh1f.js"),[]))},{id:"astro",name:"Astro",import:(()=>j(()=>import("./astro-HNnZUWAn.js"),__vite__mapDeps([10,9,2,11,3,12,13])))},{id:"awk",name:"AWK",import:(()=>j(()=>import("./awk-DMzUqQB5.js"),[]))},{id:"ballerina",name:"Ballerina",import:(()=>j(()=>import("./ballerina-BFfxhgS-.js"),[]))},{id:"bat",name:"Batch File",aliases:["batch","cmd"],import:(()=>j(()=>import("./bat-CickPsom.js"),[]))},{id:"beancount",name:"Beancount",import:(()=>j(()=>import("./beancount-k_qm7-4y.js"),[]))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>j(()=>import("./berry-uYugtg8r.js"),[]))},{id:"bibtex",name:"BibTeX",import:(()=>j(()=>import("./bibtex-CHM0blh-.js"),[]))},{id:"bicep",name:"Bicep",import:(()=>j(()=>import("./bicep-Bmn6On1c.js"),[]))},{id:"bird2",name:"BIRD2 Configuration",aliases:["bird"],import:(()=>j(()=>import("./bird2-Bx8U0n9b.js"),[]))},{id:"blade",name:"Blade",import:(()=>j(()=>import("./blade-2xfisSek.js"),__vite__mapDeps([14,15,1,2,3,7,8,16,9])))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>j(()=>import("./bsl-DlhNcFeZ.js"),__vite__mapDeps([17,18])))},{id:"c",name:"C",import:(()=>j(()=>import("./c-BIGW1oBm.js"),[]))},{id:"c3",name:"C3",import:(()=>j(()=>import("./c3-Dp5svz6Z.js"),[]))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>j(()=>import("./cadence-Bv_4Rxtq.js"),[]))},{id:"cairo",name:"Cairo",import:(()=>j(()=>import("./cairo-KRGpt6FW.js"),__vite__mapDeps([19,20])))},{id:"chapel",name:"Chapel",aliases:["chpl"],import:(()=>j(()=>import("./chapel-DTp_pixX.js"),__vite__mapDeps([21,22])))},{id:"clarity",name:"Clarity",import:(()=>j(()=>import("./clarity-Dn5IMItf.js"),[]))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>j(()=>import("./clojure-P80f7IUj.js"),[]))},{id:"cmake",name:"CMake",import:(()=>j(()=>import("./cmake-D1j8_8rp.js"),[]))},{id:"cobol",name:"COBOL",import:(()=>j(()=>import("./cobol-nBiQ_Alo.js"),__vite__mapDeps([23,1,2,3,8])))},{id:"codeowners",name:"CODEOWNERS",import:(()=>j(()=>import("./codeowners-Bp6g37R7.js"),[]))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>j(()=>import("./codeql-DsOJ9woJ.js"),[]))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>j(()=>import("./coffee-Ch7k5sss.js"),__vite__mapDeps([24,2])))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>j(()=>import("./common-lisp-Cg-RD9OK.js"),[]))},{id:"coq",name:"Rocq",import:(()=>j(()=>import("./coq-C7JzOVbR.js"),[]))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>j(()=>import("./cpp-BMRokrvK.js"),__vite__mapDeps([25,26,27,22])))},{id:"crystal",name:"Crystal",import:(()=>j(()=>import("./crystal-DGywbUpC.js"),__vite__mapDeps([28,1,2,3,16,22,29])))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>j(()=>import("./csharp-DSvCPggb.js"),[]))},{id:"css",name:"CSS",import:(()=>j(()=>import("./css-CLj8gQPS.js"),[]))},{id:"csv",name:"CSV",import:(()=>j(()=>import("./csv-fuZLfV_i.js"),[]))},{id:"cue",name:"CUE",import:(()=>j(()=>import("./cue-D82EKSYY.js"),[]))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>j(()=>import("./cypher-COkxafJQ.js"),[]))},{id:"d",name:"D",import:(()=>j(()=>import("./d-85-TOEBH.js"),[]))},{id:"dart",name:"Dart",import:(()=>j(()=>import("./dart-bE4Kk8sk.js"),[]))},{id:"dax",name:"DAX",import:(()=>j(()=>import("./dax-CEL-wOlO.js"),[]))},{id:"desktop",name:"Desktop",import:(()=>j(()=>import("./desktop-BmXAJ9_W.js"),[]))},{id:"diff",name:"Diff",import:(()=>j(()=>import("./diff-D97Zzqfu.js"),[]))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>j(()=>import("./docker-BcOcwvcX.js"),[]))},{id:"dotenv",name:"dotEnv",import:(()=>j(()=>import("./dotenv-Da5cRb03.js"),[]))},{id:"dream-maker",name:"Dream Maker",import:(()=>j(()=>import("./dream-maker-BtqSS_iP.js"),[]))},{id:"edge",name:"Edge",import:(()=>j(()=>import("./edge-FbVlp4U3.js"),__vite__mapDeps([30,11,1,2,3,15])))},{id:"elixir",name:"Elixir",import:(()=>j(()=>import("./elixir-CkH2-t6x.js"),__vite__mapDeps([31,1,2,3])))},{id:"elm",name:"Elm",import:(()=>j(()=>import("./elm-DbKCFpqz.js"),__vite__mapDeps([32,27,22])))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>j(()=>import("./emacs-lisp-C_m_b--Z.js"),[]))},{id:"erb",name:"ERB",import:(()=>j(()=>import("./erb-DXfck5VN.js"),__vite__mapDeps([33,1,2,3,34,35,7,8,16,36,11,37,13,25,26,27,22,29,38,39])))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>j(()=>import("./erlang-DsQrWhSR.js"),__vite__mapDeps([40,41])))},{id:"fennel",name:"Fennel",import:(()=>j(()=>import("./fennel-BYunw83y.js"),[]))},{id:"fish",name:"Fish",import:(()=>j(()=>import("./fish-BvzEVeQv.js"),[]))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>j(()=>import("./fluent-C4IJs8-o.js"),[]))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>j(()=>import("./fortran-fixed-form-CkoXwp7k.js"),__vite__mapDeps([42,43])))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:(()=>j(()=>import("./fortran-free-form-BxgE0vQu.js"),[]))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>j(()=>import("./fsharp-CXgrBDvD.js"),__vite__mapDeps([44,41])))},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:(()=>j(()=>import("./gdresource-TyuKm33G.js"),__vite__mapDeps([45,46,47])))},{id:"gdscript",name:"GDScript",aliases:["gd"],import:(()=>j(()=>import("./gdscript-DqcFQ5yU.js"),[]))},{id:"gdshader",name:"GDShader",import:(()=>j(()=>import("./gdshader-DkwncUOv.js"),[]))},{id:"genie",name:"Genie",import:(()=>j(()=>import("./genie-D0YGMca9.js"),[]))},{id:"gherkin",name:"Gherkin",import:(()=>j(()=>import("./gherkin-DyxjwDmM.js"),[]))},{id:"git-commit",name:"Git Commit Message",import:(()=>j(()=>import("./git-commit-F4YmCXRG.js"),__vite__mapDeps([48,49])))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>j(()=>import("./git-rebase-r7XF79zn.js"),__vite__mapDeps([50,29])))},{id:"gleam",name:"Gleam",import:(()=>j(()=>import("./gleam-BspZqrRM.js"),[]))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>j(()=>import("./glimmer-js-ByusRIyA.js"),__vite__mapDeps([51,2,11,3,1])))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>j(()=>import("./glimmer-ts-BfAWNZQY.js"),__vite__mapDeps([52,11,3,2,1])))},{id:"glsl",name:"GLSL",import:(()=>j(()=>import("./glsl-DplSGwfg.js"),__vite__mapDeps([27,22])))},{id:"gn",name:"GN",import:(()=>j(()=>import("./gn-n2N0HUVH.js"),[]))},{id:"gnuplot",name:"Gnuplot",import:(()=>j(()=>import("./gnuplot-DdkO51Og.js"),[]))},{id:"go",name:"Go",import:(()=>j(()=>import("./go-C27-OAKa.js"),[]))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>j(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([36,2,11,37,13])))},{id:"groovy",name:"Groovy",import:(()=>j(()=>import("./groovy-gcz8RCvz.js"),[]))},{id:"hack",name:"Hack",import:(()=>j(()=>import("./hack-BWmVpMyf.js"),__vite__mapDeps([53,1,2,3,16])))},{id:"haml",name:"Ruby Haml",import:(()=>j(()=>import("./haml-D5jkg6IW.js"),__vite__mapDeps([35,2,3])))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>j(()=>import("./handlebars-BpdQsYii.js"),__vite__mapDeps([54,1,2,3,39])))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>j(()=>import("./haskell-Df6bDoY_.js"),[]))},{id:"haxe",name:"Haxe",import:(()=>j(()=>import("./haxe-CfZj7gIn.js"),[]))},{id:"hcl",name:"HashiCorp HCL",import:(()=>j(()=>import("./hcl-BWvSN4gD.js"),[]))},{id:"hjson",name:"Hjson",import:(()=>j(()=>import("./hjson-D5-asLiD.js"),[]))},{id:"hlsl",name:"HLSL",import:(()=>j(()=>import("./hlsl-D3lLCCz7.js"),[]))},{id:"html",name:"HTML",import:(()=>j(()=>import("./html-pp8916En.js"),__vite__mapDeps([1,2,3])))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>j(()=>import("./html-derivative-DlHx6ybY.js"),__vite__mapDeps([15,1,2,3])))},{id:"http",name:"HTTP",import:(()=>j(()=>import("./http-jrhK8wxY.js"),__vite__mapDeps([55,29,9,7,8,36,2,11,37,13])))},{id:"hurl",name:"Hurl",import:(()=>j(()=>import("./hurl-irOxFIW8.js"),__vite__mapDeps([56,36,2,11,37,13,7,8,57])))},{id:"hxml",name:"HXML",import:(()=>j(()=>import("./hxml-2-FPmUDs.js"),__vite__mapDeps([58,59])))},{id:"hy",name:"Hy",import:(()=>j(()=>import("./hy-DFXneXwc.js"),[]))},{id:"imba",name:"Imba",import:(()=>j(()=>import("./imba-DGztddWO.js"),[]))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>j(()=>import("./ini-BEwlwnbL.js"),[]))},{id:"java",name:"Java",import:(()=>j(()=>import("./java-CylS5w8V.js"),[]))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>j(()=>import("./javascript-wDzz0qaB.js"),[]))},{id:"jinja",name:"Jinja",import:(()=>j(()=>import("./jinja-f2NsQr07.js"),__vite__mapDeps([60,1,2,3])))},{id:"jison",name:"Jison",import:(()=>j(()=>import("./jison-wvAkD_A8.js"),__vite__mapDeps([61,2])))},{id:"json",name:"JSON",import:(()=>j(()=>import("./json-Cp-IABpG.js"),[]))},{id:"json5",name:"JSON5",import:(()=>j(()=>import("./json5-C9tS-k6U.js"),[]))},{id:"jsonc",name:"JSON with Comments",import:(()=>j(()=>import("./jsonc-Des-eS-w.js"),[]))},{id:"jsonl",name:"JSON Lines",import:(()=>j(()=>import("./jsonl-DcaNXYhu.js"),[]))},{id:"jsonnet",name:"Jsonnet",import:(()=>j(()=>import("./jsonnet-DFQXde-d.js"),[]))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>j(()=>import("./jssm-C2t-YnRu.js"),[]))},{id:"jsx",name:"JSX",import:(()=>j(()=>import("./jsx-g9-lgVsj.js"),[]))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>j(()=>import("./julia-5Bft2YPA.js"),__vite__mapDeps([62,25,26,27,22,20,2,63,16])))},{id:"just",name:"Just",aliases:["justfile"],import:(()=>j(()=>import("./just-Cwhn7H3k.js"),__vite__mapDeps([64,29,2,11,65,1,3,7,8,16,20,34,35,36,37,13,25,26,27,22,38,39])))},{id:"kdl",name:"KDL",import:(()=>j(()=>import("./kdl-DV7GczEv.js"),[]))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>j(()=>import("./kotlin-BdnUsdx6.js"),[]))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>j(()=>import("./kusto-wEQ09or8.js"),[]))},{id:"latex",name:"LaTeX",import:(()=>j(()=>import("./latex-D5pSuvFb.js"),__vite__mapDeps([66,67,63])))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>j(()=>import("./lean-BZvkOJ9d.js"),[]))},{id:"less",name:"Less",import:(()=>j(()=>import("./less-B1dDrJ26.js"),[]))},{id:"liquid",name:"Liquid",import:(()=>j(()=>import("./liquid-C0sCDyMI.js"),__vite__mapDeps([68,1,2,3,9])))},{id:"llvm",name:"LLVM IR",import:(()=>j(()=>import("./llvm-BZoOZj88.js"),[]))},{id:"log",name:"Log file",import:(()=>j(()=>import("./log-2UxHyX5q.js"),[]))},{id:"logo",name:"Logo",import:(()=>j(()=>import("./logo-BtOb2qkB.js"),[]))},{id:"lua",name:"Lua",import:(()=>j(()=>import("./lua-BaeVxFsk.js"),__vite__mapDeps([38,22])))},{id:"luau",name:"Luau",import:(()=>j(()=>import("./luau-BnpPk5vE.js"),[]))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>j(()=>import("./make-CHLpvVh8.js"),[]))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>j(()=>import("./markdown-Cvjx9yec.js"),[]))},{id:"marko",name:"Marko",import:(()=>j(()=>import("./marko-DjSrsDqO.js"),__vite__mapDeps([69,3,70,5,11])))},{id:"matlab",name:"MATLAB",import:(()=>j(()=>import("./matlab-D7o27uSR.js"),[]))},{id:"mdc",name:"MDC",import:(()=>j(()=>import("./mdc-D1_yUvq7.js"),__vite__mapDeps([71,41,39,15,1,2,3])))},{id:"mdx",name:"MDX",import:(()=>j(()=>import("./mdx-Cmh6b_Ma.js"),[]))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>j(()=>import("./mermaid-CQcHuHx7.js"),[]))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>j(()=>import("./mipsasm-CKIfxQSi.js"),[]))},{id:"mojo",name:"Mojo",import:(()=>j(()=>import("./mojo-DJz3ZmWd.js"),[]))},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:(()=>j(()=>import("./moonbit-CHtswR0a.js"),[]))},{id:"move",name:"Move",import:(()=>j(()=>import("./move-el3G9tDJ.js"),[]))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>j(()=>import("./narrat-DRg8JJMk.js"),[]))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>j(()=>import("./nextflow-C-mBbutL.js"),__vite__mapDeps([72,73])))},{id:"nextflow-groovy",name:"Nextflow Groovy",import:(()=>j(()=>import("./nextflow-groovy-vE_lwT2v.js"),[]))},{id:"nginx",name:"Nginx",import:(()=>j(()=>import("./nginx-BpAMiNFr.js"),__vite__mapDeps([74,38,22])))},{id:"nim",name:"Nim",import:(()=>j(()=>import("./nim-BIad80T-.js"),__vite__mapDeps([75,22,1,2,3,7,8,27,41])))},{id:"nix",name:"Nix",import:(()=>j(()=>import("./nix-CwoSXNpI.js"),[]))},{id:"nsis",name:"NSIS",import:(()=>j(()=>import("./nsis-BlV79W_Q.js"),[]))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>j(()=>import("./nushell-D3jzshHO.js"),[]))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>j(()=>import("./objective-c-DXmwc3jG.js"),[]))},{id:"objective-cpp",name:"Objective-C++",import:(()=>j(()=>import("./objective-cpp-CLxacb5B.js"),[]))},{id:"ocaml",name:"OCaml",import:(()=>j(()=>import("./ocaml-C0hk2d4L.js"),[]))},{id:"odin",name:"Odin",import:(()=>j(()=>import("./odin-BBf5iR-q.js"),[]))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>j(()=>import("./openscad-C4EeE6gA.js"),[]))},{id:"org",name:"Org Markup",import:(()=>j(()=>import("./org-DM6o9KBp.js"),__vite__mapDeps([76,2,11,13,8,20,26,3,38,22,77,78,65,1,7,16,63,34,35,36,37,25,27,29,39,79,9,80,81,24,82,49,83,84,85,70,5,86,87,88,89,90,75,41,31,40,91,92,93,48,50,66,67])))},{id:"pascal",name:"Pascal",import:(()=>j(()=>import("./pascal-D93ZcfNL.js"),[]))},{id:"perl",name:"Perl",import:(()=>j(()=>import("./perl-B9cMNwum.js"),__vite__mapDeps([65,1,2,3,7,8,16])))},{id:"php",name:"PHP",import:(()=>j(()=>import("./php-Csjmro_R.js"),__vite__mapDeps([79,1,2,3,7,8,16,9])))},{id:"pkl",name:"Pkl",import:(()=>j(()=>import("./pkl-u5AG7uiY.js"),[]))},{id:"plsql",name:"PL/SQL",import:(()=>j(()=>import("./plsql-ChMvpjG-.js"),[]))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>j(()=>import("./po-BTJTHyun.js"),[]))},{id:"polar",name:"Polar",import:(()=>j(()=>import("./polar-C0HS_06l.js"),[]))},{id:"postcss",name:"PostCSS",import:(()=>j(()=>import("./postcss-CXtECtnM.js"),[]))},{id:"powerquery",name:"PowerQuery",import:(()=>j(()=>import("./powerquery-CEu0bR-o.js"),[]))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1","pwsh"],import:(()=>j(()=>import("./powershell-BmBUJMz7.js"),[]))},{id:"prisma",name:"Prisma",import:(()=>j(()=>import("./prisma-Vru482bI.js"),[]))},{id:"prolog",name:"Prolog",import:(()=>j(()=>import("./prolog-CbFg5uaA.js"),[]))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>j(()=>import("./proto-C7zT0LnQ.js"),[]))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>j(()=>import("./pug-DKIMFp6K.js"),__vite__mapDeps([94,2,3,1])))},{id:"puppet",name:"Puppet",import:(()=>j(()=>import("./puppet-BMWR74SV.js"),[]))},{id:"purescript",name:"PureScript",import:(()=>j(()=>import("./purescript-CklMAg4u.js"),[]))},{id:"python",name:"Python",aliases:["py"],import:(()=>j(()=>import("./python-B6aJPvgy.js"),[]))},{id:"qml",name:"QML",import:(()=>j(()=>import("./qml-3beO22l8.js"),__vite__mapDeps([95,2])))},{id:"qmldir",name:"QML Directory",import:(()=>j(()=>import("./qmldir-C8lEn-DE.js"),[]))},{id:"qss",name:"Qt Style Sheets",import:(()=>j(()=>import("./qss-IeuSbFQv.js"),[]))},{id:"r",name:"R",import:(()=>j(()=>import("./r-Cf5RLm7j.js"),[]))},{id:"racket",name:"Racket",import:(()=>j(()=>import("./racket-BqYA7rlc.js"),[]))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>j(()=>import("./raku-DXvB9xmW.js"),[]))},{id:"razor",name:"ASP.NET Razor",import:(()=>j(()=>import("./razor-BjBPvh-w.js"),__vite__mapDeps([96,1,2,3,89])))},{id:"rbs",name:"RBS",aliases:["ruby-signature"],import:(()=>j(()=>import("./rbs-CpoqiR4B.js"),[]))},{id:"reg",name:"Windows Registry Script",import:(()=>j(()=>import("./reg-C-SQnVFl.js"),[]))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>j(()=>import("./regexp-CDVJQ6XC.js"),[]))},{id:"rel",name:"Rel",import:(()=>j(()=>import("./rel-C3B-1QV4.js"),[]))},{id:"riscv",name:"RISC-V",import:(()=>j(()=>import("./riscv-BM1_JUlF.js"),[]))},{id:"ron",name:"RON",import:(()=>j(()=>import("./ron-D8l8udqQ.js"),[]))},{id:"rosmsg",name:"ROS Interface",import:(()=>j(()=>import("./rosmsg-BJDFO7_C.js"),[]))},{id:"rst",name:"reStructuredText",import:(()=>j(()=>import("./rst-bs7f0vWN.js"),__vite__mapDeps([97,15,1,2,3,25,26,27,22,20,29,39,98,34,35,7,8,16,36,11,37,13,38])))},{id:"ruby",name:"Ruby",aliases:["rb"],import:(()=>j(()=>import("./ruby-C0TQ7zu5.js"),__vite__mapDeps([34,1,2,3,35,7,8,16,36,11,37,13,25,26,27,22,29,38,39])))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>j(()=>import("./rust-B1yitclQ.js"),[]))},{id:"sas",name:"SAS",import:(()=>j(()=>import("./sas-DEy46yEz.js"),__vite__mapDeps([99,16])))},{id:"sass",name:"Sass",import:(()=>j(()=>import("./sass-Cj5Yp3dK.js"),[]))},{id:"scala",name:"Scala",import:(()=>j(()=>import("./scala-CqE71os6.js"),[]))},{id:"scheme",name:"Scheme",import:(()=>j(()=>import("./scheme-C98Dy4si.js"),[]))},{id:"scss",name:"SCSS",import:(()=>j(()=>import("./scss-D5BDwBP9.js"),__vite__mapDeps([5,3])))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>j(()=>import("./sdbl-DVxCFoDh.js"),[]))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>j(()=>import("./shaderlab-Dg9Lc6iA.js"),__vite__mapDeps([100,101])))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>j(()=>import("./shellscript-Yzrsuije.js"),[]))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>j(()=>import("./shellsession-BADoaaVG.js"),__vite__mapDeps([102,29])))},{id:"smalltalk",name:"GNU Smalltalk",import:(()=>j(()=>import("./smalltalk-BOQMe2GC.js"),[]))},{id:"smithy",name:"Smithy",import:(()=>j(()=>import("./smithy-cds9vsN8.js"),[]))},{id:"solidity",name:"Solidity",import:(()=>j(()=>import("./solidity-DijEV5ha.js"),[]))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>j(()=>import("./soy-8wufbnw4.js"),__vite__mapDeps([103,1,2,3])))},{id:"sparql",name:"SPARQL",import:(()=>j(()=>import("./sparql-rVzFXLq3.js"),__vite__mapDeps([104,105])))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>j(()=>import("./splunk-BtCnVYZw.js"),[]))},{id:"sql",name:"SQL",import:(()=>j(()=>import("./sql-CRqJ_cUM.js"),[]))},{id:"ssh-config",name:"SSH Config",import:(()=>j(()=>import("./ssh-config-_ykCGR6B.js"),[]))},{id:"stata",name:"Stata",import:(()=>j(()=>import("./stata-DI20mbqo.js"),__vite__mapDeps([106,16])))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>j(()=>import("./stylus-BEDo0Tqx.js"),[]))},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:(()=>j(()=>import("./surrealql-Cjom0U5J.js"),__vite__mapDeps([107,2])))},{id:"svelte",name:"Svelte",import:(()=>j(()=>import("./svelte-Cy7k_4gC.js"),__vite__mapDeps([108,2,11,3,12])))},{id:"swift",name:"Swift",import:(()=>j(()=>import("./swift-C2oV4EkX.js"),[]))},{id:"system-verilog",name:"SystemVerilog",import:(()=>j(()=>import("./system-verilog-0hqHdDBg.js"),[]))},{id:"systemd",name:"Systemd Units",import:(()=>j(()=>import("./systemd-4A_iFExJ.js"),[]))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>j(()=>import("./talonscript-CkByrt1z.js"),[]))},{id:"tasl",name:"Tasl",import:(()=>j(()=>import("./tasl-QIJgUcNo.js"),[]))},{id:"tcl",name:"Tcl",import:(()=>j(()=>import("./tcl-dwOrl1Do.js"),[]))},{id:"templ",name:"Templ",import:(()=>j(()=>import("./templ-DhtptRzy.js"),__vite__mapDeps([109,84,2,3])))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>j(()=>import("./terraform-BETggiCN.js"),[]))},{id:"tex",name:"TeX",import:(()=>j(()=>import("./tex-D96PA37w.js"),__vite__mapDeps([67,63])))},{id:"toml",name:"TOML",import:(()=>j(()=>import("./toml-vGWfd6FD.js"),[]))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>j(()=>import("./ts-tags-D351s5mN.js"),__vite__mapDeps([110,11,3,2,27,22,1,16,7,8])))},{id:"tsv",name:"TSV",import:(()=>j(()=>import("./tsv-B_m7g4N7.js"),[]))},{id:"tsx",name:"TSX",import:(()=>j(()=>import("./tsx-COt5Ahok.js"),[]))},{id:"turtle",name:"Turtle",import:(()=>j(()=>import("./turtle-BsS91CYL.js"),[]))},{id:"twig",name:"Twig",import:(()=>j(()=>import("./twig-27uCiNez.js"),__vite__mapDeps([111,3,2,5,79,1,7,8,16,9,20,34,35,36,11,37,13,25,26,27,22,29,38,39])))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>j(()=>import("./typescript-BPQ3VLAy.js"),[]))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>j(()=>import("./typespec-CAFt9gP4.js"),[]))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>j(()=>import("./typst-BUadGCkm.js"),__vite__mapDeps([112,113,114,22,81,24,2,25,26,27,3,89,90,49,83,31,1,40,41,44,48,50,29,84,85,54,39,77,8,115,9,62,20,63,16,66,67,70,116,38,78,82,65,7,86,79,117,94,34,35,36,11,37,13,5,118,93,87,88,111,119,120,80])))},{id:"v",name:"V",import:(()=>j(()=>import("./v-BGw2Nkan.js"),[]))},{id:"vala",name:"Vala",import:(()=>j(()=>import("./vala-CsfeWuGM.js"),[]))},{id:"vb",name:"Visual Basic",import:(()=>j(()=>import("./vb-Cu-pLBUe.js"),[]))},{id:"verilog",name:"Verilog",import:(()=>j(()=>import("./verilog-nZwndyjY.js"),[]))},{id:"vhdl",name:"VHDL",import:(()=>j(()=>import("./vhdl-CeAyd5Ju.js"),[]))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>j(()=>import("./viml-CJc9bBzg.js"),[]))},{id:"vue",name:"Vue",import:(()=>j(()=>import("./vue-BqiEGhQt.js"),__vite__mapDeps([121,3,2,11,9,1,15])))},{id:"vue-html",name:"Vue HTML",import:(()=>j(()=>import("./vue-html-AaS7Mt5G.js"),__vite__mapDeps([122,2])))},{id:"vue-vine",name:"Vue Vine",import:(()=>j(()=>import("./vue-vine-BoDAl6tE.js"),__vite__mapDeps([123,3,5,70,124,12,2])))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>j(()=>import("./vyper-CDx5xZoG.js"),[]))},{id:"wasm",name:"WebAssembly",import:(()=>j(()=>import("./wasm-MzD3tlZU.js"),[]))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>j(()=>import("./wenyan-BV7otONQ.js"),[]))},{id:"wgsl",name:"WGSL",import:(()=>j(()=>import("./wgsl-Dx-B1_4e.js"),[]))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>j(()=>import("./wikitext-BhOHFoWU.js"),[]))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>j(()=>import("./wit-5i3qLPDT.js"),[]))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>j(()=>import("./wolfram-lXgVvXCa.js"),[]))},{id:"xml",name:"XML",import:(()=>j(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([7,8])))},{id:"xsl",name:"XSL",import:(()=>j(()=>import("./xsl-CtQFsRM5.js"),__vite__mapDeps([93,7,8])))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>j(()=>import("./yaml-Buea-lGh.js"),[]))},{id:"zenscript",name:"ZenScript",import:(()=>j(()=>import("./zenscript-DVFEvuxE.js"),[]))},{id:"zig",name:"Zig",import:(()=>j(()=>import("./zig-VOosw3JB.js"),[]))}],wD=Object.fromEntries(T3.map(t=>[t.id,t.import])),kD=Object.fromEntries(T3.flatMap(t=>{var e;return((e=t.aliases)==null?void 0:e.map(n=>[n,t.import]))||[]})),SD={...wD,...kD},_D=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>j(()=>import("./andromeeda-C4gqWexZ.js"),[]))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>j(()=>import("./aurora-x-D-2ljcwZ.js"),[]))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>j(()=>import("./ayu-dark-DYE7WIF3.js"),[]))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>j(()=>import("./ayu-light-BA47KaF1.js"),[]))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>j(()=>import("./ayu-mirage-32ctXXKs.js"),[]))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>j(()=>import("./catppuccin-frappe-CZL1YF0i.js"),[]))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>j(()=>import("./catppuccin-latte-DH-8KZSZ.js"),[]))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>j(()=>import("./catppuccin-macchiato-B7yYVSCf.js"),[]))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>j(()=>import("./catppuccin-mocha-Ct7hS0mc.js"),[]))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>j(()=>import("./dark-plus-C3mMm8J8.js"),[]))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>j(()=>import("./dracula-BzJJZx-M.js"),[]))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>j(()=>import("./dracula-soft-BXkSAIEj.js"),[]))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>j(()=>import("./everforest-dark-BgDCqdQA.js"),[]))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>j(()=>import("./everforest-light-C8M2exoo.js"),[]))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>j(()=>import("./github-dark-DHJKELXO.js"),[]))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>j(()=>import("./github-dark-default-Cuk6v7N8.js"),[]))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>j(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[]))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>j(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[]))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>j(()=>import("./github-light-DAi9KRSo.js"),[]))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>j(()=>import("./github-light-default-D7oLnXFd.js"),[]))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>j(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[]))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>j(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[]))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>j(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[]))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>j(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[]))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>j(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[]))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>j(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[]))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>j(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[]))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>j(()=>import("./horizon-BUw7H-hv.js"),[]))},{id:"horizon-bright",displayName:"Horizon Bright",type:"light",import:(()=>j(()=>import("./horizon-bright-CUuTKBJd.js"),[]))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>j(()=>import("./houston-DnULxvSX.js"),[]))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>j(()=>import("./kanagawa-dragon-BuwD2xS4.js"),[]))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>j(()=>import("./kanagawa-lotus-C3DzagqV.js"),[]))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>j(()=>import("./kanagawa-wave-DFGoQZhC.js"),[]))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>j(()=>import("./laserwave-DUszq2jm.js"),[]))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>j(()=>import("./light-plus-B7mTdjB0.js"),[]))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>j(()=>import("./material-theme-D5KoaKCx.js"),[]))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>j(()=>import("./material-theme-darker-BfHTSMKl.js"),[]))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>j(()=>import("./material-theme-lighter-B0m2ddpp.js"),[]))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>j(()=>import("./material-theme-ocean-CyktbL80.js"),[]))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>j(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[]))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>j(()=>import("./min-dark-CafNBF8u.js"),[]))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>j(()=>import("./min-light-CTRr51gU.js"),[]))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>j(()=>import("./monokai-BRVnQi9A.js"),[]))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>j(()=>import("./night-owl-C39BiMTA.js"),[]))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>j(()=>import("./night-owl-light-CMTm3GFP.js"),[]))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>j(()=>import("./nord-Ddv68eIx.js"),[]))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>j(()=>import("./one-dark-pro-DVMEJ2y_.js"),[]))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>j(()=>import("./one-light-C3Wv6jpd.js"),[]))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>j(()=>import("./plastic-3e1v2bzS.js"),[]))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>j(()=>import("./poimandres-CS3Unz2-.js"),[]))},{id:"red",displayName:"Red",type:"dark",import:(()=>j(()=>import("./red-hvxz__6c.js"),[]))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>j(()=>import("./rose-pine-5qJOZa0Y.js"),[]))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>j(()=>import("./rose-pine-dawn-zx0QlTCp.js"),[]))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>j(()=>import("./rose-pine-moon-C9pEdX9L.js"),[]))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>j(()=>import("./slack-dark-BthQWCQV.js"),[]))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>j(()=>import("./slack-ochin-DqwNpetd.js"),[]))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>j(()=>import("./snazzy-light-Bw305WKR.js"),[]))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>j(()=>import("./solarized-dark-CpvCGNkr.js"),[]))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>j(()=>import("./solarized-light-Dlz6yCKv.js"),[]))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>j(()=>import("./synthwave-84-CbfX1IO0.js"),[]))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>j(()=>import("./tokyo-night-hegEt444.js"),[]))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>j(()=>import("./vesper-DRje8inN.js"),[]))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>j(()=>import("./vitesse-black-Bkuqu6BP.js"),[]))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>j(()=>import("./vitesse-dark-D0r3Knsf.js"),[]))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>j(()=>import("./vitesse-light-CVO1_9PV.js"),[]))}],CD=Object.fromEntries(_D.map(t=>[t.id,t.import]));var H1=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function AD(){return 2147483648}function TD(){return typeof performance<"u"?performance.now():Date.now()}const ED=(t,e)=>t+(e-t%e)%e;async function ND(t){let e,n;const a={};function r(x){n=x,a.HEAPU8=new Uint8Array(x),a.HEAPU32=new Uint32Array(x)}function i(x,w,S){a.HEAPU8.copyWithin(x,w,w+S)}function l(x){try{return e.grow(x-n.byteLength+65535>>>16),r(e.buffer),1}catch{}}function c(x){const w=a.HEAPU8.length;x=x>>>0;const S=AD();if(x>S)return!1;for(let C=1;C<=4;C*=2){let E=w*(1+.2/C);E=Math.min(E,x+100663296);const T=Math.min(S,ED(Math.max(x,E),65536));if(l(T))return!0}return!1}const d=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function p(x,w,S=1024){const C=w+S;let E=w;for(;x[E]&&!(E>=C);)++E;if(E-w>16&&x.buffer&&d)return d.decode(x.subarray(w,E));let T="";for(;w<E;){let L=x[w++];if(!(L&128)){T+=String.fromCharCode(L);continue}const D=x[w++]&63;if((L&224)===192){T+=String.fromCharCode((L&31)<<6|D);continue}const B=x[w++]&63;if((L&240)===224?L=(L&15)<<12|D<<6|B:L=(L&7)<<18|D<<12|B<<6|x[w++]&63,L<65536)T+=String.fromCharCode(L);else{const H=L-65536;T+=String.fromCharCode(55296|H>>10,56320|H&1023)}}return T}function h(x,w){return x?p(a.HEAPU8,x,w):""}const m={emscripten_get_now:TD,emscripten_memcpy_big:i,emscripten_resize_heap:c,fd_write:()=>0};async function b(){const w=await t({env:m,wasi_snapshot_preview1:m});e=w.memory,r(e.buffer),Object.assign(a,w),a.UTF8ToString=h}return await b(),a}var RD=Object.defineProperty,DD=(t,e,n)=>e in t?RD(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,An=(t,e,n)=>DD(t,typeof e!="symbol"?e+"":e,n);let Ln=null;function MD(t){throw new H1(t.UTF8ToString(t.getLastOnigError()))}class Pp{constructor(e){An(this,"utf16Length"),An(this,"utf8Length"),An(this,"utf16Value"),An(this,"utf8Value"),An(this,"utf16OffsetToUtf8"),An(this,"utf8OffsetToUtf16");const n=e.length,a=Pp._utf8ByteLength(e),r=a!==n,i=r?new Uint32Array(n+1):null;r&&(i[n]=a);const l=r?new Uint32Array(a+1):null;r&&(l[a]=n);const c=new Uint8Array(a);let d=0;for(let p=0;p<n;p++){const h=e.charCodeAt(p);let m=h,b=!1;if(h>=55296&&h<=56319&&p+1<n){const x=e.charCodeAt(p+1);x>=56320&&x<=57343&&(m=(h-55296<<10)+65536|x-56320,b=!0)}r&&(i[p]=d,b&&(i[p+1]=d),m<=127?l[d+0]=p:m<=2047?(l[d+0]=p,l[d+1]=p):m<=65535?(l[d+0]=p,l[d+1]=p,l[d+2]=p):(l[d+0]=p,l[d+1]=p,l[d+2]=p,l[d+3]=p)),m<=127?c[d++]=m:m<=2047?(c[d++]=192|(m&1984)>>>6,c[d++]=128|(m&63)>>>0):m<=65535?(c[d++]=224|(m&61440)>>>12,c[d++]=128|(m&4032)>>>6,c[d++]=128|(m&63)>>>0):(c[d++]=240|(m&1835008)>>>18,c[d++]=128|(m&258048)>>>12,c[d++]=128|(m&4032)>>>6,c[d++]=128|(m&63)>>>0),b&&p++}this.utf16Length=n,this.utf8Length=a,this.utf16Value=e,this.utf8Value=c,this.utf16OffsetToUtf8=i,this.utf8OffsetToUtf16=l}static _utf8ByteLength(e){let n=0;for(let a=0,r=e.length;a<r;a++){const i=e.charCodeAt(a);let l=i,c=!1;if(i>=55296&&i<=56319&&a+1<r){const d=e.charCodeAt(a+1);d>=56320&&d<=57343&&(l=(i-55296<<10)+65536|d-56320,c=!0)}l<=127?n+=1:l<=2047?n+=2:l<=65535?n+=3:n+=4,c&&a++}return n}createString(e){const n=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,n),n}}const zp=class Lr{constructor(e){if(An(this,"id",++Lr.LAST_ID),An(this,"_onigBinding"),An(this,"content"),An(this,"utf16Length"),An(this,"utf8Length"),An(this,"utf16OffsetToUtf8"),An(this,"utf8OffsetToUtf16"),An(this,"ptr"),!Ln)throw new H1("Must invoke loadWasm first.");this._onigBinding=Ln,this.content=e;const n=new Pp(e);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!Lr._sharedPtrInUse?(Lr._sharedPtr||(Lr._sharedPtr=Ln.omalloc(1e4)),Lr._sharedPtrInUse=!0,Ln.HEAPU8.set(n.utf8Value,Lr._sharedPtr),this.ptr=Lr._sharedPtr):this.ptr=n.createString(Ln)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===Lr._sharedPtr?Lr._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};An(zp,"LAST_ID",0);An(zp,"_sharedPtr",0);An(zp,"_sharedPtrInUse",!1);let E3=zp;class OD{constructor(e){if(An(this,"_onigBinding"),An(this,"_ptr"),!Ln)throw new H1("Must invoke loadWasm first.");const n=[],a=[];for(let c=0,d=e.length;c<d;c++){const p=new Pp(e[c]);n[c]=p.createString(Ln),a[c]=p.utf8Length}const r=Ln.omalloc(4*e.length);Ln.HEAPU32.set(n,r/4);const i=Ln.omalloc(4*e.length);Ln.HEAPU32.set(a,i/4);const l=Ln.createOnigScanner(r,i,e.length);for(let c=0,d=e.length;c<d;c++)Ln.ofree(n[c]);Ln.ofree(i),Ln.ofree(r),l===0&&MD(Ln),this._onigBinding=Ln,this._ptr=l}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,n,a){let r=0;if(typeof a=="number"&&(r=a),typeof e=="string"){e=new E3(e);const i=this._findNextMatchSync(e,n,!1,r);return e.dispose(),i}return this._findNextMatchSync(e,n,!1,r)}_findNextMatchSync(e,n,a,r){const i=this._onigBinding,l=i.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(n),r);if(l===0)return null;const c=i.HEAPU32;let d=l/4;const p=c[d++],h=c[d++],m=[];for(let b=0;b<h;b++){const x=e.convertUtf8OffsetToUtf16(c[d++]),w=e.convertUtf8OffsetToUtf16(c[d++]);m[b]={start:x,end:w,length:w-x}}return{index:p,captureIndices:m}}}function LD(t){return typeof t.instantiator=="function"}function jD(t){return typeof t.default=="function"}function BD(t){return typeof t.data<"u"}function ID(t){return typeof Response<"u"&&t instanceof Response}function PD(t){var e;return typeof ArrayBuffer<"u"&&(t instanceof ArrayBuffer||ArrayBuffer.isView(t))||typeof Buffer<"u"&&((e=Buffer.isBuffer)==null?void 0:e.call(Buffer,t))||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&t instanceof Uint32Array}let p0;function N3(t){if(p0)return p0;async function e(){Ln=await ND(async n=>{let a=t;return a=await a,typeof a=="function"&&(a=await a(n)),typeof a=="function"&&(a=await a(n)),LD(a)?a=await a.instantiator(n):jD(a)?a=await a.default(n):(BD(a)&&(a=a.data),ID(a)?typeof WebAssembly.instantiateStreaming=="function"?a=await zD(a)(n):a=await $D(a)(n):PD(a)?a=await Am(a)(n):a instanceof WebAssembly.Module?a=await Am(a)(n):"default"in a&&a.default instanceof WebAssembly.Module&&(a=await Am(a.default)(n))),"instance"in a&&(a=a.instance),"exports"in a&&(a=a.exports),a})}return p0=e(),p0}function Am(t){return e=>WebAssembly.instantiate(t,e)}function zD(t){return e=>WebAssembly.instantiateStreaming(t,e)}function $D(t){return async e=>{const n=await t.arrayBuffer();return WebAssembly.instantiate(n,e)}}let R3;function FD(t){R3=t}function HD(){return R3}async function UD(t){return t&&await N3(t),{createScanner(e){return new OD(e.map(n=>typeof n=="string"?n:n.source))},createString(e){return new E3(e)}}}const GD=Object.freeze(Object.defineProperty({__proto__:null,createOnigurumaEngine:UD,getDefaultWasmLoader:HD,loadWasm:N3,setDefaultWasmLoader:FD},Symbol.toStringTag,{value:"Module"}));var D3=bD({});xD(D3,GD);var $t=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function qD(t){return U1(t)}function U1(t){return Array.isArray(t)?VD(t):t instanceof RegExp?t:typeof t=="object"?WD(t):t}function VD(t){let e=[];for(let n=0,a=t.length;n<a;n++)e[n]=U1(t[n]);return e}function WD(t){let e={};for(let n in t)e[n]=U1(t[n]);return e}function M3(t,...e){return e.forEach(n=>{for(let a in n)t[a]=n[a]}),t}function O3(t){const e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return e===0?t:~e===t.length-1?O3(t.substring(0,t.length-1)):t.substr(~e+1)}var Tm=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,f0=class{static hasCaptures(t){return t===null?!1:(Tm.lastIndex=0,Tm.test(t))}static replaceCaptures(t,e,n){return t.replace(Tm,(a,r,i,l)=>{let c=n[parseInt(r||i,10)];if(c){let d=e.substring(c.start,c.end);for(;d[0]===".";)d=d.substring(1);switch(l){case"downcase":return d.toLowerCase();case"upcase":return d.toUpperCase();default:return d}}else return a})}};function L3(t,e){return t<e?-1:t>e?1:0}function j3(t,e){if(t===null&&e===null)return 0;if(!t)return-1;if(!e)return 1;let n=t.length,a=e.length;if(n===a){for(let r=0;r<n;r++){let i=L3(t[r],e[r]);if(i!==0)return i}return 0}return n-a}function z2(t){return!!(/^#[0-9a-f]{6}$/i.test(t)||/^#[0-9a-f]{8}$/i.test(t)||/^#[0-9a-f]{3}$/i.test(t)||/^#[0-9a-f]{4}$/i.test(t))}function B3(t){return t.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var I3=class{constructor(t){ne(this,"cache",new Map);this.fn=t}get(t){if(this.cache.has(t))return this.cache.get(t);const e=this.fn(t);return this.cache.set(t,e),e}},ap=class{constructor(t,e,n){ne(this,"_cachedMatchRoot",new I3(t=>this._root.match(t)));this._colorMap=t,this._defaults=e,this._root=n}static createFromRawTheme(t,e){return this.createFromParsedTheme(ZD(t),e)}static createFromParsedTheme(t,e){return QD(t,e)}getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(t){if(t===null)return this._defaults;const e=t.scopeName,a=this._cachedMatchRoot.get(e).find(r=>KD(t.parent,r.parentScopes));return a?new P3(a.fontStyle,a.foreground,a.background):null}},Em=class O0{constructor(e,n){this.parent=e,this.scopeName=n}static push(e,n){for(const a of n)e=new O0(e,a);return e}static from(...e){let n=null;for(let a=0;a<e.length;a++)n=new O0(n,e[a]);return n}push(e){return new O0(this,e)}getSegments(){let e=this;const n=[];for(;e;)n.push(e.scopeName),e=e.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){const n=[];let a=this;for(;a&&a!==e;)n.push(a.scopeName),a=a.parent;return a===e?n.reverse():void 0}};function KD(t,e){if(e.length===0)return!0;for(let n=0;n<e.length;n++){let a=e[n],r=!1;if(a===">"){if(n===e.length-1)return!1;a=e[++n],r=!0}for(;t&&!YD(t.scopeName,a);){if(r)return!1;t=t.parent}if(!t)return!1;t=t.parent}return!0}function YD(t,e){return e===t||t.startsWith(e)&&t[e.length]==="."}var P3=class{constructor(t,e,n){this.fontStyle=t,this.foregroundId=e,this.backgroundId=n}};function ZD(t){if(!t)return[];if(!t.settings||!Array.isArray(t.settings))return[];let e=t.settings,n=[],a=0;for(let r=0,i=e.length;r<i;r++){let l=e[r];if(!l.settings)continue;let c;if(typeof l.scope=="string"){let m=l.scope;m=m.replace(/^[,]+/,""),m=m.replace(/[,]+$/,""),c=m.split(",")}else Array.isArray(l.scope)?c=l.scope:c=[""];let d=-1;if(typeof l.settings.fontStyle=="string"){d=0;let m=l.settings.fontStyle.split(" ");for(let b=0,x=m.length;b<x;b++)switch(m[b]){case"italic":d=d|1;break;case"bold":d=d|2;break;case"underline":d=d|4;break;case"strikethrough":d=d|8;break}}let p=null;typeof l.settings.foreground=="string"&&z2(l.settings.foreground)&&(p=l.settings.foreground);let h=null;typeof l.settings.background=="string"&&z2(l.settings.background)&&(h=l.settings.background);for(let m=0,b=c.length;m<b;m++){let w=c[m].trim().split(" "),S=w[w.length-1],C=null;w.length>1&&(C=w.slice(0,w.length-1),C.reverse()),n[a++]=new XD(S,C,r,d,p,h)}}return n}var XD=class{constructor(t,e,n,a,r,i){this.scope=t,this.parentScopes=e,this.index=n,this.fontStyle=a,this.foreground=r,this.background=i}},Vn=(t=>(t[t.NotSet=-1]="NotSet",t[t.None=0]="None",t[t.Italic=1]="Italic",t[t.Bold=2]="Bold",t[t.Underline=4]="Underline",t[t.Strikethrough=8]="Strikethrough",t))(Vn||{});function QD(t,e){t.sort((d,p)=>{let h=L3(d.scope,p.scope);return h!==0||(h=j3(d.parentScopes,p.parentScopes),h!==0)?h:d.index-p.index});let n=0,a="#000000",r="#ffffff";for(;t.length>=1&&t[0].scope==="";){let d=t.shift();d.fontStyle!==-1&&(n=d.fontStyle),d.foreground!==null&&(a=d.foreground),d.background!==null&&(r=d.background)}let i=new JD(e),l=new P3(n,i.getId(a),i.getId(r)),c=new tM(new Pg(0,null,-1,0,0),[]);for(let d=0,p=t.length;d<p;d++){let h=t[d];c.insert(0,h.scope,h.parentScopes,h.fontStyle,i.getId(h.foreground),i.getId(h.background))}return new ap(i,l,c)}var JD=class{constructor(t){ne(this,"_isFrozen");ne(this,"_lastColorId");ne(this,"_id2color");ne(this,"_color2id");if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(t)){this._isFrozen=!0;for(let e=0,n=t.length;e<n;e++)this._color2id[t[e]]=e,this._id2color[e]=t[e]}else this._isFrozen=!1}getId(t){if(t===null)return 0;t=t.toUpperCase();let e=this._color2id[t];if(e)return e;if(this._isFrozen)throw new Error(`Missing color in color map - ${t}`);return e=++this._lastColorId,this._color2id[t]=e,this._id2color[e]=t,e}getColorMap(){return this._id2color.slice(0)}},eM=Object.freeze([]),Pg=class z3{constructor(e,n,a,r,i){ne(this,"scopeDepth");ne(this,"parentScopes");ne(this,"fontStyle");ne(this,"foreground");ne(this,"background");this.scopeDepth=e,this.parentScopes=n||eM,this.fontStyle=a,this.foreground=r,this.background=i}clone(){return new z3(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let n=[];for(let a=0,r=e.length;a<r;a++)n[a]=e[a].clone();return n}acceptOverwrite(e,n,a,r){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,n!==-1&&(this.fontStyle=n),a!==0&&(this.foreground=a),r!==0&&(this.background=r)}},tM=class zg{constructor(e,n=[],a={}){ne(this,"_rulesWithParentScopes");this._mainRule=e,this._children=a,this._rulesWithParentScopes=n}static _cmpBySpecificity(e,n){if(e.scopeDepth!==n.scopeDepth)return n.scopeDepth-e.scopeDepth;let a=0,r=0;for(;e.parentScopes[a]===">"&&a++,n.parentScopes[r]===">"&&r++,!(a>=e.parentScopes.length||r>=n.parentScopes.length);){const i=n.parentScopes[r].length-e.parentScopes[a].length;if(i!==0)return i;a++,r++}return n.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let a=e.indexOf("."),r,i;if(a===-1?(r=e,i=""):(r=e.substring(0,a),i=e.substring(a+1)),this._children.hasOwnProperty(r))return this._children[r].match(i)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(zg._cmpBySpecificity),n}insert(e,n,a,r,i,l){if(n===""){this._doInsertHere(e,a,r,i,l);return}let c=n.indexOf("."),d,p;c===-1?(d=n,p=""):(d=n.substring(0,c),p=n.substring(c+1));let h;this._children.hasOwnProperty(d)?h=this._children[d]:(h=new zg(this._mainRule.clone(),Pg.cloneArr(this._rulesWithParentScopes)),this._children[d]=h),h.insert(e+1,p,a,r,i,l)}_doInsertHere(e,n,a,r,i){if(n===null){this._mainRule.acceptOverwrite(e,a,r,i);return}for(let l=0,c=this._rulesWithParentScopes.length;l<c;l++){let d=this._rulesWithParentScopes[l];if(j3(d.parentScopes,n)===0){d.acceptOverwrite(e,a,r,i);return}}a===-1&&(a=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new Pg(e,n,a,r,i))}},xo=class Ja{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){const n=Ja.getLanguageId(e),a=Ja.getTokenType(e),r=Ja.getFontStyle(e),i=Ja.getForeground(e),l=Ja.getBackground(e);console.log({languageId:n,tokenType:a,fontStyle:r,foreground:i,background:l})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(e,n,a,r,i,l,c){let d=Ja.getLanguageId(e),p=Ja.getTokenType(e),h=Ja.containsBalancedBrackets(e)?1:0,m=Ja.getFontStyle(e),b=Ja.getForeground(e),x=Ja.getBackground(e);return n!==0&&(d=n),a!==8&&(p=a),r!==null&&(h=r?1:0),i!==-1&&(m=i),l!==0&&(b=l),c!==0&&(x=c),(d<<0|p<<8|h<<10|m<<11|b<<15|x<<24)>>>0}};function rp(t,e){const n=[],a=nM(t);let r=a.next();for(;r!==null;){let d=0;if(r.length===2&&r.charAt(1)===":"){switch(r.charAt(0)){case"R":d=1;break;case"L":d=-1;break;default:console.log(`Unknown priority ${r} in scope selector`)}r=a.next()}let p=l();if(n.push({matcher:p,priority:d}),r!==",")break;r=a.next()}return n;function i(){if(r==="-"){r=a.next();const d=i();return p=>!!d&&!d(p)}if(r==="("){r=a.next();const d=c();return r===")"&&(r=a.next()),d}if($2(r)){const d=[];do d.push(r),r=a.next();while($2(r));return p=>e(d,p)}return null}function l(){const d=[];let p=i();for(;p;)d.push(p),p=i();return h=>d.every(m=>m(h))}function c(){const d=[];let p=l();for(;p&&(d.push(p),r==="|"||r===",");){do r=a.next();while(r==="|"||r===",");p=l()}return h=>d.some(m=>m(h))}}function $2(t){return!!t&&!!t.match(/[\w\.:]+/)}function nM(t){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=e.exec(t);return{next:()=>{if(!n)return null;const a=n[0];return n=e.exec(t),a}}}function $3(t){typeof t.dispose=="function"&&t.dispose()}var vu=class{constructor(t){this.scopeName=t}toKey(){return this.scopeName}},aM=class{constructor(t,e){this.scopeName=t,this.ruleName=e}toKey(){return`${this.scopeName}#${this.ruleName}`}},rM=class{constructor(){ne(this,"_references",[]);ne(this,"_seenReferenceKeys",new Set);ne(this,"visitedRule",new Set)}get references(){return this._references}add(t){const e=t.toKey();this._seenReferenceKeys.has(e)||(this._seenReferenceKeys.add(e),this._references.push(t))}},sM=class{constructor(t,e){ne(this,"seenFullScopeRequests",new Set);ne(this,"seenPartialScopeRequests",new Set);ne(this,"Q");this.repo=t,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new vu(this.initialScopeName)]}processQueue(){const t=this.Q;this.Q=[];const e=new rM;for(const n of t)iM(n,this.initialScopeName,this.repo,e);for(const n of e.references)if(n instanceof vu){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function iM(t,e,n,a){const r=n.lookup(t.scopeName);if(!r){if(t.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}const i=n.lookup(e);t instanceof vu?L0({baseGrammar:i,selfGrammar:r},a):$g(t.ruleName,{baseGrammar:i,selfGrammar:r,repository:r.repository},a);const l=n.injections(t.scopeName);if(l)for(const c of l)a.add(new vu(c))}function $g(t,e,n){if(e.repository&&e.repository[t]){const a=e.repository[t];sp([a],e,n)}}function L0(t,e){t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns)&&sp(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e),t.selfGrammar.injections&&sp(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}function sp(t,e,n){for(const a of t){if(n.visitedRule.has(a))continue;n.visitedRule.add(a);const r=a.repository?M3({},e.repository,a.repository):e.repository;Array.isArray(a.patterns)&&sp(a.patterns,{...e,repository:r},n);const i=a.include;if(!i)continue;const l=F3(i);switch(l.kind){case 0:L0({...e,selfGrammar:e.baseGrammar},n);break;case 1:L0(e,n);break;case 2:$g(l.ruleName,{...e,repository:r},n);break;case 3:case 4:const c=l.scopeName===e.selfGrammar.scopeName?e.selfGrammar:l.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(c){const d={baseGrammar:e.baseGrammar,selfGrammar:c,repository:r};l.kind===4?$g(l.ruleName,d,n):L0(d,n)}else l.kind===4?n.add(new aM(l.scopeName,l.ruleName)):n.add(new vu(l.scopeName));break}}}var oM=class{constructor(){ne(this,"kind",0)}},lM=class{constructor(){ne(this,"kind",1)}},cM=class{constructor(t){ne(this,"kind",2);this.ruleName=t}},uM=class{constructor(t){ne(this,"kind",3);this.scopeName=t}},dM=class{constructor(t,e){ne(this,"kind",4);this.scopeName=t,this.ruleName=e}};function F3(t){if(t==="$base")return new oM;if(t==="$self")return new lM;const e=t.indexOf("#");if(e===-1)return new uM(t);if(e===0)return new cM(t.substring(1));{const n=t.substring(0,e),a=t.substring(e+1);return new dM(n,a)}}var pM=/\\(\d+)/,F2=/\\(\d+)/g,fM=-1,H3=-2;var Ou=class{constructor(t,e,n,a){ne(this,"$location");ne(this,"id");ne(this,"_nameIsCapturing");ne(this,"_name");ne(this,"_contentNameIsCapturing");ne(this,"_contentName");this.$location=t,this.id=e,this._name=n||null,this._nameIsCapturing=f0.hasCaptures(this._name),this._contentName=a||null,this._contentNameIsCapturing=f0.hasCaptures(this._contentName)}get debugName(){const t=this.$location?`${O3(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${t}`}getName(t,e){return!this._nameIsCapturing||this._name===null||t===null||e===null?this._name:f0.replaceCaptures(this._name,t,e)}getContentName(t,e){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:f0.replaceCaptures(this._contentName,t,e)}},hM=class extends Ou{constructor(e,n,a,r,i){super(e,n,a,r);ne(this,"retokenizeCapturedWithRuleId");this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,n){throw new Error("Not supported!")}compile(e,n){throw new Error("Not supported!")}compileAG(e,n,a,r){throw new Error("Not supported!")}},mM=class extends Ou{constructor(e,n,a,r,i){super(e,n,a,null);ne(this,"_match");ne(this,"captures");ne(this,"_cachedCompiledPatterns");this._match=new xu(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,n){n.push(this._match)}compile(e,n){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,n,a,r){return this._getCachedCompiledPatterns(e).compileAG(e,a,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new wu,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},H2=class extends Ou{constructor(e,n,a,r,i){super(e,n,a,r);ne(this,"hasMissingPatterns");ne(this,"patterns");ne(this,"_cachedCompiledPatterns");this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,n){for(const a of this.patterns)e.getRule(a).collectPatterns(e,n)}compile(e,n){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,n,a,r){return this._getCachedCompiledPatterns(e).compileAG(e,a,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new wu,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Fg=class extends Ou{constructor(e,n,a,r,i,l,c,d,p,h){super(e,n,a,r);ne(this,"_begin");ne(this,"beginCaptures");ne(this,"_end");ne(this,"endHasBackReferences");ne(this,"endCaptures");ne(this,"applyEndPatternLast");ne(this,"hasMissingPatterns");ne(this,"patterns");ne(this,"_cachedCompiledPatterns");this._begin=new xu(i,this.id),this.beginCaptures=l,this._end=new xu(c||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=d,this.applyEndPatternLast=p||!1,this.patterns=h.patterns,this.hasMissingPatterns=h.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,n){return this._end.resolveBackReferences(e,n)}collectPatterns(e,n){n.push(this._begin)}compile(e,n){return this._getCachedCompiledPatterns(e,n).compile(e)}compileAG(e,n,a,r){return this._getCachedCompiledPatterns(e,n).compileAG(e,a,r)}_getCachedCompiledPatterns(e,n){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new wu;for(const a of this.patterns)e.getRule(a).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,n):this._cachedCompiledPatterns.setSource(0,n)),this._cachedCompiledPatterns}},ip=class extends Ou{constructor(e,n,a,r,i,l,c,d,p){super(e,n,a,r);ne(this,"_begin");ne(this,"beginCaptures");ne(this,"whileCaptures");ne(this,"_while");ne(this,"whileHasBackReferences");ne(this,"hasMissingPatterns");ne(this,"patterns");ne(this,"_cachedCompiledPatterns");ne(this,"_cachedCompiledWhilePatterns");this._begin=new xu(i,this.id),this.beginCaptures=l,this.whileCaptures=d,this._while=new xu(c,H3),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=p.patterns,this.hasMissingPatterns=p.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,n){return this._while.resolveBackReferences(e,n)}collectPatterns(e,n){n.push(this._begin)}compile(e,n){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,n,a,r){return this._getCachedCompiledPatterns(e).compileAG(e,a,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new wu;for(const n of this.patterns)e.getRule(n).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,n){return this._getCachedCompiledWhilePatterns(e,n).compile(e)}compileWhileAG(e,n,a,r){return this._getCachedCompiledWhilePatterns(e,n).compileAG(e,a,r)}_getCachedCompiledWhilePatterns(e,n){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new wu,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,n||""),this._cachedCompiledWhilePatterns}},U3=class qn{static createCaptureRule(e,n,a,r,i){return e.registerRule(l=>new hM(n,l,a,r,i))}static getCompiledRuleId(e,n,a){return e.id||n.registerRule(r=>{if(e.id=r,e.match)return new mM(e.$vscodeTextmateLocation,e.id,e.name,e.match,qn._compileCaptures(e.captures,n,a));if(typeof e.begin>"u"){e.repository&&(a=M3({},a,e.repository));let i=e.patterns;return typeof i>"u"&&e.include&&(i=[{include:e.include}]),new H2(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,qn._compilePatterns(i,n,a))}return e.while?new ip(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,qn._compileCaptures(e.beginCaptures||e.captures,n,a),e.while,qn._compileCaptures(e.whileCaptures||e.captures,n,a),qn._compilePatterns(e.patterns,n,a)):new Fg(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,qn._compileCaptures(e.beginCaptures||e.captures,n,a),e.end,qn._compileCaptures(e.endCaptures||e.captures,n,a),e.applyEndPatternLast,qn._compilePatterns(e.patterns,n,a))}),e.id}static _compileCaptures(e,n,a){let r=[];if(e){let i=0;for(const l in e){if(l==="$vscodeTextmateLocation")continue;const c=parseInt(l,10);c>i&&(i=c)}for(let l=0;l<=i;l++)r[l]=null;for(const l in e){if(l==="$vscodeTextmateLocation")continue;const c=parseInt(l,10);let d=0;e[l].patterns&&(d=qn.getCompiledRuleId(e[l],n,a)),r[c]=qn.createCaptureRule(n,e[l].$vscodeTextmateLocation,e[l].name,e[l].contentName,d)}}return r}static _compilePatterns(e,n,a){let r=[];if(e)for(let i=0,l=e.length;i<l;i++){const c=e[i];let d=-1;if(c.include){const p=F3(c.include);switch(p.kind){case 0:case 1:d=qn.getCompiledRuleId(a[c.include],n,a);break;case 2:let h=a[p.ruleName];h&&(d=qn.getCompiledRuleId(h,n,a));break;case 3:case 4:const m=p.scopeName,b=p.kind===4?p.ruleName:null,x=n.getExternalGrammar(m,a);if(x)if(b){let w=x.repository[b];w&&(d=qn.getCompiledRuleId(w,n,x.repository))}else d=qn.getCompiledRuleId(x.repository.$self,n,x.repository);break}}else d=qn.getCompiledRuleId(c,n,a);if(d!==-1){const p=n.getRule(d);let h=!1;if((p instanceof H2||p instanceof Fg||p instanceof ip)&&p.hasMissingPatterns&&p.patterns.length===0&&(h=!0),h)continue;r.push(d)}}return{patterns:r,hasMissingPatterns:(e?e.length:0)!==r.length}}},xu=class G3{constructor(e,n){ne(this,"source");ne(this,"ruleId");ne(this,"hasAnchor");ne(this,"hasBackReferences");ne(this,"_anchorCache");if(e&&typeof e=="string"){const a=e.length;let r=0,i=[],l=!1;for(let c=0;c<a;c++)if(e.charAt(c)==="\\"&&c+1<a){const p=e.charAt(c+1);p==="z"?(i.push(e.substring(r,c)),i.push("$(?!\\n)(?<!\\n)"),r=c+2):(p==="A"||p==="G")&&(l=!0),c++}this.hasAnchor=l,r===0?this.source=e:(i.push(e.substring(r,a)),this.source=i.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=pM.test(this.source):this.hasBackReferences=!1}clone(){return new G3(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let a=n.map(r=>e.substring(r.start,r.end));return F2.lastIndex=0,this.source.replace(F2,(r,i)=>B3(a[parseInt(i,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let e=[],n=[],a=[],r=[],i,l,c,d;for(i=0,l=this.source.length;i<l;i++)c=this.source.charAt(i),e[i]=c,n[i]=c,a[i]=c,r[i]=c,c==="\\"&&i+1<l&&(d=this.source.charAt(i+1),d==="A"?(e[i+1]="",n[i+1]="",a[i+1]="A",r[i+1]="A"):d==="G"?(e[i+1]="",n[i+1]="G",a[i+1]="",r[i+1]="G"):(e[i+1]=d,n[i+1]=d,a[i+1]=d,r[i+1]=d),i++);return{A0_G0:e.join(""),A0_G1:n.join(""),A1_G0:a.join(""),A1_G1:r.join("")}}resolveAnchors(e,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:e?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},wu=class{constructor(){ne(this,"_items");ne(this,"_hasAnchors");ne(this,"_cached");ne(this,"_anchorCache");this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(t){this._items.push(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}unshift(t){this._items.unshift(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}length(){return this._items.length}setSource(t,e){this._items[t].source!==e&&(this._disposeCaches(),this._items[t].setSource(e))}compile(t){if(!this._cached){let e=this._items.map(n=>n.source);this._cached=new U2(t,e,this._items.map(n=>n.ruleId))}return this._cached}compileAG(t,e,n){return this._hasAnchors?e?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G0):this.compile(t)}_resolveAnchors(t,e,n){let a=this._items.map(r=>r.resolveAnchors(e,n));return new U2(t,a,this._items.map(r=>r.ruleId))}},U2=class{constructor(t,e,n){ne(this,"scanner");this.regExps=e,this.rules=n,this.scanner=t.createOnigScanner(e)}dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const t=[];for(let e=0,n=this.rules.length;e<n;e++)t.push(" - "+this.rules[e]+": "+this.regExps[e]);return t.join(`
|
|
309
|
+
`)}findNextMatchSync(t,e,n){const a=this.scanner.findNextMatchSync(t,e,n);return a?{ruleId:this.rules[a.index],captureIndices:a.captureIndices}:null}},Nm=class{constructor(t,e){this.languageId=t,this.tokenType=e}},xs,gM=(xs=class{constructor(e,n){ne(this,"_defaultAttributes");ne(this,"_embeddedLanguagesMatcher");ne(this,"_getBasicScopeAttributes",new I3(e=>{const n=this._scopeToLanguage(e),a=this._toStandardTokenType(e);return new Nm(n,a)}));this._defaultAttributes=new Nm(e,8),this._embeddedLanguagesMatcher=new yM(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(e){return e===null?xs._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(e)}_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(e){const n=e.match(xs.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}},ne(xs,"_NULL_SCOPE_METADATA",new Nm(0,0)),ne(xs,"STANDARD_TOKEN_TYPE_REGEXP",/\b(comment|string|regex|meta\.embedded)\b/),xs),yM=class{constructor(t){ne(this,"values");ne(this,"scopesRegExp");if(t.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(t);const e=t.map(([n,a])=>B3(n));e.sort(),e.reverse(),this.scopesRegExp=new RegExp(`^((${e.join(")|(")}))($|\\.)`,"")}}match(t){if(!this.scopesRegExp)return;const e=t.match(this.scopesRegExp);if(e)return this.values.get(e[1])}},G2=class{constructor(t,e){this.stack=t,this.stoppedEarly=e}};function q3(t,e,n,a,r,i,l,c){const d=e.content.length;let p=!1,h=-1;if(l){const x=bM(t,e,n,a,r,i);r=x.stack,a=x.linePos,n=x.isFirstLine,h=x.anchorPosition}const m=Date.now();for(;!p;){if(c!==0&&Date.now()-m>c)return new G2(r,!0);b()}return new G2(r,!1);function b(){const x=vM(t,e,n,a,r,h);if(!x){i.produce(r,d),p=!0;return}const w=x.captureIndices,S=x.matchedRuleId,C=w&&w.length>0?w[0].end>a:!1;if(S===fM){const E=r.getRule(t);i.produce(r,w[0].start),r=r.withContentNameScopesList(r.nameScopesList),Vc(t,e,n,r,i,E.endCaptures,w),i.produce(r,w[0].end);const T=r;if(r=r.parent,h=T.getAnchorPos(),!C&&T.getEnterPos()===a){r=T,i.produce(r,d),p=!0;return}}else{const E=t.getRule(S);i.produce(r,w[0].start);const T=r,L=E.getName(e.content,w),D=r.contentNameScopesList.pushAttributed(L,t);if(r=r.push(S,a,h,w[0].end===d,null,D,D),E instanceof Fg){const B=E;Vc(t,e,n,r,i,B.beginCaptures,w),i.produce(r,w[0].end),h=w[0].end;const H=B.getContentName(e.content,w),K=D.pushAttributed(H,t);if(r=r.withContentNameScopesList(K),B.endHasBackReferences&&(r=r.withEndRule(B.getEndWithResolvedBackReferences(e.content,w))),!C&&T.hasSameRuleAs(r)){r=r.pop(),i.produce(r,d),p=!0;return}}else if(E instanceof ip){const B=E;Vc(t,e,n,r,i,B.beginCaptures,w),i.produce(r,w[0].end),h=w[0].end;const H=B.getContentName(e.content,w),K=D.pushAttributed(H,t);if(r=r.withContentNameScopesList(K),B.whileHasBackReferences&&(r=r.withEndRule(B.getWhileWithResolvedBackReferences(e.content,w))),!C&&T.hasSameRuleAs(r)){r=r.pop(),i.produce(r,d),p=!0;return}}else if(Vc(t,e,n,r,i,E.captures,w),i.produce(r,w[0].end),r=r.pop(),!C){r=r.safePop(),i.produce(r,d),p=!0;return}}w[0].end>a&&(a=w[0].end,n=!1)}}function bM(t,e,n,a,r,i){let l=r.beginRuleCapturedEOL?0:-1;const c=[];for(let d=r;d;d=d.pop()){const p=d.getRule(t);p instanceof ip&&c.push({rule:p,stack:d})}for(let d=c.pop();d;d=c.pop()){const{ruleScanner:p,findOptions:h}=kM(d.rule,t,d.stack.endRule,n,a===l),m=p.findNextMatchSync(e,a,h);if(m){if(m.ruleId!==H3){r=d.stack.pop();break}m.captureIndices&&m.captureIndices.length&&(i.produce(d.stack,m.captureIndices[0].start),Vc(t,e,n,d.stack,i,d.rule.whileCaptures,m.captureIndices),i.produce(d.stack,m.captureIndices[0].end),l=m.captureIndices[0].end,m.captureIndices[0].end>a&&(a=m.captureIndices[0].end,n=!1))}else{r=d.stack.pop();break}}return{stack:r,linePos:a,anchorPosition:l,isFirstLine:n}}function vM(t,e,n,a,r,i){const l=xM(t,e,n,a,r,i),c=t.getInjections();if(c.length===0)return l;const d=wM(c,t,e,n,a,r,i);if(!d)return l;if(!l)return d;const p=l.captureIndices[0].start,h=d.captureIndices[0].start;return h<p||d.priorityMatch&&h===p?d:l}function xM(t,e,n,a,r,i){const l=r.getRule(t),{ruleScanner:c,findOptions:d}=V3(l,t,r.endRule,n,a===i),p=c.findNextMatchSync(e,a,d);return p?{captureIndices:p.captureIndices,matchedRuleId:p.ruleId}:null}function wM(t,e,n,a,r,i,l){let c=Number.MAX_VALUE,d=null,p,h=0;const m=i.contentNameScopesList.getScopeNames();for(let b=0,x=t.length;b<x;b++){const w=t[b];if(!w.matcher(m))continue;const S=e.getRule(w.ruleId),{ruleScanner:C,findOptions:E}=V3(S,e,null,a,r===l),T=C.findNextMatchSync(n,r,E);if(!T)continue;const L=T.captureIndices[0].start;if(!(L>=c)&&(c=L,d=T.captureIndices,p=T.ruleId,h=w.priority,c===r))break}return d?{priorityMatch:h===-1,captureIndices:d,matchedRuleId:p}:null}function V3(t,e,n,a,r){return{ruleScanner:t.compileAG(e,n,a,r),findOptions:0}}function kM(t,e,n,a,r){return{ruleScanner:t.compileWhileAG(e,n,a,r),findOptions:0}}function Vc(t,e,n,a,r,i,l){if(i.length===0)return;const c=e.content,d=Math.min(i.length,l.length),p=[],h=l[0].end;for(let m=0;m<d;m++){const b=i[m];if(b===null)continue;const x=l[m];if(x.length===0)continue;if(x.start>h)break;for(;p.length>0&&p[p.length-1].endPos<=x.start;)r.produceFromScopes(p[p.length-1].scopes,p[p.length-1].endPos),p.pop();if(p.length>0?r.produceFromScopes(p[p.length-1].scopes,x.start):r.produce(a,x.start),b.retokenizeCapturedWithRuleId){const S=b.getName(c,l),C=a.contentNameScopesList.pushAttributed(S,t),E=b.getContentName(c,l),T=C.pushAttributed(E,t),L=a.push(b.retokenizeCapturedWithRuleId,x.start,-1,!1,null,C,T),D=t.createOnigString(c.substring(0,x.end));q3(t,D,n&&x.start===0,x.start,L,r,!1,0),$3(D);continue}const w=b.getName(c,l);if(w!==null){const C=(p.length>0?p[p.length-1].scopes:a.contentNameScopesList).pushAttributed(w,t);p.push(new SM(C,x.end))}}for(;p.length>0;)r.produceFromScopes(p[p.length-1].scopes,p[p.length-1].endPos),p.pop()}var SM=class{constructor(t,e){ne(this,"scopes");ne(this,"endPos");this.scopes=t,this.endPos=e}};function _M(t,e,n,a,r,i,l,c){return new AM(t,e,n,a,r,i,l,c)}function q2(t,e,n,a,r){const i=rp(e,op),l=U3.getCompiledRuleId(n,a,r.repository);for(const c of i)t.push({debugSelector:e,matcher:c.matcher,ruleId:l,grammar:r,priority:c.priority})}function op(t,e){if(e.length<t.length)return!1;let n=0;return t.every(a=>{for(let r=n;r<e.length;r++)if(CM(e[r],a))return n=r+1,!0;return!1})}function CM(t,e){if(!t)return!1;if(t===e)return!0;const n=e.length;return t.length>n&&t.substr(0,n)===e&&t[n]==="."}var AM=class{constructor(t,e,n,a,r,i,l,c){ne(this,"_rootId");ne(this,"_lastRuleId");ne(this,"_ruleId2desc");ne(this,"_includedGrammars");ne(this,"_grammarRepository");ne(this,"_grammar");ne(this,"_injections");ne(this,"_basicScopeAttributesProvider");ne(this,"_tokenTypeMatchers");if(this._rootScopeName=t,this.balancedBracketSelectors=i,this._onigLib=c,this._basicScopeAttributesProvider=new gM(n,a),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=l,this._grammar=V2(e,null),this._injections=null,this._tokenTypeMatchers=[],r)for(const d of Object.keys(r)){const p=rp(d,op);for(const h of p)this._tokenTypeMatchers.push({matcher:h.matcher,type:r[d]})}}get themeProvider(){return this._grammarRepository}dispose(){for(const t of this._ruleId2desc)t&&t.dispose()}createOnigScanner(t){return this._onigLib.createOnigScanner(t)}createOnigString(t){return this._onigLib.createOnigString(t)}getMetadataForScope(t){return this._basicScopeAttributesProvider.getBasicScopeAttributes(t)}_collectInjections(){const t={lookup:r=>r===this._rootScopeName?this._grammar:this.getExternalGrammar(r),injections:r=>this._grammarRepository.injections(r)},e=[],n=this._rootScopeName,a=t.lookup(n);if(a){const r=a.injections;if(r)for(let l in r)q2(e,l,r[l],this,a);const i=this._grammarRepository.injections(n);i&&i.forEach(l=>{const c=this.getExternalGrammar(l);if(c){const d=c.injectionSelector;d&&q2(e,d,c,this,c)}})}return e.sort((r,i)=>r.priority-i.priority),e}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(t){const e=++this._lastRuleId,n=t(e);return this._ruleId2desc[e]=n,n}getRule(t){return this._ruleId2desc[t]}getExternalGrammar(t,e){if(this._includedGrammars[t])return this._includedGrammars[t];if(this._grammarRepository){const n=this._grammarRepository.lookup(t);if(n)return this._includedGrammars[t]=V2(n,e&&e.$base),this._includedGrammars[t]}}tokenizeLine(t,e,n=0){const a=this._tokenize(t,e,!1,n);return{tokens:a.lineTokens.getResult(a.ruleStack,a.lineLength),ruleStack:a.ruleStack,stoppedEarly:a.stoppedEarly}}tokenizeLine2(t,e,n=0){const a=this._tokenize(t,e,!0,n);return{tokens:a.lineTokens.getBinaryResult(a.ruleStack,a.lineLength),ruleStack:a.ruleStack,stoppedEarly:a.stoppedEarly}}_tokenize(t,e,n,a){this._rootId===-1&&(this._rootId=U3.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let r;if(!e||e===Hg.NULL){r=!0;const p=this._basicScopeAttributesProvider.getDefaultAttributes(),h=this.themeProvider.getDefaults(),m=xo.set(0,p.languageId,p.tokenType,null,h.fontStyle,h.foregroundId,h.backgroundId),b=this.getRule(this._rootId).getName(null,null);let x;b?x=ru.createRootAndLookUpScopeName(b,m,this):x=ru.createRoot("unknown",m),e=new Hg(null,this._rootId,-1,-1,!1,null,x,x)}else r=!1,e.reset();t=t+`
|
|
310
|
+
`;const i=this.createOnigString(t),l=i.content.length,c=new EM(n,t,this._tokenTypeMatchers,this.balancedBracketSelectors),d=q3(this,i,r,0,e,c,!0,a);return $3(i),{lineLength:l,lineTokens:c,ruleStack:d.stack,stoppedEarly:d.stoppedEarly}}};function V2(t,e){return t=qD(t),t.repository=t.repository||{},t.repository.$self={$vscodeTextmateLocation:t.$vscodeTextmateLocation,patterns:t.patterns,name:t.scopeName},t.repository.$base=e||t.repository.$self,t}var ru=class jr{constructor(e,n,a){this.parent=e,this.scopePath=n,this.tokenAttributes=a}static fromExtension(e,n){let a=e,r=(e==null?void 0:e.scopePath)??null;for(const i of n)r=Em.push(r,i.scopeNames),a=new jr(a,r,i.encodedTokenAttributes);return a}static createRoot(e,n){return new jr(null,new Em(null,e),n)}static createRootAndLookUpScopeName(e,n,a){const r=a.getMetadataForScope(e),i=new Em(null,e),l=a.themeProvider.themeMatch(i),c=jr.mergeAttributes(n,r,l);return new jr(null,i,c)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(e){return jr.equals(this,e)}static equals(e,n){do{if(e===n||!e&&!n)return!0;if(!e||!n||e.scopeName!==n.scopeName||e.tokenAttributes!==n.tokenAttributes)return!1;e=e.parent,n=n.parent}while(!0)}static mergeAttributes(e,n,a){let r=-1,i=0,l=0;return a!==null&&(r=a.fontStyle,i=a.foregroundId,l=a.backgroundId),xo.set(e,n.languageId,n.tokenType,null,r,i,l)}pushAttributed(e,n){if(e===null)return this;if(e.indexOf(" ")===-1)return jr._pushAttributed(this,e,n);const a=e.split(/ /g);let r=this;for(const i of a)r=jr._pushAttributed(r,i,n);return r}static _pushAttributed(e,n,a){const r=a.getMetadataForScope(n),i=e.scopePath.push(n),l=a.themeProvider.themeMatch(i),c=jr.mergeAttributes(e.tokenAttributes,r,l);return new jr(e,i,c)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){var r;const n=[];let a=this;for(;a&&a!==e;)n.push({encodedTokenAttributes:a.tokenAttributes,scopeNames:a.scopePath.getExtensionIfDefined(((r=a.parent)==null?void 0:r.scopePath)??null)}),a=a.parent;return a===e?n.reverse():void 0}},tr,Hg=(tr=class{constructor(e,n,a,r,i,l,c,d){ne(this,"_stackElementBrand");ne(this,"_enterPos");ne(this,"_anchorPos");ne(this,"depth");this.parent=e,this.ruleId=n,this.beginRuleCapturedEOL=i,this.endRule=l,this.nameScopesList=c,this.contentNameScopesList=d,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=a,this._anchorPos=r}equals(e){return e===null?!1:tr._equals(this,e)}static _equals(e,n){return e===n?!0:this._structuralEquals(e,n)?ru.equals(e.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(e,n){do{if(e===n||!e&&!n)return!0;if(!e||!n||e.depth!==n.depth||e.ruleId!==n.ruleId||e.endRule!==n.endRule)return!1;e=e.parent,n=n.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){tr._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(e,n,a,r,i,l,c){return new tr(this,e,n,a,r,i,l,c)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){const e=[];return this._writeString(e,0),"["+e.join(",")+"]"}_writeString(e,n){var a,r;return this.parent&&(n=this.parent._writeString(e,n)),e[n++]=`(${this.ruleId}, ${(a=this.nameScopesList)==null?void 0:a.toString()}, ${(r=this.contentNameScopesList)==null?void 0:r.toString()})`,n}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(e){return this.endRule===e?this:new tr(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,e,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let n=this;for(;n&&n._enterPos===e._enterPos;){if(n.ruleId===e.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){var e,n,a;return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:((n=this.nameScopesList)==null?void 0:n.getExtensionIfDefined(((e=this.parent)==null?void 0:e.nameScopesList)??null))??[],contentNameScopesList:((a=this.contentNameScopesList)==null?void 0:a.getExtensionIfDefined(this.nameScopesList))??[]}}static pushFrame(e,n){const a=ru.fromExtension((e==null?void 0:e.nameScopesList)??null,n.nameScopesList);return new tr(e,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,a,ru.fromExtension(a,n.contentNameScopesList))}},ne(tr,"NULL",new tr(null,0,0,0,!1,null,null,null)),tr),TM=class{constructor(t,e){ne(this,"balancedBracketScopes");ne(this,"unbalancedBracketScopes");ne(this,"allowAny",!1);this.balancedBracketScopes=t.flatMap(n=>n==="*"?(this.allowAny=!0,[]):rp(n,op).map(a=>a.matcher)),this.unbalancedBracketScopes=e.flatMap(n=>rp(n,op).map(a=>a.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(t){for(const e of this.unbalancedBracketScopes)if(e(t))return!1;for(const e of this.balancedBracketScopes)if(e(t))return!0;return this.allowAny}},EM=class{constructor(t,e,n,a){ne(this,"_emitBinaryTokens");ne(this,"_lineText");ne(this,"_tokens");ne(this,"_binaryTokens");ne(this,"_lastTokenEndIndex");ne(this,"_tokenTypeOverrides");this.balancedBracketSelectors=a,this._emitBinaryTokens=t,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}produce(t,e){this.produceFromScopes(t.contentNameScopesList,e)}produceFromScopes(t,e){var a;if(this._lastTokenEndIndex>=e)return;if(this._emitBinaryTokens){let r=(t==null?void 0:t.tokenAttributes)??0,i=!1;if((a=this.balancedBracketSelectors)!=null&&a.matchesAlways&&(i=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const l=(t==null?void 0:t.getScopeNames())??[];for(const c of this._tokenTypeOverrides)c.matcher(l)&&(r=xo.set(r,0,c.type,null,-1,0,0));this.balancedBracketSelectors&&(i=this.balancedBracketSelectors.match(l))}if(i&&(r=xo.set(r,0,8,i,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===r){this._lastTokenEndIndex=e;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(r),this._lastTokenEndIndex=e;return}const n=(t==null?void 0:t.getScopeNames())??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:e,scopes:n}),this._lastTokenEndIndex=e}getResult(t,e){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===e-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(t,e){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===e-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let a=0,r=this._binaryTokens.length;a<r;a++)n[a]=this._binaryTokens[a];return n}},NM=class{constructor(t,e){ne(this,"_grammars",new Map);ne(this,"_rawGrammars",new Map);ne(this,"_injectionGrammars",new Map);ne(this,"_theme");this._onigLib=e,this._theme=t}dispose(){for(const t of this._grammars.values())t.dispose()}setTheme(t){this._theme=t}getColorMap(){return this._theme.getColorMap()}addGrammar(t,e){this._rawGrammars.set(t.scopeName,t),e&&this._injectionGrammars.set(t.scopeName,e)}lookup(t){return this._rawGrammars.get(t)}injections(t){return this._injectionGrammars.get(t)}getDefaults(){return this._theme.getDefaults()}themeMatch(t){return this._theme.match(t)}grammarForScopeName(t,e,n,a,r){if(!this._grammars.has(t)){let i=this._rawGrammars.get(t);if(!i)return null;this._grammars.set(t,_M(t,i,e,n,a,r,this,this._onigLib))}return this._grammars.get(t)}},RM=class{constructor(e){ne(this,"_options");ne(this,"_syncRegistry");ne(this,"_ensureGrammarCache");this._options=e,this._syncRegistry=new NM(ap.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,n){this._syncRegistry.setTheme(ap.createFromRawTheme(e,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,n,a){return this.loadGrammarWithConfiguration(e,n,{embeddedLanguages:a})}loadGrammarWithConfiguration(e,n,a){return this._loadGrammar(e,n,a.embeddedLanguages,a.tokenTypes,new TM(a.balancedBracketSelectors||[],a.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,n,a,r,i){const l=new sM(this._syncRegistry,e);for(;l.Q.length>0;)l.Q.map(c=>this._loadSingleGrammar(c.scopeName)),l.processQueue();return this._grammarForScopeName(e,n,a,r,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){const n=this._options.loadGrammar(e);if(n){const a=typeof this._options.getInjections=="function"?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(n,a)}}addGrammar(e,n=[],a=0,r=null){return this._syncRegistry.addGrammar(e,n),this._grammarForScopeName(e.scopeName,a,r)}_grammarForScopeName(e,n=0,a=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,n,a,r,i)}},Ug=Hg.NULL;function lp(t,e){const n=typeof t=="string"?{}:{...t.colorReplacements},a=typeof t=="string"?t:t.name;for(const[r,i]of Object.entries((e==null?void 0:e.colorReplacements)||{}))typeof i=="string"?n[r]=i:r===a&&Object.assign(n,i);return n}function ki(t,e){return t&&((e==null?void 0:e[t==null?void 0:t.toLowerCase()])||t)}function DM(t){return Array.isArray(t)?t:[t]}async function W3(t){return Promise.resolve(typeof t=="function"?t():t).then(e=>e.default||e)}function $p(t){return!t||["plaintext","txt","text","plain"].includes(t)}function K3(t){return t==="ansi"||$p(t)}function Fp(t){return t==="none"}function Y3(t){return Fp(t)}const MM=/(\r?\n)/g;function Hp(t,e=!1){var i;if(t.length===0)return[["",0]];const n=t.split(MM);let a=0;const r=[];for(let l=0;l<n.length;l+=2){const c=e?n[l]+(n[l+1]||""):n[l];r.push([c,a]),a+=n[l].length,a+=((i=n[l+1])==null?void 0:i.length)||0}return r}const W2={light:"#333333",dark:"#bbbbbb"},K2={light:"#fffffe",dark:"#1e1e1e"},Y2="__shiki_resolved";function G1(t){var c,d,p,h,m;if(t!=null&&t[Y2])return t;const e={...t};e.tokenColors&&!e.settings&&(e.settings=e.tokenColors,delete e.tokenColors),e.type||(e.type="dark"),e.colorReplacements={...e.colorReplacements},e.settings||(e.settings=[]);let{bg:n,fg:a}=e;if(!n||!a){const b=e.settings?e.settings.find(x=>!x.name&&!x.scope):void 0;(c=b==null?void 0:b.settings)!=null&&c.foreground&&(a=b.settings.foreground),(d=b==null?void 0:b.settings)!=null&&d.background&&(n=b.settings.background),!a&&((p=e==null?void 0:e.colors)!=null&&p["editor.foreground"])&&(a=e.colors["editor.foreground"]),!n&&((h=e==null?void 0:e.colors)!=null&&h["editor.background"])&&(n=e.colors["editor.background"]),a||(a=e.type==="light"?W2.light:W2.dark),n||(n=e.type==="light"?K2.light:K2.dark),e.fg=a,e.bg=n}e.settings[0]&&e.settings[0].settings&&!e.settings[0].scope||e.settings.unshift({settings:{foreground:e.fg,background:e.bg}});let r=0;const i=new Map;function l(b){var w;if(i.has(b))return i.get(b);r+=1;const x=`#${r.toString(16).padStart(8,"0").toLowerCase()}`;return(w=e.colorReplacements)!=null&&w[`#${x}`]?l(b):(i.set(b,x),x)}e.settings=e.settings.map(b=>{var C,E;const x=((C=b.settings)==null?void 0:C.foreground)&&!b.settings.foreground.startsWith("#"),w=((E=b.settings)==null?void 0:E.background)&&!b.settings.background.startsWith("#");if(!x&&!w)return b;const S={...b,settings:{...b.settings}};if(x){const T=l(b.settings.foreground);e.colorReplacements[T]=b.settings.foreground,S.settings.foreground=T}if(w){const T=l(b.settings.background);e.colorReplacements[T]=b.settings.background,S.settings.background=T}return S});for(const b of Object.keys(e.colors||{}))if((b==="editor.foreground"||b==="editor.background"||b.startsWith("terminal.ansi"))&&!((m=e.colors[b])!=null&&m.startsWith("#"))){const x=l(e.colors[b]);e.colorReplacements[x]=e.colors[b],e.colors[b]=x}return Object.defineProperty(e,Y2,{enumerable:!1,writable:!1,value:!0}),e}async function Z3(t){return[...new Set((await Promise.all(t.filter(e=>!K3(e)).map(async e=>await W3(e).then(n=>Array.isArray(n)?n:[n])))).flat())]}async function X3(t){return(await Promise.all(t.map(async e=>Y3(e)?null:G1(await W3(e))))).filter(e=>!!e)}function Q3(t,e){if(!e)return t;if(e[t]){const n=new Set([t]);for(;e[t];){if(t=e[t],n.has(t))throw new $t(`Circular alias \`${[...n].join(" -> ")} -> ${t}\``);n.add(t)}}return t}var OM=class extends RM{constructor(e,n,a,r={}){super(e);ne(this,"_resolver");ne(this,"_themes");ne(this,"_langs");ne(this,"_alias");ne(this,"_resolvedThemes",new Map);ne(this,"_resolvedGrammars",new Map);ne(this,"_langMap",new Map);ne(this,"_langGraph",new Map);ne(this,"_textmateThemeCache",new WeakMap);ne(this,"_loadedThemesCache",null);ne(this,"_loadedLanguagesCache",null);this._resolver=e,this._themes=n,this._langs=a,this._alias=r,this._themes.map(i=>this.loadTheme(i)),this.loadLanguages(this._langs)}getTheme(e){return typeof e=="string"?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){const n=G1(e);return n.name&&(this._resolvedThemes.set(n.name,n),this._loadedThemesCache=null),n}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(e){let n=this._textmateThemeCache.get(e);n||(n=ap.createFromRawTheme(e),this._textmateThemeCache.set(e,n)),this._syncRegistry.setTheme(n)}getGrammar(e){return e=Q3(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){var i,l,c,d;if(this.getGrammar(e.name))return;const n=new Set([...this._langMap.values()].filter(p=>{var h;return(h=p.embeddedLangsLazy)==null?void 0:h.includes(e.name)}));this._resolver.addLanguage(e);const a={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const r=this.loadGrammarWithConfiguration(e.scopeName,1,a);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(p=>{this._alias[p]=e.name}),this._loadedLanguagesCache=null,n.size)for(const p of n)this._resolvedGrammars.delete(p.name),this._loadedLanguagesCache=null,(l=(i=this._syncRegistry)==null?void 0:i._injectionGrammars)==null||l.delete(p.scopeName),(d=(c=this._syncRegistry)==null?void 0:c._grammars)==null||d.delete(p.scopeName),this.loadLanguage(this._langMap.get(p.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(const r of e)this.resolveEmbeddedLanguages(r);const n=[...this._langGraph.entries()],a=n.filter(([r,i])=>!i);if(a.length){const r=n.filter(([i,l])=>{var c;return l?(c=l.embeddedLanguages||l.embeddedLangs)==null?void 0:c.some(d=>a.map(([p])=>p).includes(d)):!1}).filter(i=>!a.includes(i));throw new $t(`Missing languages ${a.map(([i])=>`\`${i}\``).join(", ")}, required by ${r.map(([i])=>`\`${i}\``).join(", ")}`)}for(const[r,i]of n)this._resolver.addLanguage(i);for(const[r,i]of n)this.loadLanguage(i)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);const n=e.embeddedLanguages??e.embeddedLangs;if(n)for(const a of n)this._langGraph.set(a,this._langMap.get(a))}},LM=class{constructor(t,e){ne(this,"_langs",new Map);ne(this,"_scopeToLang",new Map);ne(this,"_injections",new Map);ne(this,"_onigLib");this._onigLib={createOnigScanner:n=>t.createScanner(n),createOnigString:n=>t.createString(n)},e.forEach(n=>this.addLanguage(n))}get onigLib(){return this._onigLib}getLangRegistration(t){return this._langs.get(t)}loadGrammar(t){return this._scopeToLang.get(t)}addLanguage(t){this._langs.set(t.name,t),t.aliases&&t.aliases.forEach(e=>{this._langs.set(e,t)}),this._scopeToLang.set(t.scopeName,t),t.injectTo&&t.injectTo.forEach(e=>{this._injections.get(e)||this._injections.set(e,[]),this._injections.get(e).push(t.scopeName)})}getInjections(t){const e=t.split(".");let n=[];for(let a=1;a<=e.length;a++){const r=e.slice(0,a).join(".");n=[...n,...this._injections.get(r)||[]]}return n}};let $c=0;function jM(t){$c+=1,t.warnings!==!1&&$c>=10&&$c%10===0&&console.warn(`[Shiki] ${$c} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let e=!1;if(!t.engine)throw new $t("`engine` option is required for synchronous mode");const n=(t.langs||[]).flat(1),a=(t.themes||[]).flat(1).map(G1),r=new OM(new LM(t.engine,n),a,n,t.langAlias);let i;function l(T){return Q3(T,t.langAlias)}function c(T){C();const L=r.getGrammar(typeof T=="string"?T:T.name);if(!L)throw new $t(`Language \`${T}\` not found, you may need to load it first`);return L}function d(T){if(T==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};C();const L=r.getTheme(T);if(!L)throw new $t(`Theme \`${T}\` not found, you may need to load it first`);return L}function p(T){C();const L=d(T);return i!==T&&(r.setTheme(L),i=T),{theme:L,colorMap:r.getColorMap()}}function h(){return C(),r.getLoadedThemes()}function m(){return C(),r.getLoadedLanguages()}function b(...T){C(),r.loadLanguages(T.flat(1))}async function x(...T){return b(await Z3(T))}function w(...T){C();for(const L of T.flat(1))r.loadTheme(L)}async function S(...T){return C(),w(await X3(T))}function C(){if(e)throw new $t("Shiki instance has been disposed")}function E(){e||(e=!0,r.dispose(),$c-=1)}return{setTheme:p,getTheme:d,getLanguage:c,getLoadedThemes:h,getLoadedLanguages:m,resolveLangAlias:l,loadLanguage:x,loadLanguageSync:b,loadTheme:S,loadThemeSync:w,dispose:E,[Symbol.dispose]:E}}async function BM(t){t.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[e,n,a]=await Promise.all([X3(t.themes||[]),Z3(t.langs||[]),t.engine]);return jM({...t,themes:e,langs:n,engine:a})}const J3=new WeakMap;function Up(t,e){J3.set(t,e)}function ku(t){return J3.get(t)}var Gp=class eS{constructor(...e){ne(this,"_stacks",{});ne(this,"lang");if(e.length===2){const[n,a]=e;this.lang=a,this._stacks=n}else{const[n,a,r]=e;this.lang=a,this._stacks={[r]:n}}}get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(e,n){return new eS(Object.fromEntries(DM(n).map(a=>[a,Ug])),e)}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return IM(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function IM(t){const e=[],n=new Set;function a(r){var l;if(n.has(r))return;n.add(r);const i=(l=r==null?void 0:r.nameScopesList)==null?void 0:l.scopeName;i&&e.push(i),r.parent&&a(r.parent)}return a(t),e}function PM(t,e){if(!(t instanceof Gp))throw new $t("Invalid grammar state");return t.getInternalStack(e)}const zM=/,/,$M=/ /;function tS(t,e,n={}){const{theme:a=t.getLoadedThemes()[0]}=n;if($p(t.resolveLangAlias(n.lang||"text"))||Fp(a))return Hp(e).map(c=>[{content:c[0],offset:c[1]}]);const{theme:r,colorMap:i}=t.setTheme(a),l=t.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==l.name)throw new $t(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${l.name}"`);if(!n.grammarState.themes.includes(r.name))throw new $t(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${r.name}"`)}return HM(e,l,r,i,n)}function FM(...t){if(t.length===2)return ku(t[1]);const[e,n,a={}]=t,{lang:r="text",theme:i=e.getLoadedThemes()[0]}=a;if($p(r)||Fp(i))throw new $t("Plain language does not have grammar state");if(r==="ansi")throw new $t("ANSI language does not have grammar state");const{theme:l,colorMap:c}=e.setTheme(i),d=e.getLanguage(r);return new Gp(q1(n,d,l,c,a).stateStack,d.name,l.name)}function HM(t,e,n,a,r){const i=q1(t,e,n,a,r),l=new Gp(i.stateStack,e.name,n.name);return Up(i.tokens,l),i.tokens}function q1(t,e,n,a,r){const i=lp(n,r),{tokenizeMaxLineLength:l=0,tokenizeTimeLimit:c=500,includeExplanation:d=!1}=r,p=Hp(t);let h=r.grammarState?PM(r.grammarState,n.name)??Ug:r.grammarContextCode!=null?q1(r.grammarContextCode,e,n,a,{...r,grammarState:void 0,grammarContextCode:void 0}).stateStack:Ug,m=[];const b=[];for(let x=0,w=p.length;x<w;x++){const[S,C]=p[x];if(S===""){m=[],b.push([]);continue}if(l>0&&S.length>=l){m=[],b.push([{content:S,offset:C,color:"",fontStyle:0}]);continue}let E,T,L;d&&d!=="tokenType"&&(E=e.tokenizeLine(S,h,c),T=E.tokens,L=0);const D=e.tokenizeLine2(S,h,c),B=D.tokens.length/2;for(let H=0;H<B;H++){const K=D.tokens[2*H],U=H+1<B?D.tokens[2*H+2]:S.length;if(K===U)continue;const q=D.tokens[2*H+1],re=ki(a[xo.getForeground(q)],i),_e=xo.getFontStyle(q),G={content:S.substring(K,U),offset:C+K,color:re,fontStyle:_e};if(d==="tokenType")G.type=xo.getTokenType(q);else if(d){const me=[];if(d!=="scopeName")for(const ye of n.settings){let P;switch(typeof ye.scope){case"string":P=ye.scope.split(zM).map(oe=>oe.trim());break;case"object":P=ye.scope;break;default:continue}me.push({settings:ye,selectors:P.map(oe=>oe.split($M))})}G.explanation=[];let ge=0;for(;K+ge<U;){const ye=T[L],P=S.substring(ye.startIndex,ye.endIndex);ge+=P.length,G.explanation.push({content:P,scopes:d==="scopeName"?UM(ye.scopes):GM(me,ye.scopes)}),L+=1}}m.push(G)}b.push(m),m=[],h=D.ruleStack}return{tokens:b,stateStack:h}}function UM(t){return t.map(e=>({scopeName:e}))}function GM(t,e){const n=[];for(let a=0,r=e.length;a<r;a++){const i=e[a];n[a]={scopeName:i,themeMatches:VM(t,i,e.slice(0,a))}}return n}function Z2(t,e){return t===e||e.substring(0,t.length)===t&&e[t.length]==="."}function qM(t,e,n){if(!Z2(t.at(-1),e))return!1;let a=t.length-2,r=n.length-1;for(;a>=0&&r>=0;)Z2(t[a],n[r])&&(a-=1),r-=1;return a===-1}function VM(t,e,n){const a=[];for(const{selectors:r,settings:i}of t)for(const l of r)if(qM(l,e,n)){a.push(i);break}return a}function nS(t,e,n,a=tS){const r=Object.entries(n.themes).filter(p=>p[1]).map(p=>({color:p[0],theme:p[1]})),i=r.map(p=>{const h=a(t,e,{...n,theme:p.theme});return{tokens:h,state:ku(h),theme:typeof p.theme=="string"?p.theme:p.theme.name}}),l=WM(...i.map(p=>p.tokens)),c=l[0].map((p,h)=>p.map((m,b)=>{const x={content:m.content,variants:{},offset:m.offset};return"includeExplanation"in n&&n.includeExplanation&&(x.explanation=m.explanation),l.forEach((w,S)=>{const{content:C,explanation:E,offset:T,...L}=w[h][b];x.variants[r[S].color]=L}),x})),d=i[0].state?new Gp(Object.fromEntries(i.map(p=>{var h;return[p.theme,(h=p.state)==null?void 0:h.getInternalStack(p.theme)]})),i[0].state.lang):void 0;return d&&Up(c,d),c}function WM(...t){const e=t.map(()=>[]),n=t.length;for(let a=0;a<t[0].length;a++){const r=t.map(d=>d[a]),i=e.map(()=>[]);e.forEach((d,p)=>d.push(i[p]));const l=r.map(()=>0),c=r.map(d=>d[0]);for(;c.every(d=>d);){const d=Math.min(...c.map(p=>p.content.length));for(let p=0;p<n;p++){const h=c[p];h.content.length===d?(i[p].push(h),l[p]+=1,c[p]=r[p][l[p]]):(i[p].push({...h,content:h.content.slice(0,d)}),c[p]={...h,content:h.content.slice(d),offset:h.offset+d})}}}return e}const KM=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],X2={}.hasOwnProperty;function YM(t,e){const n=e||{};function a(r,...i){let l=a.invalid;const c=a.handlers;if(r&&X2.call(r,t)){const d=String(r[t]);l=X2.call(c,d)?c[d]:a.unknown}if(l)return l.call(this,r,...i)}return a.handlers=n.handlers||{},a.invalid=n.invalid,a.unknown=n.unknown,a}const ZM=/["&'<>`]/g,XM=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,QM=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,JM=/[|\\{}()[\]^$+*?.]/g,Q2=new WeakMap;function eO(t,e){if(t=t.replace(e.subset?tO(e.subset):ZM,a),e.subset||e.escapeOnly)return t;return t.replace(XM,n).replace(QM,a);function n(r,i,l){return e.format((r.charCodeAt(0)-55296)*1024+r.charCodeAt(1)-56320+65536,l.charCodeAt(i+2),e)}function a(r,i,l){return e.format(r.charCodeAt(0),l.charCodeAt(i+1),e)}}function tO(t){let e=Q2.get(t);return e||(e=nO(t),Q2.set(t,e)),e}function nO(t){const e=[];let n=-1;for(;++n<t.length;)e.push(t[n].replace(JM,"\\$&"));return new RegExp("(?:"+e.join("|")+")","g")}const aO=/[\dA-Fa-f]/;function rO(t,e,n){const a="&#x"+t.toString(16).toUpperCase();return n&&e&&!aO.test(String.fromCharCode(e))?a:a+";"}const sO=/\d/;function iO(t,e,n){const a="&#"+String(t);return n&&e&&!sO.test(String.fromCharCode(e))?a:a+";"}const oO=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],Rm={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},lO=["cent","copy","divide","gt","lt","not","para","times"],aS={}.hasOwnProperty,Gg={};let h0;for(h0 in Rm)aS.call(Rm,h0)&&(Gg[Rm[h0]]=h0);const cO=/[^\dA-Za-z]/;function uO(t,e,n,a){const r=String.fromCharCode(t);if(aS.call(Gg,r)){const i=Gg[r],l="&"+i;return n&&oO.includes(i)&&!lO.includes(i)&&(!a||e&&e!==61&&cO.test(String.fromCharCode(e)))?l:l+";"}return""}function dO(t,e,n){let a=rO(t,e,n.omitOptionalSemicolons),r;if((n.useNamedReferences||n.useShortestReferences)&&(r=uO(t,e,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!r)&&n.useShortestReferences){const i=iO(t,e,n.omitOptionalSemicolons);i.length<a.length&&(a=i)}return r&&(!n.useShortestReferences||r.length<a.length)?r:a}function kl(t,e){return eO(t,Object.assign({format:dO},e))}const pO=/^>|^->|<!--|-->|--!>|<!-$/g,fO=[">"],hO=["<",">"];function mO(t,e,n,a){return a.settings.bogusComments?"<?"+kl(t.value,Object.assign({},a.settings.characterReferences,{subset:fO}))+">":"<!--"+t.value.replace(pO,r)+"-->";function r(i){return kl(i,Object.assign({},a.settings.characterReferences,{subset:hO}))}}function gO(t,e,n,a){return"<!"+(a.settings.upperDoctype?"DOCTYPE":"doctype")+(a.settings.tightDoctype?"":" ")+"html>"}function J2(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let a=0,r=n.indexOf(e);for(;r!==-1;)a++,r=n.indexOf(e,r+e.length);return a}const Rn=sS(1),rS=sS(-1),yO=[];function sS(t){return e;function e(n,a,r){const i=n?n.children:yO;let l=(a||0)+t,c=i[l];if(!r)for(;c&&c1(c);)l+=t,c=i[l];return c}}const bO={}.hasOwnProperty;function iS(t){return e;function e(n,a,r){return bO.call(t,n.tagName)&&t[n.tagName](n,a,r)}}const V1=iS({body:xO,caption:Dm,colgroup:Dm,dd:_O,dt:SO,head:Dm,html:vO,li:kO,optgroup:CO,option:AO,p:wO,rp:ew,rt:ew,tbody:EO,td:tw,tfoot:NO,th:tw,thead:TO,tr:RO});function Dm(t,e,n){const a=Rn(n,e,!0);return!a||a.type!=="comment"&&!(a.type==="text"&&c1(a.value.charAt(0)))}function vO(t,e,n){const a=Rn(n,e);return!a||a.type!=="comment"}function xO(t,e,n){const a=Rn(n,e);return!a||a.type!=="comment"}function wO(t,e,n){const a=Rn(n,e);return a?a.type==="element"&&(a.tagName==="address"||a.tagName==="article"||a.tagName==="aside"||a.tagName==="blockquote"||a.tagName==="details"||a.tagName==="div"||a.tagName==="dl"||a.tagName==="fieldset"||a.tagName==="figcaption"||a.tagName==="figure"||a.tagName==="footer"||a.tagName==="form"||a.tagName==="h1"||a.tagName==="h2"||a.tagName==="h3"||a.tagName==="h4"||a.tagName==="h5"||a.tagName==="h6"||a.tagName==="header"||a.tagName==="hgroup"||a.tagName==="hr"||a.tagName==="main"||a.tagName==="menu"||a.tagName==="nav"||a.tagName==="ol"||a.tagName==="p"||a.tagName==="pre"||a.tagName==="section"||a.tagName==="table"||a.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function kO(t,e,n){const a=Rn(n,e);return!a||a.type==="element"&&a.tagName==="li"}function SO(t,e,n){const a=Rn(n,e);return!!(a&&a.type==="element"&&(a.tagName==="dt"||a.tagName==="dd"))}function _O(t,e,n){const a=Rn(n,e);return!a||a.type==="element"&&(a.tagName==="dt"||a.tagName==="dd")}function ew(t,e,n){const a=Rn(n,e);return!a||a.type==="element"&&(a.tagName==="rp"||a.tagName==="rt")}function CO(t,e,n){const a=Rn(n,e);return!a||a.type==="element"&&a.tagName==="optgroup"}function AO(t,e,n){const a=Rn(n,e);return!a||a.type==="element"&&(a.tagName==="option"||a.tagName==="optgroup")}function TO(t,e,n){const a=Rn(n,e);return!!(a&&a.type==="element"&&(a.tagName==="tbody"||a.tagName==="tfoot"))}function EO(t,e,n){const a=Rn(n,e);return!a||a.type==="element"&&(a.tagName==="tbody"||a.tagName==="tfoot")}function NO(t,e,n){return!Rn(n,e)}function RO(t,e,n){const a=Rn(n,e);return!a||a.type==="element"&&a.tagName==="tr"}function tw(t,e,n){const a=Rn(n,e);return!a||a.type==="element"&&(a.tagName==="td"||a.tagName==="th")}const DO=iS({body:LO,colgroup:jO,head:OO,html:MO,tbody:BO});function MO(t){const e=Rn(t,-1);return!e||e.type!=="comment"}function OO(t){const e=new Set;for(const a of t.children)if(a.type==="element"&&(a.tagName==="base"||a.tagName==="title")){if(e.has(a.tagName))return!1;e.add(a.tagName)}const n=t.children[0];return!n||n.type==="element"}function LO(t){const e=Rn(t,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&c1(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function jO(t,e,n){const a=rS(n,e),r=Rn(t,-1,!0);return n&&a&&a.type==="element"&&a.tagName==="colgroup"&&V1(a,n.children.indexOf(a),n)?!1:!!(r&&r.type==="element"&&r.tagName==="col")}function BO(t,e,n){const a=rS(n,e),r=Rn(t,-1);return n&&a&&a.type==="element"&&(a.tagName==="thead"||a.tagName==="tbody")&&V1(a,n.children.indexOf(a),n)?!1:!!(r&&r.type==="element"&&r.tagName==="tr")}const m0={name:[[`
|
|
311
|
+
\f\r &/=>`.split(""),`
|
|
312
|
+
\f\r "&'/=>\``.split("")],[`\0
|
|
313
|
+
\f\r "&'/<=>`.split(""),`\0
|
|
314
|
+
\f\r "&'/<=>\``.split("")]],unquoted:[[`
|
|
315
|
+
\f\r &>`.split(""),`\0
|
|
316
|
+
\f\r "&'<=>\``.split("")],[`\0
|
|
317
|
+
\f\r "&'<=>\``.split(""),`\0
|
|
318
|
+
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function IO(t,e,n,a){const r=a.schema,i=r.space==="svg"?!1:a.settings.omitOptionalTags;let l=r.space==="svg"?a.settings.closeEmptyElements:a.settings.voids.includes(t.tagName.toLowerCase());const c=[];let d;r.space==="html"&&t.tagName==="svg"&&(a.schema=l1);const p=PO(a,t.properties),h=a.all(r.space==="html"&&t.tagName==="template"?t.content:t);return a.schema=r,h&&(l=!1),(p||!i||!DO(t,e,n))&&(c.push("<",t.tagName,p?" "+p:""),l&&(r.space==="svg"||a.settings.closeSelfClosing)&&(d=p.charAt(p.length-1),(!a.settings.tightSelfClosing||d==="/"||d&&d!=='"'&&d!=="'")&&c.push(" "),c.push("/")),c.push(">")),c.push(h),!l&&(!i||!V1(t,e,n))&&c.push("</"+t.tagName+">"),c.join("")}function PO(t,e){const n=[];let a=-1,r;if(e){for(r in e)if(e[r]!==null&&e[r]!==void 0){const i=zO(t,r,e[r]);i&&n.push(i)}}for(;++a<n.length;){const i=t.settings.tightAttributes?n[a].charAt(n[a].length-1):void 0;a!==n.length-1&&i!=='"'&&i!=="'"&&(n[a]+=" ")}return n.join("")}function zO(t,e,n){const a=Dk(t.schema,e),r=t.settings.allowParseErrors&&t.schema.space==="html"?0:1,i=t.settings.allowDangerousCharacters?0:1;let l=t.quote,c;if(a.overloadedBoolean&&(n===a.attribute||n==="")?n=!0:(a.boolean||a.overloadedBoolean)&&(typeof n!="string"||n===a.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const d=kl(a.attribute,Object.assign({},t.settings.characterReferences,{subset:m0.name[r][i]}));return n===!0||(n=Array.isArray(n)?(a.commaSeparated?C8:A8)(n,{padLeft:!t.settings.tightCommaSeparatedLists}):String(n),t.settings.collapseEmptyAttributes&&!n)?d:(t.settings.preferUnquoted&&(c=kl(n,Object.assign({},t.settings.characterReferences,{attribute:!0,subset:m0.unquoted[r][i]}))),c!==n&&(t.settings.quoteSmart&&J2(n,l)>J2(n,t.alternative)&&(l=t.alternative),c=l+kl(n,Object.assign({},t.settings.characterReferences,{subset:(l==="'"?m0.single:m0.double)[r][i],attribute:!0}))+l),d+(c&&"="+c))}const $O=["<","&"];function oS(t,e,n,a){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?t.value:kl(t.value,Object.assign({},a.settings.characterReferences,{subset:$O}))}function FO(t,e,n,a){return a.settings.allowDangerousHtml?t.value:oS(t,e,n,a)}function HO(t,e,n,a){return a.all(t)}const UO=YM("type",{invalid:GO,unknown:qO,handlers:{comment:mO,doctype:gO,element:IO,raw:FO,root:HO,text:oS}});function GO(t){throw new Error("Expected node, not `"+t+"`")}function qO(t){const e=t;throw new Error("Cannot compile unknown node `"+e.type+"`")}const VO={},WO={},KO=[];function YO(t,e){const n=e||VO,a=n.quote||'"',r=a==='"'?"'":'"';if(a!=='"'&&a!=="'")throw new Error("Invalid quote `"+a+"`, expected `'` or `\"`");return{one:ZO,all:XO,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||KM,characterReferences:n.characterReferences||WO,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?l1:Mk,quote:a,alternative:r}.one(Array.isArray(t)?{type:"root",children:t}:t,void 0,void 0)}function ZO(t,e,n){return UO(t,e,n,this)}function XO(t){const e=[],n=t&&t.children||KO;let a=-1;for(;++a<n.length;)e[a]=this.one(n[a],a,t);return e.join("")}const nw=/\s+/g;function lS(t,e){var a;if(!e)return t;t.properties||(t.properties={}),(a=t.properties).class||(a.class=[]),typeof t.properties.class=="string"&&(t.properties.class=t.properties.class.split(nw)),Array.isArray(t.properties.class)||(t.properties.class=[]);const n=Array.isArray(e)?e:e.split(nw);for(const r of n)r&&!t.properties.class.includes(r)&&t.properties.class.push(r);return t}function QO(t){const e=Hp(t,!0).map(([r])=>r);function n(r){if(r===t.length)return{line:e.length-1,character:e.at(-1).length};let i=r,l=0;for(const c of e){if(i<c.length)break;i-=c.length,l++}return{line:l,character:i}}function a(r,i){let l=0;for(let c=0;c<r;c++)l+=e[c].length;return l+=i,l}return{lines:e,indexToPos:n,posToIndex:a}}const JO=["color","background-color"];function eL(t,e){let n=0;const a=[];for(const r of e)r>n&&a.push({...t,content:t.content.slice(n,r),offset:t.offset+n}),n=r;return n<t.content.length&&a.push({...t,content:t.content.slice(n),offset:t.offset+n}),a}function tL(t,e){let n=0,a=t.length;for(;n<a;){const r=n+(a-n>>1);t[r]<=e?n=r+1:a=r}return n}function nL(t,e){const n=[...e instanceof Set?e:new Set(e)].sort((a,r)=>a-r);return n.length?t.map(a=>a.flatMap(r=>{const i=r.offset+r.content.length,l=tL(n,r.offset);let c=l;for(;c<n.length&&n[c]<i;)c++;if(l===c)return r;const d=n.slice(l,c);for(let p=0;p<d.length;p++)d[p]-=r.offset;return eL(r,d)})):t}function aL(t,e,n,a,r="css-vars"){const i={content:t.content,explanation:t.explanation,offset:t.offset},l=e.map(h=>cp(t.variants[h])),c=new Set(l.flatMap(h=>Object.keys(h))),d={},p=(h,m)=>{const b=m==="color"?"":m==="background-color"?"-bg":`-${m}`;return n+e[h]+(m==="color"?"":b)};return l.forEach((h,m)=>{for(const b of c){const x=h[b]||"inherit";if(m===0&&a&&JO.includes(b))if(a==="light-dark()"&&l.length>1){const w=e.findIndex(T=>T==="light"),S=e.findIndex(T=>T==="dark");if(w===-1||S===-1)throw new $t('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const C=l[w][b]||"inherit",E=l[S][b]||"inherit";d[b]=`light-dark(${C}, ${E})`,r==="css-vars"&&(d[p(m,b)]=x)}else d[b]=x;else r==="css-vars"&&(d[p(m,b)]=x)}}),i.htmlStyle=d,i}function cp(t){const e={};if(t.color&&(e.color=t.color),t.bgColor&&(e["background-color"]=t.bgColor),t.fontStyle){t.fontStyle&Vn.Italic&&(e["font-style"]="italic"),t.fontStyle&Vn.Bold&&(e["font-weight"]="bold");const n=[];t.fontStyle&Vn.Underline&&n.push("underline"),t.fontStyle&Vn.Strikethrough&&n.push("line-through"),n.length&&(e["text-decoration"]=n.join(" "))}return e}function qg(t){return typeof t=="string"?t:Object.entries(t).map(([e,n])=>`${e}:${n}`).join(";")}function rL(){const t=new WeakMap;function e(n){if(!t.has(n.meta)){let r=function(l){if(typeof l=="number"){if(l<0||l>n.source.length)throw new $t(`Invalid decoration offset: ${l}. Code length: ${n.source.length}`);return{...a.indexToPos(l),offset:l}}else{const c=a.lines[l.line];if(c===void 0)throw new $t(`Invalid decoration position ${JSON.stringify(l)}. Lines length: ${a.lines.length}`);let d=l.character;if(d<0&&(d=c.length+d),d<0||d>c.length)throw new $t(`Invalid decoration position ${JSON.stringify(l)}. Line ${l.line} length: ${c.length}`);return{...l,character:d,offset:a.posToIndex(l.line,d)}}};const a=QO(n.source),i=(n.options.decorations||[]).map(l=>({...l,start:r(l.start),end:r(l.end)}));sL(i),t.set(n.meta,{decorations:i,converter:a,source:n.source})}return t.get(n.meta)}return{name:"shiki:decorations",tokens(n){var a;if((a=this.options.decorations)!=null&&a.length)return nL(n,e(this).decorations.flatMap(r=>[r.start.offset,r.end.offset]))},code(n){var h;if(!((h=this.options.decorations)!=null&&h.length))return;const a=e(this),r=[...n.children].filter(m=>m.type==="element"&&m.tagName==="span");if(r.length!==a.converter.lines.length)throw new $t(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${a.converter.lines.length}). Failed to apply decorations.`);function i(m,b,x,w){const S=r[m];let C="",E=-1,T=-1;if(b===0&&(E=0),x===0&&(T=0),x===Number.POSITIVE_INFINITY&&(T=S.children.length),E===-1||T===-1)for(let D=0;D<S.children.length;D++)C+=cS(S.children[D]),E===-1&&C.length===b&&(E=D+1),T===-1&&C.length===x&&(T=D+1);if(E===-1)throw new $t(`Failed to find start index for decoration ${JSON.stringify(w.start)}`);if(T===-1)throw new $t(`Failed to find end index for decoration ${JSON.stringify(w.end)}`);const L=S.children.slice(E,T);if(!w.alwaysWrap&&L.length===S.children.length)c(S,w,"line");else if(!w.alwaysWrap&&L.length===1&&L[0].type==="element")c(L[0],w,"token");else{const D={type:"element",tagName:"span",properties:{},children:L};c(D,w,"wrapper"),S.children.splice(E,L.length,D)}}function l(m,b){r[m]=c(r[m],b,"line")}function c(m,b,x){var C;const w=b.properties||{},S=b.transform||(E=>E);return m.tagName=b.tagName||"span",m.properties={...m.properties,...w,class:m.properties.class},(C=b.properties)!=null&&C.class&&lS(m,b.properties.class),m=S(m,x)||m,m}const d=[],p=a.decorations.sort((m,b)=>b.start.offset-m.start.offset||m.end.offset-b.end.offset);for(const m of p){const{start:b,end:x}=m;if(b.line===x.line)i(b.line,b.character,x.character,m);else if(b.line<x.line){i(b.line,b.character,Number.POSITIVE_INFINITY,m);for(let w=b.line+1;w<x.line;w++)d.unshift(()=>l(w,m));i(x.line,0,x.character,m)}}d.forEach(m=>m())}}}function sL(t){for(let e=0;e<t.length;e++){const n=t[e];if(n.start.offset>n.end.offset)throw new $t(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let a=e+1;a<t.length;a++){const r=t[a],i=n.start.offset<=r.start.offset&&r.start.offset<n.end.offset,l=n.start.offset<r.end.offset&&r.end.offset<=n.end.offset,c=r.start.offset<=n.start.offset&&n.start.offset<r.end.offset,d=r.start.offset<n.end.offset&&n.end.offset<=r.end.offset;if(i||l||c||d){if(i&&l||c&&d||c&&n.start.offset===n.end.offset||l&&r.start.offset===r.end.offset)continue;throw new $t(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(r.start)} intersect.`)}}}}function cS(t){return t.type==="text"?t.value:t.type==="element"?t.children.map(cS).join(""):""}const iL=[rL()];function up(t){const e=oL(t.transformers||[]);return[...e.pre,...e.normal,...e.post,...iL]}function oL(t){const e=[],n=[],a=[];for(const r of t)switch(r.enforce){case"pre":e.push(r);break;case"post":n.push(r);break;default:a.push(r)}return{pre:e,post:n,normal:a}}var ho=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],Mm={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function lL(t,e){const n=t.indexOf("\x1B",e);if(n!==-1&&t[n+1]==="["){const a=t.indexOf("m",n);if(a!==-1)return{sequence:t.substring(n+2,a).split(";"),startPosition:n,position:a+1}}return{position:t.length}}function aw(t){const e=t.shift();if(e==="2"){const n=t.splice(0,3).map(a=>Number.parseInt(a));return n.length!==3||n.some(a=>Number.isNaN(a))?void 0:{type:"rgb",rgb:n}}else if(e==="5"){const n=t.shift();if(n)return{type:"table",index:Number(n)}}}function cL(t){const e=[];for(;t.length>0;){const n=t.shift();if(!n)continue;const a=Number.parseInt(n);if(!Number.isNaN(a))if(a===0)e.push({type:"resetAll"});else if(a<=9)Mm[a]&&e.push({type:"setDecoration",value:Mm[a]});else if(a<=29){const r=Mm[a-20];r&&(e.push({type:"resetDecoration",value:r}),r==="dim"&&e.push({type:"resetDecoration",value:"bold"}))}else if(a<=37)e.push({type:"setForegroundColor",value:{type:"named",name:ho[a-30]}});else if(a===38){const r=aw(t);r&&e.push({type:"setForegroundColor",value:r})}else if(a===39)e.push({type:"resetForegroundColor"});else if(a<=47)e.push({type:"setBackgroundColor",value:{type:"named",name:ho[a-40]}});else if(a===48){const r=aw(t);r&&e.push({type:"setBackgroundColor",value:r})}else a===49?e.push({type:"resetBackgroundColor"}):a===53?e.push({type:"setDecoration",value:"overline"}):a===55?e.push({type:"resetDecoration",value:"overline"}):a>=90&&a<=97?e.push({type:"setForegroundColor",value:{type:"named",name:ho[a-90+8]}}):a>=100&&a<=107&&e.push({type:"setBackgroundColor",value:{type:"named",name:ho[a-100+8]}})}return e}function uL(){let t=null,e=null,n=new Set;return{parse(a){const r=[];let i=0;do{const l=lL(a,i),c=l.sequence?a.substring(i,l.startPosition):a.substring(i);if(c.length>0&&r.push({value:c,foreground:t,background:e,decorations:new Set(n)}),l.sequence){const d=cL(l.sequence);for(const p of d)p.type==="resetAll"?(t=null,e=null,n.clear()):p.type==="resetForegroundColor"?t=null:p.type==="resetBackgroundColor"?e=null:p.type==="resetDecoration"&&n.delete(p.value);for(const p of d)p.type==="setForegroundColor"?t=p.value:p.type==="setBackgroundColor"?e=p.value:p.type==="setDecoration"&&n.add(p.value)}i=l.position}while(i<a.length);return r}}}var dL={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function pL(t=dL){function e(c){return t[c]}function n(c){return`#${c.map(d=>Math.max(0,Math.min(d,255)).toString(16).padStart(2,"0")).join("")}`}let a;function r(){if(a)return a;a=[];for(let p=0;p<ho.length;p++)a.push(e(ho[p]));let c=[0,95,135,175,215,255];for(let p=0;p<6;p++)for(let h=0;h<6;h++)for(let m=0;m<6;m++)a.push(n([c[p],c[h],c[m]]));let d=8;for(let p=0;p<24;p++,d+=10)a.push(n([d,d,d]));return a}function i(c){return r()[c]}function l(c){switch(c.type){case"named":return e(c.name);case"rgb":return n(c.rgb);case"table":return i(c.index)}}return{value:l}}const fL=/#([0-9a-f]{3,8})/i,hL=/var\((--[\w-]+-ansi-[\w-]+)\)/,mL={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function gL(t,e,n){const a=lp(t,n),r=Hp(e),i=pL(Object.fromEntries(ho.map(c=>{var p;const d=`terminal.ansi${c[0].toUpperCase()}${c.substring(1)}`;return[c,((p=t.colors)==null?void 0:p[d])||mL[c]]}))),l=uL();return r.map(c=>l.parse(c[0]).map(d=>{let p,h;d.decorations.has("reverse")?(p=d.background?i.value(d.background):t.bg,h=d.foreground?i.value(d.foreground):t.fg):(p=d.foreground?i.value(d.foreground):t.fg,h=d.background?i.value(d.background):void 0),p=ki(p,a),h=ki(h,a),d.decorations.has("dim")&&(p=yL(p));let m=Vn.None;return d.decorations.has("bold")&&(m|=Vn.Bold),d.decorations.has("italic")&&(m|=Vn.Italic),d.decorations.has("underline")&&(m|=Vn.Underline),d.decorations.has("strikethrough")&&(m|=Vn.Strikethrough),{content:d.value,offset:c[1],color:p,bgColor:h,fontStyle:m}}))}function yL(t){const e=t.match(fL);if(e){const a=e[1];if(a.length===8){const r=Math.round(Number.parseInt(a.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${a.slice(0,6)}${r}`}else{if(a.length===6)return`#${a}80`;if(a.length===4){const r=a[0],i=a[1],l=a[2],c=a[3];return`#${r}${r}${i}${i}${l}${l}${Math.round(Number.parseInt(`${c}${c}`,16)/2).toString(16).padStart(2,"0")}`}else if(a.length===3){const r=a[0],i=a[1],l=a[2];return`#${r}${r}${i}${i}${l}${l}80`}}}const n=t.match(hL);return n?`var(${n[1]}-dim)`:t}function Vg(t,e,n={}){const a=t.resolveLangAlias(n.lang||"text"),{theme:r=t.getLoadedThemes()[0]}=n;if(!$p(a)&&!Fp(r)&&a==="ansi"){const{theme:i}=t.setTheme(r);return gL(i,e,n)}return tS(t,e,n)}function dp(t,e,n){let a,r,i,l,c,d;if("themes"in n){const{defaultColor:p="light",cssVariablePrefix:h="--shiki-",colorsRendering:m="css-vars"}=n,b=Object.entries(n.themes).filter(E=>E[1]).map(E=>({color:E[0],theme:E[1]})).sort((E,T)=>E.color===p?-1:T.color===p?1:0);if(b.length===0)throw new $t("`themes` option must not be empty");const x=nS(t,e,n,Vg);if(d=ku(x),p&&p!=="light-dark()"&&!b.some(E=>E.color===p))throw new $t(`\`themes\` option must contain the defaultColor key \`${p}\``);const w=b.map(E=>t.getTheme(E.theme)),S=b.map(E=>E.color);i=x.map(E=>E.map(T=>aL(T,S,h,p,m))),d&&Up(i,d);const C=b.map(E=>lp(E.theme,n));r=rw(b,w,C,h,p,"fg",m),a=rw(b,w,C,h,p,"bg",m),l=`shiki-themes ${w.map(E=>E.name).join(" ")}`,c=p?void 0:[r,a].join(";")}else if("theme"in n){const p=lp(n.theme,n);i=Vg(t,e,n);const h=t.getTheme(n.theme);a=ki(h.bg,p),r=ki(h.fg,p),l=h.name,d=ku(i)}else throw new $t("Invalid options, either `theme` or `themes` must be provided");return{tokens:i,fg:r,bg:a,themeName:l,rootStyle:c,grammarState:d}}function rw(t,e,n,a,r,i,l){return t.map((c,d)=>{const p=ki(e[d][i],n[d])||"inherit",h=`${a+c.color}${i==="bg"?"-bg":""}:${p}`;if(d===0&&r){if(r==="light-dark()"&&t.length>1){const m=t.findIndex(x=>x.color==="light"),b=t.findIndex(x=>x.color==="dark");if(m===-1||b===-1)throw new $t('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${ki(e[m][i],n[m])||"inherit"}, ${ki(e[b][i],n[b])||"inherit"});${h}`}return p}return l==="css-vars"?h:null}).filter(c=>!!c).join(";")}const uS=/^\s+$/,bL=/^(\s*)(.*?)(\s*)$/;function pp(t,e,n,a={meta:{},options:n,codeToHast:(r,i)=>pp(t,r,i),codeToTokens:(r,i)=>dp(t,r,i)}){var w,S;let r=e;for(const C of up(n))r=((w=C.preprocess)==null?void 0:w.call(a,r,n))||r;let{tokens:i,fg:l,bg:c,themeName:d,rootStyle:p,grammarState:h}=dp(t,r,n);const{mergeWhitespaces:m=!0,mergeSameStyleTokens:b=!1}=n;m===!0?i=xL(i):m==="never"&&(i=wL(i)),b&&(i=kL(i));const x={...a,get source(){return r}};for(const C of up(n))i=((S=C.tokens)==null?void 0:S.call(x,i))||i;return vL(i,{...n,fg:l,bg:c,themeName:d,rootStyle:n.rootStyle===!1?!1:n.rootStyle??p},x,h)}function vL(t,e,n,a=ku(t)){var S,C,E,T;const r=up(e),i=[],l={type:"root",children:[]},{structure:c="classic",tabindex:d="0"}=e,p={class:`shiki ${e.themeName||""}`};e.rootStyle!==!1&&(e.rootStyle!=null?p.style=e.rootStyle:p.style=`background-color:${e.bg};color:${e.fg}`),d!==!1&&d!=null&&(p.tabindex=d.toString());for(const[L,D]of Object.entries(e.meta||{}))L.startsWith("_")||(p[L]=D);let h={type:"element",tagName:"pre",properties:p,children:[],data:e.data},m={type:"element",tagName:"code",properties:{},children:i};const b=[],x={...n,structure:c,addClassToHast:lS,get source(){return n.source},get tokens(){return t},get options(){return e},get root(){return l},get pre(){return h},get code(){return m},get lines(){return b}};if(t.forEach((L,D)=>{var K,U;D&&(c==="inline"?l.children.push({type:"element",tagName:"br",properties:{},children:[]}):c==="classic"&&i.push({type:"text",value:`
|
|
319
|
+
`}));let B={type:"element",tagName:"span",properties:{class:"line"},children:[]},H=0;for(const q of L){let re={type:"element",tagName:"span",properties:{...q.htmlAttrs},children:[{type:"text",value:q.content}]};const _e=qg(q.htmlStyle||cp(q));_e&&(re.properties.style=_e);for(const G of r)re=((K=G==null?void 0:G.span)==null?void 0:K.call(x,re,D+1,H,B,q))||re;c==="inline"?l.children.push(re):c==="classic"&&B.children.push(re),H+=q.content.length}if(c==="classic"){for(const q of r)B=((U=q==null?void 0:q.line)==null?void 0:U.call(x,B,D+1))||B;b.push(B),i.push(B)}else c==="inline"&&b.push(B)}),c==="classic"){for(const L of r)m=((S=L==null?void 0:L.code)==null?void 0:S.call(x,m))||m;h.children.push(m);for(const L of r)h=((C=L==null?void 0:L.pre)==null?void 0:C.call(x,h))||h;l.children.push(h)}else if(c==="inline"){const L=[];let D={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const H of l.children)H.type==="element"&&H.tagName==="br"?(L.push(D),D={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(H.type==="element"||H.type==="text")&&D.children.push(H);L.push(D);let B={type:"element",tagName:"code",properties:{},children:L};for(const H of r)B=((E=H==null?void 0:H.code)==null?void 0:E.call(x,B))||B;l.children=[];for(let H=0;H<B.children.length;H++){H>0&&l.children.push({type:"element",tagName:"br",properties:{},children:[]});const K=B.children[H];K.type==="element"&&l.children.push(...K.children)}}let w=l;for(const L of r)w=((T=L==null?void 0:L.root)==null?void 0:T.call(x,w))||w;return a&&Up(w,a),w}function xL(t){return t.map(e=>{const n=[];let a="",r;return e.forEach((i,l)=>{const c=!(i.fontStyle&&(i.fontStyle&Vn.Underline||i.fontStyle&Vn.Strikethrough));c&&uS.test(i.content)&&e[l+1]?(r===void 0&&(r=i.offset),a+=i.content):a?(c?n.push({...i,offset:r,content:a+i.content}):n.push({content:a,offset:r},i),r=void 0,a=""):n.push(i)}),n})}function wL(t){return t.map(e=>e.flatMap(n=>{if(uS.test(n.content))return n;const a=n.content.match(bL);if(!a)return n;const[,r,i,l]=a;if(!r&&!l)return n;const c=[{...n,offset:n.offset+r.length,content:i}];return r&&c.unshift({content:r,offset:n.offset}),l&&c.push({content:l,offset:n.offset+r.length+i.length}),c}))}function kL(t){return t.map(e=>{const n=[];for(const a of e){if(n.length===0){n.push({...a});continue}const r=n.at(-1),i=qg(r.htmlStyle||cp(r)),l=qg(a.htmlStyle||cp(a)),c=r.fontStyle&&(r.fontStyle&Vn.Underline||r.fontStyle&Vn.Strikethrough),d=a.fontStyle&&(a.fontStyle&Vn.Underline||a.fontStyle&Vn.Strikethrough);!c&&!d&&i===l?r.content+=a.content:n.push({...a})}return n})}const SL=YO;function _L(t,e,n){var i;const a={meta:{},options:n,codeToHast:(l,c)=>pp(t,l,c),codeToTokens:(l,c)=>dp(t,l,c)};let r=SL(pp(t,e,n,a));for(const l of up(n))r=((i=l.postprocess)==null?void 0:i.call(a,r,n))||r;return r}async function CL(t){const e=await BM(t);return{getLastGrammarState:(...n)=>FM(e,...n),codeToTokensBase:(n,a)=>Vg(e,n,a),codeToTokensWithThemes:(n,a)=>nS(e,n,a),codeToTokens:(n,a)=>dp(e,n,a),codeToHast:(n,a)=>pp(e,n,a),codeToHtml:(n,a)=>_L(e,n,a),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...e,getInternalContext:()=>e}}function AL(t){const e=t.langs,n=t.themes,a=t.engine;async function r(i){function l(m){var b;if(typeof m=="string"){if(m=((b=i.langAlias)==null?void 0:b[m])||m,K3(m))return[];const x=e[m];if(!x)throw new $t(`Language \`${m}\` is not included in this bundle. You may want to load it from external source.`);return x}return m}function c(m){if(Y3(m))return"none";if(typeof m=="string"){const b=n[m];if(!b)throw new $t(`Theme \`${m}\` is not included in this bundle. You may want to load it from external source.`);return b}return m}const d=(i.themes??[]).map(m=>c(m)),p=(i.langs??[]).map(m=>l(m)),h=await CL({engine:i.engine??a(),...i,themes:d,langs:p});return{...h,loadLanguage(...m){return h.loadLanguage(...m.map(l))},loadTheme(...m){return h.loadTheme(...m.map(c))},getBundledLanguages(){return e},getBundledThemes(){return n}}}return r}const dS=AL({langs:SD,themes:CD,engine:()=>(0,D3.createOnigurumaEngine)(j(()=>import("./wasm-CG6Dc4jp.js"),[]))}),sw=4294967295;var TL=class{constructor(t,e={}){ne(this,"patterns");ne(this,"options");ne(this,"regexps");this.patterns=t,this.options=e;const{forgiving:n=!1,cache:a,regexConstructor:r}=e;if(!r)throw new Error("Option `regexConstructor` is not provided");this.regexps=t.map(i=>{if(typeof i!="string")return i;const l=a==null?void 0:a.get(i);if(l){if(l instanceof RegExp)return l;if(n)return null;throw l}try{const c=r(i);return a==null||a.set(i,c),c}catch(c){if(a==null||a.set(i,c),n)return null;throw c}})}findNextMatchSync(t,e,n){const a=typeof t=="string"?t:t.content,r=[];function i(l,c,d=0){return{index:l,captureIndices:c.indices.map(p=>p==null?{start:sw,end:sw,length:0}:{start:p[0]+d,end:p[1]+d,length:p[1]-p[0]})}}for(let l=0;l<this.regexps.length;l++){const c=this.regexps[l];if(c)try{c.lastIndex=e;const d=c.exec(a);if(!d)continue;if(d.index===e)return i(l,d,0);r.push([l,d,0])}catch(d){if(this.options.forgiving)continue;throw d}}if(r.length){const l=Math.min(...r.map(c=>c[1].index));for(const[c,d,p]of r)if(d.index===l)return i(c,d,p)}return null}};function Il(t){if([...t].length!==1)throw new Error(`Expected "${t}" to be a single code point`);return t.codePointAt(0)}function EL(t,e,n){return t.has(e)||t.set(e,n),t.get(e)}const W1=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),jn=String.raw;function Pl(t,e){if(t==null)throw new Error(e??"Value expected");return t}const pS=jn`\[\^?`,fS=`c.? | C(?:-.?)?|${jn`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${jn`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${jn`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${jn`o\{[^\}]*\}?`}|${jn`\d{1,3}`}`,K1=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,g0=new RegExp(jn`
|
|
320
|
+
\\ (?:
|
|
321
|
+
${fS}
|
|
322
|
+
| [gk]<[^>]*>?
|
|
323
|
+
| [gk]'[^']*'?
|
|
324
|
+
| .
|
|
325
|
+
)
|
|
326
|
+
| \( (?:
|
|
327
|
+
\? (?:
|
|
328
|
+
[:=!>({]
|
|
329
|
+
| <[=!]
|
|
330
|
+
| <[^>]*>
|
|
331
|
+
| '[^']*'
|
|
332
|
+
| ~\|?
|
|
333
|
+
| #(?:[^)\\]|\\.?)*
|
|
334
|
+
| [^:)]*[:)]
|
|
335
|
+
)?
|
|
336
|
+
| \*[^\)]*\)?
|
|
337
|
+
)?
|
|
338
|
+
| (?:${K1.source})+
|
|
339
|
+
| ${pS}
|
|
340
|
+
| .
|
|
341
|
+
`.replace(/\s+/g,""),"gsu"),Om=new RegExp(jn`
|
|
342
|
+
\\ (?:
|
|
343
|
+
${fS}
|
|
344
|
+
| .
|
|
345
|
+
)
|
|
346
|
+
| \[:(?:\^?\p{Alpha}+|\^):\]
|
|
347
|
+
| ${pS}
|
|
348
|
+
| &&
|
|
349
|
+
| .
|
|
350
|
+
`.replace(/\s+/g,""),"gsu");function NL(t,e={}){const n={flags:"",...e,rules:{captureGroup:!1,singleline:!1,...e.rules}};if(typeof t!="string")throw new Error("String expected as pattern");const a=KL(n.flags),r=[a.extended],i={captureGroup:n.rules.captureGroup,getCurrentModX(){return r.at(-1)},numOpenGroups:0,popModX(){r.pop()},pushModX(m){r.push(m)},replaceCurrentModX(m){r[r.length-1]=m},singleline:n.rules.singleline};let l=[],c;for(g0.lastIndex=0;c=g0.exec(t);){const m=RL(i,t,c[0],g0.lastIndex);m.tokens?l.push(...m.tokens):m.token&&l.push(m.token),m.lastIndex!==void 0&&(g0.lastIndex=m.lastIndex)}const d=[];let p=0;l.filter(m=>m.type==="GroupOpen").forEach(m=>{m.kind==="capturing"?m.number=++p:m.raw==="("&&d.push(m)}),p||d.forEach((m,b)=>{m.kind="capturing",m.number=b+1});const h=p||d.length;return{tokens:l.map(m=>m.type==="EscapedNumber"?ZL(m,h):m).flat(),flags:a}}function RL(t,e,n,a){const[r,i]=n;if(n==="["||n==="[^"){const l=DL(e,n,a);return{tokens:l.tokens,lastIndex:l.lastIndex}}if(r==="\\"){if("AbBGyYzZ".includes(i))return{token:iw(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:FL(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:mS(n)}}if(i==="K")return{token:gS("keep",n)};if(i==="N"||i==="R")return{token:mo("newline",n,{negate:i==="N"})};if(i==="O")return{token:mo("any",n)};if(i==="X")return{token:mo("text_segment",n)};const l=hS(n,{inCharClass:!1});return Array.isArray(l)?{tokens:l}:{token:l}}if(r==="("){if(i==="*")return{token:qL(n)};if(n==="(?{")throw new Error(`Unsupported callout "${n}"`);if(n.startsWith("(?#")){if(e[a]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:a+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:GL(n,t)};if(t.pushModX(t.getCurrentModX()),t.numOpenGroups++,n==="("&&!t.captureGroup||n==="(?:")return{token:ml("group",n)};if(n==="(?>")return{token:ml("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?<!")return{token:ml(n[2]==="<"?"lookbehind":"lookahead",n,{negate:n.endsWith("!")})};if(n==="("&&t.captureGroup||n.startsWith("(?<")&&n.endsWith(">")||n.startsWith("(?'")&&n.endsWith("'"))return{token:ml("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:ml("absence_repeater",n)}}throw n==="(?("?new Error(`Unsupported conditional "${n}"`):new Error(`Invalid or unsupported group option "${n}"`)}if(n===")"){if(t.popModX(),t.numOpenGroups--,t.numOpenGroups<0)throw new Error('Unmatched ")"');return{token:PL(n)}}if(t.getCurrentModX()){if(n==="#"){const l=e.indexOf(`
|
|
351
|
+
`,a);return{lastIndex:l===-1?e.length:l}}if(/^\s$/.test(n)){const l=/\s+/y;return l.lastIndex=a,{lastIndex:l.exec(e)?l.lastIndex:a}}}if(n===".")return{token:mo("dot",n)};if(n==="^"||n==="$"){const l=t.singleline?{"^":jn`\A`,$:jn`\Z`}[n]:n;return{token:iw(l,n)}}return n==="|"?{token:OL(n)}:K1.test(n)?{tokens:XL(n)}:{token:Ss(Il(n),n)}}function DL(t,e,n){const a=[ow(e[1]==="^",e)];let r=1,i;for(Om.lastIndex=n;i=Om.exec(t);){const l=i[0];if(l[0]==="["&&l[1]!==":")r++,a.push(ow(l[1]==="^",l));else if(l==="]"){if(a.at(-1).type==="CharacterClassOpen")a.push(Ss(93,l));else if(r--,a.push(LL(l)),!r)break}else{const c=ML(l);Array.isArray(c)?a.push(...c):a.push(c)}}return{tokens:a,lastIndex:Om.lastIndex||t.length}}function ML(t){if(t[0]==="\\")return hS(t,{inCharClass:!0});if(t[0]==="["){const e=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(t);if(!e||!W1.has(e.groups.name))throw new Error(`Invalid POSIX class "${t}"`);return mo("posix",t,{value:e.groups.name,negate:!!e.groups.negate})}return t==="-"?jL(t):t==="&&"?BL(t):Ss(Il(t),t)}function hS(t,{inCharClass:e}){const n=t[1];if(n==="c"||n==="C")return UL(t);if("dDhHsSwW".includes(n))return VL(t);if(t.startsWith(jn`\o{`))throw new Error(`Incomplete, invalid, or unsupported octal code point "${t}"`);if(/^\\[pP]\{/.test(t)){if(t.length===3)throw new Error(`Incomplete or invalid Unicode property "${t}"`);return WL(t)}if(new RegExp("^\\\\x[89A-Fa-f]\\p{AHex}","u").test(t))try{const a=t.split(/\\x/).slice(1).map(l=>parseInt(l,16)),r=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(a)),i=new TextEncoder;return[...r].map(l=>{const c=[...i.encode(l)].map(d=>`\\x${d.toString(16)}`).join("");return Ss(Il(l),c)})}catch{throw new Error(`Multibyte code "${t}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return Ss(YL(t),t);if(lw.has(n))return Ss(lw.get(n),t);if(/\d/.test(n))return IL(e,t);if(t==="\\")throw new Error(jn`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${t}"`);if([...t].length===2)return Ss(t.codePointAt(1),t);throw new Error(`Unexpected escape "${t}"`)}function OL(t){return{type:"Alternator",raw:t}}function iw(t,e){return{type:"Assertion",kind:t,raw:e}}function mS(t){return{type:"Backreference",raw:t}}function Ss(t,e){return{type:"Character",value:t,raw:e}}function LL(t){return{type:"CharacterClassClose",raw:t}}function jL(t){return{type:"CharacterClassHyphen",raw:t}}function BL(t){return{type:"CharacterClassIntersector",raw:t}}function ow(t,e){return{type:"CharacterClassOpen",negate:t,raw:e}}function mo(t,e,n={}){return{type:"CharacterSet",kind:t,...n,raw:e}}function gS(t,e,n={}){return t==="keep"?{type:"Directive",kind:t,raw:e}:{type:"Directive",kind:t,flags:Pl(n.flags),raw:e}}function IL(t,e){return{type:"EscapedNumber",inCharClass:t,raw:e}}function PL(t){return{type:"GroupClose",raw:t}}function ml(t,e,n={}){return{type:"GroupOpen",kind:t,...n,raw:e}}function zL(t,e,n,a){return{type:"NamedCallout",kind:t,tag:e,arguments:n,raw:a}}function $L(t,e,n,a){return{type:"Quantifier",kind:t,min:e,max:n,raw:a}}function FL(t){return{type:"Subroutine",raw:t}}const HL=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),lw=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function UL(t){const e=t[1]==="c"?t[2]:t[3];if(!e||!/[A-Za-z]/.test(e))throw new Error(`Unsupported control character "${t}"`);return Ss(Il(e.toUpperCase())-64,t)}function GL(t,e){let{on:n,off:a}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(t).groups;a??(a="");const r=(e.getCurrentModX()||n.includes("x"))&&!a.includes("x"),i=uw(n),l=uw(a),c={};if(i&&(c.enable=i),l&&(c.disable=l),t.endsWith(")"))return e.replaceCurrentModX(r),gS("flags",t,{flags:c});if(t.endsWith(":"))return e.pushModX(r),e.numOpenGroups++,ml("group",t,{...(i||l)&&{flags:c}});throw new Error(`Unexpected flag modifier "${t}"`)}function qL(t){const e=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(t);if(!e)throw new Error(`Incomplete or invalid named callout "${t}"`);const{name:n,tag:a,args:r}=e.groups;if(!n)throw new Error(`Invalid named callout "${t}"`);if(a==="")throw new Error(`Named callout tag with empty value not allowed "${t}"`);const i=r?r.split(",").filter(h=>h!=="").map(h=>/^[+-]?\d+$/.test(h)?+h:h):[],[l,c,d]=i,p=HL.has(n)?n.toLowerCase():"custom";switch(p){case"fail":case"mismatch":case"skip":if(i.length>0)throw new Error(`Named callout arguments not allowed "${i}"`);break;case"error":if(i.length>1)throw new Error(`Named callout allows only one argument "${i}"`);if(typeof l=="string")throw new Error(`Named callout argument must be a number "${l}"`);break;case"max":if(!i.length||i.length>2)throw new Error(`Named callout must have one or two arguments "${i}"`);if(typeof l=="string"&&!/^[A-Za-z_]\w*$/.test(l))throw new Error(`Named callout argument one must be a tag or number "${l}"`);if(i.length===2&&(typeof c=="number"||!/^[<>X]$/.test(c)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${c}"`);break;case"count":case"total_count":if(i.length>1)throw new Error(`Named callout allows only one argument "${i}"`);if(i.length===1&&(typeof l=="number"||!/^[<>X]$/.test(l)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${l}"`);break;case"cmp":if(i.length!==3)throw new Error(`Named callout must have three arguments "${i}"`);if(typeof l=="string"&&!/^[A-Za-z_]\w*$/.test(l))throw new Error(`Named callout argument one must be a tag or number "${l}"`);if(typeof c=="number"||!/^(?:[<>!=]=|[<>])$/.test(c))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${c}"`);if(typeof d=="string"&&!/^[A-Za-z_]\w*$/.test(d))throw new Error(`Named callout argument three must be a tag or number "${d}"`);break;case"custom":throw new Error(`Undefined callout name "${n}"`);default:throw new Error(`Unexpected named callout kind "${p}"`)}return zL(p,a??null,(r==null?void 0:r.split(","))??null,t)}function cw(t){let e=null,n,a;if(t[0]==="{"){const{minStr:r,maxStr:i}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(t).groups,l=1e5;if(+r>l||i&&+i>l)throw new Error("Quantifier value unsupported in Oniguruma");if(n=+r,a=i===void 0?+r:i===""?1/0:+i,n>a&&(e="possessive",[n,a]=[a,n]),t.endsWith("?")){if(e==="possessive")throw new Error('Unsupported possessive interval quantifier chain with "?"');e="lazy"}else e||(e="greedy")}else n=t[0]==="+"?1:0,a=t[0]==="?"?1:1/0,e=t[1]==="+"?"possessive":t[1]==="?"?"lazy":"greedy";return $L(e,n,a,t)}function VL(t){const e=t[1].toLowerCase();return mo({d:"digit",h:"hex",s:"space",w:"word"}[e],t,{negate:t[1]!==e})}function WL(t){const{p:e,neg:n,value:a}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(t).groups;return mo("property",t,{value:a,negate:e==="P"&&!n||e==="p"&&!!n})}function uw(t){const e={};return t.includes("i")&&(e.ignoreCase=!0),t.includes("m")&&(e.dotAll=!0),t.includes("x")&&(e.extended=!0),Object.keys(e).length?e:null}function KL(t){const e={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n<t.length;n++){const a=t[n];if(!"imxDPSWy".includes(a))throw new Error(`Invalid flag "${a}"`);if(a==="y"){if(!/^y{[gw]}/.test(t.slice(n)))throw new Error('Invalid or unspecified flag "y" mode');e.textSegmentMode=t[n+2]==="g"?"grapheme":"word",n+=3;continue}e[{i:"ignoreCase",m:"dotAll",x:"extended",D:"digitIsAscii",P:"posixIsAscii",S:"spaceIsAscii",W:"wordIsAscii"}[a]]=!0}return e}function YL(t){if(new RegExp("^(?:\\\\u(?!\\p{AHex}{4})|\\\\x(?!\\p{AHex}{1,2}|\\{\\p{AHex}{1,8}\\}))","u").test(t))throw new Error(`Incomplete or invalid escape "${t}"`);const e=t[2]==="{"?new RegExp("^\\\\x\\{\\s*(?<hex>\\p{AHex}+)","u").exec(t).groups.hex:t.slice(2);return parseInt(e,16)}function ZL(t,e){const{raw:n,inCharClass:a}=t,r=n.slice(1);if(!a&&(r!=="0"&&r.length===1||r[0]!=="0"&&+r<=e))return[mS(n)];const i=[],l=r.match(/^[0-7]+|\d/g);for(let c=0;c<l.length;c++){const d=l[c];let p;if(c===0&&d!=="8"&&d!=="9"){if(p=parseInt(d,8),p>127)throw new Error(jn`Octal encoded byte above 177 unsupported "${n}"`)}else p=Il(d);i.push(Ss(p,(c===0?"\\":"")+d))}return i}function XL(t){const e=[],n=new RegExp(K1,"gy");let a;for(;a=n.exec(t);){const r=a[0];if(r[0]==="{"){const i=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(r);if(i){const{min:l,max:c}=i.groups;if(+l>+c&&r.endsWith("?")){n.lastIndex--,e.push(cw(r.slice(0,-1)));continue}}}e.push(cw(r))}return e}function yS(t,e){if(!Array.isArray(t.body))throw new Error("Expected node with body array");if(t.body.length!==1)return!1;const n=t.body[0];return!e||Object.keys(e).every(a=>e[a]===n[a])}function QL(t){return JL.has(t.type)}const JL=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function bS(t,e={}){const n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...e,rules:{captureGroup:!1,singleline:!1,...e.rules}},a=NL(t,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),r=(b,x)=>{const w=a.tokens[i.nextIndex];switch(i.parent=b,i.nextIndex++,w.type){case"Alternator":return Co();case"Assertion":return ej(w);case"Backreference":return tj(w,i);case"Character":return qp(w.value,{useLastValid:!!x.isCheckingRangeEnd});case"CharacterClassHyphen":return nj(w,i,x);case"CharacterClassOpen":return aj(w,i,x);case"CharacterSet":return rj(w,i);case"Directive":return uj(w.kind,{flags:w.flags});case"GroupOpen":return sj(w,i,x);case"NamedCallout":return pj(w.kind,w.tag,w.arguments);case"Quantifier":return ij(w,i);case"Subroutine":return oj(w,i);default:throw new Error(`Unexpected token type "${w.type}"`)}},i={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:a.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:r},l=hj(dj(a.flags));let c=l.body[0];for(;i.nextIndex<a.tokens.length;){const b=r(c,{});b.type==="Alternative"?(l.body.push(b),c=b):c.body.push(b)}const{capturingGroups:d,hasNumberedRef:p,namedGroupsByName:h,subroutines:m}=i;if(p&&h.size&&!n.rules.captureGroup)throw new Error("Numbered backref/subroutine not allowed when using named capture");for(const{ref:b}of m)if(typeof b=="number"){if(b>d.length)throw new Error("Subroutine uses a group number that's not defined");b&&(d[b-1].isSubroutined=!0)}else if(h.has(b)){if(h.get(b).length>1)throw new Error(jn`Subroutine uses a duplicate group name "\g<${b}>"`);h.get(b)[0].isSubroutined=!0}else throw new Error(jn`Subroutine uses a group name that's not defined "\g<${b}>"`);return l}function ej({kind:t}){return Wg(Pl({"^":"line_start",$:"line_end","\\A":"string_start","\\b":"word_boundary","\\B":"word_boundary","\\G":"search_start","\\y":"text_segment_boundary","\\Y":"text_segment_boundary","\\z":"string_end","\\Z":"string_end_newline"}[t],`Unexpected assertion kind "${t}"`),{negate:t===jn`\B`||t===jn`\Y`})}function tj({raw:t},e){const n=/^\\k[<']/.test(t),a=n?t.slice(3,-1):t.slice(1),r=(i,l=!1)=>{const c=e.capturingGroups.length;let d=!1;if(i>c)if(e.skipBackrefValidation)d=!0;else throw new Error(`Not enough capturing groups defined to the left "${t}"`);return e.hasNumberedRef=!0,Kg(l?c+1-i:i,{orphan:d})};if(n){const i=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(a);if(i)return r(+i.groups.num,!!i.groups.sign);if(/[-+]/.test(a))throw new Error(`Invalid backref name "${t}"`);if(!e.namedGroupsByName.has(a))throw new Error(`Group name not defined to the left "${t}"`);return Kg(a)}return r(+a)}function nj(t,e,n){const{tokens:a,walk:r}=e,i=e.parent,l=i.body.at(-1),c=a[e.nextIndex];if(!n.isCheckingRangeEnd&&l&&l.type!=="CharacterClass"&&l.type!=="CharacterClassRange"&&c&&c.type!=="CharacterClassOpen"&&c.type!=="CharacterClassClose"&&c.type!=="CharacterClassIntersector"){const d=r(i,{...n,isCheckingRangeEnd:!0});if(l.type==="Character"&&d.type==="Character")return i.body.pop(),cj(l,d);throw new Error("Invalid character class range")}return qp(Il("-"))}function aj({negate:t},e,n){const{tokens:a,walk:r}=e,i=[j0()],l=a[e.nextIndex];let c=fw(l);for(;c.type!=="CharacterClassClose";){if(c.type==="CharacterClassIntersector")i.push(j0()),e.nextIndex++;else{const p=i.at(-1);p.body.push(r(p,n))}c=fw(a[e.nextIndex],l)}const d=j0({negate:t});return i.length===1?d.body=i[0].body:(d.kind="intersection",d.body=i.map(p=>p.body.length===1?p.body[0]:p)),e.nextIndex++,d}function rj({kind:t,negate:e,value:n},a){const{normalizeUnknownPropertyNames:r,skipPropertyNameValidation:i,unicodePropertyMap:l}=a;if(t==="property"){const c=Vp(n);if(W1.has(c)&&!(l!=null&&l.has(c)))t="posix",n=c;else return gl(n,{negate:e,normalizeUnknownPropertyNames:r,skipPropertyNameValidation:i,unicodePropertyMap:l})}return t==="posix"?fj(n,{negate:e}):Yg(t,{negate:e})}function sj(t,e,n){const{tokens:a,capturingGroups:r,namedGroupsByName:i,skipLookbehindValidation:l,walk:c}=e,d=mj(t),p=d.type==="AbsenceFunction",h=pw(d),m=h&&d.negate;if(d.type==="CapturingGroup"&&(r.push(d),d.name&&EL(i,d.name,[]).push(d)),p&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let b=hw(a[e.nextIndex]);for(;b.type!=="GroupClose";){if(b.type==="Alternator")d.body.push(Co()),e.nextIndex++;else{const x=d.body.at(-1),w=c(x,{...n,isInAbsenceFunction:n.isInAbsenceFunction||p,isInLookbehind:n.isInLookbehind||h,isInNegLookbehind:n.isInNegLookbehind||m});if(x.body.push(w),(h||n.isInLookbehind)&&!l){const S="Lookbehind includes a pattern not allowed by Oniguruma";if(m||n.isInNegLookbehind){if(dw(w)||w.type==="CapturingGroup")throw new Error(S)}else if(dw(w)||pw(w)&&w.negate)throw new Error(S)}}b=hw(a[e.nextIndex])}return e.nextIndex++,d}function ij({kind:t,min:e,max:n},a){const r=a.parent,i=r.body.at(-1);if(!i||!QL(i))throw new Error("Quantifier requires a repeatable token");const l=xS(t,e,n,i);return r.body.pop(),l}function oj({raw:t},e){const{capturingGroups:n,subroutines:a}=e;let r=t.slice(3,-1);const i=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(r);if(i){const c=+i.groups.num,d=n.length;if(e.hasNumberedRef=!0,r={"":c,"+":d+c,"-":d+1-c}[i.groups.sign],r<1)throw new Error("Invalid subroutine number")}else r==="0"&&(r=0);const l=wS(r);return a.push(l),l}function lj(t,e){return{type:"AbsenceFunction",kind:t,body:Lu(e==null?void 0:e.body)}}function Co(t){return{type:"Alternative",body:kS(t==null?void 0:t.body)}}function Wg(t,e){const n={type:"Assertion",kind:t};return(t==="word_boundary"||t==="text_segment_boundary")&&(n.negate=!!(e!=null&&e.negate)),n}function Kg(t,e){const n=!!(e!=null&&e.orphan);return{type:"Backreference",ref:t,...n&&{orphan:n}}}function vS(t,e){const n={name:void 0,isSubroutined:!1,...e};if(n.name!==void 0&&!gj(n.name))throw new Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:"CapturingGroup",number:t,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:Lu(e==null?void 0:e.body)}}function qp(t,e){const n={useLastValid:!1,...e};if(t>1114111){const a=t.toString(16);if(n.useLastValid)t=1114111;else throw t>1310719?new Error(`Invalid code point out of range "\\x{${a}}"`):new Error(`Invalid code point out of range in JS "\\x{${a}}"`)}return{type:"Character",value:t}}function j0(t){const e={kind:"union",negate:!1,...t};return{type:"CharacterClass",kind:e.kind,negate:e.negate,body:kS(t==null?void 0:t.body)}}function cj(t,e){if(e.value<t.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:t,max:e}}function Yg(t,e){const n=!!(e!=null&&e.negate),a={type:"CharacterSet",kind:t};return(t==="digit"||t==="hex"||t==="newline"||t==="space"||t==="word")&&(a.negate=n),(t==="text_segment"||t==="newline"&&!n)&&(a.variableLength=!0),a}function uj(t,e={}){if(t==="keep")return{type:"Directive",kind:t};if(t==="flags")return{type:"Directive",kind:t,flags:Pl(e.flags)};throw new Error(`Unexpected directive kind "${t}"`)}function dj(t){return{type:"Flags",...t}}function br(t){const e=t==null?void 0:t.atomic,n=t==null?void 0:t.flags;if(e&&n)throw new Error("Atomic group cannot have flags");return{type:"Group",...e&&{atomic:e},...n&&{flags:n},body:Lu(t==null?void 0:t.body)}}function po(t){const e={behind:!1,negate:!1,...t};return{type:"LookaroundAssertion",kind:e.behind?"lookbehind":"lookahead",negate:e.negate,body:Lu(t==null?void 0:t.body)}}function pj(t,e,n){return{type:"NamedCallout",kind:t,tag:e,arguments:n}}function fj(t,e){const n=!!(e!=null&&e.negate);if(!W1.has(t))throw new Error(`Invalid POSIX class "${t}"`);return{type:"CharacterSet",kind:"posix",value:t,negate:n}}function xS(t,e,n,a){if(e>n)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:t,min:e,max:n,body:a}}function hj(t,e){return{type:"Regex",body:Lu(e==null?void 0:e.body),flags:t}}function wS(t){return{type:"Subroutine",ref:t}}function gl(t,e){var r;const n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...e};let a=(r=n.unicodePropertyMap)==null?void 0:r.get(Vp(t));if(!a){if(n.normalizeUnknownPropertyNames)a=yj(t);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(jn`Invalid Unicode property "\p{${t}}"`)}return{type:"CharacterSet",kind:"property",value:a??t,negate:n.negate}}function mj({flags:t,kind:e,name:n,negate:a,number:r}){switch(e){case"absence_repeater":return lj("repeater");case"atomic":return br({atomic:!0});case"capturing":return vS(r,{name:n});case"group":return br({flags:t});case"lookahead":case"lookbehind":return po({behind:e==="lookbehind",negate:a});default:throw new Error(`Unexpected group kind "${e}"`)}}function Lu(t){if(t===void 0)t=[Co()];else if(!Array.isArray(t)||!t.length||!t.every(e=>e.type==="Alternative"))throw new Error("Invalid body; expected array of one or more Alternative nodes");return t}function kS(t){if(t===void 0)t=[];else if(!Array.isArray(t)||!t.every(e=>!!e.type))throw new Error("Invalid body; expected array of nodes");return t}function dw(t){return t.type==="LookaroundAssertion"&&t.kind==="lookahead"}function pw(t){return t.type==="LookaroundAssertion"&&t.kind==="lookbehind"}function gj(t){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(t)}function yj(t){return t.trim().replace(/[- _]+/g,"_").replace(/[A-Z][a-z]+(?=[A-Z])/g,"$&_").replace(/[A-Za-z]+/g,e=>e[0].toUpperCase()+e.slice(1).toLowerCase())}function Vp(t){return t.replace(/[- _]+/g,"").toLowerCase()}function fw(t,e){const n=e;return Pl(t,`Unclosed character class${(n==null?void 0:n.type)==="Character"&&n.value===93&&n.raw==="]"?' (started with "]")':""}`)}function hw(t){return Pl(t,"Unclosed group")}function su(t,e,n=null){function a(i,l){for(let c=0;c<i.length;c++){const d=r(i[c],l,c,i);c=Math.max(-1,c+d)}}function r(i,l=null,c=null,d=null){var E,T;let p=0,h=!1;const m={node:i,parent:l,key:c,container:d,root:t,remove(){y0(d).splice(Math.max(0,pl(c)+p),1),p--,h=!0},removeAllNextSiblings(){return y0(d).splice(pl(c)+1)},removeAllPrevSiblings(){const L=pl(c)+p;return p-=L,y0(d).splice(0,Math.max(0,L))},replaceWith(L,D={}){const B=!!D.traverse;d?d[Math.max(0,pl(c)+p)]=L:Pl(l,"Can't replace root node")[c]=L,B&&r(L,l,c,d),h=!0},replaceWithMultiple(L,D={}){const B=!!D.traverse;if(y0(d).splice(Math.max(0,pl(c)+p),1,...L),p+=L.length-1,B){let H=0;for(let K=0;K<L.length;K++)H+=r(L[K],l,pl(c)+K+H,d)}h=!0},skip(){h=!0}},{type:b}=i,x=e["*"],w=e[b],S=typeof x=="function"?x:x==null?void 0:x.enter,C=typeof w=="function"?w:w==null?void 0:w.enter;if(S==null||S(m,n),C==null||C(m,n),!h)switch(b){case"AbsenceFunction":case"Alternative":case"CapturingGroup":case"CharacterClass":case"Group":case"LookaroundAssertion":a(i.body,i);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":r(i.min,i,"min"),r(i.max,i,"max");break;case"Quantifier":r(i.body,i,"body");break;case"Regex":a(i.body,i),r(i.flags,i,"flags");break;default:throw new Error(`Unexpected node type "${b}"`)}return(E=w==null?void 0:w.exit)==null||E.call(w,m,n),(T=x==null?void 0:x.exit)==null||T.call(x,m,n),p}return r(t),t}function y0(t){if(!Array.isArray(t))throw new Error("Container expected");return t}function pl(t){if(typeof t!="number")throw new Error("Numeric key expected");return t}const bj=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function vj(t,e){for(let n=0;n<t.length;n++)t[n]>=e&&t[n]++}function xj(t,e,n,a){return t.slice(0,e)+a+t.slice(e+n.length)}const ir=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function Y1(t,e,n,a){const r=new RegExp(String.raw`${e}|(?<$skip>\[\^?|\\?.)`,"gsu"),i=[!1];let l=0,c="";for(const d of t.matchAll(r)){const{0:p,groups:{$skip:h}}=d;if(!h&&(!a||a===ir.DEFAULT==!l)){n instanceof Function?c+=n(d,{context:l?ir.CHAR_CLASS:ir.DEFAULT,negated:i[i.length-1]}):c+=n;continue}p[0]==="["?(l++,i.push(p[1]==="^")):p==="]"&&l&&(l--,i.pop()),c+=p}return c}function SS(t,e,n,a){Y1(t,e,n,a)}function wj(t,e,n=0,a){if(!new RegExp(e,"su").test(t))return null;const r=new RegExp(`${e}|(?<$skip>\\\\?.)`,"gsu");r.lastIndex=n;let i=0,l;for(;l=r.exec(t);){const{0:c,groups:{$skip:d}}=l;if(!d&&(!a||a===ir.DEFAULT==!i))return l;c==="["?i++:c==="]"&&i&&i--,r.lastIndex==l.index&&r.lastIndex++}return null}function b0(t,e,n){return!!wj(t,e,0,n)}function kj(t,e){const n=/\\?./gsu;n.lastIndex=e;let a=t.length,r=0,i=1,l;for(;l=n.exec(t);){const[c]=l;if(c==="[")r++;else if(r)c==="]"&&r--;else if(c==="(")i++;else if(c===")"&&(i--,!i)){a=l.index;break}}return t.slice(e,a)}const mw=new RegExp(String.raw`(?<noncapturingStart>${bj})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function Sj(t,e){const n=(e==null?void 0:e.hiddenCaptures)??[];let a=(e==null?void 0:e.captureTransfers)??new Map;if(!/\(\?>/.test(t))return{pattern:t,captureTransfers:a,hiddenCaptures:n};const r="(?>",i="(?:(?=(",l=[0],c=[];let d=0,p=0,h=NaN,m;do{m=!1;let b=0,x=0,w=!1,S;for(mw.lastIndex=Number.isNaN(h)?0:h+i.length;S=mw.exec(t);){const{0:C,index:E,groups:{capturingStart:T,noncapturingStart:L}}=S;if(C==="[")b++;else if(b)C==="]"&&b--;else if(C===r&&!w)h=E,w=!0;else if(w&&L)x++;else if(T)w?x++:(d++,l.push(d+p));else if(C===")"&&w){if(!x){p++;const D=d+p;if(t=`${t.slice(0,h)}${i}${t.slice(h+r.length,E)}))<$$${D}>)${t.slice(E+1)}`,m=!0,c.push(D),vj(n,D),a.size){const B=new Map;a.forEach((H,K)=>{B.set(K>=D?K+1:K,H.map(U=>U>=D?U+1:U))}),a=B}break}x--}}}while(m);return n.push(...c),t=Y1(t,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:b,groups:{backrefNum:x,wrappedBackrefNum:w}})=>{if(x){const S=+x;if(S>l.length-1)throw new Error(`Backref "${b}" greater than number of captures`);return`\\${l[S]}`}return`\\${w}`},ir.DEFAULT),{pattern:t,captureTransfers:a,hiddenCaptures:n}}const _S=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,Lm=new RegExp(String.raw`
|
|
352
|
+
\\(?: \d+
|
|
353
|
+
| c[A-Za-z]
|
|
354
|
+
| [gk]<[^>]+>
|
|
355
|
+
| [pPu]\{[^\}]+\}
|
|
356
|
+
| u[A-Fa-f\d]{4}
|
|
357
|
+
| x[A-Fa-f\d]{2}
|
|
358
|
+
)
|
|
359
|
+
| \((?: \? (?: [:=!>]
|
|
360
|
+
| <(?:[=!]|[^>]+>)
|
|
361
|
+
| [A-Za-z\-]+:
|
|
362
|
+
| \(DEFINE\)
|
|
363
|
+
))?
|
|
364
|
+
| (?<qBase>${_S})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
|
|
365
|
+
| \\?.
|
|
366
|
+
`.replace(/\s+/g,""),"gsu");function _j(t){if(!new RegExp(`${_S}\\+`).test(t))return{pattern:t};const e=[];let n=null,a=null,r="",i=0,l;for(Lm.lastIndex=0;l=Lm.exec(t);){const{0:c,index:d,groups:{qBase:p,qMod:h,invalidQ:m}}=l;if(c==="[")i||(a=d),i++;else if(c==="]")i?i--:a=null;else if(!i)if(h==="+"&&r&&!r.startsWith("(")){if(m)throw new Error(`Invalid quantifier "${c}"`);let b=-1;if(/^\{\d+\}$/.test(p))t=xj(t,d+p.length,h,"");else{if(r===")"||r==="]"){const x=r===")"?n:a;if(x===null)throw new Error(`Invalid unmatched "${r}"`);t=`${t.slice(0,x)}(?>${t.slice(x,d)}${p})${t.slice(d+c.length)}`}else t=`${t.slice(0,d-r.length)}(?>${r}${p})${t.slice(d+c.length)}`;b+=4}Lm.lastIndex+=b}else c[0]==="("?e.push(d):c===")"&&(n=e.length?e.pop():null);r=c}return{pattern:t}}const nr=String.raw,Cj=nr`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,Zg=nr`\(\?R=(?<rDepth>[^\)]+)\)|${Cj}`,Wp=nr`\(\?<(?![=!])(?<captureName>[^>]+)>`,CS=nr`${Wp}|(?<unnamed>\()(?!\?)`,so=new RegExp(nr`${Wp}|${Zg}|\(\?|\\?.`,"gsu"),jm="Cannot use multiple overlapping recursions";function Aj(t,e){const{hiddenCaptures:n,mode:a}={hiddenCaptures:[],mode:"plugin",...e};let r=(e==null?void 0:e.captureTransfers)??new Map;if(!new RegExp(Zg,"su").test(t))return{pattern:t,captureTransfers:r,hiddenCaptures:n};if(a==="plugin"&&b0(t,nr`\(\?\(DEFINE\)`,ir.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const i=[],l=b0(t,nr`\\[1-9]`,ir.DEFAULT),c=new Map,d=[];let p=!1,h=0,m=0,b;for(so.lastIndex=0;b=so.exec(t);){const{0:x,groups:{captureName:w,rDepth:S,gRNameOrNum:C,gRDepth:E}}=b;if(x==="[")h++;else if(h)x==="]"&&h--;else if(S){if(gw(S),p)throw new Error(jm);if(l)throw new Error(`${a==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const T=t.slice(0,b.index),L=t.slice(so.lastIndex);if(b0(L,Zg,ir.DEFAULT))throw new Error(jm);const D=+S-1;t=yw(T,L,D,!1,n,i,m),r=vw(r,T,D,i.length,0,m);break}else if(C){gw(E);let T=!1;for(const G of d)if(G.name===C||G.num===+C){if(T=!0,G.hasRecursedWithin)throw new Error(jm);break}if(!T)throw new Error(nr`Recursive \g cannot be used outside the referenced group "${a==="external"?C:nr`\g<${C}&R=${E}>`}"`);const L=c.get(C),D=kj(t,L);if(l&&b0(D,nr`${Wp}|\((?!\?)`,ir.DEFAULT))throw new Error(`${a==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const B=t.slice(L,b.index),H=D.slice(B.length+x.length),K=i.length,U=+E-1,q=yw(B,H,U,!0,n,i,m);r=vw(r,B,U,i.length-K,K,m);const re=t.slice(0,L),_e=t.slice(L+D.length);t=`${re}${q}${_e}`,so.lastIndex+=q.length-x.length-B.length-H.length,d.forEach(G=>G.hasRecursedWithin=!0),p=!0}else if(w)m++,c.set(String(m),so.lastIndex),c.set(w,so.lastIndex),d.push({num:m,name:w});else if(x[0]==="("){const T=x==="(";T&&(m++,c.set(String(m),so.lastIndex)),d.push(T?{num:m}:{})}else x===")"&&d.pop()}return n.push(...i),{pattern:t,captureTransfers:r,hiddenCaptures:n}}function gw(t){const e=`Max depth must be integer between 2 and 100; used ${t}`;if(!/^[1-9]\d*$/.test(t))throw new Error(e);if(t=+t,t<2||t>100)throw new Error(e)}function yw(t,e,n,a,r,i,l){const c=new Set;a&&SS(t+e,Wp,({groups:{captureName:p}})=>{c.add(p)},ir.DEFAULT);const d=[n,a?c:null,r,i,l];return`${t}${bw(`(?:${t}`,"forward",...d)}(?:)${bw(`${e})`,"backward",...d)}${e}`}function bw(t,e,n,a,r,i,l){const d=h=>e==="forward"?h+2:n-h+2-1;let p="";for(let h=0;h<n;h++){const m=d(h);p+=Y1(t,nr`${CS}|\\k<(?<backref>[^>]+)>`,({0:b,groups:{captureName:x,unnamed:w,backref:S}})=>{if(S&&a&&!a.has(S))return b;const C=`_$${m}`;if(w||x){const E=l+i.length+1;return i.push(E),Tj(r,E),w?b:`(?<${x}${C}>`}return nr`\k<${S}${C}>`},ir.DEFAULT)}return p}function Tj(t,e){for(let n=0;n<t.length;n++)t[n]>=e&&t[n]++}function vw(t,e,n,a,r,i){if(t.size&&a){let l=0;SS(e,CS,()=>l++,ir.DEFAULT);const c=i-l+r,d=new Map;return t.forEach((p,h)=>{const m=(a-l*n)/n,b=l*n,x=h>c+l?h+a:h,w=[];for(const S of p)if(S<=c)w.push(S);else if(S>c+l+m)w.push(S+a);else if(S<=c+l)for(let C=0;C<=n;C++)w.push(S+l*C);else for(let C=0;C<=n;C++)w.push(S+b+m*C);d.set(x,w)}),d}return t}var Tn=String.fromCodePoint,rt=String.raw,xr={},Kp=globalThis.RegExp;xr.flagGroups=(()=>{try{new Kp("(?i:)")}catch{return!1}return!0})();xr.unicodeSets=(()=>{try{new Kp("[[]]","v")}catch{return!1}return!0})();xr.bugFlagVLiteralHyphenIsRange=xr.unicodeSets?(()=>{try{new Kp(rt`[\d\-a]`,"v")}catch{return!0}return!1})():!1;xr.bugNestedClassIgnoresNegation=xr.unicodeSets&&new Kp("[[^a]]","v").test("a");function fp(t,{enable:e,disable:n}){return{dotAll:!(n!=null&&n.dotAll)&&!!(e!=null&&e.dotAll||t.dotAll),ignoreCase:!(n!=null&&n.ignoreCase)&&!!(e!=null&&e.ignoreCase||t.ignoreCase)}}function Su(t,e,n){return t.has(e)||t.set(e,n),t.get(e)}function Xg(t,e){return xw[t]>=xw[e]}function Ej(t,e){if(t==null)throw new Error(e??"Value expected");return t}var xw={ES2025:2025,ES2024:2024,ES2018:2018},Nj={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function AS(t={}){if({}.toString.call(t)!=="[object Object]")throw new Error("Unexpected options");if(t.target!==void 0&&!Nj[t.target])throw new Error(`Unexpected target "${t.target}"`);const e={accuracy:"default",avoidSubclass:!1,flags:"",global:!1,hasIndices:!1,lazyCompileLength:1/0,target:"auto",verbose:!1,...t,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...t.rules}};return e.target==="auto"&&(e.target=xr.flagGroups?"ES2025":xr.unicodeSets?"ES2024":"ES2018"),e}var Rj="[ -\r ]",Dj=new Set([Tn(304),Tn(305)]),ms=rt`[\p{L}\p{M}\p{N}\p{Pc}]`;function TS(t){if(Dj.has(t))return[t];const e=new Set,n=t.toLowerCase(),a=n.toUpperCase(),r=Lj.get(n),i=Mj.get(n),l=Oj.get(n);return[...a].length===1&&e.add(a),l&&e.add(l),r&&e.add(r),e.add(n),i&&e.add(i),[...e]}var Z1=new Map(`C Other
|
|
367
|
+
Cc Control cntrl
|
|
368
|
+
Cf Format
|
|
369
|
+
Cn Unassigned
|
|
370
|
+
Co Private_Use
|
|
371
|
+
Cs Surrogate
|
|
372
|
+
L Letter
|
|
373
|
+
LC Cased_Letter
|
|
374
|
+
Ll Lowercase_Letter
|
|
375
|
+
Lm Modifier_Letter
|
|
376
|
+
Lo Other_Letter
|
|
377
|
+
Lt Titlecase_Letter
|
|
378
|
+
Lu Uppercase_Letter
|
|
379
|
+
M Mark Combining_Mark
|
|
380
|
+
Mc Spacing_Mark
|
|
381
|
+
Me Enclosing_Mark
|
|
382
|
+
Mn Nonspacing_Mark
|
|
383
|
+
N Number
|
|
384
|
+
Nd Decimal_Number digit
|
|
385
|
+
Nl Letter_Number
|
|
386
|
+
No Other_Number
|
|
387
|
+
P Punctuation punct
|
|
388
|
+
Pc Connector_Punctuation
|
|
389
|
+
Pd Dash_Punctuation
|
|
390
|
+
Pe Close_Punctuation
|
|
391
|
+
Pf Final_Punctuation
|
|
392
|
+
Pi Initial_Punctuation
|
|
393
|
+
Po Other_Punctuation
|
|
394
|
+
Ps Open_Punctuation
|
|
395
|
+
S Symbol
|
|
396
|
+
Sc Currency_Symbol
|
|
397
|
+
Sk Modifier_Symbol
|
|
398
|
+
Sm Math_Symbol
|
|
399
|
+
So Other_Symbol
|
|
400
|
+
Z Separator
|
|
401
|
+
Zl Line_Separator
|
|
402
|
+
Zp Paragraph_Separator
|
|
403
|
+
Zs Space_Separator
|
|
404
|
+
ASCII
|
|
405
|
+
ASCII_Hex_Digit AHex
|
|
406
|
+
Alphabetic Alpha
|
|
407
|
+
Any
|
|
408
|
+
Assigned
|
|
409
|
+
Bidi_Control Bidi_C
|
|
410
|
+
Bidi_Mirrored Bidi_M
|
|
411
|
+
Case_Ignorable CI
|
|
412
|
+
Cased
|
|
413
|
+
Changes_When_Casefolded CWCF
|
|
414
|
+
Changes_When_Casemapped CWCM
|
|
415
|
+
Changes_When_Lowercased CWL
|
|
416
|
+
Changes_When_NFKC_Casefolded CWKCF
|
|
417
|
+
Changes_When_Titlecased CWT
|
|
418
|
+
Changes_When_Uppercased CWU
|
|
419
|
+
Dash
|
|
420
|
+
Default_Ignorable_Code_Point DI
|
|
421
|
+
Deprecated Dep
|
|
422
|
+
Diacritic Dia
|
|
423
|
+
Emoji
|
|
424
|
+
Emoji_Component EComp
|
|
425
|
+
Emoji_Modifier EMod
|
|
426
|
+
Emoji_Modifier_Base EBase
|
|
427
|
+
Emoji_Presentation EPres
|
|
428
|
+
Extended_Pictographic ExtPict
|
|
429
|
+
Extender Ext
|
|
430
|
+
Grapheme_Base Gr_Base
|
|
431
|
+
Grapheme_Extend Gr_Ext
|
|
432
|
+
Hex_Digit Hex
|
|
433
|
+
IDS_Binary_Operator IDSB
|
|
434
|
+
IDS_Trinary_Operator IDST
|
|
435
|
+
ID_Continue IDC
|
|
436
|
+
ID_Start IDS
|
|
437
|
+
Ideographic Ideo
|
|
438
|
+
Join_Control Join_C
|
|
439
|
+
Logical_Order_Exception LOE
|
|
440
|
+
Lowercase Lower
|
|
441
|
+
Math
|
|
442
|
+
Noncharacter_Code_Point NChar
|
|
443
|
+
Pattern_Syntax Pat_Syn
|
|
444
|
+
Pattern_White_Space Pat_WS
|
|
445
|
+
Quotation_Mark QMark
|
|
446
|
+
Radical
|
|
447
|
+
Regional_Indicator RI
|
|
448
|
+
Sentence_Terminal STerm
|
|
449
|
+
Soft_Dotted SD
|
|
450
|
+
Terminal_Punctuation Term
|
|
451
|
+
Unified_Ideograph UIdeo
|
|
452
|
+
Uppercase Upper
|
|
453
|
+
Variation_Selector VS
|
|
454
|
+
White_Space space
|
|
455
|
+
XID_Continue XIDC
|
|
456
|
+
XID_Start XIDS`.split(/\s/).map(t=>[Vp(t),t])),Mj=new Map([["s",Tn(383)],[Tn(383),"s"]]),Oj=new Map([[Tn(223),Tn(7838)],[Tn(107),Tn(8490)],[Tn(229),Tn(8491)],[Tn(969),Tn(8486)]]),Lj=new Map([fi(453),fi(456),fi(459),fi(498),...Bm(8072,8079),...Bm(8088,8095),...Bm(8104,8111),fi(8124),fi(8140),fi(8188)]),jj=new Map([["alnum",rt`[\p{Alpha}\p{Nd}]`],["alpha",rt`\p{Alpha}`],["ascii",rt`\p{ASCII}`],["blank",rt`[\p{Zs}\t]`],["cntrl",rt`\p{Cc}`],["digit",rt`\p{Nd}`],["graph",rt`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",rt`\p{Lower}`],["print",rt`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",rt`[\p{P}\p{S}]`],["space",rt`\p{space}`],["upper",rt`\p{Upper}`],["word",rt`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",rt`\p{AHex}`]]);function Bj(t,e){const n=[];for(let a=t;a<=e;a++)n.push(a);return n}function fi(t){const e=Tn(t);return[e.toLowerCase(),e]}function Bm(t,e){return Bj(t,e).map(n=>fi(n))}var ES=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function Ij(t,e){const n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...e};NS(t);const a={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:Xg(n.bestEffortTarget,"ES2024"),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:t.flags.digitIsAscii,spaceIsAscii:t.flags.spaceIsAscii,wordIsAscii:t.flags.wordIsAscii};su(t,Pj,a);const r={dotAll:t.flags.dotAll,ignoreCase:t.flags.ignoreCase},i={currentFlags:r,prevFlags:null,globalFlags:r,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:a.subroutineRefMap};su(t,zj,i);const l={groupsByName:i.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:i.reffedNodesByReferencer};return su(t,$j,l),t._originMap=i.groupOriginByCopy,t._strategy=a.strategy,t}var Pj={AbsenceFunction({node:t,parent:e,replaceWith:n}){const{body:a,kind:r}=t;if(r==="repeater"){const i=br();i.body[0].body.push(po({negate:!0,body:a}),gl("Any"));const l=br();l.body[0].body.push(xS("greedy",0,1/0,i)),n(ln(l,e),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:t,parent:e,key:n},{flagDirectivesByAlt:a}){const r=t.body.filter(i=>i.kind==="flags");for(let i=n+1;i<e.body.length;i++){const l=e.body[i];Su(a,l,[]).push(...r)}},exit({node:t},{flagDirectivesByAlt:e}){var n;if((n=e.get(t))!=null&&n.length){const a=DS(e.get(t));if(a){const r=br({flags:a});r.body[0].body=t.body,t.body=[ln(r,t)]}}}},Assertion({node:t,parent:e,key:n,container:a,root:r,remove:i,replaceWith:l},c){const{kind:d,negate:p}=t,{asciiWordBoundaries:h,avoidSubclass:m,supportedGNodes:b,wordIsAscii:x}=c;if(d==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${p?"Y":"y"}"`);if(d==="line_end")l(ln(po({body:[Co({body:[Wg("string_end")]}),Co({body:[qp(10)]})]}),e));else if(d==="line_start")l(ln(gs(rt`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),e));else if(d==="search_start")if(b.has(t))r.flags.sticky=!0,i();else{const w=a[n-1];if(w&&Vj(w))l(ln(po({negate:!0}),e));else{if(m)throw new Error(rt`Uses "\G" in a way that requires a subclass`);l(hi(Wg("string_start"),e)),c.strategy="clip_search"}}else if(!(d==="string_end"||d==="string_start"))if(d==="string_end_newline")l(ln(gs(rt`(?=\n?\z)`),e));else if(d==="word_boundary"){if(!x&&!h){const w=`(?:(?<=${ms})(?!${ms})|(?<!${ms})(?=${ms}))`,S=`(?:(?<=${ms})(?=${ms})|(?<!${ms})(?!${ms}))`;l(ln(gs(p?S:w),e))}}else throw new Error(`Unexpected assertion kind "${d}"`)},Backreference({node:t},{jsGroupNameMap:e}){let{ref:n}=t;typeof n=="string"&&!Pm(n)&&(n=Im(n,e),t.ref=n)},CapturingGroup({node:t},{jsGroupNameMap:e,subroutineRefMap:n}){let{name:a}=t;a&&!Pm(a)&&(a=Im(a,e),t.name=a),n.set(t.number,t),a&&n.set(a,t)},CharacterClassRange({node:t,parent:e,replaceWith:n}){if(e.kind==="intersection"){const a=j0({body:[t]});n(ln(a,e),{traverse:!0})}},CharacterSet({node:t,parent:e,replaceWith:n},{accuracy:a,minTargetEs2024:r,digitIsAscii:i,spaceIsAscii:l,wordIsAscii:c}){const{kind:d,negate:p,value:h}=t;if(i&&(d==="digit"||h==="digit")){n(hi(Yg("digit",{negate:p}),e));return}if(l&&(d==="space"||h==="space")){n(ln(zm(gs(Rj),p),e));return}if(c&&(d==="word"||h==="word")){n(hi(Yg("word",{negate:p}),e));return}if(d==="any")n(hi(gl("Any"),e));else if(d==="digit")n(hi(gl("Nd",{negate:p}),e));else if(d!=="dot")if(d==="text_segment"){if(a==="strict")throw new Error(rt`Use of "\X" requires non-strict accuracy`);const m="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",b=rt`\p{RI}{2}|${m}(?:\u200D${m})*`;n(ln(gs(rt`(?>\r\n|${r?rt`\p{RGI_Emoji}`:b}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),e))}else if(d==="hex")n(hi(gl("AHex",{negate:p}),e));else if(d==="newline")n(ln(gs(p?`[^
|
|
457
|
+
]`:`(?>\r
|
|
458
|
+
?|[
|
|
459
|
+
\v\f
\u2028\u2029])`),e));else if(d==="posix")if(!r&&(h==="graph"||h==="print")){if(a==="strict")throw new Error(`POSIX class "${h}" requires min target ES2024 or non-strict accuracy`);let m={graph:"!-~",print:" -~"}[h];p&&(m=`\0-${Tn(m.codePointAt(0)-1)}${Tn(m.codePointAt(2)+1)}-`),n(ln(gs(`[${m}]`),e))}else n(ln(zm(gs(jj.get(h)),p),e));else if(d==="property")Z1.has(Vp(h))||(t.key="sc");else if(d==="space")n(hi(gl("space",{negate:p}),e));else if(d==="word")n(ln(zm(gs(ms),p),e));else throw new Error(`Unexpected character set kind "${d}"`)},Directive({node:t,parent:e,root:n,remove:a,replaceWith:r,removeAllPrevSiblings:i,removeAllNextSiblings:l}){const{kind:c,flags:d}=t;if(c==="flags")if(!d.enable&&!d.disable)a();else{const p=br({flags:d});p.body[0].body=l(),r(ln(p,e),{traverse:!0})}else if(c==="keep"){const p=n.body[0],m=n.body.length===1&&yS(p,{type:"Group"})&&p.body[0].body.length===1?p.body[0]:n;if(e.parent!==m||m.body.length>1)throw new Error(rt`Uses "\K" in a way that's unsupported`);const b=po({behind:!0});b.body[0].body=i(),r(ln(b,e))}else throw new Error(`Unexpected directive kind "${c}"`)},Flags({node:t,parent:e}){if(t.posixIsAscii)throw new Error('Unsupported flag "P"');if(t.textSegmentMode==="word")throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(n=>delete t[n]),Object.assign(t,{global:!1,hasIndices:!1,multiline:!1,sticky:t.sticky??!1}),e.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:t}){if(!t.flags)return;const{enable:e,disable:n}=t.flags;e!=null&&e.extended&&delete e.extended,n!=null&&n.extended&&delete n.extended,e!=null&&e.dotAll&&(n!=null&&n.dotAll)&&delete e.dotAll,e!=null&&e.ignoreCase&&(n!=null&&n.ignoreCase)&&delete e.ignoreCase,e&&!Object.keys(e).length&&delete t.flags.enable,n&&!Object.keys(n).length&&delete t.flags.disable,!t.flags.enable&&!t.flags.disable&&delete t.flags},LookaroundAssertion({node:t},e){const{kind:n}=t;n==="lookbehind"&&(e.passedLookbehind=!0)},NamedCallout({node:t,parent:e,replaceWith:n}){const{kind:a}=t;if(a==="fail")n(ln(po({negate:!0}),e));else throw new Error(`Unsupported named callout "(*${a.toUpperCase()}"`)},Quantifier({node:t}){if(t.body.type==="Quantifier"){const e=br();e.body[0].body.push(t.body),t.body=ln(e,t)}},Regex:{enter({node:t},{supportedGNodes:e}){const n=[];let a=!1,r=!1;for(const i of t.body)if(i.body.length===1&&i.body[0].kind==="search_start")i.body.pop();else{const l=OS(i.body);l?(a=!0,Array.isArray(l)?n.push(...l):n.push(l)):r=!0}a&&!r&&n.forEach(i=>e.add(i))},exit(t,{accuracy:e,passedLookbehind:n,strategy:a}){if(e==="strict"&&n&&a)throw new Error(rt`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:t},{jsGroupNameMap:e}){let{ref:n}=t;typeof n=="string"&&!Pm(n)&&(n=Im(n,e),t.ref=n)}},zj={Backreference({node:t},{multiplexCapturesToLeftByRef:e,reffedNodesByReferencer:n}){const{orphan:a,ref:r}=t;a||n.set(t,[...e.get(r).map(({node:i})=>i)])},CapturingGroup:{enter({node:t,parent:e,replaceWith:n,skip:a},{groupOriginByCopy:r,groupsByName:i,multiplexCapturesToLeftByRef:l,openRefs:c,reffedNodesByReferencer:d}){const p=r.get(t);if(p&&c.has(t.number)){const m=hi(ww(t.number),e);d.set(m,c.get(t.number)),n(m);return}c.set(t.number,t),l.set(t.number,[]),t.name&&Su(l,t.name,[]);const h=l.get(t.name??t.number);for(let m=0;m<h.length;m++){const b=h[m];if(p===b.node||p&&p===b.origin||t===b.origin){h.splice(m,1);break}}if(l.get(t.number).push({node:t,origin:p}),t.name&&l.get(t.name).push({node:t,origin:p}),t.name){const m=Su(i,t.name,new Map);let b=!1;if(p)b=!0;else for(const x of m.values())if(!x.hasDuplicateNameToRemove){b=!0;break}i.get(t.name).set(t,{node:t,hasDuplicateNameToRemove:b})}},exit({node:t},{openRefs:e}){e.get(t.number)===t&&e.delete(t.number)}},Group:{enter({node:t},e){e.prevFlags=e.currentFlags,t.flags&&(e.currentFlags=fp(e.currentFlags,t.flags))},exit(t,e){e.currentFlags=e.prevFlags}},Subroutine({node:t,parent:e,replaceWith:n},a){const{isRecursive:r,ref:i}=t;if(r){let h=e;for(;(h=h.parent)&&!(h.type==="CapturingGroup"&&(h.name===i||h.number===i)););a.reffedNodesByReferencer.set(t,h);return}const l=a.subroutineRefMap.get(i),c=i===0,d=c?ww(0):RS(l,a.groupOriginByCopy,null);let p=d;if(!c){const h=DS(Uj(l,b=>b.type==="Group"&&!!b.flags)),m=h?fp(a.globalFlags,h):a.globalFlags;Fj(m,a.currentFlags)||(p=br({flags:Gj(m)}),p.body[0].body.push(d))}n(ln(p,e),{traverse:!c})}},$j={Backreference({node:t,parent:e,replaceWith:n},a){if(t.orphan){a.highestOrphanBackref=Math.max(a.highestOrphanBackref,t.ref);return}const i=a.reffedNodesByReferencer.get(t).filter(l=>Hj(l,t));if(!i.length)n(ln(po({negate:!0}),e));else if(i.length>1){const l=br({atomic:!0,body:i.reverse().map(c=>Co({body:[Kg(c.number)]}))});n(ln(l,e))}else t.ref=i[0].number},CapturingGroup({node:t},e){t.number=++e.numCapturesToLeft,t.name&&e.groupsByName.get(t.name).get(t).hasDuplicateNameToRemove&&delete t.name},Regex:{exit({node:t},e){const n=Math.max(e.highestOrphanBackref-e.numCapturesToLeft,0);for(let a=0;a<n;a++){const r=vS();t.body.at(-1).body.push(r)}}},Subroutine({node:t},e){!t.isRecursive||t.ref===0||(t.ref=e.reffedNodesByReferencer.get(t).number)}};function NS(t){su(t,{"*"({node:e,parent:n}){e.parent=n}})}function Fj(t,e){return t.dotAll===e.dotAll&&t.ignoreCase===e.ignoreCase}function Hj(t,e){let n=e;do{if(n.type==="Regex")return!1;if(n.type==="Alternative")continue;if(n===t)return!1;const a=MS(n.parent);for(const r of a){if(r===n)break;if(r===t||LS(r,t))return!0}}while(n=n.parent);throw new Error("Unexpected path")}function RS(t,e,n,a){const r=Array.isArray(t)?[]:{};for(const[i,l]of Object.entries(t))i==="parent"?r.parent=Array.isArray(n)?a:n:l&&typeof l=="object"?r[i]=RS(l,e,r,n):(i==="type"&&l==="CapturingGroup"&&e.set(r,e.get(t)??t),r[i]=l);return r}function ww(t){const e=wS(t);return e.isRecursive=!0,e}function Uj(t,e){const n=[];for(;t=t.parent;)(!e||e(t))&&n.push(t);return n}function Im(t,e){if(e.has(t))return e.get(t);const n=`$${e.size}_${t.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return e.set(t,n),n}function DS(t){const e=["dotAll","ignoreCase"],n={enable:{},disable:{}};return t.forEach(({flags:a})=>{e.forEach(r=>{var i,l;(i=a.enable)!=null&&i[r]&&(delete n.disable[r],n.enable[r]=!0),(l=a.disable)!=null&&l[r]&&(n.disable[r]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function Gj({dotAll:t,ignoreCase:e}){const n={};return(t||e)&&(n.enable={},t&&(n.enable.dotAll=!0),e&&(n.enable.ignoreCase=!0)),(!t||!e)&&(n.disable={},!t&&(n.disable.dotAll=!0),!e&&(n.disable.ignoreCase=!0)),n}function MS(t){if(!t)throw new Error("Node expected");const{body:e}=t;return Array.isArray(e)?e:e?[e]:null}function OS(t){const e=t.find(n=>n.kind==="search_start"||Wj(n,{negate:!1})||!qj(n));if(!e)return null;if(e.kind==="search_start")return e;if(e.type==="LookaroundAssertion")return e.body[0].body[0];if(e.type==="CapturingGroup"||e.type==="Group"){const n=[];for(const a of e.body){const r=OS(a.body);if(!r)return null;Array.isArray(r)?n.push(...r):n.push(r)}return n}return null}function LS(t,e){const n=MS(t)??[];for(const a of n)if(a===e||LS(a,e))return!0;return!1}function qj({type:t}){return t==="Assertion"||t==="Directive"||t==="LookaroundAssertion"}function Vj(t){const e=["Character","CharacterClass","CharacterSet"];return e.includes(t.type)||t.type==="Quantifier"&&t.min&&e.includes(t.body.type)}function Wj(t,e){const n={negate:null,...e};return t.type==="LookaroundAssertion"&&(n.negate===null||t.negate===n.negate)&&t.body.length===1&&yS(t.body[0],{type:"Assertion",kind:"search_start"})}function Pm(t){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(t)}function gs(t,e){const a=bS(t,{...e,unicodePropertyMap:Z1}).body;return a.length>1||a[0].body.length>1?br({body:a}):a[0].body[0]}function zm(t,e){return t.negate=e,t}function hi(t,e){return t.parent=e,t}function ln(t,e){return NS(t),t.parent=e,t}function Kj(t,e){const n=AS(e),a=Xg(n.target,"ES2024"),r=Xg(n.target,"ES2025"),i=n.rules.recursionLimit;if(!Number.isInteger(i)||i<2||i>20)throw new Error("Invalid recursionLimit; use 2-20");let l=null,c=null;if(!r){const x=[t.flags.ignoreCase];su(t,Yj,{getCurrentModI:()=>x.at(-1),popModI(){x.pop()},pushModI(w){x.push(w)},setHasCasedChar(){x.at(-1)?l=!0:c=!0}})}const d={dotAll:t.flags.dotAll,ignoreCase:!!((t.flags.ignoreCase||l)&&!c)};let p=t;const h={accuracy:n.accuracy,appliedGlobalFlags:d,captureMap:new Map,currentFlags:{dotAll:t.flags.dotAll,ignoreCase:t.flags.ignoreCase},inCharClass:!1,lastNode:p,originMap:t._originMap,recursionLimit:i,useAppliedIgnoreCase:!!(!r&&l&&c),useFlagMods:r,useFlagV:a,verbose:n.verbose};function m(x){return h.lastNode=p,p=x,Ej(Zj[x.type],`Unexpected node type "${x.type}"`)(x,h,m)}const b={pattern:t.body.map(m).join("|"),flags:m(t.flags),options:{...t.options}};return a||(delete b.options.force.v,b.options.disable.v=!0,b.options.unicodeSetsPlugin=null),b._captureTransfers=new Map,b._hiddenCaptures=[],h.captureMap.forEach((x,w)=>{x.hidden&&b._hiddenCaptures.push(w),x.transferTo&&Su(b._captureTransfers,x.transferTo,[]).push(w)}),b}var Yj={"*":{enter({node:t},e){if(Sw(t)){const n=e.getCurrentModI();e.pushModI(t.flags?fp({ignoreCase:n},t.flags).ignoreCase:n)}},exit({node:t},e){Sw(t)&&e.popModI()}},Backreference(t,e){e.setHasCasedChar()},Character({node:t},e){X1(Tn(t.value))&&e.setHasCasedChar()},CharacterClassRange({node:t,skip:e},n){e(),jS(t,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:t},e){t.kind==="property"&&ES.has(t.value)&&e.setHasCasedChar()}},Zj={Alternative({body:t},e,n){return t.map(n).join("")},Assertion({kind:t,negate:e}){if(t==="string_end")return"$";if(t==="string_start")return"^";if(t==="word_boundary")return e?rt`\B`:rt`\b`;throw new Error(`Unexpected assertion kind "${t}"`)},Backreference({ref:t},e){if(typeof t!="number")throw new Error("Unexpected named backref in transformed AST");if(!e.useFlagMods&&e.accuracy==="strict"&&e.currentFlags.ignoreCase&&!e.captureMap.get(t).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+t},CapturingGroup(t,e,n){const{body:a,name:r,number:i}=t,l={ignoreCase:e.currentFlags.ignoreCase},c=e.originMap.get(t);return c&&(l.hidden=!0,i>c.number&&(l.transferTo=c.number)),e.captureMap.set(i,l),`(${r?`?<${r}>`:""}${a.map(n).join("|")})`},Character({value:t},e){const n=Tn(t),a=fl(t,{escDigit:e.lastNode.type==="Backreference",inCharClass:e.inCharClass,useFlagV:e.useFlagV});if(a!==n)return a;if(e.useAppliedIgnoreCase&&e.currentFlags.ignoreCase&&X1(n)){const r=TS(n);return e.inCharClass?r.join(""):r.length>1?`[${r.join("")}]`:r[0]}return n},CharacterClass(t,e,n){const{kind:a,negate:r,parent:i}=t;let{body:l}=t;if(a==="intersection"&&!e.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");xr.bugFlagVLiteralHyphenIsRange&&e.useFlagV&&l.some(_w)&&(l=[qp(45),...l.filter(p=>!_w(p))]);const c=()=>`[${r?"^":""}${l.map(n).join(a==="intersection"?"&&":"")}]`;if(!e.inCharClass){if((!e.useFlagV||xr.bugNestedClassIgnoresNegation)&&!r){const h=l.filter(m=>m.type==="CharacterClass"&&m.kind==="union"&&m.negate);if(h.length){const m=br(),b=m.body[0];return m.parent=i,b.parent=m,l=l.filter(x=>!h.includes(x)),t.body=l,l.length?(t.parent=b,b.body.push(t)):m.body.pop(),h.forEach(x=>{const w=Co({body:[x]});x.parent=w,w.parent=m,m.body.push(w)}),n(m)}}e.inCharClass=!0;const p=c();return e.inCharClass=!1,p}const d=l[0];if(a==="union"&&!r&&d&&((!e.useFlagV||!e.verbose)&&i.kind==="union"&&!(xr.bugFlagVLiteralHyphenIsRange&&e.useFlagV)||!e.verbose&&i.kind==="intersection"&&l.length===1&&d.type!=="CharacterClassRange"))return l.map(n).join("");if(!e.useFlagV&&i.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return c()},CharacterClassRange(t,e){const n=t.min.value,a=t.max.value,r={escDigit:!1,inCharClass:!0,useFlagV:e.useFlagV},i=fl(n,r),l=fl(a,r),c=new Set;if(e.useAppliedIgnoreCase&&e.currentFlags.ignoreCase){const d=jS(t);tB(d).forEach(h=>{c.add(Array.isArray(h)?`${fl(h[0],r)}-${fl(h[1],r)}`:fl(h,r))})}return`${i}-${l}${[...c].join("")}`},CharacterSet({kind:t,negate:e,value:n,key:a},r){if(t==="dot")return r.currentFlags.dotAll?r.appliedGlobalFlags.dotAll||r.useFlagMods?".":"[^]":rt`[^\n]`;if(t==="digit")return e?rt`\D`:rt`\d`;if(t==="property"){if(r.useAppliedIgnoreCase&&r.currentFlags.ignoreCase&&ES.has(n))throw new Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${e?rt`\P`:rt`\p`}{${a?`${a}=`:""}${n}}`}if(t==="word")return e?rt`\W`:rt`\w`;throw new Error(`Unexpected character set kind "${t}"`)},Flags(t,e){return(e.appliedGlobalFlags.ignoreCase?"i":"")+(t.dotAll?"s":"")+(t.sticky?"y":"")},Group({atomic:t,body:e,flags:n,parent:a},r,i){const l=r.currentFlags;n&&(r.currentFlags=fp(l,n));const c=e.map(i).join("|"),d=!r.verbose&&e.length===1&&a.type!=="Quantifier"&&!t&&(!r.useFlagMods||!n)?c:`(?${nB(t,n,r.useFlagMods)}${c})`;return r.currentFlags=l,d},LookaroundAssertion({body:t,kind:e,negate:n},a,r){return`(?${`${e==="lookahead"?"":"<"}${n?"!":"="}`}${t.map(r).join("|")})`},Quantifier(t,e,n){return n(t.body)+aB(t)},Subroutine({isRecursive:t,ref:e},n){if(!t)throw new Error("Unexpected non-recursive subroutine in transformed AST");const a=n.recursionLimit;return e===0?`(?R=${a})`:rt`\g<${e}&R=${a}>`}},Xj=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),Qj=new Set(["-","\\","]","^","["]),Jj=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),kw=new Map([[9,rt`\t`],[10,rt`\n`],[11,rt`\v`],[12,rt`\f`],[13,rt`\r`],[8232,rt`\u2028`],[8233,rt`\u2029`],[65279,rt`\uFEFF`]]),eB=new RegExp("^\\p{Cased}$","u");function X1(t){return eB.test(t)}function jS(t,e){const n=!!(e!=null&&e.firstOnly),a=t.min.value,r=t.max.value,i=[];if(a<65&&(r===65535||r>=131071)||a===65536&&r>=131071)return i;for(let l=a;l<=r;l++){const c=Tn(l);if(!X1(c))continue;const d=TS(c).filter(p=>{const h=p.codePointAt(0);return h<a||h>r});if(d.length&&(i.push(...d),n))break}return i}function fl(t,{escDigit:e,inCharClass:n,useFlagV:a}){if(kw.has(t))return kw.get(t);if(t<32||t>126&&t<160||t>262143||e&&rB(t))return t>255?`\\u{${t.toString(16).toUpperCase()}}`:`\\x${t.toString(16).toUpperCase().padStart(2,"0")}`;const r=n?a?Jj:Qj:Xj,i=Tn(t);return(r.has(i)?"\\":"")+i}function tB(t){const e=t.map(r=>r.codePointAt(0)).sort((r,i)=>r-i),n=[];let a=null;for(let r=0;r<e.length;r++)e[r+1]===e[r]+1?a??(a=e[r]):a===null?n.push(e[r]):(n.push([a,e[r]]),a=null);return n}function nB(t,e,n){if(t)return">";let a="";if(e&&n){const{enable:r,disable:i}=e;a=(r!=null&&r.ignoreCase?"i":"")+(r!=null&&r.dotAll?"s":"")+(i?"-":"")+(i!=null&&i.ignoreCase?"i":"")+(i!=null&&i.dotAll?"s":"")}return`${a}:`}function aB({kind:t,max:e,min:n}){let a;return!n&&e===1?a="?":!n&&e===1/0?a="*":n===1&&e===1/0?a="+":n===e?a=`{${n}}`:a=`{${n},${e===1/0?"":e}}`,a+{greedy:"",lazy:"?",possessive:"+"}[t]}function Sw({type:t}){return t==="CapturingGroup"||t==="Group"||t==="LookaroundAssertion"}function rB(t){return t>47&&t<58}function _w({type:t,value:e}){return t==="Character"&&e===45}var gi,vs,yo,yi,bo,Cu,Qg,Si,sB=(Si=class extends RegExp{constructor(n,a,r){var e=(...XF)=>(super(...XF),no(this,Cu),no(this,gi,new Map),no(this,vs,null),no(this,yo),no(this,yi,null),no(this,bo,null),ne(this,"rawOptions",{}),this);const i=!!(r!=null&&r.lazyCompile);if(n instanceof RegExp){if(r)throw new Error("Cannot provide options when copying a regexp");const l=n;e(l,a),gr(this,yo,l.source),l instanceof Si&&(gr(this,gi,ea(l,gi)),gr(this,yi,ea(l,yi)),gr(this,bo,ea(l,bo)),this.rawOptions=l.rawOptions)}else{const l={hiddenCaptures:[],strategy:null,transfers:[],...r};e(i?"":n,a),gr(this,yo,n),gr(this,gi,oB(l.hiddenCaptures,l.transfers)),gr(this,bo,l.strategy),this.rawOptions=r??{}}i||gr(this,vs,this)}get source(){return ea(this,yo)||"(?:)"}exec(n){if(!ea(this,vs)){const{lazyCompile:i,...l}=this.rawOptions;gr(this,vs,new Si(ea(this,yo),this.flags,l))}const a=this.global||this.sticky,r=this.lastIndex;if(ea(this,bo)==="clip_search"&&a&&r){this.lastIndex=0;const i=Xh(this,Cu,Qg).call(this,n.slice(r));return i&&(iB(i,r,n,this.hasIndices),this.lastIndex+=r),i}return Xh(this,Cu,Qg).call(this,n)}},gi=new WeakMap,vs=new WeakMap,yo=new WeakMap,yi=new WeakMap,bo=new WeakMap,Cu=new WeakSet,Qg=function(n){ea(this,vs).lastIndex=this.lastIndex;const a=Lx(Si.prototype,this,"exec").call(ea(this,vs),n);if(this.lastIndex=ea(this,vs).lastIndex,!a||!ea(this,gi).size)return a;const r=[...a];a.length=1;let i;this.hasIndices&&(i=[...a.indices],a.indices.length=1);const l=[0];for(let c=1;c<r.length;c++){const{hidden:d,transferTo:p}=ea(this,gi).get(c)??{};if(d?l.push(null):(l.push(a.length),a.push(r[c]),this.hasIndices&&a.indices.push(i[c])),p&&r[c]!==void 0){const h=l[p];if(!h)throw new Error(`Invalid capture transfer to "${h}"`);if(a[h]=r[c],this.hasIndices&&(a.indices[h]=i[c]),a.groups){ea(this,yi)||gr(this,yi,lB(this.source));const m=ea(this,yi).get(p);m&&(a.groups[m]=r[c],this.hasIndices&&(a.indices.groups[m]=i[c]))}}}return a},Si);function iB(t,e,n,a){if(t.index+=e,t.input=n,a){const r=t.indices;for(let l=0;l<r.length;l++){const c=r[l];c&&(r[l]=[c[0]+e,c[1]+e])}const i=r.groups;i&&Object.keys(i).forEach(l=>{const c=i[l];c&&(i[l]=[c[0]+e,c[1]+e])})}}function oB(t,e){const n=new Map;for(const a of t)n.set(a,{hidden:!0});for(const[a,r]of e)for(const i of r)Su(n,i,{}).transferTo=a;return n}function lB(t){const e=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map;let a=0,r=0,i;for(;i=e.exec(t);){const{0:l,groups:{capture:c,name:d}}=i;l==="["?a++:a?l==="]"&&a--:c&&(r++,d&&n.set(r,d))}return n}function cB(t,e){const n=uB(t,e);return n.options?new sB(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function uB(t,e){const n=AS(e),a=bS(t,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:Z1}),r=Ij(a,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),i=Kj(r,n),l=Aj(i.pattern,{captureTransfers:i._captureTransfers,hiddenCaptures:i._hiddenCaptures,mode:"external"}),c=_j(l.pattern),d=Sj(c.pattern,{captureTransfers:l.captureTransfers,hiddenCaptures:l.hiddenCaptures}),p={pattern:d.pattern,flags:`${n.hasIndices?"d":""}${n.global?"g":""}${i.flags}${i.options.disable.v?"u":"v"}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{const h=d.hiddenCaptures.sort((w,S)=>w-S),m=Array.from(d.captureTransfers),b=r._strategy,x=p.pattern.length>=n.lazyCompileLength;(h.length||m.length||b||x)&&(p.options={...h.length&&{hiddenCaptures:h},...m.length&&{transfers:m},...b&&{strategy:b},...x&&{lazyCompile:x}})}return p}function dB(t,e){return cB(t,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...e})}function BS(t={}){const e={target:"auto",cache:new Map,...t};return e.regexConstructor||(e.regexConstructor=n=>dB(n,{target:e.target})),{createScanner(n){return new TL(n,e)},createString(n){return{content:n}}}}function Q1(){try{const t=sessionStorage.getItem("auth_token")??localStorage.getItem("auth_token");return t?`&token=${encodeURIComponent(t)}`:""}catch{return""}}const pB=/\.(png|jpe?g|webp|gif|bmp|svg)$/i;function J1(t){return/^https?:\/\//i.test(t)}function aF(t){return J1(t)?t:Ru(`/api/generated-images?path=${encodeURIComponent(t)}${Q1()}`)}function fB(t){if(!t||J1(t)||t.startsWith("data:")||t.startsWith("/")||t.startsWith("#")||t.startsWith("artifact:")||t.startsWith("dscfile:"))return null;const e=t.split(/[?#]/)[0]??"";return pB.test(e)?Ru(`/api/files/download?path=${encodeURIComponent(t)}${Q1()}`):null}function rF(t){return!t||J1(t)||t.startsWith("data:")?t:Ru(`/api/images?path=${encodeURIComponent(t)}${Q1()}`)}function IS(t){return`md-h-${t}`}function hB(t){return t.replace(/\s+#+\s*$/,"").replace(/!\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/[*_~`]+/g,"").replace(/\s{2,}/g," ").trim()}const mB=/^(?:[-*+]|\d+[.)])\s|^>/;function gB(t){const e=[],n=(t||"").split(/\r?\n/);let a=null;const r=(i,l)=>{const c=hB(l);c&&e.push({id:IS(e.length),level:i,text:c})};for(let i=0;i<n.length;i++){const l=n[i]??"",c=l.match(/^\s{0,3}(`{3,}|~{3,})/);if(c){const m=(c[1]??"").charAt(0);a===null?a=m:a===m&&(a=null);continue}if(a!==null)continue;const d=l.match(/^\s{0,3}(#{1,6})\s+(.*)$/);if(d){r((d[1]??"").length,d[2]??"");continue}const p=l.trim();if(!p||mB.test(p))continue;const h=n[i+1]??"";/^\s{0,3}=+\s*$/.test(h)?(r(1,p),i++):/^\s{0,3}-{2,}\s*$/.test(h)&&(r(2,p),i++)}return e}function yB({src:t,alt:e,onClose:n}){const[a,r]=N.useState(null),i=N.useRef(null),l=N.useRef(null);N.useEffect(()=>{const m=b=>{b.key==="Escape"&&(b.stopPropagation(),n())};return window.addEventListener("keydown",m,!0),()=>window.removeEventListener("keydown",m,!0)},[n]);const c=N.useCallback(m=>{const b=l.current;if(!b)return;const x=b.getBoundingClientRect();r(w=>w??{x:x.left,y:x.top}),i.current={startX:m.clientX,startY:m.clientY,originX:x.left,originY:x.top},m.currentTarget.setPointerCapture(m.pointerId)},[]),d=N.useCallback(m=>{const b=i.current;b&&r({x:b.originX+(m.clientX-b.startX),y:b.originY+(m.clientY-b.startY)})},[]),p=N.useCallback(()=>{i.current=null},[]),h=a?{left:a.x,top:a.y}:{left:"50%",top:"50%",transform:"translate(-50%, -50%)"};return g.jsxs("div",{className:"fixed inset-0 z-[80]",role:"dialog","aria-label":e||"Image preview",children:[g.jsx("div",{className:"absolute inset-0 bg-black/40",onClick:n,"aria-hidden":"true"}),g.jsxs("div",{ref:l,className:"absolute overflow-hidden rounded-xl border border-dark-border bg-dark-surface shadow-2xl",style:h,"data-testid":"image-lightbox",children:[g.jsxs("div",{className:"flex cursor-move touch-none select-none items-center justify-between border-b border-dark-border bg-dark-bg/80 px-3 py-1.5",onPointerDown:c,onPointerMove:d,onPointerUp:p,onPointerCancel:p,children:[g.jsx("span",{className:"max-w-[24rem] truncate text-[11px] text-dark-muted",children:e||"—"}),g.jsx("button",{onClick:n,className:"rounded p-1 text-dark-muted transition-colors hover:bg-dark-hover hover:text-dark-text","aria-label":"Close preview",children:g.jsx(yn,{size:14})})]}),g.jsx("img",{src:t,alt:e||"",draggable:!1,className:"block max-h-[70vh] max-w-[70vw] object-contain"})]})]})}var PS=Yk();const bB=168,vB=200,xB=170;function wB(t,e={}){const n=e.width??vB,a=e.height??xB;return{x:Math.max(4,Math.min(t.clientX,window.innerWidth-n)),y:Math.max(4,Math.min(t.clientY,window.innerHeight-a))}}const kB=28,SB=9,_B=8;function Jg(t,e=0){return t*kB+e*SB+_B}const zS=N.memo(function({items:e,position:n,onClose:a,ariaLabel:r,minWidth:i=bB}){const l=n!==null;return N.useEffect(()=>{if(!l)return;const c=()=>a(),d=p=>{p.key==="Escape"&&a()};return window.addEventListener("click",c),window.addEventListener("resize",c),window.addEventListener("scroll",c,!0),window.addEventListener("keydown",d),()=>{window.removeEventListener("click",c),window.removeEventListener("resize",c),window.removeEventListener("scroll",c,!0),window.removeEventListener("keydown",d)}},[l,a]),n?PS.createPortal(g.jsx("div",{role:"menu","aria-label":r,className:"fixed z-[9999] rounded-lg border border-dark-border bg-dark-surface py-1 shadow-[0_10px_32px_rgba(0,0,0,0.28)]",style:{left:n.x,top:n.y,minWidth:i},onClick:c=>c.stopPropagation(),onContextMenu:c=>c.preventDefault(),children:e.map(c=>{if(c.kind==="separator")return g.jsx("div",{role:"separator",className:"my-1 h-px bg-dark-border/60"},c.id);const d=c.icon;return g.jsxs("button",{role:"menuitem",disabled:c.disabled,onClick:()=>{a(),c.onSelect()},className:`flex w-full items-center gap-2 rounded-md px-2.5 py-1.5 text-left text-xs transition-colors ${c.disabled?"cursor-not-allowed text-dark-muted/35":"text-dark-muted hover:bg-dark-hover hover:text-dark-text"}`,children:[d?g.jsx(d,{size:13,"aria-hidden":"true",className:"shrink-0 opacity-70"}):null,g.jsx("span",{className:"truncate",children:c.label})]},c.id)})}),document.body):null});function $S(){const[t,e]=N.useState(null),n=N.useCallback((i,l,c,d)=>{e({...wB({clientX:i,clientY:l},d),data:c})},[]),a=N.useCallback((i,l,c)=>{i.preventDefault(),i.stopPropagation(),n(i.clientX,i.clientY,l,c)},[n]),r=N.useCallback(()=>e(null),[]);return{state:t,open:a,openAt:n,close:r}}let _u=null;function sF(t){_u=t}function iF(t){_u===t&&(_u=null)}function CB(t){return _u?(_u(t),!0):!1}function v0(t){return t.success?{ok:!0}:{ok:!1,error:t.error||"unknown error"}}const B0={open:t=>Je.fs.open(t,"open").then(v0),reveal:t=>Je.fs.open(t,"reveal").then(v0),openFolder:t=>Je.fs.openFolder(t).then(v0),download:t=>Je.files.download(t).then(v0)},Cw=208,AB=Jg(6,1);function FS(){const{t}=at(),{state:e,open:n,close:a}=$S(),r=(e==null?void 0:e.data)??null,i=N.useCallback((p,h)=>n(p,h,{width:Cw,height:AB}),[n]),l=N.useCallback((p,h)=>{p.then(m=>{m.ok||ut.error(m.error||h)})},[]),c=N.useMemo(()=>r?[{id:"preview",label:t("fileMenu.preview"),icon:yp,onSelect:()=>hu(r)},{id:"openExternal",label:t("fileMenu.openExternal"),icon:lu,onSelect:()=>l(B0.open(r),t("fileMenu.openFailed"))},{id:"reveal",label:t("fileMenu.reveal"),icon:z0,onSelect:()=>l(B0.reveal(r),t("fileMenu.revealFailed"))},{kind:"separator",id:"sep-after-open"},{id:"addToChat",label:t("fileMenu.addToChat"),icon:D8,onSelect:()=>{CB(r)||ut.warning(t("fileMenu.noComposer"))}},{id:"copyPath",label:t("fileMenu.copyPath"),icon:Au,onSelect:()=>{var p;(p=navigator.clipboard)==null||p.writeText(r).then(()=>ut.success(t("fileMenu.copied")),()=>{})}},{id:"download",label:t("fileMenu.download"),icon:Sl,onSelect:()=>l(B0.download(r),t("fileMenu.downloadFailed"))}]:[],[r,t,l]),d=g.jsx(zS,{items:c,position:e?{x:e.x,y:e.y}:null,onClose:a,ariaLabel:t("fileMenu.aria"),minWidth:Cw});return{openFileMenu:i,menuNode:d}}const TB={js:"JavaScript",ts:"TypeScript",jsx:"JSX",tsx:"TSX",py:"Python",python:"Python",bash:"Bash",shell:"Shell",css:"CSS",json:"JSON",yaml:"YAML",yml:"YAML",sql:"SQL",md:"Markdown",markdown:"Markdown",xml:"XML",html:"HTML"},EB={js:"javascript",ts:"typescript",py:"python",yml:"yaml",shell:"bash",sh:"bash",zsh:"bash",text:"txt",plaintext:"txt",plain:"txt"};function NB(t){return EB[t]??t}let x0=null;function RB(){return x0||(x0=dS({themes:["github-dark"],langs:["javascript","typescript","jsx","tsx","css","json","bash","python","markdown","yaml","sql","html","xml","diff"],engine:BS()}).catch(t=>{throw x0=null,t})),x0}const Wc=new Map,DB=300;function MB(t,e){if(Wc.size>=DB){const n=Wc.keys().next().value;n!==void 0&&Wc.delete(n)}Wc.set(t,e)}function OB({language:t,code:e}){const{t:n}=at(),[a,r]=N.useState(!1),[i,l]=N.useState(null);N.useEffect(()=>{let p=!1;const h=`${t}\0${e}`,m=Wc.get(h);if(m){l(m);return}return RB().then(b=>{const x=NB(t);if(!b.getLoadedLanguages().includes(x))return;const w=b.codeToHtml(e,{lang:x,theme:"github-dark"});MB(h,w),p||l(w)}).catch(()=>{}),()=>{p=!0}},[e,t]);const c=async()=>{try{await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),2e3)}catch(p){console.error("Failed to copy:",p)}},d=TB[t]||t.toUpperCase();return g.jsxs("div",{className:"relative group rounded-lg overflow-hidden border border-dark-border my-2",children:[g.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 bg-dark-surface border-b border-dark-border",children:[g.jsx("span",{className:"text-xs text-dark-muted font-mono",children:d}),g.jsx("button",{onClick:c,className:"flex items-center gap-1 text-xs px-2 py-1 rounded hover:bg-dark-hover transition-colors",children:a?g.jsxs(g.Fragment,{children:[g.jsx(Lk,{size:12,className:"text-accent-green"}),g.jsx("span",{className:"text-accent-green",children:n("common.copied")})]}):g.jsxs(g.Fragment,{children:[g.jsx(Au,{size:12}),g.jsx("span",{children:n("common.copy")})]})})]}),i?g.jsx("div",{className:"codeblock-shiki text-sm [&_pre]:bg-dark-bg [&_pre]:p-3 [&_pre]:overflow-x-auto custom-scrollbar",dangerouslySetInnerHTML:{__html:i}}):g.jsx("pre",{className:"bg-dark-bg p-3 overflow-x-auto custom-scrollbar text-sm",children:g.jsx("code",{children:e})})]})}const Aw=80;function LB({path:t,title:e}){const{t:n}=at(),{openFileMenu:a,menuNode:r}=FS(),i=t.split(/[\\/]/).pop()||t;return g.jsxs(g.Fragment,{children:[g.jsxs("button",{type:"button",className:"inline-flex items-center gap-2 mx-0.5 my-1 rounded-lg border border-dark-border bg-dark-surface px-2.5 py-1.5 text-left align-middle transition-colors hover:border-accent-blue/40 hover:bg-dark-hover",title:t,onClick:()=>hu(t),onContextMenu:l=>a(l,t),children:[g.jsx("span",{className:"grid w-6 h-6 shrink-0 place-items-center rounded-md bg-accent-blue/10 text-accent-blue",children:g.jsx(wo,{size:13})}),g.jsxs("span",{className:"min-w-0 flex flex-col leading-tight",children:[g.jsx("b",{className:"text-xs font-semibold text-dark-text truncate max-w-[14rem]",children:e||i}),e&&e!==i&&g.jsx("span",{className:"text-[10px] font-mono text-dark-muted truncate max-w-[14rem]",children:i})]}),g.jsx("span",{className:"ml-1 shrink-0 text-[11px] font-medium text-accent-blue",children:n("commonUi.openFile")})]}),r]})}function Tw(t){return typeof t=="string"&&t.startsWith("artifact:")}function jB({src:t,alt:e}){const[n,a]=N.useState(!1);return g.jsxs(g.Fragment,{children:[g.jsx("img",{src:t,alt:e,title:e,loading:"lazy",onClick:()=>a(!0),className:"my-1 max-h-80 max-w-full cursor-zoom-in rounded-lg border border-dark-border object-contain"}),n&&g.jsx(yB,{src:t,alt:e||void 0,onClose:()=>a(!1)})]})}function BB(t){const e=t.slice(9);try{return decodeURIComponent(e)}catch{return e}}function Ew(t){return typeof t=="string"&&t.startsWith("dscfile:")}function IB(t){const e=t.slice(8);try{return decodeURIComponent(e)}catch{return e}}function Nw(t){return t.replace(/%/g,"%25")}const HS=/((?:[A-Za-z]:[\\/])?[\w@.()[\]{}$%-]+(?:[\\/][\w@.()[\]{}$%-]+)+)/,PB=new RegExp(`^${HS.source}$`);function Rw(t){if(t.length<3||t.length>400||/^[a-z][a-z0-9+.-]*:\/\//i.test(t)||/^www\./i.test(t)||/^\/\//.test(t))return!1;const e=t.split(/[\\/]/);if(e.length>=2&&e.every(r=>/^\d+$/.test(r)))return!1;const n=(e[e.length-1]||"").replace(/[.,;:!?)\]}]+$/g,"");return n?/^(?:[A-Za-z]:|~|\.{1,2})[\\/]/.test(t)||/\.[A-Za-z0-9]{1,12}$/.test(n):!1}function zB(t){const e=t.match(/^(.*?)([.,;:!?)\]}]+)$/);if(!e)return{path:t,tail:""};const n=e[1]??"",a=e[2]??"";if(a==="."){const r=n.split(/[\\/]/).pop()||"";if(!/\.[A-Za-z0-9]{1,12}$/.test(r))return{path:t,tail:""}}return{path:n,tail:a}}function $B({path:t}){const{openFileMenu:e,menuNode:n}=FS();return g.jsxs(g.Fragment,{children:[g.jsxs("button",{type:"button",onClick:()=>hu(t),onContextMenu:a=>e(a,t),title:t,className:"inline-flex max-w-full items-center gap-1 align-baseline rounded px-1 font-mono text-[0.9em] text-accent-blue underline decoration-accent-blue/40 underline-offset-2 hover:bg-accent-blue/10 hover:decoration-accent-blue transition-colors cursor-pointer",children:[g.jsx(wo,{size:10,className:"shrink-0"}),g.jsx("span",{className:"break-all",children:t})]}),n]})}function FB(){const t=new Set(["code","html","link","linkReference","image","imageReference"]);function e(r){return!PB.test(r)||!Rw(r)?null:{type:"link",url:`dscfile:${Nw(r)}`,title:null,children:[{type:"text",value:r}]}}function n(r){const i=r.split(HS);if(i.length<=1)return[{type:"text",value:r}];const l=[];return i.forEach((c,d)=>{if(d%2===1){const{path:p,tail:h}=zB(c);if(p&&Rw(p)){l.push({type:"link",url:`dscfile:${Nw(p)}`,title:null,children:[{type:"text",value:p}]}),h&&l.push({type:"text",value:h});return}}l.push({type:"text",value:c})}),l}function a(r){if(!r||typeof r!="object"||t.has(r.type))return;const i=r.children;if(!Array.isArray(i))return;const l=[];for(const c of i){const d=c;if(!d||typeof d!="object"){l.push(d);continue}if(d.type==="inlineCode"&&typeof d.value=="string"){l.push(e(d.value)??d);continue}if(d.type==="text"&&typeof d.value=="string"){l.push(...n(d.value));continue}a(d),l.push(d)}r.children=l}return function(i){a(i)}}const HB=[FB,BR],UB=[hD];function GB({content:t,className:e="",headingIds:n=!1}){const[a,r]=N.useState(t),i=N.useRef(0),l=N.useRef(null),c=N.useRef(t),d=N.useRef(null);c.current=t,N.useEffect(()=>{if(t===a)return;const h=Date.now(),m=h-i.current;m>=Aw?(r(t),i.current=h):l.current||(l.current=setTimeout(()=>{l.current=null,r(c.current),i.current=Date.now()},Aw-m))},[t]),N.useEffect(()=>()=>{l.current&&clearTimeout(l.current)},[]),N.useEffect(()=>{if(!n)return;const h=d.current;h&&h.querySelectorAll("h1,h2,h3,h4,h5,h6").forEach((m,b)=>{m.id=IS(b)})},[n,a]);const p=(a||"").replace(/\\n/g,`
|
|
460
|
+
`).replace(/\n{3,}/g,`
|
|
461
|
+
|
|
462
|
+
`);return g.jsx("div",{ref:d,className:`markdown-content ${e}`,style:{wordBreak:"break-word"},children:g.jsx(T8,{remarkPlugins:HB,rehypePlugins:UB,urlTransform:h=>Tw(h)||Ew(h)?h:E8(h),components:{code({className:h,children:m,...b}){const x=/language-(\w+)/.exec(h||""),w=String(m).replace(/\n$/,"");return x&&x[1]?g.jsx(OB,{language:x[1],code:w}):g.jsx("code",{className:"bg-dark-hover px-1.5 py-0.5 rounded text-sm font-mono text-accent-blue",...b,children:m})},a({href:h,children:m}){if(Tw(h)){const b=Array.isArray(m)?m.join(""):String(m??"");return g.jsx(LB,{path:BB(h),title:b})}return Ew(h)?g.jsx($B,{path:IB(h)}):g.jsx("a",{href:h,target:"_blank",rel:"noopener noreferrer",className:"text-accent-blue hover:underline",children:m})},img({src:h,alt:m}){const b=typeof h=="string"?h:"";if(!b)return null;const x=fB(b);return x?g.jsx(jB,{src:x,alt:typeof m=="string"?m:""}):g.jsx("img",{src:b,alt:typeof m=="string"?m:"",className:"my-1 max-h-80 max-w-full rounded-lg border border-dark-border object-contain"})},table({children:h}){return g.jsx("div",{className:"overflow-x-auto custom-scrollbar my-2",children:g.jsx("table",{className:"w-full border-collapse border border-dark-border",children:h})})},th({children:h}){return g.jsx("th",{className:"border border-dark-border px-3 py-2 text-left bg-dark-hover font-medium",children:h})},td({children:h}){return g.jsx("td",{className:"border border-dark-border px-3 py-2",children:h})},p({children:h}){return g.jsx("p",{className:"mb-0.5 leading-snug last:mb-0",children:h})},blockquote({children:h}){return g.jsx("blockquote",{className:"border-l-4 border-accent-blue pl-3 my-1 text-dark-muted italic",children:h})},h1({children:h}){return g.jsx("h1",{className:"text-2xl font-bold mt-3 mb-1 text-dark-text border-b border-dark-border pb-1",children:h})},h2({children:h}){return g.jsx("h2",{className:"text-xl font-semibold mt-3 mb-1 text-dark-text border-b border-dark-border pb-1",children:h})},h3({children:h}){return g.jsx("h3",{className:"text-lg font-semibold mt-2 mb-1 text-dark-text",children:h})}},children:p})})}const qB=24,$m=6;function VB({headings:t,scrollRoot:e,onClose:n}){const{t:a}=at(),[r,i]=N.useState(null),[l,c]=N.useState(!1),[d,p]=N.useState(void 0),h=N.useRef(null),[m,b]=N.useState(null);N.useEffect(()=>{b(e.current)},[e,t]);const x=N.useMemo(()=>t.reduce((E,T)=>Math.min(E,T.level),6),[t]),w=N.useMemo(()=>{const E=t.map((K,U)=>({heading:K,index:U})),T=E.filter(({heading:K})=>K.level===x),L=T.length>0?T:E;if(L.length<=$m)return L;const D=(L.length-1)/($m-1),B=[],H=new Set;for(let K=0;K<$m;K++){const U=L[Math.round(K*D)];U&&!H.has(U.index)&&(H.add(U.index),B.push(U))}return B},[t,x]);N.useEffect(()=>{if(!m)return;let E=0;const T=()=>{var H;E=0;const D=m.getBoundingClientRect().top;let B=((H=t[0])==null?void 0:H.id)??null;for(const K of t){const U=m.querySelector(`#${K.id}`);if(U)if(U.getBoundingClientRect().top-D<=qB)B=K.id;else break}i(B)},L=()=>{E||(E=requestAnimationFrame(T))};return T(),m.addEventListener("scroll",L,{passive:!0}),()=>{m.removeEventListener("scroll",L),E&&cancelAnimationFrame(E)}},[m,t]),N.useEffect(()=>{const E=e.current;if(!E)return;const T=()=>p(Math.max(160,E.clientHeight-16));T();const L=new ResizeObserver(T);return L.observe(E),()=>L.disconnect()},[e,t]),N.useEffect(()=>{if(!l)return;const E=h.current,T=E==null?void 0:E.querySelector('[data-active="1"]');if(!E||!T)return;const L=E.getBoundingClientRect(),D=T.getBoundingClientRect();D.top<L.top?E.scrollTop-=L.top-D.top:D.bottom>L.bottom&&(E.scrollTop+=D.bottom-L.bottom)},[r,l]);const S=N.useMemo(()=>{var L;const E=t.findIndex(D=>D.id===r);if(E<0||w.length===0)return-1;let T=((L=w[0])==null?void 0:L.index)??-1;for(const D of w)D.index<=E&&(T=D.index);return T},[t,r,w]),C=E=>{if(!m)return;const T=m.querySelector(`#${E}`);if(!T)return;const L=T.getBoundingClientRect().top-m.getBoundingClientRect().top;m.scrollTo({top:Math.max(0,m.scrollTop+L-8),behavior:"smooth"}),i(E)};return g.jsxs("div",{className:"absolute right-2 top-2 z-20 flex items-start",onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),onFocus:()=>c(!0),onBlur:E=>{const T=E.relatedTarget;(!T||!E.currentTarget.contains(T))&&c(!1)},children:[g.jsxs("nav",{"aria-label":a("chat.outline"),"aria-hidden":!l,style:{maxHeight:l?d:0},className:Ke("flex flex-col overflow-hidden rounded-lg border bg-dark-surface/90 shadow-lg backdrop-blur-sm transition-all duration-200 ease-out",l?"w-56 border-dark-border opacity-100":"w-0 border-transparent opacity-0"),children:[g.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-1 border-b border-dark-border/60 px-2.5 py-1.5",children:[g.jsx("span",{className:"text-[11px] font-medium text-dark-text",children:a("chat.outline")}),g.jsx("button",{type:"button",onClick:n,className:"grid h-4 w-4 shrink-0 place-items-center rounded text-dark-muted transition-colors hover:bg-dark-hover hover:text-dark-text",title:a("chat.outlineClose"),"aria-label":a("chat.outlineClose"),children:g.jsx(yn,{size:11})})]}),g.jsx("div",{ref:h,className:"min-h-0 flex-1 overflow-y-auto custom-scrollbar px-1 py-1",children:t.map(E=>{const T=E.id===r;return g.jsx("button",{type:"button","data-active":T?"1":"0",title:E.text,onClick:()=>C(E.id),style:{paddingLeft:6+Math.min(E.level-x,3)*10},className:Ke("flex w-full items-start gap-1 rounded px-1.5 py-1 text-left text-[11px] leading-snug transition-colors",T?"bg-accent-blue/10 font-medium text-accent-blue":"text-dark-muted hover:bg-dark-hover hover:text-dark-text"),children:g.jsx("span",{className:"min-w-0 flex-1 line-clamp-2 break-all",children:E.text})},E.id)})})]}),g.jsx("div",{className:"flex w-3 shrink-0 flex-col items-center gap-1 rounded-md border border-dark-border/50 bg-dark-surface/70 py-2 backdrop-blur-sm",children:w.map(({heading:E,index:T})=>{const L=T===S;return g.jsx("button",{type:"button",onClick:()=>C(E.id),title:E.text,"aria-label":E.text,className:"group/dot grid h-2.5 w-3 shrink-0 place-items-center",children:g.jsx("span",{className:Ke("rounded-full transition-all",L?"h-2.5 w-1 bg-accent-blue":"h-1 w-1 bg-dark-muted/60 group-hover/dot:bg-dark-text")})},E.id)})})]})}const WB="dsc:host-ready",KB="dsc:host-context",YB="dsc:plugin-ready",US=N.memo(function({contribution:e,hostContext:n}){const a=N.useRef(null),r=N.useRef(JSON.stringify(n??{})),i=N.useCallback(()=>{const l=a.current,c=l==null?void 0:l.getAttribute("src");if(!(!(l!=null&&l.contentWindow)||!c))try{l.contentWindow.postMessage({__dsc:!0,type:KB,context:n??{}},new URL(c,window.location.origin).origin)}catch{}},[n]);return N.useEffect(()=>{const l=c=>{const d=a.current;if(!d)return;const p=d.getAttribute("src")??"";let h;try{h=new URL(p,window.location.origin).origin}catch{return}if(c.origin!==h)return;const m=c.data;!m||m.__dsc!==!0||m.type===YB&&i()};return window.addEventListener("message",l),()=>window.removeEventListener("message",l)},[i]),N.useEffect(()=>{const l=JSON.stringify(n??{});l!==r.current&&(r.current=l,i())},[n,i]),g.jsx("div",{className:"flex-1 min-h-0 w-full bg-dark-bg","data-plugin-tab":e.pluginId,children:g.jsx("iframe",{ref:a,title:e.title,src:e.url,className:"w-full h-full border-0",sandbox:"allow-scripts allow-same-origin","data-plugin-ready":WB})})}),ZB=Object.freeze(Object.defineProperty({__proto__:null,PluginTabContainer:US},Symbol.toStringTag,{value:"Module"})),Fm=Nn()(Ri(t=>({hidden:{},pinned:{},hide:e=>t(n=>({hidden:{...n.hidden,[e]:!0}})),show:e=>t(n=>{const a={...n.hidden};return delete a[e],{hidden:a}}),togglePin:e=>t(n=>{const a=!n.pinned[e],r={...n.hidden};return a&&delete r[e],{pinned:{...n.pinned,[e]:a},hidden:r}}),reset:()=>t({hidden:{},pinned:{}})}),{name:"deepseekcode-widget-store",storage:y1({key:"widgetStore",trims:[]}),partialize:t=>({hidden:t.hidden,pinned:t.pinned})})),Eo=N.memo(function({id:e,title:n,icon:a,action:r,children:i,defaultOpen:l=!0}){const{t:c}=at(),d=Fm(x=>x.pinned[e]),p=Fm(x=>x.togglePin),h=Fm(x=>x.hide),[m,b]=N.useState(l);return g.jsxs("div",{className:"rounded-lg border border-dark-border bg-dark-surface overflow-hidden",children:[g.jsxs("div",{className:"flex items-center gap-0.5 px-2 py-1.5",children:[g.jsxs("button",{type:"button",onClick:()=>b(x=>!x),className:"flex-1 min-w-0 flex items-center gap-1.5 text-left transition-colors","aria-expanded":m,title:c(m?"widgets.card.collapse":"widgets.card.expand"),children:[g.jsx(_s,{size:11,className:Ke("text-dark-muted shrink-0 transition-transform duration-200",!m&&"-rotate-90")}),a,g.jsx("span",{className:"text-[11px] font-semibold text-dark-text truncate",children:n}),!d&&g.jsx("span",{className:"text-[8px] text-dark-muted/50 border border-dark-border rounded px-1 py-px shrink-0",children:c("widgets.card.auto")})]}),r,g.jsx("button",{type:"button",onClick:()=>p(e),className:Ke("p-1 rounded transition-colors shrink-0",d?"text-accent-blue":"text-dark-muted/40 hover:text-dark-muted hover:bg-dark-hover"),title:c(d?"widgets.card.unpin":"widgets.card.pinKeep"),"aria-label":c(d?"widgets.card.unpin":"widgets.card.pin"),children:d?g.jsx(Xm,{size:11}):g.jsx(M8,{size:11})}),g.jsx("button",{type:"button",onClick:()=>h(e),className:"p-1 rounded text-dark-muted/40 hover:text-dark-muted hover:bg-dark-hover transition-colors shrink-0",title:c("widgets.card.close"),"aria-label":c("widgets.card.close"),children:g.jsx(yn,{size:11})})]}),m&&g.jsx("div",{className:"px-2.5 pb-2.5",children:i})]})}),XB=N.memo(function({sessionId:e}){const{t:n}=at(),a=ot(l=>e?l.getPlanForSession(e):void 0);if(!a||!a.confirm)return null;const r=a.nodes??[],i=l=>{ot.getState().clearPlan(e),De.send({type:"workflow_confirm",sessionId:e,data:JSON.stringify({planId:a.planId,action:l})})};return g.jsx(Eo,{id:"plan-card",title:n("widgets.plan.title"),icon:g.jsx(jk,{size:13,className:"text-accent-purple shrink-0"}),children:g.jsxs("div",{className:"space-y-2",children:[g.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] text-dark-text",children:[g.jsx(Hn,{size:11,className:"animate-spin text-accent-blue shrink-0"}),g.jsx("span",{className:"truncate flex-1",children:a.title||n("widgets.plan.fallbackTitle")}),g.jsx("span",{className:"text-[10px] text-dark-muted tabular-nums shrink-0",children:n("widgets.plan.stepCount",{count:r.length})})]}),r.length>0&&g.jsxs("ol",{className:"space-y-0.5",children:[r.slice(0,8).map((l,c)=>{var d;return g.jsxs("li",{className:"flex items-start gap-1.5 text-[11px] text-dark-muted",children:[g.jsx("span",{className:"w-4 h-4 rounded-full grid place-items-center bg-dark-border/60 text-dark-muted text-[9px] font-semibold shrink-0 mt-0.5",children:c+1}),g.jsxs("span",{className:"min-w-0 flex-1 leading-snug break-words",children:[l.title,(l.role||l.tokenEstimate)&&g.jsxs("span",{className:"text-[10px] text-dark-muted/70",children:[l.role?` · ${l.role}`:"",l.tokenEstimate?` · ~${Math.round(l.tokenEstimate/1e3)}k`:""]}),((d=a.parallelGroups)==null?void 0:d.some(p=>p.includes(l.id)))&&g.jsxs("span",{className:"ml-1 rounded bg-dark-border/50 px-1 text-[9px]",children:["P",a.parallelGroups.findIndex(p=>p.includes(l.id))+1]})]}),l.dependencies&&l.dependencies.length>0&&g.jsx("span",{className:"shrink-0 text-[9px] text-dark-muted/60",children:n("widgets.plan.dependsOn",{count:l.dependencies.length})})]},l.id)}),r.length>8&&g.jsx("li",{className:"text-[10px] text-dark-muted/60 pl-6",children:n("widgets.plan.moreSteps",{count:r.length-8})})]}),g.jsxs("div",{className:"flex items-center gap-1.5 pt-1 border-t border-dark-border/60",children:[g.jsxs("button",{type:"button",onClick:()=>i("start"),className:"flex-1 flex items-center justify-center gap-1 px-2 py-1 rounded border border-accent-blue/40 bg-accent-blue/10 text-[10px] text-accent-blue hover:bg-accent-blue/20 transition-colors",children:[g.jsx(bp,{size:10})," ",n("widgets.plan.start")]}),g.jsxs("button",{type:"button",onClick:()=>i("change"),className:"flex-1 flex items-center justify-center gap-1 px-2 py-1 rounded border border-dark-border text-[10px] text-dark-text hover:bg-dark-hover transition-colors",title:n("widgets.plan.changeHint"),children:[g.jsx(vp,{size:10})," ",n("widgets.plan.change")]}),a.runtimeAvailable&&g.jsxs("button",{type:"button",onClick:()=>i("runtime"),className:"flex items-center justify-center gap-1 px-2 py-1 rounded border border-accent-purple/40 bg-accent-purple/10 text-[10px] text-accent-purple hover:bg-accent-purple/20 transition-colors",title:n("widgets.plan.runtimeHint"),children:[g.jsx(O8,{size:10})," ",n("widgets.plan.runtime")]}),g.jsxs("button",{type:"button",onClick:()=>i("cancel"),className:"flex items-center justify-center gap-1 px-2 py-1 rounded border border-dark-border text-[10px] text-dark-text hover:bg-dark-hover transition-colors",title:n("widgets.plan.cancelTitle"),children:[g.jsx(yn,{size:10})," ",n("widgets.plan.cancel")]})]})]})})}),QB=N.memo(function({sessionId:e}){const{t:n}=at(),a=ot(d=>e?d.getDwfOfferForSession(e):void 0),[r,i]=N.useState(!1);if(!a||a.resolved)return null;const l=d=>{ot.getState().clearDwfOffer(e,a.offerId),De.send({type:"dwf_confirm",sessionId:e,data:JSON.stringify({offerId:a.offerId,action:d})})},c=Array.isArray(a.phases)?a.phases:[];return g.jsx(Eo,{id:"dwf-offer",title:a.fileName||"Dynamic workflow",icon:g.jsx(u1,{size:13,className:"text-accent-purple shrink-0"}),children:g.jsxs("div",{className:"space-y-2",children:[g.jsxs("div",{className:"flex items-start gap-1.5",children:[g.jsx("span",{className:"text-[11px] font-medium text-dark-text leading-snug break-words flex-1",children:a.title||n("widgets.dwf.offerFallbackTitle")}),typeof a.agentCount=="number"&&a.agentCount>0&&g.jsxs("span",{className:"text-[10px] text-dark-muted tabular-nums shrink-0",children:[a.agentCount," agents"]})]}),a.description&&g.jsx("p",{className:"text-[11px] text-dark-muted leading-snug break-words",children:a.description}),c.length>0&&g.jsxs("ol",{className:"space-y-0.5",children:[c.slice(0,6).map((d,p)=>g.jsxs("li",{className:"flex items-start gap-1.5 text-[11px] text-dark-muted",children:[g.jsx("span",{className:"w-4 h-4 rounded-full grid place-items-center bg-dark-border/60 text-dark-muted text-[9px] font-semibold shrink-0 mt-0.5",children:p+1}),g.jsx("span",{className:"min-w-0 flex-1 leading-snug break-words",children:d.title||d.detail||`Phase ${p+1}`})]},p)),c.length>6&&g.jsxs("li",{className:"text-[10px] text-dark-muted/60 pl-6",children:["+",c.length-6," more"]})]}),a.tokenWarning&&g.jsxs("div",{className:"flex items-start gap-1.5 px-2 py-1.5 rounded bg-accent-yellow/10 border border-accent-yellow/30 text-[10px] text-accent-yellow leading-snug",children:[g.jsx(xp,{size:11,className:"shrink-0 mt-0.5"}),g.jsx("span",{children:a.tokenWarning})]}),r&&a.scriptPreview&&g.jsx("pre",{className:"max-h-48 overflow-y-auto rounded bg-dark-bg/80 border border-dark-border p-2 text-[10px] text-dark-text leading-relaxed whitespace-pre-wrap break-words custom-scrollbar",children:a.scriptPreview}),g.jsxs("div",{className:"flex items-center gap-1.5 pt-1 border-t border-dark-border/60",children:[g.jsxs("button",{type:"button",onClick:()=>l("run"),className:"flex-1 flex items-center justify-center gap-1 px-2 py-1 rounded border border-accent-blue/40 bg-accent-blue/10 text-[10px] text-accent-blue hover:bg-accent-blue/20 transition-colors",children:[g.jsx(bp,{size:10})," Run"]}),g.jsxs("button",{type:"button",onClick:()=>{if(!a.scriptPreview){l("view");return}i(d=>!d)},className:"flex items-center justify-center gap-1 px-2 py-1 rounded border border-dark-border text-[10px] text-dark-text hover:bg-dark-hover transition-colors",title:a.scriptPreview?"Toggle script preview":"View (no preview available)",children:[r?g.jsx(Hn,{size:10,className:"rotate-45"}):g.jsx(yp,{size:10})," ",r?"Hide":"View"]}),g.jsxs("button",{type:"button",onClick:()=>l("no"),className:"flex items-center justify-center gap-1 px-2 py-1 rounded border border-dark-border text-[10px] text-dark-text hover:bg-dark-hover transition-colors",title:"Dismiss — the generated file stays in the workspace",children:[g.jsx(yn,{size:10})," No"]})]}),a.filePath&&g.jsxs("div",{className:"flex items-center gap-1 text-[9px] text-dark-muted/70 truncate",children:[g.jsx(L8,{size:9,className:"shrink-0"}),g.jsx("span",{className:"truncate",children:a.filePath})]})]})})});function JB(t){return t>=1e4?`${Math.round(t/1e3)}k`:t.toLocaleString()}const eI=N.memo(function({sessionId:e}){const{t:n}=at(),a=ot(m=>e?m.getDwfPromotableForSession(e):void 0),[r,i]=N.useState(!1),[l,c]=N.useState(!1);if(!a||a.resolved)return null;const d=()=>{ot.getState().clearDwfPromotable(e,a.workflowId)},p=()=>{i(!0),ot.getState().clearDwfPromotable(e,a.workflowId),De.send({type:"dwf_promote",sessionId:e,data:JSON.stringify({workflowId:a.workflowId})}),c(!0),i(!1),window.setTimeout(()=>c(!1),2500)},h=typeof a.successRate=="number"?Math.round(a.successRate*100):void 0;return g.jsx(Eo,{id:"dwf-promotable",title:a.name||a.workflowId||"Dynamic workflow",icon:g.jsx(B8,{size:13,className:"text-accent-green shrink-0"}),children:g.jsxs("div",{className:"space-y-2",children:[g.jsx("div",{className:"flex items-start gap-1.5",children:g.jsx("span",{className:"text-[11px] font-medium text-dark-text leading-snug break-words flex-1",children:n("widgets.dwf.promotableSentence",{n:typeof a.runs=="number"?a.runs:"3+"})})}),(typeof a.runs=="number"||h!==void 0||typeof a.avgTokens=="number"&&a.avgTokens>0)&&g.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-dark-muted",children:[typeof a.runs=="number"&&g.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-dark-border/60 tabular-nums",children:[a.runs," runs"]}),h!==void 0&&g.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-accent-green/10 text-accent-green tabular-nums",children:[h,"% success"]}),typeof a.avgTokens=="number"&&a.avgTokens>0&&g.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-dark-border/60 tabular-nums",children:["~",JB(a.avgTokens)," tokens avg"]})]}),g.jsxs("div",{className:"flex items-center gap-1.5 pt-1 border-t border-dark-border/60",children:[g.jsxs("button",{type:"button",onClick:p,disabled:r||l,className:"flex-1 flex items-center justify-center gap-1 px-2 py-1 rounded border border-accent-green/40 bg-accent-green/10 text-[10px] text-accent-green hover:bg-accent-green/20 transition-colors disabled:opacity-60",children:[l?g.jsx(d1,{size:10}):r?g.jsx(Hn,{size:10,className:"animate-spin"}):g.jsx(j8,{size:10}),l?"Saved":"Save as template"]}),g.jsxs("button",{type:"button",onClick:d,className:"flex items-center justify-center gap-1 px-2 py-1 rounded border border-dark-border text-[10px] text-dark-text hover:bg-dark-hover transition-colors",title:"Dismiss — 不再提示该 workflow",children:[g.jsx(yn,{size:10})," No"]})]})]})})});function e1(t,e=Date.now(),n){const a=typeof t=="number"?t:new Date(t).getTime();if(!Number.isFinite(a))return"";const r=e-a;if(r<6e4)return n?n("time.justNow"):"刚刚";const i=Math.floor(r/6e4);if(i<60)return n?n("time.minutesAgo",{count:i}):`${i}分钟前`;const l=Math.floor(i/60);if(l<24)return n?n("time.hoursAgo",{count:l}):`${l}小时前`;const c=Math.floor(l/24);if(c<7)return n?n("time.daysAgo",{count:c}):`${c}天前`;const d=new Date(a);return`${d.getFullYear()}-${String(d.getMonth()+1).padStart(2,"0")}-${String(d.getDate()).padStart(2,"0")}`}function ey(t){if(t==null||!Number.isFinite(t))return"—";if(t<=0)return"";if(t<1e3)return`${Math.round(t)}ms`;const e=Math.round(t/100);if(e<600)return`${(e/10).toFixed(1)}s`;const n=Math.round(t/1e3);if(n<3600)return`${Math.floor(n/60)}m${n%60}s`;const a=Math.round(t/6e4);return`${Math.floor(a/60)}h${a%60}m`}const tI=["RUNNING","RESUMING"];function nI(t){switch(t){case"running":return g.jsx(Hn,{size:12,className:"animate-spin text-accent-blue shrink-0"});case"completed":return g.jsx(Eu,{size:12,className:"text-accent-green shrink-0"});case"failed":return g.jsx(Tu,{size:12,className:"text-accent-red shrink-0"});case"skipped":return g.jsx(zk,{size:12,className:"text-dark-muted shrink-0"});case"blocked":return g.jsx(wp,{size:12,className:"text-dark-muted shrink-0"});default:return g.jsx(p1,{size:12,className:"text-dark-muted/70 shrink-0"})}}function aI(t,e){switch(t){case"running":return e("widgets.workflow.statusRunning");case"completed":return e("widgets.workflow.statusCompleted");case"failed":return e("widgets.workflow.statusFailed");case"skipped":return e("widgets.workflow.statusSkipped");case"blocked":return e("widgets.workflow.statusBlocked");default:return e("widgets.workflow.statusPending")}}function t1(t){return!t||t<0?"":ey(t)}function rI(t,e){if(!t)return"";const n=(e??Date.now())-t;return n<0?"":ey(n)}function sI(t){return t<=0?"":t<6e4?`${Math.max(1,Math.ceil(t/1e3))}s`:t<36e5?`${Math.ceil(t/6e4)}m`:`${Math.floor(t/36e5)}h${Math.ceil(t%36e5/6e4)}m`}function iI(t,e){if(!e||t.length===0)return;const n=t.filter(l=>l.status==="completed"||l.status==="skipped").length,a=e-n;if(a<=0)return;const r=t.filter(l=>l.status==="completed"&&typeof l.durationMs=="number"&&l.durationMs>0).map(l=>l.durationMs);if(r.length===0)return;const i=r.reduce((l,c)=>l+c,0)/r.length;return Math.round(i*a)}function oI(t,e,n){const a=t.filter(p=>p.status==="failed"),r=t.reduce((p,h)=>p+(h.attempts!=null&&h.attempts>1?1:0),0),i=t.filter(p=>typeof p.durationMs=="number"&&p.durationMs>0),l=i.length>=2?i.reduce((p,h)=>h.durationMs>p.durationMs?h:p):void 0,c=[];a.length>0&&c.push(n("widgets.workflow.recapFailedNodes",{n:a.length,names:a.map(p=>p.title).join(" / ").slice(0,18)})),r>0&&c.push(n("widgets.workflow.recapRetried",{n:r})),l&&c.push(n("widgets.workflow.recapSlowest",{name:l.title.slice(0,10),duration:t1(l.durationMs)}));const d=a.length===0&&e==="COMPLETED"?n("widgets.workflow.recapAllDone"):"";if(d&&c.length===0){const p=i.reduce((h,m)=>h+(m.durationMs||0),0);return p>0?`${d} · ${n("widgets.workflow.recapTotalDuration",{duration:t1(p)})}`:d}return[d,c.join(" · ")].filter(Boolean).join(" · ")||(e==="FAILED"?n("widgets.workflow.recapAllFailed"):"")}function Dw(t,e=80){const n=t.split(`
|
|
463
|
+
`).map(a=>a.trim()).find(Boolean)??"";return n.length>e?`${n.slice(0,e-1)}…`:n}const Mw={running:0,failed:1,pending:2,ready:2,blocked:2,skipped:3,completed:3};function lI(t){if(t.length===0)return[];const e=new Map;for(const i of t)e.set(i.id,i);const n=new Map;for(const i of t)i.parentId&&e.has(i.parentId)&&i.parentId!==i.id&&n.set(i.id,i.parentId);if(n.size<t.length)for(const i of t){if(n.has(i.id))continue;const l=(i.children||[]).filter(c=>c!==i.id&&e.has(c));for(const c of l)n.has(c)||n.set(c,i.id)}const a=new Map;for(const i of t){const l=n.get(i.id);if(!l)continue;const c=a.get(l)??[];c.push(i),a.set(l,c)}const r=(i,l)=>{const c=e.get(i);if(!c||l.has(i))return null;const d=(a.get(i)??[]).map(p=>r(p.id,new Set(l).add(i))).filter(p=>p!==null).sort((p,h)=>(Mw[p.node.status]??9)-(Mw[h.node.status]??9));return{node:c,children:d}};return t.filter(i=>!n.has(i.id)).map(i=>r(i.id,new Set)).filter(i=>i!==null)}const cI=N.memo(function({sessionId:e}){const{t:n}=at(),a=ot(H=>e?H.getForSession(e):void 0),r=a==null?void 0:a.nodes;if(!r||r.length===0)return null;const i=r.length,l=r.filter(H=>H.status==="completed"||H.status==="skipped"||H.status==="failed").length,c=r.filter(H=>H.status==="running").length,d=r.filter(H=>H.status==="failed").length,p=Math.round(l/i*100),h=tI.includes(String(a==null?void 0:a.status)),m=iI(r,i),b=String((a==null?void 0:a.status)??""),x=["COMPLETED","FAILED","CANCELLED","CANCELED"].includes(b),w=r.reduce((H,K)=>H+(K.attempts!=null&&K.attempts>1?1:0),0),S=!h&&(b==="COMPLETED"||b==="FAILED"||b==="CANCELLED")?oI(r,b,n):"",E=["FAILED","COMPLETED","PAUSED"].includes(String(a==null?void 0:a.status))&&d>0&&!!(a!=null&&a.runId),T=rI(a==null?void 0:a.startedAt,a==null?void 0:a.finishedAt),L={};for(const H of r)L[H.id]=H.title;const D=lI(r),B=(H,K)=>{const U=a.runId;K==="recover"?De.send({type:"workflow_recover",sessionId:e,runId:U}):H&&De.send({type:K==="retry_node"?"workflow_retry_node":"workflow_skip_node",sessionId:e,runId:U,nodeId:H})};return g.jsx(Eo,{id:"workflow-strip",title:(a==null?void 0:a.title)||n("widgets.workflow.fallbackTitle"),icon:g.jsx(jk,{size:13,className:"text-accent-blue shrink-0"}),action:g.jsxs("span",{className:"text-[10px] text-dark-muted tabular-nums shrink-0 px-1",children:[l,"/",i,T?` · ${T}`:""]}),children:g.jsxs("div",{className:"space-y-2",children:[h?g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("div",{className:"flex-1 h-1.5 bg-dark-surface rounded-full overflow-hidden",children:g.jsx("div",{className:Ke("h-full rounded-full transition-all duration-500",d>0?"bg-accent-red":c>0?"bg-accent-blue":"bg-accent-green"),style:{width:`${p}%`}})}),g.jsxs("span",{className:"text-[10px] text-dark-muted tabular-nums shrink-0",children:[p,"%"]}),m!=null&&g.jsxs("span",{className:"text-[9px] text-accent-blue/80 tabular-nums shrink-0",children:["ETA ",sI(m)]})]}):x&&g.jsx(hI,{status:b,failedCount:d,retriedCount:w,recapText:S,elapsed:T,t:n}),g.jsx(uI,{roots:D,canRecover:E,titleById:L,onRetry:H=>B(H.id,"retry_node"),onSkip:H=>B(H.id,"skip_node")}),(h||(a==null?void 0:a.status)==="PAUSED")&&g.jsx("div",{className:"flex items-center gap-1.5 pt-1 border-t border-dark-border/60",children:g.jsx(fI,{sessionId:e,runId:a.runId,status:String(a==null?void 0:a.status)})}),E&&!h&&(a==null?void 0:a.status)!=="PAUSED"&&g.jsxs("div",{className:"flex items-center gap-1.5 pt-1 border-t border-dark-border/60",children:[g.jsxs("button",{type:"button",onClick:()=>B(void 0,"recover"),className:"flex items-center gap-1 px-2 py-0.5 rounded border border-accent-blue/40 bg-accent-blue/5 text-[10px] text-accent-blue hover:bg-accent-blue/10 transition-colors",children:[g.jsx(Bk,{size:10}),n("widgets.workflow.recoverFromCheckpoint")]}),g.jsx("span",{className:"text-[9px] text-dark-muted/60",children:n("widgets.workflow.recoverHint",{n:d})})]})]})})});function uI({roots:t,canRecover:e,titleById:n,onRetry:a,onSkip:r}){return t.length===0?null:g.jsx("ul",{className:"space-y-0.5",children:t.map(i=>g.jsx(pI,{item:i,canRecover:e,titleById:n,onRetry:a,onSkip:r},i.node.id))})}function dI(t,e=10){switch(t){case"parallel":return g.jsx("span",{className:"text-accent-blue/80 font-bold shrink-0",style:{fontSize:e},children:"⧉"});case"phase":return g.jsx("span",{className:"text-accent-purple/80 font-bold shrink-0",style:{fontSize:e},children:"▣"});case"checkpoint":return g.jsx("span",{className:"text-accent-yellow/80 shrink-0",style:{fontSize:e},children:"◈"});case"loop":return g.jsx("span",{className:"text-dark-muted shrink-0",style:{fontSize:e},children:"↻"});case"condition":return g.jsx("span",{className:"text-dark-muted shrink-0",style:{fontSize:e},children:"◇"});case"pipeline":return g.jsx("span",{className:"text-dark-muted shrink-0",style:{fontSize:e},children:"▸"});case"agent":return g.jsx("span",{className:"text-accent-blue/80 shrink-0",style:{fontSize:e},children:"◉"});default:return g.jsx("span",{className:"text-dark-muted/50 shrink-0",style:{fontSize:e},children:"•"})}}const pI=N.memo(function t({item:e,canRecover:n,titleById:a,onRetry:r,onSkip:i}){var C;const{node:l,children:c}=e,{t:d}=at(),p=t1(l.durationMs),h=l.status==="pending"||l.status==="ready"||l.status==="blocked",m=h&&((C=l.dependencies)!=null&&C.length)?l.dependencies[0]:void 0,b=m!=null?a[m]??m:"",x=l.error?Dw(l.error):"",w=l.status==="completed"&&l.result?Dw(l.result):"",S=l.status==="failed"&&n;return g.jsxs("li",{className:"min-w-0",children:[g.jsxs("div",{className:"flex items-start gap-1.5 py-0.5",children:[g.jsx("span",{className:"mt-0.5 shrink-0",children:dI(l.type)}),g.jsx("span",{className:"mt-0.5 shrink-0",children:nI(l.status)}),g.jsxs("span",{className:"min-w-0 flex-1 leading-snug",children:[g.jsxs("span",{className:"flex items-start gap-1.5",children:[g.jsx("span",{className:Ke("min-w-0 flex-1 text-[11px] leading-snug break-words",l.status==="completed"&&"text-dark-muted/70",l.status==="failed"&&"text-accent-red/90",l.status==="running"&&"text-dark-text font-medium",h&&"text-dark-muted"),title:`${l.title} · ${aI(l.status,d)}`,children:l.title}),g.jsxs("span",{className:"ml-auto flex shrink-0 items-center gap-1 text-[9px] text-dark-muted/70 tabular-nums",children:[l.attempts?g.jsxs("span",{title:d("widgets.workflow.retryCount",{n:l.attempts}),children:["↻",l.attempts]}):null,p?g.jsx("span",{children:p}):null]})]}),x&&g.jsxs("div",{className:"text-[9.5px] leading-snug text-accent-red/80 break-words",title:l.error,children:["✗ ",x]}),!x&&b&&g.jsxs("div",{className:"text-[9.5px] leading-snug text-dark-muted/60 break-words",children:["← ",d("widgets.workflow.waitingFor",{name:b})]}),!x&&w&&g.jsxs("div",{className:"text-[9.5px] leading-snug text-accent-green/70 break-words",children:["→ ",w]})]})]}),S&&g.jsxs("div",{className:"flex items-center gap-1 pl-[38px] pb-1",children:[g.jsxs("button",{type:"button",onClick:()=>r(l),className:"flex items-center gap-0.5 px-1.5 py-px rounded border border-dark-border text-[9px] text-accent-blue hover:bg-dark-hover transition-colors",title:d("widgets.workflow.retryNode"),children:[g.jsx(Ik,{size:8,className:"text-accent-blue"}),d("widgets.workflow.retryNode")]}),g.jsxs("button",{type:"button",onClick:()=>i(l),className:"flex items-center gap-0.5 px-1.5 py-px rounded border border-dark-border text-[9px] text-dark-muted hover:bg-dark-hover transition-colors",title:d("widgets.workflow.skipNode"),children:[g.jsx(I8,{size:8}),d("widgets.workflow.skipNode")]})]}),c.length>0&&g.jsx("ul",{className:"ml-[11px] space-y-0.5 border-l border-dark-border/40 pl-2",children:c.map(E=>g.jsx(t,{item:E,canRecover:n,titleById:a,onRetry:r,onSkip:i},E.node.id))})]})});function fI({sessionId:t,runId:e,status:n}){const{t:a}=at(),r=n==="PAUSED";return g.jsxs(g.Fragment,{children:[g.jsxs("button",{type:"button",onClick:()=>De.send(r?{type:"workflow_resume",sessionId:t,runId:e}:{type:"workflow_pause",sessionId:t,runId:e}),className:"flex items-center gap-1 px-2 py-0.5 rounded border border-dark-border text-[10px] text-dark-text hover:bg-dark-hover transition-colors",children:[r?g.jsx(bp,{size:10,className:"text-accent-green"}):g.jsx(wp,{size:10,className:"text-accent-blue"}),a(r?"widgets.workflow.resume":"widgets.workflow.pause")]}),g.jsxs("button",{type:"button",onClick:()=>De.send({type:"workflow_cancel",sessionId:t,runId:e}),className:"flex items-center gap-1 px-2 py-0.5 rounded border border-dark-border text-[10px] text-dark-text hover:bg-dark-hover transition-colors",children:[g.jsx(Pk,{size:9,className:"text-accent-red"}),a("widgets.workflow.cancel")]})]})}function hI({status:t,failedCount:e,retriedCount:n,recapText:a,elapsed:r,t:i}){const l=e>0,c=t==="CANCELLED"||t==="CANCELED",d=l?"border-accent-red/30 bg-accent-red/[0.06]":c?"border-dark-border bg-dark-surface":"border-accent-green/30 bg-accent-green/[0.06]",p=l?"text-accent-red":c?"text-dark-muted":"text-accent-green",h=l?"bg-accent-red":c?"bg-dark-muted":"bg-accent-green",m=l?"widgets.workflow.resultFailed":c?"widgets.workflow.resultCancelled":"widgets.workflow.resultSucceeded",b=l?Tu:c?zk:Eu;return g.jsxs("div",{className:Ke("rounded-md border px-2 py-1.5 space-y-1",d),children:[g.jsxs("div",{className:"flex items-center gap-1.5",children:[g.jsx("span",{className:Ke("w-0.5 self-stretch rounded-full",h),"aria-hidden":"true"}),g.jsx(b,{size:14,className:Ke("shrink-0",p)}),g.jsx("span",{className:Ke("text-[12px] font-semibold leading-none",p),children:i(m)}),g.jsxs("span",{className:"ml-auto flex shrink-0 items-center gap-1.5 text-[9px] text-dark-muted/80 tabular-nums",children:[n>0&&g.jsxs("span",{title:i("widgets.workflow.retriedCount",{n}),children:[g.jsx(Ik,{size:8,className:"inline text-dark-muted/70 mr-0.5"}),n]}),r&&g.jsx("span",{children:r})]})]}),a&&g.jsx("p",{className:"pl-[18px] text-[9px] leading-snug text-dark-muted/80 break-words",children:i("widgets.workflow.recapLine",{text:a})})]})}function mI({sessionId:t}){const e=N.useRef(new Set);return N.useEffect(()=>{if(!t||ot.getState().getForSession(t)||e.current.has(t))return;e.current.add(t);let a=!1;return(async()=>{var r,i,l;try{const c=await Je.workflows.list();if(a||!c.success)return;const p=(c.data??[]).filter(D=>D.sessionId===t).sort((D,B)=>String(B.updatedAt||"").localeCompare(String(D.updatedAt||""))).find(D=>["COMPLETED","FAILED","CANCELLED","CANCELED"].includes(String(D.status).toUpperCase()));if(!p)return;const h=String(p.runId||"");if(((r=ot.getState().getForSession(t))==null?void 0:r.runId)===h)return;const m=await Je.workflows.events(h);if(a||!m.success)return;const b=m.data??[],x=b.find(D=>D.type==="workflow_started"),w=(i=x==null?void 0:x.data)==null?void 0:i.nodes;if(!Array.isArray(w)||w.length===0)return;const S=new Map,C=[];for(const D of w){const B=String(D.id||"");B&&(C.push(B),S.set(B,{id:B,title:String(D.title||D.name||B),status:"pending",dependencies:Array.isArray(D.dependencies)?D.dependencies.map(String):void 0}))}const E=D=>{const B=D.data;if(B&&typeof B=="object")return B;if(typeof B=="string")try{return JSON.parse(B)}catch{return{}}return{}};for(const D of b){const B=String(D.nodeId||E(D).nodeId||"");if(!B||!S.has(B))continue;const H=S.get(B),K=E(D),U=String(K.status||D.type||"").toLowerCase();if(D.type==="workflow_node_start")H.status="running";else if(D.type==="workflow_node_complete"){H.status=U==="failed"||U==="error"?"failed":"completed";const q=Number(K.durationMs??D.durationMs);Number.isFinite(q)&&q>0&&(H.durationMs=q);const re=typeof K.result=="string"?K.result:void 0;re&&(H.result=re);const _e=typeof K.error=="string"?K.error:void 0;_e&&(H.error=_e);const G=Number(K.attempts);Number.isFinite(G)&&G>1&&(H.attempts=G)}else if(D.type==="workflow_node_retry"){const q=Number(K.attempt);Number.isFinite(q)&&q>1&&(H.attempts=q),H.status="pending"}}const T=C.map(D=>S.get(D)),L=String(p.status).toUpperCase();for(const D of T)(D.status==="pending"||D.status==="running")&&(D.status="skipped");ot.getState().upsert(t,{runId:h,status:L,title:((l=x==null?void 0:x.data)==null?void 0:l.title)||`workflow: ${h.slice(0,18)}`,completedPhases:T.filter(D=>D.status==="completed"||D.status==="skipped"||D.status==="failed").length,totalPhases:T.length,completedEffects:0,totalEffects:0,tokensUsed:Number(p.tokensUsed||0),tokensRemaining:Number(p.tokensRemaining||0),finishedAt:Date.now(),updatedAt:Date.now()}),ot.getState().setNodes(t,h,T)}catch{}})(),()=>{a=!0}},[t]),null}const gI=N.memo(function({sessionId:e}){const{t:n}=at();return ot(r=>e?r.getTasksForSession(e).length:0)===0?null:g.jsx(Eo,{id:"task-board",title:n("widgets.taskBoard.title"),icon:g.jsx($k,{size:13,className:"text-accent-blue shrink-0"}),children:g.jsx(xP,{sessionId:e})})}),yI=N.memo(function({messages:e,onPreview:n}){const{t:a}=at(),r=N.useMemo(()=>n6(e),[e]);return r.length===0?null:g.jsx(Eo,{id:"artifacts",title:`${a("chat.sidebarArtifacts")} (${r.length})`,icon:g.jsx(P8,{size:13,className:"text-accent-blue shrink-0"}),action:g.jsx("button",{type:"button",onClick:()=>{const i=r[0];i&&n(i.path)},className:"p-1 rounded text-dark-muted hover:bg-dark-hover hover:text-dark-text transition-colors shrink-0",title:a("chat.sidebarOpenFolder"),"aria-label":a("chat.sidebarOpenFolder"),children:g.jsx(z0,{size:12})}),children:g.jsx("div",{className:"space-y-0.5",children:r.map(i=>{const l=n1(i.path);return g.jsxs("button",{type:"button",onClick:()=>n(i.path),className:"w-full flex items-center gap-2 px-1.5 py-1.5 rounded-lg text-left transition-colors group hover:bg-dark-hover",title:i.path,children:[g.jsx("span",{className:Ke("w-1.5 h-6 rounded-full shrink-0",i.source==="filejob"?"bg-accent-green":"bg-accent-blue")}),g.jsx(JS,{kind:l,size:15}),g.jsxs("span",{className:"flex-1 min-w-0",children:[g.jsx("span",{className:"block text-xs text-dark-text truncate",children:i.name}),g.jsx("span",{className:"block text-[10px] font-mono text-dark-muted truncate",children:i.path})]}),g.jsx("span",{className:"shrink-0 text-[10.5px] font-medium text-dark-muted opacity-0 group-hover:opacity-100 transition-opacity",children:a("chat.sidebarOpen")})]},i.path)})})})}),w0=new Set;let Fc=null,GS=0;function bI(t){return w0.add(t),Fc||(Fc=setInterval(()=>{GS++,w0.forEach(e=>e())},1e3)),()=>{w0.delete(t),w0.size===0&&Fc&&(clearInterval(Fc),Fc=null)}}function Ow(){return GS}function vI(){return N.useSyncExternalStore(bI,Ow,Ow)}const xI=["Orchestrator","Explorer","Architect","Coder","Tester","Reviewer","Debug","Documenter","Evaluator"],wI=4,kI=12;function SI(t){return t==="running"||t==="scheduled"?g.jsx(Hn,{size:11,className:"animate-spin text-accent-blue shrink-0"}):t==="paused"?g.jsx(wp,{size:11,className:"text-amber-400 shrink-0"}):t==="completed"?g.jsx(Eu,{size:11,className:"text-accent-green shrink-0"}):t==="failed"?g.jsx(Tu,{size:11,className:"text-accent-red shrink-0"}):g.jsx(p1,{size:11,className:"text-dark-muted shrink-0"})}const _I=(t,e)=>e(t==="running"||t==="scheduled"?"widgets.agentFlow.statusRunning":t==="paused"?"widgets.agentFlow.statusPaused":t==="completed"?"widgets.agentFlow.statusCompleted":t==="failed"?"widgets.agentFlow.statusFailed":"widgets.agentFlow.statusIdle"),Lw=t=>t.toLowerCase();function CI(t){const e=Math.max(0,Math.floor(t/1e3));return`${String(Math.floor(e/60)).padStart(2,"0")}:${String(e%60).padStart(2,"0")}`}const qS=t=>t==="running"||t==="scheduled"||t==="paused",AI=N.memo(function({agent:e}){vI();const n=qS(e.status),a=e.elapsedMs===void 0?void 0:n&&e.elapsedAt?e.elapsedMs+Math.max(0,Date.now()-e.elapsedAt):e.elapsedMs,r=[e.round!==void 0?e.maxRounds?`Turn ${e.round}/${e.maxRounds}`:`Turn ${e.round}`:"",e.currentTool?`⚙ ${e.currentTool}`:"",a!==void 0?CI(a):""].filter(Boolean);return r.length===0?null:g.jsx("span",{className:"shrink-0 font-mono text-[9px] text-accent-blue/80",children:r.join(" · ")})});function TI({agent:t,busy:e}){if(!(t.status==="running"||t.status==="scheduled"||t.status==="paused"))return null;const a=async(r,i)=>{try{await r()}catch(l){const c=l instanceof Error?l.message:String(l);ut.error(`${i}失败: ${c.slice(0,120)}`,5e3)}};return g.jsxs("span",{className:"hidden group-hover/agent-row:flex items-center gap-0.5 shrink-0",children:[t.status==="paused"?g.jsx("button",{type:"button",title:"恢复运行",disabled:e,onClick:r=>{r.stopPropagation(),a(()=>Je.agentRuns.resume(t.id),"恢复")},className:"p-0.5 rounded hover:bg-dark-border text-accent-green disabled:opacity-40",children:g.jsx(bp,{size:10})}):g.jsx("button",{type:"button",title:"暂停(当前轮完成后挂起)",disabled:e,onClick:r=>{r.stopPropagation(),a(()=>Je.agentRuns.pause(t.id),"暂停")},className:"p-0.5 rounded hover:bg-dark-border text-amber-400 disabled:opacity-40",children:g.jsx(wp,{size:10})}),g.jsx("button",{type:"button",title:"终止并返回部分结果",disabled:e,onClick:r=>{r.stopPropagation(),a(()=>Je.agentRuns.stop(t.id),"终止")},className:"p-0.5 rounded hover:bg-dark-border text-accent-red disabled:opacity-40",children:g.jsx(Pk,{size:10})})]})}const EI=N.memo(function({sessionId:e}){const{t:n}=at(),a=ot(b=>e?b.agentsBySession[e]:void 0),r=ot(b=>e?b.eventsBySession[e]:void 0),i=N.useMemo(()=>r?r.filter(b=>b.source==="agent"||b.source==="plan").slice(0,30):[],[r]),[l,c]=N.useState(!1),[d,p]=N.useState(null),h=N.useMemo(()=>{if(!a)return[];const b=ot.getState().getAgentTree(e),x=(T,L,D)=>{for(const B of T)D.push({agent:B.agent,depth:L}),x(B.children,L+1,D);return D},w=new Map(b.map(T=>[Lw(T.agent.name),T])),S=xI.map(T=>w.get(Lw(T))).filter(Boolean),C=new Set(S.map(T=>T.agent.id)),E=b.filter(T=>!C.has(T.agent.id)).sort((T,L)=>L.agent.updatedAt-T.agent.updatedAt);return x([...S,...E],0,[])},[e,a]),m=h.filter(b=>b.agent.status==="running"||b.agent.status==="scheduled"||b.agent.status==="paused").length;return h.length===0?null:g.jsx(Eo,{id:"agent-flow",title:"Agent",icon:g.jsx($8,{size:13,className:"text-accent-purple shrink-0"}),action:m>0?g.jsx("span",{className:"w-1.5 h-1.5 bg-accent-blue rounded-full animate-pulse shrink-0"}):void 0,children:g.jsxs("div",{className:"space-y-1",children:[h.slice(0,8).map(({agent:b,depth:x})=>g.jsxs("div",{className:"group/agent-row flex items-center gap-1.5 py-0.5",style:{paddingLeft:Math.min(x,wI)*kI},onClick:()=>p(w=>w===b.id?null:b.id),children:[x>0&&g.jsx(z8,{size:10,className:"text-dark-muted/50 shrink-0"}),SI(b.status),g.jsxs("span",{className:Ke("min-w-0 flex-1 text-[11px] leading-snug break-words",b.status==="running"||b.status==="scheduled"?"text-dark-text":"text-dark-muted"),children:[b.name,b.currentTask&&qS(b.status)&&g.jsxs("span",{className:"text-dark-muted/70",children:[" · ",b.currentTask]})]}),g.jsx(AI,{agent:b}),g.jsx("span",{className:"text-[8px] text-dark-muted/50 shrink-0",children:_I(b.status,n)}),g.jsx(TI,{agent:b,busy:d===b.id})]},b.id)),h.length>8&&g.jsx("div",{className:"text-[10px] text-dark-muted text-center pt-0.5",children:n("widgets.agentFlow.moreAgents",{count:h.length-8})}),i.length>0&&g.jsxs(g.Fragment,{children:[g.jsxs("button",{type:"button",onClick:()=>c(b=>!b),className:"w-full flex items-center gap-1 pt-1 text-[10px] text-dark-muted hover:text-dark-text transition-colors",children:[g.jsx(_s,{size:10,className:Ke("transition-transform",l&&"rotate-180")}),n("widgets.agentFlow.eventLog",{count:i.length})]}),l&&g.jsx("div",{className:"space-y-1 pt-1 max-h-32 overflow-y-auto custom-scrollbar",children:i.map(b=>g.jsxs("div",{className:"px-1.5 py-1 rounded border border-dark-border bg-dark-surface text-[9px] text-dark-muted",children:[g.jsx("span",{className:"font-medium text-dark-text",children:b.title||b.type}),b.message&&g.jsx("span",{className:"block text-dark-muted/80 truncate",children:b.message})]},b.id))})]})]})})});function NI({sessionId:t}){const[e,n]=N.useState([]);return N.useEffect(()=>{let a=!1;return Y.get("/api/plugins/ui").then(r=>{var i;a||n((((i=r==null?void 0:r.data)==null?void 0:i.ui)??[]).filter(l=>l.mount==="inline"))}).catch(()=>{}),()=>{a=!0}},[]),e.length===0?null:g.jsx(g.Fragment,{children:e.map(a=>g.jsx("div",{className:"rounded-xl border border-dark-border bg-dark-surface overflow-hidden",style:{height:220},"data-plugin-inline":a.pluginId,children:g.jsx(US,{contribution:a,hostContext:{sessionId:t,wsUrl:w1()}})},a.id))})}const RI=N.memo(function({sessionId:e,messages:n,onPreview:a}){return g.jsx("div",{className:"flex-1 overflow-y-auto min-h-0 custom-scrollbar",children:g.jsxs("div",{className:"p-2 space-y-2",children:[g.jsx(mI,{sessionId:e}),g.jsx(XB,{sessionId:e}),g.jsx(QB,{sessionId:e}),g.jsx(eI,{sessionId:e}),g.jsx(cI,{sessionId:e}),g.jsx(EI,{sessionId:e}),g.jsx(gI,{sessionId:e}),g.jsx(yI,{messages:n,onPreview:a}),g.jsx(NI,{sessionId:e})]})})}),DI=3,MI=250;function OI(t,e={}){const{maxRetries:n=DI,retryBaseDelayMs:a=MI,label:r="lazyWithRetry"}=e;return()=>{let i=Math.max(0,n);const l=()=>t().catch(c=>{if(i<=0)throw c;const d=n-i+1;i-=1;const p=a*2**(d-1);return console.warn(`[${r}] dynamic import failed (retry ${d}/${n}) — retrying in ${p}ms. Error: ${c instanceof Error?c.message:String(c)}`),new Promise(h=>setTimeout(h,p)).then(l)});return l()}}function ka(t,e={}){return N.lazy(OI(t,e))}var LI=N8();const jw=Ok(LI);Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]};Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity;Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup;Prism.hooks.add("wrap",function(t){t.type==="entity"&&(t.attributes.title=t.content.replace(/&/,"&"))});Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(e,n){var a={};a["language-"+n]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[n]},a.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:a}};r["language-"+n]={pattern:/[\s\S]+/,inside:Prism.languages[n]};var i={};i[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:r},Prism.languages.insertBefore("markup","cdata",i)}});Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(t,e){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[e,"language-"+e],inside:Prism.languages[e]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}});Prism.languages.html=Prism.languages.markup;Prism.languages.mathml=Prism.languages.markup;Prism.languages.svg=Prism.languages.markup;Prism.languages.xml=Prism.languages.extend("markup",{});Prism.languages.ssml=Prism.languages.xml;Prism.languages.atom=Prism.languages.xml;Prism.languages.rss=Prism.languages.xml;Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/});Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}});Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}});Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript"));Prism.languages.js=Prism.languages.javascript;var Bw={},Iw;function jI(){return Iw||(Iw=1,(function(t){t.languages.typescript=t.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),t.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete t.languages.typescript.parameter,delete t.languages.typescript["literal-property"];var e=t.languages.extend("typescript",{});delete e["class-name"],t.languages.typescript["class-name"].inside=e,t.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e}}}}),t.languages.ts=t.languages.typescript})(Prism)),Bw}jI();(function(t){var e=t.util.clone(t.languages.javascript),n=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,a=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,r=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function i(d,p){return d=d.replace(/<S>/g,function(){return n}).replace(/<BRACES>/g,function(){return a}).replace(/<SPREAD>/g,function(){return r}),RegExp(d,p)}r=i(r).source,t.languages.jsx=t.languages.extend("markup",e),t.languages.jsx.tag.pattern=i(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),t.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,t.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,t.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,t.languages.jsx.tag.inside.comment=e.comment,t.languages.insertBefore("inside","attr-name",{spread:{pattern:i(/<SPREAD>/.source),inside:t.languages.jsx}},t.languages.jsx.tag),t.languages.insertBefore("inside","special-attr",{script:{pattern:i(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:t.languages.jsx}}},t.languages.jsx.tag);var l=function(d){return d?typeof d=="string"?d:typeof d.content=="string"?d.content:d.content.map(l).join(""):""},c=function(d){for(var p=[],h=0;h<d.length;h++){var m=d[h],b=!1;if(typeof m!="string"&&(m.type==="tag"&&m.content[0]&&m.content[0].type==="tag"?m.content[0].content[0].content==="</"?p.length>0&&p[p.length-1].tagName===l(m.content[0].content[1])&&p.pop():m.content[m.content.length-1].content==="/>"||p.push({tagName:l(m.content[0].content[1]),openedBraces:0}):p.length>0&&m.type==="punctuation"&&m.content==="{"?p[p.length-1].openedBraces++:p.length>0&&p[p.length-1].openedBraces>0&&m.type==="punctuation"&&m.content==="}"?p[p.length-1].openedBraces--:b=!0),(b||typeof m=="string")&&p.length>0&&p[p.length-1].openedBraces===0){var x=l(m);h<d.length-1&&(typeof d[h+1]=="string"||d[h+1].type==="plain-text")&&(x+=l(d[h+1]),d.splice(h+1,1)),h>0&&(typeof d[h-1]=="string"||d[h-1].type==="plain-text")&&(x=l(d[h-1])+x,d.splice(h-1,1),h--),d[h]=new t.Token("plain-text",x,null,x)}m.content&&typeof m.content!="string"&&c(m.content)}};t.hooks.add("after-tokenize",function(d){d.language!=="jsx"&&d.language!=="tsx"||c(d.tokens)})})(Prism);(function(t){var e=t.util.clone(t.languages.typescript);t.languages.tsx=t.languages.extend("jsx",e),delete t.languages.tsx.parameter,delete t.languages.tsx["literal-property"];var n=t.languages.tsx.tag;n.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+n.pattern.source+")",n.pattern.flags),n.lookbehind=!0})(Prism);(function(t){var e=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+e.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+e.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+e.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+e.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:e,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css;var n=t.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))})(Prism);Prism.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}};Prism.languages.webmanifest=Prism.languages.json;(function(t){var e="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},a={bash:n,environment:{pattern:RegExp("\\$"+e),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+e),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};t.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+e),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:a},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:a},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:a.entity}}],environment:{pattern:RegExp("\\$?"+e),alias:"constant"},variable:a.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=t.languages.bash;for(var r=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],i=a.variable[1].inside,l=0;l<r.length;l++)i[r[l]]=t.languages.bash[r[l]];t.languages.sh=t.languages.bash,t.languages.shell=t.languages.bash})(Prism);var Pw={},zw;function BI(){return zw||(zw=1,Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python),Pw}BI();(function(t){var e=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(h){return h=h.replace(/<inner>/g,function(){return e}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+h+")")}var a=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,r=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return a}),i=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;t.languages.markdown=t.languages.extend("markup",{}),t.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:t.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+r+i+"(?:"+r+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+r+i+")(?:"+r+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(a),inside:t.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+r+")"+i+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+r+"$"),inside:{"table-header":{pattern:RegExp(a),alias:"important",inside:t.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(h){["url","bold","italic","strike","code-snippet"].forEach(function(m){h!==m&&(t.languages.markdown[h].inside.content.inside[m]=t.languages.markdown[m])})}),t.hooks.add("after-tokenize",function(h){if(h.language!=="markdown"&&h.language!=="md")return;function m(b){if(!(!b||typeof b=="string"))for(var x=0,w=b.length;x<w;x++){var S=b[x];if(S.type!=="code"){m(S.content);continue}var C=S.content[1],E=S.content[3];if(C&&E&&C.type==="code-language"&&E.type==="code-block"&&typeof C.content=="string"){var T=C.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");T=(/[a-z][\w-]*/i.exec(T)||[""])[0].toLowerCase();var L="language-"+T;E.alias?typeof E.alias=="string"?E.alias=[E.alias,L]:E.alias.push(L):E.alias=[L]}}}m(h.tokens)}),t.hooks.add("wrap",function(h){if(h.type==="code-block"){for(var m="",b=0,x=h.classes.length;b<x;b++){var w=h.classes[b],S=/language-(.+)/.exec(w);if(S){m=S[1];break}}var C=t.languages[m];if(C)h.content=t.highlight(p(h.content),C,m);else if(m&&m!=="none"&&t.plugins.autoloader){var E="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*1e16);h.attributes.id=E,t.plugins.autoloader.loadLanguages(m,function(){var T=document.getElementById(E);T&&(T.innerHTML=t.highlight(T.textContent,t.languages[m],m))})}}});var l=RegExp(t.languages.markup.tag.pattern.source,"gi"),c={amp:"&",lt:"<",gt:">",quot:'"'},d=String.fromCodePoint||String.fromCharCode;function p(h){var m=h.replace(l,"");return m=m.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(b,x){if(x=x.toLowerCase(),x[0]==="#"){var w;return x[1]==="x"?w=parseInt(x.slice(2),16):w=Number(x.slice(1)),d(w)}else{var S=c[x];return S||b}}),m}t.languages.md=t.languages.markdown})(Prism);(function(t){var e=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,a="(?:"+n.source+"(?:[ ]+"+e.source+")?|"+e.source+"(?:[ ]+"+n.source+")?)",r=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),i=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function l(c,d){d=(d||"").replace(/m/g,"")+"m";var p=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return a}).replace(/<<value>>/g,function(){return c});return RegExp(p,d)}t.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return a})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return a}).replace(/<<key>>/g,function(){return"(?:"+r+"|"+i+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:l(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:l(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:l(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:l(i),lookbehind:!0,greedy:!0},number:{pattern:l(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:n,important:e,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},t.languages.yml=t.languages.yaml})(Prism);Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/};Prism.languages.go=Prism.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/});Prism.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}});delete Prism.languages.go["class-name"];var $w={},Fw;function II(){return Fw||(Fw=1,(function(t){for(var e=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)e=e.replace(/<self>/g,function(){return e});e=e.replace(/<self>/g,function(){return/[^\s\S]/.source}),t.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+e),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},t.languages.rust["closure-params"].inside.rest=t.languages.rust,t.languages.rust.attribute.inside.string=t.languages.rust.string})(Prism)),$w}II();var Hw={},Uw;function PI(){return Uw||(Uw=1,(function(t){var e=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,a={pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};t.languages.java=t.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[a,{pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:a.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+n+/[A-Z]\w*\b/.source),lookbehind:!0,inside:a.inside}],keyword:e,function:[t.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),t.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),t.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":a,keyword:e,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+n+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:a.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+n+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:a.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return e.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(Prism)),Hw}PI();Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/});Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}});Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}});Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/});delete Prism.languages.c.boolean;var Gw={},qw;function zI(){return qw||(qw=1,(function(t){var e=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return e.source});t.languages.cpp=t.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return e.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:e,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),t.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return n})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),t.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t.languages.cpp}}}}),t.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),t.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:t.languages.extend("cpp",{})}}),t.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},t.languages.cpp["base-clause"])})(Prism)),Gw}zI();(function(t){function e(n,a){return"___"+n.toUpperCase()+a+"___"}Object.defineProperties(t.languages["markup-templating"]={},{buildPlaceholders:{value:function(n,a,r,i){if(n.language===a){var l=n.tokenStack=[];n.code=n.code.replace(r,function(c){if(typeof i=="function"&&!i(c))return c;for(var d=l.length,p;n.code.indexOf(p=e(a,d))!==-1;)++d;return l[d]=c,p}),n.grammar=t.languages.markup}}},tokenizePlaceholders:{value:function(n,a){if(n.language!==a||!n.tokenStack)return;n.grammar=t.languages[a];var r=0,i=Object.keys(n.tokenStack);function l(c){for(var d=0;d<c.length&&!(r>=i.length);d++){var p=c[d];if(typeof p=="string"||p.content&&typeof p.content=="string"){var h=i[r],m=n.tokenStack[h],b=typeof p=="string"?p:p.content,x=e(a,h),w=b.indexOf(x);if(w>-1){++r;var S=b.substring(0,w),C=new t.Token(a,t.tokenize(m,n.grammar),"language-"+a,m),E=b.substring(w+x.length),T=[];S&&T.push.apply(T,l([S])),T.push(C),E&&T.push.apply(T,l([E])),typeof p=="string"?c.splice.apply(c,[d,1].concat(T)):p.content=T}}else p.content&&l(p.content)}return c}l(n.tokens)}}})})(Prism);var Vw={},Ww;function $I(){return Ww||(Ww=1,(function(t){var e=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,n=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],a=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,r=/<?=>|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,i=/[{}\[\](),:;]/;t.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:e,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:n,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:a,operator:r,punctuation:i};var l={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:t.languages.php},c=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:l}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:l}}];t.languages.insertBefore("php","variable",{string:c,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:e,string:c,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:n,number:a,operator:r,punctuation:i}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),t.hooks.add("before-tokenize",function(d){if(/<\?/.test(d.code)){var p=/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;t.languages["markup-templating"].buildPlaceholders(d,"php",p)}}),t.hooks.add("after-tokenize",function(d){t.languages["markup-templating"].tokenizePlaceholders(d,"php")})})(Prism)),Vw}$I();var Kw={},Yw;function FI(){return Yw||(Yw=1,(function(t){t.languages.ruby=t.languages.extend("clike",{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===|<?=>|[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),t.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var e={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:t.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete t.languages.ruby.function;var n="(?:"+[/([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,/\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,/<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source].join("|")+")",a=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;t.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+n+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:e,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:e,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+a),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+a+/(?=:(?!:))/.source),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),t.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+n),greedy:!0,inside:{interpolation:e,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:e,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:e,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(/%x/.source+n),greedy:!0,inside:{interpolation:e,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:e,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete t.languages.ruby.string,t.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),t.languages.rb=t.languages.ruby})(Prism)),Kw}FI();class HI{diff(e,n,a={}){let r;typeof a=="function"?(r=a,a={}):"callback"in a&&(r=a.callback);const i=this.castInput(e,a),l=this.castInput(n,a),c=this.removeEmpty(this.tokenize(i,a)),d=this.removeEmpty(this.tokenize(l,a));return this.diffWithOptionsObj(c,d,a,r)}diffWithOptionsObj(e,n,a,r){var i;const l=T=>{if(T=this.postProcess(T,a),r){setTimeout(function(){r(T)},0);return}else return T},c=n.length,d=e.length;let p=1,h=c+d;a.maxEditLength!=null&&(h=Math.min(h,a.maxEditLength));const m=(i=a.timeout)!==null&&i!==void 0?i:1/0,b=Date.now()+m,x=[{oldPos:-1,lastComponent:void 0}];let w=this.extractCommon(x[0],n,e,0,a);if(x[0].oldPos+1>=d&&w+1>=c)return l(this.buildValues(x[0].lastComponent,n,e));let S=-1/0,C=1/0;const E=()=>{for(let T=Math.max(S,-p);T<=Math.min(C,p);T+=2){let L;const D=x[T-1],B=x[T+1];D&&(x[T-1]=void 0);let H=!1;if(B){const U=B.oldPos-T;H=B&&0<=U&&U<c}const K=D&&D.oldPos+1<d;if(!H&&!K){x[T]=void 0;continue}if(!K||H&&D.oldPos<B.oldPos?L=this.addToPath(B,!0,!1,0,a):L=this.addToPath(D,!1,!0,1,a),w=this.extractCommon(L,n,e,T,a),L.oldPos+1>=d&&w+1>=c)return l(this.buildValues(L.lastComponent,n,e))||!0;x[T]=L,L.oldPos+1>=d&&(C=Math.min(C,T-1)),w+1>=c&&(S=Math.max(S,T+1))}p++};if(r)(function T(){setTimeout(function(){if(p>h||Date.now()>b)return r(void 0);E()||T()},0)})();else for(;p<=h&&Date.now()<=b;){const T=E();if(T)return T}}addToPath(e,n,a,r,i){const l=e.lastComponent;return l&&!i.oneChangePerToken&&l.added===n&&l.removed===a?{oldPos:e.oldPos+r,lastComponent:{count:l.count+1,added:n,removed:a,previousComponent:l.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:n,removed:a,previousComponent:l}}}extractCommon(e,n,a,r,i){const l=n.length,c=a.length;let d=e.oldPos,p=d-r,h=0;for(;p+1<l&&d+1<c&&this.equals(a[d+1],n[p+1],i);)p++,d++,h++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return h&&!i.oneChangePerToken&&(e.lastComponent={count:h,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=d,p}equals(e,n,a){return a.comparator?a.comparator(e,n):e===n||!!a.ignoreCase&&e.toLowerCase()===n.toLowerCase()}removeEmpty(e){const n=[];for(let a=0;a<e.length;a++)e[a]&&n.push(e[a]);return n}castInput(e,n){return e}tokenize(e,n){return Array.from(e)}join(e){return e.join("")}postProcess(e,n){return e}get useLongestToken(){return!1}buildValues(e,n,a){const r=[];let i;for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();const l=r.length;let c=0,d=0,p=0;for(;c<l;c++){const h=r[c];if(h.removed)h.value=this.join(a.slice(p,p+h.count)),p+=h.count;else{if(!h.added&&this.useLongestToken){let m=n.slice(d,d+h.count);m=m.map(function(b,x){const w=a[p+x];return w.length>b.length?w:b}),h.value=this.join(m)}else h.value=this.join(n.slice(d,d+h.count));d+=h.count,h.added||(p+=h.count)}}return r}}class UI extends HI{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}}const GI=new UI;function qI(t,e,n){return GI.diff(t,e,n)}const VI=.4;function Zw(t){const e=[];let n=0;for(;n<t.length;){const a=t[n];if(/[\p{L}\p{N}_]/u.test(a)){let r=n+1;for(;r<t.length&&/[\p{L}\p{N}_]/u.test(t[r]);)r++;e.push(t.slice(n,r)),n=r}else if(/\s/.test(a)){let r=n+1;for(;r<t.length&&/\s/.test(t[r]);)r++;e.push(t.slice(n,r)),n=r}else{const i=t.codePointAt(n)>65535?2:1;e.push(t.slice(n,n+i)),n+=i}}return e}function WI(t,e){const n=qI(Zw(t),Zw(e)),a=t.length+e.length;let r=0;const i=[],l=[];let c=0,d=0;for(const p of n){const h=p.value.reduce((m,b)=>m+b.length,0);p.removed?(r+=h,i.push({start:c,end:c+h}),c+=h):p.added?(r+=h,l.push({start:d,end:d+h}),d+=h):(c+=h,d+=h)}return a>0&&r/a>VI?[[],[]]:[i,l]}function VS(t){const e=[];let n=null;for(const a of t.split(`
|
|
464
|
+
`)){if(a.startsWith("---")||a.startsWith("+++")||a.startsWith("index ")||a.startsWith("diff --git")||a.startsWith("==="))continue;const r=a.match(/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/);if(r){n&&e.push(n),n={oldStart:parseInt(r[1],10),oldLines:parseInt(r[2]??"1",10),newStart:parseInt(r[3],10),newLines:parseInt(r[4]??"1",10),lines:[]};continue}if(!a.startsWith("\\")){if(n&&(a.startsWith("+")||a.startsWith("-")||a.startsWith(" ")||a==="")){n.lines.push(a);continue}n&&a&&(e.push(n),n=null)}}return n&&e.push(n),e}function WS(t){let e=t.oldStart,n=t.newStart;const a=[];for(const r of t.lines){const i=r[0]==="+"||r[0]==="-"?r[0]:" ",l=r.slice(1);let c=null,d=null;i==="-"?c=e++:(i==="+"||(c=e++),d=n++),a.push({marker:i,code:l,oldLine:c,newLine:d})}return a}const k0=4e3,KI=N.memo(function({filePath:e,content:n,language:a,variant:r="card"}){const{t:i}=at(),[l,c]=N.useState("unified"),[d,p]=N.useState(!1),h=r==="panel",m=YI(e,a),b=(n==null?void 0:n.includes("@@"))||(n==null?void 0:n.includes("+++"))||(n==null?void 0:n.includes("---")),x=b?ZI(n||""):null,w=N.useMemo(()=>{const C=n||"",E=C.split(`
|
|
465
|
+
`);return E.length<=k0?{text:C,dropped:0}:{text:E.slice(0,k0).join(`
|
|
466
|
+
`),dropped:E.length-k0}},[n]),S=N.useMemo(()=>b?l==="unified"?eP(w.text,m):tP(w.text,m):g.jsx("pre",{className:"text-xs font-mono p-2 text-dark-fg whitespace-pre-wrap",children:w.text||"(no content)"}),[b,l,w.text,m]);return!n&&!e?null:g.jsxs("div",{className:h?"flex flex-col flex-1 min-h-0 overflow-hidden":"mt-2 border border-dark-border rounded-lg overflow-hidden",children:[g.jsxs("div",{className:Ke("flex items-center gap-2 px-3 py-1.5 bg-dark-surface",h?"shrink-0 border-b border-dark-border":"border-b border-dark-border"),children:[g.jsx("span",{className:"text-accent-purple text-xs",children:"📝"}),g.jsx("span",{className:"text-xs font-mono text-dark-fg truncate",children:e||"file"}),x&&g.jsxs("span",{className:"text-xs ml-2 flex gap-2",children:[g.jsxs("span",{className:"text-green-400",children:["+",x.additions]}),g.jsxs("span",{className:"text-red-400",children:["-",x.deletions]})]}),g.jsx("span",{className:"text-xs text-dark-muted ml-auto",children:m}),b&&g.jsxs("div",{className:"flex gap-0.5 ml-2",children:[g.jsx("button",{onClick:()=>c("unified"),className:`text-xs px-1.5 py-0.5 rounded ${l==="unified"?"bg-accent-blue/20 text-accent-blue":"text-dark-muted hover:text-dark-fg"}`,title:"Unified view",children:"Unified"}),g.jsx("button",{onClick:()=>c("side-by-side"),className:`text-xs px-1.5 py-0.5 rounded ${l==="side-by-side"?"bg-accent-blue/20 text-accent-blue":"text-dark-muted hover:text-dark-fg"}`,title:"Side-by-side view",children:"Side"})]}),!h&&g.jsx("button",{onClick:()=>p(!d),className:"text-xs text-dark-muted hover:text-dark-fg ml-1",children:d?"▶":"▼"})]}),!d&&g.jsxs("div",{className:h?"flex-1 min-h-0 overflow-auto custom-scrollbar bg-dark-bg":"bg-dark-bg overflow-x-auto max-h-96 overflow-y-auto custom-scrollbar",children:[S,w.dropped>0&&g.jsx("div",{className:"px-3 py-1.5 text-[11px] text-accent-yellow border-t border-dark-border",children:i("chat.diffRenderCapped",{rendered:k0,dropped:w.dropped})}),x&&g.jsxs("div",{className:"sticky bottom-0 bg-dark-surface border-t border-dark-border px-3 py-1 flex gap-4 text-xs text-dark-muted",children:[g.jsxs("span",{className:"text-green-400",children:["+",x.additions," additions"]}),g.jsxs("span",{className:"text-red-400",children:["-",x.deletions," deletions"]}),g.jsxs("span",{children:[x.hunks," hunks"]})]})]})]})});function YI(t,e){var r;if(e)return e;if(!t)return"plaintext";const n=(r=t.split(".").pop())==null?void 0:r.toLowerCase();return{ts:"typescript",tsx:"typescript",mts:"typescript",js:"javascript",jsx:"javascript",mjs:"javascript",cjs:"javascript",py:"python",go:"go",rs:"rust",cpp:"cpp",cxx:"cpp",hpp:"cpp",cc:"cpp",c:"cpp",h:"cpp",css:"css",scss:"css",html:"markup",htm:"markup",svg:"markup",xml:"xml",json:"json",yml:"yaml",yaml:"yaml",md:"markdown",sql:"sql",sh:"bash",bash:"bash",zsh:"bash",php:"php",rb:"ruby"}[n||""]||"plaintext"}function ZI(t){const e=t.split(`
|
|
467
|
+
`);let n=0,a=0,r=0;for(const i of e)i.startsWith("@@")?r++:i.startsWith("+")&&!i.startsWith("+++")?n++:i.startsWith("-")&&!i.startsWith("---")&&a++;return{additions:n,deletions:a,hunks:r,filesChanged:1}}function XI(t){const e=[],n=(r,i)=>{if(!i)return;const l=e[e.length-1];l&&l.type===r?l.text+=i:e.push({type:r,text:i})},a=(r,i)=>{if(typeof r=="string"){n(i,r);return}const l=r.type||i;if(typeof r.content=="string"){n(l,r.content);return}for(const c of r.content)a(c,l)};for(const r of t)a(r,"");return e}function KS(t,e){const n=jw.languages[e];if(!n)return[{type:"",text:t}];try{return XI(jw.tokenize(t,n))}catch{return[{type:"",text:t}]}}function QI(t,e){if(e.length===0)return t.map(r=>({...r,word:!1}));const n=[];let a=0;for(const r of t){const i=a,l=a+r.text.length;let c=0;for(const d of e){const p=Math.max(0,d.start-i),h=Math.min(r.text.length,d.end-i);h<=0||p>=r.text.length||(p>c&&n.push({type:r.type,text:r.text.slice(c,p),word:!1}),n.push({type:r.type,text:r.text.slice(p,h),word:!0}),c=h)}c<r.text.length&&n.push({type:r.type,text:r.text.slice(c),word:!1}),a=l}return n}function JI({code:t,marker:e,lang:n,ranges:a}){const r=e==="-"?[{type:"",text:t}]:KS(t,n),i=QI(r,a),l=e==="+"?"bg-green-900/30":e==="-"?"bg-red-900/30":"",c=e==="+"?"bg-green-700/60":"bg-red-700/60";return g.jsx("span",{className:`flex-1 whitespace-pre-wrap px-2 ${l}`,children:i.length===0?" ":i.map((d,p)=>g.jsx("span",{className:[d.type?`token ${d.type}`:"",d.word&&e!==" "?c:""].join(" "),children:d.text},p))})}function eP(t,e){const n=VS(t);if(n.length===0)return g.jsx("pre",{className:"text-xs font-mono p-2 text-dark-fg whitespace-pre-wrap",children:t});const a=[];let r=0;for(const i of n){const l=WS(i);a.push(g.jsxs("div",{className:"flex text-xs font-mono leading-snug bg-accent-blue/5 text-accent-blue font-bold px-2",style:{minHeight:"1.25rem"},children:[g.jsx("span",{className:"select-none shrink-0 text-right pr-1",children:"@"}),g.jsxs("span",{className:"flex-1 whitespace-pre-wrap",children:["@@ -",i.oldStart,",",i.oldLines," +",i.newStart,",",i.newLines," @@"]})]},r++));const c=new Map;for(let d=0;d<l.length;){if(l[d].marker!=="-"){d++;continue}const p=d;for(;d<l.length&&l[d].marker==="-";)d++;const h=d;for(;d<l.length&&l[d].marker==="+";)d++;const m=Math.min(h-p,d-h);for(let b=0;b<m;b++){const[x,w]=WI(l[p+b].code,l[h+b].code);c.set(p+b,x),c.set(h+b,w)}}for(let d=0;d<l.length;d++){const p=l[d],h=p.marker==="+",m=p.marker==="-",b=h?"bg-green-900/30":m?"bg-red-900/30":"",x=p.marker==="-"?p.oldLine:p.newLine;a.push(g.jsxs("div",{className:"flex text-xs font-mono leading-snug",style:{minHeight:"1.25rem"},children:[g.jsxs("span",{className:`select-none shrink-0 w-9 text-right pr-1 ${b} ${h?"text-green-400":m?"text-red-400":"text-dark-muted"}`,children:[p.marker===" "?"":p.marker,x??""]}),g.jsx(JI,{code:p.code,marker:p.marker,lang:e,ranges:c.get(d)??[]})]},r++))}}return g.jsx("div",{children:a})}function Xw({code:t,lang:e,kind:n}){if(t==="")return g.jsx("span",{className:"flex-1 px-2 border-r border-dark-border/30 font-mono text-xs leading-snug",style:{minHeight:"1.25rem"},children:" "});const a=n==="remove"?[{type:"",text:t}]:KS(t,e),r=n==="add"?"bg-green-900/30":n==="remove"?"bg-red-900/30":"";return g.jsx("span",{className:`flex-1 px-2 border-r border-dark-border/30 font-mono text-xs leading-snug ${r}`,children:a.map((i,l)=>g.jsx("span",{className:i.type?`token ${i.type}`:"",children:i.text},l))})}function tP(t,e){const n=VS(t);if(n.length===0)return g.jsx("pre",{className:"text-xs font-mono p-2 text-dark-fg whitespace-pre-wrap",children:t});const a=[];for(const r of n){const i=WS(r);a.push({left:`@@ -${r.oldStart},${r.oldLines} +${r.newStart},${r.newLines} @@`,right:"",type:"header"});let l=[],c=[];const d=()=>{(l.length>0||c.length>0)&&(nP(a,l,c),l=[],c=[])};for(const p of i)p.marker==="-"?l.push(p.code):p.marker==="+"?c.push(p.code):(d(),a.push({left:p.code,right:p.code,type:"context"}));d()}return g.jsxs("div",{children:[g.jsxs("div",{className:"flex border-b border-dark-border text-xs font-bold text-dark-muted",children:[g.jsx("div",{className:"flex-1 px-2 py-0.5 border-r border-dark-border",children:"Old"}),g.jsx("div",{className:"flex-1 px-2 py-0.5",children:"New"})]}),a.map((r,i)=>r.type==="header"?g.jsx("div",{className:"bg-accent-blue/5 text-accent-blue font-bold font-mono text-xs leading-snug px-2",children:r.left},i):g.jsxs("div",{className:"flex",style:{minHeight:"1.25rem"},children:[g.jsx(Xw,{code:r.type==="replace"||r.type==="delete"?"- "+r.left:r.left,lang:e,kind:r.type==="replace"||r.type==="delete"?"remove":"context"}),g.jsx(Xw,{code:r.type==="replace"||r.type==="add"?"+ "+r.right:r.right,lang:e,kind:r.type==="replace"||r.type==="add"?"add":"context"})]},i))]})}function nP(t,e,n){const a=Math.max(e.length,n.length);for(let r=0;r<a;r++){const i=r<e.length?e[r]??"":"",l=r<n.length?n[r]??"":"";t.push({left:i,right:l,type:r<e.length&&r<n.length?"replace":r<e.length?"delete":"add"})}}function Qw(t){return t.status.includes("?")?"bg-accent-purple/15 text-accent-purple":t.status.trim()&&t.status===t.status.toUpperCase()?"bg-accent-green/15 text-accent-green":"bg-accent-yellow/15 text-accent-yellow"}function aP(t){const e=t.split(/[\\/]/);return e[e.length-1]||t}const rP=1e5,sP=3,YS=N.memo(function(){const{t:e}=at(),n=er(P=>P.status),a=er(P=>P.refreshing),r=_i(P=>P.workspaceDir),i=er(P=>P.changeScope),l=er(P=>P.setChangeScope),[c,d]=N.useState(null),[p,h]=N.useState([]),[m,b]=N.useState(!1),[x,w]=N.useState({}),[S,C]=N.useState(null),{changes:E,added:T,removed:L}=_1(),D=er(P=>{var oe,he;return((he=(oe=P.status)==null?void 0:oe.changes)==null?void 0:he.length)??0}),B=N.useMemo(()=>new Map(E.map(P=>[P.path,P])),[E]),H=N.useMemo(()=>E.map(P=>P.path).join(`
|
|
468
|
+
`),[E]),K=N.useCallback(P=>`${m?"full":"compact"}:${P}`,[m]);N.useEffect(()=>{er.getState().refreshStatus()},[]),N.useEffect(()=>{if((n==null?void 0:n.available)===!1)return;const P=new Set(H?H.split(`
|
|
469
|
+
`):[]);!c||P.has(c)||(h(oe=>oe.filter(he=>P.has(he))),d(null))},[H,c,n==null?void 0:n.available]);const U=N.useCallback(async(P,oe)=>{var he,ke;C(P);try{const Be=m?rP:sP,Pe=await Je.git.diff(P,{mode:oe,context:Be});let He=Pe.success&&Pe.data?Pe.data:null;if(!He)throw new Error(Pe.error||"diff failed");if(!He.patch.trim()&&!He.error&&He.mode==="worktree"&&((he=B.get(P))!=null&&he.staged)){const ft=await Je.git.diff(P,{mode:"staged",context:Be});ft.success&&((ke=ft.data)!=null&&ke.patch.trim())&&(He=ft.data)}const $e=He;w(ft=>({...ft,[K(P)]:$e}))}catch(Be){const Pe=Be instanceof Error?Be.message:String(Be);w(He=>({...He,[K(P)]:{path:P,mode:oe,patch:"",error:Pe}}))}finally{C(null)}},[m,K,B]),q=c?K(c):"",re=c?x[q]:void 0,_e=c?B.get(c):void 0;N.useEffect(()=>{if(!c||x[q])return;const P=B.get(c);U(c,P!=null&&P.status.includes("?")?"untracked":"worktree")},[c,q,x,B,U]);const G=N.useCallback(P=>{d(P),h(oe=>oe.includes(P)?oe:[...oe,P])},[]),me=N.useCallback(P=>{const oe=p.indexOf(P),he=p.filter(ke=>ke!==P);h(he),c===P&&d(he.length>0?he[Math.max(0,oe-1)]??he[0]:null)},[p,c]),ge=(n==null?void 0:n.available)===!1,ye=S!==null&&S===c&&!re;return ge?g.jsxs("div",{className:"flex-1 min-h-0 flex flex-col items-center justify-center gap-2 px-4 text-center",children:[g.jsx(F8,{size:22,className:"text-dark-muted/50"}),g.jsx("div",{className:"text-xs text-dark-muted",children:e("git.notGitDesc")}),g.jsx("div",{className:"text-[10px] font-mono text-dark-muted/60 break-all",children:r})]}):n?g.jsx("div",{className:"flex-1 min-h-0 flex flex-col overflow-hidden",children:c?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"shrink-0 flex items-start gap-1.5 px-2 py-1.5 border-b border-dark-border",children:[g.jsx("button",{onClick:()=>d(null),className:"shrink-0 flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[11px] text-dark-muted hover:bg-dark-hover hover:text-dark-text transition-colors",title:e("git.backToList"),children:g.jsx(Fk,{size:12})}),g.jsxs("div",{className:"min-w-0 flex-1",children:[g.jsx("div",{className:"text-[11px] font-mono leading-snug text-dark-text break-all",title:c,children:c}),g.jsxs("div",{className:"mt-0.5 flex items-center gap-1.5",children:[_e&&g.jsx("span",{className:Ke("rounded px-1 text-[9px] leading-4",Qw(_e)),children:_e.status}),(re==null?void 0:re.mode)==="staged"&&g.jsx("span",{className:"text-[9px] text-accent-green",children:e("git.stagedBadge")}),(_e==null?void 0:_e.status.includes("?"))&&g.jsx("span",{className:"text-[9px] text-accent-purple",children:e("git.untrackedBadge")})]})]}),g.jsx("button",{onClick:()=>b(P=>!P),className:Ke("shrink-0 rounded-md border px-1.5 py-0.5 text-[10px] transition-colors",m?"border-accent-blue/40 bg-accent-blue/10 text-accent-blue":"border-dark-border text-dark-muted hover:text-dark-text"),title:e(m?"git.changedLines":"git.fullFile"),children:e(m?"git.fullFile":"git.changedLines")})]}),p.length>1&&g.jsx("div",{className:"shrink-0 flex items-center gap-1 overflow-x-auto custom-scrollbar border-b border-dark-border px-2 py-1",children:p.map(P=>g.jsxs("span",{className:Ke("group flex max-w-[11rem] shrink-0 items-center gap-1 rounded-md border px-1.5 py-0.5 text-[11px] transition-colors",P===c?"border-accent-blue/40 bg-accent-blue/10 text-dark-text":"border-dark-border text-dark-muted hover:text-dark-text"),children:[g.jsx("button",{onClick:()=>d(P),className:"min-w-0 truncate font-mono",title:P,children:aP(P)}),g.jsx("button",{onClick:()=>me(P),className:"shrink-0 rounded text-dark-muted hover:text-dark-text","aria-label":e("chat.closeTab"),title:e("chat.closeTab"),children:g.jsx(yn,{size:10})})]},P))}),g.jsx("div",{className:"flex-1 min-h-0 flex flex-col overflow-hidden p-2",children:ye||!re?g.jsx("div",{className:"flex flex-1 items-center justify-center",children:g.jsx(Hn,{size:18,className:"animate-spin text-accent-blue"})}):re.error?g.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-accent-red/30 bg-accent-red/5 px-2.5 py-2 text-[11px] text-accent-red",children:[g.jsx(Tu,{size:13,className:"shrink-0 mt-0.5"}),g.jsx("span",{className:"break-all",children:re.error})]}):re!=null&&re.binary?g.jsx(Jw,{text:e("git.binary")}):re!=null&&re.patch.trim()?g.jsx(KI,{variant:"panel",filePath:c,content:re.patch}):g.jsx(Jw,{text:e("git.noDiff")})})]}):g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"shrink-0 flex items-center gap-1.5 px-3 py-2 border-b border-dark-border",children:[n.branch&&g.jsxs("span",{className:"flex shrink-0 items-center gap-1 text-[10px] font-mono text-accent-blue",title:e("git.branch"),children:[g.jsx(H8,{size:11}),n.branch]}),g.jsx("span",{className:"text-[11px] text-dark-muted",children:e("git.filesChanged")}),g.jsxs("span",{className:"text-[11px] font-mono tabular-nums",children:[g.jsxs("span",{className:"text-accent-green",children:["+",T]}),g.jsx("span",{className:"text-dark-muted/40",children:" / "}),g.jsxs("span",{className:"text-accent-red",children:["−",L]})]}),g.jsx("div",{className:"flex-1"}),g.jsxs("div",{className:"flex shrink-0 items-center gap-0.5 rounded-md border border-dark-border p-0.5",children:[g.jsx("button",{type:"button",onClick:()=>l("session"),"aria-pressed":i==="session",title:e("git.scopeHintSession"),className:Ke("rounded px-1.5 py-0.5 text-[10px] transition-colors",i==="session"?"bg-accent-blue/10 text-accent-blue":"text-dark-muted hover:text-dark-text"),children:e("git.scopeSession")}),g.jsx("button",{type:"button",onClick:()=>l("all"),"aria-pressed":i==="all",title:e("git.scopeHintAll"),className:Ke("rounded px-1.5 py-0.5 text-[10px] transition-colors",i==="all"?"bg-accent-blue/10 text-accent-blue":"text-dark-muted hover:text-dark-text"),children:e("git.scopeAll")})]}),g.jsx("button",{onClick:()=>void er.getState().refreshStatus(),className:"shrink-0 rounded p-1 text-dark-muted hover:bg-dark-hover hover:text-dark-text transition-colors",title:e("git.refresh"),"aria-label":e("git.refresh"),children:g.jsx(vp,{size:12,className:Ke(a&&"animate-spin")})})]}),g.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto custom-scrollbar",children:E.length===0?g.jsx("div",{className:"py-6 text-center text-[11px] text-dark-muted/60",children:i==="session"&&D>0?e("git.sessionClean"):e("git.clean")}):E.map(P=>g.jsxs("button",{onClick:()=>G(P.path),className:"flex w-full items-start gap-1.5 border-b border-dark-border/40 px-3 py-1.5 text-left hover:bg-dark-hover transition-colors",title:P.path,children:[g.jsx("span",{className:Ke("mt-px w-6 shrink-0 rounded px-1 text-center text-[9px] leading-4",Qw(P)),children:P.status}),g.jsx("span",{className:"min-w-0 flex-1 break-all font-mono text-[11px] leading-snug text-dark-text",children:P.path}),g.jsxs("span",{className:"shrink-0 font-mono text-[10px] leading-snug tabular-nums",children:[P.added>0&&g.jsxs("span",{className:"text-accent-green",children:["+",P.added]}),P.removed>0&&g.jsxs("span",{className:"ml-1 text-accent-red",children:["−",P.removed]})]})]},P.path))})]})}):g.jsx("div",{className:"flex-1 min-h-0 flex items-center justify-center",children:g.jsx(Hn,{size:18,className:"animate-spin text-accent-blue"})})});function Jw({text:t}){return g.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-1.5 text-center",children:[g.jsx(Hk,{size:20,className:"text-dark-muted/50"}),g.jsx("span",{className:"text-[11px] text-dark-muted/70",children:t})]})}const Hm=[{id:"artifacts",labelKey:"chat.viewOverview",icon:U8},{id:"workspace",labelKey:"chat.viewWorkspaceFiles",icon:G8},{id:"changes",labelKey:"chat.viewChanges",icon:Hk}],ZS=N.memo(function({view:e,onSelect:n,counts:a,variant:r="toolbar",className:i}){const{t:l}=at(),[c,d]=N.useState(!1),p=N.useRef(null),h=Hm.find(C=>C.id===e)??Hm[0],m=h.icon,b=(a==null?void 0:a[e])??0,x=N.useCallback(()=>d(C=>!C),[]),w=N.useCallback(C=>{d(!1),n(C)},[n]);N.useEffect(()=>{if(!c)return;const C=T=>{p.current&&!p.current.contains(T.target)&&d(!1)},E=T=>{T.key==="Escape"&&(T.stopImmediatePropagation(),d(!1))};return document.addEventListener("mousedown",C),document.addEventListener("keydown",E),()=>{document.removeEventListener("mousedown",C),document.removeEventListener("keydown",E)}},[c]);const S=r==="panel";return g.jsxs("div",{className:Ke("relative",S?"min-w-0":"shrink-0",i),ref:p,children:[g.jsxs("button",{type:"button",onClick:x,className:Ke("flex items-center transition-colors",S?Ke("gap-1 rounded-lg px-2 py-1 text-xs",c?"bg-accent-blue/10 text-accent-blue":"text-dark-text hover:bg-dark-hover"):Ke("gap-1.5 rounded-lg px-2 py-1.5 text-xs",c?"bg-accent-blue/10 text-accent-blue":"text-dark-muted hover:bg-dark-hover hover:text-dark-text")),title:l("chat.switchPanelView"),"aria-label":l("chat.switchPanelView"),"aria-haspopup":"menu","aria-expanded":c,"data-testid":S?"sidebar-view-switcher":"toolbar-view-switcher",children:[!S&&g.jsx(m,{size:13,className:"shrink-0","aria-hidden":"true"}),g.jsx("span",{className:Ke("truncate",S&&"font-medium"),children:l(h.labelKey)}),!S&&b>0&&g.jsxs("span",{className:"font-mono text-[10px] tabular-nums",children:["(",b,")"]}),g.jsx(_s,{size:11,className:Ke("shrink-0 transition-transform",c&&"rotate-180"),"aria-hidden":"true"})]}),c&&g.jsx("div",{role:"menu",className:Ke("absolute top-full z-40 mt-1.5 w-44 overflow-hidden rounded-xl border border-dark-border bg-dark-surface p-1 shadow-2xl animate-fade-in",S?"left-0":"right-0"),children:Hm.map(C=>{const E=C.id===e,T=C.icon,L=(a==null?void 0:a[C.id])??0;return g.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":E,"data-testid":`panel-view-${C.id}`,onClick:()=>w(C.id),className:Ke("flex w-full items-center gap-2 rounded-lg px-2 py-1.5 text-left text-xs transition-colors",E?"bg-dark-hover text-dark-text":"text-dark-text hover:bg-dark-hover"),children:[g.jsx(T,{size:14,className:"shrink-0 text-dark-muted","aria-hidden":"true"}),g.jsx("span",{className:"min-w-0 flex-1 truncate",children:l(C.labelKey)}),L>0&&g.jsx("span",{className:"shrink-0 font-mono text-[10px] tabular-nums text-dark-muted",children:L}),E&&g.jsx(d1,{size:13,className:"shrink-0 text-accent-green","aria-hidden":"true"})]},C.id)})})]})}),XS=ka(()=>j(()=>import("./FileTreeView-Ciq1vhTf.js"),__vite__mapDeps([125,126,127,128,129,130])).then(t=>({default:t.FileTreeView})));function iP(t){return gu(t,["outputPath","output"])}function Ml(t){const e=t.split(/[\\/]/);return e[e.length-1]||t}function QS(t){return S1(t)??t}function n1(t){const e=(t.split(".").pop()||"").toLowerCase();return["png","jpg","jpeg","gif","svg","webp","ico","bmp"].includes(e)?"image":["md","markdown","mdown"].includes(e)?"markdown":["html","htm"].includes(e)?"html":["docx"].includes(e)?"docx":["xlsx"].includes(e)?"xlsx":["mp4","webm","mov","m4v"].includes(e)?"video":["mp3","wav","m4a","flac","ogg","aac"].includes(e)?"audio":e==="pdf"?"pdf":["c","h","cpp","cxx","cc","hpp","hh","hxx","m","mm","cs","ts","tsx","js","jsx","mjs","cjs","css","scss","sass","less","styl","html","htm","vue","svelte","astro","json","jsonc","json5","xml","yml","yaml","toml","ini","conf","cfg","env","properties","editorconfig","java","kt","kts","scala","sc","groovy","gradle","clj","cljs","cljc","py","rb","php","pl","pm","lua","tcl","r","jl","ps1","psm1","sh","bash","zsh","fish","ex","exs","erl","hrl","hs","lhs","ml","mli","fs","fsx","fsi","go","rs","swift","dart","sql","diff","patch","dockerfile","docker","makefile","mk","cmake","vim","asm","s","txt","log"].includes(e)?"code":"file"}function JS({kind:t,size:e=14}){return t==="image"?g.jsx(V8,{size:e,className:"text-dark-muted shrink-0"}):t==="markdown"?g.jsx(wo,{size:e,className:"text-dark-muted shrink-0"}):t==="code"?g.jsx(W8,{size:e,className:"text-dark-muted shrink-0"}):t==="html"?g.jsx(K8,{size:e,className:"text-dark-muted shrink-0"}):t==="video"?g.jsx(Y8,{size:e,className:"text-dark-muted shrink-0"}):t==="audio"?g.jsx(Z8,{size:e,className:"text-dark-muted shrink-0"}):t==="pdf"?g.jsx(wo,{size:e,className:"text-dark-muted shrink-0"}):t==="docx"?g.jsx(X8,{size:e,className:"text-dark-muted shrink-0"}):t==="xlsx"?g.jsx(Uk,{size:e,className:"text-dark-muted shrink-0"}):g.jsx(Gk,{size:e,className:"text-dark-muted shrink-0"})}const oP=["markdown","code","html"],lP=5e3,ek=new Map;function e6(t){const[e,n]=N.useState(null);return N.useEffect(()=>{if(!t){n(null);return}const a=w5(t);if(a){n(a);return}let r=!1;const i="/api/files/download",l=`${i}:${t}`,c=p=>Ru(`${i}?path=${encodeURIComponent(t)}&ticket=${encodeURIComponent(p)}`),d=ek.get(l);if(d&&d.exp-lP>Date.now()){n(c(d.ticket));return}return Je.files.previewTicket(t,i).then(p=>{var m,b;if(r)return;const h=p.success?(m=p.data)==null?void 0:m.ticket:void 0;if(!h){n(null);return}ek.set(l,{ticket:h,exp:Date.now()+(((b=p.data)==null?void 0:b.expiresInMs)??6e4)}),n(c(h))}).catch(()=>{r||n(null)}),()=>{r=!0}},[t]),e}let S0=null;function cP(){return S0||(S0=dS({themes:["github-dark"],langs:["javascript","typescript","jsx","tsx","css","json","bash","python","markdown","yaml","sql","html","xml","diff","java","c","cpp","csharp","go","rust","ruby","php","swift","kotlin","scala","dart","lua","perl","r","objective-c","powershell","dockerfile","makefile","cmake","jsonc","scss","less"],engine:BS()}).catch(t=>{throw S0=null,t})),S0}const tk={js:"javascript",ts:"typescript",mjs:"javascript",cjs:"javascript",jsx:"jsx",tsx:"tsx",py:"python",rb:"ruby",yml:"yaml",rs:"rust",sh:"bash",bash:"bash",zsh:"bash",fish:"bash",shell:"bash",text:"txt",plaintext:"txt",plain:"txt",log:"txt",cxx:"cpp",cc:"cpp",hpp:"cpp",hh:"cpp",hxx:"cpp",cs:"csharp",kt:"kotlin",kts:"kotlin","objective-c":"objective-c",mm:"objective-c",ex:"elixir",exs:"elixir",erl:"erlang",hrl:"erlang",hs:"haskell",lhs:"haskell",ml:"ocaml",mli:"ocaml",jl:"julia",pl:"perl",pm:"perl",clj:"clojure",cljs:"clojure",cljc:"clojure",fs:"fsharp",fsx:"fsharp",fsi:"fsharp",mk:"makefile",styl:"scss",sass:"scss",json5:"jsonc",vue:"vue",svelte:"svelte",astro:"astro",conf:"ini",cfg:"ini",env:"ini",properties:"ini",editorconfig:"ini",patch:"diff",docker:"dockerfile"};function uP(t){const e=(t.split(".").pop()||"").toLowerCase();return tk[e]?tk[e]:e||"txt"}function t6({text:t,className:e=""}){const{t:n}=at(),[a,r]=N.useState(!1),i=N.useRef(null);N.useEffect(()=>()=>{i.current&&clearTimeout(i.current)},[]);const l=N.useCallback(async()=>{try{await navigator.clipboard.writeText(t),r(!0),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>r(!1),2e3)}catch{ut.error(n("chat.copyPathFailed"))}},[t,n]);return g.jsxs("button",{type:"button",onClick:()=>void l(),title:n("chat.copySource"),className:Ke("inline-flex items-center gap-1 rounded-md px-2 py-1 text-[11px] transition-colors",a?"text-accent-green":"text-dark-muted hover:bg-dark-hover hover:text-dark-text",e),children:[a?g.jsx(Eu,{size:12}):g.jsx(Au,{size:12}),n(a?"common.copied":"chat.copySource")]})}function dP({path:t,content:e}){const{t:n}=at(),[a,r]=N.useState(null),[i,l]=N.useState(!1),c=uP(t);return N.useEffect(()=>{let d=!1;if(r(null),l(!1),e!=null)return cP().then(p=>{if(!p.getLoadedLanguages().includes(c)){r(null);return}const h=p.codeToHtml(e,{lang:c,theme:"github-dark"});d||r(h)}).catch(()=>{d||l(!0)}),()=>{d=!0}},[e,c]),e==null?null:g.jsxs("div",{className:"flex flex-1 min-h-0 flex-col overflow-hidden rounded-lg border border-dark-border",children:[g.jsxs("div",{className:"flex shrink-0 items-center justify-between px-3 py-1 bg-dark-surface border-b border-dark-border",children:[g.jsx("span",{className:"text-[11px] text-dark-muted font-mono",children:c}),g.jsx(t6,{text:e})]}),a?g.jsx("div",{className:"flex-1 min-h-0 overflow-auto custom-scrollbar codeblock-shiki text-sm [&_pre]:bg-dark-bg [&_pre]:p-3 [&_pre]:overflow-x-auto custom-scrollbar",dangerouslySetInnerHTML:{__html:a}}):g.jsxs(g.Fragment,{children:[i&&g.jsx("div",{className:"shrink-0 border-b border-dark-border/60 bg-dark-surface px-3 py-1 text-[10.5px] text-dark-muted",children:n("chat.codeRenderError")}),g.jsx("pre",{className:"flex-1 min-h-0 overflow-auto custom-scrollbar bg-dark-bg p-3 text-xs leading-relaxed font-mono whitespace-pre-wrap break-all text-dark-text",children:e})]})]})}function pP({path:t}){const[e,n]=N.useState(null),[a,r]=N.useState(!1),[i,l]=N.useState(null);return N.useEffect(()=>{let c=!1;return n(null),l(null),r(!0),Je.files.previewDocx(t).then(d=>{var p;c||(d.success?n(((p=d.data)==null?void 0:p.text)??""):l(d.error||"读取失败"))}).catch(d=>{c||l(d instanceof Error?d.message:"读取失败")}).finally(()=>{c||r(!1)}),()=>{c=!0}},[t]),a?g.jsx("div",{className:"flex flex-1 items-center justify-center text-dark-muted",children:g.jsx(Hn,{size:18,className:"animate-spin text-accent-blue"})}):i?g.jsx("div",{className:"text-xs text-accent-red",children:i}):g.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto custom-scrollbar rounded-lg border border-dark-border bg-dark-bg p-3 text-[12.5px] leading-relaxed text-dark-text whitespace-pre-wrap break-words",children:e})}function fP({path:t}){const[e,n]=N.useState(null),[a,r]=N.useState(!1),[i,l]=N.useState(null);if(N.useEffect(()=>{let d=!1;return n(null),l(null),r(!0),Je.files.previewXlsx(t).then(p=>{var h;d||(p.success?n(((h=p.data)==null?void 0:h.sheets)??[]):l(p.error||"读取失败"))}).catch(p=>{d||l(p instanceof Error?p.message:"读取失败")}).finally(()=>{d||r(!1)}),()=>{d=!0}},[t]),a)return g.jsx("div",{className:"flex flex-1 items-center justify-center text-dark-muted",children:g.jsx(Hn,{size:18,className:"animate-spin text-accent-blue"})});if(i)return g.jsx("div",{className:"text-xs text-accent-red",children:i});if(!e||e.length===0)return g.jsx("div",{className:"text-xs text-dark-muted",children:"空表格"});const c=e[0];return g.jsxs("div",{className:"flex flex-1 min-h-0 flex-col overflow-hidden rounded-lg border border-dark-border bg-dark-bg",children:[g.jsxs("div",{className:"shrink-0 px-3 py-1.5 bg-dark-surface border-b border-dark-border text-[11px] text-dark-muted font-medium flex items-center gap-2",children:[g.jsx(Uk,{size:12}),g.jsx("span",{className:"font-mono",children:c.name}),e.length>1&&g.jsxs("span",{className:"text-dark-muted/70",children:["(共 ",e.length," 个 sheet,仅预览首个)"]})]}),g.jsx("div",{className:"flex-1 min-h-0 overflow-auto custom-scrollbar",children:g.jsxs("table",{className:"w-full text-xs border-collapse",children:[c.headers.length>0&&g.jsx("thead",{className:"sticky top-0 bg-dark-surface",children:g.jsx("tr",{children:c.headers.map((d,p)=>g.jsx("th",{className:"border border-dark-border px-2 py-1.5 text-left font-medium text-dark-text whitespace-nowrap",children:d},p))})}),g.jsx("tbody",{children:c.rows.length===0?g.jsx("tr",{children:g.jsx("td",{className:"px-2 py-2 text-dark-muted",colSpan:Math.max(1,c.headers.length),children:"无数据行"})}):c.rows.map((d,p)=>g.jsx("tr",{className:"even:bg-dark-hover/30",children:d.map((h,m)=>g.jsx("td",{className:"border border-dark-border px-2 py-1 text-dark-text align-top whitespace-pre-wrap break-words",children:h},m))},p))})]})})]})}function hP({path:t,content:e}){const{t:n}=at(),[a,r]=N.useState("page");N.useEffect(()=>{r("page")},[t]);const i=e6(t),l=c=>Ke("inline-flex items-center gap-1 rounded-md px-2.5 py-1 text-xs transition-colors",c?"bg-accent-blue/10 text-accent-blue font-medium":"text-dark-muted hover:text-dark-text hover:bg-dark-hover");return g.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-2",children:[g.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2",children:[g.jsxs("div",{className:"flex items-center gap-0.5 self-start rounded-lg border border-dark-border bg-dark-surface p-0.5",children:[g.jsxs("button",{type:"button",onClick:()=>r("page"),className:l(a==="page"),"aria-pressed":a==="page",children:[g.jsx(yp,{size:12}),n("chat.previewTabPage")]}),g.jsxs("button",{type:"button",onClick:()=>r("code"),className:l(a==="code"),"aria-pressed":a==="code",children:[g.jsx(t_,{size:12}),n("chat.previewTabCode")]})]}),a==="code"&&g.jsx(t6,{text:e??""})]}),a==="page"?g.jsx("div",{className:"relative w-full flex-1 min-h-0 overflow-hidden rounded-lg border border-dark-border bg-white",children:g.jsx("iframe",{src:i??void 0,title:Ml(t),sandbox:"allow-scripts allow-forms allow-popups allow-modals",className:"absolute inset-0 h-full w-full border-0"},t)}):g.jsx("pre",{className:"flex-1 min-h-0 overflow-auto custom-scrollbar rounded-lg border border-dark-border bg-dark-bg p-3 text-[11px] leading-relaxed font-mono whitespace-pre-wrap break-all text-dark-text",children:e??""})]})}function n6(t){var n;const e=new Map;for(const a of t){if((n=a.fileJob)!=null&&n.result)for(const r of a.fileJob.result)r.path&&!e.has(r.path)&&e.set(r.path,{path:r.path,name:r.fileName||Ml(r.path),source:"filejob"});for(const r of a.toolCalls??[]){if(r.status==="error")continue;const i=iP(r.args);i&&_o(r.name)&&!e.has(i)&&e.set(i,{path:i,name:Ml(i),source:"toolcall"})}}return Array.from(e.values())}function mP({status:t}){return t==="running"?g.jsx(Hn,{size:12,className:"animate-spin text-accent-blue shrink-0 mt-0.5"}):t==="completed"?g.jsx(Eu,{size:12,className:"text-accent-green shrink-0 mt-0.5"}):t==="failed"?g.jsx(f1,{size:12,className:"text-accent-red shrink-0 mt-0.5"}):t==="skipped"?g.jsx(q8,{size:12,className:"text-dark-muted shrink-0 mt-0.5"}):g.jsx(p1,{size:12,className:"text-dark-muted shrink-0 mt-0.5"})}const gP={workflow:"WF",goal:"Goal",plan:"Plan",task:"Task",todo:"Todo",agent:"Agent"},yP={pending:"待执行",running:"进行中",completed:"完成",failed:"失败",skipped:"跳过"};function bP(t){const e=new Map;for(const i of t)e.set(i.id,i);const n=new Map,a=[];for(const i of t){const c=i.source==="goal"&&i.dependencies&&i.dependencies[0]||void 0;if(c&&e.has(c)){const d=n.get(c)??[];d.push(i),n.set(c,d)}else a.push(i)}const r=(i,l)=>{const c=(n.get(i.id)??[]).filter(d=>!l.has(d.id)).map(d=>r(d,new Set(l).add(i.id)));return{task:i,children:c}};return a.map(i=>r(i,new Set))}function a6({node:t}){const{task:e,children:n}=t,a=gP[e.source]||e.source;return g.jsxs("div",{className:"min-w-0",children:[g.jsxs("div",{className:"flex items-start gap-2 text-xs",children:[g.jsx("span",{className:"mt-0.5 shrink-0",children:g.jsx(mP,{status:e.status})}),g.jsxs("span",{className:"min-w-0 flex-1 leading-snug break-words",children:[g.jsxs("span",{className:"flex flex-wrap items-center gap-1.5",children:[g.jsx("span",{className:Ke("font-medium break-words",e.status==="completed"&&"text-dark-muted/70 line-through decoration-dark-muted/40",e.status==="failed"&&"text-accent-red/90"),children:e.title}),e.agentType&&g.jsx("span",{className:"rounded bg-dark-surface px-1 py-px text-[9.5px] font-mono text-accent-blue/90",children:e.agentType}),g.jsxs("span",{className:"text-[9px] text-dark-muted/60",children:[a," · ",yP[e.status]]})]}),e.status==="running"&&e.progress!==void 0&&g.jsx("span",{className:"block mt-1",children:g.jsx("span",{className:"block w-full h-1 bg-dark-surface rounded-full overflow-hidden",children:g.jsx("span",{className:"block h-full bg-accent-blue rounded-full transition-all duration-500",style:{width:`${Math.max(0,Math.min(100,e.progress))}%`}})})}),e.description&&g.jsx("span",{className:"block mt-0.5 text-[11px] leading-snug text-dark-muted break-words",children:e.description}),e.result&&e.status==="completed"&&g.jsxs("span",{className:"block mt-0.5 text-[11px] leading-snug text-accent-green/80 break-words",children:["→ ",e.result]}),e.error&&g.jsxs("span",{className:"block mt-0.5 text-[11px] leading-snug text-accent-red/90 break-words",children:["✗ ",e.error]})]})]}),n.length>0&&g.jsx("div",{className:"mt-1 space-y-1 border-l border-dark-border/40 ml-[11px] pl-2",children:n.map(r=>g.jsx(a6,{node:r},r.task.id))})]})}const vP=[];function xP({sessionId:t}){const{t:e}=at(),n=ot(h=>t?h.tasksBySession[t]:void 0),a=N.useMemo(()=>t?ot.getState().getTasksForSession(t):vP,[t,n]),r=ot(h=>t?h.getRunningAgentCount(t):0),i=ot(h=>t?h.getForSession(t):void 0),c=Me(h=>t?h.isGenerating(t):!1)||r>0||(i==null?void 0:i.status)==="RUNNING"||(i==null?void 0:i.status)==="RESUMING",d=N.useMemo(()=>t?ot.getState().getEventsForSession(t).filter(m=>m.type==="tool_call"||m.title).length:0,[t,a.length,r,i==null?void 0:i.updatedAt]),p=N.useMemo(()=>bP(a),[a]);return a.length===0?c?g.jsxs("div",{className:"flex items-center gap-2 text-xs text-dark-muted py-0.5",children:[g.jsx(Hn,{size:13,className:"animate-spin text-accent-blue shrink-0"}),g.jsx("span",{className:"truncate",children:r>0?e("chat.sidebarWorkingWithAgents",{n:r}):d>0?e("chat.sidebarWorkingToolcalls",{n:d}):e("chat.sidebarWorking")})]}):g.jsx("p",{className:"text-[11px] leading-relaxed text-dark-muted/70",children:e("chat.sidebarIdle")}):g.jsxs("div",{className:"space-y-1.5",children:[p.map(h=>g.jsx(a6,{node:h},h.task.id)),c&&g.jsx("p",{className:"text-[10px] text-dark-muted/70 pt-0.5",children:r>0?e("chat.sidebarRunningAgents",{n:r}):e("chat.sidebarToolcallsSoFar",{n:d})})]})}function wP({tabs:t,active:e,onActivate:n,onClose:a,onBack:r}){const{t:i}=at(),l=N.useRef(null);return N.useEffect(()=>{var d,p;const c=(d=l.current)==null?void 0:d.querySelector('[data-active="1"]');(p=c==null?void 0:c.scrollIntoView)==null||p.call(c,{block:"nearest",inline:"nearest"})},[e,t.length]),g.jsxs("div",{className:"flex shrink-0 items-center gap-1 border-b border-dark-border/60 bg-dark-surface/60 px-1",children:[g.jsx("button",{onClick:r,className:"p-1 rounded hover:bg-dark-hover transition-colors text-dark-muted shrink-0",title:i("chat.backToArtifacts"),"aria-label":i("chat.backToArtifacts"),children:g.jsx(h1,{size:15})}),g.jsx("div",{ref:l,role:"tablist",className:"flex min-w-0 flex-1 items-center gap-0.5 overflow-x-auto custom-scrollbar py-1",children:t.map(c=>{const d=c===e,p=QS(c),h=S1(c)??Ml(c);return g.jsxs("div",{"data-active":d?"1":"0",role:"tab","aria-selected":d,title:p,className:Ke("group/tab flex max-w-[11rem] shrink-0 items-center gap-1 rounded-md border px-2 py-1 text-[11px] transition-colors cursor-pointer",d?"border-accent-blue/40 bg-accent-blue/10 text-dark-text":"border-transparent text-dark-muted hover:bg-dark-hover hover:text-dark-text"),onClick:()=>n(c),onAuxClick:m=>{m.button===1&&(m.preventDefault(),a(c))},children:[g.jsx("span",{className:"truncate",children:h}),g.jsx("button",{type:"button","aria-label":i("chat.closeTab"),title:i("chat.closeTab"),onClick:m=>{m.stopPropagation(),a(c)},className:Ke("grid h-4 w-4 shrink-0 place-items-center rounded transition-colors",d?"text-dark-muted hover:bg-dark-border hover:text-dark-text":"opacity-0 group-hover/tab:opacity-100 hover:bg-dark-border hover:text-dark-text"),children:g.jsx(yn,{size:11})})]},c)})})]})}function ty({sessionId:t,messages:e,previewFile:n,previewTabs:a,onPreview:r,onCloseTab:i,onClosePreview:l}){const{t:c}=at(),[d,p]=N.useState(null),[h,m]=N.useState(!1),[b,x]=N.useState(null),[w,S]=N.useState(!0),C=N.useRef(null),E=e6(n),T=N.useCallback(async q=>{m(!0),x(null),p(null);try{const re=await Je.files.read(q);re.success&&re.data!==void 0&&re.data!==null?p(String(re.data)):x(re.error||c("chat.fileReadError"))}catch(re){x(re instanceof Error?re.message:c("chat.fileReadError"))}finally{m(!1)}},[c]);N.useEffect(()=>{const q=n?n1(n):null;if(!n||!q||!oP.includes(q)){p(null),m(!1),x(null);return}T(n)},[n,T]);const L=N.useCallback(async q=>{const re=w5(q);if(re){const G=document.createElement("a");G.href=re,G.download=S1(q)??"image",document.body.appendChild(G),G.click(),G.remove();return}const _e=await Je.files.download(q);_e.success||ut.error(_e.error||c("chat.fileReadError"))},[c]),D=N.useCallback(async q=>{try{await navigator.clipboard.writeText(q),ut.success(c("chat.copiedPath"))}catch{ut.error(c("chat.copyPathFailed"))}},[c]),B=n?n1(n):"file",H=N.useMemo(()=>B==="markdown"?gB(d??""):[],[d,B]),K=n?QS(n):"",U=k1(n);return g.jsx("div",{className:"flex-1 min-h-0 min-w-0 flex flex-col overflow-hidden",children:n?g.jsxs("div",{className:"flex-1 flex flex-col min-h-0",children:[g.jsx(wP,{tabs:a&&a.length>0?a:[n],active:n,onActivate:r,onClose:q=>i?i(q):l(),onBack:l}),g.jsx("div",{className:"shrink-0 px-2 py-1.5 border-b border-dark-border/60",children:g.jsxs("div",{className:"flex items-center gap-1.5",children:[g.jsxs("div",{className:"min-w-0 flex-1 flex items-center gap-1.5",children:[g.jsx(JS,{kind:B,size:13}),g.jsx("span",{className:"text-[11px] font-mono text-dark-muted truncate",title:K,children:K})]}),!U&&g.jsx("button",{onClick:()=>void D(n),className:"p-1 rounded text-dark-muted hover:bg-dark-hover hover:text-dark-text transition-colors shrink-0",title:c("chat.copyPath"),"aria-label":c("chat.copyPath"),children:g.jsx(Au,{size:14})}),!U&&g.jsx("a",{href:E??"#",target:"_blank",rel:"noopener noreferrer",className:"p-1 rounded text-dark-muted hover:bg-dark-hover hover:text-dark-text transition-colors shrink-0",title:c("chat.openInNewTab"),"aria-label":c("chat.openInNewTab"),children:g.jsx(lu,{size:14})}),g.jsx("button",{onClick:()=>void L(n),className:"p-1 rounded text-dark-muted hover:bg-dark-hover hover:text-dark-text transition-colors shrink-0",title:c("fileJob.download"),"aria-label":c("fileJob.download"),children:g.jsx(Sl,{size:14})}),B==="markdown"&&H.length>0&&g.jsx("button",{onClick:()=>S(q=>!q),className:Ke("p-1 rounded transition-colors shrink-0",w?"bg-accent-blue/10 text-accent-blue":"text-dark-muted hover:bg-dark-hover hover:text-dark-text"),title:c("chat.outline"),"aria-label":c("chat.outline"),"aria-pressed":w,children:g.jsx(e_,{size:14})})]})}),g.jsx("div",{className:"flex flex-1 min-h-0 flex-col overflow-hidden p-3",children:h?g.jsx("div",{className:"flex flex-1 items-center justify-center text-dark-muted",children:g.jsx(Hn,{size:18,className:"animate-spin text-accent-blue"})}):b?g.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-accent-red/30 bg-accent-red/5 px-3 py-2.5 text-xs text-accent-red",children:[g.jsx(Tu,{size:14,className:"shrink-0 mt-0.5"}),g.jsx("span",{className:"break-words",children:b})]}):B==="image"?g.jsx("div",{className:"flex flex-1 min-h-0 items-center justify-center overflow-hidden",children:g.jsx("img",{src:E??void 0,alt:K,className:"max-h-full max-w-full object-contain rounded-lg border border-dark-border"})}):B==="markdown"?g.jsxs("div",{className:"relative flex-1 min-h-0",children:[g.jsx("div",{ref:C,className:"absolute inset-0 overflow-y-auto custom-scrollbar",children:d!=null&&g.jsx(GB,{content:d,headingIds:!0})}),w&&H.length>0&&g.jsx(VB,{headings:H,scrollRoot:C,onClose:()=>S(!1)})]}):B==="html"?g.jsx(hP,{path:n,content:d}):B==="docx"?g.jsx(pP,{path:n}):B==="xlsx"?g.jsx(fP,{path:n}):B==="pdf"?g.jsx("div",{className:"relative w-full flex-1 min-h-0 overflow-hidden rounded-lg border border-dark-border bg-white",children:g.jsx("iframe",{src:E??void 0,title:Ml(n),className:"absolute inset-0 h-full w-full border-0"},n)}):B==="video"?g.jsx("div",{className:"flex flex-1 min-h-0 items-center justify-center overflow-hidden rounded-lg border border-dark-border bg-black",children:g.jsx("video",{src:E??void 0,controls:!0,className:"max-h-full max-w-full"},n)}):B==="audio"?g.jsx("div",{className:"shrink-0 pt-2",children:g.jsx("audio",{src:E??void 0,controls:!0,className:"w-full"},n)}):B==="code"?g.jsx(dP,{path:n,content:d}):g.jsxs("div",{className:"flex flex-1 min-h-0 flex-col items-center justify-center gap-3 overflow-y-auto px-4 text-center custom-scrollbar",children:[g.jsx("span",{className:"grid w-16 h-16 shrink-0 place-items-center rounded-2xl bg-dark-surface border border-dark-border shadow-sm",children:g.jsx(Gk,{size:30,className:"text-accent-blue"})}),g.jsxs("div",{className:"min-w-0 w-full max-w-sm",children:[g.jsx("div",{className:"text-sm font-semibold text-dark-text break-all leading-snug",children:Ml(n)}),g.jsx("div",{className:"mt-1.5 text-[11px] font-mono text-dark-muted break-all leading-relaxed",title:n,children:n})]}),g.jsx("p",{className:"text-[11px] text-dark-muted/70 leading-relaxed max-w-xs",children:c("chat.filePreviewHint")}),g.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[g.jsxs("a",{href:E??"#",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 rounded-lg bg-accent-blue/10 text-accent-blue px-3 py-1.5 text-xs font-medium hover:bg-accent-blue/20 transition-colors",title:c("chat.openInNewTab"),children:[g.jsx(lu,{size:13}),c("chat.openInNewTab")]}),g.jsxs("button",{onClick:()=>void L(n),className:"inline-flex items-center gap-1 rounded-lg bg-dark-surface border border-dark-border text-dark-text px-3 py-1.5 text-xs hover:bg-dark-hover transition-colors",title:c("fileJob.download"),children:[g.jsx(Sl,{size:13}),c("fileJob.download")]})]})]})})]}):g.jsx(RI,{sessionId:t,messages:e,onPreview:r})})}function kP({sessionId:t,messages:e,previewFile:n,previewTabs:a,onPreview:r,onCloseTab:i,onClosePreview:l,onPopOutPreview:c,isMaximized:d,onToggleMaximize:p,view:h,onViewChange:m}){const{t:b}=at(),x=N.useMemo(()=>n6(e),[e]),[w,S]=N.useState("artifacts"),C=h??w,E=_1().changes.length,T=N.useCallback(L=>{S(L),m==null||m(L)},[m]);return g.jsxs("div",{className:"w-full h-full border-l border-dark-border bg-dark-surface flex flex-col overflow-hidden",children:[g.jsxs("div",{className:"shrink-0 px-3 py-2.5 border-b border-dark-border bg-dark-surface flex items-center gap-2",children:[g.jsx(ZS,{variant:"panel",view:C,onSelect:T,counts:{artifacts:x.length,changes:E}}),g.jsxs("div",{className:"ml-auto flex items-center gap-0.5",children:[c&&C==="artifacts"&&n&&g.jsx("button",{onClick:c,className:"p-1 rounded text-dark-muted hover:bg-dark-hover hover:text-dark-text transition-colors shrink-0",title:b("chat.previewPopOut"),"aria-label":b("chat.previewPopOut"),"data-testid":"sidebar-popout-preview",children:g.jsx(lu,{size:14})}),p&&g.jsx("button",{onClick:p,className:"p-1 rounded text-dark-muted hover:bg-dark-hover hover:text-dark-text transition-colors shrink-0",title:b(d?"chat.sidebarRestore":"chat.sidebarMaximize"),"aria-label":b(d?"chat.sidebarRestore":"chat.sidebarMaximize"),children:d?g.jsx(Q8,{size:14}):g.jsx(J8,{size:14})})]})]}),C==="changes"?g.jsx(YS,{}):C==="workspace"?g.jsx(N.Suspense,{fallback:g.jsx("div",{className:"flex-1 min-h-0 flex items-center justify-center",children:g.jsx(Hn,{size:18,className:"animate-spin text-accent-blue"})}),children:g.jsx(XS,{})}):g.jsx(ty,{sessionId:t,messages:e,previewFile:n,previewTabs:a,onPreview:r,onCloseTab:i,onClosePreview:l}),g.jsx("div",{className:"shrink-0 px-3 py-2 border-t border-dark-border/60",children:g.jsx("p",{className:"text-[10px] text-dark-muted/60 leading-relaxed",children:b(C==="workspace"?"chat.workspaceHint":C==="changes"?"chat.changesHint":"chat.artifactHint")})})]})}function SP(t){return t<=0?3.2:Math.min(3.2,Math.max(.95,3.2/(1+t/45)))}function yl(t,e,n){const a=(t%360+360)%360,r=(1-Math.abs(2*n-1))*e,i=r*(1-Math.abs(a/60%2-1)),l=n-r/2;let c=0,d=0,p=0;return a<60?[c,d,p]=[r,i,0]:a<120?[c,d,p]=[i,r,0]:a<180?[c,d,p]=[0,r,i]:a<240?[c,d,p]=[0,i,r]:a<300?[c,d,p]=[i,0,r]:[c,d,p]=[r,0,i],`${Math.round((c+l)*255)} ${Math.round((d+l)*255)} ${Math.round((p+l)*255)}`}function _P(t){let e=5381;for(let n=0;n<t.length;n++)e=e*33^t.charCodeAt(n)|0;return(e%360+360)%360}const nk=.35,r6=N.memo(function({size:e=12,rate:n=0,accent:a="blue",hue:r,className:i}){const l=N.useRef(null),c=N.useRef(n);c.current=n;const d=Math.round(e*.58),p=Math.max(2.5,Math.round(e*.24)),h=e/2+1,m=h*nk,b=h+2.5,x=m+2.5*nk,w=r===void 0?void 0:{"--rs-tail":yl(r-130,.86,.55),"--rs-c1":yl(r-65,.9,.6),"--rs-mid":yl(r,.8,.62),"--rs-c2":yl(r+65,.92,.66),"--rs-head":yl(r+130,.95,.7)},S=r!==void 0?r/360*2*Math.PI:-Math.PI/2;N.useEffect(()=>{const E=l.current;if(!E||typeof window.requestAnimationFrame!="function"||typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;const T=e/2,L=e/2;let D=S,B=2*Math.PI/3.2,H=performance.now(),K=0;const U=q=>{const re=Math.min((q-H)/1e3,.1);H=q;const _e=2*Math.PI/SP(c.current);B+=(_e-B)*(1-Math.exp(-re*3)),D=(D+B*re)%(2*Math.PI);const G=T+h*Math.cos(D)-p/2,me=L+m*Math.sin(D)-p/2;E.style.transform=`translate(${G.toFixed(2)}px, ${me.toFixed(2)}px)`,E.style.zIndex=Math.sin(D)>0?"3":"1",K=requestAnimationFrame(U)};return K=requestAnimationFrame(U),()=>cancelAnimationFrame(K)},[e,p,h,m,S]);const C=(E,T)=>({left:`${50-E/e*100}%`,top:`${50-T/e*100}%`,width:E*2,height:T*2});return g.jsxs("span",{className:`rate-spinner${i?` ${i}`:""}`,"data-accent":a,style:{width:e,height:e,...w},role:"status","aria-label":"generating",children:[g.jsx("i",{className:"rs-ringline rs-ring-back",style:C(h,m),"aria-hidden":!0}),g.jsx("i",{className:"rs-ringline rs-ring-outer",style:C(b,x),"aria-hidden":!0}),g.jsx("i",{className:"rs-planet",style:{width:d,height:d,left:`calc(50% - ${d/2}px)`,top:`calc(50% - ${d/2}px)`},"aria-hidden":!0}),g.jsx("i",{className:"rs-ringline rs-ring-front",style:C(h,m),"aria-hidden":!0}),g.jsx("i",{ref:l,className:"rs-moon",style:{width:p,height:p,zIndex:Math.sin(S)>0?3:1,transform:`translate(${(e/2+h*Math.cos(S)-p/2).toFixed(2)}px, ${(e/2+m*Math.sin(S)-p/2).toFixed(2)}px)`},"aria-hidden":!0})]})}),ak={running:{Icon:m1,label:"nav.sessionRunning",ring:"spin"},waiting:{Icon:a_,label:"nav.sessionWaiting",ring:"breathe"},failed:{Icon:n_,label:"nav.sessionFailed",ring:"static"},done:{Icon:d1,label:"nav.sessionDone"}},rk=`
|
|
470
|
+
.dsc-status {
|
|
471
|
+
--dsc-rgb: var(--color-muted);
|
|
472
|
+
/* 龙卷风涡流的两端:涡头靛蓝 → 涡尾青绿(中段由浏览器插值成蓝绿) */
|
|
473
|
+
--dsc-vortex-a: var(--color-accent-blue);
|
|
474
|
+
--dsc-vortex-b: var(--color-accent-green);
|
|
475
|
+
--dsc-chip: 0.1;
|
|
476
|
+
color: rgb(var(--dsc-rgb));
|
|
477
|
+
background-color: rgb(var(--dsc-rgb) / var(--dsc-chip));
|
|
478
|
+
border-color: transparent;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
.dsc-status[data-status='running'] { --dsc-rgb: var(--color-accent-blue); }
|
|
482
|
+
.dsc-status[data-status='waiting'] { --dsc-rgb: var(--color-accent-yellow); --dsc-chip: 0.13; }
|
|
483
|
+
.dsc-status[data-status='failed'] { --dsc-rgb: var(--color-accent-red); }
|
|
484
|
+
|
|
485
|
+
/* 已完成:绿勾 + 极淡绿底 —— 「尘埃落定」的正向确认(一眼可辨,无需读标题)。
|
|
486
|
+
刻意比 running 收敛:无动效、低饱和底板、绿而非高饱和大色块,
|
|
487
|
+
避免侧栏一排会话全是喧闹的绿灯抢占 running 的视觉重心。 */
|
|
488
|
+
.dsc-status[data-status='done'] {
|
|
489
|
+
color: rgb(var(--color-accent-green));
|
|
490
|
+
background-color: rgb(var(--color-accent-green) / 0.14);
|
|
491
|
+
border-color: rgb(var(--color-accent-green) / 0.34);
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
/* 进行中:同色柔光晕缓慢呼吸 —— 即使截图静止,也认得出这是彩色状态。
|
|
495
|
+
振幅刻意压小 + 周期拉长:box-shadow 是重绘属性,快而强的脉冲在 18px 上
|
|
496
|
+
看起来就是「闪烁」。 */
|
|
497
|
+
.dsc-status[data-status='running'] {
|
|
498
|
+
animation: dscGlow 3.6s ease-in-out infinite;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
.dsc-ring {
|
|
502
|
+
position: absolute;
|
|
503
|
+
inset: -2px;
|
|
504
|
+
border: 2px solid transparent;
|
|
505
|
+
border-radius: 7px;
|
|
506
|
+
pointer-events: none;
|
|
507
|
+
}
|
|
508
|
+
.dsc-ring[data-motion='spin'] {
|
|
509
|
+
/* 龙卷风:蓝→青→绿的头尾渐隐涡流(comet),遮罩抠出 2.5px 环带 */
|
|
510
|
+
border-color: transparent;
|
|
511
|
+
background: conic-gradient(
|
|
512
|
+
from 0deg,
|
|
513
|
+
rgb(var(--dsc-vortex-a) / 0) 0deg,
|
|
514
|
+
rgb(var(--dsc-vortex-a)) 80deg,
|
|
515
|
+
rgb(var(--dsc-vortex-b)) 250deg,
|
|
516
|
+
rgb(var(--dsc-vortex-b) / 0) 340deg,
|
|
517
|
+
rgb(var(--dsc-vortex-a) / 0) 360deg
|
|
518
|
+
);
|
|
519
|
+
-webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2.5px));
|
|
520
|
+
mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2.5px));
|
|
521
|
+
animation: dscSpin 1.5s linear infinite;
|
|
522
|
+
/* 提示浏览器把这一层独立合成:旋转只走 composite,不整帧重绘父级 */
|
|
523
|
+
will-change: transform;
|
|
524
|
+
}
|
|
525
|
+
/* 内涡:反向、稍快的细弧,让静止截图也读得出「漏斗」而非一片渐变。
|
|
526
|
+
透明度压低(0.6/0.35):11px 直径上的 1.5px 细弧本身很小,高对比会让
|
|
527
|
+
亚像素抗锯齿随旋转闪烁。 */
|
|
528
|
+
.dsc-ring[data-motion='spin']::after {
|
|
529
|
+
content: '';
|
|
530
|
+
position: absolute;
|
|
531
|
+
inset: 3.5px;
|
|
532
|
+
border: 1.5px solid transparent;
|
|
533
|
+
border-top-color: rgb(var(--dsc-vortex-b) / 0.6);
|
|
534
|
+
border-left-color: rgb(var(--dsc-vortex-a) / 0.35);
|
|
535
|
+
border-radius: 50%;
|
|
536
|
+
animation: dscSpin 1.6s linear infinite reverse;
|
|
537
|
+
}
|
|
538
|
+
.dsc-ring[data-motion='breathe'] {
|
|
539
|
+
border-color: rgb(var(--dsc-rgb) / 0.85);
|
|
540
|
+
animation: dscBreathe 1.9s ease-in-out infinite;
|
|
541
|
+
}
|
|
542
|
+
.dsc-ring[data-motion='static'] {
|
|
543
|
+
border-color: rgb(var(--dsc-rgb) / 0.5);
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
@keyframes dscSpin {
|
|
547
|
+
to { transform: rotate(360deg); }
|
|
548
|
+
}
|
|
549
|
+
@keyframes dscBreathe {
|
|
550
|
+
0%, 100% { opacity: 0.3; transform: scale(0.96); }
|
|
551
|
+
50% { opacity: 1; transform: scale(1); }
|
|
552
|
+
}
|
|
553
|
+
@keyframes dscGlow {
|
|
554
|
+
0%, 100% { box-shadow: 0 0 0 2px rgb(var(--dsc-rgb) / 0.1), 0 0 6px rgb(var(--dsc-rgb) / 0.18); }
|
|
555
|
+
50% { box-shadow: 0 0 0 2px rgb(var(--dsc-rgb) / 0.14), 0 0 9px rgb(var(--dsc-rgb) / 0.3); }
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
@media (prefers-reduced-motion: reduce) {
|
|
559
|
+
.dsc-status,
|
|
560
|
+
.dsc-ring,
|
|
561
|
+
.dsc-ring::after { animation: none !important; }
|
|
562
|
+
.dsc-status[data-status='running'] { box-shadow: 0 0 0 2px rgb(var(--dsc-rgb) / 0.16); }
|
|
563
|
+
.dsc-ring[data-motion='breathe'] { opacity: 0.7; transform: none; }
|
|
564
|
+
}
|
|
565
|
+
`,hp=N.memo(function({status:e,label:n,className:a,sessionId:r}){const{t:i}=at(),l=ak[e]??ak.done,{Icon:c,ring:d}=l,p=n??i(l.label);if(e==="running"){const h=r!==void 0?_P(r):void 0,m=h!==void 0?yl(h,.78,.62):void 0;return g.jsxs(g.Fragment,{children:[g.jsx("style",{href:"deepseekcode-session-status",precedence:"default",children:rk}),g.jsx("span",{"data-status":"running",className:Ke("dsc-status relative flex h-[18px] w-[18px] shrink-0 items-center justify-center rounded-[5px] border transition-colors",a),style:m?{"--dsc-rgb":m}:void 0,title:p,"aria-label":p,role:"img",children:g.jsx(r6,{size:15,rate:0,hue:h})})]})}return g.jsxs(g.Fragment,{children:[g.jsx("style",{href:"deepseekcode-session-status",precedence:"default",children:rk}),g.jsxs("span",{"data-status":e,className:Ke("dsc-status relative flex h-[18px] w-[18px] shrink-0 items-center justify-center rounded-[5px] border transition-colors",a),title:p,"aria-label":p,role:"img",children:[d&&g.jsx("span",{className:"dsc-ring","data-motion":d,"aria-hidden":"true"}),g.jsx(c,{size:e==="done"?13:12,strokeWidth:e==="done"?2.8:2.2,"aria-hidden":"true",className:"relative"})]})]})});N.createContext(null);function Yp({isOpen:t,onClose:e,title:n,children:a,size:r="md",className:i}){if(N.useEffect(()=>{const c=d=>{d.key==="Escape"&&(d.preventDefault(),d.stopPropagation(),e())};return t&&(document.addEventListener("keydown",c),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",c),document.body.style.overflow=""}},[t,e]),!t)return null;const l={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl","2xl":"max-w-3xl","3xl":"max-w-5xl"};return g.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center overflow-hidden p-4",children:[g.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:e}),g.jsxs("div",{className:Ke("relative w-full mx-4 bg-dark-surface border border-dark-border rounded-xl shadow-2xl animate-fade-in","max-h-[calc(100vh-2rem)] flex flex-col overflow-hidden",l[r],i),children:[n&&g.jsxs("div",{className:"flex shrink-0 items-center justify-between px-6 py-4 border-b border-dark-border",children:[g.jsx("h2",{className:"text-lg font-semibold text-dark-text",children:n}),g.jsx("button",{onClick:e,"aria-label":"Close",className:"p-1 rounded-lg text-dark-muted hover:text-dark-text hover:bg-dark-hover transition-colors",children:g.jsx(yn,{className:"w-5 h-5","aria-hidden":"true"})})]}),g.jsx("div",{className:"min-h-0 overflow-y-auto custom-scrollbar p-6",children:a})]})]})}function oF({isOpen:t,onClose:e,onConfirm:n,title:a,message:r,confirmText:i,cancelText:l,variant:c="default"}){const{t:d}=at(),p=()=>{n(),e()};return g.jsxs(Yp,{isOpen:t,onClose:e,title:a??d("common.confirm"),size:"sm",children:[g.jsx("p",{className:"text-dark-muted mb-6",children:r}),g.jsxs("div",{className:"flex gap-3 justify-end",children:[g.jsx("button",{onClick:e,className:"px-4 py-2 rounded-lg border border-dark-border text-dark-text hover:bg-dark-hover transition-colors",children:l??d("common.cancel")}),g.jsx("button",{onClick:p,className:Ke("px-4 py-2 rounded-lg text-white transition-colors",c==="danger"?"bg-accent-red hover:bg-accent-red/90":"bg-accent-blue hover:bg-accent-blue/90"),children:i??d("common.confirm")})]})]})}function sk({children:t,variant:e="default",size:n="md",className:a}){const r={default:"bg-dark-border text-dark-muted",success:"bg-accent-green/20 text-accent-green",warning:"bg-accent-yellow/20 text-accent-yellow",error:"bg-accent-red/20 text-accent-red",info:"bg-accent-blue/20 text-accent-blue"},i={sm:"px-1.5 py-0.5 text-[10px]",md:"px-2 py-0.5 text-xs"};return g.jsx("span",{className:Ke("inline-flex items-center rounded-full font-medium",r[e],i[n],a),children:t})}const CP={string:"templates.typeString",number:"templates.typeNumber",select:"templates.typeSelect",boolean:"templates.typeBoolean",folder:"templates.typeFolder",connector:"templates.typeConnector"};function AP({template:t,onCancel:e,onSubmit:n,submitLabel:a,busy:r=!1,autoValues:i,preflightSummary:l,submitIcon:c}){const{t:d}=at(),p=a??d("templates.launch"),h=t.inputs??[],m=N.useMemo(()=>{const T={};for(const L of h){const D=i==null?void 0:i[L.name];if(D&&typeof D.value=="string"&&D.value!==""){T[L.name]=L.type==="number"?Number(D.value):D.value;continue}L.default!==void 0&&L.default!==null&&(T[L.name]=L.default)}return T},[h,i]),[b,x]=N.useState(m),[w,S]=N.useState({});if(h.length===0)return g.jsxs("div",{className:"space-y-4",children:[l,g.jsx("div",{className:"text-sm text-dark-muted",children:d("templates.noInputsNeeded")}),g.jsx("div",{className:"text-xs text-dark-muted/80 break-all",children:t.description||"—"}),g.jsxs("div",{className:"flex justify-end gap-3",children:[g.jsx("button",{onClick:e,className:"px-4 py-2 rounded-lg border border-dark-border text-dark-text hover:bg-dark-hover transition-colors",children:d("templates.cancel")}),g.jsx("button",{onClick:()=>n({}),disabled:r,className:"px-4 py-2 rounded-lg bg-accent-blue text-white hover:bg-accent-blue/90 disabled:opacity-50 transition-colors",children:r?d("templates.starting"):g.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[p,c]})})]})]});const C=(T,L)=>{x(D=>({...D,[T]:L})),S(D=>{if(!D[T])return D;const B={...D};return delete B[T],B})},E=()=>{const T={},L={};for(const D of h){let B=b[D.name];typeof B=="string"&&(B=B.trim());const H=B==null||B==="";if(D.required&&H){T[D.name]=d("templates.requiredError");continue}if(!H)if(D.type==="number"){const K=Number(B);if(!Number.isFinite(K)){T[D.name]=d("templates.numberError");continue}L[D.name]=K}else L[D.name]=B}if(Object.keys(T).length>0){S(T);return}n(L)};return g.jsxs("div",{className:"space-y-4",children:[l,g.jsx("div",{className:"text-sm text-dark-muted",children:t.description||""}),h.map(T=>{const L=i==null?void 0:i[T.name],D=!!L&&typeof L.value=="string"&&L.value!=="";return g.jsxs("div",{children:[g.jsxs("label",{className:"flex items-center gap-1.5 text-sm text-dark-text mb-1.5",children:[g.jsx("span",{children:T.label||T.name}),T.required&&g.jsx("span",{className:"text-accent-red",children:"*"}),D&&g.jsx("span",{className:"text-[9px] px-1 py-px rounded bg-accent-blue/15 text-accent-blue font-medium uppercase tracking-wide",children:d("templates.autoDetected")}),T.type!=="boolean"&&g.jsx("span",{className:"text-[10px] text-dark-muted/70",children:d(CP[T.type])})]}),TP(T,b[T.name],C,d("templates.selectNone")),D&&(L==null?void 0:L.label)&&g.jsxs("div",{className:"mt-1 text-[11px] text-dark-muted/80",children:[L.label,b[T.name]===L.value?"":d("templates.manualInput")]}),T.description&&g.jsx("div",{className:"mt-1 text-xs text-dark-muted/70",children:T.description}),w[T.name]&&g.jsx("div",{className:"mt-1 text-xs text-accent-red",children:w[T.name]})]},T.name)}),g.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[g.jsx("button",{onClick:e,className:"px-4 py-2 rounded-lg border border-dark-border text-dark-text hover:bg-dark-hover transition-colors",children:d("templates.cancel")}),g.jsx("button",{onClick:E,disabled:r,className:"px-4 py-2 rounded-lg bg-accent-blue text-white hover:bg-accent-blue/90 disabled:opacity-50 transition-colors",children:r?d("templates.starting"):g.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[p,c]})})]})]})}function TP(t,e,n,a){const r="w-full px-3 py-2 rounded-lg bg-dark-bg border border-dark-border text-sm text-dark-text focus:outline-none focus:ring-1 focus:ring-accent-blue placeholder:text-dark-muted/50";switch(t.type){case"select":return g.jsxs("select",{value:typeof e=="string"?e:t.default||"",onChange:i=>n(t.name,i.target.value),className:r,children:[!t.required&&g.jsx("option",{value:"",children:a}),(t.options||[]).map(i=>g.jsx("option",{value:i,children:i},i))]});case"boolean":return g.jsx("button",{type:"button",onClick:()=>n(t.name,e!==!0),className:Ke("h-6 w-11 rounded-full transition-colors relative flex items-center px-0.5",e===!0?"bg-accent-blue":"bg-dark-border"),"aria-pressed":e===!0,children:g.jsx("span",{className:Ke("h-5 w-5 rounded-full bg-white transition-transform",e===!0&&"translate-x-5")})});case"number":return g.jsx("input",{type:"number",value:typeof e=="number"||typeof e=="string"?e:"",onChange:i=>n(t.name,i.target.value),placeholder:typeof t.default=="number"?String(t.default):"0",className:r});default:return g.jsx("input",{type:"text",value:typeof e=="string"?e:"",onChange:i=>n(t.name,i.target.value),placeholder:typeof t.default=="string"?t.default:"",className:r})}}function EP({collapsed:t=!1,onDirect:e,onStartTemplate:n,onManageTemplates:a}){const{t:r}=at(),[i,l]=N.useState(!1),[c,d]=N.useState({kind:"list"}),[p,h]=N.useState([]),[m,b]=N.useState(!1),[x,w]=N.useState(""),[S,C]=N.useState({top:0,left:0}),E=N.useRef(null),T=N.useCallback(()=>{d({kind:"list"}),l(!0)},[]);N.useEffect(()=>{var U;if(!i)return;const K=(U=E.current)==null?void 0:U.getBoundingClientRect();K&&C({top:K.bottom+6,left:Math.max(8,K.left)})},[i,t]),N.useEffect(()=>{if(!i||c.kind!=="list")return;let K=!1;return b(!0),w(""),Je.templates.list().then(U=>{K||(U.success&&U.data?h(U.data):w(U.error||r("templates.loadFailed")))}).catch(()=>{K||w(r("templates.loadFailed"))}).finally(()=>{K||b(!1)}),()=>{K=!0}},[i,c.kind]);const L=N.useMemo(()=>{const K=new Map;for(const U of p){const q=U.category||r("templates.uncategorized"),re=K.get(q)||[];re.push(U),K.set(q,re)}return[...K.entries()]},[p,r]),D=async K=>{const U=await Je.templates.get(K.id);U.success&&U.data?d({kind:"form",template:U.data}):w(U.error||r("templates.loadFailed"))},B=K=>{c.kind==="form"&&(n(c.template,K),l(!1),d({kind:"list"}))},H={top:S.top,left:S.left,width:Math.min(360,typeof window<"u"?window.innerWidth-16:360)};return g.jsxs("div",{ref:E,className:"relative",children:[g.jsx("div",{className:"flex",children:t?g.jsx("button",{onClick:T,className:"btn btn-primary w-full !px-0 aspect-square",title:r("templates.newSession"),"aria-label":r("templates.newSession"),children:g.jsx(vo,{size:16,"aria-hidden":"true"})}):g.jsxs(g.Fragment,{children:[g.jsxs("button",{onClick:e,className:"btn btn-primary flex-1 !px-3 py-2 rounded-l-lg",children:[g.jsx(vo,{size:15,"aria-hidden":"true"}),r("templates.newSession")]}),g.jsx("button",{onClick:()=>i?l(!1):T(),className:"px-2.5 rounded-r-lg bg-accent-blue text-white border-l border-white/25 hover:opacity-95 flex items-center",title:r("templates.newFromTemplateTitle"),"aria-label":r("templates.chooseTemplateAria"),children:g.jsx(_s,{size:13,"aria-hidden":"true"})})]})}),i&&g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>l(!1)}),g.jsx("div",{className:"fixed z-50 bg-dark-surface border border-dark-border rounded-xl shadow-2xl p-1.5 max-h-[70vh] overflow-y-auto custom-scrollbar",style:H,children:c.kind==="form"?g.jsxs("div",{className:"p-2",children:[g.jsxs("button",{onClick:()=>d({kind:"list"}),className:"mb-2 inline-flex items-center gap-1 text-xs text-dark-muted hover:text-dark-text transition-colors",children:[g.jsx(Fk,{className:"w-3.5 h-3.5"})," ",r("templates.backToList")]}),g.jsx("div",{className:"text-sm font-medium text-dark-text mb-3",children:c.template.name}),g.jsx(AP,{template:c.template,onCancel:()=>d({kind:"list"}),onSubmit:B,submitLabel:r("templates.launch")})]}):g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"px-2 py-1 text-[10.5px] uppercase tracking-[0.06em] text-dark-muted/70 font-semibold",children:r("templates.startSessionHeader")}),g.jsxs("button",{onClick:()=>{l(!1),e()},className:"w-full flex items-center gap-2.5 px-2 py-2 rounded-lg hover:bg-dark-hover text-left",children:[g.jsx("span",{className:"w-6 h-6 rounded-md bg-accent-blue/10 border border-accent-blue/30 grid place-items-center text-accent-blue shrink-0",children:g.jsx(m1,{className:"w-3.5 h-3.5"})}),g.jsxs("span",{className:"min-w-0",children:[g.jsx("span",{className:"block text-[13px] font-medium text-dark-text",children:r("templates.directChat")}),g.jsx("span",{className:"block text-[11px] text-dark-muted truncate",children:r("templates.directChatHint")})]})]}),m&&g.jsxs("div",{className:"flex items-center gap-2 px-2 py-3 text-xs text-dark-muted",children:[g.jsx(Hn,{className:"w-3.5 h-3.5 animate-spin"})," ",r("templates.loadingTemplates")]}),x&&!m&&g.jsx("div",{className:"px-2 py-2 text-xs text-accent-red",children:x}),!m&&!x&&L.length===0&&g.jsx("div",{className:"px-2 py-2 text-xs text-dark-muted",children:r("templates.noTemplatesYet")}),L.map(([K,U])=>g.jsxs("div",{className:"mt-1",children:[g.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1",children:[g.jsx(Qm,{className:"w-3 h-3 text-dark-muted/70"}),g.jsx("span",{className:"text-[10px] uppercase tracking-[0.06em] text-dark-muted/70 font-semibold",children:K}),g.jsx(sk,{size:"sm",children:U.length})]}),U.map(q=>g.jsxs("button",{onClick:()=>void D(q),className:"w-full flex items-center gap-2.5 px-2 py-2 rounded-lg hover:bg-dark-hover text-left",children:[g.jsx("span",{className:"w-6 h-6 rounded-md bg-dark-border/60 border border-dark-border grid place-items-center text-dark-muted shrink-0",children:g.jsx(Qm,{className:"w-3.5 h-3.5"})}),g.jsxs("span",{className:"min-w-0 flex-1",children:[g.jsxs("span",{className:"flex items-center gap-1.5",children:[g.jsx("span",{className:"block text-[13px] font-medium text-dark-text truncate",children:q.name}),g.jsxs(sk,{size:"sm",variant:"info",children:["v",q.version]})]}),q.description&&g.jsx("span",{className:"block text-[11px] text-dark-muted truncate",children:q.description})]})]},q.id))]},K)),g.jsx("div",{className:"border-t border-dark-border mt-1 pt-1",children:g.jsx("button",{onClick:()=>{l(!1),a()},className:"w-full px-2 py-1.5 rounded-lg hover:bg-dark-hover text-left text-[12.5px] text-dark-muted",children:r("templates.libraryMenu")})})]})})]})]})}const Hc=10;function NP({isOpen:t,onClose:e,onSwitchSession:n}){const{t:a}=at(),r=Ge(U=>U.sessionTabs),i=Ge(U=>U.historySessions),l=Ge(U=>U.activeSessionId),c=Me(U=>U.generatingSessions),[d,p]=N.useState(0),[h,m]=N.useState(""),b=N.useRef(null);N.useEffect(()=>{if(!t)return;m(""),p(0);const U=window.setTimeout(()=>{var q;return(q=b.current)==null?void 0:q.focus()},0);return()=>window.clearTimeout(U)},[t]),N.useEffect(()=>{p(0)},[h]);const x=N.useMemo(()=>{const U=new Map;for(const q of r)U.set(q.id,q);for(const q of i)U.has(q.id)||U.set(q.id,q);return[...U.values()].sort((q,re)=>(re.lastActiveAt??re.createdAt??0)-(q.lastActiveAt??q.createdAt??0))},[r,i]),w=h.trim().toLowerCase(),S=w.length>0,C=N.useMemo(()=>S?x.filter(U=>{const q=Jc(U);return U.title.toLowerCase().includes(w)||(U.project||"").toLowerCase().includes(w)||(q||"").toLowerCase().includes(w)}):x,[x,w,S]),E=Math.max(1,Math.ceil(C.length/Hc)),T=Math.min(d,E-1),L=N.useMemo(()=>{if(S)return C;const U=T*Hc;return C.slice(U,U+Hc)},[C,S,T]),D=N.useMemo(()=>{const U=new Map;for(const q of L){const re=q.project||"default",_e=U.get(re)||[];_e.push(q),U.set(re,_e)}return Array.from(U.entries())},[L]),B=C.length===0?0:T*Hc+1,H=Math.min((T+1)*Hc,C.length),K=U=>c.includes(U.id)?"running":U.status||"done";return g.jsx(Yp,{isOpen:t,onClose:e,size:"2xl",title:g.jsxs("span",{className:"flex items-center gap-2",children:[g.jsx("span",{children:a("chat.sessionPickerTitle")}),x.length>0&&g.jsx("span",{className:"rounded-full bg-dark-hover px-2 py-0.5 font-mono text-[11px] font-normal text-dark-muted",children:S?`${C.length}/${x.length}`:x.length})]}),children:g.jsxs("div",{className:"flex flex-col gap-3",children:[g.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-dark-border/70 bg-dark-bg/45 px-2.5 py-1.5 focus-within:border-accent-blue/45",children:[g.jsx(g1,{size:13,className:"shrink-0 text-dark-muted","aria-hidden":"true"}),g.jsx("input",{ref:b,value:h,onChange:U=>m(U.target.value),className:"min-w-0 flex-1 bg-transparent text-xs text-dark-text placeholder:text-dark-muted/55 focus:outline-none",placeholder:a("nav.searchSessionsPlaceholder"),"aria-label":a("nav.searchSessions")}),h&&g.jsx("button",{onClick:()=>{var U;m(""),(U=b.current)==null||U.focus()},className:"rounded p-0.5 text-dark-muted hover:bg-dark-hover hover:text-dark-text","aria-label":a("nav.clearSessionSearch"),children:g.jsx(yn,{size:11,"aria-hidden":"true"})})]}),g.jsx("div",{className:"max-h-[min(58vh,520px)] min-h-[180px] overflow-y-auto custom-scrollbar rounded-lg border border-dark-border bg-dark-bg px-1.5 py-1",children:C.length===0?g.jsx("div",{className:"px-3 py-10 text-center text-xs text-dark-muted/60",children:a(S?"common.noResults":"chat.noSessions")}):D.map(([U,q])=>g.jsxs("div",{children:[g.jsxs("div",{className:"sticky top-0 z-10 -mx-1.5 flex items-center gap-1 border-b border-dark-border/40 bg-dark-bg px-3.5 py-1.5 text-[10px] text-dark-muted/70",children:[g.jsx(qk,{size:10,"aria-hidden":"true",className:"shrink-0 opacity-60"}),g.jsx("span",{className:"truncate",children:U==="default"?a("nav.mySessions"):U}),g.jsx("span",{className:"ml-auto text-[9px] text-dark-muted/40",children:q.length})]}),g.jsx("div",{className:"space-y-0.5 py-0.5",children:q.map(re=>{const _e=re.id===l,G=K(re),me=e1(re.lastActiveAt??re.createdAt,Date.now(),a),ge=Jc(re),ye=t5(re.title,ge);return g.jsxs("button",{onClick:()=>{n(re.id),e()},title:a("chat.clickToOpenSession"),className:`group flex w-full cursor-pointer items-center gap-2.5 rounded-lg px-2.5 py-2 text-left text-[13px] transition-colors ${_e?"bg-accent-blue/10 font-medium text-accent-blue":"text-dark-muted hover:bg-dark-hover/60 hover:text-dark-text"}`,children:[g.jsx(hp,{status:G,sessionId:re.id}),g.jsxs("span",{className:"min-w-0 flex-1",children:[g.jsx("span",{className:"flex items-center gap-1.5",children:g.jsx("span",{className:"min-w-0 flex-1 truncate",children:re.title})}),g.jsxs("span",{className:"mt-0.5 flex items-center gap-2 text-[11px] leading-tight text-dark-muted/60",children:[ye&&g.jsx("span",{className:"min-w-0 flex-1 truncate",children:ge}),g.jsx("span",{className:`shrink-0 ${ye?"":"ml-auto"}`,children:me})]})]})]},re.id)})})]},U))}),g.jsxs("div",{className:"flex items-center justify-between text-xs text-dark-muted",children:[g.jsx("span",{className:"tabular-nums",children:S?a("common.pageInfo",{start:1,end:C.length,total:C.length}):a("common.pageInfo",{start:B,end:H,total:C.length})}),!S&&E>1&&g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsxs("button",{onClick:()=>p(U=>Math.max(0,U-1)),disabled:T===0,className:"flex items-center gap-0.5 rounded-md border border-dark-border px-2 py-1 text-dark-muted transition-colors hover:bg-dark-hover hover:text-dark-text disabled:cursor-not-allowed disabled:opacity-40",children:[g.jsx(h1,{size:13,"aria-hidden":"true"}),a("common.prevPage")]}),g.jsxs("span",{className:"min-w-[48px] text-center font-mono",children:[T+1,"/",E]}),g.jsxs("button",{onClick:()=>p(U=>Math.min(E-1,U+1)),disabled:T>=E-1,className:"flex items-center gap-0.5 rounded-md border border-dark-border px-2 py-1 text-dark-muted transition-colors hover:bg-dark-hover hover:text-dark-text disabled:cursor-not-allowed disabled:opacity-40",children:[a("common.nextPage"),g.jsx(Vk,{size:13,"aria-hidden":"true"})]})]})]})]})})}function RP(){return{activities:{},order:[],taskTitles:{},artifacts:[]}}const ba=Nn()(t=>({bySession:{},applyEvent:(e,n)=>t(a=>{const r=a.bySession[e]??RP();switch(n.type){case"activity_started":return r.activities[n.activity.id]?a:{...a,bySession:{...a.bySession,[e]:{...r,activities:{...r.activities,[n.activity.id]:n.activity},order:[...r.order,n.activity.id]}}};case"activity_updated":{const i=r.activities[n.activityId];return i?{...a,bySession:{...a.bySession,[e]:{...r,activities:{...r.activities,[n.activityId]:{...i,...n.patch}}}}}:a}case"activity_finalized":{const i=r.activities[n.activityId];return i?{...a,bySession:{...a.bySession,[e]:{...r,activities:{...r.activities,[n.activityId]:{...i,status:n.status,endedAt:n.endedAt}}}}}:a}case"artifact_produced":return r.artifacts.some(i=>i.id===n.artifact.id)?a:{...a,bySession:{...a.bySession,[e]:{...r,artifacts:[...r.artifacts,n.artifact]}}};case"task_title_set":return{...a,bySession:{...a.bySession,[e]:{...r,taskTitles:{...r.taskTitles,[n.messageId]:n.title}}}};case"next_action_set":return{...a,bySession:{...a.bySession,[e]:{...r,nextAction:n.text??void 0}}};default:return a}}),resetSession:e=>t(n=>{if(!n.bySession[e])return n;const a={...n.bySession};return delete a[e],{bySession:a}}),finalizeSession:(e,n)=>t(a=>{const r=a.bySession[e];if(!r)return a;const i=Date.now(),l=["pending","running","paused","waiting_user"];let c=!1;const d={};for(const[p,h]of Object.entries(r.activities))l.includes(h.status)?(d[p]={...h,status:n,endedAt:i},c=!0):d[p]=h;return c?{...a,bySession:{...a.bySession,[e]:{...r,activities:d}}}:a}),markStatus:(e,n,a)=>t(r=>{const i=r.bySession[e];if(!i)return r;let l=!1;const c={};for(const[d,p]of Object.entries(i.activities))n.includes(p.status)?(c[d]={...p,status:a},l=!0):c[d]=p;return l?{...r,bySession:{...r.bySession,[e]:{...i,activities:c}}}:r})}));function DP(t,e){if(!e)return;const n=t.bySession[e];if(n)for(let a=n.order.length-1;a>=0;a--){const r=n.order[a];if(!r)continue;const i=n.activities[r];if(i&&(i.status==="running"||i.status==="waiting_user"||i.status==="paused"||i.status==="blocked"))return i}}const ik=[];function s6(t){const e=ba(a=>{var r;return t?(r=a.bySession[t])==null?void 0:r.taskTitles:void 0}),n=Me(a=>t?a.messagesBySession[t]??ik:ik);if(!t||!e)return null;for(let a=n.length-1;a>=0;a--){const r=n[a];if(!r||r.type!=="assistant")continue;const i=e[r.id];if(i)return i}return null}const mp=["assistants","templates","plugins","connectors","skills","channels"];function MP(t,e=[]){const n=mp.filter(r=>!e.includes(r)),a=t.filter(r=>!mp.includes(r));return[...n,...a]}const ui=Nn()(Ri(t=>({pinned:mp,removedDefaults:[],moreExpanded:!1,morePinned:!1,collapsedProjects:[],togglePin:e=>t(n=>{const a=mp.includes(e);return n.pinned.includes(e)?{pinned:n.pinned.filter(r=>r!==e),removedDefaults:a&&!n.removedDefaults.includes(e)?[...n.removedDefaults,e]:n.removedDefaults}:{pinned:[...n.pinned,e],removedDefaults:n.removedDefaults.filter(r=>r!==e)}}),setMoreExpanded:e=>t({moreExpanded:e}),toggleMorePinned:()=>t(e=>({morePinned:!e.morePinned})),toggleProjectCollapsed:e=>t(n=>({collapsedProjects:n.collapsedProjects.includes(e)?n.collapsedProjects.filter(a=>a!==e):[...n.collapsedProjects,e]}))}),{name:"deepseekcode-nav-storage",merge:(t,e)=>{const n=t??{},a=n.removedDefaults??[];return{...e,...n,pinned:MP(n.pinned??[],a),removedDefaults:a,collapsedProjects:n.collapsedProjects??[]}}})),_0=5,OP=10,LP=10;function jP({sessionId:t,fallback:e}){const n=s6(t);return g.jsx("span",{className:"min-w-0 flex-1 truncate",title:n??e,children:n??e})}const ok=["chat","plan","agentflow"],lk=N.memo(function({collapsed:e,onToggleCollapse:n,tabs:a,activeTab:r,onTabChange:i,isConnected:l,onNewSession:c,onStartTemplate:d,onManageTemplates:p,onSwitchSession:h,onCloseSession:m,onRenameSession:b,getTabTitle:x,onNewSessionInDir:w}){const{t:S}=at(),C=Ge(se=>se.sessionTabs),E=Ge(se=>se.activeSessionId),T=Ge(se=>se.historySessions),L=Ge(se=>se.restoreHistorySession),D=Ge(se=>se.removeHistorySession),B=Ge(se=>se.sessionWorkspaceDirs),[H,K]=N.useState(!1),[U,q]=N.useState(!1),[re,_e]=N.useState(null),[G,me]=N.useState(""),[ge,ye]=N.useState(""),[P,oe]=N.useState({}),he=N.useRef(null),ke=ui(se=>se.pinned),Be=ui(se=>se.moreExpanded),Pe=ui(se=>se.morePinned),He=ui(se=>se.togglePin),$e=ui(se=>se.setMoreExpanded),ft=ui(se=>se.toggleMorePinned),tn=ui(se=>se.collapsedProjects),Kn=ui(se=>se.toggleProjectCollapsed),Dn=N.useMemo(()=>ke.filter(se=>!ok.includes(se)).map(se=>a.find(Ce=>Ce.id===se)).filter(se=>!!se),[a,ke]),Un=N.useMemo(()=>a.filter(se=>!ok.includes(se.id)&&!ke.includes(se.id)),[a,ke]),Ye=N.useCallback((se,Ce)=>{_e(se),me(Ce),setTimeout(()=>{var ht;return(ht=he.current)==null?void 0:ht.select()},50)},[]),{state:cn,open:oa,openAt:la,close:$a}=$S(),un=Jg(3),Le=Jg(2),cr=N.useCallback((se,Ce)=>{const ht=(B[Ce.id]||"").trim();oa(se,{kind:"session",id:Ce.id,title:Ce.title,dir:ht||void 0},{height:un})},[B,oa]),ca=N.useCallback((se,Ce,ht)=>{if(Ce==="default")return;const Fe=ht.map(wt=>(B[wt.id]||"").trim()).find(Boolean);oa(se,{kind:"project",id:Ce,dir:Fe||void 0},{height:Le})},[B,oa]),wr=N.useCallback((se,Ce,ht)=>{if(Ce==="default")return;const Fe=se.currentTarget.getBoundingClientRect(),wt=ht.map(Dt=>(B[Dt.id]||"").trim()).find(Boolean);la(Fe.right,Fe.bottom,{kind:"project",id:Ce,dir:wt||void 0},{height:Le})},[B,la]),Sa=N.useCallback(se=>{se&&B0.openFolder(se).then(Ce=>{Ce.ok||ut.error(Ce.error||S("chat.openFolderFailed"),5e3)})},[S]),_a=N.useCallback(()=>{re&&G.trim()&&b(re,G.trim()),_e(null)},[re,G,b]),kr=N.useCallback((se,Ce)=>{var ua;const ht=Me.getState().getMessages(se),Fe=[];Fe.push(`# ${Ce||S("nav.chat")}`),Fe.push(""),Fe.push(`> ${S("chat.exportMd")} · ${new Date().toLocaleString()}`),Fe.push(""),Fe.push("---"),Fe.push(""),(!ht||ht.length===0)&&(Fe.push(S("chat.noSessions")),Fe.push(""));for(const Ne of ht){if(Ne.deleted)continue;const Rt=Ne.type==="user"?S("chat.you"):S("chat.assistantLabel");if(Fe.push(`## ${Rt} · ${new Date(Ne.timestamp).toLocaleString()}`),Fe.push(""),Ne.thinking&&Ne.thinking.trim()&&(Fe.push("<details>"),Fe.push(`<summary>💭 ${S("chat.thoughtProcess")}</summary>`),Fe.push(""),Fe.push(Ne.thinking.trim()),Fe.push(""),Fe.push("</details>"),Fe.push("")),Ne.content&&Ne.content.trim()&&(Fe.push(Ne.content.trim()),Fe.push("")),Ne.steps&&Ne.steps.length>0){Fe.push(`**${S("chat.runningSteps")}:**`),Fe.push("");for(const Ft of Ne.steps){if(Fe.push(`- **${Ft.title}**${Ft.status?` (\`${Ft.status}\`)`:""}`),Ft.thought&&Fe.push(` - 💭 ${Ft.thought}`),(ua=Ft.toolCalls)!=null&&ua.length)for(const In of Ft.toolCalls)Fe.push(` - 🛠 \`${In.name}\``);Ft.result&&Fe.push(` - ${Ft.result}`)}Fe.push("")}Fe.push("---"),Fe.push("")}const wt=new Blob([Fe.join(`
|
|
566
|
+
`)],{type:"text/markdown;charset=utf-8"}),Dt=URL.createObjectURL(wt),dn=document.createElement("a");dn.href=Dt,dn.download=`${(Ce||"session").replace(/[\\/:*?"<>|]/g,"_").slice(0,80)}.md`,dn.click(),URL.revokeObjectURL(Dt)},[S]),ur=N.useCallback(se=>{L(se),De.setSessionId(se)},[L]),Fa=N.useCallback(se=>{h(se),r!=="chat"&&i("chat")},[h,i,r]),It=N.useCallback(se=>{!C.some(ht=>ht.id===se)?(ur(se),r!=="chat"&&i("chat")):Fa(se)},[C,ur,Fa,r,i]),Ha=Me(se=>se.generatingSessions),Sr=N.useCallback(se=>Ha.includes(se.id)?"running":se.status||"done",[Ha]),wn=ge.trim().length>0,Yn=N.useCallback((se,Ce)=>{oe(ht=>({...ht,[se]:(ht[se]??_0)+Math.min(OP,Ce)}))},[]),Ua=N.useCallback(se=>{oe(Ce=>({...Ce,[se]:_0}))},[]),Bn=N.useMemo(()=>{const se=new Map,Ce=ge.trim().toLowerCase(),Fe=[...Ce?C.filter(wt=>{const Dt=Jc(wt);return wt.title.toLowerCase().includes(Ce)||(wt.project||"").toLowerCase().includes(Ce)||(Dt||"").toLowerCase().includes(Ce)}):C].sort((wt,Dt)=>(Dt.lastActiveAt??Dt.createdAt??0)-(wt.lastActiveAt??wt.createdAt??0));for(const wt of Fe){const Dt=wt.project||"default",dn=se.get(Dt)||[];dn.push(wt),se.set(Dt,dn)}return Array.from(se.entries())},[C,ge]),Ds=N.useMemo(()=>{const se=new Set(C.map(Ce=>Ce.id));return C.length+T.filter(Ce=>!se.has(Ce.id)).length},[C,T]),Mi=(se,Ce)=>{const ht=r===se.id,Fe=se.iconComponent,wt=S(Ce?"nav.unpin":"nav.pin");return e?g.jsx("button",{onClick:()=>i(se.id),className:`flex h-9 w-9 items-center justify-center rounded-lg transition-colors ${ht?"bg-accent-blue/10 text-accent-blue":"text-dark-muted hover:bg-dark-hover hover:text-dark-text"}`,title:x(se.id,se.title),"aria-label":x(se.id,se.title),"aria-current":ht?"page":void 0,children:Fe&&g.jsx(Fe,{size:17,"aria-hidden":"true"})},se.id):g.jsxs("button",{onClick:()=>i(se.id),className:"side-nav-item group","data-active":ht,"aria-current":ht?"page":void 0,children:[Fe&&g.jsx(Fe,{size:15,"aria-hidden":"true",className:"shrink-0"}),g.jsx("span",{className:"truncate",children:x(se.id,se.title)}),g.jsx("span",{role:"button",tabIndex:0,onClick:Dt=>{Dt.stopPropagation(),He(se.id)},onKeyDown:Dt=>{(Dt.key==="Enter"||Dt.key===" ")&&(Dt.stopPropagation(),He(se.id))},className:"ml-auto shrink-0 rounded p-0.5 text-dark-muted/60 opacity-0 transition-all hover:bg-dark-bg hover:text-dark-text group-hover:opacity-100",title:wt,"aria-label":wt,children:g.jsx(Xm,{size:11,"aria-hidden":"true",className:Ce?"fill-current text-accent-blue":""})})]},se.id)},Zn=se=>{if(Un.length===0)return null;const Ce=`${S("nav.moreOptions")} (${Un.length})`,ht=S(Pe?"nav.unpinMore":"nav.pinMore"),Fe=e?g.jsx("button",{onClick:()=>$e(!Be),className:`flex h-9 w-9 items-center justify-center rounded-lg transition-colors ${Be?"bg-dark-hover text-dark-text":"text-dark-muted hover:bg-dark-hover hover:text-dark-text"}`,title:Ce,"aria-label":Ce,"aria-expanded":Be,children:g.jsx(Xd,{size:17,"aria-hidden":"true"})},"more"):g.jsxs("div",{className:"group flex items-center",children:[g.jsxs("button",{onClick:()=>$e(!Be),className:`side-nav-item flex-1 ${Be?"bg-dark-hover text-dark-text":""}`,"data-active":!1,"aria-expanded":Be,children:[g.jsx(Xd,{size:15,"aria-hidden":"true",className:"shrink-0"}),g.jsx("span",{className:"truncate",children:S("nav.moreOptions")}),g.jsx("span",{className:"ml-auto rounded bg-dark-bg px-1.5 py-px text-[10px] text-dark-muted/70",children:Un.length}),g.jsx(_s,{size:13,"aria-hidden":"true",className:`shrink-0 text-dark-muted/70 transition-transform duration-150 ${Be?"rotate-180":""}`})]}),g.jsx("span",{role:"button",tabIndex:0,onClick:wt=>{wt.stopPropagation(),ft()},onKeyDown:wt=>{(wt.key==="Enter"||wt.key===" ")&&(wt.stopPropagation(),ft())},className:"mr-1 shrink-0 rounded p-0.5 text-dark-muted/60 opacity-0 transition-all hover:bg-dark-bg hover:text-dark-text group-hover:opacity-100",title:ht,"aria-label":ht,children:g.jsx(Xm,{size:11,"aria-hidden":"true",className:Pe?"fill-current text-accent-blue":""})})]},"more");return g.jsx("div",{className:`${se?"mt-1 border-t border-dark-border/40 pt-1":"mt-1.5 border-t border-dark-border/40 pt-1.5"}`,children:Fe},"more-row")},nn=N.useMemo(()=>{if(!cn)return[];if(cn.data.kind==="session"){const{id:Ce,title:ht,dir:Fe}=cn.data;return[{id:"openFolder",label:S("nav.openFolder"),icon:z0,disabled:!Fe,onSelect:()=>Sa(Fe)},{id:"rename",label:S("chat.renameSession"),icon:Px,onSelect:()=>Ye(Ce,ht||"")},{id:"remove",label:S("chat.removeFromList"),icon:yn,disabled:C.length<=1,onSelect:()=>m(Ce)}]}const{dir:se}=cn.data;return[{id:"newTask",label:S("nav.newTask"),icon:vo,disabled:!se||!w,onSelect:()=>w==null?void 0:w(se||"")},{id:"openFolder",label:S("nav.openFolder"),icon:z0,disabled:!se,onSelect:()=>Sa(se)}]},[cn,S,Sa,Ye,C.length,m,w]);return g.jsxs("div",{className:"workbench-sidebar flex h-full flex-col",children:[g.jsxs("div",{className:`flex h-14 shrink-0 items-center gap-2.5 border-b border-dark-border/70 bg-dark-bg/20 ${e?"justify-center px-2":"px-4"}`,children:[g.jsx("img",{src:"/logo.svg",alt:"deepseekcode",className:"h-7 w-7 shadow-sm"}),!e&&g.jsx("span",{className:"flex-1 truncate text-[15px] font-semibold tracking-tight text-dark-text",children:"deepseekcode"}),g.jsx("button",{onClick:n,className:`rounded-md p-1.5 text-dark-muted transition-colors hover:bg-dark-hover hover:text-dark-text ${e?"hidden":""}`,title:S("nav.collapseSidebar"),"aria-label":S("nav.collapseSidebar"),children:g.jsx(r_,{size:16,"aria-hidden":"true"})})]}),g.jsx("div",{className:e?"p-2":"px-3 pt-3",children:d&&p?g.jsx(EP,{collapsed:e,onDirect:c,onStartTemplate:d,onManageTemplates:p}):g.jsxs("button",{onClick:c,className:"btn btn-primary w-full shadow-[0_8px_20px_rgb(var(--color-accent-blue)/0.14)]",children:[g.jsx(vo,{size:15,"aria-hidden":"true"}),S("chat.newSession")]})}),g.jsxs("div",{className:"flex-1 overflow-y-auto custom-scrollbar px-3 pb-2 min-h-0",children:[g.jsxs("nav",{className:"sticky top-0 z-10 border-b border-dark-border/50 bg-dark-surface pt-2",children:[(Dn.length>0||Pe)&&g.jsxs("div",{className:`space-y-0.5 ${e?"flex flex-col items-center":""}`,children:[Dn.map(se=>Mi(se,!0)),Pe&&Zn(!0)]}),!Pe&&Zn(!1)]}),Be&&Un.length>0&&g.jsx("div",{className:`space-y-0.5 border-b border-dark-border/50 bg-dark-surface pb-2 ${e?"flex flex-col items-center":""}`,children:Un.map(se=>Mi(se,!1))}),!e&&g.jsxs("div",{className:"pt-2",children:[g.jsxs("div",{className:"mb-2 flex items-center gap-2 rounded-lg border border-dark-border/70 bg-dark-bg/45 px-2.5 py-1.5 focus-within:border-accent-blue/45",children:[g.jsx(g1,{size:13,className:"shrink-0 text-dark-muted","aria-hidden":"true"}),g.jsx("input",{value:ge,onChange:se=>ye(se.target.value),className:"min-w-0 flex-1 bg-transparent text-xs text-dark-text placeholder:text-dark-muted/55 focus:outline-none",placeholder:S("nav.searchSessionsPlaceholder"),"aria-label":S("nav.searchSessions")}),ge&&g.jsx("button",{onClick:()=>ye(""),className:"rounded p-0.5 text-dark-muted hover:bg-dark-hover hover:text-dark-text","aria-label":S("nav.clearSessionSearch"),children:g.jsx(yn,{size:11,"aria-hidden":"true"})})]}),g.jsxs("div",{className:"side-group-label flex items-center justify-between",children:[g.jsx("span",{children:S("nav.sessions")}),T.length>0&&g.jsxs("button",{onClick:()=>K(se=>!se),className:"flex items-center gap-0.5 rounded px-1 py-0.5 text-dark-muted/70 transition-colors hover:text-dark-text",title:S("chat.sessionHistory"),"aria-expanded":H,children:[g.jsx(Bk,{size:11,"aria-hidden":"true"}),g.jsx(_s,{size:11,"aria-hidden":"true",className:`transition-transform ${H?"":"-rotate-90"}`})]})]}),g.jsxs("div",{className:"space-y-1.5",children:[Bn.map(([se,Ce])=>{const ht=!wn&&tn.includes(se),Fe=wn?Ce.length:Math.min(P[se]??_0,Ce.length);let wt=Ce.slice(0,Fe);const Dt=Ce.find(Ne=>Ne.id===E);Dt&&!wt.some(Ne=>Ne.id===Dt.id)&&(wt=[Dt,...wt]);const dn=Ce.length-wt.length,ua=!wn&&Fe>_0;return g.jsxs("div",{children:[g.jsxs("div",{role:"button",tabIndex:0,onClick:()=>Kn(se),onKeyDown:Ne=>{(Ne.key==="Enter"||Ne.key===" ")&&(Ne.preventDefault(),Kn(se))},onContextMenu:Ne=>ca(Ne,se,Ce),className:"group/hdr flex w-full cursor-pointer items-center gap-1 rounded px-2 py-0.5 text-[10px] text-dark-muted/70 transition-colors hover:bg-dark-hover/40 hover:text-dark-text","aria-expanded":!ht,title:S(ht?"nav.expandGroup":"nav.collapseGroup"),children:[g.jsx(qk,{size:10,"aria-hidden":"true",className:"shrink-0 opacity-60"}),g.jsx("span",{className:"truncate",children:se==="default"?S("nav.mySessions"):se}),g.jsx(_s,{size:10,"aria-hidden":"true",className:`shrink-0 opacity-60 transition-transform duration-150 ${ht?"-rotate-90":""}`}),se!=="default"&&g.jsxs("span",{className:"ml-auto flex shrink-0 items-center gap-0.5",children:[w&&g.jsx("span",{role:"button",tabIndex:0,"aria-label":S("nav.newTask"),title:S("nav.newTask"),onClick:Ne=>{Ne.stopPropagation();const Rt=Ce.map(Ft=>(B[Ft.id]||"").trim()).find(Boolean);Rt&&w(Rt)},onKeyDown:Ne=>{if(Ne.key==="Enter"||Ne.key===" "){Ne.stopPropagation();const Rt=Ce.map(Ft=>(B[Ft.id]||"").trim()).find(Boolean);Rt&&w(Rt)}},className:"rounded p-px opacity-0 transition-all hover:bg-dark-bg hover:text-accent-blue group-hover/hdr:opacity-100",children:g.jsx(vo,{size:10,"aria-hidden":"true"})}),g.jsx("span",{role:"button",tabIndex:0,"aria-label":S("nav.groupActions"),title:S("nav.groupActions"),onClick:Ne=>ca(Ne,se,Ce),onKeyDown:Ne=>{(Ne.key==="Enter"||Ne.key===" ")&&(Ne.stopPropagation(),wr(Ne,se,Ce))},className:"rounded p-px opacity-0 transition-all hover:bg-dark-bg hover:text-dark-text group-hover/hdr:opacity-100",children:g.jsx(Xd,{size:10,"aria-hidden":"true"})})]}),g.jsx("span",{className:`shrink-0 text-[9px] text-dark-muted/40 ${se==="default"?"ml-auto":""}`,children:Ce.length})]}),!ht&&g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"space-y-0.5",children:wt.map(Ne=>{const Rt=Ne.id===E,Ft=re===Ne.id,In=Sr(Ne),Oi=e1(Ne.lastActiveAt??Ne.createdAt,Date.now(),S),_r=Jc(Ne),dr=t5(Ne.title,_r);return g.jsxs("div",{onClick:()=>!Ft&&Fa(Ne.id),onDoubleClick:()=>Ye(Ne.id,Ne.title),onContextMenu:an=>cr(an,Ne),className:`group relative flex cursor-pointer items-center gap-2 rounded-lg px-2.5 py-[6px] text-[13px] transition-colors ${Rt?"bg-dark-hover font-medium text-dark-text":"text-dark-muted hover:bg-dark-hover/60 hover:text-dark-text"}`,children:[Rt&&g.jsx("span",{className:"absolute left-0 top-1/2 h-4 w-[2px] -translate-y-1/2 rounded-full bg-accent-blue","aria-hidden":"true"}),g.jsx(hp,{status:In,sessionId:Ne.id}),Ft?g.jsx("input",{ref:he,value:G,onChange:an=>me(an.target.value),onBlur:_a,onKeyDown:an=>{an.key==="Enter"?_a():an.key==="Escape"&&_e(null)},onClick:an=>an.stopPropagation(),className:"min-w-0 flex-1 rounded border border-accent-blue bg-dark-bg px-1 py-0.5 text-xs text-dark-text outline-none",autoFocus:!0}):g.jsxs("span",{className:"min-w-0 flex-1",children:[g.jsx("span",{className:"flex items-center gap-1.5",children:g.jsx(jP,{sessionId:Ne.id,fallback:Ne.title})}),g.jsxs("span",{className:"mt-0.5 flex items-center gap-2 text-[11px] leading-tight text-dark-muted/50",children:[dr&&g.jsx("span",{className:"min-w-0 flex-1 truncate",children:_r}),g.jsx("span",{className:`shrink-0 ${dr?"":"ml-auto"}`,children:Oi})]})]}),!Ft&&g.jsxs(g.Fragment,{children:[g.jsx("button",{onClick:an=>{an.stopPropagation(),Ye(Ne.id,Ne.title)},className:"shrink-0 rounded p-0.5 opacity-0 transition-all hover:bg-dark-bg group-hover:opacity-100",title:S("chat.renameSession"),"aria-label":S("chat.renameSession"),children:g.jsx(Px,{size:11,"aria-hidden":"true"})}),g.jsx("button",{onClick:an=>{an.stopPropagation(),kr(Ne.id,Ne.title)},className:"shrink-0 rounded p-0.5 opacity-0 transition-all hover:bg-dark-bg group-hover:opacity-100",title:S("chat.exportMd"),"aria-label":S("chat.exportMd"),children:g.jsx(Sl,{size:11,"aria-hidden":"true"})}),g.jsx("button",{onClick:an=>cr(an,Ne),className:"shrink-0 rounded p-0.5 opacity-0 transition-all hover:bg-dark-bg group-hover:opacity-100",title:S("nav.sessionActions"),"aria-label":S("nav.sessionActions"),children:g.jsx(Xd,{size:11,"aria-hidden":"true"})}),C.length>1&&g.jsx("button",{onClick:an=>{an.stopPropagation(),m(Ne.id)},className:"shrink-0 rounded p-0.5 opacity-0 transition-all hover:bg-dark-bg group-hover:opacity-100","aria-label":S("a11y.close"),children:g.jsx(yn,{size:12,"aria-hidden":"true"})})]})]},Ne.id)})}),(dn>0||ua)&&g.jsxs("div",{className:"mt-0.5 flex items-center gap-3 rounded-lg bg-dark-bg/50 px-2.5 py-1 text-[11px]",children:[dn>0&&g.jsxs("button",{onClick:()=>Yn(se,dn),className:"text-dark-muted transition-colors hover:text-accent-blue",children:[S("nav.showMoreSessions"),g.jsxs("span",{className:"ml-1 text-dark-muted/50",children:["(",dn,")"]})]}),ua&&g.jsx("button",{onClick:()=>Ua(se),className:"text-dark-muted/60 transition-colors hover:text-dark-text",children:S("nav.collapseGroup")})]})]})]},se)}),Bn.length===0&&g.jsx("div",{className:"px-2.5 py-2 text-xs text-dark-muted/60",children:S("chat.noSessions")})]}),Ds>LP&&g.jsxs("button",{onClick:()=>q(!0),className:"mt-1.5 flex w-full items-center justify-center gap-1 rounded-lg border border-dashed border-dark-border px-2 py-1.5 text-xs text-dark-muted transition-colors hover:bg-dark-hover hover:text-dark-text",title:S("chat.viewAllSessions"),children:[g.jsx(s_,{size:12,"aria-hidden":"true"}),S("chat.viewAllSessions"),g.jsxs("span",{className:"text-dark-muted/50",children:["(",Ds,")"]})]}),H&&T.length>0&&g.jsx("div",{className:"mt-1 space-y-0.5 border-t border-dark-border/50 pt-1",children:T.slice(0,10).map(se=>{const Ce=Jc(se);return g.jsxs("div",{onClick:()=>ur(se.id),className:"group flex cursor-pointer items-center gap-2 rounded-lg px-2.5 py-1.5 text-xs text-dark-muted transition-colors hover:bg-dark-hover/60 hover:text-dark-text",children:[g.jsx(hp,{status:"done",label:S("nav.sessionEnded")}),g.jsxs("span",{className:"min-w-0 flex-1",children:[g.jsx("span",{className:"block truncate",children:se.title}),Ce&&g.jsx("span",{className:"block truncate text-[10px] text-dark-muted/50",children:Ce})]}),g.jsx("span",{className:"shrink-0 text-[10px] text-dark-muted/50",children:e1(se.lastActiveAt??se.createdAt,Date.now(),S)}),g.jsx("button",{onClick:ht=>{ht.stopPropagation(),D(se.id)},className:"shrink-0 rounded p-0.5 opacity-0 transition-all hover:bg-dark-bg group-hover:opacity-100","aria-label":S("chat.removeFromHistory"),children:g.jsx(yn,{size:11,"aria-hidden":"true"})})]},se.id)})})]})]}),g.jsxs("div",{className:`shrink-0 border-t border-dark-border/70 ${e?"p-2":"p-3"}`,children:[e&&g.jsx("button",{onClick:n,className:"mb-2 flex w-full items-center justify-center rounded-md p-1.5 text-dark-muted transition-colors hover:bg-dark-hover hover:text-dark-text",title:S("nav.expandSidebar"),"aria-label":S("nav.expandSidebar"),children:g.jsx(i_,{size:16,"aria-hidden":"true"})}),g.jsxs("div",{className:`flex items-center gap-2 text-xs text-dark-muted ${e?"justify-center":"px-1.5"}`,role:"status","aria-label":S("a11y.connectionStatus"),children:[g.jsx("span",{className:`h-2 w-2 shrink-0 rounded-[1px] ${l?"bg-accent-green":"bg-accent-red"}`,"aria-hidden":"true"}),!e&&g.jsx("span",{className:"truncate",children:S(l?"chat.connected":"chat.disconnected")})]})]}),g.jsx(NP,{isOpen:U,onClose:()=>q(!1),onSwitchSession:It}),g.jsx(zS,{items:nn,position:cn?{x:cn.x,y:cn.y}:null,onClose:$a,ariaLabel:(cn==null?void 0:cn.data.kind)==="session"?S("nav.sessionActions"):S("nav.groupActions")})]})}),BP={info:"bg-accent-blue",warn:"bg-accent-yellow",error:"bg-accent-red",success:"bg-accent-green",tool:"bg-accent-purple"};function IP(t){return t.split(`
|
|
567
|
+
`).map(e=>e.trim()).find(Boolean)??t}function PP(t){return t==null||t===""?"-":new Date(t).toLocaleString()}function zP(){const{t}=at(),[e,n]=N.useState([]),[a,r]=N.useState(!0),[i,l]=N.useState(null),[c,d]=N.useState(null),[p,h]=N.useState(!1),m=N.useCallback(async()=>{r(!0);try{const S=await Je.logs.list();S.success&&Array.isArray(S.data)&&n(S.data)}catch(S){console.error("Failed to load log files:",S)}r(!1)},[]);N.useEffect(()=>{m()},[m]);const b=N.useCallback(async S=>{if(!S.previewable)return;l(S),h(!0);const C=await Je.logs.read(S.name,500);C.success&&C.data&&d(C.data),h(!1)},[]),x=N.useCallback(()=>{l(null),d(null)},[]),w=S=>S<1024?`${S} B`:S<1024*1024?`${(S/1024).toFixed(1)} KB`:`${(S/(1024*1024)).toFixed(1)} MB`;return i&&c?g.jsxs("div",{className:"flex flex-col min-h-0 h-full",children:[g.jsxs("div",{className:"flex items-center gap-2 mb-2 shrink-0",children:[g.jsx("button",{onClick:x,className:"p-1 rounded hover:bg-dark-hover transition-colors",title:t("logs.backToList"),children:g.jsx(h1,{size:16})}),g.jsx("span",{className:"text-sm font-medium text-dark-text truncate flex-1",children:i.name}),g.jsxs("a",{href:Je.logs.downloadUrl(i.name),download:i.name,className:"flex items-center gap-1 px-2 py-1 text-xs bg-accent-blue text-white rounded hover:opacity-90 transition-opacity",children:[g.jsx(Sl,{size:12}),t("logs.download")]})]}),p?g.jsx("div",{className:"flex-1 flex items-center justify-center",children:g.jsx(Hn,{size:20,className:"animate-spin text-accent-blue"})}):g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"text-[10px] text-dark-muted mb-1 shrink-0",children:[w(c.size)," · ",t("logs.totalLines",{count:c.totalLines}),c.startLine>1&&` ${t("logs.showingLatest",{count:c.totalLines-c.startLine+1})}`]}),g.jsx("div",{className:`flex-1 overflow-y-auto min-h-0 font-mono text-[11px] leading-relaxed whitespace-pre-wrap break-all
|
|
568
|
+
bg-dark-bg border border-dark-border rounded p-3 custom-scrollbar`,style:{scrollbarWidth:"thin",scrollbarColor:"#30363d transparent"},children:c.content||g.jsx("span",{className:"text-dark-muted italic",children:t("logs.emptyFile")})})]})]}):g.jsxs("div",{className:"flex flex-col min-h-0 h-full",children:[g.jsxs("div",{className:"flex items-center justify-between mb-2 shrink-0",children:[g.jsx("span",{className:"text-xs font-medium text-dark-text",children:t("logs.files")}),g.jsx("button",{onClick:m,className:"px-2 py-1 text-[10px] bg-dark-hover rounded hover:bg-dark-border transition-colors",disabled:a,children:t(a?"logs.refreshing":"logs.refresh")})]}),a?g.jsx("div",{className:"flex items-center justify-center py-8",children:g.jsx(Hn,{size:16,className:"animate-spin text-accent-blue"})}):e.length===0?g.jsxs("div",{className:"text-center py-8 text-dark-muted",children:[g.jsx(wo,{size:32,className:"mx-auto mb-1 opacity-50"}),g.jsx("p",{className:"text-xs",children:t("logs.noFiles")})]}):g.jsx("div",{className:"flex-1 overflow-y-auto min-h-0 space-y-1 custom-scrollbar",children:e.map(S=>g.jsxs("div",{className:"flex items-center gap-2 p-2 rounded hover:bg-dark-hover transition-colors group",children:[g.jsx(wo,{size:14,className:"text-accent-blue shrink-0"}),g.jsxs("div",{className:"flex-1 min-w-0",children:[g.jsx("div",{className:"text-xs text-dark-text truncate",children:S.name}),g.jsxs("div",{className:"text-[10px] text-dark-muted",children:[w(S.size)," · ",PP(S.modified)]})]}),g.jsxs("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[S.previewable&&g.jsx("button",{onClick:()=>b(S),className:"p-1.5 rounded hover:bg-dark-border transition-colors",title:t("logs.preview"),children:g.jsx(yp,{size:14})}),g.jsx("a",{href:Je.logs.downloadUrl(S.name),download:S.name,className:"p-1.5 rounded hover:bg-dark-border transition-colors block",title:t("logs.download"),children:g.jsx(Sl,{size:14})})]})]},S.name))})]})}const ck=N.memo(N.forwardRef(function({logs:e},n){const{t:a}=at();return g.jsx("div",{ref:n,className:"flex-1 overflow-y-auto min-h-0 font-mono text-xs space-y-0.5 custom-scrollbar",children:e.length===0?g.jsxs("div",{className:"text-center text-dark-muted py-12",children:[g.jsx(Zc,{size:48,className:"mx-auto mb-2 opacity-50"}),g.jsx("p",{children:a("logs.noLogs")})]}):e.map(r=>g.jsxs("div",{className:`p-2 rounded hover:bg-dark-surface transition-colors ${r.level==="error"?"bg-accent-red/10":r.level==="warn"?"bg-accent-yellow/10":r.level==="success"?"bg-accent-green/10":""}`,children:[g.jsx("span",{className:"text-dark-muted text-xs",children:new Date(r.timestamp).toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit",second:"2-digit"})})," ",g.jsx("span",{className:`px-1.5 py-0.5 rounded text-white text-xs ${BP[r.level]}`,children:r.level.toUpperCase()})," ",g.jsxs("span",{className:"text-dark-muted text-xs",children:["[",r.source,"]"]})," ",g.jsx("span",{className:"text-dark-text whitespace-pre-wrap break-all",children:r.message}),r.detail&&g.jsxs("details",{className:"mt-1",children:[g.jsx("summary",{className:"cursor-pointer select-none text-xs text-dark-muted hover:text-dark-text",children:IP(r.detail)}),g.jsx("pre",{className:"mt-1 max-h-60 overflow-auto whitespace-pre-wrap break-all text-xs leading-relaxed text-dark-muted custom-scrollbar",children:r.detail})]})]},r.id))})})),$P=N.memo(function({logs:e,onClear:n,compact:a}){const{t:r}=at(),[i,l]=N.useState("stream"),c=N.useRef(null),d=N.useRef(!0),p=N.useCallback(()=>{const m=c.current;return m?m.scrollHeight-m.scrollTop-m.clientHeight<50:!0},[]),h=N.useCallback(()=>{const m=c.current;m&&(m.scrollTop=m.scrollHeight)},[]);return N.useEffect(()=>{const m=c.current;if(!m)return;const b=()=>{d.current=p()};return m.addEventListener("scroll",b,{passive:!0}),()=>m.removeEventListener("scroll",b)},[p]),N.useEffect(()=>{d.current&&h()},[e,h]),N.useEffect(()=>{const m=c.current;if(!m)return;let b=m.clientHeight;const x=new ResizeObserver(()=>{const w=m.clientHeight;w>0&&b===0&&h(),b=w});return x.observe(m),()=>x.disconnect()},[h]),a?g.jsxs("div",{className:"flex flex-col min-h-0 flex-1 p-2",children:[g.jsxs("div",{className:"flex items-center justify-between mb-2 shrink-0",children:[g.jsxs("h2",{className:"flex items-center gap-2 text-xs font-semibold",children:[g.jsx(Zc,{size:14,className:"text-accent-blue"}),r("logs.title"),g.jsxs("span",{className:"text-sm font-normal text-dark-muted",children:["(",e.length,")"]})]}),g.jsx("button",{onClick:n,className:"bg-dark-surface border border-dark-border rounded hover:bg-dark-hover transition-colors px-2 py-1 text-[10px]",children:r("logs.clear")})]}),g.jsx(ck,{ref:c,logs:e})]}):g.jsxs("div",{className:"flex flex-col min-h-0 flex-1 overflow-hidden p-4",children:[g.jsx("div",{className:"flex items-center justify-between mb-3 shrink-0",children:g.jsxs("h2",{className:"flex items-center gap-2 text-lg font-semibold",children:[g.jsx(Zc,{size:18,className:"text-accent-blue"}),r("logs.backendLogs")]})}),g.jsx("div",{className:"flex gap-1 mb-3 shrink-0 border-b border-dark-border",children:[["stream",r("logs.streamTab"),Zc],["files",r("logs.files"),wo]].map(([m,b,x])=>g.jsxs("button",{onClick:()=>l(m),className:`flex items-center gap-1.5 px-4 py-2 text-sm rounded-t transition-colors border-b-2 ${i===m?"border-accent-blue text-accent-blue bg-accent-blue/5":"border-transparent text-dark-muted hover:text-dark-text hover:bg-dark-hover"}`,children:[g.jsx(x,{size:14}),b,m==="stream"&&e.length>0&&g.jsxs("span",{className:"ml-1 text-[10px] text-dark-muted",children:["(",e.length,")"]})]},m))}),i==="stream"&&g.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[g.jsx("div",{className:"flex items-center justify-end mb-2 shrink-0",children:g.jsx("button",{onClick:n,className:"bg-dark-surface border border-dark-border rounded hover:bg-dark-hover transition-colors px-3 py-1.5 text-sm",children:r("logs.clear")})}),g.jsx(ck,{ref:c,logs:e})]}),i==="files"&&g.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:g.jsx("div",{className:"border border-dark-border rounded-lg p-3 bg-dark-surface h-full",children:g.jsx(zP,{})})})]})});function FP(t){if(!t)return!1;const e=Me.getState();return e.isGenerating(t)||e.isPaused(t)||e.getMessages(t).length===0?!1:(e.replaceMessages(t,[]),!0)}const HP=t=>{if(t==null||t==="")return{};if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}},C0=(t,e="")=>typeof t=="string"?t:String((t==null?void 0:t.content)||(t==null?void 0:t.message)||(t==null?void 0:t.text)||(t==null?void 0:t.error)||e||""),UP=t=>Array.isArray(t)?t:Array.isArray(t==null?void 0:t.tasks)?t.tasks:Array.isArray(t==null?void 0:t.items)?t.items:Array.isArray(t==null?void 0:t.planTasks)?t.planTasks:[],Um=(t,e,n=0)=>{const a=String(t.id||t.taskId||t.backendId||`plan-task-${n+1}`),r=vr(t.status||t.planStatus,t.completed),i=Date.now()+n;return{id:a,sessionId:e,title:String(t.title||t.name||t.content||t.description||`Task ${n+1}`),description:t.description||t.details||t.content,status:r,source:"plan",agentType:t.agentType||t.agent||t.role,progress:t.progress!=null?Number(t.progress):void 0,result:t.result,error:t.error,dependencies:Array.isArray(t.dependencies)?t.dependencies.map(String):void 0,startedAt:t.startedAt?Number(t.startedAt):r==="running"?i:void 0,completedAt:t.completedAt?Number(t.completedAt):r==="completed"||r==="failed"?i:void 0,createdAt:t.createdAt&&Number(t.createdAt)||i,updatedAt:i,raw:t}},uk=(t,e,n=0)=>{const a=String(t.id||t.taskId||t.backendId||`goal-task-${n+1}`),r=vr(t.status),i=Date.now()+n;return{id:a,sessionId:e,title:String(t.title||t.name||t.content||t.description||`Task ${n+1}`),description:t.description||t.details||t.content,status:r,source:"goal",agentType:t.agentType||t.agent||t.role,progress:t.progress!=null?Number(t.progress):void 0,result:t.result,error:t.error,dependencies:Array.isArray(t.parentIds)?t.parentIds.map(String):void 0,startedAt:t.startedAt?Number(t.startedAt):r==="running"?i:void 0,completedAt:t.completedAt?Number(t.completedAt):r==="completed"||r==="failed"?i:void 0,createdAt:t.createdAt&&Number(t.createdAt)||i,updatedAt:t.updatedAt?Number(t.updatedAt):i,raw:t}},GP=(t,e)=>{const n=String((e==null?void 0:e.taskId)||(e==null?void 0:e.id)||"");if(!n)return;const a=ot.getState().getTasksForSession(t).find(c=>c.id===n),r=Ge.getState().getSessionTasks(t).find(c=>c.id===n||c.backendId===n),i=e!=null&&e.status?vr(e.status):(a==null?void 0:a.status)||"pending",l={id:n,sessionId:t,title:(e==null?void 0:e.title)||(a==null?void 0:a.title)||(r==null?void 0:r.title)||n,description:(e==null?void 0:e.description)??(a==null?void 0:a.description)??(r==null?void 0:r.description),status:i,source:"goal",agentType:(e==null?void 0:e.agentType)||(a==null?void 0:a.agentType),progress:(e==null?void 0:e.progress)!=null?Number(e.progress):a==null?void 0:a.progress,result:(e==null?void 0:e.result)??(a==null?void 0:a.result),error:(e==null?void 0:e.error)??(a==null?void 0:a.error),startedAt:i==="running"?Date.now():a==null?void 0:a.startedAt,completedAt:i==="completed"||i==="failed"?Date.now():a==null?void 0:a.completedAt,createdAt:(a==null?void 0:a.createdAt)||Date.now(),updatedAt:Date.now(),raw:e};return ot.getState().upsertTask(t,l),a1(t,l),l},Kc=t=>({id:t.id,title:t.title,completed:t.status==="completed",createdAt:t.createdAt,description:t.description,planStatus:t.status,agentType:t.agentType,dependencies:t.dependencies,result:t.result,error:t.error,startedAt:t.startedAt,completedAt:t.completedAt,progress:t.progress}),a1=(t,e)=>{const n=Ge.getState(),a=n.getSessionTasks(t),r=Kc(e);if(a.some(i=>i.id===e.id||i.backendId===e.id)){n.updateTaskPlanStatus(t,e.id,r);return}n.setSessionTasks(t,[...a,r])},A0=t=>{const e=Me.getState(),n=e.getMessages(t),a=n[n.length-1];(!a||a.type!=="assistant")&&e.addMessage(t,{id:`plan-${Date.now()}`,type:"assistant",content:"",timestamp:Date.now()})};function T0(t,e,n){const a=bi.getState(),r=Me.getState(),i=ot.getState(),l=HP(e);switch(t){case"plan_start":{r.startGeneration(n),A0(n);const c=C0(l,"Plan started");c&&a.setThinkingStatus(n,c),i.recordEvent(n,{type:t,source:"plan",title:"Plan started",message:c,status:"running",data:l});break}case"plan_thinking":{const c=C0(l,"Analyzing request...");a.setThinkingStatus(n,c),A0(n),r.setThinking(n,c),i.recordEvent(n,{type:t,source:"plan",title:"Plan thinking",message:c,status:"running",data:l});break}case"plan_complete":{const c=(l==null?void 0:l.plan)||(l==null?void 0:l.content)||(l==null?void 0:l.result)||(l==null?void 0:l.markdown);if(c){a.setPlanContent(String(c)),A0(n);const d=r.getMessages(n),p=d[d.length-1];(p==null?void 0:p.type)==="assistant"&&!p.content.trim()&&r.updateLastMessage(n,String(c))}else{const d=[...r.getMessages(n)].reverse().find(p=>p.type==="assistant");d!=null&&d.content&&a.setPlanContent(d.content)}r.endGeneration(n),i.recordEvent(n,{type:t,source:"plan",title:"Plan complete",message:C0(l,"Plan complete"),status:"completed",data:l});break}case"plan_error":{const c=C0(l,"Plan failed");A0(n),r.updateLastMessage(n,`Plan failed: ${c}`),r.endGeneration(n,c),i.recordEvent(n,{type:t,source:"plan",title:"Plan failed",message:c,status:"failed",data:l});break}case"plan_tasks":{const c=UP(l).map((d,p)=>Um(d,n,p));i.setTasks(n,c,"plan"),Ge.getState().setSessionTasks(n,c.map(Kc)),i.recordEvent(n,{type:t,source:"plan",title:"Plan tasks updated",message:`${c.length} tasks`,status:"pending",data:l});break}case"plan_task_start":case"plan_task_update":case"plan_task_result":{const c=Um(l,n),d=t==="plan_task_start"?"running":vr(t==="plan_task_result"?l.status||(l.error?"failed":"completed"):l.status||l.planStatus),p={...c,status:d,startedAt:c.startedAt||(d==="running"?Date.now():void 0),completedAt:c.completedAt||(d==="completed"||d==="failed"?Date.now():void 0)};i.upsertTask(n,p),a1(n,p),i.recordEvent(n,{type:t,source:"plan",title:p.title,message:p.result||p.error||p.description,status:p.status,taskId:p.id,data:l});break}case"plan_task_complete":{const c=Um(l,n),d=String(l.status||"")==="failed"||!!l.error,h={...c,status:d?"failed":"completed",completedAt:c.completedAt||Date.now()};i.upsertTask(n,h),a1(n,h),i.recordEvent(n,{type:t,source:"plan",title:h.title,message:h.result||h.error||h.description,status:h.status,taskId:h.id,data:l});const m=h.title||`task ${h.id}`;d?ut.error(`✘ ${m} 失败`,6e3):ut.success(`✓ ${m} 完成`,4e3);break}case"plan_subagent_start":{const c=(l==null?void 0:l.scope)||(l==null?void 0:l.agentId)||"design sub-agent";i.recordEvent(n,{type:t,source:"plan",title:`设计子代理: ${c}`,message:(l==null?void 0:l.title)||"Reading codebase and designing implementation details...",status:"running",data:l});break}case"plan_subagent_done":{const c=(l==null?void 0:l.scope)||(l==null?void 0:l.agentId)||"design sub-agent",d=(l==null?void 0:l.status)==="error"||(l==null?void 0:l.status)==="timeout"||(l==null?void 0:l.status)==="max_iterations"||!!(l!=null&&l.error);i.recordEvent(n,{type:t,source:"plan",title:`设计子代理: ${c}`,message:d?`设计失败: ${(l==null?void 0:l.error)||(l==null?void 0:l.status)||"error"}`:l!=null&&l.designDocPath?`设计完成 → ${l.designDocPath}`:"设计完成",status:d?"failed":"completed",data:l});break}case"agent_started":{if(!(l!=null&&l.agentId))break;i.upsertAgent(n,{id:String((l==null?void 0:l.agentId)||""),toolCallId:l!=null&&l.toolCallId?String(l.toolCallId):void 0,name:String((l==null?void 0:l.scope)||(l==null?void 0:l.agentId)||"agent").slice(0,60),role:"sub-agent",status:"running",parentId:l!=null&&l.parentAgentId?String(l.parentAgentId):void 0}),i.recordEvent(n,{type:t,source:"plan",title:`Agent 启动: ${String((l==null?void 0:l.scope)||(l==null?void 0:l.agentId)||"agent").slice(0,50)}`,message:"Running…(统一生命周期 · /agents 可管理)",status:"running",agentId:l!=null&&l.agentId?String(l.agentId):void 0,data:l});break}case"agent_progress":{if(!(l!=null&&l.agentId))break;const c=(l==null?void 0:l.iteration)||{},d=(l==null?void 0:l.tools)||{},p=Number(c.current||0),h=Number(c.max||0),m=d.current?String(d.current):"",b=(l==null?void 0:l.paused)===!0||(l==null?void 0:l.state)==="paused",x=(l==null?void 0:l.resumed)===!0||(l==null?void 0:l.state)==="running"&&!b,w=typeof(l==null?void 0:l.elapsedMs)=="number"?l.elapsedMs:void 0;i.upsertAgent(n,{id:String((l==null?void 0:l.agentId)||""),toolCallId:l!=null&&l.toolCallId?String(l.toolCallId):void 0,status:b?"paused":x?"running":void 0,round:p>0?p:void 0,maxRounds:h>0?h:void 0,currentTool:m||void 0,elapsedMs:w,currentTask:b?"已暂停(等待恢复)":void 0});break}case"agent_completed":{if(!(l!=null&&l.agentId))break;i.upsertAgent(n,{id:String((l==null?void 0:l.agentId)||""),toolCallId:l!=null&&l.toolCallId?String(l.toolCallId):void 0,status:"completed",currentTask:void 0}),i.recordEvent(n,{type:t,source:"plan",title:`Agent 完成: ${String((l==null?void 0:l.scope)||(l==null?void 0:l.agentId)||"agent").slice(0,50)}`,message:typeof(l==null?void 0:l.elapsedMs)=="number"?`耗时 ${Math.floor(l.elapsedMs/1e3)}s`:"Completed",status:"completed",agentId:l!=null&&l.agentId?String(l.agentId):void 0,data:l});break}case"agent_cancelled":{if(!(l!=null&&l.agentId))break;i.upsertAgent(n,{id:String((l==null?void 0:l.agentId)||""),toolCallId:l!=null&&l.toolCallId?String(l.toolCallId):void 0,status:"completed",currentTask:"已停止(部分结果已返回)"}),i.recordEvent(n,{type:t,source:"plan",title:`Agent 已停止: ${String((l==null?void 0:l.scope)||(l==null?void 0:l.agentId)||"agent").slice(0,50)}`,message:"用户终止 — 已冻结 transcript 并返回部分结果(partial result)",status:"completed",agentId:l!=null&&l.agentId?String(l.agentId):void 0,data:l});break}case"agent_failed":{if(!(l!=null&&l.agentId))break;i.upsertAgent(n,{id:String((l==null?void 0:l.agentId)||""),toolCallId:l!=null&&l.toolCallId?String(l.toolCallId):void 0,status:"failed",error:l!=null&&l.error?String(l.error).slice(0,160):void 0,currentTask:void 0}),i.recordEvent(n,{type:t,source:"plan",title:`Agent 失败: ${String((l==null?void 0:l.scope)||(l==null?void 0:l.agentId)||"agent").slice(0,50)}`,message:String((l==null?void 0:l.error)||(l==null?void 0:l.state)||"error").slice(0,200),status:"failed",agentId:l!=null&&l.agentId?String(l.agentId):void 0,data:l});break}case"plan_mode_change":{const c=(l==null?void 0:l.frontendMode)||(l==null?void 0:l.newMode),d=l==null?void 0:l.planPath;c==="normal"?a.applyBackendMode("normal"):c==="auto"?a.setAuto(!0):(c==="plan"||c==="act"||c==="goal"||c==="auto-plan"||c==="auto-act"||c==="auto-goal")&&a.applyBackendMode(c);const p=d?` [plan: ${d}]`:"";i.recordEvent(n,{type:t,source:"system",title:"Mode changed",message:`${(l==null?void 0:l.previousMode)||"unknown"} -> ${c||"unknown"}${p}`,status:(l==null?void 0:l.success)===!1?"failed":"completed",data:l});break}case"mode_suggestion":{if(!(l!=null&&l.suggestedMode)||!(l!=null&&l.currentMode))break;a.setPendingSuggestion({currentMode:String(l.currentMode),suggestedMode:String(l.suggestedMode),confidence:typeof l.confidence=="number"?l.confidence:void 0,reason:String(l.reason||"")});break}case"goal_created":{i.recordEvent(n,{type:t,source:"goal",title:(l==null?void 0:l.goalTitle)||(l==null?void 0:l.title)||"Goal created",message:l!=null&&l.goalId?`Goal ${l.goalId}`:"Goal created",status:"pending",data:l});break}case"goal_tasks":{const c=Array.isArray(l==null?void 0:l.tasks)?l.tasks.map((d,p)=>uk(d,n,p)):[];i.setTasks(n,c,"goal"),Ge.getState().setSessionTasks(n,c.map(Kc)),i.recordEvent(n,{type:t,source:"goal",title:(l==null?void 0:l.goalTitle)||"Goal tasks",message:`${c.length} tasks`,status:"pending",data:l});break}case"goal_task_update":{const c=String((l==null?void 0:l.taskId)||(l==null?void 0:l.id)||""),d=GP(n,l);i.recordEvent(n,{type:t,source:"goal",title:(d==null?void 0:d.title)||c||"Goal task update",message:(l==null?void 0:l.result)||(l==null?void 0:l.error)||(l!=null&&l.status?`status: ${l.status}`:"updated"),status:d==null?void 0:d.status,taskId:c||void 0,data:l});break}case"goal_update":{const c=Array.isArray(l==null?void 0:l.tasks)?l.tasks.map((d,p)=>uk(d,n,p)):[];i.setTasks(n,c,"goal"),Ge.getState().setSessionTasks(n,c.map(Kc)),i.recordEvent(n,{type:t,source:"goal",title:(l==null?void 0:l.goalTitle)||(l==null?void 0:l.title)||"Goal update",message:(l==null?void 0:l.status)||(l!=null&&l.id?`Goal ${l.id}`:"Goal updated"),status:l!=null&&l.status?vr(l.status):void 0,data:l});break}case"goal_completed":{const c=String((l==null?void 0:l.goalId)||""),d=i.getTasksForSession(n).filter(p=>p.source==="goal");if(d.length>0){const p=d.map(h=>h.status==="pending"||h.status==="running"?{...h,status:"completed",completedAt:Date.now(),updatedAt:Date.now()}:h);i.setTasks(n,p,"goal"),Ge.getState().setSessionTasks(n,p.map(Kc))}i.recordEvent(n,{type:t,source:"goal",title:l!=null&&l.goalTitle?`Goal 完成: ${String(l.goalTitle).slice(0,60)}`:"Goal completed",message:l!=null&&l.result?String(l.result).slice(0,200):c?`Goal ${c} completed`:"Goal completed",status:"completed",data:l});break}}}const i6=/(?:^|\s|\/|\\)(test|tests|lint|build|tsc|vitest|jest|pytest|typecheck|check)(?:\s|\.|"|'|`|$)/i,o6=/bash|shell|run|exec|terminal|command/i,qP=/read|grep|glob|search|list|find|open|view|web_search|fetch/i;function dk(t){return t.some(e=>_o(e.name))?"coding":t.some(e=>o6.test(e.name))&&t.some(e=>{const n=typeof e.args=="string"?e.args:JSON.stringify(e.args??"");return i6.test(n)})?"validating":t.some(e=>qP.test(e.name))?"researching":"summarizing"}function pk(t){return t.some(e=>_o(e.name))?"implementation":t.some(e=>o6.test(e.name))&&t.some(e=>{const n=typeof e.args=="string"?e.args:JSON.stringify(e.args??"");return i6.test(n)})?"optimization":"analysis"}function r1(t){return Zt.t(`activity.verb.${t}`)}function l6(t){const e=t.replace(/\\/g,"/");return e.slice(e.lastIndexOf("/")+1)||t}function VP(t,e){const n=r1(t);for(const a of e){const r=gu(a.args);if(r)return Zt.t("activity.title.withFile",{verb:n,file:l6(r)})}return e.length>1?Zt.t("activity.title.withCount",{verb:n,count:e.length}):n}const WP=1500,KP=3,YP=3,fk=24;let I0=!1,xi=[],gp=0,go=null;function s1(){return gp>=YP}function hk(){go==null||go.abort(),go=null;const t=xi;xi=[],I0=!1,gp=0;for(const e of t)e.resolve(null)}function ZP(t){const e=t.replace(/[\r\n]+/g," ").replace(/^["'「『]+|["'」』。.,,、]+$/g,"").trim();return e?e.length>fk?`${e.slice(0,fk-1)}…`:e:null}async function XP(t){var a,r,i;const e=new AbortController;go=e;const n=setTimeout(()=>e.abort(),WP);try{const l=[`行为类型: ${t.kind}`,t.files.length>0?`涉及文件: ${t.files.map(l6).join(", ")}`:"",`工具调用数: ${t.toolCount}`].filter(Boolean).join(`
|
|
569
|
+
`);let c=null;try{c=sessionStorage.getItem("auth_token")??localStorage.getItem("auth_token")}catch{}const d=await fetch("/api/completions",{method:"POST",headers:{"content-type":"application/json",...c?{authorization:`Bearer ${c}`}:{}},signal:e.signal,body:JSON.stringify({messages:[{role:"system",content:"你是标题生成器。根据给定的行为类型、涉及文件和工具数,生成一句不超过 16 字的中文活动标题(动词开头,不要标点结尾,不要引号)。只输出标题本身。"},{role:"user",content:l}],max_tokens:60,temperature:.3,stream:!1})});if(!d.ok)return null;const h=(i=(r=(a=(await d.json()).choices)==null?void 0:a[0])==null?void 0:r.message)==null?void 0:i.content;return typeof h=="string"?ZP(h):null}catch{return null}finally{clearTimeout(n),go===e&&(go=null)}}async function c6(){if(I0)return;const t=xi.shift();if(t){I0=!0;try{const e=await XP(t.req);e?(gp=0,t.resolve(e)):(gp+=1,t.resolve(null))}finally{if(I0=!1,xi.length>0&&!s1())c6();else if(s1()){const e=xi;xi=[];for(const n of e)n.resolve(null)}}}}function QP(t){return s1()||xi.length>=KP?Promise.resolve(null):new Promise(e=>{xi.push({req:t,resolve:e}),c6()})}const JP=new Set(["content","thinking","tool_call","tool_result"]),ez=/api ?key|unauthorized|401|no such file|not found|eacces|permission denied|file (?:does not exist|not exist)|missing (?:api key|file|dependency)|command not found|is not a function|ENOENT/i;function tz(t){return ez.test(t)?"blocked":"failed"}const nz=6;function az(t,e){const n=t[t.length-1];if(!n)return!1;const a=_o(n.name),r=/bash|shell|run|exec|terminal/i.test(e);return a&&r||!a&&r&&_o(e)}class rz{constructor(){ne(this,"sessions",new Map)}session(e){let n=this.sessions.get(e);return n||(n={messageId:null,batch:null,lastBlockIndex:Number.NEGATIVE_INFINITY,seq:0},this.sessions.set(e,n)),n}currentMessageId(e){const n=this.session(e);if(n.messageId)return n.messageId;const a=Me.getState().messagesBySession[e]||[],r=a[a.length-1];return(r==null?void 0:r.id)??null}resetSession(e){this.sessions.delete(e),ba.getState().resetSession(e)}onWsEvent(e,n,a,r){if(!(r&&JP.has(n)))switch(n){case"start":this.onStart(e);break;case"thinking":this.onThinking(e,a);break;case"content":this.onContent(e);break;case"tool_call":this.onToolCall(e,a);break;case"tool_result":this.onToolResult(e,a);break;case"turn_summary":this.onTurnSummary(e,a);break;case"ask_user_question":case"hook_ask":this.onWaitingUser(e);break;case"generation_paused":ba.getState().markStatus(e,["running","waiting_user"],"paused");break;case"generation_resumed":ba.getState().markStatus(e,["paused"],"running");break;case"error":this.finalizeAll(e,"failed"),hk();break;case"complete":this.finalizeAll(e,"completed"),hk();break}}onStart(e){const n=this.session(e),a=Me.getState().messagesBySession[e]||[],r=a[a.length-1];n.messageId=(r==null?void 0:r.id)??null,n.batch=null,n.seq=0,n.lastBlockIndex=Number.NEGATIVE_INFINITY}onThinking(e,n){const a=this.session(e);if(!a.batch||a.batch.toolCallIds.length===0){this.advanceBlockIndex(a,n);return}const r=this.parseIndex(n);typeof r=="number"&&r>a.lastBlockIndex&&this.sealBatch(a.batch),this.advanceBlockIndex(a,n)}onContent(e){const n=this.session(e);n.batch&&this.sealBatch(n.batch)}onToolCall(e,n){const a=this.session(e),r=this.parseObj(n);if(!r)return;const i=typeof r.id=="string"?r.id:void 0,l=typeof r.index=="number"?r.index:void 0,c=typeof r.name=="string"?r.name:"Unknown",d=r.args??r.arguments??"",p=this.currentMessageId(e)??`session:${e}`;let h=a.batch;if(!h||h.messageId!==p||h.sealed){h&&!h.sealed&&h.toolCallIds.length>0&&this.finalizeBatch(e,h,h.hadError?this.errorStatus(h):"completed"),a.seq+=1;const E=`${p}:act:${a.seq}`,T=dk([{name:c,args:d}]),L=pk([{name:c,args:d}]),D=Date.now(),B=l??(a.lastBlockIndex===Number.NEGATIVE_INFINITY?0:a.lastBlockIndex+1);h={sessionId:e,messageId:p,activityId:E,kind:T,phase:L,tools:[],toolCallIds:[],toolIndexByKey:new Map,pending:new Set,hadError:!1,blockRange:[B,B],startedAt:D,sealed:!1},a.batch=h,ba.getState().applyEvent(e,{type:"activity_started",activity:{id:E,sessionId:e,messageId:p,kind:T,phase:L,status:"running",title:r1(T),titleSource:"rule",toolCallIds:[],blockRange:h.blockRange,startedAt:D}})}if(!h.sealed&&h.toolCallIds.length>=nz&&az(h.tools,c)){this.finalizeBatch(e,h,h.hadError?"failed":"completed"),a.batch=null,this.onToolCall(e,n);return}const m=l!==void 0?`idx:${l}`:i??null;if(m!==null&&h.toolIndexByKey.has(m)){const E=h.toolIndexByKey.get(m),T=h.tools[E];let L=!1;T&&(T.name==="Unknown"&&c!=="Unknown"&&(T.name=c,L=!0),!T.args&&d&&(T.args=d,L=!0));const D=h.toolCallIds[E];i&&D&&D.startsWith("tc-")&&(h.toolCallIds[E]=i,h.pending.delete(D),h.pending.add(i),L=!0),L&&ba.getState().applyEvent(e,{type:"activity_updated",activityId:h.activityId,patch:{toolCallIds:[...h.toolCallIds]}});return}const b={name:c,args:d};h.tools.push(b),m!==null&&h.toolIndexByKey.set(m,h.tools.length-1);const x=i??`tc-${h.toolCallIds.length}-${h.activityId}`;h.toolCallIds.push(x),h.pending.add(x),l!==void 0&&(h.blockRange=[Math.min(h.blockRange[0],l),Math.max(h.blockRange[1],l)],a.lastBlockIndex=Math.max(a.lastBlockIndex,l));const w=dk(h.tools),S=pk(h.tools),C=ba.getState();if(C.applyEvent(e,{type:"activity_updated",activityId:h.activityId,patch:{kind:w,phase:S,toolCallIds:[...h.toolCallIds],...w!==h.kind?{title:r1(w)}:{}}}),h.kind=w,h.phase=S,_o(c)){const E=gu(d);E&&C.applyEvent(e,{type:"artifact_produced",artifact:{id:`${h.activityId}:${E}`,path:E,action:"modified",activityId:h.activityId}})}}onToolResult(e,n){const a=this.session(e);if(!a.batch)return;const r=this.parseObj(n);if(!r)return;const i=a.batch,l=typeof r.id=="string"?r.id:void 0,c=typeof r.index=="number"?r.index:void 0;if(!(l!==void 0&&i.toolCallIds.includes(l)||l===void 0&&c!==void 0&&c>=i.blockRange[0]&&c<=i.blockRange[1]))return;if(l!==void 0)i.pending.delete(l);else{const m=[...i.pending][0];m&&i.pending.delete(m)}const p=r.result;typeof p=="string"&&p.startsWith("Error:")&&(i.hadError=!0,i.lastError=String(p).slice(0,200)),i.sealed&&i.pending.size===0&&this.finalizeBatch(e,i,i.hadError?"failed":"completed")}onTurnSummary(e,n){const a=this.parseObj(n);if(!a)return;const r=typeof a.headline=="string"?a.headline:void 0;if(!r)return;const i=this.currentMessageId(e);i&&ba.getState().applyEvent(e,{type:"task_title_set",messageId:i,title:r})}onWaitingUser(e){const n=ba.getState(),a=n.bySession[e];if(a)for(let r=a.order.length-1;r>=0;r--){const i=a.order[r];if(!i)continue;const l=a.activities[i];if(l&&l.status==="running"){n.applyEvent(e,{type:"activity_updated",activityId:l.id,patch:{status:"waiting_user"}});return}}}finalizeAll(e,n){const a=this.session(e);a.batch&&(this.finalizeBatch(e,a.batch,a.batch.hadError?this.errorStatus(a.batch):n),a.batch=null),ba.getState().finalizeSession(e,n)}errorStatus(e){return e.lastError?tz(e.lastError):"failed"}sealBatch(e){!e||e.sealed||(e.sealed=!0,this.finalizeBatch(e.sessionId,e,e.hadError?this.errorStatus(e):"completed"))}finalizeBatch(e,n,a){if(!n)return;const r=ba.getState(),i=n.kind,l=n.tools,c=VP(i,l);if(r.applyEvent(e,{type:"activity_finalized",activityId:n.activityId,status:a,endedAt:Date.now()}),r.applyEvent(e,{type:"activity_updated",activityId:n.activityId,patch:{title:c,titleSource:"inferred",...(a==="failed"||a==="blocked")&&n.lastError?{blockedReason:n.lastError}:{}}}),a==="completed"&&l.length>=2){const d=l.map(p=>gu(p.args)).filter(p=>typeof p=="string");QP({kind:i,files:d,toolCount:l.length}).then(p=>{p&&ba.getState().applyEvent(e,{type:"activity_updated",activityId:n.activityId,patch:{title:p,titleSource:"llm"}})})}}parseObj(e){if(e&&typeof e=="object"&&!Array.isArray(e))return e;if(typeof e=="string")try{const n=JSON.parse(e);return n&&typeof n=="object"&&!Array.isArray(n)?n:null}catch{return null}return null}parseIndex(e){const n=this.parseObj(e),a=n==null?void 0:n.index;return typeof a=="number"?a:void 0}advanceBlockIndex(e,n){const a=this.parseIndex(n);typeof a=="number"&&(e.lastBlockIndex=Math.max(e.lastBlockIndex,a))}}const sz=new rz;let mk=0;const Gm=Nn(t=>({compactedBySession:{},ttftBySession:{},addCompacted:(e,n)=>t(a=>{const r=a.compactedBySession[e]??[];return r.some(i=>i.seq===n.seq)?a:{compactedBySession:{...a.compactedBySession,[e]:[...r,n].sort((i,l)=>i.timestamp-l.timestamp)}}}),recordTtft:(e,n,a)=>t(r=>{const i=r.ttftBySession[e]??{};return i[n]!==void 0?r:{ttftBySession:{...r.ttftBySession,[e]:{...i,[n]:a}}}}),resetSession:e=>t(n=>{if(n.compactedBySession[e]===void 0&&n.ttftBySession[e]===void 0)return n;const a={...n.compactedBySession},r={...n.ttftBySession};return delete a[e],delete r[e],{compactedBySession:a,ttftBySession:r}})}));function iz(){return mk+=1,mk}class oz{constructor(){ne(this,"sessions",new Map)}session(e){let n=this.sessions.get(e);return n||(n={messageId:null,ttftRecorded:!1},this.sessions.set(e,n)),n}currentMessageId(e){const n=this.session(e);if(n.messageId)return n.messageId;const a=Me.getState().messagesBySession[e]||[],r=a[a.length-1];return(r==null?void 0:r.id)??null}resetSession(e){this.sessions.delete(e),Gm.getState().resetSession(e)}onWsEvent(e,n,a,r){if(!r)switch(n){case"start":this.onStart(e);break;case"content":case"thinking":this.onFirstToken(e);break;case"context_compressed":this.onCompacted(e,a);break;case"complete":case"error":this.onEnd(e);break}}onStart(e){const n=this.session(e),a=Me.getState().messagesBySession[e]||[],r=a[a.length-1];n.messageId=(r==null?void 0:r.id)??null,n.ttftRecorded=!1}onFirstToken(e){const n=this.session(e);if(n.ttftRecorded)return;const a=n.messageId??this.currentMessageId(e);a&&(n.ttftRecorded=!0,Gm.getState().recordTtft(e,a,Date.now()))}onCompacted(e,n){let a=null;if(n&&typeof n=="object"&&!Array.isArray(n))a=n;else if(typeof n=="string")try{const r=JSON.parse(n);r&&typeof r=="object"&&!Array.isArray(r)&&(a=r)}catch{a=null}a&&Gm.getState().addCompacted(e,{seq:iz(),timestamp:Date.now(),...typeof a.originalCount=="number"?{originalCount:a.originalCount}:{},...typeof a.compressedCount=="number"?{compressedCount:a.compressedCount}:{},...typeof a.tokensSaved=="number"?{tokensSaved:a.tokensSaved}:{}})}onEnd(e){const n=this.session(e);n.messageId=null,n.ttftRecorded=!1}}const lz=new oz;function u6(t){const e=t.toLowerCase();let n="unknown";return e.includes("401")||e.includes("unauthorized")||e.includes("invalid api key")||/api ?key.*invalid/.test(e)?n="auth":e.includes("429")||e.includes("rate limit")||e.includes("quota")||e.includes("insufficient_quota")?n="rate_limit":e.includes("timeout")||e.includes("timed out")||e.includes("timedout")?n="timeout":e.includes("network")||e.includes("econnrefused")||e.includes("fetch failed")||e.includes("socket")||e.includes("websocket")?n="network":e.includes("tool")||e.includes("bash")||e.includes("command failed")?n="tool":(e.includes("model")||e.includes("api")||e.includes("provider")||e.includes("response"))&&(n="model"),{id:`error-${Date.now()}-${Math.random().toString(36).slice(2,7)}`,category:n,summary:cz(t,n),detail:t,retryable:n!=="auth",timestamp:Date.now()}}function cz(t,e){const n={auth:"API Key 无效或已失效(401 Unauthorized)",rate_limit:"请求频率超限或配额不足(429)",timeout:"请求超时",network:"网络连接异常",tool:"工具执行失败",model:"模型调用失败",unknown:"发生未知错误"},a=(t.split(`
|
|
570
|
+
`)[0]||"").trim().slice(0,120);return a?`${n[e]}: ${a}`:n[e]}const uz=12e4;let iu=null;function Yc(){iu!==null&&(clearTimeout(iu),iu=null)}function gk(){Yc(),iu=setTimeout(()=>{iu=null,Xe.getState().setCompactionProgress(null)},uz)}function d6(t){let e="";if(typeof t=="string")e=t;else if(t==null)e="";else try{e=JSON.stringify(t)}catch{e=String(t)}const n=e.trim();if(n.startsWith("{")||n.startsWith("["))try{const a=JSON.parse(n),r=p6(a);if(r)return r}catch{}return n||"Error occurred"}function p6(t,e=0){if(!t||typeof t!="object"||e>2)return null;const n=t;for(const a of["message","error","detail","reason"]){const r=n[a];if(typeof r=="string"&&r.trim())return r.trim();const i=p6(r,e+1);if(i)return i}return null}function yk(t){const e=String(t||"");try{const n=JSON.parse(e),a=n.text||n.content;return{text:typeof a=="string"?a:e,index:typeof n.index=="number"?n.index:void 0}}catch{return{text:e,index:void 0}}}function dz(t,e,n,a){var i,l;const r=Me.getState();if(!(a&&(t==="content"||t==="thinking"||t==="tool_call"||t==="tool_result"))){switch(t){case"start":r.startGeneration(n),Xe.getState().resetTokenRate(),r.addMessage(n,{id:ar(),type:"assistant",content:"",timestamp:Date.now()}),Ge.getState().touchSession(n);break;case"content":{const{text:c,index:d}=yk(e),p=c.replace(/\[FINISH\]/g,"");p&&(r.appendToLastMessageText(n,p,d),Xe.getState().recordStreamText(p))}break;case"thinking":{const{text:c,index:d}=yk(e);c&&(r.appendToLastMessageThinking(n,c,d),Xe.getState().recordStreamText(c))}break;case"tool_call":try{const c=JSON.parse(e||"{}"),d=c.id||ar(),p=typeof c.index=="number"?c.index:void 0,h=c.args||c.arguments||"",m=r.messagesBySession[n]||[],b=m[m.length-1],x=[...((i=b==null?void 0:b.steps)==null?void 0:i.flatMap(S=>S.toolCalls||[]))||[],...(b==null?void 0:b.toolCalls)||[]],w=x.find(S=>p!==void 0&&S.index===p||S.id===d);if(w)r.updateToolCall(n,w.id??d,{args:h,...d&&w.id&&w.id!==d?{id:d}:{}});else if(p===void 0&&c.name){const S=x.filter(E=>E.name===c.name&&E.status==="running"),C=S[S.length-1];C?r.updateToolCall(n,C.id,{args:h,...d&&C.id!==d?{id:d}:{}}):r.addToolCall(n,{id:d,index:p,name:c.name||"Unknown",args:h,status:"running",timestamp:Date.now()})}else r.addToolCall(n,{id:d,index:p,name:c.name||"Unknown",args:h,status:"running",timestamp:Date.now()})}catch(c){console.warn("Failed to parse tool call",String(c))}break;case"tool_result":try{const c=JSON.parse(e||"{}"),p=Me.getState().messagesBySession[n]||[],h=[];for(const S of p){const C=S.steps||[];for(const E of C)E.toolCalls&&h.push(...E.toolCalls);S.toolCalls&&h.push(...S.toolCalls)}const m=c.toolName,b=c.id,x=typeof c.index=="number"?c.index:void 0;let w;if(b&&(w=h.find(S=>S.id===b)),!w&&x!==void 0&&(w=h.find(S=>S.index===x&&S.name===m)),!w){const S=h.filter(C=>C.name===m&&C.status==="running");S.sort((C,E)=>(C.timestamp||0)-(E.timestamp||0)),w=S[0]}if(!w){const S=h.filter(C=>C.name===m&&C.status==="error"&&C.ended!==void 0&&C.ended!==null);S.sort((C,E)=>(E.timestamp||0)-(C.timestamp||0)),w=S[0]}if(w){const S=Math.max(0,Date.now()-(w.timestamp||Date.now())),C=typeof c.result=="string"&&c.result.startsWith("Error:");r.updateToolCall(n,w.id,{status:C?"error":"completed",result:c.result,ended:void 0,waitingUser:void 0,duration:S,...c.diff!==void 0?{diff:String(c.diff)}:{},...c.noTruncate===!0?{noTruncate:!0}:{},...Array.isArray(c.generatedImages)?{generatedImages:c.generatedImages.filter(E=>typeof E=="string"&&E.length>0)}:{},...Array.isArray(c.attachments)?{attachments:c.attachments.filter(E=>!!E&&typeof E=="object"&&typeof E.url=="string"&&typeof E.mime=="string")}:{}})}}catch(c){console.warn("Failed to parse tool result",String(c))}break;case"tool_diff":try{const c=JSON.parse(e||"{}"),p=Me.getState().messagesBySession[n]||[],h=[];for(const x of p){const w=x.steps||[];for(const S of w)S.toolCalls&&h.push(...S.toolCalls);x.toolCalls&&h.push(...x.toolCalls)}const m=h.filter(x=>x.name===c.toolName&&x.status==="running");m.sort((x,w)=>(x.timestamp||0)-(w.timestamp||0));const b=m[0];b&&typeof c.diff=="string"&&r.updateToolCall(n,b.id,{diff:c.diff})}catch(c){console.warn("Failed to parse tool diff",String(c))}break;case"tool_output":try{const c=JSON.parse(e||"{}"),d=r.messagesBySession[n]||[],p=[];for(const b of d){const x=b.steps||[];for(const w of x)w.toolCalls&&p.push(...w.toolCalls);b.toolCalls&&p.push(...b.toolCalls)}const h=p.filter(b=>(c.toolName?b.name===c.toolName:!0)&&b.status==="running");h.sort((b,x)=>(b.timestamp||0)-(x.timestamp||0));const m=h[0];m&&typeof c.chunk=="string"&&r.updateToolCall(n,m.id,{liveOutput:(m.liveOutput||"")+c.chunk})}catch(c){console.warn("Failed to parse tool output",String(c))}break;case"turn_summary":{try{const c=JSON.parse(e||"{}"),d={};if(c.toolCounts&&typeof c.toolCounts=="object"&&!Array.isArray(c.toolCounts))for(const[p,h]of Object.entries(c.toolCounts)){const m=Number(h);Number.isFinite(m)&&m>0&&(d[p]=m)}r.setTurnSummary(n,{thoughtMs:Number(c.thoughtMs??c.durationMs??0)||0,durationMs:Number(c.durationMs??c.thoughtMs??0)||0,toolCounts:d,...typeof c.headline=="string"&&c.headline?{headline:c.headline}:{}})}catch(c){console.warn("Failed to parse turn_summary",String(c))}break}case"web_search":try{const c=JSON.parse(e||"{}"),d=c.callId||`web-search-${Date.now()}-${Math.random().toString(36).slice(2,7)}`,p=typeof c.index=="number"?c.index:void 0,h=c.status==="searching"||c.status==="in_progress",m=c.status==="failed",b=r.messagesBySession[n]||[],x=b[b.length-1],S=[...((l=x==null?void 0:x.steps)==null?void 0:l.flatMap(C=>C.toolCalls||[]))||[],...(x==null?void 0:x.toolCalls)||[]].find(C=>C.id===d||p!==void 0&&C.index===p&&C.name==="web_search");S?h||r.updateToolCall(n,S.id,{status:m?"error":"completed",result:m?"❌ 联网搜索失败":c.searchUrl?`✅ 搜索完成:${c.searchUrl}`:"✅ 搜索完成"}):r.addToolCall(n,{id:d,index:p,name:"web_search",args:"{}",status:h?"running":"completed",result:h?void 0:m?"❌ 联网搜索失败":c.searchUrl?`✅ 搜索完成:${c.searchUrl}`:"✅ 搜索完成",timestamp:Date.now()})}catch(c){console.warn("Failed to parse web_search",String(c))}break;case"cache_stats":try{const c=JSON.parse(e||"{}");Xe.getState().setCacheStats({cacheHitTokens:Number(c.cacheHitTokens)||0,cacheMissTokens:Number(c.cacheMissTokens)||0,cacheHitRate:c.cacheHitRate!==void 0?Number(c.cacheHitRate):void 0,cacheStatsCalls:Number(c.cacheStatsCalls)||0})}catch(c){console.warn("Failed to parse cache_stats",String(c))}break;case"complete":Yc(),Xe.getState().setCompactionProgress(null),r.endGeneration(n),b4(n);{const c=Me.getState().messagesBySession[n]||[];c.length>0&&Xe.getState().recalculateFromMessages(c)}Ge.getState().touchSession(n);break;case"generation_paused":r.pauseGeneration(n);break;case"generation_resumed":r.resumeGeneration(n);break;case"compaction_progress":try{const c=JSON.parse(e||"{}");Xe.getState().setCompactionProgress({stage:c.stage||"",percent:c.percent||0,message:c.message||""}),gk()}catch(c){console.error("Failed to parse compaction_progress:",c)}break;case"compaction_finished":Yc(),Xe.getState().setCompactionProgress(null);break;case"compaction_started":gk();break;case"context_compressed":try{const c=JSON.parse(e||"{}"),d=C=>typeof C=="number"&&Number.isFinite(C)?C:void 0,p=d(c.originalCount),h=d(c.compressedCount)??d(c.messageCount),m=d(c.tokensSaved)??d(c.totalTokensSaved),x=[p!==void 0&&h!==void 0?`${p} -> ${h} msgs`:h!==void 0?`${h} msgs`:"",m!==void 0?`freed ${m} tokens`:""].filter(Boolean).join(", "),w=typeof c.message=="string"?c.message.trim():"",S=x?`Context compressed: ${x}`:w||"Context compressed";r.appendToLastMessage(n,`
|
|
571
|
+
|
|
572
|
+
---
|
|
573
|
+
${S}
|
|
574
|
+
|
|
575
|
+
`),ut.info(S,5e3),Xe.getState().setCompacting({originalCount:p??0,compressedCount:h??0,tokensSaved:m??0}),Xe.getState().setCompactionProgress(null),Yc()}catch(c){console.error("Failed to parse context_compressed:",c)}break;case"error":{Yc(),Xe.getState().setCompactionProgress(null),r.endGeneration(n),b4(n);const c=d6(e),d=u6(c),p=Me.getState(),h=p.messagesBySession[n]||[],m=h[h.length-1];m&&m.type==="assistant"&&!m.errorCard?p.attachErrorCard(n,d):p.addMessage(n,{id:ar(),type:"assistant",content:"",timestamp:Date.now(),errorCard:d}),xa.error(d.summary,c),Ge.getState().touchSession(n);break}case"context_analysis":try{const c=JSON.parse(e||"{}");c&&c.total!==void 0&&Xe.getState().setContextDistribution(c)}catch(c){console.error("Failed to parse context_analysis:",c)}break;case"threshold_warning":try{const c=JSON.parse(e||"{}");Xe.getState().setThresholdWarning(c);const d=c.percentLeft!==void 0?c.percentLeft:0;d<=5?console.warn(`Context nearly full (${d}% remaining)`):d<=15&&console.info(`Context running low (${d}% remaining)`)}catch(c){console.error("Failed to parse threshold_warning:",c)}break;case"blocking_limit":try{const c=JSON.parse(e||"{}");Xe.getState().setThresholdWarning(c),console.error(c.message||"Context blocked")}catch(c){console.error("Failed to parse blocking_limit:",c)}break;case"context_blocked":try{const c=JSON.parse(e||"{}");Xe.getState().setThresholdWarning(c),console.error(c.message||"Context is full — generation blocked")}catch(c){console.error("Failed to parse context_blocked:",c)}break;case"stall_detected":try{const c=JSON.parse(e||"{}"),d=c.attempt||0,p=c.maxRetries||3,h=c.reason||"no response from model";c.recovering?ut.warning(`⚠ Generation stalled (${h}) — retrying ${d}/${p}`,8e3):ut.error(`⚠ Generation stalled (${h}) — giving up`,1e4)}catch(c){console.warn("Failed to parse stall_detected",String(c))}break}sz.onWsEvent(n,t,e,a),lz.onWsEvent(n,t,e,a)}}const ny=Nn()((t,e)=>({backendCommands:[],loaded:!1,setBackendCommands:n=>{t({backendCommands:n,loaded:!0})},getAllCommands:()=>e().backendCommands}));async function pz(t="",e){try{let n=`${t}/api/commands`;e&&(n+=`?lang=${encodeURIComponent(e)}`);const a=await fetch(n);if(!a.ok)return[];const r=await a.json(),i=Array.isArray(r==null?void 0:r.data)?r.data:[];return ny.getState().setBackendCommands(i),i}catch{return[]}}function qm(t,e,n,a,r){var i,l,c;switch(t){case"token_update":try{const p=typeof e=="string"?JSON.parse(e):e||{};if(p.source==="workflow"){Xe.getState().addWorkflowTokens(Number(p.workflowNodeTokens)||0);break}p.totalTokens>0&&Xe.getState().updateUsage({promptTokens:p.promptTokens||0,completionTokens:p.completionTokens||0,totalTokens:p.totalTokens||0});const h=p.promptCacheHitTokens??p.prompt_cache_hit_tokens,m=p.promptCacheMissTokens??p.prompt_cache_miss_tokens;(h!==void 0||m!==void 0)&&Xe.getState().accumulateCacheStats(Number(h)||0,Number(m)||0),p.model&&Xe.getState().setModel(p.model)}catch{}break;case"context_breakdown":try{const p=typeof e=="string"?JSON.parse(e):e||{};Xe.getState().setContextBreakdown({systemPromptTokens:Number(p.systemPromptTokens)||0,messagesTokens:Number(p.messagesTokens)||0,toolContentTokens:Number(p.toolContentTokens)||0,toolDefTokens:Number(p.toolDefTokens)||0,mcpToolTokens:Number(p.mcpToolTokens)||0,skillTokens:Number(p.skillTokens)||0,dynamicTokens:Number(p.dynamicTokens)||0,total:Number(p.total)||0})}catch{}break;case"model_name":try{const p=r&&typeof r.model=="string"&&r.model||(typeof e=="string"?e:(e==null?void 0:e.model)||"");p&&Xe.getState().setModel(p);const h=r&&typeof r.modelRef=="string"&&r.modelRef||(typeof e=="object"&&e!==null&&typeof e.modelRef=="string"?e.modelRef:"");h&&Xe.getState().setModelRef(h);const m=r&&typeof r.source=="string"&&r.source||(typeof e=="object"&&e!==null&&typeof e.source=="string"?e.source:"");m&&Xe.getState().setModelSource(m)}catch{}break;case"auth_required":let d=localStorage.getItem("auth_token");d||(d="default-token",localStorage.setItem("auth_token",d)),De.setToken(d),De.setAuthenticated(!1),De.send({type:"auth",token:d});break;case"auth_success":De.setAuthenticated(!0),De.send({type:"subscribe_logs"});{const p=_i.getState();pz("",B9(Sp(p.language)));const h=p.workspaceDir;h&&De.send({type:"workspace",message:h})}break;case"auth_failed":xa.error("Auth failed",String(e));break;case"log":try{const p=typeof e=="string"?JSON.parse(e):e,h={id:`log-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,level:p.level||"info",source:p.source||"System",message:p.message||"",timestamp:p.timestamp||Date.now()};a.setLogs(m=>[...m,h].slice(-500)),a.activeTab!=="logs"&&a.setUnreadLogs(m=>m+1)}catch(p){console.warn("Failed to parse log entry",String(p))}break;case"commands_list":try{const p=JSON.parse(e||"[]");ny.getState().setBackendCommands(Array.isArray(p)?p:[])}catch(p){console.warn("Failed to parse commands list",String(p))}break;case"command_error":try{const p=typeof e=="string"?JSON.parse(e):e||{};ut.error((p.error||"Command failed").toString(),6e3)}catch{}break;case"notification":{try{const p=typeof e=="string"?JSON.parse(e):e||{},h=p.result&&typeof p.result=="object"?p.result:{},m=String(p.message||h.message||"").trim();if(!m)break;if(p.kind==="command"){const b=Ge.getState().activeSessionId;b&&Me.getState().addMessage(b,{id:`cmd-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,type:"assistant",content:`⚙️ ${String(p.command||"")} → ${m}`,timestamp:Date.now()})}else ut.info(m,5e3)}catch{}break}case"ping":De.send({type:"pong",data:Date.now().toString()});break;case"workspace_changed":try{const p=JSON.parse(e||"{}");p.newDir&&_i.getState().setWorkspaceDir(p.newDir)}catch{}break;case"degradation_update":try{const p=typeof e=="string"?JSON.parse(e):e||{},h=p.active,m=p.mode||"normal",b=Number(p.retryCount)||0,x=Number(p.maxRetries)||0,w=p.message||"",C={normal:"normal",retrying:"retrying",alternative:"alternative model",degraded:"degraded",verifying:"verifying",verified_fail:"verify failed"}[m]||m;if(Xe.getState().setDegradation({active:h,retryCount:b,maxRetries:x,mode:m,message:w,label:C}),h){const E=b>0?` (${b}/${x})`:"";ut.warning(w||`API Degraded: ${C}${E}`,8e3),a.setLogs(T=>[...T,{id:`deg-${Date.now()}`,level:"warn",source:"Infrastructure",message:`Degradation: ${C} | ${w||"no details"}`,timestamp:Date.now()}].slice(-500))}else ut.success("API Normal")}catch(p){console.warn("Degradation update parse error",String(p))}break;case"doctor_result":try{const p=typeof e=="string"?JSON.parse(e):e||{},h=p.overallStatus||p.status||"unknown",m=p.healthRate,b=p.issues||[],w={healthy:"healthy",degraded:"degraded",unhealthy:"unhealthy",unknown:"unknown"}[h]||h,S=typeof m=="number"?` (${Math.round(m*100)}%)`:"";if(h==="healthy")ut.success(`Doctor: ${w}${S}`);else if(ut.warning(`Doctor: ${w}${S}`,1e4),b&&b.length>0)for(const C of b)a.setLogs(E=>[...E,{id:`doctor-${Date.now()}-${Math.random().toString(36).slice(2,6)}`,level:"warn",source:"Doctor",message:typeof C=="string"?C:C.message||JSON.stringify(C),timestamp:Date.now()}].slice(-500))}catch(p){console.warn("Doctor result parse error",String(p))}break;case"session_created":{try{const p=typeof e=="string"?JSON.parse(e):e||{};p.id&&(De.setSessionId(p.id),Ge.getState().updateSession(p.id,p))}catch{}typeof e=="string"&&e&&xa.info(`Session event: ${t}`);break}case"session_resumed":{try{const p=typeof e=="string"?JSON.parse(e):e||{};if((i=p.session)!=null&&i.id&&(De.setSessionId(p.session.id),Ge.getState().updateSession(p.session.id,p.session)),p.messages&&Array.isArray(p.messages)){const h=((l=p.session)==null?void 0:l.id)||n;Me.getState().replaceMessages(h,p.messages.map(x=>({id:x.id||`msg-${x.timestamp||Date.now()}`,type:x.type==="user"?"user":"assistant",content:x.content||"",timestamp:x.timestamp||Date.now(),thinking:x.thinking||void 0})));const m=p.messages.find(x=>x.type==="user"&&!x.deleted),b=typeof(m==null?void 0:m.content)=="string"?m.content.replace(/\s+/g," ").trim():"";Ge.getState().touchSession(h,b||void 0)}}catch(p){console.warn("Failed to process session_resumed",String(p))}typeof e=="string"&&e&&xa.info(`Session event: ${t}`);break}case"session_delegation_start":{try{const p=typeof e=="string"?JSON.parse(e):e||{},h=p.toSessionId||n;if(h){const m=p.fromTitle||p.fromSessionId||"另一会话",b=String(p.task||"").replace(/\s+/g," ").trim();Me.getState().addMessage(h,{id:`deleg-start-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,type:"system",content:`🔗 「${m}」委派任务:${b.slice(0,200)}${b.length>200?"…":""}`,timestamp:Date.now()})}}catch{}break}case"session_delegation_end":{try{const p=typeof e=="string"?JSON.parse(e):e||{},h=p.toSessionId||n;if(h){const m=p.ok!==!1,b=String(p.summary||"").replace(/\s+/g," ").trim();Me.getState().addMessage(h,{id:`deleg-end-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,type:"system",content:`${m?"✅":"❌"} 委派任务${m?"已完成":"失败"}${b?`:${b.slice(0,200)}${b.length>200?"…":""}`:""}`,timestamp:Date.now()})}}catch{}break}case"session_direct_delivered":{try{const p=typeof e=="string"?JSON.parse(e):e||{},h=p.fromSessionId||n;if(h){const m=p.toTitle||p.toSessionId||"另一会话",b=String(p.text||"").replace(/\s+/g," ").trim(),x=p.queued===!0;Me.getState().addMessage(h,{id:`direct-delivered-${p.deliveryId||Date.now()}`,type:"system",content:`📤 直连投递给「${m}」${x?"(对方正在运行,已排队作新一轮)":"(对方开始独立执行)"}:${b.slice(0,200)}${b.length>200?"…":""}`,timestamp:Date.now()})}}catch{}break}case"session_direct_completed":{try{const p=typeof e=="string"?JSON.parse(e):e||{},h=p.fromSessionId||n;if(h){const m=String(p.toSessionId||""),b=m?((c=Ge.getState().sessions.find(S=>S.id===m))==null?void 0:c.title)||m.slice(0,8):"另一会话",x=p.ok!==!1,w=String(p.summary||"").replace(/\s+/g," ").trim();Me.getState().addMessage(h,{id:`direct-completed-${p.deliveryId||Date.now()}`,type:"system",content:x?`✅ 「${b}」已完成直连消息${w?`:${w.slice(0,300)}${w.length>300?"…":""}`:""}`:`❌ 「${b}」直连消息执行失败:${w||"未知错误"}`,timestamp:Date.now()})}}catch{}break}case"mcp_update":try{const p=typeof e=="string"?JSON.parse(e):e||{},h=p.server||p.name||"MCP",m=p.action||p.status||"updated";xa.info(`MCP ${h}: ${m}`)}catch{}break}}function lF(t,e){switch(KT(t,e)){case"critical":return{level:"CRITICAL",reasonKey:"risk_critical"};case"high":return{level:"HIGH",reasonKey:/rm\s+-rf|sudo|chmod\s+777|curl.*\|\s*(ba)?sh|wget.*-O|>\/dev\/|mkfs/i.test(e)?"risk_critical_cmd":/write|edit|save|upload|deploy|publish/i.test(t)?"risk_high_file":/install|uninstall|npm|pip|cargo|gem|apt|brew|choco|yum|dnf/i.test(t)?"risk_high_pkg":"risk_high_shell"};case"low":return{level:"LOW",reasonKey:"risk_low"};default:return{level:"MEDIUM",reasonKey:/git|commit|push|merge|rebase/i.test(t)?"risk_git":"risk_network"}}}const cF={CRITICAL:{bg:"bg-red-900/20",border:"border-red-500/40",text:"text-red-400",badge:"bg-red-500/20 text-red-400 border-red-500/30",icon:"🚨"},HIGH:{bg:"bg-orange-900/15",border:"border-orange-500/30",text:"text-orange-400",badge:"bg-orange-500/20 text-orange-400 border-orange-500/30",icon:"⚠️"},MEDIUM:{bg:"bg-yellow-900/10",border:"border-yellow-500/25",text:"text-yellow-400",badge:"bg-yellow-500/15 text-yellow-400 border-yellow-500/25",icon:"📋"},LOW:{bg:"bg-blue-900/10",border:"border-blue-500/25",text:"text-blue-400",badge:"bg-blue-500/15 text-blue-400 border-blue-500/25",icon:"✅"}};function uF(t,e){return ZT(t,e)}function fz(t){try{const e=JSON.parse(t),n=e.payload&&typeof e.payload=="object"?e.payload:e,a=n.resolvedPath;if(typeof a=="string"&&a)return a;const r=n.requestedPath;return typeof r=="string"&&r?r:null}catch{return null}}function hz(t,e){try{const n=typeof t=="string"?JSON.parse(t):t||{},a=ys.getState(),{approvalId:r,toolName:i,askPayload:l,timeoutMs:c,timeoutAction:d}=n,p=fz(String(l||""));if(a.isSessionAllowed(i,p??void 0)){De.send({type:"hook_allow",data:JSON.stringify({approvalId:r})});return}if(a.autoMode&&i!=="exit_plan_mode"){De.send({type:"hook_allow",data:JSON.stringify({approvalId:r})});return}Me.getState().addMessage(e,{id:`hook-approval-${r||Date.now()}`,type:"assistant",content:"",timestamp:Date.now(),hookApproval:{approvalId:r||"",toolName:i||"unknown",askPayload:l||"",status:"pending",timestamp:Date.now(),timeoutMs:typeof c=="number"?c:void 0,timeoutAction:d==="allow"||d==="deny"?d:void 0}}),a.addApproval({approvalId:r||"",toolName:i||"unknown",askPayload:l||"",timestamp:Date.now(),timeoutMs:typeof c=="number"?c:void 0,timeoutAction:d==="allow"||d==="deny"?d:void 0}),window.dispatchEvent(new CustomEvent("hook-approval-required"))}catch{}}function Vm(t,e){try{const n=typeof t=="string"?JSON.parse(t):t||{};typeof n.sessionId=="string"&&n.sessionId&&(e=n.sessionId);const a=Ge.getState(),r=ot.getState(),{action:i,taskId:l,data:c}=n;if(i==="created"&&c){const d={id:l||`task-${Date.now()}`,title:c.title||"",completed:c.status==="COMPLETED",createdAt:Date.parse(c.createdAt)||Date.now(),backendId:l,backendStatus:c.status,description:c.description},p=a.tasksBySession[e]||[];a.setSessionTasks(e,[...p,d]),r.upsertTask(e,{id:d.id,title:d.title,description:d.description,status:vr(c.status),source:"task",progress:c.progress!=null?Number(c.progress):void 0,raw:n})}else if((i==="updated"||i==="status_changed")&&c)a.updateTaskPlanStatus(e,l,{backendStatus:c.status,progress:c.progress}),r.upsertTask(e,{id:l,title:c.title||l,description:c.description,status:vr(c.status),source:"task",progress:c.progress!=null?Number(c.progress):void 0,raw:n});else if(i==="deleted"){const d=a.tasksBySession[e]||[];a.setSessionTasks(e,d.filter(p=>p.id!==l&&p.backendId!==l))}else if(n&&!i&&(n.id||n.taskId)){const d=String(n.id||n.taskId),p=n,h=String(p.status||"").toUpperCase()==="COMPLETED",m={id:d,title:String(p.title||p.name||d),completed:h,createdAt:Date.parse(p.createdAt)||Date.now(),backendId:d,backendStatus:p.status,description:p.description,progress:p.progress!=null?Number(p.progress):void 0},b=a.getSessionTasks(e);b.some(x=>x.id===d||x.backendId===d)?a.updateTaskPlanStatus(e,d,{backendStatus:p.status,progress:m.progress,completed:h}):a.setSessionTasks(e,[...b,m]),r.upsertTask(e,{id:d,title:m.title,description:m.description,status:vr(p.status),source:"task",progress:m.progress,raw:n})}r.recordEvent(e,{type:"task_update",source:"task",title:(c==null?void 0:c.title)||n&&(n.title||n.id||n.taskId)||l||"Task update",message:i||"updated",status:(c==null?void 0:c.status)||(n==null?void 0:n.status),taskId:l||(n==null?void 0:n.id)||(n==null?void 0:n.taskId),data:n})}catch{}}function mz(t,e,n,a){try{const r=JSON.parse(e||"{}"),i=a(n,t,r);if(i){const l=Me.getState();switch(t){case"step_start":l.updateStep(n,i.id,{title:r.step||i.title,description:r.description||i.description,status:r.status==="start"?"running":r.status||"running"});break;case"step_thinking":l.updateStep(n,i.id,{thought:r.thought});break;case"step_action":l.updateStep(n,i.id,{action:r.action});break;case"step_complete":l.updateStep(n,i.id,{status:r.status??"success",result:r.result});break}}}catch(r){console.warn("Failed to parse "+t,String(r))}}function gz(t,e){var n,a;try{const r=typeof t=="string"?JSON.parse(t):t,i=r&&typeof r=="object"?r:{};let l=[];if(Array.isArray(i)?l=i:Array.isArray(i.todos)?l=i.todos:(n=i.tasks)!=null&&n.length?l=i.tasks:(a=i.items)!=null&&a.length&&(l=i.items),l.length>0&&e){const c=Ge.getState(),d=ot.getState(),p=[];l.forEach(h=>{const m=String(h.content||h.title||h.name||"").trim();if(!m)return;const b=h.completed||h.status==="completed"||h.status==="COMPLETED"||h.status==="done"||h.activeForm==="completed";if(!c.getSessionTasks(e).find(C=>C.title===m)&&(c.addSessionTask(e,m),b)){const C=c.getSessionTasks(e).find(E=>E.title===m);C&&c.toggleSessionTask(e,C.id)}const w=String(h.id||h.taskId||m),S=vr(h.status,b);d.upsertTask(e,{id:w,title:m,description:h.description,status:S,source:"todo",raw:h}),p.push({id:w,title:m,status:S})}),p.length>0&&d.setTasks(e,p,"todo"),d.recordEvent(e,{type:"todo_update",source:"todo",title:"Todo list updated",message:`${l.length} items`,status:"updated",data:i})}}catch{}}function yz(t,e){try{const n=typeof t=="string"?JSON.parse(t):t||{},a=n.questionId||"",r=n.question||"";if(!a||!r)return;const i=Array.isArray(n.questions)?n.questions.map(d=>({question:String(d.question||""),header:d.header?String(d.header):void 0,options:Array.isArray(d.options)?d.options:void 0,multiSelect:d.multiSelect===!0})).filter(d=>d.question):[{question:r,header:n.header||void 0,options:Array.isArray(n.options)?n.options:void 0,multiSelect:n.multiSelect===!0}],l=window;l.__answeredQuestionIds=l.__answeredQuestionIds||new Set,l.__pendingQuestions=l.__pendingQuestions||{};const c={questionId:a,question:r,header:n.header||void 0,options:Array.isArray(n.options)?n.options:void 0,multiSelect:n.multiSelect===!0,autoResolutionMs:typeof n.autoResolutionMs=="number"?n.autoResolutionMs:void 0,questions:i,sessionId:e};l.__pendingQuestions[e]=c,l.__pendingQuestion=c,Me.getState().markWaitingUserToolCall(e,"ask_user_question"),window.dispatchEvent(new CustomEvent("ask-question-required",{detail:e}))}catch{}}function bz(t,e){try{const n=typeof t=="string"?JSON.parse(t):t,a=n&&typeof n=="object"?n:{},r=a.title||a.name||"";if(r&&e){const i=Ge.getState(),l=ot.getState(),c=i.getSessionTasks(e).find(p=>p.title===r&&!p.completed);c&&i.toggleSessionTask(e,c.id);const d=String(a.id||a.taskId||r);l.upsertTask(e,{id:d,title:r,status:vr(a.status,!0),source:"todo"}),l.recordEvent(e,{type:"todo_item_done",source:"todo",title:r,status:"completed",taskId:d,data:a})}}catch{}}function bk(t){if(!t)return null;try{return JSON.parse(t)}catch{return null}}const vk=Nn((t,e)=>({automations:[],runsByAutomation:{},loading:!1,error:null,fetchAutomations:async()=>{const n=await Je.automations.list();n.success&&n.data?t({automations:n.data}):t({error:n.error||"加载自动化失败"})},createAutomation:async n=>{const a=await Je.automations.create(n);return a.success&&a.data?(await e().fetchAutomations(),a.data):(t({error:a.error||"创建自动化失败"}),null)},updateAutomation:async(n,a)=>{const r=await Je.automations.update(n,a);return r.success?(await e().fetchAutomations(),!0):(t({error:r.error||"更新自动化失败"}),!1)},deleteAutomation:async n=>{const a=await Je.automations.remove(n);return a.success?(await e().fetchAutomations(),!0):(t({error:a.error||"删除失败"}),!1)},toggleAutomation:async(n,a)=>{const r=await Je.automations.toggle(n,a);r.success?await e().fetchAutomations():t({error:r.error||"切换失败"})},runAutomation:async n=>{const a=await Je.automations.run(n);a.success?(await e().fetchRuns(n),await e().fetchAutomations()):t({error:a.error||"触发失败"})},fetchRuns:async n=>{const a=await Je.automations.runs(n);a.success&&a.data&&t(r=>({runsByAutomation:{...r.runsByAutomation,[n]:a.data}}))},onAutomationUpdate:n=>{t(a=>({automations:a.automations.some(i=>i.id===n.id)?a.automations.map(i=>i.id===n.id?n:i):[...a.automations,n]}))},onAutomationRun:n=>{t(a=>({runsByAutomation:{...a.runsByAutomation,[n.automationId]:[n,...a.runsByAutomation[n.automationId]||[]].slice(0,50)}}))}})),xk={automationUpdate:t=>{const e=bk(t);e!=null&&e.automation&&vk.getState().onAutomationUpdate(e.automation)},automationRun:t=>{const e=bk(t);e!=null&&e.run&&vk.getState().onAutomationRun(e.run)}};function vz(t,e,n){let a={};if(e&&typeof e=="object")a=e;else try{a=JSON.parse(String(e||"{}"))}catch{}const r=String(a.jobId||`fjob-${Date.now()}`),i=a.stage||(t==="filejob_result"?"complete":t==="filejob_error"?"error":"uploaded"),l={jobId:r,stage:i,parseProgress:a.parseProgress,parsedFiles:a.parsedFiles,mapping:a.mapping,renderProgress:a.renderProgress,currentRow:a.currentRow,totalRows:a.totalRows,result:a.result,error:a.error,errorDetail:a.errorDetail};a.attachments&&(l.attachments=a.attachments),Me.getState().setMessageFileJob(n,l)}const i1=new Map;function xz(t){i1.clear();for(const e of t)e.label&&i1.set(e.type,e.label)}const wz={wechat:"微信",feishu:"飞书",dingtalk:"钉钉",telegram:"Telegram",discord:"Discord",slack:"Slack",signal:"Signal",whatsapp:"WhatsApp",line:"LINE",qqbot:"QQ Bot",matrix:"Matrix",mattermost:"Mattermost",msteams:"Teams",googlechat:"Google Chat",irc:"IRC",imessage:"iMessage",sms:"SMS","nextcloud-talk":"Nextcloud Talk",nostr:"Nostr","synology-chat":"Synology Chat",tlon:"Tlon",twitch:"Twitch",zalo:"Zalo",zalouser:"ZaloUser",clickclack:"ClickClack",raft:"Raft","qa-channel":"QA"},kz={wechat:"💬",feishu:"📘",dingtalk:"🔔",telegram:"✈️",discord:"🎮",slack:"💼",signal:"🔒",whatsapp:"📱",line:"🟢",qqbot:"🐧",matrix:"🧩",mattermost:"🏢",msteams:"📋",googlechat:"📧",irc:"💻",imessage:"✉️",sms:"📨"},Sz=new Set(["mattermost","msteams","googlechat","irc","imessage","sms","nextcloud-talk","nostr","synology-chat","tlon","twitch","zalo","zalouser","clickclack","raft","qa-channel"]);function _z(t){return i1.get(t)??wz[t]??t}function Cz(t){return kz[t]??"📡"}function dF(t){return Sz.has(t)}async function wk(){const t=await Je.channels.catalog();if(t.success&&Array.isArray(t.data))return xz(t.data),t.data.map(n=>n.type);const e=await Je.channels.types();return e.success&&Array.isArray(e.data)?e.data:[]}const Az=Nn((t,e)=>({channels:[],availableTypes:[],typesLoaded:!1,loading:!1,error:null,formOpen:!1,editing:null,qrOpen:!1,qrChannel:null,selectedType:null,loadTypes:async()=>{const n=await wk();t({availableTypes:n,typesLoaded:!0});const{selectedType:a}=e();a&&n.length>0&&!n.includes(a)&&t({selectedType:null})},load:async()=>{t({loading:!0,error:null});const n=await wk(),a=await Je.channels.list(),r=a.success&&Array.isArray(a.data)?a.data:[];t({loading:!1,channels:r,availableTypes:n,typesLoaded:!0,...a.success&&!Array.isArray(a.data)?{error:"服务端返回的频道数据格式异常"}:a.success?{}:{error:a.error??"Failed to load"}});const i=e();if(!i.selectedType&&n.length>0){const l=r.find(c=>n.includes(c.type));l&&t({selectedType:l.type})}else i.selectedType&&n.length>0&&!n.includes(i.selectedType)&&t({selectedType:null})},create:async n=>{const a=await Je.channels.create(n);return a.success?(await e().load(),t({formOpen:!1,editing:null}),!0):(t({error:a.error??"Create failed"}),!1)},update:async(n,a)=>{const r=await Je.channels.update(n,a);return r.success?(await e().load(),t({formOpen:!1,editing:null}),!0):(t({error:r.error??"Update failed"}),!1)},remove:async n=>{const a=await Je.channels.delete(n);return a.success?(t(r=>({channels:r.channels.filter(i=>i.id!==n)})),!0):(t({error:a.error??"Delete failed"}),!1)},toggle:async(n,a)=>(await Je.channels.toggle(n,a)).success?(t(i=>({channels:i.channels.map(l=>l.id===n?{...l,enabled:a}:l)})),!0):(await e().load(),!1),openForm:n=>t({formOpen:!0,editing:n??null,error:null}),closeForm:()=>t({formOpen:!1,editing:null,error:null}),openQr:n=>t({qrOpen:!0,qrChannel:n??null}),closeQr:()=>{t({qrOpen:!1,qrChannel:null}),e().load()},clearError:()=>t({error:null}),selectType:n=>{const a=e();n&&a.availableTypes.length>0&&!a.availableTypes.includes(n)||t({selectedType:n,error:null})},updateChannelStatus:n=>{t(a=>({channels:a.channels.map(r=>r.id===n.channelId?{...r,connected:n.connected,_state:n.state}:r)}))}})),f6=["(the run was interrupted by the user while waiting for an answer","(tool call interrupted by the user before a result was recorded)"];function Tz(t){return t.trim().length>0}function Ez(t,e){if(!(t!=null&&t.length)||!e.length)return[];const n=new Map;for(const r of t){if(r.type!=="tool")continue;const i=typeof r.toolCallId=="string"?r.toolCallId:"";if(!i)continue;const l=typeof r.content=="string"?r.content:"";Tz(l)&&n.set(i,l)}if(n.size===0)return[];const a=[];for(const r of e){const i=n.get(r.id);if(i===void 0)continue;const l=r.status==="running",c=r.status==="error"&&r.ended!==void 0&&r.ended!==null;if(!l&&!c)continue;if(f6.some(p=>i.includes(p))){a.push({id:r.id,status:"error",result:i,ended:void 0,waitingUser:void 0});continue}a.push({id:r.id,status:"completed",result:i,ended:void 0,waitingUser:void 0})}return a}const Nz=["start","content","thinking","tool_call","tool_result","tool_diff","tool_output","cache_stats","turn_summary","web_search","complete","generation_paused","generation_resumed","error","context_compressed","compaction_progress","compaction_started","compaction_finished","context_analysis","threshold_warning","blocking_limit","context_blocked","stall_detected"],P0=(t,e=[])=>{if(typeof t=="string"){const a=t.trim();if(!a)return e;if(a.startsWith("{")||a.startsWith("[")){try{const r=JSON.parse(a);P0(r,e)}catch{e.push(a)}return e}return e.push(a),e}if(Array.isArray(t))return t.forEach(a=>P0(a,e)),e;if(!t||typeof t!="object")return e;const n=t;for(const a of["content","message"]){const r=n[a];typeof r=="string"&&r.trim()?e.push(r.trim()):r!=null&&typeof r=="object"&&P0(r,e)}return e},Rz=t=>{if(typeof t=="string"){const n=t.trim();if(!n)return"";if(!n.startsWith("{")&&!n.startsWith("["))return n}const e=P0(t);return e[e.length-1]||""};function kk(...t){for(const e of t){if(e==null||e==="")continue;const n=Number(e);if(Number.isFinite(n))return n}}function Dz(t){const e=Me.getState().messagesBySession[t]||[],n=[];for(const a of e){for(const r of a.toolCalls||[])n.push({id:r.id,name:r.name,status:r.status,result:r.result,ended:r.ended??null,waitingUser:r.waitingUser});for(const r of a.steps||[])for(const i of r.toolCalls||[])n.push({id:i.id,name:i.name,status:i.status,result:i.result,ended:i.ended??null,waitingUser:i.waitingUser})}return n}async function Mz(){const t=[...Me.getState().generatingSessions];t.length!==0&&await Promise.all(t.map(async e=>{try{const n=await Je.sessions.resume(e);if(!n.success||!n.data)return;const a=Ez(n.data.messages,Dz(e));if(a.length>0&&Me.getState().applyToolCallPatches(e,a),n.data.activeRun)return;const r=Me.getState();r.isGenerating(e)&&r.endGeneration(e,void 0,{force:!0})}catch{}}))}function Oz(){try{const t=window,e=t.__pendingQuestions;if(!e)return;const n=t.__answeredQuestionIds||new Set,a=Me.getState();for(const r of Object.keys(e)){const i=e[r],l=i==null?void 0:i.questionId;!l||n.has(l)||(a.markWaitingUserToolCall(r,"ask_user_question"),window.dispatchEvent(new CustomEvent("ask-question-required",{detail:r})))}}catch{}}function Lz({activeTab:t,setLogs:e,setUnreadLogs:n}){const a=Me,r=N.useCallback(h=>{if(!h)return{};if(typeof h=="object")return h;if(typeof h!="string")return{};try{return JSON.parse(h)}catch{return{}}},[]),i=N.useCallback((h,m,b,x)=>{const w=r(m),S=ot.getState(),C=Me.getState();if(h==="workflow_plan_ready"&&w.planId){S.setPlan(b,{planId:String(w.planId),title:typeof w.title=="string"&&w.title?String(w.title):"工作流计划",reason:typeof w.reason=="string"?String(w.reason):void 0,confirm:w.confirm===!0,nodes:Array.isArray(w.nodes)?w.nodes:void 0,parallelGroups:Array.isArray(w.parallelGroups)?w.parallelGroups.map(ye=>Array.isArray(ye)?ye.map(String):[]):void 0,estimatedTokens:typeof w.estimatedTokens=="number"?w.estimatedTokens:void 0,runtimeAvailable:w.runtimeAvailable===!0,createdAt:Date.now()});return}if(h==="workflow_confirm_ack"){S.clearPlan(b);return}if(h==="dwf_offer"&&w.offerId){S.setDwfOffer(b,{offerId:String(w.offerId),sessionId:b,fileName:typeof w.fileName=="string"?String(w.fileName):"",filePath:typeof w.filePath=="string"?String(w.filePath):void 0,title:typeof w.title=="string"?String(w.title):"",description:typeof w.description=="string"?String(w.description):void 0,phases:Array.isArray(w.phases)?w.phases:void 0,agentCount:typeof w.agentCount=="number"?w.agentCount:void 0,tokenWarning:typeof w.tokenWarning=="string"?String(w.tokenWarning):void 0,scriptPreview:typeof w.scriptPreview=="string"?String(w.scriptPreview):void 0,createdAt:Date.now()});return}if(h==="dwf_confirm_ack"){S.clearDwfOffer(b,w.offerId?String(w.offerId):"");return}if(h==="dwf_promotable"&&w.workflowId){S.setDwfPromotable(b,{workflowId:String(w.workflowId),sessionId:b,name:typeof w.name=="string"?String(w.name):void 0,runs:typeof w.runs=="number"?w.runs:void 0,successRate:typeof w.successRate=="number"?w.successRate:void 0,avgTokens:typeof w.avgTokens=="number"?w.avgTokens:void 0,lastRunAt:typeof w.lastRunAt=="number"?w.lastRunAt:void 0,createdAt:Date.now()});return}if(h==="dwf_promote_ack"){S.clearDwfPromotable(b,w.workflowId?String(w.workflowId):void 0);return}const E=w.runId||x||"";if(!E)return;if(h==="workflow_error"){S.fail(b,E,w.error||"Workflow failed"),(C.isGenerating(b)||C.isPaused(b))&&C.endGeneration(b,w.error||"Workflow failed");return}const T=h==="workflow_finished"?w.status||"COMPLETED":h==="workflow_started"?w.status||"RUNNING":h==="workflow_paused"?w.status||"PAUSED":h==="workflow_resumed"?w.status||"RESUMING":h==="workflow_cancelled"?w.status||"CANCELLED":w.status||void 0,L=w.type||h,D=w.data&&typeof w.data=="object"?w.data:{},B=String(w.kind||D.kind||""),H=w.nodeId||w.node_id||D.nodeId||D.node_id,K=w.role||w.agentRole||w.agent_role||D.role||D.agentRole||D.agent_role,U=w.phase||w.phaseId||D.phase||D.phaseId,q=w.effectId||D.effectId||H,re=w.toolName||w.tool_name||D.toolName||D.tool_name,_e=w.error||D.error,G=["effect.scheduled","effect.completed","effect.failed"].includes(L)&&H&&B!=="tool",me=["effect.scheduled","effect.completed","effect.failed"].includes(L)&&B==="tool"&&(re||H),ge=H?S.getAgentsForSession(b).find(ye=>ye.id===String(H)):void 0;if(S.upsert(b,{runId:E,status:T,title:typeof w.title=="string"&&w.title?String(w.title):void 0,completedPhases:kk(w.completedNodes,w.completedPhases),totalPhases:kk(w.totalNodes,w.totalPhases),completedEffects:Number(w.completedEffects||0),totalEffects:Number(w.totalEffects||0),tokensUsed:Number(w.tokensUsed||0),tokensRemaining:Number(w.tokensRemaining||0),lastEventType:L,agentNode:G?{nodeId:String(H),role:String(K||(ge==null?void 0:ge.role)||(ge==null?void 0:ge.name)||"agent"),phase:U?String(U):ge==null?void 0:ge.phase,status:L==="effect.failed"?"failed":L==="effect.completed"?"completed":"scheduled",tokens:w.tokensUsed!=null?Number(w.tokensUsed):D.tokens!=null&&typeof D.tokens=="number"?Number(D.tokens):void 0,error:_e?String(_e):void 0,updatedAt:Date.now()}:void 0}),me){const ye=L==="effect.failed"?"failed":L==="effect.completed"?"completed":"running",P=String(q||`${E}-${re||H}`);S.upsertTask(b,{id:P,title:String(re||H),description:H?String(H):void 0,status:ye,source:"workflow",runId:E,result:D.artifactRef?String(D.artifactRef):void 0,error:_e?String(_e):void 0,raw:w}),S.recordEvent(b,{type:L,source:"workflow",title:String(re||H),status:ye,runId:E,taskId:P,message:_e?String(_e):void 0,data:w})}if((h==="workflow_started"||h==="workflow_handoff")&&Array.isArray(w.nodes))S.setNodes(b,E,w.nodes);else if(h==="workflow_node_start"&&H)S.setNodeStatus(b,E,String(H),{status:"running"});else if(h==="workflow_node_complete"&&H){const ye=Number(D.durationMs??w.durationMs),P=Number(D.attempts??w.attempts);S.setNodeStatus(b,E,String(H),{status:String(D.status||w.status||"completed"),result:(D.result??w.result)!=null?String(D.result??w.result):void 0,error:_e?String(_e):void 0,durationMs:Number.isFinite(ye)&&ye>=0?ye:void 0,attempts:Number.isFinite(P)&&P>1?P:void 0})}else if(h==="workflow_node_retry"&&H){const ye=Number(D.attempt??w.attempt);Number.isFinite(ye)&&ye>1&&S.setNodeStatus(b,E,String(H),{attempts:ye})}if(h==="workflow_started")S.clearPlan(b),C.startGeneration(b);else if(h==="workflow_finished"){S.finalizeNodes(b,E,String(T||"COMPLETED"));const ye=Rz(w.output);if(ye){const P=C.getMessages(b),oe=P[P.length-1];(oe==null?void 0:oe.type)==="assistant"?C.appendToLastMessage(b,ye):C.addMessage(b,{id:ar(),type:"assistant",content:ye,timestamp:Date.now()})}C.endGeneration(b)}else h==="workflow_cancelled"?(S.finalizeNodes(b,E,"CANCELLED"),C.endGeneration(b,"workflow cancelled by user")):T==="PAUSED"?C.pauseGeneration(b):(T==="RUNNING"||T==="RESUMING")&&C.resumeGeneration(b)},[r]),l=N.useCallback((h,m)=>{const b=r(h),x=Array.isArray(b.runs)?b.runs:[];if(x.length===0)return;const w=x.slice().sort((T,L)=>String(L.updatedAt||"").localeCompare(String(T.updatedAt||"")))[0],S=String(w.status||"").toUpperCase();if(!S)return;const C=ot.getState(),E=String(w.runId||"");if(C.upsert(m,{runId:E,status:S,title:w.workflowId?`workflow: ${String(w.workflowId)}`:void 0,totalPhases:Number(w.totalNodes||0),completedPhases:Number(w.completedNodes||0),lastEventType:"workflow_status",error:w.error?String(w.error):void 0}),["COMPLETED","FAILED","ERROR","CANCELLED","CANCELED","PAUSED"].includes(S)){C.recordEvent(m,{type:"workflow_status",source:"workflow",title:`Workflow ${S}`,message:w.output?String(w.output).slice(0,200):w.error?String(w.error):void 0,status:S==="COMPLETED"?"completed":"failed",runId:E,data:w});const T=a.getState();(T.isGenerating(m)||T.isPaused(m))&&T.clearGenerating(m)}},[r]),c=N.useCallback(h=>{var w;const b=a.getState().messagesBySession[h]||[],x=b[b.length-1];return(w=x==null?void 0:x.steps)==null?void 0:w[x.steps.length-1]},[a]),d=N.useCallback((h,m,b)=>{const x=c(h),w=m==="step_complete",S=x&&(x.status==="success"||x.status==="error");if(!x||S&&!w){const C=(b==null?void 0:b.step)||m.replace("step_","").replace("_"," ");return a.getState().addStep(h,{id:`step-${Date.now()}`,title:C,description:(b==null?void 0:b.description)||"Executing...",status:"running",timestamp:Date.now()}),c(h)}return x},[c,a]),p=N.useCallback(h=>{var w,S;const m=h.type,b=h.data;if(m==="model_name"){qm(m,b,h.sessionId||"",{activeTab:t,setLogs:e,setUnreadLogs:n},h);return}if(m==="models_updated"||m==="models.updated"){window.dispatchEvent(new CustomEvent("models-updated"));return}if(m==="workspace_changed"){qm(m,b,h.sessionId||"",{activeTab:t,setLogs:e,setUnreadLogs:n});return}if(m==="mode_state"){try{const C=r(b);bi.getState().applyModeState(typeof(C==null?void 0:C.mode)=="string"?C.mode:void 0,typeof(C==null?void 0:C.source)=="string"?C.source:void 0)}catch{}return}if(m==="session_renamed"){const C=r(b),E=(C==null?void 0:C.sessionId)||h.sessionId,T=typeof(C==null?void 0:C.title)=="string"?C.title.trim():"";if(E&&T){const L=Ge.getState(),D=L.sessionTabs.find(B=>B.id===E)||L.historySessions.find(B=>B.id===E);D&&!D.renamed&&L.renameSessionTab(E,T)}return}if(m==="question_answer_ack"){const C=r(b),E=C==null?void 0:C.questionId;let T=h.sessionId||"";if(E){const L=window;L.__answeredQuestionIds=L.__answeredQuestionIds||new Set,L.__answeredQuestionIds.add(E);const D=L.__pendingQuestions||{};for(const B of Object.keys(D))((w=D[B])==null?void 0:w.questionId)===E&&(T||(T=B),delete D[B]);((S=L.__pendingQuestion)==null?void 0:S.questionId)===E&&(L.__pendingQuestion=null)}T&&Me.getState().clearWaitingUserToolCalls(T),window.dispatchEvent(new CustomEvent("ask-question-dismiss",{detail:C==null?void 0:C.questionId}));return}if(m==="error"&&!h.sessionId){xa.error("Request failed",d6(b));return}const x=h.sessionId||"";if(!x){if(m==="task_update"||m==="task_finished"||m==="task_error"){const C=r(b);C&&typeof C.sessionId=="string"&&C.sessionId&&Vm(b,C.sessionId)}return}if(m==="hook_ask"){hz(b,x);return}if(m==="ask_user_question"){yz(b,x);return}if(m==="task_update"){Vm(b,x);return}if(m==="task_output"){try{a.getState().appendToLastMessage(x,String(b||""))}catch{}return}if(m==="task_finished"||m==="task_error"){m==="task_error"?xa.error("Task error",String(b)):Vm(b,x);return}if(m==="filejob_start"||m==="filejob_progress"||m==="filejob_result"||m==="filejob_error"){vz(m,b,x);return}if(m.startsWith("step_")){mz(m,b,x,d);return}if(m.startsWith("plan_")){try{T0(m,b,x)}catch(C){xa.error(`Failed to handle ${m}`,String(C))}return}if(m.startsWith("goal_")){if(m==="goal_route_decision"){try{const C=typeof b=="string"?JSON.parse(b):b||{},E=String(C.tier||"");if(E){const T=E==="simple"?"快速模式":E==="medium"?"标准模式":"完整模式";ot.getState().recordEvent(x,{type:"goal_route_decision",source:"goal",title:`✓ 已选择${T}`,message:String(C.summary||""),runId:String(C.runId||h.runId||"")||void 0,status:"completed",data:C})}}catch{}return}try{T0(m,b,x)}catch(C){xa.error(`Failed to handle ${m}`,String(C))}return}if(m.startsWith("agent_")){try{T0(m,b,x)}catch(C){xa.error(`Failed to handle ${m}`,String(C))}return}if(m.startsWith("mode_")){try{T0(m,b,x)}catch(C){xa.error(`Failed to handle ${m}`,String(C))}return}if(m==="todo_update"){gz(b,x);return}if(m==="todo_item_done"){bz(b,x);return}if(m!=="todo_progress"){if(m==="automation.update"){xk.automationUpdate(b);return}if(m==="automation.run"){xk.automationRun(b);return}if(m!=="tool.approval_required"){if(["workflow_started","workflow_event","workflow_progress","workflow_finished","workflow_error","workflow_checkpoint","workflow_node_start","workflow_node_complete","workflow_node_retry","workflow_paused","workflow_resumed","workflow_cancelled","workflow_handoff","workflow_plan_ready","workflow_confirm_ack","workflow_recovered","dwf_offer","dwf_confirm_ack","dwf_promotable","dwf_promote_ack","dwf_cancelled"].includes(m)){i(m,b,x,h.runId);return}if(m==="workflow_status"){l(b,x);return}if(Nz.includes(m)){dz(m,b,x,h.nodeId);return}if(m==="channel_status"){try{const C=JSON.parse(b||"{}");Az.getState().updateChannelStatus(C)}catch{}return}if(m==="channel_message"||m==="channel_error"){try{const C=typeof b=="string"?JSON.parse(b):b||{},E=C.channelName||C.channelType||C.channelId||C.channel||C.platform||"Channel";if(m==="channel_error")ut.error(`${E}: ${C.error||C.message||"channel error"}`);else{const T=C.senderName||C.senderId||C.from||C.sender||"",L=String(C.text||C.content||C.message||"");L.trim()&&(ut.info(`📨 ${E}${T?` · ${T}`:""}: ${L.slice(0,120)}`),Me.getState().addMessage(x,{id:ar(),type:"user",content:L,timestamp:Date.now(),channel:{...C.channelId?{channelId:String(C.channelId)}:{},...C.channelType?{channelType:String(C.channelType)}:{},...C.senderId?{senderId:String(C.senderId)}:{},...C.senderName?{senderName:String(C.senderName)}:{},...C.isGroup?{isGroup:!0}:{}}}))}}catch{}return}if(m==="session_switched"){try{const C=typeof b=="string"?JSON.parse(b):b||{},E=C.id||C.sessionId||(typeof b=="string"?b:"");E&&Ge.getState().setActiveSession(String(E))}catch{}return}if(m==="task_interrupted"){try{const C=typeof b=="string"?JSON.parse(b):b||{},E=C.title||C.taskId||"Task";ut.warning(`⏸ ${E} interrupted — 使用 /continue 恢复生成`,1e4)}catch{ut.warning("A running task was interrupted",1e4)}return}if(m==="code_review_ready"){try{const C=typeof b=="string"?JSON.parse(b):b||{},E=C.title||C.skillId||"Code Review",T=C.summary||"";ut.success(`🔍 ${E} ready${T?`: ${String(T).slice(0,120)}`:""}`,8e3)}catch{ut.success("🔍 Code review ready",8e3)}return}if(m==="hook_auto_ack"){try{const C=typeof b=="string"?JSON.parse(b):b||{};ut.info(`Hook auto-approved: ${C.tool||C.name||"tool"}`,4e3)}catch{}return}if(m==="throttle"){try{const C=typeof b=="string"?JSON.parse(b):b||{},E=C.limit||C.remaining!=null?` (${C.remaining} left)`:"";ut.warning(`⚠ Rate limited${E}`,6e3)}catch{}return}if(["token_update","context_breakdown","auth_required","auth_success","auth_failed","log","commands_list","ping","degradation_update","doctor_result","session_created","session_resumed","session_delegation_start","session_delegation_end","mcp_update","hook_response_ack","notification"].includes(m)){qm(m,b,x,{activeTab:t,setLogs:e,setUnreadLogs:n});return}}}},[t,d,i,l,r,e,n]);N.useEffect(()=>{De.connect();const h=De.onMessage(p),m=De.onReconnectGiveUp(()=>{const x=Me.getState();for(const w of x.generatingSessions)x.endGeneration(w,"WebSocket disconnected")}),b=De.onOpen(()=>{var w;const x=((w=De.getSessionId)==null?void 0:w.call(De))||Ge.getState().activeSessionId;if(x){De.send({type:"get_workflow_status",sessionId:x,data:JSON.stringify({sessionId:x})});const S=bi.getState().mode;De.send({type:"plan_mode_change",sessionId:x,data:JSON.stringify({mode:S})})}Mz(),Oz()});return()=>{h(),m(),b()}},[p])}const ou={linear:{id:"linear",nameKey:"settings.themePresetLinear",descriptionKey:"settings.themePresetLinearDesc",dark:{bg:"#0a0a0c",surface:"#121215",border:"#26262b",text:"#e4e4e7",muted:"#8e8e96",accentBlue:"#7c83f8",accentGreen:"#4ade80",accentRed:"#f87171",accentYellow:"#fbbf24",accentPurple:"#c084fc"},light:{bg:"#ffffff",surface:"#f6f6f7",border:"#e4e4e8",text:"#18181b",muted:"#71717a",accentBlue:"#5e6ad2",accentGreen:"#16a34a",accentRed:"#dc2626",accentYellow:"#b45309",accentPurple:"#7c3aed"}},mimo:{id:"mimo",nameKey:"settings.themePresetMimo",descriptionKey:"settings.themePresetMimoDesc",dark:{bg:"#fcfaf8",surface:"#f6f1ea",border:"#e7dfd5",text:"#26251e",muted:"#5a574f",accentBlue:"#26251e",accentGreen:"#1f7a4d",accentRed:"#b84f42",accentYellow:"#a16b2d",accentPurple:"#7a5c8f"},light:{bg:"#ffffff",surface:"#f8f4ef",border:"#e2d8cd",text:"#24221c",muted:"#605b52",accentBlue:"#26251e",accentGreen:"#1f7a4d",accentRed:"#b84f42",accentYellow:"#a16b2d",accentPurple:"#7a5c8f"}},github:{id:"github",nameKey:"settings.themePresetGithub",descriptionKey:"settings.themePresetGithubDesc",dark:{bg:"#0d1117",surface:"#161b22",border:"#30363d",text:"#c9d1d9",muted:"#8b949e",accentBlue:"#58a6ff",accentGreen:"#238636",accentRed:"#f85149",accentYellow:"#d29922",accentPurple:"#a855f7"},light:{bg:"#ffffff",surface:"#f6f8fa",border:"#d0d7de",text:"#24292f",muted:"#57606a",accentBlue:"#0969da",accentGreen:"#1a7f37",accentRed:"#cf222e",accentYellow:"#9a6700",accentPurple:"#8250df"}},cherry:{id:"cherry",nameKey:"settings.themePresetCherry",descriptionKey:"settings.themePresetCherryDesc",dark:{bg:"#0f1419",surface:"#1a2332",border:"#2d3f50",text:"#e1e8ed",muted:"#8899aa",accentBlue:"#01a9ff",accentGreen:"#00c853",accentRed:"#ff5252",accentYellow:"#ffab00",accentPurple:"#7c4dff"},light:{bg:"#f5f9ff",surface:"#ffffff",border:"#cce0ff",text:"#1a2332",muted:"#5c6f87",accentBlue:"#0160ff",accentGreen:"#00a844",accentRed:"#e53935",accentYellow:"#f9a825",accentPurple:"#651fff"}},ocean:{id:"ocean",nameKey:"settings.themePresetOcean",descriptionKey:"settings.themePresetOceanDesc",dark:{bg:"#0b1e2e",surface:"#122b3d",border:"#1e4057",text:"#d4e6f5",muted:"#7a9bb5",accentBlue:"#00bcd4",accentGreen:"#26a69a",accentRed:"#ef5350",accentYellow:"#ffca28",accentPurple:"#ab47bc"},light:{bg:"#edf7fc",surface:"#ffffff",border:"#b3d9e8",text:"#0b1e2e",muted:"#4f7a94",accentBlue:"#00838f",accentGreen:"#00897b",accentRed:"#d32f2f",accentYellow:"#f57f17",accentPurple:"#8e24aa"}},mint:{id:"mint",nameKey:"settings.themePresetMint",descriptionKey:"settings.themePresetMintDesc",dark:{bg:"#0d1f1c",surface:"#162d28",border:"#264b41",text:"#d1f0e8",muted:"#7dafa3",accentBlue:"#26c6da",accentGreen:"#66bb6a",accentRed:"#ef5350",accentYellow:"#ffd54f",accentPurple:"#ad8aff"},light:{bg:"#edf7f4",surface:"#ffffff",border:"#b8d9cf",text:"#0d1f1c",muted:"#4a7f72",accentBlue:"#0097a7",accentGreen:"#388e3c",accentRed:"#d32f2f",accentYellow:"#f9a825",accentPurple:"#7c4dff"}},lavender:{id:"lavender",nameKey:"settings.themePresetLavender",descriptionKey:"settings.themePresetLavenderDesc",dark:{bg:"#1a1428",surface:"#261f38",border:"#3c3354",text:"#e2daf2",muted:"#9387b5",accentBlue:"#86bef5",accentGreen:"#81c784",accentRed:"#ef9a9a",accentYellow:"#ffe082",accentPurple:"#ce93d8"},light:{bg:"#f5f0ff",surface:"#ffffff",border:"#d4c8e8",text:"#1a1428",muted:"#6c5b8a",accentBlue:"#1565c0",accentGreen:"#2e7d32",accentRed:"#c62828",accentYellow:"#f57f17",accentPurple:"#7b1fa2"}},midnight:{id:"midnight",nameKey:"settings.themePresetMidnight",descriptionKey:"settings.themePresetMidnightDesc",dark:{bg:"#0a0e1a",surface:"#111726",border:"#1e2740",text:"#c8d2e8",muted:"#6a7596",accentBlue:"#4fc3f7",accentGreen:"#4caf50",accentRed:"#e57373",accentYellow:"#ffd54f",accentPurple:"#b39ddb"},light:{bg:"#eef1f7",surface:"#ffffff",border:"#c0c9dc",text:"#0a0e1a",muted:"#4f5a78",accentBlue:"#0288d1",accentGreen:"#2e7d32",accentRed:"#d32f2f",accentYellow:"#f57f17",accentPurple:"#5e35b1"}},sunset:{id:"sunset",nameKey:"settings.themePresetSunset",descriptionKey:"settings.themePresetSunsetDesc",dark:{bg:"#1e1410",surface:"#2a1d16",border:"#443124",text:"#f0dfcf",muted:"#b8957a",accentBlue:"#5fa5e8",accentGreen:"#81c784",accentRed:"#ff7043",accentYellow:"#ffb74d",accentPurple:"#e0a0e0"},light:{bg:"#fff6f0",surface:"#ffffff",border:"#f0d5c0",text:"#2a1d16",muted:"#8a6e5a",accentBlue:"#1976d2",accentGreen:"#388e3c",accentRed:"#e64a19",accentYellow:"#ef6c00",accentPurple:"#8e24aa"}},forest:{id:"forest",nameKey:"settings.themePresetForest",descriptionKey:"settings.themePresetForestDesc",dark:{bg:"#0e1a12",surface:"#172a1d",border:"#2a4733",text:"#d1e8d6",muted:"#7da684",accentBlue:"#5bb8e8",accentGreen:"#66bb6a",accentRed:"#ef9a9a",accentYellow:"#e6c35c",accentPurple:"#ae8ad9"},light:{bg:"#f0f7f0",surface:"#ffffff",border:"#b8d9be",text:"#0e1a12",muted:"#477a50",accentBlue:"#1565c0",accentGreen:"#2e7d32",accentRed:"#c62828",accentYellow:"#827717",accentPurple:"#6a1b9a"}},candy:{id:"candy",nameKey:"settings.themePresetCandy",descriptionKey:"settings.themePresetCandyDesc",dark:{bg:"#16101a",surface:"#22182a",border:"#3d284a",text:"#f0def5",muted:"#b28dc2",accentBlue:"#5fc3f5",accentGreen:"#81e080",accentRed:"#ff6b6b",accentYellow:"#ffd93d",accentPurple:"#e066ff"},light:{bg:"#faf0ff",surface:"#ffffff",border:"#e0cce8",text:"#1a0a24",muted:"#7a5c8a",accentBlue:"#1976d2",accentGreen:"#388e3c",accentRed:"#d32f2f",accentYellow:"#f9a825",accentPurple:"#8e24aa"}},nord:{id:"nord",nameKey:"settings.themePresetNord",descriptionKey:"settings.themePresetNordDesc",dark:{bg:"#2e3440",surface:"#3b4252",border:"#4c566a",text:"#eceff4",muted:"#81a1c1",accentBlue:"#88c0d0",accentGreen:"#a3be8c",accentRed:"#bf616a",accentYellow:"#ebcb8b",accentPurple:"#b48ead"},light:{bg:"#f5f7fa",surface:"#ffffff",border:"#d8dee9",text:"#2e3440",muted:"#5e6d85",accentBlue:"#5e81ac",accentGreen:"#6f9e6f",accentRed:"#bf616a",accentYellow:"#b48d56",accentPurple:"#8f6f9e"}}},o1="linear";function Sk(t,e,n){const a=ou[t]||ou[o1];if(!a)return{bg:"#fcfaf8",surface:"#f6f1ea",border:"#e7dfd5",text:"#26251e",muted:"#5a574f",accentBlue:"#26251e",accentGreen:"#1f7a4d",accentRed:"#b84f42",accentYellow:"#a16b2d",accentPurple:"#7a5c8f"};const r={...e==="dark"?a.dark:a.light};return n&&Object.assign(r,n),r}const Mr=t=>{const e=parseInt(t.slice(1,3),16),n=parseInt(t.slice(3,5),16),a=parseInt(t.slice(5,7),16);return`${e} ${n} ${a}`},jz=(t,e,n)=>{const a=[parseInt(t.slice(1,3),16),parseInt(t.slice(3,5),16),parseInt(t.slice(5,7),16)],r=[parseInt(e.slice(1,3),16),parseInt(e.slice(3,5),16),parseInt(e.slice(5,7),16)];return a.map((i,l)=>Math.round(i+((r[l]??i)-i)*n)).join(" ")};function _k(t,e,n,a,r){n.classList.toggle("dark",t==="dark"),n.classList.toggle("light",t==="light"),n.style.setProperty("--color-bg",Mr(e.bg)),n.style.setProperty("--color-surface",Mr(e.surface)),n.style.setProperty("--color-border",Mr(e.border)),n.style.setProperty("--color-text",Mr(e.text)),n.style.setProperty("--color-muted",Mr(e.muted)),n.style.setProperty("--color-accent-blue",Mr(e.accentBlue)),n.style.setProperty("--color-accent-green",Mr(e.accentGreen)),n.style.setProperty("--color-accent-red",Mr(e.accentRed)),n.style.setProperty("--color-accent-yellow",Mr(e.accentYellow)),n.style.setProperty("--color-accent-purple",Mr(e.accentPurple)),n.style.setProperty("--color-hover",jz(e.surface,e.text,.06)),a&&a.setAttribute("content",e.bg),r&&r.setAttribute("content",t)}function Bz({theme:t,themePresetId:e,customTheme:n,customThemeEnabled:a}){N.useEffect(()=>{const r=document.documentElement,i=document.querySelector('meta[name="theme-color"]'),l=document.querySelector('meta[name="color-scheme"]'),c=t==="dark"?"dark":t==="light"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",d=a?n:void 0,p=Sk(e||o1,c,d);if(_k(c,p,r,i,l),t==="auto"){const h=window.matchMedia("(prefers-color-scheme: dark)"),m=()=>{const b=h.matches?"dark":"light",x=Sk(e||o1,b,d);_k(b,x,r,i,l)};return h.addEventListener("change",m),()=>h.removeEventListener("change",m)}},[t,e,n,a])}function Iz(t){return typeof t.content!="string"||!/^Error:\s*\S/.test(t.content)||Array.isArray(t.toolCalls)&&t.toolCalls.length>0||typeof t.thinking=="string"&&t.thinking.trim()?null:t.content.replace(/^Error:\s*/,"").trim()}function Pz(t){if(!t)return{};try{const e=JSON.parse(t);return e&&typeof e=="object"&&!Array.isArray(e)?e:t}catch{return t}}function zz(t){const e=new Map;for(const n of t){if(n.type!=="tool"||typeof n.toolCallId!="string"||!n.toolCallId)continue;const a=typeof n.content=="string"?n.content:"";if(!a.trim())continue;const r=typeof n.diff=="string"&&n.diff.trim()?n.diff:void 0;e.set(n.toolCallId,{content:a,diff:r,timestamp:typeof n.timestamp=="number"?n.timestamp:void 0,name:typeof n.name=="string"?n.name:void 0})}return e}function $z(t,e,n){var r,i;const a=[];for(const l of t){const c=typeof(l==null?void 0:l.id)=="string"?l.id:"";if(!c)continue;const d=e.get(c);if(!d)continue;const p=((r=l.function)==null?void 0:r.name)??d.name??"";if(!p)continue;const h=f6.some(m=>d.content.includes(m));a.push({id:c,name:p,args:Pz((i=l.function)==null?void 0:i.arguments),result:d.content,status:h?"error":"completed",timestamp:d.timestamp??n,...d.diff?{diff:d.diff}:{}})}return a}function Fz(t){const e=[];if(!(t!=null&&t.length))return e;const n=zz(t);let a=null;for(const r of t){if(r.type==="tool"||r.type!=="user"&&r.type!=="assistant"&&r.type!=="system")continue;if(r.type!=="assistant"){a=null,e.push({id:r.id||`msg-${r.timestamp||Date.now()}`,type:r.type,content:r.content||"",timestamp:r.timestamp||Date.now(),thinking:r.thinking||void 0,images:r.images&&r.images.length>0?r.images:void 0});continue}const i=Iz(r);if(i){a=null,e.push({id:r.id||`msg-${r.timestamp||Date.now()}`,type:"assistant",content:"",timestamp:r.timestamp||Date.now(),errorCard:u6(i)});continue}if(a?(typeof r.content=="string"&&r.content.trim()&&(a.content=a.content?`${a.content}
|
|
576
|
+
|
|
577
|
+
${r.content}`:r.content),typeof r.thinking=="string"&&r.thinking.trim()&&(a.thinking=a.thinking?`${a.thinking}
|
|
578
|
+
|
|
579
|
+
${r.thinking}`:r.thinking)):(a={id:r.id||`msg-${r.timestamp||Date.now()}`,type:"assistant",content:r.content||"",timestamp:r.timestamp||Date.now(),thinking:r.thinking||void 0},e.push(a)),Array.isArray(r.toolCalls)&&r.toolCalls.length>0&&a){const l=$z(r.toolCalls,n,a.timestamp);l.length>0&&(a.toolCalls=[...a.toolCalls??[],...l])}}return e}function Hz({message:t,onRetry:e}){const{t:n}=at();return g.jsx("div",{className:"flex items-center justify-center h-full w-full bg-dark-bg",children:g.jsxs("div",{className:"max-w-md p-8 text-center",children:[g.jsx("div",{className:"flex justify-center mb-4",children:g.jsx("div",{className:"w-16 h-16 rounded-full bg-accent-red/10 flex items-center justify-center",children:g.jsx(xp,{size:32,className:"text-accent-red"})})}),g.jsx("h2",{className:"text-xl font-semibold text-dark-text mb-2",children:n("error.pageError")}),g.jsx("p",{className:"text-sm text-dark-muted mb-6",children:t||n("error.unknownError")}),g.jsxs("div",{className:"flex items-center justify-center gap-3",children:[g.jsxs("button",{onClick:e,className:"flex items-center gap-2 px-4 py-2 bg-accent-blue text-white rounded-lg hover:opacity-90 transition-opacity",children:[g.jsx(vp,{size:16}),n("common.retry")]}),g.jsx("button",{onClick:()=>window.location.reload(),className:"px-4 py-2 bg-dark-hover text-dark-text rounded-lg hover:bg-dark-border transition-colors",children:n("error.refreshPage")})]})]})})}class Ck extends N.Component{constructor(n){super(n);ne(this,"handleRetry",()=>{this.setState({hasError:!1,error:null})});this.state={hasError:!1,error:null}}static getDerivedStateFromError(n){return{hasError:!0,error:n}}componentDidCatch(n,a){var r,i;console.error("[ErrorBoundary] Caught error:",n,a),(i=(r=this.props).onError)==null||i.call(r,n,a)}render(){var n;return this.state.hasError?this.props.fallback?this.props.fallback:g.jsx(Hz,{message:(n=this.state.error)==null?void 0:n.message,onRetry:this.handleRetry}):this.props.children}}const di=8;function Wm(t,e,n){const a=Math.max(n.width,e.width-di*2),r=Math.max(n.height,e.height-di*2),i=Math.min(Math.max(t.width,n.width),a),l=Math.min(Math.max(t.height,n.height),r),c=Math.max(di,e.width-i-di),d=Math.max(di,e.height-l-di);return{x:Math.min(Math.max(t.x,di),c),y:Math.min(Math.max(t.y,di),d),width:i,height:l}}let pi=null;function Uz(){return(!pi||!pi.isConnected)&&(pi=document.createElement("div"),pi.id="dc-floating-layer",pi.className="fixed inset-0 pointer-events-none",pi.style.zIndex="35",document.body.appendChild(pi)),pi}let Km=0;function Ym(){return{width:window.innerWidth,height:window.innerHeight}}function Gz({title:t,subtitle:e,actions:n,onClose:a,children:r,initialRect:i,minWidth:l=300,minHeight:c=180,resizable:d=!0,className:p,label:h}){const[m,b]=N.useState(()=>{const B=Ym(),H=(i==null?void 0:i.width)??520,K=(i==null?void 0:i.height)??420;return Wm({x:(i==null?void 0:i.x)??B.width-H-32,y:(i==null?void 0:i.y)??88,width:H,height:K},B,{width:l,height:c})}),[x,w]=N.useState(()=>++Km),[S,C]=N.useState(null),E=N.useRef(m);E.current=m;const T={width:l,height:c},L=N.useCallback(B=>H=>{if(H.pointerType==="mouse"&&H.button!==0)return;H.preventDefault();const K=H.currentTarget,U=H.clientX,q=H.clientY,re=E.current;try{K.setPointerCapture(H.pointerId)}catch{}w(++Km),C(B);const _e=me=>{const ge=me.clientX-U,ye=me.clientY-q,P={...re};B==="drag"?(P.x=re.x+ge,P.y=re.y+ye):((B==="e"||B==="se")&&(P.width=re.width+ge),(B==="s"||B==="se")&&(P.height=re.height+ye)),b(Wm(P,Ym(),T))},G=()=>{try{K.releasePointerCapture(H.pointerId)}catch{}K.removeEventListener("pointermove",_e),K.removeEventListener("pointerup",G),K.removeEventListener("pointercancel",G),C(null)};K.addEventListener("pointermove",_e),K.addEventListener("pointerup",G),K.addEventListener("pointercancel",G)},[l,c]);N.useEffect(()=>{if(!S)return;const B=document.body.style.userSelect,H=document.body.style.cursor;return document.body.style.userSelect="none",document.body.style.cursor=S==="drag"?"grabbing":"nwse-resize",()=>{document.body.style.userSelect=B,document.body.style.cursor=H}},[S]),N.useEffect(()=>{const B=()=>b(H=>Wm(H,Ym(),T));return window.addEventListener("resize",B),()=>window.removeEventListener("resize",B)},[l,c]);const D=g.jsxs("div",{role:"dialog","aria-label":h??(typeof t=="string"?t:void 0),"data-testid":"floating-window",onPointerDown:()=>w(++Km),className:Ke("pointer-events-auto absolute flex flex-col overflow-hidden","rounded-lg border border-dark-border bg-dark-surface shadow-xl",p),style:{transform:`translate3d(${m.x}px, ${m.y}px, 0)`,width:m.width,height:m.height,zIndex:x},children:[g.jsxs("div",{"data-testid":"floating-window-handle",onPointerDown:L("drag"),className:Ke("flex shrink-0 select-none items-center gap-2 border-b border-dark-border bg-dark-surface px-2.5 py-1.5",S==="drag"?"cursor-grabbing":"cursor-grab"),children:[g.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-1.5 text-xs",children:[g.jsx("span",{className:"truncate font-medium text-dark-text",children:t}),e&&g.jsx("span",{className:"truncate text-[10px] text-dark-muted/70",children:e})]}),g.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",onPointerDown:B=>B.stopPropagation(),children:[n,g.jsx("button",{type:"button",onClick:a,"data-testid":"floating-window-close","aria-label":h?`${h} — close`:"Close",title:"Close",className:"rounded p-1 text-dark-muted transition-colors hover:bg-dark-hover hover:text-dark-text",children:g.jsx(yn,{size:12})})]})]}),g.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:r}),d&&g.jsxs(g.Fragment,{children:[g.jsx("div",{"data-testid":"floating-window-resize-e",onPointerDown:L("e"),className:"absolute right-0 top-0 h-full w-[3px] cursor-ew-resize"}),g.jsx("div",{"data-testid":"floating-window-resize-s",onPointerDown:L("s"),className:"absolute bottom-0 left-0 h-[3px] w-full cursor-ns-resize"}),g.jsx("div",{"data-testid":"floating-window-resize-se",onPointerDown:L("se"),className:"absolute bottom-0 right-0 h-3.5 w-3.5 cursor-nwse-resize",children:g.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14","aria-hidden":"true",className:"text-dark-muted/40",children:[g.jsx("path",{d:"M13 5 L5 13",stroke:"currentColor",strokeWidth:"1.2",fill:"none"}),g.jsx("path",{d:"M13 9 L9 13",stroke:"currentColor",strokeWidth:"1.2",fill:"none"})]})})]})]});return PS.createPortal(D,Uz())}const qz=10;function Vz(t,e=qz){return t.filter(n=>n&&!!n.id&&(n.messageCount??0)>0).sort((n,a)=>String(a.updatedAt||"").localeCompare(String(n.updatedAt||""))).slice(0,e).map(n=>{const a=new Date(n.createdAt).getTime()||Date.now(),r=new Date(n.updatedAt).getTime()||a;return{id:n.id,title:n.title||n.id,createdAt:a,lastActiveAt:r,messageCount:n.messageCount??0,...n.preview?{preview:n.preview}:{}}})}function Wz(t){if(!t)return"";const e=[];for(const n of Object.values(t))(n==null?void 0:n.source)==="todo"&&n.title&&e.push(n.title);return e.sort().join("\0")}function Kz(t,e,n){return n?t.includes(n)?{tabs:t,active:n}:{tabs:[...t,n],active:n}:{tabs:t,active:e}}function Yz(t,e,n){const a=t.indexOf(n);if(a===-1)return{tabs:t,active:e};const r=t.filter(i=>i!==n);return e!==n?{tabs:r,active:e}:r.length===0?{tabs:r,active:null}:{tabs:r,active:r[Math.min(a,r.length-1)]??null}}const Ak={showRightSidebar:!1,rightSidebarView:"artifacts",previewTabs:[],previewFilePath:null,previewFloating:!1,rightSidebarMaximized:!1};function Zz(t){const[e,n]=N.useState({}),a=(t?e[t]:void 0)??Ak,r=N.useCallback((b,x)=>{n(w=>{const S=w[b]??Ak,C=x(S);return C===S?w:{...w,[b]:C}})},[]),i=N.useCallback(b=>{t&&r(t,x=>({...x,showRightSidebar:typeof b=="function"?b(x.showRightSidebar):b}))},[t,r]),l=N.useCallback(b=>{t&&r(t,x=>x.rightSidebarView===b?x:{...x,rightSidebarView:b})},[t,r]),c=N.useCallback(b=>{t&&r(t,x=>({...x,previewFloating:typeof b=="function"?b(x.previewFloating):b}))},[t,r]),d=N.useCallback(b=>{t&&r(t,x=>({...x,rightSidebarMaximized:typeof b=="function"?b(x.rightSidebarMaximized):b}))},[t,r]),p=N.useCallback(b=>{!t||!b||r(t,x=>{const w=Kz(x.previewTabs,x.previewFilePath,b);return{...x,previewTabs:w.tabs,previewFilePath:w.active}})},[t,r]),h=N.useCallback(b=>{t&&r(t,x=>{const w=Yz(x.previewTabs,x.previewFilePath,b);return{...x,previewTabs:w.tabs,previewFilePath:w.active,previewFloating:w.active?x.previewFloating:!1}})},[t,r]),m=N.useCallback(()=>{t&&r(t,b=>({...b,previewTabs:[],previewFilePath:null,previewFloating:!1}))},[t,r]);return N.useEffect(()=>{!t||!a.previewFloating||a.previewFilePath||r(t,b=>b.previewFloating&&!b.previewFilePath?{...b,previewFloating:!1}:b)},[t,a.previewFloating,a.previewFilePath,r]),{showRightSidebar:a.showRightSidebar,rightSidebarView:a.rightSidebarView,previewTabs:a.previewTabs,previewFilePath:a.previewFilePath,previewFloating:a.previewFloating,rightSidebarMaximized:a.rightSidebarMaximized,setShowRightSidebar:i,setRightSidebarView:l,setPreviewFloating:c,setRightSidebarMaximized:d,openPreviewTab:p,closePreviewTab:h,closePreview:m}}function Tk(t,e){const n=(e==null?void 0:e.wan)??"万",a=(e==null?void 0:e.yi)??"亿";if(t>=1e8)return`${(t/1e8).toFixed(1)}${a}`;if(t>=1e4){const r=t/1e4;return`${r>=100?r.toFixed(0):r.toFixed(1)}${n}`}return String(Math.round(t))}function Xz(t){return`${t>=10?t.toFixed(0):t.toFixed(1)}%`}const Qz=N.memo(function({open:e,onClose:n}){const{t:a}=at(),r=Xe(D=>D.currentUsage),i=Xe(D=>D.maxContextTokens),l=Xe(D=>D.contextBreakdown),c=Xe(D=>D.cacheStats),d=Xe(D=>D.estimateTokens),p=Me(D=>D.messagesBySession),h=Ge(D=>D.activeSessionId),m=h?p[h]||[]:[];N.useEffect(()=>{if(!e)return;const D=B=>{B.key==="Escape"&&n()};return window.addEventListener("keydown",D),()=>window.removeEventListener("keydown",D)},[e,n]);const b=N.useMemo(()=>{if(l)return null;let D=0,B=0;for(const H of m){let K=H.content||"",U="";if(H.thinking&&(K+=" "+H.thinking),H.steps)for(const q of H.steps)q.thought&&(K+=" "+q.thought),q.action&&(U+=" "+q.action),q.result&&(U+=" "+q.result);if(H.toolCalls)for(const q of H.toolCalls)U+=" "+(typeof q.args=="string"?q.args:JSON.stringify(q.args));D+=d(K),B+=d(U)}return{messagesTokens:D,toolTokens:B,total:D+B}},[l,m,d]),w=N.useMemo(()=>{const D=l,B=D?D.messagesTokens:(b==null?void 0:b.messagesTokens)??0,H=D?D.toolContentTokens+D.toolDefTokens:(b==null?void 0:b.toolTokens)??0,K=D?D.systemPromptTokens:0,U=D?D.skillTokens:0,q=(D==null?void 0:D.memoryTokens)??0,re=(D==null?void 0:D.skillDiscoveryTokens)??0,_e=(D==null?void 0:D.budgetTokens)??0,G=D?D.mcpToolTokens:0,me=D?D.dynamicTokens:0,ge=D?D.total:(b==null?void 0:b.total)??0,ye=Math.max(0,r.totalTokens-ge)+me,P=Math.max(r.totalTokens,ge,1);return[{key:"system",label:a("chat.ctxSystemPrompt"),tokens:K,color:"bg-dark-text/70"},{key:"tools",label:a("chat.ctxSystemTools"),tokens:H,color:"bg-accent-purple"},{key:"mcp",label:a("chat.ctxMcpTools"),tokens:G,color:"bg-accent-cyan"},{key:"skills",label:a("chat.ctxSkills"),tokens:U,color:"bg-accent-yellow"},{key:"memory",label:a("chat.ctxMemory"),tokens:q,color:"bg-accent-green"},{key:"skillDiscovery",label:a("chat.ctxSkillDiscovery"),tokens:re,color:"bg-accent-teal"},{key:"budget",label:a("chat.ctxBudget"),tokens:_e,color:"bg-accent-red"},{key:"messages",label:a("chat.ctxMessages"),tokens:B,color:"bg-accent-blue"},{key:"other",label:a("chat.ctxOther"),tokens:ye,color:"bg-dark-muted/60"}].map(oe=>({...oe,pct:oe.tokens/P*100}))},[l,b,r.totalTokens,a]).filter(D=>D.pct>=.05||D.tokens>0),S=r.totalTokens,C=i>0?Math.min(100,S/i*100):0,E=C>=90?"bg-accent-red":C>=70?"bg-accent-yellow":"bg-dark-text/70",T=C>=90?"text-accent-red":C>=70?"text-accent-yellow":"text-dark-text",L=c&&c.cacheStatsCalls>0&&c.cacheHitRate!==void 0?c.cacheHitRate:null;return e?g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"fixed inset-0 z-40 bg-black/40 backdrop-blur-[1px]",onClick:n,"aria-hidden":"true"}),g.jsx("div",{className:"fixed inset-x-0 bottom-9 z-50 mx-auto max-w-lg px-2 pb-2",children:g.jsxs("div",{className:"animate-slide-up rounded-t-xl rounded-b-md border border-dark-border bg-dark-surface/95 backdrop-blur shadow-[0_-12px_40px_-10px_rgba(0,0,0,0.6)] overflow-hidden",children:[g.jsxs("div",{className:"flex items-center justify-between px-4 pt-3 pb-2",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(o_,{size:15,className:T}),g.jsx("span",{className:"text-sm font-semibold text-dark-text",children:a("chat.contextCapacity")})]}),g.jsx("button",{type:"button","aria-label":a("a11y.close"),onClick:n,className:"p-1 rounded-md text-dark-muted hover:text-dark-text hover:bg-dark-hover transition-colors",children:g.jsx(yn,{size:15})})]}),g.jsxs("div",{className:"px-4 pb-1",children:[g.jsxs("div",{className:"flex items-baseline gap-2",children:[g.jsxs("span",{className:"text-xl font-bold font-mono text-dark-text",children:[Tk(S,{wan:a("chat.unitWan"),yi:a("chat.unitYi")}),g.jsxs("span",{className:"text-dark-muted text-sm font-normal",children:[" / ",Tk(i,{wan:a("chat.unitWan"),yi:a("chat.unitYi")})]})]}),g.jsxs("span",{className:`text-xs font-mono ${T}`,children:["(",C.toFixed(1),"%)"]})]}),g.jsx("div",{className:"mt-1.5 h-1.5 bg-dark-border/70 rounded-full overflow-hidden",children:g.jsx("div",{className:`h-full rounded-full transition-all duration-500 ${E}`,style:{width:`${C}%`}})})]}),g.jsxs("div",{className:"flex items-center justify-between px-4 pt-2 pb-1",children:[g.jsx("span",{className:"text-[11px] font-medium text-dark-muted",children:a("chat.categoryBreakdown")}),g.jsx("span",{className:"text-[10px] text-dark-muted/50 select-none",title:a("chat.assemblyOrderHint"),children:a("chat.byAssemblyOrder")})]}),g.jsx("div",{className:"px-4 pb-2 space-y-1.5",children:w.map(D=>g.jsxs("div",{"data-row-key":D.key,className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-[11px] text-dark-muted w-16 shrink-0",children:D.label}),g.jsx("div",{className:"flex-1 h-1.5 bg-dark-border/70 rounded-full overflow-hidden",children:g.jsx("div",{className:`h-full ${D.color} rounded-full`,style:{width:`${Math.max(.5,D.pct)}%`}})}),g.jsx("span",{className:"text-[11px] font-mono text-dark-text w-12 text-right shrink-0",children:Xz(D.pct)})]},D.key))}),g.jsxs("div",{className:"mx-4 mb-3 mt-1 flex items-center justify-between rounded-md bg-dark-bg/70 px-3 py-1.5",children:[g.jsxs("span",{className:"flex items-center gap-1.5 text-[11px] text-dark-muted",children:[g.jsx(l_,{size:11}),a("chat.avgCacheHitRate")]}),L!==null?g.jsxs("span",{className:`text-[11px] font-mono font-semibold ${L>=.5?"text-accent-green":"text-accent-yellow"}`,children:[(L*100).toFixed(0),"%"]}):g.jsx("span",{className:"text-[11px] font-mono text-dark-muted/60",children:"–"})]})]})})]}):null});function h6(t){const e=t.trim();if(!e)return{model:""};const n=e.indexOf("/"),a=e.indexOf(":"),r=n>=0&&(a<0||n<a)?n:a;if(r>0){const i=e.slice(0,r).trim(),l=e.slice(r+1).trim();if(i&&l)return{provider:i,model:l}}return{model:e}}function pF(t){return h6(t).provider??""}function Jz(t,e){const n=h6(e),a=t||n.model;return n.provider&&a?`${n.provider} · ${a}`:a}function fF(t){const e=new Map;for(const n of t){const a=n.provider||"default",r=e.get(a);r?r.push(n):e.set(a,[n])}return Array.from(e.entries())}const e$=N.memo(function(e){const{t:n}=at(),a=Xe(ke=>ke.currentUsage),r=Xe(ke=>ke.maxContextTokens),i=Xe(ke=>ke.model),l=Xe(ke=>ke.modelRef),c=Xe(ke=>ke.modelSource),d=Xe(ke=>ke.tokenRate),p=Xe(ke=>ke.compactingUntil),h=Xe(ke=>ke.lastCompactInfo),m=Xe(ke=>ke.degradation),b=Xe(ke=>ke.compactionProgress),x=Xe(ke=>ke.cacheStats),w=Ge(ke=>ke.activeSessionId),S=Me(ke=>w?ke.isGenerating(w):!1),C=ot(ke=>w?ke.bySession[w]:void 0),E=ot(ke=>w?ke.getRunningAgentCount(w):0),T=bi(ke=>ke.mode),L=ys(ke=>ke.autoMode),[D,B]=N.useState(0),H=N.useRef(0),[K,U]=N.useState(!1),[q,re]=N.useState(null);N.useEffect(()=>{const ke=De.onReconnectAttempt(($e,ft)=>re({attempt:$e,max:ft})),Be=De.onReconnectSuccess(()=>re(null)),Pe=De.onReconnectGiveUp(()=>re(null)),He=De.onOpen(()=>re(null));return()=>{ke(),Be(),Pe(),He()}},[]),N.useEffect(()=>{if(S&&!H.current&&(H.current=Date.now()),!S){H.current=0,B(0);return}const ke=setInterval(()=>B(Math.floor((Date.now()-H.current)/1e3)),1e3);return()=>clearInterval(ke)},[S]);const _e=a.totalTokens,G=r>0?Math.min(100,Math.round(a.totalTokens/r*100)):0,me=UT(d),ge=T==="normal"?"act":T,ye=HT[ge],P=Jz(i,l),oe=ja(ge),he=oe==="plan"?"brand":oe==="goal"?"purple":"green";return g.jsxs("div",{className:"h-9 border-t border-dark-border bg-dark-bg flex items-center px-3 gap-2 shrink-0 select-none text-xs overflow-hidden",children:[g.jsx("span",{className:"font-semibold text-dark-text whitespace-nowrap",children:"DeepSeekCode"}),g.jsx("span",{className:"status-pill","data-tone":he,children:ye.label}),L&&g.jsx("span",{className:"status-pill","data-tone":"yellow",children:"Auto"}),q&&g.jsxs("span",{className:"status-pill","data-tone":"yellow",title:n("reconnect.hint"),"data-testid":"reconnect-pill",children:[g.jsx(vp,{size:10,className:"animate-spin"}),n("reconnect.reconnecting",{attempt:q.attempt,max:q.max})]}),g.jsx("span",{className:"text-dark-muted truncate max-w-[14rem]",title:P||void 0,children:P||n("common.connecting")}),c==="session"&&g.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-accent-purple/20 text-accent-purple whitespace-nowrap",title:n("chat.sessionModelTitle"),children:n("chat.sessionModel")}),g.jsxs("span",{className:"inline-flex items-center text-[11px] whitespace-nowrap shrink-0",title:x&&x.cacheStatsCalls>0?n("chat.cacheHitTitle",{hit:Pc(x.cacheHitTokens),miss:Pc(x.cacheMissTokens),calls:x.cacheStatsCalls}):n(S?"chat.cacheWaitingRun":"chat.cacheNoStats"),children:[g.jsx("span",{className:"text-dark-muted",children:"cache"})," ",x&&x.cacheStatsCalls>0?g.jsx("span",{className:x.cacheHitRate!==void 0&&x.cacheHitRate>=.5?"text-accent-green":"text-accent-yellow",children:x.cacheHitRate!==void 0?`${(x.cacheHitRate*100).toFixed(0)}%`:"n/a"}):S?g.jsx("span",{className:"text-dark-muted/60",children:"–"}):g.jsx("span",{className:"text-dark-muted/60",children:"n/a"})]}),S&&g.jsx("span",{className:`whitespace-nowrap shrink-0 ${me?"text-accent-purple":"text-dark-muted/50"}`,title:n(me?"chat.tokenRateTitle":"chat.tokenRateIdle"),"data-testid":"token-rate",children:me||"– tok/s"}),g.jsxs("button",{type:"button",onClick:()=>U(!0),title:n("chat.viewContextDetail"),className:"group inline-flex items-center gap-1.5 shrink-0 -mx-1 px-1 rounded transition-colors cursor-pointer hover:bg-dark-hover/60",children:[g.jsxs("span",{className:"hidden md:inline-flex items-center gap-1 text-dark-muted whitespace-nowrap",children:[g.jsx("span",{className:"text-dark-text",children:Pc(_e)}),g.jsx("span",{className:"text-dark-muted/60",children:"/"}),g.jsx("span",{children:Pc(r)})]}),g.jsxs("span",{className:"inline-flex items-center gap-1",children:[g.jsx("span",{className:"w-16 lg:w-20 h-1.5 bg-dark-border/70 rounded-full overflow-hidden inline-flex",children:g.jsx("span",{className:`h-full transition-all rounded-full ${G>=90?"bg-accent-red":G>=70?"bg-accent-yellow":"bg-dark-text/70"}`,style:{width:`${G}%`}})}),g.jsxs("span",{className:G>=90?"text-accent-red font-bold":G>=70?"text-accent-yellow":"",children:[G,"%"]})]}),g.jsx(c_,{size:12,className:"text-dark-muted/50 group-hover:text-dark-text transition-colors"})]}),S&&g.jsxs("span",{className:"text-dark-text flex items-center gap-1 whitespace-nowrap",children:[g.jsx(r6,{size:12,rate:d}),ey(D*1e3)]}),E>0&&g.jsxs("span",{className:"text-dark-text whitespace-nowrap",children:[E," agent",E>1?"s":""]}),g.jsx("div",{className:"flex-1"}),C&&g.jsxs("span",{className:"hidden xl:flex items-center gap-2 text-[11px] text-dark-text whitespace-nowrap",children:[g.jsx("span",{className:"text-dark-muted",children:"wf"}),g.jsx("span",{className:"font-mono",children:C.status}),g.jsxs("span",{children:[C.completedPhases,"/",C.totalPhases||0]}),g.jsx("span",{className:"text-dark-muted",children:Pc(C.tokensUsed)})]}),b&&g.jsxs("span",{"data-testid":"compaction-indicator",className:"hidden lg:flex items-center gap-2 text-[11px] text-dark-text whitespace-nowrap",children:[g.jsx("span",{children:"compact"}),g.jsxs("span",{children:[b.percent,"%"]}),g.jsx("span",{className:"w-20 h-1.5 bg-dark-border/70 rounded-full overflow-hidden",children:g.jsx("span",{className:`h-full bg-dark-text/70 rounded-full block transition-all${b.percent<100?" animate-pulse-soft":""}`,style:{width:`${b.percent}%`}})})]}),!b&&Date.now()<p&&h&&g.jsxs("span",{className:"hidden lg:inline text-dark-muted text-[11px] whitespace-nowrap",children:[h.originalCount," ","->"," ",h.compressedCount]}),(m==null?void 0:m.active)&&g.jsxs("span",{className:"text-accent-yellow text-[11px] whitespace-nowrap",children:[m.label," ",m.retryCount>0?`${m.retryCount}/${m.maxRetries}`:""]}),g.jsx(Qz,{open:K,onClose:()=>U(!1)})]})});function t$({sessionId:t,fallback:e,renamed:n}){const a=s6(t),r=n?e:a??e;return g.jsx("span",{className:"min-w-0 flex-1 truncate",children:r})}const n$=N.memo(function({tabs:e,activeSessionId:n,onActivate:a,onClose:r,onRename:i,onNew:l,onFork:c,workspaceDir:d,canClose:p=!0}){const{t:h}=at(),m=N.useRef(null),[b,x]=N.useState(null),[w,S]=N.useState(""),C=N.useRef(null),E=Me(U=>U.generatingSessions),T=N.useCallback(U=>E.includes(U.id)?"running":U.status||"done",[E]),L=N.useMemo(()=>[...e].sort((U,q)=>U.createdAt-q.createdAt),[e]);N.useEffect(()=>{var q,re;const U=(q=m.current)==null?void 0:q.querySelector('[data-active="1"]');(re=U==null?void 0:U.scrollIntoView)==null||re.call(U,{block:"nearest",inline:"nearest"})},[n,e.length]);const D=N.useCallback(U=>{x(U.id),S(U.title),setTimeout(()=>{var q;return(q=C.current)==null?void 0:q.select()},0)},[]),B=N.useCallback(()=>{const U=b,q=w.trim();x(null),U&&q&&i(U,q)},[b,w,i]),H=N.useCallback(U=>{var me;if(U.key!=="ArrowLeft"&&U.key!=="ArrowRight")return;const q=m.current;if(!q)return;const re=Array.from(q.querySelectorAll('[role="tab"]')),_e=re.indexOf(document.activeElement);if(_e===-1)return;U.preventDefault();const G=U.key==="ArrowRight"?1:-1;(me=re[(_e+G+re.length)%re.length])==null||me.focus()},[]),K=N.useMemo(()=>h(d?"chat.newSessionInWorkspace":"chat.newSession"),[h,d]);return g.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-1",children:[g.jsx("div",{ref:m,role:"tablist","aria-label":h("chat.sessionTabs"),onKeyDown:H,className:"flex min-w-0 items-center gap-0.5 overflow-x-auto custom-scrollbar",children:L.map(U=>{const q=U.id===n,re=b===U.id,_e=U.title||h("nav.chat");return g.jsxs("div",{"data-active":q?"1":"0",role:"tab","aria-selected":q,tabIndex:q?0:-1,title:d?`${_e} · ${d}`:_e,onClick:()=>!re&&!q&&a(U.id),onDoubleClick:()=>!re&&D(U),onAuxClick:G=>{G.button===1&&(G.preventDefault(),r(U.id))},onKeyDown:G=>{(G.key==="Enter"||G.key===" ")&&(G.preventDefault(),!re&&!q&&a(U.id))},className:Ke("group/tab flex h-6 max-w-[13rem] shrink-0 cursor-pointer items-center gap-1.5 rounded-md px-2 text-[12px] transition-colors","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent-blue/60",q?"bg-accent-blue/10 font-medium text-dark-text ring-1 ring-accent-blue/30":"text-dark-muted hover:bg-dark-hover hover:text-dark-text"),children:[g.jsx(hp,{status:T(U),sessionId:U.id}),re?g.jsx("input",{ref:C,value:w,onChange:G=>S(G.target.value),onBlur:B,onKeyDown:G=>{G.key==="Enter"?B():G.key==="Escape"&&x(null)},onClick:G=>G.stopPropagation(),className:"min-w-0 flex-1 rounded border border-accent-blue bg-dark-bg px-1 text-[12px] text-dark-text outline-none",autoFocus:!0}):g.jsx(t$,{sessionId:U.id,fallback:_e,renamed:U.renamed}),!re&&g.jsxs(g.Fragment,{children:[c&&g.jsx("button",{type:"button","aria-label":h("chat.forkSession"),title:h("chat.forkSession"),onClick:G=>{G.stopPropagation(),c(U.id)},className:Ke("grid h-4 w-4 shrink-0 place-items-center rounded transition-colors",q?"text-dark-muted hover:bg-dark-border hover:text-dark-text":"opacity-0 group-hover/tab:opacity-100 hover:bg-dark-border hover:text-dark-text"),children:g.jsx(Au,{size:10})}),p&&g.jsx("button",{type:"button","aria-label":h("chat.closeTab"),title:h("chat.closeTab"),onClick:G=>{G.stopPropagation(),r(U.id)},className:Ke("grid h-4 w-4 shrink-0 place-items-center rounded transition-colors",q?"text-dark-muted hover:bg-dark-border hover:text-dark-text":"opacity-0 group-hover/tab:opacity-100 hover:bg-dark-border hover:text-dark-text"),children:g.jsx(yn,{size:11})})]})]},U.id)})}),g.jsx("button",{type:"button",onClick:l,title:K,"aria-label":K,className:"grid h-6 w-6 shrink-0 place-items-center rounded-md text-dark-muted transition-colors hover:bg-dark-hover hover:text-dark-text focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent-blue/60",children:g.jsx(vo,{size:14,"aria-hidden":"true"})})]})}),a$={idle:"bg-green-500",running:"bg-yellow-500 animate-pulse",paused:"bg-gray-500",error:"bg-red-500"};function r$(t){return a$[t]??"bg-gray-500"}const s$=N.memo(function({assistant:e,onOpenSession:n}){const{t:a}=at(),r=e.channel.peerKind==="group",i=a(`assistants.status.${e.status}`,{defaultValue:e.status});return g.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-dark-border px-3 py-2",children:[g.jsx("span",{className:"text-base leading-none","aria-hidden":"true",children:Cz(e.channel.type)}),g.jsxs("div",{className:"min-w-0 flex-1",children:[g.jsxs("div",{className:"flex items-center gap-1.5",children:[g.jsx("span",{className:"min-w-0 flex-1 truncate text-xs font-medium text-dark-text",title:e.title,children:e.title}),g.jsx("span",{className:`h-1.5 w-1.5 shrink-0 rounded-full ${r$(e.status)}`,title:i}),g.jsx("span",{className:"shrink-0 text-[10px] text-dark-muted",children:i})]}),g.jsxs("div",{className:"mt-0.5 flex items-center gap-1.5 text-[10px] text-dark-muted",children:[r?g.jsx(u_,{size:10,className:"shrink-0","aria-label":a("assistants.group")}):g.jsx(d_,{size:10,className:"shrink-0","aria-label":a("assistants.dm")}),g.jsx("span",{className:"shrink-0",children:_z(e.channel.type)}),g.jsx("span",{className:"min-w-0 truncate",title:e.channel.peerId,children:e.channel.peerId}),e.stats.unread>0&&g.jsx("span",{className:"shrink-0 rounded-full bg-red-500/80 px-1.5 text-[9px] font-medium text-white",children:e.stats.unread})]})]}),g.jsxs("button",{type:"button",onClick:n,className:"flex shrink-0 items-center gap-1 rounded px-2 py-0.5 text-[11px] text-accent-blue hover:bg-dark-hover",children:[g.jsx(lu,{size:11,"aria-hidden":"true"}),a("assistants.openSession")]})]})}),i$=N.memo(function({sessionId:e}){const{t:n}=at(),a=ba(d=>DP(d,e)),r=ot(d=>e?d.getForSession(e):void 0),i=N.useMemo(()=>{const d=r==null?void 0:r.nodes;if(!d)return;const p=d.find(h=>h.status==="pending"||h.status==="scheduled"||h.status==="running");return p==null?void 0:p.title},[r==null?void 0:r.nodes]);if(!e||!a&&!i)return null;const l=(a==null?void 0:a.status)==="waiting_user"?"text-accent-yellow":(a==null?void 0:a.status)==="blocked"?"text-accent-red":(a==null?void 0:a.status)==="paused"?"text-dark-300":(a==null?void 0:a.status)==="failed"?"text-accent-red":"text-accent-blue",c=(a==null?void 0:a.status)==="waiting_user"?"bg-accent-yellow":(a==null?void 0:a.status)==="blocked"?"bg-accent-red":(a==null?void 0:a.status)==="paused"?"bg-dark-300":(a==null?void 0:a.status)==="failed"?"bg-accent-red":(a==null?void 0:a.status)==="running"?"bg-accent-blue animate-pulse":"bg-accent-blue";return g.jsxs("div",{className:"h-7 shrink-0 flex items-center gap-2.5 px-3 text-[11px] select-none","data-testid":"task-status-bar",children:[a&&g.jsxs("span",{title:(a==null?void 0:a.status)==="blocked"?a.blockedReason:void 0,className:`flex min-w-0 items-center gap-1.5 shrink-0 ${l}`,"data-testid":"taskbar-current",children:[g.jsx("span",{className:`inline-block w-1.5 h-1.5 shrink-0 rounded-full ${c}`}),g.jsx("span",{className:"truncate max-w-[18rem]",children:a.title})]}),i&&g.jsxs("span",{className:"shrink-0 min-w-0 truncate text-dark-muted","data-testid":"taskbar-next",children:[n("taskbar.next"),": ",i]})]})});function o$(t){return t==="changes"?"chat.changesTitle":t==="workspace"?"chat.viewWorkspaceFiles":"chat.viewOverview"}function l$({view:t,...e}){return g.jsx("div",{className:"flex h-[52vh] flex-col","data-testid":"mobile-right-panel-sheet",children:t==="changes"?g.jsx(YS,{}):t==="workspace"?g.jsx(N.Suspense,{fallback:g.jsx("div",{className:"flex-1 min-h-0 flex items-center justify-center",children:g.jsx(Hn,{size:18,className:"animate-spin text-accent-blue"})}),children:g.jsx(XS,{})}):g.jsx(ty,{...e})})}const c$=2e4;function u$(t){const e=_i(n=>n.workspaceDir);N.useEffect(()=>{er.getState().refreshStatus();const n=setInterval(()=>{document.visibilityState==="visible"&&er.getState().refreshStatus()},c$);return()=>clearInterval(n)},[e]),N.useEffect(()=>{t>0&&er.getState().refreshStatus()},[t])}const d$={info:Wk,success:Lk,warning:xp,error:f1},p$={info:"text-accent-blue",success:"text-accent-green",warning:"text-accent-yellow",error:"text-accent-red"},f$=N.memo(function(){const{toasts:e,dismissToast:n}=ws();return e.length===0?null:g.jsx("div",{className:"fixed bottom-20 right-4 z-[100] flex flex-col gap-2 max-w-sm",children:e.slice(-3).map(a=>{const r=d$[a.type];return g.jsxs("div",{className:"toast-card animate-fade-in-up",role:"status",children:[g.jsx(r,{size:16,className:`shrink-0 mt-0.5 ${p$[a.type]}`}),g.jsxs("span",{className:"text-xs flex-1 text-dark-text leading-relaxed",children:[a.message,a.count>1&&g.jsxs("span",{className:"toast-card-count ml-1.5",children:["×",a.count]})]}),g.jsx("button",{onClick:()=>n(a.id),className:"shrink-0 p-0.5 rounded text-dark-muted/70 hover:text-dark-text hover:bg-dark-hover/60 transition-colors","aria-label":"Dismiss",children:g.jsx(yn,{size:12})})]},a.id)})})}),h$={critical:{icon:p_,text:"text-accent-red"},error:{icon:f1,text:"text-accent-red"},warning:{icon:xp,text:"text-accent-yellow"},info:{icon:Wk,text:"text-accent-blue"}},m$={info:6e3,warning:1e4},g$=N.memo(function(){const e=vl(r=>r.errors),n=vl(r=>r.dismiss),a=e.filter(r=>!r.dismissed);return N.useEffect(()=>{const r=a.filter(i=>!i.action).map(i=>{const l=i.durationMs??m$[i.level];return l?setTimeout(()=>n(i.id),l):null}).filter(i=>i!==null);return()=>r.forEach(clearTimeout)},[a,n]),a.length===0?null:g.jsx("div",{className:"fixed bottom-4 right-4 z-[110] flex flex-col gap-2 max-w-sm",children:a.map(r=>{const i=h$[r.level],l=i.icon;return g.jsx(y$,{entry:r,icon:l,config:i,onDismiss:()=>n(r.id)},r.id)})})});function y$({entry:t,icon:e,config:n,onDismiss:a}){const[r,i]=N.useState(!1);return g.jsxs("div",{className:"toast-card animate-fade-in-up",role:"alert",children:[g.jsx(e,{size:16,className:`shrink-0 mt-0.5 ${n.text}`}),g.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[g.jsxs("span",{className:`text-xs leading-relaxed ${n.text}`,children:[t.title,t.count!=null&&t.count>1&&g.jsxs("span",{className:"toast-card-count ml-1.5",children:["×",t.count]})]}),r&&t.detail&&g.jsx("div",{className:"mt-1.5 text-[11px] text-dark-muted whitespace-pre-wrap break-words leading-relaxed border-t border-dark-border/50 pt-1.5",children:t.detail}),t.action&&g.jsx("button",{onClick:t.action.onClick,className:"mt-1.5 self-start text-[11px] px-2 py-0.5 rounded-md bg-dark-hover hover:bg-dark-border transition-colors text-dark-text",children:t.action.label})]}),g.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[t.detail&&g.jsx("button",{onClick:()=>i(!r),className:"p-0.5 rounded text-dark-muted/70 hover:text-dark-text hover:bg-dark-hover/60 transition-colors","aria-label":r?"Collapse":"Expand",children:r?g.jsx(_s,{size:12}):g.jsx(Vk,{size:12})}),g.jsx("button",{onClick:a,className:"p-0.5 rounded text-dark-muted/70 hover:text-dark-text hover:bg-dark-hover/60 transition-colors","aria-label":"Dismiss",children:g.jsx(yn,{size:12})})]})]})}function b$(t){const{t:e}=at(),{setActiveTab:n,createNewSession:a,clearMessages:r,setTheme:i,setThemePreset:l,setLogs:c,setUnreadLogs:d}=t,p=ny(G=>G.backendCommands),h=Array.isArray(p)?p:[],[m,b]=N.useState(!1),[x,w]=N.useState(""),[S,C]=N.useState(0),E=N.useRef(null),T=N.useCallback((G,me)=>{const ge=Ge.getState().activeSessionId;return ge?(De.setSessionId(ge),De.send({type:"command_execute",sessionId:ge,data:JSON.stringify({command:`/${G}`,args:me||""})}),{success:!0,message:e("slashCommands.sent_command")+`/${G}`}):{success:!1,message:e("slashCommands.noActiveSession")}},[e]),L=N.useMemo(()=>[{id:"chat",name:"chat",description:e("slashCommands.chat_desc"),icon:"💬",local:!0,action:()=>(n("chat"),{success:!0,message:e("slashCommands.chat_result")})},{id:"files",name:"files",description:e("slashCommands.files_desc"),icon:"📁",local:!0,action:()=>(window.dispatchEvent(new CustomEvent("open-panel-view",{detail:{view:"workspace"}})),{success:!0,message:e("slashCommands.files_result")})},{id:"models",name:"models",description:e("slashCommands.models_desc"),icon:"🧠",local:!0,action:()=>(n("models"),{success:!0,message:e("slashCommands.models_result")})},{id:"tools",name:"tools",description:e("slashCommands.tools_desc"),icon:"🔧",local:!0,action:()=>(n("tools"),{success:!0,message:e("slashCommands.tools_result")})},{id:"skills",name:"skills",description:e("slashCommands.skills_desc"),icon:"🎯",local:!0,action:()=>(n("skills"),{success:!0,message:e("slashCommands.skills_result")})},{id:"settings",name:"settings",description:e("slashCommands.settings_desc"),icon:"⚙️",local:!0,action:()=>(n("settings"),{success:!0,message:e("slashCommands.settings_result")})},{id:"logs",name:"logs",description:e("slashCommands.logs_desc"),icon:"📜",local:!0,action:()=>(n("logs"),d(0),{success:!0,message:e("slashCommands.logs_result")})},{id:"new",name:"new",description:e("slashCommands.new_desc"),icon:"✨",local:!0,action:()=>(a(),{success:!0,message:e("slashCommands.new_result")})},{id:"clear",name:"clear",description:e("slashCommands.clear_desc"),icon:"🗑️",local:!0,action:()=>(r(),{success:!0,message:e("slashCommands.clear_result")})},{id:"theme",name:"theme",description:e("slashCommands.theme_desc"),args:"<dark|light|auto|preset-name>",icon:"🎨",local:!0,action:G=>{const me=G.trim().toLowerCase();if(["dark","light","auto"].includes(me))return i(me),{success:!0,message:e("slashCommands.theme_result")+me};if(ou[me])return l?(l(me),{success:!0,message:e("slashCommands.theme_preset_result")+ou[me].nameKey}):{success:!1,message:e("slashCommands.theme_preset_unavailable")};const ge=Object.keys(ou).join("|");return{success:!1,message:e("slashCommands.theme_error",{presets:ge})}}},{id:"clear-logs",name:"clear-logs",description:e("slashCommands.logs_clear_desc"),icon:"📭",local:!0,action:()=>(c([]),d(0),{success:!0,message:e("slashCommands.logs_clear_result")})},{id:"doctor",name:"doctor",description:e("slashCommands.doctor_desc"),icon:"🩺",local:!1,action:()=>T("doctor")},{id:"compact",name:"compact",description:e("slashCommands.compact_desc"),args:"[aggressive|summary]",icon:"🗜️",local:!1,action:G=>T("compact",G)},{id:"help",name:"help",description:e("slashCommands.help_desc"),icon:"❓",local:!1,action:()=>T("help")},{id:"model",name:"model",description:e("slashCommands.model_desc"),args:"[model-name]",icon:"🤖",local:!1,action:G=>T("model",G)},{id:"status",name:"status",description:e("slashCommands.status_desc"),icon:"📊",local:!1,action:()=>T("status")},{id:"config",name:"config",description:e("slashCommands.config_desc"),args:"<get|set|list|delete> [key] [value]",icon:"🔧",local:!1,action:G=>T("config",G)},{id:"exit",name:"exit",description:e("slashCommands.exit_desc"),icon:"🚪",local:!1,action:()=>{const G=Ge.getState().activeSessionId;return G&&(De.setSessionId(G),De.send({type:"exit",sessionId:G})),{success:!0,message:e("slashCommands.exit_result")}}},{id:"test",name:"test",description:e("slashCommands.benchmark_desc"),args:"[simple|medium|complex|full|list]",icon:"🧪",local:!1,action:G=>T("test",G)}],[n,a,r,i,l,c,d,T,e]),D=N.useMemo(()=>h.map(G=>{const me=e(`slashCommands.${G.name}_desc`,G.description||G.usage||"");return{id:`backend-${G.name}`,name:G.name,description:me,icon:"🔌",local:!1,action:ge=>{const ye=Ge.getState().activeSessionId;return ye?(De.setSessionId(ye),De.send({type:"command_execute",sessionId:ye,data:JSON.stringify({command:`/${G.name}`,args:ge||""})}),{success:!0,message:e("slashCommands.sent_command")+`/${G.name}`}):{success:!1,message:e("slashCommands.noActiveSession")}}}}),[h,e]),B=N.useMemo(()=>{const G=new Set;return[...L,...D].filter(me=>G.has(me.name)?!1:(G.add(me.name),!0))},[L,D]),H=N.useMemo(()=>{if(!x)return B;const G=x.toLowerCase();return B.filter(me=>me.name.toLowerCase().includes(G)||me.description.toLowerCase().includes(G))},[B,x]),K=N.useCallback(()=>{b(!0),w(""),C(0)},[]),U=N.useCallback(()=>{b(!1),w(""),C(0)},[]),q=N.useCallback(()=>{C(G=>G>=H.length-1?0:G+1)},[H.length]),re=N.useCallback(()=>{C(G=>G<=0?H.length-1:G-1)},[H.length]),_e=N.useCallback((G,me)=>{const ge=G.action(me);return U(),ge},[U]);return N.useEffect(()=>{if(m&&E.current){const G=E.current.querySelector(`[data-index="${S}"]`);G&&G.scrollIntoView({block:"nearest"})}},[S,m]),{isOpen:m,filter:x,setFilter:w,selectedIndex:S,setSelectedIndex:C,filteredCommands:H,allCommands:B,openMenu:K,closeMenu:U,selectNext:q,selectPrev:re,executeCommand:_e,containerRef:E,commands:L}}function hF(t){const e=t.trim();if(!e.startsWith("/"))return null;const a=e.slice(1).split(/\s+/),r=a[0]||"",i=a.slice(1).join(" ");return{command:r,args:i}}function v$({open:t,onClose:e,options:n}){const{t:a}=at(),{filter:r,setFilter:i,filteredCommands:l,selectedIndex:c,setSelectedIndex:d,selectNext:p,selectPrev:h,executeCommand:m,openMenu:b,closeMenu:x}=b$(n),w=N.useRef(null),S=N.useRef(null),[C,E]=N.useState(!1);if(N.useEffect(()=>{t?(b(),E(!1),setTimeout(()=>{var D;return(D=w.current)==null?void 0:D.focus()},0)):x()},[t,b,x]),N.useEffect(()=>{if(!t||!S.current)return;const D=S.current.querySelector(`[data-cmd-index="${c}"]`);D&&D.scrollIntoView({block:"nearest"})},[c,t]),!t)return null;const T=D=>{D.local||(E(!0),ut.info(a("palette.running")));const B=m(D,"");D.local&&(B!=null&&B.message)&&ut.success(B.message),e()},L=D=>{if(D.key==="ArrowDown")D.preventDefault(),p();else if(D.key==="ArrowUp")D.preventDefault(),h();else if(D.key==="Enter"){D.preventDefault();const B=l[c];B&&T(B)}else D.key==="Escape"&&(D.preventDefault(),e())};return g.jsx("div",{className:"fixed inset-0 z-[100] flex items-start justify-center bg-black/50 backdrop-blur-sm pt-[12vh] px-4 animate-fade-in",onClick:e,role:"dialog","aria-modal":"true","aria-label":a("a11y.commandPalette"),children:g.jsxs("div",{className:"w-full max-w-xl bg-dark-surface border border-dark-border rounded-xl shadow-2xl overflow-hidden",onClick:D=>D.stopPropagation(),children:[g.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-dark-border",children:[g.jsx(g1,{size:16,className:"text-dark-muted shrink-0","aria-hidden":"true"}),g.jsx("input",{ref:w,value:r,onChange:D=>{i(D.target.value),d(0)},onKeyDown:L,placeholder:a("palette.placeholder"),"aria-label":a("palette.placeholder"),className:"flex-1 bg-transparent text-sm text-dark-text placeholder-dark-muted outline-none"}),C&&g.jsx("span",{className:"text-[10px] text-accent-blue animate-pulse-soft shrink-0",children:a("palette.running")})]}),g.jsx("div",{ref:S,className:"max-h-[50vh] overflow-y-auto custom-scrollbar py-1",children:l.length===0?g.jsx("div",{className:"px-4 py-8 text-center text-sm text-dark-muted",children:a("palette.empty")}):l.map((D,B)=>g.jsxs("button",{"data-cmd-index":B,onClick:()=>T(D),onMouseEnter:()=>d(B),className:`w-full px-4 py-2.5 flex items-center gap-3 text-left transition-colors ${B===c?"bg-accent-blue/10 border-l-2 border-accent-blue":"border-l-2 border-transparent hover:bg-dark-hover"}`,children:[g.jsx("span",{className:"text-lg shrink-0","aria-hidden":"true",children:D.icon}),g.jsxs("div",{className:"flex-1 min-w-0",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsxs("span",{className:"text-sm font-medium text-dark-text",children:["/",D.name]}),D.args&&g.jsx("span",{className:"text-xs text-dark-muted",children:D.args}),!D.local&&g.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-accent-blue/20 text-accent-blue shrink-0",children:a("slashCommands.backend")})]}),g.jsx("div",{className:"text-xs text-dark-muted truncate",children:D.description})]}),B===c&&g.jsx(f_,{size:14,className:"text-dark-muted shrink-0","aria-hidden":"true"})]},D.id))}),g.jsx("div",{className:"px-4 py-2 border-t border-dark-border text-[10px] text-dark-muted bg-dark-bg",children:a("palette.hint")})]})})}function Or({keys:t,label:e}){return g.jsxs("div",{className:"flex items-center justify-between py-2 border-b border-dark-border/50 last:border-0",children:[g.jsx("span",{className:"text-sm text-dark-text",children:e}),g.jsx("span",{className:"flex items-center gap-1",children:t.map(n=>g.jsx("kbd",{className:"px-2 py-0.5 text-xs font-mono bg-dark-bg rounded border border-dark-border text-dark-muted",children:n},n))})]})}function x$({open:t,onClose:e}){const{t:n}=at(),a=navigator.platform.toLowerCase().includes("mac")?"⌘":"Ctrl";return g.jsx(Yp,{isOpen:t,onClose:e,title:n("shortcuts.title"),size:"md",children:g.jsxs("div",{className:"space-y-0.5",children:[g.jsx(Or,{keys:[a,"K"],label:n("shortcuts.commandPalette")}),g.jsx(Or,{keys:[a,"L"],label:n("shortcuts.clearLogs")}),g.jsx(Or,{keys:[a,"/"],label:n("shortcuts.help")}),g.jsx(Or,{keys:[a,"Enter"],label:n("shortcuts.submit")}),g.jsx(Or,{keys:[a,"Shift","S"],label:n("shortcuts.screenshot")}),g.jsx(Or,{keys:["Shift","Enter"],label:n("shortcuts.newline")}),g.jsx(Or,{keys:["/"],label:n("shortcuts.slashCommand")}),g.jsx(Or,{keys:["@"],label:n("shortcuts.fileRef")}),g.jsx(Or,{keys:["Esc"],label:n("shortcuts.closeDialog")}),g.jsx(Or,{keys:["Esc","Esc"],label:n("shortcuts.stopGen")})]})})}const m6=Nn(t=>({isOpen:!1,entries:null,openWhatsNew:e=>t({isOpen:!0,entries:e??null}),closeWhatsNew:()=>t({isOpen:!1})}));function w$(){var c;const{t,i18n:e}=at(),{isOpen:n,entries:a,closeWhatsNew:r}=m6(),i=a??X0,l=(c=e.language)!=null&&c.toLowerCase().startsWith("zh")?"zh":"en";return g.jsx(Yp,{isOpen:n,onClose:r,title:g.jsxs("span",{className:"flex items-center gap-2",children:[g.jsx(u1,{className:"w-4 h-4 text-accent-yellow","aria-hidden":"true"}),t("whatsnew.title")]}),size:"2xl",children:g.jsx("div",{className:"space-y-6",children:i.map(d=>{const p=JT(d,l);return g.jsxs("section",{className:"space-y-2",children:[g.jsxs("header",{className:"flex items-baseline gap-3",children:[g.jsxs("h3",{className:"text-base font-semibold text-dark-text font-mono",children:["v",p.version]}),p.title&&g.jsx("span",{className:"text-sm text-dark-muted",children:p.title}),p.date&&g.jsx("span",{className:"text-xs text-dark-muted/60 ml-auto",children:p.date})]}),g.jsx("ul",{className:"space-y-1.5",children:p.items.map((h,m)=>g.jsxs("li",{className:"flex gap-2 text-sm text-dark-muted leading-relaxed",children:[g.jsx("span",{className:"text-accent-blue shrink-0 mt-0.5","aria-hidden":"true",children:"•"}),g.jsx("span",{children:h})]},m))})]},d.version)})})})}function k$({isOpen:t,onClose:e,title:n,collapsedSummary:a,badge:r,children:i,maxHeight:l="45vh",onExpandedChange:c,className:d}){const{t:p}=at(),[h,m]=N.useState(!0);N.useEffect(()=>{t&&m(!0)},[t]),N.useEffect(()=>{c==null||c(h)},[h,c]);const b=N.useCallback(()=>{m(x=>!x)},[]);return t?g.jsxs("div",{className:Ke("shrink-0 bg-dark-surface/95 backdrop-blur border-t border-dark-border shadow-[0_-10px_30px_-15px_rgba(0,0,0,0.5)]",d),children:[g.jsxs("div",{role:"button","aria-expanded":h,tabIndex:0,onClick:b,onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),b())},title:p(h?"commonUi.drawerCollapseTitle":"commonUi.drawerExpandTitle"),className:Ke("flex items-center gap-2 px-4 py-2 cursor-pointer select-none transition-colors","hover:bg-dark-hover/60"),children:[g.jsx("span",{className:Ke("shrink-0 text-dark-muted transition-transform duration-200",!h&&"rotate-180"),children:g.jsx(_s,{size:16})}),g.jsxs("div",{className:"min-w-0 flex-1 flex items-center gap-2",children:[g.jsx("span",{className:"text-sm font-semibold text-dark-text truncate",children:n}),r,!h&&a&&g.jsx("span",{className:"min-w-0 flex items-center gap-1.5 text-xs text-dark-muted truncate",children:a})]}),g.jsx("button",{type:"button","aria-label":p("common.close"),onClick:x=>{x.stopPropagation(),e()},className:"shrink-0 p-1 rounded-md text-dark-muted hover:text-dark-text hover:bg-dark-hover transition-colors",children:g.jsx(yn,{size:15})})]}),h&&g.jsx("div",{className:"animate-slide-up border-t border-dark-border/60 overflow-y-auto custom-scrollbar p-4",style:{maxHeight:l},children:i})]}):null}const S$=ka(()=>j(()=>import("./ModelsView-BW6eRUwf.js"),__vite__mapDeps([131,126,127,128,129,130])).then(t=>({default:t.ModelsView}))),_$=ka(()=>j(()=>import("./ToolsView-Bk4hckku.js"),__vite__mapDeps([132,126,127,128,129,130])).then(t=>({default:t.ToolsView}))),C$=ka(()=>j(()=>import("./SkillsView-DS0nnKig.js"),__vite__mapDeps([133,126,127,128,129,130])).then(t=>({default:t.SkillsView}))),A$=ka(()=>j(()=>import("./TemplatesTab-pXElHCnz.js"),__vite__mapDeps([134,126,127,128,129,130])).then(t=>({default:t.TemplatesTab}))),T$=ka(()=>j(()=>import("./HookConfigView-DR8TP3QG.js"),__vite__mapDeps([135,126,127,129,128,130])).then(t=>({default:t.HookConfigView}))),Ek=ka(()=>j(()=>import("./SessionGrid-DYYsm2dT.js"),__vite__mapDeps([136,126,127,137,129,128,130,138])).then(t=>({default:t.SessionGrid}))),E$=ka(()=>j(()=>import("./SettingsModal-DNxIKsKC.js"),__vite__mapDeps([139,126,127,137,128,129,130])).then(t=>({default:t.SettingsModal}))),N$=ka(()=>j(()=>import("./ChannelConfigView-DlakOI5z.js"),__vite__mapDeps([140,126,127,128,129,130])).then(t=>({default:t.ChannelConfigView}))),R$=ka(()=>j(()=>import("./AssistantsView-Bh6ajWIo.js"),__vite__mapDeps([141,126,127,128,129,130])).then(t=>({default:t.AssistantsView}))),D$=ka(()=>j(()=>import("./ConnectorsView-ELXDmM9m.js"),__vite__mapDeps([142,126,127,128,129,130])).then(t=>({default:t.ConnectorsView}))),M$=ka(()=>j(()=>import("./AutomationView-D2Z-_4qe.js"),__vite__mapDeps([143,126,127,128,129,130])).then(t=>({default:t.AutomationView}))),O$=ka(()=>j(()=>import("./PluginsView-CrHGk_JC.js"),__vite__mapDeps([144,126,127,128,129,130])).then(t=>({default:t.PluginsView}))),L$=ka(()=>j(()=>Promise.resolve().then(()=>ZB),void 0).then(t=>({default:t.PluginTabContainer}))),j$=()=>g.jsx("div",{className:"flex-1 flex items-center justify-center bg-dark-bg",children:g.jsx("div",{className:"w-5 h-5 border-2 border-accent-blue border-t-transparent rounded-full animate-spin"})}),ay=[{id:"chat",labelKey:"nav.chat",icon:m1},{id:"models",labelKey:"nav.models",icon:h_},{id:"tools",labelKey:"nav.tools",icon:m_},{id:"skills",labelKey:"nav.skills",icon:u1},{id:"assistants",labelKey:"nav.assistants",icon:g_},{id:"templates",labelKey:"nav.templates",icon:Qm},{id:"hooks",labelKey:"nav.hooks",icon:y_},{id:"channels",labelKey:"nav.channels",icon:b_},{id:"connectors",labelKey:"nav.connectors",icon:v_},{id:"scheduled",labelKey:"nav.scheduled",icon:x_},{id:"logs",labelKey:"nav.logs",icon:Zc},{id:"settings",labelKey:"nav.settings",icon:w_},{id:"plugins",labelKey:"nav.plugins",icon:Kk}],Zm=Object.fromEntries(ay.map(t=>[t.id,t.labelKey])),B$=ay.map(t=>({id:t.id,title:t.labelKey})),Nk=Object.fromEntries(ay.map(t=>[t.id,t.icon])),Rk=[];function I$(){const[t,e]=N.useState("chat"),[n,a]=N.useState(!1),[r,i]=N.useState([]),l=N.useMemo(()=>r.filter($=>$.level==="error"),[r]),[,c]=N.useState(0),[d,p]=N.useState(!1),[h,m]=N.useState(!1),[b,x]=N.useState(!1),[w,S]=N.useState(!1),[C,E]=N.useState(!1),[T,L]=N.useState(null),[D,B]=N.useState({}),H=_1().changes.length,K=N.useRef(null),U=N.useRef(null),[q,re]=N.useState(()=>localStorage.getItem("dsc-sidebar-collapsed")==="1"),_e=N.useCallback(()=>{re($=>(localStorage.setItem("dsc-sidebar-collapsed",$?"0":"1"),!$))},[]);N.useEffect(()=>{try{const $=localStorage.getItem("dsc-seen-version"),X=eE($);if(X.length>0){m6.getState().openWhatsNew(X);const de=tE();de&&localStorage.setItem("dsc-seen-version",de)}}catch{}},[]);const{t:G,i18n:me}=at(),{theme:ge,setTheme:ye,setThemePreset:P,language:oe,workspaceDir:he,setWorkspaceDir:ke,effort:Be}=_i(),Pe=ys();N.useEffect(()=>{const $=Sp(oe);me.language!==$&&me.changeLanguage($)},[oe,me]);const[He,$e]=N.useState([]);N.useEffect(()=>{let $=!1;return Y.get("/api/plugins/ui").then(X=>{var de;$||$e((((de=X==null?void 0:X.data)==null?void 0:de.ui)??[]).filter(Se=>Se.mount==="tab"))}).catch(()=>{}),()=>{$=!0}},[]);const ft=$=>`plugin:${$.pluginId}:${$.id}`,tn=N.useMemo(()=>[...B$.map($=>({...$,iconComponent:Nk[$.id]})),...He.map($=>({id:ft($),title:$.title,icon:$.icon,iconComponent:Nk[$.icon??""]??Kk}))],[He]),[Kn,Dn]=N.useState(!1),Un=N.useCallback(()=>Dn(!1),[]),Ye=N.useCallback($=>{if($==="settings"){Dn(!0);return}N.startTransition(()=>{e($)})},[]),[cn,oa]=N.useState(null),la=N.useCallback($=>{Dn(!0),oa({section:$,nonce:Date.now()})},[]);N.useEffect(()=>{const $=Se=>{const je=Se==null?void 0:Se.stack;return typeof je=="string"&&je.trim()?je:void 0},X=Se=>{const je=Se.message||G("common.unknownError"),st=Se.filename||"global";st.includes("chrome-extension://")||st.includes("moz-extension://")||i(bt=>[...bt,{id:`error-${Date.now()}-${ar()}`,level:"error",source:"Browser",message:`${G("toast.uncaughtError")}${je}`,timestamp:Date.now(),detail:$(Se.error)}].slice(-500))},de=Se=>{var st;const je=((st=Se.reason)==null?void 0:st.message)||Se.reason||G("toast.unknownReason");i(bt=>[...bt,{id:`rejection-${Date.now()}-${ar()}`,level:"error",source:"Promise",message:`${G("toast.uncaughtRejection")}${je}`,timestamp:Date.now(),detail:$(Se.reason)}].slice(-500))};return window.addEventListener("error",X),window.addEventListener("unhandledrejection",de),()=>{window.removeEventListener("error",X),window.removeEventListener("unhandledrejection",de)}},[G]);const $a=N.useCallback(($,X)=>{i(de=>[...de,{id:`boundary-${Date.now()}-${ar()}`,level:"error",source:"React",message:`${G("toast.uncaughtError")}${$.message}`,timestamp:Date.now(),detail:X.componentStack??void 0}].slice(-500))},[G]),{sessionTabs:un,activeSessionId:Le,setActiveSession:cr,addSessionTab:ca,closeSessionTab:wr,renameSessionTab:Sa,getVisibleSessionTabs:_a,autoNameSession:kr,touchSession:ur,sessionWorkspaceDirs:Fa}=Ge(),{showRightSidebar:It,rightSidebarView:Ha,previewTabs:Sr,previewFilePath:wn,previewFloating:Yn,rightSidebarMaximized:Ua,setShowRightSidebar:Bn,setRightSidebarView:Ds,setPreviewFloating:Mi,setRightSidebarMaximized:Zn,openPreviewTab:nn,closePreviewTab:se,closePreview:Ce}=Zz(Le),ht=N.useMemo(()=>{if(!wn)return"";const $=wn.split(/[\\/]/);return $[$.length-1]||wn},[wn]),Fe=N.useCallback($=>{Ds($),Bn(!0),Zn(!1)},[Ds,Bn,Zn]),wt=N.useCallback(()=>{Bn($=>!$),Zn(!1)},[Bn,Zn]),Dt=N.useCallback(()=>{const $=K.current;$&&(Ua?$.resize(U.current??20):(U.current=$.getSize(),$.resize(68)),Zn(X=>!X))},[Ua,Zn]);N.useEffect(()=>{const $=window.matchMedia("(min-width: 1400px)"),X=de=>{de.matches||Bn(!1)};return $.addEventListener("change",X),()=>$.removeEventListener("change",X)},[Bn]);const dn=Le?D[Le]??!0:!0,ua=ot($=>Le?Object.keys($.tasksBySession[Le]||{}).length:0),Ne=N.useCallback(()=>{B($=>Le?{...$,[Le]:!($[Le]??!0)}:$)},[Le]),[Rt,Ft]=N.useState(()=>typeof window<"u"&&window.innerWidth<768);N.useEffect(()=>{const $=window.matchMedia("(max-width: 767px)"),X=de=>Ft(de.matches);return $.addEventListener("change",X),()=>$.removeEventListener("change",X)},[]);const In=ot($=>Le?$.getForSession(Le):void 0),Oi=ot($=>Le?$.tasksBySession[Le]:void 0),_r=N.useMemo(()=>Wz(Oi),[Oi]),dr=N.useRef(null),an=N.useRef({});N.useEffect(()=>{if(Rt)return;const $=In&&["RUNNING","RESUMING","PAUSED"].includes(String(In.status)),X=ua>0;$&&In&&dr.current!==In.runId?(dr.current=In.runId,Bn(!0)):X&&Le&&an.current[Le]!==_r&&(an.current[Le]=_r,Bn(!0))},[In==null?void 0:In.runId,In==null?void 0:In.status,ua,_r,Le,Rt]);const Ms=ba($=>{var X;return Le?((X=$.bySession[Le])==null?void 0:X.artifacts.length)??0:0}),No=N.useRef({sessionId:null,count:0});N.useEffect(()=>{const $=No.current;if(Le!==$.sessionId){No.current={sessionId:Le??null,count:Ms};return}!Rt&&Ms>$.count&&Bn(!0),No.current={sessionId:Le??null,count:Math.max(Ms,$.count)}},[Ms,Le,Rt]),u$(Ms);const{clearMessages:zl,generatingSessions:$l,pausedSessions:Fl}=Me(),Ro=Me($=>Le?$.messagesBySession[Le]??Rk:Rk),{customTheme:ju,customThemeEnabled:Cr,themePresetId:kn}=_i();Bz({theme:ge,themePresetId:kn,customTheme:ju,customThemeEnabled:Cr}),Lz({activeTab:t,setLogs:i,setUnreadLogs:c}),N.useEffect(()=>{const $=X=>{const de=X.detail,Se=typeof de=="string"?de:de==null?void 0:de.tab,je=typeof de=="string"||de==null?void 0:de.section;Se&&Se!==t&&Ye(Se),Se==="settings"&&je&&la(je)};return window.addEventListener("switch-tab",$),()=>window.removeEventListener("switch-tab",$)},[t,Ye,la]),N.useEffect(()=>{const $=X=>{var Se;const de=(Se=X.detail)==null?void 0:Se.path;de&&(nn(de),Bn(!0))};return window.addEventListener("preview-file",$),()=>window.removeEventListener("preview-file",$)},[nn]),N.useEffect(()=>{const $=X=>{var Se;const de=(Se=X.detail)==null?void 0:Se.view;de&&Fe(de)};return window.addEventListener("open-panel-view",$),()=>window.removeEventListener("open-panel-view",$)},[Fe]);const Sn=N.useCallback(()=>{const $=window.location.hash.replace(/^#\/?/,"");if(!$)return;const[X,de]=$.split("/");X&&X in Zm&&Ye(X),X==="settings"&&de==="stt"&&la("stt")},[Ye,la]);N.useEffect(()=>(Sn(),window.addEventListener("hashchange",Sn),()=>window.removeEventListener("hashchange",Sn)),[Sn]);const Ar=N.useRef(n);N.useEffect(()=>{const $=De.onOpen(()=>{Ar.current=!0,a(!0),ut.success(G("toast.backendConnected"))}),X=De.onClose(()=>{const de=Ar.current;Ar.current=!1,a(!1),de&&ut.warning(G("toast.backendDisconnected"))});return()=>{$(),X()}},[G]);const Li=un.map($=>$.id).join(`
|
|
580
|
+
`),Hl=[...$l,...Fl].join(`
|
|
581
|
+
`),Bu=N.useRef([]);N.useEffect(()=>{const $=Li?Li.split(`
|
|
582
|
+
`):[],X=new Set([...$,...Hl?Hl.split(`
|
|
583
|
+
`):[]]);X.size>0&&De.setVisibleSessions(X);for(const de of Bu.current)X.has(de)||FP(de);Bu.current=$},[Li,Hl]);const Iu=N.useCallback(async()=>{try{const $=await Je.sessions.list();if(!$.success||!Array.isArray($.data))return;const X=Vz($.data);if(X.length===0)return;const de=Se=>({id:Se.id,title:Se.title,createdAt:Se.createdAt,lastActiveAt:Se.lastActiveAt,preview:Se.preview,status:"done"});Ge.setState(Se=>{const je=new Set(Se.sessionTabs.map(lt=>lt.id)),st=[...X.map(de).filter(lt=>!je.has(lt.id)),...Se.historySessions.filter(lt=>!X.some(Wt=>Wt.id===lt.id))].slice(0,Math.max(0,n5-Se.sessionTabs.length)),bt=[...X.map(lt=>({id:lt.id,title:lt.title,createdAt:new Date(lt.createdAt).toISOString(),updatedAt:new Date(lt.lastActiveAt??lt.createdAt).toISOString(),messageCount:lt.messageCount??0})),...Se.sessions.filter(lt=>!X.some(Wt=>Wt.id===lt.id))];return{historySessions:st,sessions:bt}})}catch{}},[]);N.useEffect(()=>{if(Ge.getState().sessionTabs.length===0){const $=ca(G("chat.defaultSessionTitle",{n:1}));Ge.getState().removeHistorySession($)}Iu()},[]),N.useEffect(()=>{const $=()=>m(!0);return window.addEventListener("hook-approval-required",$),()=>window.removeEventListener("hook-approval-required",$)},[]);const Os=N.useRef(Le);N.useEffect(()=>{Os.current=Le},[Le]);const Ls=N.useCallback($=>{var Se,je,st;if(!$)return!1;const X=window,de=(Se=X.__pendingQuestions)==null?void 0:Se[$];return de?(je=X.__answeredQuestionIds)!=null&&je.has(de.questionId)?(delete X.__pendingQuestions[$],((st=X.__pendingQuestion)==null?void 0:st.questionId)===de.questionId&&(X.__pendingQuestion=null),!1):(X.__pendingQuestion=de,x(!0),!0):!1},[]);N.useEffect(()=>{const $=X=>{const de=X.detail||Os.current;Ls(de)};return window.addEventListener("ask-question-required",$),()=>window.removeEventListener("ask-question-required",$)},[Ls]),N.useEffect(()=>{Le&&Ls(Le)},[Le,Ls]);const qr=N.useCallback(()=>{var de;const $=window,X=$.__pendingQuestion;if(X!=null&&X.questionId){$.__answeredQuestionIds=$.__answeredQuestionIds||new Set,$.__answeredQuestionIds.add(X.questionId);const Se=$.__pendingQuestions||{};for(const je of Object.keys(Se))((de=Se[je])==null?void 0:de.questionId)===X.questionId&&delete Se[je];$.__pendingQuestion=null}x(!1)},[]);N.useEffect(()=>{Pe.autoMode&&Pe.pendingApprovals.length>0&&m(!1),Pe.pendingApprovals.length>0&&!Pe.autoMode&&m(!0)},[Pe.autoMode,Pe.pendingApprovals.length]);const pr=N.useRef(0);N.useEffect(()=>{const $=X=>{var Wt,Pi;if(X.key!=="Escape"||X.defaultPrevented)return;const de=(Wt=X.target)==null?void 0:Wt.tagName;if(de==="INPUT"||de==="TEXTAREA"||(Pi=X.target)!=null&&Pi.isContentEditable)return;const Se=Me.getState(),st=Ge.getState().activeSessionId;if(!st||!Se.isGenerating(st))return;X.preventDefault();const bt=Date.now(),lt=nE(Se.getPending(st).length,Se.isPaused(st),pr.current,bt);if(pr.current=bt,lt==="revokeQueue"){const Xt=Se.clearPending(st);pr.current=0,Xt>0&&ut.info(G("toast.queueRevoked",{count:Xt}))}else if(lt==="stop"){De.send({type:"stop",sessionId:st});const Xt=Se.clearPending(st);pr.current=0,ut.info(Xt>0?G("toast.terminatedQueued",{count:Xt}):G("toast.terminated"))}else De.send({type:"pause",sessionId:st}),ut.info(G("toast.paused"))};return window.addEventListener("keydown",$),()=>window.removeEventListener("keydown",$)},[G]);const js=N.useCallback(()=>{const $=Ge.getState(),X=$.activeSessionId;return((X?$.sessionWorkspaceDirs[X]:"")||he||"").trim()},[he]),Xn=N.useCallback(()=>{N.startTransition(()=>{const $=ca(void 0,js()||void 0);De.setSessionId($),bi.getState().setMode("auto-act"),Ye("chat")})},[ca,js,Ye]),rn=N.useCallback($=>{const X=($||"").trim();X&&N.startTransition(()=>{const de=ca(void 0,X);De.setSessionId(de),bi.getState().setMode("auto-act"),Ye("chat")})},[ca,Ye]),Ul=N.useCallback(($,X)=>{N.startTransition(()=>{const de=Ge.getState();de.sessionTabs.some(Se=>Se.id===$)||de.addSessionTab(X,de.sessionWorkspaceDirs[$]||void 0,$),De.setSessionId($),Ye("chat")})},[Ye]),Pu=N.useCallback(async $=>{const X=await Je.sessions.fork($);if(!X.success||!X.data){ut.error(X.error||G("chat.forkSessionFailed"));return}const{newSessionId:de,title:Se}=X.data;N.startTransition(()=>{const je=Ge.getState(),st=(je.sessionWorkspaceDirs[$]||he||"").trim();je.addSessionTab(Se,st||void 0,de),De.setSessionId(de),Ye("chat")})},[he,Ye,G]),Vr=N.useCallback($=>{N.startTransition(()=>{const X=Ge.getState();let de=X.activeSessionId;de||(de=X.addSessionTab(void 0,he),De.setSessionId(de)),Me.getState().setSessionInput(de,`$${$.id} `),Ye("chat")})},[he,Ye]),Wr=N.useCallback(()=>Ye("templates"),[Ye]),Gl=N.useCallback(async($,X)=>{var lt;const de=await Je.templates.render($.id,X);if(!de.success||!de.data){ut.error(de.error||"模板渲染失败");return}const Se=de.data,je=ca($.name,he);De.setSessionId(je),bi.getState().setMode("auto-act"),Ye("chat");const st=`wf-${Date.now()}-${ar()}`;ot.getState().upsert(je,{runId:st,status:"RUNNING",completedPhases:0,totalPhases:((lt=Se.nodes)==null?void 0:lt.length)??0,completedEffects:0,totalEffects:0,tokensUsed:0,tokensRemaining:0,lastEventType:"workflow_start"});const bt=await Je.workflows.start({sessionId:je,runId:st,workflow:Se,message:`[工作流] ${$.name}`});if(!bt.success||!bt.data){ut.error(bt.error||"工作流启动失败"),ot.getState().fail(je,st,bt.error||"启动失败");return}if(bt.data.status==="FAILED"){const Wt=bt.data.error||"模板定义无效";ut.error(`工作流启动失败: ${Wt}`),ot.getState().fail(je,st,Wt)}},[ca,he,Ye]),ql=N.useRef(0),ji=N.useCallback(async $=>{if(!$)return;const X=++ql.current;try{const de=await Je.sessions.resume($);if(X!==ql.current||!de.success||!de.data)return;const Se=de.data;Se.session&&Ge.getState().updateSession($,Se.session);const je=Se.messages||[];if(je.length>0){const st=Fz(je);st.length>0&&Me.getState().replaceMessages($,st);const bt=je.find(Wt=>E0(Wt)),lt=typeof(bt==null?void 0:bt.content)=="string"?bt.content.replace(/\s+/g," ").trim():"";Ge.getState().touchSession($,lt||void 0)}}catch{}},[]),zu=N.useRef(null),Do=N.useCallback($=>{L($),zu.current!==$.sessionId&&(zu.current=$.sessionId,ji($.sessionId))},[ji]),Bs=N.useCallback($=>{cr($),De.setSessionId($)},[cr]),Ca=N.useCallback($=>{wr($)},[wr]),Gn=N.useCallback(($,X)=>{Sa($,X),Je.sessions.rename($,X).catch(de=>{console.warn("[session] rename sync failed:",de)})},[Sa]),Bi=N.useCallback($=>(($?Fa[$]:"")||he||"").trim(),[Fa,he]),Zp=N.useMemo(()=>{const $=Bi(Le),X=un.filter(de=>Bi(de.id)===$);if(Le&&!X.some(de=>de.id===Le)){const de=un.find(Se=>Se.id===Le);if(de)return[de,...X]}return X},[un,Le,Bi]),Is=N.useCallback(()=>{Le&&zl(Le)},[Le,zl]);N.useEffect(()=>{if(!Le)return;const $=Me.getState().messagesBySession[Le];$&&$.length>0&&Xe.getState().recalculateFromMessages($)},[Le]),N.useEffect(()=>{if(!Le)return;Me.getState().getMessages(Le).length===0&&ji(Le)},[Le,ji]);const Kr=N.useCallback(async($,X,de,Se,je)=>{if(!X.trim()&&!(je!=null&&je.force))return;const st=Me.getState().isGenerating($),bt=Me.getState().isPaused($);if(!(je!=null&&je.force)){if(st&&!bt){console.info(`[sendMessage] Session ${$} generating — message queued (${X.trim().length} chars)`),Me.getState().enqueuePending($,X.trim(),de,Se,je==null?void 0:je.display);return}st&&bt&&(console.warn(`[sendMessage] Session ${$} paused — force-ending paused run`),Me.getState().endGeneration($,"Force-ended: new message"))}const lt=bi.getState();Me.getState().resumeGeneration($),De.setSessionId($),Me.getState().getMessages($).some(Ga=>E0(Ga))?ur($):(kr($,X.trim()),ur($,X.trim()));let Xt=X.trim();if(de&&de.length>0){const Ga=[],Xr=[...de].sort((Mn,Ta)=>Ta.length-Mn.length);for(const Mn of Xr){Xt=Xt.split(`@${Mn}`).join("").trim();try{const Ta=await Je.files.read(Mn),zi=Ta.success&&Ta.data?Ta.data:null;if(zi){const Hu=Mn.split(".").pop()||"";Ga.push(`<context ref="${Mn}">
|
|
584
|
+
\`\`\`${Hu}
|
|
585
|
+
${zi}
|
|
586
|
+
\`\`\`
|
|
587
|
+
</context>`)}}catch(Ta){console.warn(`Failed to read @-referenced file: ${Mn}`,Ta)}}Ga.length>0&&(Xt=Ga.join(`
|
|
588
|
+
|
|
589
|
+
`)+`
|
|
590
|
+
|
|
591
|
+
`+Xt.trim(),Xt=Xt.trim())}const da=(je==null?void 0:je.mentions)??[];WA.getState().setObserved(da);let Tr=Xt;if(da.length>0){for(const Ga of da)for(const Xr of[`@${Ga.title}`,`@${Ga.id}`].sort((Mn,Ta)=>Ta.length-Mn.length))Tr=Tr.split(Xr).join("");Tr=Tr.trim()||Xt}je!=null&&je.skipAddUserMessage||Me.getState().addMessage($,{id:`msg-${Date.now()}`,type:"user",content:Xt,timestamp:Date.now(),...je!=null&&je.display?{display:je.display}:{},...Se&&Se.length>0?{images:Se}:{}});const jo=lt.mode,Wl=ja(jo==="normal"?"act":jo),Zr=Be==="off"?!1:void 0,Aa=Se&&Se.length>0||da.length>0?JSON.stringify({...Se&&Se.length>0?{images:Se}:{},...da.length>0?{mentions:da}:{},...da.length>0?{mentionDeliveryMode:(je==null?void 0:je.mentionDeliveryMode)??"enqueue"}:{}}):void 0;Wl==="plan"?De.send({type:"plan",sessionId:$,message:Tr,effort:Be,thinking:Zr,data:Aa}):Wl==="goal"?De.send({type:"chat",sessionId:$,message:Tr,effort:Be,thinking:Zr,data:Aa}):De.send({type:"chat",sessionId:$,message:Tr,effort:Be,thinking:Zr,data:Aa})},[kr,ur,he,Be]);N.useEffect(()=>(y4(($,X)=>{Kr($,X.content,X.files,X.images,{force:!0,display:X.display})}),()=>y4(null)),[Kr]);const Ii=N.useCallback(($,X)=>{var lt;const de=Me.getState(),Se=de.getMessages($),je=Se.findIndex(Wt=>Wt.id===X);if(je===-1)return;let st=-1;for(let Wt=je-1;Wt>=0;Wt--)if(E0(Se[Wt])){st=Wt;break}if(st===-1)return;const bt=Se[st];(lt=bt==null?void 0:bt.content)!=null&<.trim()&&(de.replaceMessages($,Se.slice(0,st+1)),Kr($,bt.content,void 0,void 0,{skipAddUserMessage:!0}))},[Kr]),$u=N.useCallback(($,X)=>{Me.getState().applyTombstone($,[X]),ut.success(G("chat.messageDeleted"))},[G]),Qn=N.useCallback($=>{const X=Me.getState().clearPending($);X>0&&console.info(`[stopGeneration] Session ${$} — dropped ${X} queued message(s)`);const de=ot.getState().getForSession($);de&&!["COMPLETED","CANCELLED","ERROR","FAILED"].includes(de.status)?De.send({type:"workflow_cancel",sessionId:$,runId:de.runId}):De.send({type:"stop",sessionId:$}),Me.getState().endGeneration($,"user stop")},[]),Mo=N.useCallback($=>{const X=ot.getState().getForSession($);X&&["RUNNING","RESUMING"].includes(X.status)?De.send({type:"workflow_pause",sessionId:$,runId:X.runId}):De.send({type:"pause",sessionId:$}),Me.getState().pauseGeneration($)},[]),Vl=N.useCallback($=>{const X=ot.getState().getForSession($);X&&X.status==="PAUSED"?De.send({type:"workflow_resume",sessionId:$,runId:X.runId}):De.send({type:"resume",sessionId:$}),Me.getState().resumeGeneration($)},[]),Oo=N.useCallback($=>{const X=$.trim();if(!X||X===he)return;ke(X),De.send({type:"workspace",message:X}),Ge.getState().sessionTabs.forEach(Se=>{Me.getState().clearMessages(Se.id)}),Ge.setState({sessionTabs:[],sessions:[],sessionWorkspaceDirs:{},activeSessionId:null}),setTimeout(()=>{Ge.getState().addSessionTab(G("chat.defaultSessionTitle",{n:1}),X)},0)},[he,ke,G]),Yr=()=>{i([]),c(0)},Fu=N.useMemo(()=>({setActiveTab:Ye,createNewSession:Xn,clearMessages:Is,setTheme:ye,setThemePreset:P,setLogs:i,setUnreadLogs:c}),[Ye,Xn,Is,ye,P]);N.useEffect(()=>{const $=X=>{var st,bt;const de=X.ctrlKey||X.metaKey,Se=(st=X.target)==null?void 0:st.tagName,je=Se==="INPUT"||Se==="TEXTAREA"||((bt=X.target)==null?void 0:bt.isContentEditable);if(X.key==="Escape"){if(w){X.preventDefault(),S(!1);return}if(C){X.preventDefault(),E(!1);return}if(d){X.preventDefault(),p(!1);return}return}if(de)if(X.key==="k"||X.key==="K")X.preventDefault(),E(!1),S(lt=>!lt);else if(X.key==="l"||X.key==="L"){if(je)return;X.preventDefault(),Yr(),ut.success(G("slashCommands.logs_clear_result"))}else X.key==="/"&&(X.preventDefault(),S(!1),E(lt=>!lt))};return window.addEventListener("keydown",$),()=>window.removeEventListener("keydown",$)},[w,C,d,G]);const Lo=($,X)=>Zm[$]?G(Zm[$]):X,Ps=$=>{switch($){case"chat":{const X=_a();return g.jsxs("div",{className:"chat-workspace flex flex-col flex-1 min-h-0",children:[g.jsxs("div",{className:"chat-toolbar flex h-9 items-center gap-2 px-3.5",children:[g.jsxs("span",{className:"flex shrink-0 items-center gap-1.5 text-xs text-dark-muted",title:G(n?"chat.connected":"chat.disconnected"),"aria-label":G(n?"chat.connected":"chat.disconnected"),role:"status",children:[g.jsx("span",{className:"ui-status-dot shrink-0","data-status":n?"online":"error","aria-hidden":"true"}),g.jsx("span",{className:"hidden whitespace-nowrap sm:inline",children:G(n?"chat.connected":"chat.disconnected")})]}),g.jsx(n$,{tabs:Zp,activeSessionId:Le,onActivate:Bs,onClose:Ca,onRename:Gn,onNew:Xn,onFork:Pu,workspaceDir:Bi(Le),canClose:un.length>1}),g.jsx(ZS,{view:Ha,onSelect:Fe,counts:{changes:H}}),ua>0&&g.jsx("button",{onClick:Rt?Ne:wt,className:`ui-icon-button transition-colors ${Rt?dn?"bg-accent-blue/10 text-accent-blue":"text-dark-muted hover:bg-dark-hover hover:text-dark-text":It?"bg-accent-blue/10 text-accent-blue":"text-dark-muted hover:bg-dark-hover hover:text-dark-text"}`,title:Rt?"Task Board":"任务看板(右侧)","aria-label":Rt?"Task Board":"任务看板(右侧)","aria-expanded":Rt?dn:It,children:g.jsx($k,{size:16,"aria-hidden":"true"})}),g.jsx("button",{onClick:wt,className:`ui-icon-button transition-colors ${It?"bg-accent-blue/10 text-accent-blue":"text-dark-muted hover:bg-dark-hover hover:text-dark-text"}`,title:"右侧面板","aria-label":"切换右侧面板","aria-expanded":It,children:g.jsx(S_,{size:16,"aria-hidden":"true"})})]}),g.jsx(i$,{sessionId:Le??void 0}),g.jsx(Ek,{tabs:X,activeSessionId:Le,onSend:Kr,onStop:Qn,onPause:Mo,onResume:Vl,activeTab:t,setActiveTab:Ye,createNewSession:Xn,clearMessages:Is,onOpenSidebarView:Fe,setTheme:ye,setThemePreset:P,setLogs:i,setUnreadLogs:c,showTaskBoard:dn&&Rt,onToggleTaskBoard:Ne,onRegenerate:Ii,onDeleteMessage:$u,hookDrawerOpen:h,onCloseHookDrawer:()=>m(!1),questionDrawerOpen:b,onCloseQuestionDrawer:qr,workspaceDir:he,onWorkspaceSelect:Oo,errorLogs:l,onOpenLogs:()=>Ye("logs")})]})}case"models":return g.jsx(S$,{});case"tools":return g.jsx(_$,{});case"skills":return g.jsx(C$,{onUseSkill:Vr});case"templates":return g.jsx(A$,{onLaunch:Gl,workspaceDir:he});case"hooks":return g.jsx(T$,{});case"channels":return g.jsx(N$,{});case"assistants":{const X=T;return g.jsxs("div",{className:"flex h-full min-h-0",children:[g.jsx("div",{className:"w-[340px] shrink-0 border-r border-dark-border",children:g.jsx(R$,{selectedSessionId:(X==null?void 0:X.sessionId)??null,onSelectionChange:Do,onOpenSession:Ul,onNavigate:Ye})}),g.jsx("div",{className:"flex min-w-0 flex-1 flex-col",children:X?g.jsxs(g.Fragment,{children:[g.jsx(s$,{assistant:X,onOpenSession:()=>Ul(X.sessionId,X.title)}),g.jsx(Ek,{tabs:[{id:X.sessionId,title:X.title,createdAt:0}],activeSessionId:X.sessionId,onSend:Kr,onStop:Qn,onPause:Mo,onResume:Vl,activeTab:t,setActiveTab:Ye,createNewSession:Xn,clearMessages:Is,setTheme:ye,setThemePreset:P,setLogs:i,setUnreadLogs:c,showTaskBoard:!1,onRegenerate:Ii,onDeleteMessage:$u,hookDrawerOpen:h,onCloseHookDrawer:()=>m(!1),questionDrawerOpen:b,onCloseQuestionDrawer:qr,workspaceDir:he,onWorkspaceSelect:Oo,errorLogs:l,onOpenLogs:()=>Ye("logs")})]}):g.jsx("div",{className:"flex flex-1 items-center justify-center px-6 text-center text-xs text-dark-muted",children:G("assistants.selectHint")})})]})}case"connectors":return g.jsx(D$,{onNavigate:Ye});case"scheduled":return g.jsx(M$,{});case"logs":return g.jsx($P,{logs:r,onClear:Yr});case"plugins":return g.jsx(O$,{});default:if($.startsWith("plugin:")){const X=He.find(de=>ft(de)===$);if(X)return g.jsx(L$,{contribution:X,hostContext:{sessionId:Le,theme:ge,workspaceDir:he,wsUrl:w1()}})}return null}};return g.jsxs(Ck,{onError:$a,children:[g.jsxs("div",{className:"app-shell h-screen w-full flex bg-dark-bg text-dark-text overflow-hidden",children:[g.jsx("aside",{className:`workbench-sidebar hidden md:block shrink-0 border-r border-dark-border/70 transition-[width] duration-200 ease-in-out overflow-hidden ${q?"w-14":"w-60"}`,children:g.jsx(lk,{collapsed:q,onToggleCollapse:_e,tabs:tn,activeTab:t,onTabChange:Ye,isConnected:n,onNewSession:Xn,onStartTemplate:Gl,onManageTemplates:Wr,onSwitchSession:Bs,onCloseSession:Ca,onRenameSession:Gn,getTabTitle:Lo,onNewSessionInDir:rn})}),d&&g.jsxs("div",{className:"md:hidden fixed inset-0 z-50",children:[g.jsx("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-[2px]",onClick:()=>p(!1)}),g.jsx("aside",{className:"absolute left-0 top-0 h-full w-64 bg-dark-surface border-r border-dark-border shadow-2xl animate-slide-in",children:g.jsx(lk,{collapsed:!1,onToggleCollapse:()=>p(!1),tabs:tn,activeTab:t,onTabChange:$=>{Ye($),p(!1)},isConnected:n,onNewSession:()=>{Xn(),p(!1)},onStartTemplate:Gl,onManageTemplates:()=>{Wr(),p(!1)},onSwitchSession:$=>{Bs($),p(!1)},onCloseSession:Ca,onRenameSession:Gn,getTabTitle:Lo,onNewSessionInDir:$=>{rn($),p(!1)}})})]}),g.jsxs("div",{className:"flex-1 flex flex-col min-w-0 min-h-0",children:[g.jsxs("header",{className:"md:hidden h-12 bg-dark-surface border-b border-dark-border flex items-center gap-1 px-2 shrink-0",children:[g.jsx("button",{className:"ui-icon-button",onClick:()=>p(!0),"aria-label":G("a11y.openMenu"),children:g.jsx(k_,{size:18,"aria-hidden":"true"})}),g.jsx("span",{className:"text-sm font-semibold truncate",children:Lo(t,"")}),g.jsx("div",{className:"flex-1"}),t==="chat"&&g.jsx("button",{onClick:Xn,className:"ui-icon-button","aria-label":G("chat.newSession"),children:g.jsx(vo,{size:18,"aria-hidden":"true"})})]}),g.jsx("div",{className:"flex-1 flex overflow-hidden min-h-0",children:g.jsxs(A_,{direction:"horizontal",children:[g.jsx(zx,{id:"chat-main",minSize:30,className:"min-w-0",children:g.jsx("div",{className:"flex h-full flex-col min-w-0 min-h-0",children:g.jsx(N.Suspense,{fallback:g.jsx(j$,{}),children:g.jsx(Ck,{onError:$a,children:Ps(t)})})})}),t==="chat"&&It&&!Rt&&!Yn&&g.jsx(T_,{className:"w-1 bg-dark-border hover:bg-accent-blue transition-colors cursor-col-resize"}),t==="chat"&&It&&!Rt&&!Yn&&g.jsx(zx,{id:"rightrail",ref:K,defaultSize:20,minSize:14,maxSize:70,className:"min-w-0",children:g.jsx(kP,{sessionId:Le??"",messages:Ro,previewFile:wn,previewTabs:Sr,onPreview:nn,onCloseTab:se,onClosePreview:Ce,isMaximized:Ua,onToggleMaximize:Dt,view:Ha,onViewChange:Ds,onPopOutPreview:()=>Mi(!0)})})]})}),t==="chat"&&It&&!Rt&&Yn&&wn&&g.jsx(Gz,{title:ht,subtitle:wn===ht?void 0:wn,label:G("chat.previewPopOut"),onClose:()=>Mi(!1),children:g.jsx(ty,{sessionId:Le??"",messages:Ro,previewFile:wn,previewTabs:Sr,onPreview:nn,onCloseTab:se,onClosePreview:Ce})}),t==="chat"&&It&&Rt&&g.jsx(k$,{isOpen:!0,onClose:()=>Bn(!1),title:G(o$(Ha)),maxHeight:"60vh",children:g.jsx(l$,{view:Ha,sessionId:Le??"",messages:Ro,previewFile:wn,previewTabs:Sr,onPreview:nn,onCloseTab:se,onClosePreview:Ce})}),g.jsx(e$,{activeTab:t})]})]}),g.jsx(v$,{open:w,onClose:()=>S(!1),options:Fu}),g.jsx(x$,{open:C,onClose:()=>E(!1)}),g.jsx(w$,{}),g.jsx(N.Suspense,{fallback:null,children:g.jsx(E$,{isOpen:Kn,onClose:Un,onNavigate:$=>{Un(),Ye($)},focusSection:cn})}),g.jsx(f$,{}),g.jsx(g$,{})]})}O_.createRoot(document.getElementById("root")).render(g.jsx(__.StrictMode,{children:g.jsx(I$,{})}));export{e1 as $,zB as A,sk as B,oF as C,KI as D,Rw as E,_i as F,Me as G,GB as H,AP as I,Z$ as J,E0 as K,G$ as L,Yp as M,PS as N,Gm as O,J$ as P,HT as Q,r6 as R,lo as S,Ge as T,pF as U,fF as V,W$ as W,Jz as X,V$ as Y,X$ as Z,Q$ as _,Je as a,b4 as a0,b$ as a1,iF as a2,hF as a3,nE as a4,sF as a5,WA as a6,k$ as a7,K$ as a8,uF as a9,Y$ as aa,Ri as ab,j as ac,q$ as ad,ag as ae,b1 as af,B9 as ag,Sp as ah,ou as ai,o1 as aj,m6 as ak,N9 as al,Az as am,dF as an,Cz as ao,_z as ap,r$ as aq,vk as ar,Y as as,bi as b,ja as c,Ke as d,yB as e,Pc as f,gu as g,ot as h,_o as i,vI as j,FS as k,ey as l,Xe as m,fz as n,hu as o,lF as p,ys as q,aF as r,cF as s,ut as t,at as u,eF as v,De as w,rF as x,$B as y,HS as z};
|