@deepseekcode/cli 1.0.37 → 1.0.39

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.
Files changed (50) hide show
  1. package/README.md +10 -1
  2. package/package.json +9 -9
  3. package/web/dist/assets/AssistantsView-0aLB_cG6.js +1 -0
  4. package/web/dist/assets/AutomationView-CAMjPhJ2.js +1 -0
  5. package/web/dist/assets/{ChannelConfigView-JDljUn42.js → ChannelConfigView-FcioeeYb.js} +6 -6
  6. package/web/dist/assets/{ConnectorsView-AemNT1Ae.js → ConnectorsView-DERP7zAW.js} +1 -1
  7. package/web/dist/assets/FileTreeView-hBtHBbAV.js +11 -0
  8. package/web/dist/assets/HookConfigView-NModtSB8.js +1 -0
  9. package/web/dist/assets/ModelsView-BPpO50C_.js +1 -0
  10. package/web/dist/assets/PluginsView-D0NE7zrt.js +1 -0
  11. package/web/dist/assets/ProjectsView-PIv7Gx4q.js +1 -0
  12. package/web/dist/assets/SessionGrid-BsDL3lov.js +47 -0
  13. package/web/dist/assets/SettingsModal-DdebvEmv.js +10 -0
  14. package/web/dist/assets/SkillsView-BNoigImJ.js +1 -0
  15. package/web/dist/assets/TemplatesTab-D8Pa68fj.js +1 -0
  16. package/web/dist/assets/ToolsView-NY-yk5YX.js +1 -0
  17. package/web/dist/assets/WorkspaceDirPicker-C5knnArH.js +6 -0
  18. package/web/dist/assets/{icons-f1hlMKvD.js → icons-BxNxyk-c.js} +219 -139
  19. package/web/dist/assets/index-DaiVo1RY.css +1 -0
  20. package/web/dist/assets/index-RB5ffy32.js +620 -0
  21. package/web/dist/assets/{markdown-DEtuzEyz.js → markdown-B2L4Mq-x.js} +1 -1
  22. package/web/dist/assets/{panels-Bn-2wCur.js → panels-P_I7Q72_.js} +1 -1
  23. package/web/dist/assets/profileChange-C7Jg9C61.js +1 -0
  24. package/web/dist/assets/{react-vendor-ClBKp0t-.js → react-vendor-B2V_5iSS.js} +1 -1
  25. package/web/dist/assets/{state-xD58vmym.js → state-0T92JV0u.js} +1 -1
  26. package/web/dist/fonts/OFL-Inter.txt +93 -0
  27. package/web/dist/fonts/inter-latin-400-normal.woff2 +0 -0
  28. package/web/dist/fonts/inter-latin-600-normal.woff2 +0 -0
  29. package/web/dist/icons/icon-180.png +0 -0
  30. package/web/dist/icons/icon-192.png +0 -0
  31. package/web/dist/icons/icon-512.png +0 -0
  32. package/web/dist/icons/icon-maskable-512.png +0 -0
  33. package/web/dist/index.html +38 -8
  34. package/web/dist/manifest.webmanifest +16 -0
  35. package/web/dist/assets/AssistantsView-OMdgsTIj.js +0 -1
  36. package/web/dist/assets/AutomationView-BPwjLbkL.js +0 -1
  37. package/web/dist/assets/FileTreeView-DYx-0jFV.js +0 -11
  38. package/web/dist/assets/HookConfigView-CS1QqgPx.js +0 -1
  39. package/web/dist/assets/ModelsView-B3nHezvJ.js +0 -1
  40. package/web/dist/assets/PluginsView-C4Xc70ec.js +0 -1
  41. package/web/dist/assets/SessionGrid-C9-LeJH0.js +0 -47
  42. package/web/dist/assets/SettingsModal-CjWT1C66.js +0 -4
  43. package/web/dist/assets/SkillsView-DTZyXald.js +0 -1
  44. package/web/dist/assets/TemplatesTab-CE-CfCf2.js +0 -1
  45. package/web/dist/assets/ThreeScene-CMqkpyKO.js +0 -2863
  46. package/web/dist/assets/ThreeScene-DvOrMIoG.css +0 -1
  47. package/web/dist/assets/ToolsView-CrEHDTEO.js +0 -1
  48. package/web/dist/assets/index-BCHbHIbw.css +0 -1
  49. package/web/dist/assets/index-u1vYyqna.js +0 -592
  50. package/web/dist/assets/sttLanguages-BNRptAQA.js +0 -1
@@ -1,592 +0,0 @@
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/ModelsView-B3nHezvJ.js","assets/markdown-DEtuzEyz.js","assets/icons-f1hlMKvD.js","assets/react-vendor-ClBKp0t-.js","assets/state-xD58vmym.js","assets/panels-Bn-2wCur.js","assets/ToolsView-CrEHDTEO.js","assets/SkillsView-DTZyXald.js","assets/TemplatesTab-CE-CfCf2.js","assets/HookConfigView-CS1QqgPx.js","assets/FileTreeView-DYx-0jFV.js","assets/SessionGrid-C9-LeJH0.js","assets/sttLanguages-BNRptAQA.js","assets/SessionGrid-BGpz0-op.css","assets/SettingsModal-CjWT1C66.js","assets/ChannelConfigView-JDljUn42.js","assets/AssistantsView-OMdgsTIj.js","assets/ConnectorsView-AemNT1Ae.js","assets/AutomationView-BPwjLbkL.js","assets/PluginsView-C4Xc70ec.js"])))=>i.map(i=>d[i]);
2
- var P8=Object.defineProperty;var z8=Object.getPrototypeOf;var $8=Reflect.get;var ex=t=>{throw TypeError(t)};var F8=(t,e,n)=>e in t?P8(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Z=(t,e,n)=>F8(t,typeof e!="symbol"?e+"":e,n),Xp=(t,e,n)=>e.has(t)||ex("Cannot "+n);var Qn=(t,e,n)=>(Xp(t,e,"read from private field"),n?n.call(t):e.get(t)),Xi=(t,e,n)=>e.has(t)?ex("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),fa=(t,e,n,r)=>(Xp(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Qp=(t,e,n)=>(Xp(t,e,"access private method"),n);var tx=(t,e,n)=>$8(z8(t),n,e);import{o as Tc,f as Gd,m as no,a as Q5,p as nx,b as rx,n as ax,h as J5,s as _1,c as U8,v as H8,S as G8,w as C1,d as q8,e as V8,j as g,M as W8,g as K8,r as Y8}from"./markdown-DEtuzEyz.js";import{r as Z8,g as E1,a as N,X as Bn,F as mo,C as e3,b as hf,d as yi,P as lg,e as X8,L as Kn,f as T1,h as pf,S as Q8,G as t3,A as mf,E as A1,i as J8,j as N1,k as e_,l as t_,B as n_,H as n3,m as r3,n as r_,o as a3,p as a_,q as bu,M as s3,s as vu,t as R1,u as i3,v as s_,w as o3,x as i_,y as o_,z as l3,D as l_,I as M0,J as M1,K as c_,N as u_,O as d_,Q as f_,T as h_,U as p_,V as m_,Y as c3,Z as u3,_ as g_,$ as cg,a0 as y_,a1 as b_,a2 as tu,a3 as v_,a4 as D1,a5 as x_,a6 as w_,a7 as k_,a8 as S_,a9 as O1,aa as nu,ab as ug,ac as d3,ad as f3,ae as __,af as h3,ag as C_,ah as E_,ai as T_,aj as sx,ak as Gc,al as A_,am as N_,an as R_,ao as p3,ap as M_,aq as D_,ar as O_,as as L_,at as j_,au as B_,av as I_,aw as P_,ax as z_,ay as $_,az as F_,aA as m3,aB as U_,aC as H_,W as G_}from"./icons-f1hlMKvD.js";import{r as g3}from"./react-vendor-ClBKp0t-.js";import{r as q_,c as gn}from"./state-xD58vmym.js";import{P as y3,a as dg,b as b3}from"./panels-Bn-2wCur.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(a){if(a.ep)return;a.ep=!0;const i=n(a);fetch(a.href,i)}})();var Jp={exports:{}},Ac={},em={exports:{}},tm={};/**
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 ix;function V_(){return ix||(ix=1,(function(t){function e(q,ie){var _e=q.length;q.push(ie);e:for(;0<_e;){var Se=_e-1>>>1,Qe=q[Se];if(0<a(Qe,ie))q[Se]=ie,q[_e]=Qe,_e=Se;else break e}}function n(q){return q.length===0?null:q[0]}function r(q){if(q.length===0)return null;var ie=q[0],_e=q.pop();if(_e!==ie){q[0]=_e;e:for(var Se=0,Qe=q.length,qe=Qe>>>1;Se<qe;){var Ke=2*(Se+1)-1,Ie=q[Ke],vt=Ke+1,an=q[vt];if(0>a(Ie,_e))vt<Qe&&0>a(an,Ie)?(q[Se]=an,q[vt]=_e,Se=vt):(q[Se]=Ie,q[Ke]=_e,Se=Ke);else if(vt<Qe&&0>a(an,_e))q[Se]=an,q[vt]=_e,Se=vt;else break e}}return ie}function a(q,ie){var _e=q.sortIndex-ie.sortIndex;return _e!==0?_e:q.id-ie.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=[],h=[],p=1,m=null,b=3,x=!1,w=!1,S=!1,E=!1,A=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,D=typeof setImmediate<"u"?setImmediate:null;function M(q){for(var ie=n(h);ie!==null;){if(ie.callback===null)r(h);else if(ie.startTime<=q)r(h),ie.sortIndex=ie.expirationTime,e(d,ie);else break;ie=n(h)}}function B(q){if(S=!1,M(q),!w)if(n(d)!==null)w=!0,I||(I=!0,V());else{var ie=n(h);ie!==null&&ge(B,ie.startTime-q)}}var I=!1,U=-1,W=5,Y=-1;function oe(){return E?!0:!(t.unstable_now()-Y<W)}function ae(){if(E=!1,I){var q=t.unstable_now();Y=q;var ie=!0;try{e:{w=!1,S&&(S=!1,T(U),U=-1),x=!0;var _e=b;try{t:{for(M(q),m=n(d);m!==null&&!(m.expirationTime>q&&oe());){var Se=m.callback;if(typeof Se=="function"){m.callback=null,b=m.priorityLevel;var Qe=Se(m.expirationTime<=q);if(q=t.unstable_now(),typeof Qe=="function"){m.callback=Qe,M(q),ie=!0;break t}m===n(d)&&r(d),M(q)}else r(d);m=n(d)}if(m!==null)ie=!0;else{var qe=n(h);qe!==null&&ge(B,qe.startTime-q),ie=!1}}break e}finally{m=null,b=_e,x=!1}ie=void 0}}finally{ie?V():I=!1}}}var V;if(typeof D=="function")V=function(){D(ae)};else if(typeof MessageChannel<"u"){var he=new MessageChannel,ve=he.port2;he.port1.onmessage=ae,V=function(){ve.postMessage(null)}}else V=function(){A(ae,0)};function ge(q,ie){U=A(function(){q(t.unstable_now())},ie)}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(q){q.callback=null},t.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):W=0<q?Math.floor(1e3/q):5},t.unstable_getCurrentPriorityLevel=function(){return b},t.unstable_next=function(q){switch(b){case 1:case 2:case 3:var ie=3;break;default:ie=b}var _e=b;b=ie;try{return q()}finally{b=_e}},t.unstable_requestPaint=function(){E=!0},t.unstable_runWithPriority=function(q,ie){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var _e=b;b=q;try{return ie()}finally{b=_e}},t.unstable_scheduleCallback=function(q,ie,_e){var Se=t.unstable_now();switch(typeof _e=="object"&&_e!==null?(_e=_e.delay,_e=typeof _e=="number"&&0<_e?Se+_e:Se):_e=Se,q){case 1:var Qe=-1;break;case 2:Qe=250;break;case 5:Qe=1073741823;break;case 4:Qe=1e4;break;default:Qe=5e3}return Qe=_e+Qe,q={id:p++,callback:ie,priorityLevel:q,startTime:_e,expirationTime:Qe,sortIndex:-1},_e>Se?(q.sortIndex=_e,e(h,q),n(d)===null&&q===n(h)&&(S?(T(U),U=-1):S=!0,ge(B,_e-Se))):(q.sortIndex=Qe,e(d,q),w||x||(w=!0,I||(I=!0,V()))),q},t.unstable_shouldYield=oe,t.unstable_wrapCallback=function(q){var ie=b;return function(){var _e=b;b=ie;try{return q.apply(this,arguments)}finally{b=_e}}}})(tm)),tm}var ox;function W_(){return ox||(ox=1,em.exports=V_()),em.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 lx;function K_(){if(lx)return Ac;lx=1;var t=W_(),e=Z8(),n=g3();function r(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 a(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(r(188))}function h(s){var o=s.alternate;if(!o){if(o=i(s),o===null)throw Error(r(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(r(188))}if(u.return!==f.return)u=y,f=v;else{for(var C=!1,O=y.child;O;){if(O===u){C=!0,u=y,f=v;break}if(O===f){C=!0,f=y,u=v;break}O=O.sibling}if(!C){for(O=v.child;O;){if(O===u){C=!0,u=v,f=y;break}if(O===f){C=!0,f=v,u=y;break}O=O.sibling}if(!C)throw Error(r(189))}}if(u.alternate!==f)throw Error(r(190))}if(u.tag!==3)throw Error(r(188));return u.stateNode.current===u?s:o}function p(s){var o=s.tag;if(o===5||o===26||o===27||o===6)return s;for(s=s.child;s!==null;){if(o=p(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"),E=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),D=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),U=Symbol.for("react.memo"),W=Symbol.for("react.lazy"),Y=Symbol.for("react.activity"),oe=Symbol.for("react.memo_cache_sentinel"),ae=Symbol.iterator;function V(s){return s===null||typeof s!="object"?null:(s=ae&&s[ae]||s["@@iterator"],typeof s=="function"?s:null)}var he=Symbol.for("react.client.reference");function ve(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===he?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case S:return"Fragment";case A:return"Profiler";case E:return"StrictMode";case B:return"Suspense";case I:return"SuspenseList";case Y:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case w:return"Portal";case D:return s.displayName||"Context";case T:return(s._context.displayName||"Context")+".Consumer";case M:var o=s.render;return s=s.displayName,s||(s=o.displayName||o.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case U:return o=s.displayName||null,o!==null?o:ve(s.type)||"Memo";case W:o=s._payload,s=s._init;try{return ve(s(o))}catch{}}return null}var ge=Array.isArray,q=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ie=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,_e={pending:!1,data:null,method:null,action:null},Se=[],Qe=-1;function qe(s){return{current:s}}function Ke(s){0>Qe||(s.current=Se[Qe],Se[Qe]=null,Qe--)}function Ie(s,o){Qe++,Se[Qe]=s.current,s.current=o}var vt=qe(null),an=qe(null),bn=qe(null),Hn=qe(null);function Ye(s,o){switch(Ie(bn,o),Ie(an,s),Ie(vt,null),o.nodeType){case 9:case 11:s=(s=o.documentElement)&&(s=s.namespaceURI)?S4(s):0;break;default:if(s=o.tagName,o=o.namespaceURI)o=S4(o),s=_4(o,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}Ke(vt),Ie(vt,s)}function vn(){Ke(vt),Ke(an),Ke(bn)}function yr(s){s.memoizedState!==null&&Ie(Hn,s);var o=vt.current,u=_4(o,s.type);o!==u&&(Ie(an,s),Ie(vt,u))}function Yn(s){an.current===s&&(Ke(vt),Ke(an)),Hn.current===s&&(Ke(Hn),Sc._currentValue=_e)}var Lr,Zn;function Tt(s){if(Lr===void 0)try{throw Error()}catch(u){var o=u.stack.trim().match(/\n( *(at )?)/);Lr=o&&o[1]||"",Zn=-1<u.stack.indexOf(`
19
- at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
20
- `+Lr+s+Zn}var jr=!1;function br(s,o){if(!s||jr)return"";jr=!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(re){var te=re}Reflect.construct(s,[],ue)}else{try{ue.call()}catch(re){te=re}s.call(ue.prototype)}}else{try{throw Error()}catch(re){te=re}(ue=s())&&typeof ue.catch=="function"&&ue.catch(function(){})}}catch(re){if(re&&te&&typeof re.stack=="string")return[re.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(),C=v[0],O=v[1];if(C&&O){var $=C.split(`
21
- `),J=O.split(`
22
- `);for(y=f=0;f<$.length&&!$[f].includes("DetermineComponentFrameRoot");)f++;for(;y<J.length&&!J[y].includes("DetermineComponentFrameRoot");)y++;if(f===$.length||y===J.length)for(f=$.length-1,y=J.length-1;1<=f&&0<=y&&$[f]!==J[y];)y--;for(;1<=f&&0<=y;f--,y--)if($[f]!==J[y]){if(f!==1||y!==1)do if(f--,y--,0>y||$[f]!==J[y]){var se=`
23
- `+$[f].replace(" at new "," at ");return s.displayName&&se.includes("<anonymous>")&&(se=se.replace("<anonymous>",s.displayName)),se}while(1<=f&&0<=y);break}}}finally{jr=!1,Error.prepareStackTrace=u}return(u=s?s.displayName||s.name:"")?Tt(u):""}function Br(s,o){switch(s.tag){case 26:case 27:case 5:return Tt(s.type);case 16:return Tt("Lazy");case 13:return s.child!==o&&o!==null?Tt("Suspense Fallback"):Tt("Suspense");case 19:return Tt("SuspenseList");case 0:case 15:return br(s.type,!1);case 11:return br(s.type.render,!1);case 1:return br(s.type,!0);case 31:return Tt("Activity");default:return""}}function Ir(s){try{var o="",u=null;do o+=Br(s,u),u=s,s=s.return;while(s);return o}catch(f){return`
24
- Error generating stack: `+f.message+`
25
- `+f.stack}}var aa=Object.prototype.hasOwnProperty,ar=t.unstable_scheduleCallback,sa=t.unstable_cancelCallback,de=t.unstable_shouldYield,Ve=t.unstable_requestPaint,He=t.unstable_now,Ee=t.unstable_getCurrentPriorityLevel,bt=t.unstable_ImmediatePriority,Lt=t.unstable_UserBlockingPriority,It=t.unstable_NormalPriority,In=t.unstable_LowPriority,xe=t.unstable_IdlePriority,$a=t.log,Vt=t.unstable_setDisableYieldValue,Pr=null,Mn=null;function vr(s){if(typeof $a=="function"&&Vt(s),Mn&&typeof Mn.setStrictMode=="function")try{Mn.setStrictMode(Pr,s)}catch{}}var xn=Math.clz32?Math.clz32:Ll,Dn=Math.log,Eu=Math.LN2;function Ll(s){return s>>>=0,s===0?32:31-(Dn(s)/Eu|0)|0}var Ts=256,Ni=262144,wn=4194304;function Fa(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 Gn(s,o,u){var f=s.pendingLanes;if(f===0)return 0;var y=0,v=s.suspendedLanes,C=s.pingedLanes;s=s.warmLanes;var O=f&134217727;return O!==0?(f=O&~v,f!==0?y=Fa(f):(C&=O,C!==0?y=Fa(C):u||(u=O&~s,u!==0&&(y=Fa(u))))):(O=f&~v,O!==0?y=Fa(O):C!==0?y=Fa(C):u||(u=f&~s,u!==0&&(y=Fa(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 As(s,o){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&o)===0}function Tu(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 Ns(){var s=wn;return wn<<=1,(wn&62914560)===0&&(wn=4194304),s}function Ri(s){for(var o=[],u=0;31>u;u++)o.push(s);return o}function Rs(s,o){s.pendingLanes|=o,o!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function jl(s,o,u,f,y,v){var C=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 O=s.entanglements,$=s.expirationTimes,J=s.hiddenUpdates;for(u=C&~u;0<u;){var se=31-xn(u),ue=1<<se;O[se]=0,$[se]=-1;var te=J[se];if(te!==null)for(J[se]=null,se=0;se<te.length;se++){var re=te[se];re!==null&&(re.lane&=-536870913)}u&=~ue}f!==0&&Au(s,f,0),v!==0&&y===0&&s.tag!==0&&(s.suspendedLanes|=v&~(C&~o))}function Au(s,o,u){s.pendingLanes|=o,s.suspendedLanes&=~o;var f=31-xn(o);s.entangledLanes|=o,s.entanglements[f]=s.entanglements[f]|1073741824|u&261930}function Nu(s,o){var u=s.entangledLanes|=o;for(s=s.entanglements;u;){var f=31-xn(u),y=1<<f;y&o|s[f]&o&&(s[f]|=o),u&=~y}}function Ru(s,o){var u=o&-o;return u=(u&42)!==0?1:Ms(u),(u&(s.suspendedLanes|o))!==0?0:u}function Ms(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 Mi(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function Mu(){var s=ie.p;return s!==0?s:(s=window.event,s===void 0?32:W4(s.type))}function Bl(s,o){var u=ie.p;try{return ie.p=s,o()}finally{ie.p=u}}var xr=Math.random().toString(36).slice(2),kn="__reactFiber$"+xr,Sn="__reactProps$"+xr,ia="__reactContainer$"+xr,oa="__reactEvents$"+xr,qf="__reactListeners$"+xr,Vf="__reactHandles$"+xr,Du="__reactResources$"+xr,Ds="__reactMarker$"+xr;function Di(s){delete s[kn],delete s[Sn],delete s[oa],delete s[qf],delete s[Vf]}function Ua(s){var o=s[kn];if(o)return o;for(var u=s.parentNode;u;){if(o=u[ia]||u[kn]){if(u=o.alternate,o.child!==null||u!==null&&u.child!==null)for(s=M4(s);s!==null;){if(u=s[kn])return u;s=M4(s)}return o}s=u,u=s.parentNode}return null}function Ha(s){if(s=s[kn]||s[ia]){var o=s.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return s}return null}function Ga(s){var o=s.tag;if(o===5||o===26||o===27||o===6)return s.stateNode;throw Error(r(33))}function ya(s){var o=s[Du];return o||(o=s[Du]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function Xt(s){s[Ds]=!0}var Oi=new Set,Ou={};function la(s,o){zr(s,o),zr(s+"Capture",o)}function zr(s,o){for(Ou[s]=o,s=0;s<o.length;s++)Oi.add(o[s])}var Wf=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]*$"),Lu={},ju={};function Kf(s){return aa.call(ju,s)?!0:aa.call(Lu,s)?!1:Wf.test(s)?ju[s]=!0:(Lu[s]=!0,!1)}function ko(s,o,u){if(Kf(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 So(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 $r(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 sr(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function _o(s){var o=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function Yf(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(C){u=""+C,v.call(this,C)}}),Object.defineProperty(s,o,{enumerable:f.enumerable}),{getValue:function(){return u},setValue:function(C){u=""+C},stopTracking:function(){s._valueTracker=null,delete s[o]}}}}function F(s){if(!s._valueTracker){var o=_o(s)?"checked":"value";s._valueTracker=Yf(s,o,""+s[o])}}function ee(s){if(!s)return!1;var o=s._valueTracker;if(!o)return!0;var u=o.getValue(),f="";return s&&(f=_o(s)?s.checked?"true":"false":s.value),s=f,s!==u?(o.setValue(s),!0):!1}function fe(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 Me=/[\n"\\]/g;function Te(s){return s.replace(Me,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function nt(s,o,u,f,y,v,C,O){s.name="",C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?s.type=C:s.removeAttribute("type"),o!=null?C==="number"?(o===0&&s.value===""||s.value!=o)&&(s.value=""+sr(o)):s.value!==""+sr(o)&&(s.value=""+sr(o)):C!=="submit"&&C!=="reset"||s.removeAttribute("value"),o!=null?Qt(s,C,sr(o)):u!=null?Qt(s,C,sr(u)):f!=null&&s.removeAttribute("value"),y==null&&v!=null&&(s.defaultChecked=!!v),y!=null&&(s.checked=y&&typeof y!="function"&&typeof y!="symbol"),O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?s.name=""+sr(O):s.removeAttribute("name")}function Et(s,o,u,f,y,v,C,O){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)){F(s);return}u=u!=null?""+sr(u):"",o=o!=null?""+sr(o):u,O||o===s.value||(s.value=o),s.defaultValue=o}f=f??y,f=typeof f!="function"&&typeof f!="symbol"&&!!f,s.checked=O?s.checked:!!f,s.defaultChecked=!!f,C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(s.name=C),F(s)}function Qt(s,o,u){o==="number"&&fe(s.ownerDocument)===s||s.defaultValue===""+u||(s.defaultValue=""+u)}function Ft(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=""+sr(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 Wt(s,o,u){if(o!=null&&(o=""+sr(o),o!==s.value&&(s.value=o),u==null)){s.defaultValue!==o&&(s.defaultValue=o);return}s.defaultValue=u!=null?""+sr(u):""}function Jt(s,o,u,f){if(o==null){if(f!=null){if(u!=null)throw Error(r(92));if(ge(f)){if(1<f.length)throw Error(r(93));f=f[0]}u=f}u==null&&(u=""),o=u}u=sr(o),s.defaultValue=u,f=s.textContent,f===u&&f!==""&&f!==null&&(s.value=f),F(s)}function ir(s,o){if(o){var u=s.firstChild;if(u&&u===s.lastChild&&u.nodeType===3){u.nodeValue=o;return}}s.textContent=o}var qa=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 Il(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||qa.has(o)?o==="float"?s.cssFloat=u:s[o]=(""+u).trim():s[o]=u+"px"}function Pl(s,o,u){if(o!=null&&typeof o!="object")throw Error(r(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&&Il(s,y,f)}else for(var v in o)o.hasOwnProperty(v)&&Il(s,v,o[v])}function Li(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 zl=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"]]),ba=/^[\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 Os(s){return ba.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function _n(){}var wr=null;function Co(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Ls=null,Eo=null;function ky(s){var o=Ha(s);if(o&&(s=o.stateNode)){var u=s[Sn]||null;e:switch(s=o.stateNode,o.type){case"input":if(nt(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="'+Te(""+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(r(90));nt(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&&ee(f)}break e;case"textarea":Wt(s,u.value,u.defaultValue);break e;case"select":o=u.value,o!=null&&Ft(s,!!u.multiple,o,!1)}}}var Zf=!1;function Sy(s,o,u){if(Zf)return s(o,u);Zf=!0;try{var f=s(o);return f}finally{if(Zf=!1,(Ls!==null||Eo!==null)&&(kd(),Ls&&(o=Ls,s=Eo,Eo=Ls=null,ky(o),s)))for(o=0;o<s.length;o++)ky(s[o])}}function $l(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(r(231,o,typeof u));return u}var Va=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Xf=!1;if(Va)try{var Fl={};Object.defineProperty(Fl,"passive",{get:function(){Xf=!0}}),window.addEventListener("test",Fl,Fl),window.removeEventListener("test",Fl,Fl)}catch{Xf=!1}var js=null,Qf=null,Bu=null;function _y(){if(Bu)return Bu;var s,o=Qf,u=o.length,f,y="value"in js?js.value:js.textContent,v=y.length;for(s=0;s<u&&o[s]===y[s];s++);var C=u-s;for(f=1;f<=C&&o[u-f]===y[v-f];f++);return Bu=y.slice(s,1<f?1-f:void 0)}function Iu(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 Pu(){return!0}function Cy(){return!1}function or(s){function o(u,f,y,v,C){this._reactName=u,this._targetInst=y,this.type=f,this.nativeEvent=v,this.target=C,this.currentTarget=null;for(var O in s)s.hasOwnProperty(O)&&(u=s[O],this[O]=u?u(v):v[O]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?Pu:Cy,this.isPropagationStopped=Cy,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=Pu)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Pu)},persist:function(){},isPersistent:Pu}),o}var ji={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},zu=or(ji),Ul=m({},ji,{view:0,detail:0}),BS=or(Ul),Jf,eh,Hl,$u=m({},Ul,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:nh,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!==Hl&&(Hl&&s.type==="mousemove"?(Jf=s.screenX-Hl.screenX,eh=s.screenY-Hl.screenY):eh=Jf=0,Hl=s),Jf)},movementY:function(s){return"movementY"in s?s.movementY:eh}}),Ey=or($u),IS=m({},$u,{dataTransfer:0}),PS=or(IS),zS=m({},Ul,{relatedTarget:0}),th=or(zS),$S=m({},ji,{animationName:0,elapsedTime:0,pseudoElement:0}),FS=or($S),US=m({},ji,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),HS=or(US),GS=m({},ji,{data:0}),Ty=or(GS),qS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},VS={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"},WS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function KS(s){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(s):(s=WS[s])?!!o[s]:!1}function nh(){return KS}var YS=m({},Ul,{key:function(s){if(s.key){var o=qS[s.key]||s.key;if(o!=="Unidentified")return o}return s.type==="keypress"?(s=Iu(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?VS[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:nh,charCode:function(s){return s.type==="keypress"?Iu(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?Iu(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),ZS=or(YS),XS=m({},$u,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ay=or(XS),QS=m({},Ul,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:nh}),JS=or(QS),e7=m({},ji,{propertyName:0,elapsedTime:0,pseudoElement:0}),t7=or(e7),n7=m({},$u,{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}),r7=or(n7),a7=m({},ji,{newState:0,oldState:0}),s7=or(a7),i7=[9,13,27,32],rh=Va&&"CompositionEvent"in window,Gl=null;Va&&"documentMode"in document&&(Gl=document.documentMode);var o7=Va&&"TextEvent"in window&&!Gl,Ny=Va&&(!rh||Gl&&8<Gl&&11>=Gl),Ry=" ",My=!1;function Dy(s,o){switch(s){case"keyup":return i7.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Oy(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var To=!1;function l7(s,o){switch(s){case"compositionend":return Oy(o);case"keypress":return o.which!==32?null:(My=!0,Ry);case"textInput":return s=o.data,s===Ry&&My?null:s;default:return null}}function c7(s,o){if(To)return s==="compositionend"||!rh&&Dy(s,o)?(s=_y(),Bu=Qf=js=null,To=!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 Ny&&o.locale!=="ko"?null:o.data;default:return null}}var u7={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 Ly(s){var o=s&&s.nodeName&&s.nodeName.toLowerCase();return o==="input"?!!u7[s.type]:o==="textarea"}function jy(s,o,u,f){Ls?Eo?Eo.push(f):Eo=[f]:Ls=f,o=Nd(o,"onChange"),0<o.length&&(u=new zu("onChange","change",null,u,f),s.push({event:u,listeners:o}))}var ql=null,Vl=null;function d7(s){y4(s,0)}function Fu(s){var o=Ga(s);if(ee(o))return s}function By(s,o){if(s==="change")return o}var Iy=!1;if(Va){var ah;if(Va){var sh="oninput"in document;if(!sh){var Py=document.createElement("div");Py.setAttribute("oninput","return;"),sh=typeof Py.oninput=="function"}ah=sh}else ah=!1;Iy=ah&&(!document.documentMode||9<document.documentMode)}function zy(){ql&&(ql.detachEvent("onpropertychange",$y),Vl=ql=null)}function $y(s){if(s.propertyName==="value"&&Fu(Vl)){var o=[];jy(o,Vl,s,Co(s)),Sy(d7,o)}}function f7(s,o,u){s==="focusin"?(zy(),ql=o,Vl=u,ql.attachEvent("onpropertychange",$y)):s==="focusout"&&zy()}function h7(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return Fu(Vl)}function p7(s,o){if(s==="click")return Fu(o)}function m7(s,o){if(s==="input"||s==="change")return Fu(o)}function g7(s,o){return s===o&&(s!==0||1/s===1/o)||s!==s&&o!==o}var kr=typeof Object.is=="function"?Object.is:g7;function Wl(s,o){if(kr(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(!aa.call(o,y)||!kr(s[y],o[y]))return!1}return!0}function Fy(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function Uy(s,o){var u=Fy(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=Fy(u)}}function Hy(s,o){return s&&o?s===o?!0:s&&s.nodeType===3?!1:o&&o.nodeType===3?Hy(s,o.parentNode):"contains"in s?s.contains(o):s.compareDocumentPosition?!!(s.compareDocumentPosition(o)&16):!1:!1}function Gy(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var o=fe(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=fe(s.document)}return o}function ih(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 y7=Va&&"documentMode"in document&&11>=document.documentMode,Ao=null,oh=null,Kl=null,lh=!1;function qy(s,o,u){var f=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;lh||Ao==null||Ao!==fe(f)||(f=Ao,"selectionStart"in f&&ih(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}),Kl&&Wl(Kl,f)||(Kl=f,f=Nd(oh,"onSelect"),0<f.length&&(o=new zu("onSelect","select",null,o,u),s.push({event:o,listeners:f}),o.target=Ao)))}function Bi(s,o){var u={};return u[s.toLowerCase()]=o.toLowerCase(),u["Webkit"+s]="webkit"+o,u["Moz"+s]="moz"+o,u}var No={animationend:Bi("Animation","AnimationEnd"),animationiteration:Bi("Animation","AnimationIteration"),animationstart:Bi("Animation","AnimationStart"),transitionrun:Bi("Transition","TransitionRun"),transitionstart:Bi("Transition","TransitionStart"),transitioncancel:Bi("Transition","TransitionCancel"),transitionend:Bi("Transition","TransitionEnd")},ch={},Vy={};Va&&(Vy=document.createElement("div").style,"AnimationEvent"in window||(delete No.animationend.animation,delete No.animationiteration.animation,delete No.animationstart.animation),"TransitionEvent"in window||delete No.transitionend.transition);function Ii(s){if(ch[s])return ch[s];if(!No[s])return s;var o=No[s],u;for(u in o)if(o.hasOwnProperty(u)&&u in Vy)return ch[s]=o[u];return s}var Wy=Ii("animationend"),Ky=Ii("animationiteration"),Yy=Ii("animationstart"),b7=Ii("transitionrun"),v7=Ii("transitionstart"),x7=Ii("transitioncancel"),Zy=Ii("transitionend"),Xy=new Map,uh="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(" ");uh.push("scrollEnd");function ca(s,o){Xy.set(s,o),la(o,[s])}var Uu=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)},Fr=[],Ro=0,dh=0;function Hu(){for(var s=Ro,o=dh=Ro=0;o<s;){var u=Fr[o];Fr[o++]=null;var f=Fr[o];Fr[o++]=null;var y=Fr[o];Fr[o++]=null;var v=Fr[o];if(Fr[o++]=null,f!==null&&y!==null){var C=f.pending;C===null?y.next=y:(y.next=C.next,C.next=y),f.pending=y}v!==0&&Qy(u,y,v)}}function Gu(s,o,u,f){Fr[Ro++]=s,Fr[Ro++]=o,Fr[Ro++]=u,Fr[Ro++]=f,dh|=f,s.lanes|=f,s=s.alternate,s!==null&&(s.lanes|=f)}function fh(s,o,u,f){return Gu(s,o,u,f),qu(s)}function Pi(s,o){return Gu(s,null,null,o),qu(s)}function Qy(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-xn(u),s=v.hiddenUpdates,f=s[y],f===null?s[y]=[o]:f.push(o),o.lane=u|536870912),v):null}function qu(s){if(50<gc)throw gc=0,wp=null,Error(r(185));for(var o=s.return;o!==null;)s=o,o=s.return;return s.tag===3?s.stateNode:null}var Mo={};function w7(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 Sr(s,o,u,f){return new w7(s,o,u,f)}function hh(s){return s=s.prototype,!(!s||!s.isReactComponent)}function Wa(s,o){var u=s.alternate;return u===null?(u=Sr(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 Jy(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 Vu(s,o,u,f,y,v){var C=0;if(f=s,typeof s=="function")hh(s)&&(C=1);else if(typeof s=="string")C=E8(s,u,vt.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case Y:return s=Sr(31,u,o,y),s.elementType=Y,s.lanes=v,s;case S:return zi(u.children,y,v,o);case E:C=8,y|=24;break;case A:return s=Sr(12,u,o,y|2),s.elementType=A,s.lanes=v,s;case B:return s=Sr(13,u,o,y),s.elementType=B,s.lanes=v,s;case I:return s=Sr(19,u,o,y),s.elementType=I,s.lanes=v,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case D:C=10;break e;case T:C=9;break e;case M:C=11;break e;case U:C=14;break e;case W:C=16,f=null;break e}C=29,u=Error(r(130,s===null?"null":typeof s,"")),f=null}return o=Sr(C,u,o,y),o.elementType=s,o.type=f,o.lanes=v,o}function zi(s,o,u,f){return s=Sr(7,s,f,o),s.lanes=u,s}function ph(s,o,u){return s=Sr(6,s,null,o),s.lanes=u,s}function eb(s){var o=Sr(18,null,null,0);return o.stateNode=s,o}function mh(s,o,u){return o=Sr(4,s.children!==null?s.children:[],s.key,o),o.lanes=u,o.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},o}var tb=new WeakMap;function Ur(s,o){if(typeof s=="object"&&s!==null){var u=tb.get(s);return u!==void 0?u:(o={value:s,source:o,stack:Ir(o)},tb.set(s,o),o)}return{value:s,source:o,stack:Ir(o)}}var Do=[],Oo=0,Wu=null,Yl=0,Hr=[],Gr=0,Bs=null,va=1,xa="";function Ka(s,o){Do[Oo++]=Yl,Do[Oo++]=Wu,Wu=s,Yl=o}function nb(s,o,u){Hr[Gr++]=va,Hr[Gr++]=xa,Hr[Gr++]=Bs,Bs=s;var f=va;s=xa;var y=32-xn(f)-1;f&=~(1<<y),u+=1;var v=32-xn(o)+y;if(30<v){var C=y-y%5;v=(f&(1<<C)-1).toString(32),f>>=C,y-=C,va=1<<32-xn(o)+y|u<<y|f,xa=v+s}else va=1<<v|u<<y|f,xa=s}function gh(s){s.return!==null&&(Ka(s,1),nb(s,1,0))}function yh(s){for(;s===Wu;)Wu=Do[--Oo],Do[Oo]=null,Yl=Do[--Oo],Do[Oo]=null;for(;s===Bs;)Bs=Hr[--Gr],Hr[Gr]=null,xa=Hr[--Gr],Hr[Gr]=null,va=Hr[--Gr],Hr[Gr]=null}function rb(s,o){Hr[Gr++]=va,Hr[Gr++]=xa,Hr[Gr++]=Bs,va=o.id,xa=o.overflow,Bs=s}var Pn=null,zt=null,gt=!1,Is=null,qr=!1,bh=Error(r(519));function Ps(s){var o=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Zl(Ur(o,s)),bh}function ab(s){var o=s.stateNode,u=s.type,f=s.memoizedProps;switch(o[kn]=s,o[Sn]=f,u){case"dialog":ft("cancel",o),ft("close",o);break;case"iframe":case"object":case"embed":ft("load",o);break;case"video":case"audio":for(u=0;u<bc.length;u++)ft(bc[u],o);break;case"source":ft("error",o);break;case"img":case"image":case"link":ft("error",o),ft("load",o);break;case"details":ft("toggle",o);break;case"input":ft("invalid",o),Et(o,f.value,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name,!0);break;case"select":ft("invalid",o);break;case"textarea":ft("invalid",o),Jt(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||w4(o.textContent,u)?(f.popover!=null&&(ft("beforetoggle",o),ft("toggle",o)),f.onScroll!=null&&ft("scroll",o),f.onScrollEnd!=null&&ft("scrollend",o),f.onClick!=null&&(o.onclick=_n),o=!0):o=!1,o||Ps(s,!0)}function sb(s){for(Pn=s.return;Pn;)switch(Pn.tag){case 5:case 31:case 13:qr=!1;return;case 27:case 3:qr=!0;return;default:Pn=Pn.return}}function Lo(s){if(s!==Pn)return!1;if(!gt)return sb(s),gt=!0,!1;var o=s.tag,u;if((u=o!==3&&o!==27)&&((u=o===5)&&(u=s.type,u=!(u!=="form"&&u!=="button")||Bp(s.type,s.memoizedProps)),u=!u),u&&zt&&Ps(s),sb(s),o===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));zt=R4(s)}else if(o===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));zt=R4(s)}else o===27?(o=zt,Qs(s.type)?(s=Fp,Fp=null,zt=s):zt=o):zt=Pn?Wr(s.stateNode.nextSibling):null;return!0}function $i(){zt=Pn=null,gt=!1}function vh(){var s=Is;return s!==null&&(dr===null?dr=s:dr.push.apply(dr,s),Is=null),s}function Zl(s){Is===null?Is=[s]:Is.push(s)}var xh=qe(null),Fi=null,Ya=null;function zs(s,o,u){Ie(xh,o._currentValue),o._currentValue=u}function Za(s){s._currentValue=xh.current,Ke(xh)}function wh(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 kh(s,o,u,f){var y=s.child;for(y!==null&&(y.return=s);y!==null;){var v=y.dependencies;if(v!==null){var C=y.child;v=v.firstContext;e:for(;v!==null;){var O=v;v=y;for(var $=0;$<o.length;$++)if(O.context===o[$]){v.lanes|=u,O=v.alternate,O!==null&&(O.lanes|=u),wh(v.return,u,s),f||(C=null);break e}v=O.next}}else if(y.tag===18){if(C=y.return,C===null)throw Error(r(341));C.lanes|=u,v=C.alternate,v!==null&&(v.lanes|=u),wh(C,u,s),C=null}else C=y.child;if(C!==null)C.return=y;else for(C=y;C!==null;){if(C===s){C=null;break}if(y=C.sibling,y!==null){y.return=C.return,C=y;break}C=C.return}y=C}}function jo(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 C=y.alternate;if(C===null)throw Error(r(387));if(C=C.memoizedProps,C!==null){var O=y.type;kr(y.pendingProps.value,C.value)||(s!==null?s.push(O):s=[O])}}else if(y===Hn.current){if(C=y.alternate,C===null)throw Error(r(387));C.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(s!==null?s.push(Sc):s=[Sc])}y=y.return}s!==null&&kh(o,s,u,f),o.flags|=262144}function Ku(s){for(s=s.firstContext;s!==null;){if(!kr(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function Ui(s){Fi=s,Ya=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function zn(s){return ib(Fi,s)}function Yu(s,o){return Fi===null&&Ui(s),ib(s,o)}function ib(s,o){var u=o._currentValue;if(o={context:o,memoizedValue:u,next:null},Ya===null){if(s===null)throw Error(r(308));Ya=o,s.dependencies={lanes:0,firstContext:o},s.flags|=524288}else Ya=Ya.next=o;return u}var k7=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()})}},S7=t.unstable_scheduleCallback,_7=t.unstable_NormalPriority,cn={$$typeof:D,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Sh(){return{controller:new k7,data:new Map,refCount:0}}function Xl(s){s.refCount--,s.refCount===0&&S7(_7,function(){s.controller.abort()})}var Ql=null,_h=0,Bo=0,Io=null;function C7(s,o){if(Ql===null){var u=Ql=[];_h=0,Bo=Tp(),Io={status:"pending",value:void 0,then:function(f){u.push(f)}}}return _h++,o.then(ob,ob),o}function ob(){if(--_h===0&&Ql!==null){Io!==null&&(Io.status="fulfilled");var s=Ql;Ql=null,Bo=0,Io=null;for(var o=0;o<s.length;o++)(0,s[o])()}}function E7(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 lb=q.S;q.S=function(s,o){qv=He(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&C7(s,o),lb!==null&&lb(s,o)};var Hi=qe(null);function Ch(){var s=Hi.current;return s!==null?s:jt.pooledCache}function Zu(s,o){o===null?Ie(Hi,Hi.current):Ie(Hi,o.pool)}function cb(){var s=Ch();return s===null?null:{parent:cn._currentValue,pool:s}}var Po=Error(r(460)),Eh=Error(r(474)),Xu=Error(r(542)),Qu={then:function(){}};function ub(s){return s=s.status,s==="fulfilled"||s==="rejected"}function db(s,o,u){switch(u=s[u],u===void 0?s.push(o):u!==o&&(o.then(_n,_n),o=u),o.status){case"fulfilled":return o.value;case"rejected":throw s=o.reason,hb(s),s;default:if(typeof o.status=="string")o.then(_n,_n);else{if(s=jt,s!==null&&100<s.shellSuspendCounter)throw Error(r(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,hb(s),s}throw qi=o,Po}}function Gi(s){try{var o=s._init;return o(s._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(qi=u,Po):u}}var qi=null;function fb(){if(qi===null)throw Error(r(459));var s=qi;return qi=null,s}function hb(s){if(s===Po||s===Xu)throw Error(r(483))}var zo=null,Jl=0;function Ju(s){var o=Jl;return Jl+=1,zo===null&&(zo=[]),db(zo,s,o)}function ec(s,o){o=o.props.ref,s.ref=o!==void 0?o:null}function ed(s,o){throw o.$$typeof===b?Error(r(525)):(s=Object.prototype.toString.call(o),Error(r(31,s==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":s)))}function pb(s){function o(K,H){if(s){var X=K.deletions;X===null?(K.deletions=[H],K.flags|=16):X.push(H)}}function u(K,H){if(!s)return null;for(;H!==null;)o(K,H),H=H.sibling;return null}function f(K){for(var H=new Map;K!==null;)K.key!==null?H.set(K.key,K):H.set(K.index,K),K=K.sibling;return H}function y(K,H){return K=Wa(K,H),K.index=0,K.sibling=null,K}function v(K,H,X){return K.index=X,s?(X=K.alternate,X!==null?(X=X.index,X<H?(K.flags|=67108866,H):X):(K.flags|=67108866,H)):(K.flags|=1048576,H)}function C(K){return s&&K.alternate===null&&(K.flags|=67108866),K}function O(K,H,X,ce){return H===null||H.tag!==6?(H=ph(X,K.mode,ce),H.return=K,H):(H=y(H,X),H.return=K,H)}function $(K,H,X,ce){var Pe=X.type;return Pe===S?se(K,H,X.props.children,ce,X.key):H!==null&&(H.elementType===Pe||typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===W&&Gi(Pe)===H.type)?(H=y(H,X.props),ec(H,X),H.return=K,H):(H=Vu(X.type,X.key,X.props,null,K.mode,ce),ec(H,X),H.return=K,H)}function J(K,H,X,ce){return H===null||H.tag!==4||H.stateNode.containerInfo!==X.containerInfo||H.stateNode.implementation!==X.implementation?(H=mh(X,K.mode,ce),H.return=K,H):(H=y(H,X.children||[]),H.return=K,H)}function se(K,H,X,ce,Pe){return H===null||H.tag!==7?(H=zi(X,K.mode,ce,Pe),H.return=K,H):(H=y(H,X),H.return=K,H)}function ue(K,H,X){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return H=ph(""+H,K.mode,X),H.return=K,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case x:return X=Vu(H.type,H.key,H.props,null,K.mode,X),ec(X,H),X.return=K,X;case w:return H=mh(H,K.mode,X),H.return=K,H;case W:return H=Gi(H),ue(K,H,X)}if(ge(H)||V(H))return H=zi(H,K.mode,X,null),H.return=K,H;if(typeof H.then=="function")return ue(K,Ju(H),X);if(H.$$typeof===D)return ue(K,Yu(K,H),X);ed(K,H)}return null}function te(K,H,X,ce){var Pe=H!==null?H.key:null;if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return Pe!==null?null:O(K,H,""+X,ce);if(typeof X=="object"&&X!==null){switch(X.$$typeof){case x:return X.key===Pe?$(K,H,X,ce):null;case w:return X.key===Pe?J(K,H,X,ce):null;case W:return X=Gi(X),te(K,H,X,ce)}if(ge(X)||V(X))return Pe!==null?null:se(K,H,X,ce,null);if(typeof X.then=="function")return te(K,H,Ju(X),ce);if(X.$$typeof===D)return te(K,H,Yu(K,X),ce);ed(K,X)}return null}function re(K,H,X,ce,Pe){if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return K=K.get(X)||null,O(H,K,""+ce,Pe);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case x:return K=K.get(ce.key===null?X:ce.key)||null,$(H,K,ce,Pe);case w:return K=K.get(ce.key===null?X:ce.key)||null,J(H,K,ce,Pe);case W:return ce=Gi(ce),re(K,H,X,ce,Pe)}if(ge(ce)||V(ce))return K=K.get(X)||null,se(H,K,ce,Pe,null);if(typeof ce.then=="function")return re(K,H,X,Ju(ce),Pe);if(ce.$$typeof===D)return re(K,H,X,Yu(H,ce),Pe);ed(H,ce)}return null}function Re(K,H,X,ce){for(var Pe=null,xt=null,Le=H,at=H=0,pt=null;Le!==null&&at<X.length;at++){Le.index>at?(pt=Le,Le=null):pt=Le.sibling;var wt=te(K,Le,X[at],ce);if(wt===null){Le===null&&(Le=pt);break}s&&Le&&wt.alternate===null&&o(K,Le),H=v(wt,H,at),xt===null?Pe=wt:xt.sibling=wt,xt=wt,Le=pt}if(at===X.length)return u(K,Le),gt&&Ka(K,at),Pe;if(Le===null){for(;at<X.length;at++)Le=ue(K,X[at],ce),Le!==null&&(H=v(Le,H,at),xt===null?Pe=Le:xt.sibling=Le,xt=Le);return gt&&Ka(K,at),Pe}for(Le=f(Le);at<X.length;at++)pt=re(Le,K,at,X[at],ce),pt!==null&&(s&&pt.alternate!==null&&Le.delete(pt.key===null?at:pt.key),H=v(pt,H,at),xt===null?Pe=pt:xt.sibling=pt,xt=pt);return s&&Le.forEach(function(ri){return o(K,ri)}),gt&&Ka(K,at),Pe}function $e(K,H,X,ce){if(X==null)throw Error(r(151));for(var Pe=null,xt=null,Le=H,at=H=0,pt=null,wt=X.next();Le!==null&&!wt.done;at++,wt=X.next()){Le.index>at?(pt=Le,Le=null):pt=Le.sibling;var ri=te(K,Le,wt.value,ce);if(ri===null){Le===null&&(Le=pt);break}s&&Le&&ri.alternate===null&&o(K,Le),H=v(ri,H,at),xt===null?Pe=ri:xt.sibling=ri,xt=ri,Le=pt}if(wt.done)return u(K,Le),gt&&Ka(K,at),Pe;if(Le===null){for(;!wt.done;at++,wt=X.next())wt=ue(K,wt.value,ce),wt!==null&&(H=v(wt,H,at),xt===null?Pe=wt:xt.sibling=wt,xt=wt);return gt&&Ka(K,at),Pe}for(Le=f(Le);!wt.done;at++,wt=X.next())wt=re(Le,K,at,wt.value,ce),wt!==null&&(s&&wt.alternate!==null&&Le.delete(wt.key===null?at:wt.key),H=v(wt,H,at),xt===null?Pe=wt:xt.sibling=wt,xt=wt);return s&&Le.forEach(function(I8){return o(K,I8)}),gt&&Ka(K,at),Pe}function Ot(K,H,X,ce){if(typeof X=="object"&&X!==null&&X.type===S&&X.key===null&&(X=X.props.children),typeof X=="object"&&X!==null){switch(X.$$typeof){case x:e:{for(var Pe=X.key;H!==null;){if(H.key===Pe){if(Pe=X.type,Pe===S){if(H.tag===7){u(K,H.sibling),ce=y(H,X.props.children),ce.return=K,K=ce;break e}}else if(H.elementType===Pe||typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===W&&Gi(Pe)===H.type){u(K,H.sibling),ce=y(H,X.props),ec(ce,X),ce.return=K,K=ce;break e}u(K,H);break}else o(K,H);H=H.sibling}X.type===S?(ce=zi(X.props.children,K.mode,ce,X.key),ce.return=K,K=ce):(ce=Vu(X.type,X.key,X.props,null,K.mode,ce),ec(ce,X),ce.return=K,K=ce)}return C(K);case w:e:{for(Pe=X.key;H!==null;){if(H.key===Pe)if(H.tag===4&&H.stateNode.containerInfo===X.containerInfo&&H.stateNode.implementation===X.implementation){u(K,H.sibling),ce=y(H,X.children||[]),ce.return=K,K=ce;break e}else{u(K,H);break}else o(K,H);H=H.sibling}ce=mh(X,K.mode,ce),ce.return=K,K=ce}return C(K);case W:return X=Gi(X),Ot(K,H,X,ce)}if(ge(X))return Re(K,H,X,ce);if(V(X)){if(Pe=V(X),typeof Pe!="function")throw Error(r(150));return X=Pe.call(X),$e(K,H,X,ce)}if(typeof X.then=="function")return Ot(K,H,Ju(X),ce);if(X.$$typeof===D)return Ot(K,H,Yu(K,X),ce);ed(K,X)}return typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint"?(X=""+X,H!==null&&H.tag===6?(u(K,H.sibling),ce=y(H,X),ce.return=K,K=ce):(u(K,H),ce=ph(X,K.mode,ce),ce.return=K,K=ce),C(K)):u(K,H)}return function(K,H,X,ce){try{Jl=0;var Pe=Ot(K,H,X,ce);return zo=null,Pe}catch(Le){if(Le===Po||Le===Xu)throw Le;var xt=Sr(29,Le,null,K.mode);return xt.lanes=ce,xt.return=K,xt}finally{}}}var Vi=pb(!0),mb=pb(!1),$s=!1;function Th(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ah(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 Fs(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function Us(s,o,u){var f=s.updateQueue;if(f===null)return null;if(f=f.shared,(St&2)!==0){var y=f.pending;return y===null?o.next=o:(o.next=y.next,y.next=o),f.pending=o,o=qu(s),Qy(s,null,u),o}return Gu(s,f,o,u),qu(s)}function tc(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,Nu(s,u)}}function Nh(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 C={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};v===null?y=v=C:v=v.next=C,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 Rh=!1;function nc(){if(Rh){var s=Io;if(s!==null)throw s}}function rc(s,o,u,f){Rh=!1;var y=s.updateQueue;$s=!1;var v=y.firstBaseUpdate,C=y.lastBaseUpdate,O=y.shared.pending;if(O!==null){y.shared.pending=null;var $=O,J=$.next;$.next=null,C===null?v=J:C.next=J,C=$;var se=s.alternate;se!==null&&(se=se.updateQueue,O=se.lastBaseUpdate,O!==C&&(O===null?se.firstBaseUpdate=J:O.next=J,se.lastBaseUpdate=$))}if(v!==null){var ue=y.baseState;C=0,se=J=$=null,O=v;do{var te=O.lane&-536870913,re=te!==O.lane;if(re?(ht&te)===te:(f&te)===te){te!==0&&te===Bo&&(Rh=!0),se!==null&&(se=se.next={lane:0,tag:O.tag,payload:O.payload,callback:null,next:null});e:{var Re=s,$e=O;te=o;var Ot=u;switch($e.tag){case 1:if(Re=$e.payload,typeof Re=="function"){ue=Re.call(Ot,ue,te);break e}ue=Re;break e;case 3:Re.flags=Re.flags&-65537|128;case 0:if(Re=$e.payload,te=typeof Re=="function"?Re.call(Ot,ue,te):Re,te==null)break e;ue=m({},ue,te);break e;case 2:$s=!0}}te=O.callback,te!==null&&(s.flags|=64,re&&(s.flags|=8192),re=y.callbacks,re===null?y.callbacks=[te]:re.push(te))}else re={lane:te,tag:O.tag,payload:O.payload,callback:O.callback,next:null},se===null?(J=se=re,$=ue):se=se.next=re,C|=te;if(O=O.next,O===null){if(O=y.shared.pending,O===null)break;re=O,O=re.next,re.next=null,y.lastBaseUpdate=re,y.shared.pending=null}}while(!0);se===null&&($=ue),y.baseState=$,y.firstBaseUpdate=J,y.lastBaseUpdate=se,v===null&&(y.shared.lanes=0),Ws|=C,s.lanes=C,s.memoizedState=ue}}function gb(s,o){if(typeof s!="function")throw Error(r(191,s));s.call(o)}function yb(s,o){var u=s.callbacks;if(u!==null)for(s.callbacks=null,s=0;s<u.length;s++)gb(u[s],o)}var $o=qe(null),td=qe(0);function bb(s,o){s=ss,Ie(td,s),Ie($o,o),ss=s|o.baseLanes}function Mh(){Ie(td,ss),Ie($o,$o.current)}function Dh(){ss=td.current,Ke($o),Ke(td)}var _r=qe(null),Vr=null;function Hs(s){var o=s.alternate;Ie(sn,sn.current&1),Ie(_r,s),Vr===null&&(o===null||$o.current!==null||o.memoizedState!==null)&&(Vr=s)}function Oh(s){Ie(sn,sn.current),Ie(_r,s),Vr===null&&(Vr=s)}function vb(s){s.tag===22?(Ie(sn,sn.current),Ie(_r,s),Vr===null&&(Vr=s)):Gs()}function Gs(){Ie(sn,sn.current),Ie(_r,_r.current)}function Cr(s){Ke(_r),Vr===s&&(Vr=null),Ke(sn)}var sn=qe(0);function nd(s){for(var o=s;o!==null;){if(o.tag===13){var u=o.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||zp(u)||$p(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 Xa=0,rt=null,Mt=null,un=null,rd=!1,Fo=!1,Wi=!1,ad=0,ac=0,Uo=null,T7=0;function en(){throw Error(r(321))}function Lh(s,o){if(o===null)return!1;for(var u=0;u<o.length&&u<s.length;u++)if(!kr(s[u],o[u]))return!1;return!0}function jh(s,o,u,f,y,v){return Xa=v,rt=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,q.H=s===null||s.memoizedState===null?nv:Zh,Wi=!1,v=u(f,y),Wi=!1,Fo&&(v=wb(o,u,f,y)),xb(s),v}function xb(s){q.H=oc;var o=Mt!==null&&Mt.next!==null;if(Xa=0,un=Mt=rt=null,rd=!1,ac=0,Uo=null,o)throw Error(r(300));s===null||dn||(s=s.dependencies,s!==null&&Ku(s)&&(dn=!0))}function wb(s,o,u,f){rt=s;var y=0;do{if(Fo&&(Uo=null),ac=0,Fo=!1,25<=y)throw Error(r(301));if(y+=1,un=Mt=null,s.updateQueue!=null){var v=s.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}q.H=rv,v=o(u,f)}while(Fo);return v}function A7(){var s=q.H,o=s.useState()[0];return o=typeof o.then=="function"?sc(o):o,s=s.useState()[0],(Mt!==null?Mt.memoizedState:null)!==s&&(rt.flags|=1024),o}function Bh(){var s=ad!==0;return ad=0,s}function Ih(s,o,u){o.updateQueue=s.updateQueue,o.flags&=-2053,s.lanes&=~u}function Ph(s){if(rd){for(s=s.memoizedState;s!==null;){var o=s.queue;o!==null&&(o.pending=null),s=s.next}rd=!1}Xa=0,un=Mt=rt=null,Fo=!1,ac=ad=0,Uo=null}function Xn(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return un===null?rt.memoizedState=un=s:un=un.next=s,un}function on(){if(Mt===null){var s=rt.alternate;s=s!==null?s.memoizedState:null}else s=Mt.next;var o=un===null?rt.memoizedState:un.next;if(o!==null)un=o,Mt=s;else{if(s===null)throw rt.alternate===null?Error(r(467)):Error(r(310));Mt=s,s={memoizedState:Mt.memoizedState,baseState:Mt.baseState,baseQueue:Mt.baseQueue,queue:Mt.queue,next:null},un===null?rt.memoizedState=un=s:un=un.next=s}return un}function sd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function sc(s){var o=ac;return ac+=1,Uo===null&&(Uo=[]),s=db(Uo,s,o),o=rt,(un===null?o.memoizedState:un.next)===null&&(o=o.alternate,q.H=o===null||o.memoizedState===null?nv:Zh),s}function id(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return sc(s);if(s.$$typeof===D)return zn(s)}throw Error(r(438,String(s)))}function zh(s){var o=null,u=rt.updateQueue;if(u!==null&&(o=u.memoCache),o==null){var f=rt.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=sd(),rt.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]=oe;return o.index++,u}function Qa(s,o){return typeof o=="function"?o(s):o}function od(s){var o=on();return $h(o,Mt,s)}function $h(s,o,u){var f=s.queue;if(f===null)throw Error(r(311));f.lastRenderedReducer=u;var y=s.baseQueue,v=f.pending;if(v!==null){if(y!==null){var C=y.next;y.next=v.next,v.next=C}o.baseQueue=y=v,f.pending=null}if(v=s.baseState,y===null)s.memoizedState=v;else{o=y.next;var O=C=null,$=null,J=o,se=!1;do{var ue=J.lane&-536870913;if(ue!==J.lane?(ht&ue)===ue:(Xa&ue)===ue){var te=J.revertLane;if(te===0)$!==null&&($=$.next={lane:0,revertLane:0,gesture:null,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null}),ue===Bo&&(se=!0);else if((Xa&te)===te){J=J.next,te===Bo&&(se=!0);continue}else ue={lane:0,revertLane:J.revertLane,gesture:null,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},$===null?(O=$=ue,C=v):$=$.next=ue,rt.lanes|=te,Ws|=te;ue=J.action,Wi&&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},$===null?(O=$=te,C=v):$=$.next=te,rt.lanes|=ue,Ws|=ue;J=J.next}while(J!==null&&J!==o);if($===null?C=v:$.next=O,!kr(v,s.memoizedState)&&(dn=!0,se&&(u=Io,u!==null)))throw u;s.memoizedState=v,s.baseState=C,s.baseQueue=$,f.lastRenderedState=v}return y===null&&(f.lanes=0),[s.memoizedState,f.dispatch]}function Fh(s){var o=on(),u=o.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=s;var f=u.dispatch,y=u.pending,v=o.memoizedState;if(y!==null){u.pending=null;var C=y=y.next;do v=s(v,C.action),C=C.next;while(C!==y);kr(v,o.memoizedState)||(dn=!0),o.memoizedState=v,o.baseQueue===null&&(o.baseState=v),u.lastRenderedState=v}return[v,f]}function kb(s,o,u){var f=rt,y=on(),v=gt;if(v){if(u===void 0)throw Error(r(407));u=u()}else u=o();var C=!kr((Mt||y).memoizedState,u);if(C&&(y.memoizedState=u,dn=!0),y=y.queue,Gh(Cb.bind(null,f,y,s),[s]),y.getSnapshot!==o||C||un!==null&&un.memoizedState.tag&1){if(f.flags|=2048,Ho(9,{destroy:void 0},_b.bind(null,f,y,u,o),null),jt===null)throw Error(r(349));v||(Xa&127)!==0||Sb(f,o,u)}return u}function Sb(s,o,u){s.flags|=16384,s={getSnapshot:o,value:u},o=rt.updateQueue,o===null?(o=sd(),rt.updateQueue=o,o.stores=[s]):(u=o.stores,u===null?o.stores=[s]:u.push(s))}function _b(s,o,u,f){o.value=u,o.getSnapshot=f,Eb(o)&&Tb(s)}function Cb(s,o,u){return u(function(){Eb(o)&&Tb(s)})}function Eb(s){var o=s.getSnapshot;s=s.value;try{var u=o();return!kr(s,u)}catch{return!0}}function Tb(s){var o=Pi(s,2);o!==null&&fr(o,s,2)}function Uh(s){var o=Xn();if(typeof s=="function"){var u=s;if(s=u(),Wi){vr(!0);try{u()}finally{vr(!1)}}}return o.memoizedState=o.baseState=s,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qa,lastRenderedState:s},o}function Ab(s,o,u,f){return s.baseState=u,$h(s,Mt,typeof f=="function"?f:Qa)}function N7(s,o,u,f,y){if(ud(s))throw Error(r(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(C){v.listeners.push(C)}};q.T!==null?u(!0):v.isTransition=!1,f(v),u=o.pending,u===null?(v.next=o.pending=v,Nb(o,v)):(v.next=u.next,o.pending=u.next=v)}}function Nb(s,o){var u=o.action,f=o.payload,y=s.state;if(o.isTransition){var v=q.T,C={};q.T=C;try{var O=u(y,f),$=q.S;$!==null&&$(C,O),Rb(s,o,O)}catch(J){Hh(s,o,J)}finally{v!==null&&C.types!==null&&(v.types=C.types),q.T=v}}else try{v=u(y,f),Rb(s,o,v)}catch(J){Hh(s,o,J)}}function Rb(s,o,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(f){Mb(s,o,f)},function(f){return Hh(s,o,f)}):Mb(s,o,u)}function Mb(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,Nb(s,u)))}function Hh(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 Ob(s,o){return o}function Lb(s,o){if(gt){var u=jt.formState;if(u!==null){e:{var f=rt;if(gt){if(zt){t:{for(var y=zt,v=qr;y.nodeType!==8;){if(!v){y=null;break t}if(y=Wr(y.nextSibling),y===null){y=null;break t}}v=y.data,y=v==="F!"||v==="F"?y:null}if(y){zt=Wr(y.nextSibling),f=y.data==="F!";break e}}Ps(f)}f=!1}f&&(o=u[0])}}return u=Xn(),u.memoizedState=u.baseState=o,f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ob,lastRenderedState:o},u.queue=f,u=Jb.bind(null,rt,f),f.dispatch=u,f=Uh(!1),v=Yh.bind(null,rt,!1,f.queue),f=Xn(),y={state:o,dispatch:null,action:s,pending:null},f.queue=y,u=N7.bind(null,rt,y,v,u),y.dispatch=u,f.memoizedState=s,[o,u,!1]}function jb(s){var o=on();return Bb(o,Mt,s)}function Bb(s,o,u){if(o=$h(s,o,Ob)[0],s=od(Qa)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var f=sc(o)}catch(C){throw C===Po?Xu:C}else f=o;o=on();var y=o.queue,v=y.dispatch;return u!==o.memoizedState&&(rt.flags|=2048,Ho(9,{destroy:void 0},R7.bind(null,y,u),null)),[f,v,s]}function R7(s,o){s.action=o}function Ib(s){var o=on(),u=Mt;if(u!==null)return Bb(o,u,s);on(),o=o.memoizedState,u=on();var f=u.queue.dispatch;return u.memoizedState=s,[o,f,!1]}function Ho(s,o,u,f){return s={tag:s,create:u,deps:f,inst:o,next:null},o=rt.updateQueue,o===null&&(o=sd(),rt.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 Pb(){return on().memoizedState}function ld(s,o,u,f){var y=Xn();rt.flags|=s,y.memoizedState=Ho(1|o,{destroy:void 0},u,f===void 0?null:f)}function cd(s,o,u,f){var y=on();f=f===void 0?null:f;var v=y.memoizedState.inst;Mt!==null&&f!==null&&Lh(f,Mt.memoizedState.deps)?y.memoizedState=Ho(o,v,u,f):(rt.flags|=s,y.memoizedState=Ho(1|o,v,u,f))}function zb(s,o){ld(8390656,8,s,o)}function Gh(s,o){cd(2048,8,s,o)}function M7(s){rt.flags|=4;var o=rt.updateQueue;if(o===null)o=sd(),rt.updateQueue=o,o.events=[s];else{var u=o.events;u===null?o.events=[s]:u.push(s)}}function $b(s){var o=on().memoizedState;return M7({ref:o,nextImpl:s}),function(){if((St&2)!==0)throw Error(r(440));return o.impl.apply(void 0,arguments)}}function Fb(s,o){return cd(4,2,s,o)}function Ub(s,o){return cd(4,4,s,o)}function Hb(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 Gb(s,o,u){u=u!=null?u.concat([s]):null,cd(4,4,Hb.bind(null,o,s),u)}function qh(){}function qb(s,o){var u=on();o=o===void 0?null:o;var f=u.memoizedState;return o!==null&&Lh(o,f[1])?f[0]:(u.memoizedState=[s,o],s)}function Vb(s,o){var u=on();o=o===void 0?null:o;var f=u.memoizedState;if(o!==null&&Lh(o,f[1]))return f[0];if(f=s(),Wi){vr(!0);try{s()}finally{vr(!1)}}return u.memoizedState=[f,o],f}function Vh(s,o,u){return u===void 0||(Xa&1073741824)!==0&&(ht&261930)===0?s.memoizedState=o:(s.memoizedState=u,s=Wv(),rt.lanes|=s,Ws|=s,u)}function Wb(s,o,u,f){return kr(u,o)?u:$o.current!==null?(s=Vh(s,u,f),kr(s,o)||(dn=!0),s):(Xa&42)===0||(Xa&1073741824)!==0&&(ht&261930)===0?(dn=!0,s.memoizedState=u):(s=Wv(),rt.lanes|=s,Ws|=s,o)}function Kb(s,o,u,f,y){var v=ie.p;ie.p=v!==0&&8>v?v:8;var C=q.T,O={};q.T=O,Yh(s,!1,o,u);try{var $=y(),J=q.S;if(J!==null&&J(O,$),$!==null&&typeof $=="object"&&typeof $.then=="function"){var se=E7($,f);ic(s,o,se,Ar(s))}else ic(s,o,f,Ar(s))}catch(ue){ic(s,o,{then:function(){},status:"rejected",reason:ue},Ar())}finally{ie.p=v,C!==null&&O.types!==null&&(C.types=O.types),q.T=C}}function D7(){}function Wh(s,o,u,f){if(s.tag!==5)throw Error(r(476));var y=Yb(s).queue;Kb(s,y,o,_e,u===null?D7:function(){return Zb(s),u(f)})}function Yb(s){var o=s.memoizedState;if(o!==null)return o;o={memoizedState:_e,baseState:_e,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qa,lastRenderedState:_e},next:null};var u={};return o.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qa,lastRenderedState:u},next:null},s.memoizedState=o,s=s.alternate,s!==null&&(s.memoizedState=o),o}function Zb(s){var o=Yb(s);o.next===null&&(o=s.alternate.memoizedState),ic(s,o.next.queue,{},Ar())}function Kh(){return zn(Sc)}function Xb(){return on().memoizedState}function Qb(){return on().memoizedState}function O7(s){for(var o=s.return;o!==null;){switch(o.tag){case 24:case 3:var u=Ar();s=Fs(u);var f=Us(o,s,u);f!==null&&(fr(f,o,u),tc(f,o,u)),o={cache:Sh()},s.payload=o;return}o=o.return}}function L7(s,o,u){var f=Ar();u={lane:f,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},ud(s)?ev(o,u):(u=fh(s,o,u,f),u!==null&&(fr(u,s,f),tv(u,o,f)))}function Jb(s,o,u){var f=Ar();ic(s,o,u,f)}function ic(s,o,u,f){var y={lane:f,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(ud(s))ev(o,y);else{var v=s.alternate;if(s.lanes===0&&(v===null||v.lanes===0)&&(v=o.lastRenderedReducer,v!==null))try{var C=o.lastRenderedState,O=v(C,u);if(y.hasEagerState=!0,y.eagerState=O,kr(O,C))return Gu(s,o,y,0),jt===null&&Hu(),!1}catch{}finally{}if(u=fh(s,o,y,f),u!==null)return fr(u,s,f),tv(u,o,f),!0}return!1}function Yh(s,o,u,f){if(f={lane:2,revertLane:Tp(),gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},ud(s)){if(o)throw Error(r(479))}else o=fh(s,u,f,2),o!==null&&fr(o,s,2)}function ud(s){var o=s.alternate;return s===rt||o!==null&&o===rt}function ev(s,o){Fo=rd=!0;var u=s.pending;u===null?o.next=o:(o.next=u.next,u.next=o),s.pending=o}function tv(s,o,u){if((u&4194048)!==0){var f=o.lanes;f&=s.pendingLanes,u|=f,o.lanes=u,Nu(s,u)}}var oc={readContext:zn,use:id,useCallback:en,useContext:en,useEffect:en,useImperativeHandle:en,useLayoutEffect:en,useInsertionEffect:en,useMemo:en,useReducer:en,useRef:en,useState:en,useDebugValue:en,useDeferredValue:en,useTransition:en,useSyncExternalStore:en,useId:en,useHostTransitionStatus:en,useFormState:en,useActionState:en,useOptimistic:en,useMemoCache:en,useCacheRefresh:en};oc.useEffectEvent=en;var nv={readContext:zn,use:id,useCallback:function(s,o){return Xn().memoizedState=[s,o===void 0?null:o],s},useContext:zn,useEffect:zb,useImperativeHandle:function(s,o,u){u=u!=null?u.concat([s]):null,ld(4194308,4,Hb.bind(null,o,s),u)},useLayoutEffect:function(s,o){return ld(4194308,4,s,o)},useInsertionEffect:function(s,o){ld(4,2,s,o)},useMemo:function(s,o){var u=Xn();o=o===void 0?null:o;var f=s();if(Wi){vr(!0);try{s()}finally{vr(!1)}}return u.memoizedState=[f,o],f},useReducer:function(s,o,u){var f=Xn();if(u!==void 0){var y=u(o);if(Wi){vr(!0);try{u(o)}finally{vr(!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=L7.bind(null,rt,s),[f.memoizedState,s]},useRef:function(s){var o=Xn();return s={current:s},o.memoizedState=s},useState:function(s){s=Uh(s);var o=s.queue,u=Jb.bind(null,rt,o);return o.dispatch=u,[s.memoizedState,u]},useDebugValue:qh,useDeferredValue:function(s,o){var u=Xn();return Vh(u,s,o)},useTransition:function(){var s=Uh(!1);return s=Kb.bind(null,rt,s.queue,!0,!1),Xn().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,o,u){var f=rt,y=Xn();if(gt){if(u===void 0)throw Error(r(407));u=u()}else{if(u=o(),jt===null)throw Error(r(349));(ht&127)!==0||Sb(f,o,u)}y.memoizedState=u;var v={value:u,getSnapshot:o};return y.queue=v,zb(Cb.bind(null,f,v,s),[s]),f.flags|=2048,Ho(9,{destroy:void 0},_b.bind(null,f,v,u,o),null),u},useId:function(){var s=Xn(),o=jt.identifierPrefix;if(gt){var u=xa,f=va;u=(f&~(1<<32-xn(f)-1)).toString(32)+u,o="_"+o+"R_"+u,u=ad++,0<u&&(o+="H"+u.toString(32)),o+="_"}else u=T7++,o="_"+o+"r_"+u.toString(32)+"_";return s.memoizedState=o},useHostTransitionStatus:Kh,useFormState:Lb,useActionState:Lb,useOptimistic:function(s){var o=Xn();o.memoizedState=o.baseState=s;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=u,o=Yh.bind(null,rt,!0,u),u.dispatch=o,[s,o]},useMemoCache:zh,useCacheRefresh:function(){return Xn().memoizedState=O7.bind(null,rt)},useEffectEvent:function(s){var o=Xn(),u={impl:s};return o.memoizedState=u,function(){if((St&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}},Zh={readContext:zn,use:id,useCallback:qb,useContext:zn,useEffect:Gh,useImperativeHandle:Gb,useInsertionEffect:Fb,useLayoutEffect:Ub,useMemo:Vb,useReducer:od,useRef:Pb,useState:function(){return od(Qa)},useDebugValue:qh,useDeferredValue:function(s,o){var u=on();return Wb(u,Mt.memoizedState,s,o)},useTransition:function(){var s=od(Qa)[0],o=on().memoizedState;return[typeof s=="boolean"?s:sc(s),o]},useSyncExternalStore:kb,useId:Xb,useHostTransitionStatus:Kh,useFormState:jb,useActionState:jb,useOptimistic:function(s,o){var u=on();return Ab(u,Mt,s,o)},useMemoCache:zh,useCacheRefresh:Qb};Zh.useEffectEvent=$b;var rv={readContext:zn,use:id,useCallback:qb,useContext:zn,useEffect:Gh,useImperativeHandle:Gb,useInsertionEffect:Fb,useLayoutEffect:Ub,useMemo:Vb,useReducer:Fh,useRef:Pb,useState:function(){return Fh(Qa)},useDebugValue:qh,useDeferredValue:function(s,o){var u=on();return Mt===null?Vh(u,s,o):Wb(u,Mt.memoizedState,s,o)},useTransition:function(){var s=Fh(Qa)[0],o=on().memoizedState;return[typeof s=="boolean"?s:sc(s),o]},useSyncExternalStore:kb,useId:Xb,useHostTransitionStatus:Kh,useFormState:Ib,useActionState:Ib,useOptimistic:function(s,o){var u=on();return Mt!==null?Ab(u,Mt,s,o):(u.baseState=s,[s,u.queue.dispatch])},useMemoCache:zh,useCacheRefresh:Qb};rv.useEffectEvent=$b;function Xh(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 Qh={enqueueSetState:function(s,o,u){s=s._reactInternals;var f=Ar(),y=Fs(f);y.payload=o,u!=null&&(y.callback=u),o=Us(s,y,f),o!==null&&(fr(o,s,f),tc(o,s,f))},enqueueReplaceState:function(s,o,u){s=s._reactInternals;var f=Ar(),y=Fs(f);y.tag=1,y.payload=o,u!=null&&(y.callback=u),o=Us(s,y,f),o!==null&&(fr(o,s,f),tc(o,s,f))},enqueueForceUpdate:function(s,o){s=s._reactInternals;var u=Ar(),f=Fs(u);f.tag=2,o!=null&&(f.callback=o),o=Us(s,f,u),o!==null&&(fr(o,s,u),tc(o,s,u))}};function av(s,o,u,f,y,v,C){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(f,v,C):o.prototype&&o.prototype.isPureReactComponent?!Wl(u,f)||!Wl(y,v):!0}function sv(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&&Qh.enqueueReplaceState(o,o.state,null)}function Ki(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 iv(s){Uu(s)}function ov(s){console.error(s)}function lv(s){Uu(s)}function dd(s,o){try{var u=s.onUncaughtError;u(o.value,{componentStack:o.stack})}catch(f){setTimeout(function(){throw f})}}function cv(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 Jh(s,o,u){return u=Fs(u),u.tag=3,u.payload={element:null},u.callback=function(){dd(s,o)},u}function uv(s){return s=Fs(s),s.tag=3,s}function dv(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(){cv(o,u,f)}}var C=u.stateNode;C!==null&&typeof C.componentDidCatch=="function"&&(s.callback=function(){cv(o,u,f),typeof y!="function"&&(Ks===null?Ks=new Set([this]):Ks.add(this));var O=f.stack;this.componentDidCatch(f.value,{componentStack:O!==null?O:""})})}function j7(s,o,u,f,y){if(u.flags|=32768,f!==null&&typeof f=="object"&&typeof f.then=="function"){if(o=u.alternate,o!==null&&jo(o,u,y,!0),u=_r.current,u!==null){switch(u.tag){case 31:case 13:return Vr===null?Sd():u.alternate===null&&tn===0&&(tn=3),u.flags&=-257,u.flags|=65536,u.lanes=y,f===Qu?u.flags|=16384:(o=u.updateQueue,o===null?u.updateQueue=new Set([f]):o.add(f),_p(s,f,y)),!1;case 22:return u.flags|=65536,f===Qu?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)),_p(s,f,y)),!1}throw Error(r(435,u.tag))}return _p(s,f,y),Sd(),!1}if(gt)return o=_r.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=y,f!==bh&&(s=Error(r(422),{cause:f}),Zl(Ur(s,u)))):(f!==bh&&(o=Error(r(423),{cause:f}),Zl(Ur(o,u))),s=s.current.alternate,s.flags|=65536,y&=-y,s.lanes|=y,f=Ur(f,u),y=Jh(s.stateNode,f,y),Nh(s,y),tn!==4&&(tn=2)),!1;var v=Error(r(520),{cause:f});if(v=Ur(v,u),mc===null?mc=[v]:mc.push(v),tn!==4&&(tn=2),o===null)return!0;f=Ur(f,u),u=o;do{switch(u.tag){case 3:return u.flags|=65536,s=y&-y,u.lanes|=s,s=Jh(u.stateNode,f,s),Nh(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"&&(Ks===null||!Ks.has(v))))return u.flags|=65536,y&=-y,u.lanes|=y,y=uv(y),dv(y,s,u,f),Nh(u,y),!1}u=u.return}while(u!==null);return!1}var ep=Error(r(461)),dn=!1;function $n(s,o,u,f){o.child=s===null?mb(o,null,u,f):Vi(o,s.child,u,f)}function fv(s,o,u,f,y){u=u.render;var v=o.ref;if("ref"in f){var C={};for(var O in f)O!=="ref"&&(C[O]=f[O])}else C=f;return Ui(o),f=jh(s,o,u,C,v,y),O=Bh(),s!==null&&!dn?(Ih(s,o,y),Ja(s,o,y)):(gt&&O&&gh(o),o.flags|=1,$n(s,o,f,y),o.child)}function hv(s,o,u,f,y){if(s===null){var v=u.type;return typeof v=="function"&&!hh(v)&&v.defaultProps===void 0&&u.compare===null?(o.tag=15,o.type=v,pv(s,o,v,f,y)):(s=Vu(u.type,null,f,o,o.mode,y),s.ref=o.ref,s.return=o,o.child=s)}if(v=s.child,!lp(s,y)){var C=v.memoizedProps;if(u=u.compare,u=u!==null?u:Wl,u(C,f)&&s.ref===o.ref)return Ja(s,o,y)}return o.flags|=1,s=Wa(v,f),s.ref=o.ref,s.return=o,o.child=s}function pv(s,o,u,f,y){if(s!==null){var v=s.memoizedProps;if(Wl(v,f)&&s.ref===o.ref)if(dn=!1,o.pendingProps=f=v,lp(s,y))(s.flags&131072)!==0&&(dn=!0);else return o.lanes=s.lanes,Ja(s,o,y)}return tp(s,o,u,f,y)}function mv(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 gv(s,o,v,u,f)}if((u&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},s!==null&&Zu(o,v!==null?v.cachePool:null),v!==null?bb(o,v):Mh(),vb(o);else return f=o.lanes=536870912,gv(s,o,v!==null?v.baseLanes|u:u,u,f)}else v!==null?(Zu(o,v.cachePool),bb(o,v),Gs(),o.memoizedState=null):(s!==null&&Zu(o,null),Mh(),Gs());return $n(s,o,y,u),o.child}function lc(s,o){return s!==null&&s.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function gv(s,o,u,f,y){var v=Ch();return v=v===null?null:{parent:cn._currentValue,pool:v},o.memoizedState={baseLanes:u,cachePool:v},s!==null&&Zu(o,null),Mh(),vb(o),s!==null&&jo(s,o,f,!0),o.childLanes=y,null}function fd(s,o){return o=pd({mode:o.mode,children:o.children},s.mode),o.ref=s.ref,s.child=o,o.return=s,o}function yv(s,o,u){return Vi(o,s.child,null,u),s=fd(o,o.pendingProps),s.flags|=2,Cr(o),o.memoizedState=null,s}function B7(s,o,u){var f=o.pendingProps,y=(o.flags&128)!==0;if(o.flags&=-129,s===null){if(gt){if(f.mode==="hidden")return s=fd(o,f),o.lanes=536870912,lc(null,s);if(Oh(o),(s=zt)?(s=N4(s,qr),s=s!==null&&s.data==="&"?s:null,s!==null&&(o.memoizedState={dehydrated:s,treeContext:Bs!==null?{id:va,overflow:xa}:null,retryLane:536870912,hydrationErrors:null},u=eb(s),u.return=o,o.child=u,Pn=o,zt=null)):s=null,s===null)throw Ps(o);return o.lanes=536870912,null}return fd(o,f)}var v=s.memoizedState;if(v!==null){var C=v.dehydrated;if(Oh(o),y)if(o.flags&256)o.flags&=-257,o=yv(s,o,u);else if(o.memoizedState!==null)o.child=s.child,o.flags|=128,o=null;else throw Error(r(558));else if(dn||jo(s,o,u,!1),y=(u&s.childLanes)!==0,dn||y){if(f=jt,f!==null&&(C=Ru(f,u),C!==0&&C!==v.retryLane))throw v.retryLane=C,Pi(s,C),fr(f,s,C),ep;Sd(),o=yv(s,o,u)}else s=v.treeContext,zt=Wr(C.nextSibling),Pn=o,gt=!0,Is=null,qr=!1,s!==null&&rb(o,s),o=fd(o,f),o.flags|=4096;return o}return s=Wa(s.child,{mode:f.mode,children:f.children}),s.ref=o.ref,o.child=s,s.return=o,s}function hd(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(r(284));(s===null||s.ref!==u)&&(o.flags|=4194816)}}function tp(s,o,u,f,y){return Ui(o),u=jh(s,o,u,f,void 0,y),f=Bh(),s!==null&&!dn?(Ih(s,o,y),Ja(s,o,y)):(gt&&f&&gh(o),o.flags|=1,$n(s,o,u,y),o.child)}function bv(s,o,u,f,y,v){return Ui(o),o.updateQueue=null,u=wb(o,f,u,y),xb(s),f=Bh(),s!==null&&!dn?(Ih(s,o,v),Ja(s,o,v)):(gt&&f&&gh(o),o.flags|=1,$n(s,o,u,v),o.child)}function vv(s,o,u,f,y){if(Ui(o),o.stateNode===null){var v=Mo,C=u.contextType;typeof C=="object"&&C!==null&&(v=zn(C)),v=new u(f,v),o.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=Qh,o.stateNode=v,v._reactInternals=o,v=o.stateNode,v.props=f,v.state=o.memoizedState,v.refs={},Th(o),C=u.contextType,v.context=typeof C=="object"&&C!==null?zn(C):Mo,v.state=o.memoizedState,C=u.getDerivedStateFromProps,typeof C=="function"&&(Xh(o,u,C,f),v.state=o.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(C=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),C!==v.state&&Qh.enqueueReplaceState(v,v.state,null),rc(o,f,v,y),nc(),v.state=o.memoizedState),typeof v.componentDidMount=="function"&&(o.flags|=4194308),f=!0}else if(s===null){v=o.stateNode;var O=o.memoizedProps,$=Ki(u,O);v.props=$;var J=v.context,se=u.contextType;C=Mo,typeof se=="object"&&se!==null&&(C=zn(se));var ue=u.getDerivedStateFromProps;se=typeof ue=="function"||typeof v.getSnapshotBeforeUpdate=="function",O=o.pendingProps!==O,se||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(O||J!==C)&&sv(o,v,f,C),$s=!1;var te=o.memoizedState;v.state=te,rc(o,f,v,y),nc(),J=o.memoizedState,O||te!==J||$s?(typeof ue=="function"&&(Xh(o,u,ue,f),J=o.memoizedState),($=$s||av(o,u,$,f,te,J,C))?(se||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(o.flags|=4194308)):(typeof v.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=f,o.memoizedState=J),v.props=f,v.state=J,v.context=C,f=$):(typeof v.componentDidMount=="function"&&(o.flags|=4194308),f=!1)}else{v=o.stateNode,Ah(s,o),C=o.memoizedProps,se=Ki(u,C),v.props=se,ue=o.pendingProps,te=v.context,J=u.contextType,$=Mo,typeof J=="object"&&J!==null&&($=zn(J)),O=u.getDerivedStateFromProps,(J=typeof O=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(C!==ue||te!==$)&&sv(o,v,f,$),$s=!1,te=o.memoizedState,v.state=te,rc(o,f,v,y),nc();var re=o.memoizedState;C!==ue||te!==re||$s||s!==null&&s.dependencies!==null&&Ku(s.dependencies)?(typeof O=="function"&&(Xh(o,u,O,f),re=o.memoizedState),(se=$s||av(o,u,se,f,te,re,$)||s!==null&&s.dependencies!==null&&Ku(s.dependencies))?(J||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(f,re,$),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(f,re,$)),typeof v.componentDidUpdate=="function"&&(o.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof v.componentDidUpdate!="function"||C===s.memoizedProps&&te===s.memoizedState||(o.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||C===s.memoizedProps&&te===s.memoizedState||(o.flags|=1024),o.memoizedProps=f,o.memoizedState=re),v.props=f,v.state=re,v.context=$,f=se):(typeof v.componentDidUpdate!="function"||C===s.memoizedProps&&te===s.memoizedState||(o.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||C===s.memoizedProps&&te===s.memoizedState||(o.flags|=1024),f=!1)}return v=f,hd(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=Vi(o,s.child,null,y),o.child=Vi(o,null,u,y)):$n(s,o,u,y),o.memoizedState=v.state,s=o.child):s=Ja(s,o,y),s}function xv(s,o,u,f){return $i(),o.flags|=256,$n(s,o,u,f),o.child}var np={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function rp(s){return{baseLanes:s,cachePool:cb()}}function ap(s,o,u){return s=s!==null?s.childLanes&~u:0,o&&(s|=Tr),s}function wv(s,o,u){var f=o.pendingProps,y=!1,v=(o.flags&128)!==0,C;if((C=v)||(C=s!==null&&s.memoizedState===null?!1:(sn.current&2)!==0),C&&(y=!0,o.flags&=-129),C=(o.flags&32)!==0,o.flags&=-33,s===null){if(gt){if(y?Hs(o):Gs(),(s=zt)?(s=N4(s,qr),s=s!==null&&s.data!=="&"?s:null,s!==null&&(o.memoizedState={dehydrated:s,treeContext:Bs!==null?{id:va,overflow:xa}:null,retryLane:536870912,hydrationErrors:null},u=eb(s),u.return=o,o.child=u,Pn=o,zt=null)):s=null,s===null)throw Ps(o);return $p(s)?o.lanes=32:o.lanes=536870912,null}var O=f.children;return f=f.fallback,y?(Gs(),y=o.mode,O=pd({mode:"hidden",children:O},y),f=zi(f,y,u,null),O.return=o,f.return=o,O.sibling=f,o.child=O,f=o.child,f.memoizedState=rp(u),f.childLanes=ap(s,C,u),o.memoizedState=np,lc(null,f)):(Hs(o),sp(o,O))}var $=s.memoizedState;if($!==null&&(O=$.dehydrated,O!==null)){if(v)o.flags&256?(Hs(o),o.flags&=-257,o=ip(s,o,u)):o.memoizedState!==null?(Gs(),o.child=s.child,o.flags|=128,o=null):(Gs(),O=f.fallback,y=o.mode,f=pd({mode:"visible",children:f.children},y),O=zi(O,y,u,null),O.flags|=2,f.return=o,O.return=o,f.sibling=O,o.child=f,Vi(o,s.child,null,u),f=o.child,f.memoizedState=rp(u),f.childLanes=ap(s,C,u),o.memoizedState=np,o=lc(null,f));else if(Hs(o),$p(O)){if(C=O.nextSibling&&O.nextSibling.dataset,C)var J=C.dgst;C=J,f=Error(r(419)),f.stack="",f.digest=C,Zl({value:f,source:null,stack:null}),o=ip(s,o,u)}else if(dn||jo(s,o,u,!1),C=(u&s.childLanes)!==0,dn||C){if(C=jt,C!==null&&(f=Ru(C,u),f!==0&&f!==$.retryLane))throw $.retryLane=f,Pi(s,f),fr(C,s,f),ep;zp(O)||Sd(),o=ip(s,o,u)}else zp(O)?(o.flags|=192,o.child=s.child,o=null):(s=$.treeContext,zt=Wr(O.nextSibling),Pn=o,gt=!0,Is=null,qr=!1,s!==null&&rb(o,s),o=sp(o,f.children),o.flags|=4096);return o}return y?(Gs(),O=f.fallback,y=o.mode,$=s.child,J=$.sibling,f=Wa($,{mode:"hidden",children:f.children}),f.subtreeFlags=$.subtreeFlags&65011712,J!==null?O=Wa(J,O):(O=zi(O,y,u,null),O.flags|=2),O.return=o,f.return=o,f.sibling=O,o.child=f,lc(null,f),f=o.child,O=s.child.memoizedState,O===null?O=rp(u):(y=O.cachePool,y!==null?($=cn._currentValue,y=y.parent!==$?{parent:$,pool:$}:y):y=cb(),O={baseLanes:O.baseLanes|u,cachePool:y}),f.memoizedState=O,f.childLanes=ap(s,C,u),o.memoizedState=np,lc(s.child,f)):(Hs(o),u=s.child,s=u.sibling,u=Wa(u,{mode:"visible",children:f.children}),u.return=o,u.sibling=null,s!==null&&(C=o.deletions,C===null?(o.deletions=[s],o.flags|=16):C.push(s)),o.child=u,o.memoizedState=null,u)}function sp(s,o){return o=pd({mode:"visible",children:o},s.mode),o.return=s,s.child=o}function pd(s,o){return s=Sr(22,s,null,o),s.lanes=0,s}function ip(s,o,u){return Vi(o,s.child,null,u),s=sp(o,o.pendingProps.children),s.flags|=2,o.memoizedState=null,s}function kv(s,o,u){s.lanes|=o;var f=s.alternate;f!==null&&(f.lanes|=o),wh(s.return,o,u)}function op(s,o,u,f,y,v){var C=s.memoizedState;C===null?s.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:f,tail:u,tailMode:y,treeForkCount:v}:(C.isBackwards=o,C.rendering=null,C.renderingStartTime=0,C.last=f,C.tail=u,C.tailMode=y,C.treeForkCount=v)}function Sv(s,o,u){var f=o.pendingProps,y=f.revealOrder,v=f.tail;f=f.children;var C=sn.current,O=(C&2)!==0;if(O?(C=C&1|2,o.flags|=128):C&=1,Ie(sn,C),$n(s,o,f,u),f=gt?Yl:0,!O&&s!==null&&(s.flags&128)!==0)e:for(s=o.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&kv(s,u,o);else if(s.tag===19)kv(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&&nd(s)===null&&(y=u),u=u.sibling;u=y,u===null?(y=o.child,o.child=null):(y=u.sibling,u.sibling=null),op(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&&nd(s)===null){o.child=y;break}s=y.sibling,y.sibling=u,u=y,y=s}op(o,!0,u,null,v,f);break;case"together":op(o,!1,null,null,void 0,f);break;default:o.memoizedState=null}return o.child}function Ja(s,o,u){if(s!==null&&(o.dependencies=s.dependencies),Ws|=o.lanes,(u&o.childLanes)===0)if(s!==null){if(jo(s,o,u,!1),(u&o.childLanes)===0)return null}else return null;if(s!==null&&o.child!==s.child)throw Error(r(153));if(o.child!==null){for(s=o.child,u=Wa(s,s.pendingProps),o.child=u,u.return=o;s.sibling!==null;)s=s.sibling,u=u.sibling=Wa(s,s.pendingProps),u.return=o;u.sibling=null}return o.child}function lp(s,o){return(s.lanes&o)!==0?!0:(s=s.dependencies,!!(s!==null&&Ku(s)))}function I7(s,o,u){switch(o.tag){case 3:Ye(o,o.stateNode.containerInfo),zs(o,cn,s.memoizedState.cache),$i();break;case 27:case 5:yr(o);break;case 4:Ye(o,o.stateNode.containerInfo);break;case 10:zs(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,Oh(o),null;break;case 13:var f=o.memoizedState;if(f!==null)return f.dehydrated!==null?(Hs(o),o.flags|=128,null):(u&o.child.childLanes)!==0?wv(s,o,u):(Hs(o),s=Ja(s,o,u),s!==null?s.sibling:null);Hs(o);break;case 19:var y=(s.flags&128)!==0;if(f=(u&o.childLanes)!==0,f||(jo(s,o,u,!1),f=(u&o.childLanes)!==0),y){if(f)return Sv(s,o,u);o.flags|=128}if(y=o.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),Ie(sn,sn.current),f)break;return null;case 22:return o.lanes=0,mv(s,o,u,o.pendingProps);case 24:zs(o,cn,s.memoizedState.cache)}return Ja(s,o,u)}function _v(s,o,u){if(s!==null)if(s.memoizedProps!==o.pendingProps)dn=!0;else{if(!lp(s,u)&&(o.flags&128)===0)return dn=!1,I7(s,o,u);dn=(s.flags&131072)!==0}else dn=!1,gt&&(o.flags&1048576)!==0&&nb(o,Yl,o.index);switch(o.lanes=0,o.tag){case 16:e:{var f=o.pendingProps;if(s=Gi(o.elementType),o.type=s,typeof s=="function")hh(s)?(f=Ki(s,f),o.tag=1,o=vv(null,o,s,f,u)):(o.tag=0,o=tp(null,o,s,f,u));else{if(s!=null){var y=s.$$typeof;if(y===M){o.tag=11,o=fv(null,o,s,f,u);break e}else if(y===U){o.tag=14,o=hv(null,o,s,f,u);break e}}throw o=ve(s)||s,Error(r(306,o,""))}}return o;case 0:return tp(s,o,o.type,o.pendingProps,u);case 1:return f=o.type,y=Ki(f,o.pendingProps),vv(s,o,f,y,u);case 3:e:{if(Ye(o,o.stateNode.containerInfo),s===null)throw Error(r(387));f=o.pendingProps;var v=o.memoizedState;y=v.element,Ah(s,o),rc(o,f,null,u);var C=o.memoizedState;if(f=C.cache,zs(o,cn,f),f!==v.cache&&kh(o,[cn],u,!0),nc(),f=C.element,v.isDehydrated)if(v={element:f,isDehydrated:!1,cache:C.cache},o.updateQueue.baseState=v,o.memoizedState=v,o.flags&256){o=xv(s,o,f,u);break e}else if(f!==y){y=Ur(Error(r(424)),o),Zl(y),o=xv(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(zt=Wr(s.firstChild),Pn=o,gt=!0,Is=null,qr=!0,u=mb(o,null,f,u),o.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if($i(),f===y){o=Ja(s,o,u);break e}$n(s,o,f,u)}o=o.child}return o;case 26:return hd(s,o),s===null?(u=j4(o.type,null,o.pendingProps,null))?o.memoizedState=u:gt||(u=o.type,s=o.pendingProps,f=Rd(bn.current).createElement(u),f[kn]=o,f[Sn]=s,Fn(f,u,s),Xt(f),o.stateNode=f):o.memoizedState=j4(o.type,s.memoizedProps,o.pendingProps,s.memoizedState),null;case 27:return yr(o),s===null&&gt&&(f=o.stateNode=D4(o.type,o.pendingProps,bn.current),Pn=o,qr=!0,y=zt,Qs(o.type)?(Fp=y,zt=Wr(f.firstChild)):zt=y),$n(s,o,o.pendingProps.children,u),hd(s,o),s===null&&(o.flags|=4194304),o.child;case 5:return s===null&&gt&&((y=f=zt)&&(f=h8(f,o.type,o.pendingProps,qr),f!==null?(o.stateNode=f,Pn=o,zt=Wr(f.firstChild),qr=!1,y=!0):y=!1),y||Ps(o)),yr(o),y=o.type,v=o.pendingProps,C=s!==null?s.memoizedProps:null,f=v.children,Bp(y,v)?f=null:C!==null&&Bp(y,C)&&(o.flags|=32),o.memoizedState!==null&&(y=jh(s,o,A7,null,null,u),Sc._currentValue=y),hd(s,o),$n(s,o,f,u),o.child;case 6:return s===null&&gt&&((s=u=zt)&&(u=p8(u,o.pendingProps,qr),u!==null?(o.stateNode=u,Pn=o,zt=null,s=!0):s=!1),s||Ps(o)),null;case 13:return wv(s,o,u);case 4:return Ye(o,o.stateNode.containerInfo),f=o.pendingProps,s===null?o.child=Vi(o,null,f,u):$n(s,o,f,u),o.child;case 11:return fv(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,zs(o,o.type,f.value),$n(s,o,f.children,u),o.child;case 9:return y=o.type._context,f=o.pendingProps.children,Ui(o),y=zn(y),f=f(y),o.flags|=1,$n(s,o,f,u),o.child;case 14:return hv(s,o,o.type,o.pendingProps,u);case 15:return pv(s,o,o.type,o.pendingProps,u);case 19:return Sv(s,o,u);case 31:return B7(s,o,u);case 22:return mv(s,o,u,o.pendingProps);case 24:return Ui(o),f=zn(cn),s===null?(y=Ch(),y===null&&(y=jt,v=Sh(),y.pooledCache=v,v.refCount++,v!==null&&(y.pooledCacheLanes|=u),y=v),o.memoizedState={parent:f,cache:y},Th(o),zs(o,cn,y)):((s.lanes&u)!==0&&(Ah(s,o),rc(o,null,null,u),nc()),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),zs(o,cn,f)):(f=v.cache,zs(o,cn,f),f!==y.cache&&kh(o,[cn],u,!0))),$n(s,o,o.pendingProps.children,u),o.child;case 29:throw o.pendingProps}throw Error(r(156,o.tag))}function es(s){s.flags|=4}function cp(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(Xv())s.flags|=8192;else throw qi=Qu,Eh}else s.flags&=-16777217}function Cv(s,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!$4(o))if(Xv())s.flags|=8192;else throw qi=Qu,Eh}function md(s,o){o!==null&&(s.flags|=4),s.flags&16384&&(o=s.tag!==22?Ns():536870912,s.lanes|=o,Wo|=o)}function cc(s,o){if(!gt)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 $t(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 P7(s,o,u){var f=o.pendingProps;switch(yh(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return $t(o),null;case 1:return $t(o),null;case 3:return u=o.stateNode,f=null,s!==null&&(f=s.memoizedState.cache),o.memoizedState.cache!==f&&(o.flags|=2048),Za(cn),vn(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(s===null||s.child===null)&&(Lo(o)?es(o):s===null||s.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,vh())),$t(o),null;case 26:var y=o.type,v=o.memoizedState;return s===null?(es(o),v!==null?($t(o),Cv(o,v)):($t(o),cp(o,y,null,f,u))):v?v!==s.memoizedState?(es(o),$t(o),Cv(o,v)):($t(o),o.flags&=-16777217):(s=s.memoizedProps,s!==f&&es(o),$t(o),cp(o,y,s,f,u)),null;case 27:if(Yn(o),u=bn.current,y=o.type,s!==null&&o.stateNode!=null)s.memoizedProps!==f&&es(o);else{if(!f){if(o.stateNode===null)throw Error(r(166));return $t(o),null}s=vt.current,Lo(o)?ab(o):(s=D4(y,f,u),o.stateNode=s,es(o))}return $t(o),null;case 5:if(Yn(o),y=o.type,s!==null&&o.stateNode!=null)s.memoizedProps!==f&&es(o);else{if(!f){if(o.stateNode===null)throw Error(r(166));return $t(o),null}if(v=vt.current,Lo(o))ab(o);else{var C=Rd(bn.current);switch(v){case 1:v=C.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:v=C.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":v=C.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":v=C.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":v=C.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof f.is=="string"?C.createElement("select",{is:f.is}):C.createElement("select"),f.multiple?v.multiple=!0:f.size&&(v.size=f.size);break;default:v=typeof f.is=="string"?C.createElement(y,{is:f.is}):C.createElement(y)}}v[kn]=o,v[Sn]=f;e:for(C=o.child;C!==null;){if(C.tag===5||C.tag===6)v.appendChild(C.stateNode);else if(C.tag!==4&&C.tag!==27&&C.child!==null){C.child.return=C,C=C.child;continue}if(C===o)break e;for(;C.sibling===null;){if(C.return===null||C.return===o)break e;C=C.return}C.sibling.return=C.return,C=C.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&&es(o)}}return $t(o),cp(o,o.type,s===null?null:s.memoizedProps,o.pendingProps,u),null;case 6:if(s&&o.stateNode!=null)s.memoizedProps!==f&&es(o);else{if(typeof f!="string"&&o.stateNode===null)throw Error(r(166));if(s=bn.current,Lo(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||w4(s.nodeValue,u)),s||Ps(o,!0)}else s=Rd(s).createTextNode(f),s[kn]=o,o.stateNode=s}return $t(o),null;case 31:if(u=o.memoizedState,s===null||s.memoizedState!==null){if(f=Lo(o),u!==null){if(s===null){if(!f)throw Error(r(318));if(s=o.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[kn]=o}else $i(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;$t(o),s=!1}else u=vh(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=u),s=!0;if(!s)return o.flags&256?(Cr(o),o):(Cr(o),null);if((o.flags&128)!==0)throw Error(r(558))}return $t(o),null;case 13:if(f=o.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(y=Lo(o),f!==null&&f.dehydrated!==null){if(s===null){if(!y)throw Error(r(318));if(y=o.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(r(317));y[kn]=o}else $i(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;$t(o),y=!1}else y=vh(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=y),y=!0;if(!y)return o.flags&256?(Cr(o),o):(Cr(o),null)}return Cr(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),md(o,o.updateQueue),$t(o),null);case 4:return vn(),s===null&&Mp(o.stateNode.containerInfo),$t(o),null;case 10:return Za(o.type),$t(o),null;case 19:if(Ke(sn),f=o.memoizedState,f===null)return $t(o),null;if(y=(o.flags&128)!==0,v=f.rendering,v===null)if(y)cc(f,!1);else{if(tn!==0||s!==null&&(s.flags&128)!==0)for(s=o.child;s!==null;){if(v=nd(s),v!==null){for(o.flags|=128,cc(f,!1),s=v.updateQueue,o.updateQueue=s,md(o,s),o.subtreeFlags=0,s=u,u=o.child;u!==null;)Jy(u,s),u=u.sibling;return Ie(sn,sn.current&1|2),gt&&Ka(o,f.treeForkCount),o.child}s=s.sibling}f.tail!==null&&He()>xd&&(o.flags|=128,y=!0,cc(f,!1),o.lanes=4194304)}else{if(!y)if(s=nd(v),s!==null){if(o.flags|=128,y=!0,s=s.updateQueue,o.updateQueue=s,md(o,s),cc(f,!0),f.tail===null&&f.tailMode==="hidden"&&!v.alternate&&!gt)return $t(o),null}else 2*He()-f.renderingStartTime>xd&&u!==536870912&&(o.flags|=128,y=!0,cc(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=He(),s.sibling=null,u=sn.current,Ie(sn,y?u&1|2:u&1),gt&&Ka(o,f.treeForkCount),s):($t(o),null);case 22:case 23:return Cr(o),Dh(),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&&($t(o),o.subtreeFlags&6&&(o.flags|=8192)):$t(o),u=o.updateQueue,u!==null&&md(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&&Ke(Hi),null;case 24:return u=null,s!==null&&(u=s.memoizedState.cache),o.memoizedState.cache!==u&&(o.flags|=2048),Za(cn),$t(o),null;case 25:return null;case 30:return null}throw Error(r(156,o.tag))}function z7(s,o){switch(yh(o),o.tag){case 1:return s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 3:return Za(cn),vn(),s=o.flags,(s&65536)!==0&&(s&128)===0?(o.flags=s&-65537|128,o):null;case 26:case 27:case 5:return Yn(o),null;case 31:if(o.memoizedState!==null){if(Cr(o),o.alternate===null)throw Error(r(340));$i()}return s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 13:if(Cr(o),s=o.memoizedState,s!==null&&s.dehydrated!==null){if(o.alternate===null)throw Error(r(340));$i()}return s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 19:return Ke(sn),null;case 4:return vn(),null;case 10:return Za(o.type),null;case 22:case 23:return Cr(o),Dh(),s!==null&&Ke(Hi),s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 24:return Za(cn),null;case 25:return null;default:return null}}function Ev(s,o){switch(yh(o),o.tag){case 3:Za(cn),vn();break;case 26:case 27:case 5:Yn(o);break;case 4:vn();break;case 31:o.memoizedState!==null&&Cr(o);break;case 13:Cr(o);break;case 19:Ke(sn);break;case 10:Za(o.type);break;case 22:case 23:Cr(o),Dh(),s!==null&&Ke(Hi);break;case 24:Za(cn)}}function uc(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,C=u.inst;f=v(),C.destroy=f}u=u.next}while(u!==y)}}catch(O){Nt(o,o.return,O)}}function qs(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 C=f.inst,O=C.destroy;if(O!==void 0){C.destroy=void 0,y=o;var $=u,J=O;try{J()}catch(se){Nt(y,$,se)}}}f=f.next}while(f!==v)}}catch(se){Nt(o,o.return,se)}}function Tv(s){var o=s.updateQueue;if(o!==null){var u=s.stateNode;try{yb(o,u)}catch(f){Nt(s,s.return,f)}}}function Av(s,o,u){u.props=Ki(s.type,s.memoizedProps),u.state=s.memoizedState;try{u.componentWillUnmount()}catch(f){Nt(s,o,f)}}function dc(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){Nt(s,o,y)}}function wa(s,o){var u=s.ref,f=s.refCleanup;if(u!==null)if(typeof f=="function")try{f()}catch(y){Nt(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){Nt(s,o,y)}else u.current=null}function Nv(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){Nt(s,s.return,y)}}function up(s,o,u){try{var f=s.stateNode;o8(f,s.type,u,o),f[Sn]=o}catch(y){Nt(s,s.return,y)}}function Rv(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&Qs(s.type)||s.tag===4}function dp(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||Rv(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&&Qs(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 fp(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=_n));else if(f!==4&&(f===27&&Qs(s.type)&&(u=s.stateNode,o=null),s=s.child,s!==null))for(fp(s,o,u),s=s.sibling;s!==null;)fp(s,o,u),s=s.sibling}function gd(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&&Qs(s.type)&&(u=s.stateNode),s=s.child,s!==null))for(gd(s,o,u),s=s.sibling;s!==null;)gd(s,o,u),s=s.sibling}function Mv(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){Nt(s,s.return,v)}}var ts=!1,fn=!1,hp=!1,Dv=typeof WeakSet=="function"?WeakSet:Set,On=null;function $7(s,o){if(s=s.containerInfo,Lp=Id,s=Gy(s),ih(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 C=0,O=-1,$=-1,J=0,se=0,ue=s,te=null;t:for(;;){for(var re;ue!==u||y!==0&&ue.nodeType!==3||(O=C+y),ue!==v||f!==0&&ue.nodeType!==3||($=C+f),ue.nodeType===3&&(C+=ue.nodeValue.length),(re=ue.firstChild)!==null;)te=ue,ue=re;for(;;){if(ue===s)break t;if(te===u&&++J===y&&(O=C),te===v&&++se===f&&($=C),(re=ue.nextSibling)!==null)break;ue=te,te=ue.parentNode}ue=re}u=O===-1||$===-1?null:{start:O,end:$}}else u=null}u=u||{start:0,end:0}}else u=null;for(jp={focusedElem:s,selectionRange:u},Id=!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=Ki(u.type,y);s=f.getSnapshotBeforeUpdate(Re,v),f.__reactInternalSnapshotBeforeUpdate=s}catch($e){Nt(u,u.return,$e)}}break;case 3:if((s&1024)!==0){if(s=o.stateNode.containerInfo,u=s.nodeType,u===9)Pp(s);else if(u===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":Pp(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(r(163))}if(s=o.sibling,s!==null){s.return=o.return,On=s;break}On=o.return}}function Ov(s,o,u){var f=u.flags;switch(u.tag){case 0:case 11:case 15:rs(s,u),f&4&&uc(5,u);break;case 1:if(rs(s,u),f&4)if(s=u.stateNode,o===null)try{s.componentDidMount()}catch(C){Nt(u,u.return,C)}else{var y=Ki(u.type,o.memoizedProps);o=o.memoizedState;try{s.componentDidUpdate(y,o,s.__reactInternalSnapshotBeforeUpdate)}catch(C){Nt(u,u.return,C)}}f&64&&Tv(u),f&512&&dc(u,u.return);break;case 3:if(rs(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{yb(s,o)}catch(C){Nt(u,u.return,C)}}break;case 27:o===null&&f&4&&Mv(u);case 26:case 5:rs(s,u),o===null&&f&4&&Nv(u),f&512&&dc(u,u.return);break;case 12:rs(s,u);break;case 31:rs(s,u),f&4&&Bv(s,u);break;case 13:rs(s,u),f&4&&Iv(s,u),f&64&&(s=u.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(u=Y7.bind(null,u),m8(s,u))));break;case 22:if(f=u.memoizedState!==null||ts,!f){o=o!==null&&o.memoizedState!==null||fn,y=ts;var v=fn;ts=f,(fn=o)&&!v?as(s,u,(u.subtreeFlags&8772)!==0):rs(s,u),ts=y,fn=v}break;case 30:break;default:rs(s,u)}}function Lv(s){var o=s.alternate;o!==null&&(s.alternate=null,Lv(o)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(o=s.stateNode,o!==null&&Di(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 Ut=null,lr=!1;function ns(s,o,u){for(u=u.child;u!==null;)jv(s,o,u),u=u.sibling}function jv(s,o,u){if(Mn&&typeof Mn.onCommitFiberUnmount=="function")try{Mn.onCommitFiberUnmount(Pr,u)}catch{}switch(u.tag){case 26:fn||wa(u,o),ns(s,o,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:fn||wa(u,o);var f=Ut,y=lr;Qs(u.type)&&(Ut=u.stateNode,lr=!1),ns(s,o,u),xc(u.stateNode),Ut=f,lr=y;break;case 5:fn||wa(u,o);case 6:if(f=Ut,y=lr,Ut=null,ns(s,o,u),Ut=f,lr=y,Ut!==null)if(lr)try{(Ut.nodeType===9?Ut.body:Ut.nodeName==="HTML"?Ut.ownerDocument.body:Ut).removeChild(u.stateNode)}catch(v){Nt(u,o,v)}else try{Ut.removeChild(u.stateNode)}catch(v){Nt(u,o,v)}break;case 18:Ut!==null&&(lr?(s=Ut,T4(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,u.stateNode),tl(s)):T4(Ut,u.stateNode));break;case 4:f=Ut,y=lr,Ut=u.stateNode.containerInfo,lr=!0,ns(s,o,u),Ut=f,lr=y;break;case 0:case 11:case 14:case 15:qs(2,u,o),fn||qs(4,u,o),ns(s,o,u);break;case 1:fn||(wa(u,o),f=u.stateNode,typeof f.componentWillUnmount=="function"&&Av(u,o,f)),ns(s,o,u);break;case 21:ns(s,o,u);break;case 22:fn=(f=fn)||u.memoizedState!==null,ns(s,o,u),fn=f;break;default:ns(s,o,u)}}function Bv(s,o){if(o.memoizedState===null&&(s=o.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{tl(s)}catch(u){Nt(o,o.return,u)}}}function Iv(s,o){if(o.memoizedState===null&&(s=o.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{tl(s)}catch(u){Nt(o,o.return,u)}}function F7(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(r(435,s.tag))}}function yd(s,o){var u=F7(s);o.forEach(function(f){if(!u.has(f)){u.add(f);var y=Z7.bind(null,s,f);f.then(y,y)}})}function cr(s,o){var u=o.deletions;if(u!==null)for(var f=0;f<u.length;f++){var y=u[f],v=s,C=o,O=C;e:for(;O!==null;){switch(O.tag){case 27:if(Qs(O.type)){Ut=O.stateNode,lr=!1;break e}break;case 5:Ut=O.stateNode,lr=!1;break e;case 3:case 4:Ut=O.stateNode.containerInfo,lr=!0;break e}O=O.return}if(Ut===null)throw Error(r(160));jv(v,C,y),Ut=null,lr=!1,v=y.alternate,v!==null&&(v.return=null),y.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)Pv(o,s),o=o.sibling}var ua=null;function Pv(s,o){var u=s.alternate,f=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:cr(o,s),ur(s),f&4&&(qs(3,s,s.return),uc(3,s),qs(5,s,s.return));break;case 1:cr(o,s),ur(s),f&512&&(fn||u===null||wa(u,u.return)),f&64&&ts&&(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=ua;if(cr(o,s),ur(s),f&512&&(fn||u===null||wa(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[Ds]||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,Xt(v),f=v;break e;case"link":var C=P4("link","href",y).get(f+(u.href||""));if(C){for(var O=0;O<C.length;O++)if(v=C[O],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)){C.splice(O,1);break t}}v=y.createElement(f),Fn(v,f,u),y.head.appendChild(v);break;case"meta":if(C=P4("meta","content",y).get(f+(u.content||""))){for(O=0;O<C.length;O++)if(v=C[O],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)){C.splice(O,1);break t}}v=y.createElement(f),Fn(v,f,u),y.head.appendChild(v);break;default:throw Error(r(468,f))}v[kn]=s,Xt(v),f=v}s.stateNode=f}else z4(y,s.type,s.stateNode);else s.stateNode=I4(y,f,s.memoizedProps);else v!==f?(v===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):v.count--,f===null?z4(y,s.type,s.stateNode):I4(y,f,s.memoizedProps)):f===null&&s.stateNode!==null&&up(s,s.memoizedProps,u.memoizedProps)}break;case 27:cr(o,s),ur(s),f&512&&(fn||u===null||wa(u,u.return)),u!==null&&f&4&&up(s,s.memoizedProps,u.memoizedProps);break;case 5:if(cr(o,s),ur(s),f&512&&(fn||u===null||wa(u,u.return)),s.flags&32){y=s.stateNode;try{ir(y,"")}catch(Re){Nt(s,s.return,Re)}}f&4&&s.stateNode!=null&&(y=s.memoizedProps,up(s,y,u!==null?u.memoizedProps:y)),f&1024&&(hp=!0);break;case 6:if(cr(o,s),ur(s),f&4){if(s.stateNode===null)throw Error(r(162));f=s.memoizedProps,u=s.stateNode;try{u.nodeValue=f}catch(Re){Nt(s,s.return,Re)}}break;case 3:if(Od=null,y=ua,ua=Md(o.containerInfo),cr(o,s),ua=y,ur(s),f&4&&u!==null&&u.memoizedState.isDehydrated)try{tl(o.containerInfo)}catch(Re){Nt(s,s.return,Re)}hp&&(hp=!1,zv(s));break;case 4:f=ua,ua=Md(s.stateNode.containerInfo),cr(o,s),ur(s),ua=f;break;case 12:cr(o,s),ur(s);break;case 31:cr(o,s),ur(s),f&4&&(f=s.updateQueue,f!==null&&(s.updateQueue=null,yd(s,f)));break;case 13:cr(o,s),ur(s),s.child.flags&8192&&s.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(vd=He()),f&4&&(f=s.updateQueue,f!==null&&(s.updateQueue=null,yd(s,f)));break;case 22:y=s.memoizedState!==null;var $=u!==null&&u.memoizedState!==null,J=ts,se=fn;if(ts=J||y,fn=se||$,cr(o,s),fn=se,ts=J,ur(s),f&8192)e:for(o=s.stateNode,o._visibility=y?o._visibility&-2:o._visibility|1,y&&(u===null||$||ts||fn||Yi(s)),u=null,o=s;;){if(o.tag===5||o.tag===26){if(u===null){$=u=o;try{if(v=$.stateNode,y)C=v.style,typeof C.setProperty=="function"?C.setProperty("display","none","important"):C.display="none";else{O=$.stateNode;var ue=$.memoizedProps.style,te=ue!=null&&ue.hasOwnProperty("display")?ue.display:null;O.style.display=te==null||typeof te=="boolean"?"":(""+te).trim()}}catch(Re){Nt($,$.return,Re)}}}else if(o.tag===6){if(u===null){$=o;try{$.stateNode.nodeValue=y?"":$.memoizedProps}catch(Re){Nt($,$.return,Re)}}}else if(o.tag===18){if(u===null){$=o;try{var re=$.stateNode;y?A4(re,!0):A4($.stateNode,!1)}catch(Re){Nt($,$.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,yd(s,u))));break;case 19:cr(o,s),ur(s),f&4&&(f=s.updateQueue,f!==null&&(s.updateQueue=null,yd(s,f)));break;case 30:break;case 21:break;default:cr(o,s),ur(s)}}function ur(s){var o=s.flags;if(o&2){try{for(var u,f=s.return;f!==null;){if(Rv(f)){u=f;break}f=f.return}if(u==null)throw Error(r(160));switch(u.tag){case 27:var y=u.stateNode,v=dp(s);gd(s,v,y);break;case 5:var C=u.stateNode;u.flags&32&&(ir(C,""),u.flags&=-33);var O=dp(s);gd(s,O,C);break;case 3:case 4:var $=u.stateNode.containerInfo,J=dp(s);fp(s,J,$);break;default:throw Error(r(161))}}catch(se){Nt(s,s.return,se)}s.flags&=-3}o&4096&&(s.flags&=-4097)}function zv(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var o=s;zv(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),s=s.sibling}}function rs(s,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)Ov(s,o.alternate,o),o=o.sibling}function Yi(s){for(s=s.child;s!==null;){var o=s;switch(o.tag){case 0:case 11:case 14:case 15:qs(4,o,o.return),Yi(o);break;case 1:wa(o,o.return);var u=o.stateNode;typeof u.componentWillUnmount=="function"&&Av(o,o.return,u),Yi(o);break;case 27:xc(o.stateNode);case 26:case 5:wa(o,o.return),Yi(o);break;case 22:o.memoizedState===null&&Yi(o);break;case 30:Yi(o);break;default:Yi(o)}s=s.sibling}}function as(s,o,u){for(u=u&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var f=o.alternate,y=s,v=o,C=v.flags;switch(v.tag){case 0:case 11:case 15:as(y,v,u),uc(4,v);break;case 1:if(as(y,v,u),f=v,y=f.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(J){Nt(f,f.return,J)}if(f=v,y=f.updateQueue,y!==null){var O=f.stateNode;try{var $=y.shared.hiddenCallbacks;if($!==null)for(y.shared.hiddenCallbacks=null,y=0;y<$.length;y++)gb($[y],O)}catch(J){Nt(f,f.return,J)}}u&&C&64&&Tv(v),dc(v,v.return);break;case 27:Mv(v);case 26:case 5:as(y,v,u),u&&f===null&&C&4&&Nv(v),dc(v,v.return);break;case 12:as(y,v,u);break;case 31:as(y,v,u),u&&C&4&&Bv(y,v);break;case 13:as(y,v,u),u&&C&4&&Iv(y,v);break;case 22:v.memoizedState===null&&as(y,v,u),dc(v,v.return);break;case 30:break;default:as(y,v,u)}o=o.sibling}}function pp(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&&Xl(u))}function mp(s,o){s=null,o.alternate!==null&&(s=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==s&&(o.refCount++,s!=null&&Xl(s))}function da(s,o,u,f){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)$v(s,o,u,f),o=o.sibling}function $v(s,o,u,f){var y=o.flags;switch(o.tag){case 0:case 11:case 15:da(s,o,u,f),y&2048&&uc(9,o);break;case 1:da(s,o,u,f);break;case 3:da(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&&Xl(s)));break;case 12:if(y&2048){da(s,o,u,f),s=o.stateNode;try{var v=o.memoizedProps,C=v.id,O=v.onPostCommit;typeof O=="function"&&O(C,o.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch($){Nt(o,o.return,$)}}else da(s,o,u,f);break;case 31:da(s,o,u,f);break;case 13:da(s,o,u,f);break;case 23:break;case 22:v=o.stateNode,C=o.alternate,o.memoizedState!==null?v._visibility&2?da(s,o,u,f):fc(s,o):v._visibility&2?da(s,o,u,f):(v._visibility|=2,Go(s,o,u,f,(o.subtreeFlags&10256)!==0||!1)),y&2048&&pp(C,o);break;case 24:da(s,o,u,f),y&2048&&mp(o.alternate,o);break;default:da(s,o,u,f)}}function Go(s,o,u,f,y){for(y=y&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var v=s,C=o,O=u,$=f,J=C.flags;switch(C.tag){case 0:case 11:case 15:Go(v,C,O,$,y),uc(8,C);break;case 23:break;case 22:var se=C.stateNode;C.memoizedState!==null?se._visibility&2?Go(v,C,O,$,y):fc(v,C):(se._visibility|=2,Go(v,C,O,$,y)),y&&J&2048&&pp(C.alternate,C);break;case 24:Go(v,C,O,$,y),y&&J&2048&&mp(C.alternate,C);break;default:Go(v,C,O,$,y)}o=o.sibling}}function fc(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:fc(u,f),y&2048&&pp(f.alternate,f);break;case 24:fc(u,f),y&2048&&mp(f.alternate,f);break;default:fc(u,f)}o=o.sibling}}var hc=8192;function qo(s,o,u){if(s.subtreeFlags&hc)for(s=s.child;s!==null;)Fv(s,o,u),s=s.sibling}function Fv(s,o,u){switch(s.tag){case 26:qo(s,o,u),s.flags&hc&&s.memoizedState!==null&&T8(u,ua,s.memoizedState,s.memoizedProps);break;case 5:qo(s,o,u);break;case 3:case 4:var f=ua;ua=Md(s.stateNode.containerInfo),qo(s,o,u),ua=f;break;case 22:s.memoizedState===null&&(f=s.alternate,f!==null&&f.memoizedState!==null?(f=hc,hc=16777216,qo(s,o,u),hc=f):qo(s,o,u));break;default:qo(s,o,u)}}function Uv(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 pc(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,Gv(f,s)}Uv(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)Hv(s),s=s.sibling}function Hv(s){switch(s.tag){case 0:case 11:case 15:pc(s),s.flags&2048&&qs(9,s,s.return);break;case 3:pc(s);break;case 12:pc(s);break;case 22:var o=s.stateNode;s.memoizedState!==null&&o._visibility&2&&(s.return===null||s.return.tag!==13)?(o._visibility&=-3,bd(s)):pc(s);break;default:pc(s)}}function bd(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,Gv(f,s)}Uv(s)}for(s=s.child;s!==null;){switch(o=s,o.tag){case 0:case 11:case 15:qs(8,o,o.return),bd(o);break;case 22:u=o.stateNode,u._visibility&2&&(u._visibility&=-3,bd(o));break;default:bd(o)}s=s.sibling}}function Gv(s,o){for(;On!==null;){var u=On;switch(u.tag){case 0:case 11:case 15:qs(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:Xl(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(Lv(f),f===u){On=null;break e}if(y!==null){y.return=v,On=y;break e}On=v}}}var U7={getCacheForType:function(s){var o=zn(cn),u=o.data.get(s);return u===void 0&&(u=s(),o.data.set(s,u)),u},cacheSignal:function(){return zn(cn).controller.signal}},H7=typeof WeakMap=="function"?WeakMap:Map,St=0,jt=null,dt=null,ht=0,At=0,Er=null,Vs=!1,Vo=!1,gp=!1,ss=0,tn=0,Ws=0,Zi=0,yp=0,Tr=0,Wo=0,mc=null,dr=null,bp=!1,vd=0,qv=0,xd=1/0,wd=null,Ks=null,Cn=0,Ys=null,Ko=null,is=0,vp=0,xp=null,Vv=null,gc=0,wp=null;function Ar(){return(St&2)!==0&&ht!==0?ht&-ht:q.T!==null?Tp():Mu()}function Wv(){if(Tr===0)if((ht&536870912)===0||gt){var s=Ni;Ni<<=1,(Ni&3932160)===0&&(Ni=262144),Tr=s}else Tr=536870912;return s=_r.current,s!==null&&(s.flags|=32),Tr}function fr(s,o,u){(s===jt&&(At===2||At===9)||s.cancelPendingCommit!==null)&&(Yo(s,0),Zs(s,ht,Tr,!1)),Rs(s,u),((St&2)===0||s!==jt)&&(s===jt&&((St&2)===0&&(Zi|=u),tn===4&&Zs(s,ht,Tr,!1)),ka(s))}function Kv(s,o,u){if((St&6)!==0)throw Error(r(327));var f=!u&&(o&127)===0&&(o&s.expiredLanes)===0||As(s,o),y=f?V7(s,o):Sp(s,o,!0),v=f;do{if(y===0){Vo&&!f&&Zs(s,o,0,!1);break}else{if(u=s.current.alternate,v&&!G7(u)){y=Sp(s,o,!1),v=!1;continue}if(y===2){if(v=o,s.errorRecoveryDisabledLanes&v)var C=0;else C=s.pendingLanes&-536870913,C=C!==0?C:C&536870912?536870912:0;if(C!==0){o=C;e:{var O=s;y=mc;var $=O.current.memoizedState.isDehydrated;if($&&(Yo(O,C).flags|=256),C=Sp(O,C,!1),C!==2){if(gp&&!$){O.errorRecoveryDisabledLanes|=v,Zi|=v,y=4;break e}v=dr,dr=y,v!==null&&(dr===null?dr=v:dr.push.apply(dr,v))}y=C}if(v=!1,y!==2)continue}}if(y===1){Yo(s,0),Zs(s,o,0,!0);break}e:{switch(f=s,v=y,v){case 0:case 1:throw Error(r(345));case 4:if((o&4194048)!==o)break;case 6:Zs(f,o,Tr,!Vs);break e;case 2:dr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((o&62914560)===o&&(y=vd+300-He(),10<y)){if(Zs(f,o,Tr,!Vs),Gn(f,0,!0)!==0)break e;is=o,f.timeoutHandle=C4(Yv.bind(null,f,u,dr,wd,bp,o,Tr,Zi,Wo,Vs,v,"Throttled",-0,0),y);break e}Yv(f,u,dr,wd,bp,o,Tr,Zi,Wo,Vs,v,null,-0,0)}}break}while(!0);ka(s)}function Yv(s,o,u,f,y,v,C,O,$,J,se,ue,te,re){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:_n},Fv(o,v,ue);var Re=(v&62914560)===v?vd-He():(v&4194048)===v?qv-He():0;if(Re=A8(ue,Re),Re!==null){is=v,s.cancelPendingCommit=Re(r4.bind(null,s,o,v,u,f,y,C,O,$,se,ue,null,te,re)),Zs(s,v,C,!J);return}}r4(s,o,v,u,f,y,C,O,$)}function G7(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(!kr(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 Zs(s,o,u,f){o&=~yp,o&=~Zi,s.suspendedLanes|=o,s.pingedLanes&=~o,f&&(s.warmLanes|=o),f=s.expirationTimes;for(var y=o;0<y;){var v=31-xn(y),C=1<<v;f[v]=-1,y&=~C}u!==0&&Au(s,u,o)}function kd(){return(St&6)===0?(yc(0),!1):!0}function kp(){if(dt!==null){if(At===0)var s=dt.return;else s=dt,Ya=Fi=null,Ph(s),zo=null,Jl=0,s=dt;for(;s!==null;)Ev(s.alternate,s),s=s.return;dt=null}}function Yo(s,o){var u=s.timeoutHandle;u!==-1&&(s.timeoutHandle=-1,u8(u)),u=s.cancelPendingCommit,u!==null&&(s.cancelPendingCommit=null,u()),is=0,kp(),jt=s,dt=u=Wa(s.current,null),ht=o,At=0,Er=null,Vs=!1,Vo=As(s,o),gp=!1,Wo=Tr=yp=Zi=Ws=tn=0,dr=mc=null,bp=!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-xn(f),v=1<<y;o|=s[y],f&=~v}return ss=o,Hu(),u}function Zv(s,o){rt=null,q.H=oc,o===Po||o===Xu?(o=fb(),At=3):o===Eh?(o=fb(),At=4):At=o===ep?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,Er=o,dt===null&&(tn=1,dd(s,Ur(o,s.current)))}function Xv(){var s=_r.current;return s===null?!0:(ht&4194048)===ht?Vr===null:(ht&62914560)===ht||(ht&536870912)!==0?s===Vr:!1}function Qv(){var s=q.H;return q.H=oc,s===null?oc:s}function Jv(){var s=q.A;return q.A=U7,s}function Sd(){tn=4,Vs||(ht&4194048)!==ht&&_r.current!==null||(Vo=!0),(Ws&134217727)===0&&(Zi&134217727)===0||jt===null||Zs(jt,ht,Tr,!1)}function Sp(s,o,u){var f=St;St|=2;var y=Qv(),v=Jv();(jt!==s||ht!==o)&&(wd=null,Yo(s,o)),o=!1;var C=tn;e:do try{if(At!==0&&dt!==null){var O=dt,$=Er;switch(At){case 8:kp(),C=6;break e;case 3:case 2:case 9:case 6:_r.current===null&&(o=!0);var J=At;if(At=0,Er=null,Zo(s,O,$,J),u&&Vo){C=0;break e}break;default:J=At,At=0,Er=null,Zo(s,O,$,J)}}q7(),C=tn;break}catch(se){Zv(s,se)}while(!0);return o&&s.shellSuspendCounter++,Ya=Fi=null,St=f,q.H=y,q.A=v,dt===null&&(jt=null,ht=0,Hu()),C}function q7(){for(;dt!==null;)e4(dt)}function V7(s,o){var u=St;St|=2;var f=Qv(),y=Jv();jt!==s||ht!==o?(wd=null,xd=He()+500,Yo(s,o)):Vo=As(s,o);e:do try{if(At!==0&&dt!==null){o=dt;var v=Er;t:switch(At){case 1:At=0,Er=null,Zo(s,o,v,1);break;case 2:case 9:if(ub(v)){At=0,Er=null,t4(o);break}o=function(){At!==2&&At!==9||jt!==s||(At=7),ka(s)},v.then(o,o);break e;case 3:At=7;break e;case 4:At=5;break e;case 7:ub(v)?(At=0,Er=null,t4(o)):(At=0,Er=null,Zo(s,o,v,7));break;case 5:var C=null;switch(dt.tag){case 26:C=dt.memoizedState;case 5:case 27:var O=dt;if(C?$4(C):O.stateNode.complete){At=0,Er=null;var $=O.sibling;if($!==null)dt=$;else{var J=O.return;J!==null?(dt=J,_d(J)):dt=null}break t}}At=0,Er=null,Zo(s,o,v,5);break;case 6:At=0,Er=null,Zo(s,o,v,6);break;case 8:kp(),tn=6;break e;default:throw Error(r(462))}}W7();break}catch(se){Zv(s,se)}while(!0);return Ya=Fi=null,q.H=f,q.A=y,St=u,dt!==null?0:(jt=null,ht=0,Hu(),tn)}function W7(){for(;dt!==null&&!de();)e4(dt)}function e4(s){var o=_v(s.alternate,s,ss);s.memoizedProps=s.pendingProps,o===null?_d(s):dt=o}function t4(s){var o=s,u=o.alternate;switch(o.tag){case 15:case 0:o=bv(u,o,o.pendingProps,o.type,void 0,ht);break;case 11:o=bv(u,o,o.pendingProps,o.type.render,o.ref,ht);break;case 5:Ph(o);default:Ev(u,o),o=dt=Jy(o,ss),o=_v(u,o,ss)}s.memoizedProps=s.pendingProps,o===null?_d(s):dt=o}function Zo(s,o,u,f){Ya=Fi=null,Ph(o),zo=null,Jl=0;var y=o.return;try{if(j7(s,y,o,u,ht)){tn=1,dd(s,Ur(u,s.current)),dt=null;return}}catch(v){if(y!==null)throw dt=y,v;tn=1,dd(s,Ur(u,s.current)),dt=null;return}o.flags&32768?(gt||f===1?s=!0:Vo||(ht&536870912)!==0?s=!1:(Vs=s=!0,(f===2||f===9||f===3||f===6)&&(f=_r.current,f!==null&&f.tag===13&&(f.flags|=16384))),n4(o,s)):_d(o)}function _d(s){var o=s;do{if((o.flags&32768)!==0){n4(o,Vs);return}s=o.return;var u=P7(o.alternate,o,ss);if(u!==null){dt=u;return}if(o=o.sibling,o!==null){dt=o;return}dt=o=s}while(o!==null);tn===0&&(tn=5)}function n4(s,o){do{var u=z7(s.alternate,s);if(u!==null){u.flags&=32767,dt=u;return}if(u=s.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!o&&(s=s.sibling,s!==null)){dt=s;return}dt=s=u}while(s!==null);tn=6,dt=null}function r4(s,o,u,f,y,v,C,O,$){s.cancelPendingCommit=null;do Cd();while(Cn!==0);if((St&6)!==0)throw Error(r(327));if(o!==null){if(o===s.current)throw Error(r(177));if(v=o.lanes|o.childLanes,v|=dh,jl(s,u,v,C,O,$),s===jt&&(dt=jt=null,ht=0),Ko=o,Ys=s,is=u,vp=v,xp=y,Vv=f,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,X7(It,function(){return l4(),null})):(s.callbackNode=null,s.callbackPriority=0),f=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||f){f=q.T,q.T=null,y=ie.p,ie.p=2,C=St,St|=4;try{$7(s,o,u)}finally{St=C,ie.p=y,q.T=f}}Cn=1,a4(),s4(),i4()}}function a4(){if(Cn===1){Cn=0;var s=Ys,o=Ko,u=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||u){u=q.T,q.T=null;var f=ie.p;ie.p=2;var y=St;St|=4;try{Pv(o,s);var v=jp,C=Gy(s.containerInfo),O=v.focusedElem,$=v.selectionRange;if(C!==O&&O&&O.ownerDocument&&Hy(O.ownerDocument.documentElement,O)){if($!==null&&ih(O)){var J=$.start,se=$.end;if(se===void 0&&(se=J),"selectionStart"in O)O.selectionStart=J,O.selectionEnd=Math.min(se,O.value.length);else{var ue=O.ownerDocument||document,te=ue&&ue.defaultView||window;if(te.getSelection){var re=te.getSelection(),Re=O.textContent.length,$e=Math.min($.start,Re),Ot=$.end===void 0?$e:Math.min($.end,Re);!re.extend&&$e>Ot&&(C=Ot,Ot=$e,$e=C);var K=Uy(O,$e),H=Uy(O,Ot);if(K&&H&&(re.rangeCount!==1||re.anchorNode!==K.node||re.anchorOffset!==K.offset||re.focusNode!==H.node||re.focusOffset!==H.offset)){var X=ue.createRange();X.setStart(K.node,K.offset),re.removeAllRanges(),$e>Ot?(re.addRange(X),re.extend(H.node,H.offset)):(X.setEnd(H.node,H.offset),re.addRange(X))}}}}for(ue=[],re=O;re=re.parentNode;)re.nodeType===1&&ue.push({element:re,left:re.scrollLeft,top:re.scrollTop});for(typeof O.focus=="function"&&O.focus(),O=0;O<ue.length;O++){var ce=ue[O];ce.element.scrollLeft=ce.left,ce.element.scrollTop=ce.top}}Id=!!Lp,jp=Lp=null}finally{St=y,ie.p=f,q.T=u}}s.current=o,Cn=2}}function s4(){if(Cn===2){Cn=0;var s=Ys,o=Ko,u=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||u){u=q.T,q.T=null;var f=ie.p;ie.p=2;var y=St;St|=4;try{Ov(s,o.alternate,o)}finally{St=y,ie.p=f,q.T=u}}Cn=3}}function i4(){if(Cn===4||Cn===3){Cn=0,Ve();var s=Ys,o=Ko,u=is,f=Vv;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?Cn=5:(Cn=0,Ko=Ys=null,o4(s,s.pendingLanes));var y=s.pendingLanes;if(y===0&&(Ks=null),Mi(u),o=o.stateNode,Mn&&typeof Mn.onCommitFiberRoot=="function")try{Mn.onCommitFiberRoot(Pr,o,void 0,(o.current.flags&128)===128)}catch{}if(f!==null){o=q.T,y=ie.p,ie.p=2,q.T=null;try{for(var v=s.onRecoverableError,C=0;C<f.length;C++){var O=f[C];v(O.value,{componentStack:O.stack})}}finally{q.T=o,ie.p=y}}(is&3)!==0&&Cd(),ka(s),y=s.pendingLanes,(u&261930)!==0&&(y&42)!==0?s===wp?gc++:(gc=0,wp=s):gc=0,yc(0)}}function o4(s,o){(s.pooledCacheLanes&=o)===0&&(o=s.pooledCache,o!=null&&(s.pooledCache=null,Xl(o)))}function Cd(){return a4(),s4(),i4(),l4()}function l4(){if(Cn!==5)return!1;var s=Ys,o=vp;vp=0;var u=Mi(is),f=q.T,y=ie.p;try{ie.p=32>u?32:u,q.T=null,u=xp,xp=null;var v=Ys,C=is;if(Cn=0,Ko=Ys=null,is=0,(St&6)!==0)throw Error(r(331));var O=St;if(St|=4,Hv(v.current),$v(v,v.current,C,u),St=O,yc(0,!1),Mn&&typeof Mn.onPostCommitFiberRoot=="function")try{Mn.onPostCommitFiberRoot(Pr,v)}catch{}return!0}finally{ie.p=y,q.T=f,o4(s,o)}}function c4(s,o,u){o=Ur(u,o),o=Jh(s.stateNode,o,2),s=Us(s,o,2),s!==null&&(Rs(s,2),ka(s))}function Nt(s,o,u){if(s.tag===3)c4(s,s,u);else for(;o!==null;){if(o.tag===3){c4(o,s,u);break}else if(o.tag===1){var f=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(Ks===null||!Ks.has(f))){s=Ur(u,s),u=uv(2),f=Us(o,u,2),f!==null&&(dv(u,f,o,s),Rs(f,2),ka(f));break}}o=o.return}}function _p(s,o,u){var f=s.pingCache;if(f===null){f=s.pingCache=new H7;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)||(gp=!0,y.add(u),s=K7.bind(null,s,o,u),o.then(s,s))}function K7(s,o,u){var f=s.pingCache;f!==null&&f.delete(o),s.pingedLanes|=s.suspendedLanes&u,s.warmLanes&=~u,jt===s&&(ht&u)===u&&(tn===4||tn===3&&(ht&62914560)===ht&&300>He()-vd?(St&2)===0&&Yo(s,0):yp|=u,Wo===ht&&(Wo=0)),ka(s)}function u4(s,o){o===0&&(o=Ns()),s=Pi(s,o),s!==null&&(Rs(s,o),ka(s))}function Y7(s){var o=s.memoizedState,u=0;o!==null&&(u=o.retryLane),u4(s,u)}function Z7(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(r(314))}f!==null&&f.delete(o),u4(s,u)}function X7(s,o){return ar(s,o)}var Ed=null,Xo=null,Cp=!1,Td=!1,Ep=!1,Xs=0;function ka(s){s!==Xo&&s.next===null&&(Xo===null?Ed=Xo=s:Xo=Xo.next=s),Td=!0,Cp||(Cp=!0,J7())}function yc(s,o){if(!Ep&&Td){Ep=!0;do for(var u=!1,f=Ed;f!==null;){if(s!==0){var y=f.pendingLanes;if(y===0)var v=0;else{var C=f.suspendedLanes,O=f.pingedLanes;v=(1<<31-xn(42|s)+1)-1,v&=y&~(C&~O),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(u=!0,p4(f,v))}else v=ht,v=Gn(f,f===jt?v:0,f.cancelPendingCommit!==null||f.timeoutHandle!==-1),(v&3)===0||As(f,v)||(u=!0,p4(f,v));f=f.next}while(u);Ep=!1}}function Q7(){d4()}function d4(){Td=Cp=!1;var s=0;Xs!==0&&c8()&&(s=Xs);for(var o=He(),u=null,f=Ed;f!==null;){var y=f.next,v=f4(f,o);v===0?(f.next=null,u===null?Ed=y:u.next=y,y===null&&(Xo=u)):(u=f,(s!==0||(v&3)!==0)&&(Td=!0)),f=y}Cn!==0&&Cn!==5||yc(s),Xs!==0&&(Xs=0)}function f4(s,o){for(var u=s.suspendedLanes,f=s.pingedLanes,y=s.expirationTimes,v=s.pendingLanes&-62914561;0<v;){var C=31-xn(v),O=1<<C,$=y[C];$===-1?((O&u)===0||(O&f)!==0)&&(y[C]=Tu(O,o)):$<=o&&(s.expiredLanes|=O),v&=~O}if(o=jt,u=ht,u=Gn(s,s===o?u:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),f=s.callbackNode,u===0||s===o&&(At===2||At===9)||s.cancelPendingCommit!==null)return f!==null&&f!==null&&sa(f),s.callbackNode=null,s.callbackPriority=0;if((u&3)===0||As(s,u)){if(o=u&-u,o===s.callbackPriority)return o;switch(f!==null&&sa(f),Mi(u)){case 2:case 8:u=Lt;break;case 32:u=It;break;case 268435456:u=xe;break;default:u=It}return f=h4.bind(null,s),u=ar(u,f),s.callbackPriority=o,s.callbackNode=u,o}return f!==null&&f!==null&&sa(f),s.callbackPriority=2,s.callbackNode=null,2}function h4(s,o){if(Cn!==0&&Cn!==5)return s.callbackNode=null,s.callbackPriority=0,null;var u=s.callbackNode;if(Cd()&&s.callbackNode!==u)return null;var f=ht;return f=Gn(s,s===jt?f:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),f===0?null:(Kv(s,f,o),f4(s,He()),s.callbackNode!=null&&s.callbackNode===u?h4.bind(null,s):null)}function p4(s,o){if(Cd())return null;Kv(s,o,!0)}function J7(){d8(function(){(St&6)!==0?ar(bt,Q7):d4()})}function Tp(){if(Xs===0){var s=Bo;s===0&&(s=Ts,Ts<<=1,(Ts&261888)===0&&(Ts=256)),Xs=s}return Xs}function m4(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:Os(""+s)}function g4(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 e8(s,o,u,f,y){if(o==="submit"&&u&&u.stateNode===y){var v=m4((y[Sn]||null).action),C=f.submitter;C&&(o=(o=C[Sn]||null)?m4(o.formAction):C.getAttribute("formAction"),o!==null&&(v=o,C=null));var O=new zu("action","action",null,f,y);s.push({event:O,listeners:[{instance:null,listener:function(){if(f.defaultPrevented){if(Xs!==0){var $=C?g4(y,C):new FormData(y);Wh(u,{pending:!0,data:$,method:y.method,action:v},null,$)}}else typeof v=="function"&&(O.preventDefault(),$=C?g4(y,C):new FormData(y),Wh(u,{pending:!0,data:$,method:y.method,action:v},v,$))},currentTarget:y}]})}}for(var Ap=0;Ap<uh.length;Ap++){var Np=uh[Ap],t8=Np.toLowerCase(),n8=Np[0].toUpperCase()+Np.slice(1);ca(t8,"on"+n8)}ca(Wy,"onAnimationEnd"),ca(Ky,"onAnimationIteration"),ca(Yy,"onAnimationStart"),ca("dblclick","onDoubleClick"),ca("focusin","onFocus"),ca("focusout","onBlur"),ca(b7,"onTransitionRun"),ca(v7,"onTransitionStart"),ca(x7,"onTransitionCancel"),ca(Zy,"onTransitionEnd"),zr("onMouseEnter",["mouseout","mouseover"]),zr("onMouseLeave",["mouseout","mouseover"]),zr("onPointerEnter",["pointerout","pointerover"]),zr("onPointerLeave",["pointerout","pointerover"]),la("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),la("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),la("onBeforeInput",["compositionend","keypress","textInput","paste"]),la("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),la("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),la("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var bc="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(" "),r8=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(bc));function y4(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 C=f.length-1;0<=C;C--){var O=f[C],$=O.instance,J=O.currentTarget;if(O=O.listener,$!==v&&y.isPropagationStopped())break e;v=O,y.currentTarget=J;try{v(y)}catch(se){Uu(se)}y.currentTarget=null,v=$}else for(C=0;C<f.length;C++){if(O=f[C],$=O.instance,J=O.currentTarget,O=O.listener,$!==v&&y.isPropagationStopped())break e;v=O,y.currentTarget=J;try{v(y)}catch(se){Uu(se)}y.currentTarget=null,v=$}}}}function ft(s,o){var u=o[oa];u===void 0&&(u=o[oa]=new Set);var f=s+"__bubble";u.has(f)||(b4(o,s,2,!1),u.add(f))}function Rp(s,o,u){var f=0;o&&(f|=4),b4(u,s,f,o)}var Ad="_reactListening"+Math.random().toString(36).slice(2);function Mp(s){if(!s[Ad]){s[Ad]=!0,Oi.forEach(function(u){u!=="selectionchange"&&(r8.has(u)||Rp(u,!1,s),Rp(u,!0,s))});var o=s.nodeType===9?s:s.ownerDocument;o===null||o[Ad]||(o[Ad]=!0,Rp("selectionchange",!1,o))}}function b4(s,o,u,f){switch(W4(o)){case 2:var y=M8;break;case 8:y=D8;break;default:y=Vp}u=y.bind(null,o,u,s),y=void 0,!Xf||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 Dp(s,o,u,f,y){var v=f;if((o&1)===0&&(o&2)===0&&f!==null)e:for(;;){if(f===null)return;var C=f.tag;if(C===3||C===4){var O=f.stateNode.containerInfo;if(O===y)break;if(C===4)for(C=f.return;C!==null;){var $=C.tag;if(($===3||$===4)&&C.stateNode.containerInfo===y)return;C=C.return}for(;O!==null;){if(C=Ua(O),C===null)return;if($=C.tag,$===5||$===6||$===26||$===27){f=v=C;continue e}O=O.parentNode}}f=f.return}Sy(function(){var J=v,se=Co(u),ue=[];e:{var te=Xy.get(s);if(te!==void 0){var re=zu,Re=s;switch(s){case"keypress":if(Iu(u)===0)break e;case"keydown":case"keyup":re=ZS;break;case"focusin":Re="focus",re=th;break;case"focusout":Re="blur",re=th;break;case"beforeblur":case"afterblur":re=th;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":re=Ey;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":re=PS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":re=JS;break;case Wy:case Ky:case Yy:re=FS;break;case Zy:re=t7;break;case"scroll":case"scrollend":re=BS;break;case"wheel":re=r7;break;case"copy":case"cut":case"paste":re=HS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":re=Ay;break;case"toggle":case"beforetoggle":re=s7}var $e=(o&4)!==0,Ot=!$e&&(s==="scroll"||s==="scrollend"),K=$e?te!==null?te+"Capture":null:te;$e=[];for(var H=J,X;H!==null;){var ce=H;if(X=ce.stateNode,ce=ce.tag,ce!==5&&ce!==26&&ce!==27||X===null||K===null||(ce=$l(H,K),ce!=null&&$e.push(vc(H,ce,X))),Ot)break;H=H.return}0<$e.length&&(te=new re(te,Re,null,u,se),ue.push({event:te,listeners:$e}))}}if((o&7)===0){e:{if(te=s==="mouseover"||s==="pointerover",re=s==="mouseout"||s==="pointerout",te&&u!==wr&&(Re=u.relatedTarget||u.fromElement)&&(Ua(Re)||Re[ia]))break e;if((re||te)&&(te=se.window===se?se:(te=se.ownerDocument)?te.defaultView||te.parentWindow:window,re?(Re=u.relatedTarget||u.toElement,re=J,Re=Re?Ua(Re):null,Re!==null&&(Ot=i(Re),$e=Re.tag,Re!==Ot||$e!==5&&$e!==27&&$e!==6)&&(Re=null)):(re=null,Re=J),re!==Re)){if($e=Ey,ce="onMouseLeave",K="onMouseEnter",H="mouse",(s==="pointerout"||s==="pointerover")&&($e=Ay,ce="onPointerLeave",K="onPointerEnter",H="pointer"),Ot=re==null?te:Ga(re),X=Re==null?te:Ga(Re),te=new $e(ce,H+"leave",re,u,se),te.target=Ot,te.relatedTarget=X,ce=null,Ua(se)===J&&($e=new $e(K,H+"enter",Re,u,se),$e.target=X,$e.relatedTarget=Ot,ce=$e),Ot=ce,re&&Re)t:{for($e=a8,K=re,H=Re,X=0,ce=K;ce;ce=$e(ce))X++;ce=0;for(var Pe=H;Pe;Pe=$e(Pe))ce++;for(;0<X-ce;)K=$e(K),X--;for(;0<ce-X;)H=$e(H),ce--;for(;X--;){if(K===H||H!==null&&K===H.alternate){$e=K;break t}K=$e(K),H=$e(H)}$e=null}else $e=null;re!==null&&v4(ue,te,re,$e,!1),Re!==null&&Ot!==null&&v4(ue,Ot,Re,$e,!0)}}e:{if(te=J?Ga(J):window,re=te.nodeName&&te.nodeName.toLowerCase(),re==="select"||re==="input"&&te.type==="file")var xt=By;else if(Ly(te))if(Iy)xt=m7;else{xt=h7;var Le=f7}else re=te.nodeName,!re||re.toLowerCase()!=="input"||te.type!=="checkbox"&&te.type!=="radio"?J&&Li(J.elementType)&&(xt=By):xt=p7;if(xt&&(xt=xt(s,J))){jy(ue,xt,u,se);break e}Le&&Le(s,te,J),s==="focusout"&&J&&te.type==="number"&&J.memoizedProps.value!=null&&Qt(te,"number",te.value)}switch(Le=J?Ga(J):window,s){case"focusin":(Ly(Le)||Le.contentEditable==="true")&&(Ao=Le,oh=J,Kl=null);break;case"focusout":Kl=oh=Ao=null;break;case"mousedown":lh=!0;break;case"contextmenu":case"mouseup":case"dragend":lh=!1,qy(ue,u,se);break;case"selectionchange":if(y7)break;case"keydown":case"keyup":qy(ue,u,se)}var at;if(rh)e:{switch(s){case"compositionstart":var pt="onCompositionStart";break e;case"compositionend":pt="onCompositionEnd";break e;case"compositionupdate":pt="onCompositionUpdate";break e}pt=void 0}else To?Dy(s,u)&&(pt="onCompositionEnd"):s==="keydown"&&u.keyCode===229&&(pt="onCompositionStart");pt&&(Ny&&u.locale!=="ko"&&(To||pt!=="onCompositionStart"?pt==="onCompositionEnd"&&To&&(at=_y()):(js=se,Qf="value"in js?js.value:js.textContent,To=!0)),Le=Nd(J,pt),0<Le.length&&(pt=new Ty(pt,s,null,u,se),ue.push({event:pt,listeners:Le}),at?pt.data=at:(at=Oy(u),at!==null&&(pt.data=at)))),(at=o7?l7(s,u):c7(s,u))&&(pt=Nd(J,"onBeforeInput"),0<pt.length&&(Le=new Ty("onBeforeInput","beforeinput",null,u,se),ue.push({event:Le,listeners:pt}),Le.data=at)),e8(ue,s,J,u,se)}y4(ue,o)})}function vc(s,o,u){return{instance:s,listener:o,currentTarget:u}}function Nd(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=$l(s,u),y!=null&&f.unshift(vc(s,y,v)),y=$l(s,o),y!=null&&f.push(vc(s,y,v))),s.tag===3)return f;s=s.return}return[]}function a8(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function v4(s,o,u,f,y){for(var v=o._reactName,C=[];u!==null&&u!==f;){var O=u,$=O.alternate,J=O.stateNode;if(O=O.tag,$!==null&&$===f)break;O!==5&&O!==26&&O!==27||J===null||($=J,y?(J=$l(u,v),J!=null&&C.unshift(vc(u,J,$))):y||(J=$l(u,v),J!=null&&C.push(vc(u,J,$)))),u=u.return}C.length!==0&&s.push({event:o,listeners:C})}var s8=/\r\n?/g,i8=/\u0000|\uFFFD/g;function x4(s){return(typeof s=="string"?s:""+s).replace(s8,`
26
- `).replace(i8,"")}function w4(s,o){return o=x4(o),x4(s)===o}function Dt(s,o,u,f,y,v){switch(u){case"children":typeof f=="string"?o==="body"||o==="textarea"&&f===""||ir(s,f):(typeof f=="number"||typeof f=="bigint")&&o!=="body"&&ir(s,""+f);break;case"className":So(s,"class",f);break;case"tabIndex":So(s,"tabindex",f);break;case"dir":case"role":case"viewBox":case"width":case"height":So(s,u,f);break;case"style":Pl(s,f,v);break;case"data":if(o!=="object"){So(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=Os(""+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"&&Dt(s,o,"name",y.name,y,null),Dt(s,o,"formEncType",y.formEncType,y,null),Dt(s,o,"formMethod",y.formMethod,y,null),Dt(s,o,"formTarget",y.formTarget,y,null)):(Dt(s,o,"encType",y.encType,y,null),Dt(s,o,"method",y.method,y,null),Dt(s,o,"target",y.target,y,null)));if(f==null||typeof f=="symbol"||typeof f=="boolean"){s.removeAttribute(u);break}f=Os(""+f),s.setAttribute(u,f);break;case"onClick":f!=null&&(s.onclick=_n);break;case"onScroll":f!=null&&ft("scroll",s);break;case"onScrollEnd":f!=null&&ft("scrollend",s);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(r(61));if(u=f.__html,u!=null){if(y.children!=null)throw Error(r(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=Os(""+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":ft("beforetoggle",s),ft("toggle",s),ko(s,"popover",f);break;case"xlinkActuate":$r(s,"http://www.w3.org/1999/xlink","xlink:actuate",f);break;case"xlinkArcrole":$r(s,"http://www.w3.org/1999/xlink","xlink:arcrole",f);break;case"xlinkRole":$r(s,"http://www.w3.org/1999/xlink","xlink:role",f);break;case"xlinkShow":$r(s,"http://www.w3.org/1999/xlink","xlink:show",f);break;case"xlinkTitle":$r(s,"http://www.w3.org/1999/xlink","xlink:title",f);break;case"xlinkType":$r(s,"http://www.w3.org/1999/xlink","xlink:type",f);break;case"xmlBase":$r(s,"http://www.w3.org/XML/1998/namespace","xml:base",f);break;case"xmlLang":$r(s,"http://www.w3.org/XML/1998/namespace","xml:lang",f);break;case"xmlSpace":$r(s,"http://www.w3.org/XML/1998/namespace","xml:space",f);break;case"is":ko(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=zl.get(u)||u,ko(s,u,f))}}function Op(s,o,u,f,y,v){switch(u){case"style":Pl(s,f,v);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(r(61));if(u=f.__html,u!=null){if(y.children!=null)throw Error(r(60));s.innerHTML=u}}break;case"children":typeof f=="string"?ir(s,f):(typeof f=="number"||typeof f=="bigint")&&ir(s,""+f);break;case"onScroll":f!=null&&ft("scroll",s);break;case"onScrollEnd":f!=null&&ft("scrollend",s);break;case"onClick":f!=null&&(s.onclick=_n);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ou.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,""):ko(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":ft("error",s),ft("load",s);var f=!1,y=!1,v;for(v in u)if(u.hasOwnProperty(v)){var C=u[v];if(C!=null)switch(v){case"src":f=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:Dt(s,o,v,C,u,null)}}y&&Dt(s,o,"srcSet",u.srcSet,u,null),f&&Dt(s,o,"src",u.src,u,null);return;case"input":ft("invalid",s);var O=v=C=y=null,$=null,J=null;for(f in u)if(u.hasOwnProperty(f)){var se=u[f];if(se!=null)switch(f){case"name":y=se;break;case"type":C=se;break;case"checked":$=se;break;case"defaultChecked":J=se;break;case"value":v=se;break;case"defaultValue":O=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(r(137,o));break;default:Dt(s,o,f,se,u,null)}}Et(s,v,O,$,J,C,y,!1);return;case"select":ft("invalid",s),f=C=v=null;for(y in u)if(u.hasOwnProperty(y)&&(O=u[y],O!=null))switch(y){case"value":v=O;break;case"defaultValue":C=O;break;case"multiple":f=O;default:Dt(s,o,y,O,u,null)}o=v,u=C,s.multiple=!!f,o!=null?Ft(s,!!f,o,!1):u!=null&&Ft(s,!!f,u,!0);return;case"textarea":ft("invalid",s),v=y=f=null;for(C in u)if(u.hasOwnProperty(C)&&(O=u[C],O!=null))switch(C){case"value":f=O;break;case"defaultValue":y=O;break;case"children":v=O;break;case"dangerouslySetInnerHTML":if(O!=null)throw Error(r(91));break;default:Dt(s,o,C,O,u,null)}Jt(s,f,y,v);return;case"option":for($ in u)if(u.hasOwnProperty($)&&(f=u[$],f!=null))switch($){case"selected":s.selected=f&&typeof f!="function"&&typeof f!="symbol";break;default:Dt(s,o,$,f,u,null)}return;case"dialog":ft("beforetoggle",s),ft("toggle",s),ft("cancel",s),ft("close",s);break;case"iframe":case"object":ft("load",s);break;case"video":case"audio":for(f=0;f<bc.length;f++)ft(bc[f],s);break;case"image":ft("error",s),ft("load",s);break;case"details":ft("toggle",s);break;case"embed":case"source":case"link":ft("error",s),ft("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(r(137,o));default:Dt(s,o,J,f,u,null)}return;default:if(Li(o)){for(se in u)u.hasOwnProperty(se)&&(f=u[se],f!==void 0&&Op(s,o,se,f,u,void 0));return}}for(O in u)u.hasOwnProperty(O)&&(f=u[O],f!=null&&Dt(s,o,O,f,u,null))}function o8(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,C=null,O=null,$=null,J=null,se=null;for(re in u){var ue=u[re];if(u.hasOwnProperty(re)&&ue!=null)switch(re){case"checked":break;case"value":break;case"defaultValue":$=ue;default:f.hasOwnProperty(re)||Dt(s,o,re,null,f,ue)}}for(var te in f){var re=f[te];if(ue=u[te],f.hasOwnProperty(te)&&(re!=null||ue!=null))switch(te){case"type":v=re;break;case"name":y=re;break;case"checked":J=re;break;case"defaultChecked":se=re;break;case"value":C=re;break;case"defaultValue":O=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(r(137,o));break;default:re!==ue&&Dt(s,o,te,re,f,ue)}}nt(s,C,O,$,J,se,v,y);return;case"select":re=C=O=te=null;for(v in u)if($=u[v],u.hasOwnProperty(v)&&$!=null)switch(v){case"value":break;case"multiple":re=$;default:f.hasOwnProperty(v)||Dt(s,o,v,null,f,$)}for(y in f)if(v=f[y],$=u[y],f.hasOwnProperty(y)&&(v!=null||$!=null))switch(y){case"value":te=v;break;case"defaultValue":O=v;break;case"multiple":C=v;default:v!==$&&Dt(s,o,y,v,f,$)}o=O,u=C,f=re,te!=null?Ft(s,!!u,te,!1):!!f!=!!u&&(o!=null?Ft(s,!!u,o,!0):Ft(s,!!u,u?[]:"",!1));return;case"textarea":re=te=null;for(O in u)if(y=u[O],u.hasOwnProperty(O)&&y!=null&&!f.hasOwnProperty(O))switch(O){case"value":break;case"children":break;default:Dt(s,o,O,null,f,y)}for(C in f)if(y=f[C],v=u[C],f.hasOwnProperty(C)&&(y!=null||v!=null))switch(C){case"value":te=y;break;case"defaultValue":re=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(r(91));break;default:y!==v&&Dt(s,o,C,y,f,v)}Wt(s,te,re);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:Dt(s,o,Re,null,f,te)}for($ in f)if(te=f[$],re=u[$],f.hasOwnProperty($)&&te!==re&&(te!=null||re!=null))switch($){case"selected":s.selected=te&&typeof te!="function"&&typeof te!="symbol";break;default:Dt(s,o,$,te,f,re)}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 $e in u)te=u[$e],u.hasOwnProperty($e)&&te!=null&&!f.hasOwnProperty($e)&&Dt(s,o,$e,null,f,te);for(J in f)if(te=f[J],re=u[J],f.hasOwnProperty(J)&&te!==re&&(te!=null||re!=null))switch(J){case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(r(137,o));break;default:Dt(s,o,J,te,f,re)}return;default:if(Li(o)){for(var Ot in u)te=u[Ot],u.hasOwnProperty(Ot)&&te!==void 0&&!f.hasOwnProperty(Ot)&&Op(s,o,Ot,void 0,f,te);for(se in f)te=f[se],re=u[se],!f.hasOwnProperty(se)||te===re||te===void 0&&re===void 0||Op(s,o,se,te,f,re);return}}for(var K in u)te=u[K],u.hasOwnProperty(K)&&te!=null&&!f.hasOwnProperty(K)&&Dt(s,o,K,null,f,te);for(ue in f)te=f[ue],re=u[ue],!f.hasOwnProperty(ue)||te===re||te==null&&re==null||Dt(s,o,ue,te,f,re)}function k4(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function l8(){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,C=y.initiatorType,O=y.duration;if(v&&O&&k4(C)){for(C=0,O=y.responseEnd,f+=1;f<u.length;f++){var $=u[f],J=$.startTime;if(J>O)break;var se=$.transferSize,ue=$.initiatorType;se&&k4(ue)&&($=$.responseEnd,C+=se*($<O?1:(O-J)/($-J)))}if(--f,o+=8*(v+C)/(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 Lp=null,jp=null;function Rd(s){return s.nodeType===9?s:s.ownerDocument}function S4(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 _4(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 Bp(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 Ip=null;function c8(){var s=window.event;return s&&s.type==="popstate"?s===Ip?!1:(Ip=s,!0):(Ip=null,!1)}var C4=typeof setTimeout=="function"?setTimeout:void 0,u8=typeof clearTimeout=="function"?clearTimeout:void 0,E4=typeof Promise=="function"?Promise:void 0,d8=typeof queueMicrotask=="function"?queueMicrotask:typeof E4<"u"?function(s){return E4.resolve(null).then(s).catch(f8)}:C4;function f8(s){setTimeout(function(){throw s})}function Qs(s){return s==="head"}function T4(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),tl(o);return}f--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")f++;else if(u==="html")xc(s.ownerDocument.documentElement);else if(u==="head"){u=s.ownerDocument.head,xc(u);for(var v=u.firstChild;v;){var C=v.nextSibling,O=v.nodeName;v[Ds]||O==="SCRIPT"||O==="STYLE"||O==="LINK"&&v.rel.toLowerCase()==="stylesheet"||u.removeChild(v),v=C}}else u==="body"&&xc(s.ownerDocument.body);u=y}while(u);tl(o)}function A4(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 Pp(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":Pp(u),Di(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}s.removeChild(u)}}function h8(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[Ds])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=Wr(s.nextSibling),s===null)break}return null}function p8(s,o,u){if(o==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!u||(s=Wr(s.nextSibling),s===null))return null;return s}function N4(s,o){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!o||(s=Wr(s.nextSibling),s===null))return null;return s}function zp(s){return s.data==="$?"||s.data==="$~"}function $p(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function m8(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 Wr(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 Fp=null;function R4(s){s=s.nextSibling;for(var o=0;s;){if(s.nodeType===8){var u=s.data;if(u==="/$"||u==="/&"){if(o===0)return Wr(s.nextSibling);o--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||o++}s=s.nextSibling}return null}function M4(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 D4(s,o,u){switch(o=Rd(u),s){case"html":if(s=o.documentElement,!s)throw Error(r(452));return s;case"head":if(s=o.head,!s)throw Error(r(453));return s;case"body":if(s=o.body,!s)throw Error(r(454));return s;default:throw Error(r(451))}}function xc(s){for(var o=s.attributes;o.length;)s.removeAttributeNode(o[0]);Di(s)}var Kr=new Map,O4=new Set;function Md(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var os=ie.d;ie.d={f:g8,r:y8,D:b8,C:v8,L:x8,m:w8,X:S8,S:k8,M:_8};function g8(){var s=os.f(),o=kd();return s||o}function y8(s){var o=Ha(s);o!==null&&o.tag===5&&o.type==="form"?Zb(o):os.r(s)}var Qo=typeof document>"u"?null:document;function L4(s,o,u){var f=Qo;if(f&&typeof o=="string"&&o){var y=Te(o);y='link[rel="'+s+'"][href="'+y+'"]',typeof u=="string"&&(y+='[crossorigin="'+u+'"]'),O4.has(y)||(O4.add(y),s={rel:s,crossOrigin:u,href:o},f.querySelector(y)===null&&(o=f.createElement("link"),Fn(o,"link",s),Xt(o),f.head.appendChild(o)))}}function b8(s){os.D(s),L4("dns-prefetch",s,null)}function v8(s,o){os.C(s,o),L4("preconnect",s,o)}function x8(s,o,u){os.L(s,o,u);var f=Qo;if(f&&s&&o){var y='link[rel="preload"][as="'+Te(o)+'"]';o==="image"&&u&&u.imageSrcSet?(y+='[imagesrcset="'+Te(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(y+='[imagesizes="'+Te(u.imageSizes)+'"]')):y+='[href="'+Te(s)+'"]';var v=y;switch(o){case"style":v=Jo(s);break;case"script":v=el(s)}Kr.has(v)||(s=m({rel:"preload",href:o==="image"&&u&&u.imageSrcSet?void 0:s,as:o},u),Kr.set(v,s),f.querySelector(y)!==null||o==="style"&&f.querySelector(wc(v))||o==="script"&&f.querySelector(kc(v))||(o=f.createElement("link"),Fn(o,"link",s),Xt(o),f.head.appendChild(o)))}}function w8(s,o){os.m(s,o);var u=Qo;if(u&&s){var f=o&&typeof o.as=="string"?o.as:"script",y='link[rel="modulepreload"][as="'+Te(f)+'"][href="'+Te(s)+'"]',v=y;switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=el(s)}if(!Kr.has(v)&&(s=m({rel:"modulepreload",href:s},o),Kr.set(v,s),u.querySelector(y)===null)){switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(kc(v)))return}f=u.createElement("link"),Fn(f,"link",s),Xt(f),u.head.appendChild(f)}}}function k8(s,o,u){os.S(s,o,u);var f=Qo;if(f&&s){var y=ya(f).hoistableStyles,v=Jo(s);o=o||"default";var C=y.get(v);if(!C){var O={loading:0,preload:null};if(C=f.querySelector(wc(v)))O.loading=5;else{s=m({rel:"stylesheet",href:s,"data-precedence":o},u),(u=Kr.get(v))&&Up(s,u);var $=C=f.createElement("link");Xt($),Fn($,"link",s),$._p=new Promise(function(J,se){$.onload=J,$.onerror=se}),$.addEventListener("load",function(){O.loading|=1}),$.addEventListener("error",function(){O.loading|=2}),O.loading|=4,Dd(C,o,f)}C={type:"stylesheet",instance:C,count:1,state:O},y.set(v,C)}}}function S8(s,o){os.X(s,o);var u=Qo;if(u&&s){var f=ya(u).hoistableScripts,y=el(s),v=f.get(y);v||(v=u.querySelector(kc(y)),v||(s=m({src:s,async:!0},o),(o=Kr.get(y))&&Hp(s,o),v=u.createElement("script"),Xt(v),Fn(v,"link",s),u.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},f.set(y,v))}}function _8(s,o){os.M(s,o);var u=Qo;if(u&&s){var f=ya(u).hoistableScripts,y=el(s),v=f.get(y);v||(v=u.querySelector(kc(y)),v||(s=m({src:s,async:!0,type:"module"},o),(o=Kr.get(y))&&Hp(s,o),v=u.createElement("script"),Xt(v),Fn(v,"link",s),u.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},f.set(y,v))}}function j4(s,o,u,f){var y=(y=bn.current)?Md(y):null;if(!y)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(o=Jo(u.href),u=ya(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=Jo(u.href);var v=ya(y).hoistableStyles,C=v.get(s);if(C||(y=y.ownerDocument||y,C={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(s,C),(v=y.querySelector(wc(s)))&&!v._p&&(C.instance=v,C.state.loading=5),Kr.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},Kr.set(s,u),v||C8(y,s,u,C.state))),o&&f===null)throw Error(r(528,""));return C}if(o&&f!==null)throw Error(r(529,""));return null;case"script":return o=u.async,u=u.src,typeof u=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=el(u),u=ya(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(r(444,s))}}function Jo(s){return'href="'+Te(s)+'"'}function wc(s){return'link[rel="stylesheet"]['+s+"]"}function B4(s){return m({},s,{"data-precedence":s.precedence,precedence:null})}function C8(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),Xt(o),s.head.appendChild(o))}function el(s){return'[src="'+Te(s)+'"]'}function kc(s){return"script[async]"+s}function I4(s,o,u){if(o.count++,o.instance===null)switch(o.type){case"style":var f=s.querySelector('style[data-href~="'+Te(u.href)+'"]');if(f)return o.instance=f,Xt(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"),Xt(f),Fn(f,"style",y),Dd(f,u.precedence,s),o.instance=f;case"stylesheet":y=Jo(u.href);var v=s.querySelector(wc(y));if(v)return o.state.loading|=4,o.instance=v,Xt(v),v;f=B4(u),(y=Kr.get(y))&&Up(f,y),v=(s.ownerDocument||s).createElement("link"),Xt(v);var C=v;return C._p=new Promise(function(O,$){C.onload=O,C.onerror=$}),Fn(v,"link",f),o.state.loading|=4,Dd(v,u.precedence,s),o.instance=v;case"script":return v=el(u.src),(y=s.querySelector(kc(v)))?(o.instance=y,Xt(y),y):(f=u,(y=Kr.get(v))&&(f=m({},u),Hp(f,y)),s=s.ownerDocument||s,y=s.createElement("script"),Xt(y),Fn(y,"link",f),s.head.appendChild(y),o.instance=y);case"void":return null;default:throw Error(r(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(f=o.instance,o.state.loading|=4,Dd(f,u.precedence,s));return o.instance}function Dd(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,C=0;C<f.length;C++){var O=f[C];if(O.dataset.precedence===o)v=O;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 Up(s,o){s.crossOrigin==null&&(s.crossOrigin=o.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=o.referrerPolicy),s.title==null&&(s.title=o.title)}function Hp(s,o){s.crossOrigin==null&&(s.crossOrigin=o.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=o.referrerPolicy),s.integrity==null&&(s.integrity=o.integrity)}var Od=null;function P4(s,o,u){if(Od===null){var f=new Map,y=Od=new Map;y.set(u,f)}else y=Od,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[Ds]||v[kn]||s==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var C=v.getAttribute(o)||"";C=s+C;var O=f.get(C);O?O.push(v):f.set(C,[v])}}return f}function z4(s,o,u){s=s.ownerDocument||s,s.head.insertBefore(u,o==="title"?s.querySelector("head > title"):null)}function E8(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 $4(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function T8(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=Jo(f.href),v=o.querySelector(wc(y));if(v){o=v._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(s.count++,s=Ld.bind(s),o.then(s,s)),u.state.loading|=4,u.instance=v,Xt(v);return}v=o.ownerDocument||o,f=B4(f),(y=Kr.get(y))&&Up(f,y),v=v.createElement("link"),Xt(v);var C=v;C._p=new Promise(function(O,$){C.onload=O,C.onerror=$}),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=Ld.bind(s),o.addEventListener("load",u),o.addEventListener("error",u))}}var Gp=0;function A8(s,o){return s.stylesheets&&s.count===0&&Bd(s,s.stylesheets),0<s.count||0<s.imgCount?function(u){var f=setTimeout(function(){if(s.stylesheets&&Bd(s,s.stylesheets),s.unsuspend){var v=s.unsuspend;s.unsuspend=null,v()}},6e4+o);0<s.imgBytes&&Gp===0&&(Gp=62500*l8());var y=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&Bd(s,s.stylesheets),s.unsuspend)){var v=s.unsuspend;s.unsuspend=null,v()}},(s.imgBytes>Gp?50:800)+o);return s.unsuspend=u,function(){s.unsuspend=null,clearTimeout(f),clearTimeout(y)}}:null}function Ld(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Bd(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var jd=null;function Bd(s,o){s.stylesheets=null,s.unsuspend!==null&&(s.count++,jd=new Map,o.forEach(N8,s),jd=null,Ld.call(s))}function N8(s,o){if(!(o.state.loading&4)){var u=jd.get(s);if(u)var f=u.get(null);else{u=new Map,jd.set(s,u);for(var y=s.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<y.length;v++){var C=y[v];(C.nodeName==="LINK"||C.getAttribute("media")!=="not all")&&(u.set(C.dataset.precedence,C),f=C)}f&&u.set(null,f)}y=o.instance,C=y.getAttribute("data-precedence"),v=u.get(C)||f,v===f&&u.set(null,y),u.set(C,y),this.count++,f=Ld.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 Sc={$$typeof:D,Provider:null,Consumer:null,_currentValue:_e,_currentValue2:_e,_threadCount:0};function R8(s,o,u,f,y,v,C,O,$){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=Ri(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ri(0),this.hiddenUpdates=Ri(null),this.identifierPrefix=f,this.onUncaughtError=y,this.onCaughtError=v,this.onRecoverableError=C,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=$,this.incompleteTransitions=new Map}function F4(s,o,u,f,y,v,C,O,$,J,se,ue){return s=new R8(s,o,u,C,$,J,se,ue,O),o=1,v===!0&&(o|=24),v=Sr(3,null,null,o),s.current=v,v.stateNode=s,o=Sh(),o.refCount++,s.pooledCache=o,o.refCount++,v.memoizedState={element:f,isDehydrated:u,cache:o},Th(v),s}function U4(s){return s?(s=Mo,s):Mo}function H4(s,o,u,f,y,v){y=U4(y),f.context===null?f.context=y:f.pendingContext=y,f=Fs(o),f.payload={element:u},v=v===void 0?null:v,v!==null&&(f.callback=v),u=Us(s,f,o),u!==null&&(fr(u,s,o),tc(u,s,o))}function G4(s,o){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var u=s.retryLane;s.retryLane=u!==0&&u<o?u:o}}function qp(s,o){G4(s,o),(s=s.alternate)&&G4(s,o)}function q4(s){if(s.tag===13||s.tag===31){var o=Pi(s,67108864);o!==null&&fr(o,s,67108864),qp(s,67108864)}}function V4(s){if(s.tag===13||s.tag===31){var o=Ar();o=Ms(o);var u=Pi(s,o);u!==null&&fr(u,s,o),qp(s,o)}}var Id=!0;function M8(s,o,u,f){var y=q.T;q.T=null;var v=ie.p;try{ie.p=2,Vp(s,o,u,f)}finally{ie.p=v,q.T=y}}function D8(s,o,u,f){var y=q.T;q.T=null;var v=ie.p;try{ie.p=8,Vp(s,o,u,f)}finally{ie.p=v,q.T=y}}function Vp(s,o,u,f){if(Id){var y=Wp(f);if(y===null)Dp(s,o,f,Pd,u),K4(s,f);else if(L8(y,s,o,u,f))f.stopPropagation();else if(K4(s,f),o&4&&-1<O8.indexOf(s)){for(;y!==null;){var v=Ha(y);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var C=Fa(v.pendingLanes);if(C!==0){var O=v;for(O.pendingLanes|=2,O.entangledLanes|=2;C;){var $=1<<31-xn(C);O.entanglements[1]|=$,C&=~$}ka(v),(St&6)===0&&(xd=He()+500,yc(0))}}break;case 31:case 13:O=Pi(v,2),O!==null&&fr(O,v,2),kd(),qp(v,2)}if(v=Wp(f),v===null&&Dp(s,o,f,Pd,u),v===y)break;y=v}y!==null&&f.stopPropagation()}else Dp(s,o,f,null,u)}}function Wp(s){return s=Co(s),Kp(s)}var Pd=null;function Kp(s){if(Pd=null,s=Ua(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 Pd=s,null}function W4(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(Ee()){case bt:return 2;case Lt:return 8;case It:case In:return 32;case xe:return 268435456;default:return 32}default:return 32}}var Yp=!1,Js=null,ei=null,ti=null,_c=new Map,Cc=new Map,ni=[],O8="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 K4(s,o){switch(s){case"focusin":case"focusout":Js=null;break;case"dragenter":case"dragleave":ei=null;break;case"mouseover":case"mouseout":ti=null;break;case"pointerover":case"pointerout":_c.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Cc.delete(o.pointerId)}}function Ec(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=Ha(o),o!==null&&q4(o)),s):(s.eventSystemFlags|=f,o=s.targetContainers,y!==null&&o.indexOf(y)===-1&&o.push(y),s)}function L8(s,o,u,f,y){switch(o){case"focusin":return Js=Ec(Js,s,o,u,f,y),!0;case"dragenter":return ei=Ec(ei,s,o,u,f,y),!0;case"mouseover":return ti=Ec(ti,s,o,u,f,y),!0;case"pointerover":var v=y.pointerId;return _c.set(v,Ec(_c.get(v)||null,s,o,u,f,y)),!0;case"gotpointercapture":return v=y.pointerId,Cc.set(v,Ec(Cc.get(v)||null,s,o,u,f,y)),!0}return!1}function Y4(s){var o=Ua(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,Bl(s.priority,function(){V4(u)});return}}else if(o===31){if(o=c(u),o!==null){s.blockedOn=o,Bl(s.priority,function(){V4(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 zd(s){if(s.blockedOn!==null)return!1;for(var o=s.targetContainers;0<o.length;){var u=Wp(s.nativeEvent);if(u===null){u=s.nativeEvent;var f=new u.constructor(u.type,u);wr=f,u.target.dispatchEvent(f),wr=null}else return o=Ha(u),o!==null&&q4(o),s.blockedOn=u,!1;o.shift()}return!0}function Z4(s,o,u){zd(s)&&u.delete(o)}function j8(){Yp=!1,Js!==null&&zd(Js)&&(Js=null),ei!==null&&zd(ei)&&(ei=null),ti!==null&&zd(ti)&&(ti=null),_c.forEach(Z4),Cc.forEach(Z4)}function $d(s,o){s.blockedOn===o&&(s.blockedOn=null,Yp||(Yp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,j8)))}var Fd=null;function X4(s){Fd!==s&&(Fd=s,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Fd===s&&(Fd=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(Kp(f||u)===null)continue;break}var v=Ha(u);v!==null&&(s.splice(o,3),o-=3,Wh(v,{pending:!0,data:y,method:u.method,action:f},f,y))}}))}function tl(s){function o($){return $d($,s)}Js!==null&&$d(Js,s),ei!==null&&$d(ei,s),ti!==null&&$d(ti,s),_c.forEach(o),Cc.forEach(o);for(var u=0;u<ni.length;u++){var f=ni[u];f.blockedOn===s&&(f.blockedOn=null)}for(;0<ni.length&&(u=ni[0],u.blockedOn===null);)Y4(u),u.blockedOn===null&&ni.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],C=y[Sn]||null;if(typeof v=="function")C||X4(u);else if(C){var O=null;if(v&&v.hasAttribute("formAction")){if(y=v,C=v[Sn]||null)O=C.formAction;else if(Kp(y)!==null)continue}else O=C.action;typeof O=="function"?u[f+1]=O:(u.splice(f,3),f-=3),X4(u)}}}function Q4(){function s(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(C){return y=C})},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 Zp(s){this._internalRoot=s}Ud.prototype.render=Zp.prototype.render=function(s){var o=this._internalRoot;if(o===null)throw Error(r(409));var u=o.current,f=Ar();H4(u,f,s,o,null,null)},Ud.prototype.unmount=Zp.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var o=s.containerInfo;H4(s.current,2,null,s,null,null),kd(),o[ia]=null}};function Ud(s){this._internalRoot=s}Ud.prototype.unstable_scheduleHydration=function(s){if(s){var o=Mu();s={blockedOn:null,target:s,priority:o};for(var u=0;u<ni.length&&o!==0&&o<ni[u].priority;u++);ni.splice(u,0,s),u===0&&Y4(s)}};var J4=e.version;if(J4!=="19.2.7")throw Error(r(527,J4,"19.2.7"));ie.findDOMNode=function(s){var o=s._reactInternals;if(o===void 0)throw typeof s.render=="function"?Error(r(188)):(s=Object.keys(s).join(","),Error(r(268,s)));return s=h(o),s=s!==null?p(s):null,s=s===null?null:s.stateNode,s};var B8={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:q,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Hd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Hd.isDisabled&&Hd.supportsFiber)try{Pr=Hd.inject(B8),Mn=Hd}catch{}}return Ac.createRoot=function(s,o){if(!a(s))throw Error(r(299));var u=!1,f="",y=iv,v=ov,C=lv;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&&(C=o.onRecoverableError)),o=F4(s,1,!1,null,null,u,f,null,y,v,C,Q4),s[ia]=o.current,Mp(s),new Zp(o)},Ac.hydrateRoot=function(s,o,u){if(!a(s))throw Error(r(299));var f=!1,y="",v=iv,C=ov,O=lv,$=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&&(C=u.onCaughtError),u.onRecoverableError!==void 0&&(O=u.onRecoverableError),u.formState!==void 0&&($=u.formState)),o=F4(s,1,!0,o,u??null,f,y,$,v,C,O,Q4),o.context=U4(null),u=o.current,f=Ar(),f=Ms(f),y=Fs(f),y.callback=null,Us(u,y,f),u=f,o.current.lanes=u,Rs(o,u),ka(o),s[ia]=o.current,Mp(s),new Ud(o)},Ac.version="19.2.7",Ac}var cx;function Y_(){if(cx)return Jp.exports;cx=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(),Jp.exports=K_(),Jp.exports}var Z_=Y_();const X_=E1(Z_),Q_="modulepreload",J_=function(t){return"/"+t},ux={},j=function(e,n,r){let a=Promise.resolve();if(n&&n.length>0){let l=function(h){return Promise.all(h.map(p=>Promise.resolve(p).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),d=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));a=l(n.map(h=>{if(h=J_(h),h in ux)return;ux[h]=!0;const p=h.endsWith(".css"),m=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${m}`))return;const b=document.createElement("link");if(b.rel=p?"stylesheet":Q_,p||(b.as="script"),b.crossOrigin="",b.href=h,d&&b.setAttribute("nonce",d),document.head.appendChild(b),p)return new Promise((x,w)=>{b.addEventListener("load",x),b.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${h}`)))})}))}function i(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return a.then(l=>{for(const c of l||[])c.status==="rejected"&&i(c.reason);return e().catch(i)})},Ge=t=>typeof t=="string",Nc=()=>{let t,e;const n=new Promise((r,a)=>{t=r,e=a});return n.resolve=t,n.reject=e,n},dx=t=>t==null?"":String(t),e9=(t,e,n)=>{t.forEach(r=>{e[r]&&(n[r]=e[r])})},t9=/###/g,fx=t=>t&&t.includes("###")?t.replace(t9,"."):t,hx=t=>!t||Ge(t),qc=(t,e,n)=>{const r=Ge(e)?e.split("."):e;let a=0;for(;a<r.length-1;){if(hx(t))return{};const i=fx(r[a]);!t[i]&&n&&(t[i]=new n),Object.prototype.hasOwnProperty.call(t,i)?t=t[i]:t={},++a}return hx(t)?{}:{obj:t,k:fx(r[a])}},px=(t,e,n)=>{const{obj:r,k:a}=qc(t,e,Object);if(r!==void 0||e.length===1){r[a]=n;return}let i=e[e.length-1],l=e.slice(0,e.length-1),c=qc(t,l,Object);for(;c.obj===void 0&&l.length;)i=`${l[l.length-1]}.${i}`,l=l.slice(0,l.length-1),c=qc(t,l,Object),c!=null&&c.obj&&typeof c.obj[`${c.k}.${i}`]<"u"&&(c.obj=void 0);c.obj[`${c.k}.${i}`]=n},n9=(t,e,n,r)=>{const{obj:a,k:i}=qc(t,e,Object);a[i]=a[i]||[],a[i].push(n)},D0=(t,e)=>{const{obj:n,k:r}=qc(t,e);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},r9=(t,e,n)=>{const r=D0(t,n);return r!==void 0?r:D0(e,n)},v3=(t,e,n)=>{for(const r in e)r!=="__proto__"&&r!=="constructor"&&(Object.prototype.hasOwnProperty.call(t,r)?Ge(t[r])||t[r]instanceof String||Ge(e[r])||e[r]instanceof String?n&&(t[r]=e[r]):v3(t[r],e[r],n):t[r]=e[r]);return t},ls=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),a9={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"},s9=t=>Ge(t)?t.replace(/[&<>"'\/]/g,e=>a9[e]):t;class i9{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 r=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,r),this.regExpQueue.push(e),r}}const o9=[" ",",","?","!",";"],l9=new i9(20),c9=(t,e,n)=>{e=e||"",n=n||"";const r=o9.filter(l=>!e.includes(l)&&!n.includes(l));if(r.length===0)return!0;const a=l9.getRegExp(`(${r.map(l=>l==="?"?"\\?":l).join("|")})`);let i=!a.test(t);if(!i){const l=t.indexOf(n);l>0&&!a.test(t.substring(0,l))&&(i=!0)}return i},fg=(t,e,n=".")=>{if(!t)return;if(t[e])return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;const r=e.split(n);let a=t;for(let i=0;i<r.length;){if(!a||typeof a!="object")return;let l,c="";for(let d=i;d<r.length;++d)if(d!==i&&(c+=n),c+=r[d],l=a[c],l!==void 0){if(["string","number","boolean"].includes(typeof l)&&d<r.length-1)continue;i+=d-i+1;break}a=l}return a},ru=t=>t==null?void 0:t.replace(/_/g,"-"),u9={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,r;(r=(n=console==null?void 0:console[t])==null?void 0:n.apply)==null||r.call(n,console,e)}};class O0{constructor(e,n={}){this.init(e,n)}init(e,n={}){this.prefix=n.prefix||"i18next:",this.logger=e||u9,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,r,a){return a&&!this.debug?null:(e=e.map(i=>Ge(i)?i.replace(/[\r\n\x00-\x1F\x7F]/g," "):i),Ge(e[0])&&(e[0]=`${r}${this.prefix} ${e[0]}`),this.logger[n](e))}create(e){return new O0(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new O0(this.logger,e)}}var Ra=new O0;class gf{constructor(){this.observers={}}on(e,n){return e.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const a=this.observers[r].get(n)||0;this.observers[r].set(n,a+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 r=(...a)=>{n(...a),this.off(e,r)};return this.on(e,r),this}emit(e,...n){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([a,i])=>{for(let l=0;l<i;l++)a(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([a,i])=>{for(let l=0;l<i;l++)a(e,...n)})}}class mx extends gf{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,r,a={}){var h,p;const i=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,l=a.ignoreJSONStructure!==void 0?a.ignoreJSONStructure:this.options.ignoreJSONStructure;let c;e.includes(".")?c=e.split("."):(c=[e,n],r&&(Array.isArray(r)?c.push(...r):Ge(r)&&i?c.push(...r.split(i)):c.push(r)));const d=D0(this.data,c);return!d&&!n&&!r&&e.includes(".")&&(e=c[0],n=c[1],r=c.slice(2).join(".")),d||!l||!Ge(r)?d:fg((p=(h=this.data)==null?void 0:h[e])==null?void 0:p[n],r,i)}addResource(e,n,r,a,i={silent:!1}){const l=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let c=[e,n];r&&(c=c.concat(l?r.split(l):r)),e.includes(".")&&(c=e.split("."),a=n,n=c[1]),this.addNamespaces(n),px(this.data,c,a),i.silent||this.emit("added",e,n,r,a)}addResources(e,n,r,a={silent:!1}){for(const i in r)(Ge(r[i])||Array.isArray(r[i]))&&this.addResource(e,n,i,r[i],{silent:!0});a.silent||this.emit("added",e,n,r)}addResourceBundle(e,n,r,a,i,l={silent:!1,skipCopy:!1}){let c=[e,n];e.includes(".")&&(c=e.split("."),a=r,r=n,n=c[1]),this.addNamespaces(n);let d=D0(this.data,c)||{};l.skipCopy||(r=JSON.parse(JSON.stringify(r))),a?v3(d,r,i):d={...d,...r},px(this.data,c,d),l.silent||this.emit("added",e,n,r)}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(a=>n[a]&&Object.keys(n[a]).length>0)}toJSON(){return this.data}}var x3={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,n,r,a){return t.forEach(i=>{var l;e=((l=this.processors[i])==null?void 0:l.process(e,n,r,a))??e}),e}};const w3=Symbol("i18next/PATH_KEY");function d9(){const t=[],e=Object.create(null);let n;return e.get=(r,a)=>{var i;return(i=n==null?void 0:n.revoke)==null||i.call(n),a===w3?t:(t.push(a),n=Proxy.revocable(r,e),n.proxy)},Proxy.revocable(Object.create(null),e).proxy}function hl(t,e){const{[w3]:n}=t(d9()),r=(e==null?void 0:e.keySeparator)??".",a=(e==null?void 0:e.nsSeparator)??":",i=(e==null?void 0:e.enableSelector)==="strict";if(n.length>1&&a){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]}${a}${n.slice(1).join(r)}`}return n.join(r)}const nm=t=>!Ge(t)&&typeof t!="boolean"&&typeof t!="number";class L0 extends gf{constructor(e,n={}){super(),e9(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Ra.create("translator"),this.checkedLoadedFor={}}changeLanguage(e){e&&(this.language=e)}exists(e,n={interpolation:{}}){const r={...n};if(e==null)return!1;const a=this.resolve(e,r);if((a==null?void 0:a.res)===void 0)return!1;const i=nm(a.res);return!(r.returnObjects===!1&&i)}extractFromKey(e,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const a=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let i=n.ns||this.options.defaultNS||[];const l=r&&e.includes(r),c=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!c9(e,r,a);if(l&&!c){const d=e.match(this.interpolator.nestingRegexp);if(d&&d.length>0)return{key:e,namespaces:Ge(i)?[i]:i};const h=e.split(r);(r!==a||r===a&&this.options.ns.includes(h[0]))&&(i=h.shift()),e=h.join(a)}return{key:e,namespaces:Ge(i)?[i]:i}}translate(e,n,r){let a=typeof n=="object"?{...n}:n;if(typeof a!="object"&&this.options.overloadTranslationOptionHandler&&(a=this.options.overloadTranslationOptionHandler(arguments)),typeof a=="object"&&(a={...a}),a||(a={}),e==null)return"";typeof e=="function"&&(e=hl(e,{...this.options,...a})),Array.isArray(e)||(e=[String(e)]),e=e.map(he=>typeof he=="function"?hl(he,{...this.options,...a}):String(he));const i=a.returnDetails!==void 0?a.returnDetails:this.options.returnDetails,l=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,{key:c,namespaces:d}=this.extractFromKey(e[e.length-1],a),h=d[d.length-1];let p=a.nsSeparator!==void 0?a.nsSeparator:this.options.nsSeparator;p===void 0&&(p=":");const m=a.lng||this.language,b=a.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((m==null?void 0:m.toLowerCase())==="cimode")return b?i?{res:`${h}${p}${c}`,usedKey:c,exactUsedKey:c,usedLng:m,usedNS:h,usedParams:this.getUsedParamsDetails(a)}:`${h}${p}${c}`:i?{res:c,usedKey:c,exactUsedKey:c,usedLng:m,usedNS:h,usedParams:this.getUsedParamsDetails(a)}:c;const x=this.resolve(e,a);let w=x==null?void 0:x.res;const S=(x==null?void 0:x.usedKey)||c,E=(x==null?void 0:x.exactUsedKey)||c,A=["[object Number]","[object Function]","[object RegExp]"],T=a.joinArrays!==void 0?a.joinArrays:this.options.joinArrays,D=!this.i18nFormat||this.i18nFormat.handleAsObject,M=a.count!==void 0&&!Ge(a.count),B=L0.hasDefaultValue(a),I=M?this.pluralResolver.getSuffix(m,a.count,a):"",U=a.ordinal&&M?this.pluralResolver.getSuffix(m,a.count,{ordinal:!1}):"",W=M&&!a.ordinal&&a.count===0,Y=W&&a[`defaultValue${this.options.pluralSeparator}zero`]||a[`defaultValue${I}`]||a[`defaultValue${U}`]||a.defaultValue;let oe=w;D&&!w&&B&&(oe=Y);const ae=nm(oe),V=Object.prototype.toString.apply(oe);if(D&&oe&&ae&&!A.includes(V)&&!(Ge(T)&&Array.isArray(oe))){if(!a.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const he=this.options.returnedObjectHandler?this.options.returnedObjectHandler(S,oe,{...a,ns:d}):`key '${c} (${this.language})' returned an object instead of string.`;return i?(x.res=he,x.usedParams=this.getUsedParamsDetails(a),x):he}if(l){const he=Array.isArray(oe),ve=he?[]:{},ge=he?E:S;for(const q in oe)if(Object.prototype.hasOwnProperty.call(oe,q)){const ie=`${ge}${l}${q}`;B&&!w?ve[q]=this.translate(ie,{...a,defaultValue:nm(Y)?Y[q]:void 0,joinArrays:!1,ns:d}):ve[q]=this.translate(ie,{...a,joinArrays:!1,ns:d}),ve[q]===ie&&(ve[q]=oe[q])}w=ve}}else if(D&&Ge(T)&&Array.isArray(w))w=w.join(T),w&&(w=this.extendTranslation(w,e,a,r));else{let he=!1,ve=!1;!this.isValidLookup(w)&&B&&(he=!0,w=Y),this.isValidLookup(w)||(ve=!0,w=c);const q=(a.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&ve?void 0:w,ie=B&&Y!==w&&this.options.updateMissing;if(ve||he||ie){if(this.logger.log(ie?"updateKey":"missingKey",m,h,M&&!ie?`${c}${this.pluralResolver.getSuffix(m,a.count,a)}`:c,ie?Y:w),l){const qe=this.resolve(c,{...a,keySeparator:!1});qe&&qe.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 _e=[];const Se=this.languageUtils.getFallbackCodes(this.options.fallbackLng,a.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Se&&Se[0])for(let qe=0;qe<Se.length;qe++)_e.push(Se[qe]);else this.options.saveMissingTo==="all"?_e=this.languageUtils.toResolveHierarchy(a.lng||this.language):_e.push(a.lng||this.language);const Qe=(qe,Ke,Ie)=>{var an;const vt=B&&Ie!==w?Ie:q;this.options.missingKeyHandler?this.options.missingKeyHandler(qe,h,Ke,vt,ie,a):(an=this.backendConnector)!=null&&an.saveMissing&&this.backendConnector.saveMissing(qe,h,Ke,vt,ie,a),this.emit("missingKey",qe,h,Ke,w)};this.options.saveMissing&&(this.options.saveMissingPlurals&&M?_e.forEach(qe=>{const Ke=this.pluralResolver.getSuffixes(qe,a);W&&a[`defaultValue${this.options.pluralSeparator}zero`]&&!Ke.includes(`${this.options.pluralSeparator}zero`)&&Ke.push(`${this.options.pluralSeparator}zero`),Ke.forEach(Ie=>{Qe([qe],c+Ie,a[`defaultValue${Ie}`]||Y)})}):Qe(_e,c,Y))}w=this.extendTranslation(w,e,a,x,r),ve&&w===c&&this.options.appendNamespaceToMissingKey&&(w=`${h}${p}${c}`),(ve||he)&&this.options.parseMissingKeyHandler&&(w=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${h}${p}${c}`:c,he?w:void 0,a))}return i?(x.res=w,x.usedParams=this.getUsedParamsDetails(a),x):w}extendTranslation(e,n,r,a,i){var d,h;if((d=this.i18nFormat)!=null&&d.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||a.usedLng,a.usedNS,a.usedKey,{resolved:a});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const p=Ge(e)&&(((h=r==null?void 0:r.interpolation)==null?void 0:h.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let m;if(p){const x=e.match(this.interpolator.nestingRegexp);m=x&&x.length}let b=r.replace&&!Ge(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(b={...this.options.interpolation.defaultVariables,...b}),e=this.interpolator.interpolate(e,b,r.lng||this.language||a.usedLng,r),p){const x=e.match(this.interpolator.nestingRegexp),w=x&&x.length;m<w&&(r.nest=!1)}!r.lng&&a&&a.res&&(r.lng=this.language||a.usedLng),r.nest!==!1&&(e=this.interpolator.nest(e,(...x)=>(i==null?void 0:i[0])===x[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${x[0]} in key: ${n[0]}`),null):this.translate(...x,n),r)),r.interpolation&&this.interpolator.reset()}const l=r.postProcess||this.options.postProcess,c=Ge(l)?[l]:l;return e!=null&&(c!=null&&c.length)&&r.applyPostProcessor!==!1&&(e=x3.handle(c,e,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...a,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),e}resolve(e,n={}){let r,a,i,l,c;return Ge(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(d=>typeof d=="function"?hl(d,{...this.options,...n}):d)),e.forEach(d=>{if(this.isValidLookup(r))return;const h=this.extractFromKey(d,n),p=h.key;a=p;let m=h.namespaces;this.options.fallbackNS&&(m=m.concat(this.options.fallbackNS));const b=n.count!==void 0&&!Ge(n.count),x=b&&!n.ordinal&&n.count===0,w=n.context!==void 0&&(Ge(n.context)||typeof n.context=="number")&&n.context!=="",S=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);m.forEach(E=>{var A,T;this.isValidLookup(r)||(c=E,!this.checkedLoadedFor[`${S[0]}-${E}`]&&((A=this.utils)!=null&&A.hasLoadedNamespace)&&!((T=this.utils)!=null&&T.hasLoadedNamespace(c))&&(this.checkedLoadedFor[`${S[0]}-${E}`]=!0,this.logger.warn(`key "${a}" 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(D=>{var I;if(this.isValidLookup(r))return;l=D;const M=[p];if((I=this.i18nFormat)!=null&&I.addLookupKeys)this.i18nFormat.addLookupKeys(M,p,D,E,n);else{let U;b&&(U=this.pluralResolver.getSuffix(D,n.count,n));const W=`${this.options.pluralSeparator}zero`,Y=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(b&&(n.ordinal&&U.startsWith(Y)&&M.push(p+U.replace(Y,this.options.pluralSeparator)),M.push(p+U),x&&M.push(p+W)),w){const oe=`${p}${this.options.contextSeparator||"_"}${n.context}`;M.push(oe),b&&(n.ordinal&&U.startsWith(Y)&&M.push(oe+U.replace(Y,this.options.pluralSeparator)),M.push(oe+U),x&&M.push(oe+W))}}let B;for(;B=M.pop();)this.isValidLookup(r)||(i=B,r=this.getResource(D,E,B,n))}))})}),{res:r,usedKey:a,exactUsedKey:i,usedLng:l,usedNS:c}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,n,r,a={}){var i;return(i=this.i18nFormat)!=null&&i.getResource?this.i18nFormat.getResource(e,n,r,a):this.resourceStore.getResource(e,n,r,a)}getUsedParamsDetails(e={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=e.replace&&!Ge(e.replace);let a=r?e.replace:e;if(r&&typeof e.count<"u"&&(a={...a,count:e.count}),this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),!r){a={...a};for(const i of n)delete a[i]}return a}static hasDefaultValue(e){const n="defaultValue";for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&r.startsWith(n)&&e[r]!==void 0)return!0;return!1}}class gx{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Ra.create("languageUtils")}getScriptPartFromCode(e){if(e=ru(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=ru(e),!e||!e.includes("-"))return e;const n=e.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(e){if(Ge(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(r=>{if(n)return;const a=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(a))&&(n=a)}),!n&&this.options.supportedLngs&&e.forEach(r=>{if(n)return;const a=this.getScriptPartFromCode(r);if(this.isSupportedCode(a))return n=a;const i=this.getLanguagePartFromCode(r);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)),Ge(e)&&(e=[e]),Array.isArray(e))return e;if(!n)return e.default||[];let r=e[n];return r||(r=e[this.getScriptPartFromCode(n)]),r||(r=e[this.formatLanguageCode(n)]),r||(r=e[this.getLanguagePartFromCode(n)]),r||(r=e.default),r||[]}toResolveHierarchy(e,n){const r=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],e),a=[],i=l=>{l&&(this.isSupportedCode(l)?a.push(l):this.logger.warn(`rejecting language code not found in supportedLngs: ${l}`))};return Ge(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))):Ge(e)&&i(this.formatLanguageCode(e)),r.forEach(l=>{a.includes(l)||i(this.formatLanguageCode(l))}),a}}const yx={zero:0,one:1,two:2,few:3,many:4,other:5},bx={select:t=>t===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class f9{constructor(e,n={}){this.languageUtils=e,this.options=n,this.logger=Ra.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,n={}){const r=ru(e==="dev"?"en":e),a=n.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:r,type:a});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let l;try{l=new Intl.PluralRules(r,{type:a})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),bx;if(!e.match(/-|_/))return bx;const d=this.languageUtils.getLanguagePartFromCode(e);l=this.getRule(d,n)}return this.pluralRulesCache[i]=l,l}needsPlural(e,n={}){let r=this.getRule(e,n);return r||(r=this.getRule("dev",n)),(r==null?void 0:r.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(e,n,r={}){return this.getSuffixes(e,r).map(a=>`${n}${a}`)}getSuffixes(e,n={}){let r=this.getRule(e,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((a,i)=>yx[a]-yx[i]).map(a=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${a}`):[]}getSuffix(e,n,r={}){const a=this.getRule(e,r);return a?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${a.select(n)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",n,r))}}const vx=(t,e,n,r=".",a=!0)=>{let i=r9(t,e,n);return!i&&a&&Ge(n)&&(i=fg(t,n,r),i===void 0&&(i=fg(e,n,r))),i},h9=t=>t.replace(/\$/g,"$$$$");class xx{constructor(e={}){var n;this.logger=Ra.create("interpolator"),this.options=e,this.format=((n=e==null?void 0:e.interpolation)==null?void 0:n.format)||(r=>r),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:a,prefix:i,prefixEscaped:l,suffix:c,suffixEscaped:d,formatSeparator:h,unescapeSuffix:p,unescapePrefix:m,nestingPrefix:b,nestingPrefixEscaped:x,nestingSuffix:w,nestingSuffixEscaped:S,nestingOptionsSeparator:E,maxReplaces:A,alwaysFormat:T}=e.interpolation;this.escape=n!==void 0?n:s9,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=a!==void 0?a:!1,this.prefix=i?ls(i):l||"{{",this.suffix=c?ls(c):d||"}}",this.formatSeparator=h||",",this.unescapePrefix=p?"":m?ls(m):"-",this.unescapeSuffix=this.unescapePrefix?"":p?ls(p):"",this.nestingPrefix=b?ls(b):x||ls("$t("),this.nestingSuffix=w?ls(w):S||ls(")"),this.nestingOptionsSeparator=E||",",this.maxReplaces=A||1e3,this.alwaysFormat=T!==void 0?T:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(n,r)=>(n==null?void 0:n.source)===r?(n.lastIndex=0,n):new RegExp(r,"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,r,a){var x;let i,l,c;const d=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},h=w=>{if(!w.includes(this.formatSeparator)){const T=vx(n,d,w,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(T,void 0,r,{...a,...n,interpolationkey:w}):T}const S=w.split(this.formatSeparator),E=S.shift().trim(),A=S.join(this.formatSeparator).trim();return this.format(vx(n,d,E,this.options.keySeparator,this.options.ignoreJSONStructure),A,r,{...a,...n,interpolationkey:E})};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 p=(a==null?void 0:a.missingInterpolationHandler)||this.options.missingInterpolationHandler,m=((x=a==null?void 0:a.interpolation)==null?void 0:x.skipOnVariables)!==void 0?a.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=h(S),l===void 0)if(typeof p=="function"){const A=p(e,i,a);l=Ge(A)?A:""}else if(a&&Object.prototype.hasOwnProperty.call(a,S))l="";else if(m){l=i[0];continue}else this.logger.warn(`missed to pass in variable ${S} for interpolating ${e}`),l="";else!Ge(l)&&!this.useRawValueToEscape&&(l=dx(l));const E=w.safeValue(l);if(e=e.replace(i[0],h9(E)),m?(w.regex.lastIndex+=E.length,w.regex.lastIndex-=i[0].length):w.regex.lastIndex=0,c++,c>=this.maxReplaces)break}}),e}nest(e,n,r={}){let a,i,l;const c=(d,h)=>{const p=this.nestingOptionsSeparator;if(!d.includes(p))return d;const m=d.split(new RegExp(`${ls(p)}[ ]*{`));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),h&&(l={...h,...l})}catch(S){return this.logger.warn(`failed parsing options string in nesting for key ${d}`,S),`${d}${p}${b}`}return l.defaultValue&&l.defaultValue.includes(this.prefix)&&delete l.defaultValue,d};for(;a=this.nestingRegexp.exec(e);){let d=[];l={...r},l=l.replace&&!Ge(l.replace)?l.replace:l,l.applyPostProcessor=!1,delete l.defaultValue;const h=/{.*}/s.test(a[1])?a[1].lastIndexOf("}")+1:a[1].indexOf(this.formatSeparator);if(h!==-1&&(d=a[1].slice(h).split(this.formatSeparator).map(p=>p.trim()).filter(Boolean),a[1]=a[1].slice(0,h)),i=n(c.call(this,a[1].trim(),l),l),i&&a[0]===e&&!Ge(i))return i;Ge(i)||(i=dx(i)),i||(this.logger.warn(`missed to resolve ${a[1]} for nesting ${e}`),i=""),d.length&&(i=d.reduce((p,m)=>this.format(p,m,r.lng,{...r,interpolationkey:a[1].trim()}),i.trim())),e=e.replace(a[0],i),this.regexp.lastIndex=0}return e}}const p9=t=>{let e=t.toLowerCase().trim();const n={};if(t.includes("(")){const r=t.split("(");e=r[0].toLowerCase().trim();const a=r[1].slice(0,-1);e==="currency"&&!a.includes(":")?n.currency||(n.currency=a.trim()):e==="relativetime"&&!a.includes(":")?n.range||(n.range=a.trim()):a.split(";").forEach(l=>{if(l){const[c,...d]=l.split(":"),h=d.join(":").trim().replace(/^'+|'+$/g,""),p=c.trim();n[p]||(n[p]=h),h==="false"&&(n[p]=!1),h==="true"&&(n[p]=!0),isNaN(h)||(n[p]=parseInt(h,10))}})}return{formatName:e,formatOptions:n}},wx=t=>{const e={};return(n,r,a)=>{let i=a;a&&a.interpolationkey&&a.formatParams&&a.formatParams[a.interpolationkey]&&a[a.interpolationkey]&&(i={...i,[a.interpolationkey]:void 0});const l=r+JSON.stringify(i);let c=e[l];return c||(c=t(ru(r),a),e[l]=c),c(n)}},m9=t=>(e,n,r)=>t(ru(n),r)(e);class g9{constructor(e={}){this.logger=Ra.create("formatter"),this.options=e,this.init(e)}init(e,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const r=n.cacheInBuiltFormats?wx:m9;this.formats={number:r((a,i)=>{const l=new Intl.NumberFormat(a,{...i});return c=>l.format(c)}),currency:r((a,i)=>{const l=new Intl.NumberFormat(a,{...i,style:"currency"});return c=>l.format(c)}),datetime:r((a,i)=>{const l=new Intl.DateTimeFormat(a,{...i});return c=>l.format(c)}),relativetime:r((a,i)=>{const l=new Intl.RelativeTimeFormat(a,{...i});return c=>l.format(c,i.range||"day")}),list:r((a,i)=>{const l=new Intl.ListFormat(a,{...i});return c=>l.format(c)})}}add(e,n){this.formats[e.toLowerCase().trim()]=n}addCached(e,n){this.formats[e.toLowerCase().trim()]=wx(n)}format(e,n,r,a={}){if(!n||e==null)return e;const i=n.split(this.formatSeparator),l=[];for(let d=0;d<i.length;d++){let h=i[d];for(;h.indexOf("(")>-1&&!h.includes(")")&&d+1<i.length;)h=`${h}${this.formatSeparator}${i[++d]}`;l.push(h)}return l.reduce((d,h)=>{var b;const{formatName:p,formatOptions:m}=p9(h);if(this.formats[p]){let x=d;try{const w=((b=a==null?void 0:a.formatParams)==null?void 0:b[a.interpolationkey])||{},S=w.locale||w.lng||a.locale||a.lng||r;x=this.formats[p](d,S,{...m,...a,...w})}catch(w){this.logger.warn(w)}return x}else this.logger.warn(`there was no format function for ${p}`);return d},e)}}const y9=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class b9 extends gf{constructor(e,n,r,a={}){var i,l;super(),this.backend=e,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=a,this.logger=Ra.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=a.maxParallelReads||10,this.readingCalls=0,this.maxRetries=a.maxRetries>=0?a.maxRetries:5,this.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,this.state={},this.queue=[],(l=(i=this.backend)==null?void 0:i.init)==null||l.call(i,r,a.backend,a)}queueLoad(e,n,r,a){const i={},l={},c={},d={};return e.forEach(h=>{let p=!0;n.forEach(m=>{const b=`${h}|${m}`;!r.reload&&this.store.hasResourceBundle(h,m)?this.state[b]=2:this.state[b]<0||(this.state[b]===1?l[b]===void 0&&(l[b]=!0):(this.state[b]=1,p=!1,l[b]===void 0&&(l[b]=!0),i[b]===void 0&&(i[b]=!0),d[m]===void 0&&(d[m]=!0)))}),p||(c[h]=!0)}),(Object.keys(i).length||Object.keys(l).length)&&this.queue.push({pending:l,pendingCount:Object.keys(l).length,loaded:{},errors:[],callback:a}),{toLoad:Object.keys(i),pending:Object.keys(l),toLoadLanguages:Object.keys(c),toLoadNamespaces:Object.keys(d)}}loaded(e,n,r){const a=e.split("|"),i=a[0],l=a[1];n&&this.emit("failedLoading",i,l,n),!n&&r&&this.store.addResourceBundle(i,l,r,void 0,void 0,{skipCopy:!0}),this.state[e]=n?-1:2,n&&r&&(this.state[e]=0);const c={};this.queue.forEach(d=>{n9(d.loaded,[i],l),y9(d,e),n&&d.errors.push(n),d.pendingCount===0&&!d.done&&(Object.keys(d.loaded).forEach(h=>{c[h]||(c[h]={});const p=d.loaded[h];p.length&&p.forEach(m=>{c[h][m]===void 0&&(c[h][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,r,a=0,i=this.retryTimeout,l){if(!e.length)return l(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:n,fcName:r,tried:a,wait:i,callback:l});return}this.readingCalls++;const c=(h,p)=>{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(h&&p&&a<this.maxRetries){setTimeout(()=>{this.read(e,n,r,a+1,i*2,l)},i);return}l(h,p)},d=this.backend[r].bind(this.backend);if(d.length===2){try{const h=d(e,n);h&&typeof h.then=="function"?h.then(p=>c(null,p)).catch(c):c(null,h)}catch(h){c(h)}return}return d(e,n,c)}prepareLoading(e,n,r={},a){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),a&&a();Ge(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Ge(n)&&(n=[n]);const i=this.queueLoad(e,n,r,a);if(!i.toLoad.length)return i.pending.length||a(),null;i.toLoad.forEach(l=>{this.loadOne(l)})}load(e,n,r){this.prepareLoading(e,n,{},r)}reload(e,n,r){this.prepareLoading(e,n,{reload:!0},r)}loadOne(e,n=""){const r=e.split("|"),a=r[0],i=r[1];this.read(a,i,"read",void 0,void 0,(l,c)=>{l&&this.logger.warn(`${n}loading namespace ${i} for language ${a} failed`,l),!l&&c&&this.logger.log(`${n}loaded namespace ${i} for language ${a}`,c),this.loaded(e,l,c)})}saveMissing(e,n,r,a,i,l={},c=()=>{}){var d,h,p,m,b;if((h=(d=this.services)==null?void 0:d.utils)!=null&&h.hasLoadedNamespace&&!((m=(p=this.services)==null?void 0:p.utils)!=null&&m.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${r}" 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(!(r==null||r==="")){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,r,a,x):S=w(e,n,r,a),S&&typeof S.then=="function"?S.then(E=>c(null,E)).catch(c):c(null,S)}catch(S){c(S)}else w(e,n,r,a,c,x)}!e||!e[0]||this.store.addResource(e[0],n,r,a)}}}const rm=()=>({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]),Ge(t[1])&&(e.defaultValue=t[1]),Ge(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const n=t[3]||t[2];Object.keys(n).forEach(r=>{e[r]=n[r]})}return e},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),kx=t=>(Ge(t.ns)&&(t.ns=[t.ns]),Ge(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),Ge(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&!t.supportedLngs.includes("cimode")&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t),qd=()=>{},v9=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(n=>{typeof t[n]=="function"&&(t[n]=t[n].bind(t))})};class Vc extends gf{constructor(e={},n){if(super(),this.options=kx(e),this.services={},this.logger=Ra,this.modules={external:[]},v9(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&&(Ge(e.ns)?e.defaultNS=e.ns:e.ns.includes("translation")||(e.defaultNS=e.ns[0]));const r=rm();this.options={...r,...this.options,...kx(e)},this.options.interpolation={...r.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=r.overloadTranslationOptionHandler);const a=h=>h?typeof h=="function"?new h:h:null;if(!this.options.isClone){this.modules.logger?Ra.init(a(this.modules.logger),this.options):Ra.init(null,this.options);let h;this.modules.formatter?h=this.modules.formatter:h=g9;const p=new gx(this.options);this.store=new mx(this.options.resources,this.options);const m=this.services;m.logger=Ra,m.resourceStore=this.store,m.languageUtils=p,m.pluralResolver=new f9(p,{prepend:this.options.pluralSeparator}),h&&(m.formatter=a(h),m.formatter.init&&m.formatter.init(m,this.options),this.options.interpolation.format=m.formatter.format.bind(m.formatter)),m.interpolator=new xx(this.options),m.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},m.backendConnector=new b9(a(this.modules.backend),m.resourceStore,m,this.options),m.backendConnector.on("*",(b,...x)=>{this.emit(b,...x)}),this.modules.languageDetector&&(m.languageDetector=a(this.modules.languageDetector),m.languageDetector.init&&m.languageDetector.init(m,this.options.detection,this.options)),this.modules.i18nFormat&&(m.i18nFormat=a(this.modules.i18nFormat),m.i18nFormat.init&&m.i18nFormat.init(this)),this.translator=new L0(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 h=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);h.length>0&&h[0]!=="dev"&&(this.options.lng=h[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(h=>{this[h]=(...p)=>this.store[h](...p)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(h=>{this[h]=(...p)=>(this.store[h](...p),this)});const c=Nc(),d=()=>{const h=(p,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(p,m)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return h(null,this.t.bind(this));this.changeLanguage(this.options.lng,h)};return this.options.resources||!this.options.initAsync?d():setTimeout(d,0),c}loadResources(e,n=qd){var i,l;let r=n;const a=Ge(e)?e:this.language;if(typeof e=="function"&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if((a==null?void 0:a.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const c=[],d=h=>{if(!h||h==="cimode")return;this.services.languageUtils.toResolveHierarchy(h).forEach(m=>{m!=="cimode"&&(c.includes(m)||c.push(m))})};a?d(a):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(p=>d(p)),(l=(i=this.options.preload)==null?void 0:i.forEach)==null||l.call(i,h=>d(h)),this.services.backendConnector.load(c,this.options.ns,h=>{!h&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(h)})}else r(null)}reloadResources(e,n,r){const a=Nc();return typeof e=="function"&&(r=e,e=void 0),typeof n=="function"&&(r=n,n=void 0),e||(e=this.languages),n||(n=this.options.ns),r||(r=qd),this.services.backendConnector.reload(e,n,i=>{a.resolve(),r(i)}),a}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"&&x3.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 r=this.languages[n];if(!["cimode","dev"].includes(r)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;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 r=Nc();this.emit("languageChanging",e);const a=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&&(a(d),this.translator.changeLanguage(d),this.isLanguageChangingTo=void 0,this.emit("languageChanged",d),this.logger.log("languageChanged",d)):this.isLanguageChangingTo=void 0,r.resolve((...h)=>this.t(...h)),n&&n(c,(...h)=>this.t(...h))},l=c=>{var p,m;!e&&!c&&this.services.languageDetector&&(c=[]);const d=Ge(c)?c:c&&c[0],h=this.store.hasLanguageSomeTranslations(d)?d:this.services.languageUtils.getBestMatchFromCodes(Ge(c)?[c]:c);h&&(this.language||a(h),this.translator.language||this.translator.changeLanguage(h),(m=(p=this.services.languageDetector)==null?void 0:p.cacheUserLanguage)==null||m.call(p,h)),this.loadResources(h,b=>{i(b,h)})};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),r}getFixedT(e,n,r,a){const i=a==null?void 0:a.scopeNs,l=(c,d,...h)=>{let p;typeof d!="object"?p=this.options.overloadTranslationOptionHandler([c,d].concat(h)):p={...d},p.lng=p.lng||l.lng,p.lngs=p.lngs||l.lngs;const m=p.ns!==void 0&&p.ns!==null;p.ns=p.ns||l.ns,p.keyPrefix!==""&&(p.keyPrefix=p.keyPrefix||r||l.keyPrefix);const b={...this.options,...p};Array.isArray(i)&&!m&&(b.ns=i),typeof p.keyPrefix=="function"&&(p.keyPrefix=hl(p.keyPrefix,b));const x=this.options.keySeparator||".";let w;return p.keyPrefix&&Array.isArray(c)?w=c.map(S=>(typeof S=="function"&&(S=hl(S,b)),`${p.keyPrefix}${x}${S}`)):(typeof c=="function"&&(c=hl(c,b)),w=p.keyPrefix?`${p.keyPrefix}${x}${c}`:c),this.t(w,p)};return Ge(e)?l.lng=e:l.lngs=e,l.ns=n,l.keyPrefix=r,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 r=n.lng||this.resolvedLanguage||this.languages[0],a=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const l=(c,d)=>{const h=this.services.backendConnector.state[`${c}|${d}`];return h===-1||h===0||h===2};if(n.precheck){const c=n.precheck(this,l);if(c!==void 0)return c}return!!(this.hasResourceBundle(r,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||l(r,e)&&(!a||l(i,e)))}loadNamespaces(e,n){const r=Nc();return this.options.ns?(Ge(e)&&(e=[e]),e.forEach(a=>{this.options.ns.includes(a)||this.options.ns.push(a)}),this.loadResources(a=>{r.resolve(),n&&n(a)}),r):(n&&n(),Promise.resolve())}loadLanguages(e,n){const r=Nc();Ge(e)&&(e=[e]);const a=this.options.preload||[],i=e.filter(l=>!a.includes(l)&&this.services.languageUtils.isSupportedCode(l));return i.length?(this.options.preload=a.concat(i),this.loadResources(l=>{r.resolve(),n&&n(l)}),r):(n&&n(),Promise.resolve())}dir(e){var a,i;if(e||(e=this.resolvedLanguage||(((a=this.languages)==null?void 0:a.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"],r=((i=this.services)==null?void 0:i.languageUtils)||new gx(rm());return e.toLowerCase().indexOf("-latn")>1?"ltr":n.includes(r.getLanguagePartFromCode(e))||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},n){const r=new Vc(e,n);return r.createInstance=Vc.createInstance,r}cloneInstance(e={},n=qd){const r=e.forkResourceStore;r&&delete e.forkResourceStore;const a={...this.options,...e,isClone:!0},i=new Vc(a);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)},r){const c=Object.keys(this.store.data).reduce((d,h)=>(d[h]={...this.store.data[h]},d[h]=Object.keys(d[h]).reduce((p,m)=>(p[m]={...d[h][m]},p),d[h]),d),{});i.store=new mx(c,a),i.services.resourceStore=i.store}if(e.interpolation){const d={...rm().interpolation,...this.options.interpolation,...e.interpolation},h={...a,interpolation:d};i.services.interpolator=new xx(h)}return i.translator=new L0(i.services,a),i.translator.on("*",(c,...d)=>{i.emit(c,...d)}),i.init(a,n),i.translator.options=a,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 rn=Vc.createInstance();rn.createInstance;rn.dir;rn.init;rn.loadResources;rn.reloadResources;rn.use;rn.changeLanguage;rn.getFixedT;rn.t;rn.exists;rn.setDefaultNamespace;rn.hasLoadedNamespace;rn.loadNamespaces;rn.loadLanguages;const x9=(t,e,n,r)=>{var i,l,c,d;const a=[n,{code:e,...r||{}}];if((l=(i=t==null?void 0:t.services)==null?void 0:i.logger)!=null&&l.forward)return t.services.logger.forward(a,"warn","react-i18next::",!0);go(a[0])&&(a[0]=`react-i18next:: ${a[0]}`),(d=(c=t==null?void 0:t.services)==null?void 0:c.logger)!=null&&d.warn?t.services.logger.warn(...a):console!=null&&console.warn&&console.warn(...a)},Sx={},hg=(t,e,n,r)=>{go(n)&&Sx[n]||(go(n)&&(Sx[n]=new Date),x9(t,e,n,r))},k3=(t,e)=>()=>{if(t.isInitialized)e();else{const n=()=>{setTimeout(()=>{t.off("initialized",n)},0),e()};t.on("initialized",n)}},pg=(t,e,n)=>{t.loadNamespaces(e,k3(t,n))},_x=(t,e,n,r)=>{if(go(n)&&(n=[n]),t.options.preload&&t.options.preload.indexOf(e)>-1)return pg(t,n,r);n.forEach(a=>{t.options.ns.indexOf(a)<0&&t.options.ns.push(a)}),t.loadLanguages(e,k3(t,r))},w9=(t,e,n={})=>!e.languages||!e.languages.length?(hg(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(t,{lng:n.lng,precheck:(r,a)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!a(r.isLanguageChangingTo,t))return!1}}),go=t=>typeof t=="string",k9=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,_9={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},C9=t=>_9[t],E9=t=>t.replace(S9,C9);let mg={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:E9,transDefaultProps:void 0};const T9=(t={})=>{mg={...mg,...t}},A9=()=>mg;let S3;const N9=t=>{S3=t},R9=()=>S3,M9={type:"3rdParty",init(t){T9(t.options.react),N9(t)}},D9=N.createContext();class O9{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var L9=q_();const j9=(t,e)=>{if(go(e))return e;if(k9(e)&&go(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:j9,ready:!1},I9=()=>()=>{},tt=(t,e={})=>{var Y,oe,ae;const{i18n:n}=e,{i18n:r,defaultNS:a}=N.useContext(D9)||{},i=n||r||R9();i&&!i.reportNamespaces&&(i.reportNamespaces=new O9),i||hg(i,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const l=N.useMemo(()=>{var V;return{...A9(),...(V=i==null?void 0:i.options)==null?void 0:V.react,...e}},[i,e]),{useSuspense:c,keyPrefix:d}=l,h=t||a||((Y=i==null?void 0:i.options)==null?void 0:Y.defaultNS),p=go(h)?[h]:h||["translation"],m=N.useMemo(()=>p,p);(ae=(oe=i==null?void 0:i.reportNamespaces)==null?void 0:oe.addUsedNamespaces)==null||ae.call(oe,m);const b=N.useRef(0),x=N.useCallback(V=>{if(!i)return I9;const{bindI18n:he,bindI18nStore:ve}=l,ge=()=>{b.current+=1,V()};return he&&i.on(he,ge),ve&&i.store.on(ve,ge),()=>{he&&he.split(" ").forEach(q=>i.off(q,ge)),ve&&ve.split(" ").forEach(q=>i.store.off(q,ge))}},[i,l]),w=N.useRef(),S=N.useCallback(()=>{if(!i)return B9;const V=!!(i.isInitialized||i.initializedStoreOnce)&&m.every(_e=>w9(_e,i,l)),he=e.lng||i.language,ve=b.current,ge=w.current;if(ge&&ge.ready===V&&ge.lng===he&&ge.keyPrefix===d&&ge.revision===ve)return ge;const ie={t:i.getFixedT(he,l.nsMode==="fallback"?m:m[0],d,{scopeNs:m}),ready:V,lng:he,keyPrefix:d,revision:ve};return w.current=ie,ie},[i,m,d,l,e.lng]),[E,A]=N.useState(0),{t:T,ready:D}=L9.useSyncExternalStore(x,S,S);N.useEffect(()=>{if(i&&!D&&!c){const V=()=>A(he=>he+1);e.lng?_x(i,e.lng,m,V):pg(i,m,V)}},[i,e.lng,m,D,c,E]);const M=i||{},B=N.useRef(null),I=N.useRef(),U=V=>{const he=Object.getOwnPropertyDescriptors(V);he.__original&&delete he.__original;const ve=Object.create(Object.getPrototypeOf(V),he);if(!Object.prototype.hasOwnProperty.call(ve,"__original"))try{Object.defineProperty(ve,"__original",{value:V,writable:!1,enumerable:!1,configurable:!1})}catch{}return ve},W=N.useMemo(()=>{const V=M,he=V==null?void 0:V.language;let ve=V;V&&(B.current&&B.current.__original===V?I.current!==he?(ve=U(V),B.current=ve,I.current=he):ve=B.current:(ve=U(V),B.current=ve,I.current=he));const ge=!D&&!c?(...ie)=>(hg(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(...ie)):T,q=[ge,ve,D];return q.t=ge,q.i18n=ve,q.ready=D,q},[T,M,D,M.resolvedLanguage,M.language,M.languages]);if(i&&c&&!D)throw new Promise(V=>{const he=()=>V();e.lng?_x(i,e.lng,m,he):pg(i,m,he)});return W},P9={};function z9(t,e){let n;try{n=t()}catch{return}return{getItem:a=>{var i;const l=d=>d===null?null:JSON.parse(d,void 0),c=(i=n.getItem(a))!=null?i:null;return c instanceof Promise?c.then(l):l(c)},setItem:(a,i)=>n.setItem(a,JSON.stringify(i,void 0)),removeItem:a=>n.removeItem(a)}}const au=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(r){return au(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return au(r)(n)}}}},$9=(t,e)=>(n,r,a)=>{let i={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:E=>E,version:0,merge:(E,A)=>({...A,...E}),...e},l=!1;const c=new Set,d=new Set;let h;try{h=i.getStorage()}catch{}if(!h)return t((...E)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...E)},r,a);const p=au(i.serialize),m=()=>{const E=i.partialize({...r()});let A;const T=p({state:E,version:i.version}).then(D=>h.setItem(i.name,D)).catch(D=>{A=D});if(A)throw A;return T},b=a.setState;a.setState=(E,A)=>{b(E,A),m()};const x=t((...E)=>{n(...E),m()},r,a);let w;const S=()=>{var E;if(!h)return;l=!1,c.forEach(T=>T(r()));const A=((E=i.onRehydrateStorage)==null?void 0:E.call(i,r()))||void 0;return au(h.getItem.bind(h))(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 D;return w=i.merge(T,(D=r())!=null?D:x),n(w,!0),m()}).then(()=>{A==null||A(w,void 0),l=!0,d.forEach(T=>T(w))}).catch(T=>{A==null||A(void 0,T)})};return a.persist={setOptions:E=>{i={...i,...E},E.getStorage&&(h=E.getStorage())},clearStorage:()=>{h==null||h.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>S(),hasHydrated:()=>l,onHydrate:E=>(c.add(E),()=>{c.delete(E)}),onFinishHydration:E=>(d.add(E),()=>{d.delete(E)})},S(),w||x},F9=(t,e)=>(n,r,a)=>{let i={storage:z9(()=>localStorage),partialize:S=>S,version:0,merge:(S,E)=>({...E,...S}),...e},l=!1;const c=new Set,d=new Set;let h=i.storage;if(!h)return t((...S)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...S)},r,a);const p=()=>{const S=i.partialize({...r()});return h.setItem(i.name,{state:S,version:i.version})},m=a.setState;a.setState=(S,E)=>{m(S,E),p()};const b=t((...S)=>{n(...S),p()},r,a);a.getInitialState=()=>b;let x;const w=()=>{var S,E;if(!h)return;l=!1,c.forEach(T=>{var D;return T((D=r())!=null?D:b)});const A=((E=i.onRehydrateStorage)==null?void 0:E.call(i,(S=r())!=null?S:b))||void 0;return au(h.getItem.bind(h))(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 D;const[M,B]=T;if(x=i.merge(B,(D=r())!=null?D:b),n(x,!0),M)return p()}).then(()=>{A==null||A(x,void 0),x=r(),l=!0,d.forEach(T=>T(x))}).catch(T=>{A==null||A(void 0,T)})};return a.persist={setOptions:S=>{i={...i,...S},S.storage&&(h=S.storage)},clearStorage:()=>{h==null||h.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},U9=(t,e)=>"getStorage"in e||"serialize"in e||"deserialize"in e?((P9?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),$9(t,e)):F9(t,e),Ti=U9;let Cx=!1;function Oa(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():(Cx||(Cx=!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 H9=4e3,oo=new Map;function Ex(t,e){const n=oo.get(t);n&&clearTimeout(n),!(e<=0)&&oo.set(t,setTimeout(()=>{oo.delete(t),ys.setState(r=>({toasts:r.toasts.filter(a=>a.id!==t)}))},e))}const ys=gn(t=>({toasts:[],addToast:(e,n,r)=>{const a=r??H9;t(i=>{const l=i.toasts.find(h=>h.type===e&&h.message===n);if(l)return Ex(l.id,a),{toasts:i.toasts.map(h=>h.id===l.id?{...h,count:h.count+1,createdAt:Date.now()}:h)};const c=`toast-${Date.now()}-${Math.random().toString(36).slice(2,7)}`;Ex(c,a);const d={id:c,type:e,message:n,duration:a,createdAt:Date.now(),count:1};return{toasts:[...i.toasts,d].slice(-10)}})},dismissToast:e=>{const n=oo.get(e);n&&(clearTimeout(n),oo.delete(e)),t(r=>({toasts:r.toasts.filter(a=>a.id!==e)}))},clearAll:()=>{for(const e of oo.values())clearTimeout(e);oo.clear(),t({toasts:[]})}})),mt={info:(t,e)=>ys.getState().addToast("info",t,e),success:(t,e)=>ys.getState().addToast("success",t,e),warning:(t,e)=>ys.getState().addToast("warning",t,e),error:(t,e)=>ys.getState().addToast("error",t,e??6e3)};function w0(t){return!!t&&t.type==="user"&&!t.shellRun&&!t.deleted}function vF(t){return!!t&&t.type==="user"&&!!t.shellRun}const ul=24;function k0(t){if(t.preview){const a=String(t.preview).replace(/\s+/g," ").trim();return a.length>ul?a.slice(0,ul)+"…":a}const e=Be.getState().getMessages(t.id);if(!e||e.length===0)return"";const n=e.find(a=>w0(a))||e.find(a=>!a.deleted)||e[0],r=String((n==null?void 0:n.content)||"").replace(/\s+/g," ").trim();return r?r.length>ul?r.slice(0,ul)+"…":r:""}function _3(t,e){if(!e)return!1;const n=t.replace(/\s+/g," ").replace(/\.\.\.$/,"");return n?!e.startsWith(n):!0}const G9=3e4;function L1(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 p;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 h=Date.now();if(h-e>G9){e=h;const m=new Error(`localStorage 配额已满或不可用(${t.key}),已降级为仅内存持久化,刷新页面将丢失部分历史。`);console.warn(`[${t.key}] 持久化失败:`,m);try{(p=t.onFailure)==null||p.call(t,m)}catch{}}},removeItem:l=>{try{localStorage.removeItem(l)}catch{}}}}const gg=6,C3=50,Tx=50;let Ax=0,Nx=0;function q9(){const t=Date.now();t!==Nx&&(Nx=t,Ax=0);const e=(++Ax).toString(36),n=Math.random().toString(36).slice(2,6);return`s_${t.toString(36)}${e}${n}`}const V9=100,Rc=2e3,Mc=(t,e)=>t&&(t.length>e?`${t.slice(0,e)}…`:t),E3=t=>{const{logs:e,...n}=t;return{...n,description:Mc(n.description,Rc),result:Mc(n.result,Rc),error:Mc(n.error,Rc),stepPrompt:Mc(n.stepPrompt,Rc),context:n.context?Object.fromEntries(Object.entries(n.context).map(([r,a])=>[r,Mc(a,Rc)??""])):void 0,children:n.children?n.children.map(E3):void 0}},S0=t=>[...t].sort((e,n)=>(n.lastActiveAt??n.createdAt??0)-(e.lastActiveAt??e.createdAt??0));function am(t,e){const n=new Set(t.map(c=>c.id)),r=[],a=new Set,i=Math.max(0,C3-t.length);let l=0;for(const c of S0(e)){if(n.has(c.id)){r.push(c);continue}if(l>=i){a.add(c.id);continue}r.push(c),l++}return{history:r,droppedIds:a}}function Rx(t,e,n,r){return r.size===0?{sessions:t,tasksBySession:e,sessionWorkspaceDirs:n}:{sessions:t.filter(a=>!r.has(a.id)),tasksBySession:Object.fromEntries(Object.entries(e).filter(([a])=>!r.has(a))),sessionWorkspaceDirs:Object.fromEntries(Object.entries(n).filter(([a])=>!r.has(a)))}}const Fe=gn()(Ti((t,e)=>({sessions:[],activeSessionId:null,sessionTabs:[],layout:"single",sessionWorkspaceDirs:{},tasksBySession:{},historySessions:[],addSession:n=>t(r=>({sessions:[n,...r.sessions].slice(0,Tx),activeSessionId:n.id})),removeSession:n=>t(r=>{var a;return{sessions:r.sessions.filter(i=>i.id!==n),activeSessionId:r.activeSessionId===n?((a=r.sessions[0])==null?void 0:a.id)||null:r.activeSessionId}}),updateSession:(n,r)=>t(a=>({sessions:a.sessions.map(i=>i.id===n?{...i,...r}:i)})),setActiveSession:n=>t({activeSessionId:n}),setSessionWorkspaceDir:(n,r)=>t(a=>({sessionWorkspaceDirs:{...a.sessionWorkspaceDirs,[n]:r}})),getSessionWorkspaceDir:n=>e().sessionWorkspaceDirs[n]||"",addSessionTab:(n,r,a)=>{const i=e();if(i.sessionTabs.length>=gg){const S=i.sessionTabs.reduce((E,A)=>E.createdAt<A.createdAt?E:A);e().closeSessionTab(S.id)}const l=a||q9(),c=r&&r.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"},h={id:l,title:n||`对话 ${i.sessionTabs.length+1}`,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),messageCount:0},p={...i.sessionWorkspaceDirs};r&&(p[l]=r);const m={...i.tasksBySession};m[l]||(m[l]=[]);const b=S0([d,...i.sessionTabs]),x=am(b,[d,...i.historySessions.filter(S=>S.id!==l)]),w=Rx([...i.sessions,h].slice(-Tx),m,p,x.droppedIds);return t({sessionTabs:b,sessions:w.sessions,sessionWorkspaceDirs:w.sessionWorkspaceDirs,tasksBySession:w.tasksBySession,activeSessionId:l,historySessions:x.history}),l},closeSessionTab:n=>{var p;const r=e(),a=r.sessionTabs.find(m=>m.id===n),i=r.sessionTabs.filter(m=>m.id!==n);if(i.length===0)return;let l=r.historySessions;a&&(l=[a,...l.filter(m=>m.id!==n)]);const c=am(i,l),d=Rx(r.sessions,r.tasksBySession,r.sessionWorkspaceDirs,c.droppedIds),h=i[i.length-1];t({sessionTabs:i,historySessions:c.history,sessions:d.sessions,tasksBySession:d.tasksBySession,sessionWorkspaceDirs:d.sessionWorkspaceDirs,activeSessionId:r.activeSessionId===n?h?h.id:((p=i[0])==null?void 0:p.id)||null:r.activeSessionId})},renameSessionTab:(n,r)=>t(a=>({sessionTabs:a.sessionTabs.map(i=>i.id===n?{...i,title:r}:i),sessions:a.sessions.map(i=>i.id===n?{...i,title:r,updatedAt:new Date().toISOString()}:i),historySessions:a.historySessions.map(i=>i.id===n?{...i,title:r}:i)})),getActiveSessionTab:()=>{const n=e();return n.sessionTabs.find(r=>r.id===n.activeSessionId)||null},getVisibleSessionTabs:()=>{const n=e(),r=n.sessionTabs.find(a=>a.id===n.activeSessionId);return r?[r]:n.sessionTabs.slice(0,1)},addSessionTask:(n,r,a,i)=>t(l=>{const c=l.tasksBySession[n]||[],d={id:`session-task-${Date.now()}-${Math.random().toString(36).slice(2,6)}`,title:r.trim(),completed:!1,createdAt:Date.now(),backendId:a,description:i};return{tasksBySession:{...l.tasksBySession,[n]:[...c,d]}}}),toggleSessionTask:(n,r)=>t(a=>{const i=a.tasksBySession[n]||[];return{tasksBySession:{...a.tasksBySession,[n]:i.map(l=>l.id===r?{...l,completed:!l.completed}:l)}}}),removeSessionTask:(n,r)=>t(a=>({tasksBySession:{...a.tasksBySession,[n]:(a.tasksBySession[n]||[]).filter(i=>i.id!==r)}})),updateSessionTask:(n,r,a)=>t(i=>{const l=i.tasksBySession[n]||[];return{tasksBySession:{...i.tasksBySession,[n]:l.map(c=>c.id===r?{...c,title:a.trim()}:c)}}}),getSessionTasks:n=>e().tasksBySession[n]||[],setSessionTasks:(n,r)=>t(a=>({tasksBySession:{...a.tasksBySession,[n]:r}})),updateTaskPlanStatus:(n,r,a)=>t(i=>{const l=i.tasksBySession[n]||[];return{tasksBySession:{...i.tasksBySession,[n]:l.map(c=>c.id===r?{...c,...a}:c)}}}),autoNameSession:(n,r)=>{const i=e().sessionTabs.find(d=>d.id===n);if(!i||!/^对话 \d+$/.test(i.title))return;const l=r.replace(/\s+/g," ").trim(),c=l.slice(0,20)+(l.length>20?"...":"");c&&e().renameSessionTab(n,c)},updateSessionStatus:(n,r)=>t(a=>({sessionTabs:a.sessionTabs.map(i=>i.id===n?{...i,status:r}:i)})),touchSession:(n,r)=>t(a=>{const i=Date.now();let l;if(r){const d=r.replace(/\s+/g," ").trim();l=d.length>ul?d.slice(0,ul)+"…":d}const c=d=>({...d,lastActiveAt:i,...l&&!d.preview?{preview:l}:{}});return{sessionTabs:S0(a.sessionTabs.map(d=>d.id===n?c(d):d)),sessions:a.sessions.map(d=>d.id===n?{...d,updatedAt:new Date(i).toISOString()}:d),historySessions:a.historySessions.map(d=>d.id===n?c(d):d)}}),getHistorySessions:()=>e().historySessions,restoreHistorySession:n=>{const r=e(),a=r.historySessions.find(d=>d.id===n);if(!a)return;const i=r.historySessions.filter(d=>d.id!==n);if(r.sessionTabs.some(d=>d.id===n)){t({historySessions:i,activeSessionId:n});return}let l=r.sessionTabs;if(l.length>=gg){const d=l.reduce((h,p)=>h.createdAt<p.createdAt?h:p);l=l.filter(h=>h.id!==d.id),i.unshift(d)}const c=S0([a,...l]);t({sessionTabs:c,historySessions:am(c,i).history,activeSessionId:n})},clearHistorySessions:()=>t({historySessions:[]}),removeHistorySession:n=>t(r=>({historySessions:r.historySessions.filter(a=>a.id!==n)}))}),{name:"deepseekcode-session-storage",storage:L1({key:"sessionStore",trims:[t=>({...t,state:{...t.state,tasksBySession:Object.fromEntries(Object.entries(t.state.tasksBySession).map(([e,n])=>[e,n.map(r=>({id:r.id,title:r.title,completed:r.completed,createdAt:r.createdAt,planStatus:r.planStatus,backendId:r.backendId,backendStatus:r.backendStatus,agentType:r.agentType,progress:r.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{ys.getState().addToast("warning","会话数据保存失败:浏览器本地存储已满或不可用。当前数据仅保留在内存中,刷新页面将丢失,建议清理旧会话或导出数据。",8e3)}catch{}}}),partialize:t=>{const e=new Set;for(const a of t.sessionTabs)e.add(a.id);for(const a of t.historySessions)e.add(a.id);t.activeSessionId&&e.add(t.activeSessionId);const n=t.sessions.filter(a=>e.has(a.id)),r={};for(const[a,i]of Object.entries(t.tasksBySession))e.has(a)&&(r[a]=i.slice(0,V9).map(E3));return{sessions:n,sessionTabs:t.sessionTabs,activeSessionId:t.activeSessionId,layout:t.layout,sessionWorkspaceDirs:t.sessionWorkspaceDirs,tasksBySession:r,historySessions:t.historySessions}}})),Mx={bg:"#0d1117",surface:"#161b22",border:"#30363d",text:"#c9d1d9",muted:"#8b949e",accentBlue:"#58a6ff",accentGreen:"#238636",accentRed:"#f85149",accentYellow:"#d29922",accentPurple:"#a855f7"},xF=["off","low","medium","high","extra_high","max"],W9=8,wi=gn()(Ti(t=>({theme:"light",themePresetId:"linear",language:"zh-CN",fontSize:14,streamingEnabled:!0,workspaceDir:"",recentDirs:[],effort:"medium",customTheme:Mx,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:Mx}),setDeveloperView:e=>t({developerView:e}),setWorkspaceDir:e=>t(n=>{const r=e.trim();if(!r)return{workspaceDir:""};const a=[r,...n.recentDirs.filter(i=>i!==r)].slice(0,W9);return{workspaceDir:r,recentDirs:a}}),setEffort:e=>t({effort:e})}),{name:"deepseekcode-settings-storage",version:5,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),n}})),K9={confirm:"确认",cancel:"取消",save:"保存",saving:"保存中...",delete:"删除",close:"关闭",refresh:"刷新",retry:"重试",loading:"加载中...",collapse:"折叠",expand:"展开",collapse_short:"收起",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:"默认"},Y9={chat:"对话",files:"文件",models:"模型",tools:"工具",skills:"技能",templates:"工作流",hooks:"Hooks",agentFlow:"Agent Flow",settings:"设置",logs:"日志",channels:"频道",assistants:"助理",sessions:"会话",groupWorkspace:"工作台",groupConfig:"配置",groupSystem:"系统",collapseSidebar:"收起侧栏",expandSidebar:"展开侧栏",moreOptions:"更多",scheduled:"定时任务",plugins:"插件",mySessions:"我的会话",sessionRunning:"运行中",sessionWaiting:"待确认",sessionFailed:"失败",sessionDone:"已完成",sessionEnded:"已结束",connectors:"连接器",pin:"置顶",unpin:"取消置顶",pinMore:"置顶「更多」",unpinMore:"取消置顶「更多」",clearSessionSearch:"清除会话搜索",searchSessions:"搜索会话",searchSessionsPlaceholder:"搜索会话...",showMoreSessions:"查看更多",collapseGroup:"收起",expandGroup:"展开"},Z9={newSession:"新建会话",forkSession:"复制会话(fork-原名,上下文全带)",forkSessionFailed:"复制会话失败",newSessionInWorkspace:"在此工作目录新建会话",sessionTabs:"此工作目录下的会话",noSessions:"暂无会话",renameSession:"重命名会话",exportMd:"导出为 Markdown",you:"你",thinkingEllipsis:"思考中…",messageRail:"消息导航",messageIndex:"对话索引",backToBottom:"回到最新消息",generatingPlaceholder:"AI 正在生成… 可直接输入,Enter 将排队发送",defaultSessionTitle:"对话 {{n}}",welcome:"欢迎使用 deepseekcode",welcomeDesc:"我可以帮你编写代码、分析项目、自动化任务。试试发送一条消息吧!",suggestionCode:"代码编写",suggestionCodePrompt:"用 Python 实现快速排序,并解释它的时间复杂度",suggestionAnalyze:"代码分析",suggestionAnalyzePrompt:"分析当前项目的目录结构,告诉我它是如何组织的",suggestionAutomate:"自动化任务",suggestionAutomatePrompt:"帮我写一个脚本,自动整理当前目录下的文件",quickCommands:"查看快捷命令",refFiles:"引用文件",inputPlaceholder:"输入消息... Shift+Enter 换行,/ 命令,@ 引用文件,! 执行命令,↑ 历史",charTokens:"{{chars}} 字符 · ~{{tokens}} tokens",nearLimit:"接近上限",shiftEnter:"Shift+Enter 换行",escHint:"回复中可继续输入排队 · Esc 撤销/暂停 · 连按 Esc 终止",bangHint:"! 执行命令",shellRunning:"执行中…",shellExitCode:"退出码 {{code}}",shellNoExitCode:"已结束(无退出码)",shellTimedOut:"已超时终止",shellTruncated:"输出已截断",shellNoOutput:"(无输出)",shellRequestFailed:"执行失败:{{message}}",shellRequestFailedGeneric:"请求失败",queuedCount:"{{count}} 条排队 — 回复结束后自动发送",queuedEscHint:"Esc 撤销",queuedRevoke:"撤销全部排队消息",sendQueuedBtn:"发送(排队)",resume:"恢复",resumeGen:"恢复生成",stop:"终止",stopGen:"终止生成",pause:"暂停",pauseGen:"暂停生成",sendBtn:"发送",voiceInput:"语音输入",voiceListening:"正在聆听...",voiceTranscribing:"识别中...",voiceUnsupported:"当前浏览器不支持语音输入",voiceError:"语音识别出错,请重试",connected:"已连接",disconnected:"未连接",sessionHistory:"会话历史",noHistory:"暂无历史会话",clearHistory:"清空历史",clearHistoryTitle:"清空历史",restoreSession:"点击恢复「{{title}}」",removeFromHistory:"从历史移除",viewAllSessions:"更多会话",allSessions:"全部会话",sessionPickerTitle:"选择会话",clickToOpenSession:"打开会话",workingDir:"工作目录",switchDir:"切换",clickToSwitchDir:"点击切换工作目录",switchDirPrompt:"请输入新的工作目录路径:",addTask:"添加",addTaskPlaceholder:"添加任务...",noTasks:"暂无任务,在上方输入添加",taskBoardDragHint:"下拉展开 · 上推收起 · 点击切换",doubleClickEdit:"双击编辑",deleteTask:"删除任务",backgroundLogs:"后台日志",effort:"推理力度",effortOff:"关闭思考",effortLow:"低",effortMedium:"中",effortHigh:"高",effortExtraHigh:"超高",effortMax:"最高",noWorkspaceDir:"未设置工作目录",recentDirs:"最近记录",noRecentDirs:"暂无最近目录",chooseOtherDir:"选择其他目录…",dirPickerTitle:"选择工作目录",dirPickerEnterPath:"输入完整路径后回车跳转",dirPickerGo:"跳转",dirPickerUp:"上一级",dirPickerNoDirs:"无子目录",dirPickerConfirm:"选择此目录",dirPickerLoadError:"目录读取失败",artifactPanel:"AI 输出物",workspaceTitle:"工作台",workspaceToggle:"切换到工作台",artifactsToggle:"切换到输出物",workspaceHint:"工作台为 AI Agent 工作区:组件按动态布局加载,可响应事件与命令。",artifactEmpty:"暂无输出文件。点击聊天中的文件 / 路径链接即可在右侧预览。",artifactHint:"点击聊天中的文件 / 路径链接即可在右侧预览;拖拽边缘可调整宽度,右上角可最大化",previewInPanel:"预览",backToArtifacts:"返回清单",openInNewTab:"新标签页打开",copyPath:"复制路径",copiedPath:"已复制路径",copyPathFailed:"复制失败",filePreviewHint:"该文件类型不支持内嵌预览,可下载或在新标签页中打开。",outline:"目录",outlineClose:"关闭目录",previewTabPage:"页面",changesTitle:"变更",changesToggle:"切换到变更面板",changesHint:"点击文件查看行级 diff。改动来自 git 工作区,包含 Agent 的写入。",viewAllArtifacts:"查看所有产物 ({{n}})",viewAllChanges:"查看所有变更 ({{n}})",diffRenderCapped:"补丁过长,仅渲染前 {{rendered}} 行(其余 {{dropped}} 行已省略)",previewTabCode:"源码",copySource:"复制源码",closeTab:"关闭",codeRenderError:"代码高亮失败,已降级为纯文本。",sidebarProgress:"进度",sidebarArtifacts:"AI 输出物",sidebarOpen:"打开",sidebarOpenFolder:"打开首个输出文件",sidebarExpandAll:"展开全部",sidebarMaximize:"最大化",sidebarRestore:"恢复大小",previewPopOut:"浮窗预览",sidebarWorking:"正在处理…",sidebarWorkingWithAgents:"正在处理({{n}} 个 Agent 运行中)…",sidebarWorkingToolcalls:"正在处理(已调用 {{n}} 次工具)…",sidebarIdle:"多步骤任务运行时,进度会显示在这里:计划、工具调用、审批与产出文件。",sidebarMoreTasks:"更多任务",sidebarRunningAgents:"{{n}} 个 Agent 运行中",sidebarToolcallsSoFar:"已调用 {{n}} 次工具",tokenPrompt:"提示词",tokenCompletion:"补全",tokenTotal:"总计",tokenRateTitle:"实时输出速率(估算值:CJK ≈1.5 tok/字,其余 ≈0.25 tok/字;provider 不提供逐块 token 数)",totalChars:"总字符数",avgTokens:"平均 token/条",estimatedCost:"预估成本: ${{cost}}",contextTrimming:"上下文裁剪",keepMore:"保留更多",trimMore:"裁剪更多",trimContext:"裁剪上下文 (保留 ~{{n}} 条消息)",currentMessages:"当前 {{n}} 条消息",totalCharsInfo:"· 共 {{n}} 字符",contextManager:"上下文管理",showContext:"显示上下文信息",taskBoard:"任务看板",morePending:"还有 {{n}} 个待处理任务...",moreCompleted:"还有 {{n}} 个已完成任务...",dependencyCount:"🔗 依赖 {{n}} 个任务",contextSuggestions:"展开 ({{n}}条建议)",collapseSuggestions:"收起",toolRequest:"工具请求: ",toolResult:"工具结果: ",memory:"记忆: ",filesCount:"({{n}}文件)",saveTokens:"可节省 ~{{n}}",ignoreSuggestion:"忽略此建议",fileMention:"@ 引用文件",fileMentionSearch:'@ 搜索: "{{query}}"',fileMentionHelp:"↑↓ 选择 · Enter 插入 · Esc 关闭",fileBrowser:"文件浏览器",fileSaved:"文件已保存",fileReadError:"读取文件失败",fileSaveError:"保存失败",fileModified:"● 已修改",selectFilePreview:"选择文件以预览或编辑",kbdHint:"命令面板",clickToSwitchMode:"点击切换模式 (Plan → Goal → Act)",selectModel:"选择模型",clickToSelectModel:"选择模型 / 推理力度",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:"步",stepCountPlural:"步",copyMessage:"复制",regenerate:"重新生成",deleteMessage:"删除消息",historyCount:"{{n}} 条",startChatHint:"请先开始对话",panelTitle:"面板",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:"预算提醒",distAssistantMessages:"助理消息",distToolRequest:"工具请求",distToolResult:"工具结果",distUserMessages:"用户消息",duplicateReads:"⚠️ 重复读取: {{pct}}%",enterInsertMulti:"Enter 插入 · 可连续多选",fileMentionHelpMulti:"↑↓ 选择 · Enter 插入(可连续多选)· Esc 关闭",finishMention:"完成引用",keepPercent:"{{pct}}% 保留",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:"失败",noMatchingFiles:"未找到匹配的文件",searchingFiles:"搜索文件中...",selectedCountShort:"已选 {{n}}",selectedFilesCount:"已选 {{n}} 个文件",tokenDistribution:"Token 分布",unitWan:"万",unitYi:"亿",viewContextDetail:"查看上下文容量详情",loading:"加载中…",applyScopeGlobal:"全局",applyScopeSession:"仅本会话",sessionScopeHint:"仅对当前会话生效,不改变全局默认",saveAsWorkflow:"保存为工作流",workflowLibrary:"工作流"},X9={title:"键盘快捷键",commandPalette:"打开命令面板",clearLogs:"清空日志",help:"显示快捷键帮助",submit:"提交输入",newline:"换行",closeDialog:"关闭弹窗 / 暂停生成",slashCommand:"快捷命令",fileRef:"引用文件",stopGen:"终止生成(连按两次 Esc)",screenshot:"屏幕截图(添加为图片附件)"},Q9={placeholder:"搜索命令或跳转面板...",navGroup:"导航",commandGroup:"命令",empty:"没有匹配的命令",hint:"↑↓ 选择 · Enter 执行 · Esc 关闭",running:"执行中..."},J9={openMenu:"打开菜单",closeMenu:"关闭菜单",close:"关闭",expand:"展开",collapse:"折叠",delete:"删除",remove:"移除",send:"发送消息",newSession:"新建会话",messageInput:"消息输入框",connectionStatus:"连接状态",loading:"加载中",toggleAgentFlow:"切换 Agent 信息流",commandPalette:"命令面板",shortcutsHelp:"快捷键帮助"},eC={mode:"模式",planMode:"Plan 模式 — 只读分析",planModeDesc:"在 Plan 模式下,AI 将使用只读工具分析需求和代码,不会修改任何文件。",planModeHint:"分析完成后,请切换到 Act 模式执行具体实现。",switchToAct:"切换到 Act 模式执行",actMode:"Act 模式",actModeDesc:"在 Act 模式下,AI 可以读取、修改文件并执行命令。",actModeHint:"需要先分析需求?切换到 Plan 模式进行只读探索。",switchToPlan:"切换到 Plan 模式分析",readOnlyMode:"只读模式",planTitle:"Plan Mode:只读探索,不能修改代码",actTitle:"Act Mode:可以读写和执行",switchToPlanMode:"切换到规划模式",switchToActMode:"切换到执行模式",autoMode:"自动模式:自动批准工具调用",goalMode:"Goal 模式",planModeShort:"只读分析与规划,不修改文件",actModeShort:"读写文件并执行命令",goalModeShort:"围绕目标持续推进直到完成",autoApprove:"Auto 自动批准",autoApproveShort:"自动批准所有工具调用",planContent:"Plan 文件内容",analyzing:"正在分析需求...",modePlanTitle:"Plan 模式 — 只读探索",modePlanDesc:"只读模式。AI 只能读取文件和分析代码,不能进行任何修改。分析完成后使用 ExitPlanMode 切换到 Act 模式执行。",modeActTitle:"Act 模式 — 执行",modeActDesc:"读写模式。AI 可以读取、修改文件并执行命令。低风险操作自动放行,高风险操作需要确认。",modeGoalTitle:"Goal 模式 — 目标任务",modeGoalDesc:"面向目标的执行模式。AI 在活跃任务范围内可以读写和执行,超出范围的操作需要确认。",modeNormalTitle:"Normal 模式 — 标准交互",modeNormalDesc:"标准交互模式。所有工具正常使用,写操作和命令执行需要用户确认。",readOnlyBadge:"🔒 只读",autoApproveBadge:"✅ 自动审批",toPlanMode:"切换到 Plan 模式",toActMode:"切换到 Act 模式",modeCycleHint:"模式切换: Plan → Act → Goal 循环,Auto 为独立开关"},tC={title:"更新内容"},nC={title:"设置",searchPlaceholder:"搜索设置...",noResults:"没有匹配的设置项",nav:{general:"通用",appearance:"个性化",voice:"语音服务",models:"模型与 Provider",connectors:"连接器与能力",context:"上下文",configFiles:"配置文件",system:"系统",about:"关于"},groups:{general:"通用",features:"功能",system:"系统"},theme:"主题",themeDark:"🌙 深色",themeLight:"☀️ 浅色",themeAuto:"🔄 自动",themePresets:"主题预设",themePresetLinear:"极简 Linear",themePresetLinearDesc:"中性灰 + 单一强调色 — 极简专业",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:"调整单个颜色以覆盖当前主题预设",customColors:"自定义配色",colorBg:"背景色",colorSurface:"面板色",colorBorder:"边框色",colorText:"文字色",colorMuted:"次要文字",colorAccentBlue:"强调蓝",colorAccentGreen:"强调绿",colorAccentRed:"强调红",colorAccentYellow:"强调黄",colorAccentPurple:"强调紫",resetColors:"重置为默认配色",about:"关于",aboutDesc:"基于 Web 的 AI 编码助手界面",whatsNew:"查看更新内容",language:"语言",languageZh:"中文",languageEn:"English",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 的字段被同名环境变量覆盖,修改环境变量后重启生效"}},rC={title:"模型配置",providerConfig:"Provider 配置",configured:"已配置",notConfigured:"未配置",modelsCount:"{{n}} 个模型 · {{apiType}}",clickToConfig:"点击配置 →",apiKeyHint:"已配置 API Key,输入新 Key 将覆盖旧配置。",apiKeyPlaceholder:"输入新 Key 以覆盖...",apiKeyDefaultPlaceholder:"sk-...",enterApiKey:"请输入 API Key",removeConfirm:'确定要移除 "{{providerKey}}" 的配置吗?这将删除其 API Key 和模型。',loadFailed:"加载模型失败",saveFailed:"保存失败",overallStatus:"总体状态",healthy:"健康",degraded:"降级",abnormal:"异常",healthRate:"健康率",onlineInstances:"在线实例",totalRequests:"总请求数",configuredModels:"已配置模型",addModel:"添加模型",provider_qwen:"通义千问 (Qwen)",provider_glm:"智谱 (GLM)",provider_baichuan:"百川 (Baichuan)",provider_minimax:"MiniMax / 海螺",provider_doubao:"豆包 (Doubao)",provider_hunyuan:"腾讯混元 (Hunyuan)",provider_spark:"讯飞星火 (Spark)",provider_custom:"Custom (自定义)",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:"累计请求",setGlobalDefaultFailed:"设置全局默认失败",setGlobalDefaultTitle:"设为全局默认",setPlanDefaultFailed:"设置 Plan 默认失败",setPlanDefaultTitle:"设为 Plan 默认",unsetPlanDefaultFailed:"取消 Plan 默认失败",unsetPlanDefaultTitle:"取消 Plan 默认(该模式回退到全局默认)",setActDefaultFailed:"设置 Act 默认失败",setActDefaultTitle:"设为 Act 默认",unsetActDefaultFailed:"取消 Act 默认失败",unsetActDefaultTitle:"取消 Act 默认(该模式回退到全局默认)",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 默认",unsetActDefault:"取消 Act 默认",unsetPlanDefault:"取消 Plan 默认",unsetGoalDefault:"取消 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:"全局默认不可取消(当前会话必须有生效模型)"},aC={title:"工具列表",searchTools:"搜索工具...",disabled:"禁用",enabled:"启用",params:"参数",loadFailed:"加载工具失败",noTools:"暂无工具",loading:"加载中...",retry:"重试",refresh:"刷新",all:"全部",invalidData:"服务端返回的工具数据格式异常"},sC={title:"技能管理",list:"技能列表",noSkills:"暂无技能",loadFailed:"加载技能失败",loadFailedFallback:"加载失败",enable:"启用",disable:"禁用",enabled:"已启用",disabled:"已关闭",new:"新建技能",import:"导入",importTitle:"导入技能",edit:"编辑",save:"保存",cancel:"取消",retry:"重试",refresh:"刷新",tags:"标签",none:"无",source:"来源",localSkill:"本地技能",systemPrompt:"系统提示词",selectSkill:"选择一个技能",fieldId:"ID",fieldName:"名称",fieldCategory:"分类",fieldTrigger:"触发词",fieldTools:"所需工具",description:"描述",saving:"保存中",chooseFile:"选择技能文件",importHint:"支持 .skill.md 文件",marketplace:"技能市场",marketplaceDesc:"从远程市场浏览并安装技能",marketplaceTitle:"技能市场",addMarketplace:"添加市场",addMarketplaceTitle:"添加技能市场",marketplaceUrl:"市场地址",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}} 个技能",installedSkills:"已安装技能",addFail:"添加市场失败",installing:"安装中...",adding:"添加中...",marketplaceTab:"技能市场",mineTab:"我的技能",installedTab:"已安装",workshopTab:"技能工坊",workshopHint:"技能提案:从会话/手动生成,审核后一键应用为技能",workshopPropose:"新建提案",workshopName:"技能名 (skill-name) 如 format-json",workshopTrigger:"触发关键词(可选)",workshopDescription:"一句话描述",workshopContent:"技能正文(系统提示 / 工作流指令)",workshopSubmit:"提交提案",workshopApply:"应用",workshopEmpty:"暂无技能提案",workshopFormRequired:"技能名和正文为必填",uninstall:"卸载",uninstallConfirm:"确定卸载已安装技能「{{name}}」?",uninstalling:"卸载中...",uninstallFail:"卸载失败",pagePrev:"上一页",pageNext:"下一页",pageOf:"第 {{page}} / {{total}} 页",emptyInstalled:"还没有已安装的市场技能",emptyInstalledHint:"前往「技能市场」浏览并下载安装",browseMarket:"去市场逛逛",use:"使用",useHint:"使用此技能:将 $技能名 插入输入框,补充任务描述后发送",pickTitle:"选择技能",pickPlaceholder:"搜索技能...",pickEmpty:"没有可用的技能",pickUse:"点击使用"},iC={permissionRequest:"权限申请",hookApproval:"Hook 拦截审批",hookConfirm:"Hook 请求确认",morePending:"还有 {{n}} 项待审批",tool:"工具:",reason:"原因:",needConfirm:"需要用户确认此操作",allow:"允许",deny:"拒绝",allowAlways:"本次会话始终允许",allowAlwaysDesc:"当前会话中不再询问此工具",autoMode:"自动模式",autoModeLabel:"自动模式(全部允许)",autoModeDesc:"自动批准所有 Hook 请求",moreOptions:"更多选项",highRiskWarning:"此操作可能造成不可逆的影响,请仔细确认",mediumRiskConfirm:"请确认此操作为预期行为",alreadyAllowed:"已允许:",alreadyDenied:"已拒绝:",risk_critical:"破坏性操作 - 可能删除数据",risk_critical_cmd:"高危命令 - 包含系统级操作",risk_high_shell:"Shell 命令执行",risk_high_file:"文件写入操作",risk_high_pkg:"包管理操作",risk_git_force:"Git 强制操作",risk_git:"Git 操作",risk_network:"网络请求",risk_low:"只读操作",risk_default:"工具调用",hookConfigTitle:"自定义 Hook 配置说明",hookConfigDesc:"你可以在项目根目录的 .agent/hooks.json 文件中添加或修改 Hook 拦截规则。",hookConfigDetail:"Hook 支持 SHELL(外部脚本)和 HTTP(REST 端点)两种类型,可以在工具执行前(PRE_TOOL_USE)或执行后(POST_TOOL_USE)触发。",hookConfigBuiltin:"内置了 BashSafetyHook(危险命令拦截)、FileWriteAuditHook(文件写入审计)、ToolUsageStatsHook(工具调用统计)三套 Hook。设置 enabled: false 可禁用任意 Hook。",optionAllow:"允许 — 执行此操作",optionAllowHint:"点击或按 Enter 确认",optionDeny:"拒绝 — 取消此操作",optionDenyHint:"点击或按 Esc 取消",optionAllowAlways:"本次会话始终允许",optionAllowAlwaysHint:"不再询问 {{tool}}",optionAllowPathHint:"不再询问该外部路径",timeoutWaitUser:"等待用户输入(无超时)",optionAutoMode:"自动模式 — 全部允许",optionAutoModeHint:"之后所有 Hook 将自动批准",shortcutHint:"快捷键: 1-4 选择 · Enter 允许 · Esc 拒绝",lastItem:"最后一项",modalHint:"请在弹窗中处理此审批请求",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:`合并到现有配置吗?
27
- "确定"=合并 / "取消"=替换`,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:"总规则数"},oC={pending:"等待",thinking:"思考",action:"执行",result:"结果",running:"运行中",error:"错误",completed:"完成",params:"参数"},lC={linesTotal:"… (共 {{n}} 行)",expandAll:"展开全部 ({{n}} 行)",collapse:"收起"},cC={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 查看可用命令"},uC={pageError:"页面出现错误",unknownError:"发生了未知错误,请尝试刷新页面",refreshPage:"刷新页面",genEnded:"生成已结束(工具执行超时或连接中断)",genEndedWs:"生成已结束(连接已断开,回答未能送达;恢复后已自动补发)",genEndedStopped:"已终止(用户停止或发送了新消息)"},dC={backendConnected:"后端已连接",backendDisconnected:"后端连接断开,正在重连...",paused:"已暂停,再按 ESC 终止",terminated:"已终止 (ESC×2)",queueRevoked:"已撤销 {{count}} 条排队消息",terminatedQueued:"已终止,并丢弃 {{count}} 条排队消息",contextCompressed:"上下文压缩: {{original}} → {{compressed}} 条消息, 释放 {{saved}} tokens",errorPrefix:"❌ 错误: {{error}}",uncaughtError:"未捕获错误:",uncaughtRejection:"未捕获的 Promise 拒绝: ",unknownReason:"未知原因",diagnosing:"⏳ 诊断中...",runDiagnostic:"🔍 运行诊断",inspectorOn:"开启检查模式 (Ctrl+Shift+Alt+C)",inspectorOff:"关闭检查模式"},fC={title:"频道助理",loading:"正在加载助理…",loadFailed:"助理列表加载失败",empty:"还没有助理",emptyHint:"启动并配置一个频道后,第一条私信或群内 @ 会自动创建对应的助理",goChannels:"去配置频道",openSession:"打开会话",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:"已中断"}},hC={title:"频道管理",subtitle:"接入外部 IM 平台,通过微信、飞书、钉钉等与 AI 交互",newChannel:"新建频道",editChannel:"编辑频道",table:{name:"频道名称",type:"类型",appId:"App ID",status:"连接状态",enabled:"启用",actions:"操作",emptyHint:"点击右上角「新建频道」接入微信、飞书或钉钉"},status:{connected:"已连接",disconnected:"未连接",connecting:"连接中",error:"错误"},empty:"还没有配置任何频道",emptyHint:"点击「新建频道」添加一个 IM 平台机器人",form:{basicInfo:"基础信息",name:"频道名称",namePlaceholder:"例如:公司群机器人",type:"频道类型",credentials:"凭证信息",appId:"App ID / 企业ID",appIdPlaceholder:"填写应用 AppID",appSecret:"App Secret",appSecretPlaceholder:"填写应用密钥",token:"Token / Bot Token",tokenPlaceholder:"填写机器人 Token",encodingAESKey:"EncodingAESKey",encodingAESKeyPlaceholder:"仅微信需要,可选",enabled:"启用频道",wechatQrHint:"保存后可使用微信扫码登录",feishuWsHint:"飞书使用 WebSocket 连接,自动接收消息",namePlaceholderDev:"例如:研发群机器人",typeLocked:"频道类型创建后不可修改",leaveBlankUnchanged:"留空不修改",leaveBlankMeansUnchanged:"留空表示不修改",appSecretValue:"应用密钥",tokenCallback:"回调校验 Token",optionalShort:"选填",encodingAesOptional:"选填,消息加解密密钥",wechatIlinkHint:"微信 iLink 机器人通过扫码授权,凭证可留空,保存后扫码登录即可。",wechatIlinkHintList:"微信 iLink 机器人通过扫码授权,凭证可留空,保存后在列表点击「扫码登录」。",enabledOffHint:"关闭后停止收发消息"},actions:{scanQr:"扫码",edit:"编辑",delete:"删除",deleteConfirm:"确定要删除此频道?",test:"测试连接",save:"保存频道",cancel:"取消",refresh:"刷新",qrLogin:"扫码登录",deleteConfirmNamed:"确认删除频道「{{name}}」?",deleteConfirmShort:"确认删除该频道?"},errors:{loadFailed:"加载频道列表失败",createFailed:"创建频道失败",updateFailed:"更新频道失败",deleteFailed:"删除频道失败",notFound:"频道未找到",notImplemented:"尚未实现",nameRequired:"频道名称不能为空"},qr:{title:"微信扫码登录",generating:"二维码生成中...",waiting:"请使用微信扫描二维码",scanned:"已扫描,请在手机上确认",confirmed:"登录成功",expired:"二维码已失效",expiredHint:"点击重试重新生成二维码",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:"插件未安装",pluginMissingTip:"该频道类型的插件未安装或未激活,无法启动实例",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}} 已连接",waitingPlugin:"等待安装插件"},categories:{im:"即时通讯",international:"国际主流",eastAsia:"东亚",collaboration:"协作平台",classic:"经典协议",other:"其他",builtin:"内置",plugins:"插件扩展"}},pC={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:"截图失败"},mC={reconnecting:"重连中 {{attempt}}/{{max}}",hint:"正在重新连接后端…"},gC={title:"Full access(自动批准)已开启",desc:"Agent 可不经确认直接编辑文件和执行命令,存在数据丢失风险。",dismiss:"本次关闭",neverShow:"不再显示"},yC={noRepo:"非 Git 仓库",notGitDesc:"当前工作目录不是 Git 仓库,无法展示变更统计。",refresh:"刷新",clean:"工作区干净",branch:"分支",loading:"加载中…",filesChanged:"文件变更",backToList:"返回变更清单",fullFile:"完整文件",changedLines:"仅改动行",binary:"二进制文件,没有可显示的文本差异",noDiff:"该文件没有差异",stagedBadge:"已暂存",untrackedBadge:"新文件"},bC={retry:"重试",details:"详情",modelSettings:"模型设置"},vC={comingSoon:"即将上线"},xC={lspGroup:"语言服务器 (LSP)",mcpGroup:"MCP 服务器",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:"添加"},wC={justNow:"刚刚",minutesAgo:"{{count}}分钟前",hoursAgo:"{{count}}小时前",daysAgo:"{{count}}天前"},kC={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 环境。"}},SC={verb:{researching:"分析代码",coding:"修改代码",validating:"运行验证",summarizing:"整理结果"},title:{withFile:"{{verb}} {{file}}",withCount:"{{verb}} · {{count}} 项"},evidenceMore:"等 {{count}} 项",toolCallCount:"{{count}} 次工具调用",toolNamesMore:"等 {{count}} 个工具",waitingUser:"等待你的回答",blocked:"被阻塞:{{reason}}",paused:"已暂停,可恢复",viewAndAnswer:"查看并回答",evidence:"执行明细",phase:{analysis:"分析",implementation:"实现",optimization:"优化"}},_C={next:"下一步",idle:"空闲"},CC={title:"定时自动化",refresh:"刷新",new:"新建",namePlaceholder:"名称(如:每早 9 点汇总 Git 状态)",instructionsPlaceholder:"指令(agent 每次触发时执行的内容)",cronPlaceholder:"cron(5 段,如 0 9 * * *)",create:"创建",cronDaily9:"每天 9:00",cronWeekday9:"工作日 9:00",cronEvery30Min:"每 30 分钟",empty:"还没有定时自动化。新建一个,让 agent 无人值守干活。",enable:"启用",disable:"停用",runNow:"手动触发",delete:"删除",historyTitle:"运行历史",noRuns:"暂无运行记录",permissionsTitle:"作用域放行(tool target)",permissionsEmpty:"无。未放行的写操作需人工批准,超时后自动拒绝。",permissionPlaceholder:"如:write_file docs/report.md",add:"添加"},EC="定时任务(如每晚跑测试数据)将在这里管理。",TC="插件管理入口。可启停文件处理技能等扩展能力。",AC="功能开发中…",NC={title:"文件浏览器",searchPlaceholder:"搜索...",refresh:"刷新",collapse:"折叠",uploadTo:"上传到 {{dir}}",uploadToRoot:"上传到工作区根目录",setUploadDirHint:"点击设为上传目录并展开",download:"下载",close:"关闭",modified:"已修改",saving:"保存中...",save:"保存",saved:"文件已保存",saveFail:"保存失败",readFail:"读取文件失败",downloadFail:"下载失败",downloadStarted:"已开始下载",uploadedCount:"已上传 {{count}} 个文件",uploadFailedCount:"{{count}} 个文件上传失败",selectFileHint:"选择文件以预览或编辑"},RC={title:"日志",backendLogs:"后台日志",streamTab:"实时日志流",files:"日志文件",clear:"清空",refresh:"刷新",refreshing:"刷新中...",noLogs:"暂无实时日志",noFiles:"暂无日志文件",preview:"预览",download:"下载",backToList:"返回文件列表",emptyFile:"(空文件)",totalLines:"{{count}} 行",showingLatest:"(显示最新 {{count}} 行)"},MC={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 除外)。"},DC={starterTitle:"新工作流",starterNodeTitle:"任务",starterNodeDesc:"描述任务",sourceSaved:"沉淀",sourceScript:"脚本",sourceHandwritten:"手写",roleExplore:"探索",rolePlan:"规划",roleExecute:"执行",roleVerify:"校验",roleSummarize:"总结",roleGeneric:"通用",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:"从左侧选择一个工作流查看 / 编辑",selectTemplateHintSub:"内置预设开箱即用;也可以把一次工作流运行「保存为工作流」沉淀复用。",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:"当前查看中",libraryTitle:"工作流库",newTemplate:"新建工作流",newShort:"新建",searchPlaceholder:"搜索工作流…",paramCount:"{{n}} 参数",viewing:"查看中",view:"查看",launchModalTitle:"回放「{{name}}」",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:"查看",editMode:"编辑",backToView:"返回查看",editMeta:"编辑元信息",replay:"回放",replayWorkflow:"回放",preflight:"预检",preflightCheck:"预检",readonly:"只读",readonlyHint:"回放时不会修改任何文件",writable:"可修改文件",riskLow:"风险:低",riskMedium:"风险:中",riskHigh:"风险:高",confirmCount:"{{n}} 项确认",confirmCountNone:"无需确认",parallelCount:"{{n}} 步({{p}} 并行)",stepCount:"{{n}} 步",permissions:"权限",permissionsSummary:"回放范围声明",allowDuringReplay:"回放时允许",denyDuringReplay:"回放时禁止",toolWhitelist:"工具白名单",noToolsRestriction:"不限制工具(按会话权限)",editMetaTitle:"编辑元信息",exportJson:"导出为模板 JSON",copyId:"复制模板 ID",copied:"已复制",reRecordAsNew:"以此版本重录为新版本",reRecordHint:"不就地回滚:基于 v{{v}} 生成新版本",compare:"比较",forkAsNew:"复制为新工作流",more:"更多",degradedBadge:"剪辑不完整",degradedHint:"部分内容仍是录制时的具体值,建议处理后分享",statusDraft:"草稿",statusReady:"就绪",statusDeprecated:"已弃用",statusArchived:"已归档",overviewTab:"概览",flowTab:"流程",permissionsTab:"权限",historyTab:"历史",inputsNeeded:"回放时需要确认",autoDetected:"自动识别",manualInput:"手动输入",outputsProduced:"回放后得到",noOutputsDeclared:"(未声明产出)",replayDrawerTitle:"回放 {{name}}",replaySummary:"将回放 {{n}} 步(其中 {{p}} 并行)",replayReadonlyLine:"只读,不修改任何文件",replayWritableLine:"可修改文件",replayEstimated:"预计约 {{m}} 分钟",replayStart:"开始回放 →",preflightOk:"可以回放",preflightNodesOk:"{{n}} 个节点,无环",preflightInputsOk:"{{n}} 项输入已解析({{a}} 项来自当前上下文)",preflightPermOk:"权限检查通过",preflightRunning:"预检中…",preflightError:"预检发现问题",edit:"编辑",saveAsWorkflow:"保存为工作流",savingAsWorkflow:"正在保存为工作流…",savedAsWorkflow:"已保存为工作流「{{name}}」(v{{version}})",savedAsWorkflowDegraded:"已保存为工作流「{{name}}」,但剪辑不完整,已原样保存{{reason}}",noRunToSave:"当前会话没有可保存的工作流运行",workflowNoRunFound:"没有可保存的工作流运行",replayNewSession:"回放会新建会话并启动,可在对话中查看进度",roleTooltip:"角色"},OC={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:"已取消",resultPaused:"已暂停",doneNodeCount:"{{done}}/{{total}} 节点",tokensUsedLabel:"{{tokens}} tokens",retriedCount:"重试 {{n}} 次",runEnded:"结束于 {{time}}"},dwf:{offerFallbackTitle:"动态工作流",promotableSentence:"已验证 {{n}} 次,可保存为可复用模板"},agentFlow:{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 中运行(重型出口)"}},LC={drawerCollapseTitle:"折叠抽屉,查看消息",drawerExpandTitle:"展开抽屉,做出选择",openFile:"打开 ›"},jC={viewChat:"会话",viewTrajectory:"轨迹",viewToggleTitle:"切换会话 / 轨迹视图",toolbar:{duration:"时长",actualDuration:"按记录时长显示时间轴块",equalWidth:"按等宽显示时间轴块",turns:"轮次",calls:"调用",collapseTurns:"折叠所有轮次",expandTurns:"展开所有轮次",collapseCalls:"折叠所有工具调用",expandCalls:"展开所有工具调用",search:"搜索轨迹",searchPlaceholder:"搜索轨迹…"}},Dx={common:K9,nav:Y9,chat:Z9,shortcuts:X9,palette:Q9,a11y:J9,plan:eC,whatsnew:tC,settings:nC,models:rC,tools:aC,skills:sC,hook:iC,step:oC,toolCall:lC,slashCommands:cC,error:uC,toast:dC,assistants:fC,channels:hC,fileJob:pC,reconnect:mC,autoAccess:gC,git:yC,errorCard:bC,placeholder:vC,connectors:xC,time:wC,stt:kC,activity:SC,taskbar:_C,automation:CC,placeholderScheduledDesc:EC,placeholderPluginsDesc:TC,featureInProgress:AC,fileTree:NC,logs:RC,plugins:MC,templates:DC,widgets:OC,commonUi:LC,trajectory:jC},BC={confirm:"Confirm",cancel:"Cancel",save:"Save",saving:"Saving...",delete:"Delete",close:"Close",refresh:"Refresh",retry:"Retry",loading:"Loading...",collapse:"Collapse",expand:"Expand",collapse_short:"Collapse",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"},IC={chat:"Chat",files:"Files",models:"Models",tools:"Tools",skills:"Skills",templates:"Workflows",hooks:"Hooks",agentFlow:"Agent Flow",settings:"Settings",logs:"Logs",channels:"Channels",assistants:"Assistants",sessions:"Sessions",groupWorkspace:"Workspace",groupConfig:"Configuration",groupSystem:"System",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"},PC=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","defaultSessionTitle":"Chat {{n}}","welcome":"Welcome to deepseekcode","welcomeDesc":"I can help you write code, analyze projects, and automate tasks. Try sending a message!","suggestionCode":"Code Writing","suggestionCodePrompt":"Implement quicksort in Python and explain its time complexity","suggestionAnalyze":"Code Analysis","suggestionAnalyzePrompt":"Analyze the current project structure and explain how it is organized","suggestionAutomate":"Automation","suggestionAutomatePrompt":"Write a script to organize the files in the current directory","quickCommands":"View quick commands","refFiles":"Reference files","inputPlaceholder":"Type a message... Shift+Enter for newline, / commands, @ file refs, ! shell, ↑ history","charTokens":"{{chars}} chars · ~{{tokens}} tokens","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","sendQueuedBtn":"Send (queued)","resume":"Resume","resumeGen":"Resume generation","stop":"Stop","stopGen":"Stop generation","pause":"Pause","pauseGen":"Pause generation","sendBtn":"Send","voiceInput":"Voice Input","voiceListening":"Listening...","voiceTranscribing":"Transcribing...","voiceUnsupported":"Voice input is not supported in this browser","voiceError":"Voice recognition error, please try again","connected":"Connected","disconnected":"Disconnected","sessionHistory":"Session History","noHistory":"No history sessions","clearHistory":"Clear history","clearHistoryTitle":"Clear history","restoreSession":"Click to restore \\"{{title}}\\"","removeFromHistory":"Remove from history","viewAllSessions":"More sessions","allSessions":"All sessions","sessionPickerTitle":"Select session","clickToOpenSession":"Open session","workingDir":"Working Directory","switchDir":"Switch","clickToSwitchDir":"Click to switch working directory","switchDirPrompt":"Enter new working directory path:","addTask":"Add","addTaskPlaceholder":"Add task...","noTasks":"No tasks, add one above","taskBoardDragHint":"Drag down to expand · drag up to collapse · click to toggle","doubleClickEdit":"Double-click to edit","deleteTask":"Delete task","backgroundLogs":"Background Logs","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","artifactPanel":"AI Outputs","workspaceTitle":"Workspace","workspaceToggle":"Switch to workspace","artifactsToggle":"Switch to outputs","workspaceHint":"AI Agent workspace: components load into a dynamic layout and respond to events and commands.","artifactEmpty":"No output files yet. Click a file/path link in the chat to preview it here.","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","changesToggle":"Switch to changes panel","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.","sidebarProgress":"Progress","sidebarArtifacts":"AI Outputs","sidebarOpen":"Open","sidebarOpenFolder":"Open first output file","sidebarExpandAll":"Expand all","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.","sidebarMoreTasks":"more tasks","sidebarRunningAgents":"{{n}} agent(s) running","sidebarToolcallsSoFar":"{{n}} tool call(s) so far","tokenPrompt":"Prompt","tokenCompletion":"Completion","tokenTotal":"Total","tokenRateTitle":"Live output rate (estimated: CJK ≈1.5 tok/char, other ≈0.25 tok/char — the provider sends no per-chunk token counts)","totalChars":"Total chars","avgTokens":"Avg tokens/msg","estimatedCost":"Est. cost: \${{cost}}","contextTrimming":"Context Trimming","keepMore":"Keep more","trimMore":"Trim more","trimContext":"Trim context (keep ~{{n}} messages)","currentMessages":"{{n}} messages","totalCharsInfo":"· {{n}} chars total","contextManager":"Context Manager","showContext":"Show context info","taskBoard":"Task Board","morePending":"{{n}} more pending...","moreCompleted":"{{n}} more completed...","dependencyCount":"🔗 {{n}} dependencies","contextSuggestions":"Expand ({{n}} suggestions)","collapseSuggestions":"Collapse","toolRequest":"Tool request: ","toolResult":"Tool result: ","memory":"Memory: ","filesCount":"({{n}} files)","saveTokens":"Save ~{{n}}","ignoreSuggestion":"Ignore suggestion","fileMention":"@ Reference file","fileMentionSearch":"@ Search: \\"{{query}}\\"","fileMentionHelp":"↑↓ Select · Enter Insert · Esc Close","fileBrowser":"File Browser","fileSaved":"File saved","fileReadError":"Failed to read file","fileSaveError":"Save failed","fileModified":"● Modified","selectFilePreview":"Select a file to preview or edit","kbdHint":"command palette","clickToSwitchMode":"Click to toggle mode (Plan → Goal → Act)","selectModel":"Select model","clickToSelectModel":"Select model / reasoning effort","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","stepCountPlural":"steps","copyMessage":"Copy","regenerate":"Regenerate","deleteMessage":"Delete message","historyCount":"{{n}} items","startChatHint":"Start a conversation first","panelTitle":"Panel","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","distAssistantMessages":"Assistant messages","distToolRequest":"Tool requests","distToolResult":"Tool results","distUserMessages":"User messages","duplicateReads":"⚠️ Duplicate reads: {{pct}}%","enterInsertMulti":"Enter to insert · multi-select supported","fileMentionHelpMulti":"↑↓ Select · Enter insert (multi-select) · Esc close","finishMention":"Done","keepPercent":"{{pct}}% kept","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","noMatchingFiles":"No matching files","saveAsWorkflow":"Save as workflow","searchingFiles":"Searching files...","selectedCountShort":"Selected {{n}}","selectedFilesCount":"{{n}} files selected","workflowLibrary":"Workflows","tokenDistribution":"Token distribution","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"}`),zC={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",stopGen:"Stop generation (double Esc)",screenshot:"Capture screenshot as image attachment"},$C={placeholder:"Search commands or jump to panel...",navGroup:"Navigation",commandGroup:"Commands",empty:"No matching commands",hint:"↑↓ Select · Enter Run · Esc Close",running:"Running..."},FC={openMenu:"Open menu",closeMenu:"Close menu",close:"Close",expand:"Expand",collapse:"Collapse",delete:"Delete",remove:"Remove",send:"Send message",newSession:"New session",messageInput:"Message input",connectionStatus:"Connection status",loading:"Loading",toggleAgentFlow:"Toggle agent flow",commandPalette:"Command palette",shortcutsHelp:"Shortcuts help"},UC={mode:"Mode",planMode:"Plan Mode — Read-only analysis",planModeDesc:"In Plan mode, AI uses read-only tools to analyze requirements and code without modifying any files.",planModeHint:"After analysis, switch to Act mode to implement changes.",switchToAct:"Switch to Act mode",actMode:"Act Mode",actModeDesc:"In Act mode, AI can read, modify files, and execute commands.",actModeHint:"Need to analyze first? Switch to Plan mode for read-only exploration.",switchToPlan:"Switch to Plan mode",readOnlyMode:"Read-only",planTitle:"Plan Mode: Read-only exploration, cannot modify code",actTitle:"Act Mode: Full read/write access",switchToPlanMode:"Switch to plan mode",switchToActMode:"Switch to act mode",autoMode:"Auto mode: auto-approve tool calls",goalMode:"Goal Mode",planModeShort:"Read-only analysis and planning",actModeShort:"Read/write files and run commands",goalModeShort:"Keep working toward the goal until done",autoApprove:"Auto Approve",autoApproveShort:"Auto-approve all tool calls",planContent:"Plan file content",analyzing:"Analyzing requirements...",modePlanTitle:"Plan Mode — Read-only exploration",modePlanDesc:"Read-only mode. AI can only read files and analyze code; no modifications are allowed. After analysis, use ExitPlanMode to switch to Act mode.",modeActTitle:"Act Mode — Execute",modeActDesc:"Read-write mode. AI can read, modify files, and execute commands. Low-risk operations are auto-approved; high-risk ones require confirmation.",modeGoalTitle:"Goal Mode — Goal-driven tasks",modeGoalDesc:"Goal-oriented execution mode. AI can read/write and execute within the active task scope; out-of-scope operations require confirmation.",modeNormalTitle:"Normal Mode — Standard interaction",modeNormalDesc:"Standard interaction mode. All tools work normally; writes and command execution require user confirmation.",readOnlyBadge:"🔒 Read-only",autoApproveBadge:"✅ Auto-approve",toPlanMode:"Switch to Plan Mode",toActMode:"Switch to Act Mode",modeCycleHint:"Mode cycle: Plan → Act → Goal; Auto is an independent toggle"},HC={title:"What's New"},GC={title:"Settings",searchPlaceholder:"Search settings...",noResults:"No matching settings",nav:{general:"General",appearance:"Appearance",voice:"Voice",models:"Models & Providers",connectors:"Connectors",context:"Context",configFiles:"Config Files",system:"System",about:"About"},groups:{general:"General",features:"Features",system:"System"},theme:"Theme",themeDark:"🌙 Dark",themeLight:"☀️ Light",themeAuto:"🔄 Auto",themePresets:"Theme Presets",themePresetLinear:"Linear (minimal)",themePresetLinearDesc:"Neutral grays with a single accent — clean and focused",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",customColors:"Custom Colors",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",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.",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"}},qC={title:"Model Configuration",providerConfig:"Provider Config",configured:"Configured",notConfigured:"Not configured",modelsCount:"{{n}} models · {{apiType}}",clickToConfig:"Click to configure →",apiKeyHint:"API Key configured. Enter new key to overwrite.",apiKeyPlaceholder:"Enter new key to overwrite...",apiKeyDefaultPlaceholder:"sk-...",enterApiKey:"Please enter API Key",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",addModel:"Add Model",provider_qwen:"Qwen (Tongyi Qianwen)",provider_glm:"GLM (Zhipu)",provider_baichuan:"Baichuan",provider_minimax:"MiniMax / Hailuo",provider_doubao:"Doubao",provider_hunyuan:"Tencent Hunyuan",provider_spark:"iFlytek Spark",provider_custom:"Custom",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",unsetActDefault:"Unset Act default",unsetPlanDefault:"Unset Plan default",unsetGoalDefault:"Unset Goal default",setActDefaultTitle:"Set as Act default",setPlanDefaultTitle:"Set as Plan default",setGoalDefaultTitle:"Set as Goal default",unsetActDefaultTitle:"Unset Act default (falls back to global 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",setGlobalDefaultFailed:"Failed to set global default",setGlobalDefaultTitle:"Set as global default",setPlanDefaultFailed:"Failed to set Plan default",unsetPlanDefaultFailed:"Failed to unset Plan default",setActDefaultFailed:"Failed to set Act default",unsetActDefaultFailed:"Failed to unset Act 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)"},VC={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",all:"All",invalidData:"Invalid tool data format returned by server"},WC={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",localSkill:"Local skill",systemPrompt:"System Prompt",selectSkill:"Select a skill",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",marketplaceDesc:"Browse and install skills from remote marketplaces",marketplaceTitle:"Skill Marketplace",addMarketplace:"Add Marketplace",addMarketplaceTitle:"Add Skill Marketplace",marketplaceUrl:"Marketplace URL",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",installedSkills:"Installed 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}}"?',uninstalling:"Uninstalling...",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"},KC={permissionRequest:"Permission Request",hookApproval:"Hook Interception Approval",hookConfirm:"Hook Request Confirmation",morePending:"{{n}} more pending",tool:"Tool: ",reason:"Reason: ",needConfirm:"Requires user confirmation",allow:"Allow",deny:"Deny",allowAlways:"Always allow this session",allowAlwaysDesc:"Don't ask again for this tool in current session",autoMode:"Auto Mode",autoModeLabel:"Auto mode (allow all)",autoModeDesc:"Auto-approve all hook requests",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_force:"Git force operation",risk_git:"Git operation",risk_network:"Network request",risk_low:"Read-only operation",risk_default:"Tool call",hookConfigTitle:"Custom Hook Configuration",hookConfigDesc:"You can add or modify hook interception rules in the .agent/hooks.json file in the project root directory.",hookConfigDetail:"Hooks support SHELL (external scripts) and HTTP (REST endpoints) types, and can be triggered before (PRE_TOOL_USE) or after (POST_TOOL_USE) tool execution.",hookConfigBuiltin:"Built-in hooks: BashSafetyHook (dangerous command interception), FileWriteAuditHook (file write audit), ToolUsageStatsHook (tool usage statistics). Set enabled: false to disable any hook.",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",modalHint:"Please handle this approval request in the popup modal",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?
28
- "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"},YC={pending:"Waiting",thinking:"Thinking",action:"Action",result:"Result",running:"Running",error:"Error",completed:"Completed",params:"Parameters"},ZC={linesTotal:"… ({{n}} lines total)",expandAll:"Expand all ({{n}} lines)",collapse:"Collapse"},XC={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:"Switch to file panel",files_result:"Switched to file 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"},QC={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)"},JC={backendConnected:"Backend connected",backendDisconnected:"Backend disconnected, reconnecting...",paused:"Paused, press ESC again to stop",terminated:"Stopped (ESC×2)",queueRevoked:"Revoked {{count}} queued message(s)",terminatedQueued:"Stopped — dropped {{count}} queued message(s)",contextCompressed:"Context compressed: {{original}} → {{compressed}} messages, saved {{saved}} tokens",errorPrefix:"❌ Error: {{error}}",uncaughtError:"Uncaught error: ",uncaughtRejection:"Uncaught Promise rejection: ",unknownReason:"Unknown reason",diagnosing:"⏳ Diagnosing...",runDiagnostic:"🔍 Run Diagnostic",inspectorOn:"Enable inspector (Ctrl+Shift+Alt+C)",inspectorOff:"Disable inspector"},eE={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",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"}},tE={title:"Channel Management",subtitle:"Connect external IM platforms to interact with AI via WeChat, Feishu, DingTalk, etc.",newChannel:"New Channel",editChannel:"Edit Channel",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:{basicInfo:"Basic Info",name:"Channel Name",namePlaceholder:"e.g. Office Group Bot",type:"Channel Type",credentials:"Credentials",appId:"App ID",appIdPlaceholder:"Enter App ID",appSecret:"App Secret",appSecretPlaceholder:"Enter App Secret",token:"Token",tokenPlaceholder:"Enter Bot Token",encodingAESKey:"EncodingAESKey",encodingAESKeyPlaceholder:"WeChat only, optional",enabled:"Enable Channel",wechatQrHint:"Save first, then scan QR code to login",feishuWsHint:"Feishu uses WebSocket to receive messages automatically",namePlaceholderDev:"e.g. Dev Group Bot",typeLocked:"Channel type cannot be changed after creation",leaveBlankUnchanged:"Leave blank to keep unchanged",leaveBlankMeansUnchanged:"Leave blank to keep unchanged",appSecretValue:"App secret",tokenCallback:"Callback verification token",optionalShort:"Optional",encodingAesOptional:"Optional, message encryption/decryption key",wechatIlinkHint:"The WeChat iLink bot authorizes via QR scan; credentials can be left empty — just save and scan to log in.",wechatIlinkHintList:'The WeChat iLink bot authorizes via QR scan; credentials can be left empty — after saving, click "QR Login" in the list.',enabledOffHint:"Sending and receiving messages stops when disabled"},actions:{scanQr:"Scan QR",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",deleteConfirmNamed:'Delete channel "{{name}}"?',deleteConfirmShort:"Delete this channel?"},errors:{loadFailed:"Failed to load channels",createFailed:"Failed to create channel",updateFailed:"Failed to update channel",deleteFailed:"Failed to delete 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",expiredHint:"Click retry to generate a new QR code",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",pluginMissingTip:"The plugin for this channel type is not installed or activated; instances cannot start",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",waitingPlugin:"Waiting for plugin installation"},categories:{im:"Instant Messaging",international:"International",eastAsia:"East Asia",collaboration:"Collaboration Platforms",classic:"Classic Protocols",other:"Others",builtin:"Built-in",plugins:"Plugin Extensions"}},nE={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"},rE={reconnecting:"Reconnecting {{attempt}}/{{max}}",hint:"Reconnecting to backend…"},aE={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"},sE={noRepo:"Not a Git repo",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"},iE={retry:"Retry",details:"Details",modelSettings:"Model settings"},oE={comingSoon:"Coming soon"},lE={lspGroup:"Language Servers (LSP)",mcpGroup:"MCP Servers",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"},cE={justNow:"just now",minutesAgo:"{{count}}m ago",hoursAgo:"{{count}}h ago",daysAgo:"{{count}}d ago"},uE={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; other languages use faster-whisper",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."}},dE={verb:{researching:"Analyzing code",coding:"Editing code",validating:"Running checks",summarizing:"Wrapping up"},title:{withFile:"{{verb}} {{file}}",withCount:"{{verb}} · {{count}} items"},evidenceMore:"+ {{count}} more",toolCallCount:"{{count}} tool calls",toolNamesMore:"+{{count}} more tools",waitingUser:"Waiting for your answer",blocked:"Blocked: {{reason}}",paused:"Paused — resumable",viewAndAnswer:"View & answer",evidence:"Execution details",phase:{analysis:"Analysis",implementation:"Implement",optimization:"Optimize"}},fE={next:"Next",idle:"Idle"},hE={title:"Scheduled Automations",refresh:"Refresh",new:"New",namePlaceholder:"Name (e.g. summarize Git status every morning at 9)",instructionsPlaceholder:"Instructions (what the agent executes on each trigger)",cronPlaceholder:"cron (5 fields, e.g. 0 9 * * *)",create:"Create",cronDaily9:"Daily at 9:00",cronWeekday9:"Weekdays at 9:00",cronEvery30Min:"Every 30 minutes",empty:"No scheduled automations yet. Create one to let the agent work unattended.",enable:"Enable",disable:"Disable",runNow:"Trigger manually",delete:"Delete",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"},pE="Scheduled tasks (e.g. nightly test-data runs) will be managed here.",mE="Manage plugins. Enable or disable extensions such as file-processing skills.",gE="Feature under development…",yE={title:"Files",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",close:"Close",modified:"Modified",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"},bE={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)"},vE={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)."},xE={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",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",selectTemplateHintSub:"Built-in presets work out of the box; you can also save a workflow run as a workflow to reuse it later.",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",libraryTitle:"Workflow library",newTemplate:"New workflow",newShort:"New",searchPlaceholder:"Search workflows…",paramCount:"{{n}} params",viewing:"Viewing",view:"View",launchModalTitle:'Replay "{{name}}"',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",editMode:"Edit",backToView:"Back to view",editMeta:"Edit details",replay:"Replay",replayWorkflow:"Replay",preflight:"Preflight",preflightCheck:"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",permissionsSummary:"Replay scope",allowDuringReplay:"Allowed during replay",denyDuringReplay:"Denied during replay",toolWhitelist:"Tool whitelist",noToolsRestriction:"No tool restriction (session permissions apply)",editMetaTitle:"Edit details",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",forkAsNew:"Copy as new workflow",more:"More",degradedBadge:"Cut incomplete",degradedHint:"Some content still holds recorded concrete values — review before sharing",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}}",replaySummary:"Will replay {{n}} steps ({{p}} in parallel)",replayReadonlyLine:"Read-only — no files modified",replayWritableLine:"Can modify files",replayEstimated:"Estimated ~{{m}} min",replayStart:"Start replay →",preflightOk:"Ready to replay",preflightNodesOk:"{{n}} nodes, no cycles",preflightInputsOk:"{{n}} inputs resolved ({{a}} from current context)",preflightPermOk:"Permission check passed",preflightRunning:"Preflighting…",preflightError:"Preflight found issues",edit:"Edit",saveAsWorkflow:"Save as workflow",savingAsWorkflow:"Saving as workflow…",savedAsWorkflow:"Saved as workflow “{{name}}” (v{{version}})",savedAsWorkflowDegraded:"Saved as workflow “{{name}}” — cut incomplete, saved as-is{{reason}}",noRunToSave:"No workflow run in this session to save",workflowNoRunFound:"No workflow run to save",replayNewSession:"Replay opens a new session; track progress in chat",roleTooltip:"Role"},wE={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",resultPaused:"Paused",doneNodeCount:"{{done}}/{{total}} nodes",tokensUsedLabel:"{{tokens}} tokens",retriedCount:"retried {{n}}",runEnded:"Ended {{time}}"},dwf:{offerFallbackTitle:"Dynamic workflow",promotableSentence:"Validated {{n}} times — save as a reusable template"},agentFlow:{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)"}},kE={drawerCollapseTitle:"Collapse drawer to view messages",drawerExpandTitle:"Expand drawer to make a choice",openFile:"Open ›"},SE={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…"}},Ox={common:BC,nav:IC,chat:PC,shortcuts:zC,palette:$C,a11y:FC,plan:UC,whatsnew:HC,settings:GC,models:qC,tools:VC,skills:WC,hook:KC,step:YC,toolCall:ZC,slashCommands:XC,error:QC,toast:JC,assistants:eE,channels:tE,fileJob:nE,reconnect:rE,autoAccess:aE,git:sE,errorCard:iE,placeholder:oE,connectors:lE,time:cE,stt:uE,activity:dE,taskbar:fE,automation:hE,placeholderScheduledDesc:pE,placeholderPluginsDesc:mE,featureInProgress:gE,fileTree:yE,logs:bE,plugins:vE,templates:xE,widgets:wE,commonUi:kE,trajectory:SE},_E=wi.getState().language||"zh-CN";rn.use(M9).init({resources:{"zh-CN":{translation:Dx,hook:Dx.hook},en:{translation:Ox,hook:Ox.hook}},lng:_E,fallbackLng:"zh-CN",interpolation:{escapeValue:!1}});wi.subscribe((t,e)=>{t.language!==e.language&&rn.changeLanguage(t.language)});const CE="deepseekcode-chat-store",EE=500,TE=3e4,AE=2e4,j0=4e3;let Ta=null,sm=0,Wc=null;const Kc=(t,e)=>!t||t.length<=e?t:t.slice(0,e)+"…",Lx=t=>({...t,args:typeof t.args=="string"?Kc(t.args,j0)??t.args:t.args,result:typeof t.result=="string"?Kc(t.result,j0)??t.result:t.result}),NE=t=>{const e={...t,thinkingBlocks:void 0,textBlocks:void 0,content:Kc(t.content,AE)??t.content};return t.steps&&(e.steps=t.steps.map(n=>{var r;return{...n,thought:Kc(n.thought,j0),result:Kc(n.result,j0),toolCalls:(r=n.toolCalls)==null?void 0:r.map(Lx)}})),t.toolCalls&&(e.toolCalls=t.toolCalls.map(Lx)),e},RE=/WebSocket disconnected|connection (lost|closed)|disconnect/i,ME=/force|new message|user stop|stop|terminate|paused/i;function T3(t){return t?RE.test(t)?"ws_disconnected":ME.test(t)?"force_stopped":"unknown":"unknown"}function DE(t){switch(T3(t)){case"ws_disconnected":return rn.t("error.genEndedWs");case"force_stopped":return rn.t("error.genEndedStopped");default:return rn.t("error.genEnded")}}const OE=[t=>{const e=Fe.getState(),n=new Set;for(const a of e.sessionTabs)n.add(a.id);for(const a of e.historySessions)n.add(a.id);e.activeSessionId&&n.add(e.activeSessionId);const r={};for(const[a,i]of Object.entries(t.state.messagesBySession||{}))n.has(a)&&Array.isArray(i)&&i.length>0&&(r[a]=i);return{...t,state:{...t.state,messagesBySession:r}}},t=>{const e={};for(const[n,r]of Object.entries(t.state.messagesBySession||{}))e[n]=(Array.isArray(r)?r:[]).slice(-60).map(NE);return{...t,state:{...t.state,messagesBySession:e}}},t=>{const e=Fe.getState().activeSessionId||"",n=(t.state.messagesBySession||{})[e]||[],r=(Array.isArray(n)?n:[]).slice(-30).map(a=>({id:a.id,type:a.type,content:a.content,timestamp:a.timestamp,...a.thinking?{thinking:a.thinking}:{}}));return{...t,state:{...t.state,messagesBySession:e?{[e]:r}:{}}}}];function A3(t,e){const n=i=>{try{return localStorage.setItem(t,JSON.stringify(i)),sm=0,!0}catch{return!1}};if(n(e))return;let r=e;for(const i of OE){try{r=i(r)}catch{continue}if(n(r))return}const a=Date.now();if(a-sm>TE){sm=a,console.error("[chatStore] localStorage 持久化失败,刷新页面将丢失历史消息:",new Error("quota exceeded or storage unavailable"));try{ys.getState().addToast("warning","聊天记录保存失败:浏览器本地存储已满或不可用。刷新页面将丢失历史消息,建议导出会话或清理旧会话。",8e3)}catch{}}}function LE(){Ta&&(clearTimeout(Ta),Ta=null);const t=Wc;Wc=null,t&&A3(t.name,t.value)}const jE={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)=>{Wc={name:t,value:e},Ta&&clearTimeout(Ta),Ta=setTimeout(()=>{Ta=null,Wc=null,A3(t,e)},EE)},removeItem:t=>{Wc=null,Ta&&(clearTimeout(Ta),Ta=null);try{localStorage.removeItem(t)}catch{}}};if(typeof window<"u"){const t=()=>LE();window.addEventListener("pagehide",t),window.addEventListener("beforeunload",t)}function N3(t,e,n,r){const a=t!=null&&t.length?t:e;if(!a||a.length===0)return{blocks:[{index:r??0,text:n}],appendedAtEnd:!0};if(typeof r=="number"){const c=a.findIndex(h=>h.index===r),d=a.slice();return c>=0?(d[c]={...a[c],text:a[c].text+n},{blocks:d,appendedAtEnd:c===d.length-1}):(d.push({index:r,text:n}),d[d.length-2].index<=r?{blocks:d,appendedAtEnd:!0}:(d.sort((h,p)=>h.index-p.index),{blocks:d,appendedAtEnd:!1}))}const i=a.length-1,l=a.slice();return l[i]={...a[i],text:a[i].text+n},{blocks:l,appendedAtEnd:!0}}function jx(t,e,n){const{blocks:r,appendedAtEnd:a}=N3(t.thinkingBlocks,t.thinking?[{index:Number.MIN_SAFE_INTEGER,text:t.thinking}]:void 0,e,n);return{...t,thinkingBlocks:r,thinking:a?(t.thinking||"")+e:r.map(i=>i.text).join("")}}function Vd(t,e,n){const{blocks:r,appendedAtEnd:a}=N3(t.textBlocks,t.content?[{index:Number.MAX_SAFE_INTEGER,text:t.content}]:void 0,e,n);return{...t,textBlocks:r,content:a?(t.content||"")+e:r.map(i=>i.text).join("")}}const Be=gn()(Ti((t,e)=>({messagesBySession:{},generatingSessions:[],pausedSessions:[],sessionInputs:{},pendingBySession:{},getMessages:n=>e().messagesBySession[n]||[],replaceMessages:(n,r)=>t(a=>({messagesBySession:{...a.messagesBySession,[n]:r.slice(-200)}})),addMessage:(n,r)=>t(a=>{const l=[...a.messagesBySession[n]||[],r].slice(-200);return{messagesBySession:{...a.messagesBySession,[n]:l}}}),updateMessage:(n,r,a)=>t(i=>{const l=i.messagesBySession[n]||[];return l.some(c=>c.id===r)?{messagesBySession:{...i.messagesBySession,[n]:l.map(c=>c.id===r?{...c,...a}:c)}}:i}),updateLastMessage:(n,r)=>t(a=>{const i=(a.messagesBySession[n]||[]).map((l,c,d)=>c===d.length-1&&l.type==="assistant"?{...l,content:r}:l);return{messagesBySession:{...a.messagesBySession,[n]:i}}}),appendToLastMessage:(n,r)=>t(a=>{const i=a.messagesBySession[n];if(!i||i.length===0)return a;const l=i.length-1,c=i[l];if(c&&c.type==="assistant"){const d=i.slice();return d[l]=Vd(c,r),{messagesBySession:{...a.messagesBySession,[n]:d}}}return{messagesBySession:{...a.messagesBySession,[n]:[...i,Vd({id:Oa(),type:"assistant",content:"",timestamp:Date.now()},r)].slice(-200)}}}),setThinking:(n,r)=>t(a=>{const i=(a.messagesBySession[n]||[]).map((l,c,d)=>{var p;if(c!==d.length-1||l.type!=="assistant")return l;const h=(p=l.steps)==null?void 0:p.findIndex(m=>m.status==="running");if(h!==void 0&&h!==-1&&l.steps&&l.steps[h]){const m=l.steps.map((b,x)=>x===h?{...b,thought:r}:b);return{...l,steps:m}}return{...l,thinking:r,thinkingBlocks:r?[{index:0,text:r}]:[]}});return{messagesBySession:{...a.messagesBySession,[n]:i}}}),appendToLastMessageThinking:(n,r,a)=>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,jx({id:Oa(),type:"assistant",content:"",timestamp:Date.now()},r,a)].slice(-200)}};const h=jx(d,r,a),p=l.slice();return p[c]=h,{messagesBySession:{...i.messagesBySession,[n]:p}}}),appendToLastMessageText:(n,r,a)=>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,Vd({id:Oa(),type:"assistant",content:"",timestamp:Date.now()},r,a)].slice(-200)}};const h=l.slice();return h[c]=Vd(d,r,a),{messagesBySession:{...i.messagesBySession,[n]:h}}}),addStep:(n,r)=>t(a=>{const i=(a.messagesBySession[n]||[]).map((l,c,d)=>{var m;if(c!==d.length-1||l.type!=="assistant")return l;const h=(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(E=>E.id===b.id)}))}),p={...r};return h!=null&&h.length&&(p.toolCalls=[...p.toolCalls||[],...h]),{...l,steps:[...l.steps||[],p]}});return{messagesBySession:{...a.messagesBySession,[n]:i}}}),updateStep:(n,r,a)=>t(i=>{const l=(i.messagesBySession[n]||[]).map((c,d,h)=>{if(d!==h.length-1||!c.steps)return c;const p=c.steps.findIndex(b=>b.id===r);if(p===-1)return c;const m=c.steps.map((b,x)=>x===p?{...b,...a}:b);return{...c,steps:m}});return{messagesBySession:{...i.messagesBySession,[n]:l}}}),addToolCall:(n,r)=>t(a=>{const i=(a.messagesBySession[n]||[]).map((l,c,d)=>{var p;if(c!==d.length-1||l.type!=="assistant")return l;const h=(p=l.steps)==null?void 0:p.findIndex(m=>m.status==="running");if(h!==void 0&&h!==-1&&l.steps&&l.steps[h]){const m=l.steps.map((b,x)=>x===h?{...b,toolCalls:[...b.toolCalls||[],r]}: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||[],r]}:x);return{...l,steps:b}}return{...l,toolCalls:[...l.toolCalls||[],r]}});return{messagesBySession:{...a.messagesBySession,[n]:i}}}),updateToolCall:(n,r,a)=>t(i=>{const l=d=>{if(!d)return null;const h=d.findIndex(p=>p.id===r);return h===-1?null:d.map((p,m)=>m===h?{...p,...a}:p)},c=(i.messagesBySession[n]||[]).map((d,h,p)=>{var x,w;if(h!==p.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 E=d.steps.map((A,T)=>T===m?{...A,toolCalls:S}:A);return{...d,steps:E}}}if(d.steps){let S=!1;const E=d.steps.map(A=>{if(S)return A;const T=l(A.toolCalls);return T?(S=!0,{...A,toolCalls:T}):A});if(S)return{...d,steps:E}}const b=l(d.toolCalls);return b?{...d,toolCalls:b}:d});return{messagesBySession:{...i.messagesBySession,[n]:c}}}),markWaitingUserToolCall:(n,r)=>t(a=>{var p,m;const i=a.messagesBySession[n];if(!(i!=null&&i.length))return a;let l=-1;for(let b=i.length-1;b>=0;b--)if(((p=i[b])==null?void 0:p.type)==="assistant"){l=b;break}if(l===-1)return a;const c=i[l];if(!c)return a;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||r&&w.name!==r)continue;const S=b.slice();return S[x]={...w,waitingUser:!0},S}return null},h=d(c.toolCalls);if(h){const b=i.slice();return b[l]={...c,toolCalls:h},{messagesBySession:{...a.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 E=i.slice();return E[l]={...c,steps:S},{messagesBySession:{...a.messagesBySession,[n]:E}}}}return a}),clearWaitingUserToolCalls:n=>t(r=>{const a=r.messagesBySession[n];if(!(a!=null&&a.length))return r;let i=!1;const l=d=>!(d!=null&&d.length)||!d.some(h=>h.waitingUser===!0)?d:(i=!0,d.map(h=>h.waitingUser?{...h,waitingUser:void 0}:h)),c=a.map(d=>{var m;const h=l(d.toolCalls),p=(m=d.steps)==null?void 0:m.map(b=>{const x=l(b.toolCalls);return x!==b.toolCalls?{...b,toolCalls:x}:b});return h===d.toolCalls&&p===d.steps?d:{...d,toolCalls:h,steps:p}});return i?{messagesBySession:{...r.messagesBySession,[n]:c}}:r}),applyToolCallPatches:(n,r)=>t(a=>{if(!(r!=null&&r.length))return a;const i=a.messagesBySession[n];if(!(i!=null&&i.length))return a;const l=new Map(r.map(p=>[p.id,p]));let c=!1;const d=p=>{if(!(p!=null&&p.length))return p;let m=!1;const b=p.map(x=>{const w=l.get(x.id);if(!w)return x;m=!0;const S=Math.floor((Date.now()-(x.timestamp||Date.now()))/1e3);return{...x,status:w.status,result:w.result,ended:w.ended,waitingUser:w.waitingUser,duration:S}});return m?(c=!0,b):p},h=i.map(p=>{var x;const m=d(p.toolCalls),b=(x=p.steps)==null?void 0:x.map(w=>{const S=d(w.toolCalls);return S!==w.toolCalls?{...w,toolCalls:S}:w});return m===p.toolCalls&&b===p.steps?p:{...p,toolCalls:m,steps:b}});return c?{messagesBySession:{...a.messagesBySession,[n]:h}}:a}),appendToLastToolCallArgs:(n,r,a,i)=>t(l=>{const c=p=>{let m=p.args;if(typeof m=="string")m=m+a;else if(typeof m=="object"&&m!==null){const b=a.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=a;return{...p,args:m}},d=p=>{if(!p)return null;const m=p.findIndex(b=>i!==void 0&&b.index===i||b.id===r);return m===-1?null:p.map((b,x)=>x===m?c(b):b)},h=(l.messagesBySession[n]||[]).map((p,m,b)=>{var S,E;if(m!==b.length-1||p.type!=="assistant")return p;const x=(S=p.steps)==null?void 0:S.findIndex(A=>A.status==="running");if(x!==void 0&&x!==-1&&p.steps&&p.steps[x]){const A=d((E=p.steps[x])==null?void 0:E.toolCalls);if(A){const T=p.steps.map((D,M)=>M===x?{...D,toolCalls:A}:D);return{...p,steps:T}}}if(p.steps){let A=!1;const T=p.steps.map(D=>{if(A)return D;const M=d(D.toolCalls);return M?(A=!0,{...D,toolCalls:M}):D});if(A)return{...p,steps:T}}const w=d(p.toolCalls);return w?{...p,toolCalls:w}:p});return{messagesBySession:{...l.messagesBySession,[n]:h}}}),startGeneration:n=>t(r=>({generatingSessions:r.generatingSessions.includes(n)?r.generatingSessions:[...r.generatingSessions,n]})),endGeneration:(n,r,a)=>t(i=>{var w,S,E;const l=i.messagesBySession[n]||[],c=Date.now(),d=DE(r),h=T3(r),p=(a==null?void 0:a.force)===!0,m=A=>!p&&A.waitingUser===!0,b=l.map(A=>{var B,I;let T=!1;const D=(B=A.steps)==null?void 0:B.map(U=>{if(!U.toolCalls)return U;const W=U.toolCalls.map(Y=>Y.status!=="running"||m(Y)?Y:(T=!0,{...Y,status:"error",result:d,ended:h,duration:Math.floor((c-(Y.timestamp||c))/1e3)}));return W!==U.toolCalls?{...U,toolCalls:W}:U}),M=(I=A.toolCalls)==null?void 0:I.map(U=>U.status!=="running"||m(U)?U:(T=!0,{...U,status:"error",result:d,ended:h,duration:Math.floor((c-(U.timestamp||c))/1e3)}));return T?{...A,steps:D,toolCalls:M}:A}),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)&&!((E=x.toolCalls)!=null&&E.length)&&!x.hookApproval){const{[n]:A,...T}=i.messagesBySession;return{generatingSessions:i.generatingSessions.filter(D=>D!==n),pausedSessions:i.pausedSessions.filter(D=>D!==n),messagesBySession:{...T,[n]:b.slice(0,-1)}}}return{generatingSessions:i.generatingSessions.filter(A=>A!==n),pausedSessions:i.pausedSessions.filter(A=>A!==n),messagesBySession:{...i.messagesBySession,[n]:b}}}),pauseGeneration:n=>t(r=>({pausedSessions:r.pausedSessions.includes(n)?r.pausedSessions:[...r.pausedSessions,n]})),resumeGeneration:n=>t(r=>({pausedSessions:r.pausedSessions.filter(a=>a!==n)})),clearMessages:n=>t(r=>{const{[n]:a,...i}=r.messagesBySession,{[n]:l,...c}=r.pendingBySession;return{messagesBySession:i,pendingBySession:c}}),removeSession:n=>t(r=>{const{[n]:a,...i}=r.messagesBySession,{[n]:l,...c}=r.sessionInputs,{[n]:d,...h}=r.pendingBySession;return{messagesBySession:i,sessionInputs:c,pendingBySession:h,generatingSessions:r.generatingSessions.filter(p=>p!==n)}}),setSessionInput:(n,r)=>t(a=>({sessionInputs:{...a.sessionInputs,[n]:r}})),getSessionInput:n=>e().sessionInputs[n]||"",enqueuePending:(n,r,a,i)=>{const l={id:`queued-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,content:r,files:a,images:i,createdAt:Date.now()};t(c=>({pendingBySession:{...c.pendingBySession,[n]:[...c.pendingBySession[n]||[],l]}}))},getPending:n=>e().pendingBySession[n]||[],clearPending:n=>{const r=e().pendingBySession[n];return!r||r.length===0?0:(t(a=>{const{[n]:i,...l}=a.pendingBySession;return{pendingBySession:l}}),r.length)},shiftPending:n=>{const r=e().pendingBySession[n];if(!r||r.length===0)return;const a=r[0],i=r.slice(1);return t(l=>{if(i.length===0){const{[n]:c,...d}=l.pendingBySession;return{pendingBySession:d}}return{pendingBySession:{...l.pendingBySession,[n]:i}}}),a},attachHookApproval:(n,r)=>t(a=>{const i=a.messagesBySession[n]||[];if(i.length===0){const h={id:`hook-approval-${r.approvalId||Date.now()}`,type:"assistant",content:"",timestamp:Date.now(),hookApproval:r};return{messagesBySession:{...a.messagesBySession,[n]:[h]}}}const l=i.length-1,c=i[l];if(c&&c.type==="assistant"){const h=i.slice();return h[l]={...c,hookApproval:r},{messagesBySession:{...a.messagesBySession,[n]:h}}}const d={id:`hook-approval-${r.approvalId||Date.now()}`,type:"assistant",content:"",timestamp:Date.now(),hookApproval:r};return{messagesBySession:{...a.messagesBySession,[n]:[...i,d].slice(-200)}}}),updateHookApprovalStatus:(n,r,a)=>t(i=>{const l=i.messagesBySession[n];if(!l)return i;const c=l.map(d=>{var h;return((h=d.hookApproval)==null?void 0:h.approvalId)===r?{...d,hookApproval:{...d.hookApproval,status:a}}:d});return{messagesBySession:{...i.messagesBySession,[n]:c}}}),setMessageFileJob:(n,r)=>t(a=>{const i=a.messagesBySession[n]||[];if(i.length===0){const h={id:`filejob-${r.jobId}`,type:"assistant",content:"",timestamp:Date.now(),fileJob:r};return{messagesBySession:{...a.messagesBySession,[n]:[h]}}}const l=i.length-1,c=i[l];if(c&&c.type==="assistant"){const h=i.slice();return h[l]={...c,fileJob:c.fileJob?{...c.fileJob,...r,attachments:r.attachments??c.fileJob.attachments,jobId:c.fileJob.jobId,updatedAt:Date.now()}:{...r,updatedAt:Date.now()}},{messagesBySession:{...a.messagesBySession,[n]:h}}}const d={id:`filejob-${r.jobId}`,type:"assistant",content:"",timestamp:Date.now(),fileJob:r};return{messagesBySession:{...a.messagesBySession,[n]:[...i,d].slice(-200)}}}),attachErrorCard:(n,r)=>t(a=>{const i=a.messagesBySession[n];if(!i||i.length===0)return a;const l=i.length-1,c=i[l];if(c&&c.type==="assistant"){const d=i.slice();return d[l]={...c,errorCard:r},{messagesBySession:{...a.messagesBySession,[n]:d}}}return a}),setTurnSummary:(n,r)=>t(a=>{const i=a.messagesBySession[n];if(!i||i.length===0)return a;const l=i.length-1,c=i[l];if(!c||c.type!=="assistant")return a;const d=i.slice();return d[l]={...c,summary:r},{messagesBySession:{...a.messagesBySession,[n]:d}}}),applyTombstone:(n,r)=>t(a=>{const i=a.messagesBySession[n];if(!i||i.length===0)return a;const l=new Set(r),c=i.map(d=>l.has(d.id)?{...d,deleted:!0}:d);return{messagesBySession:{...a.messagesBySession,[n]:c}}}),isGenerating:n=>e().generatingSessions.includes(n),isPaused:n=>e().pausedSessions.includes(n),clearGenerating:n=>t(r=>{const a=n?r.generatingSessions.filter(l=>l!==n):[],i=n?r.pausedSessions.filter(l=>l!==n):[];return a.length===r.generatingSessions.length&&i.length===r.pausedSessions.length?r:{generatingSessions:a,pausedSessions:i}})}),{name:CE,storage:jE,partialize:t=>({messagesBySession:t.messagesBySession,sessionInputs:t.sessionInputs})}));let yg=null;function Bx(t){yg=t}function Ix(t){const e=Be.getState();if(e.isGenerating(t))return;const n=e.shiftPending(t);return n&&yg&&yg(t,n),n}const BE=gn(t=>({observed:[],setObserved:e=>t({observed:e})}));var kt;(function(t){t.assertEqual=a=>{};function e(a){}t.assertIs=e;function n(a){throw new Error}t.assertNever=n,t.arrayToEnum=a=>{const i={};for(const l of a)i[l]=l;return i},t.getValidEnumValues=a=>{const i=t.objectKeys(a).filter(c=>typeof a[a[c]]!="number"),l={};for(const c of i)l[c]=a[c];return t.objectValues(l)},t.objectValues=a=>t.objectKeys(a).map(function(i){return a[i]}),t.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const i=[];for(const l in a)Object.prototype.hasOwnProperty.call(a,l)&&i.push(l);return i},t.find=(a,i)=>{for(const l of a)if(i(l))return l},t.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function r(a,i=" | "){return a.map(l=>typeof l=="string"?`'${l}'`:l).join(i)}t.joinValues=r,t.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(kt||(kt={}));var Px;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Px||(Px={}));const De=kt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),fi=t=>{switch(typeof t){case"undefined":return De.undefined;case"string":return De.string;case"number":return Number.isNaN(t)?De.nan:De.number;case"boolean":return De.boolean;case"function":return De.function;case"bigint":return De.bigint;case"symbol":return De.symbol;case"object":return Array.isArray(t)?De.array:t===null?De.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?De.promise:typeof Map<"u"&&t instanceof Map?De.map:typeof Set<"u"&&t instanceof Set?De.set:typeof Date<"u"&&t instanceof Date?De.date:De.object;default:return De.unknown}},we=kt.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 ks extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};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},r={_errors:[]},a=i=>{for(const l of i.issues)if(l.code==="invalid_union")l.unionErrors.map(a);else if(l.code==="invalid_return_type")a(l.returnTypeError);else if(l.code==="invalid_arguments")a(l.argumentsError);else if(l.path.length===0)r._errors.push(n(l));else{let c=r,d=0;for(;d<l.path.length;){const h=l.path[d];d===l.path.length-1?(c[h]=c[h]||{_errors:[]},c[h]._errors.push(n(l))):c[h]=c[h]||{_errors:[]},c=c[h],d++}}};return a(this),r}static assert(e){if(!(e instanceof ks))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,kt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const a of this.issues)if(a.path.length>0){const i=a.path[0];n[i]=n[i]||[],n[i].push(e(a))}else r.push(e(a));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}ks.create=t=>new ks(t);const bg=(t,e)=>{let n;switch(t.code){case we.invalid_type:t.received===De.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case we.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,kt.jsonStringifyReplacer)}`;break;case we.unrecognized_keys:n=`Unrecognized key(s) in object: ${kt.joinValues(t.keys,", ")}`;break;case we.invalid_union:n="Invalid input";break;case we.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${kt.joinValues(t.options)}`;break;case we.invalid_enum_value:n=`Invalid enum value. Expected ${kt.joinValues(t.options)}, received '${t.received}'`;break;case we.invalid_arguments:n="Invalid function arguments";break;case we.invalid_return_type:n="Invalid function return type";break;case we.invalid_date:n="Invalid date";break;case we.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}"`:kt.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case we.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 we.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 we.custom:n="Invalid input";break;case we.invalid_intersection_types:n="Intersection results could not be merged";break;case we.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case we.not_finite:n="Number must be finite";break;default:n=e.defaultError,kt.assertNever(t)}return{message:n}};let IE=bg;function PE(){return IE}const zE=t=>{const{data:e,path:n,errorMaps:r,issueData:a}=t,i=[...n,...a.path||[]],l={...a,path:i};if(a.message!==void 0)return{...a,path:i,message:a.message};let c="";const d=r.filter(h=>!!h).slice().reverse();for(const h of d)c=h(l,{data:e,defaultError:c}).message;return{...a,path:i,message:c}};function Ae(t,e){const n=PE(),r=zE({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===bg?void 0:bg].filter(a=>!!a)});t.common.issues.push(r)}class nr{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const a of n){if(a.status==="aborted")return Ze;a.status==="dirty"&&e.dirty(),r.push(a.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const a of n){const i=await a.key,l=await a.value;r.push({key:i,value:l})}return nr.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const a of n){const{key:i,value:l}=a;if(i.status==="aborted"||l.status==="aborted")return Ze;i.status==="dirty"&&e.dirty(),l.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof l.value<"u"||a.alwaysSet)&&(r[i.value]=l.value)}return{status:e.value,value:r}}}const Ze=Object.freeze({status:"aborted"}),Pc=t=>({status:"dirty",value:t}),ra=t=>({status:"valid",value:t}),zx=t=>t.status==="aborted",$x=t=>t.status==="dirty",yl=t=>t.status==="valid",B0=t=>typeof Promise<"u"&&t instanceof Promise;var je;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(je||(je={}));class Ba{constructor(e,n,r,a){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=a}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 Fx=(t,e)=>{if(yl(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 ks(t.common.issues);return this._error=n,this._error}}};function lt(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:a}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(l,c)=>{const{message:d}=t;return l.code==="invalid_enum_value"?{message:d??c.defaultError}:typeof c.data>"u"?{message:d??r??c.defaultError}:l.code!=="invalid_type"?{message:c.defaultError}:{message:d??n??c.defaultError}},description:a}}class yt{get description(){return this._def.description}_getType(e){return fi(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:fi(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new nr,ctx:{common:e.parent.common,data:e.data,parsedType:fi(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(B0(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 r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){const r={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:fi(e)},a=this._parseSync({data:e,path:r.path,parent:r});return Fx(r,a)}"~validate"(e){var r,a;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:fi(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:n});return yl(i)?{value:i.value}:{issues:n.common.issues}}catch(i){(a=(r=i==null?void 0:i.message)==null?void 0:r.toLowerCase())!=null&&a.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(i=>yl(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={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:fi(e)},a=this._parse({data:e,path:r.path,parent:r}),i=await(B0(a)?a:Promise.resolve(a));return Fx(r,i)}refine(e,n){const r=a=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(a):n;return this._refinement((a,i)=>{const l=e(a),c=()=>i.addIssue({code:we.custom,...r(a)});return typeof Promise<"u"&&l instanceof Promise?l.then(d=>d?!0:(c(),!1)):l?!0:(c(),!1)})}refinement(e,n){return this._refinement((r,a)=>e(r)?!0:(a.addIssue(typeof n=="function"?n(r,a):n),!1))}_refinement(e){return new xl({schema:this,typeName:We.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 bi.create(this,this._def)}nullable(){return wl.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return La.create(this)}promise(){return F0.create(this,this._def)}or(e){return P0.create([this,e],this._def)}and(e){return z0.create(this,e,this._def)}transform(e){return new xl({...lt(this._def),schema:this,typeName:We.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new _g({...lt(this._def),innerType:this,defaultValue:n,typeName:We.ZodDefault})}brand(){return new lT({typeName:We.ZodBranded,type:this,...lt(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Cg({...lt(this._def),innerType:this,catchValue:n,typeName:We.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return j1.create(this,e)}readonly(){return Eg.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const $E=/^c[^\s-]{8,}$/i,FE=/^[0-9a-z]+$/,UE=/^[0-9A-HJKMNP-TV-Z]{26}$/i,HE=/^[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,GE=/^[a-z0-9_-]{21}$/i,qE=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,VE=/^[-+]?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)?)??$/,WE=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,KE="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let im;const YE=/^(?:(?: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])$/,ZE=/^(?:(?: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])$/,XE=/^(([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]))$/,QE=/^(([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])$/,JE=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,eT=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,R3="((\\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])))",tT=new RegExp(`^${R3}$`);function M3(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 nT(t){return new RegExp(`^${M3(t)}$`)}function rT(t){let e=`${R3}T${M3(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 aT(t,e){return!!((e==="v4"||!e)&&YE.test(t)||(e==="v6"||!e)&&XE.test(t))}function sT(t,e){if(!qE.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),a=JSON.parse(atob(r));return!(typeof a!="object"||a===null||"typ"in a&&(a==null?void 0:a.typ)!=="JWT"||!a.alg||e&&a.alg!==e)}catch{return!1}}function iT(t,e){return!!((e==="v4"||!e)&&ZE.test(t)||(e==="v6"||!e)&&QE.test(t))}class bs extends yt{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==De.string){const i=this._getOrReturnCtx(e);return Ae(i,{code:we.invalid_type,expected:De.string,received:i.parsedType}),Ze}const r=new nr;let a;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(a=this._getOrReturnCtx(e,a),Ae(a,{code:we.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")e.data.length>i.value&&(a=this._getOrReturnCtx(e,a),Ae(a,{code:we.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const l=e.data.length>i.value,c=e.data.length<i.value;(l||c)&&(a=this._getOrReturnCtx(e,a),l?Ae(a,{code:we.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):c&&Ae(a,{code:we.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")WE.test(e.data)||(a=this._getOrReturnCtx(e,a),Ae(a,{validation:"email",code:we.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")im||(im=new RegExp(KE,"u")),im.test(e.data)||(a=this._getOrReturnCtx(e,a),Ae(a,{validation:"emoji",code:we.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")HE.test(e.data)||(a=this._getOrReturnCtx(e,a),Ae(a,{validation:"uuid",code:we.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")GE.test(e.data)||(a=this._getOrReturnCtx(e,a),Ae(a,{validation:"nanoid",code:we.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")$E.test(e.data)||(a=this._getOrReturnCtx(e,a),Ae(a,{validation:"cuid",code:we.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")FE.test(e.data)||(a=this._getOrReturnCtx(e,a),Ae(a,{validation:"cuid2",code:we.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")UE.test(e.data)||(a=this._getOrReturnCtx(e,a),Ae(a,{validation:"ulid",code:we.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),Ae(a,{validation:"url",code:we.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),Ae(a,{validation:"regex",code:we.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(a=this._getOrReturnCtx(e,a),Ae(a,{code:we.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.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)||(a=this._getOrReturnCtx(e,a),Ae(a,{code:we.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(a=this._getOrReturnCtx(e,a),Ae(a,{code:we.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?rT(i).test(e.data)||(a=this._getOrReturnCtx(e,a),Ae(a,{code:we.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?tT.test(e.data)||(a=this._getOrReturnCtx(e,a),Ae(a,{code:we.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?nT(i).test(e.data)||(a=this._getOrReturnCtx(e,a),Ae(a,{code:we.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?VE.test(e.data)||(a=this._getOrReturnCtx(e,a),Ae(a,{validation:"duration",code:we.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?aT(e.data,i.version)||(a=this._getOrReturnCtx(e,a),Ae(a,{validation:"ip",code:we.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?sT(e.data,i.alg)||(a=this._getOrReturnCtx(e,a),Ae(a,{validation:"jwt",code:we.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?iT(e.data,i.version)||(a=this._getOrReturnCtx(e,a),Ae(a,{validation:"cidr",code:we.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?JE.test(e.data)||(a=this._getOrReturnCtx(e,a),Ae(a,{validation:"base64",code:we.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?eT.test(e.data)||(a=this._getOrReturnCtx(e,a),Ae(a,{validation:"base64url",code:we.invalid_string,message:i.message}),r.dirty()):kt.assertNever(i);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(a=>e.test(a),{validation:n,code:we.invalid_string,...je.errToObj(r)})}_addCheck(e){return new bs({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...je.errToObj(e)})}url(e){return this._addCheck({kind:"url",...je.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...je.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...je.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...je.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...je.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...je.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...je.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...je.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...je.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...je.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...je.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...je.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,...je.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,...je.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...je.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...je.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...je.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...je.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...je.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...je.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...je.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...je.errToObj(n)})}nonempty(e){return this.min(1,je.errToObj(e))}trim(){return new bs({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new bs({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new bs({...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}}bs.create=t=>new bs({checks:[],typeName:We.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...lt(t)});function oT(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,a=n>r?n:r,i=Number.parseInt(t.toFixed(a).replace(".","")),l=Number.parseInt(e.toFixed(a).replace(".",""));return i%l/10**a}class bl extends yt{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)!==De.number){const i=this._getOrReturnCtx(e);return Ae(i,{code:we.invalid_type,expected:De.number,received:i.parsedType}),Ze}let r;const a=new nr;for(const i of this._def.checks)i.kind==="int"?kt.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),Ae(r,{code:we.invalid_type,expected:"integer",received:"float",message:i.message}),a.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),Ae(r,{code:we.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),Ae(r,{code:we.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="multipleOf"?oT(e.data,i.value)!==0&&(r=this._getOrReturnCtx(e,r),Ae(r,{code:we.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),Ae(r,{code:we.not_finite,message:i.message}),a.dirty()):kt.assertNever(i);return{status:a.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,je.toString(n))}gt(e,n){return this.setLimit("min",e,!1,je.toString(n))}lte(e,n){return this.setLimit("max",e,!0,je.toString(n))}lt(e,n){return this.setLimit("max",e,!1,je.toString(n))}setLimit(e,n,r,a){return new bl({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:je.toString(a)}]})}_addCheck(e){return new bl({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:je.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:je.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:je.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:je.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:je.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:je.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:je.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:je.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:je.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"&&kt.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}bl.create=t=>new bl({checks:[],typeName:We.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...lt(t)});class su extends yt{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)!==De.bigint)return this._getInvalidInput(e);let r;const a=new nr;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),Ae(r,{code:we.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),Ae(r,{code:we.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),Ae(r,{code:we.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):kt.assertNever(i);return{status:a.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return Ae(n,{code:we.invalid_type,expected:De.bigint,received:n.parsedType}),Ze}gte(e,n){return this.setLimit("min",e,!0,je.toString(n))}gt(e,n){return this.setLimit("min",e,!1,je.toString(n))}lte(e,n){return this.setLimit("max",e,!0,je.toString(n))}lt(e,n){return this.setLimit("max",e,!1,je.toString(n))}setLimit(e,n,r,a){return new su({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:je.toString(a)}]})}_addCheck(e){return new su({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:je.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:je.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:je.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:je.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:je.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}}su.create=t=>new su({checks:[],typeName:We.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...lt(t)});class vg extends yt{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==De.boolean){const r=this._getOrReturnCtx(e);return Ae(r,{code:we.invalid_type,expected:De.boolean,received:r.parsedType}),Ze}return ra(e.data)}}vg.create=t=>new vg({typeName:We.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...lt(t)});class I0 extends yt{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==De.date){const i=this._getOrReturnCtx(e);return Ae(i,{code:we.invalid_type,expected:De.date,received:i.parsedType}),Ze}if(Number.isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return Ae(i,{code:we.invalid_date}),Ze}const r=new nr;let a;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(a=this._getOrReturnCtx(e,a),Ae(a,{code:we.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(a=this._getOrReturnCtx(e,a),Ae(a,{code:we.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):kt.assertNever(i);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new I0({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:je.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:je.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}}I0.create=t=>new I0({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:We.ZodDate,...lt(t)});class Ux extends yt{_parse(e){if(this._getType(e)!==De.symbol){const r=this._getOrReturnCtx(e);return Ae(r,{code:we.invalid_type,expected:De.symbol,received:r.parsedType}),Ze}return ra(e.data)}}Ux.create=t=>new Ux({typeName:We.ZodSymbol,...lt(t)});class Hx extends yt{_parse(e){if(this._getType(e)!==De.undefined){const r=this._getOrReturnCtx(e);return Ae(r,{code:we.invalid_type,expected:De.undefined,received:r.parsedType}),Ze}return ra(e.data)}}Hx.create=t=>new Hx({typeName:We.ZodUndefined,...lt(t)});class Gx extends yt{_parse(e){if(this._getType(e)!==De.null){const r=this._getOrReturnCtx(e);return Ae(r,{code:we.invalid_type,expected:De.null,received:r.parsedType}),Ze}return ra(e.data)}}Gx.create=t=>new Gx({typeName:We.ZodNull,...lt(t)});class xg extends yt{constructor(){super(...arguments),this._any=!0}_parse(e){return ra(e.data)}}xg.create=t=>new xg({typeName:We.ZodAny,...lt(t)});class wg extends yt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ra(e.data)}}wg.create=t=>new wg({typeName:We.ZodUnknown,...lt(t)});class ki extends yt{_parse(e){const n=this._getOrReturnCtx(e);return Ae(n,{code:we.invalid_type,expected:De.never,received:n.parsedType}),Ze}}ki.create=t=>new ki({typeName:We.ZodNever,...lt(t)});class qx extends yt{_parse(e){if(this._getType(e)!==De.undefined){const r=this._getOrReturnCtx(e);return Ae(r,{code:we.invalid_type,expected:De.void,received:r.parsedType}),Ze}return ra(e.data)}}qx.create=t=>new qx({typeName:We.ZodVoid,...lt(t)});class La extends yt{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),a=this._def;if(n.parsedType!==De.array)return Ae(n,{code:we.invalid_type,expected:De.array,received:n.parsedType}),Ze;if(a.exactLength!==null){const l=n.data.length>a.exactLength.value,c=n.data.length<a.exactLength.value;(l||c)&&(Ae(n,{code:l?we.too_big:we.too_small,minimum:c?a.exactLength.value:void 0,maximum:l?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(a.minLength!==null&&n.data.length<a.minLength.value&&(Ae(n,{code:we.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),a.maxLength!==null&&n.data.length>a.maxLength.value&&(Ae(n,{code:we.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((l,c)=>a.type._parseAsync(new Ba(n,l,n.path,c)))).then(l=>nr.mergeArray(r,l));const i=[...n.data].map((l,c)=>a.type._parseSync(new Ba(n,l,n.path,c)));return nr.mergeArray(r,i)}get element(){return this._def.type}min(e,n){return new La({...this._def,minLength:{value:e,message:je.toString(n)}})}max(e,n){return new La({...this._def,maxLength:{value:e,message:je.toString(n)}})}length(e,n){return new La({...this._def,exactLength:{value:e,message:je.toString(n)}})}nonempty(e){return this.min(1,e)}}La.create=(t,e)=>new La({type:t,minLength:null,maxLength:null,exactLength:null,typeName:We.ZodArray,...lt(e)});function ol(t){if(t instanceof hn){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=bi.create(ol(r))}return new hn({...t._def,shape:()=>e})}else return t instanceof La?new La({...t._def,type:ol(t.element)}):t instanceof bi?bi.create(ol(t.unwrap())):t instanceof wl?wl.create(ol(t.unwrap())):t instanceof yo?yo.create(t.items.map(e=>ol(e))):t}class hn extends yt{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=kt.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==De.object){const h=this._getOrReturnCtx(e);return Ae(h,{code:we.invalid_type,expected:De.object,received:h.parsedType}),Ze}const{status:r,ctx:a}=this._processInputParams(e),{shape:i,keys:l}=this._getCached(),c=[];if(!(this._def.catchall instanceof ki&&this._def.unknownKeys==="strip"))for(const h in a.data)l.includes(h)||c.push(h);const d=[];for(const h of l){const p=i[h],m=a.data[h];d.push({key:{status:"valid",value:h},value:p._parse(new Ba(a,m,a.path,h)),alwaysSet:h in a.data})}if(this._def.catchall instanceof ki){const h=this._def.unknownKeys;if(h==="passthrough")for(const p of c)d.push({key:{status:"valid",value:p},value:{status:"valid",value:a.data[p]}});else if(h==="strict")c.length>0&&(Ae(a,{code:we.unrecognized_keys,keys:c}),r.dirty());else if(h!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const h=this._def.catchall;for(const p of c){const m=a.data[p];d.push({key:{status:"valid",value:p},value:h._parse(new Ba(a,m,a.path,p)),alwaysSet:p in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const h=[];for(const p of d){const m=await p.key,b=await p.value;h.push({key:m,value:b,alwaysSet:p.alwaysSet})}return h}).then(h=>nr.mergeObjectSync(r,h)):nr.mergeObjectSync(r,d)}get shape(){return this._def.shape()}strict(e){return je.errToObj,new hn({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var i,l;const a=((l=(i=this._def).errorMap)==null?void 0:l.call(i,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:je.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new hn({...this._def,unknownKeys:"strip"})}passthrough(){return new hn({...this._def,unknownKeys:"passthrough"})}extend(e){return new hn({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new hn({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:We.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new hn({...this._def,catchall:e})}pick(e){const n={};for(const r of kt.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new hn({...this._def,shape:()=>n})}omit(e){const n={};for(const r of kt.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new hn({...this._def,shape:()=>n})}deepPartial(){return ol(this)}partial(e){const n={};for(const r of kt.objectKeys(this.shape)){const a=this.shape[r];e&&!e[r]?n[r]=a:n[r]=a.optional()}return new hn({...this._def,shape:()=>n})}required(e){const n={};for(const r of kt.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof bi;)i=i._def.innerType;n[r]=i}return new hn({...this._def,shape:()=>n})}keyof(){return D3(kt.objectKeys(this.shape))}}hn.create=(t,e)=>new hn({shape:()=>t,unknownKeys:"strip",catchall:ki.create(),typeName:We.ZodObject,...lt(e)});hn.strictCreate=(t,e)=>new hn({shape:()=>t,unknownKeys:"strict",catchall:ki.create(),typeName:We.ZodObject,...lt(e)});hn.lazycreate=(t,e)=>new hn({shape:t,unknownKeys:"strip",catchall:ki.create(),typeName:We.ZodObject,...lt(e)});class P0 extends yt{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function a(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 ks(c.ctx.common.issues));return Ae(n,{code:we.invalid_union,unionErrors:l}),Ze}if(n.common.async)return Promise.all(r.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(a);{let i;const l=[];for(const d of r){const h={...n,common:{...n.common,issues:[]},parent:null},p=d._parseSync({data:n.data,path:n.path,parent:h});if(p.status==="valid")return p;p.status==="dirty"&&!i&&(i={result:p,ctx:h}),h.common.issues.length&&l.push(h.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const c=l.map(d=>new ks(d));return Ae(n,{code:we.invalid_union,unionErrors:c}),Ze}}get options(){return this._def.options}}P0.create=(t,e)=>new P0({options:t,typeName:We.ZodUnion,...lt(e)});function kg(t,e){const n=fi(t),r=fi(e);if(t===e)return{valid:!0,data:t};if(n===De.object&&r===De.object){const a=kt.objectKeys(e),i=kt.objectKeys(t).filter(c=>a.indexOf(c)!==-1),l={...t,...e};for(const c of i){const d=kg(t[c],e[c]);if(!d.valid)return{valid:!1};l[c]=d.data}return{valid:!0,data:l}}else if(n===De.array&&r===De.array){if(t.length!==e.length)return{valid:!1};const a=[];for(let i=0;i<t.length;i++){const l=t[i],c=e[i],d=kg(l,c);if(!d.valid)return{valid:!1};a.push(d.data)}return{valid:!0,data:a}}else return n===De.date&&r===De.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class z0 extends yt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),a=(i,l)=>{if(zx(i)||zx(l))return Ze;const c=kg(i.value,l.value);return c.valid?(($x(i)||$x(l))&&n.dirty(),{status:n.value,value:c.data}):(Ae(r,{code:we.invalid_intersection_types}),Ze)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,l])=>a(i,l)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}z0.create=(t,e,n)=>new z0({left:t,right:e,typeName:We.ZodIntersection,...lt(n)});class yo extends yt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==De.array)return Ae(r,{code:we.invalid_type,expected:De.array,received:r.parsedType}),Ze;if(r.data.length<this._def.items.length)return Ae(r,{code:we.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ze;!this._def.rest&&r.data.length>this._def.items.length&&(Ae(r,{code:we.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((l,c)=>{const d=this._def.items[c]||this._def.rest;return d?d._parse(new Ba(r,l,r.path,c)):null}).filter(l=>!!l);return r.common.async?Promise.all(i).then(l=>nr.mergeArray(n,l)):nr.mergeArray(n,i)}get items(){return this._def.items}rest(e){return new yo({...this._def,rest:e})}}yo.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new yo({items:t,typeName:We.ZodTuple,rest:null,...lt(e)})};class $0 extends yt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==De.object)return Ae(r,{code:we.invalid_type,expected:De.object,received:r.parsedType}),Ze;const a=[],i=this._def.keyType,l=this._def.valueType;for(const c in r.data)a.push({key:i._parse(new Ba(r,c,r.path,c)),value:l._parse(new Ba(r,r.data[c],r.path,c)),alwaysSet:c in r.data});return r.common.async?nr.mergeObjectAsync(n,a):nr.mergeObjectSync(n,a)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof yt?new $0({keyType:e,valueType:n,typeName:We.ZodRecord,...lt(r)}):new $0({keyType:bs.create(),valueType:e,typeName:We.ZodRecord,...lt(n)})}}class Vx extends yt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==De.map)return Ae(r,{code:we.invalid_type,expected:De.map,received:r.parsedType}),Ze;const a=this._def.keyType,i=this._def.valueType,l=[...r.data.entries()].map(([c,d],h)=>({key:a._parse(new Ba(r,c,r.path,[h,"key"])),value:i._parse(new Ba(r,d,r.path,[h,"value"]))}));if(r.common.async){const c=new Map;return Promise.resolve().then(async()=>{for(const d of l){const h=await d.key,p=await d.value;if(h.status==="aborted"||p.status==="aborted")return Ze;(h.status==="dirty"||p.status==="dirty")&&n.dirty(),c.set(h.value,p.value)}return{status:n.value,value:c}})}else{const c=new Map;for(const d of l){const h=d.key,p=d.value;if(h.status==="aborted"||p.status==="aborted")return Ze;(h.status==="dirty"||p.status==="dirty")&&n.dirty(),c.set(h.value,p.value)}return{status:n.value,value:c}}}}Vx.create=(t,e,n)=>new Vx({valueType:e,keyType:t,typeName:We.ZodMap,...lt(n)});class iu extends yt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==De.set)return Ae(r,{code:we.invalid_type,expected:De.set,received:r.parsedType}),Ze;const a=this._def;a.minSize!==null&&r.data.size<a.minSize.value&&(Ae(r,{code:we.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),n.dirty()),a.maxSize!==null&&r.data.size>a.maxSize.value&&(Ae(r,{code:we.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),n.dirty());const i=this._def.valueType;function l(d){const h=new Set;for(const p of d){if(p.status==="aborted")return Ze;p.status==="dirty"&&n.dirty(),h.add(p.value)}return{status:n.value,value:h}}const c=[...r.data.values()].map((d,h)=>i._parse(new Ba(r,d,r.path,h)));return r.common.async?Promise.all(c).then(d=>l(d)):l(c)}min(e,n){return new iu({...this._def,minSize:{value:e,message:je.toString(n)}})}max(e,n){return new iu({...this._def,maxSize:{value:e,message:je.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}iu.create=(t,e)=>new iu({valueType:t,minSize:null,maxSize:null,typeName:We.ZodSet,...lt(e)});class Wx extends yt{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})}}Wx.create=(t,e)=>new Wx({getter:t,typeName:We.ZodLazy,...lt(e)});class Sg extends yt{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return Ae(n,{received:n.data,code:we.invalid_literal,expected:this._def.value}),Ze}return{status:"valid",value:e.data}}get value(){return this._def.value}}Sg.create=(t,e)=>new Sg({value:t,typeName:We.ZodLiteral,...lt(e)});function D3(t,e){return new vl({values:t,typeName:We.ZodEnum,...lt(e)})}class vl extends yt{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return Ae(n,{expected:kt.joinValues(r),received:n.parsedType,code:we.invalid_type}),Ze}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return Ae(n,{received:n.data,code:we.invalid_enum_value,options:r}),Ze}return ra(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 vl.create(e,{...this._def,...n})}exclude(e,n=this._def){return vl.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}vl.create=D3;class Kx extends yt{_parse(e){const n=kt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==De.string&&r.parsedType!==De.number){const a=kt.objectValues(n);return Ae(r,{expected:kt.joinValues(a),received:r.parsedType,code:we.invalid_type}),Ze}if(this._cache||(this._cache=new Set(kt.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const a=kt.objectValues(n);return Ae(r,{received:r.data,code:we.invalid_enum_value,options:a}),Ze}return ra(e.data)}get enum(){return this._def.values}}Kx.create=(t,e)=>new Kx({values:t,typeName:We.ZodNativeEnum,...lt(e)});class F0 extends yt{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==De.promise&&n.common.async===!1)return Ae(n,{code:we.invalid_type,expected:De.promise,received:n.parsedType}),Ze;const r=n.parsedType===De.promise?n.data:Promise.resolve(n.data);return ra(r.then(a=>this._def.type.parseAsync(a,{path:n.path,errorMap:n.common.contextualErrorMap})))}}F0.create=(t,e)=>new F0({type:t,typeName:We.ZodPromise,...lt(e)});class xl extends yt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===We.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),a=this._def.effect||null,i={addIssue:l=>{Ae(r,l),l.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){const l=a.transform(r.data,i);if(r.common.async)return Promise.resolve(l).then(async c=>{if(n.value==="aborted")return Ze;const d=await this._def.schema._parseAsync({data:c,path:r.path,parent:r});return d.status==="aborted"?Ze:d.status==="dirty"||n.value==="dirty"?Pc(d.value):d});{if(n.value==="aborted")return Ze;const c=this._def.schema._parseSync({data:l,path:r.path,parent:r});return c.status==="aborted"?Ze:c.status==="dirty"||n.value==="dirty"?Pc(c.value):c}}if(a.type==="refinement"){const l=c=>{const d=a.refinement(c,i);if(r.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(r.common.async===!1){const c=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return c.status==="aborted"?Ze:(c.status==="dirty"&&n.dirty(),l(c.value),{status:n.value,value:c.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(c=>c.status==="aborted"?Ze:(c.status==="dirty"&&n.dirty(),l(c.value).then(()=>({status:n.value,value:c.value}))))}if(a.type==="transform")if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!yl(l))return Ze;const c=a.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:r.data,path:r.path,parent:r}).then(l=>yl(l)?Promise.resolve(a.transform(l.value,i)).then(c=>({status:n.value,value:c})):Ze);kt.assertNever(a)}}xl.create=(t,e,n)=>new xl({schema:t,typeName:We.ZodEffects,effect:e,...lt(n)});xl.createWithPreprocess=(t,e,n)=>new xl({schema:e,effect:{type:"preprocess",transform:t},typeName:We.ZodEffects,...lt(n)});class bi extends yt{_parse(e){return this._getType(e)===De.undefined?ra(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}bi.create=(t,e)=>new bi({innerType:t,typeName:We.ZodOptional,...lt(e)});class wl extends yt{_parse(e){return this._getType(e)===De.null?ra(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}wl.create=(t,e)=>new wl({innerType:t,typeName:We.ZodNullable,...lt(e)});class _g extends yt{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===De.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}_g.create=(t,e)=>new _g({innerType:t,typeName:We.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...lt(e)});class Cg extends yt{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return B0(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ks(r.common.issues)},input:r.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new ks(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Cg.create=(t,e)=>new Cg({innerType:t,typeName:We.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...lt(e)});class Yx extends yt{_parse(e){if(this._getType(e)!==De.nan){const r=this._getOrReturnCtx(e);return Ae(r,{code:we.invalid_type,expected:De.nan,received:r.parsedType}),Ze}return{status:"valid",value:e.data}}}Yx.create=t=>new Yx({typeName:We.ZodNaN,...lt(t)});class lT extends yt{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class j1 extends yt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Ze:i.status==="dirty"?(n.dirty(),Pc(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const a=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Ze:a.status==="dirty"?(n.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:r.path,parent:r})}}static create(e,n){return new j1({in:e,out:n,typeName:We.ZodPipeline})}}class Eg extends yt{_parse(e){const n=this._def.innerType._parse(e),r=a=>(yl(a)&&(a.value=Object.freeze(a.value)),a);return B0(n)?n.then(a=>r(a)):r(n)}unwrap(){return this._def.innerType}}Eg.create=(t,e)=>new Eg({innerType:t,typeName:We.ZodReadonly,...lt(e)});var We;(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"})(We||(We={}));const le=bs.create,Rt=bl.create,pa=vg.create,ro=xg.create,xu=wg.create;ki.create;const Na=La.create,et=hn.create,cT=P0.create;z0.create;yo.create;const uT=$0.create,B1=Sg.create,U0=vl.create;F0.create;bi.create;wl.create;function ne(t){return{schema:xu(),...t}}const yf=[];let Zx=new Set;function Mr(t){for(const e of t){if(Zx.has(e.type))throw new Error(`[protocol] duplicate event type: ${e.type}`);Zx.add(e.type),yf.push(e)}return t}function Wd(t){return yf.find(e=>e.type===t)}new Proxy({},{get:(t,e)=>{var n;return typeof e=="string"?(n=Wd(e))==null?void 0:n.schema:void 0},has:(t,e)=>{var n;return typeof e=="string"?!!((n=Wd(e))!=null&&n.schema):!1},ownKeys:()=>yf.map(t=>t.type),getOwnPropertyDescriptor:(t,e)=>{var n;return typeof e=="string"&&Wd(e)?{enumerable:!0,configurable:!0,value:(n=Wd(e))==null?void 0:n.schema}:void 0}});Mr([ne({type:"connected",description:"WebSocket 已连接",category:"session",emittedBy:["server"],handledByCli:!0,handledByWeb:!0}),ne({type:"session_created",description:"新会话已创建",category:"session",emittedBy:["server","core"],handledByCli:!0,handledByWeb:!0,note:"CLI/Web 均已处理(Web: systemHandlers session_created)",schema:et({id:le(),title:le().optional()}).partial()}),ne({type:"session_resumed",description:"会话从存储中恢复",category:"session",emittedBy:["core","server"],handledByCli:!0,handledByWeb:!0,note:"CLI/Web 均已处理(Web: systemHandlers session_resumed)",schema:et({id:le()}).partial()}),ne({type:"auth_required",description:"需要认证",category:"session",emittedBy:["server"],handledByCli:!0,handledByWeb:!0,note:"CLI 已处理(2026-07-18)"}),ne({type:"auth_success",description:"认证成功",category:"session",emittedBy:["server"],handledByCli:!0,handledByWeb:!0,note:"CLI 已处理(2026-07-18)"}),ne({type:"auth_failed",description:"认证失败",category:"session",emittedBy:["server"],handledByCli:!0,handledByWeb:!0,note:"CLI 已处理(2026-07-18)"}),ne({type:"message_ack",description:"消息确认",category:"session",emittedBy:["client"],handledByCli:!1,handledByWeb:!1,note:"CLI 发送给服务器的入站事件,无需 handler"}),ne({type:"workspace_changed",description:"工作空间已切换",category:"session",emittedBy:["server"],handledByCli:!0,handledByWeb:!0,schema:et({workspaceDir:le()}).partial()}),ne({type:"session_switched",description:"会话已切换",category:"session",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"CLI 已处理(2026-07-18); Web 已处理(切换 activeSessionId)",schema:et({id:le()}).partial()}),ne({type:"disconnected",description:"连接断开",category:"session",emittedBy:["server"],handledByCli:!0,handledByWeb:!0}),ne({type:"session_delegation_start",description:"会话 A 向会话 B 发起委派任务(send_to_session 工具)",category:"session",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"客户端把 task 作为一条系统消息展示在目标会话(B)时间线上;A 阻塞等待 B 完成",schema:et({fromSessionId:le(),fromTitle:le(),toSessionId:le(),toTitle:le(),task:le()}).partial()}),ne({type:"session_delegation_end",description:"会话委派任务完成(成功/失败)",category:"session",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"结果回填到 A 的 send_to_session 工具结果;客户端据此关闭目标会话的委派横幅",schema:et({fromSessionId:le(),toSessionId:le(),ok:pa(),summary:le()}).partial()}),ne({type:"session_direct_delivered",description:"用户消息经会话 A 直连投递给会话 B(deliverDirectMessage,不经 A 的模型)",category:"session",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"投递卡渲染在 A(邮局)的时间线;queued=true 表示 B 正在跑、已排队作新一轮(复用 delegationQueue 互斥门)",schema:et({fromSessionId:le(),fromTitle:le(),toSessionId:le(),toTitle:le(),text:le(),deliveryId:le(),traceId:le(),hopCount:Rt(),queued:pa()}).partial()}),ne({type:"session_direct_completed",description:"直连消息在会话 B 执行完成(成功/失败),结果转达回 A",category:"session",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"回复卡渲染在 A 的时间线:summary 是展示优化,outputMessageIds 是事实链(可回溯 B 的原始输出)",schema:et({fromSessionId:le(),toSessionId:le(),deliveryId:le(),traceId:le(),hopCount:Rt(),ok:pa(),status:le(),summary:le(),outputMessageIds:Na(le())}).partial()})]);Mr([ne({type:"start",description:"AI 开始生成",category:"stream",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ne({type:"content",description:"生成内容增量",category:"stream",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,schema:et({text:le(),content:le(),index:Rt()}).partial(),note:"载荷 { text, index }:index 为服务端稳定 block index(TurnEngine 每轮分配),客户端据此把多段正文与思考/工具按时间序穿插;content 为兼容旧字段"}),ne({type:"thinking",description:"思考过程增量",category:"stream",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,schema:et({text:le(),content:le(),index:Rt()}).partial(),note:"载荷 { text, index }:index 为服务端稳定 block index,客户端按 index upsert 成独立思考块(工具调用前后各一段)"}),ne({type:"tool_call",description:"工具调用流式增量",category:"stream",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ne({type:"tool_result",description:"工具执行结果",category:"stream",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ne({type:"tool_execution_start",description:"工具执行阶段开始(无流事件时段开始)",category:"stream",emittedBy:["core"],handledByCli:!1,handledByWeb:!1,note:"纯 core 内部遥测:供运行时暂停/恢复 stall 心跳与全局看门狗;CLI/Web 无 handler(前端无需展示),仅 queryEngine 消费",intentionalGap:!0}),ne({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}),ne({type:"tool_diff",description:"工具执行中的参数 diff 增量(P0-2 diffConsumer 生产者推送)",category:"stream",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ne({type:"step_start",description:"步骤开始",category:"stream",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ne({type:"step_thinking",description:"步骤思考",category:"stream",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ne({type:"step_action",description:"步骤动作",category:"stream",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ne({type:"step_complete",description:"步骤完成",category:"stream",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ne({type:"turn_summary",description:"回合结束摘要(思考时长+工具计数+头条)",category:"stream",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"CLI/Web 渲染为折叠摘要行(Thought for Ns, ran N …)"}),ne({type:"cache_stats",description:"本轮 run 前缀缓存命中统计(命中/未命中 token、命中率、调用次数)",category:"stream",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"run 结束时由 queryEngine 发送;CLI/Web 在模型名旁展示命中率",schema:et({cacheHitTokens:Rt(),cacheMissTokens:Rt(),cacheHitRate:Rt().optional(),cacheStatsCalls:Rt()}).partial()}),ne({type:"web_search",description:"模型内置联网搜索状态(DeepSeek Responses web_search_call:searching/completed/failed)",category:"stream",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"由服务端执行搜索,客户端仅展示状态(🔍搜索中 → ✅完成)",schema:et({state:le()}).partial()}),ne({type:"progress",description:"通用进度(当前未使用)",category:"stream",emittedBy:["none"],handledByCli:!1,handledByWeb:!1,deprecated:!0,note:"已定义但从未发送;SendMessageTool 的 progress 是消息类型而非 WS 事件"}),ne({type:"complete",description:"生成完成",category:"stream",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ne({type:"error",description:"生成错误",category:"stream",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,schema:et({message:le()}).partial()}),ne({type:"generation_paused",description:"生成已暂停",category:"stream",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ne({type:"generation_resumed",description:"生成已恢复",category:"stream",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ne({type:"stall_detected",description:"流级卡死检测(自动重试/通知)",category:"stream",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"由 StreamHeartbeat 或 StallDetector 触发;CLI/Web 显示重试进度"}),ne({type:"task_interrupted",description:"任务中断(服务重启/异常退出)",category:"stream",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"服务启动扫描时将 running activeRun 标记为 interrupted 后触发;提示用户使用 /continue 恢复生成,或用 /resume 切换会话"}),ne({type:"step_prompt",description:"步骤提示(Web 路由用)",category:"stream",emittedBy:["none"],handledByCli:!1,handledByWeb:!0,note:"Web 路由的内部事件,不通过 WS 发送"})]);Mr([ne({type:"plan_start",description:"计划开始",category:"plan",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"由 EnterPlanMode 工具 emit"}),ne({type:"plan_thinking",description:"计划思考",category:"plan",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ne({type:"plan_tasks",description:"计划任务列表生成",category:"plan",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"由 ExitPlanMode 工具 emit(解析计划内容为任务列表);CLI handler 解析 data.tasks",schema:et({tasks:Na(ro())}).partial()}),ne({type:"plan_task_start",description:"计划任务开始",category:"plan",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ne({type:"plan_task_update",description:"计划任务更新",category:"plan",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ne({type:"plan_task_result",description:"计划任务结果",category:"plan",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ne({type:"plan_complete",description:"计划完成",category:"plan",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"由 ExitPlanMode 工具 emit(携带 currentPlan/proposedPlan)"}),ne({type:"plan_error",description:"计划错误",category:"plan",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ne({type:"plan_mode_change",description:"计划模式切换",category:"plan",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"CLI 已添加 handler(2026-07-01);Web planHandlers 已处理(2026-08-07)"}),ne({type:"plan_mode_enter",description:"进入计划模式(CLI 遗留)",category:"plan",emittedBy:["none"],handledByCli:!0,handledByWeb:!0,deprecated:!0,note:"兼容遗留代码,应改用 plan_mode_change"}),ne({type:"plan_mode_exit",description:"退出计划模式(CLI 遗留)",category:"plan",emittedBy:["none"],handledByCli:!0,handledByWeb:!0,deprecated:!0,note:"兼容遗留代码,应改用 plan_mode_change"}),ne({type:"plan_confirm",description:"计划等待确认",category:"plan",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"CLI 已处理(2026-07-18); Web planHandlers 已处理(2026-08-07)"}),ne({type:"plan_waiting",description:"计划等待用户输入",category:"plan",emittedBy:["none"],handledByCli:!0,handledByWeb:!1,note:"核心未发射(仅 CLI 兼容订阅),已从 emittedBy 移除 core"}),ne({type:"plan_continue",description:"计划继续执行",category:"plan",emittedBy:["none"],handledByCli:!0,handledByWeb:!1,note:"核心未发射(仅 CLI 兼容订阅),已从 emittedBy 移除 core"}),ne({type:"plan_settled",description:"计划已定稿",category:"plan",emittedBy:["none"],handledByCli:!0,handledByWeb:!1,note:"核心未发射(仅 CLI 兼容订阅),已从 emittedBy 移除 core"}),ne({type:"plan_cleared",description:"计划已清除",category:"plan",emittedBy:["none"],handledByCli:!0,handledByWeb:!1,note:"核心未发射(仅 CLI 兼容订阅),已从 emittedBy 移除 core"}),ne({type:"user_exit_plan_mode",description:"用户手动退出计划模式",category:"plan",emittedBy:["client"],handledByCli:!1,handledByWeb:!1,note:"入站事件(CLI→服务器),客户端无需 handler"}),ne({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:et({id:le(),title:le(),status:le(),result:le().optional(),error:le().optional()}).partial()}),ne({type:"plan_subagent_start",description:"Plan 设计子代理启动",category:"plan",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"PlanSubAgentTool 启动只读设计子代理时 emit;data 携带 scope/agentId/planSlug/title",schema:et({scope:le(),agentId:le(),planSlug:le().optional(),title:le().optional()}).partial()}),ne({type:"plan_subagent_done",description:"Plan 设计子代理完成",category:"plan",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"PlanSubAgentTool 子代理完成(成功或失败)时 emit;data 携带 scope/agentId/status/designDocPath/error",schema:et({scope:le(),agentId:le(),status:le(),designDocPath:le().optional(),error:le().optional()}).partial()}),ne({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"})]);Mr([ne({type:"token_update",description:"Token 用量更新",category:"context",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ne({type:"context_compressed",description:"上下文已压缩",category:"context",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ne({type:"compaction_progress",description:"压缩进度更新",category:"context",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ne({type:"context_analysis",description:"上下文分布分析",category:"context",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"CLI 已处理(2026-07-18); Web 有 handler 但路由不可达"}),ne({type:"threshold_warning",description:"Token 阈值警告",category:"context",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"CLI 已处理(2026-07-18); Web 有 handler 但路由不可达"}),ne({type:"threshold_error",description:"Token 阈值错误",category:"context",emittedBy:["none"],handledByCli:!1,handledByWeb:!1,deprecated:!0,note:"功能存在但被 context_blocked 覆盖,事件未使用"}),ne({type:"context_blocked",description:"上下文已满,生成被阻止",category:"context",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"CLI 已处理(2026-07-18); Web 有 handler 但路由不可达"}),ne({type:"blocking_limit",description:"已达到阻止极限",category:"context",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"CLI 已处理(2026-07-18); Web 有 handler 但路由不可达"}),ne({type:"compaction_started",description:"压缩任务已启动(phase/trigger)",category:"context",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ne({type:"compaction_finished",description:"压缩任务结束(done/failed/aborted)",category:"context",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ne({type:"tool_retry",description:"工具重试",category:"context",emittedBy:["none"],handledByCli:!1,handledByWeb:!0,deprecated:!0,note:"重试信息已含于 tool_result/error,Web handler 保留但路由不可达"}),ne({type:"model_fallback",description:"模型回退",category:"context",emittedBy:["none"],handledByCli:!1,handledByWeb:!0,deprecated:!0,note:"降级信息已含于 degradation_update,Web handler 保留但路由不可达"}),ne({type:"usage",description:"Token 用量",category:"context",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ne({type:"context_breakdown",description:"上下文容量分类占比(系统提示词/消息/工具/技能/MCP),供 Web 底部上下文条抽屉展示",category:"context",emittedBy:["core"],handledByCli:!1,handledByWeb:!0,note:"每轮 query 上下文组装后估算各组件 token,Web 端点状态栏上下文条上拉展示",intentionalGap:!0})]);Mr([ne({type:"workflow_started",description:"工作流已启动",category:"workflow",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"data.nodes 携带 LLM 合成完整节点清单(含 type/children/priority,前端可分层渲染)",schema:et({workflowId:le().optional(),title:le().optional(),goalId:le().optional(),totalNodes:Rt().optional(),nodes:Na(ro()).optional()}).partial()}),ne({type:"workflow_event",description:"工作流事件",category:"workflow",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ne({type:"workflow_progress",description:"工作流进度",category:"workflow",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"nodeStatuses: 逐节点状态全量映射(断线重连可重建视图)",schema:et({runId:le().optional(),status:le().optional(),completedNodes:Rt().optional(),totalNodes:Rt().optional(),tokensUsed:Rt().optional(),tokensRemaining:Rt().optional(),currentNodeId:le().optional(),nodeStatuses:uT(le(),le()).optional()}).partial()}),ne({type:"workflow_finished",description:"工作流完成",category:"workflow",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,schema:et({runId:le().optional(),status:le().optional(),output:ro().optional(),error:le().optional()}).partial()}),ne({type:"workflow_error",description:"工作流错误",category:"workflow",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ne({type:"workflow_checkpoint",description:"工作流检查点",category:"workflow",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ne({type:"workflow_node_start",description:"工作流节点开始",category:"workflow",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,schema:et({nodeId:le().optional(),title:le().optional(),type:le().optional()}).partial()}),ne({type:"workflow_node_complete",description:"工作流节点完成",category:"workflow",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"durationMs: 节点耗时;attempts: retry 重试次数(retry 原语节点)",schema:et({nodeId:le().optional(),title:le().optional(),status:le().optional(),result:ro().optional(),error:le().optional(),durationMs:Rt().optional(),attempts:Rt().optional()}).partial()}),ne({type:"workflow_node_retry",description:"工作流节点重试(retry 原语每次重试发出)",category:"workflow",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"attempt > 1 时发出;reason 为上一次尝试的失败原因",schema:et({nodeId:le().optional(),childId:le().optional(),attempt:Rt().optional(),maxAttempts:Rt().optional(),reason:le().optional()}).partial()}),ne({type:"workflow_paused",description:"工作流已暂停",category:"workflow",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ne({type:"workflow_resumed",description:"工作流已恢复",category:"workflow",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ne({type:"workflow_cancelled",description:"工作流已取消",category:"workflow",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ne({type:"workflow_recovered",description:"工作流已恢复(从故障)",category:"workflow",emittedBy:["none"],handledByCli:!1,handledByWeb:!1,deprecated:!0,note:"已被 workflow_resumed 覆盖,核心从未发送"}),ne({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 兼容旧服务端回放"}),ne({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:et({planId:le(),title:le().optional(),reason:le().optional(),confirm:pa().optional(),nodes:Na(ro()).optional(),parallelGroups:Na(Na(le())).optional(),estimatedTokens:Rt().optional(),runtimeAvailable:pa().optional()}).partial()}),ne({type:"workflow_confirm_ack",description:"工作流提案确认结果(start/cancel/change/runtime)",category:"workflow",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,schema:et({planId:le().optional(),action:le().optional(),ok:pa().optional(),auto:pa().optional()}).partial()}),ne({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:et({runs:Na(ro()).optional()}).partial()})]);Mr([ne({type:"dwf_offer",description:"动态工作流确认请求(模型写了 _<name>_workflow.js,询问是否运行)",category:"workflow",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"回合尾嗅探到新写的 workflow 脚本时发出;用户经 dwf_confirm(run|view|no) 应答;执行期进度复用 workflow_* 事件",schema:et({offerId:le(),sessionId:le().optional(),fileName:le(),filePath:le().optional(),title:le().optional(),description:le().optional(),phases:Na(et({title:le(),detail:le().optional()})).optional(),agentCount:Rt().optional(),scriptPreview:le().optional(),tokenWarning:le().optional()}).partial()}),ne({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:et({offerId:le(),action:le(),ok:pa(),scriptPreview:le().optional(),error:le().optional()}).partial()}),ne({type:"dwf_cancelled",description:"动态工作流已取消(用户 no / 运行中取消)",category:"workflow",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,schema:et({offerId:le().optional(),runId:le().optional(),reason:le().optional()}).partial()}),ne({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:et({workflowId:le(),sessionId:le().optional(),name:le().optional(),runs:Rt().optional(),successRate:Rt().optional(),avgTokens:Rt().optional(),lastRunAt:Rt().optional()}).partial()}),ne({type:"dwf_promote_ack",description:"沉淀为模板的结果回执(处理 dwf_promote 后)",category:"workflow",emittedBy:["server"],handledByCli:!0,handledByWeb:!0,schema:et({workflowId:le(),ok:pa(),templateId:le().optional(),reason:le().optional()}).partial()})]);Mr([ne({type:"task_update",description:"任务更新",category:"task",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"CLI 已添加 handler(2026-07-01)"}),ne({type:"task_output",description:"任务输出",category:"task",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"CLI 已添加 handler(2026-07-01)"}),ne({type:"task_finished",description:"任务完成",category:"task",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"CLI 已添加 handler(2026-07-01)"}),ne({type:"task_error",description:"任务错误",category:"task",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"CLI 已添加 handler(2026-07-01)"}),ne({type:"filejob_start",description:"文件处理任务开始(解析/渲染)",category:"task",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"对话内嵌文件处理面板;Web 已处理,CLI 已处理(2026-08-07 状态行)"}),ne({type:"filejob_progress",description:"文件处理进度更新",category:"task",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"解析/渲染进度百分比",schema:et({progress:Rt()}).partial()}),ne({type:"filejob_result",description:"文件处理完成(结果文件列表)",category:"task",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"携带 RenderedFileResult[]",schema:Na(ro())}),ne({type:"filejob_error",description:"文件处理失败",category:"task",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"脱敏错误详情"})]);Mr([ne({type:"goal_created",description:"目标已创建",category:"goal",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"2026-07-21: Web handled via goal_tasks/goal_task_update"}),ne({type:"goal_tasks",description:"目标任务列表(批量初始化看板)",category:"goal",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"2026-07-21: 统一看板数据源"}),ne({type:"goal_task_update",description:"目标任务更新",category:"goal",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"2026-07-21: Web 已添加 handler"}),ne({type:"goal_update",description:"目标元信息更新(retitle / 看板整体刷新)",category:"goal",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"漂移修复:goalManager.retitle / GoalTool 此前已在发射但未注册;tasks 为空数组时 Web 清空看板"}),ne({type:"goal_completed",description:"目标已完成(workflow 终态自动推导)",category:"goal",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"2026-08-14: 此前 goals.complete() 无任何调用点,goal 工作流跑完后 goal 永远停在 active —— 新增终态事件供两端对账"}),ne({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:et({tier:U0(["simple","medium","hard"]),summary:le().optional(),source:U0(["override","llm","fallback"]).optional(),latencyMs:Rt().optional(),reason:le().optional(),confidence:Rt().optional(),goalId:le().optional(),runId:le().optional(),message:le().optional()}).partial()})]);Mr([ne({type:"hook_ask",description:"Hook 审批请求",category:"hook",emittedBy:["server"],handledByCli:!0,handledByWeb:!0}),ne({type:"hook_allow",description:"Hook 允许响应",category:"hook",emittedBy:["client"],handledByCli:!1,handledByWeb:!1,note:"入站事件(CLI→服务器),无需 handler"}),ne({type:"hook_deny",description:"Hook 拒绝响应",category:"hook",emittedBy:["client"],handledByCli:!1,handledByWeb:!1,note:"入站事件(CLI→服务器),无需 handler"}),ne({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)"}),ne({type:"ask_user_question",description:"向用户提问",category:"hook",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ne({type:"question_answer_ack",description:"提问回答确认",category:"hook",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"Web useWebSocket 已处理(dismiss 提问弹窗)"}),ne({type:"hook_auto_ack",description:"Hook 自动模式确认",category:"hook",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"Web 已处理(2026-08-07 toast 提示)"}),ne({type:"tool.approval_required",description:"工具调用需要审批(无人值守运行触发,未放行即拒绝)",category:"hook",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"无人值守/定时运行写操作需审批的通知;Inbox 审批队列已退役,Web 显式 no-op,CLI 走 hook 链审批"})]);Mr([ne({type:"mcp_update",description:"MCP 状态更新",category:"mcp",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"CLI 已添加 handler(2026-07-01)"})]);Mr([ne({type:"doctor_result",description:"诊断完成",category:"diagnostic",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ne({type:"degradation",description:"降级状态更新(遗留)",category:"diagnostic",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ne({type:"degradation_update",description:"降级状态更新",category:"diagnostic",emittedBy:["core"],handledByCli:!0,handledByWeb:!0})]);Mr([ne({type:"commands_list",description:"命令列表(服务器→客户端)",category:"system",emittedBy:["core","server"],handledByCli:!0,handledByWeb:!0,note:"CLI 已处理(setDynamicCommands); Web systemHandlers 已处理(2026-08-07)"}),ne({type:"ping",description:"心跳 Ping",category:"system",emittedBy:["client"],handledByCli:!1,handledByWeb:!1,note:"由 Server 的 WS 层自动处理"}),ne({type:"pong",description:"心跳 Pong",category:"system",emittedBy:["server"],handledByCli:!1,handledByWeb:!1,note:"由 Client 的 WS 层自动处理"}),ne({type:"log",description:"服务端日志",category:"system",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ne({type:"notification",description:"通知消息",category:"system",emittedBy:["server"],handledByCli:!0,handledByWeb:!0}),ne({type:"channel_message",description:"频道入站消息(转发到 Web UI)",category:"system",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"CLI 已处理(2026-07-18); Web 已处理(2026-08-07 通知)"}),ne({type:"channel_status",description:"频道连接状态变更",category:"system",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"CLI 已处理(2026-07-18); Web 已处理(channelsStore)"}),ne({type:"channel_error",description:"频道运行时错误",category:"system",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"CLI 已处理(2026-07-18); Web 已处理(2026-08-07 通知)"}),ne({type:"todo_update",description:"待办事项更新",category:"system",emittedBy:["core"],handledByCli:!0,handledByWeb:!0}),ne({type:"todo_item_done",description:"待办项完成",category:"system",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"运行时可能发送"}),ne({type:"todo_progress",description:"待办进度",category:"system",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"运行时可能发送"}),ne({type:"tombstone",description:"消息已删除/墓碑",category:"system",emittedBy:["none"],handledByCli:!1,handledByWeb:!1,deprecated:!0,note:"Web/CLI 本地消息删除渲染概念,无 WS 发射端"}),ne({type:"status",description:"状态更新(modelName/connected/statusText)",category:"system",emittedBy:["core","server"],handledByCli:!0,handledByWeb:!0,schema:et({modelName:le(),connected:pa(),statusText:le()}).partial()}),ne({type:"model_name",description:"当前模型名称",category:"system",emittedBy:["core","server"],handledByCli:!0,handledByWeb:!0,schema:et({model:le(),modelRef:le(),source:U0(["session","mode","global"]),data:le()}).partial(),note:"model 顶层裸模型 id;modelRef 为 provider:model 复合身份(同 id 多 provider 去歧义,CLI/Web 状态行 + 模型选择器用);source 标记模型来源 session/mode/global(session = 仅本会话切换)"}),ne({type:"models_updated",description:"模型列表已更新(models.dev 快照刷新后广播)",category:"system",emittedBy:["server"],handledByCli:!1,handledByWeb:!1,note:"漂移修复:app.ts 模型端点写入后全量广播,但此前未注册;两端尚未接 handler,先做类型层登记"}),ne({type:"throttle",description:"速率限制状态",category:"system",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"Web 已处理(2026-08-07 toast 提示)"}),ne({type:"code_review_ready",description:"代码审查结果就绪",category:"system",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"Web 已处理(2026-08-07 toast 提示)"}),ne({type:"pdca_phase",description:"PDCA 循环阶段",category:"system",emittedBy:["none"],handledByCli:!0,handledByWeb:!1,deprecated:!0,note:"已退役:5-phase light pipeline 被 WorkflowRuntime 取代"}),ne({type:"command_start",description:"命令开始(Web 路由用)",category:"system",emittedBy:["none"],handledByCli:!1,handledByWeb:!0,deprecated:!0,note:"Web systemHandler 有 case 但核心无发送方,保留兼容"}),ne({type:"command_complete",description:"命令完成(Web 路由用)",category:"system",emittedBy:["none"],handledByCli:!1,handledByWeb:!0,deprecated:!0,note:"Web systemHandler 有 case 但核心无发送方,保留兼容"}),ne({type:"command_error",description:"命令错误(Web 路由用)",category:"system",emittedBy:["core"],handledByCli:!0,handledByWeb:!0,note:"core index.ts:1270 真实 emit;CLI useStreamHandlers:741 与 Web systemHandlers 均已处理"})]);Mr([ne({type:"automation.update",description:"自动化任务新增/更新/删除/状态变更",category:"automation",emittedBy:["server"],handledByCli:!0,handledByWeb:!0,note:"REST /api/automations 已可用;Web 自动化视图消费"}),ne({type:"automation.run",description:"自动化触发运行(started/finished/error)",category:"automation",emittedBy:["core","server"],handledByCli:!0,handledByWeb:!0,note:"CLI 状态提示;Web RunDetail 消费"})]);const dT=/^[a-z][a-z0-9._-]*$/,H0=le().min(1).max(128).regex(dT,"command id must match ^[a-z][a-z0-9._-]*$");et({id:le().min(1).max(128),command:H0,payload:xu().optional(),timeoutMs:Rt().int().positive().max(3e5).optional(),sender:le().max(128).optional()});et({success:pa(),requestId:le(),command:H0,result:xu().optional(),error:le().optional(),durationMs:Rt().min(0).optional()});const fT=et({capability:H0,command:H0,description:le().max(500).optional(),provider:le().max(128).optional()});et({version:B1("1"),capabilities:Na(fT)});const hT="1",pT=["ready","select","inspect","screenshot","highlight","command","event"],mT=et({version:B1(hT),type:U0(pT),requestId:le().min(1).max(128),payload:xu().optional()}).passthrough();et({type:le().min(1).max(128).regex(/^[a-z][a-z0-9._-]*$/,"event type must match ^[a-z][a-z0-9._-]*$"),payload:xu().optional(),source:le().max(128).optional(),timestamp:Rt().nonnegative().optional()});const gT="workspace_event";et({type:B1(gT),sessionId:le().optional(),data:cT([le(),mT]).optional(),traceId:le().optional()});const yT=yf.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}:{}})),bT=/^\s*\*\*\*\s+(?:Add|Update|Delete)\s+File:\s*(.+?)\s*$/,vT=/^\s*\*\*\*\s+Move\s+to:\s*(.+?)\s*$/;function O3(t){if(!t)return[];const e=[],n=new Set;for(const r of t.split(/\r?\n/)){const a=r.trim();if(!a.startsWith("***"))continue;const i=bT.exec(a),l=i?null:vT.exec(a),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 xT=["/etc/","/usr/lib/","/boot/","/dev/","/sys/","/proc/","C:\\Windows\\","C:\\Program Files\\"];function wT(t){if(!t)return!1;const e=t.replace(/\\/g,"/"),n=e.toLowerCase();return xT.some(r=>{const a=r.replace(/\\/g,"/"),i=a.endsWith("/")?a.slice(0,-1):a;return/^[a-z]:\//i.test(a)?n===i.toLowerCase()||n.startsWith(a.toLowerCase()):e===i||e.startsWith(a)})}function Xx(t){return t.find(e=>e&&wT(e))??null}function Zr(t){return t==="auto-plan"?"plan":t==="auto-act"?"act":t==="auto-goal"?"goal":t}function dl(t){return t==="auto-plan"||t==="auto-act"||t==="auto-goal"}function kT(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 wF=["plan","act","goal"];function Tg(t,e){return e?t==="plan"?"auto-plan":t==="act"?"auto-act":"auto-goal":t}function ST(t){const e=["plan","act","goal"],n=e.indexOf(Zr(t)),r=e[(n+1)%e.length]??"act";return Tg(r,dl(t))}const _T={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"}},kF={low:{label:"Low",accent:"green"},medium:{label:"Medium",accent:"cyan"},high:{label:"High",accent:"yellow"},critical:{label:"Critical",accent:"red"}},SF={allow:{label:"Allow"},deny:{label:"Deny"},allow_session:{label:"Allow session"},auto:{label:"Auto mode"}};function CT(t){return t==="plan"||t==="auto-plan"||t==="act"||t==="auto-act"||t==="goal"||t==="auto-goal"?t:"auto-act"}function Dc(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${Math.round(t/1e3)}K`:String(t)}function ET(t){return t<=0?"":t>=100?`${Math.round(t)}tok/s`:`${t.toFixed(1)}tok/s`}function TT(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 AT(t=4e3){let n=[];const r=a=>{const i=a-t;for(;n.length>0&&n[0].ts<i;)n.shift()};return{feed(a,i=Date.now()){const l=TT(a);l<=0||(r(i),n.push({ts:i,tokens:l}))},rate(a=Date.now()){if(r(a),n.length===0)return 0;let i=0;for(const c of n)i+=c.tokens;const l=Math.max(a-n[0].ts,500);return i/l*1e3},reset(){n=[]}}}function L3(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 NT(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":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 _F(t){const e=Object.entries(t.toolCounts).filter(([,a])=>a>0).sort((a,i)=>i[1]-a[1]),n=t.headline||`Thought for ${L3(Math.max(1,Math.round(t.durationMs/1e3)))}`,r=e.map(([a,i])=>NT(a,i));return r.length>0?`${n}, ${r.join(", ")}`:n}function RT(t,e){const n=t.toLowerCase(),r=new Set(n.split(/[^a-z0-9]+/).filter(Boolean)),a=(...i)=>i.some(l=>r.has(l));return n==="apply_patch"?Xx(O3(j3(e)))?"critical":"high":a("rm","del","delete","drop","truncate","format","mkfs")?"critical":a("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":a("write","edit","save","upload","deploy","publish")?Xx(DT(e))?"critical":"high":a("install","uninstall","npm","pip","cargo","gem","apt","brew","choco","yum","dnf")?"high":a("git","commit","push","merge","rebase")?/\b(push|force|hard\s*reset|rebase)\b/i.test(e)?"high":"medium":a("http","fetch","curl","wget","api","request","download")?"medium":a("read","open","list","ls","dir","cat","view","search","find","grep","glob")?"low":"medium"}function j3(t){if(!t)return"";try{const e=JSON.parse(t);if(!e||typeof e!="object")return t;const n=e,a=(n.payload&&typeof n.payload=="object"?n.payload:n).patch;return typeof a=="string"?a:t}catch{return t}}const MT=new Set(["file_path","filePath","filepath","path","notebook_path","notebookPath","file"]);function DT(t){if(!t)return[];const e=[],n=new Set,r=i=>{typeof i=="string"&&i.trim()&&!n.has(i)&&(n.add(i),e.push(i))},a=(i,l)=>{if(!(l>4||!i||typeof i!="object")){if(Array.isArray(i)){for(const c of i)r(c),a(c,l+1);return}for(const[c,d]of Object.entries(i))MT.has(c)?(r(d),Array.isArray(d)&&d.forEach(r)):a(d,l+1)}};try{a(JSON.parse(t),0)}catch{}if(e.length===0)for(const i of t.matchAll(/(?:file_path|filePath|path|file)["\s:=]+([^\s",}]+)/gi))r(i[1]);return e}function OT(t,e){if(e==null)return null;if(/apply_patch/i.test(t)){const n=j3(e),r=O3(n),a=r.length>0?r.join(`
29
- `):"(no file markers found)",i=n.split(/\r?\n/).slice(0,12).join(`
30
- `);return`${a}
31
- ${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]}
32
- ${e.slice(0,200)}`:e.slice(0,200)||null}return e&&e.length>0?e.length>200?`${e.slice(0,200)}...`:e:null}function Qx(t){const n=(String(t||"").trim().replace(/^v/i,"").split(/[-+]/)[0]??"").split(".").map(r=>parseInt(r,10));for(;n.length<3;)n.push(0);return n.map(r=>Number.isFinite(r)?r:0)}function LT(t,e){const n=Qx(t),r=Qx(e);for(let a=0;a<3;a+=1){const i=n[a]??0,l=r[a]??0;if(i!==l)return i-l}return 0}const G0=[{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=r=>{if(r)return e==="zh"?r.zh:r.en};return{version:t.version,date:t.date,title:n(t.title),items:t.items.map(r=>e==="zh"?r.zh:r.en)}}function BT(t){return t?G0.filter(e=>LT(e.version,t)>0):G0}function IT(){const t=G0[0];return t?t.version:null}function PT(t,e,n,r,a=500){return t>0?"revokeQueue":e||n>0&&r-n<a?"stop":"pause"}const CF=["openai-chat-completions","openai-completions","openai-responses","anthropic-messages","codex-responses","claude-code"];yT.map(t=>t.eventType);function zT(){return`err-${Date.now()}-${Math.random().toString(36).slice(2,7)}`}const fl=gn(t=>({errors:[],push:(e,n,r,a,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 h=zT();l=h;const p={id:h,level:e,title:n,detail:r,action:a,timestamp:Date.now(),dismissed:!1,durationMs:i,count:1};return{errors:[...c.errors.slice(-49),p]}}),l},dismiss:e=>t(n=>({errors:n.errors.map(r=>r.id===e?{...r,dismissed:!0}:r)})),clearAll:()=>t({errors:[]})})),Ma={info:(t,e,n)=>fl.getState().push("info",t,e,void 0,n),warn:(t,e,n)=>fl.getState().push("warning",t,e,void 0,n),error:(t,e,n)=>fl.getState().push("error",t,e,void 0,n),critical:(t,e,n)=>fl.getState().push("critical",t,e,void 0,n)},Oc=20,B3="dscode_pending_frames",I3=20,P3=new Set(["question_answer","hook_allow","hook_deny"]);function Jx(){try{const t=localStorage.getItem(B3);if(!t)return[];const e=JSON.parse(t);if(!Array.isArray(e))return[];const n=Date.now()-600*1e3;return e.filter(r=>!!r&&typeof r.type=="string"&&P3.has(r.type)&&typeof r.queuedAt=="number"&&r.queuedAt>=n)}catch{return[]}}function om(t){try{localStorage.setItem(B3,JSON.stringify(t.slice(-I3)))}catch{}}const I1=()=>{const t=window.location.protocol==="https:"?"wss:":"ws:",e=window.location.hostname,n=window.location.port,r=n?String(Number(n)+1):"",a=r?`${e}:${r}`:e;return`${t}//${a}/ws`},$T=I1(),e2="dscode_client_id";function FT(){try{const t=localStorage.getItem(e2);if(t)return t;const e=`web-${typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():Math.random().toString(36).slice(2,10)}`;return localStorage.setItem(e2,e),e}catch{return`web-${Math.random().toString(36).slice(2,10)}`}}class UT{constructor(e){Z(this,"ws",null);Z(this,"url");Z(this,"clientId",FT());Z(this,"messageHandlers",new Set);Z(this,"openHandlers",new Set);Z(this,"closeHandlers",new Set);Z(this,"errorHandlers",new Set);Z(this,"reconnectAttempts",0);Z(this,"reconnectHandlers",new Set);Z(this,"reconnectSuccessHandlers",new Set);Z(this,"reconnectGiveUpHandlers",new Set);Z(this,"isManualClose",!1);Z(this,"authenticated",!1);Z(this,"sessionId",null);Z(this,"pendingFrames",Jx());Z(this,"heartbeatInterval",null);Z(this,"reconnectTimer",null);Z(this,"awaitingPong",0);Z(this,"HEARTBEAT_INTERVAL",15e3);Z(this,"MAX_MISSED_PONGS",3);this.url=e||$T}setSessionId(e){this.sessionId=e}getSessionId(){return this.sessionId}getPendingFrameCount(){return this.pendingFrames.length}getPendingFrameIds(){return this.pendingFrames.map(e=>e.id||e.type).filter(Boolean)}clearPendingQueue(){this.pendingFrames=[],om([])}enqueueReliableFrame(e){const n=(()=>{try{return e.data?JSON.parse(e.data):{}}catch{return{}}})(),r={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()},a=this.pendingFrames.filter(i=>i.id!==r.id||i.type!==r.type);this.pendingFrames=[...a,r].slice(-I3),om(this.pendingFrames),console.warn(`[WS] NOT CONNECTED — queued ${e.type}${r.id?` (${r.id})`:""} for retry after reconnect`)}flushPendingFrames(){var a,i;if(((a=this.ws)==null?void 0:a.readyState)!==WebSocket.OPEN)return;const e=Jx(),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 r=[];for(const l of n){if(((i=this.ws)==null?void 0:i.readyState)!==WebSocket.OPEN){r.push(l);continue}try{this.ws.send(JSON.stringify({type:l.type,sessionId:l.sessionId,data:l.data})),console.log("[WS→] (replayed)",l.type,l.sessionId,(l.data||"").slice(0,200))}catch(c){console.warn("[WS] Failed to replay pending frame",l.type,String(c)),r.push(l)}}this.pendingFrames=r,om(r)}getReconnectState(){var e;return{attempts:this.reconnectAttempts,maxAttempts:Oc,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 r,a;if(((r=this.ws)==null?void 0:r.readyState)===WebSocket.OPEN||((a=this.ws)==null?void 0:a.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;console.log("WebSocket connected");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.openHandlers.forEach(c=>c())},this.ws.onclose=()=>{console.log("WebSocket closed"),this.stopHeartbeat(),this.closeHandlers.forEach(i=>i()),this.isManualClose||this.scheduleReconnect()},this.ws.onerror=i=>{Ma.error("WebSocket connection error",i.message||"Connection failed"),this.errorHandlers.forEach(l=>l())},this.ws.onmessage=i=>{this._onMessage(i)}}async _onMessage(e){var n,r;try{let a;if(e.data instanceof Blob?a=await e.data.text():e.data instanceof ArrayBuffer?a=new TextDecoder().decode(e.data):typeof e.data=="string"?a=e.data:a=String(e.data),a=a.trim(),!a)return;const i=JSON.parse(a);if(console.log("[WS←]",i.type,i.sessionId,JSON.stringify(i.data||i.message||"").slice(0,200)),(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(a){const i=((r=(n=e.data)==null?void 0:n.constructor)==null?void 0:r.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{}}Ma.error("Failed to parse WebSocket message",`type=${i} data=${l} error=${a}`)}}startHeartbeat(){this.stopHeartbeat(),this.awaitingPong=0,this.heartbeatInterval=setInterval(()=>{var e,n;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}scheduleReconnect(){if(this.reconnectAttempts++,this.reconnectAttempts>Oc){console.error(`[WS] Max reconnect attempts (${Oc}) reached — giving up.`),Ma.error("WebSocket",`Connection lost — max reconnect attempts (${Oc}) reached. Refresh the page to try again.`),this.reconnectGiveUpHandlers.forEach(a=>a());return}const e=Math.min(3e3*Math.pow(2,this.reconnectAttempts),3e4),n=Math.random()*1e3-500,r=Math.max(100,Math.round(e+n));console.log(`[WS] Reconnecting... Attempt ${this.reconnectAttempts}, delay=${r}ms`),this.reconnectHandlers.forEach(a=>a(this.reconnectAttempts,Oc)),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},r)}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,r;if(((n=this.ws)==null?void 0:n.readyState)===WebSocket.OPEN){const a=JSON.stringify(e);console.log("[WS→]",e.type,e.sessionId,a.slice(0,200)),this.ws.send(a)}else e.type&&P3.has(e.type)?this.enqueueReliableFrame(e):console.warn("[WS] NOT CONNECTED — dropping:",e.type,e.sessionId,"readyState=",(r=this.ws)==null?void 0:r.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 Oe=new UT;function t2(t,e){return`ext:${t}:${e.toLowerCase()}`}const hs=gn()(Ti((t,e)=>({pendingApprovals:[],autoMode:!0,sessionAllowList:[],showConfigHint:!0,addApproval:n=>t(r=>({pendingApprovals:[...r.pendingApprovals,n]})),removeApproval:n=>t(r=>({pendingApprovals:r.pendingApprovals.filter(a=>a.approvalId!==n)})),clearApprovals:()=>t({pendingApprovals:[]}),setAutoMode:n=>t({autoMode:n}),addToSessionAllowList:(n,r)=>t(a=>{const i=r?t2(n,r):n;return a.sessionAllowList.includes(i)?a:{sessionAllowList:[...a.sessionAllowList,i]}}),isSessionAllowed:(n,r)=>{const a=e().sessionAllowList;return r?a.includes(t2(n,r)):a.includes(n)},setShowConfigHint:n=>t({showConfigHint:n})}),{name:"deepseekcode-hook-approval",partialize:t=>({autoMode:t.autoMode,showConfigHint:t.showConfigHint})})),lm=AT();function HT(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 st=gn((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(r=>({currentUsage:{...r.currentUsage,...n},_hasBackendData:!0})),recordStreamText:n=>{lm.feed(n),t({tokenRate:lm.rate()})},setModel:n=>t({model:n}),setModelRef:n=>t({modelRef:n}),setModelSource:n=>t({modelSource:n}),addWorkflowTokens:n=>t(r=>({workflowTokens:r.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,r)=>t(a=>{const i=a.cacheStats,l=((i==null?void 0:i.cacheHitTokens)??0)+n,c=((i==null?void 0:i.cacheMissTokens)??0)+r;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(r=>({history:[...r.history.slice(-100),{timestamp:Date.now(),usage:n}]})),estimateTokens:n=>HT(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 r=e().estimateTokens;let a=0,i=0;for(const d of n){if(d.shellRun)continue;let h=d.content||"";if(d.thinking&&(h+=" "+d.thinking),d.steps)for(const m of d.steps)m.thought&&(h+=" "+m.thought),m.action&&(h+=" "+m.action),m.result&&(h+=" "+m.result);if(d.toolCalls)for(const m of d.toolCalls)m.args&&(h+=" "+(typeof m.args=="string"?m.args:JSON.stringify(m.args)));const p=r(h);d.type==="user"?a+=p:i+=p}const l=a+i,c=a/1e6*.15+i/1e6*.6;t({currentUsage:{promptTokens:a,completionTokens:i,totalTokens:l,estimatedCost:c}})},resetUsage:()=>{lm.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}))}})),z3="";function wu(t){return`${z3}${t}`}class GT{constructor(e){Z(this,"baseUrl");this.baseUrl=e}async request(e,n={}){try{const r=sessionStorage.getItem("auth_token")??localStorage.getItem("auth_token"),a={"Content-Type":"application/json",...n.headers};r&&(a.Authorization=`Bearer ${r}`);const i=await fetch(`${this.baseUrl}${e}`,{headers:a,...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(r){return{success:!1,error:r instanceof Error?r.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 Q=new GT(z3),ct={providers:{presets:()=>Q.get("/api/providers/presets"),refresh:()=>Q.post("/api/providers/refresh"),testConnection:(t,e)=>Q.post("/api/providers/test-connection",{baseUrl:t,apiKey:e})},models:{list:async()=>{var e;const t=await Q.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=>Q.get(`/api/models/${t}`),create:t=>Q.post("/api/models",t),update:(t,e,n)=>Q.post("/api/models/update",{provider:t,modelId:e,...n}),delete:(t,e)=>Q.post("/api/models/delete",{provider:t,modelId:e}),test:t=>Q.post(`/api/models/${t}/test`),fetch:(t,e,n)=>Q.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),Q.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 Q.get(`/api/models/catalog${n?`?${n}`:""}`)},toggle:(t,e)=>Q.post("/api/models/toggle",{provider:t,modelId:e}),setDefaults:t=>Q.post("/api/models/defaults",t),getSessionModel:t=>Q.get(`/api/sessions/${encodeURIComponent(t)}/model`),setSessionModel:(t,e,n)=>Q.put(`/api/sessions/${encodeURIComponent(t)}/model`,{provider:e,model:n}),clearSessionModel:t=>Q.delete(`/api/sessions/${encodeURIComponent(t)}/model`)},tools:{list:()=>Q.get("/api/tools"),get:t=>Q.get(`/api/tools/${t}`),update:(t,e)=>Q.put(`/api/tools/${t}`,e),toggle:(t,e)=>Q.post(`/api/tools/${t}/toggle`,{enabled:e})},connectors:{list:()=>Q.get("/api/connectors"),get:t=>Q.get(`/api/connectors/${encodeURIComponent(t)}`),toggle:(t,e,n)=>Q.post(`/api/connectors/${encodeURIComponent(t)}/toggle`,{enabled:e,env:n}),connect:(t,e)=>Q.post(`/api/connectors/${encodeURIComponent(t)}/connect`,{env:e}),addCustom:t=>Q.post("/api/connectors/custom",t),removeCustom:t=>Q.delete(`/api/connectors/custom/${encodeURIComponent(t)}`)},skills:{list:()=>Q.get("/api/skills"),get:t=>Q.get(`/api/skills/${t}`),create:t=>Q.post("/api/skills",t),update:(t,e)=>Q.put(`/api/skills/${t}`,e),toggle:(t,e)=>Q.post(`/api/skills/${t}/toggle`,{enabled:e}),delete:t=>Q.delete(`/api/skills/${t}`),import:t=>Q.post("/api/skills/import",t),marketplaces:{list:()=>Q.get("/api/skills/marketplaces"),add:t=>Q.post("/api/skills/marketplaces",t),remove:t=>Q.delete(`/api/skills/marketplaces/${t}`),get:t=>Q.get(`/api/skills/marketplaces/${t}`),refresh:t=>Q.post(`/api/skills/marketplaces/${t}/refresh`,{}),install:(t,e)=>Q.post(`/api/skills/marketplaces/${t}/install`,{skillId:e})},workshop:{list:t=>Q.get(`/api/skills/workshop${t?`?status=${t}`:""}`),propose:t=>Q.post("/api/skills/workshop",t),apply:t=>Q.post(`/api/skills/workshop/${t}/apply`,{}),reject:t=>Q.post(`/api/skills/workshop/${t}/reject`,{})},config:{get:t=>Q.get(`/api/skills/${t}/config`),update:(t,e)=>Q.put(`/api/skills/${t}/config`,e)}},shell:{exec:(t,e,n)=>Q.post("/api/shell/exec",{command:t,workspaceDir:e,timeoutMs:n})},terminalFigure:{generate:t=>Q.post("/api/terminal-figure",t)},files:{list:t=>Q.get(`/api/files${t?`?path=${encodeURIComponent(t)}`:""}`),read:t=>Q.get(`/api/files/read?path=${encodeURIComponent(t)}`),previewDocx:t=>Q.get(`/api/files/preview-docx?path=${encodeURIComponent(t)}`),previewXlsx:t=>Q.get(`/api/files/preview-xlsx?path=${encodeURIComponent(t)}`),previewTicket:(t,e)=>Q.post("/api/files/preview-ticket",{path:t,endpoint:e}),create:(t,e)=>Q.post("/api/files",{path:t,content:e}),update:(t,e)=>Q.put("/api/files/write",{path:t,content:e}),delete:t=>Q.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 r=await fetch(wu(`/api/files/download?path=${encodeURIComponent(t)}`),{headers:e});if(!r.ok){let c=`HTTP ${r.status}`;try{const d=await r.json();d!=null&&d.error&&(c=d.error)}catch{}return{success:!1,error:c}}const a=await r.blob(),i=URL.createObjectURL(a),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 qT(t);return Q.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=>Q.get(`/api/dirs${t?`?path=${encodeURIComponent(t)}`:""}`)},sessions:{list:()=>Q.get("/api/sessions"),get:t=>Q.get(`/api/sessions/${t}`),create:t=>Q.post("/api/sessions",{title:t}),delete:t=>Q.delete(`/api/sessions/${t}`),resume:t=>Q.get(`/api/sessions/${encodeURIComponent(t)}/resume`),fork:(t,e)=>Q.post(`/api/sessions/${encodeURIComponent(t)}/fork`,e?{title:e}:{})},trajectory:{events:async(t,e=0,n=500)=>{var l,c;const r=encodeURIComponent(t),a=await Q.get(`/api/plugins/http/trajectory/api/events?sessionId=${r}&cursor=${e}&limit=${n}`);if(a.success&&Array.isArray((l=a.data)==null?void 0:l.events))return{success:!0,data:{events:a.data.events,hasMore:!!a.data.hasMore||a.data.events.length===n}};const i=await Q.get(`/api/plugins/http/trajectory/api/trajectory?sid=${r}&off=${e}&lim=${n}`);if(i.success&&Array.isArray((c=i.data)==null?void 0:c.events)){const d=i.data.events,h=i.data.nextOffset??e+d.length,p=i.data.total??h;return{success:!0,data:{events:d,hasMore:h<p&&d.length>0}}}return{success:!1,error:a.error||i.error||"轨迹插件不可用"}}},tasks:{list:t=>Q.get(t?`/api/tasks?sessionId=${encodeURIComponent(t)}`:"/api/tasks"),get:t=>Q.get(`/api/tasks/${t}`),create:t=>Q.post("/api/tasks",t),update:(t,e)=>Q.put(`/api/tasks/${t}`,e),updateStatus:(t,e)=>Q.patch(`/api/tasks/${t}/status`,{status:e}),delete:t=>Q.delete(`/api/tasks/${t}`),clearCompleted:()=>Q.delete("/api/tasks")},config:{provider:{get:()=>Q.get("/api/config/provider"),save:t=>Q.post("/api/config/provider",t),delete:t=>Q.post("/api/config/provider/remove",{provider:t}),setDefault:t=>Q.post("/api/config/provider",{provider:t,setDefault:!0})},files:{list:()=>Q.get("/api/config/files"),read:t=>Q.get(`/api/config/files/read?file=${encodeURIComponent(t)}`),write:(t,e)=>Q.put("/api/config/files/write",{file:t,content:e})},context:{get:()=>Q.get("/api/config/context"),save:t=>Q.post("/api/config/context",t)},language:{get:()=>Q.get("/api/config/language"),set:t=>Q.post("/api/config/language",{language:t})}},git:{status:()=>Q.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)),Q.get(`/api/git/diff?${n.toString()}`)}},fileJob:{parse:t=>Q.post("/api/filejob/parse",{files:t}),parsePaths:t=>Q.post("/api/filejob/parse",{paths:t}),importPaths:t=>Q.post("/api/filejob/import",{paths:t}),render:t=>Q.post("/api/filejob/render",t)},system:{status:()=>Q.get("/api/system/status"),restart:()=>Q.post("/api/system/restart"),shutdown:()=>Q.post("/api/system/shutdown")},observability:{summary:()=>Q.get("/api/observability/summary"),costs:()=>Q.get("/api/observability/costs")},templates:{list:()=>Q.get("/api/templates"),get:t=>Q.get(`/api/templates/${encodeURIComponent(t)}`),create:t=>Q.post("/api/templates",t),update:(t,e)=>Q.put(`/api/templates/${encodeURIComponent(t)}`,e),remove:t=>Q.delete(`/api/templates/${encodeURIComponent(t)}`),versions:t=>Q.get(`/api/templates/${encodeURIComponent(t)}/versions`),getVersion:(t,e)=>Q.get(`/api/templates/${encodeURIComponent(t)}/versions/${e}`),render:(t,e)=>Q.post(`/api/templates/${encodeURIComponent(t)}/render`,{inputs:e}),createFromRun:(t,e)=>Q.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:()=>Q.get("/api/workflows"),start:t=>Q.post("/api/workflows",t),get:t=>Q.get(`/api/workflows/${encodeURIComponent(t)}`),events:t=>Q.get(`/api/workflows/${encodeURIComponent(t)}/events`),synthesize:t=>Q.post("/api/workflows/synthesize",{message:t})},plans:{list:()=>Q.get("/api/plans"),read:t=>Q.get(`/api/plans/${encodeURIComponent(t)}`),delete:t=>Q.delete(`/api/plans/${encodeURIComponent(t)}`)},logs:{list:()=>Q.get("/api/logs"),read:(t,e)=>Q.get(`/api/logs/read?file=${encodeURIComponent(t)}${e?`&maxLines=${e}`:""}`),downloadUrl:t=>`/api/logs/download?file=${encodeURIComponent(t)}`},stt:{status:()=>Q.get("/api/stt/status"),transcribe:(t,e,n="wav")=>Q.post("/api/stt/transcribe",{language:t,audio:e,format:n}),install:t=>Q.post("/api/stt/install",{backend:t}),installStatus:()=>Q.get("/api/stt/install/status"),cancelInstall:()=>Q.post("/api/stt/install/cancel")},hooks:{list:()=>Q.get("/api/hooks/rules"),get:t=>Q.get(`/api/hooks/rules/${encodeURIComponent(t)}`),create:t=>Q.post("/api/hooks/rules",t),update:(t,e)=>Q.put(`/api/hooks/rules/${encodeURIComponent(t)}`,e),delete:t=>Q.delete(`/api/hooks/rules/${encodeURIComponent(t)}`),batchDelete:t=>Q.post("/api/hooks/rules/batch-delete",{names:t}),toggle:(t,e)=>Q.patch(`/api/hooks/rules/${encodeURIComponent(t)}/toggle`,{enabled:e}),batchToggle:(t,e)=>Q.post("/api/hooks/rules/batch-toggle",{names:t,enabled:e}),dryRun:t=>Q.post("/api/hooks/dry-run",t),stats:()=>Q.get("/api/hooks/stats"),events:()=>Q.get("/api/hooks/events"),agents:()=>Q.get("/api/hooks/agents"),export:()=>Q.get("/api/hooks/export"),import:t=>Q.post("/api/hooks/import",t)},assistants:{list:()=>Q.get("/api/assistants"),get:t=>Q.get(`/api/assistants/${encodeURIComponent(t)}`),update:(t,e)=>Q.patch(`/api/assistants/${encodeURIComponent(t)}`,e)},channels:{list:()=>Q.get("/api/channels"),types:()=>Q.get("/api/channels/types"),catalog:()=>Q.get("/api/channels/catalog"),create:t=>Q.post("/api/channels",t),update:(t,e)=>Q.put(`/api/channels/${encodeURIComponent(t)}`,e),delete:t=>Q.delete(`/api/channels/${encodeURIComponent(t)}`),toggle:(t,e)=>Q.patch(`/api/channels/${encodeURIComponent(t)}/toggle`,{enabled:e}),test:t=>Q.post(`/api/channels/${encodeURIComponent(t)}/test`),wechat:{qrcode:(t,e)=>Q.get(`/api/channels/${encodeURIComponent(t)}/wechat/qrcode?token=${encodeURIComponent(e)}`),qrcodeStatus:(t,e,n)=>Q.get(`/api/channels/${encodeURIComponent(t)}/wechat/qrcode/status?token=${encodeURIComponent(e)}&qrcode=${encodeURIComponent(n)}`)},weixin:{bind:()=>Q.get("/api/weixin/bind"),bindStatus:t=>Q.get(`/api/weixin/bind/status?qrcode=${encodeURIComponent(t)}`)}},automations:{list:()=>Q.get("/api/automations"),create:t=>Q.post("/api/automations",t),update:(t,e)=>Q.put(`/api/automations/${encodeURIComponent(t)}`,e),remove:t=>Q.delete(`/api/automations/${encodeURIComponent(t)}`),toggle:(t,e)=>Q.post(`/api/automations/${encodeURIComponent(t)}/toggle`,{enabled:e}),run:t=>Q.post(`/api/automations/${encodeURIComponent(t)}/run`),runs:t=>Q.get(`/api/automations/${encodeURIComponent(t)}/runs`),addPermission:(t,e,n)=>Q.post(`/api/automations/${encodeURIComponent(t)}/permissions`,{tool:e,target:n}),revokePermission:(t,e)=>Q.delete(`/api/automations/${encodeURIComponent(t)}/permissions`,{entry:e})}};function qT(t){return new Promise((e,n)=>{const r=new FileReader;r.onload=()=>{const a=r.result,i=a.indexOf(",");e(i>=0?a.slice(i+1):a)},r.onerror=()=>n(r.error||new Error("Failed to read file")),r.readAsDataURL(t)})}const cm=t=>t==="normal"?"act":t;let Kd=0;const VT=t=>t==="normal"?"normal":t==="auto"?"auto-act":CT(typeof t=="string"?t:void 0),Lc=t=>t==="normal"?"act":dl(t)?"auto":Zr(t),pl=gn()(Ti((t,e)=>({mode:"auto-act",currentPlanContent:null,modeHistory:[],thinkingStatusBySession:{},prePlanMode:null,setMode:n=>{const r=e().mode;if(r===n)return;t(h=>({mode:n,modeHistory:[...h.modeHistory,{previousMode:r,newMode:n,description:`Mode changed: ${r} -> ${n}`,timestamp:Date.now()}]})),hs.getState().setAutoMode(n!=="normal"&&dl(n));const a=Lc(r),i=Lc(n),l=r==="normal"?"act":Zr(r),c=n==="normal"?"act":Zr(n);if(l===c&&a===i)return;try{const h=Fe.getState().activeSessionId||Oe.getSessionId();h&&Oe.send({type:"plan_mode_change",sessionId:h,data:JSON.stringify({previousMode:Lc(r),newMode:Lc(n),frontendMode:n,timestamp:Date.now()})})}catch(h){console.warn("[ExecutionModeStore] Failed to notify mode change via WS:",h)}const d=++Kd;ct.models.list().then(h=>{var S;if(d!==Kd||!h.success||!((S=h.data)!=null&&S.models))return;const p=h.data.models.filter(E=>E.enabled!==!1),m=Zr(cm(n)),b=p.find(E=>E.defaultFor===m),x=p.find(E=>E.isDefault||E.defaultFor==="global"),w=b||x||p[0];w&&(st.getState().setModel(w.id),st.getState().setModelRef(`${w.provider}:${w.id}`))}).catch(h=>{console.warn("[ExecutionModeStore] Failed to refresh models:",h)})},applyBackendMode:n=>{const r=e().mode;if(r===n)return;t(i=>({mode:n,prePlanMode:n!=="plan"?null:i.prePlanMode,modeHistory:[...i.modeHistory,{previousMode:r,newMode:n,description:`Backend mode changed: ${r} -> ${n}`,timestamp:Date.now()}]})),hs.getState().setAutoMode(n!=="normal"&&dl(n));const a=++Kd;ct.models.list().then(i=>{var m;if(a!==Kd||!i.success||!((m=i.data)!=null&&m.models))return;const l=i.data.models.filter(b=>b.enabled!==!1),c=Zr(cm(n)),d=l.find(b=>b.defaultFor===c),h=l.find(b=>b.isDefault||b.defaultFor==="global"),p=d||h||l[0];p&&(st.getState().setModel(p.id),st.getState().setModelRef(`${p.provider}:${p.id}`))}).catch(i=>{console.warn("[ExecutionModeStore] Failed to refresh models after backend mode change:",i)})},toggleMode:()=>{const n=e().mode,r=n==="normal"?"act":ST(n);e().setMode(r)},setBaseMode:n=>{const r=e().mode,a=r!=="normal"&&dl(r);e().setMode(Tg(n,a))},setAuto:n=>{e().setMode(Tg(Zr(cm(e().mode)),n))},toggleAuto:()=>{const n=e().mode;e().setMode(n==="normal"?"auto-act":kT(n))},enterPlanMode:(n,r)=>{const a=e().mode,i=a!=="normal"&&Zr(a)!=="plan"?a:e().prePlanMode,l=a!=="normal"&&Zr(a)==="goal"?"goal":"plan";t(c=>({mode:l,prePlanMode:i,modeHistory:[...c.modeHistory,{previousMode:a,newMode:l,description:`Enter ${l} mode: ${r}`,timestamp:Date.now()}]})),hs.getState().setAutoMode(!1)},exitPlanMode:(n,r)=>{const a=e().mode,i=e().prePlanMode,l=i&&(i==="normal"||Zr(i)!=="plan")?i:"act";t(c=>({mode:l,prePlanMode:null,modeHistory:[...c.modeHistory,{previousMode:a,newMode:l,description:`Exit to ${l} mode: ${r}`,timestamp:Date.now()}]})),hs.getState().setAutoMode(l!=="normal"&&dl(l))},enterGoalMode:(n,r)=>{const a=e().mode;t(i=>({mode:"goal",modeHistory:[...i.modeHistory,{previousMode:a,newMode:"goal",description:`Enter Goal mode: ${r}`,timestamp:Date.now()}]})),hs.getState().setAutoMode(!1);try{const i=Fe.getState().activeSessionId||Oe.getSessionId()||void 0;Oe.send({type:"plan_mode_change",sessionId:i,data:JSON.stringify({previousMode:Lc(a),newMode:"goal",frontendMode:"goal",goalDescription:r,timestamp:Date.now()})})}catch(i){console.warn("[ExecutionModeStore] Failed to notify goal mode change via WS:",i)}},exitGoalMode:()=>{const n=e().mode;t(r=>({mode:"act",modeHistory:[...r.modeHistory,{previousMode:n,newMode:"act",description:"Exit Goal mode",timestamp:Date.now()}]})),hs.getState().setAutoMode(!1)},setPlanContent:n=>t({currentPlanContent:n}),setThinkingStatus:(n,r)=>t(a=>({thinkingStatusBySession:{...a.thinkingStatusBySession,[n]:r}})),getThinkingStatus:n=>e().thinkingStatusBySession[n]||"",reset:()=>t({mode:"auto-act",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:VT(n.mode)}},partialize:t=>({mode:t.mode,currentPlanContent:t.currentPlanContent,modeHistory:t.modeHistory})}));function q0(t){window.dispatchEvent(new CustomEvent("preview-file",{detail:{path:t}}))}const ou="dsc-image:",WT=/^dsc-image:[^/]+\/(.+)$/,ao=new Map,KT=50;function YT(t){const e=t.slice(0,4096),n=t.length>8192?t.slice(-4096):"",r=`${t.length}|${e}|${n}`;let a=5381;for(let i=0;i<r.length;i++)a=(a<<5)+a+r.charCodeAt(i)>>>0;return a.toString(36)}function $3(t){return(t||"image").replace(/[\\/]/g,"_").replace(/["<>]/g,"").trim()||"image"}function ZT(t,e){if(!t)return"";const n=YT(t),r=$3(e),a=ao.get(n);if(a)return`${ou}${n}/${a.name}`;if(ao.size>=KT){const i=ao.keys().next().value;i!==void 0&&ao.delete(i)}return ao.set(n,{src:t,name:r}),`${ou}${n}/${r}`}function P1(t){return typeof t=="string"&&t.startsWith(ou)}function F3(t){var n;if(!P1(t))return null;const e=t.slice(ou.length).split("/")[0]??"";return((n=ao.get(e))==null?void 0:n.src)??null}function z1(t){var n,r;if(!P1(t))return null;const e=t.slice(ou.length).split("/")[0]??"";return((n=ao.get(e))==null?void 0:n.name)??((r=WT.exec(t))==null?void 0:r[1])??null}function EF(t){const{src:e,path:n}=t,r=n?n.split(/[\\/]/).pop()||n:"image",a=$3(t.name||r);if(!e)return;if(n&&!e.startsWith("data:")&&!e.startsWith("blob:")){q0(n);return}const i=ZT(e,a);i&&q0(i)}function U3(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var a=t.length;for(e=0;e<a;e++)t[e]&&(n=U3(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function XT(){for(var t,e,n=0,r="",a=arguments.length;n<a;n++)(t=arguments[n])&&(e=U3(t))&&(r&&(r+=" "),r+=e);return r}function ut(...t){return XT(t)}const um=200,n2=50,r2=30;function Yd(t,e,n=[]){const r=Object.keys(t);if(r.length<=e)return t;const a=new Set(n),i=r.filter(d=>!a.has(d)).sort((d,h)=>{var p,m;return(((p=t[d])==null?void 0:p.updatedAt)??0)-(((m=t[h])==null?void 0:m.updatedAt)??0)}),l=new Set(i.slice(0,Math.max(0,r.length-e))),c={};for(const d of r)l.has(d)||(c[d]=t[d]);return c}const a2=(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()}),hr=()=>Date.now(),ja=(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"},s2=t=>t.id||`${t.type||"event"}-${t.timestamp||hr()}-${Math.random().toString(36).slice(2,8)}`;function dm(t){if(!Array.isArray(t)||t.length===0)return{totalPhases:0,completedNodes:0};const e=t.length,n=t.filter(r=>r.status==="completed"||r.status==="skipped"||r.status==="failed").length;return{totalPhases:e,completedNodes:n}}const ot=gn()(Ti((t,e)=>({bySession:{},byRun:{},agentsBySession:{},tasksBySession:{},eventsBySession:{},plansBySession:{},dwfOffersBySession:{},dwfPromotableBySession:{},upsert:(n,r)=>t(a=>{const i=r.runId,l=a.byRun[i]&&a.byRun[i].runId===i?a.byRun[i]:a2(n,i),c={...l.agentNodes||{}};r.agentNode&&(c[r.agentNode.nodeId]=r.agentNode);const{agentNode:d,...h}=r,p={};for(const[E,A]of Object.entries(h))A!==void 0&&(p[E]=A);const m={...l,...p,agentNodes:c,sessionId:n,runId:i,updatedAt:hr()},b={...a.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||hr()});const x=r.lastEventType||r.status||"workflow_update",S=[{id:s2({type:x}),sessionId:n,type:x,source:"workflow",timestamp:hr(),status:m.status,runId:i,agentId:d==null?void 0:d.nodeId,message:m.error,data:h},...a.eventsBySession[n]||[]].slice(0,um);return{bySession:Yd({...a.bySession,[n]:m},r2,[n]),byRun:Yd({...a.byRun,[i]:m},n2,[i]),agentsBySession:{...a.agentsBySession,[n]:b},eventsBySession:{...a.eventsBySession,[n]:S}}}),fail:(n,r,a)=>e().upsert(n,{runId:r,status:"ERROR",error:a,lastEventType:"workflow_error"}),getForSession:n=>e().bySession[n],setPlan:(n,r)=>t(a=>({plansBySession:{...a.plansBySession,[n]:r}})),clearPlan:n=>t(r=>{if(!r.plansBySession[n])return{};const a={...r.plansBySession};return delete a[n],{plansBySession:a}}),getPlanForSession:n=>e().plansBySession[n],setDwfOffer:(n,r)=>t(a=>({dwfOffersBySession:{...a.dwfOffersBySession,[n]:r}})),clearDwfOffer:(n,r)=>t(a=>{const i=a.dwfOffersBySession[n];if(!i||r&&i.offerId!==r)return{};const l={...a.dwfOffersBySession};return delete l[n],{dwfOffersBySession:l}}),getDwfOfferForSession:n=>e().dwfOffersBySession[n],setDwfPromotable:(n,r)=>t(a=>({dwfPromotableBySession:{...a.dwfPromotableBySession,[n]:r}})),clearDwfPromotable:(n,r)=>t(a=>{const i=a.dwfPromotableBySession[n];if(!i||r&&i.workflowId!==r)return{};const l={...a.dwfPromotableBySession};return delete l[n],{dwfPromotableBySession:l}}),getDwfPromotableForSession:n=>e().dwfPromotableBySession[n],setNodes:(n,r,a)=>t(i=>{const l=i.byRun[r],c=l||i.bySession[n]||a2(n,r),d=a.map(b=>{var x;return((x=c.nodes)==null?void 0:x.find(w=>w.id===b.id))||b}),{totalPhases:h,completedNodes:p}=dm(d),m={...c,runId:r,sessionId:n,nodes:d,totalPhases:h||c.totalPhases,completedPhases:l?p||c.completedPhases:p,startedAt:l?c.startedAt??hr():hr(),finishedAt:l?c.finishedAt:void 0,updatedAt:hr()};return{bySession:{...i.bySession,[n]:m},byRun:{...i.byRun,[r]:m}}}),setNodeStatus:(n,r,a,i)=>t(l=>{const c=l.byRun[r],d=c||l.bySession[n];if(!d)return{};const h=(d.nodes||[]).map(x=>x.id===a?{...x,...i}:x),{totalPhases:p,completedNodes:m}=dm(h),b={...d,nodes:h,totalPhases:p||d.totalPhases,completedPhases:c?m||d.completedPhases:m,updatedAt:hr()};return{bySession:{...l.bySession,[n]:b},byRun:{...l.byRun,[r]:b}}}),finalizeNodes:(n,r,a)=>t(i=>{const l=i.byRun[r]||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:h}=dm(c),p={...l,nodes:c,completedPhases:h||l.completedPhases,totalPhases:d||l.totalPhases,finishedAt:hr(),updatedAt:hr()};return{bySession:{...i.bySession,[n]:p},byRun:{...i.byRun,[r]:p}}}),upsertAgent:(n,r)=>t(a=>{var c;const i=(c=a.agentsBySession[n])==null?void 0:c[r.id],l={id:r.id,sessionId:n,name:r.name||r.role||(i==null?void 0:i.name)||r.id,role:r.role||(i==null?void 0:i.role)||r.name||r.id,source:r.source||(i==null?void 0:i.source)||"agent",status:r.status||(i==null?void 0:i.status)||"idle",runId:r.runId??(i==null?void 0:i.runId),phase:r.phase??(i==null?void 0:i.phase),taskId:r.taskId??(i==null?void 0:i.taskId),currentTask:r.currentTask??(i==null?void 0:i.currentTask),tokens:r.tokens??(i==null?void 0:i.tokens),error:r.error??(i==null?void 0:i.error),updatedAt:r.updatedAt||hr()};return{agentsBySession:{...a.agentsBySession,[n]:{...a.agentsBySession[n]||{},[r.id]:l}}}}),upsertTask:(n,r)=>t(a=>{var h;const i=(h=a.tasksBySession[n])==null?void 0:h[r.id],l=hr(),c=r.status||(i==null?void 0:i.status)||"pending",d={id:r.id,sessionId:n,title:r.title||(i==null?void 0:i.title)||r.description||r.id,status:c,source:r.source||(i==null?void 0:i.source)||"task",description:r.description??(i==null?void 0:i.description),agentType:r.agentType??(i==null?void 0:i.agentType),progress:r.progress??(i==null?void 0:i.progress),result:r.result??(i==null?void 0:i.result),error:r.error??(i==null?void 0:i.error),runId:r.runId??(i==null?void 0:i.runId),dependencies:r.dependencies??(i==null?void 0:i.dependencies),startedAt:r.startedAt??(i==null?void 0:i.startedAt)??(c==="running"?l:void 0),completedAt:r.completedAt??(i==null?void 0:i.completedAt)??(c==="completed"||c==="failed"?l:void 0),createdAt:r.createdAt||(i==null?void 0:i.createdAt)||l,updatedAt:r.updatedAt||l,raw:r.raw??(i==null?void 0:i.raw)};return{tasksBySession:{...a.tasksBySession,[n]:{...a.tasksBySession[n]||{},[r.id]:d}}}}),setTasks:(n,r,a="plan")=>t(i=>{const l=i.tasksBySession[n]||{},c=Object.fromEntries(Object.entries(l).filter(([,p])=>p.source!==a)),d=hr(),h=Object.fromEntries(r.map((p,m)=>{const b=l[p.id],x=p.status||(b==null?void 0:b.status)||"pending",w={id:p.id,sessionId:n,title:p.title||(b==null?void 0:b.title)||p.description||`Task ${m+1}`,status:x,source:p.source||a,description:p.description??(b==null?void 0:b.description),agentType:p.agentType??(b==null?void 0:b.agentType),progress:p.progress??(b==null?void 0:b.progress),result:p.result??(b==null?void 0:b.result),error:p.error??(b==null?void 0:b.error),runId:p.runId??(b==null?void 0:b.runId),dependencies:p.dependencies??(b==null?void 0:b.dependencies),startedAt:p.startedAt??(b==null?void 0:b.startedAt),completedAt:p.completedAt??(b==null?void 0:b.completedAt),createdAt:p.createdAt||(b==null?void 0:b.createdAt)||d+m,updatedAt:p.updatedAt||d,raw:p.raw??(b==null?void 0:b.raw)};return[w.id,w]}));return{tasksBySession:{...i.tasksBySession,[n]:{...c,...h}}}}),recordEvent:(n,r)=>t(a=>{const i={id:s2(r),sessionId:n,type:r.type,source:r.source||"system",timestamp:r.timestamp||hr(),title:r.title,message:r.message,status:r.status,runId:r.runId,agentId:r.agentId,taskId:r.taskId,data:r.data};return{eventsBySession:{...a.eventsBySession,[n]:[i,...a.eventsBySession[n]||[]].slice(0,um)}}}),getAgentsForSession:n=>Object.values(e().agentsBySession[n]||{}).sort((r,a)=>a.updatedAt-r.updatedAt),getTasksForSession:n=>Object.values(e().tasksBySession[n]||{}).sort((r,a)=>{const i={running:0,pending:1,failed:2,completed:3,skipped:4};return i[r.status]-i[a.status]||r.createdAt-a.createdAt}),getEventsForSession:n=>e().eventsBySession[n]||[],getAgentTree:n=>{const r=Object.values(e().agentsBySession[n]||{}),a=new Map(r.map(d=>[d.id,d])),i=r.filter(d=>!d.parentId||!a.has(d.parentId)),l=d=>r.filter(h=>h.parentId===d),c=d=>({agent:d,children:l(d.id).map(c),isRunning:d.status==="running",tokensUsed:d.tokens||0});return i.map(c)},getRunningAgentCount:n=>Object.values(e().agentsBySession[n]||{}).filter(a=>a.status==="running").length}),{name:"deepseekcode-workflow-store",storage:L1({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(([r,a])=>[r,{...a,result:a.result?String(a.result).slice(0,1e3):void 0,error:a.error?String(a.error).slice(0,1e3):void 0}]))]))}}),t=>({...t,state:{...t.state,eventsBySession:{}}}),t=>({...t,state:{...t.state,tasksBySession:{},agentsBySession:{}}})],onFailure:()=>{try{ys.getState().addToast("warning","任务看板数据保存失败:浏览器本地存储已满或不可用。当前数据仅保留在内存中,刷新页面将丢失。",8e3)}catch{}}}),partialize:t=>{const e=Yd(t.bySession,r2),n=Yd(t.byRun,n2),r=new Set([...Object.keys(e),...Object.keys(t.plansBySession||{}),...Object.keys(t.dwfOffersBySession||{})]),a=i=>Object.fromEntries(Object.entries(i).filter(([l])=>r.has(l)));return{bySession:e,byRun:n,agentsBySession:a(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(a(t.tasksBySession)).map(([i,l])=>[i,Object.fromEntries(Object.entries(l).map(([c,d])=>{const{raw:h,...p}=d;return[c,p]}))])),eventsBySession:Object.fromEntries(Object.entries(a(t.eventsBySession)).map(([i,l])=>[i,l.slice(-um).map(c=>{const{data:d,...h}=c;return h})]))}}})),vs=gn()((t,e)=>({status:null,refreshing:!1,refreshStatus:async()=>{if(e().refreshing)return e().status;t({refreshing:!0});try{const n=await ct.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})}}}));function QT(t,e){const n=String(t);let r=n.indexOf(e),a=r,i=0,l=0;for(;r!==-1;)r===a?++i>l&&(l=i):i=1,a=r+e.length,r=n.indexOf(e,a);return l}function JT(){return{enter:{mathFlow:t,mathFlowFenceMeta:e,mathText:i},exit:{mathFlow:a,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:c,mathText:l,mathTextData:c}};function t(d){const h={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[h]}},d)}function e(){this.buffer()}function n(){const d=this.resume(),h=this.stack[this.stack.length-1];Tc(h.type==="math"),h.meta=d}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function a(d){const h=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),p=this.stack[this.stack.length-1];Tc(p.type==="math"),this.exit(d),p.value=h;const m=p.data.hChildren[0];Tc(m.type==="element"),Tc(m.tagName==="code"),m.children.push({type:"text",value:h}),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 h=this.resume(),p=this.stack[this.stack.length-1];Tc(p.type==="inlineMath"),this.exit(d),p.value=h,p.data.hChildren.push({type:"text",value:h})}function c(d){this.config.enter.data.call(this,d),this.config.exit.data.call(this,d)}}function eA(t){let e=(t||{}).singleDollarTextMath;return e==null&&(e=!0),r.peek=a,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:`
33
- `,inConstruct:"mathFlowMeta"},{character:"$",after:e?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:n,inlineMath:r}};function n(i,l,c,d){const h=i.value||"",p=c.createTracker(d),m="$".repeat(Math.max(QT(h,"$")+1,2)),b=c.enter("mathFlow");let x=p.move(m);if(i.meta){const w=c.enter("mathFlowMeta");x+=p.move(c.safe(i.meta,{after:`
34
- `,before:x,encode:["$"],...p.current()})),w()}return x+=p.move(`
35
- `),h&&(x+=p.move(h+`
36
- `)),x+=p.move(m),b(),x}function r(i,l,c){let d=i.value||"",h=1;for(e||h++;new RegExp("(^|[^$])"+"\\$".repeat(h)+"([^$]|$)").test(d);)h++;const p="$".repeat(h);/[^ \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 p+d+p}function a(){return"$"}}const tA={tokenize:nA,concrete:!0,name:"mathFlow"},i2={tokenize:rA,partial:!0};function nA(t,e,n){const r=this,a=r.events[r.events.length-1],i=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[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"),Gd(t,h,"whitespace")(T))}function h(T){return T===null||no(T)?m(T):(t.enter("mathFlowFenceMeta"),t.enter("chunkString",{contentType:"string"}),p(T))}function p(T){return T===null||no(T)?(t.exit("chunkString"),t.exit("mathFlowFenceMeta"),m(T)):T===36?n(T):(t.consume(T),p)}function m(T){return t.exit("mathFlowFence"),r.interrupt?e(T):t.attempt(i2,b,E)(T)}function b(T){return t.attempt({tokenize:A,partial:!0},E,x)(T)}function x(T){return(i?Gd(t,w,"linePrefix",i+1):w)(T)}function w(T){return T===null?E(T):no(T)?t.attempt(i2,b,E)(T):(t.enter("mathFlowValue"),S(T))}function S(T){return T===null||no(T)?(t.exit("mathFlowValue"),w(T)):(t.consume(T),S)}function E(T){return t.exit("mathFlow"),e(T)}function A(T,D,M){let B=0;return Gd(T,I,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function I(Y){return T.enter("mathFlowFence"),T.enter("mathFlowFenceSequence"),U(Y)}function U(Y){return Y===36?(B++,T.consume(Y),U):B<l?M(Y):(T.exit("mathFlowFenceSequence"),Gd(T,W,"whitespace")(Y))}function W(Y){return Y===null||no(Y)?(T.exit("mathFlowFence"),D(Y)):M(Y)}}}function rA(t,e,n){const r=this;return a;function a(l){return l===null?e(l):(t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),i)}function i(l){return r.parser.lazy[r.now().line]?n(l):e(l)}}function aA(t){let n=(t||{}).singleDollarTextMath;return n==null&&(n=!0),{tokenize:r,resolve:sA,previous:iA,name:"mathText"};function r(a,i,l){let c=0,d,h;return p;function p(S){return a.enter("mathText"),a.enter("mathTextSequence"),m(S)}function m(S){return S===36?(a.consume(S),c++,m):c<2&&!n?l(S):(a.exit("mathTextSequence"),b(S))}function b(S){return S===null?l(S):S===36?(h=a.enter("mathTextSequence"),d=0,w(S)):S===32?(a.enter("space"),a.consume(S),a.exit("space"),b):no(S)?(a.enter("lineEnding"),a.consume(S),a.exit("lineEnding"),b):(a.enter("mathTextData"),x(S))}function x(S){return S===null||S===32||S===36||no(S)?(a.exit("mathTextData"),b(S)):(a.consume(S),x)}function w(S){return S===36?(a.consume(S),d++,w):d===c?(a.exit("mathTextSequence"),a.exit("mathText"),i(S)):(h.type="mathTextData",x(S))}}}function sA(t){let e=t.length-4,n=3,r,a;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r<e;)if(t[r][1].type==="mathTextData"){t[e][1].type="mathTextPadding",t[n][1].type="mathTextPadding",n+=2,e-=2;break}}for(r=n-1,e++;++r<=e;)a===void 0?r!==e&&t[r][1].type!=="lineEnding"&&(a=r):(r===e||t[r][1].type==="lineEnding")&&(t[a][1].type="mathTextData",r!==a+2&&(t[a][1].end=t[r-1][1].end,t.splice(a+2,r-a-2),e-=r-a-2,r=a+2),a=void 0);return t}function iA(t){return t!==36||this.events[this.events.length-1][1].type==="characterEscape"}function oA(t){return{flow:{36:tA},text:{36:aA(t)}}}class ye extends Error{constructor(e,n){var r="KaTeX parse error: "+e,a,i,l=n&&n.loc;if(l&&l.start<=l.end){var c=l.lexer.input;a=l.start,i=l.end,a===c.length?r+=" at end of input: ":r+=" at position "+(a+1)+": ";var d=c.slice(a,i).replace(/[^]/g,"$&̲"),h;a>15?h="…"+c.slice(a-15,a):h=c.slice(0,a);var p;i+15<c.length?p=c.slice(i,i+15)+"…":p=c.slice(i),r+=h+d+p}super(r),this.name="ParseError",this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,ye.prototype),this.position=a,a!=null&&i!=null&&(this.length=i-a),this.rawMessage=e}}var lA=/([A-Z])/g,cA=t=>t.replace(lA,"-$1").toLowerCase(),uA={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},dA=/[&><"']/g,Wn=t=>String(t).replace(dA,e=>uA[e]),_0=t=>t.type==="ordgroup"||t.type==="color"?t.body.length===1?_0(t.body[0]):t:t.type==="font"?_0(t.body):t,fA=new Set(["mathord","textord","atom"]),_s=t=>fA.has(_0(t).type),hA=t=>{var e=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(t);return e?e[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e[1])?null:e[1].toLowerCase():"_relative"},Ag={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 pA(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 mA(t){if(t.default!==void 0)return t.default;var e=Array.isArray(t.type)?t.type[0]:t.type;return pA(e)}function gA(t,e,n,r){var a=n[e];t[e]=a!==void 0?r.processor?r.processor(a):a:mA(r)}class $1{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(Ag)){var r=Ag[n];r&&gA(this,n,e,r)}}reportNonstrict(e,n,r){var a=this.strict;if(typeof a=="function"&&(a=a(e,n,r)),!(!a||a==="ignore")){if(a===!0||a==="error")throw new ye("LaTeX-incompatible input and strict mode is set to 'error': "+(n+" ["+e+"]"),r);a==="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 '"+a+"': "+n+" ["+e+"]"))}}useStrictBehavior(e,n,r){var a=this.strict;if(typeof a=="function")try{a=a(e,n,r)}catch{a="error"}return!a||a==="ignore"?!1:a===!0||a==="error"?!0:a==="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 '"+a+"': "+n+" ["+e+"]")),!1)}isTrusted(e){if("url"in e&&e.url&&!e.protocol){var n=hA(e.url);if(n==null)return!1;e.protocol=n}var r=typeof this.trust=="function"?this.trust(e):this.trust;return!!r}}class ai{constructor(e,n,r){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=n,this.cramped=r}sup(){return Aa[yA[this.id]]}sub(){return Aa[bA[this.id]]}fracNum(){return Aa[vA[this.id]]}fracDen(){return Aa[xA[this.id]]}cramp(){return Aa[wA[this.id]]}text(){return Aa[kA[this.id]]}isTight(){return this.size>=2}}var F1=0,V0=1,ml=2,ws=3,lu=4,Jr=5,kl=6,tr=7,Aa=[new ai(F1,0,!1),new ai(V0,0,!0),new ai(ml,1,!1),new ai(ws,1,!0),new ai(lu,2,!1),new ai(Jr,2,!0),new ai(kl,3,!1),new ai(tr,3,!0)],yA=[lu,Jr,lu,Jr,kl,tr,kl,tr],bA=[Jr,Jr,Jr,Jr,tr,tr,tr,tr],vA=[ml,ws,lu,Jr,kl,tr,kl,tr],xA=[ws,ws,Jr,Jr,tr,tr,tr,tr],wA=[V0,V0,ws,ws,Jr,Jr,tr,tr],kA=[F1,V0,ml,ws,ml,ws,ml,ws],Xe={DISPLAY:Aa[F1],TEXT:Aa[ml],SCRIPT:Aa[lu],SCRIPTSCRIPT:Aa[kl]},Ng=[{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 SA(t){for(var e=0;e<Ng.length;e++)for(var n=Ng[e],r=0;r<n.blocks.length;r++){var a=n.blocks[r];if(t>=a[0]&&t<=a[1])return n.name}return null}var C0=[];Ng.forEach(t=>t.blocks.forEach(e=>C0.push(...e)));function H3(t){for(var e=0;e<C0.length;e+=2)if(t>=C0[e]&&t<=C0[e+1])return!0;return!1}var En=t=>t+" "+t,nl=80,_A=function(e,n){return"M95,"+(622+e+n)+`
37
- c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
38
- c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
39
- 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
40
- s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
41
- c69,-144,104.5,-217.7,106.5,-221
42
- l`+e/2.075+" -"+e+`
43
- c5.3,-9.3,12,-14,20,-14
44
- H400000v`+(40+e)+`H845.2724
45
- s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
46
- c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
47
- M`+(834+e)+" "+n+"h400000v"+(40+e)+"h-400000z"},CA=function(e,n){return"M263,"+(601+e+n)+`c0.7,0,18,39.7,52,119
48
- c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
49
- c340,-704.7,510.7,-1060.3,512,-1067
50
- l`+e/2.084+" -"+e+`
51
- c4.7,-7.3,11,-11,19,-11
52
- H40000v`+(40+e)+`H1012.3
53
- s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
54
- 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
55
- s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
56
- c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
57
- M`+(1001+e)+" "+n+"h400000v"+(40+e)+"h-400000z"},EA=function(e,n){return"M983 "+(10+e+n)+`
58
- l`+e/3.13+" -"+e+`
59
- c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+`
60
- 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
61
- 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
62
- c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
63
- c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
64
- c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
65
- c53.7,-170.3,84.5,-266.8,92.5,-289.5z
66
- M`+(1001+e)+" "+n+"h400000v"+(40+e)+"h-400000z"},TA=function(e,n){return"M424,"+(2398+e+n)+`
67
- c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
68
- 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
69
- s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
70
- s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
71
- l`+e/4.223+" -"+e+`c4,-6.7,10,-10,18,-10 H400000
72
- v`+(40+e)+`H1014.6
73
- s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
74
- c-2,6,-10,9,-24,9
75
- c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+" "+n+`
76
- h400000v`+(40+e)+"h-400000z"},AA=function(e,n){return"M473,"+(2713+e+n)+`
77
- c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+" -"+e+`
78
- c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7
79
- s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
80
- 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
81
- 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
82
- s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
83
- 606zM`+(1001+e)+" "+n+"h400000v"+(40+e)+"H1017.7z"},NA=function(e){var n=e/2;return"M400000 "+e+" H0 L"+n+" 0 l65 45 L145 "+(e-80)+" H400000z"},RA=function(e,n,r){var a=r-54-n-e;return"M702 "+(e+n)+"H400000"+(40+e)+`
84
- H742v`+a+`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
85
- h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
86
- c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
87
- 219 661 l218 661zM702 `+n+"H400000v"+(40+e)+"H742z"},MA=function(e,n,r){n=1e3*n;var a="";switch(e){case"sqrtMain":a=_A(n,nl);break;case"sqrtSize1":a=CA(n,nl);break;case"sqrtSize2":a=EA(n,nl);break;case"sqrtSize3":a=TA(n,nl);break;case"sqrtSize4":a=AA(n,nl);break;case"sqrtTall":a=RA(n,nl,r)}return a},DA=function(e,n){switch(e){case"⎜":return En("M291 0 H417 V"+n+" H291z");case"∣":return En("M145 0 H188 V"+n+" H145z");case"∥":return En("M145 0 H188 V"+n+" H145z")+En("M367 0 H410 V"+n+" H367z");case"⎟":return En("M457 0 H583 V"+n+" H457z");case"⎢":return En("M319 0 H403 V"+n+" H319z");case"⎥":return En("M263 0 H347 V"+n+" H263z");case"⎪":return En("M384 0 H504 V"+n+" H384z");case"⏐":return En("M312 0 H355 V"+n+" H312z");case"‖":return En("M257 0 H300 V"+n+" H257z")+En("M478 0 H521 V"+n+" H478z");default:return""}},o2={doubleleftarrow:`M262 157
88
- 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
89
- 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
90
- 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
91
- 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
92
- 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
93
- -86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
94
- -2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
95
- m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
96
- -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
97
- 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
98
- -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
99
- -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
100
- -13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
101
- 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
102
- -107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
103
- 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
104
- -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
105
- 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
106
- 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
107
- 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
108
- l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
109
- -45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
110
- 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
111
- 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
112
- 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
113
- -331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
114
- 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
115
- 435 0h399565z`,leftgroupunder:`M400000 262
116
- 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
117
- 435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
118
- -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
119
- -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
120
- -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
121
- 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
122
- -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
123
- -10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
124
- m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
125
- 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
126
- 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
127
- -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
128
- 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
129
- -2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
130
- 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
131
- -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
132
- -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
133
- 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:En("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),leftbracketunder:En("M0 0 h120 V290 H399995 v120 H0z"),leftbracketover:En("M0 440 h120 V150 H399995 v-120 H0z"),leftmapsto:En("M40 281 V448H0V74H40V241H400000v40z"),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
134
- -.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
135
- 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
136
- 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:En("M0 50 h400000 v40H0z m0 194h40000v40H0z"),midbrace:`M200428 334
137
- 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
138
- -53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
139
- 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
140
- 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
141
- 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
142
- 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
143
- 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
144
- -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
145
- -320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
146
- 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
147
- 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
148
- -451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
149
- m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
150
- 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
151
- -480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
152
- 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
153
- 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
154
- -707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
155
- m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
156
- 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
157
- -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
158
- 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
159
- 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
160
- -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
161
- -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
162
- 151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
163
- -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
164
- 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
165
- 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
166
- 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
167
- -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
168
- 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
169
- 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
170
- -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
171
- -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
172
- 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
173
- -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
174
- 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
175
- 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
176
- 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
177
- -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
178
- -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
179
- 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
180
- 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
181
- -64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
182
- 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
183
- 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
184
- -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
185
- 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:En("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),rightbracketunder:En("M399995 0 h-120 V290 H0 v120 H400000z"),rightbracketover:En("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
186
- 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
187
- -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
188
- -167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
189
- 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
190
- -70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
191
- -40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
192
- -37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
193
- 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
194
- 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
195
- 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
196
- 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
197
- -19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
198
- 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
199
- -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
200
- 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
201
- 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
202
- -68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
203
- -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
204
- 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
205
- 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
206
- 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
207
- -11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
208
- 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
209
- 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
210
- -338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
211
- -11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
212
- 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
213
- 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
214
- -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
215
- 3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
216
- 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
217
- -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
218
- -7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
219
- H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
220
- 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
221
- 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
222
- -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
223
- -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
224
- -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,
225
- -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,
226
- -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,
227
- -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,
228
- -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
229
- c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
230
- 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
231
- 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
232
- 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
233
- 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
234
- c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
235
- M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
236
- -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
237
- 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
238
- -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
239
- -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
240
- -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
241
- 151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
242
- c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
243
- 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
244
- c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
245
- c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
246
- M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
247
- 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,
248
- -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
249
- 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
250
- 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
251
- 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,
252
- 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,
253
- -152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
254
- 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
255
- 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,
256
- -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
257
- 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
258
- M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},OA=function(e,n){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v1759 v84 h347 v-84
259
- 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
260
- 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
261
- c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
262
- 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
263
- c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
264
- c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+` v585 h43z
265
- M367 15 v585 v`+n+` v585 c2.667,10,9.667,15,21,15
266
- c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
267
- 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
268
- MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+n+` v1799 H0 v-84 H319z
269
- MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v602 h84z
270
- M403 1759 V0 H319 V1759 v`+n+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v602 h84z
271
- 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
272
- 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,
273
- -36,557 l0,`+(n+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
274
- 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
275
- 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,
276
- -544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
277
- l0,-`+(n+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
278
- -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,
279
- 63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
280
- c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(n+9)+`
281
- 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
282
- 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
283
- 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
284
- c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
285
- l0,-`+(n+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
286
- -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 LA(t){return"toText"in t}class Tl{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(LA(e))return e.toText();throw new Error("Expected MathDomNode with toText, got "+e.constructor.name)}).join("")}}var Rg={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},jA={ex:!0,em:!0,mu:!0},G3=function(e){return typeof e!="string"&&(e=e.unit),e in Rg||e in jA||e==="ex"},Yt=function(e,n){var r;if(e.unit in Rg)r=Rg[e.unit]/n.fontMetrics().ptPerEm/n.sizeMultiplier;else if(e.unit==="mu")r=n.fontMetrics().cssEmPerMu;else{var a;if(n.style.isTight()?a=n.havingStyle(n.style.text()):a=n,e.unit==="ex")r=a.fontMetrics().xHeight;else if(e.unit==="em")r=a.fontMetrics().quad;else throw new ye("Invalid unit: '"+e.unit+"'");a!==n&&(r*=a.sizeMultiplier/n.sizeMultiplier)}return Math.min(e.number*r,n.maxSize)},ke=function(e){return+e.toFixed(4)+"em"},Si=function(e){return e.filter(n=>n).join(" ")},U1=function(e){var n="";for(var r of Object.keys(e)){var a=e[r];a!==void 0&&(n+=cA(r)+":"+a+";")}return n},q3=function(e,n,r){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},n){n.style.isTight()&&this.classes.push("mtight");var a=n.getColor();a&&(this.style.color=a)}},V3=function(e){var n=document.createElement(e);n.className=Si(this.classes),Object.assign(n.style,this.style);for(var r of Object.keys(this.attributes))n.setAttribute(r,this.attributes[r]);for(var a=0;a<this.children.length;a++)n.appendChild(this.children[a].toNode());return n},BA=/[\s"'>/=\x00-\x1f]/,W3=function(e){var n="<"+e;this.classes.length&&(n+=' class="'+Wn(Si(this.classes))+'"');var r=U1(this.style);r&&(n+=' style="'+Wn(r)+'"');for(var a of Object.keys(this.attributes)){if(BA.test(a))throw new ye("Invalid attribute name '"+a+"'");n+=" "+a+'="'+Wn(this.attributes[a])+'"'}n+=">";for(var i=0;i<this.children.length;i++)n+=this.children[i].toMarkup();return n+="</"+e+">",n};class Al{constructor(e,n,r,a){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,q3.call(this,e,r,a),this.children=n||[]}setAttribute(e,n){this.attributes[e]=n}hasClass(e){return this.classes.includes(e)}toNode(){return V3.call(this,"span")}toMarkup(){return W3.call(this,"span")}}class bf{constructor(e,n,r,a){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,q3.call(this,n,a),this.children=r||[],this.setAttribute("href",e)}setAttribute(e,n){this.attributes[e]=n}hasClass(e){return this.classes.includes(e)}toNode(){return V3.call(this,"a")}toMarkup(){return W3.call(this,"a")}}class IA{constructor(e,n,r){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=n,this.src=e,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=r}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=U1(this.style);return n&&(e+=' style="'+Wn(n)+'"'),e+="'/>",e}}var PA={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class Rr{constructor(e,n,r,a,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=r||0,this.italic=a||0,this.skew=i||0,this.width=l||0,this.classes=c||[],this.style=d||{},this.maxFontSize=0;var h=SA(this.text.charCodeAt(0));h&&this.classes.push(h+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=PA[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=ke(this.italic)),this.classes.length>0&&(n=n||document.createElement("span"),n.className=Si(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(Si(this.classes)),n+='"');var r="";this.italic>0&&(r+="margin-right:"+ke(this.italic)+";"),r+=U1(this.style),r&&(e=!0,n+=' style="'+Wn(r)+'"');var a=Wn(this.text);return e?(n+=">",n+=a,n+="</span>",n):a}}class Ss{constructor(e,n){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=n||{}}toNode(){var e="http://www.w3.org/2000/svg",n=document.createElementNS(e,"svg");for(var r of Object.keys(this.attributes))n.setAttribute(r,this.attributes[r]);for(var a=0;a<this.children.length;a++)n.appendChild(this.children[a].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 r=0;r<this.children.length;r++)e+=this.children[r].toMarkup();return e+="</svg>",e}}class _i{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",o2[this.pathName]),n}toMarkup(){return this.alternate?'<path d="'+Wn(this.alternate)+'"/>':'<path d="'+Wn(o2[this.pathName])+'"/>'}}class Mg{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",n=document.createElementNS(e,"line");for(var r of Object.keys(this.attributes))n.setAttribute(r,this.attributes[r]);return n}toMarkup(){var e="<line";for(var n of Object.keys(this.attributes))e+=" "+n+'="'+Wn(this.attributes[n])+'"';return e+="/>",e}}function zA(t){if(t instanceof Rr)return t;throw new Error("Expected symbolNode but got "+String(t)+".")}function $A(t){if(t instanceof Al)return t;throw new Error("Expected span<HtmlDomNode> but got "+String(t)+".")}var FA=t=>t instanceof Al||t instanceof bf||t instanceof Tl,Da={"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]}},Zd={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]},l2={Å:"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 UA(t,e){Da[t]=e}function H1(t,e,n){if(!Da[e])throw new Error("Font metrics not found for font: "+e+".");var r=t.charCodeAt(0),a=Da[e][r];if(!a&&t[0]in l2&&(r=l2[t[0]].charCodeAt(0),a=Da[e][r]),!a&&n==="text"&&H3(r)&&(a=Da[e][77]),a)return{depth:a[0],height:a[1],italic:a[2],skew:a[3],width:a[4]}}var fm={};function HA(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!fm[e]){var n=fm[e]={cssEmPerMu:Zd.quad[e]/18};for(var r in Zd)Zd.hasOwnProperty(r)&&(n[r]=Zd[r][e])}return fm[e]}var Gt={math:{},text:{}};function k(t,e,n,r,a,i){Gt[t][a]={font:e,group:n,replace:r},i&&r&&(Gt[t][r]=Gt[t][a])}var _="math",pe="text",R="main",P="ams",qt="accent-token",Ne="bin",rr="close",Nl="inner",ze="mathord",yn="op-token",Dr="open",ku="punct",z="rel",Cs="spacing",G="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,ku,".","\\ldotp");k(_,R,ku,"⋅","\\cdotp");k(_,R,ku,"⋅","·");k(pe,R,G,"⋅","·");k(_,R,G,"#","\\#");k(pe,R,G,"#","\\#");k(_,R,G,"&","\\&");k(pe,R,G,"&","\\&");k(_,R,G,"ℵ","\\aleph",!0);k(_,R,G,"∀","\\forall",!0);k(_,R,G,"ℏ","\\hbar",!0);k(_,R,G,"∃","\\exists",!0);k(_,R,G,"∇","\\nabla",!0);k(_,R,G,"♭","\\flat",!0);k(_,R,G,"ℓ","\\ell",!0);k(_,R,G,"♮","\\natural",!0);k(_,R,G,"♣","\\clubsuit",!0);k(_,R,G,"℘","\\wp",!0);k(_,R,G,"♯","\\sharp",!0);k(_,R,G,"♢","\\diamondsuit",!0);k(_,R,G,"ℜ","\\Re",!0);k(_,R,G,"♡","\\heartsuit",!0);k(_,R,G,"ℑ","\\Im",!0);k(_,R,G,"♠","\\spadesuit",!0);k(_,R,G,"§","\\S",!0);k(pe,R,G,"§","\\S");k(_,R,G,"¶","\\P",!0);k(pe,R,G,"¶","\\P");k(_,R,G,"†","\\dag");k(pe,R,G,"†","\\dag");k(pe,R,G,"†","\\textdagger");k(_,R,G,"‡","\\ddag");k(pe,R,G,"‡","\\ddag");k(pe,R,G,"‡","\\textdaggerdbl");k(_,R,rr,"⎱","\\rmoustache",!0);k(_,R,Dr,"⎰","\\lmoustache",!0);k(_,R,rr,"⟯","\\rgroup",!0);k(_,R,Dr,"⟮","\\lgroup",!0);k(_,R,Ne,"∓","\\mp",!0);k(_,R,Ne,"⊖","\\ominus",!0);k(_,R,Ne,"⊎","\\uplus",!0);k(_,R,Ne,"⊓","\\sqcap",!0);k(_,R,Ne,"∗","\\ast");k(_,R,Ne,"⊔","\\sqcup",!0);k(_,R,Ne,"◯","\\bigcirc",!0);k(_,R,Ne,"∙","\\bullet",!0);k(_,R,Ne,"‡","\\ddagger");k(_,R,Ne,"≀","\\wr",!0);k(_,R,Ne,"⨿","\\amalg");k(_,R,Ne,"&","\\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(_,P,z,"≮","\\nless",!0);k(_,P,z,"","\\@nleqslant");k(_,P,z,"","\\@nleqq");k(_,P,z,"⪇","\\lneq",!0);k(_,P,z,"≨","\\lneqq",!0);k(_,P,z,"","\\@lvertneqq");k(_,P,z,"⋦","\\lnsim",!0);k(_,P,z,"⪉","\\lnapprox",!0);k(_,P,z,"⊀","\\nprec",!0);k(_,P,z,"⋠","\\npreceq",!0);k(_,P,z,"⋨","\\precnsim",!0);k(_,P,z,"⪹","\\precnapprox",!0);k(_,P,z,"≁","\\nsim",!0);k(_,P,z,"","\\@nshortmid");k(_,P,z,"∤","\\nmid",!0);k(_,P,z,"⊬","\\nvdash",!0);k(_,P,z,"⊭","\\nvDash",!0);k(_,P,z,"⋪","\\ntriangleleft");k(_,P,z,"⋬","\\ntrianglelefteq",!0);k(_,P,z,"⊊","\\subsetneq",!0);k(_,P,z,"","\\@varsubsetneq");k(_,P,z,"⫋","\\subsetneqq",!0);k(_,P,z,"","\\@varsubsetneqq");k(_,P,z,"≯","\\ngtr",!0);k(_,P,z,"","\\@ngeqslant");k(_,P,z,"","\\@ngeqq");k(_,P,z,"⪈","\\gneq",!0);k(_,P,z,"≩","\\gneqq",!0);k(_,P,z,"","\\@gvertneqq");k(_,P,z,"⋧","\\gnsim",!0);k(_,P,z,"⪊","\\gnapprox",!0);k(_,P,z,"⊁","\\nsucc",!0);k(_,P,z,"⋡","\\nsucceq",!0);k(_,P,z,"⋩","\\succnsim",!0);k(_,P,z,"⪺","\\succnapprox",!0);k(_,P,z,"≆","\\ncong",!0);k(_,P,z,"","\\@nshortparallel");k(_,P,z,"∦","\\nparallel",!0);k(_,P,z,"⊯","\\nVDash",!0);k(_,P,z,"⋫","\\ntriangleright");k(_,P,z,"⋭","\\ntrianglerighteq",!0);k(_,P,z,"","\\@nsupseteqq");k(_,P,z,"⊋","\\supsetneq",!0);k(_,P,z,"","\\@varsupsetneq");k(_,P,z,"⫌","\\supsetneqq",!0);k(_,P,z,"","\\@varsupsetneqq");k(_,P,z,"⊮","\\nVdash",!0);k(_,P,z,"⪵","\\precneqq",!0);k(_,P,z,"⪶","\\succneqq",!0);k(_,P,z,"","\\@nsubseteqq");k(_,P,Ne,"⊴","\\unlhd");k(_,P,Ne,"⊵","\\unrhd");k(_,P,z,"↚","\\nleftarrow",!0);k(_,P,z,"↛","\\nrightarrow",!0);k(_,P,z,"⇍","\\nLeftarrow",!0);k(_,P,z,"⇏","\\nRightarrow",!0);k(_,P,z,"↮","\\nleftrightarrow",!0);k(_,P,z,"⇎","\\nLeftrightarrow",!0);k(_,P,z,"△","\\vartriangle");k(_,P,G,"ℏ","\\hslash");k(_,P,G,"▽","\\triangledown");k(_,P,G,"◊","\\lozenge");k(_,P,G,"Ⓢ","\\circledS");k(_,P,G,"®","\\circledR");k(pe,P,G,"®","\\circledR");k(_,P,G,"∡","\\measuredangle",!0);k(_,P,G,"∄","\\nexists");k(_,P,G,"℧","\\mho");k(_,P,G,"Ⅎ","\\Finv",!0);k(_,P,G,"⅁","\\Game",!0);k(_,P,G,"‵","\\backprime");k(_,P,G,"▲","\\blacktriangle");k(_,P,G,"▼","\\blacktriangledown");k(_,P,G,"■","\\blacksquare");k(_,P,G,"⧫","\\blacklozenge");k(_,P,G,"★","\\bigstar");k(_,P,G,"∢","\\sphericalangle",!0);k(_,P,G,"∁","\\complement",!0);k(_,P,G,"ð","\\eth",!0);k(pe,R,G,"ð","ð");k(_,P,G,"╱","\\diagup");k(_,P,G,"╲","\\diagdown");k(_,P,G,"□","\\square");k(_,P,G,"□","\\Box");k(_,P,G,"◊","\\Diamond");k(_,P,G,"¥","\\yen",!0);k(pe,P,G,"¥","\\yen",!0);k(_,P,G,"✓","\\checkmark",!0);k(pe,P,G,"✓","\\checkmark");k(_,P,G,"ℶ","\\beth",!0);k(_,P,G,"ℸ","\\daleth",!0);k(_,P,G,"ℷ","\\gimel",!0);k(_,P,G,"ϝ","\\digamma",!0);k(_,P,G,"ϰ","\\varkappa");k(_,P,Dr,"┌","\\@ulcorner",!0);k(_,P,rr,"┐","\\@urcorner",!0);k(_,P,Dr,"└","\\@llcorner",!0);k(_,P,rr,"┘","\\@lrcorner",!0);k(_,P,z,"≦","\\leqq",!0);k(_,P,z,"⩽","\\leqslant",!0);k(_,P,z,"⪕","\\eqslantless",!0);k(_,P,z,"≲","\\lesssim",!0);k(_,P,z,"⪅","\\lessapprox",!0);k(_,P,z,"≊","\\approxeq",!0);k(_,P,Ne,"⋖","\\lessdot");k(_,P,z,"⋘","\\lll",!0);k(_,P,z,"≶","\\lessgtr",!0);k(_,P,z,"⋚","\\lesseqgtr",!0);k(_,P,z,"⪋","\\lesseqqgtr",!0);k(_,P,z,"≑","\\doteqdot");k(_,P,z,"≓","\\risingdotseq",!0);k(_,P,z,"≒","\\fallingdotseq",!0);k(_,P,z,"∽","\\backsim",!0);k(_,P,z,"⋍","\\backsimeq",!0);k(_,P,z,"⫅","\\subseteqq",!0);k(_,P,z,"⋐","\\Subset",!0);k(_,P,z,"⊏","\\sqsubset",!0);k(_,P,z,"≼","\\preccurlyeq",!0);k(_,P,z,"⋞","\\curlyeqprec",!0);k(_,P,z,"≾","\\precsim",!0);k(_,P,z,"⪷","\\precapprox",!0);k(_,P,z,"⊲","\\vartriangleleft");k(_,P,z,"⊴","\\trianglelefteq");k(_,P,z,"⊨","\\vDash",!0);k(_,P,z,"⊪","\\Vvdash",!0);k(_,P,z,"⌣","\\smallsmile");k(_,P,z,"⌢","\\smallfrown");k(_,P,z,"≏","\\bumpeq",!0);k(_,P,z,"≎","\\Bumpeq",!0);k(_,P,z,"≧","\\geqq",!0);k(_,P,z,"⩾","\\geqslant",!0);k(_,P,z,"⪖","\\eqslantgtr",!0);k(_,P,z,"≳","\\gtrsim",!0);k(_,P,z,"⪆","\\gtrapprox",!0);k(_,P,Ne,"⋗","\\gtrdot");k(_,P,z,"⋙","\\ggg",!0);k(_,P,z,"≷","\\gtrless",!0);k(_,P,z,"⋛","\\gtreqless",!0);k(_,P,z,"⪌","\\gtreqqless",!0);k(_,P,z,"≖","\\eqcirc",!0);k(_,P,z,"≗","\\circeq",!0);k(_,P,z,"≜","\\triangleq",!0);k(_,P,z,"∼","\\thicksim");k(_,P,z,"≈","\\thickapprox");k(_,P,z,"⫆","\\supseteqq",!0);k(_,P,z,"⋑","\\Supset",!0);k(_,P,z,"⊐","\\sqsupset",!0);k(_,P,z,"≽","\\succcurlyeq",!0);k(_,P,z,"⋟","\\curlyeqsucc",!0);k(_,P,z,"≿","\\succsim",!0);k(_,P,z,"⪸","\\succapprox",!0);k(_,P,z,"⊳","\\vartriangleright");k(_,P,z,"⊵","\\trianglerighteq");k(_,P,z,"⊩","\\Vdash",!0);k(_,P,z,"∣","\\shortmid");k(_,P,z,"∥","\\shortparallel");k(_,P,z,"≬","\\between",!0);k(_,P,z,"⋔","\\pitchfork",!0);k(_,P,z,"∝","\\varpropto");k(_,P,z,"◀","\\blacktriangleleft");k(_,P,z,"∴","\\therefore",!0);k(_,P,z,"∍","\\backepsilon");k(_,P,z,"▶","\\blacktriangleright");k(_,P,z,"∵","\\because",!0);k(_,P,z,"⋘","\\llless");k(_,P,z,"⋙","\\gggtr");k(_,P,Ne,"⊲","\\lhd");k(_,P,Ne,"⊳","\\rhd");k(_,P,z,"≂","\\eqsim",!0);k(_,R,z,"⋈","\\Join");k(_,P,z,"≑","\\Doteq",!0);k(_,P,Ne,"∔","\\dotplus",!0);k(_,P,Ne,"∖","\\smallsetminus");k(_,P,Ne,"⋒","\\Cap",!0);k(_,P,Ne,"⋓","\\Cup",!0);k(_,P,Ne,"⩞","\\doublebarwedge",!0);k(_,P,Ne,"⊟","\\boxminus",!0);k(_,P,Ne,"⊞","\\boxplus",!0);k(_,P,Ne,"⋇","\\divideontimes",!0);k(_,P,Ne,"⋉","\\ltimes",!0);k(_,P,Ne,"⋊","\\rtimes",!0);k(_,P,Ne,"⋋","\\leftthreetimes",!0);k(_,P,Ne,"⋌","\\rightthreetimes",!0);k(_,P,Ne,"⋏","\\curlywedge",!0);k(_,P,Ne,"⋎","\\curlyvee",!0);k(_,P,Ne,"⊝","\\circleddash",!0);k(_,P,Ne,"⊛","\\circledast",!0);k(_,P,Ne,"⋅","\\centerdot");k(_,P,Ne,"⊺","\\intercal",!0);k(_,P,Ne,"⋒","\\doublecap");k(_,P,Ne,"⋓","\\doublecup");k(_,P,Ne,"⊠","\\boxtimes",!0);k(_,P,z,"⇢","\\dashrightarrow",!0);k(_,P,z,"⇠","\\dashleftarrow",!0);k(_,P,z,"⇇","\\leftleftarrows",!0);k(_,P,z,"⇆","\\leftrightarrows",!0);k(_,P,z,"⇚","\\Lleftarrow",!0);k(_,P,z,"↞","\\twoheadleftarrow",!0);k(_,P,z,"↢","\\leftarrowtail",!0);k(_,P,z,"↫","\\looparrowleft",!0);k(_,P,z,"⇋","\\leftrightharpoons",!0);k(_,P,z,"↶","\\curvearrowleft",!0);k(_,P,z,"↺","\\circlearrowleft",!0);k(_,P,z,"↰","\\Lsh",!0);k(_,P,z,"⇈","\\upuparrows",!0);k(_,P,z,"↿","\\upharpoonleft",!0);k(_,P,z,"⇃","\\downharpoonleft",!0);k(_,R,z,"⊶","\\origof",!0);k(_,R,z,"⊷","\\imageof",!0);k(_,P,z,"⊸","\\multimap",!0);k(_,P,z,"↭","\\leftrightsquigarrow",!0);k(_,P,z,"⇉","\\rightrightarrows",!0);k(_,P,z,"⇄","\\rightleftarrows",!0);k(_,P,z,"↠","\\twoheadrightarrow",!0);k(_,P,z,"↣","\\rightarrowtail",!0);k(_,P,z,"↬","\\looparrowright",!0);k(_,P,z,"↷","\\curvearrowright",!0);k(_,P,z,"↻","\\circlearrowright",!0);k(_,P,z,"↱","\\Rsh",!0);k(_,P,z,"⇊","\\downdownarrows",!0);k(_,P,z,"↾","\\upharpoonright",!0);k(_,P,z,"⇂","\\downharpoonright",!0);k(_,P,z,"⇝","\\rightsquigarrow",!0);k(_,P,z,"⇝","\\leadsto");k(_,P,z,"⇛","\\Rrightarrow",!0);k(_,P,z,"↾","\\restriction");k(_,R,G,"‘","`");k(_,R,G,"$","\\$");k(pe,R,G,"$","\\$");k(pe,R,G,"$","\\textdollar");k(_,R,G,"%","\\%");k(pe,R,G,"%","\\%");k(_,R,G,"_","\\_");k(pe,R,G,"_","\\_");k(pe,R,G,"_","\\textunderscore");k(_,R,G,"∠","\\angle",!0);k(_,R,G,"∞","\\infty",!0);k(_,R,G,"′","\\prime");k(_,R,G,"△","\\triangle");k(_,R,G,"Γ","\\Gamma",!0);k(_,R,G,"Δ","\\Delta",!0);k(_,R,G,"Θ","\\Theta",!0);k(_,R,G,"Λ","\\Lambda",!0);k(_,R,G,"Ξ","\\Xi",!0);k(_,R,G,"Π","\\Pi",!0);k(_,R,G,"Σ","\\Sigma",!0);k(_,R,G,"Υ","\\Upsilon",!0);k(_,R,G,"Φ","\\Phi",!0);k(_,R,G,"Ψ","\\Psi",!0);k(_,R,G,"Ω","\\Omega",!0);k(_,R,G,"A","Α");k(_,R,G,"B","Β");k(_,R,G,"E","Ε");k(_,R,G,"Z","Ζ");k(_,R,G,"H","Η");k(_,R,G,"I","Ι");k(_,R,G,"K","Κ");k(_,R,G,"M","Μ");k(_,R,G,"N","Ν");k(_,R,G,"O","Ο");k(_,R,G,"P","Ρ");k(_,R,G,"T","Τ");k(_,R,G,"X","Χ");k(_,R,G,"¬","\\neg",!0);k(_,R,G,"¬","\\lnot");k(_,R,G,"⊤","\\top");k(_,R,G,"⊥","\\bot");k(_,R,G,"∅","\\emptyset");k(_,P,G,"∅","\\varnothing");k(_,R,ze,"α","\\alpha",!0);k(_,R,ze,"β","\\beta",!0);k(_,R,ze,"γ","\\gamma",!0);k(_,R,ze,"δ","\\delta",!0);k(_,R,ze,"ϵ","\\epsilon",!0);k(_,R,ze,"ζ","\\zeta",!0);k(_,R,ze,"η","\\eta",!0);k(_,R,ze,"θ","\\theta",!0);k(_,R,ze,"ι","\\iota",!0);k(_,R,ze,"κ","\\kappa",!0);k(_,R,ze,"λ","\\lambda",!0);k(_,R,ze,"μ","\\mu",!0);k(_,R,ze,"ν","\\nu",!0);k(_,R,ze,"ξ","\\xi",!0);k(_,R,ze,"ο","\\omicron",!0);k(_,R,ze,"π","\\pi",!0);k(_,R,ze,"ρ","\\rho",!0);k(_,R,ze,"σ","\\sigma",!0);k(_,R,ze,"τ","\\tau",!0);k(_,R,ze,"υ","\\upsilon",!0);k(_,R,ze,"ϕ","\\phi",!0);k(_,R,ze,"χ","\\chi",!0);k(_,R,ze,"ψ","\\psi",!0);k(_,R,ze,"ω","\\omega",!0);k(_,R,ze,"ε","\\varepsilon",!0);k(_,R,ze,"ϑ","\\vartheta",!0);k(_,R,ze,"ϖ","\\varpi",!0);k(_,R,ze,"ϱ","\\varrho",!0);k(_,R,ze,"ς","\\varsigma",!0);k(_,R,ze,"φ","\\varphi",!0);k(_,R,Ne,"∗","*",!0);k(_,R,Ne,"+","+");k(_,R,Ne,"−","-",!0);k(_,R,Ne,"⋅","\\cdot",!0);k(_,R,Ne,"∘","\\circ",!0);k(_,R,Ne,"÷","\\div",!0);k(_,R,Ne,"±","\\pm",!0);k(_,R,Ne,"×","\\times",!0);k(_,R,Ne,"∩","\\cap",!0);k(_,R,Ne,"∪","\\cup",!0);k(_,R,Ne,"∖","\\setminus",!0);k(_,R,Ne,"∧","\\land");k(_,R,Ne,"∨","\\lor");k(_,R,Ne,"∧","\\wedge",!0);k(_,R,Ne,"∨","\\vee",!0);k(_,R,G,"√","\\surd");k(_,R,Dr,"⟨","\\langle",!0);k(_,R,Dr,"∣","\\lvert");k(_,R,Dr,"∥","\\lVert");k(_,R,rr,"?","?");k(_,R,rr,"!","!");k(_,R,rr,"⟩","\\rangle",!0);k(_,R,rr,"∣","\\rvert");k(_,R,rr,"∥","\\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(_,P,z,"⊈","\\nsubseteq",!0);k(_,P,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(_,P,z,"≱","\\ngeq",!0);k(_,P,z,"≰","\\nleq",!0);k(_,R,Cs," ","\\ ");k(_,R,Cs," ","\\space");k(_,R,Cs," ","\\nobreakspace");k(pe,R,Cs," ","\\ ");k(pe,R,Cs," "," ");k(pe,R,Cs," ","\\space");k(pe,R,Cs," ","\\nobreakspace");k(_,R,Cs,"","\\nobreak");k(_,R,Cs,"","\\allowbreak");k(_,R,ku,",",",");k(_,R,ku,";",";");k(_,P,Ne,"⊼","\\barwedge",!0);k(_,P,Ne,"⊻","\\veebar",!0);k(_,R,Ne,"⊙","\\odot",!0);k(_,R,Ne,"⊕","\\oplus",!0);k(_,R,Ne,"⊗","\\otimes",!0);k(_,R,G,"∂","\\partial",!0);k(_,R,Ne,"⊘","\\oslash",!0);k(_,P,Ne,"⊚","\\circledcirc",!0);k(_,P,Ne,"⊡","\\boxdot",!0);k(_,R,Ne,"△","\\bigtriangleup");k(_,R,Ne,"▽","\\bigtriangledown");k(_,R,Ne,"†","\\dagger");k(_,R,Ne,"⋄","\\diamond");k(_,R,Ne,"⋆","\\star");k(_,R,Ne,"◃","\\triangleleft");k(_,R,Ne,"▹","\\triangleright");k(_,R,Dr,"{","\\{");k(pe,R,G,"{","\\{");k(pe,R,G,"{","\\textbraceleft");k(_,R,rr,"}","\\}");k(pe,R,G,"}","\\}");k(pe,R,G,"}","\\textbraceright");k(_,R,Dr,"{","\\lbrace");k(_,R,rr,"}","\\rbrace");k(_,R,Dr,"[","\\lbrack",!0);k(pe,R,G,"[","\\lbrack",!0);k(_,R,rr,"]","\\rbrack",!0);k(pe,R,G,"]","\\rbrack",!0);k(_,R,Dr,"(","\\lparen",!0);k(_,R,rr,")","\\rparen",!0);k(pe,R,G,"<","\\textless",!0);k(pe,R,G,">","\\textgreater",!0);k(_,R,Dr,"⌊","\\lfloor",!0);k(_,R,rr,"⌋","\\rfloor",!0);k(_,R,Dr,"⌈","\\lceil",!0);k(_,R,rr,"⌉","\\rceil",!0);k(_,R,G,"\\","\\backslash");k(_,R,G,"∣","|");k(_,R,G,"∣","\\vert");k(pe,R,G,"|","\\textbar",!0);k(_,R,G,"∥","\\|");k(_,R,G,"∥","\\Vert");k(pe,R,G,"∥","\\textbardbl");k(pe,R,G,"~","\\textasciitilde");k(pe,R,G,"\\","\\textbackslash");k(pe,R,G,"^","\\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,yn,"∐","\\coprod");k(_,R,yn,"⋁","\\bigvee");k(_,R,yn,"⋀","\\bigwedge");k(_,R,yn,"⨄","\\biguplus");k(_,R,yn,"⋂","\\bigcap");k(_,R,yn,"⋃","\\bigcup");k(_,R,yn,"∫","\\int");k(_,R,yn,"∫","\\intop");k(_,R,yn,"∬","\\iint");k(_,R,yn,"∭","\\iiint");k(_,R,yn,"∏","\\prod");k(_,R,yn,"∑","\\sum");k(_,R,yn,"⨂","\\bigotimes");k(_,R,yn,"⨁","\\bigoplus");k(_,R,yn,"⨀","\\bigodot");k(_,R,yn,"∮","\\oint");k(_,R,yn,"∯","\\oiint");k(_,R,yn,"∰","\\oiiint");k(_,R,yn,"⨆","\\bigsqcup");k(_,R,yn,"∫","\\smallint");k(pe,R,Nl,"…","\\textellipsis");k(_,R,Nl,"…","\\mathellipsis");k(pe,R,Nl,"…","\\ldots",!0);k(_,R,Nl,"…","\\ldots",!0);k(_,R,Nl,"⋯","\\@cdots",!0);k(_,R,Nl,"⋱","\\ddots",!0);k(_,R,G,"⋮","\\varvdots");k(pe,R,G,"⋮","\\varvdots");k(_,R,qt,"ˊ","\\acute");k(_,R,qt,"ˋ","\\grave");k(_,R,qt,"¨","\\ddot");k(_,R,qt,"~","\\tilde");k(_,R,qt,"ˉ","\\bar");k(_,R,qt,"˘","\\breve");k(_,R,qt,"ˇ","\\check");k(_,R,qt,"^","\\hat");k(_,R,qt,"⃗","\\vec");k(_,R,qt,"˙","\\dot");k(_,R,qt,"˚","\\mathring");k(_,R,ze,"","\\@imath");k(_,R,ze,"","\\@jmath");k(_,R,G,"ı","ı");k(_,R,G,"ȷ","ȷ");k(pe,R,G,"ı","\\i",!0);k(pe,R,G,"ȷ","\\j",!0);k(pe,R,G,"ß","\\ss",!0);k(pe,R,G,"æ","\\ae",!0);k(pe,R,G,"œ","\\oe",!0);k(pe,R,G,"ø","\\o",!0);k(pe,R,G,"Æ","\\AE",!0);k(pe,R,G,"Œ","\\OE",!0);k(pe,R,G,"Ø","\\O",!0);k(pe,R,qt,"ˊ","\\'");k(pe,R,qt,"ˋ","\\`");k(pe,R,qt,"ˆ","\\^");k(pe,R,qt,"˜","\\~");k(pe,R,qt,"ˉ","\\=");k(pe,R,qt,"˘","\\u");k(pe,R,qt,"˙","\\.");k(pe,R,qt,"¸","\\c");k(pe,R,qt,"˚","\\r");k(pe,R,qt,"ˇ","\\v");k(pe,R,qt,"¨",'\\"');k(pe,R,qt,"˝","\\H");k(pe,R,qt,"◯","\\textcircled");var K3={"--":!0,"---":!0,"``":!0,"''":!0};k(pe,R,G,"–","--",!0);k(pe,R,G,"–","\\textendash");k(pe,R,G,"—","---",!0);k(pe,R,G,"—","\\textemdash");k(pe,R,G,"‘","`",!0);k(pe,R,G,"‘","\\textquoteleft");k(pe,R,G,"’","'",!0);k(pe,R,G,"’","\\textquoteright");k(pe,R,G,"“","``",!0);k(pe,R,G,"“","\\textquotedblleft");k(pe,R,G,"”","''",!0);k(pe,R,G,"”","\\textquotedblright");k(_,R,G,"°","\\degree",!0);k(pe,R,G,"°","\\degree");k(pe,R,G,"°","\\textdegree",!0);k(_,R,G,"£","\\pounds");k(_,R,G,"£","\\mathsterling",!0);k(pe,R,G,"£","\\pounds");k(pe,R,G,"£","\\textsterling",!0);k(_,P,G,"✠","\\maltese");k(pe,P,G,"✠","\\maltese");var c2='0123456789/@."';for(var hm=0;hm<c2.length;hm++){var u2=c2.charAt(hm);k(_,R,G,u2,u2)}var d2='0123456789!@*()-=+";:?/.,';for(var pm=0;pm<d2.length;pm++){var f2=d2.charAt(pm);k(pe,R,G,f2,f2)}var W0="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(var mm=0;mm<W0.length;mm++){var Xd=W0.charAt(mm);k(_,R,ze,Xd,Xd),k(pe,R,G,Xd,Xd)}k(_,P,G,"C","ℂ");k(pe,P,G,"C","ℂ");k(_,P,G,"H","ℍ");k(pe,P,G,"H","ℍ");k(_,P,G,"N","ℕ");k(pe,P,G,"N","ℕ");k(_,P,G,"P","ℙ");k(pe,P,G,"P","ℙ");k(_,P,G,"Q","ℚ");k(pe,P,G,"Q","ℚ");k(_,P,G,"R","ℝ");k(pe,P,G,"R","ℝ");k(_,P,G,"Z","ℤ");k(pe,P,G,"Z","ℤ");k(_,R,ze,"h","ℎ");k(pe,R,ze,"h","ℎ");var Ue;for(var Jn=0;Jn<W0.length;Jn++){var nn=W0.charAt(Jn);Ue=String.fromCharCode(55349,56320+Jn),k(_,R,ze,nn,Ue),k(pe,R,G,nn,Ue),Ue=String.fromCharCode(55349,56372+Jn),k(_,R,ze,nn,Ue),k(pe,R,G,nn,Ue),Ue=String.fromCharCode(55349,56424+Jn),k(_,R,ze,nn,Ue),k(pe,R,G,nn,Ue),Ue=String.fromCharCode(55349,56580+Jn),k(_,R,ze,nn,Ue),k(pe,R,G,nn,Ue),Ue=String.fromCharCode(55349,56684+Jn),k(_,R,ze,nn,Ue),k(pe,R,G,nn,Ue),Ue=String.fromCharCode(55349,56736+Jn),k(_,R,ze,nn,Ue),k(pe,R,G,nn,Ue),Ue=String.fromCharCode(55349,56788+Jn),k(_,R,ze,nn,Ue),k(pe,R,G,nn,Ue),Ue=String.fromCharCode(55349,56840+Jn),k(_,R,ze,nn,Ue),k(pe,R,G,nn,Ue),Ue=String.fromCharCode(55349,56944+Jn),k(_,R,ze,nn,Ue),k(pe,R,G,nn,Ue),Jn<26&&(Ue=String.fromCharCode(55349,56632+Jn),k(_,R,ze,nn,Ue),k(pe,R,G,nn,Ue),Ue=String.fromCharCode(55349,56476+Jn),k(_,R,ze,nn,Ue),k(pe,R,G,nn,Ue))}Ue="𝕜";k(_,R,ze,"k",Ue);k(pe,R,G,"k",Ue);for(var Qi=0;Qi<10;Qi++){var si=Qi.toString();Ue=String.fromCharCode(55349,57294+Qi),k(_,R,ze,si,Ue),k(pe,R,G,si,Ue),Ue=String.fromCharCode(55349,57314+Qi),k(_,R,ze,si,Ue),k(pe,R,G,si,Ue),Ue=String.fromCharCode(55349,57324+Qi),k(_,R,ze,si,Ue),k(pe,R,G,si,Ue),Ue=String.fromCharCode(55349,57334+Qi),k(_,R,ze,si,Ue),k(pe,R,G,si,Ue)}var Dg="ÐÞþ";for(var gm=0;gm<Dg.length;gm++){var Qd=Dg.charAt(gm);k(_,R,ze,Qd,Qd),k(pe,R,G,Qd,Qd)}var Og={mathClass:"mathbf",textClass:"textbf",font:"Main-Bold"},h2={mathClass:"mathnormal",textClass:"textit",font:"Math-Italic"},p2={mathClass:"boldsymbol",textClass:"boldsymbol",font:"Main-BoldItalic"},GA={mathClass:"mathscr",textClass:"textscr",font:"Script-Regular"},so={mathClass:"",textClass:"",font:""},m2={mathClass:"mathfrak",textClass:"textfrak",font:"Fraktur-Regular"},g2={mathClass:"mathbb",textClass:"textbb",font:"AMS-Regular"},y2={mathClass:"mathboldfrak",textClass:"textboldfrak",font:"Fraktur-Regular"},Lg={mathClass:"mathsf",textClass:"textsf",font:"SansSerif-Regular"},jg={mathClass:"mathboldsf",textClass:"textboldsf",font:"SansSerif-Bold"},b2={mathClass:"mathitsf",textClass:"textitsf",font:"SansSerif-Italic"},Bg={mathClass:"mathtt",textClass:"texttt",font:"Typewriter-Regular"},v2=[Og,Og,h2,h2,p2,p2,GA,so,so,so,m2,m2,g2,g2,y2,y2,Lg,Lg,jg,jg,b2,b2,so,so,Bg,Bg],qA=[Og,so,Lg,jg,Bg],VA=t=>{var e=t.charCodeAt(0),n=t.charCodeAt(1),r=(e-55296)*1024+(n-56320)+65536;if(119808<=r&&r<120484){var a=Math.floor((r-119808)/26);return v2[a]}else if(120782<=r&&r<=120831){var i=Math.floor((r-120782)/10);return qA[i]}else{if(r===120485||r===120486)return v2[0];if(120486<r&&r<120782)return so;throw new ye("Unsupported character: "+t)}},vf=function(e,n,r){if(Gt[r][e]){var a=Gt[r][e].replace;a&&(e=a)}return{value:e,metrics:H1(e,n,r)}},er=function(e,n,r,a,i){var l=vf(e,n,r),c=l.metrics;e=l.value;var d;if(c){var h=c.italic;(r==="text"||a&&a.font==="mathit")&&(h=0),d=new Rr(e,c.height,c.depth,h,c.skew,c.width,i)}else typeof console<"u"&&console.warn("No character metrics "+("for '"+e+"' in style '"+n+"' and mode '"+r+"'")),d=new Rr(e,0,0,0,0,0,i);if(a){d.maxFontSize=a.sizeMultiplier,a.style.isTight()&&d.classes.push("mtight");var p=a.getColor();p&&(d.style.color=p)}return d},G1=function(e,n,r,a){return a===void 0&&(a=[]),r.font==="boldsymbol"&&vf(e,"Main-Bold",n).metrics?er(e,"Main-Bold",n,r,a.concat(["mathbf"])):e==="\\"||Gt[n][e].font==="main"?er(e,"Main-Regular",n,r,a):er(e,"AMS-Regular",n,r,a.concat(["amsrm"]))},WA=function(e,n,r){return r!=="textord"&&vf(e,"Math-BoldItalic",n).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},xf=function(e,n,r){var a=e.mode,i=e.text,l=["mord"],{font:c,fontFamily:d,fontWeight:h,fontShape:p}=n,m=a==="math"||a==="text"&&!!c,b=m?c:d,x="",w="";if(i.charCodeAt(0)===55349){var S=VA(i);x=S.font,w=S[a+"Class"]}if(x)return er(i,x,a,n,l.concat(w));if(b){var E,A;if(b==="boldsymbol"){var T=WA(i,a,r);E=T.fontName,A=[T.fontClass]}else m?(E=Ig[c].fontName,A=[c]):(E=Jd(d,h,p),A=[d,h,p]);if(vf(i,E,a).metrics)return er(i,E,a,n,l.concat(A));if(K3.hasOwnProperty(i)&&E.slice(0,10)==="Typewriter"){for(var D=[],M=0;M<i.length;M++)D.push(er(i[M],E,a,n,l.concat(A)));return Es(D)}}if(r==="mathord")return er(i,"Math-Italic",a,n,l.concat(["mathnormal"]));if(r==="textord"){var B=Gt[a][i]&&Gt[a][i].font;if(B==="ams"){var I=Jd("amsrm",h,p);return er(i,I,a,n,l.concat("amsrm",h,p))}else if(B==="main"||!B){var U=Jd("textrm",h,p);return er(i,U,a,n,l.concat(h,p))}else{var W=Jd(B,h,p);return er(i,W,a,n,l.concat(W,h,p))}}else throw new Error("unexpected type: "+r+" in makeOrd")},KA=(t,e)=>{if(Si(t.classes)!==Si(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 r of Object.keys(t.style))if(t.style[r]!==e.style[r])return!1;for(var a of Object.keys(e.style))if(t.style[a]!==e.style[a])return!1;return!0},Y3=t=>{for(var e=0;e<t.length-1;e++){var n=t[e],r=t[e+1];n instanceof Rr&&r instanceof Rr&&KA(n,r)&&(n.text+=r.text,n.height=Math.max(n.height,r.height),n.depth=Math.max(n.depth,r.depth),n.italic=r.italic,t.splice(e+1,1),e--)}return t},q1=function(e){for(var n=0,r=0,a=0,i=0;i<e.children.length;i++){var l=e.children[i];l.height>n&&(n=l.height),l.depth>r&&(r=l.depth),l.maxFontSize>a&&(a=l.maxFontSize)}e.height=n,e.depth=r,e.maxFontSize=a},me=function(e,n,r,a){var i=new Al(e,n,r,a);return q1(i),i},Ci=(t,e,n,r)=>new Al(t,e,n,r),Sl=function(e,n,r){var a=me([e],[],n);return a.height=Math.max(r||n.fontMetrics().defaultRuleThickness,n.minRuleThickness),a.style.borderBottomWidth=ke(a.height),a.maxFontSize=1,a},YA=function(e,n,r,a){var i=new bf(e,n,r,a);return q1(i),i},Es=function(e){var n=new Tl(e);return q1(n),n},_l=function(e,n){return e instanceof Tl?me([],[e],n):e},ZA=function(e){if(e.positionType==="individualShift"){for(var n=e.children,r=[n[0]],a=-n[0].shift-n[0].elem.depth,i=a,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,r.push({type:"kern",size:d}),r.push(n[l])}return{children:r,depth:a}}var h;if(e.positionType==="top"){for(var p=e.positionData,m=0;m<e.children.length;m++){var b=e.children[m];p-=b.type==="kern"?b.size:b.elem.height+b.elem.depth}h=p}else if(e.positionType==="bottom")h=-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")h=-x.elem.depth-e.positionData;else if(e.positionType==="firstBaseline")h=-x.elem.depth;else throw new Error("Invalid positionType "+e.positionType+".")}return{children:e.children,depth:h}},_t=function(e,n){for(var{children:r,depth:a}=ZA(e),i=0,l=0;l<r.length;l++){var c=r[l];if(c.type==="elem"){var d=c.elem;i=Math.max(i,d.maxFontSize,d.height)}}i+=2;var h=me(["pstrut"],[]);h.style.height=ke(i);for(var p=[],m=a,b=a,x=a,w=0;w<r.length;w++){var S=r[w];if(S.type==="kern")x+=S.size;else{var E=S.elem,A=S.wrapperClasses||[],T=S.wrapperStyle||{},D=me(A,[h,E],void 0,T);D.style.top=ke(-i-x-E.depth),S.marginLeft&&(D.style.marginLeft=S.marginLeft),S.marginRight&&(D.style.marginRight=S.marginRight),p.push(D),x+=E.height+E.depth}m=Math.min(m,x),b=Math.max(b,x)}var M=me(["vlist"],p);M.style.height=ke(b);var B;if(m<0){var I=me([],[]),U=me(["vlist"],[I]);U.style.height=ke(-m);var W=me(["vlist-s"],[new Rr("​")]);B=[me(["vlist-r"],[M,W]),me(["vlist-r"],[U])]}else B=[me(["vlist-r"],[M])];var Y=me(["vlist-t"],B);return B.length===2&&Y.classes.push("vlist-t2"),Y.height=b,Y.depth=-m,Y},Z3=(t,e)=>{var n=me(["mspace"],[],e),r=Yt(t,e);return n.style.marginRight=ke(r),n},Jd=(t,e,n)=>{var r,a;switch(t){case"amsrm":r="AMS";break;case"textrm":r="Main";break;case"textsf":r="SansSerif";break;case"texttt":r="Typewriter";break;default:r=t}return e==="textbf"&&n==="textit"?a="BoldItalic":e==="textbf"?a="Bold":n==="textit"?a="Italic":a="Regular",r+"-"+a},Ig={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"}},X3={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},Q3=function(e,n){var[r,a,i]=X3[e],l=new _i(r),c=new Ss([l],{width:ke(a),height:ke(i),style:"width:"+ke(a),viewBox:"0 0 "+1e3*a+" "+1e3*i,preserveAspectRatio:"xMinYMin"}),d=Ci(["overlay"],[c],n);return d.height=i,d.style.height=ke(i),d.style.width=ke(a),d},Kt={number:3,unit:"mu"},Ji={number:4,unit:"mu"},cs={number:5,unit:"mu"},XA={mord:{mop:Kt,mbin:Ji,mrel:cs,minner:Kt},mop:{mord:Kt,mop:Kt,mrel:cs,minner:Kt},mbin:{mord:Ji,mop:Ji,mopen:Ji,minner:Ji},mrel:{mord:cs,mop:cs,mopen:cs,minner:cs},mopen:{},mclose:{mop:Kt,mbin:Ji,mrel:cs,minner:Kt},mpunct:{mord:Kt,mop:Kt,mrel:cs,mopen:Kt,mclose:Kt,mpunct:Kt,minner:Kt},minner:{mord:Kt,mop:Kt,mbin:Ji,mrel:cs,mopen:Kt,mpunct:Kt,minner:Kt}},QA={mord:{mop:Kt},mop:{mord:Kt,mop:Kt},mbin:{},mrel:{},mopen:{},mclose:{mop:Kt},mpunct:{},minner:{mop:Kt}},J3={},K0={},Y0={};function Ce(t){for(var{type:e,names:n,props:r,handler:a,htmlBuilder:i,mathmlBuilder:l}=t,c={type:e,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:r.allowedInMath===void 0?!0:r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:a},d=0;d<n.length;++d)J3[n[d]]=c;e&&(i&&(K0[e]=i),l&&(Y0[e]=l))}function vo(t){var{type:e,htmlBuilder:n,mathmlBuilder:r}=t;Ce({type:e,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:n,mathmlBuilder:r})}var Z0=function(e){return e.type==="ordgroup"&&e.body.length===1?e.body[0]:e},pn=function(e){return e.type==="ordgroup"?e.body:[e]},JA=new Set(["leftmost","mbin","mopen","mrel","mop","mpunct"]),eN=new Set(["rightmost","mrel","mclose","mpunct"]),tN={display:Xe.DISPLAY,text:Xe.TEXT,script:Xe.SCRIPT,scriptscript:Xe.SCRIPTSCRIPT},nN={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},Nn=function(e,n,r,a){a===void 0&&(a=[null,null]);for(var i=[],l=0;l<e.length;l++){var c=Ct(e[l],n);if(c instanceof Tl){var d=c.children;i.push(...d)}else i.push(c)}if(Y3(i),!r)return i;var h=n;if(e.length===1){var p=e[0];p.type==="sizing"?h=n.havingSize(p.size):p.type==="styling"&&(h=n.havingStyle(tN[p.style]))}var m=me([a[0]||"leftmost"],[],n),b=me([a[1]||"rightmost"],[],n),x=r==="root";return Pg(i,(w,S)=>{var E=S.classes[0],A=w.classes[0];E==="mbin"&&eN.has(A)?S.classes[0]="mord":A==="mbin"&&JA.has(E)&&(w.classes[0]="mord")},{node:m},b,x),Pg(i,(w,S)=>{var E,A,T=$g(S),D=$g(w),M=T&&D?w.hasClass("mtight")?(E=QA[T])==null?void 0:E[D]:(A=XA[T])==null?void 0:A[D]:null;if(M)return Z3(M,h)},{node:m},b,x),i},Pg=function(e,n,r,a,i){a&&e.push(a);for(var l=0;l<e.length;l++){var c=e[l],d=ek(c);if(d){Pg(d.children,n,r,null,i);continue}var h=!c.hasClass("mspace");if(h){var p=n(c,r.node);p&&(r.insertAfter?r.insertAfter(p):(e.unshift(p),l++))}h?r.node=c:i&&c.hasClass("newline")&&(r.node=me(["leftmost"])),r.insertAfter=(m=>b=>{e.splice(m+1,0,b),l++})(l)}a&&e.pop()},ek=function(e){return e instanceof Tl||e instanceof bf||e instanceof Al&&e.hasClass("enclosing")?e:null},zg=function(e,n){var r=ek(e);if(r){var a=r.children;if(a.length){if(n==="right")return zg(a[a.length-1],"right");if(n==="left")return zg(a[0],"left")}}return e},$g=function(e,n){if(!e)return null;n&&(e=zg(e,n));var r=e.classes[0];return nN[r]||null},cu=function(e,n){var r=["nulldelimiter"].concat(e.baseSizingClasses());return me(n.concat(r))},Ct=function(e,n,r){if(!e)return me();if(K0[e.type]){var a=K0[e.type](e,n);if(r&&n.size!==r.size){a=me(n.sizingClasses(r),[a],n);var i=n.sizeMultiplier/r.sizeMultiplier;a.height*=i,a.depth*=i}return a}else throw new ye("Got group of unknown type: '"+e.type+"'")};function e0(t,e){var n=me(["base"],t,e),r=me(["strut"]);return r.style.height=ke(n.height+n.depth),n.depth&&(r.style.verticalAlign=ke(-n.depth)),n.children.unshift(r),n}function Fg(t,e){var n=null;t.length===1&&t[0].type==="tag"&&(n=t[0].tag,t=t[0].body);var r=Nn(t,e,"root"),a;r.length===2&&r[1].hasClass("tag")&&(a=r.pop());for(var i=[],l=[],c=0;c<r.length;c++)if(l.push(r[c]),r[c].hasClass("mbin")||r[c].hasClass("mrel")||r[c].hasClass("allowbreak")){for(var d=!1;c<r.length-1&&r[c+1].hasClass("mspace")&&!r[c+1].hasClass("newline");)c++,l.push(r[c]),r[c].hasClass("nobreak")&&(d=!0);d||(i.push(e0(l,e)),l=[])}else r[c].hasClass("newline")&&(l.pop(),l.length>0&&(i.push(e0(l,e)),l=[]),i.push(r[c]));l.length>0&&i.push(e0(l,e));var h;n?(h=e0(Nn(n,e,!0),e),h.classes=["tag"],i.push(h)):a&&i.push(a);var p=me(["katex-html"],i);if(p.setAttribute("aria-hidden","true"),h){var m=h.children[0];m.style.height=ke(p.height+p.depth),p.depth&&(m.style.verticalAlign=ke(-p.depth))}return p}function tk(t){return new Tl(t)}class be{constructor(e,n,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=n||[],this.classes=r||[]}setAttribute(e,n){this.attributes[e]=n}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&e.setAttribute(n,this.attributes[n]);this.classes.length>0&&(e.className=Si(this.classes));for(var r=0;r<this.children.length;r++)if(this.children[r]instanceof mn&&this.children[r+1]instanceof mn){for(var a=this.children[r].toText()+this.children[++r].toText();this.children[r+1]instanceof mn;)a+=this.children[++r].toText();e.appendChild(new mn(a).toNode())}else e.appendChild(this.children[r].toNode());return e}toMarkup(){var e="<"+this.type;for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&(e+=" "+n+'="',e+=Wn(this.attributes[n]),e+='"');this.classes.length>0&&(e+=' class ="'+Wn(Si(this.classes))+'"'),e+=">";for(var r=0;r<this.children.length;r++)e+=this.children[r].toMarkup();return e+="</"+this.type+">",e}toText(){return this.children.map(e=>e.toText()).join("")}}class mn{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 nk{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",ke(this.width)),e}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+ke(this.width)+'"/>'}toText(){return this.character?this.character:" "}}var rN=new Set(["\\imath","\\jmath"]),aN=new Set(["mrow","mtable"]),na=function(e,n,r){return Gt[n][e]&&Gt[n][e].replace&&e.charCodeAt(0)!==55349&&!(K3.hasOwnProperty(e)&&r&&(r.fontFamily&&r.fontFamily.slice(4,6)==="tt"||r.font&&r.font.slice(4,6)==="tt"))&&(e=Gt[n][e].replace),new mn(e)},V1=function(e){return e.length===1?e[0]:new be("mrow",e)},sN={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"},W1=(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 r=t.mode,a=sN[n];if(a)return typeof a=="function"?a(t):a;var i=t.text;if(rN.has(i))return null;if(Gt[r][i]){var l=Gt[r][i].replace;l&&(i=l)}var c=Ig[n].fontName;return H1(i,c,r)?Ig[n].variant:null};function ym(t){if(!t)return!1;if(t.type==="mi"&&t.children.length===1){var e=t.children[0];return e instanceof mn&&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 mn&&n.text===","}else return!1}var Or=function(e,n,r){if(e.length===1){var a=Bt(e[0],n);return r&&a instanceof be&&a.type==="mo"&&(a.setAttribute("lspace","0em"),a.setAttribute("rspace","0em")),[a]}for(var i=[],l,c=0;c<e.length;c++){var d=Bt(e[c],n);if(d instanceof be&&l instanceof be){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(ym(d)&&l.type==="mn"){l.children.push(...d.children);continue}else if(d.type==="mn"&&ym(l))d.children=[...l.children,...d.children],i.pop();else if((d.type==="msup"||d.type==="msub")&&d.children.length>=1&&(l.type==="mn"||ym(l))){var h=d.children[0];h instanceof be&&h.type==="mn"&&(h.children=[...l.children,...h.children],i.pop())}else if(l.type==="mi"&&l.children.length===1){var p=l.children[0];if(p instanceof mn&&p.text==="̸"&&(d.type==="mo"||d.type==="mi"||d.type==="mn")){var m=d.children[0];m instanceof mn&&m.text.length>0&&(m.text=m.text.slice(0,1)+"̸"+m.text.slice(1),i.pop())}}}i.push(d),l=d}return i},Ei=function(e,n,r){return V1(Or(e,n,r))},Bt=function(e,n){if(!e)return new be("mrow");if(Y0[e.type])return Y0[e.type](e,n);throw new ye("Got group of unknown type: '"+e.type+"'")};function x2(t,e,n,r,a){var i=Or(t,n),l;i.length===1&&i[0]instanceof be&&aN.has(i[0].type)?l=i[0]:l=new be("mrow",i);var c=new be("annotation",[new mn(e)]);c.setAttribute("encoding","application/x-tex");var d=new be("semantics",[l,c]),h=new be("math",[d]);h.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&h.setAttribute("display","block");var p=a?"katex":"katex-mathml";return me([p],[h])}var iN=[[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]],w2=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],k2=function(e,n){return n.size<2?e:iN[e-1][n.size-1]};class ps{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||ps.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=w2[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 ps(n)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:k2(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:w2[e-1]})}havingBaseStyle(e){e=e||this.style.text();var n=k2(ps.BASESIZE,e);return this.size===n&&this.textSize===ps.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!==ps.BASESIZE?["sizing","reset-size"+this.size,"size"+ps.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=HA(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}ps.BASESIZE=6;var rk=function(e){return new ps({style:e.displayMode?Xe.DISPLAY:Xe.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},ak=function(e,n){if(n.displayMode){var r=["katex-display"];n.leqno&&r.push("leqno"),n.fleqn&&r.push("fleqn"),e=me(r,[e])}return e},oN=function(e,n,r){var a=rk(r),i;if(r.output==="mathml")return x2(e,n,a,r.displayMode,!0);if(r.output==="html"){var l=Fg(e,a);i=me(["katex"],[l])}else{var c=x2(e,n,a,r.displayMode,!1),d=Fg(e,a);i=me(["katex"],[c,d])}return ak(i,r)},lN=function(e,n,r){var a=rk(r),i=Fg(e,a),l=me(["katex"],[i]);return ak(l,r)},cN={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":"="},wf=function(e){var n=new be("mo",[new mn(cN[e.replace(/^\\/,"")])]);return n.setAttribute("stretchy","true"),n},uN={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]},dN=new Set(["widehat","widecheck","widetilde","utilde"]),kf=function(e,n){function r(){var c=4e5,d=e.label.slice(1);if(dN.has(d)&&"base"in e){var h=e.base.type==="ordgroup"?e.base.body.length:1,p,m,b;if(h>5)d==="widehat"||d==="widecheck"?(p=420,c=2364,b=.42,m=d+"4"):(p=312,c=2340,b=.34,m="tilde4");else{var x=[1,1,2,2,3,3][h];d==="widehat"||d==="widecheck"?(c=[0,1062,2364,2364,2364][x],p=[0,239,300,360,420][x],b=[0,.24,.3,.3,.36,.42][x],m=d+x):(c=[0,600,1033,2339,2340][x],p=[0,260,286,306,312][x],b=[0,.26,.286,.3,.306,.34][x],m="tilde"+x)}var w=new _i(m),S=new Ss([w],{width:"100%",height:ke(b),viewBox:"0 0 "+c+" "+p,preserveAspectRatio:"none"});return{span:Ci([],[S],n),minWidth:0,height:b}}else{var E=[],A=uN[d];if(!A)throw new Error('No SVG data for "'+d+'".');var[T,D,M]=A,B=M/1e3,I=T.length,U,W;if(I===1){if(A.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+d+'".');U=["hide-tail"],W=[A[3]]}else if(I===2)U=["halfarrow-left","halfarrow-right"],W=["xMinYMin","xMaxYMin"];else if(I===3)U=["brace-left","brace-center","brace-right"],W=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
287
- `+I+" children.");for(var Y=0;Y<I;Y++){var oe=new _i(T[Y]),ae=new Ss([oe],{width:"400em",height:ke(B),viewBox:"0 0 "+c+" "+M,preserveAspectRatio:W[Y]+" slice"}),V=Ci([U[Y]],[ae],n);if(I===1)return{span:V,minWidth:D,height:B};V.style.height=ke(B),E.push(V)}return{span:me(["stretchy"],E,n),minWidth:D,height:B}}}var{span:a,minWidth:i,height:l}=r();return a.height=l,a.style.height=ke(l),i>0&&(a.style.minWidth=ke(i)),a},fN=function(e,n,r,a,i){var l,c=e.height+e.depth+r+a;if(/fbox|color|angl/.test(n)){if(l=me(["stretchy",n],[],i),n==="fbox"){var d=i.color&&i.getColor();d&&(l.style.borderColor=d)}}else{var h=[];/^[bx]cancel$/.test(n)&&h.push(new Mg({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(n)&&h.push(new Mg({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var p=new Ss(h,{width:"100%",height:ke(c)});l=Ci([],[p],i)}return l.height=c,l.style.height=ke(c),l},hN={bin:1,close:1,inner:1,open:1,punct:1,rel:1},pN={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function mN(t){return t in hN}function it(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 Sf(t){var e=_f(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 _f(t){return t&&(t.type==="atom"||pN.hasOwnProperty(t.type))?t:null}var sk=t=>{if(t instanceof Rr)return t;if(FA(t)&&t.children.length===1)return sk(t.children[0])},K1=(t,e)=>{var n,r,a;t&&t.type==="supsub"?(r=it(t.base,"accent"),n=r.base,t.base=n,a=$A(Ct(t,e)),t.base=r):(r=it(t,"accent"),n=r.base);var i=Ct(n,e.havingCrampedStyle()),l=r.isShifty&&_s(n),c=0;if(l){var d,h;c=(d=(h=sk(i))==null?void 0:h.skew)!=null?d:0}var p=r.label==="\\c",m=p?i.height+i.depth:Math.min(i.height,e.fontMetrics().xHeight),b;if(r.isStretchy)b=kf(r,e),b=_t({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:b,wrapperClasses:["svg-align"],wrapperStyle:c>0?{width:"calc(100% - "+ke(2*c)+")",marginLeft:ke(2*c)}:void 0}]});else{var x,w;r.label==="\\vec"?(x=Q3("vec",e),w=X3.vec[1]):(x=xf({mode:r.mode,text:r.label},e,"textord"),x=zA(x),x.italic=0,w=x.width,p&&(m+=x.depth)),b=me(["accent-body"],[x]);var S=r.label==="\\textcircled";S&&(b.classes.push("accent-full"),m=i.height);var E=c;S||(E-=w/2),b.style.left=ke(E),r.label==="\\textcircled"&&(b.style.top=".2em"),b=_t({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-m},{type:"elem",elem:b}]})}var A=me(["mord","accent"],[b],e);return a?(a.children[0]=A,a.height=Math.max(A.height,a.height),a.classes[0]="mord",a):A},ik=(t,e)=>{var n=t.isStretchy?wf(t.label):new be("mo",[na(t.label,t.mode)]),r=new be("mover",[Bt(t.base,e),n]);return r.setAttribute("accent","true"),r},gN=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));Ce({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=Z0(e[0]),r=!gN.test(t.funcName),a=!r||t.funcName==="\\widehat"||t.funcName==="\\widetilde"||t.funcName==="\\widecheck";return{type:"accent",mode:t.parser.mode,label:t.funcName,isStretchy:r,isShifty:a,base:n}},htmlBuilder:K1,mathmlBuilder:ik});Ce({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(t,e)=>{var n=e[0],r=t.parser.mode;return r==="math"&&(t.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+t.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:t.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:K1,mathmlBuilder:ik});Ce({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(t,e)=>{var{parser:n,funcName:r}=t,a=e[0];return{type:"accentUnder",mode:n.mode,label:r,base:a}},htmlBuilder:(t,e)=>{var n=Ct(t.base,e),r=kf(t,e),a=t.label==="\\utilde"?.12:0,i=_t({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:a},{type:"elem",elem:n}]});return me(["mord","accentunder"],[i],e)},mathmlBuilder:(t,e)=>{var n=wf(t.label),r=new be("munder",[Bt(t.base,e),n]);return r.setAttribute("accentunder","true"),r}});var t0=t=>{var e=new be("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};Ce({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,n){var{parser:r,funcName:a}=t;return{type:"xArrow",mode:r.mode,label:a,body:e[0],below:n[0]}},htmlBuilder(t,e){var n=e.style,r=e.havingStyle(n.sup()),a=_l(Ct(t.body,r,e),e),i=t.label.slice(0,2)==="\\x"?"x":"cd";a.classes.push(i+"-arrow-pad");var l;t.below&&(r=e.havingStyle(n.sub()),l=_l(Ct(t.below,r,e),e),l.classes.push(i+"-arrow-pad"));var c=kf(t,e),d=-e.fontMetrics().axisHeight+.5*c.height,h=-e.fontMetrics().axisHeight-.5*c.height-.111;(a.depth>.25||t.label==="\\xleftequilibrium")&&(h-=a.depth);var p;if(l){var m=-e.fontMetrics().axisHeight+l.height+.5*c.height+.111;p=_t({positionType:"individualShift",children:[{type:"elem",elem:a,shift:h},{type:"elem",elem:c,shift:d,wrapperClasses:["svg-align"]},{type:"elem",elem:l,shift:m}]})}else p=_t({positionType:"individualShift",children:[{type:"elem",elem:a,shift:h},{type:"elem",elem:c,shift:d,wrapperClasses:["svg-align"]}]});return me(["mrel","x-arrow"],[p],e)},mathmlBuilder(t,e){var n=wf(t.label);n.setAttribute("minsize",t.label.charAt(0)==="x"?"1.75em":"3.0em");var r;if(t.body){var a=t0(Bt(t.body,e));if(t.below){var i=t0(Bt(t.below,e));r=new be("munderover",[n,i,a])}else r=new be("mover",[n,a])}else if(t.below){var l=t0(Bt(t.below,e));r=new be("munder",[n,l])}else r=t0(),r=new be("mover",[n,r]);return r}});function ok(t,e){var n=Nn(t.body,e,!0);return me([t.mclass],n,e)}function lk(t,e){var n,r=Or(t.body,e);return t.mclass==="minner"?n=new be("mpadded",r):t.mclass==="mord"?t.isCharacterBox?(n=r[0],n.type="mi"):n=new be("mi",r):(t.isCharacterBox?(n=r[0],n.type="mo"):n=new be("mo",r),t.mclass==="mbin"?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):t.mclass==="mpunct"?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):t.mclass==="mopen"||t.mclass==="mclose"?(n.attributes.lspace="0em",n.attributes.rspace="0em"):t.mclass==="minner"&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em")),n}Ce({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(t,e){var{parser:n,funcName:r}=t,a=e[0];return{type:"mclass",mode:n.mode,mclass:"m"+r.slice(5),body:pn(a),isCharacterBox:_s(a)}},htmlBuilder:ok,mathmlBuilder:lk});var Cf=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"};Ce({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(t,e){var{parser:n}=t;return{type:"mclass",mode:n.mode,mclass:Cf(e[0]),body:pn(e[1]),isCharacterBox:_s(e[1])}}});Ce({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(t,e){var{parser:n,funcName:r}=t,a=e[1],i=e[0],l;r!=="\\stackrel"?l=Cf(a):l="mrel";var c={type:"op",mode:a.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!=="\\stackrel",body:pn(a)},d={type:"supsub",mode:i.mode,base:c,sup:r==="\\underset"?null:i,sub:r==="\\underset"?i:null};return{type:"mclass",mode:n.mode,mclass:l,body:[d],isCharacterBox:_s(d)}},htmlBuilder:ok,mathmlBuilder:lk});Ce({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:n}=t;return{type:"pmb",mode:n.mode,mclass:Cf(e[0]),body:pn(e[0])}},htmlBuilder(t,e){var n=Nn(t.body,e,!0),r=me([t.mclass],n,e);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(t,e){var n=Or(t.body,e),r=new be("mstyle",n);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var yN={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},S2=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),_2=t=>t.type==="textord"&&t.text==="@",bN=(t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e;function vN(t,e,n){var r=yN[t];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(r,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var a=n.callFunction("\\\\cdleft",[e[0]],[]),i={type:"atom",text:r,mode:"math",family:"rel"},l=n.callFunction("\\Big",[i],[]),c=n.callFunction("\\\\cdright",[e[1]],[]),d={type:"ordgroup",mode:"math",body:[a,l,c]};return n.callFunction("\\\\cdparent",[d],[])}case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var h={type:"textord",text:"\\Vert",mode:"math"};return n.callFunction("\\Big",[h],[])}default:return{type:"textord",text:" ",mode:"math"}}}function xN(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 ye("Expected \\\\ or \\cr or \\end",t.nextToken)}for(var r=[],a=[r],i=0;i<e.length;i++){for(var l=e[i],c=S2(),d=0;d<l.length;d++)if(!_2(l[d]))c.body.push(l[d]);else{r.push(c),d+=1;var h=Sf(l[d]).text,p=new Array(2);if(p[0]={type:"ordgroup",mode:"math",body:[]},p[1]={type:"ordgroup",mode:"math",body:[]},!"=|.".includes(h))if("<>AV".includes(h))for(var m=0;m<2;m++){for(var b=!0,x=d+1;x<l.length;x++){if(bN(l[x],h)){b=!1,d=x;break}if(_2(l[x]))throw new ye("Missing a "+h+" character to complete a CD arrow.",l[x]);p[m].body.push(l[x])}if(b)throw new ye("Missing a "+h+" character to complete a CD arrow.",l[d])}else throw new ye('Expected one of "<>AV=|." after @',l[d]);var w=vN(h,p,t),S={type:"styling",body:[w],mode:"math",style:"display",resetFont:!0};r.push(S),c=S2()}i%2===0?r.push(c):r.shift(),r=[],a.push(r)}t.gullet.endGroup(),t.gullet.endGroup();var E=new Array(a[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:a,arraystretch:1,addJot:!0,rowGaps:[null],cols:E,colSeparationType:"CD",hLinesBeforeRow:new Array(a.length+1).fill([])}}Ce({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(t,e){var{parser:n,funcName:r}=t;return{type:"cdlabel",mode:n.mode,side:r.slice(4),label:e[0]}},htmlBuilder(t,e){var n=e.havingStyle(e.style.sup()),r=_l(Ct(t.label,n,e),e);return r.classes.push("cd-label-"+t.side),r.style.bottom=ke(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(t,e){var n=new be("mrow",[Bt(t.label,e)]);return n=new be("mpadded",[n]),n.setAttribute("width","0"),t.side==="left"&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),n=new be("mstyle",[n]),n.setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}});Ce({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=_l(Ct(t.fragment,e),e);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder(t,e){return new be("mrow",[Bt(t.fragment,e)])}});Ce({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(t,e){for(var{parser:n}=t,r=it(e[0],"ordgroup"),a=r.body,i="",l=0;l<a.length;l++){var c=it(a[l],"textord");i+=c.text}var d=parseInt(i),h;if(isNaN(d))throw new ye("\\@char has non-numeric argument "+i);if(d<0||d>=1114111)throw new ye("\\@char with invalid code point "+i);return d<=65535?h=String.fromCharCode(d):(d-=65536,h=String.fromCharCode((d>>10)+55296,(d&1023)+56320)),{type:"textord",mode:n.mode,text:h}}});var ck=(t,e)=>{var n=Nn(t.body,e.withColor(t.color),!1);return Es(n)},uk=(t,e)=>{var n=Or(t.body,e.withColor(t.color)),r=new be("mstyle",n);return r.setAttribute("mathcolor",t.color),r};Ce({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(t,e){var{parser:n}=t,r=it(e[0],"color-token").color,a=e[1];return{type:"color",mode:n.mode,color:r,body:pn(a)}},htmlBuilder:ck,mathmlBuilder:uk});Ce({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(t,e){var{parser:n,breakOnTokenText:r}=t,a=it(e[0],"color-token").color;n.gullet.macros.set("\\current@color",a);var i=n.parseExpression(!0,r);return{type:"color",mode:n.mode,color:a,body:i}},htmlBuilder:ck,mathmlBuilder:uk});Ce({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(t,e,n){var{parser:r}=t,a=r.gullet.future().text==="["?r.parseSizeGroup(!0):null,i=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:i,size:a&&it(a,"size").value}},htmlBuilder(t,e){var n=me(["mspace"],[],e);return t.newLine&&(n.classes.push("newline"),t.size&&(n.style.marginTop=ke(Yt(t.size,e)))),n},mathmlBuilder(t,e){var n=new be("mspace");return t.newLine&&(n.setAttribute("linebreak","newline"),t.size&&n.setAttribute("height",ke(Yt(t.size,e)))),n}});var Ug={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},dk=t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new ye("Expected a control sequence",t);return e},wN=t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},fk=(t,e,n,r)=>{var a=t.gullet.macros.get(n.text);a==null&&(n.noexpand=!0,a={tokens:[n],numArgs:0,unexpandable:!t.gullet.isExpandable(n.text)}),t.gullet.macros.set(e,a,r)};Ce({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(t){var{parser:e,funcName:n}=t;e.consumeSpaces();var r=e.fetch();if(Ug[r.text])return(n==="\\global"||n==="\\\\globallong")&&(r.text=Ug[r.text]),it(e.parseFunction(),"internal");throw new ye("Invalid token after macro prefix",r)}});Ce({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:n}=t,r=e.gullet.popToken(),a=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(a))throw new ye("Expected a control sequence",r);for(var i=0,l,c=[[]];e.gullet.future().text!=="{";)if(r=e.gullet.popToken(),r.text==="#"){if(e.gullet.future().text==="{"){l=e.gullet.future(),c[i].push("{");break}if(r=e.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new ye('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==i+1)throw new ye('Argument number "'+r.text+'" out of order');i++,c.push([])}else{if(r.text==="EOF")throw new ye("Expected a macro definition");c[i].push(r.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(a,{tokens:d,numArgs:i,delimiters:c},n===Ug[n]),{type:"internal",mode:e.mode}}});Ce({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:n}=t,r=dk(e.gullet.popToken());e.gullet.consumeSpaces();var a=wN(e);return fk(e,r,a,n==="\\\\globallet"),{type:"internal",mode:e.mode}}});Ce({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:n}=t,r=dk(e.gullet.popToken()),a=e.gullet.popToken(),i=e.gullet.popToken();return fk(e,r,i,n==="\\\\globalfuture"),e.gullet.pushToken(i),e.gullet.pushToken(a),{type:"internal",mode:e.mode}}});var zc=function(e,n,r){var a=Gt.math[e]&&Gt.math[e].replace,i=H1(a||e,n,r);if(!i)throw new Error("Unsupported symbol "+e+" and font size "+n+".");return i},Y1=function(e,n,r,a){var i=r.havingBaseStyle(n),l=me(a.concat(i.sizingClasses(r)),[e],r),c=i.sizeMultiplier/r.sizeMultiplier;return l.height*=c,l.depth*=c,l.maxFontSize=i.sizeMultiplier,l},hk=function(e,n,r){var a=n.havingBaseStyle(r),i=(1-n.sizeMultiplier/a.sizeMultiplier)*n.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=ke(i),e.height-=i,e.depth+=i},kN=function(e,n,r,a,i,l){var c=er(e,"Main-Regular",i,a),d=Y1(c,n,a,l);return hk(d,a,n),d},SN=function(e,n,r,a){return er(e,"Size"+n+"-Regular",r,a)},pk=function(e,n,r,a,i,l){var c=SN(e,n,i,a),d=Y1(me(["delimsizing","size"+n],[c],a),Xe.TEXT,a,l);return r&&hk(d,a,Xe.TEXT),d},bm=function(e,n,r){var a;n==="Size1-Regular"?a="delim-size1":a="delim-size4";var i=me(["delimsizinginner",a],[me([],[er(e,n,r)])]);return{type:"elem",elem:i}},vm=function(e,n,r){var a=Da["Size4-Regular"][e.charCodeAt(0)]?Da["Size4-Regular"][e.charCodeAt(0)][4]:Da["Size1-Regular"][e.charCodeAt(0)][4],i=new _i("inner",DA(e,Math.round(1e3*n))),l=new Ss([i],{width:ke(a),height:ke(n),style:"width:"+ke(a),viewBox:"0 0 "+1e3*a+" "+Math.round(1e3*n),preserveAspectRatio:"xMinYMin"}),c=Ci([],[l],r);return c.height=n,c.style.height=ke(n),c.style.width=ke(a),{type:"elem",elem:c}},Hg=.008,n0={type:"kern",size:-1*Hg},_N=new Set(["|","\\lvert","\\rvert","\\vert"]),CN=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),mk=function(e,n,r,a,i,l){var c,d,h,p,m="",b=0;c=h=p=e,d=null;var x="Size1-Regular";e==="\\uparrow"?h=p="⏐":e==="\\Uparrow"?h=p="‖":e==="\\downarrow"?c=h="⏐":e==="\\Downarrow"?c=h="‖":e==="\\updownarrow"?(c="\\uparrow",h="⏐",p="\\downarrow"):e==="\\Updownarrow"?(c="\\Uparrow",h="‖",p="\\Downarrow"):_N.has(e)?(h="∣",m="vert",b=333):CN.has(e)?(h="∥",m="doublevert",b=556):e==="["||e==="\\lbrack"?(c="⎡",h="⎢",p="⎣",x="Size4-Regular",m="lbrack",b=667):e==="]"||e==="\\rbrack"?(c="⎤",h="⎥",p="⎦",x="Size4-Regular",m="rbrack",b=667):e==="\\lfloor"||e==="⌊"?(h=c="⎢",p="⎣",x="Size4-Regular",m="lfloor",b=667):e==="\\lceil"||e==="⌈"?(c="⎡",h=p="⎢",x="Size4-Regular",m="lceil",b=667):e==="\\rfloor"||e==="⌋"?(h=c="⎥",p="⎦",x="Size4-Regular",m="rfloor",b=667):e==="\\rceil"||e==="⌉"?(c="⎤",h=p="⎥",x="Size4-Regular",m="rceil",b=667):e==="("||e==="\\lparen"?(c="⎛",h="⎜",p="⎝",x="Size4-Regular",m="lparen",b=875):e===")"||e==="\\rparen"?(c="⎞",h="⎟",p="⎠",x="Size4-Regular",m="rparen",b=875):e==="\\{"||e==="\\lbrace"?(c="⎧",d="⎨",p="⎩",h="⎪",x="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(c="⎫",d="⎬",p="⎭",h="⎪",x="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(c="⎧",p="⎩",h="⎪",x="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(c="⎫",p="⎭",h="⎪",x="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(c="⎧",p="⎭",h="⎪",x="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(c="⎫",p="⎩",h="⎪",x="Size4-Regular");var w=zc(c,x,i),S=w.height+w.depth,E=zc(h,x,i),A=E.height+E.depth,T=zc(p,x,i),D=T.height+T.depth,M=0,B=1;if(d!==null){var I=zc(d,x,i);M=I.height+I.depth,B=2}var U=S+D+M,W=Math.max(0,Math.ceil((n-U)/(B*A))),Y=U+W*B*A,oe=a.fontMetrics().axisHeight;r&&(oe*=a.sizeMultiplier);var ae=Y/2-oe,V=[];if(m.length>0){var he=Y-S-D,ve=Math.round(Y*1e3),ge=OA(m,Math.round(he*1e3)),q=new _i(m,ge),ie=ke(b/1e3),_e=ke(ve/1e3),Se=new Ss([q],{width:ie,height:_e,viewBox:"0 0 "+b+" "+ve}),Qe=Ci([],[Se],a);Qe.height=ve/1e3,Qe.style.width=ie,Qe.style.height=_e,V.push({type:"elem",elem:Qe})}else{if(V.push(bm(p,x,i)),V.push(n0),d===null){var qe=Y-S-D+2*Hg;V.push(vm(h,qe,a))}else{var Ke=(Y-S-D-M)/2+2*Hg;V.push(vm(h,Ke,a)),V.push(n0),V.push(bm(d,x,i)),V.push(n0),V.push(vm(h,Ke,a))}V.push(n0),V.push(bm(c,x,i))}var Ie=a.havingBaseStyle(Xe.TEXT),vt=_t({positionType:"bottom",positionData:ae,children:V});return Y1(me(["delimsizing","mult"],[vt],Ie),Xe.TEXT,a,l)},xm=80,wm=.08,km=function(e,n,r,a,i){var l=MA(e,a,r),c=new _i(e,l),d=new Ss([c],{width:"400em",height:ke(n),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return Ci(["hide-tail"],[d],i)},EN=function(e,n){var r=n.havingBaseSizing(),a=xk("\\surd",e*r.sizeMultiplier,vk,r),i=r.sizeMultiplier,l=Math.max(0,n.minRuleThickness-n.fontMetrics().sqrtRuleThickness),c,d,h,p,m;return a.type==="small"?(p=1e3+1e3*l+xm,e<1?i=1:e<1.4&&(i=.7),d=(1+l+wm)/i,h=(1+l)/i,c=km("sqrtMain",d,p,l,n),c.style.minWidth="0.853em",m=.833/i):a.type==="large"?(p=(1e3+xm)*Yc[a.size],h=(Yc[a.size]+l)/i,d=(Yc[a.size]+l+wm)/i,c=km("sqrtSize"+a.size,d,p,l,n),c.style.minWidth="1.02em",m=1/i):(d=e+l+wm,h=e+l,p=Math.floor(1e3*e+l)+xm,c=km("sqrtTall",d,p,l,n),c.style.minWidth="0.742em",m=1.056),c.height=h,c.style.height=ke(d),{span:c,advanceWidth:m,ruleWidth:(n.fontMetrics().sqrtRuleThickness+l)*i}},gk=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),TN=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),yk=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),Yc=[0,1.2,1.8,2.4,3],bk=function(e,n,r,a,i){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),gk.has(e)||yk.has(e))return pk(e,n,!1,r,a,i);if(TN.has(e))return mk(e,Yc[n],!1,r,a,i);throw new ye("Illegal delimiter: '"+e+"'")},AN=[{type:"small",style:Xe.SCRIPTSCRIPT},{type:"small",style:Xe.SCRIPT},{type:"small",style:Xe.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],NN=[{type:"small",style:Xe.SCRIPTSCRIPT},{type:"small",style:Xe.SCRIPT},{type:"small",style:Xe.TEXT},{type:"stack"}],vk=[{type:"small",style:Xe.SCRIPTSCRIPT},{type:"small",style:Xe.SCRIPT},{type:"small",style:Xe.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],RN=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.")},xk=function(e,n,r,a){for(var i=Math.min(2,3-a.style.size),l=i;l<r.length;l++){var c=r[l];if(c.type==="stack")break;var d=zc(e,RN(c),"math"),h=d.height+d.depth;if(c.type==="small"){var p=a.havingBaseStyle(c.style);h*=p.sizeMultiplier}if(h>n)return c}return r[r.length-1]},Gg=function(e,n,r,a,i,l){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var c;yk.has(e)?c=AN:gk.has(e)?c=vk:c=NN;var d=xk(e,n,c,a);return d.type==="small"?kN(e,d.style,r,a,i,l):d.type==="large"?pk(e,d.size,r,a,i,l):mk(e,n,r,a,i,l)},Sm=function(e,n,r,a,i,l){var c=a.fontMetrics().axisHeight*a.sizeMultiplier,d=901,h=5/a.fontMetrics().ptPerEm,p=Math.max(n-c,r+c),m=Math.max(p/500*d,2*p-h);return Gg(e,m,!0,a,i,l)},C2={"\\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}},MN=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 E2(t){return"isMiddle"in t}function Ef(t,e){var n=_f(t);if(n&&MN.has(n.text))return n;throw n?new ye("Invalid delimiter '"+n.text+"' after '"+e.funcName+"'",t):new ye("Invalid delimiter type '"+t.type+"'",t)}Ce({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=Ef(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:C2[t.funcName].size,mclass:C2[t.funcName].mclass,delim:n.text}},htmlBuilder:(t,e)=>t.delim==="."?me([t.mclass]):bk(t.delim,t.size,e,t.mode,[t.mclass]),mathmlBuilder:t=>{var e=[];t.delim!=="."&&e.push(na(t.delim,t.mode));var n=new be("mo",e);t.mclass==="mopen"||t.mclass==="mclose"?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=ke(Yc[t.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}});function T2(t){if(!t.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Ce({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 ye("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:t.parser.mode,delim:Ef(e[0],t).text,color:n}}});Ce({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var n=Ef(e[0],t),r=t.parser;++r.leftrightDepth;var a=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var i=it(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:a,left:n.text,right:i.delim,rightColor:i.color}},htmlBuilder:(t,e)=>{T2(t);for(var n=Nn(t.body,e,!0,["mopen","mclose"]),r=0,a=0,i=!1,l=0;l<n.length;l++){var c=n[l];E2(c)?i=!0:(r=Math.max(n[l].height,r),a=Math.max(n[l].depth,a))}r*=e.sizeMultiplier,a*=e.sizeMultiplier;var d;if(t.left==="."?d=cu(e,["mopen"]):d=Sm(t.left,r,a,e,t.mode,["mopen"]),n.unshift(d),i)for(var h=1;h<n.length;h++){var p=n[h];if(E2(p)){var m=p.isMiddle;n[h]=Sm(m.delim,r,a,m.options,t.mode,[])}}var b;if(t.right===".")b=cu(e,["mclose"]);else{var x=t.rightColor?e.withColor(t.rightColor):e;b=Sm(t.right,r,a,x,t.mode,["mclose"])}return n.push(b),me(["minner"],n,e)},mathmlBuilder:(t,e)=>{T2(t);var n=Or(t.body,e);if(t.left!=="."){var r=new be("mo",[na(t.left,t.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if(t.right!=="."){var a=new be("mo",[na(t.right,t.mode)]);a.setAttribute("fence","true"),t.rightColor&&a.setAttribute("mathcolor",t.rightColor),n.push(a)}return V1(n)}});Ce({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var n=Ef(e[0],t);if(!t.parser.leftrightDepth)throw new ye("\\middle without preceding \\left",n);return{type:"middle",mode:t.parser.mode,delim:n.text}},htmlBuilder:(t,e)=>{var n;return t.delim==="."?n=cu(e,[]):(n=bk(t.delim,1,e,t.mode,[]),n.isMiddle={delim:t.delim,options:e}),n},mathmlBuilder:(t,e)=>{var n=t.delim==="\\vert"||t.delim==="|"?na("|","text"):na(t.delim,t.mode),r=new be("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var Tf=(t,e)=>{var n=_l(Ct(t.body,e),e),r=t.label.slice(1),a=e.sizeMultiplier,i,l,c=_s(t.body);if(r==="sout")i=me(["stretchy","sout"]),i.height=e.fontMetrics().defaultRuleThickness/a,l=-.5*e.fontMetrics().xHeight;else if(r==="phase"){var d=Yt({number:.6,unit:"pt"},e),h=Yt({number:.35,unit:"ex"},e),p=e.havingBaseSizing();a=a/p.sizeMultiplier;var m=n.height+n.depth+d+h;n.style.paddingLeft=ke(m/2+d);var b=Math.floor(1e3*m*a),x=NA(b),w=new Ss([new _i("phase",x)],{width:"400em",height:ke(b/1e3),viewBox:"0 0 400000 "+b,preserveAspectRatio:"xMinYMin slice"});i=Ci(["hide-tail"],[w],e),i.style.height=ke(m),l=n.depth+d+h}else{/cancel/.test(r)?c||n.classes.push("cancel-pad"):r==="angl"?n.classes.push("anglpad"):n.classes.push("boxpad");var S,E,A=0;/box/.test(r)?(A=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),S=e.fontMetrics().fboxsep+(r==="colorbox"?0:A),E=S):r==="angl"?(A=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),S=4*A,E=Math.max(0,.25-n.depth)):(S=c?.2:0,E=S),i=fN(n,r,S,E,e),/fbox|boxed|fcolorbox/.test(r)?(i.style.borderStyle="solid",i.style.borderWidth=ke(A)):r==="angl"&&A!==.049&&(i.style.borderTopWidth=ke(A),i.style.borderRightWidth=ke(A)),l=n.depth+E,t.backgroundColor&&(i.style.backgroundColor=t.backgroundColor,t.borderColor&&(i.style.borderColor=t.borderColor))}var T;if(t.backgroundColor)T=_t({positionType:"individualShift",children:[{type:"elem",elem:i,shift:l},{type:"elem",elem:n,shift:0}]});else{var D=/cancel|phase/.test(r)?["svg-align"]:[];T=_t({positionType:"individualShift",children:[{type:"elem",elem:n,shift:0},{type:"elem",elem:i,shift:l,wrapperClasses:D}]})}return/cancel/.test(r)&&(T.height=n.height,T.depth=n.depth),/cancel/.test(r)&&!c?me(["mord","cancel-lap"],[T],e):me(["mord"],[T],e)},Af=(t,e)=>{var n,r=new be(t.label.includes("colorbox")?"mpadded":"menclose",[Bt(t.body,e)]);switch(t.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*n+"pt"),r.setAttribute("height","+"+2*n+"pt"),r.setAttribute("lspace",n+"pt"),r.setAttribute("voffset",n+"pt"),t.label==="\\fcolorbox"){var a=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);r.setAttribute("style","border: "+ke(a)+" solid "+t.borderColor)}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return t.backgroundColor&&r.setAttribute("mathbackground",t.backgroundColor),r};Ce({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(t,e,n){var{parser:r,funcName:a}=t,i=it(e[0],"color-token").color,l=e[1];return{type:"enclose",mode:r.mode,label:a,backgroundColor:i,body:l}},htmlBuilder:Tf,mathmlBuilder:Af});Ce({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(t,e,n){var{parser:r,funcName:a}=t,i=it(e[0],"color-token").color,l=it(e[1],"color-token").color,c=e[2];return{type:"enclose",mode:r.mode,label:a,backgroundColor:l,borderColor:i,body:c}},htmlBuilder:Tf,mathmlBuilder:Af});Ce({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]}}});Ce({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(t,e){var{parser:n,funcName:r}=t,a=e[0];return{type:"enclose",mode:n.mode,label:r,body:a}},htmlBuilder:Tf,mathmlBuilder:Af});Ce({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:n,funcName:r}=t;n.mode==="math"&&n.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var a=e[0];return{type:"enclose",mode:n.mode,label:r,body:a}},htmlBuilder:Tf,mathmlBuilder:Af});Ce({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 wk={};function Ia(t){for(var{type:e,names:n,props:r,handler:a,htmlBuilder:i,mathmlBuilder:l}=t,c={type:e,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:a},d=0;d<n.length;++d)wk[n[d]]=c;i&&(K0[e]=i),l&&(Y0[e]=l)}var kk={};function L(t,e){kk[t]=e}class mr{constructor(e,n,r){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=n,this.end=r}static range(e,n){return n?!e||!e.loc||!n.loc||e.loc.lexer!==n.loc.lexer?null:new mr(e.loc.lexer,e.loc.start,n.loc.end):e&&e.loc}}class Nr{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 Nr(n,mr.range(this,e))}}function A2(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 Nf=t=>{var e=t.parser.settings;if(!e.displayMode)throw new ye("{"+t.envName+"} can be used only in display mode.")},DN=new Set(["gather","gather*"]);function Z1(t){if(!t.includes("ed"))return!t.includes("*")}function Ai(t,e,n){var{hskipBeforeAndAfter:r,addJot:a,cols:i,arraystretch:l,colSeparationType:c,autoTag:d,singleRow:h,emptySingleRow:p,maxNumCols:m,leqno:b}=e;if(t.gullet.beginGroup(),h||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 ye("Invalid \\arraystretch: "+x)}t.gullet.beginGroup();var w=[],S=[w],E=[],A=[],T=d!=null?[]:void 0;function D(){d&&t.gullet.macros.set("\\@eqnsw","1",!0)}function M(){T&&(t.gullet.macros.get("\\df@tag")?(T.push(t.subparse([new Nr("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):T.push(!!d&&t.gullet.macros.get("\\@eqnsw")==="1"))}for(D(),A.push(A2(t));;){var B=t.parseExpression(!1,h?"\\end":"\\\\");t.gullet.endGroup(),t.gullet.beginGroup();var I={type:"ordgroup",mode:t.mode,body:B};n&&(I={type:"styling",mode:t.mode,style:n,resetFont:!0,body:[I]}),w.push(I);var U=t.fetch().text;if(U==="&"){if(m&&w.length===m){if(h||c)throw new ye("Too many tab characters: &",t.nextToken);t.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}t.consume()}else if(U==="\\end"){M(),w.length===1&&I.type==="styling"&&I.body.length===1&&I.body[0].type==="ordgroup"&&I.body[0].body.length===0&&(S.length>1||!p)&&S.pop(),A.length<S.length+1&&A.push([]);break}else if(U==="\\\\"){t.consume();var W=void 0;t.gullet.future().text!==" "&&(W=t.parseSizeGroup(!0)),E.push(W?W.value:null),M(),A.push(A2(t)),w=[],S.push(w),D()}else throw new ye("Expected & or \\\\ or \\cr or \\end",t.nextToken)}return t.gullet.endGroup(),t.gullet.endGroup(),{type:"array",mode:t.mode,addJot:a,arraystretch:l,body:S,cols:i,rowGaps:E,hskipBeforeAndAfter:r,hLinesBeforeRow:A,colSeparationType:c,tags:T,leqno:b}}function X1(t){return t.slice(0,1)==="d"?"display":"text"}var Pa=function(e,n){var r,a,i=e.body.length,l=e.hLinesBeforeRow,c=0,d=new Array(i),h=[],p=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(Xe.SCRIPT).sizeMultiplier;b=.2778*(x/n.sizeMultiplier)}var w=e.colSeparationType==="CD"?Yt({number:3,unit:"ex"},n):12*m,S=3*m,E=e.arraystretch*w,A=.7*E,T=.3*E,D=0;function M(It){for(var In=0;In<It.length;++In)In>0&&(D+=.25),h.push({pos:D,isDashed:It[In]})}for(M(l[0]),r=0;r<e.body.length;++r){var B=e.body[r],I=A,U=T;c<B.length&&(c=B.length);var W={cells:new Array(B.length),height:0,depth:0,pos:0};for(a=0;a<B.length;++a){var Y=Ct(B[a],n);U<Y.depth&&(U=Y.depth),I<Y.height&&(I=Y.height),W.cells[a]=Y}var oe=e.rowGaps[r],ae=0;oe&&(ae=Yt(oe,n),ae>0&&(ae+=T,U<ae&&(U=ae),ae=0)),e.addJot&&r<e.body.length-1&&(U+=S),W.height=I,W.depth=U,D+=I,W.pos=D,D+=U+ae,d[r]=W,M(l[r+1])}var V=D/2+n.fontMetrics().axisHeight,he=e.cols||[],ve=[],ge,q,ie=[];if(e.tags&&e.tags.some(It=>It))for(r=0;r<i;++r){var _e=d[r],Se=_e.pos-V,Qe=e.tags[r],qe=void 0;Qe===!0?qe=me(["eqn-num"],[],n):Qe===!1?qe=me([],[],n):qe=me([],Nn(Qe,n,!0),n),qe.depth=_e.depth,qe.height=_e.height,ie.push({type:"elem",elem:qe,shift:Se})}for(a=0,q=0;a<c||q<he.length;++a,++q){for(var Ke,Ie=he[q],vt=!0;((an=Ie)==null?void 0:an.type)==="separator";){var an;if(vt||(ge=me(["arraycolsep"],[]),ge.style.width=ke(n.fontMetrics().doubleRuleSep),ve.push(ge)),Ie.separator==="|"||Ie.separator===":"){var bn=Ie.separator==="|"?"solid":"dashed",Hn=me(["vertical-separator"],[],n);Hn.style.height=ke(D),Hn.style.borderRightWidth=ke(p),Hn.style.borderRightStyle=bn,Hn.style.margin="0 "+ke(-p/2);var Ye=D-V;Ye&&(Hn.style.verticalAlign=ke(-Ye)),ve.push(Hn)}else throw new ye("Invalid separator type: "+Ie.separator);q++,Ie=he[q],vt=!1}if(!(a>=c)){var vn=void 0;if(a>0||e.hskipBeforeAndAfter){var yr,Yn;vn=(yr=(Yn=Ie)==null?void 0:Yn.pregap)!=null?yr:b,vn!==0&&(ge=me(["arraycolsep"],[]),ge.style.width=ke(vn),ve.push(ge))}var Lr=[];for(r=0;r<i;++r){var Zn=d[r],Tt=Zn.cells[a];if(Tt){var jr=Zn.pos-V;Tt.depth=Zn.depth,Tt.height=Zn.height,Lr.push({type:"elem",elem:Tt,shift:jr})}}var br=_t({positionType:"individualShift",children:Lr}),Br=me(["col-align-"+(((Ke=Ie)==null?void 0:Ke.align)||"c")],[br]);if(ve.push(Br),a<c-1||e.hskipBeforeAndAfter){var Ir,aa;vn=(Ir=(aa=Ie)==null?void 0:aa.postgap)!=null?Ir:b,vn!==0&&(ge=me(["arraycolsep"],[]),ge.style.width=ke(vn),ve.push(ge))}}}var ar=me(["mtable"],ve);if(h.length>0){for(var sa=Sl("hline",n,p),de=Sl("hdashline",n,p),Ve=[{type:"elem",elem:ar,shift:0}];h.length>0;){var He=h.pop(),Ee=He.pos-V;He.isDashed?Ve.push({type:"elem",elem:de,shift:Ee}):Ve.push({type:"elem",elem:sa,shift:Ee})}ar=_t({positionType:"individualShift",children:Ve})}if(ie.length===0)return me(["mord"],[ar],n);var bt=_t({positionType:"individualShift",children:ie}),Lt=me(["tag"],[bt],n);return Es([ar,Lt])},ON={c:"center ",l:"left ",r:"right "},za=function(e,n){for(var r=[],a=new be("mtd",[],["mtr-glue"]),i=new be("mtd",[],["mml-eqn-num"]),l=0;l<e.body.length;l++){for(var c=e.body[l],d=[],h=0;h<c.length;h++)d.push(new be("mtd",[Bt(c[h],n)]));e.tags&&e.tags[l]&&(d.unshift(a),d.push(a),e.leqno?d.unshift(i):d.push(i)),r.push(new be("mtr",d))}var p=new be("mtable",r),m=e.arraystretch===.5?.1:.16+e.arraystretch-1+(e.addJot?.09:0);p.setAttribute("rowspacing",ke(m));var b="",x="";if(e.cols&&e.cols.length>0){var w=e.cols,S="",E=!1,A=0,T=w.length;w[0].type==="separator"&&(b+="top ",A=1),w[w.length-1].type==="separator"&&(b+="bottom ",T-=1);for(var D=A;D<T;D++){var M=w[D];M.type==="align"?(x+=ON[M.align],E&&(S+="none "),E=!0):M.type==="separator"&&E&&(S+=M.separator==="|"?"solid ":"dashed ",E=!1)}p.setAttribute("columnalign",x.trim()),/[sd]/.test(S)&&p.setAttribute("columnlines",S.trim())}if(e.colSeparationType==="align"){for(var B=e.cols||[],I="",U=1;U<B.length;U++)I+=U%2?"0em ":"1em ";p.setAttribute("columnspacing",I.trim())}else e.colSeparationType==="alignat"||e.colSeparationType==="gather"?p.setAttribute("columnspacing","0em"):e.colSeparationType==="small"?p.setAttribute("columnspacing","0.2778em"):e.colSeparationType==="CD"?p.setAttribute("columnspacing","0.5em"):p.setAttribute("columnspacing","1em");var W="",Y=e.hLinesBeforeRow;b+=Y[0].length>0?"left ":"",b+=Y[Y.length-1].length>0?"right ":"";for(var oe=1;oe<Y.length-1;oe++)W+=Y[oe].length===0?"none ":Y[oe][0]?"dashed ":"solid ";return/[sd]/.test(W)&&p.setAttribute("rowlines",W.trim()),b!==""&&(p=new be("menclose",[p]),p.setAttribute("notation",b.trim())),e.arraystretch&&e.arraystretch<1&&(p=new be("mstyle",[p]),p.setAttribute("scriptlevel","1")),p},Sk=function(e,n){e.envName.includes("ed")||Nf(e);var r=[],a=e.envName.includes("at")?"alignat":"align",i=e.envName==="split",l=Ai(e.parser,{cols:r,addJot:!0,autoTag:i?void 0:Z1(e.envName),emptySingleRow:!0,colSeparationType:a,maxNumCols:i?2:void 0,leqno:e.parser.settings.leqno},"display"),c=0,d=0,h={type:"ordgroup",mode:e.mode,body:[]};if(n[0]&&n[0].type==="ordgroup"){for(var p="",m=0;m<n[0].body.length;m++){var b=it(n[0].body[m],"textord");p+=b.text}c=Number(p),d=c*2}var x=!d;l.body.forEach(function(A){for(var T=1;T<A.length;T+=2){var D=it(A[T],"styling"),M=it(D.body[0],"ordgroup");M.body.unshift(h)}if(x)d<A.length&&(d=A.length);else{var B=A.length/2;if(c<B)throw new ye("Too many math in a row: "+("expected "+c+", but got "+B),A[0])}});for(var w=0;w<d;++w){var S="r",E=0;w%2===1?S="l":w>0&&x&&(E=1),r[w]={type:"align",align:S,pregap:E,postgap:0}}return l.colSeparationType=x?"align":"alignat",l};Ia({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var n=_f(e[0]),r=n?[e[0]]:it(e[0],"ordgroup").body,a=r.map(function(l){var c=Sf(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 ye("Unknown column alignment: "+d,l)}),i={cols:a,hskipBeforeAndAfter:!0,maxNumCols:a.length};return Ai(t.parser,i,X1(t.envName))},htmlBuilder:Pa,mathmlBuilder:za});Ia({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(t){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[t.envName.replace("*","")],n="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if(t.envName.charAt(t.envName.length-1)==="*"){var a=t.parser;if(a.consumeSpaces(),a.fetch().text==="["){if(a.consume(),a.consumeSpaces(),n=a.fetch().text,!"lcr".includes(n))throw new ye("Expected l or c or r",a.nextToken);a.consume(),a.consumeSpaces(),a.expect("]"),a.consume(),r.cols=[{type:"align",align:n}]}}var i=Ai(t.parser,r,X1(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:Pa,mathmlBuilder:za});Ia({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e={arraystretch:.5},n=Ai(t.parser,e,"script");return n.colSeparationType="small",n},htmlBuilder:Pa,mathmlBuilder:za});Ia({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var n=_f(e[0]),r=n?[e[0]]:it(e[0],"ordgroup").body,a=r.map(function(c){var d=Sf(c),h=d.text;if("lc".includes(h))return{type:"align",align:h};throw new ye("Unknown column alignment: "+h,c)});if(a.length>1)throw new ye("{subarray} can contain only one column");var i={cols:a,hskipBeforeAndAfter:!1,arraystretch:.5},l=Ai(t.parser,i,"script");if(l.body.length>0&&l.body[0].length>1)throw new ye("{subarray} can contain only one column");return l},htmlBuilder:Pa,mathmlBuilder:za});Ia({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=Ai(t.parser,e,X1(t.envName));return{type:"leftright",mode:t.mode,body:[n],left:t.envName.includes("r")?".":"\\{",right:t.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:Pa,mathmlBuilder:za});Ia({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:Sk,htmlBuilder:Pa,mathmlBuilder:za});Ia({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){DN.has(t.envName)&&Nf(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:Z1(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return Ai(t.parser,e,"display")},htmlBuilder:Pa,mathmlBuilder:za});Ia({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:Sk,htmlBuilder:Pa,mathmlBuilder:za});Ia({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){Nf(t);var e={autoTag:Z1(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return Ai(t.parser,e,"display")},htmlBuilder:Pa,mathmlBuilder:za});Ia({type:"array",names:["CD"],props:{numArgs:0},handler(t){return Nf(t),xN(t.parser)},htmlBuilder:Pa,mathmlBuilder:za});L("\\nonumber","\\gdef\\@eqnsw{0}");L("\\notag","\\nonumber");Ce({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(t,e){throw new ye(t.funcName+" valid only within array environment")}});var N2=wk;Ce({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(t,e){var{parser:n,funcName:r}=t,a=e[0];if(a.type!=="ordgroup")throw new ye("Invalid environment name",a);for(var i="",l=0;l<a.body.length;++l)i+=it(a.body[l],"textord").text;if(r==="\\begin"){if(!N2.hasOwnProperty(i))throw new ye("No such environment: "+i,a);var c=N2[i],{args:d,optArgs:h}=n.parseArguments("\\begin{"+i+"}",c),p={mode:n.mode,envName:i,parser:n},m=c.handler(p,d,h);n.expect("\\end",!1);var b=n.nextToken,x=it(n.parseFunction(),"environment");if(x.name!==i)throw new ye("Mismatch: \\begin{"+i+"} matched by \\end{"+x.name+"}",b);return m}return{type:"environment",mode:n.mode,name:i,nameGroup:a}}});var _k=(t,e)=>{var n=t.font,r=e.withFont(n);return Ct(t.body,r)},Ck=(t,e)=>{var n=t.font,r=e.withFont(n);return Bt(t.body,r)},R2={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};Ce({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(t,e)=>{var{parser:n,funcName:r}=t,a=Z0(e[0]),i=r;return i in R2&&(i=R2[i]),{type:"font",mode:n.mode,font:i.slice(1),body:a}},htmlBuilder:_k,mathmlBuilder:Ck});Ce({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(t,e)=>{var{parser:n}=t,r=e[0];return{type:"mclass",mode:n.mode,mclass:Cf(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:_s(r)}}});Ce({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{parser:n,funcName:r,breakOnTokenText:a}=t,{mode:i}=n,l=n.parseExpression(!0,a);return{type:"font",mode:i,font:"math"+r.slice(1),body:{type:"ordgroup",mode:n.mode,body:l}}},htmlBuilder:_k,mathmlBuilder:Ck});var LN=(t,e)=>{var n=e.style,r=n.fracNum(),a=n.fracDen(),i;i=e.havingStyle(r);var l=Ct(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(a);var h=Ct(t.denom,i,e),p,m,b;t.hasBarLine?(t.barSize?(m=Yt(t.barSize,e),p=Sl("frac-line",e,m)):p=Sl("frac-line",e),m=p.height,b=p.height):(p=null,m=0,b=e.fontMetrics().defaultRuleThickness);var x,w,S;n.size===Xe.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 E;if(p){var T=e.fontMetrics().axisHeight;x-l.depth-(T+.5*m)<w&&(x+=w-(x-l.depth-(T+.5*m))),T-.5*m-(h.height-S)<w&&(S+=w-(T-.5*m-(h.height-S)));var D=-(T-.5*m);E=_t({positionType:"individualShift",children:[{type:"elem",elem:h,shift:S},{type:"elem",elem:p,shift:D},{type:"elem",elem:l,shift:-x}]})}else{var A=x-l.depth-(h.height-S);A<w&&(x+=.5*(w-A),S+=.5*(w-A)),E=_t({positionType:"individualShift",children:[{type:"elem",elem:h,shift:S},{type:"elem",elem:l,shift:-x}]})}i=e.havingStyle(n),E.height*=i.sizeMultiplier/e.sizeMultiplier,E.depth*=i.sizeMultiplier/e.sizeMultiplier;var M;n.size===Xe.DISPLAY.size?M=e.fontMetrics().delim1:n.size===Xe.SCRIPTSCRIPT.size?M=e.havingStyle(Xe.SCRIPT).fontMetrics().delim2:M=e.fontMetrics().delim2;var B,I;return t.leftDelim==null?B=cu(e,["mopen"]):B=Gg(t.leftDelim,M,!0,e.havingStyle(n),t.mode,["mopen"]),t.continued?I=me([]):t.rightDelim==null?I=cu(e,["mclose"]):I=Gg(t.rightDelim,M,!0,e.havingStyle(n),t.mode,["mclose"]),me(["mord"].concat(i.sizingClasses(e)),[B,me(["mfrac"],[E]),I],e)},jN=(t,e)=>{var n=new be("mfrac",[Bt(t.numer,e),Bt(t.denom,e)]);if(!t.hasBarLine)n.setAttribute("linethickness","0px");else if(t.barSize){var r=Yt(t.barSize,e);n.setAttribute("linethickness",ke(r))}if(t.leftDelim!=null||t.rightDelim!=null){var a=[];if(t.leftDelim!=null){var i=new be("mo",[new mn(t.leftDelim.replace("\\",""))]);i.setAttribute("fence","true"),a.push(i)}if(a.push(n),t.rightDelim!=null){var l=new be("mo",[new mn(t.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),a.push(l)}return V1(a)}return n},Ek=(t,e)=>{if(!e)return t;var n={type:"styling",mode:t.mode,style:e,body:[t]};return n};Ce({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:r}=t,a=e[0],i=e[1],l,c=null,d=null;switch(r){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 h=r==="\\cfrac",p=null;return h||r.startsWith("\\d")?p="display":r.startsWith("\\t")&&(p="text"),Ek({type:"genfrac",mode:n.mode,numer:a,denom:i,continued:h,hasBarLine:l,leftDelim:c,rightDelim:d,barSize:null},p)},htmlBuilder:LN,mathmlBuilder:jN});Ce({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(t){var{parser:e,funcName:n,token:r}=t,a;switch(n){case"\\over":a="\\frac";break;case"\\choose":a="\\binom";break;case"\\atop":a="\\\\atopfrac";break;case"\\brace":a="\\\\bracefrac";break;case"\\brack":a="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:e.mode,replaceWith:a,token:r}}});var M2=["display","text","script","scriptscript"],D2=function(e){var n=null;return e.length>0&&(n=e,n=n==="."?null:n),n};Ce({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(t,e){var{parser:n}=t,r=e[4],a=e[5],i=Z0(e[0]),l=i.type==="atom"&&i.family==="open"?D2(i.text):null,c=Z0(e[1]),d=c.type==="atom"&&c.family==="close"?D2(c.text):null,h=it(e[2],"size"),p,m=null;h.isBlank?p=!0:(m=h.value,p=m.number>0);var b=null,x=e[3];if(x.type==="ordgroup"){if(x.body.length>0){var w=it(x.body[0],"textord");b=M2[Number(w.text)]}}else x=it(x,"textord"),b=M2[Number(x.text)];return Ek({type:"genfrac",mode:n.mode,numer:r,denom:a,continued:!1,hasBarLine:p,barSize:m,leftDelim:l,rightDelim:d},b)}});Ce({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(t,e){var{parser:n,funcName:r,token:a}=t;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:it(e[0],"size").value,token:a}}});Ce({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(t,e)=>{var{parser:n,funcName:r}=t,a=e[0],i=it(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:a,denom:l,continued:!1,hasBarLine:c,barSize:i,leftDelim:null,rightDelim:null}}});var Tk=(t,e)=>{var n=e.style,r,a;t.type==="supsub"?(r=t.sup?Ct(t.sup,e.havingStyle(n.sup()),e):Ct(t.sub,e.havingStyle(n.sub()),e),a=it(t.base,"horizBrace")):a=it(t,"horizBrace");var i=Ct(a.base,e.havingBaseStyle(Xe.DISPLAY)),l=kf(a,e),c;if(a.isOver?c=_t({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:.1},{type:"elem",elem:l,wrapperClasses:["svg-align"]}]}):c=_t({positionType:"bottom",positionData:i.depth+.1+l.height,children:[{type:"elem",elem:l,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:i}]}),r){var d=me(["minner",a.isOver?"mover":"munder"],[c],e);a.isOver?c=_t({positionType:"firstBaseline",children:[{type:"elem",elem:d},{type:"kern",size:.2},{type:"elem",elem:r}]}):c=_t({positionType:"bottom",positionData:d.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:d}]})}return me(["minner",a.isOver?"mover":"munder"],[c],e)},BN=(t,e)=>{var n=wf(t.label);return new be(t.isOver?"mover":"munder",[Bt(t.base,e),n])};Ce({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(t,e){var{parser:n,funcName:r}=t;return{type:"horizBrace",mode:n.mode,label:r,isOver:r.includes("\\over"),base:e[0]}},htmlBuilder:Tk,mathmlBuilder:BN});Ce({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=e[1],a=it(e[0],"url").url;return n.settings.isTrusted({command:"\\href",url:a})?{type:"href",mode:n.mode,href:a,body:pn(r)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(t,e)=>{var n=Nn(t.body,e,!1);return YA(t.href,[],n,e)},mathmlBuilder:(t,e)=>{var n=Ei(t.body,e);return n instanceof be||(n=new be("mrow",[n])),n.setAttribute("href",t.href),n}});Ce({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=it(e[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:r}))return n.formatUnsupportedCmd("\\url");for(var a=[],i=0;i<r.length;i++){var l=r[i];l==="~"&&(l="\\textasciitilde"),a.push({type:"textord",mode:"text",text:l})}var c={type:"text",mode:n.mode,font:"\\texttt",body:a};return{type:"href",mode:n.mode,href:r,body:pn(c)}}});Ce({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:pn(e[0])}},htmlBuilder(t,e){var n=Nn(t.body,e.withFont(""),!1);return Es(n)},mathmlBuilder(t,e){return new be("mrow",Or(t.body,e.withFont("")))}});Ce({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(t,e)=>{var{parser:n,funcName:r,token:a}=t,i=it(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(r){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 h=i.split(","),p=0;p<h.length;p++){var m=h[p],b=m.indexOf("=");if(b<0)throw new ye("\\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:pn(l)}:n.formatUnsupportedCmd(r)},htmlBuilder:(t,e)=>{var n=Nn(t.body,e,!1),r=["enclosing"];t.attributes.class&&r.push(...t.attributes.class.trim().split(/\s+/));var a=me(r,n,e);for(var i in t.attributes)i!=="class"&&t.attributes.hasOwnProperty(i)&&a.setAttribute(i,t.attributes[i]);return a},mathmlBuilder:(t,e)=>Ei(t.body,e)});Ce({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:pn(e[0]),mathml:pn(e[1])}},htmlBuilder:(t,e)=>{var n=Nn(t.html,e,!1);return Es(n)},mathmlBuilder:(t,e)=>Ei(t.mathml,e)});var _m=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 ye("Invalid size: '"+e+"' in \\includegraphics");var r={number:+(n[1]+n[2]),unit:n[3]};if(!G3(r))throw new ye("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r};Ce({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(t,e,n)=>{var{parser:r}=t,a={number:0,unit:"em"},i={number:.9,unit:"em"},l={number:0,unit:"em"},c="";if(n[0])for(var d=it(n[0],"raw").string,h=d.split(","),p=0;p<h.length;p++){var m=h[p].split("=");if(m.length===2){var b=m[1].trim();switch(m[0].trim()){case"alt":c=b;break;case"width":a=_m(b);break;case"height":i=_m(b);break;case"totalheight":l=_m(b);break;default:throw new ye("Invalid key: '"+m[0]+"' in \\includegraphics.")}}}var x=it(e[0],"url").url;return c===""&&(c=x,c=c.replace(/^.*[\\/]/,""),c=c.substring(0,c.lastIndexOf("."))),r.settings.isTrusted({command:"\\includegraphics",url:x})?{type:"includegraphics",mode:r.mode,alt:c,width:a,height:i,totalheight:l,src:x}:r.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(t,e)=>{var n=Yt(t.height,e),r=0;t.totalheight.number>0&&(r=Yt(t.totalheight,e)-n);var a=0;t.width.number>0&&(a=Yt(t.width,e));var i={height:ke(n+r)};a>0&&(i.width=ke(a)),r>0&&(i.verticalAlign=ke(-r));var l=new IA(t.src,t.alt,i);return l.height=n,l.depth=r,l},mathmlBuilder:(t,e)=>{var n=new be("mglyph",[]);n.setAttribute("alt",t.alt);var r=Yt(t.height,e),a=0;if(t.totalheight.number>0&&(a=Yt(t.totalheight,e)-r,n.setAttribute("valign",ke(-a))),n.setAttribute("height",ke(r+a)),t.width.number>0){var i=Yt(t.width,e);n.setAttribute("width",ke(i))}return n.setAttribute("src",t.src),n}});Ce({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(t,e){var{parser:n,funcName:r}=t,a=it(e[0],"size");if(n.settings.strict){var i=r[1]==="m",l=a.value.unit==="mu";i?(l||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, "+("not "+a.value.unit+" units")),n.mode!=="math"&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):l&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:a.value}},htmlBuilder(t,e){return Z3(t.dimension,e)},mathmlBuilder(t,e){var n=Yt(t.dimension,e);return new nk(n)}});Ce({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:n,funcName:r}=t,a=e[0];return{type:"lap",mode:n.mode,alignment:r.slice(5),body:a}},htmlBuilder:(t,e)=>{var n;t.alignment==="clap"?(n=me([],[Ct(t.body,e)]),n=me(["inner"],[n],e)):n=me(["inner"],[Ct(t.body,e)]);var r=me(["fix"],[]),a=me([t.alignment],[n,r],e),i=me(["strut"]);return i.style.height=ke(a.height+a.depth),a.depth&&(i.style.verticalAlign=ke(-a.depth)),a.children.unshift(i),a=me(["thinbox"],[a],e),me(["mord","vbox"],[a],e)},mathmlBuilder:(t,e)=>{var n=new be("mpadded",[Bt(t.body,e)]);if(t.alignment!=="rlap"){var r=t.alignment==="llap"?"-1":"-0.5";n.setAttribute("lspace",r+"width")}return n.setAttribute("width","0px"),n}});Ce({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){var{funcName:n,parser:r}=t,a=r.mode;r.switchMode("math");var i=n==="\\("?"\\)":"$",l=r.parseExpression(!1,i);return r.expect(i),r.switchMode(a),{type:"styling",mode:r.mode,style:"text",resetFont:!0,body:l}}});Ce({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){throw new ye("Mismatched "+t.funcName)}});var O2=(t,e)=>{switch(e.style.size){case Xe.DISPLAY.size:return t.display;case Xe.TEXT.size:return t.text;case Xe.SCRIPT.size:return t.script;case Xe.SCRIPTSCRIPT.size:return t.scriptscript;default:return t.text}};Ce({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(t,e)=>{var{parser:n}=t;return{type:"mathchoice",mode:n.mode,display:pn(e[0]),text:pn(e[1]),script:pn(e[2]),scriptscript:pn(e[3])}},htmlBuilder:(t,e)=>{var n=O2(t,e),r=Nn(n,e,!1);return Es(r)},mathmlBuilder:(t,e)=>{var n=O2(t,e);return Ei(n,e)}});var Ak=(t,e,n,r,a,i,l)=>{t=me([],[t]);var c=n&&_s(n),d,h;if(e){var p=Ct(e,r.havingStyle(a.sup()),r);h={elem:p,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-p.depth)}}if(n){var m=Ct(n,r.havingStyle(a.sub()),r);d={elem:m,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-m.height)}}var b;if(h&&d){var x=r.fontMetrics().bigOpSpacing5+d.elem.height+d.elem.depth+d.kern+t.depth+l;b=_t({positionType:"bottom",positionData:x,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:d.elem,marginLeft:ke(-i)},{type:"kern",size:d.kern},{type:"elem",elem:t},{type:"kern",size:h.kern},{type:"elem",elem:h.elem,marginLeft:ke(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else if(d){var w=t.height-l;b=_t({positionType:"top",positionData:w,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:d.elem,marginLeft:ke(-i)},{type:"kern",size:d.kern},{type:"elem",elem:t}]})}else if(h){var S=t.depth+l;b=_t({positionType:"bottom",positionData:S,children:[{type:"elem",elem:t},{type:"kern",size:h.kern},{type:"elem",elem:h.elem,marginLeft:ke(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else return t;var E=[b];if(d&&i!==0&&!c){var A=me(["mspace"],[],r);A.style.marginRight=ke(i),E.unshift(A)}return me(["mop","op-limits"],E,r)},Nk=new Set(["\\smallint"]),Rl=(t,e)=>{var n,r,a=!1,i;t.type==="supsub"?(n=t.sup,r=t.sub,i=it(t.base,"op"),a=!0):i=it(t,"op");var l=e.style,c=!1;l.size===Xe.DISPLAY.size&&i.symbol&&!Nk.has(i.name)&&(c=!0);var d,h;if(i.symbol){var p=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=er(i.name,p,"math",e,["mop","op-symbol",c?"large-op":"small-op"]),h=d.italic,m.length>0){var b=Q3(m+"Size"+(c?"2":"1"),e);d=_t({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=h}}else if(i.body){var x=Nn(i.body,e,!0);x.length===1&&x[0]instanceof Rr?(d=x[0],d.classes[0]="mop"):d=me(["mop"],x,e)}else{for(var w=[],S=1;S<i.name.length;S++)w.push(G1(i.name[S],i.mode,e));d=me(["mop"],w,e)}var E=0,A=0;if((d instanceof Rr||i.name==="\\oiint"||i.name==="\\oiiint")&&!i.suppressBaseShift){var T;E=(d.height-d.depth)/2-e.fontMetrics().axisHeight,A=(T=d.italic)!=null?T:0}return a?Ak(d,n,r,e,l,A,E):(E&&(d.style.position="relative",d.style.top=ke(E)),d)},Su=(t,e)=>{var n;if(t.symbol)n=new be("mo",[na(t.name,t.mode)]),Nk.has(t.name)&&n.setAttribute("largeop","false");else if(t.body)n=new be("mo",Or(t.body,e));else{n=new be("mi",[new mn(t.name.slice(1))]);var r=new be("mo",[na("⁡","text")]);t.parentIsSupSub?n=new be("mrow",[n,r]):n=tk([n,r])}return n},IN={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Ce({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(t,e)=>{var{parser:n,funcName:r}=t,a=r;return a.length===1&&(a=IN[a]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:a}},htmlBuilder:Rl,mathmlBuilder:Su});Ce({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var{parser:n}=t,r=e[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:pn(r)}},htmlBuilder:Rl,mathmlBuilder:Su});var PN={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Ce({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:Rl,mathmlBuilder:Su});Ce({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:Rl,mathmlBuilder:Su});Ce({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(t){var{parser:e,funcName:n}=t,r=n;return r.length===1&&(r=PN[r]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:Rl,mathmlBuilder:Su});var Rk=(t,e)=>{var n,r,a=!1,i;t.type==="supsub"?(n=t.sup,r=t.sub,i=it(t.base,"operatorname"),a=!0):i=it(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=Nn(c,e.withFont("mathrm"),!0),h=0;h<d.length;h++){var p=d[h];p instanceof Rr&&(p.text=p.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}l=me(["mop"],d,e)}else l=me(["mop"],[],e);return a?Ak(l,n,r,e,e.style,0,0):l},zN=(t,e)=>{for(var n=Or(t.body,e.withFont("mathrm")),r=!0,a=0;a<n.length;a++){var i=n[a];if(!(i instanceof nk))if(i instanceof be)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 mn?l.text=l.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):r=!1;break}default:r=!1}else r=!1}if(r){var c=n.map(p=>p.toText()).join("");n=[new mn(c)]}var d=new be("mi",n);d.setAttribute("mathvariant","normal");var h=new be("mo",[na("⁡","text")]);return t.parentIsSupSub?new be("mrow",[d,h]):tk([d,h])};Ce({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(t,e)=>{var{parser:n,funcName:r}=t,a=e[0];return{type:"operatorname",mode:n.mode,body:pn(a),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:Rk,mathmlBuilder:zN});L("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");vo({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?Es(Nn(t.body,e,!1)):me(["mord"],Nn(t.body,e,!0),e)},mathmlBuilder(t,e){return Ei(t.body,e,!0)}});Ce({type:"overline",names:["\\overline"],props:{numArgs:1},handler(t,e){var{parser:n}=t,r=e[0];return{type:"overline",mode:n.mode,body:r}},htmlBuilder(t,e){var n=Ct(t.body,e.havingCrampedStyle()),r=Sl("overline-line",e),a=e.fontMetrics().defaultRuleThickness,i=_t({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*a},{type:"elem",elem:r},{type:"kern",size:a}]});return me(["mord","overline"],[i],e)},mathmlBuilder(t,e){var n=new be("mo",[new mn("‾")]);n.setAttribute("stretchy","true");var r=new be("mover",[Bt(t.body,e),n]);return r.setAttribute("accent","true"),r}});Ce({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=e[0];return{type:"phantom",mode:n.mode,body:pn(r)}},htmlBuilder:(t,e)=>{var n=Nn(t.body,e.withPhantom(),!1);return Es(n)},mathmlBuilder:(t,e)=>{var n=Or(t.body,e);return new be("mphantom",n)}});L("\\hphantom","\\smash{\\phantom{#1}}");Ce({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=e[0];return{type:"vphantom",mode:n.mode,body:r}},htmlBuilder:(t,e)=>{var n=me(["inner"],[Ct(t.body,e.withPhantom())]),r=me(["fix"],[]);return me(["mord","rlap"],[n,r],e)},mathmlBuilder:(t,e)=>{var n=Or(pn(t.body),e),r=new be("mphantom",n),a=new be("mpadded",[r]);return a.setAttribute("width","0px"),a}});Ce({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(t,e){var{parser:n}=t,r=it(e[0],"size").value,a=e[1];return{type:"raisebox",mode:n.mode,dy:r,body:a}},htmlBuilder(t,e){var n=Ct(t.body,e),r=Yt(t.dy,e);return _t({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]})},mathmlBuilder(t,e){var n=new be("mpadded",[Bt(t.body,e)]),r=t.dy.number+t.dy.unit;return n.setAttribute("voffset",r),n}});Ce({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(t){var{parser:e}=t;return{type:"internal",mode:e.mode}}});Ce({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(t,e,n){var{parser:r}=t,a=n[0],i=it(e[0],"size"),l=it(e[1],"size");return{type:"rule",mode:r.mode,shift:a&&it(a,"size").value,width:i.value,height:l.value}},htmlBuilder(t,e){var n=me(["mord","rule"],[],e),r=Yt(t.width,e),a=Yt(t.height,e),i=t.shift?Yt(t.shift,e):0;return n.style.borderRightWidth=ke(r),n.style.borderTopWidth=ke(a),n.style.bottom=ke(i),n.width=r,n.height=a+i,n.depth=-i,n.maxFontSize=a*1.125*e.sizeMultiplier,n},mathmlBuilder(t,e){var n=Yt(t.width,e),r=Yt(t.height,e),a=t.shift?Yt(t.shift,e):0,i=e.color&&e.getColor()||"black",l=new be("mspace");l.setAttribute("mathbackground",i),l.setAttribute("width",ke(n)),l.setAttribute("height",ke(r));var c=new be("mpadded",[l]);return a>=0?c.setAttribute("height",ke(a)):(c.setAttribute("height",ke(a)),c.setAttribute("depth",ke(-a))),c.setAttribute("voffset",ke(a)),c}});function Mk(t,e,n){for(var r=Nn(t,e,!1),a=e.sizeMultiplier/n.sizeMultiplier,i=0;i<r.length;i++){var l=r[i].classes.indexOf("sizing");l<0?Array.prototype.push.apply(r[i].classes,e.sizingClasses(n)):r[i].classes[l+1]==="reset-size"+e.size&&(r[i].classes[l+1]="reset-size"+n.size),r[i].height*=a,r[i].depth*=a}return Es(r)}var L2=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],$N=(t,e)=>{var n=e.havingSize(t.size);return Mk(t.body,n,e)};Ce({type:"sizing",names:L2,props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{breakOnTokenText:n,funcName:r,parser:a}=t,i=a.parseExpression(!1,n);return{type:"sizing",mode:a.mode,size:L2.indexOf(r)+1,body:i}},htmlBuilder:$N,mathmlBuilder:(t,e)=>{var n=e.havingSize(t.size),r=Or(t.body,n),a=new be("mstyle",r);return a.setAttribute("mathsize",ke(n.sizeMultiplier)),a}});Ce({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(t,e,n)=>{var{parser:r}=t,a=!1,i=!1,l=n[0]&&it(n[0],"ordgroup");if(l)for(var c,d=0;d<l.body.length;++d){var h=l.body[d];if(c=Sf(h).text,c==="t")a=!0;else if(c==="b")i=!0;else{a=!1,i=!1;break}}else a=!0,i=!0;var p=e[0];return{type:"smash",mode:r.mode,body:p,smashHeight:a,smashDepth:i}},htmlBuilder:(t,e)=>{var n=me([],[Ct(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 me(["mord","smash"],[n],e);if(n.children)for(var r=0;r<n.children.length;r++)t.smashHeight&&(n.children[r].height=0),t.smashDepth&&(n.children[r].depth=0);var a=_t({positionType:"firstBaseline",children:[{type:"elem",elem:n}]});return me(["mord"],[a],e)},mathmlBuilder:(t,e)=>{var n=new be("mpadded",[Bt(t.body,e)]);return t.smashHeight&&n.setAttribute("height","0px"),t.smashDepth&&n.setAttribute("depth","0px"),n}});Ce({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,n){var{parser:r}=t,a=n[0],i=e[0];return{type:"sqrt",mode:r.mode,body:i,index:a}},htmlBuilder(t,e){var n=Ct(t.body,e.havingCrampedStyle());n.height===0&&(n.height=e.fontMetrics().xHeight),n=_l(n,e);var r=e.fontMetrics(),a=r.defaultRuleThickness,i=a;e.style.id<Xe.TEXT.id&&(i=e.fontMetrics().xHeight);var l=a+i/4,c=n.height+n.depth+l+a,{span:d,ruleWidth:h,advanceWidth:p}=EN(c,e),m=d.height-h;m>n.height+n.depth+l&&(l=(l+m-n.height-n.depth)/2);var b=d.height-n.height-l-h;n.style.paddingLeft=ke(p);var x=_t({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+b)},{type:"elem",elem:d},{type:"kern",size:h}]});if(t.index){var w=e.havingStyle(Xe.SCRIPTSCRIPT),S=Ct(t.index,w,e),E=.6*(x.height-x.depth),A=_t({positionType:"shift",positionData:-E,children:[{type:"elem",elem:S}]}),T=me(["root"],[A]);return me(["mord","sqrt"],[T,x],e)}else return me(["mord","sqrt"],[x],e)},mathmlBuilder(t,e){var{body:n,index:r}=t;return r?new be("mroot",[Bt(n,e),Bt(r,e)]):new be("msqrt",[Bt(n,e)])}});var qg={display:Xe.DISPLAY,text:Xe.TEXT,script:Xe.SCRIPT,scriptscript:Xe.SCRIPTSCRIPT};function FN(t){return t in qg}Ce({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t,e){var{breakOnTokenText:n,funcName:r,parser:a}=t,i=a.parseExpression(!0,n),l=r.slice(1,r.length-5);if(!FN(l))throw new Error("Unknown style: "+l);return{type:"styling",mode:a.mode,style:l,body:i}},htmlBuilder(t,e){var n=qg[t.style],r=e.havingStyle(n);return t.resetFont&&(r=r.withFont("")),Mk(t.body,r,e)},mathmlBuilder(t,e){var n=qg[t.style],r=e.havingStyle(n);t.resetFont&&(r=r.withFont(""));var a=Or(t.body,r),i=new be("mstyle",a),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 UN=function(e,n){var r=e.base;if(r)if(r.type==="op"){var a=r.limits&&(n.style.size===Xe.DISPLAY.size||r.alwaysHandleSupSub);return a?Rl:null}else if(r.type==="operatorname"){var i=r.alwaysHandleSupSub&&(n.style.size===Xe.DISPLAY.size||r.limits);return i?Rk:null}else{if(r.type==="accent")return _s(r.base)?K1:null;if(r.type==="horizBrace"){var l=!e.sub;return l===r.isOver?Tk:null}else return null}else return null};vo({type:"supsub",htmlBuilder(t,e){var n=UN(t,e);if(n)return n(t,e);var{base:r,sup:a,sub:i}=t,l=Ct(r,e),c,d,h=e.fontMetrics(),p=0,m=0,b=r&&_s(r);if(a){var x=e.havingStyle(e.style.sup());c=Ct(a,x,e),b||(p=l.height-x.fontMetrics().supDrop*x.sizeMultiplier/e.sizeMultiplier)}if(i){var w=e.havingStyle(e.style.sub());d=Ct(i,w,e),b||(m=l.depth+w.fontMetrics().subDrop*w.sizeMultiplier/e.sizeMultiplier)}var S;e.style===Xe.DISPLAY?S=h.sup1:e.style.cramped?S=h.sup3:S=h.sup2;var E=e.sizeMultiplier,A=ke(.5/h.ptPerEm/E),T=null;if(d){var D=t.base&&t.base.type==="op"&&t.base.name&&(t.base.name==="\\oiint"||t.base.name==="\\oiiint");if(l instanceof Rr||D){var M;T=ke(-((M=l.italic)!=null?M:0))}}var B;if(c&&d){p=Math.max(p,S,c.depth+.25*h.xHeight),m=Math.max(m,h.sub2);var I=h.defaultRuleThickness,U=4*I;if(p-c.depth-(d.height-m)<U){m=U-(p-c.depth)+d.height;var W=.8*h.xHeight-(p-c.depth);W>0&&(p+=W,m-=W)}var Y=[{type:"elem",elem:d,shift:m,marginRight:A,marginLeft:T},{type:"elem",elem:c,shift:-p,marginRight:A}];B=_t({positionType:"individualShift",children:Y})}else if(d){m=Math.max(m,h.sub1,d.height-.8*h.xHeight);var oe=[{type:"elem",elem:d,marginLeft:T,marginRight:A}];B=_t({positionType:"shift",positionData:m,children:oe})}else if(c)p=Math.max(p,S,c.depth+.25*h.xHeight),B=_t({positionType:"shift",positionData:-p,children:[{type:"elem",elem:c,marginRight:A}]});else throw new Error("supsub must have either sup or sub.");var ae=$g(l,"right")||"mord";return me([ae],[l,me(["msupsub"],[B])],e)},mathmlBuilder(t,e){var n=!1,r,a;t.base&&t.base.type==="horizBrace"&&(a=!!t.sup,a===t.base.isOver&&(n=!0,r=t.base.isOver)),t.base&&(t.base.type==="op"||t.base.type==="operatorname")&&(t.base.parentIsSupSub=!0);var i=[Bt(t.base,e)];t.sub&&i.push(Bt(t.sub,e)),t.sup&&i.push(Bt(t.sup,e));var l;if(n)l=r?"mover":"munder";else if(t.sub)if(t.sup){var h=t.base;h&&h.type==="op"&&h.limits&&e.style===Xe.DISPLAY||h&&h.type==="operatorname"&&h.alwaysHandleSupSub&&(e.style===Xe.DISPLAY||h.limits)?l="munderover":l="msubsup"}else{var d=t.base;d&&d.type==="op"&&d.limits&&(e.style===Xe.DISPLAY||d.alwaysHandleSupSub)||d&&d.type==="operatorname"&&d.alwaysHandleSupSub&&(d.limits||e.style===Xe.DISPLAY)?l="munder":l="msub"}else{var c=t.base;c&&c.type==="op"&&c.limits&&(e.style===Xe.DISPLAY||c.alwaysHandleSupSub)||c&&c.type==="operatorname"&&c.alwaysHandleSupSub&&(c.limits||e.style===Xe.DISPLAY)?l="mover":l="msup"}return new be(l,i)}});vo({type:"atom",htmlBuilder(t,e){return G1(t.text,t.mode,e,["m"+t.family])},mathmlBuilder(t,e){var n=new be("mo",[na(t.text,t.mode)]);if(t.family==="bin"){var r=W1(t,e);r==="bold-italic"&&n.setAttribute("mathvariant",r)}else t.family==="punct"?n.setAttribute("separator","true"):(t.family==="open"||t.family==="close")&&n.setAttribute("stretchy","false");return n}});var Dk={mi:"italic",mn:"normal",mtext:"normal"};vo({type:"mathord",htmlBuilder(t,e){return xf(t,e,"mathord")},mathmlBuilder(t,e){var n=new be("mi",[na(t.text,t.mode,e)]),r=W1(t,e)||"italic";return r!==Dk[n.type]&&n.setAttribute("mathvariant",r),n}});vo({type:"textord",htmlBuilder(t,e){return xf(t,e,"textord")},mathmlBuilder(t,e){var n=na(t.text,t.mode,e),r=W1(t,e)||"normal",a;return t.mode==="text"?a=new be("mtext",[n]):/[0-9]/.test(t.text)?a=new be("mn",[n]):t.text==="\\prime"?a=new be("mo",[n]):a=new be("mi",[n]),r!==Dk[a.type]&&a.setAttribute("mathvariant",r),a}});var Cm={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Em={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};vo({type:"spacing",htmlBuilder(t,e){if(Em.hasOwnProperty(t.text)){var n=Em[t.text].className||"";if(t.mode==="text"){var r=xf(t,e,"textord");return r.classes.push(n),r}else return me(["mspace",n],[G1(t.text,t.mode,e)],e)}else{if(Cm.hasOwnProperty(t.text))return me(["mspace",Cm[t.text]],[],e);throw new ye('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var n;if(Em.hasOwnProperty(t.text))n=new be("mtext",[new mn(" ")]);else{if(Cm.hasOwnProperty(t.text))return new be("mspace");throw new ye('Unknown type of space "'+t.text+'"')}return n}});var j2=()=>{var t=new be("mtd",[]);return t.setAttribute("width","50%"),t};vo({type:"tag",mathmlBuilder(t,e){var n=new be("mtable",[new be("mtr",[j2(),new be("mtd",[Ei(t.body,e)]),j2(),new be("mtd",[Ei(t.tag,e)])])]);return n.setAttribute("width","100%"),n}});var B2={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},I2={"\\textbf":"textbf","\\textmd":"textmd"},HN={"\\textit":"textit","\\textup":"textup"},P2=(t,e)=>{var n=t.font;if(n){if(B2[n])return e.withTextFontFamily(B2[n]);if(I2[n])return e.withTextFontWeight(I2[n]);if(n==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(HN[n])};Ce({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(t,e){var{parser:n,funcName:r}=t,a=e[0];return{type:"text",mode:n.mode,body:pn(a),font:r}},htmlBuilder(t,e){var n=P2(t,e),r=Nn(t.body,n,!0);return me(["mord","text"],r,n)},mathmlBuilder(t,e){var n=P2(t,e);return Ei(t.body,n)}});Ce({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=Ct(t.body,e),r=Sl("underline-line",e),a=e.fontMetrics().defaultRuleThickness,i=_t({positionType:"top",positionData:n.height,children:[{type:"kern",size:a},{type:"elem",elem:r},{type:"kern",size:3*a},{type:"elem",elem:n}]});return me(["mord","underline"],[i],e)},mathmlBuilder(t,e){var n=new be("mo",[new mn("‾")]);n.setAttribute("stretchy","true");var r=new be("munder",[Bt(t.body,e),n]);return r.setAttribute("accentunder","true"),r}});Ce({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=Ct(t.body,e),r=e.fontMetrics().axisHeight,a=.5*(n.height-r-(n.depth+r));return _t({positionType:"shift",positionData:a,children:[{type:"elem",elem:n}]})},mathmlBuilder(t,e){var n=new be("mpadded",[Bt(t.body,e)],["vcenter"]);return new be("mrow",[n])}});Ce({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(t,e,n){throw new ye("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(t,e){for(var n=z2(t),r=[],a=e.havingStyle(e.style.text()),i=0;i<n.length;i++){var l=n[i];l==="~"&&(l="\\textasciitilde"),r.push(er(l,"Typewriter-Regular",t.mode,a,["mord","texttt"]))}return me(["mord","text"].concat(a.sizingClasses(e)),Y3(r),a)},mathmlBuilder(t,e){var n=new mn(z2(t)),r=new be("mtext",[n]);return r.setAttribute("mathvariant","monospace"),r}});var z2=t=>t.body.replace(/ /g,t.star?"␣":" "),mi=J3,Ok=`[ \r
288
- ]`,GN="\\\\[a-zA-Z@]+",qN="\\\\[^\uD800-\uDFFF]",VN="("+GN+")"+Ok+"*",WN=`\\\\(
289
- |[ \r ]+
290
- ?)[ \r ]*`,Vg="[̀-ͯ]",KN=new RegExp(Vg+"+$"),YN="("+Ok+"+)|"+(WN+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(Vg+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(Vg+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+VN)+("|"+qN+")");class $2{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(YN,"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 Nr("EOF",new mr(this,n,n));var r=this.tokenRegex.exec(e);if(r===null||r.index!==n)throw new ye("Unexpected character: '"+e[n]+"'",new Nr(e[n],new mr(this,n,n+1)));var a=r[6]||r[3]||(r[2]?"\\ ":" ");if(this.catcodes[a]===14){var i=e.indexOf(`
291
- `,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 Nr(a,new mr(this,n,this.tokenRegex.lastIndex))}}class ZN{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 ye("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var n in e)e.hasOwnProperty(n)&&(e[n]==null?delete this.current[n]:this.current[n]=e[n])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,n,r){if(r===void 0&&(r=!1),r){for(var a=0;a<this.undefStack.length;a++)delete this.undefStack[a][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 XN=kk;L("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});L("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}});L("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}});L("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}});L("\\@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}});L("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");L("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var F2={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};L("\\char",function(t){var e=t.popToken(),n,r=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]==="\\")r=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new ye("\\char` missing argument");r=e.text.charCodeAt(0)}else n=10;if(n){if(r=F2[e.text],r==null||r>=n)throw new ye("Invalid base-"+n+" digit "+e.text);for(var a;(a=F2[t.future().text])!=null&&a<n;)r*=n,r+=a,t.popToken()}return"\\@char{"+r+"}"});var Q1=(t,e,n,r)=>{var a=t.consumeArg().tokens;if(a.length!==1)throw new ye("\\newcommand's first argument must be a macro name");var i=a[0].text,l=t.isDefined(i);if(l&&!e)throw new ye("\\newcommand{"+i+"} attempting to redefine "+(i+"; use \\renewcommand"));if(!l&&!n)throw new ye("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var c=0;if(a=t.consumeArg().tokens,a.length===1&&a[0].text==="["){for(var d="",h=t.expandNextToken();h.text!=="]"&&h.text!=="EOF";)d+=h.text,h=t.expandNextToken();if(!d.match(/^\s*[0-9]+\s*$/))throw new ye("Invalid number of arguments: "+d);c=parseInt(d),a=t.consumeArg().tokens}return l&&r||t.macros.set(i,{tokens:a,numArgs:c}),""};L("\\newcommand",t=>Q1(t,!1,!0,!1));L("\\renewcommand",t=>Q1(t,!0,!1,!1));L("\\providecommand",t=>Q1(t,!0,!0,!0));L("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(n=>n.text).join("")),""});L("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(n=>n.text).join("")),""});L("\\show",t=>{var e=t.popToken(),n=e.text;return console.log(e,t.macros.get(n),mi[n],Gt.math[n],Gt.text[n]),""});L("\\bgroup","{");L("\\egroup","}");L("~","\\nobreakspace");L("\\lq","`");L("\\rq","'");L("\\aa","\\r a");L("\\AA","\\r A");L("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");L("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");L("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");L("ℬ","\\mathscr{B}");L("ℰ","\\mathscr{E}");L("ℱ","\\mathscr{F}");L("ℋ","\\mathscr{H}");L("ℐ","\\mathscr{I}");L("ℒ","\\mathscr{L}");L("ℳ","\\mathscr{M}");L("ℛ","\\mathscr{R}");L("ℭ","\\mathfrak{C}");L("ℌ","\\mathfrak{H}");L("ℨ","\\mathfrak{Z}");L("\\Bbbk","\\Bbb{k}");L("\\llap","\\mathllap{\\textrm{#1}}");L("\\rlap","\\mathrlap{\\textrm{#1}}");L("\\clap","\\mathclap{\\textrm{#1}}");L("\\mathstrut","\\vphantom{(}");L("\\underbar","\\underline{\\text{#1}}");L("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');L("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");L("\\ne","\\neq");L("≠","\\neq");L("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");L("∉","\\notin");L("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");L("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");L("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");L("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");L("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");L("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");L("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");L("⟂","\\perp");L("‼","\\mathclose{!\\mkern-0.8mu!}");L("∌","\\notni");L("⌜","\\ulcorner");L("⌝","\\urcorner");L("⌞","\\llcorner");L("⌟","\\lrcorner");L("©","\\copyright");L("®","\\textregistered");L("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');L("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');L("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');L("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');L("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");L("⋮","\\vdots");L("\\varGamma","\\mathit{\\Gamma}");L("\\varDelta","\\mathit{\\Delta}");L("\\varTheta","\\mathit{\\Theta}");L("\\varLambda","\\mathit{\\Lambda}");L("\\varXi","\\mathit{\\Xi}");L("\\varPi","\\mathit{\\Pi}");L("\\varSigma","\\mathit{\\Sigma}");L("\\varUpsilon","\\mathit{\\Upsilon}");L("\\varPhi","\\mathit{\\Phi}");L("\\varPsi","\\mathit{\\Psi}");L("\\varOmega","\\mathit{\\Omega}");L("\\substack","\\begin{subarray}{c}#1\\end{subarray}");L("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");L("\\boxed","\\fbox{$\\displaystyle{#1}$}");L("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");L("\\implies","\\DOTSB\\;\\Longrightarrow\\;");L("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");L("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");L("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var U2={",":"\\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"},QN=new Set(["bin","rel"]);L("\\dots",function(t){var e="\\dotso",n=t.expandAfterFuture().text;return n in U2?e=U2[n]:(n.slice(0,4)==="\\not"||n in Gt.math&&QN.has(Gt.math[n].group))&&(e="\\dotsb"),e});var J1={")":!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};L("\\dotso",function(t){var e=t.future().text;return e in J1?"\\ldots\\,":"\\ldots"});L("\\dotsc",function(t){var e=t.future().text;return e in J1&&e!==","?"\\ldots\\,":"\\ldots"});L("\\cdots",function(t){var e=t.future().text;return e in J1?"\\@cdots\\,":"\\@cdots"});L("\\dotsb","\\cdots");L("\\dotsm","\\cdots");L("\\dotsi","\\!\\cdots");L("\\dotsx","\\ldots\\,");L("\\DOTSI","\\relax");L("\\DOTSB","\\relax");L("\\DOTSX","\\relax");L("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");L("\\,","\\tmspace+{3mu}{.1667em}");L("\\thinspace","\\,");L("\\>","\\mskip{4mu}");L("\\:","\\tmspace+{4mu}{.2222em}");L("\\medspace","\\:");L("\\;","\\tmspace+{5mu}{.2777em}");L("\\thickspace","\\;");L("\\!","\\tmspace-{3mu}{.1667em}");L("\\negthinspace","\\!");L("\\negmedspace","\\tmspace-{4mu}{.2222em}");L("\\negthickspace","\\tmspace-{5mu}{.277em}");L("\\enspace","\\kern.5em ");L("\\enskip","\\hskip.5em\\relax");L("\\quad","\\hskip1em\\relax");L("\\qquad","\\hskip2em\\relax");L("\\tag","\\@ifstar\\tag@literal\\tag@paren");L("\\tag@paren","\\tag@literal{({#1})}");L("\\tag@literal",t=>{if(t.macros.get("\\df@tag"))throw new ye("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});L("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");L("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");L("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");L("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");L("\\newline","\\\\\\relax");L("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var Lk=ke(Da["Main-Regular"][84][1]-.7*Da["Main-Regular"][65][1]);L("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+Lk+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");L("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+Lk+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");L("\\hspace","\\@ifstar\\@hspacer\\@hspace");L("\\@hspace","\\hskip #1\\relax");L("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");L("\\ordinarycolon",":");L("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");L("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');L("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');L("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');L("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');L("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');L("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');L("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');L("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');L("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');L("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');L("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');L("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');L("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');L("∷","\\dblcolon");L("∹","\\eqcolon");L("≔","\\coloneqq");L("≕","\\eqqcolon");L("⩴","\\Coloneqq");L("\\ratio","\\vcentcolon");L("\\coloncolon","\\dblcolon");L("\\colonequals","\\coloneqq");L("\\coloncolonequals","\\Coloneqq");L("\\equalscolon","\\eqqcolon");L("\\equalscoloncolon","\\Eqqcolon");L("\\colonminus","\\coloneq");L("\\coloncolonminus","\\Coloneq");L("\\minuscolon","\\eqcolon");L("\\minuscoloncolon","\\Eqcolon");L("\\coloncolonapprox","\\Colonapprox");L("\\coloncolonsim","\\Colonsim");L("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");L("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");L("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");L("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");L("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");L("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");L("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");L("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");L("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");L("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");L("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");L("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");L("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");L("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");L("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");L("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");L("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");L("\\nleqq","\\html@mathml{\\@nleqq}{≰}");L("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");L("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");L("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");L("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");L("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");L("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");L("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");L("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");L("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");L("\\imath","\\html@mathml{\\@imath}{ı}");L("\\jmath","\\html@mathml{\\@jmath}{ȷ}");L("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");L("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");L("⟦","\\llbracket");L("⟧","\\rrbracket");L("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");L("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");L("⦃","\\lBrace");L("⦄","\\rBrace");L("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");L("⦵","\\minuso");L("\\darr","\\downarrow");L("\\dArr","\\Downarrow");L("\\Darr","\\Downarrow");L("\\lang","\\langle");L("\\rang","\\rangle");L("\\uarr","\\uparrow");L("\\uArr","\\Uparrow");L("\\Uarr","\\Uparrow");L("\\N","\\mathbb{N}");L("\\R","\\mathbb{R}");L("\\Z","\\mathbb{Z}");L("\\alef","\\aleph");L("\\alefsym","\\aleph");L("\\Alpha","\\mathrm{A}");L("\\Beta","\\mathrm{B}");L("\\bull","\\bullet");L("\\Chi","\\mathrm{X}");L("\\clubs","\\clubsuit");L("\\cnums","\\mathbb{C}");L("\\Complex","\\mathbb{C}");L("\\Dagger","\\ddagger");L("\\diamonds","\\diamondsuit");L("\\empty","\\emptyset");L("\\Epsilon","\\mathrm{E}");L("\\Eta","\\mathrm{H}");L("\\exist","\\exists");L("\\harr","\\leftrightarrow");L("\\hArr","\\Leftrightarrow");L("\\Harr","\\Leftrightarrow");L("\\hearts","\\heartsuit");L("\\image","\\Im");L("\\infin","\\infty");L("\\Iota","\\mathrm{I}");L("\\isin","\\in");L("\\Kappa","\\mathrm{K}");L("\\larr","\\leftarrow");L("\\lArr","\\Leftarrow");L("\\Larr","\\Leftarrow");L("\\lrarr","\\leftrightarrow");L("\\lrArr","\\Leftrightarrow");L("\\Lrarr","\\Leftrightarrow");L("\\Mu","\\mathrm{M}");L("\\natnums","\\mathbb{N}");L("\\Nu","\\mathrm{N}");L("\\Omicron","\\mathrm{O}");L("\\plusmn","\\pm");L("\\rarr","\\rightarrow");L("\\rArr","\\Rightarrow");L("\\Rarr","\\Rightarrow");L("\\real","\\Re");L("\\reals","\\mathbb{R}");L("\\Reals","\\mathbb{R}");L("\\Rho","\\mathrm{P}");L("\\sdot","\\cdot");L("\\sect","\\S");L("\\spades","\\spadesuit");L("\\sub","\\subset");L("\\sube","\\subseteq");L("\\supe","\\supseteq");L("\\Tau","\\mathrm{T}");L("\\thetasym","\\vartheta");L("\\weierp","\\wp");L("\\Zeta","\\mathrm{Z}");L("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");L("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");L("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");L("\\bra","\\mathinner{\\langle{#1}|}");L("\\ket","\\mathinner{|{#1}\\rangle}");L("\\braket","\\mathinner{\\langle{#1}\\rangle}");L("\\Bra","\\left\\langle#1\\right|");L("\\Ket","\\left|#1\\right\\rangle");var jk=t=>e=>{var n=e.consumeArg().tokens,r=e.consumeArg().tokens,a=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),a.length&&b.macros.set("\\|",c));var x=m;if(!m&&a.length){var w=b.future();w.text==="|"&&(b.popToken(),x=!0)}return{tokens:x?a:r,numArgs:0}};e.macros.set("|",d(!1)),a.length&&e.macros.set("\\|",d(!0));var h=e.consumeArg().tokens,p=e.expandTokens([...i,...h,...n]);return e.macros.endGroup(),{tokens:p.reverse(),numArgs:0}};L("\\bra@ket",jk(!1));L("\\bra@set",jk(!0));L("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");L("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");L("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");L("\\angln","{\\angl n}");L("\\blue","\\textcolor{##6495ed}{#1}");L("\\orange","\\textcolor{##ffa500}{#1}");L("\\pink","\\textcolor{##ff00af}{#1}");L("\\red","\\textcolor{##df0030}{#1}");L("\\green","\\textcolor{##28ae7b}{#1}");L("\\gray","\\textcolor{gray}{#1}");L("\\purple","\\textcolor{##9d38bd}{#1}");L("\\blueA","\\textcolor{##ccfaff}{#1}");L("\\blueB","\\textcolor{##80f6ff}{#1}");L("\\blueC","\\textcolor{##63d9ea}{#1}");L("\\blueD","\\textcolor{##11accd}{#1}");L("\\blueE","\\textcolor{##0c7f99}{#1}");L("\\tealA","\\textcolor{##94fff5}{#1}");L("\\tealB","\\textcolor{##26edd5}{#1}");L("\\tealC","\\textcolor{##01d1c1}{#1}");L("\\tealD","\\textcolor{##01a995}{#1}");L("\\tealE","\\textcolor{##208170}{#1}");L("\\greenA","\\textcolor{##b6ffb0}{#1}");L("\\greenB","\\textcolor{##8af281}{#1}");L("\\greenC","\\textcolor{##74cf70}{#1}");L("\\greenD","\\textcolor{##1fab54}{#1}");L("\\greenE","\\textcolor{##0d923f}{#1}");L("\\goldA","\\textcolor{##ffd0a9}{#1}");L("\\goldB","\\textcolor{##ffbb71}{#1}");L("\\goldC","\\textcolor{##ff9c39}{#1}");L("\\goldD","\\textcolor{##e07d10}{#1}");L("\\goldE","\\textcolor{##a75a05}{#1}");L("\\redA","\\textcolor{##fca9a9}{#1}");L("\\redB","\\textcolor{##ff8482}{#1}");L("\\redC","\\textcolor{##f9685d}{#1}");L("\\redD","\\textcolor{##e84d39}{#1}");L("\\redE","\\textcolor{##bc2612}{#1}");L("\\maroonA","\\textcolor{##ffbde0}{#1}");L("\\maroonB","\\textcolor{##ff92c6}{#1}");L("\\maroonC","\\textcolor{##ed5fa6}{#1}");L("\\maroonD","\\textcolor{##ca337c}{#1}");L("\\maroonE","\\textcolor{##9e034e}{#1}");L("\\purpleA","\\textcolor{##ddd7ff}{#1}");L("\\purpleB","\\textcolor{##c6b9fc}{#1}");L("\\purpleC","\\textcolor{##aa87ff}{#1}");L("\\purpleD","\\textcolor{##7854ab}{#1}");L("\\purpleE","\\textcolor{##543b78}{#1}");L("\\mintA","\\textcolor{##f5f9e8}{#1}");L("\\mintB","\\textcolor{##edf2df}{#1}");L("\\mintC","\\textcolor{##e0e5cc}{#1}");L("\\grayA","\\textcolor{##f6f7f7}{#1}");L("\\grayB","\\textcolor{##f0f1f2}{#1}");L("\\grayC","\\textcolor{##e3e5e6}{#1}");L("\\grayD","\\textcolor{##d6d8da}{#1}");L("\\grayE","\\textcolor{##babec2}{#1}");L("\\grayF","\\textcolor{##888d93}{#1}");L("\\grayG","\\textcolor{##626569}{#1}");L("\\grayH","\\textcolor{##3b3e40}{#1}");L("\\grayI","\\textcolor{##21242c}{#1}");L("\\kaBlue","\\textcolor{##314453}{#1}");L("\\kaGreen","\\textcolor{##71B307}{#1}");var Bk={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class JN{constructor(e,n,r){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=n,this.expansionCount=0,this.feed(e),this.macros=new ZN(XN,n.macros),this.mode=r,this.stack=[]}feed(e){this.lexer=new $2(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var n,r,a;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;n=this.popToken(),{tokens:a,end:r}=this.consumeArg(["]"])}else({tokens:a,start:n,end:r}=this.consumeArg());return this.pushToken(new Nr("EOF",r.loc)),this.pushTokens(a),new Nr("",mr.range(n,r))}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var n=[],r=e&&e.length>0;r||this.consumeSpaces();var a=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 ye("Extra }",i)}else if(i.text==="EOF")throw new ye("Unexpected end of input in a macro argument, expected '"+(e&&r?e[c]:"}")+"'",i);if(e&&r)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||r);return a.text==="{"&&n[n.length-1].text==="}"&&(n.pop(),n.shift()),n.reverse(),{tokens:n,start:a,end:i}}consumeArgs(e,n){if(n){if(n.length!==e+1)throw new ye("The length of delimiters doesn't match the number of args!");for(var r=n[0],a=0;a<r.length;a++){var i=this.popToken();if(r[a]!==i.text)throw new ye("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 ye("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var n=this.popToken(),r=n.text,a=n.noexpand?null:this._getExpansion(r);if(a==null||e&&a.unexpandable){if(e&&a==null&&r[0]==="\\"&&!this.isDefined(r))throw new ye("Undefined control sequence: "+r);return this.pushToken(n),!1}this.countExpansion(1);var i=a.tokens,l=this.consumeArgs(a.numArgs,a.delimiters);if(a.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 ye("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 ye("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 Nr(e)]):void 0}expandTokens(e){var n=[],r=this.stack.length;for(this.pushTokens(e);this.stack.length>r;)if(this.expandOnce(!0)===!1){var a=this.stack.pop();a.treatAsRelax&&(a.noexpand=!1,a.treatAsRelax=!1),n.push(a)}return this.countExpansion(n.length),n}expandMacroAsText(e){var n=this.expandMacro(e);return n&&n.map(r=>r.text).join("")}_getExpansion(e){var n=this.macros.get(e);if(n==null)return n;if(e.length===1){var r=this.lexer.catcodes[e];if(r!=null&&r!==13)return}var a=typeof n=="function"?n(this):n;if(typeof a=="string"){var i=0;if(a.includes("#"))for(var l=a.replace(/##/g,"");l.includes("#"+(i+1));)++i;for(var c=new $2(a,this.settings),d=[],h=c.lex();h.text!=="EOF";)d.push(h),h=c.lex();d.reverse();var p={tokens:d,numArgs:i};return p}return a}isDefined(e){return this.macros.has(e)||mi.hasOwnProperty(e)||Gt.math.hasOwnProperty(e)||Gt.text.hasOwnProperty(e)||Bk.hasOwnProperty(e)}isExpandable(e){var n=this.macros.get(e);return n!=null?typeof n=="string"||typeof n=="function"||!n.unexpandable:mi.hasOwnProperty(e)&&!mi[e].primitive}}var H2=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,r0=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","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),Tm={"́":{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"}},G2={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class Rf{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 JN(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 ye("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 Nr("}")),this.gullet.pushTokens(e);var r=this.parseExpression(!1);return this.expect("}"),this.nextToken=n,r}parseExpression(e,n){for(var r=[];;){this.mode==="math"&&this.consumeSpaces();var a=this.fetch();if(Rf.endOfExpression.has(a.text)||n&&a.text===n||e&&mi[a.text]&&mi[a.text].infix)break;var i=this.parseAtom(n);if(i){if(i.type==="internal")continue}else break;r.push(i)}return this.mode==="text"&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(e){for(var n=-1,r,a=0;a<e.length;a++){var i=e[a];if(i.type==="infix"){if(n!==-1)throw new ye("only one infix operator per group",i.token);n=a,r=i.replaceWith}}if(n!==-1&&r){var l,c,d=e.slice(0,n),h=e.slice(n+1);d.length===1&&d[0].type==="ordgroup"?l=d[0]:l={type:"ordgroup",mode:this.mode,body:d},h.length===1&&h[0].type==="ordgroup"?c=h[0]:c={type:"ordgroup",mode:this.mode,body:h};var p;return r==="\\\\abovefrac"?p=this.callFunction(r,[l,e[n],c],[]):p=this.callFunction(r,[l,c],[]),[p]}else return e}handleSupSubscript(e){var n=this.fetch(),r=n.text;this.consume(),this.consumeSpaces();var a;do{var i;a=this.parseGroup(e)}while(((i=a)==null?void 0:i.type)==="internal");if(!a)throw new ye("Expected group after '"+r+"'",n);return a}formatUnsupportedCmd(e){for(var n=[],r=0;r<e.length;r++)n.push({type:"textord",mode:"text",text:e[r]});var a={type:"text",mode:this.mode,body:n},i={type:"color",mode:this.mode,color:this.settings.errorColor,body:[a]};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 r,a;;){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 ye("Limit controls must follow a math operator",i);this.consume()}else if(i.text==="^"){if(r)throw new ye("Double superscript",i);r=this.handleSupSubscript("superscript")}else if(i.text==="_"){if(a)throw new ye("Double subscript",i);a=this.handleSupSubscript("subscript")}else if(i.text==="'"){if(r)throw new ye("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")),r={type:"ordgroup",mode:this.mode,body:d}}else if(r0[i.text]){var h=H2.test(i.text),p=[];for(p.push(new Nr(r0[i.text])),this.consume();;){var m=this.fetch().text;if(!r0[m]||H2.test(m)!==h)break;p.unshift(new Nr(r0[m])),this.consume()}var b=this.subparse(p);h?a={type:"ordgroup",mode:"math",body:b}:r={type:"ordgroup",mode:"math",body:b}}else break}return r||a?{type:"supsub",mode:this.mode,base:n,sup:r,sub:a}:n}parseFunction(e,n){var r=this.fetch(),a=r.text,i=mi[a];if(!i)return null;if(this.consume(),n&&n!=="atom"&&!i.allowedInArgument)throw new ye("Got function '"+a+"' with no arguments"+(n?" as "+n:""),r);if(this.mode==="text"&&!i.allowedInText)throw new ye("Can't use function '"+a+"' in text mode",r);if(this.mode==="math"&&i.allowedInMath===!1)throw new ye("Can't use function '"+a+"' in math mode",r);var{args:l,optArgs:c}=this.parseArguments(a,i);return this.callFunction(a,l,c,r,e)}callFunction(e,n,r,a,i){var l={funcName:e,parser:this,token:a,breakOnTokenText:i},c=mi[e];if(c&&c.handler)return c.handler(l,n,r);throw new ye("No function handler for "+e)}parseArguments(e,n){var r=n.numArgs+n.numOptionalArgs;if(r===0)return{args:[],optArgs:[]};for(var a=[],i=[],l=0;l<r;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 h=this.parseGroupOfType("argument to '"+e+"'",c,d);if(d)i.push(h);else if(h!=null)a.push(h);else throw new ye("Null argument, please report this as a bug")}return{args:a,optArgs:i}}parseGroupOfType(e,n,r){switch(n){case"color":return this.parseColorGroup(r);case"size":return this.parseSizeGroup(r);case"url":return this.parseUrlGroup(r);case"math":case"text":return this.parseArgumentGroup(r,n);case"hbox":{var a=this.parseArgumentGroup(r,"text");return a!=null?{type:"styling",mode:a.mode,body:[a],style:"text",resetFont:!0}:null}case"raw":{var i=this.parseStringGroup("raw",r);return i!=null?{type:"raw",mode:"text",string:i.text}:null}case"primitive":{if(r)throw new ye("A primitive argument cannot be optional");var l=this.parseGroup(e);if(l==null)throw new ye("Expected group as "+e,this.fetch());return l}case"original":case null:case void 0:return this.parseArgumentGroup(r);default:throw new ye("Unknown group type as "+e,this.fetch())}}consumeSpaces(){for(;this.fetch().text===" ";)this.consume()}parseStringGroup(e,n){var r=this.gullet.scanArgument(n);if(r==null)return null;for(var a="",i;(i=this.fetch()).text!=="EOF";)a+=i.text,this.consume();return this.consume(),r.text=a,r}parseRegexGroup(e,n){for(var r=this.fetch(),a=r,i="",l;(l=this.fetch()).text!=="EOF"&&e.test(i+l.text);)a=l,i+=a.text,this.consume();if(i==="")throw new ye("Invalid "+n+": '"+r.text+"'",r);return r.range(a,i)}parseColorGroup(e){var n=this.parseStringGroup("color",e);if(n==null)return null;var r=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(n.text);if(!r)throw new ye("Invalid color: '"+n.text+"'",n);var a=r[0];return/^[0-9a-f]{6}$/i.test(a)&&(a="#"+a),{type:"color-token",mode:this.mode,color:a}}parseSizeGroup(e){var n,r=!1;if(this.gullet.consumeSpaces(),!e&&this.gullet.future().text!=="{"?n=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"):n=this.parseStringGroup("size",e),!n)return null;!e&&n.text.length===0&&(n.text="0pt",r=!0);var a=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(n.text);if(!a)throw new ye("Invalid size: '"+n.text+"'",n);var i={number:+(a[1]+a[2]),unit:a[3]};if(!G3(i))throw new ye("Invalid unit: '"+i.unit+"'",n);return{type:"size",mode:this.mode,value:i,isBlank:r}}parseUrlGroup(e){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var n=this.parseStringGroup("url",e);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),n==null)return null;var r=n.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:r}}parseArgumentGroup(e,n){var r=this.gullet.scanArgument(e);if(r==null)return null;var a=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:r.loc,body:i};return n&&this.switchMode(a),l}parseGroup(e,n){var r=this.fetch(),a=r.text,i;if(a==="{"||a==="\\begingroup"){this.consume();var l=a==="{"?"}":"\\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:mr.range(r,d),body:c,semisimple:a==="\\begingroup"||void 0}}else if(i=this.parseFunction(n,e)||this.parseSymbol(),i==null&&a[0]==="\\"&&!Bk.hasOwnProperty(a)){if(this.settings.throwOnError)throw new ye("Undefined control sequence: "+a,r);i=this.formatUnsupportedCmd(a),this.consume()}return i}formLigatures(e){for(var n=e.length-1,r=0;r<n;++r){var a=e[r];if(a.type==="textord"){var i=a.text,l=e[r+1];if(!(!l||l.type!=="textord")){if(i==="-"&&l.text==="-"){var c=e[r+2];r+1<n&&c&&c.type==="textord"&&c.text==="-"?(e.splice(r,3,{type:"textord",mode:"text",loc:mr.range(a,c),text:"---"}),n-=2):(e.splice(r,2,{type:"textord",mode:"text",loc:mr.range(a,l),text:"--"}),n-=1)}(i==="'"||i==="`")&&l.text===i&&(e.splice(r,2,{type:"textord",mode:"text",loc:mr.range(a,l),text:i+i}),n-=1)}}}}parseSymbol(){var e=this.fetch(),n=e.text;if(/^\\verb[^a-zA-Z]/.test(n)){this.consume();var r=n.slice(5),a=r.charAt(0)==="*";if(a&&(r=r.slice(1)),r.length<2||r.charAt(0)!==r.slice(-1))throw new ye(`\\verb assertion failed --
292
- please report what input caused this bug`);return r=r.slice(1,-1),{type:"verb",mode:"text",body:r,star:a}}G2.hasOwnProperty(n[0])&&!Gt[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=G2[n[0]]+n.slice(1));var i=KN.exec(n);i&&(n=n.substring(0,i.index),n==="i"?n="ı":n==="j"&&(n="ȷ"));var l;if(Gt[this.mode][n]){this.settings.strict&&this.mode==="math"&&Dg.includes(n)&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+n[0]+'" used in math mode',e);var c=Gt[this.mode][n].group,d=mr.range(e),h;mN(c)?h={type:"atom",mode:this.mode,family:c,loc:d,text:n}:h={type:c,mode:this.mode,loc:d,text:n},l=h}else if(n.charCodeAt(0)>=128)this.settings.strict&&(H3(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:mr.range(e),text:n};else return null;if(this.consume(),i)for(var p=0;p<i[0].length;p++){var m=i[0][p];if(!Tm[m])throw new ye("Unknown accent ' "+m+"'",e);var b=Tm[m][this.mode]||Tm[m].text;if(!b)throw new ye("Accent "+m+" unsupported in "+this.mode+" mode",e);l={type:"accent",mode:this.mode,loc:mr.range(e),label:b,isStretchy:!1,isShifty:!0,base:l}}return l}}Rf.endOfExpression=new Set(["}","\\endgroup","\\end","\\right","&"]);var ey=function(e,n){if(!(typeof e=="string"||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var r=new Rf(e,n);delete r.gullet.macros.current["\\df@tag"];var a=r.parse();if(delete r.gullet.macros.current["\\current@color"],delete r.gullet.macros.current["\\color"],r.gullet.macros.get("\\df@tag")){if(!n.displayMode)throw new ye("\\tag works only in display equations");a=[{type:"tag",mode:"text",body:a,tag:r.subparse([new Nr("\\df@tag")])}]}return a},Ik=function(e,n,r){n.textContent="";var a=ty(e,r).toNode();n.appendChild(a)};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."),Ik=function(){throw new ye("KaTeX doesn't work in quirks mode.")});var eR=function(e,n){var r=ty(e,n).toMarkup();return r},tR=function(e,n){var r=new $1(n);return ey(e,r)},Pk=function(e,n,r){if(r.throwOnError||!(e instanceof ye))throw e;var a=me(["katex-error"],[new Rr(n)]);return a.setAttribute("title",e.toString()),a.setAttribute("style","color:"+r.errorColor),a},ty=function(e,n){var r=new $1(n);try{var a=ey(e,r);return oN(a,e,r)}catch(i){return Pk(i,e,r)}},nR=function(e,n){var r=new $1(n);try{var a=ey(e,r);return lN(a,e,r)}catch(i){return Pk(i,e,r)}},rR="0.16.47",aR={Span:Al,Anchor:bf,SymbolNode:Rr,SvgNode:Ss,PathNode:_i,LineNode:Mg},q2={version:rR,render:Ik,renderToString:eR,ParseError:ye,SETTINGS_SCHEMA:Ag,__parse:tR,__renderToDomTree:ty,__renderToHTMLTree:nR,__setFontMetrics:UA,__defineSymbol:k,__defineFunction:Ce,__defineMacro:L,__domTree:aR};const sR={};function iR(t){const e=this,n=t||sR,r=e.data(),a=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);a.push(oA(n)),i.push(JT()),l.push(eA(n))}const V2=/[#.]/g;function oR(t,e){const n=t||"",r={};let a=0,i,l;for(;a<n.length;){V2.lastIndex=a;const c=V2.exec(n),d=n.slice(a,c?c.index:n.length);d&&(i?i==="#"?r.id=d:Array.isArray(r.className)?r.className.push(d):r.className=[d]:l=d,a+=d.length),c&&(i=c[0],a++)}return{type:"element",tagName:l||e||"div",properties:r,children:[]}}function zk(t,e,n){const r=n?dR(n):void 0;function a(i,l,...c){let d;if(i==null){d={type:"root",children:[]};const h=l;c.unshift(h)}else{d=oR(i,e);const h=d.tagName.toLowerCase(),p=r?r.get(h):void 0;if(d.tagName=p||h,lR(l))c.unshift(l);else for(const[m,b]of Object.entries(l))cR(t,d.properties,m,b)}for(const h of c)Wg(d.children,h);return d.type==="element"&&d.tagName==="template"&&(d.content={type:"root",children:d.children},d.children=[]),d}return a}function lR(t){if(t===null||typeof t!="object"||Array.isArray(t))return!0;if(typeof t.type!="string")return!1;const e=t,n=Object.keys(t);for(const r of n){const a=e[r];if(a&&typeof a=="object"){if(!Array.isArray(a))return!0;const i=a;for(const l of i)if(typeof l!="number"&&typeof l!="string")return!0}}return!!("children"in t&&Array.isArray(t.children))}function cR(t,e,n,r){const a=Q5(t,n);let i;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;i=r}else typeof r=="boolean"?i=r:typeof r=="string"?a.spaceSeparated?i=nx(r):a.commaSeparated?i=rx(r):a.commaOrSpaceSeparated?i=nx(rx(r).join(" ")):i=W2(a,a.property,r):Array.isArray(r)?i=[...r]:i=a.property==="style"?uR(r):String(r);if(Array.isArray(i)){const l=[];for(const c of i)l.push(W2(a,a.property,c));i=l}a.property==="className"&&Array.isArray(e.className)&&(i=e.className.concat(i)),e[a.property]=i}}function Wg(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)Wg(t,n);else if(typeof e=="object"&&"type"in e)e.type==="root"?Wg(t,e.children):t.push(e);else throw new Error("Expected node, nodes, or string, got `"+e+"`")}function W2(t,e,n){if(typeof n=="string"){if(t.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((t.boolean||t.overloadedBoolean)&&(n===""||ax(n)===ax(e)))return!0}return n}function uR(t){const e=[];for(const[n,r]of Object.entries(t))e.push([n,r].join(": "));return e.join("; ")}function dR(t){const e=new Map;for(const n of t)e.set(n.toLowerCase(),n);return e}const fR=["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"],hR=zk(J5,"div"),pR=zk(_1,"g",fR),Am={html:"http://www.w3.org/1999/xhtml",svg:"http://www.w3.org/2000/svg"};function mR(t,e){return $k(t,{})||{type:"root",children:[]}}function $k(t,e){const n=gR(t,e);return n&&e.afterTransform&&e.afterTransform(t,n),n}function gR(t,e){switch(t.nodeType){case 1:return xR(t,e);case 3:return bR(t);case 8:return vR(t);case 9:return K2(t,e);case 10:return yR();case 11:return K2(t,e);default:return}}function K2(t,e){return{type:"root",children:Fk(t,e)}}function yR(){return{type:"doctype"}}function bR(t){return{type:"text",value:t.nodeValue||""}}function vR(t){return{type:"comment",value:t.nodeValue||""}}function xR(t,e){const n=t.namespaceURI,r=n===Am.svg?pR:hR,a=n===Am.html?t.tagName.toLowerCase():t.tagName,i=n===Am.html&&a==="template"?t.content:t,l=t.getAttributeNames(),c={};let d=-1;for(;++d<l.length;)c[l[d]]=t.getAttribute(l[d])||"";return r(a,c,Fk(i,e))}function Fk(t,e){const n=t.childNodes,r=[];let a=-1;for(;++a<n.length;){const i=$k(n[a],e);i!==void 0&&r.push(i)}return r}new DOMParser;function wR(t,e){const n=kR(t);return mR(n)}function kR(t){const e=document.createElement("template");return e.innerHTML=t,e.content}const Y2=(function(t,e,n){const r=U8(n);if(!t||!t.type||!t.children)throw new Error("Expected parent node");if(typeof e=="number"){if(e<0||e===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(e=t.children.indexOf(e),e<0)throw new Error("Expected child node or index");for(;++e<t.children.length;)if(r(t.children[e],e,t))return t.children[e]}),xo=(function(t){if(t==null)return CR;if(typeof t=="string")return _R(t);if(typeof t=="object")return SR(t);if(typeof t=="function")return ny(t);throw new Error("Expected function, string, or array as `test`")});function SR(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=xo(t[n]);return ny(r);function r(...a){let i=-1;for(;++i<e.length;)if(e[i].apply(this,a))return!0;return!1}}function _R(t){return ny(e);function e(n){return n.tagName===t}}function ny(t){return e;function e(n,r,a){return!!(ER(n)&&t.call(this,n,typeof r=="number"?r:void 0,a||void 0))}}function CR(t){return!!(t&&typeof t=="object"&&"type"in t&&t.type==="element"&&"tagName"in t&&typeof t.tagName=="string")}function ER(t){return t!==null&&typeof t=="object"&&"type"in t&&"tagName"in t}const Z2=/\n/g,X2=/[\t ]+/g,Kg=xo("br"),Q2=xo(LR),TR=xo("p"),J2=xo("tr"),AR=xo(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",OR,jR]),Uk=xo(["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 NR(t,e){const n=e||{},r="children"in t?t.children:[],a=Uk(t),i=qk(t,{whitespace:n.whitespace||"normal"}),l=[];(t.type==="text"||t.type==="comment")&&l.push(...Gk(t,{breakBefore:!0,breakAfter:!0}));let c=-1;for(;++c<r.length;)l.push(...Hk(r[c],t,{whitespace:i,breakBefore:c?void 0:a,breakAfter:c<r.length-1?Kg(r[c+1]):a}));const d=[];let h;for(c=-1;++c<l.length;){const p=l[c];typeof p=="number"?h!==void 0&&p>h&&(h=p):p&&(h!==void 0&&h>-1&&d.push(`
293
- `.repeat(h)||" "),h=-1,d.push(p))}return d.join("")}function Hk(t,e,n){return t.type==="element"?RR(t,e,n):t.type==="text"?n.whitespace==="normal"?Gk(t,n):MR(t):[]}function RR(t,e,n){const r=qk(t,n),a=t.children||[];let i=-1,l=[];if(AR(t))return l;let c,d;for(Kg(t)||J2(t)&&Y2(e,t,J2)?d=`
294
- `:TR(t)?(c=2,d=2):Uk(t)&&(c=1,d=1);++i<a.length;)l=l.concat(Hk(a[i],t,{whitespace:r,breakBefore:i?void 0:c,breakAfter:i<a.length-1?Kg(a[i+1]):d}));return Q2(t)&&Y2(e,t,Q2)&&l.push(" "),c&&l.unshift(c),d&&l.push(d),l}function Gk(t,e){const n=String(t.value),r=[],a=[];let i=0;for(;i<=n.length;){Z2.lastIndex=i;const d=Z2.exec(n),h=d&&"index"in d?d.index:n.length;r.push(DR(n.slice(i,h).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),i===0?e.breakBefore:!0,h===n.length?e.breakAfter:!0)),i=h+1}let l=-1,c;for(;++l<r.length;)r[l].charCodeAt(r[l].length-1)===8203||l<r.length-1&&r[l+1].charCodeAt(0)===8203?(a.push(r[l]),c=void 0):r[l]?(typeof c=="number"&&a.push(c),a.push(r[l]),c=0):(l===0||l===r.length-1)&&a.push(0);return a}function MR(t){return[String(t.value)]}function DR(t,e,n){const r=[];let a=0,i;for(;a<t.length;){X2.lastIndex=a;const l=X2.exec(t);i=l?l.index:t.length,!a&&!i&&l&&!e&&r.push(""),a!==i&&r.push(t.slice(a,i)),a=l?i+l[0].length:i}return a!==i&&!n&&r.push(""),r.join(" ")}function qk(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 OR(t){return!!(t.properties||{}).hidden}function LR(t){return t.tagName==="td"||t.tagName==="th"}function jR(t){return t.tagName==="dialog"&&!(t.properties||{}).open}const BR={},IR=[];function PR(t){const e=t||BR;return function(n,r){H8(n,"element",function(a,i){const l=Array.isArray(a.properties.className)?a.properties.className:IR,c=l.includes("language-math"),d=l.includes("math-display"),h=l.includes("math-inline");let p=d;if(!c&&!d&&!h)return;let m=i[i.length-1],b=a;if(a.tagName==="code"&&c&&m&&m.type==="element"&&m.tagName==="pre"&&(b=m,m=i[i.length-2],p=!0),!m)return;const x=NR(b,{whitespace:"pre"});let w;try{w=q2.renderToString(x,{...e,displayMode:p,throwOnError:!0})}catch(E){const A=E,T=A.name.toLowerCase();r.message("Could not render math with KaTeX",{ancestors:[...i,a],cause:A,place:a.position,ruleId:T,source:"rehype-katex"});try{w=q2.renderToString(x,{...e,displayMode:p,strict:"ignore",throwOnError:!1})}catch{w=[{type:"element",tagName:"span",properties:{className:["katex-error"],style:"color:"+(e.errorColor||"#cc0000"),title:String(E)},children:[{type:"text",value:x}]}]}}typeof w=="string"&&(w=wR(w).children);const S=m.children.indexOf(b);return m.children.splice(S,1,...w),G8})}}var Yg=Object.defineProperty,zR=Object.getOwnPropertyDescriptor,$R=Object.getOwnPropertyNames,FR=Object.prototype.hasOwnProperty,UR=(t,e)=>{let n={};for(var r in t)Yg(n,r,{get:t[r],enumerable:!0});return Yg(n,Symbol.toStringTag,{value:"Module"}),n},HR=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(var a=$R(e),i=0,l=a.length,c;i<l;i++)c=a[i],!FR.call(t,c)&&c!==n&&Yg(t,c,{get:(d=>e[d]).bind(null,c),enumerable:!(r=zR(e,c))||r.enumerable});return t},GR=(t,e,n)=>(HR(t,e,"default"),n);const Vk=[{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"),[]))}],qR=Object.fromEntries(Vk.map(t=>[t.id,t.import])),VR=Object.fromEntries(Vk.flatMap(t=>{var e;return((e=t.aliases)==null?void 0:e.map(n=>[n,t.import]))||[]})),WR={...qR,...VR},KR=[{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"),[]))}],YR=Object.fromEntries(KR.map(t=>[t.id,t.import]));var ry=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function ZR(){return 2147483648}function XR(){return typeof performance<"u"?performance.now():Date.now()}const QR=(t,e)=>t+(e-t%e)%e;async function JR(t){let e,n;const r={};function a(x){n=x,r.HEAPU8=new Uint8Array(x),r.HEAPU32=new Uint32Array(x)}function i(x,w,S){r.HEAPU8.copyWithin(x,w,w+S)}function l(x){try{return e.grow(x-n.byteLength+65535>>>16),a(e.buffer),1}catch{}}function c(x){const w=r.HEAPU8.length;x=x>>>0;const S=ZR();if(x>S)return!1;for(let E=1;E<=4;E*=2){let A=w*(1+.2/E);A=Math.min(A,x+100663296);const T=Math.min(S,QR(Math.max(x,A),65536));if(l(T))return!0}return!1}const d=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function h(x,w,S=1024){const E=w+S;let A=w;for(;x[A]&&!(A>=E);)++A;if(A-w>16&&x.buffer&&d)return d.decode(x.subarray(w,A));let T="";for(;w<A;){let D=x[w++];if(!(D&128)){T+=String.fromCharCode(D);continue}const M=x[w++]&63;if((D&224)===192){T+=String.fromCharCode((D&31)<<6|M);continue}const B=x[w++]&63;if((D&240)===224?D=(D&15)<<12|M<<6|B:D=(D&7)<<18|M<<12|B<<6|x[w++]&63,D<65536)T+=String.fromCharCode(D);else{const I=D-65536;T+=String.fromCharCode(55296|I>>10,56320|I&1023)}}return T}function p(x,w){return x?h(r.HEAPU8,x,w):""}const m={emscripten_get_now:XR,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,a(e.buffer),Object.assign(r,w),r.UTF8ToString=p}return await b(),r}var eM=Object.defineProperty,tM=(t,e,n)=>e in t?eM(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Tn=(t,e,n)=>tM(t,typeof e!="symbol"?e+"":e,n);let Ln=null;function nM(t){throw new ry(t.UTF8ToString(t.getLastOnigError()))}class Mf{constructor(e){Tn(this,"utf16Length"),Tn(this,"utf8Length"),Tn(this,"utf16Value"),Tn(this,"utf8Value"),Tn(this,"utf16OffsetToUtf8"),Tn(this,"utf8OffsetToUtf16");const n=e.length,r=Mf._utf8ByteLength(e),a=r!==n,i=a?new Uint32Array(n+1):null;a&&(i[n]=r);const l=a?new Uint32Array(r+1):null;a&&(l[r]=n);const c=new Uint8Array(r);let d=0;for(let h=0;h<n;h++){const p=e.charCodeAt(h);let m=p,b=!1;if(p>=55296&&p<=56319&&h+1<n){const x=e.charCodeAt(h+1);x>=56320&&x<=57343&&(m=(p-55296<<10)+65536|x-56320,b=!0)}a&&(i[h]=d,b&&(i[h+1]=d),m<=127?l[d+0]=h:m<=2047?(l[d+0]=h,l[d+1]=h):m<=65535?(l[d+0]=h,l[d+1]=h,l[d+2]=h):(l[d+0]=h,l[d+1]=h,l[d+2]=h,l[d+3]=h)),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&&h++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=e,this.utf8Value=c,this.utf16OffsetToUtf8=i,this.utf8OffsetToUtf16=l}static _utf8ByteLength(e){let n=0;for(let r=0,a=e.length;r<a;r++){const i=e.charCodeAt(r);let l=i,c=!1;if(i>=55296&&i<=56319&&r+1<a){const d=e.charCodeAt(r+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&&r++}return n}createString(e){const n=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,n),n}}const Df=class Ca{constructor(e){if(Tn(this,"id",++Ca.LAST_ID),Tn(this,"_onigBinding"),Tn(this,"content"),Tn(this,"utf16Length"),Tn(this,"utf8Length"),Tn(this,"utf16OffsetToUtf8"),Tn(this,"utf8OffsetToUtf16"),Tn(this,"ptr"),!Ln)throw new ry("Must invoke loadWasm first.");this._onigBinding=Ln,this.content=e;const n=new Mf(e);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!Ca._sharedPtrInUse?(Ca._sharedPtr||(Ca._sharedPtr=Ln.omalloc(1e4)),Ca._sharedPtrInUse=!0,Ln.HEAPU8.set(n.utf8Value,Ca._sharedPtr),this.ptr=Ca._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===Ca._sharedPtr?Ca._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};Tn(Df,"LAST_ID",0);Tn(Df,"_sharedPtr",0);Tn(Df,"_sharedPtrInUse",!1);let Wk=Df;class rM{constructor(e){if(Tn(this,"_onigBinding"),Tn(this,"_ptr"),!Ln)throw new ry("Must invoke loadWasm first.");const n=[],r=[];for(let c=0,d=e.length;c<d;c++){const h=new Mf(e[c]);n[c]=h.createString(Ln),r[c]=h.utf8Length}const a=Ln.omalloc(4*e.length);Ln.HEAPU32.set(n,a/4);const i=Ln.omalloc(4*e.length);Ln.HEAPU32.set(r,i/4);const l=Ln.createOnigScanner(a,i,e.length);for(let c=0,d=e.length;c<d;c++)Ln.ofree(n[c]);Ln.ofree(i),Ln.ofree(a),l===0&&nM(Ln),this._onigBinding=Ln,this._ptr=l}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,n,r){let a=0;if(typeof r=="number"&&(a=r),typeof e=="string"){e=new Wk(e);const i=this._findNextMatchSync(e,n,!1,a);return e.dispose(),i}return this._findNextMatchSync(e,n,!1,a)}_findNextMatchSync(e,n,r,a){const i=this._onigBinding,l=i.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(n),a);if(l===0)return null;const c=i.HEAPU32;let d=l/4;const h=c[d++],p=c[d++],m=[];for(let b=0;b<p;b++){const x=e.convertUtf8OffsetToUtf16(c[d++]),w=e.convertUtf8OffsetToUtf16(c[d++]);m[b]={start:x,end:w,length:w-x}}return{index:h,captureIndices:m}}}function aM(t){return typeof t.instantiator=="function"}function sM(t){return typeof t.default=="function"}function iM(t){return typeof t.data<"u"}function oM(t){return typeof Response<"u"&&t instanceof Response}function lM(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 a0;function Kk(t){if(a0)return a0;async function e(){Ln=await JR(async n=>{let r=t;return r=await r,typeof r=="function"&&(r=await r(n)),typeof r=="function"&&(r=await r(n)),aM(r)?r=await r.instantiator(n):sM(r)?r=await r.default(n):(iM(r)&&(r=r.data),oM(r)?typeof WebAssembly.instantiateStreaming=="function"?r=await cM(r)(n):r=await uM(r)(n):lM(r)?r=await Nm(r)(n):r instanceof WebAssembly.Module?r=await Nm(r)(n):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await Nm(r.default)(n))),"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}return a0=e(),a0}function Nm(t){return e=>WebAssembly.instantiate(t,e)}function cM(t){return e=>WebAssembly.instantiateStreaming(t,e)}function uM(t){return async e=>{const n=await t.arrayBuffer();return WebAssembly.instantiate(n,e)}}let Yk;function dM(t){Yk=t}function fM(){return Yk}async function hM(t){return t&&await Kk(t),{createScanner(e){return new rM(e.map(n=>typeof n=="string"?n:n.source))},createString(e){return new Wk(e)}}}const pM=Object.freeze(Object.defineProperty({__proto__:null,createOnigurumaEngine:hM,getDefaultWasmLoader:fM,loadWasm:Kk,setDefaultWasmLoader:dM},Symbol.toStringTag,{value:"Module"}));var Zk=UR({});GR(Zk,pM);var Pt=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function mM(t){return ay(t)}function ay(t){return Array.isArray(t)?gM(t):t instanceof RegExp?t:typeof t=="object"?yM(t):t}function gM(t){let e=[];for(let n=0,r=t.length;n<r;n++)e[n]=ay(t[n]);return e}function yM(t){let e={};for(let n in t)e[n]=ay(t[n]);return e}function Xk(t,...e){return e.forEach(n=>{for(let r in n)t[r]=n[r]}),t}function Qk(t){const e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return e===0?t:~e===t.length-1?Qk(t.substring(0,t.length-1)):t.substr(~e+1)}var Rm=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,s0=class{static hasCaptures(t){return t===null?!1:(Rm.lastIndex=0,Rm.test(t))}static replaceCaptures(t,e,n){return t.replace(Rm,(r,a,i,l)=>{let c=n[parseInt(a||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 r})}};function Jk(t,e){return t<e?-1:t>e?1:0}function e6(t,e){if(t===null&&e===null)return 0;if(!t)return-1;if(!e)return 1;let n=t.length,r=e.length;if(n===r){for(let a=0;a<n;a++){let i=Jk(t[a],e[a]);if(i!==0)return i}return 0}return n-r}function ew(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 t6(t){return t.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var n6=class{constructor(t){Z(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}},X0=class{constructor(t,e,n){Z(this,"_cachedMatchRoot",new n6(t=>this._root.match(t)));this._colorMap=t,this._defaults=e,this._root=n}static createFromRawTheme(t,e){return this.createFromParsedTheme(xM(t),e)}static createFromParsedTheme(t,e){return kM(t,e)}getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(t){if(t===null)return this._defaults;const e=t.scopeName,r=this._cachedMatchRoot.get(e).find(a=>bM(t.parent,a.parentScopes));return r?new r6(r.fontStyle,r.foreground,r.background):null}},Mm=class E0{constructor(e,n){this.parent=e,this.scopeName=n}static push(e,n){for(const r of n)e=new E0(e,r);return e}static from(...e){let n=null;for(let r=0;r<e.length;r++)n=new E0(n,e[r]);return n}push(e){return new E0(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 r=this;for(;r&&r!==e;)n.push(r.scopeName),r=r.parent;return r===e?n.reverse():void 0}};function bM(t,e){if(e.length===0)return!0;for(let n=0;n<e.length;n++){let r=e[n],a=!1;if(r===">"){if(n===e.length-1)return!1;r=e[++n],a=!0}for(;t&&!vM(t.scopeName,r);){if(a)return!1;t=t.parent}if(!t)return!1;t=t.parent}return!0}function vM(t,e){return e===t||t.startsWith(e)&&t[e.length]==="."}var r6=class{constructor(t,e,n){this.fontStyle=t,this.foregroundId=e,this.backgroundId=n}};function xM(t){if(!t)return[];if(!t.settings||!Array.isArray(t.settings))return[];let e=t.settings,n=[],r=0;for(let a=0,i=e.length;a<i;a++){let l=e[a];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 h=null;typeof l.settings.foreground=="string"&&ew(l.settings.foreground)&&(h=l.settings.foreground);let p=null;typeof l.settings.background=="string"&&ew(l.settings.background)&&(p=l.settings.background);for(let m=0,b=c.length;m<b;m++){let w=c[m].trim().split(" "),S=w[w.length-1],E=null;w.length>1&&(E=w.slice(0,w.length-1),E.reverse()),n[r++]=new wM(S,E,a,d,h,p)}}return n}var wM=class{constructor(t,e,n,r,a,i){this.scope=t,this.parentScopes=e,this.index=n,this.fontStyle=r,this.foreground=a,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 kM(t,e){t.sort((d,h)=>{let p=Jk(d.scope,h.scope);return p!==0||(p=e6(d.parentScopes,h.parentScopes),p!==0)?p:d.index-h.index});let n=0,r="#000000",a="#ffffff";for(;t.length>=1&&t[0].scope==="";){let d=t.shift();d.fontStyle!==-1&&(n=d.fontStyle),d.foreground!==null&&(r=d.foreground),d.background!==null&&(a=d.background)}let i=new SM(e),l=new r6(n,i.getId(r),i.getId(a)),c=new CM(new Zg(0,null,-1,0,0),[]);for(let d=0,h=t.length;d<h;d++){let p=t[d];c.insert(0,p.scope,p.parentScopes,p.fontStyle,i.getId(p.foreground),i.getId(p.background))}return new X0(i,l,c)}var SM=class{constructor(t){Z(this,"_isFrozen");Z(this,"_lastColorId");Z(this,"_id2color");Z(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)}},_M=Object.freeze([]),Zg=class a6{constructor(e,n,r,a,i){Z(this,"scopeDepth");Z(this,"parentScopes");Z(this,"fontStyle");Z(this,"foreground");Z(this,"background");this.scopeDepth=e,this.parentScopes=n||_M,this.fontStyle=r,this.foreground=a,this.background=i}clone(){return new a6(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let n=[];for(let r=0,a=e.length;r<a;r++)n[r]=e[r].clone();return n}acceptOverwrite(e,n,r,a){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),a!==0&&(this.background=a)}},CM=class Xg{constructor(e,n=[],r={}){Z(this,"_rulesWithParentScopes");this._mainRule=e,this._children=r,this._rulesWithParentScopes=n}static _cmpBySpecificity(e,n){if(e.scopeDepth!==n.scopeDepth)return n.scopeDepth-e.scopeDepth;let r=0,a=0;for(;e.parentScopes[r]===">"&&r++,n.parentScopes[a]===">"&&a++,!(r>=e.parentScopes.length||a>=n.parentScopes.length);){const i=n.parentScopes[a].length-e.parentScopes[r].length;if(i!==0)return i;r++,a++}return n.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let r=e.indexOf("."),a,i;if(r===-1?(a=e,i=""):(a=e.substring(0,r),i=e.substring(r+1)),this._children.hasOwnProperty(a))return this._children[a].match(i)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(Xg._cmpBySpecificity),n}insert(e,n,r,a,i,l){if(n===""){this._doInsertHere(e,r,a,i,l);return}let c=n.indexOf("."),d,h;c===-1?(d=n,h=""):(d=n.substring(0,c),h=n.substring(c+1));let p;this._children.hasOwnProperty(d)?p=this._children[d]:(p=new Xg(this._mainRule.clone(),Zg.cloneArr(this._rulesWithParentScopes)),this._children[d]=p),p.insert(e+1,h,r,a,i,l)}_doInsertHere(e,n,r,a,i){if(n===null){this._mainRule.acceptOverwrite(e,r,a,i);return}for(let l=0,c=this._rulesWithParentScopes.length;l<c;l++){let d=this._rulesWithParentScopes[l];if(e6(d.parentScopes,n)===0){d.acceptOverwrite(e,r,a,i);return}}r===-1&&(r=this._mainRule.fontStyle),a===0&&(a=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new Zg(e,n,r,a,i))}},po=class Yr{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){const n=Yr.getLanguageId(e),r=Yr.getTokenType(e),a=Yr.getFontStyle(e),i=Yr.getForeground(e),l=Yr.getBackground(e);console.log({languageId:n,tokenType:r,fontStyle:a,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,r,a,i,l,c){let d=Yr.getLanguageId(e),h=Yr.getTokenType(e),p=Yr.containsBalancedBrackets(e)?1:0,m=Yr.getFontStyle(e),b=Yr.getForeground(e),x=Yr.getBackground(e);return n!==0&&(d=n),r!==8&&(h=r),a!==null&&(p=a?1:0),i!==-1&&(m=i),l!==0&&(b=l),c!==0&&(x=c),(d<<0|h<<8|p<<10|m<<11|b<<15|x<<24)>>>0}};function Q0(t,e){const n=[],r=EM(t);let a=r.next();for(;a!==null;){let d=0;if(a.length===2&&a.charAt(1)===":"){switch(a.charAt(0)){case"R":d=1;break;case"L":d=-1;break;default:console.log(`Unknown priority ${a} in scope selector`)}a=r.next()}let h=l();if(n.push({matcher:h,priority:d}),a!==",")break;a=r.next()}return n;function i(){if(a==="-"){a=r.next();const d=i();return h=>!!d&&!d(h)}if(a==="("){a=r.next();const d=c();return a===")"&&(a=r.next()),d}if(tw(a)){const d=[];do d.push(a),a=r.next();while(tw(a));return h=>e(d,h)}return null}function l(){const d=[];let h=i();for(;h;)d.push(h),h=i();return p=>d.every(m=>m(p))}function c(){const d=[];let h=l();for(;h&&(d.push(h),a==="|"||a===",");){do a=r.next();while(a==="|"||a===",");h=l()}return p=>d.some(m=>m(p))}}function tw(t){return!!t&&!!t.match(/[\w\.:]+/)}function EM(t){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=e.exec(t);return{next:()=>{if(!n)return null;const r=n[0];return n=e.exec(t),r}}}function s6(t){typeof t.dispose=="function"&&t.dispose()}var uu=class{constructor(t){this.scopeName=t}toKey(){return this.scopeName}},TM=class{constructor(t,e){this.scopeName=t,this.ruleName=e}toKey(){return`${this.scopeName}#${this.ruleName}`}},AM=class{constructor(){Z(this,"_references",[]);Z(this,"_seenReferenceKeys",new Set);Z(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))}},NM=class{constructor(t,e){Z(this,"seenFullScopeRequests",new Set);Z(this,"seenPartialScopeRequests",new Set);Z(this,"Q");this.repo=t,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new uu(this.initialScopeName)]}processQueue(){const t=this.Q;this.Q=[];const e=new AM;for(const n of t)RM(n,this.initialScopeName,this.repo,e);for(const n of e.references)if(n instanceof uu){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 RM(t,e,n,r){const a=n.lookup(t.scopeName);if(!a){if(t.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}const i=n.lookup(e);t instanceof uu?T0({baseGrammar:i,selfGrammar:a},r):Qg(t.ruleName,{baseGrammar:i,selfGrammar:a,repository:a.repository},r);const l=n.injections(t.scopeName);if(l)for(const c of l)r.add(new uu(c))}function Qg(t,e,n){if(e.repository&&e.repository[t]){const r=e.repository[t];J0([r],e,n)}}function T0(t,e){t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns)&&J0(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e),t.selfGrammar.injections&&J0(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}function J0(t,e,n){for(const r of t){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const a=r.repository?Xk({},e.repository,r.repository):e.repository;Array.isArray(r.patterns)&&J0(r.patterns,{...e,repository:a},n);const i=r.include;if(!i)continue;const l=i6(i);switch(l.kind){case 0:T0({...e,selfGrammar:e.baseGrammar},n);break;case 1:T0(e,n);break;case 2:Qg(l.ruleName,{...e,repository:a},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:a};l.kind===4?Qg(l.ruleName,d,n):T0(d,n)}else l.kind===4?n.add(new TM(l.scopeName,l.ruleName)):n.add(new uu(l.scopeName));break}}}var MM=class{constructor(){Z(this,"kind",0)}},DM=class{constructor(){Z(this,"kind",1)}},OM=class{constructor(t){Z(this,"kind",2);this.ruleName=t}},LM=class{constructor(t){Z(this,"kind",3);this.scopeName=t}},jM=class{constructor(t,e){Z(this,"kind",4);this.scopeName=t,this.ruleName=e}};function i6(t){if(t==="$base")return new MM;if(t==="$self")return new DM;const e=t.indexOf("#");if(e===-1)return new LM(t);if(e===0)return new OM(t.substring(1));{const n=t.substring(0,e),r=t.substring(e+1);return new jM(n,r)}}var BM=/\\(\d+)/,nw=/\\(\d+)/g,IM=-1,o6=-2;var _u=class{constructor(t,e,n,r){Z(this,"$location");Z(this,"id");Z(this,"_nameIsCapturing");Z(this,"_name");Z(this,"_contentNameIsCapturing");Z(this,"_contentName");this.$location=t,this.id=e,this._name=n||null,this._nameIsCapturing=s0.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=s0.hasCaptures(this._contentName)}get debugName(){const t=this.$location?`${Qk(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:s0.replaceCaptures(this._name,t,e)}getContentName(t,e){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:s0.replaceCaptures(this._contentName,t,e)}},PM=class extends _u{constructor(e,n,r,a,i){super(e,n,r,a);Z(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,r,a){throw new Error("Not supported!")}},zM=class extends _u{constructor(e,n,r,a,i){super(e,n,r,null);Z(this,"_match");Z(this,"captures");Z(this,"_cachedCompiledPatterns");this._match=new du(a,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,r,a){return this._getCachedCompiledPatterns(e).compileAG(e,r,a)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new fu,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},rw=class extends _u{constructor(e,n,r,a,i){super(e,n,r,a);Z(this,"hasMissingPatterns");Z(this,"patterns");Z(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 r of this.patterns)e.getRule(r).collectPatterns(e,n)}compile(e,n){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,n,r,a){return this._getCachedCompiledPatterns(e).compileAG(e,r,a)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new fu,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Jg=class extends _u{constructor(e,n,r,a,i,l,c,d,h,p){super(e,n,r,a);Z(this,"_begin");Z(this,"beginCaptures");Z(this,"_end");Z(this,"endHasBackReferences");Z(this,"endCaptures");Z(this,"applyEndPatternLast");Z(this,"hasMissingPatterns");Z(this,"patterns");Z(this,"_cachedCompiledPatterns");this._begin=new du(i,this.id),this.beginCaptures=l,this._end=new du(c||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=d,this.applyEndPatternLast=h||!1,this.patterns=p.patterns,this.hasMissingPatterns=p.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,r,a){return this._getCachedCompiledPatterns(e,n).compileAG(e,r,a)}_getCachedCompiledPatterns(e,n){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new fu;for(const r of this.patterns)e.getRule(r).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}},ef=class extends _u{constructor(e,n,r,a,i,l,c,d,h){super(e,n,r,a);Z(this,"_begin");Z(this,"beginCaptures");Z(this,"whileCaptures");Z(this,"_while");Z(this,"whileHasBackReferences");Z(this,"hasMissingPatterns");Z(this,"patterns");Z(this,"_cachedCompiledPatterns");Z(this,"_cachedCompiledWhilePatterns");this._begin=new du(i,this.id),this.beginCaptures=l,this.whileCaptures=d,this._while=new du(c,o6),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=h.patterns,this.hasMissingPatterns=h.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,r,a){return this._getCachedCompiledPatterns(e).compileAG(e,r,a)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new fu;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,r,a){return this._getCachedCompiledWhilePatterns(e,n).compileAG(e,r,a)}_getCachedCompiledWhilePatterns(e,n){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new fu,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,n||"￿"),this._cachedCompiledWhilePatterns}},l6=class qn{static createCaptureRule(e,n,r,a,i){return e.registerRule(l=>new PM(n,l,r,a,i))}static getCompiledRuleId(e,n,r){return e.id||n.registerRule(a=>{if(e.id=a,e.match)return new zM(e.$vscodeTextmateLocation,e.id,e.name,e.match,qn._compileCaptures(e.captures,n,r));if(typeof e.begin>"u"){e.repository&&(r=Xk({},r,e.repository));let i=e.patterns;return typeof i>"u"&&e.include&&(i=[{include:e.include}]),new rw(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,qn._compilePatterns(i,n,r))}return e.while?new ef(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,qn._compileCaptures(e.beginCaptures||e.captures,n,r),e.while,qn._compileCaptures(e.whileCaptures||e.captures,n,r),qn._compilePatterns(e.patterns,n,r)):new Jg(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,qn._compileCaptures(e.beginCaptures||e.captures,n,r),e.end,qn._compileCaptures(e.endCaptures||e.captures,n,r),e.applyEndPatternLast,qn._compilePatterns(e.patterns,n,r))}),e.id}static _compileCaptures(e,n,r){let a=[];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++)a[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,r)),a[c]=qn.createCaptureRule(n,e[l].$vscodeTextmateLocation,e[l].name,e[l].contentName,d)}}return a}static _compilePatterns(e,n,r){let a=[];if(e)for(let i=0,l=e.length;i<l;i++){const c=e[i];let d=-1;if(c.include){const h=i6(c.include);switch(h.kind){case 0:case 1:d=qn.getCompiledRuleId(r[c.include],n,r);break;case 2:let p=r[h.ruleName];p&&(d=qn.getCompiledRuleId(p,n,r));break;case 3:case 4:const m=h.scopeName,b=h.kind===4?h.ruleName:null,x=n.getExternalGrammar(m,r);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,r);if(d!==-1){const h=n.getRule(d);let p=!1;if((h instanceof rw||h instanceof Jg||h instanceof ef)&&h.hasMissingPatterns&&h.patterns.length===0&&(p=!0),p)continue;a.push(d)}}return{patterns:a,hasMissingPatterns:(e?e.length:0)!==a.length}}},du=class c6{constructor(e,n){Z(this,"source");Z(this,"ruleId");Z(this,"hasAnchor");Z(this,"hasBackReferences");Z(this,"_anchorCache");if(e&&typeof e=="string"){const r=e.length;let a=0,i=[],l=!1;for(let c=0;c<r;c++)if(e.charAt(c)==="\\"&&c+1<r){const h=e.charAt(c+1);h==="z"?(i.push(e.substring(a,c)),i.push("$(?!\\n)(?<!\\n)"),a=c+2):(h==="A"||h==="G")&&(l=!0),c++}this.hasAnchor=l,a===0?this.source=e:(i.push(e.substring(a,r)),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=BM.test(this.source):this.hasBackReferences=!1}clone(){return new c6(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 r=n.map(a=>e.substring(a.start,a.end));return nw.lastIndex=0,this.source.replace(nw,(a,i)=>t6(r[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=[],r=[],a=[],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,r[i]=c,a[i]=c,c==="\\"&&i+1<l&&(d=this.source.charAt(i+1),d==="A"?(e[i+1]="￿",n[i+1]="￿",r[i+1]="A",a[i+1]="A"):d==="G"?(e[i+1]="￿",n[i+1]="G",r[i+1]="￿",a[i+1]="G"):(e[i+1]=d,n[i+1]=d,r[i+1]=d,a[i+1]=d),i++);return{A0_G0:e.join(""),A0_G1:n.join(""),A1_G0:r.join(""),A1_G1:a.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}},fu=class{constructor(){Z(this,"_items");Z(this,"_hasAnchors");Z(this,"_cached");Z(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 aw(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 r=this._items.map(a=>a.resolveAnchors(e,n));return new aw(t,r,this._items.map(a=>a.ruleId))}},aw=class{constructor(t,e,n){Z(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(`
295
- `)}findNextMatchSync(t,e,n){const r=this.scanner.findNextMatchSync(t,e,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},Dm=class{constructor(t,e){this.languageId=t,this.tokenType=e}},gs,$M=(gs=class{constructor(e,n){Z(this,"_defaultAttributes");Z(this,"_embeddedLanguagesMatcher");Z(this,"_getBasicScopeAttributes",new n6(e=>{const n=this._scopeToLanguage(e),r=this._toStandardTokenType(e);return new Dm(n,r)}));this._defaultAttributes=new Dm(e,8),this._embeddedLanguagesMatcher=new FM(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(e){return e===null?gs._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(e)}_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(e){const n=e.match(gs.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!")}},Z(gs,"_NULL_SCOPE_METADATA",new Dm(0,0)),Z(gs,"STANDARD_TOKEN_TYPE_REGEXP",/\b(comment|string|regex|meta\.embedded)\b/),gs),FM=class{constructor(t){Z(this,"values");Z(this,"scopesRegExp");if(t.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(t);const e=t.map(([n,r])=>t6(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])}},sw=class{constructor(t,e){this.stack=t,this.stoppedEarly=e}};function u6(t,e,n,r,a,i,l,c){const d=e.content.length;let h=!1,p=-1;if(l){const x=UM(t,e,n,r,a,i);a=x.stack,r=x.linePos,n=x.isFirstLine,p=x.anchorPosition}const m=Date.now();for(;!h;){if(c!==0&&Date.now()-m>c)return new sw(a,!0);b()}return new sw(a,!1);function b(){const x=HM(t,e,n,r,a,p);if(!x){i.produce(a,d),h=!0;return}const w=x.captureIndices,S=x.matchedRuleId,E=w&&w.length>0?w[0].end>r:!1;if(S===IM){const A=a.getRule(t);i.produce(a,w[0].start),a=a.withContentNameScopesList(a.nameScopesList),$c(t,e,n,a,i,A.endCaptures,w),i.produce(a,w[0].end);const T=a;if(a=a.parent,p=T.getAnchorPos(),!E&&T.getEnterPos()===r){a=T,i.produce(a,d),h=!0;return}}else{const A=t.getRule(S);i.produce(a,w[0].start);const T=a,D=A.getName(e.content,w),M=a.contentNameScopesList.pushAttributed(D,t);if(a=a.push(S,r,p,w[0].end===d,null,M,M),A instanceof Jg){const B=A;$c(t,e,n,a,i,B.beginCaptures,w),i.produce(a,w[0].end),p=w[0].end;const I=B.getContentName(e.content,w),U=M.pushAttributed(I,t);if(a=a.withContentNameScopesList(U),B.endHasBackReferences&&(a=a.withEndRule(B.getEndWithResolvedBackReferences(e.content,w))),!E&&T.hasSameRuleAs(a)){a=a.pop(),i.produce(a,d),h=!0;return}}else if(A instanceof ef){const B=A;$c(t,e,n,a,i,B.beginCaptures,w),i.produce(a,w[0].end),p=w[0].end;const I=B.getContentName(e.content,w),U=M.pushAttributed(I,t);if(a=a.withContentNameScopesList(U),B.whileHasBackReferences&&(a=a.withEndRule(B.getWhileWithResolvedBackReferences(e.content,w))),!E&&T.hasSameRuleAs(a)){a=a.pop(),i.produce(a,d),h=!0;return}}else if($c(t,e,n,a,i,A.captures,w),i.produce(a,w[0].end),a=a.pop(),!E){a=a.safePop(),i.produce(a,d),h=!0;return}}w[0].end>r&&(r=w[0].end,n=!1)}}function UM(t,e,n,r,a,i){let l=a.beginRuleCapturedEOL?0:-1;const c=[];for(let d=a;d;d=d.pop()){const h=d.getRule(t);h instanceof ef&&c.push({rule:h,stack:d})}for(let d=c.pop();d;d=c.pop()){const{ruleScanner:h,findOptions:p}=VM(d.rule,t,d.stack.endRule,n,r===l),m=h.findNextMatchSync(e,r,p);if(m){if(m.ruleId!==o6){a=d.stack.pop();break}m.captureIndices&&m.captureIndices.length&&(i.produce(d.stack,m.captureIndices[0].start),$c(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>r&&(r=m.captureIndices[0].end,n=!1))}else{a=d.stack.pop();break}}return{stack:a,linePos:r,anchorPosition:l,isFirstLine:n}}function HM(t,e,n,r,a,i){const l=GM(t,e,n,r,a,i),c=t.getInjections();if(c.length===0)return l;const d=qM(c,t,e,n,r,a,i);if(!d)return l;if(!l)return d;const h=l.captureIndices[0].start,p=d.captureIndices[0].start;return p<h||d.priorityMatch&&p===h?d:l}function GM(t,e,n,r,a,i){const l=a.getRule(t),{ruleScanner:c,findOptions:d}=d6(l,t,a.endRule,n,r===i),h=c.findNextMatchSync(e,r,d);return h?{captureIndices:h.captureIndices,matchedRuleId:h.ruleId}:null}function qM(t,e,n,r,a,i,l){let c=Number.MAX_VALUE,d=null,h,p=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:E,findOptions:A}=d6(S,e,null,r,a===l),T=E.findNextMatchSync(n,a,A);if(!T)continue;const D=T.captureIndices[0].start;if(!(D>=c)&&(c=D,d=T.captureIndices,h=T.ruleId,p=w.priority,c===a))break}return d?{priorityMatch:p===-1,captureIndices:d,matchedRuleId:h}:null}function d6(t,e,n,r,a){return{ruleScanner:t.compileAG(e,n,r,a),findOptions:0}}function VM(t,e,n,r,a){return{ruleScanner:t.compileWhileAG(e,n,r,a),findOptions:0}}function $c(t,e,n,r,a,i,l){if(i.length===0)return;const c=e.content,d=Math.min(i.length,l.length),h=[],p=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>p)break;for(;h.length>0&&h[h.length-1].endPos<=x.start;)a.produceFromScopes(h[h.length-1].scopes,h[h.length-1].endPos),h.pop();if(h.length>0?a.produceFromScopes(h[h.length-1].scopes,x.start):a.produce(r,x.start),b.retokenizeCapturedWithRuleId){const S=b.getName(c,l),E=r.contentNameScopesList.pushAttributed(S,t),A=b.getContentName(c,l),T=E.pushAttributed(A,t),D=r.push(b.retokenizeCapturedWithRuleId,x.start,-1,!1,null,E,T),M=t.createOnigString(c.substring(0,x.end));u6(t,M,n&&x.start===0,x.start,D,a,!1,0),s6(M);continue}const w=b.getName(c,l);if(w!==null){const E=(h.length>0?h[h.length-1].scopes:r.contentNameScopesList).pushAttributed(w,t);h.push(new WM(E,x.end))}}for(;h.length>0;)a.produceFromScopes(h[h.length-1].scopes,h[h.length-1].endPos),h.pop()}var WM=class{constructor(t,e){Z(this,"scopes");Z(this,"endPos");this.scopes=t,this.endPos=e}};function KM(t,e,n,r,a,i,l,c){return new ZM(t,e,n,r,a,i,l,c)}function iw(t,e,n,r,a){const i=Q0(e,tf),l=l6.getCompiledRuleId(n,r,a.repository);for(const c of i)t.push({debugSelector:e,matcher:c.matcher,ruleId:l,grammar:a,priority:c.priority})}function tf(t,e){if(e.length<t.length)return!1;let n=0;return t.every(r=>{for(let a=n;a<e.length;a++)if(YM(e[a],r))return n=a+1,!0;return!1})}function YM(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 ZM=class{constructor(t,e,n,r,a,i,l,c){Z(this,"_rootId");Z(this,"_lastRuleId");Z(this,"_ruleId2desc");Z(this,"_includedGrammars");Z(this,"_grammarRepository");Z(this,"_grammar");Z(this,"_injections");Z(this,"_basicScopeAttributesProvider");Z(this,"_tokenTypeMatchers");if(this._rootScopeName=t,this.balancedBracketSelectors=i,this._onigLib=c,this._basicScopeAttributesProvider=new $M(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=l,this._grammar=ow(e,null),this._injections=null,this._tokenTypeMatchers=[],a)for(const d of Object.keys(a)){const h=Q0(d,tf);for(const p of h)this._tokenTypeMatchers.push({matcher:p.matcher,type:a[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:a=>a===this._rootScopeName?this._grammar:this.getExternalGrammar(a),injections:a=>this._grammarRepository.injections(a)},e=[],n=this._rootScopeName,r=t.lookup(n);if(r){const a=r.injections;if(a)for(let l in a)iw(e,l,a[l],this,r);const i=this._grammarRepository.injections(n);i&&i.forEach(l=>{const c=this.getExternalGrammar(l);if(c){const d=c.injectionSelector;d&&iw(e,d,c,this,c)}})}return e.sort((a,i)=>a.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]=ow(n,e&&e.$base),this._includedGrammars[t]}}tokenizeLine(t,e,n=0){const r=this._tokenize(t,e,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(t,e,n=0){const r=this._tokenize(t,e,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(t,e,n,r){this._rootId===-1&&(this._rootId=l6.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let a;if(!e||e===e1.NULL){a=!0;const h=this._basicScopeAttributesProvider.getDefaultAttributes(),p=this.themeProvider.getDefaults(),m=po.set(0,h.languageId,h.tokenType,null,p.fontStyle,p.foregroundId,p.backgroundId),b=this.getRule(this._rootId).getName(null,null);let x;b?x=Zc.createRootAndLookUpScopeName(b,m,this):x=Zc.createRoot("unknown",m),e=new e1(null,this._rootId,-1,-1,!1,null,x,x)}else a=!1,e.reset();t=t+`
296
- `;const i=this.createOnigString(t),l=i.content.length,c=new QM(n,t,this._tokenTypeMatchers,this.balancedBracketSelectors),d=u6(this,i,a,0,e,c,!0,r);return s6(i),{lineLength:l,lineTokens:c,ruleStack:d.stack,stoppedEarly:d.stoppedEarly}}};function ow(t,e){return t=mM(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 Zc=class Ea{constructor(e,n,r){this.parent=e,this.scopePath=n,this.tokenAttributes=r}static fromExtension(e,n){let r=e,a=(e==null?void 0:e.scopePath)??null;for(const i of n)a=Mm.push(a,i.scopeNames),r=new Ea(r,a,i.encodedTokenAttributes);return r}static createRoot(e,n){return new Ea(null,new Mm(null,e),n)}static createRootAndLookUpScopeName(e,n,r){const a=r.getMetadataForScope(e),i=new Mm(null,e),l=r.themeProvider.themeMatch(i),c=Ea.mergeAttributes(n,a,l);return new Ea(null,i,c)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(e){return Ea.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,r){let a=-1,i=0,l=0;return r!==null&&(a=r.fontStyle,i=r.foregroundId,l=r.backgroundId),po.set(e,n.languageId,n.tokenType,null,a,i,l)}pushAttributed(e,n){if(e===null)return this;if(e.indexOf(" ")===-1)return Ea._pushAttributed(this,e,n);const r=e.split(/ /g);let a=this;for(const i of r)a=Ea._pushAttributed(a,i,n);return a}static _pushAttributed(e,n,r){const a=r.getMetadataForScope(n),i=e.scopePath.push(n),l=r.themeProvider.themeMatch(i),c=Ea.mergeAttributes(e.tokenAttributes,a,l);return new Ea(e,i,c)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){var a;const n=[];let r=this;for(;r&&r!==e;)n.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(((a=r.parent)==null?void 0:a.scopePath)??null)}),r=r.parent;return r===e?n.reverse():void 0}},Xr,e1=(Xr=class{constructor(e,n,r,a,i,l,c,d){Z(this,"_stackElementBrand");Z(this,"_enterPos");Z(this,"_anchorPos");Z(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=r,this._anchorPos=a}equals(e){return e===null?!1:Xr._equals(this,e)}static _equals(e,n){return e===n?!0:this._structuralEquals(e,n)?Zc.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(){Xr._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(e,n,r,a,i,l,c){return new Xr(this,e,n,r,a,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 r,a;return this.parent&&(n=this.parent._writeString(e,n)),e[n++]=`(${this.ruleId}, ${(r=this.nameScopesList)==null?void 0:r.toString()}, ${(a=this.contentNameScopesList)==null?void 0:a.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 Xr(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,r;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:((r=this.contentNameScopesList)==null?void 0:r.getExtensionIfDefined(this.nameScopesList))??[]}}static pushFrame(e,n){const r=Zc.fromExtension((e==null?void 0:e.nameScopesList)??null,n.nameScopesList);return new Xr(e,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Zc.fromExtension(r,n.contentNameScopesList))}},Z(Xr,"NULL",new Xr(null,0,0,0,!1,null,null,null)),Xr),XM=class{constructor(t,e){Z(this,"balancedBracketScopes");Z(this,"unbalancedBracketScopes");Z(this,"allowAny",!1);this.balancedBracketScopes=t.flatMap(n=>n==="*"?(this.allowAny=!0,[]):Q0(n,tf).map(r=>r.matcher)),this.unbalancedBracketScopes=e.flatMap(n=>Q0(n,tf).map(r=>r.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}},QM=class{constructor(t,e,n,r){Z(this,"_emitBinaryTokens");Z(this,"_lineText");Z(this,"_tokens");Z(this,"_binaryTokens");Z(this,"_lastTokenEndIndex");Z(this,"_tokenTypeOverrides");this.balancedBracketSelectors=r,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 r;if(this._lastTokenEndIndex>=e)return;if(this._emitBinaryTokens){let a=(t==null?void 0:t.tokenAttributes)??0,i=!1;if((r=this.balancedBracketSelectors)!=null&&r.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)&&(a=po.set(a,0,c.type,null,-1,0,0));this.balancedBracketSelectors&&(i=this.balancedBracketSelectors.match(l))}if(i&&(a=po.set(a,0,8,i,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===a){this._lastTokenEndIndex=e;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(a),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 r=0,a=this._binaryTokens.length;r<a;r++)n[r]=this._binaryTokens[r];return n}},JM=class{constructor(t,e){Z(this,"_grammars",new Map);Z(this,"_rawGrammars",new Map);Z(this,"_injectionGrammars",new Map);Z(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,r,a){if(!this._grammars.has(t)){let i=this._rawGrammars.get(t);if(!i)return null;this._grammars.set(t,KM(t,i,e,n,r,a,this,this._onigLib))}return this._grammars.get(t)}},eD=class{constructor(e){Z(this,"_options");Z(this,"_syncRegistry");Z(this,"_ensureGrammarCache");this._options=e,this._syncRegistry=new JM(X0.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,n){this._syncRegistry.setTheme(X0.createFromRawTheme(e,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,n,r){return this.loadGrammarWithConfiguration(e,n,{embeddedLanguages:r})}loadGrammarWithConfiguration(e,n,r){return this._loadGrammar(e,n,r.embeddedLanguages,r.tokenTypes,new XM(r.balancedBracketSelectors||[],r.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,n,r,a,i){const l=new NM(this._syncRegistry,e);for(;l.Q.length>0;)l.Q.map(c=>this._loadSingleGrammar(c.scopeName)),l.processQueue();return this._grammarForScopeName(e,n,r,a,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 r=typeof this._options.getInjections=="function"?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(n,r)}}addGrammar(e,n=[],r=0,a=null){return this._syncRegistry.addGrammar(e,n),this._grammarForScopeName(e.scopeName,r,a)}_grammarForScopeName(e,n=0,r=null,a=null,i=null){return this._syncRegistry.grammarForScopeName(e,n,r,a,i)}},t1=e1.NULL;function nf(t,e){const n=typeof t=="string"?{}:{...t.colorReplacements},r=typeof t=="string"?t:t.name;for(const[a,i]of Object.entries((e==null?void 0:e.colorReplacements)||{}))typeof i=="string"?n[a]=i:a===r&&Object.assign(n,i);return n}function vi(t,e){return t&&((e==null?void 0:e[t==null?void 0:t.toLowerCase()])||t)}function tD(t){return Array.isArray(t)?t:[t]}async function f6(t){return Promise.resolve(typeof t=="function"?t():t).then(e=>e.default||e)}function Of(t){return!t||["plaintext","txt","text","plain"].includes(t)}function h6(t){return t==="ansi"||Of(t)}function Lf(t){return t==="none"}function p6(t){return Lf(t)}const nD=/(\r?\n)/g;function jf(t,e=!1){var i;if(t.length===0)return[["",0]];const n=t.split(nD);let r=0;const a=[];for(let l=0;l<n.length;l+=2){const c=e?n[l]+(n[l+1]||""):n[l];a.push([c,r]),r+=n[l].length,r+=((i=n[l+1])==null?void 0:i.length)||0}return a}const lw={light:"#333333",dark:"#bbbbbb"},cw={light:"#fffffe",dark:"#1e1e1e"},uw="__shiki_resolved";function sy(t){var c,d,h,p,m;if(t!=null&&t[uw])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:r}=e;if(!n||!r){const b=e.settings?e.settings.find(x=>!x.name&&!x.scope):void 0;(c=b==null?void 0:b.settings)!=null&&c.foreground&&(r=b.settings.foreground),(d=b==null?void 0:b.settings)!=null&&d.background&&(n=b.settings.background),!r&&((h=e==null?void 0:e.colors)!=null&&h["editor.foreground"])&&(r=e.colors["editor.foreground"]),!n&&((p=e==null?void 0:e.colors)!=null&&p["editor.background"])&&(n=e.colors["editor.background"]),r||(r=e.type==="light"?lw.light:lw.dark),n||(n=e.type==="light"?cw.light:cw.dark),e.fg=r,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 a=0;const i=new Map;function l(b){var w;if(i.has(b))return i.get(b);a+=1;const x=`#${a.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 E,A;const x=((E=b.settings)==null?void 0:E.foreground)&&!b.settings.foreground.startsWith("#"),w=((A=b.settings)==null?void 0:A.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,uw,{enumerable:!1,writable:!1,value:!0}),e}async function m6(t){return[...new Set((await Promise.all(t.filter(e=>!h6(e)).map(async e=>await f6(e).then(n=>Array.isArray(n)?n:[n])))).flat())]}async function g6(t){return(await Promise.all(t.map(async e=>p6(e)?null:sy(await f6(e))))).filter(e=>!!e)}function y6(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 Pt(`Circular alias \`${[...n].join(" -> ")} -> ${t}\``);n.add(t)}}return t}var rD=class extends eD{constructor(e,n,r,a={}){super(e);Z(this,"_resolver");Z(this,"_themes");Z(this,"_langs");Z(this,"_alias");Z(this,"_resolvedThemes",new Map);Z(this,"_resolvedGrammars",new Map);Z(this,"_langMap",new Map);Z(this,"_langGraph",new Map);Z(this,"_textmateThemeCache",new WeakMap);Z(this,"_loadedThemesCache",null);Z(this,"_loadedLanguagesCache",null);this._resolver=e,this._themes=n,this._langs=r,this._alias=a,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=sy(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=X0.createFromRawTheme(e),this._textmateThemeCache.set(e,n)),this._syncRegistry.setTheme(n)}getGrammar(e){return e=y6(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(h=>{var p;return(p=h.embeddedLangsLazy)==null?void 0:p.includes(e.name)}));this._resolver.addLanguage(e);const r={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const a=this.loadGrammarWithConfiguration(e.scopeName,1,r);if(a.name=e.name,this._resolvedGrammars.set(e.name,a),e.aliases&&e.aliases.forEach(h=>{this._alias[h]=e.name}),this._loadedLanguagesCache=null,n.size)for(const h of n)this._resolvedGrammars.delete(h.name),this._loadedLanguagesCache=null,(l=(i=this._syncRegistry)==null?void 0:i._injectionGrammars)==null||l.delete(h.scopeName),(d=(c=this._syncRegistry)==null?void 0:c._grammars)==null||d.delete(h.scopeName),this.loadLanguage(this._langMap.get(h.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(const a of e)this.resolveEmbeddedLanguages(a);const n=[...this._langGraph.entries()],r=n.filter(([a,i])=>!i);if(r.length){const a=n.filter(([i,l])=>{var c;return l?(c=l.embeddedLanguages||l.embeddedLangs)==null?void 0:c.some(d=>r.map(([h])=>h).includes(d)):!1}).filter(i=>!r.includes(i));throw new Pt(`Missing languages ${r.map(([i])=>`\`${i}\``).join(", ")}, required by ${a.map(([i])=>`\`${i}\``).join(", ")}`)}for(const[a,i]of n)this._resolver.addLanguage(i);for(const[a,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 r of n)this._langGraph.set(r,this._langMap.get(r))}},aD=class{constructor(t,e){Z(this,"_langs",new Map);Z(this,"_scopeToLang",new Map);Z(this,"_injections",new Map);Z(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 r=1;r<=e.length;r++){const a=e.slice(0,r).join(".");n=[...n,...this._injections.get(a)||[]]}return n}};let jc=0;function sD(t){jc+=1,t.warnings!==!1&&jc>=10&&jc%10===0&&console.warn(`[Shiki] ${jc} 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 Pt("`engine` option is required for synchronous mode");const n=(t.langs||[]).flat(1),r=(t.themes||[]).flat(1).map(sy),a=new rD(new aD(t.engine,n),r,n,t.langAlias);let i;function l(T){return y6(T,t.langAlias)}function c(T){E();const D=a.getGrammar(typeof T=="string"?T:T.name);if(!D)throw new Pt(`Language \`${T}\` not found, you may need to load it first`);return D}function d(T){if(T==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};E();const D=a.getTheme(T);if(!D)throw new Pt(`Theme \`${T}\` not found, you may need to load it first`);return D}function h(T){E();const D=d(T);return i!==T&&(a.setTheme(D),i=T),{theme:D,colorMap:a.getColorMap()}}function p(){return E(),a.getLoadedThemes()}function m(){return E(),a.getLoadedLanguages()}function b(...T){E(),a.loadLanguages(T.flat(1))}async function x(...T){return b(await m6(T))}function w(...T){E();for(const D of T.flat(1))a.loadTheme(D)}async function S(...T){return E(),w(await g6(T))}function E(){if(e)throw new Pt("Shiki instance has been disposed")}function A(){e||(e=!0,a.dispose(),jc-=1)}return{setTheme:h,getTheme:d,getLanguage:c,getLoadedThemes:p,getLoadedLanguages:m,resolveLangAlias:l,loadLanguage:x,loadLanguageSync:b,loadTheme:S,loadThemeSync:w,dispose:A,[Symbol.dispose]:A}}async function iD(t){t.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[e,n,r]=await Promise.all([g6(t.themes||[]),m6(t.langs||[]),t.engine]);return sD({...t,themes:e,langs:n,engine:r})}const b6=new WeakMap;function Bf(t,e){b6.set(t,e)}function hu(t){return b6.get(t)}var If=class v6{constructor(...e){Z(this,"_stacks",{});Z(this,"lang");if(e.length===2){const[n,r]=e;this.lang=r,this._stacks=n}else{const[n,r,a]=e;this.lang=r,this._stacks={[a]: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 v6(Object.fromEntries(tD(n).map(r=>[r,t1])),e)}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return oD(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function oD(t){const e=[],n=new Set;function r(a){var l;if(n.has(a))return;n.add(a);const i=(l=a==null?void 0:a.nameScopesList)==null?void 0:l.scopeName;i&&e.push(i),a.parent&&r(a.parent)}return r(t),e}function lD(t,e){if(!(t instanceof If))throw new Pt("Invalid grammar state");return t.getInternalStack(e)}const cD=/,/,uD=/ /;function x6(t,e,n={}){const{theme:r=t.getLoadedThemes()[0]}=n;if(Of(t.resolveLangAlias(n.lang||"text"))||Lf(r))return jf(e).map(c=>[{content:c[0],offset:c[1]}]);const{theme:a,colorMap:i}=t.setTheme(r),l=t.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==l.name)throw new Pt(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${l.name}"`);if(!n.grammarState.themes.includes(a.name))throw new Pt(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${a.name}"`)}return fD(e,l,a,i,n)}function dD(...t){if(t.length===2)return hu(t[1]);const[e,n,r={}]=t,{lang:a="text",theme:i=e.getLoadedThemes()[0]}=r;if(Of(a)||Lf(i))throw new Pt("Plain language does not have grammar state");if(a==="ansi")throw new Pt("ANSI language does not have grammar state");const{theme:l,colorMap:c}=e.setTheme(i),d=e.getLanguage(a);return new If(iy(n,d,l,c,r).stateStack,d.name,l.name)}function fD(t,e,n,r,a){const i=iy(t,e,n,r,a),l=new If(i.stateStack,e.name,n.name);return Bf(i.tokens,l),i.tokens}function iy(t,e,n,r,a){const i=nf(n,a),{tokenizeMaxLineLength:l=0,tokenizeTimeLimit:c=500,includeExplanation:d=!1}=a,h=jf(t);let p=a.grammarState?lD(a.grammarState,n.name)??t1:a.grammarContextCode!=null?iy(a.grammarContextCode,e,n,r,{...a,grammarState:void 0,grammarContextCode:void 0}).stateStack:t1,m=[];const b=[];for(let x=0,w=h.length;x<w;x++){const[S,E]=h[x];if(S===""){m=[],b.push([]);continue}if(l>0&&S.length>=l){m=[],b.push([{content:S,offset:E,color:"",fontStyle:0}]);continue}let A,T,D;d&&d!=="tokenType"&&(A=e.tokenizeLine(S,p,c),T=A.tokens,D=0);const M=e.tokenizeLine2(S,p,c),B=M.tokens.length/2;for(let I=0;I<B;I++){const U=M.tokens[2*I],W=I+1<B?M.tokens[2*I+2]:S.length;if(U===W)continue;const Y=M.tokens[2*I+1],oe=vi(r[po.getForeground(Y)],i),ae=po.getFontStyle(Y),V={content:S.substring(U,W),offset:E+U,color:oe,fontStyle:ae};if(d==="tokenType")V.type=po.getTokenType(Y);else if(d){const he=[];if(d!=="scopeName")for(const ge of n.settings){let q;switch(typeof ge.scope){case"string":q=ge.scope.split(cD).map(ie=>ie.trim());break;case"object":q=ge.scope;break;default:continue}he.push({settings:ge,selectors:q.map(ie=>ie.split(uD))})}V.explanation=[];let ve=0;for(;U+ve<W;){const ge=T[D],q=S.substring(ge.startIndex,ge.endIndex);ve+=q.length,V.explanation.push({content:q,scopes:d==="scopeName"?hD(ge.scopes):pD(he,ge.scopes)}),D+=1}}m.push(V)}b.push(m),m=[],p=M.ruleStack}return{tokens:b,stateStack:p}}function hD(t){return t.map(e=>({scopeName:e}))}function pD(t,e){const n=[];for(let r=0,a=e.length;r<a;r++){const i=e[r];n[r]={scopeName:i,themeMatches:gD(t,i,e.slice(0,r))}}return n}function dw(t,e){return t===e||e.substring(0,t.length)===t&&e[t.length]==="."}function mD(t,e,n){if(!dw(t.at(-1),e))return!1;let r=t.length-2,a=n.length-1;for(;r>=0&&a>=0;)dw(t[r],n[a])&&(r-=1),a-=1;return r===-1}function gD(t,e,n){const r=[];for(const{selectors:a,settings:i}of t)for(const l of a)if(mD(l,e,n)){r.push(i);break}return r}function w6(t,e,n,r=x6){const a=Object.entries(n.themes).filter(h=>h[1]).map(h=>({color:h[0],theme:h[1]})),i=a.map(h=>{const p=r(t,e,{...n,theme:h.theme});return{tokens:p,state:hu(p),theme:typeof h.theme=="string"?h.theme:h.theme.name}}),l=yD(...i.map(h=>h.tokens)),c=l[0].map((h,p)=>h.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:E,explanation:A,offset:T,...D}=w[p][b];x.variants[a[S].color]=D}),x})),d=i[0].state?new If(Object.fromEntries(i.map(h=>{var p;return[h.theme,(p=h.state)==null?void 0:p.getInternalStack(h.theme)]})),i[0].state.lang):void 0;return d&&Bf(c,d),c}function yD(...t){const e=t.map(()=>[]),n=t.length;for(let r=0;r<t[0].length;r++){const a=t.map(d=>d[r]),i=e.map(()=>[]);e.forEach((d,h)=>d.push(i[h]));const l=a.map(()=>0),c=a.map(d=>d[0]);for(;c.every(d=>d);){const d=Math.min(...c.map(h=>h.content.length));for(let h=0;h<n;h++){const p=c[h];p.content.length===d?(i[h].push(p),l[h]+=1,c[h]=a[h][l[h]]):(i[h].push({...p,content:p.content.slice(0,d)}),c[h]={...p,content:p.content.slice(d),offset:p.offset+d})}}}return e}const bD=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],fw={}.hasOwnProperty;function vD(t,e){const n=e||{};function r(a,...i){let l=r.invalid;const c=r.handlers;if(a&&fw.call(a,t)){const d=String(a[t]);l=fw.call(c,d)?c[d]:r.unknown}if(l)return l.call(this,a,...i)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const xD=/["&'<>`]/g,wD=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,kD=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,SD=/[|\\{}()[\]^$+*?.]/g,hw=new WeakMap;function _D(t,e){if(t=t.replace(e.subset?CD(e.subset):xD,r),e.subset||e.escapeOnly)return t;return t.replace(wD,n).replace(kD,r);function n(a,i,l){return e.format((a.charCodeAt(0)-55296)*1024+a.charCodeAt(1)-56320+65536,l.charCodeAt(i+2),e)}function r(a,i,l){return e.format(a.charCodeAt(0),l.charCodeAt(i+1),e)}}function CD(t){let e=hw.get(t);return e||(e=ED(t),hw.set(t,e)),e}function ED(t){const e=[];let n=-1;for(;++n<t.length;)e.push(t[n].replace(SD,"\\$&"));return new RegExp("(?:"+e.join("|")+")","g")}const TD=/[\dA-Fa-f]/;function AD(t,e,n){const r="&#x"+t.toString(16).toUpperCase();return n&&e&&!TD.test(String.fromCharCode(e))?r:r+";"}const ND=/\d/;function RD(t,e,n){const r="&#"+String(t);return n&&e&&!ND.test(String.fromCharCode(e))?r:r+";"}const MD=["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"],Om={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:"€"},DD=["cent","copy","divide","gt","lt","not","para","times"],k6={}.hasOwnProperty,n1={};let i0;for(i0 in Om)k6.call(Om,i0)&&(n1[Om[i0]]=i0);const OD=/[^\dA-Za-z]/;function LD(t,e,n,r){const a=String.fromCharCode(t);if(k6.call(n1,a)){const i=n1[a],l="&"+i;return n&&MD.includes(i)&&!DD.includes(i)&&(!r||e&&e!==61&&OD.test(String.fromCharCode(e)))?l:l+";"}return""}function jD(t,e,n){let r=AD(t,e,n.omitOptionalSemicolons),a;if((n.useNamedReferences||n.useShortestReferences)&&(a=LD(t,e,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!a)&&n.useShortestReferences){const i=RD(t,e,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return a&&(!n.useShortestReferences||a.length<r.length)?a:r}function gl(t,e){return _D(t,Object.assign({format:jD},e))}const BD=/^>|^->|<!--|-->|--!>|<!-$/g,ID=[">"],PD=["<",">"];function zD(t,e,n,r){return r.settings.bogusComments?"<?"+gl(t.value,Object.assign({},r.settings.characterReferences,{subset:ID}))+">":"<!--"+t.value.replace(BD,a)+"-->";function a(i){return gl(i,Object.assign({},r.settings.characterReferences,{subset:PD}))}}function $D(t,e,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}function pw(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let r=0,a=n.indexOf(e);for(;a!==-1;)r++,a=n.indexOf(e,a+e.length);return r}const Rn=_6(1),S6=_6(-1),FD=[];function _6(t){return e;function e(n,r,a){const i=n?n.children:FD;let l=(r||0)+t,c=i[l];if(!a)for(;c&&C1(c);)l+=t,c=i[l];return c}}const UD={}.hasOwnProperty;function C6(t){return e;function e(n,r,a){return UD.call(t,n.tagName)&&t[n.tagName](n,r,a)}}const oy=C6({body:GD,caption:Lm,colgroup:Lm,dd:KD,dt:WD,head:Lm,html:HD,li:VD,optgroup:YD,option:ZD,p:qD,rp:mw,rt:mw,tbody:QD,td:gw,tfoot:JD,th:gw,thead:XD,tr:eO});function Lm(t,e,n){const r=Rn(n,e,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&C1(r.value.charAt(0)))}function HD(t,e,n){const r=Rn(n,e);return!r||r.type!=="comment"}function GD(t,e,n){const r=Rn(n,e);return!r||r.type!=="comment"}function qD(t,e,n){const r=Rn(n,e);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.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 VD(t,e,n){const r=Rn(n,e);return!r||r.type==="element"&&r.tagName==="li"}function WD(t,e,n){const r=Rn(n,e);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function KD(t,e,n){const r=Rn(n,e);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function mw(t,e,n){const r=Rn(n,e);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function YD(t,e,n){const r=Rn(n,e);return!r||r.type==="element"&&r.tagName==="optgroup"}function ZD(t,e,n){const r=Rn(n,e);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function XD(t,e,n){const r=Rn(n,e);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function QD(t,e,n){const r=Rn(n,e);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function JD(t,e,n){return!Rn(n,e)}function eO(t,e,n){const r=Rn(n,e);return!r||r.type==="element"&&r.tagName==="tr"}function gw(t,e,n){const r=Rn(n,e);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const tO=C6({body:aO,colgroup:sO,head:rO,html:nO,tbody:iO});function nO(t){const e=Rn(t,-1);return!e||e.type!=="comment"}function rO(t){const e=new Set;for(const r of t.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(e.has(r.tagName))return!1;e.add(r.tagName)}const n=t.children[0];return!n||n.type==="element"}function aO(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 sO(t,e,n){const r=S6(n,e),a=Rn(t,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&oy(r,n.children.indexOf(r),n)?!1:!!(a&&a.type==="element"&&a.tagName==="col")}function iO(t,e,n){const r=S6(n,e),a=Rn(t,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&oy(r,n.children.indexOf(r),n)?!1:!!(a&&a.type==="element"&&a.tagName==="tr")}const o0={name:[[`
297
- \f\r &/=>`.split(""),`
298
- \f\r "&'/=>\``.split("")],[`\0
299
- \f\r "&'/<=>`.split(""),`\0
300
- \f\r "&'/<=>\``.split("")]],unquoted:[[`
301
- \f\r &>`.split(""),`\0
302
- \f\r "&'<=>\``.split("")],[`\0
303
- \f\r "&'<=>\``.split(""),`\0
304
- \f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function oO(t,e,n,r){const a=r.schema,i=a.space==="svg"?!1:r.settings.omitOptionalTags;let l=a.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(t.tagName.toLowerCase());const c=[];let d;a.space==="html"&&t.tagName==="svg"&&(r.schema=_1);const h=lO(r,t.properties),p=r.all(a.space==="html"&&t.tagName==="template"?t.content:t);return r.schema=a,p&&(l=!1),(h||!i||!tO(t,e,n))&&(c.push("<",t.tagName,h?" "+h:""),l&&(a.space==="svg"||r.settings.closeSelfClosing)&&(d=h.charAt(h.length-1),(!r.settings.tightSelfClosing||d==="/"||d&&d!=='"'&&d!=="'")&&c.push(" "),c.push("/")),c.push(">")),c.push(p),!l&&(!i||!oy(t,e,n))&&c.push("</"+t.tagName+">"),c.join("")}function lO(t,e){const n=[];let r=-1,a;if(e){for(a in e)if(e[a]!==null&&e[a]!==void 0){const i=cO(t,a,e[a]);i&&n.push(i)}}for(;++r<n.length;){const i=t.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&i!=='"'&&i!=="'"&&(n[r]+=" ")}return n.join("")}function cO(t,e,n){const r=Q5(t.schema,e),a=t.settings.allowParseErrors&&t.schema.space==="html"?0:1,i=t.settings.allowDangerousCharacters?0:1;let l=t.quote,c;if(r.overloadedBoolean&&(n===r.attribute||n==="")?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!="string"||n===r.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const d=gl(r.attribute,Object.assign({},t.settings.characterReferences,{subset:o0.name[a][i]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?q8:V8)(n,{padLeft:!t.settings.tightCommaSeparatedLists}):String(n),t.settings.collapseEmptyAttributes&&!n)?d:(t.settings.preferUnquoted&&(c=gl(n,Object.assign({},t.settings.characterReferences,{attribute:!0,subset:o0.unquoted[a][i]}))),c!==n&&(t.settings.quoteSmart&&pw(n,l)>pw(n,t.alternative)&&(l=t.alternative),c=l+gl(n,Object.assign({},t.settings.characterReferences,{subset:(l==="'"?o0.single:o0.double)[a][i],attribute:!0}))+l),d+(c&&"="+c))}const uO=["<","&"];function E6(t,e,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?t.value:gl(t.value,Object.assign({},r.settings.characterReferences,{subset:uO}))}function dO(t,e,n,r){return r.settings.allowDangerousHtml?t.value:E6(t,e,n,r)}function fO(t,e,n,r){return r.all(t)}const hO=vD("type",{invalid:pO,unknown:mO,handlers:{comment:zD,doctype:$D,element:oO,raw:dO,root:fO,text:E6}});function pO(t){throw new Error("Expected node, not `"+t+"`")}function mO(t){const e=t;throw new Error("Cannot compile unknown node `"+e.type+"`")}const gO={},yO={},bO=[];function vO(t,e){const n=e||gO,r=n.quote||'"',a=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:xO,all:wO,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||bD,characterReferences:n.characterReferences||yO,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?_1:J5,quote:r,alternative:a}.one(Array.isArray(t)?{type:"root",children:t}:t,void 0,void 0)}function xO(t,e,n){return hO(t,e,n,this)}function wO(t){const e=[],n=t&&t.children||bO;let r=-1;for(;++r<n.length;)e[r]=this.one(n[r],r,t);return e.join("")}const yw=/\s+/g;function T6(t,e){var r;if(!e)return t;t.properties||(t.properties={}),(r=t.properties).class||(r.class=[]),typeof t.properties.class=="string"&&(t.properties.class=t.properties.class.split(yw)),Array.isArray(t.properties.class)||(t.properties.class=[]);const n=Array.isArray(e)?e:e.split(yw);for(const a of n)a&&!t.properties.class.includes(a)&&t.properties.class.push(a);return t}function kO(t){const e=jf(t,!0).map(([a])=>a);function n(a){if(a===t.length)return{line:e.length-1,character:e.at(-1).length};let i=a,l=0;for(const c of e){if(i<c.length)break;i-=c.length,l++}return{line:l,character:i}}function r(a,i){let l=0;for(let c=0;c<a;c++)l+=e[c].length;return l+=i,l}return{lines:e,indexToPos:n,posToIndex:r}}const SO=["color","background-color"];function _O(t,e){let n=0;const r=[];for(const a of e)a>n&&r.push({...t,content:t.content.slice(n,a),offset:t.offset+n}),n=a;return n<t.content.length&&r.push({...t,content:t.content.slice(n),offset:t.offset+n}),r}function CO(t,e){let n=0,r=t.length;for(;n<r;){const a=n+(r-n>>1);t[a]<=e?n=a+1:r=a}return n}function EO(t,e){const n=[...e instanceof Set?e:new Set(e)].sort((r,a)=>r-a);return n.length?t.map(r=>r.flatMap(a=>{const i=a.offset+a.content.length,l=CO(n,a.offset);let c=l;for(;c<n.length&&n[c]<i;)c++;if(l===c)return a;const d=n.slice(l,c);for(let h=0;h<d.length;h++)d[h]-=a.offset;return _O(a,d)})):t}function TO(t,e,n,r,a="css-vars"){const i={content:t.content,explanation:t.explanation,offset:t.offset},l=e.map(p=>rf(t.variants[p])),c=new Set(l.flatMap(p=>Object.keys(p))),d={},h=(p,m)=>{const b=m==="color"?"":m==="background-color"?"-bg":`-${m}`;return n+e[p]+(m==="color"?"":b)};return l.forEach((p,m)=>{for(const b of c){const x=p[b]||"inherit";if(m===0&&r&&SO.includes(b))if(r==="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 Pt('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const E=l[w][b]||"inherit",A=l[S][b]||"inherit";d[b]=`light-dark(${E}, ${A})`,a==="css-vars"&&(d[h(m,b)]=x)}else d[b]=x;else a==="css-vars"&&(d[h(m,b)]=x)}}),i.htmlStyle=d,i}function rf(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 r1(t){return typeof t=="string"?t:Object.entries(t).map(([e,n])=>`${e}:${n}`).join(";")}function AO(){const t=new WeakMap;function e(n){if(!t.has(n.meta)){let a=function(l){if(typeof l=="number"){if(l<0||l>n.source.length)throw new Pt(`Invalid decoration offset: ${l}. Code length: ${n.source.length}`);return{...r.indexToPos(l),offset:l}}else{const c=r.lines[l.line];if(c===void 0)throw new Pt(`Invalid decoration position ${JSON.stringify(l)}. Lines length: ${r.lines.length}`);let d=l.character;if(d<0&&(d=c.length+d),d<0||d>c.length)throw new Pt(`Invalid decoration position ${JSON.stringify(l)}. Line ${l.line} length: ${c.length}`);return{...l,character:d,offset:r.posToIndex(l.line,d)}}};const r=kO(n.source),i=(n.options.decorations||[]).map(l=>({...l,start:a(l.start),end:a(l.end)}));NO(i),t.set(n.meta,{decorations:i,converter:r,source:n.source})}return t.get(n.meta)}return{name:"shiki:decorations",tokens(n){var r;if((r=this.options.decorations)!=null&&r.length)return EO(n,e(this).decorations.flatMap(a=>[a.start.offset,a.end.offset]))},code(n){var p;if(!((p=this.options.decorations)!=null&&p.length))return;const r=e(this),a=[...n.children].filter(m=>m.type==="element"&&m.tagName==="span");if(a.length!==r.converter.lines.length)throw new Pt(`Number of lines in code element (${a.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);function i(m,b,x,w){const S=a[m];let E="",A=-1,T=-1;if(b===0&&(A=0),x===0&&(T=0),x===Number.POSITIVE_INFINITY&&(T=S.children.length),A===-1||T===-1)for(let M=0;M<S.children.length;M++)E+=A6(S.children[M]),A===-1&&E.length===b&&(A=M+1),T===-1&&E.length===x&&(T=M+1);if(A===-1)throw new Pt(`Failed to find start index for decoration ${JSON.stringify(w.start)}`);if(T===-1)throw new Pt(`Failed to find end index for decoration ${JSON.stringify(w.end)}`);const D=S.children.slice(A,T);if(!w.alwaysWrap&&D.length===S.children.length)c(S,w,"line");else if(!w.alwaysWrap&&D.length===1&&D[0].type==="element")c(D[0],w,"token");else{const M={type:"element",tagName:"span",properties:{},children:D};c(M,w,"wrapper"),S.children.splice(A,D.length,M)}}function l(m,b){a[m]=c(a[m],b,"line")}function c(m,b,x){var E;const w=b.properties||{},S=b.transform||(A=>A);return m.tagName=b.tagName||"span",m.properties={...m.properties,...w,class:m.properties.class},(E=b.properties)!=null&&E.class&&T6(m,b.properties.class),m=S(m,x)||m,m}const d=[],h=r.decorations.sort((m,b)=>b.start.offset-m.start.offset||m.end.offset-b.end.offset);for(const m of h){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 NO(t){for(let e=0;e<t.length;e++){const n=t[e];if(n.start.offset>n.end.offset)throw new Pt(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=e+1;r<t.length;r++){const a=t[r],i=n.start.offset<=a.start.offset&&a.start.offset<n.end.offset,l=n.start.offset<a.end.offset&&a.end.offset<=n.end.offset,c=a.start.offset<=n.start.offset&&n.start.offset<a.end.offset,d=a.start.offset<n.end.offset&&n.end.offset<=a.end.offset;if(i||l||c||d){if(i&&l||c&&d||c&&n.start.offset===n.end.offset||l&&a.start.offset===a.end.offset)continue;throw new Pt(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(a.start)} intersect.`)}}}}function A6(t){return t.type==="text"?t.value:t.type==="element"?t.children.map(A6).join(""):""}const RO=[AO()];function af(t){const e=MO(t.transformers||[]);return[...e.pre,...e.normal,...e.post,...RO]}function MO(t){const e=[],n=[],r=[];for(const a of t)switch(a.enforce){case"pre":e.push(a);break;case"post":n.push(a);break;default:r.push(a)}return{pre:e,post:n,normal:r}}var lo=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],jm={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function DO(t,e){const n=t.indexOf("\x1B",e);if(n!==-1&&t[n+1]==="["){const r=t.indexOf("m",n);if(r!==-1)return{sequence:t.substring(n+2,r).split(";"),startPosition:n,position:r+1}}return{position:t.length}}function bw(t){const e=t.shift();if(e==="2"){const n=t.splice(0,3).map(r=>Number.parseInt(r));return n.length!==3||n.some(r=>Number.isNaN(r))?void 0:{type:"rgb",rgb:n}}else if(e==="5"){const n=t.shift();if(n)return{type:"table",index:Number(n)}}}function OO(t){const e=[];for(;t.length>0;){const n=t.shift();if(!n)continue;const r=Number.parseInt(n);if(!Number.isNaN(r))if(r===0)e.push({type:"resetAll"});else if(r<=9)jm[r]&&e.push({type:"setDecoration",value:jm[r]});else if(r<=29){const a=jm[r-20];a&&(e.push({type:"resetDecoration",value:a}),a==="dim"&&e.push({type:"resetDecoration",value:"bold"}))}else if(r<=37)e.push({type:"setForegroundColor",value:{type:"named",name:lo[r-30]}});else if(r===38){const a=bw(t);a&&e.push({type:"setForegroundColor",value:a})}else if(r===39)e.push({type:"resetForegroundColor"});else if(r<=47)e.push({type:"setBackgroundColor",value:{type:"named",name:lo[r-40]}});else if(r===48){const a=bw(t);a&&e.push({type:"setBackgroundColor",value:a})}else r===49?e.push({type:"resetBackgroundColor"}):r===53?e.push({type:"setDecoration",value:"overline"}):r===55?e.push({type:"resetDecoration",value:"overline"}):r>=90&&r<=97?e.push({type:"setForegroundColor",value:{type:"named",name:lo[r-90+8]}}):r>=100&&r<=107&&e.push({type:"setBackgroundColor",value:{type:"named",name:lo[r-100+8]}})}return e}function LO(){let t=null,e=null,n=new Set;return{parse(r){const a=[];let i=0;do{const l=DO(r,i),c=l.sequence?r.substring(i,l.startPosition):r.substring(i);if(c.length>0&&a.push({value:c,foreground:t,background:e,decorations:new Set(n)}),l.sequence){const d=OO(l.sequence);for(const h of d)h.type==="resetAll"?(t=null,e=null,n.clear()):h.type==="resetForegroundColor"?t=null:h.type==="resetBackgroundColor"?e=null:h.type==="resetDecoration"&&n.delete(h.value);for(const h of d)h.type==="setForegroundColor"?t=h.value:h.type==="setBackgroundColor"?e=h.value:h.type==="setDecoration"&&n.add(h.value)}i=l.position}while(i<r.length);return a}}}var jO={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 BO(t=jO){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 r;function a(){if(r)return r;r=[];for(let h=0;h<lo.length;h++)r.push(e(lo[h]));let c=[0,95,135,175,215,255];for(let h=0;h<6;h++)for(let p=0;p<6;p++)for(let m=0;m<6;m++)r.push(n([c[h],c[p],c[m]]));let d=8;for(let h=0;h<24;h++,d+=10)r.push(n([d,d,d]));return r}function i(c){return a()[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 IO=/#([0-9a-f]{3,8})/i,PO=/var\((--[\w-]+-ansi-[\w-]+)\)/,zO={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 $O(t,e,n){const r=nf(t,n),a=jf(e),i=BO(Object.fromEntries(lo.map(c=>{var h;const d=`terminal.ansi${c[0].toUpperCase()}${c.substring(1)}`;return[c,((h=t.colors)==null?void 0:h[d])||zO[c]]}))),l=LO();return a.map(c=>l.parse(c[0]).map(d=>{let h,p;d.decorations.has("reverse")?(h=d.background?i.value(d.background):t.bg,p=d.foreground?i.value(d.foreground):t.fg):(h=d.foreground?i.value(d.foreground):t.fg,p=d.background?i.value(d.background):void 0),h=vi(h,r),p=vi(p,r),d.decorations.has("dim")&&(h=FO(h));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:h,bgColor:p,fontStyle:m}}))}function FO(t){const e=t.match(IO);if(e){const r=e[1];if(r.length===8){const a=Math.round(Number.parseInt(r.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${r.slice(0,6)}${a}`}else{if(r.length===6)return`#${r}80`;if(r.length===4){const a=r[0],i=r[1],l=r[2],c=r[3];return`#${a}${a}${i}${i}${l}${l}${Math.round(Number.parseInt(`${c}${c}`,16)/2).toString(16).padStart(2,"0")}`}else if(r.length===3){const a=r[0],i=r[1],l=r[2];return`#${a}${a}${i}${i}${l}${l}80`}}}const n=t.match(PO);return n?`var(${n[1]}-dim)`:t}function a1(t,e,n={}){const r=t.resolveLangAlias(n.lang||"text"),{theme:a=t.getLoadedThemes()[0]}=n;if(!Of(r)&&!Lf(a)&&r==="ansi"){const{theme:i}=t.setTheme(a);return $O(i,e,n)}return x6(t,e,n)}function sf(t,e,n){let r,a,i,l,c,d;if("themes"in n){const{defaultColor:h="light",cssVariablePrefix:p="--shiki-",colorsRendering:m="css-vars"}=n,b=Object.entries(n.themes).filter(A=>A[1]).map(A=>({color:A[0],theme:A[1]})).sort((A,T)=>A.color===h?-1:T.color===h?1:0);if(b.length===0)throw new Pt("`themes` option must not be empty");const x=w6(t,e,n,a1);if(d=hu(x),h&&h!=="light-dark()"&&!b.some(A=>A.color===h))throw new Pt(`\`themes\` option must contain the defaultColor key \`${h}\``);const w=b.map(A=>t.getTheme(A.theme)),S=b.map(A=>A.color);i=x.map(A=>A.map(T=>TO(T,S,p,h,m))),d&&Bf(i,d);const E=b.map(A=>nf(A.theme,n));a=vw(b,w,E,p,h,"fg",m),r=vw(b,w,E,p,h,"bg",m),l=`shiki-themes ${w.map(A=>A.name).join(" ")}`,c=h?void 0:[a,r].join(";")}else if("theme"in n){const h=nf(n.theme,n);i=a1(t,e,n);const p=t.getTheme(n.theme);r=vi(p.bg,h),a=vi(p.fg,h),l=p.name,d=hu(i)}else throw new Pt("Invalid options, either `theme` or `themes` must be provided");return{tokens:i,fg:a,bg:r,themeName:l,rootStyle:c,grammarState:d}}function vw(t,e,n,r,a,i,l){return t.map((c,d)=>{const h=vi(e[d][i],n[d])||"inherit",p=`${r+c.color}${i==="bg"?"-bg":""}:${h}`;if(d===0&&a){if(a==="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 Pt('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${vi(e[m][i],n[m])||"inherit"}, ${vi(e[b][i],n[b])||"inherit"});${p}`}return h}return l==="css-vars"?p:null}).filter(c=>!!c).join(";")}const N6=/^\s+$/,UO=/^(\s*)(.*?)(\s*)$/;function of(t,e,n,r={meta:{},options:n,codeToHast:(a,i)=>of(t,a,i),codeToTokens:(a,i)=>sf(t,a,i)}){var w,S;let a=e;for(const E of af(n))a=((w=E.preprocess)==null?void 0:w.call(r,a,n))||a;let{tokens:i,fg:l,bg:c,themeName:d,rootStyle:h,grammarState:p}=sf(t,a,n);const{mergeWhitespaces:m=!0,mergeSameStyleTokens:b=!1}=n;m===!0?i=GO(i):m==="never"&&(i=qO(i)),b&&(i=VO(i));const x={...r,get source(){return a}};for(const E of af(n))i=((S=E.tokens)==null?void 0:S.call(x,i))||i;return HO(i,{...n,fg:l,bg:c,themeName:d,rootStyle:n.rootStyle===!1?!1:n.rootStyle??h},x,p)}function HO(t,e,n,r=hu(t)){var S,E,A,T;const a=af(e),i=[],l={type:"root",children:[]},{structure:c="classic",tabindex:d="0"}=e,h={class:`shiki ${e.themeName||""}`};e.rootStyle!==!1&&(e.rootStyle!=null?h.style=e.rootStyle:h.style=`background-color:${e.bg};color:${e.fg}`),d!==!1&&d!=null&&(h.tabindex=d.toString());for(const[D,M]of Object.entries(e.meta||{}))D.startsWith("_")||(h[D]=M);let p={type:"element",tagName:"pre",properties:h,children:[],data:e.data},m={type:"element",tagName:"code",properties:{},children:i};const b=[],x={...n,structure:c,addClassToHast:T6,get source(){return n.source},get tokens(){return t},get options(){return e},get root(){return l},get pre(){return p},get code(){return m},get lines(){return b}};if(t.forEach((D,M)=>{var U,W;M&&(c==="inline"?l.children.push({type:"element",tagName:"br",properties:{},children:[]}):c==="classic"&&i.push({type:"text",value:`
305
- `}));let B={type:"element",tagName:"span",properties:{class:"line"},children:[]},I=0;for(const Y of D){let oe={type:"element",tagName:"span",properties:{...Y.htmlAttrs},children:[{type:"text",value:Y.content}]};const ae=r1(Y.htmlStyle||rf(Y));ae&&(oe.properties.style=ae);for(const V of a)oe=((U=V==null?void 0:V.span)==null?void 0:U.call(x,oe,M+1,I,B,Y))||oe;c==="inline"?l.children.push(oe):c==="classic"&&B.children.push(oe),I+=Y.content.length}if(c==="classic"){for(const Y of a)B=((W=Y==null?void 0:Y.line)==null?void 0:W.call(x,B,M+1))||B;b.push(B),i.push(B)}else c==="inline"&&b.push(B)}),c==="classic"){for(const D of a)m=((S=D==null?void 0:D.code)==null?void 0:S.call(x,m))||m;p.children.push(m);for(const D of a)p=((E=D==null?void 0:D.pre)==null?void 0:E.call(x,p))||p;l.children.push(p)}else if(c==="inline"){const D=[];let M={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const I of l.children)I.type==="element"&&I.tagName==="br"?(D.push(M),M={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(I.type==="element"||I.type==="text")&&M.children.push(I);D.push(M);let B={type:"element",tagName:"code",properties:{},children:D};for(const I of a)B=((A=I==null?void 0:I.code)==null?void 0:A.call(x,B))||B;l.children=[];for(let I=0;I<B.children.length;I++){I>0&&l.children.push({type:"element",tagName:"br",properties:{},children:[]});const U=B.children[I];U.type==="element"&&l.children.push(...U.children)}}let w=l;for(const D of a)w=((T=D==null?void 0:D.root)==null?void 0:T.call(x,w))||w;return r&&Bf(w,r),w}function GO(t){return t.map(e=>{const n=[];let r="",a;return e.forEach((i,l)=>{const c=!(i.fontStyle&&(i.fontStyle&Vn.Underline||i.fontStyle&Vn.Strikethrough));c&&N6.test(i.content)&&e[l+1]?(a===void 0&&(a=i.offset),r+=i.content):r?(c?n.push({...i,offset:a,content:r+i.content}):n.push({content:r,offset:a},i),a=void 0,r=""):n.push(i)}),n})}function qO(t){return t.map(e=>e.flatMap(n=>{if(N6.test(n.content))return n;const r=n.content.match(UO);if(!r)return n;const[,a,i,l]=r;if(!a&&!l)return n;const c=[{...n,offset:n.offset+a.length,content:i}];return a&&c.unshift({content:a,offset:n.offset}),l&&c.push({content:l,offset:n.offset+a.length+i.length}),c}))}function VO(t){return t.map(e=>{const n=[];for(const r of e){if(n.length===0){n.push({...r});continue}const a=n.at(-1),i=r1(a.htmlStyle||rf(a)),l=r1(r.htmlStyle||rf(r)),c=a.fontStyle&&(a.fontStyle&Vn.Underline||a.fontStyle&Vn.Strikethrough),d=r.fontStyle&&(r.fontStyle&Vn.Underline||r.fontStyle&Vn.Strikethrough);!c&&!d&&i===l?a.content+=r.content:n.push({...r})}return n})}const WO=vO;function KO(t,e,n){var i;const r={meta:{},options:n,codeToHast:(l,c)=>of(t,l,c),codeToTokens:(l,c)=>sf(t,l,c)};let a=WO(of(t,e,n,r));for(const l of af(n))a=((i=l.postprocess)==null?void 0:i.call(r,a,n))||a;return a}async function YO(t){const e=await iD(t);return{getLastGrammarState:(...n)=>dD(e,...n),codeToTokensBase:(n,r)=>a1(e,n,r),codeToTokensWithThemes:(n,r)=>w6(e,n,r),codeToTokens:(n,r)=>sf(e,n,r),codeToHast:(n,r)=>of(e,n,r),codeToHtml:(n,r)=>KO(e,n,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...e,getInternalContext:()=>e}}function ZO(t){const e=t.langs,n=t.themes,r=t.engine;async function a(i){function l(m){var b;if(typeof m=="string"){if(m=((b=i.langAlias)==null?void 0:b[m])||m,h6(m))return[];const x=e[m];if(!x)throw new Pt(`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(p6(m))return"none";if(typeof m=="string"){const b=n[m];if(!b)throw new Pt(`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)),h=(i.langs??[]).map(m=>l(m)),p=await YO({engine:i.engine??r(),...i,themes:d,langs:h});return{...p,loadLanguage(...m){return p.loadLanguage(...m.map(l))},loadTheme(...m){return p.loadTheme(...m.map(c))},getBundledLanguages(){return e},getBundledThemes(){return n}}}return a}const R6=ZO({langs:WR,themes:YR,engine:()=>(0,Zk.createOnigurumaEngine)(j(()=>import("./wasm-CG6Dc4jp.js"),[]))}),xw=4294967295;var XO=class{constructor(t,e={}){Z(this,"patterns");Z(this,"options");Z(this,"regexps");this.patterns=t,this.options=e;const{forgiving:n=!1,cache:r,regexConstructor:a}=e;if(!a)throw new Error("Option `regexConstructor` is not provided");this.regexps=t.map(i=>{if(typeof i!="string")return i;const l=r==null?void 0:r.get(i);if(l){if(l instanceof RegExp)return l;if(n)return null;throw l}try{const c=a(i);return r==null||r.set(i,c),c}catch(c){if(r==null||r.set(i,c),n)return null;throw c}})}findNextMatchSync(t,e,n){const r=typeof t=="string"?t:t.content,a=[];function i(l,c,d=0){return{index:l,captureIndices:c.indices.map(h=>h==null?{start:xw,end:xw,length:0}:{start:h[0]+d,end:h[1]+d,length:h[1]-h[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(r);if(!d)continue;if(d.index===e)return i(l,d,0);a.push([l,d,0])}catch(d){if(this.options.forgiving)continue;throw d}}if(a.length){const l=Math.min(...a.map(c=>c[1].index));for(const[c,d,h]of a)if(d.index===l)return i(c,d,h)}return null}};function Ml(t){if([...t].length!==1)throw new Error(`Expected "${t}" to be a single code point`);return t.codePointAt(0)}function QO(t,e,n){return t.has(e)||t.set(e,n),t.get(e)}const ly=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),jn=String.raw;function Dl(t,e){if(t==null)throw new Error(e??"Value expected");return t}const M6=jn`\[\^?`,D6=`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}`}`,cy=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,l0=new RegExp(jn`
306
- \\ (?:
307
- ${D6}
308
- | [gk]<[^>]*>?
309
- | [gk]'[^']*'?
310
- | .
311
- )
312
- | \( (?:
313
- \? (?:
314
- [:=!>({]
315
- | <[=!]
316
- | <[^>]*>
317
- | '[^']*'
318
- | ~\|?
319
- | #(?:[^)\\]|\\.?)*
320
- | [^:)]*[:)]
321
- )?
322
- | \*[^\)]*\)?
323
- )?
324
- | (?:${cy.source})+
325
- | ${M6}
326
- | .
327
- `.replace(/\s+/g,""),"gsu"),Bm=new RegExp(jn`
328
- \\ (?:
329
- ${D6}
330
- | .
331
- )
332
- | \[:(?:\^?\p{Alpha}+|\^):\]
333
- | ${M6}
334
- | &&
335
- | .
336
- `.replace(/\s+/g,""),"gsu");function JO(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 r=bL(n.flags),a=[r.extended],i={captureGroup:n.rules.captureGroup,getCurrentModX(){return a.at(-1)},numOpenGroups:0,popModX(){a.pop()},pushModX(m){a.push(m)},replaceCurrentModX(m){a[a.length-1]=m},singleline:n.rules.singleline};let l=[],c;for(l0.lastIndex=0;c=l0.exec(t);){const m=eL(i,t,c[0],l0.lastIndex);m.tokens?l.push(...m.tokens):m.token&&l.push(m.token),m.lastIndex!==void 0&&(l0.lastIndex=m.lastIndex)}const d=[];let h=0;l.filter(m=>m.type==="GroupOpen").forEach(m=>{m.kind==="capturing"?m.number=++h:m.raw==="("&&d.push(m)}),h||d.forEach((m,b)=>{m.kind="capturing",m.number=b+1});const p=h||d.length;return{tokens:l.map(m=>m.type==="EscapedNumber"?xL(m,p):m).flat(),flags:r}}function eL(t,e,n,r){const[a,i]=n;if(n==="["||n==="[^"){const l=tL(e,n,r);return{tokens:l.tokens,lastIndex:l.lastIndex}}if(a==="\\"){if("AbBGyYzZ".includes(i))return{token:ww(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:dL(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:L6(n)}}if(i==="K")return{token:j6("keep",n)};if(i==="N"||i==="R")return{token:co("newline",n,{negate:i==="N"})};if(i==="O")return{token:co("any",n)};if(i==="X")return{token:co("text_segment",n)};const l=O6(n,{inCharClass:!1});return Array.isArray(l)?{tokens:l}:{token:l}}if(a==="("){if(i==="*")return{token:mL(n)};if(n==="(?{")throw new Error(`Unsupported callout "${n}"`);if(n.startsWith("(?#")){if(e[r]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:r+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:pL(n,t)};if(t.pushModX(t.getCurrentModX()),t.numOpenGroups++,n==="("&&!t.captureGroup||n==="(?:")return{token:ll("group",n)};if(n==="(?>")return{token:ll("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?<!")return{token:ll(n[2]==="<"?"lookbehind":"lookahead",n,{negate:n.endsWith("!")})};if(n==="("&&t.captureGroup||n.startsWith("(?<")&&n.endsWith(">")||n.startsWith("(?'")&&n.endsWith("'"))return{token:ll("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:ll("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:lL(n)}}if(t.getCurrentModX()){if(n==="#"){const l=e.indexOf(`
337
- `,r);return{lastIndex:l===-1?e.length:l}}if(/^\s$/.test(n)){const l=/\s+/y;return l.lastIndex=r,{lastIndex:l.exec(e)?l.lastIndex:r}}}if(n===".")return{token:co("dot",n)};if(n==="^"||n==="$"){const l=t.singleline?{"^":jn`\A`,$:jn`\Z`}[n]:n;return{token:ww(l,n)}}return n==="|"?{token:rL(n)}:cy.test(n)?{tokens:wL(n)}:{token:xs(Ml(n),n)}}function tL(t,e,n){const r=[kw(e[1]==="^",e)];let a=1,i;for(Bm.lastIndex=n;i=Bm.exec(t);){const l=i[0];if(l[0]==="["&&l[1]!==":")a++,r.push(kw(l[1]==="^",l));else if(l==="]"){if(r.at(-1).type==="CharacterClassOpen")r.push(xs(93,l));else if(a--,r.push(aL(l)),!a)break}else{const c=nL(l);Array.isArray(c)?r.push(...c):r.push(c)}}return{tokens:r,lastIndex:Bm.lastIndex||t.length}}function nL(t){if(t[0]==="\\")return O6(t,{inCharClass:!0});if(t[0]==="["){const e=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(t);if(!e||!ly.has(e.groups.name))throw new Error(`Invalid POSIX class "${t}"`);return co("posix",t,{value:e.groups.name,negate:!!e.groups.negate})}return t==="-"?sL(t):t==="&&"?iL(t):xs(Ml(t),t)}function O6(t,{inCharClass:e}){const n=t[1];if(n==="c"||n==="C")return hL(t);if("dDhHsSwW".includes(n))return gL(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 yL(t)}if(new RegExp("^\\\\x[89A-Fa-f]\\p{AHex}","u").test(t))try{const r=t.split(/\\x/).slice(1).map(l=>parseInt(l,16)),a=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(r)),i=new TextEncoder;return[...a].map(l=>{const c=[...i.encode(l)].map(d=>`\\x${d.toString(16)}`).join("");return xs(Ml(l),c)})}catch{throw new Error(`Multibyte code "${t}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return xs(vL(t),t);if(Sw.has(n))return xs(Sw.get(n),t);if(/\d/.test(n))return oL(e,t);if(t==="\\")throw new Error(jn`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${t}"`);if([...t].length===2)return xs(t.codePointAt(1),t);throw new Error(`Unexpected escape "${t}"`)}function rL(t){return{type:"Alternator",raw:t}}function ww(t,e){return{type:"Assertion",kind:t,raw:e}}function L6(t){return{type:"Backreference",raw:t}}function xs(t,e){return{type:"Character",value:t,raw:e}}function aL(t){return{type:"CharacterClassClose",raw:t}}function sL(t){return{type:"CharacterClassHyphen",raw:t}}function iL(t){return{type:"CharacterClassIntersector",raw:t}}function kw(t,e){return{type:"CharacterClassOpen",negate:t,raw:e}}function co(t,e,n={}){return{type:"CharacterSet",kind:t,...n,raw:e}}function j6(t,e,n={}){return t==="keep"?{type:"Directive",kind:t,raw:e}:{type:"Directive",kind:t,flags:Dl(n.flags),raw:e}}function oL(t,e){return{type:"EscapedNumber",inCharClass:t,raw:e}}function lL(t){return{type:"GroupClose",raw:t}}function ll(t,e,n={}){return{type:"GroupOpen",kind:t,...n,raw:e}}function cL(t,e,n,r){return{type:"NamedCallout",kind:t,tag:e,arguments:n,raw:r}}function uL(t,e,n,r){return{type:"Quantifier",kind:t,min:e,max:n,raw:r}}function dL(t){return{type:"Subroutine",raw:t}}const fL=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),Sw=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function hL(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 xs(Ml(e.toUpperCase())-64,t)}function pL(t,e){let{on:n,off:r}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(t).groups;r??(r="");const a=(e.getCurrentModX()||n.includes("x"))&&!r.includes("x"),i=Cw(n),l=Cw(r),c={};if(i&&(c.enable=i),l&&(c.disable=l),t.endsWith(")"))return e.replaceCurrentModX(a),j6("flags",t,{flags:c});if(t.endsWith(":"))return e.pushModX(a),e.numOpenGroups++,ll("group",t,{...(i||l)&&{flags:c}});throw new Error(`Unexpected flag modifier "${t}"`)}function mL(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:r,args:a}=e.groups;if(!n)throw new Error(`Invalid named callout "${t}"`);if(r==="")throw new Error(`Named callout tag with empty value not allowed "${t}"`);const i=a?a.split(",").filter(p=>p!=="").map(p=>/^[+-]?\d+$/.test(p)?+p:p):[],[l,c,d]=i,h=fL.has(n)?n.toLowerCase():"custom";switch(h){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 "${h}"`)}return cL(h,r??null,(a==null?void 0:a.split(","))??null,t)}function _w(t){let e=null,n,r;if(t[0]==="{"){const{minStr:a,maxStr:i}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(t).groups,l=1e5;if(+a>l||i&&+i>l)throw new Error("Quantifier value unsupported in Oniguruma");if(n=+a,r=i===void 0?+a:i===""?1/0:+i,n>r&&(e="possessive",[n,r]=[r,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,r=t[0]==="?"?1:1/0,e=t[1]==="+"?"possessive":t[1]==="?"?"lazy":"greedy";return uL(e,n,r,t)}function gL(t){const e=t[1].toLowerCase();return co({d:"digit",h:"hex",s:"space",w:"word"}[e],t,{negate:t[1]!==e})}function yL(t){const{p:e,neg:n,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(t).groups;return co("property",t,{value:r,negate:e==="P"&&!n||e==="p"&&!!n})}function Cw(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 bL(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 r=t[n];if(!"imxDPSWy".includes(r))throw new Error(`Invalid flag "${r}"`);if(r==="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"}[r]]=!0}return e}function vL(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 xL(t,e){const{raw:n,inCharClass:r}=t,a=n.slice(1);if(!r&&(a!=="0"&&a.length===1||a[0]!=="0"&&+a<=e))return[L6(n)];const i=[],l=a.match(/^[0-7]+|\d/g);for(let c=0;c<l.length;c++){const d=l[c];let h;if(c===0&&d!=="8"&&d!=="9"){if(h=parseInt(d,8),h>127)throw new Error(jn`Octal encoded byte above 177 unsupported "${n}"`)}else h=Ml(d);i.push(xs(h,(c===0?"\\":"")+d))}return i}function wL(t){const e=[],n=new RegExp(cy,"gy");let r;for(;r=n.exec(t);){const a=r[0];if(a[0]==="{"){const i=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(a);if(i){const{min:l,max:c}=i.groups;if(+l>+c&&a.endsWith("?")){n.lastIndex--,e.push(_w(a.slice(0,-1)));continue}}}e.push(_w(a))}return e}function B6(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(r=>e[r]===n[r])}function kL(t){return SL.has(t.type)}const SL=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function I6(t,e={}){const n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...e,rules:{captureGroup:!1,singleline:!1,...e.rules}},r=JO(t,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),a=(b,x)=>{const w=r.tokens[i.nextIndex];switch(i.parent=b,i.nextIndex++,w.type){case"Alternator":return bo();case"Assertion":return _L(w);case"Backreference":return CL(w,i);case"Character":return Pf(w.value,{useLastValid:!!x.isCheckingRangeEnd});case"CharacterClassHyphen":return EL(w,i,x);case"CharacterClassOpen":return TL(w,i,x);case"CharacterSet":return AL(w,i);case"Directive":return LL(w.kind,{flags:w.flags});case"GroupOpen":return NL(w,i,x);case"NamedCallout":return BL(w.kind,w.tag,w.arguments);case"Quantifier":return RL(w,i);case"Subroutine":return ML(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:r.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:a},l=PL(jL(r.flags));let c=l.body[0];for(;i.nextIndex<r.tokens.length;){const b=a(c,{});b.type==="Alternative"?(l.body.push(b),c=b):c.body.push(b)}const{capturingGroups:d,hasNumberedRef:h,namedGroupsByName:p,subroutines:m}=i;if(h&&p.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(p.has(b)){if(p.get(b).length>1)throw new Error(jn`Subroutine uses a duplicate group name "\g<${b}>"`);p.get(b)[0].isSubroutined=!0}else throw new Error(jn`Subroutine uses a group name that's not defined "\g<${b}>"`);return l}function _L({kind:t}){return s1(Dl({"^":"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 CL({raw:t},e){const n=/^\\k[<']/.test(t),r=n?t.slice(3,-1):t.slice(1),a=(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,i1(l?c+1-i:i,{orphan:d})};if(n){const i=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(r);if(i)return a(+i.groups.num,!!i.groups.sign);if(/[-+]/.test(r))throw new Error(`Invalid backref name "${t}"`);if(!e.namedGroupsByName.has(r))throw new Error(`Group name not defined to the left "${t}"`);return i1(r)}return a(+r)}function EL(t,e,n){const{tokens:r,walk:a}=e,i=e.parent,l=i.body.at(-1),c=r[e.nextIndex];if(!n.isCheckingRangeEnd&&l&&l.type!=="CharacterClass"&&l.type!=="CharacterClassRange"&&c&&c.type!=="CharacterClassOpen"&&c.type!=="CharacterClassClose"&&c.type!=="CharacterClassIntersector"){const d=a(i,{...n,isCheckingRangeEnd:!0});if(l.type==="Character"&&d.type==="Character")return i.body.pop(),OL(l,d);throw new Error("Invalid character class range")}return Pf(Ml("-"))}function TL({negate:t},e,n){const{tokens:r,walk:a}=e,i=[A0()],l=r[e.nextIndex];let c=Aw(l);for(;c.type!=="CharacterClassClose";){if(c.type==="CharacterClassIntersector")i.push(A0()),e.nextIndex++;else{const h=i.at(-1);h.body.push(a(h,n))}c=Aw(r[e.nextIndex],l)}const d=A0({negate:t});return i.length===1?d.body=i[0].body:(d.kind="intersection",d.body=i.map(h=>h.body.length===1?h.body[0]:h)),e.nextIndex++,d}function AL({kind:t,negate:e,value:n},r){const{normalizeUnknownPropertyNames:a,skipPropertyNameValidation:i,unicodePropertyMap:l}=r;if(t==="property"){const c=zf(n);if(ly.has(c)&&!(l!=null&&l.has(c)))t="posix",n=c;else return cl(n,{negate:e,normalizeUnknownPropertyNames:a,skipPropertyNameValidation:i,unicodePropertyMap:l})}return t==="posix"?IL(n,{negate:e}):o1(t,{negate:e})}function NL(t,e,n){const{tokens:r,capturingGroups:a,namedGroupsByName:i,skipLookbehindValidation:l,walk:c}=e,d=zL(t),h=d.type==="AbsenceFunction",p=Tw(d),m=p&&d.negate;if(d.type==="CapturingGroup"&&(a.push(d),d.name&&QO(i,d.name,[]).push(d)),h&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let b=Nw(r[e.nextIndex]);for(;b.type!=="GroupClose";){if(b.type==="Alternator")d.body.push(bo()),e.nextIndex++;else{const x=d.body.at(-1),w=c(x,{...n,isInAbsenceFunction:n.isInAbsenceFunction||h,isInLookbehind:n.isInLookbehind||p,isInNegLookbehind:n.isInNegLookbehind||m});if(x.body.push(w),(p||n.isInLookbehind)&&!l){const S="Lookbehind includes a pattern not allowed by Oniguruma";if(m||n.isInNegLookbehind){if(Ew(w)||w.type==="CapturingGroup")throw new Error(S)}else if(Ew(w)||Tw(w)&&w.negate)throw new Error(S)}}b=Nw(r[e.nextIndex])}return e.nextIndex++,d}function RL({kind:t,min:e,max:n},r){const a=r.parent,i=a.body.at(-1);if(!i||!kL(i))throw new Error("Quantifier requires a repeatable token");const l=z6(t,e,n,i);return a.body.pop(),l}function ML({raw:t},e){const{capturingGroups:n,subroutines:r}=e;let a=t.slice(3,-1);const i=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(a);if(i){const c=+i.groups.num,d=n.length;if(e.hasNumberedRef=!0,a={"":c,"+":d+c,"-":d+1-c}[i.groups.sign],a<1)throw new Error("Invalid subroutine number")}else a==="0"&&(a=0);const l=$6(a);return r.push(l),l}function DL(t,e){return{type:"AbsenceFunction",kind:t,body:Cu(e==null?void 0:e.body)}}function bo(t){return{type:"Alternative",body:F6(t==null?void 0:t.body)}}function s1(t,e){const n={type:"Assertion",kind:t};return(t==="word_boundary"||t==="text_segment_boundary")&&(n.negate=!!(e!=null&&e.negate)),n}function i1(t,e){const n=!!(e!=null&&e.orphan);return{type:"Backreference",ref:t,...n&&{orphan:n}}}function P6(t,e){const n={name:void 0,isSubroutined:!1,...e};if(n.name!==void 0&&!$L(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:Cu(e==null?void 0:e.body)}}function Pf(t,e){const n={useLastValid:!1,...e};if(t>1114111){const r=t.toString(16);if(n.useLastValid)t=1114111;else throw t>1310719?new Error(`Invalid code point out of range "\\x{${r}}"`):new Error(`Invalid code point out of range in JS "\\x{${r}}"`)}return{type:"Character",value:t}}function A0(t){const e={kind:"union",negate:!1,...t};return{type:"CharacterClass",kind:e.kind,negate:e.negate,body:F6(t==null?void 0:t.body)}}function OL(t,e){if(e.value<t.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:t,max:e}}function o1(t,e){const n=!!(e!=null&&e.negate),r={type:"CharacterSet",kind:t};return(t==="digit"||t==="hex"||t==="newline"||t==="space"||t==="word")&&(r.negate=n),(t==="text_segment"||t==="newline"&&!n)&&(r.variableLength=!0),r}function LL(t,e={}){if(t==="keep")return{type:"Directive",kind:t};if(t==="flags")return{type:"Directive",kind:t,flags:Dl(e.flags)};throw new Error(`Unexpected directive kind "${t}"`)}function jL(t){return{type:"Flags",...t}}function ha(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:Cu(t==null?void 0:t.body)}}function io(t){const e={behind:!1,negate:!1,...t};return{type:"LookaroundAssertion",kind:e.behind?"lookbehind":"lookahead",negate:e.negate,body:Cu(t==null?void 0:t.body)}}function BL(t,e,n){return{type:"NamedCallout",kind:t,tag:e,arguments:n}}function IL(t,e){const n=!!(e!=null&&e.negate);if(!ly.has(t))throw new Error(`Invalid POSIX class "${t}"`);return{type:"CharacterSet",kind:"posix",value:t,negate:n}}function z6(t,e,n,r){if(e>n)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:t,min:e,max:n,body:r}}function PL(t,e){return{type:"Regex",body:Cu(e==null?void 0:e.body),flags:t}}function $6(t){return{type:"Subroutine",ref:t}}function cl(t,e){var a;const n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...e};let r=(a=n.unicodePropertyMap)==null?void 0:a.get(zf(t));if(!r){if(n.normalizeUnknownPropertyNames)r=FL(t);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(jn`Invalid Unicode property "\p{${t}}"`)}return{type:"CharacterSet",kind:"property",value:r??t,negate:n.negate}}function zL({flags:t,kind:e,name:n,negate:r,number:a}){switch(e){case"absence_repeater":return DL("repeater");case"atomic":return ha({atomic:!0});case"capturing":return P6(a,{name:n});case"group":return ha({flags:t});case"lookahead":case"lookbehind":return io({behind:e==="lookbehind",negate:r});default:throw new Error(`Unexpected group kind "${e}"`)}}function Cu(t){if(t===void 0)t=[bo()];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 F6(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 Ew(t){return t.type==="LookaroundAssertion"&&t.kind==="lookahead"}function Tw(t){return t.type==="LookaroundAssertion"&&t.kind==="lookbehind"}function $L(t){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(t)}function FL(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 zf(t){return t.replace(/[- _]+/g,"").toLowerCase()}function Aw(t,e){const n=e;return Dl(t,`Unclosed character class${(n==null?void 0:n.type)==="Character"&&n.value===93&&n.raw==="]"?' (started with "]")':""}`)}function Nw(t){return Dl(t,"Unclosed group")}function Xc(t,e,n=null){function r(i,l){for(let c=0;c<i.length;c++){const d=a(i[c],l,c,i);c=Math.max(-1,c+d)}}function a(i,l=null,c=null,d=null){var A,T;let h=0,p=!1;const m={node:i,parent:l,key:c,container:d,root:t,remove(){c0(d).splice(Math.max(0,rl(c)+h),1),h--,p=!0},removeAllNextSiblings(){return c0(d).splice(rl(c)+1)},removeAllPrevSiblings(){const D=rl(c)+h;return h-=D,c0(d).splice(0,Math.max(0,D))},replaceWith(D,M={}){const B=!!M.traverse;d?d[Math.max(0,rl(c)+h)]=D:Dl(l,"Can't replace root node")[c]=D,B&&a(D,l,c,d),p=!0},replaceWithMultiple(D,M={}){const B=!!M.traverse;if(c0(d).splice(Math.max(0,rl(c)+h),1,...D),h+=D.length-1,B){let I=0;for(let U=0;U<D.length;U++)I+=a(D[U],l,rl(c)+U+I,d)}p=!0},skip(){p=!0}},{type:b}=i,x=e["*"],w=e[b],S=typeof x=="function"?x:x==null?void 0:x.enter,E=typeof w=="function"?w:w==null?void 0:w.enter;if(S==null||S(m,n),E==null||E(m,n),!p)switch(b){case"AbsenceFunction":case"Alternative":case"CapturingGroup":case"CharacterClass":case"Group":case"LookaroundAssertion":r(i.body,i);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":a(i.min,i,"min"),a(i.max,i,"max");break;case"Quantifier":a(i.body,i,"body");break;case"Regex":r(i.body,i),a(i.flags,i,"flags");break;default:throw new Error(`Unexpected node type "${b}"`)}return(A=w==null?void 0:w.exit)==null||A.call(w,m,n),(T=x==null?void 0:x.exit)==null||T.call(x,m,n),h}return a(t),t}function c0(t){if(!Array.isArray(t))throw new Error("Container expected");return t}function rl(t){if(typeof t!="number")throw new Error("Numeric key expected");return t}const UL=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function HL(t,e){for(let n=0;n<t.length;n++)t[n]>=e&&t[n]++}function GL(t,e,n,r){return t.slice(0,e)+r+t.slice(e+n.length)}const ea=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function uy(t,e,n,r){const a=new RegExp(String.raw`${e}|(?<$skip>\[\^?|\\?.)`,"gsu"),i=[!1];let l=0,c="";for(const d of t.matchAll(a)){const{0:h,groups:{$skip:p}}=d;if(!p&&(!r||r===ea.DEFAULT==!l)){n instanceof Function?c+=n(d,{context:l?ea.CHAR_CLASS:ea.DEFAULT,negated:i[i.length-1]}):c+=n;continue}h[0]==="["?(l++,i.push(h[1]==="^")):h==="]"&&l&&(l--,i.pop()),c+=h}return c}function U6(t,e,n,r){uy(t,e,n,r)}function qL(t,e,n=0,r){if(!new RegExp(e,"su").test(t))return null;const a=new RegExp(`${e}|(?<$skip>\\\\?.)`,"gsu");a.lastIndex=n;let i=0,l;for(;l=a.exec(t);){const{0:c,groups:{$skip:d}}=l;if(!d&&(!r||r===ea.DEFAULT==!i))return l;c==="["?i++:c==="]"&&i&&i--,a.lastIndex==l.index&&a.lastIndex++}return null}function u0(t,e,n){return!!qL(t,e,0,n)}function VL(t,e){const n=/\\?./gsu;n.lastIndex=e;let r=t.length,a=0,i=1,l;for(;l=n.exec(t);){const[c]=l;if(c==="[")a++;else if(a)c==="]"&&a--;else if(c==="(")i++;else if(c===")"&&(i--,!i)){r=l.index;break}}return t.slice(e,r)}const Rw=new RegExp(String.raw`(?<noncapturingStart>${UL})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function WL(t,e){const n=(e==null?void 0:e.hiddenCaptures)??[];let r=(e==null?void 0:e.captureTransfers)??new Map;if(!/\(\?>/.test(t))return{pattern:t,captureTransfers:r,hiddenCaptures:n};const a="(?>",i="(?:(?=(",l=[0],c=[];let d=0,h=0,p=NaN,m;do{m=!1;let b=0,x=0,w=!1,S;for(Rw.lastIndex=Number.isNaN(p)?0:p+i.length;S=Rw.exec(t);){const{0:E,index:A,groups:{capturingStart:T,noncapturingStart:D}}=S;if(E==="[")b++;else if(b)E==="]"&&b--;else if(E===a&&!w)p=A,w=!0;else if(w&&D)x++;else if(T)w?x++:(d++,l.push(d+h));else if(E===")"&&w){if(!x){h++;const M=d+h;if(t=`${t.slice(0,p)}${i}${t.slice(p+a.length,A)}))<$$${M}>)${t.slice(A+1)}`,m=!0,c.push(M),HL(n,M),r.size){const B=new Map;r.forEach((I,U)=>{B.set(U>=M?U+1:U,I.map(W=>W>=M?W+1:W))}),r=B}break}x--}}}while(m);return n.push(...c),t=uy(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}`},ea.DEFAULT),{pattern:t,captureTransfers:r,hiddenCaptures:n}}const H6=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,Im=new RegExp(String.raw`
338
- \\(?: \d+
339
- | c[A-Za-z]
340
- | [gk]<[^>]+>
341
- | [pPu]\{[^\}]+\}
342
- | u[A-Fa-f\d]{4}
343
- | x[A-Fa-f\d]{2}
344
- )
345
- | \((?: \? (?: [:=!>]
346
- | <(?:[=!]|[^>]+>)
347
- | [A-Za-z\-]+:
348
- | \(DEFINE\)
349
- ))?
350
- | (?<qBase>${H6})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
351
- | \\?.
352
- `.replace(/\s+/g,""),"gsu");function KL(t){if(!new RegExp(`${H6}\\+`).test(t))return{pattern:t};const e=[];let n=null,r=null,a="",i=0,l;for(Im.lastIndex=0;l=Im.exec(t);){const{0:c,index:d,groups:{qBase:h,qMod:p,invalidQ:m}}=l;if(c==="[")i||(r=d),i++;else if(c==="]")i?i--:r=null;else if(!i)if(p==="+"&&a&&!a.startsWith("(")){if(m)throw new Error(`Invalid quantifier "${c}"`);let b=-1;if(/^\{\d+\}$/.test(h))t=GL(t,d+h.length,p,"");else{if(a===")"||a==="]"){const x=a===")"?n:r;if(x===null)throw new Error(`Invalid unmatched "${a}"`);t=`${t.slice(0,x)}(?>${t.slice(x,d)}${h})${t.slice(d+c.length)}`}else t=`${t.slice(0,d-a.length)}(?>${a}${h})${t.slice(d+c.length)}`;b+=4}Im.lastIndex+=b}else c[0]==="("?e.push(d):c===")"&&(n=e.length?e.pop():null);a=c}return{pattern:t}}const Qr=String.raw,YL=Qr`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,l1=Qr`\(\?R=(?<rDepth>[^\)]+)\)|${YL}`,$f=Qr`\(\?<(?![=!])(?<captureName>[^>]+)>`,G6=Qr`${$f}|(?<unnamed>\()(?!\?)`,eo=new RegExp(Qr`${$f}|${l1}|\(\?|\\?.`,"gsu"),Pm="Cannot use multiple overlapping recursions";function ZL(t,e){const{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:"plugin",...e};let a=(e==null?void 0:e.captureTransfers)??new Map;if(!new RegExp(l1,"su").test(t))return{pattern:t,captureTransfers:a,hiddenCaptures:n};if(r==="plugin"&&u0(t,Qr`\(\?\(DEFINE\)`,ea.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const i=[],l=u0(t,Qr`\\[1-9]`,ea.DEFAULT),c=new Map,d=[];let h=!1,p=0,m=0,b;for(eo.lastIndex=0;b=eo.exec(t);){const{0:x,groups:{captureName:w,rDepth:S,gRNameOrNum:E,gRDepth:A}}=b;if(x==="[")p++;else if(p)x==="]"&&p--;else if(S){if(Mw(S),h)throw new Error(Pm);if(l)throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const T=t.slice(0,b.index),D=t.slice(eo.lastIndex);if(u0(D,l1,ea.DEFAULT))throw new Error(Pm);const M=+S-1;t=Dw(T,D,M,!1,n,i,m),a=Lw(a,T,M,i.length,0,m);break}else if(E){Mw(A);let T=!1;for(const V of d)if(V.name===E||V.num===+E){if(T=!0,V.hasRecursedWithin)throw new Error(Pm);break}if(!T)throw new Error(Qr`Recursive \g cannot be used outside the referenced group "${r==="external"?E:Qr`\g<${E}&R=${A}>`}"`);const D=c.get(E),M=VL(t,D);if(l&&u0(M,Qr`${$f}|\((?!\?)`,ea.DEFAULT))throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const B=t.slice(D,b.index),I=M.slice(B.length+x.length),U=i.length,W=+A-1,Y=Dw(B,I,W,!0,n,i,m);a=Lw(a,B,W,i.length-U,U,m);const oe=t.slice(0,D),ae=t.slice(D+M.length);t=`${oe}${Y}${ae}`,eo.lastIndex+=Y.length-x.length-B.length-I.length,d.forEach(V=>V.hasRecursedWithin=!0),h=!0}else if(w)m++,c.set(String(m),eo.lastIndex),c.set(w,eo.lastIndex),d.push({num:m,name:w});else if(x[0]==="("){const T=x==="(";T&&(m++,c.set(String(m),eo.lastIndex)),d.push(T?{num:m}:{})}else x===")"&&d.pop()}return n.push(...i),{pattern:t,captureTransfers:a,hiddenCaptures:n}}function Mw(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 Dw(t,e,n,r,a,i,l){const c=new Set;r&&U6(t+e,$f,({groups:{captureName:h}})=>{c.add(h)},ea.DEFAULT);const d=[n,r?c:null,a,i,l];return`${t}${Ow(`(?:${t}`,"forward",...d)}(?:)${Ow(`${e})`,"backward",...d)}${e}`}function Ow(t,e,n,r,a,i,l){const d=p=>e==="forward"?p+2:n-p+2-1;let h="";for(let p=0;p<n;p++){const m=d(p);h+=uy(t,Qr`${G6}|\\k<(?<backref>[^>]+)>`,({0:b,groups:{captureName:x,unnamed:w,backref:S}})=>{if(S&&r&&!r.has(S))return b;const E=`_$${m}`;if(w||x){const A=l+i.length+1;return i.push(A),XL(a,A),w?b:`(?<${x}${E}>`}return Qr`\k<${S}${E}>`},ea.DEFAULT)}return h}function XL(t,e){for(let n=0;n<t.length;n++)t[n]>=e&&t[n]++}function Lw(t,e,n,r,a,i){if(t.size&&r){let l=0;U6(e,G6,()=>l++,ea.DEFAULT);const c=i-l+a,d=new Map;return t.forEach((h,p)=>{const m=(r-l*n)/n,b=l*n,x=p>c+l?p+r:p,w=[];for(const S of h)if(S<=c)w.push(S);else if(S>c+l+m)w.push(S+r);else if(S<=c+l)for(let E=0;E<=n;E++)w.push(S+l*E);else for(let E=0;E<=n;E++)w.push(S+b+m*E);d.set(x,w)}),d}return t}var An=String.fromCodePoint,Je=String.raw,ma={},Ff=globalThis.RegExp;ma.flagGroups=(()=>{try{new Ff("(?i:)")}catch{return!1}return!0})();ma.unicodeSets=(()=>{try{new Ff("[[]]","v")}catch{return!1}return!0})();ma.bugFlagVLiteralHyphenIsRange=ma.unicodeSets?(()=>{try{new Ff(Je`[\d\-a]`,"v")}catch{return!0}return!1})():!1;ma.bugNestedClassIgnoresNegation=ma.unicodeSets&&new Ff("[[^a]]","v").test("a");function lf(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 pu(t,e,n){return t.has(e)||t.set(e,n),t.get(e)}function c1(t,e){return jw[t]>=jw[e]}function QL(t,e){if(t==null)throw new Error(e??"Value expected");return t}var jw={ES2025:2025,ES2024:2024,ES2018:2018},JL={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function q6(t={}){if({}.toString.call(t)!=="[object Object]")throw new Error("Unexpected options");if(t.target!==void 0&&!JL[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=ma.flagGroups?"ES2025":ma.unicodeSets?"ES2024":"ES2018"),e}var ej="[ -\r ]",tj=new Set([An(304),An(305)]),us=Je`[\p{L}\p{M}\p{N}\p{Pc}]`;function V6(t){if(tj.has(t))return[t];const e=new Set,n=t.toLowerCase(),r=n.toUpperCase(),a=aj.get(n),i=nj.get(n),l=rj.get(n);return[...r].length===1&&e.add(r),l&&e.add(l),a&&e.add(a),e.add(n),i&&e.add(i),[...e]}var dy=new Map(`C Other
353
- Cc Control cntrl
354
- Cf Format
355
- Cn Unassigned
356
- Co Private_Use
357
- Cs Surrogate
358
- L Letter
359
- LC Cased_Letter
360
- Ll Lowercase_Letter
361
- Lm Modifier_Letter
362
- Lo Other_Letter
363
- Lt Titlecase_Letter
364
- Lu Uppercase_Letter
365
- M Mark Combining_Mark
366
- Mc Spacing_Mark
367
- Me Enclosing_Mark
368
- Mn Nonspacing_Mark
369
- N Number
370
- Nd Decimal_Number digit
371
- Nl Letter_Number
372
- No Other_Number
373
- P Punctuation punct
374
- Pc Connector_Punctuation
375
- Pd Dash_Punctuation
376
- Pe Close_Punctuation
377
- Pf Final_Punctuation
378
- Pi Initial_Punctuation
379
- Po Other_Punctuation
380
- Ps Open_Punctuation
381
- S Symbol
382
- Sc Currency_Symbol
383
- Sk Modifier_Symbol
384
- Sm Math_Symbol
385
- So Other_Symbol
386
- Z Separator
387
- Zl Line_Separator
388
- Zp Paragraph_Separator
389
- Zs Space_Separator
390
- ASCII
391
- ASCII_Hex_Digit AHex
392
- Alphabetic Alpha
393
- Any
394
- Assigned
395
- Bidi_Control Bidi_C
396
- Bidi_Mirrored Bidi_M
397
- Case_Ignorable CI
398
- Cased
399
- Changes_When_Casefolded CWCF
400
- Changes_When_Casemapped CWCM
401
- Changes_When_Lowercased CWL
402
- Changes_When_NFKC_Casefolded CWKCF
403
- Changes_When_Titlecased CWT
404
- Changes_When_Uppercased CWU
405
- Dash
406
- Default_Ignorable_Code_Point DI
407
- Deprecated Dep
408
- Diacritic Dia
409
- Emoji
410
- Emoji_Component EComp
411
- Emoji_Modifier EMod
412
- Emoji_Modifier_Base EBase
413
- Emoji_Presentation EPres
414
- Extended_Pictographic ExtPict
415
- Extender Ext
416
- Grapheme_Base Gr_Base
417
- Grapheme_Extend Gr_Ext
418
- Hex_Digit Hex
419
- IDS_Binary_Operator IDSB
420
- IDS_Trinary_Operator IDST
421
- ID_Continue IDC
422
- ID_Start IDS
423
- Ideographic Ideo
424
- Join_Control Join_C
425
- Logical_Order_Exception LOE
426
- Lowercase Lower
427
- Math
428
- Noncharacter_Code_Point NChar
429
- Pattern_Syntax Pat_Syn
430
- Pattern_White_Space Pat_WS
431
- Quotation_Mark QMark
432
- Radical
433
- Regional_Indicator RI
434
- Sentence_Terminal STerm
435
- Soft_Dotted SD
436
- Terminal_Punctuation Term
437
- Unified_Ideograph UIdeo
438
- Uppercase Upper
439
- Variation_Selector VS
440
- White_Space space
441
- XID_Continue XIDC
442
- XID_Start XIDS`.split(/\s/).map(t=>[zf(t),t])),nj=new Map([["s",An(383)],[An(383),"s"]]),rj=new Map([[An(223),An(7838)],[An(107),An(8490)],[An(229),An(8491)],[An(969),An(8486)]]),aj=new Map([ui(453),ui(456),ui(459),ui(498),...zm(8072,8079),...zm(8088,8095),...zm(8104,8111),ui(8124),ui(8140),ui(8188)]),sj=new Map([["alnum",Je`[\p{Alpha}\p{Nd}]`],["alpha",Je`\p{Alpha}`],["ascii",Je`\p{ASCII}`],["blank",Je`[\p{Zs}\t]`],["cntrl",Je`\p{Cc}`],["digit",Je`\p{Nd}`],["graph",Je`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",Je`\p{Lower}`],["print",Je`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",Je`[\p{P}\p{S}]`],["space",Je`\p{space}`],["upper",Je`\p{Upper}`],["word",Je`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",Je`\p{AHex}`]]);function ij(t,e){const n=[];for(let r=t;r<=e;r++)n.push(r);return n}function ui(t){const e=An(t);return[e.toLowerCase(),e]}function zm(t,e){return ij(t,e).map(n=>ui(n))}var W6=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function oj(t,e){const n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...e};K6(t);const r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:c1(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};Xc(t,lj,r);const a={dotAll:t.flags.dotAll,ignoreCase:t.flags.ignoreCase},i={currentFlags:a,prevFlags:null,globalFlags:a,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};Xc(t,cj,i);const l={groupsByName:i.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:i.reffedNodesByReferencer};return Xc(t,uj,l),t._originMap=i.groupOriginByCopy,t._strategy=r.strategy,t}var lj={AbsenceFunction({node:t,parent:e,replaceWith:n}){const{body:r,kind:a}=t;if(a==="repeater"){const i=ha();i.body[0].body.push(io({negate:!0,body:r}),cl("Any"));const l=ha();l.body[0].body.push(z6("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:r}){const a=t.body.filter(i=>i.kind==="flags");for(let i=n+1;i<e.body.length;i++){const l=e.body[i];pu(r,l,[]).push(...a)}},exit({node:t},{flagDirectivesByAlt:e}){var n;if((n=e.get(t))!=null&&n.length){const r=Z6(e.get(t));if(r){const a=ha({flags:r});a.body[0].body=t.body,t.body=[ln(a,t)]}}}},Assertion({node:t,parent:e,key:n,container:r,root:a,remove:i,replaceWith:l},c){const{kind:d,negate:h}=t,{asciiWordBoundaries:p,avoidSubclass:m,supportedGNodes:b,wordIsAscii:x}=c;if(d==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${h?"Y":"y"}"`);if(d==="line_end")l(ln(io({body:[bo({body:[s1("string_end")]}),bo({body:[Pf(10)]})]}),e));else if(d==="line_start")l(ln(ds(Je`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),e));else if(d==="search_start")if(b.has(t))a.flags.sticky=!0,i();else{const w=r[n-1];if(w&&gj(w))l(ln(io({negate:!0}),e));else{if(m)throw new Error(Je`Uses "\G" in a way that requires a subclass`);l(di(s1("string_start"),e)),c.strategy="clip_search"}}else if(!(d==="string_end"||d==="string_start"))if(d==="string_end_newline")l(ln(ds(Je`(?=\n?\z)`),e));else if(d==="word_boundary"){if(!x&&!p){const w=`(?:(?<=${us})(?!${us})|(?<!${us})(?=${us}))`,S=`(?:(?<=${us})(?=${us})|(?<!${us})(?!${us}))`;l(ln(ds(h?S:w),e))}}else throw new Error(`Unexpected assertion kind "${d}"`)},Backreference({node:t},{jsGroupNameMap:e}){let{ref:n}=t;typeof n=="string"&&!Fm(n)&&(n=$m(n,e),t.ref=n)},CapturingGroup({node:t},{jsGroupNameMap:e,subroutineRefMap:n}){let{name:r}=t;r&&!Fm(r)&&(r=$m(r,e),t.name=r),n.set(t.number,t),r&&n.set(r,t)},CharacterClassRange({node:t,parent:e,replaceWith:n}){if(e.kind==="intersection"){const r=A0({body:[t]});n(ln(r,e),{traverse:!0})}},CharacterSet({node:t,parent:e,replaceWith:n},{accuracy:r,minTargetEs2024:a,digitIsAscii:i,spaceIsAscii:l,wordIsAscii:c}){const{kind:d,negate:h,value:p}=t;if(i&&(d==="digit"||p==="digit")){n(di(o1("digit",{negate:h}),e));return}if(l&&(d==="space"||p==="space")){n(ln(Um(ds(ej),h),e));return}if(c&&(d==="word"||p==="word")){n(di(o1("word",{negate:h}),e));return}if(d==="any")n(di(cl("Any"),e));else if(d==="digit")n(di(cl("Nd",{negate:h}),e));else if(d!=="dot")if(d==="text_segment"){if(r==="strict")throw new Error(Je`Use of "\X" requires non-strict accuracy`);const m="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",b=Je`\p{RI}{2}|${m}(?:\u200D${m})*`;n(ln(ds(Je`(?>\r\n|${a?Je`\p{RGI_Emoji}`:b}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),e))}else if(d==="hex")n(di(cl("AHex",{negate:h}),e));else if(d==="newline")n(ln(ds(h?`[^
443
- ]`:`(?>\r
444
- ?|[
445
- \v\f…\u2028\u2029])`),e));else if(d==="posix")if(!a&&(p==="graph"||p==="print")){if(r==="strict")throw new Error(`POSIX class "${p}" requires min target ES2024 or non-strict accuracy`);let m={graph:"!-~",print:" -~"}[p];h&&(m=`\0-${An(m.codePointAt(0)-1)}${An(m.codePointAt(2)+1)}-􏿿`),n(ln(ds(`[${m}]`),e))}else n(ln(Um(ds(sj.get(p)),h),e));else if(d==="property")dy.has(zf(p))||(t.key="sc");else if(d==="space")n(di(cl("space",{negate:h}),e));else if(d==="word")n(ln(Um(ds(us),h),e));else throw new Error(`Unexpected character set kind "${d}"`)},Directive({node:t,parent:e,root:n,remove:r,replaceWith:a,removeAllPrevSiblings:i,removeAllNextSiblings:l}){const{kind:c,flags:d}=t;if(c==="flags")if(!d.enable&&!d.disable)r();else{const h=ha({flags:d});h.body[0].body=l(),a(ln(h,e),{traverse:!0})}else if(c==="keep"){const h=n.body[0],m=n.body.length===1&&B6(h,{type:"Group"})&&h.body[0].body.length===1?h.body[0]:n;if(e.parent!==m||m.body.length>1)throw new Error(Je`Uses "\K" in a way that's unsupported`);const b=io({behind:!0});b.body[0].body=i(),a(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:r}=t;if(r==="fail")n(ln(io({negate:!0}),e));else throw new Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:t}){if(t.body.type==="Quantifier"){const e=ha();e.body[0].body.push(t.body),t.body=ln(e,t)}},Regex:{enter({node:t},{supportedGNodes:e}){const n=[];let r=!1,a=!1;for(const i of t.body)if(i.body.length===1&&i.body[0].kind==="search_start")i.body.pop();else{const l=Q6(i.body);l?(r=!0,Array.isArray(l)?n.push(...l):n.push(l)):a=!0}r&&!a&&n.forEach(i=>e.add(i))},exit(t,{accuracy:e,passedLookbehind:n,strategy:r}){if(e==="strict"&&n&&r)throw new Error(Je`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:t},{jsGroupNameMap:e}){let{ref:n}=t;typeof n=="string"&&!Fm(n)&&(n=$m(n,e),t.ref=n)}},cj={Backreference({node:t},{multiplexCapturesToLeftByRef:e,reffedNodesByReferencer:n}){const{orphan:r,ref:a}=t;r||n.set(t,[...e.get(a).map(({node:i})=>i)])},CapturingGroup:{enter({node:t,parent:e,replaceWith:n,skip:r},{groupOriginByCopy:a,groupsByName:i,multiplexCapturesToLeftByRef:l,openRefs:c,reffedNodesByReferencer:d}){const h=a.get(t);if(h&&c.has(t.number)){const m=di(Bw(t.number),e);d.set(m,c.get(t.number)),n(m);return}c.set(t.number,t),l.set(t.number,[]),t.name&&pu(l,t.name,[]);const p=l.get(t.name??t.number);for(let m=0;m<p.length;m++){const b=p[m];if(h===b.node||h&&h===b.origin||t===b.origin){p.splice(m,1);break}}if(l.get(t.number).push({node:t,origin:h}),t.name&&l.get(t.name).push({node:t,origin:h}),t.name){const m=pu(i,t.name,new Map);let b=!1;if(h)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=lf(e.currentFlags,t.flags))},exit(t,e){e.currentFlags=e.prevFlags}},Subroutine({node:t,parent:e,replaceWith:n},r){const{isRecursive:a,ref:i}=t;if(a){let p=e;for(;(p=p.parent)&&!(p.type==="CapturingGroup"&&(p.name===i||p.number===i)););r.reffedNodesByReferencer.set(t,p);return}const l=r.subroutineRefMap.get(i),c=i===0,d=c?Bw(0):Y6(l,r.groupOriginByCopy,null);let h=d;if(!c){const p=Z6(hj(l,b=>b.type==="Group"&&!!b.flags)),m=p?lf(r.globalFlags,p):r.globalFlags;dj(m,r.currentFlags)||(h=ha({flags:pj(m)}),h.body[0].body.push(d))}n(ln(h,e),{traverse:!c})}},uj={Backreference({node:t,parent:e,replaceWith:n},r){if(t.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,t.ref);return}const i=r.reffedNodesByReferencer.get(t).filter(l=>fj(l,t));if(!i.length)n(ln(io({negate:!0}),e));else if(i.length>1){const l=ha({atomic:!0,body:i.reverse().map(c=>bo({body:[i1(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 r=0;r<n;r++){const a=P6();t.body.at(-1).body.push(a)}}},Subroutine({node:t},e){!t.isRecursive||t.ref===0||(t.ref=e.reffedNodesByReferencer.get(t).number)}};function K6(t){Xc(t,{"*"({node:e,parent:n}){e.parent=n}})}function dj(t,e){return t.dotAll===e.dotAll&&t.ignoreCase===e.ignoreCase}function fj(t,e){let n=e;do{if(n.type==="Regex")return!1;if(n.type==="Alternative")continue;if(n===t)return!1;const r=X6(n.parent);for(const a of r){if(a===n)break;if(a===t||J6(a,t))return!0}}while(n=n.parent);throw new Error("Unexpected path")}function Y6(t,e,n,r){const a=Array.isArray(t)?[]:{};for(const[i,l]of Object.entries(t))i==="parent"?a.parent=Array.isArray(n)?r:n:l&&typeof l=="object"?a[i]=Y6(l,e,a,n):(i==="type"&&l==="CapturingGroup"&&e.set(a,e.get(t)??t),a[i]=l);return a}function Bw(t){const e=$6(t);return e.isRecursive=!0,e}function hj(t,e){const n=[];for(;t=t.parent;)(!e||e(t))&&n.push(t);return n}function $m(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 Z6(t){const e=["dotAll","ignoreCase"],n={enable:{},disable:{}};return t.forEach(({flags:r})=>{e.forEach(a=>{var i,l;(i=r.enable)!=null&&i[a]&&(delete n.disable[a],n.enable[a]=!0),(l=r.disable)!=null&&l[a]&&(n.disable[a]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function pj({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 X6(t){if(!t)throw new Error("Node expected");const{body:e}=t;return Array.isArray(e)?e:e?[e]:null}function Q6(t){const e=t.find(n=>n.kind==="search_start"||yj(n,{negate:!1})||!mj(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 r of e.body){const a=Q6(r.body);if(!a)return null;Array.isArray(a)?n.push(...a):n.push(a)}return n}return null}function J6(t,e){const n=X6(t)??[];for(const r of n)if(r===e||J6(r,e))return!0;return!1}function mj({type:t}){return t==="Assertion"||t==="Directive"||t==="LookaroundAssertion"}function gj(t){const e=["Character","CharacterClass","CharacterSet"];return e.includes(t.type)||t.type==="Quantifier"&&t.min&&e.includes(t.body.type)}function yj(t,e){const n={negate:null,...e};return t.type==="LookaroundAssertion"&&(n.negate===null||t.negate===n.negate)&&t.body.length===1&&B6(t.body[0],{type:"Assertion",kind:"search_start"})}function Fm(t){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(t)}function ds(t,e){const r=I6(t,{...e,unicodePropertyMap:dy}).body;return r.length>1||r[0].body.length>1?ha({body:r}):r[0].body[0]}function Um(t,e){return t.negate=e,t}function di(t,e){return t.parent=e,t}function ln(t,e){return K6(t),t.parent=e,t}function bj(t,e){const n=q6(e),r=c1(n.target,"ES2024"),a=c1(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(!a){const x=[t.flags.ignoreCase];Xc(t,vj,{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 h=t;const p={accuracy:n.accuracy,appliedGlobalFlags:d,captureMap:new Map,currentFlags:{dotAll:t.flags.dotAll,ignoreCase:t.flags.ignoreCase},inCharClass:!1,lastNode:h,originMap:t._originMap,recursionLimit:i,useAppliedIgnoreCase:!!(!a&&l&&c),useFlagMods:a,useFlagV:r,verbose:n.verbose};function m(x){return p.lastNode=h,h=x,QL(xj[x.type],`Unexpected node type "${x.type}"`)(x,p,m)}const b={pattern:t.body.map(m).join("|"),flags:m(t.flags),options:{...t.options}};return r||(delete b.options.force.v,b.options.disable.v=!0,b.options.unicodeSetsPlugin=null),b._captureTransfers=new Map,b._hiddenCaptures=[],p.captureMap.forEach((x,w)=>{x.hidden&&b._hiddenCaptures.push(w),x.transferTo&&pu(b._captureTransfers,x.transferTo,[]).push(w)}),b}var vj={"*":{enter({node:t},e){if(Pw(t)){const n=e.getCurrentModI();e.pushModI(t.flags?lf({ignoreCase:n},t.flags).ignoreCase:n)}},exit({node:t},e){Pw(t)&&e.popModI()}},Backreference(t,e){e.setHasCasedChar()},Character({node:t},e){fy(An(t.value))&&e.setHasCasedChar()},CharacterClassRange({node:t,skip:e},n){e(),eS(t,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:t},e){t.kind==="property"&&W6.has(t.value)&&e.setHasCasedChar()}},xj={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?Je`\B`:Je`\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:r,name:a,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),`(${a?`?<${a}>`:""}${r.map(n).join("|")})`},Character({value:t},e){const n=An(t),r=al(t,{escDigit:e.lastNode.type==="Backreference",inCharClass:e.inCharClass,useFlagV:e.useFlagV});if(r!==n)return r;if(e.useAppliedIgnoreCase&&e.currentFlags.ignoreCase&&fy(n)){const a=V6(n);return e.inCharClass?a.join(""):a.length>1?`[${a.join("")}]`:a[0]}return n},CharacterClass(t,e,n){const{kind:r,negate:a,parent:i}=t;let{body:l}=t;if(r==="intersection"&&!e.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");ma.bugFlagVLiteralHyphenIsRange&&e.useFlagV&&l.some(zw)&&(l=[Pf(45),...l.filter(h=>!zw(h))]);const c=()=>`[${a?"^":""}${l.map(n).join(r==="intersection"?"&&":"")}]`;if(!e.inCharClass){if((!e.useFlagV||ma.bugNestedClassIgnoresNegation)&&!a){const p=l.filter(m=>m.type==="CharacterClass"&&m.kind==="union"&&m.negate);if(p.length){const m=ha(),b=m.body[0];return m.parent=i,b.parent=m,l=l.filter(x=>!p.includes(x)),t.body=l,l.length?(t.parent=b,b.body.push(t)):m.body.pop(),p.forEach(x=>{const w=bo({body:[x]});x.parent=w,w.parent=m,m.body.push(w)}),n(m)}}e.inCharClass=!0;const h=c();return e.inCharClass=!1,h}const d=l[0];if(r==="union"&&!a&&d&&((!e.useFlagV||!e.verbose)&&i.kind==="union"&&!(ma.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,r=t.max.value,a={escDigit:!1,inCharClass:!0,useFlagV:e.useFlagV},i=al(n,a),l=al(r,a),c=new Set;if(e.useAppliedIgnoreCase&&e.currentFlags.ignoreCase){const d=eS(t);Cj(d).forEach(p=>{c.add(Array.isArray(p)?`${al(p[0],a)}-${al(p[1],a)}`:al(p,a))})}return`${i}-${l}${[...c].join("")}`},CharacterSet({kind:t,negate:e,value:n,key:r},a){if(t==="dot")return a.currentFlags.dotAll?a.appliedGlobalFlags.dotAll||a.useFlagMods?".":"[^]":Je`[^\n]`;if(t==="digit")return e?Je`\D`:Je`\d`;if(t==="property"){if(a.useAppliedIgnoreCase&&a.currentFlags.ignoreCase&&W6.has(n))throw new Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${e?Je`\P`:Je`\p`}{${r?`${r}=`:""}${n}}`}if(t==="word")return e?Je`\W`:Je`\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:r},a,i){const l=a.currentFlags;n&&(a.currentFlags=lf(l,n));const c=e.map(i).join("|"),d=!a.verbose&&e.length===1&&r.type!=="Quantifier"&&!t&&(!a.useFlagMods||!n)?c:`(?${Ej(t,n,a.useFlagMods)}${c})`;return a.currentFlags=l,d},LookaroundAssertion({body:t,kind:e,negate:n},r,a){return`(?${`${e==="lookahead"?"":"<"}${n?"!":"="}`}${t.map(a).join("|")})`},Quantifier(t,e,n){return n(t.body)+Tj(t)},Subroutine({isRecursive:t,ref:e},n){if(!t)throw new Error("Unexpected non-recursive subroutine in transformed AST");const r=n.recursionLimit;return e===0?`(?R=${r})`:Je`\g<${e}&R=${r}>`}},wj=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),kj=new Set(["-","\\","]","^","["]),Sj=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),Iw=new Map([[9,Je`\t`],[10,Je`\n`],[11,Je`\v`],[12,Je`\f`],[13,Je`\r`],[8232,Je`\u2028`],[8233,Je`\u2029`],[65279,Je`\uFEFF`]]),_j=new RegExp("^\\p{Cased}$","u");function fy(t){return _j.test(t)}function eS(t,e){const n=!!(e!=null&&e.firstOnly),r=t.min.value,a=t.max.value,i=[];if(r<65&&(a===65535||a>=131071)||r===65536&&a>=131071)return i;for(let l=r;l<=a;l++){const c=An(l);if(!fy(c))continue;const d=V6(c).filter(h=>{const p=h.codePointAt(0);return p<r||p>a});if(d.length&&(i.push(...d),n))break}return i}function al(t,{escDigit:e,inCharClass:n,useFlagV:r}){if(Iw.has(t))return Iw.get(t);if(t<32||t>126&&t<160||t>262143||e&&Aj(t))return t>255?`\\u{${t.toString(16).toUpperCase()}}`:`\\x${t.toString(16).toUpperCase().padStart(2,"0")}`;const a=n?r?Sj:kj:wj,i=An(t);return(a.has(i)?"\\":"")+i}function Cj(t){const e=t.map(a=>a.codePointAt(0)).sort((a,i)=>a-i),n=[];let r=null;for(let a=0;a<e.length;a++)e[a+1]===e[a]+1?r??(r=e[a]):r===null?n.push(e[a]):(n.push([r,e[a]]),r=null);return n}function Ej(t,e,n){if(t)return">";let r="";if(e&&n){const{enable:a,disable:i}=e;r=(a!=null&&a.ignoreCase?"i":"")+(a!=null&&a.dotAll?"s":"")+(i?"-":"")+(i!=null&&i.ignoreCase?"i":"")+(i!=null&&i.dotAll?"s":"")}return`${r}:`}function Tj({kind:t,max:e,min:n}){let r;return!n&&e===1?r="?":!n&&e===1/0?r="*":n===1&&e===1/0?r="+":n===e?r=`{${n}}`:r=`{${n},${e===1/0?"":e}}`,r+{greedy:"",lazy:"?",possessive:"+"}[t]}function Pw({type:t}){return t==="CapturingGroup"||t==="Group"||t==="LookaroundAssertion"}function Aj(t){return t>47&&t<58}function zw({type:t,value:e}){return t==="Character"&&e===45}var hi,ms,fo,pi,ho,yu,u1,xi,Nj=(xi=class extends RegExp{constructor(n,r,a){var e=(...SU)=>(super(...SU),Xi(this,yu),Xi(this,hi,new Map),Xi(this,ms,null),Xi(this,fo),Xi(this,pi,null),Xi(this,ho,null),Z(this,"rawOptions",{}),this);const i=!!(a!=null&&a.lazyCompile);if(n instanceof RegExp){if(a)throw new Error("Cannot provide options when copying a regexp");const l=n;e(l,r),fa(this,fo,l.source),l instanceof xi&&(fa(this,hi,Qn(l,hi)),fa(this,pi,Qn(l,pi)),fa(this,ho,Qn(l,ho)),this.rawOptions=l.rawOptions)}else{const l={hiddenCaptures:[],strategy:null,transfers:[],...a};e(i?"":n,r),fa(this,fo,n),fa(this,hi,Mj(l.hiddenCaptures,l.transfers)),fa(this,ho,l.strategy),this.rawOptions=a??{}}i||fa(this,ms,this)}get source(){return Qn(this,fo)||"(?:)"}exec(n){if(!Qn(this,ms)){const{lazyCompile:i,...l}=this.rawOptions;fa(this,ms,new xi(Qn(this,fo),this.flags,l))}const r=this.global||this.sticky,a=this.lastIndex;if(Qn(this,ho)==="clip_search"&&r&&a){this.lastIndex=0;const i=Qp(this,yu,u1).call(this,n.slice(a));return i&&(Rj(i,a,n,this.hasIndices),this.lastIndex+=a),i}return Qp(this,yu,u1).call(this,n)}},hi=new WeakMap,ms=new WeakMap,fo=new WeakMap,pi=new WeakMap,ho=new WeakMap,yu=new WeakSet,u1=function(n){Qn(this,ms).lastIndex=this.lastIndex;const r=tx(xi.prototype,this,"exec").call(Qn(this,ms),n);if(this.lastIndex=Qn(this,ms).lastIndex,!r||!Qn(this,hi).size)return r;const a=[...r];r.length=1;let i;this.hasIndices&&(i=[...r.indices],r.indices.length=1);const l=[0];for(let c=1;c<a.length;c++){const{hidden:d,transferTo:h}=Qn(this,hi).get(c)??{};if(d?l.push(null):(l.push(r.length),r.push(a[c]),this.hasIndices&&r.indices.push(i[c])),h&&a[c]!==void 0){const p=l[h];if(!p)throw new Error(`Invalid capture transfer to "${p}"`);if(r[p]=a[c],this.hasIndices&&(r.indices[p]=i[c]),r.groups){Qn(this,pi)||fa(this,pi,Dj(this.source));const m=Qn(this,pi).get(h);m&&(r.groups[m]=a[c],this.hasIndices&&(r.indices.groups[m]=i[c]))}}}return r},xi);function Rj(t,e,n,r){if(t.index+=e,t.input=n,r){const a=t.indices;for(let l=0;l<a.length;l++){const c=a[l];c&&(a[l]=[c[0]+e,c[1]+e])}const i=a.groups;i&&Object.keys(i).forEach(l=>{const c=i[l];c&&(i[l]=[c[0]+e,c[1]+e])})}}function Mj(t,e){const n=new Map;for(const r of t)n.set(r,{hidden:!0});for(const[r,a]of e)for(const i of a)pu(n,i,{}).transferTo=r;return n}function Dj(t){const e=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map;let r=0,a=0,i;for(;i=e.exec(t);){const{0:l,groups:{capture:c,name:d}}=i;l==="["?r++:r?l==="]"&&r--:c&&(a++,d&&n.set(a,d))}return n}function Oj(t,e){const n=Lj(t,e);return n.options?new Nj(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function Lj(t,e){const n=q6(e),r=I6(t,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:dy}),a=oj(r,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),i=bj(a,n),l=ZL(i.pattern,{captureTransfers:i._captureTransfers,hiddenCaptures:i._hiddenCaptures,mode:"external"}),c=KL(l.pattern),d=WL(c.pattern,{captureTransfers:l.captureTransfers,hiddenCaptures:l.hiddenCaptures}),h={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 p=d.hiddenCaptures.sort((w,S)=>w-S),m=Array.from(d.captureTransfers),b=a._strategy,x=h.pattern.length>=n.lazyCompileLength;(p.length||m.length||b||x)&&(h.options={...p.length&&{hiddenCaptures:p},...m.length&&{transfers:m},...b&&{strategy:b},...x&&{lazyCompile:x}})}return h}function jj(t,e){return Oj(t,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...e})}function tS(t={}){const e={target:"auto",cache:new Map,...t};return e.regexConstructor||(e.regexConstructor=n=>jj(n,{target:e.target})),{createScanner(n){return new XO(n,e)},createString(n){return{content:n}}}}function hy(){try{const t=sessionStorage.getItem("auth_token")??localStorage.getItem("auth_token");return t?`&token=${encodeURIComponent(t)}`:""}catch{return""}}const Bj=/\.(png|jpe?g|webp|gif|bmp|svg)$/i;function py(t){return/^https?:\/\//i.test(t)}function NF(t){return py(t)?t:wu(`/api/generated-images?path=${encodeURIComponent(t)}${hy()}`)}function Ij(t){if(!t||py(t)||t.startsWith("data:")||t.startsWith("/")||t.startsWith("#")||t.startsWith("artifact:")||t.startsWith("dscfile:"))return null;const e=t.split(/[?#]/)[0]??"";return Bj.test(e)?wu(`/api/files/download?path=${encodeURIComponent(t)}${hy()}`):null}function RF(t){return!t||py(t)||t.startsWith("data:")?t:wu(`/api/images?path=${encodeURIComponent(t)}${hy()}`)}function nS(t){return`md-h-${t}`}function Pj(t){return t.replace(/\s+#+\s*$/,"").replace(/!\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/[*_~`]+/g,"").replace(/\s{2,}/g," ").trim()}const zj=/^(?:[-*+]|\d+[.)])\s|^>/;function $j(t){const e=[],n=(t||"").split(/\r?\n/);let r=null;const a=(i,l)=>{const c=Pj(l);c&&e.push({id:nS(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);r===null?r=m:r===m&&(r=null);continue}if(r!==null)continue;const d=l.match(/^\s{0,3}(#{1,6})\s+(.*)$/);if(d){a((d[1]??"").length,d[2]??"");continue}const h=l.trim();if(!h||zj.test(h))continue;const p=n[i+1]??"";/^\s{0,3}=+\s*$/.test(p)?(a(1,h),i++):/^\s{0,3}-{2,}\s*$/.test(p)&&(a(2,h),i++)}return e}function Fj({src:t,alt:e,onClose:n}){const[r,a]=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();a(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&&a({x:b.originX+(m.clientX-b.startX),y:b.originY+(m.clientY-b.startY)})},[]),h=N.useCallback(()=>{i.current=null},[]),p=r?{left:r.x,top:r.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:p,"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:h,onPointerCancel:h,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(Bn,{size:14})})]}),g.jsx("img",{src:t,alt:e||"",draggable:!1,className:"block max-h-[70vh] max-w-[70vw] object-contain"})]})]})}const Uj={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"},Hj={js:"javascript",ts:"typescript",py:"python",yml:"yaml",shell:"bash",sh:"bash",zsh:"bash",text:"txt",plaintext:"txt",plain:"txt"};function Gj(t){return Hj[t]??t}let d0=null;function qj(){return d0||(d0=R6({themes:["github-dark"],langs:["javascript","typescript","jsx","tsx","css","json","bash","python","markdown","yaml","sql","html","xml","diff"],engine:tS()}).catch(t=>{throw d0=null,t})),d0}const Fc=new Map,Vj=300;function Wj(t,e){if(Fc.size>=Vj){const n=Fc.keys().next().value;n!==void 0&&Fc.delete(n)}Fc.set(t,e)}function Kj({language:t,code:e}){const{t:n}=tt(),[r,a]=N.useState(!1),[i,l]=N.useState(null);N.useEffect(()=>{let h=!1;const p=`${t}\0${e}`,m=Fc.get(p);if(m){l(m);return}return qj().then(b=>{const x=Gj(t);if(!b.getLoadedLanguages().includes(x))return;const w=b.codeToHtml(e,{lang:x,theme:"github-dark"});Wj(p,w),h||l(w)}).catch(()=>{}),()=>{h=!0}},[e,t]);const c=async()=>{try{await navigator.clipboard.writeText(e),a(!0),setTimeout(()=>a(!1),2e3)}catch(h){console.error("Failed to copy:",h)}},d=Uj[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:r?g.jsxs(g.Fragment,{children:[g.jsx(e3,{size:12,className:"text-accent-green"}),g.jsx("span",{className:"text-accent-green",children:n("common.copied")})]}):g.jsxs(g.Fragment,{children:[g.jsx(hf,{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 $w=80;function Yj({path:t,title:e}){const{t:n}=tt(),r=t.split(/[\\/]/).pop()||t;return 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:()=>q0(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(mo,{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||r}),e&&e!==r&&g.jsx("span",{className:"text-[10px] font-mono text-dark-muted truncate max-w-[14rem]",children:r})]}),g.jsx("span",{className:"ml-1 shrink-0 text-[11px] font-medium text-accent-blue",children:n("commonUi.openFile")})]})}function Fw(t){return typeof t=="string"&&t.startsWith("artifact:")}function Zj({src:t,alt:e}){const[n,r]=N.useState(!1);return g.jsxs(g.Fragment,{children:[g.jsx("img",{src:t,alt:e,title:e,loading:"lazy",onClick:()=>r(!0),className:"my-1 max-h-80 max-w-full cursor-zoom-in rounded-lg border border-dark-border object-contain"}),n&&g.jsx(Fj,{src:t,alt:e||void 0,onClose:()=>r(!1)})]})}function Xj(t){const e=t.slice(9);try{return decodeURIComponent(e)}catch{return e}}function Uw(t){return typeof t=="string"&&t.startsWith("dscfile:")}function Qj(t){const e=t.slice(8);try{return decodeURIComponent(e)}catch{return e}}function Jj(t){return t.replace(/%/g,"%25")}const eB=/((?:[A-Za-z]:[\\/])?[\w@.()[\]{}$%-]+(?:[\\/][\w@.()[\]{}$%-]+)+)/;function tB(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(a=>/^\d+$/.test(a)))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 nB(t){const e=t.match(/^(.*?)([.,;:!?)\]}]+)$/);if(!e)return{path:t,tail:""};const n=e[1]??"",r=e[2]??"";if(r==="."){const a=n.split(/[\\/]/).pop()||"";if(!/\.[A-Za-z0-9]{1,12}$/.test(a))return{path:t,tail:""}}return{path:n,tail:r}}function rB({path:t}){return g.jsxs("button",{type:"button",onClick:()=>q0(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(mo,{size:10,className:"shrink-0"}),g.jsx("span",{className:"break-all",children:t})]})}function aB(){const t=new Set(["code","inlineCode","html","link","linkReference","image","imageReference"]);function e(r){const a=r.split(eB);if(a.length<=1)return[{type:"text",value:r}];const i=[];return a.forEach((l,c)=>{if(c%2===1){const{path:d,tail:h}=nB(l);if(d&&tB(d)){i.push({type:"link",url:`dscfile:${Jj(d)}`,title:null,children:[{type:"text",value:d}]}),h&&i.push({type:"text",value:h});return}}i.push({type:"text",value:l})}),i}function n(r){if(!r||typeof r!="object"||t.has(r.type))return;const a=r.children;if(!Array.isArray(a))return;const i=[];for(const l of a)l&&l.type==="text"&&typeof l.value=="string"?i.push(...e(l.value)):(n(l),i.push(l));r.children=i}return function(a){n(a)}}const sB=[aB,iR],iB=[PR];function oB({content:t,className:e="",headingIds:n=!1}){const[r,a]=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===r)return;const p=Date.now(),m=p-i.current;m>=$w?(a(t),i.current=p):l.current||(l.current=setTimeout(()=>{l.current=null,a(c.current),i.current=Date.now()},$w-m))},[t]),N.useEffect(()=>()=>{l.current&&clearTimeout(l.current)},[]),N.useEffect(()=>{if(!n)return;const p=d.current;p&&p.querySelectorAll("h1,h2,h3,h4,h5,h6").forEach((m,b)=>{m.id=nS(b)})},[n,r]);const h=(r||"").replace(/\\n/g,`
446
- `).replace(/\n{3,}/g,`
447
-
448
- `);return g.jsx("div",{ref:d,className:`markdown-content ${e}`,style:{wordBreak:"break-word"},children:g.jsx(W8,{remarkPlugins:sB,rehypePlugins:iB,urlTransform:p=>Fw(p)||Uw(p)?p:K8(p),components:{code({className:p,children:m,...b}){const x=/language-(\w+)/.exec(p||""),w=String(m).replace(/\n$/,"");return x&&x[1]?g.jsx(Kj,{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:p,children:m}){if(Fw(p)){const b=Array.isArray(m)?m.join(""):String(m??"");return g.jsx(Yj,{path:Xj(p),title:b})}return Uw(p)?g.jsx(rB,{path:Qj(p)}):g.jsx("a",{href:p,target:"_blank",rel:"noopener noreferrer",className:"text-accent-blue hover:underline",children:m})},img({src:p,alt:m}){const b=typeof p=="string"?p:"";if(!b)return null;const x=Ij(b);return x?g.jsx(Zj,{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:p}){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:p})})},th({children:p}){return g.jsx("th",{className:"border border-dark-border px-3 py-2 text-left bg-dark-hover font-medium",children:p})},td({children:p}){return g.jsx("td",{className:"border border-dark-border px-3 py-2",children:p})},p({children:p}){return g.jsx("p",{className:"mb-0.5 leading-snug last:mb-0",children:p})},blockquote({children:p}){return g.jsx("blockquote",{className:"border-l-4 border-accent-blue pl-3 my-1 text-dark-muted italic",children:p})},h1({children:p}){return g.jsx("h1",{className:"text-2xl font-bold mt-3 mb-1 text-dark-text border-b border-dark-border pb-1",children:p})},h2({children:p}){return g.jsx("h2",{className:"text-xl font-semibold mt-3 mb-1 text-dark-text border-b border-dark-border pb-1",children:p})},h3({children:p}){return g.jsx("h3",{className:"text-lg font-semibold mt-2 mb-1 text-dark-text",children:p})}},children:h})})}const lB=24;function cB({headings:t,scrollRoot:e,onClose:n}){const{t:r}=tt(),[a,i]=N.useState(null),l=N.useRef(null),[c,d]=N.useState(null);N.useEffect(()=>{d(e.current)},[e,t]);const h=N.useMemo(()=>t.reduce((m,b)=>Math.min(m,b.level),6),[t]);N.useEffect(()=>{if(!c)return;let m=0;const b=()=>{var E;m=0;const w=c.getBoundingClientRect().top;let S=((E=t[0])==null?void 0:E.id)??null;for(const A of t){const T=c.querySelector(`#${A.id}`);if(T)if(T.getBoundingClientRect().top-w<=lB)S=A.id;else break}i(S)},x=()=>{m||(m=requestAnimationFrame(b))};return b(),c.addEventListener("scroll",x,{passive:!0}),()=>{c.removeEventListener("scroll",x),m&&cancelAnimationFrame(m)}},[c,t]),N.useEffect(()=>{const m=l.current,b=m==null?void 0:m.querySelector('[data-active="1"]');if(!m||!b)return;const x=m.getBoundingClientRect(),w=b.getBoundingClientRect();w.top<x.top?m.scrollTop-=x.top-w.top:w.bottom>x.bottom&&(m.scrollTop+=w.bottom-x.bottom)},[a]);const p=m=>{if(!c)return;const b=c.querySelector(`#${m}`);if(!b)return;const x=b.getBoundingClientRect().top-c.getBoundingClientRect().top;c.scrollTo({top:Math.max(0,c.scrollTop+x-8),behavior:"smooth"}),i(m)};return g.jsxs("nav",{"aria-label":r("chat.outline"),className:"absolute right-2 top-2 z-20 flex max-h-[calc(100%-1rem)] w-56 flex-col overflow-hidden rounded-lg border border-dark-border bg-dark-surface shadow-lg",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:r("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:r("chat.outlineClose"),"aria-label":r("chat.outlineClose"),children:g.jsx(Bn,{size:11})})]}),g.jsx("div",{ref:l,className:"min-h-0 flex-1 overflow-y-auto custom-scrollbar px-1 py-1",children:t.map(m=>{const b=m.id===a;return g.jsx("button",{type:"button","data-active":b?"1":"0",title:m.text,onClick:()=>p(m.id),style:{paddingLeft:6+Math.min(m.level-h,3)*10},className:ut("flex w-full items-start gap-1 rounded px-1.5 py-1 text-left text-[11px] leading-snug transition-colors",b?"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:m.text})},m.id)})})]})}const uB="dsc:host-ready",dB="dsc:host-context",fB="dsc:plugin-ready",rS=N.memo(function({contribution:e,hostContext:n}){const r=N.useRef(null),a=N.useRef(JSON.stringify(n??{})),i=N.useCallback(()=>{const l=r.current,c=l==null?void 0:l.getAttribute("src");if(!(!(l!=null&&l.contentWindow)||!c))try{l.contentWindow.postMessage({__dsc:!0,type:dB,context:n??{}},new URL(c,window.location.origin).origin)}catch{}},[n]);return N.useEffect(()=>{const l=c=>{const d=r.current;if(!d)return;const h=d.getAttribute("src")??"";let p;try{p=new URL(h,window.location.origin).origin}catch{return}if(c.origin!==p)return;const m=c.data;!m||m.__dsc!==!0||m.type===fB&&i()};return window.addEventListener("message",l),()=>window.removeEventListener("message",l)},[i]),N.useEffect(()=>{const l=JSON.stringify(n??{});l!==a.current&&(a.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:r,title:e.title,src:e.url,className:"w-full h-full border-0",sandbox:"allow-scripts allow-same-origin","data-plugin-ready":uB})})}),hB=Object.freeze(Object.defineProperty({__proto__:null,PluginTabContainer:rS},Symbol.toStringTag,{value:"Module"})),Hm=gn()(Ti(t=>({hidden:{},pinned:{},hide:e=>t(n=>({hidden:{...n.hidden,[e]:!0}})),show:e=>t(n=>{const r={...n.hidden};return delete r[e],{hidden:r}}),togglePin:e=>t(n=>{const r=!n.pinned[e],a={...n.hidden};return r&&delete a[e],{pinned:{...n.pinned,[e]:r},hidden:a}}),reset:()=>t({hidden:{},pinned:{}})}),{name:"deepseekcode-widget-store",storage:L1({key:"widgetStore",trims:[]}),partialize:t=>({hidden:t.hidden,pinned:t.pinned})})),wo=N.memo(function({id:e,title:n,icon:r,action:a,children:i,defaultOpen:l=!0}){const{t:c}=tt(),d=Hm(x=>x.pinned[e]),h=Hm(x=>x.togglePin),p=Hm(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(yi,{size:11,className:ut("text-dark-muted shrink-0 transition-transform duration-200",!m&&"-rotate-90")}),r,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")})]}),a,g.jsx("button",{type:"button",onClick:()=>h(e),className:ut("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(lg,{size:11}):g.jsx(X8,{size:11})}),g.jsx("button",{type:"button",onClick:()=>p(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(Bn,{size:11})})]}),m&&g.jsx("div",{className:"px-2.5 pb-2.5",children:i})]})}),pB=N.memo(function({sessionId:e}){const{t:n}=tt(),r=ot(l=>e?l.getPlanForSession(e):void 0);if(!r||!r.confirm)return null;const a=r.nodes??[],i=l=>{ot.getState().clearPlan(e),Oe.send({type:"workflow_confirm",sessionId:e,data:JSON.stringify({planId:r.planId,action:l})})};return g.jsx(wo,{id:"plan-card",title:n("widgets.plan.title"),icon:g.jsx(t3,{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(Kn,{size:11,className:"animate-spin text-accent-blue shrink-0"}),g.jsx("span",{className:"truncate flex-1",children:r.title||n("widgets.plan.fallbackTitle")}),g.jsx("span",{className:"text-[10px] text-dark-muted tabular-nums shrink-0",children:n("widgets.plan.stepCount",{count:a.length})})]}),a.length>0&&g.jsxs("ol",{className:"space-y-0.5",children:[a.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=r.parallelGroups)==null?void 0:d.some(h=>h.includes(l.id)))&&g.jsxs("span",{className:"ml-1 rounded bg-dark-border/50 px-1 text-[9px]",children:["P",r.parallelGroups.findIndex(h=>h.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)}),a.length>8&&g.jsx("li",{className:"text-[10px] text-dark-muted/60 pl-6",children:n("widgets.plan.moreSteps",{count:a.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(T1,{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(pf,{size:10})," ",n("widgets.plan.change")]}),r.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(Q8,{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(Bn,{size:10})," ",n("widgets.plan.cancel")]})]})]})})}),mB=N.memo(function({sessionId:e}){const{t:n}=tt(),r=ot(d=>e?d.getDwfOfferForSession(e):void 0),[a,i]=N.useState(!1);if(!r||r.resolved)return null;const l=d=>{ot.getState().clearDwfOffer(e,r.offerId),Oe.send({type:"dwf_confirm",sessionId:e,data:JSON.stringify({offerId:r.offerId,action:d})})},c=Array.isArray(r.phases)?r.phases:[];return g.jsx(wo,{id:"dwf-offer",title:r.fileName||"Dynamic workflow",icon:g.jsx(N1,{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:r.title||n("widgets.dwf.offerFallbackTitle")}),typeof r.agentCount=="number"&&r.agentCount>0&&g.jsxs("span",{className:"text-[10px] text-dark-muted tabular-nums shrink-0",children:[r.agentCount," agents"]})]}),r.description&&g.jsx("p",{className:"text-[11px] text-dark-muted leading-snug break-words",children:r.description}),c.length>0&&g.jsxs("ol",{className:"space-y-0.5",children:[c.slice(0,6).map((d,h)=>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:h+1}),g.jsx("span",{className:"min-w-0 flex-1 leading-snug break-words",children:d.title||d.detail||`Phase ${h+1}`})]},h)),c.length>6&&g.jsxs("li",{className:"text-[10px] text-dark-muted/60 pl-6",children:["+",c.length-6," more"]})]}),r.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(mf,{size:11,className:"shrink-0 mt-0.5"}),g.jsx("span",{children:r.tokenWarning})]}),a&&r.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:r.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(T1,{size:10})," Run"]}),g.jsxs("button",{type:"button",onClick:()=>{if(!r.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:r.scriptPreview?"Toggle script preview":"View (no preview available)",children:[a?g.jsx(Kn,{size:10,className:"rotate-45"}):g.jsx(A1,{size:10})," ",a?"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(Bn,{size:10})," No"]})]}),r.filePath&&g.jsxs("div",{className:"flex items-center gap-1 text-[9px] text-dark-muted/70 truncate",children:[g.jsx(J8,{size:9,className:"shrink-0"}),g.jsx("span",{className:"truncate",children:r.filePath})]})]})})});function gB(t){return t>=1e4?`${Math.round(t/1e3)}k`:t.toLocaleString()}const yB=N.memo(function({sessionId:e}){const{t:n}=tt(),r=ot(m=>e?m.getDwfPromotableForSession(e):void 0),[a,i]=N.useState(!1),[l,c]=N.useState(!1);if(!r||r.resolved)return null;const d=()=>{ot.getState().clearDwfPromotable(e,r.workflowId)},h=()=>{i(!0),ot.getState().clearDwfPromotable(e,r.workflowId),Oe.send({type:"dwf_promote",sessionId:e,data:JSON.stringify({workflowId:r.workflowId})}),c(!0),i(!1),window.setTimeout(()=>c(!1),2500)},p=typeof r.successRate=="number"?Math.round(r.successRate*100):void 0;return g.jsx(wo,{id:"dwf-promotable",title:r.name||r.workflowId||"Dynamic workflow",icon:g.jsx(n_,{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 r.runs=="number"?r.runs:"3+"})})}),(typeof r.runs=="number"||p!==void 0||typeof r.avgTokens=="number"&&r.avgTokens>0)&&g.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-dark-muted",children:[typeof r.runs=="number"&&g.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-dark-border/60 tabular-nums",children:[r.runs," runs"]}),p!==void 0&&g.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-accent-green/10 text-accent-green tabular-nums",children:[p,"% success"]}),typeof r.avgTokens=="number"&&r.avgTokens>0&&g.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-dark-border/60 tabular-nums",children:["~",gB(r.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:h,disabled:a||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(e_,{size:10}):a?g.jsx(Kn,{size:10,className:"animate-spin"}):g.jsx(t_,{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(Bn,{size:10})," No"]})]})]})})}),bB=["RUNNING","RESUMING"];function vB(t){switch(t){case"running":return g.jsx(Kn,{size:12,className:"animate-spin text-accent-blue shrink-0"});case"completed":return g.jsx(vu,{size:12,className:"text-accent-green shrink-0"});case"failed":return g.jsx(bu,{size:12,className:"text-accent-red shrink-0"});case"skipped":return g.jsx(s3,{size:12,className:"text-dark-muted shrink-0"});case"blocked":return g.jsx(a3,{size:12,className:"text-dark-muted shrink-0"});default:return g.jsx(R1,{size:12,className:"text-dark-muted/70 shrink-0"})}}function xB(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 d1(t){return!t||t<0?"":t>=6e4?`${Math.floor(t/6e4)}m${Math.floor(t%6e4/1e3)}s`:`${(t/1e3).toFixed(1)}s`}function wB(t,e){if(!t)return"";const n=(e??Date.now())-t;return n<0?"":n>=36e5?`${Math.floor(n/36e5)}h${Math.floor(n%36e5/6e4)}m`:n>=6e4?`${Math.floor(n/6e4)}m${Math.floor(n%6e4/1e3)}s`:`${Math.floor(n/1e3)}s`}function kB(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 SB(t,e){if(!e||t.length===0)return;const n=t.filter(l=>l.status==="completed"||l.status==="skipped").length,r=e-n;if(r<=0)return;const a=t.filter(l=>l.status==="completed"&&typeof l.durationMs=="number"&&l.durationMs>0).map(l=>l.durationMs);if(a.length===0)return;const i=a.reduce((l,c)=>l+c,0)/a.length;return Math.round(i*r)}function _B(t,e,n){const r=t.filter(h=>h.status==="failed"),a=t.reduce((h,p)=>h+(p.attempts!=null&&p.attempts>1?1:0),0),i=t.filter(h=>typeof h.durationMs=="number"&&h.durationMs>0),l=i.length>=2?i.reduce((h,p)=>p.durationMs>h.durationMs?p:h):void 0,c=[];r.length>0&&c.push(n("widgets.workflow.recapFailedNodes",{n:r.length,names:r.map(h=>h.title).join(" / ").slice(0,18)})),a>0&&c.push(n("widgets.workflow.recapRetried",{n:a})),l&&c.push(n("widgets.workflow.recapSlowest",{name:l.title.slice(0,10),duration:d1(l.durationMs)}));const d=r.length===0&&e==="COMPLETED"?n("widgets.workflow.recapAllDone"):"";if(d&&c.length===0){const h=i.reduce((p,m)=>p+(m.durationMs||0),0);return h>0?`${d} · ${n("widgets.workflow.recapTotalDuration",{duration:d1(h)})}`:d}return[d,c.join(" · ")].filter(Boolean).join(" · ")||(e==="FAILED"?n("widgets.workflow.recapAllFailed"):"")}function Hw(t,e=80){const n=t.split(`
449
- `).map(r=>r.trim()).find(Boolean)??"";return n.length>e?`${n.slice(0,e-1)}…`:n}const Gw={running:0,failed:1,pending:2,ready:2,blocked:2,skipped:3,completed:3};function CB(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 r=new Map;for(const i of t){const l=n.get(i.id);if(!l)continue;const c=r.get(l)??[];c.push(i),r.set(l,c)}const a=(i,l)=>{const c=e.get(i);if(!c||l.has(i))return null;const d=(r.get(i)??[]).map(h=>a(h.id,new Set(l).add(i))).filter(h=>h!==null).sort((h,p)=>(Gw[h.node.status]??9)-(Gw[p.node.status]??9));return{node:c,children:d}};return t.filter(i=>!n.has(i.id)).map(i=>a(i.id,new Set)).filter(i=>i!==null)}const EB=N.memo(function({sessionId:e}){const{t:n}=tt(),r=ot(I=>e?I.getForSession(e):void 0),a=r==null?void 0:r.nodes;if(!a||a.length===0)return null;const i=a.length,l=a.filter(I=>I.status==="completed"||I.status==="skipped"||I.status==="failed").length,c=a.filter(I=>I.status==="running").length,d=a.filter(I=>I.status==="failed").length,h=Math.round(l/i*100),p=bB.includes(String(r==null?void 0:r.status)),m=SB(a,i),b=String((r==null?void 0:r.status)??""),x=["COMPLETED","FAILED","CANCELLED","CANCELED"].includes(b),w=a.reduce((I,U)=>I+(U.attempts!=null&&U.attempts>1?1:0),0),S=!p&&(b==="COMPLETED"||b==="FAILED"||b==="CANCELLED")?_B(a,b,n):"",A=["FAILED","COMPLETED","PAUSED"].includes(String(r==null?void 0:r.status))&&d>0&&!!(r!=null&&r.runId),T=wB(r==null?void 0:r.startedAt,r==null?void 0:r.finishedAt),D={};for(const I of a)D[I.id]=I.title;const M=CB(a),B=(I,U)=>{const W=r.runId;U==="recover"?Oe.send({type:"workflow_recover",sessionId:e,runId:W}):I&&Oe.send({type:U==="retry_node"?"workflow_retry_node":"workflow_skip_node",sessionId:e,runId:W,nodeId:I})};return g.jsx(wo,{id:"workflow-strip",title:(r==null?void 0:r.title)||n("widgets.workflow.fallbackTitle"),icon:g.jsx(t3,{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:[p?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:ut("h-full rounded-full transition-all duration-500",d>0?"bg-accent-red":c>0?"bg-accent-blue":"bg-accent-green"),style:{width:`${h}%`}})}),g.jsxs("span",{className:"text-[10px] text-dark-muted tabular-nums shrink-0",children:[h,"%"]}),m!=null&&g.jsxs("span",{className:"text-[9px] text-accent-blue/80 tabular-nums shrink-0",children:["ETA ",kB(m)]})]}):x&&g.jsx(MB,{status:b,failedCount:d,retriedCount:w,recapText:S,elapsed:T,t:n}),g.jsx(TB,{roots:M,canRecover:A,titleById:D,onRetry:I=>B(I.id,"retry_node"),onSkip:I=>B(I.id,"skip_node")}),(p||(r==null?void 0:r.status)==="PAUSED")&&g.jsx("div",{className:"flex items-center gap-1.5 pt-1 border-t border-dark-border/60",children:g.jsx(RB,{sessionId:e,runId:r.runId,status:String(r==null?void 0:r.status)})}),A&&!p&&(r==null?void 0:r.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(n3,{size:10}),n("widgets.workflow.recoverFromCheckpoint")]}),g.jsx("span",{className:"text-[9px] text-dark-muted/60",children:n("widgets.workflow.recoverHint",{n:d})})]})]})})});function TB({roots:t,canRecover:e,titleById:n,onRetry:r,onSkip:a}){return t.length===0?null:g.jsx("ul",{className:"space-y-0.5",children:t.map(i=>g.jsx(NB,{item:i,canRecover:e,titleById:n,onRetry:r,onSkip:a},i.node.id))})}function AB(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 NB=N.memo(function t({item:e,canRecover:n,titleById:r,onRetry:a,onSkip:i}){var E;const{node:l,children:c}=e,{t:d}=tt(),h=d1(l.durationMs),p=l.status==="pending"||l.status==="ready"||l.status==="blocked",m=p&&((E=l.dependencies)!=null&&E.length)?l.dependencies[0]:void 0,b=m!=null?r[m]??m:"",x=l.error?Hw(l.error):"",w=l.status==="completed"&&l.result?Hw(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:AB(l.type)}),g.jsx("span",{className:"mt-0.5 shrink-0",children:vB(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:ut("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",p&&"text-dark-muted"),title:`${l.title} · ${xB(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,h?g.jsx("span",{children:h}):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:()=>a(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(r3,{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(r_,{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(A=>g.jsx(t,{item:A,canRecover:n,titleById:r,onRetry:a,onSkip:i},A.node.id))})]})});function RB({sessionId:t,runId:e,status:n}){const{t:r}=tt(),a=n==="PAUSED";return g.jsxs(g.Fragment,{children:[g.jsxs("button",{type:"button",onClick:()=>Oe.send(a?{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:[a?g.jsx(T1,{size:10,className:"text-accent-green"}):g.jsx(a3,{size:10,className:"text-accent-blue"}),r(a?"widgets.workflow.resume":"widgets.workflow.pause")]}),g.jsxs("button",{type:"button",onClick:()=>Oe.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(a_,{size:9,className:"text-accent-red"}),r("widgets.workflow.cancel")]})]})}function MB({status:t,failedCount:e,retriedCount:n,recapText:r,elapsed:a,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]",h=l?"text-accent-red":c?"text-dark-muted":"text-accent-green",p=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?bu:c?s3:vu;return g.jsxs("div",{className:ut("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:ut("w-0.5 self-stretch rounded-full",p),"aria-hidden":"true"}),g.jsx(b,{size:14,className:ut("shrink-0",h)}),g.jsx("span",{className:ut("text-[12px] font-semibold leading-none",h),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(r3,{size:8,className:"inline text-dark-muted/70 mr-0.5"}),n]}),a&&g.jsx("span",{children:a})]})]}),r&&g.jsx("p",{className:"pl-[18px] text-[9px] leading-snug text-dark-muted/80 break-words",children:i("widgets.workflow.recapLine",{text:r})})]})}function DB({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 r=!1;return(async()=>{var a,i,l;try{const c=await ct.workflows.list();if(r||!c.success)return;const h=(c.data??[]).filter(M=>M.sessionId===t).sort((M,B)=>String(B.updatedAt||"").localeCompare(String(M.updatedAt||""))).find(M=>["COMPLETED","FAILED","CANCELLED","CANCELED"].includes(String(M.status).toUpperCase()));if(!h)return;const p=String(h.runId||"");if(((a=ot.getState().getForSession(t))==null?void 0:a.runId)===p)return;const m=await ct.workflows.events(p);if(r||!m.success)return;const b=m.data??[],x=b.find(M=>M.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,E=[];for(const M of w){const B=String(M.id||"");B&&(E.push(B),S.set(B,{id:B,title:String(M.title||M.name||B),status:"pending",dependencies:Array.isArray(M.dependencies)?M.dependencies.map(String):void 0}))}const A=M=>{const B=M.data;if(B&&typeof B=="object")return B;if(typeof B=="string")try{return JSON.parse(B)}catch{return{}}return{}};for(const M of b){const B=String(M.nodeId||A(M).nodeId||"");if(!B||!S.has(B))continue;const I=S.get(B),U=A(M),W=String(U.status||M.type||"").toLowerCase();if(M.type==="workflow_node_start")I.status="running";else if(M.type==="workflow_node_complete"){I.status=W==="failed"||W==="error"?"failed":"completed";const Y=Number(U.durationMs??M.durationMs);Number.isFinite(Y)&&Y>0&&(I.durationMs=Y);const oe=typeof U.result=="string"?U.result:void 0;oe&&(I.result=oe);const ae=typeof U.error=="string"?U.error:void 0;ae&&(I.error=ae);const V=Number(U.attempts);Number.isFinite(V)&&V>1&&(I.attempts=V)}else if(M.type==="workflow_node_retry"){const Y=Number(U.attempt);Number.isFinite(Y)&&Y>1&&(I.attempts=Y),I.status="pending"}}const T=E.map(M=>S.get(M)),D=String(h.status).toUpperCase();for(const M of T)(M.status==="pending"||M.status==="running")&&(M.status="skipped");ot.getState().upsert(t,{runId:p,status:D,title:((l=x==null?void 0:x.data)==null?void 0:l.title)||`workflow: ${p.slice(0,18)}`,completedPhases:T.filter(M=>M.status==="completed"||M.status==="skipped"||M.status==="failed").length,totalPhases:T.length,completedEffects:0,totalEffects:0,tokensUsed:Number(h.tokensUsed||0),tokensRemaining:Number(h.tokensRemaining||0),finishedAt:Date.now(),updatedAt:Date.now()}),ot.getState().setNodes(t,p,T)}catch{}})(),()=>{r=!0}},[t]),null}const OB=N.memo(function({sessionId:e}){const{t:n}=tt();return ot(a=>e?a.getTasksForSession(e).length:0)===0?null:g.jsx(wo,{id:"task-board",title:n("widgets.taskBoard.title"),icon:g.jsx(i3,{size:13,className:"text-accent-blue shrink-0"}),children:g.jsx(SP,{sessionId:e})})}),LB=N.memo(function({messages:e,onPreview:n}){const{t:r}=tt(),a=N.useMemo(()=>bS(e),[e]);return a.length===0?null:g.jsx(wo,{id:"artifacts",title:`${r("chat.sidebarArtifacts")} (${a.length})`,icon:g.jsx(o3,{size:13,className:"text-accent-blue shrink-0"}),action:g.jsx("button",{type:"button",onClick:()=>{const i=a[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:r("chat.sidebarOpenFolder"),"aria-label":r("chat.sidebarOpenFolder"),children:g.jsx(s_,{size:12})}),children:g.jsx("div",{className:"space-y-0.5",children:a.map(i=>{const l=m1(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:ut("w-1.5 h-6 rounded-full shrink-0",i.source==="filejob"?"bg-accent-green":"bg-accent-blue")}),g.jsx(gS,{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:r("chat.sidebarOpen")})]},i.path)})})})}),jB=["Orchestrator","Explorer","Architect","Coder","Tester","Reviewer","Debug","Documenter","Evaluator"];function BB(t){return t==="running"||t==="scheduled"?g.jsx(Kn,{size:11,className:"animate-spin text-accent-blue shrink-0"}):t==="completed"?g.jsx(vu,{size:11,className:"text-accent-green shrink-0"}):t==="failed"?g.jsx(bu,{size:11,className:"text-accent-red shrink-0"}):g.jsx(R1,{size:11,className:"text-dark-muted shrink-0"})}const IB=(t,e)=>e(t==="running"||t==="scheduled"?"widgets.agentFlow.statusRunning":t==="completed"?"widgets.agentFlow.statusCompleted":t==="failed"?"widgets.agentFlow.statusFailed":"widgets.agentFlow.statusIdle"),qw=t=>t.toLowerCase(),PB=N.memo(function({sessionId:e}){const{t:n}=tt(),r=ot(h=>e?h.getAgentsForSession(e):[]),a=ot(h=>e?h.getEventsForSession(e).filter(p=>p.source==="agent"||p.source==="plan").slice(0,30):[]),[i,l]=N.useState(!1),c=N.useMemo(()=>{if(r.length===0)return[];const h=new Map(r.map(b=>[qw(b.name),b])),p=jB.map(b=>h.get(qw(b))).filter(Boolean),m=r.filter(b=>!p.some(x=>x.id===b.id));return[...p,...m]},[r]),d=c.filter(h=>h.status==="running"||h.status==="scheduled").length;return c.length===0?null:g.jsx(wo,{id:"agent-flow",title:"Agent",icon:g.jsx(i_,{size:13,className:"text-accent-purple shrink-0"}),action:d>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:[c.slice(0,8).map(h=>g.jsxs("div",{className:"flex items-center gap-1.5 py-0.5",children:[BB(h.status),g.jsxs("span",{className:ut("min-w-0 flex-1 text-[11px] leading-snug break-words",h.status==="running"||h.status==="scheduled"?"text-dark-text":"text-dark-muted"),children:[h.name,h.currentTask&&g.jsxs("span",{className:"text-dark-muted/70",children:[" · ",h.currentTask]})]}),g.jsx("span",{className:"text-[8px] text-dark-muted/50 shrink-0",children:IB(h.status,n)})]},h.id)),c.length>8&&g.jsx("div",{className:"text-[10px] text-dark-muted text-center pt-0.5",children:n("widgets.agentFlow.moreAgents",{count:c.length-8})}),a.length>0&&g.jsxs(g.Fragment,{children:[g.jsxs("button",{type:"button",onClick:()=>l(h=>!h),className:"w-full flex items-center gap-1 pt-1 text-[10px] text-dark-muted hover:text-dark-text transition-colors",children:[g.jsx(yi,{size:10,className:ut("transition-transform",i&&"rotate-180")}),n("widgets.agentFlow.eventLog",{count:a.length})]}),i&&g.jsx("div",{className:"space-y-1 pt-1 max-h-32 overflow-y-auto custom-scrollbar",children:a.map(h=>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:h.title||h.type}),h.message&&g.jsx("span",{className:"block text-dark-muted/80 truncate",children:h.message})]},h.id))})]})]})})});function zB({sessionId:t}){const[e,n]=N.useState([]);return N.useEffect(()=>{let r=!1;return Q.get("/api/plugins/ui").then(a=>{var i;r||n((((i=a==null?void 0:a.data)==null?void 0:i.ui)??[]).filter(l=>l.mount==="inline"))}).catch(()=>{}),()=>{r=!0}},[]),e.length===0?null:g.jsx(g.Fragment,{children:e.map(r=>g.jsx("div",{className:"rounded-xl border border-dark-border bg-dark-surface overflow-hidden",style:{height:220},"data-plugin-inline":r.pluginId,children:g.jsx(rS,{contribution:r,hostContext:{sessionId:t,wsUrl:I1()}})},r.id))})}const $B=N.memo(function({sessionId:e,messages:n,onPreview:r}){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(DB,{sessionId:e}),g.jsx(pB,{sessionId:e}),g.jsx(mB,{sessionId:e}),g.jsx(yB,{sessionId:e}),g.jsx(EB,{sessionId:e}),g.jsx(PB,{sessionId:e}),g.jsx(OB,{sessionId:e}),g.jsx(LB,{messages:n,onPreview:r}),g.jsx(zB,{sessionId:e})]})})});function Vw(t,e){var n,r,a;return{artifactMatch:!!((n=e.artifact)!=null&&n.kind&&((r=t.artifactKinds)!=null&&r.includes(e.artifact.kind))),capabilityMatch:!!((a=e.requiredCapabilities)!=null&&a.includes(t.capability)),priority:t.priority??0}}function FB(t,e){return t.artifactMatch!==e.artifactMatch?t.artifactMatch?1:-1:t.capabilityMatch!==e.capabilityMatch?t.capabilityMatch?1:-1:t.priority-e.priority}function UB(t,e){const n=t.filter(i=>i.slots.includes(e.slotId));if(n.length===0)return;if(e.preferredComponentId){const i=n.find(l=>l.id===e.preferredComponentId);if(i)return i}let r=n[0],a=Vw(r,e);for(let i=1;i<n.length;i+=1){const l=Vw(n[i],e);FB(l,a)>0&&(r=n[i],a=l)}return r}const Gm=/^[a-z][a-z0-9._-]*$/;class to extends Error{}class HB{constructor(){Z(this,"defs",new Map);Z(this,"listeners",new Set);Z(this,"versionCounter",0)}getVersion(){return this.versionCounter}onChange(e){return this.listeners.add(e),()=>this.listeners.delete(e)}register(e){return this.assertValid(e),this.defs.set(e.id,e),this.notify(),()=>this.unregister(e.id)}unregister(e){const n=this.defs.delete(e);return n&&this.notify(),n}get(e){return this.defs.get(e)}has(e){return this.defs.has(e)}list(){return[...this.defs.values()].sort((n,r)=>(r.priority??0)-(n.priority??0))}listForSlot(e){return this.list().filter(n=>n.slots.includes(e))}resolve(e){return UB(this.list(),e)}capabilities(){return[...new Set(this.list().map(e=>e.capability))]}clear(){this.defs.size!==0&&(this.defs.clear(),this.notify())}get size(){return this.defs.size}notify(){this.versionCounter+=1;for(const e of[...this.listeners])try{e()}catch(n){console.error("[workspace] registry listener error:",n)}}assertValid(e){var n;if(!e||typeof e!="object")throw new to("[workspace] component def must be an object");if(!Gm.test(e.id))throw new to(`[workspace] invalid component id: ${JSON.stringify(e.id)} (expected ${Gm})`);if(this.defs.has(e.id))throw new to(`[workspace] duplicate component id: "${e.id}"`);if(!Gm.test(e.capability))throw new to(`[workspace] invalid capability id: ${JSON.stringify(e.capability)}`);if(!Array.isArray(e.slots)||e.slots.length===0||e.slots.some(r=>typeof r!="string"||r.length===0))throw new to(`[workspace] component "${e.id}" must declare at least one non-empty slot`);if(typeof e.component!="function"&&typeof((n=e.component)==null?void 0:n.render)!="function")throw new to(`[workspace] component "${e.id}" has no renderable component`);if(e.priority!==void 0&&(typeof e.priority!="number"||!Number.isFinite(e.priority)))throw new to(`[workspace] component "${e.id}" priority must be a finite number`)}}const my=new HB,Ww=32;function qm(t){if(typeof t!="object"||t===null)return!1;const e=t;return e.type==="slot"||e.type==="split"||e.type==="stack"}function aS(t,e=0){if(!qm(t))return["layout root must be a slot/split/stack node"];const n=[],r=(a,i,l)=>{if(l>Ww){n.push(`${i}: exceeds max nesting depth ${Ww}`);return}switch(a.type){case"slot":{(typeof a.id!="string"||a.id.length===0)&&n.push(`${i}: slot requires a non-empty id`);break}case"split":{a.direction!=="horizontal"&&a.direction!=="vertical"&&n.push(`${i}: split requires direction "horizontal"|"vertical"`),!Array.isArray(a.children)||a.children.length<2?n.push(`${i}: split requires at least 2 children`):a.sizes!==void 0&&(!Array.isArray(a.sizes)||a.sizes.length!==a.children.length?n.push(`${i}: split sizes must match children count`):a.sizes.some(c=>typeof c!="number"||!Number.isFinite(c)||c<=0)&&n.push(`${i}: split sizes must be positive finite numbers`)),Array.isArray(a.children)&&a.children.forEach((c,d)=>{qm(c)?r(c,`${i}.children[${d}]`,l+1):n.push(`${i}.children[${d}]: invalid node`)});break}case"stack":{!Array.isArray(a.children)||a.children.length<1?n.push(`${i}: stack requires at least 1 child`):a.children.forEach((c,d)=>{qm(c)?r(c,`${i}.children[${d}]`,l+1):n.push(`${i}.children[${d}]: invalid node`)});break}}};return r(t,"$",e),n}class GB{constructor(e={}){Z(this,"listeners",new Map);Z(this,"onError");this.onError=e.onError??((n,r)=>{console.error(`[workspace] EventBus handler error for "${String(r)}":`,n)})}on(e,n){let r=this.listeners.get(e);return r||(r=new Set,this.listeners.set(e,r)),r.add(n),()=>this.off(e,n)}once(e,n){const r=a=>{this.off(e,r),n(a)};return this.on(e,r)}off(e,n){const r=this.listeners.get(e);r&&(r.delete(n),r.size===0&&this.listeners.delete(e))}emit(e,n){const r=this.listeners.get(e);if(!(!r||r.size===0))for(const a of[...r])try{a(n)}catch(i){this.onError(i,String(e),a)}}listenerCount(e){var r;if(e!==void 0)return((r=this.listeners.get(e))==null?void 0:r.size)??0;let n=0;for(const a of this.listeners.values())n+=a.size;return n}clear(){this.listeners.clear()}}const qB=/^[a-z][a-z0-9._-]*$/;function Vm(t){return typeof t=="string"&&qB.test(t)}const f0="";let Kw=0;function VB(t="cmd"){const e=typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2)}`;return Kw+=1,`${t}-${Kw}-${e}`}const WB=1e4;class KB{constructor(e={}){Z(this,"handlers",new Map);Z(this,"capabilityToCommand",new Map);Z(this,"pending",new Map);Z(this,"defaultTimeoutMs");Z(this,"onError");this.defaultTimeoutMs=e.defaultTimeoutMs??WB,this.onError=e.onError??((n,r)=>{console.error(`[workspace] CommandBus handler error for "${r}":`,n)})}register(e,n,r={}){if(!Vm(e))throw new Error(`[workspace] invalid command id: ${JSON.stringify(e)}`);const a=r.scope??f0;if(a!==f0&&!Vm(a))throw new Error(`[workspace] invalid command scope: ${JSON.stringify(a)}`);let i=this.handlers.get(e);if(i||(i=new Map,this.handlers.set(e,i)),i.has(a))throw new Error(`[workspace] duplicate command handler: "${e}"${a?` (scope: ${a})`:""}`);if(r.capability!==void 0){if(!Vm(r.capability))throw new Error(`[workspace] invalid capability id: ${JSON.stringify(r.capability)}`);if(this.capabilityToCommand.has(r.capability))throw new Error(`[workspace] duplicate capability mapping: "${r.capability}"`);this.capabilityToCommand.set(r.capability,e)}i.set(a,n);let l=!1;return()=>{if(l)return;l=!0;const c=this.handlers.get(e);c&&(c.delete(a),c.size===0&&this.handlers.delete(e)),r.capability!==void 0&&this.capabilityToCommand.delete(r.capability)}}has(e){return this.handlers.has(e)}listCommands(){return[...this.handlers.keys()]}resolveCapability(e){return this.capabilityToCommand.get(e)}capabilities(){return[...this.capabilityToCommand.entries()].map(([e,n])=>({capability:e,command:n}))}async execute(e,n,r={}){const a=r.requestId??VB(),i=this.resolveHandler(e,r.scope);if(!i)return{success:!1,requestId:a,command:e,error:`unknown command: "${e}"`,durationMs:0};const l=r.timeoutMs??this.defaultTimeoutMs,c=Date.now(),d=`command "${e}" timed out after ${l}ms`;return await new Promise(h=>{const p=setTimeout(()=>{this.pending.delete(a),h({success:!1,requestId:a,command:e,error:d,durationMs:Date.now()-c})},l);this.pending.set(a,{resolve:h,timer:p,startedAt:c,command:e}),Promise.resolve().then(()=>i(n,{requestId:a,command:e})).then(m=>{this.settle(a,{success:!0,requestId:a,command:e,result:m,durationMs:Date.now()-c})},m=>{this.onError(m,e),this.settle(a,{success:!1,requestId:a,command:e,error:m instanceof Error?m.message:String(m),durationMs:Date.now()-c})})})}handle(e){return this.execute(e.command,e.payload,{timeoutMs:e.timeoutMs,requestId:e.id,scope:e.scope})}resolveHandler(e,n){const r=this.handlers.get(e);if(r){if(n&&n!==f0){const a=r.get(n);if(a)return a}return r.get(f0)}}cancel(e,n="cancelled"){const r=this.pending.get(e);return r?(this.pending.delete(e),r.timer&&clearTimeout(r.timer),r.resolve({success:!1,requestId:e,command:r.command,error:n,durationMs:Date.now()-r.startedAt}),!0):!1}pendingCount(){return this.pending.size}settle(e,n){const r=this.pending.get(e);r&&(this.pending.delete(e),r.timer&&clearTimeout(r.timer),r.resolve(n))}}const YB=/^[a-zA-Z]:[\\/]/,ZB=/\0/;function XB(t){if(typeof t!="string"||t.length===0||ZB.test(t)||YB.test(t)||t.startsWith("/")||t.startsWith("\\"))return!1;const e=t.replace(/\\/g,"/").split("/");let n=0;for(const r of e)if(!(r===""||r==="."))if(r===".."){if(n-=1,n<0)return!1}else n+=1;return!0}function Yw(t,e=""){if(!XB(t))throw new Error(`[workspace] unsafe path rejected: ${JSON.stringify(t)}`);const n=t.replace(/\\/g,"/").split("/"),r=[];for(const l of n)l===""||l==="."||(l===".."?r.pop():r.push(l));const a=r.join("/");return e?`${e.replace(/[\\/]+$/,"")}/${a}`:a}class sS{diff(e,n,r={}){let a;typeof r=="function"?(a=r,r={}):"callback"in r&&(a=r.callback);const i=this.castInput(e,r),l=this.castInput(n,r),c=this.removeEmpty(this.tokenize(i,r)),d=this.removeEmpty(this.tokenize(l,r));return this.diffWithOptionsObj(c,d,r,a)}diffWithOptionsObj(e,n,r,a){var i;const l=T=>{if(T=this.postProcess(T,r),a){setTimeout(function(){a(T)},0);return}else return T},c=n.length,d=e.length;let h=1,p=c+d;r.maxEditLength!=null&&(p=Math.min(p,r.maxEditLength));const m=(i=r.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,r);if(x[0].oldPos+1>=d&&w+1>=c)return l(this.buildValues(x[0].lastComponent,n,e));let S=-1/0,E=1/0;const A=()=>{for(let T=Math.max(S,-h);T<=Math.min(E,h);T+=2){let D;const M=x[T-1],B=x[T+1];M&&(x[T-1]=void 0);let I=!1;if(B){const W=B.oldPos-T;I=B&&0<=W&&W<c}const U=M&&M.oldPos+1<d;if(!I&&!U){x[T]=void 0;continue}if(!U||I&&M.oldPos<B.oldPos?D=this.addToPath(B,!0,!1,0,r):D=this.addToPath(M,!1,!0,1,r),w=this.extractCommon(D,n,e,T,r),D.oldPos+1>=d&&w+1>=c)return l(this.buildValues(D.lastComponent,n,e))||!0;x[T]=D,D.oldPos+1>=d&&(E=Math.min(E,T-1)),w+1>=c&&(S=Math.max(S,T+1))}h++};if(a)(function T(){setTimeout(function(){if(h>p||Date.now()>b)return a(void 0);A()||T()},0)})();else for(;h<=p&&Date.now()<=b;){const T=A();if(T)return T}}addToPath(e,n,r,a,i){const l=e.lastComponent;return l&&!i.oneChangePerToken&&l.added===n&&l.removed===r?{oldPos:e.oldPos+a,lastComponent:{count:l.count+1,added:n,removed:r,previousComponent:l.previousComponent}}:{oldPos:e.oldPos+a,lastComponent:{count:1,added:n,removed:r,previousComponent:l}}}extractCommon(e,n,r,a,i){const l=n.length,c=r.length;let d=e.oldPos,h=d-a,p=0;for(;h+1<l&&d+1<c&&this.equals(r[d+1],n[h+1],i);)h++,d++,p++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return p&&!i.oneChangePerToken&&(e.lastComponent={count:p,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=d,h}equals(e,n,r){return r.comparator?r.comparator(e,n):e===n||!!r.ignoreCase&&e.toLowerCase()===n.toLowerCase()}removeEmpty(e){const n=[];for(let r=0;r<e.length;r++)e[r]&&n.push(e[r]);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,r){const a=[];let i;for(;e;)a.push(e),i=e.previousComponent,delete e.previousComponent,e=i;a.reverse();const l=a.length;let c=0,d=0,h=0;for(;c<l;c++){const p=a[c];if(p.removed)p.value=this.join(r.slice(h,h+p.count)),h+=p.count;else{if(!p.added&&this.useLongestToken){let m=n.slice(d,d+p.count);m=m.map(function(b,x){const w=r[h+x];return w.length>b.length?w:b}),p.value=this.join(m)}else p.value=this.join(n.slice(d,d+p.count));d+=p.count,p.added||(h+=p.count)}}return a}}class QB extends sS{constructor(){super(...arguments),this.tokenize=eI}equals(e,n,r){return r.ignoreWhitespace?((!r.newlineIsToken||!e.includes(`
450
- `))&&(e=e.trim()),(!r.newlineIsToken||!n.includes(`
451
- `))&&(n=n.trim())):r.ignoreNewlineAtEof&&!r.newlineIsToken&&(e.endsWith(`
452
- `)&&(e=e.slice(0,-1)),n.endsWith(`
453
- `)&&(n=n.slice(0,-1))),super.equals(e,n,r)}}const JB=new QB;function f1(t,e,n){return JB.diff(t,e,n)}function eI(t,e){e.stripTrailingCr&&(t=t.replace(/\r\n/g,`
454
- `));const n=[],r=t.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let a=0;a<r.length;a++){const i=r[a];a%2&&!e.newlineIsToken?n[n.length-1]+=i:n.push(i)}return n}class tI extends sS{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}}const nI=new tI;function rI(t,e,n){return nI.diff(t,e,n)}function aI(t){for(let e=0;e<t.length;e++)if(t[e]<" "||t[e]>"~"||t[e]==='"'||t[e]==="\\")return!0;return!1}function ii(t){if(!aI(t))return t;let e='"';const n=new TextEncoder().encode(t);let r=0;for(;r<n.length;){const a=n[r];a===7?e+="\\a":a===8?e+="\\b":a===9?e+="\\t":a===10?e+="\\n":a===11?e+="\\v":a===12?e+="\\f":a===13?e+="\\r":a===34?e+='\\"':a===92?e+="\\\\":a>=32&&a<=126?e+=String.fromCharCode(a):e+="\\"+a.toString(8).padStart(3,"0"),r++}return e+='"',e}const Zw={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};function sI(t,e,n,r,a,i,l){let c;c={},typeof c.context>"u"&&(c.context=4);const d=c.context;if(c.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(c.callback){const{callback:p}=c;f1(n,r,Object.assign(Object.assign({},c),{callback:m=>{const b=h(m);p(b)}}))}else return h(f1(n,r,c));function h(p){if(!p)return;p.push({value:"",lines:[]});function m(T){return T.map(function(D){return" "+D})}const b=[];let x=0,w=0,S=[],E=1,A=1;for(let T=0;T<p.length;T++){const D=p[T],M=D.lines||iI(D.value);if(D.lines=M,D.added||D.removed){if(!x){const B=p[T-1];x=E,w=A,B&&(S=d>0?m(B.lines.slice(-d)):[],x-=S.length,w-=S.length)}for(const B of M)S.push((D.added?"+":"-")+B);D.added?A+=M.length:E+=M.length}else{if(x)if(M.length<=d*2&&T<p.length-2)for(const B of m(M))S.push(B);else{const B=Math.min(M.length,d);for(const U of m(M.slice(0,B)))S.push(U);const I={oldStart:x,oldLines:E-x+B,newStart:w,newLines:A-w+B,lines:S};b.push(I),x=0,w=0,S=[]}E+=M.length,A+=M.length}}for(const T of b)for(let D=0;D<T.lines.length;D++)T.lines[D].endsWith(`
455
- `)?T.lines[D]=T.lines[D].slice(0,-1):(T.lines.splice(D+1,0,"\"),D++);return{oldFileName:t,newFileName:e,oldHeader:a,newHeader:i,hunks:b}}}function iS(t,e){var n,r,a,i,l,c;if(e||(e=Zw),Array.isArray(t)){if(t.length>1&&!e.includeFileHeaders&&!t.every(p=>p.isGit))throw new Error("Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)");return t.map(p=>iS(p,e)).join(`
456
- `)}const d=[];if(t.isGit){if(e=Zw,!t.oldFileName)throw new Error("oldFileName must be specified for Git patches");if(!t.newFileName)throw new Error("newFileName must be specified for Git patches");let p=t.oldFileName,m=t.newFileName;t.isCreate&&p==="/dev/null"?p=m.replace(/^b\//,"a/"):t.isDelete&&m==="/dev/null"&&(m=p.replace(/^a\//,"b/")),d.push("diff --git "+ii(p)+" "+ii(m)),t.isDelete&&d.push("deleted file mode "+((n=t.oldMode)!==null&&n!==void 0?n:"100644")),t.isCreate&&d.push("new file mode "+((r=t.newMode)!==null&&r!==void 0?r:"100644")),t.oldMode&&t.newMode&&!t.isDelete&&!t.isCreate&&(d.push("old mode "+t.oldMode),d.push("new mode "+t.newMode)),t.isRename&&(d.push("rename from "+ii(((a=t.oldFileName)!==null&&a!==void 0?a:"").replace(/^a\//,""))),d.push("rename to "+ii(((i=t.newFileName)!==null&&i!==void 0?i:"").replace(/^b\//,"")))),t.isCopy&&(d.push("copy from "+ii(((l=t.oldFileName)!==null&&l!==void 0?l:"").replace(/^a\//,""))),d.push("copy to "+ii(((c=t.newFileName)!==null&&c!==void 0?c:"").replace(/^b\//,""))))}else e.includeIndex&&t.oldFileName==t.newFileName&&t.oldFileName!==void 0&&d.push("Index: "+t.oldFileName),e.includeUnderline&&d.push("===================================================================");const h=t.hunks.length>0;e.includeFileHeaders&&t.oldFileName!==void 0&&t.newFileName!==void 0&&(!t.isGit||h)&&(d.push("--- "+ii(t.oldFileName)+(t.oldHeader?" "+t.oldHeader:"")),d.push("+++ "+ii(t.newFileName)+(t.newHeader?" "+t.newHeader:"")));for(let p=0;p<t.hunks.length;p++){const m=t.hunks[p],b=m.oldLines===0?m.oldStart-1:m.oldStart,x=m.newLines===0?m.newStart-1:m.newStart;d.push("@@ -"+b+","+m.oldLines+" +"+x+","+m.newLines+" @@");for(const w of m.lines)d.push(w)}return d.join(`
457
- `)+`
458
- `}function Wm(t,e,n,r,a,i,l){{const c=sI(t,e,n,r,a,i);return c?iS(c,void 0):void 0}}function iI(t){const e=t.endsWith(`
459
- `),n=t.split(`
460
- `).map(r=>r+`
461
- `);return e?n.pop():n.push(n.pop().slice(0,-1)),n}function oI(t,e){const n=t?new Map(t.files.map(c=>[c.path,c.content])):new Map,r=new Map(e.files.map(c=>[c.path,c.content])),i=[...new Set([...n.keys(),...r.keys()])].sort().map(c=>{const d=n.get(c)??"",h=r.get(c)??"",p=n.has(c),m=r.has(c);if(!p&&m){const S=h.length===0?0:(h.match(/\n/g)??[]).length;return{path:c,change:"added",addedLines:S,removedLines:0,patch:Wm(c,c,"",h)}}if(p&&!m){const S=d.length===0?0:(d.match(/\n/g)??[]).length;return{path:c,change:"removed",addedLines:0,removedLines:S,patch:Wm(c,c,d,"")}}if(d===h)return{path:c,change:"unchanged",addedLines:0,removedLines:0};const b=f1(d,h);let x=0,w=0;for(const S of b){const E=(S.value.match(/\n/g)??[]).length;S.added?x+=E:S.removed&&(w+=E)}return{path:c,change:"modified",addedLines:x,removedLines:w,patch:Wm(c,c,d,h)}}),l=i.filter(c=>c.change!=="unchanged");return{fromId:(t==null?void 0:t.id)??null,toId:e.id,files:i,totalAdded:l.reduce((c,d)=>c+d.addedLines,0),totalRemoved:l.reduce((c,d)=>c+d.removedLines,0),changedFileCount:l.length}}const oS=N.createContext(null);function gy(){const t=N.useContext(oS);if(!t)throw new Error("[workspace] useArtifactContext must be used inside <ArtifactProvider>");return t}let Xw=0;function lI(){return Xw+=1,`v${Xw}-${Date.now().toString(36)}`}function cI({children:t,initial:e,versionStore:n}){const[r,a]=N.useState((e==null?void 0:e.artifactId)??null),[i,l]=N.useState((e==null?void 0:e.kind)??"unknown"),[c,d]=N.useState((e==null?void 0:e.files)??{}),[h,p]=N.useState((e==null?void 0:e.versions)??[]),[m,b]=N.useState((e==null?void 0:e.previewUrl)??null),x=N.useCallback((D,M)=>{const B=Yw(D);d(I=>({...I,[B]:M}))},[]),w=N.useCallback(D=>{const M=Yw(D);d(B=>{if(!(M in B))return B;const I={...B};return delete I[M],I})},[]),S=N.useCallback(D=>{if(Object.keys(c).length===0)return null;const M={id:lI(),createdAt:Date.now(),files:Object.entries(c).map(([B,I])=>({path:B,content:I})),message:D};return p(B=>[...B,M]),n&&r&&n.persistVersion(r,M).then(B=>{B.ok||console.warn("[workspace] failed to persist version snapshot",B.error)}),M},[c,r,n]),E=N.useCallback(D=>{const M=h.find(B=>B.id===D);return M?(d(Object.fromEntries(M.files.map(B=>[B.path,B.content]))),!0):!1},[h]),A=N.useCallback((D,M)=>{const B=h.find(U=>U.id===M);if(!B)return null;const I=D===null?null:h.find(U=>U.id===D)??null;return oI(I,B)},[h]),T=N.useMemo(()=>({artifactId:r,kind:i,files:c,versions:h,previewUrl:m,setArtifactId:a,setKind:l,saveFile:x,deleteFile:w,addVersion:S,restoreVersion:E,diffVersions:A,setPreviewUrl:b}),[r,i,c,h,m,x,w,S,E,A]);return g.jsx(oS.Provider,{value:T,children:t})}const sl=gn()(t=>({layout:null,device:"desktop",activeSlot:null,setLayout:e=>t({layout:e}),setDevice:e=>t({device:e}),setActiveSlot:e=>t({activeSlot:e})})),lS=N.createContext(null);function uI(){const t=N.useContext(lS);if(!t)throw new Error("[workspace] useViewContext must be used inside <ViewProvider>");return t}function dI({children:t,layout:e,syncOnMount:n=!0}){const r=sl(p=>p.layout),a=sl(p=>p.device),i=sl(p=>p.activeSlot),l=sl(p=>p.setLayout),c=sl(p=>p.setDevice),d=sl(p=>p.setActiveSlot);N.useEffect(()=>{n&&e!==void 0&&e!==r&&l(e)},[]);const h=N.useMemo(()=>({layout:e??r,device:a,activeSlot:i,setLayout:l,setDevice:c,setActiveSlot:d}),[e,r,a,i,l,c,d]);return g.jsx(lS.Provider,{value:h,children:t})}const cS=N.createContext(null);function fI(){const t=N.useContext(cS);if(!t)throw new Error("[workspace] useSessionContext must be used inside <SessionProvider>");return t}function hI({children:t,initial:e}){const[n,r]=N.useState((e==null?void 0:e.conversationId)??null),[a,i]=N.useState((e==null?void 0:e.task)??""),[l,c]=N.useState((e==null?void 0:e.toolCalls)??[]),d=N.useCallback(m=>{c(b=>[...b,m])},[]),h=N.useCallback((m,b)=>{c(x=>x.map(w=>w.id===m?{...w,...b}:w))},[]),p=N.useMemo(()=>({conversationId:n,task:a,toolCalls:l,setConversationId:r,setTask:i,appendToolCall:d,updateToolCall:h}),[n,a,l,d,h]);return g.jsx(cS.Provider,{value:p,children:t})}class pI{constructor(){Z(this,"providers",new Map)}register(e,n,r){if(this.providers.has(e))throw new Error(`[workspace] duplicate context provider: "${e}"`);return this.providers.set(e,{provider:n,value:r}),()=>this.unregister(e)}unregister(e){return this.providers.delete(e)}get(e){var n;return(n=this.providers.get(e))==null?void 0:n.provider}valueOf(e){var n;return(n=this.providers.get(e))==null?void 0:n.value}entries(){return[...this.providers.entries()].map(([e,n])=>[e,n.provider,n.value])}clear(){this.providers.clear()}}const mI=new pI,uS=N.createContext(null);function gI(){const t=N.useContext(uS);if(!t)throw new Error("[workspace] useWorkspace must be used inside <WorkspaceProvider>");return t}function yI({children:t,registry:e=my,layout:n,artifact:r,session:a,mountExtraContexts:i=!0}){const l=N.useRef(null);l.current===null&&(l.current={registry:e,eventBus:new GB,commandBus:new KB,registryVersion:0});const[c,d]=N.useState(0);N.useEffect(()=>e.onChange(()=>d(b=>b+1)),[e]);const h=N.useMemo(()=>({...l.current,registryVersion:c}),[c]),p=N.useMemo(()=>i?mI.entries():[],[i]);let m=t;for(const[b,x,w]of p)m=g.jsx(x,{value:w,children:m},b);return g.jsx(uS.Provider,{value:h,children:g.jsx(cI,{initial:r,children:g.jsx(dI,{layout:n,children:g.jsx(hI,{initial:a,children:m})})})})}function Uf(){const t=gI(),e=gy(),n=uI(),r=fI();return N.useMemo(()=>({...t,artifact:e,view:n,session:r}),[t,e,n,r])}function bI({label:t}){return g.jsx("div",{className:"flex h-full w-full items-center justify-center text-xs text-dark-muted","data-testid":"workspace-slot-loading",children:t?`Loading ${t}…`:"Loading…"})}function vI({slotId:t}){return g.jsxs("div",{className:"flex h-full w-full items-center justify-center border border-dashed border-dark-border text-xs text-dark-muted","data-testid":`workspace-empty-slot-${t}`,children:["No component for slot “",t,"”"]})}function Hf({message:t}){return g.jsx("div",{className:"flex h-full w-full items-center justify-center bg-red-950/30 p-3 text-xs text-red-300","data-testid":"workspace-slot-error",children:t})}class xI extends N.Component{constructor(){super(...arguments);Z(this,"state",{error:null})}static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,r){console.error("[workspace] slot component crashed:",n,r.componentStack)}render(){return this.state.error?this.props.fallback?this.props.fallback(this.state.error):Hf({message:this.state.error.message}):this.props.children}}function wI({slotId:t,componentId:e,requiredCapabilities:n,preferredComponentId:r}){const{registry:a,artifact:i}=Uf(),l=(e?a.get(e):void 0)??a.resolve({slotId:t,artifact:i.artifactId?{kind:i.kind}:null,requiredCapabilities:n,preferredComponentId:r});return g.jsx(kI,{slotId:t,def:l})}function kI({slotId:t,def:e}){const{eventBus:n,commandBus:r,artifact:a}=Uf(),i=e==null?void 0:e.component;return N.useEffect(()=>{var l;if((l=e==null?void 0:e.lifecycle)!=null&&l.mount)return e.lifecycle.mount({artifactId:a.artifactId??void 0,eventBus:n,commandBus:r}),()=>{var c,d;return(d=(c=e.lifecycle)==null?void 0:c.unmount)==null?void 0:d.call(c,{artifactId:a.artifactId??void 0,eventBus:n,commandBus:r})}},[e,n,r,a.artifactId]),!e||!i?g.jsx(vI,{slotId:t}):g.jsx(xI,{children:g.jsx(N.Suspense,{fallback:g.jsx(bI,{label:e.id}),children:g.jsx(i,{slotId:t,defId:e.id})})})}function SI({layout:t}){if(!t)return g.jsx("div",{className:"flex h-full w-full items-center justify-center text-xs text-dark-muted","data-testid":"workspace-empty",children:"Workspace is empty — no layout configured"});const e=aS(t);return e.length>0?g.jsx(Hf,{message:`Invalid workspace layout: ${e.join("; ")}`}):g.jsx(h1,{node:t})}function h1({node:t}){switch(t.type){case"slot":return g.jsx(wI,{slotId:t.id,componentId:t.componentId});case"split":return g.jsxs(y3,{direction:t.direction==="horizontal"?"horizontal":"vertical",className:"h-full w-full overflow-hidden",children:[t.children.map((e,n)=>{var r;return g.jsx(dg,{defaultSize:((r=t.sizes)==null?void 0:r[n])??50,className:"min-h-0 min-w-0",children:g.jsx(h1,{node:e})},n)}),t.children.slice(0,-1).map((e,n)=>g.jsx(b3,{className:"w-px bg-dark-border transition-colors hover:bg-accent-blue data-[resize-handle-state=hover]:bg-accent-blue data-[resize-handle-state=drag]:bg-accent-blue"},`h-${n}`))]});case"stack":return g.jsx("div",{className:"flex h-full w-full flex-col overflow-hidden",children:t.children.map((e,n)=>g.jsx("div",{className:"min-h-0 min-w-0 flex-1 border-b border-dark-border last:border-b-0",children:g.jsx(h1,{node:e})},n))});default:return g.jsx(Hf,{message:`Unknown layout node: ${JSON.stringify(t)}`})}}const _I="1",CI=["ready","select","inspect","screenshot","highlight","command","event"];function EI(t){return typeof t=="string"&&CI.includes(t)}function TI(t){if(typeof t!="object"||t===null||Array.isArray(t))return{ok:!1,error:"workspace message must be a plain object"};const e=t;return e.version!==_I?{ok:!1,error:`unsupported workspace protocol version: ${JSON.stringify(e.version)}`}:EI(e.type)?typeof e.requestId!="string"||e.requestId.length===0?{ok:!1,error:"workspace message requires a non-empty requestId"}:{ok:!0,data:{version:e.version,type:e.type,requestId:e.requestId,payload:e.payload}}:{ok:!1,error:`unknown workspace message type: ${JSON.stringify(e.type)}`}}function AI({layout:t=null,registry:e=my,artifact:n,session:r,onRegister:a,toolbar:i,statusBar:l,onLayoutError:c}){N.useEffect(()=>{if(a)return a(e)},[]);const d=t?aS(t):[];return d.length>0?(c==null||c(d),g.jsx("div",{className:"flex h-full w-full flex-col bg-dark-surface","data-testid":"workspace-runtime",children:g.jsx(Hf,{message:`Invalid workspace layout: ${d.join("; ")}`})})):g.jsx("div",{className:"flex h-full w-full flex-col overflow-hidden bg-dark-surface","data-testid":"workspace-runtime",children:g.jsxs(yI,{registry:e,layout:t,artifact:n,session:r,children:[i&&g.jsx("div",{className:"shrink-0 border-b border-dark-border",children:i}),g.jsx("div",{className:"min-h-0 min-w-0 flex-1",children:g.jsx(SI,{layout:t})}),l&&g.jsx("div",{className:"shrink-0 border-t border-dark-border",children:l})]})})}const Qc="demo.ping",p1="demo.pong",NI=`<!doctype html>
462
- <html>
463
- <head><meta charset="utf-8"><title>Demo Artifact</title></head>
464
- <body style="font-family:system-ui;padding:24px;background:#0f172a;color:#e2e8f0">
465
- <h2>AI 生成的工作台工件</h2>
466
- <p>这个页面运行在 <code>sandbox="allow-scripts allow-forms allow-modals"</code> 的 iframe 中。</p>
467
- <button id="say" onclick="parent.postMessage({version:'1',type:'event',requestId:'demo-1',payload:{event:'preview.interaction',data:{clicked:true}}},'*')">点击向宿主发送事件</button>
468
- <script>document.getElementById('say').textContent='✓ 已就绪(blob: opaque origin)'<\/script>
469
- </body>
470
- </html>`;function Qw({slotId:t,defId:e}){const{eventBus:n,commandBus:r}=Uf(),a=gy(),[i,l]=N.useState(0),[c,d]=N.useState(null);return N.useEffect(()=>{const h=n.on(Qc,()=>l(b=>b+1));let p;e==="panel-b"&&(p=r.register(p1,()=>(d(new Date().toISOString()),{pong:!0,slotId:t})));let m;return e==="panel-a"&&(m=setTimeout(()=>n.emit(Qc,{from:e}),0)),()=>{h(),p==null||p(),m&&clearTimeout(m)}},[n,r,e,t]),g.jsxs("div",{className:"flex h-full w-full flex-col gap-2 p-3","data-testid":`test-panel-${e}`,children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsx("span",{className:"text-xs font-semibold text-dark-text",children:e}),g.jsxs("span",{className:"text-[10px] text-dark-muted",children:["slot: ",t]})]}),g.jsxs("div",{className:"flex items-center gap-2 text-xs text-dark-muted",children:[g.jsx("span",{"data-testid":`ping-count-${e}`,children:i}),g.jsx("button",{type:"button",onClick:()=>n.emit(Qc,{from:e}),className:"rounded bg-accent-blue/10 px-2 py-0.5 text-accent-blue hover:bg-accent-blue/20",children:"emit ping"}),e==="panel-b"&&g.jsx("button",{type:"button",onClick:()=>{const h=URL.createObjectURL(new Blob([NI],{type:"text/html"}));a.setArtifactId("demo/index.html"),a.setKind("web"),a.setPreviewUrl(h)},className:"rounded bg-accent-green/10 px-2 py-0.5 text-accent-green hover:bg-accent-green/20","data-testid":"demo-preview-button",children:"preview demo"})]}),c&&g.jsxs("div",{className:"text-[10px] text-emerald-400","data-testid":`pong-${e}`,children:["pong @ ",c]})]})}function RI(t=my){const e=t.register({id:"panel-a",capability:"demo.panel.a",component:Qw,slots:["left"],priority:10,metadata:{label:"Panel A"},lifecycle:{mount:()=>{},unmount:()=>{}}}),n=t.register({id:"panel-b",capability:"demo.panel.b",component:Qw,slots:["right"],priority:10,metadata:{label:"Panel B"},aiManifest:{description:"Demo panel that responds to demo.pong commands",commands:[p1],capabilities:[{capability:"demo.panel.b.pong",command:p1,description:"Ping back from panel-b",parameters:[{name:"from",type:"string",description:"who is pinging",required:!1}]}],events:{listen:[Qc],emit:[Qc]}}});return()=>{e(),n()}}const MI={select:"preview.element.select",inspect:"preview.element.inspect",screenshot:"preview.element.screenshot",highlight:"preview.element.highlight"};function DI(t,e){const n=e??{},r=typeof n.selector=="string"&&n.selector.trim()!==""?n.selector:void 0,a=typeof n.elementId=="string"&&n.elementId.trim()!==""?n.elementId:void 0;return!r&&!a?{ok:!1,error:`interactive "${t}" message requires a non-empty selector or elementId`}:{ok:!0,elementRef:{selector:r,elementId:a}}}function OI(t,e){var a,i,l,c,d,h,p,m,b;const n=TI(t);if(!n.ok)return(a=e.onError)==null||a.call(e,n.error),!1;const r=n.data;switch(r.type){case"ready":return(i=e.onReady)==null||i.call(e,r),!0;case"event":{const x=r.payload??{};return typeof x.event!="string"?((l=e.onError)==null||l.call(e,`iframe event message requires payload.event string, got ${JSON.stringify(x.event)}`),!1):((c=e.onEvent)==null||c.call(e,x.event,x.data,r),!0)}case"command":{const x=r.payload??{};return typeof x.command!="string"?((d=e.onError)==null||d.call(e,`iframe command message requires payload.command string, got ${JSON.stringify(x.command)}`),!1):((h=e.onCommand)==null||h.call(e,x.command,x.payload,r),!0)}case"select":case"inspect":case"screenshot":case"highlight":{const x=DI(r.type,r.payload);return x.ok?((m=e.onEvent)==null||m.call(e,MI[r.type],{...r.payload??{},elementRef:x.elementRef},r),!0):((p=e.onError)==null||p.call(e,x.error),!1)}default:return(b=e.onError)==null||b.call(e,`unsupported message type: ${JSON.stringify(r.type)}`),!1}}function LI(t,e){const n=N.useRef(e);n.current=e;const r=a=>{var l;const i=(l=t.current)==null?void 0:l.contentWindow;i&&i.postMessage(a,"*")};return N.useEffect(()=>{const a=i=>{var m;const l=(m=t.current)==null?void 0:m.contentWindow;if(l&&i.source!==l||l===void 0&&i.source!==null)return;const{eventBus:c,onCommand:d,onReady:h,onError:p}=n.current;OI(i.data,{onEvent:(b,x)=>c.emit(b,x),onCommand:d??(()=>{}),onReady:h,onError:p})};return window.addEventListener("message",a),()=>window.removeEventListener("message",a)},[t]),{post:r}}function jI(t,e){const n=(t.split(".").pop()||"").toLowerCase();return e==="web"||n==="html"||n==="htm"?"html":["png","jpg","jpeg","gif","svg","webp","ico","bmp"].includes(n)||e==="document"?"image":"text"}function BI({slotId:t}){const{artifactId:e,kind:n,previewUrl:r}=gy(),{eventBus:a}=Uf(),[i,l]=N.useState(null),[c,d]=N.useState(null),[h,p]=N.useState(null),m=N.useRef(null),b=e??null,x=b?jI(b,n):"text";return LI(m,{eventBus:a,onError:w=>p(w)}),N.useEffect(()=>{if(x!=="html"||!b)return;if(r&&r.startsWith("blob:")){d(r),p(null);return}let w=!1;return p(null),l(null),(async()=>{try{const S=await ct.files.read(b);if(w)return;if(!S.success||S.data===void 0){p(S.error||"failed to read artifact");return}const E=new Blob([String(S.data)],{type:"text/html"}),A=URL.createObjectURL(E);l(String(S.data)),d(A)}catch(S){w||p(S instanceof Error?S.message:String(S))}})(),()=>{w=!0,c&&URL.revokeObjectURL(c)}},[x,b,r]),g.jsxs("div",{className:"flex h-full w-full min-h-0 flex-col","data-testid":`web-preview-${t}`,children:[g.jsxs("div",{className:"shrink-0 flex items-center gap-2 border-b border-dark-border/60 px-2 py-1 text-[10px] text-dark-muted",children:[g.jsx("span",{className:"truncate font-mono",children:b??"no artifact"}),g.jsx("span",{className:"ml-auto shrink-0 uppercase",children:x})]}),h&&g.jsx("div",{className:"m-2 rounded border border-accent-red/30 bg-accent-red/5 px-2 py-1.5 text-[11px] text-accent-red",children:h}),g.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:b?x==="html"&&c?g.jsx("iframe",{ref:m,title:`preview-${b}`,sandbox:"allow-scripts allow-forms allow-modals",src:c,className:"h-full w-full border-0 bg-white","data-testid":"web-preview-iframe"}):x==="image"?g.jsx("img",{src:r??void 0,alt:b,className:"mx-auto max-h-full max-w-full object-contain","data-testid":"web-preview-image"}):g.jsx("pre",{className:"whitespace-pre-wrap break-all p-3 font-mono text-[11px] leading-relaxed text-dark-text",children:i??(r?`Loading ${b}…`:`Preview ${b}`)}):g.jsx("div",{className:"grid h-full place-items-center p-4 text-center text-xs text-dark-muted/70",children:"Select an artifact to preview it here."})})]})}function II(t){return t.register({id:"web-preview",capability:"preview.artifact",component:BI,slots:["preview"],priority:10,metadata:{label:"Preview"},aiManifest:{description:"Renders the current artifact (HTML in a sandboxed iframe, images, text)",commands:[],events:{listen:[],emit:[]}}})}var PI=Y8();const Jw=E1(PI);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(/&amp;/,"&"))});Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(e,n){var r={};r["language-"+n]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[n]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var a={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};a["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:a},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 e5={},t5;function zI(){return t5||(t5=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)),e5}zI();(function(t){var e=t.util.clone(t.languages.javascript),n=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,r=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,a=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function i(d,h){return d=d.replace(/<S>/g,function(){return n}).replace(/<BRACES>/g,function(){return r}).replace(/<SPREAD>/g,function(){return a}),RegExp(d,h)}a=i(a).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 h=[],p=0;p<d.length;p++){var m=d[p],b=!1;if(typeof m!="string"&&(m.type==="tag"&&m.content[0]&&m.content[0].type==="tag"?m.content[0].content[0].content==="</"?h.length>0&&h[h.length-1].tagName===l(m.content[0].content[1])&&h.pop():m.content[m.content.length-1].content==="/>"||h.push({tagName:l(m.content[0].content[1]),openedBraces:0}):h.length>0&&m.type==="punctuation"&&m.content==="{"?h[h.length-1].openedBraces++:h.length>0&&h[h.length-1].openedBraces>0&&m.type==="punctuation"&&m.content==="}"?h[h.length-1].openedBraces--:b=!0),(b||typeof m=="string")&&h.length>0&&h[h.length-1].openedBraces===0){var x=l(m);p<d.length-1&&(typeof d[p+1]=="string"||d[p+1].type==="plain-text")&&(x+=l(d[p+1]),d.splice(p+1,1)),p>0&&(typeof d[p-1]=="string"||d[p-1].type==="plain-text")&&(x=l(d[p-1])+x,d.splice(p-1,1),p--),d[p]=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},r={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:r},{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:r},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:r.entity}}],environment:{pattern:RegExp("\\$?"+e),alias:"constant"},variable:r.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 a=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],i=r.variable[1].inside,l=0;l<a.length;l++)i[a[l]]=t.languages.bash[a[l]];t.languages.sh=t.languages.bash,t.languages.shell=t.languages.bash})(Prism);var n5={},r5;function $I(){return r5||(r5=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:/![sra](?=[:}]$)/,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),n5}$I();(function(t){var e=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(p){return p=p.replace(/<inner>/g,function(){return e}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+p+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,a=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),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("^"+a+i+"(?:"+a+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+a+i+")(?:"+a+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:t.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+a+")"+i+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+a+"$"),inside:{"table-header":{pattern:RegExp(r),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(p){["url","bold","italic","strike","code-snippet"].forEach(function(m){p!==m&&(t.languages.markdown[p].inside.content.inside[m]=t.languages.markdown[m])})}),t.hooks.add("after-tokenize",function(p){if(p.language!=="markdown"&&p.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 E=S.content[1],A=S.content[3];if(E&&A&&E.type==="code-language"&&A.type==="code-block"&&typeof E.content=="string"){var T=E.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");T=(/[a-z][\w-]*/i.exec(T)||[""])[0].toLowerCase();var D="language-"+T;A.alias?typeof A.alias=="string"?A.alias=[A.alias,D]:A.alias.push(D):A.alias=[D]}}}m(p.tokens)}),t.hooks.add("wrap",function(p){if(p.type==="code-block"){for(var m="",b=0,x=p.classes.length;b<x;b++){var w=p.classes[b],S=/language-(.+)/.exec(w);if(S){m=S[1];break}}var E=t.languages[m];if(E)p.content=t.highlight(h(p.content),E,m);else if(m&&m!=="none"&&t.plugins.autoloader){var A="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*1e16);p.attributes.id=A,t.plugins.autoloader.loadLanguages(m,function(){var T=document.getElementById(A);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 h(p){var m=p.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\-%#;/?:@&=+$.~*'()]+)?/,r="(?:"+n.source+"(?:[ ]+"+e.source+")?|"+e.source+"(?:[ ]+"+n.source+")?)",a=/(?:[^\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 h=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<value>>/g,function(){return c});return RegExp(h,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 r})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<key>>/g,function(){return"(?:"+a+"|"+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 a5={},s5;function FI(){return s5||(s5=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)),a5}FI();var i5={},o5;function UI(){return o5||(o5=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,r={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":[r,{pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:r.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+n+/[A-Z]\w*\b/.source),lookbehind:!0,inside:r.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":r,keyword:e,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+n+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+n+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:r.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)),i5}UI();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 l5={},c5;function HI(){return c5||(c5=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)),l5}HI();(function(t){function e(n,r){return"___"+n.toUpperCase()+r+"___"}Object.defineProperties(t.languages["markup-templating"]={},{buildPlaceholders:{value:function(n,r,a,i){if(n.language===r){var l=n.tokenStack=[];n.code=n.code.replace(a,function(c){if(typeof i=="function"&&!i(c))return c;for(var d=l.length,h;n.code.indexOf(h=e(r,d))!==-1;)++d;return l[d]=c,h}),n.grammar=t.languages.markup}}},tokenizePlaceholders:{value:function(n,r){if(n.language!==r||!n.tokenStack)return;n.grammar=t.languages[r];var a=0,i=Object.keys(n.tokenStack);function l(c){for(var d=0;d<c.length&&!(a>=i.length);d++){var h=c[d];if(typeof h=="string"||h.content&&typeof h.content=="string"){var p=i[a],m=n.tokenStack[p],b=typeof h=="string"?h:h.content,x=e(r,p),w=b.indexOf(x);if(w>-1){++a;var S=b.substring(0,w),E=new t.Token(r,t.tokenize(m,n.grammar),"language-"+r,m),A=b.substring(w+x.length),T=[];S&&T.push.apply(T,l([S])),T.push(E),A&&T.push.apply(T,l([A])),typeof h=="string"?c.splice.apply(c,[d,1].concat(T)):h.content=T}}else h.content&&l(h.content)}return c}l(n.tokens)}}})})(Prism);var u5={},d5;function GI(){return d5||(d5=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*\()/],r=/\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,a=/<?=>|\?\?=?|\.{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:r,operator:a,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:r,operator:a,punctuation:i}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),t.hooks.add("before-tokenize",function(d){if(/<\?/.test(d.code)){var h=/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;t.languages["markup-templating"].buildPlaceholders(d,"php",h)}}),t.hooks.add("after-tokenize",function(d){t.languages["markup-templating"].tokenizePlaceholders(d,"php")})})(Prism)),u5}GI();var f5={},h5;function qI(){return h5||(h5=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("|")+")",r=/(?:"(?:\\.|[^"\\\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+r),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+r+/(?=:(?!:))/.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)),f5}qI();const VI=.4;function p5(t){const e=[];let n=0;for(;n<t.length;){const r=t[n];if(/[\p{L}\p{N}_]/u.test(r)){let a=n+1;for(;a<t.length&&/[\p{L}\p{N}_]/u.test(t[a]);)a++;e.push(t.slice(n,a)),n=a}else if(/\s/.test(r)){let a=n+1;for(;a<t.length&&/\s/.test(t[a]);)a++;e.push(t.slice(n,a)),n=a}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=rI(p5(t),p5(e)),r=t.length+e.length;let a=0;const i=[],l=[];let c=0,d=0;for(const h of n){const p=h.value.reduce((m,b)=>m+b.length,0);h.removed?(a+=p,i.push({start:c,end:c+p}),c+=p):h.added?(a+=p,l.push({start:d,end:d+p}),d+=p):(c+=p,d+=p)}return r>0&&a/r>VI?[[],[]]:[i,l]}function dS(t){const e=[];let n=null;for(const r of t.split(`
471
- `)){if(r.startsWith("---")||r.startsWith("+++")||r.startsWith("index ")||r.startsWith("diff --git")||r.startsWith("==="))continue;const a=r.match(/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/);if(a){n&&e.push(n),n={oldStart:parseInt(a[1],10),oldLines:parseInt(a[2]??"1",10),newStart:parseInt(a[3],10),newLines:parseInt(a[4]??"1",10),lines:[]};continue}if(!r.startsWith("\\")){if(n&&(r.startsWith("+")||r.startsWith("-")||r.startsWith(" ")||r==="")){n.lines.push(r);continue}n&&r&&(e.push(n),n=null)}}return n&&e.push(n),e}function fS(t){let e=t.oldStart,n=t.newStart;const r=[];for(const a of t.lines){const i=a[0]==="+"||a[0]==="-"?a[0]:" ",l=a.slice(1);let c=null,d=null;i==="-"?c=e++:(i==="+"||(c=e++),d=n++),r.push({marker:i,code:l,oldLine:c,newLine:d})}return r}const h0=4e3,KI=N.memo(function({filePath:e,content:n,language:r,variant:a="card"}){const{t:i}=tt(),[l,c]=N.useState("unified"),[d,h]=N.useState(!1),p=a==="panel",m=YI(e,r),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 E=n||"",A=E.split(`
472
- `);return A.length<=h0?{text:E,dropped:0}:{text:A.slice(0,h0).join(`
473
- `),dropped:A.length-h0}},[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:p?"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:ut("flex items-center gap-2 px-3 py-1.5 bg-dark-surface",p?"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"})]}),!p&&g.jsx("button",{onClick:()=>h(!d),className:"text-xs text-dark-muted hover:text-dark-fg ml-1",children:d?"▶":"▼"})]}),!d&&g.jsxs("div",{className:p?"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:h0,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 a;if(e)return e;if(!t)return"plaintext";const n=(a=t.split(".").pop())==null?void 0:a.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(`
474
- `);let n=0,r=0,a=0;for(const i of e)i.startsWith("@@")?a++:i.startsWith("+")&&!i.startsWith("+++")?n++:i.startsWith("-")&&!i.startsWith("---")&&r++;return{additions:n,deletions:r,hunks:a,filesChanged:1}}function XI(t){const e=[],n=(a,i)=>{if(!i)return;const l=e[e.length-1];l&&l.type===a?l.text+=i:e.push({type:a,text:i})},r=(a,i)=>{if(typeof a=="string"){n(i,a);return}const l=a.type||i;if(typeof a.content=="string"){n(l,a.content);return}for(const c of a.content)r(c,l)};for(const a of t)r(a,"");return e}function hS(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(a=>({...a,word:!1}));const n=[];let r=0;for(const a of t){const i=r,l=r+a.text.length;let c=0;for(const d of e){const h=Math.max(0,d.start-i),p=Math.min(a.text.length,d.end-i);p<=0||h>=a.text.length||(h>c&&n.push({type:a.type,text:a.text.slice(c,h),word:!1}),n.push({type:a.type,text:a.text.slice(h,p),word:!0}),c=p)}c<a.text.length&&n.push({type:a.type,text:a.text.slice(c),word:!1}),r=l}return n}function JI({code:t,marker:e,lang:n,ranges:r}){const a=e==="-"?[{type:"",text:t}]:hS(t,n),i=QI(a,r),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,h)=>g.jsx("span",{className:[d.type?`token ${d.type}`:"",d.word&&e!==" "?c:""].join(" "),children:d.text},h))})}function eP(t,e){const n=dS(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 r=[];let a=0;for(const i of n){const l=fS(i);r.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," @@"]})]},a++));const c=new Map;for(let d=0;d<l.length;){if(l[d].marker!=="-"){d++;continue}const h=d;for(;d<l.length&&l[d].marker==="-";)d++;const p=d;for(;d<l.length&&l[d].marker==="+";)d++;const m=Math.min(p-h,d-p);for(let b=0;b<m;b++){const[x,w]=WI(l[h+b].code,l[p+b].code);c.set(h+b,x),c.set(p+b,w)}}for(let d=0;d<l.length;d++){const h=l[d],p=h.marker==="+",m=h.marker==="-",b=p?"bg-green-900/30":m?"bg-red-900/30":"",x=h.marker==="-"?h.oldLine:h.newLine;r.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} ${p?"text-green-400":m?"text-red-400":"text-dark-muted"}`,children:[h.marker===" "?"":h.marker,x??""]}),g.jsx(JI,{code:h.code,marker:h.marker,lang:e,ranges:c.get(d)??[]})]},a++))}}return g.jsx("div",{children:r})}function m5({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 r=n==="remove"?[{type:"",text:t}]:hS(t,e),a=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 ${a}`,children:r.map((i,l)=>g.jsx("span",{className:i.type?`token ${i.type}`:"",children:i.text},l))})}function tP(t,e){const n=dS(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 r=[];for(const a of n){const i=fS(a);r.push({left:`@@ -${a.oldStart},${a.oldLines} +${a.newStart},${a.newLines} @@`,right:"",type:"header"});let l=[],c=[];const d=()=>{(l.length>0||c.length>0)&&(nP(r,l,c),l=[],c=[])};for(const h of i)h.marker==="-"?l.push(h.code):h.marker==="+"?c.push(h.code):(d(),r.push({left:h.code,right:h.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"})]}),r.map((a,i)=>a.type==="header"?g.jsx("div",{className:"bg-accent-blue/5 text-accent-blue font-bold font-mono text-xs leading-snug px-2",children:a.left},i):g.jsxs("div",{className:"flex",style:{minHeight:"1.25rem"},children:[g.jsx(m5,{code:a.type==="replace"||a.type==="delete"?"- "+a.left:a.left,lang:e,kind:a.type==="replace"||a.type==="delete"?"remove":"context"}),g.jsx(m5,{code:a.type==="replace"||a.type==="add"?"+ "+a.right:a.right,lang:e,kind:a.type==="replace"||a.type==="add"?"add":"context"})]},i))]})}function nP(t,e,n){const r=Math.max(e.length,n.length);for(let a=0;a<r;a++){const i=a<e.length?e[a]??"":"",l=a<n.length?n[a]??"":"";t.push({left:i,right:l,type:a<e.length&&a<n.length?"replace":a<e.length?"delete":"add"})}}const rP=1e5,aP=3,pS=N.memo(function(){const{t:e}=tt(),n=vs(ae=>ae.status),r=vs(ae=>ae.refreshing),a=wi(ae=>ae.workspaceDir),[i,l]=N.useState(null),[c,d]=N.useState([]),[h,p]=N.useState(!1),[m,b]=N.useState({}),[x,w]=N.useState(null),S=(n==null?void 0:n.changes)??[],E=N.useMemo(()=>new Map(S.map(ae=>[ae.path,ae])),[S]),A=N.useMemo(()=>S.map(ae=>ae.path).join(`
475
- `),[S]),T=N.useCallback(ae=>`${h?"full":"compact"}:${ae}`,[h]);N.useEffect(()=>{vs.getState().refreshStatus()},[]),N.useEffect(()=>{if((n==null?void 0:n.available)===!1)return;const ae=new Set(A?A.split(`
476
- `):[]);!i||ae.has(i)||(d(V=>V.filter(he=>ae.has(he))),l(null))},[A,i,n==null?void 0:n.available]);const D=N.useCallback(async(ae,V)=>{var he,ve;w(ae);try{const ge=h?rP:aP,q=await ct.git.diff(ae,{mode:V,context:ge});let ie=q.success&&q.data?q.data:null;if(!ie)throw new Error(q.error||"diff failed");if(!ie.patch.trim()&&!ie.error&&ie.mode==="worktree"&&((he=E.get(ae))!=null&&he.staged)){const Se=await ct.git.diff(ae,{mode:"staged",context:ge});Se.success&&((ve=Se.data)!=null&&ve.patch.trim())&&(ie=Se.data)}const _e=ie;b(Se=>({...Se,[T(ae)]:_e}))}catch(ge){const q=ge instanceof Error?ge.message:String(ge);b(ie=>({...ie,[T(ae)]:{path:ae,mode:V,patch:"",error:q}}))}finally{w(null)}},[h,T,E]),M=i?T(i):"",B=i?m[M]:void 0,I=i?E.get(i):void 0;N.useEffect(()=>{if(!i||m[M])return;const ae=E.get(i);D(i,ae!=null&&ae.status.includes("?")?"untracked":"worktree")},[i,M,m,E,D]);const U=N.useCallback(ae=>{l(ae),d(V=>V.includes(ae)?V:[...V,ae])},[]),W=N.useCallback(ae=>{const V=c.indexOf(ae),he=c.filter(ve=>ve!==ae);d(he),i===ae&&l(he.length>0?he[Math.max(0,V-1)]??he[0]:null)},[c,i]),Y=(n==null?void 0:n.available)===!1,oe=x!==null&&x===i&&!B;return Y?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(o_,{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:a})]}):n?g.jsx("div",{className:"flex-1 min-h-0 flex flex-col overflow-hidden",children:i?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:()=>l(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(l3,{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:i,children:i}),g.jsxs("div",{className:"mt-0.5 flex items-center gap-1.5",children:[I&&g.jsx("span",{className:ut("rounded px-1 text-[9px] leading-4",g5(I)),children:I.status}),(B==null?void 0:B.mode)==="staged"&&g.jsx("span",{className:"text-[9px] text-accent-green",children:e("git.stagedBadge")}),(I==null?void 0:I.status.includes("?"))&&g.jsx("span",{className:"text-[9px] text-accent-purple",children:e("git.untrackedBadge")})]})]}),g.jsx("button",{onClick:()=>p(ae=>!ae),className:ut("shrink-0 rounded-md border px-1.5 py-0.5 text-[10px] transition-colors",h?"border-accent-blue/40 bg-accent-blue/10 text-accent-blue":"border-dark-border text-dark-muted hover:text-dark-text"),title:e(h?"git.changedLines":"git.fullFile"),children:e(h?"git.fullFile":"git.changedLines")})]}),c.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:c.map(ae=>g.jsxs("span",{className:ut("group flex max-w-[11rem] shrink-0 items-center gap-1 rounded-md border px-1.5 py-0.5 text-[11px] transition-colors",ae===i?"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:()=>l(ae),className:"min-w-0 truncate font-mono",title:ae,children:sP(ae)}),g.jsx("button",{onClick:()=>W(ae),className:"shrink-0 rounded text-dark-muted hover:text-dark-text","aria-label":e("chat.closeTab"),title:e("chat.closeTab"),children:g.jsx(Bn,{size:10})})]},ae))}),g.jsx("div",{className:"flex-1 min-h-0 flex flex-col overflow-hidden p-2",children:oe||!B?g.jsx("div",{className:"flex flex-1 items-center justify-center",children:g.jsx(Kn,{size:18,className:"animate-spin text-accent-blue"})}):B.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(bu,{size:13,className:"shrink-0 mt-0.5"}),g.jsx("span",{className:"break-all",children:B.error})]}):B!=null&&B.binary?g.jsx(y5,{text:e("git.binary")}):B!=null&&B.patch.trim()?g.jsx(KI,{variant:"panel",filePath:i,content:B.patch}):g.jsx(y5,{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(l_,{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:["+",n.totalAdded??0]}),g.jsx("span",{className:"text-dark-muted/40",children:" / "}),g.jsxs("span",{className:"text-accent-red",children:["−",n.totalRemoved??0]})]}),g.jsx("div",{className:"flex-1"}),g.jsx("button",{onClick:()=>void vs.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(pf,{size:12,className:ut(r&&"animate-spin")})})]}),g.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto custom-scrollbar",children:S.length===0?g.jsx("div",{className:"py-6 text-center text-[11px] text-dark-muted/60",children:e("git.clean")}):S.map(ae=>g.jsxs("button",{onClick:()=>U(ae.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:ae.path,children:[g.jsx("span",{className:ut("mt-px w-6 shrink-0 rounded px-1 text-center text-[9px] leading-4",g5(ae)),children:ae.status}),g.jsx("span",{className:"min-w-0 flex-1 break-all font-mono text-[11px] leading-snug text-dark-text",children:ae.path}),g.jsxs("span",{className:"shrink-0 font-mono text-[10px] leading-snug tabular-nums",children:[ae.added>0&&g.jsxs("span",{className:"text-accent-green",children:["+",ae.added]}),ae.removed>0&&g.jsxs("span",{className:"ml-1 text-accent-red",children:["−",ae.removed]})]})]},ae.path))})]})}):g.jsx("div",{className:"flex-1 min-h-0 flex items-center justify-center",children:g.jsx(Kn,{size:18,className:"animate-spin text-accent-blue"})})});function g5(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 sP(t){const e=t.split(/[\\/]/);return e[e.length-1]||t}function y5({text:t}){return g.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-1.5 text-center",children:[g.jsx(M0,{size:20,className:"text-dark-muted/50"}),g.jsx("span",{className:"text-[11px] text-dark-muted/70",children:t})]})}const iP=["write_file","edit_file","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"],oP=/(?:^|[_\W])(write|edit|save|create|update|modify|patch|output|export|render|generate|build)(?:[_\W]|$)/i,lP=/(?:^|[_\W])(read|open|cat|view|list|ls|dir|find|grep|glob|search)(?:[_\W]|$)/i;function Cl(t){return iP.includes(t)?!0:oP.test(t)&&!lP.test(t)}const b5=["file_path","filePath","path","file"];function cf(t,e){const n=cP(t);if(n)for(const r of e?[...b5,...e]:b5){const a=n[r];if(typeof a=="string"&&a.trim())return a}}function cP(t){if(typeof t=="string")try{const e=JSON.parse(t);return v5(e)?e:null}catch{return null}return v5(t)?t:null}function v5(t){return!!t&&typeof t=="object"&&!Array.isArray(t)}function uP(t){return cf(t,["outputPath","output"])}function El(t){const e=t.split(/[\\/]/);return e[e.length-1]||t}function mS(t){return z1(t)??t}function m1(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 gS({kind:t,size:e=14}){return t==="image"?g.jsx(u_,{size:e,className:"text-dark-muted shrink-0"}):t==="markdown"?g.jsx(mo,{size:e,className:"text-dark-muted shrink-0"}):t==="code"?g.jsx(d_,{size:e,className:"text-dark-muted shrink-0"}):t==="html"?g.jsx(f_,{size:e,className:"text-dark-muted shrink-0"}):t==="video"?g.jsx(h_,{size:e,className:"text-dark-muted shrink-0"}):t==="audio"?g.jsx(p_,{size:e,className:"text-dark-muted shrink-0"}):t==="pdf"?g.jsx(mo,{size:e,className:"text-dark-muted shrink-0"}):t==="docx"?g.jsx(m_,{size:e,className:"text-dark-muted shrink-0"}):t==="xlsx"?g.jsx(c3,{size:e,className:"text-dark-muted shrink-0"}):g.jsx(u3,{size:e,className:"text-dark-muted shrink-0"})}const dP=["markdown","code","html"],fP=5e3,x5=new Map;function g1(t,e="download"){const[n,r]=N.useState(null);return N.useEffect(()=>{if(!t){r(null);return}const a=F3(t);if(a){r(a);return}let i=!1;const l=e==="read"?"/api/files/read":"/api/files/download",c=`${l}:${t}`,d=p=>wu(`${l}?path=${encodeURIComponent(t)}&ticket=${encodeURIComponent(p)}`),h=x5.get(c);if(h&&h.exp-fP>Date.now()){r(d(h.ticket));return}return ct.files.previewTicket(t,l).then(p=>{var b,x;if(i)return;const m=p.success?(b=p.data)==null?void 0:b.ticket:void 0;if(!m){r(null);return}x5.set(c,{ticket:m,exp:Date.now()+(((x=p.data)==null?void 0:x.expiresInMs)??6e4)}),r(d(m))}).catch(()=>{i||r(null)}),()=>{i=!0}},[t,e]),n}let p0=null;function hP(){return p0||(p0=R6({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:tS()}).catch(t=>{throw p0=null,t})),p0}const w5={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 pP(t){const e=(t.split(".").pop()||"").toLowerCase();return w5[e]?w5[e]:e||"txt"}function yS({text:t,className:e=""}){const{t:n}=tt(),[r,a]=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),a(!0),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>a(!1),2e3)}catch{mt.error(n("chat.copyPathFailed"))}},[t,n]);return g.jsxs("button",{type:"button",onClick:()=>void l(),title:n("chat.copySource"),className:ut("inline-flex items-center gap-1 rounded-md px-2 py-1 text-[11px] transition-colors",r?"text-accent-green":"text-dark-muted hover:bg-dark-hover hover:text-dark-text",e),children:[r?g.jsx(vu,{size:12}):g.jsx(hf,{size:12}),n(r?"common.copied":"chat.copySource")]})}function mP({path:t,content:e}){const{t:n}=tt(),[r,a]=N.useState(null),[i,l]=N.useState(!1),c=pP(t);return N.useEffect(()=>{let d=!1;if(a(null),l(!1),e!=null)return hP().then(h=>{if(!h.getLoadedLanguages().includes(c)){a(null);return}const p=h.codeToHtml(e,{lang:c,theme:"github-dark"});d||a(p)}).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(yS,{text:e})]}),r?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:r}}):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 gP({path:t}){const[e,n]=N.useState(null),[r,a]=N.useState(!1),[i,l]=N.useState(null);return N.useEffect(()=>{let c=!1;return n(null),l(null),a(!0),ct.files.previewDocx(t).then(d=>{var h;c||(d.success?n(((h=d.data)==null?void 0:h.text)??""):l(d.error||"读取失败"))}).catch(d=>{c||l(d instanceof Error?d.message:"读取失败")}).finally(()=>{c||a(!1)}),()=>{c=!0}},[t]),r?g.jsx("div",{className:"flex flex-1 items-center justify-center text-dark-muted",children:g.jsx(Kn,{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 yP({path:t}){const[e,n]=N.useState(null),[r,a]=N.useState(!1),[i,l]=N.useState(null);if(N.useEffect(()=>{let d=!1;return n(null),l(null),a(!0),ct.files.previewXlsx(t).then(h=>{var p;d||(h.success?n(((p=h.data)==null?void 0:p.sheets)??[]):l(h.error||"读取失败"))}).catch(h=>{d||l(h instanceof Error?h.message:"读取失败")}).finally(()=>{d||a(!1)}),()=>{d=!0}},[t]),r)return g.jsx("div",{className:"flex flex-1 items-center justify-center text-dark-muted",children:g.jsx(Kn,{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(c3,{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,h)=>g.jsx("th",{className:"border border-dark-border px-2 py-1.5 text-left font-medium text-dark-text whitespace-nowrap",children:d},h))})}),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,h)=>g.jsx("tr",{className:"even:bg-dark-hover/30",children:d.map((p,m)=>g.jsx("td",{className:"border border-dark-border px-2 py-1 text-dark-text align-top whitespace-pre-wrap break-words",children:p},m))},h))})]})})]})}function bP({path:t,content:e}){const{t:n}=tt(),[r,a]=N.useState("page");N.useEffect(()=>{a("page")},[t]);const i=g1(t,"download"),l=c=>ut("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:()=>a("page"),className:l(r==="page"),"aria-pressed":r==="page",children:[g.jsx(A1,{size:12}),n("chat.previewTabPage")]}),g.jsxs("button",{type:"button",onClick:()=>a("code"),className:l(r==="code"),"aria-pressed":r==="code",children:[g.jsx(x_,{size:12}),n("chat.previewTabCode")]})]}),r==="code"&&g.jsx(yS,{text:e??""})]}),r==="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:El(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 bS(t){var n;const e=new Map;for(const r of t){if((n=r.fileJob)!=null&&n.result)for(const a of r.fileJob.result)a.path&&!e.has(a.path)&&e.set(a.path,{path:a.path,name:a.fileName||El(a.path),source:"filejob"});for(const a of r.toolCalls??[]){if(a.status==="error")continue;const i=uP(a.args);i&&Cl(a.name)&&!e.has(i)&&e.set(i,{path:i,name:El(i),source:"toolcall"})}}return Array.from(e.values())}function vP({status:t}){return t==="running"?g.jsx(Kn,{size:12,className:"animate-spin text-accent-blue shrink-0 mt-0.5"}):t==="completed"?g.jsx(vu,{size:12,className:"text-accent-green shrink-0 mt-0.5"}):t==="failed"?g.jsx(M1,{size:12,className:"text-accent-red shrink-0 mt-0.5"}):t==="skipped"?g.jsx(c_,{size:12,className:"text-dark-muted shrink-0 mt-0.5"}):g.jsx(R1,{size:12,className:"text-dark-muted shrink-0 mt-0.5"})}const xP={workflow:"WF",goal:"Goal",plan:"Plan",task:"Task",todo:"Todo",agent:"Agent"},wP={pending:"待执行",running:"进行中",completed:"完成",failed:"失败",skipped:"跳过"};function kP(t){const e=new Map;for(const i of t)e.set(i.id,i);const n=new Map,r=[];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 r.push(i)}const a=(i,l)=>{const c=(n.get(i.id)??[]).filter(d=>!l.has(d.id)).map(d=>a(d,new Set(l).add(i.id)));return{task:i,children:c}};return r.map(i=>a(i,new Set))}function vS({node:t}){const{task:e,children:n}=t,r=xP[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(vP,{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:ut("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:[r," · ",wP[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(a=>g.jsx(vS,{node:a},a.task.id))})]})}function SP({sessionId:t}){const{t:e}=tt(),n=ot(h=>t?h.getTasksForSession(t):[]),r=ot(h=>t?h.getRunningAgentCount(t):0),a=ot(h=>t?h.getForSession(t):void 0),l=Be(h=>t?h.isGenerating(t):!1)||r>0||(a==null?void 0:a.status)==="RUNNING"||(a==null?void 0:a.status)==="RESUMING",c=N.useMemo(()=>t?ot.getState().getEventsForSession(t).filter(p=>p.type==="tool_call"||p.title).length:0,[t,n.length,r,a==null?void 0:a.updatedAt]),d=N.useMemo(()=>kP(n),[n]);return n.length===0?l?g.jsxs("div",{className:"flex items-center gap-2 text-xs text-dark-muted py-0.5",children:[g.jsx(Kn,{size:13,className:"animate-spin text-accent-blue shrink-0"}),g.jsx("span",{className:"truncate",children:r>0?e("chat.sidebarWorkingWithAgents",{n:r}):c>0?e("chat.sidebarWorkingToolcalls",{n:c}):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:[d.map(h=>g.jsx(vS,{node:h},h.task.id)),l&&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:c})})]})}function _P({tabs:t,active:e,onActivate:n,onClose:r,onBack:a}){const{t:i}=tt(),l=N.useRef(null);return N.useEffect(()=>{var d,h;const c=(d=l.current)==null?void 0:d.querySelector('[data-active="1"]');(h=c==null?void 0:c.scrollIntoView)==null||h.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:a,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(D1,{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,h=mS(c),p=z1(c)??El(c);return g.jsxs("div",{"data-active":d?"1":"0",role:"tab","aria-selected":d,title:h,className:ut("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(),r(c))},children:[g.jsx("span",{className:"truncate",children:p}),g.jsx("button",{type:"button","aria-label":i("chat.closeTab"),title:i("chat.closeTab"),onClick:m=>{m.stopPropagation(),r(c)},className:ut("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(Bn,{size:11})})]},c)})})]})}function y1({sessionId:t,messages:e,previewFile:n,previewTabs:r,onPreview:a,onCloseTab:i,onClosePreview:l}){const{t:c}=tt(),[d,h]=N.useState(null),[p,m]=N.useState(!1),[b,x]=N.useState(null),[w,S]=N.useState(!1),E=N.useRef(null),A=g1(n,"download"),T=g1(n,"read"),D=N.useCallback(async oe=>{m(!0),x(null),h(null);try{const ae=await ct.files.read(oe);ae.success&&ae.data!==void 0&&ae.data!==null?h(String(ae.data)):x(ae.error||c("chat.fileReadError"))}catch(ae){x(ae instanceof Error?ae.message:c("chat.fileReadError"))}finally{m(!1)}},[c]);N.useEffect(()=>{const oe=n?m1(n):null;if(!n||!oe||!dP.includes(oe)){h(null),m(!1),x(null);return}D(n)},[n,D]);const M=N.useCallback(async oe=>{const ae=F3(oe);if(ae){const he=document.createElement("a");he.href=ae,he.download=z1(oe)??"image",document.body.appendChild(he),he.click(),he.remove();return}const V=await ct.files.download(oe);V.success||mt.error(V.error||c("chat.fileReadError"))},[c]),B=N.useCallback(async oe=>{try{await navigator.clipboard.writeText(oe),mt.success(c("chat.copiedPath"))}catch{mt.error(c("chat.copyPathFailed"))}},[c]),I=n?m1(n):"file",U=N.useMemo(()=>I==="markdown"?$j(d??""):[],[d,I]),W=n?mS(n):"",Y=P1(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(_P,{tabs:r&&r.length>0?r:[n],active:n,onActivate:a,onClose:oe=>i?i(oe):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(gS,{kind:I,size:13}),g.jsx("span",{className:"text-[11px] font-mono text-dark-muted truncate",title:W,children:W})]}),!Y&&g.jsx("button",{onClick:()=>void B(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(hf,{size:14})}),!Y&&g.jsx("a",{href:T??"#",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(cg,{size:14})}),g.jsx("button",{onClick:()=>void M(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(tu,{size:14})}),I==="markdown"&&U.length>0&&g.jsx("button",{onClick:()=>S(oe=>!oe),className:ut("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(v_,{size:14})})]})}),g.jsx("div",{className:"flex flex-1 min-h-0 flex-col overflow-hidden p-3",children:p?g.jsx("div",{className:"flex flex-1 items-center justify-center text-dark-muted",children:g.jsx(Kn,{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(bu,{size:14,className:"shrink-0 mt-0.5"}),g.jsx("span",{className:"break-words",children:b})]}):I==="image"?g.jsx("div",{className:"flex flex-1 min-h-0 items-center justify-center overflow-hidden",children:g.jsx("img",{src:A??void 0,alt:W,className:"max-h-full max-w-full object-contain rounded-lg border border-dark-border"})}):I==="markdown"?g.jsxs("div",{className:"relative flex-1 min-h-0",children:[g.jsx("div",{ref:E,className:"absolute inset-0 overflow-y-auto custom-scrollbar",children:d!=null&&g.jsx(oB,{content:d,headingIds:!0})}),w&&U.length>0&&g.jsx(cB,{headings:U,scrollRoot:E,onClose:()=>S(!1)})]}):I==="html"?g.jsx(bP,{path:n,content:d}):I==="docx"?g.jsx(gP,{path:n}):I==="xlsx"?g.jsx(yP,{path:n}):I==="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:A??void 0,title:El(n),className:"absolute inset-0 h-full w-full border-0"},n)}):I==="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:A??void 0,controls:!0,className:"max-h-full max-w-full"},n)}):I==="audio"?g.jsx("div",{className:"shrink-0 pt-2",children:g.jsx("audio",{src:A??void 0,controls:!0,className:"w-full"},n)}):I==="code"?g.jsx(mP,{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(u3,{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:El(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:T??"#",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(cg,{size:13}),c("chat.openInNewTab")]}),g.jsxs("button",{onClick:()=>void M(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(tu,{size:13}),c("fileJob.download")]})]})]})})]}):g.jsx($B,{sessionId:t,messages:e,onPreview:a})})}function CP({sessionId:t,messages:e,previewFile:n,previewTabs:r,onPreview:a,onCloseTab:i,onClosePreview:l,onPopOutPreview:c,isMaximized:d,onToggleMaximize:h,view:p,onViewChange:m}){const{t:b}=tt(),x=N.useMemo(()=>bS(e),[e]),[w,S]=N.useState("artifacts"),E=p??w,A=vs(M=>{var B,I;return((I=(B=M.status)==null?void 0:B.changes)==null?void 0:I.length)??0}),T=N.useCallback(M=>{S(M),m==null||m(M)},[m]),D=N.useMemo(()=>({type:"split",direction:"horizontal",children:[{type:"slot",id:"left"},{type:"split",direction:"vertical",children:[{type:"slot",id:"right"},{type:"slot",id:"preview"}]}]}),[]);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:[E==="changes"?g.jsx(M0,{size:14,className:"text-accent-blue shrink-0"}):g.jsx(o3,{size:14,className:"text-accent-blue shrink-0"}),g.jsx("span",{className:"text-xs font-semibold text-dark-text truncate",children:b(E==="workspace"?"chat.workspaceTitle":E==="changes"?"chat.changesTitle":"chat.artifactPanel")}),g.jsxs("div",{className:"ml-auto flex items-center gap-0.5",children:[E==="artifacts"&&!n&&x.length>0&&g.jsx("span",{className:"text-[10px] text-dark-muted tabular-nums",children:x.length}),E==="changes"&&A>0&&g.jsx("span",{className:"text-[10px] text-dark-muted tabular-nums",children:A}),g.jsx("button",{onClick:()=>T(E==="changes"?"artifacts":"changes"),className:ut("p-1 rounded transition-colors shrink-0",E==="changes"?"bg-accent-blue/10 text-accent-blue":"text-dark-muted hover:bg-dark-hover hover:text-dark-text"),title:b("chat.changesToggle"),"aria-label":b("chat.changesToggle"),"aria-pressed":E==="changes","data-testid":"sidebar-changes-toggle",children:g.jsx(M0,{size:14})}),g.jsx("button",{onClick:()=>T(E==="workspace"?"artifacts":"workspace"),className:"p-1 rounded text-dark-muted hover:bg-dark-hover hover:text-dark-text transition-colors shrink-0",title:b(E==="workspace"?"chat.artifactsToggle":"chat.workspaceToggle"),"aria-label":b(E==="workspace"?"chat.artifactsToggle":"chat.workspaceToggle"),"data-testid":"sidebar-view-toggle",children:g.jsx(g_,{size:14})}),c&&E==="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(cg,{size:14})}),h&&g.jsx("button",{onClick:h,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(y_,{size:14}):g.jsx(b_,{size:14})})]})]}),E==="changes"?g.jsx(pS,{}):E==="workspace"?g.jsx(AI,{layout:D,onRegister:M=>{const B=[RI(M),II(M)];return()=>B.forEach(I=>I())}}):g.jsx(y1,{sessionId:t,messages:e,previewFile:n,previewTabs:r,onPreview:a,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(E==="workspace"?"chat.workspaceHint":E==="changes"?"chat.changesHint":"chat.artifactHint")})})]})}const k5={running:{Icon:O1,label:"nav.sessionRunning",ring:"spin"},waiting:{Icon:S_,label:"nav.sessionWaiting",ring:"breathe"},failed:{Icon:k_,label:"nav.sessionFailed",ring:"static"},done:{Icon:w_,label:"nav.sessionDone"}},EP=`
477
- .dsc-status {
478
- --dsc-rgb: var(--color-muted);
479
- /* 龙卷风涡流的两端:涡头靛蓝 → 涡尾青绿(中段由浏览器插值成蓝绿) */
480
- --dsc-vortex-a: var(--color-accent-blue);
481
- --dsc-vortex-b: var(--color-accent-green);
482
- --dsc-sat: 1.6;
483
- --dsc-chip: 0.1;
484
- color: rgb(var(--dsc-rgb));
485
- background-color: rgb(var(--dsc-rgb) / var(--dsc-chip));
486
- border-color: transparent;
487
- filter: saturate(var(--dsc-sat));
488
- }
489
- .dark .dsc-status {
490
- --dsc-sat: 1.12;
491
- }
492
-
493
- .dsc-status[data-status='running'] { --dsc-rgb: var(--color-accent-blue); }
494
- .dsc-status[data-status='waiting'] { --dsc-rgb: var(--color-accent-yellow); --dsc-chip: 0.13; }
495
- .dsc-status[data-status='failed'] { --dsc-rgb: var(--color-accent-red); }
496
-
497
- /* 已结束:中性虚线灰框,不参与配色 */
498
- .dsc-status[data-status='done'] {
499
- --dsc-sat: 1;
500
- color: rgb(var(--color-muted) / 0.55);
501
- background-color: transparent;
502
- border-style: dashed;
503
- border-color: rgb(var(--color-border) / 0.7);
504
- }
505
-
506
- /* 进行中:同色柔光晕缓慢呼吸 —— 即使截图静止,也认得出这是彩色状态 */
507
- .dsc-status[data-status='running'] {
508
- animation: dscGlow 2.6s ease-in-out infinite;
509
- }
510
-
511
- .dsc-ring {
512
- position: absolute;
513
- inset: -2px;
514
- border: 2px solid transparent;
515
- border-radius: 7px;
516
- pointer-events: none;
517
- }
518
- .dsc-ring[data-motion='spin'] {
519
- /* 龙卷风:蓝→青→绿的头尾渐隐涡流(comet),遮罩抠出 2.5px 环带 */
520
- border-color: transparent;
521
- background: conic-gradient(
522
- from 0deg,
523
- rgb(var(--dsc-vortex-a) / 0) 0deg,
524
- rgb(var(--dsc-vortex-a)) 80deg,
525
- rgb(var(--dsc-vortex-b)) 250deg,
526
- rgb(var(--dsc-vortex-b) / 0) 340deg,
527
- rgb(var(--dsc-vortex-a) / 0) 360deg
528
- );
529
- -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2.5px));
530
- mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2.5px));
531
- animation: dscSpin 0.72s linear infinite;
532
- }
533
- /* 内涡:反向、更快的细弧,让静止截图也读得出「漏斗」而非一片渐变 */
534
- .dsc-ring[data-motion='spin']::after {
535
- content: '';
536
- position: absolute;
537
- inset: 3.5px;
538
- border: 1.5px solid transparent;
539
- border-top-color: rgb(var(--dsc-vortex-b) / 0.85);
540
- border-left-color: rgb(var(--dsc-vortex-a) / 0.55);
541
- border-radius: 50%;
542
- animation: dscSpin 0.5s linear infinite reverse;
543
- }
544
- .dsc-ring[data-motion='breathe'] {
545
- border-color: rgb(var(--dsc-rgb) / 0.85);
546
- animation: dscBreathe 1.9s ease-in-out infinite;
547
- }
548
- .dsc-ring[data-motion='static'] {
549
- border-color: rgb(var(--dsc-rgb) / 0.5);
550
- }
551
-
552
- @keyframes dscSpin {
553
- to { transform: rotate(360deg); }
554
- }
555
- @keyframes dscBreathe {
556
- 0%, 100% { opacity: 0.3; transform: scale(0.96); }
557
- 50% { opacity: 1; transform: scale(1); }
558
- }
559
- @keyframes dscGlow {
560
- 0%, 100% { box-shadow: 0 0 0 2px rgb(var(--dsc-rgb) / 0.1), 0 0 6px rgb(var(--dsc-rgb) / 0.2); }
561
- 50% { box-shadow: 0 0 0 3px rgb(var(--dsc-rgb) / 0.18), 0 0 12px rgb(var(--dsc-rgb) / 0.45); }
562
- }
563
-
564
- @media (prefers-reduced-motion: reduce) {
565
- .dsc-status,
566
- .dsc-ring,
567
- .dsc-ring::after { animation: none !important; }
568
- .dsc-status[data-status='running'] { box-shadow: 0 0 0 2px rgb(var(--dsc-rgb) / 0.16); }
569
- .dsc-ring[data-motion='breathe'] { opacity: 0.7; transform: none; }
570
- }
571
- `,uf=N.memo(function({status:e,label:n,className:r}){const{t:a}=tt(),i=k5[e]??k5.done,{Icon:l,ring:c}=i,d=n??a(i.label);return g.jsxs(g.Fragment,{children:[g.jsx("style",{href:"deepseekcode-session-status",precedence:"default",children:EP}),g.jsxs("span",{"data-status":e,className:ut("dsc-status relative flex h-[18px] w-[18px] shrink-0 items-center justify-center rounded-[5px] border transition-colors",r),title:d,"aria-label":d,role:"img",children:[c&&g.jsx("span",{className:"dsc-ring","data-motion":c,"aria-hidden":"true"}),g.jsx(l,{size:12,strokeWidth:2.2,"aria-hidden":"true",className:"relative"})]})]})});N.createContext(null);function Gf({isOpen:t,onClose:e,title:n,children:r,size:a="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:ut("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[a],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(Bn,{className:"w-5 h-5","aria-hidden":"true"})})]}),g.jsx("div",{className:"min-h-0 overflow-y-auto custom-scrollbar p-6",children:r})]})]})}function MF({isOpen:t,onClose:e,onConfirm:n,title:r,message:a,confirmText:i,cancelText:l,variant:c="default"}){const{t:d}=tt(),h=()=>{n(),e()};return g.jsxs(Gf,{isOpen:t,onClose:e,title:r??d("common.confirm"),size:"sm",children:[g.jsx("p",{className:"text-dark-muted mb-6",children:a}),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:h,className:ut("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 S5({children:t,variant:e="default",size:n="md",className:r}){const a={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:ut("inline-flex items-center rounded-full font-medium",a[e],i[n],r),children:t})}const TP={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:r,busy:a=!1,autoValues:i,preflightSummary:l,submitIcon:c}){const{t:d}=tt(),h=r??d("templates.launch"),p=t.inputs??[],m=N.useMemo(()=>{const T={};for(const D of p){const M=i==null?void 0:i[D.name];if(M&&typeof M.value=="string"&&M.value!==""){T[D.name]=D.type==="number"?Number(M.value):M.value;continue}D.default!==void 0&&D.default!==null&&(T[D.name]=D.default)}return T},[p,i]),[b,x]=N.useState(m),[w,S]=N.useState({});if(p.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:a,className:"px-4 py-2 rounded-lg bg-accent-blue text-white hover:bg-accent-blue/90 disabled:opacity-50 transition-colors",children:a?d("templates.starting"):g.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[h,c]})})]})]});const E=(T,D)=>{x(M=>({...M,[T]:D})),S(M=>{if(!M[T])return M;const B={...M};return delete B[T],B})},A=()=>{const T={},D={};for(const M of p){let B=b[M.name];typeof B=="string"&&(B=B.trim());const I=B==null||B==="";if(M.required&&I){T[M.name]=d("templates.requiredError");continue}if(!I)if(M.type==="number"){const U=Number(B);if(!Number.isFinite(U)){T[M.name]=d("templates.numberError");continue}D[M.name]=U}else D[M.name]=B}if(Object.keys(T).length>0){S(T);return}n(D)};return g.jsxs("div",{className:"space-y-4",children:[l,g.jsx("div",{className:"text-sm text-dark-muted",children:t.description||""}),p.map(T=>{const D=i==null?void 0:i[T.name],M=!!D&&typeof D.value=="string"&&D.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:"*"}),M&&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(TP[T.type])})]}),NP(T,b[T.name],E,d("templates.selectNone")),M&&(D==null?void 0:D.label)&&g.jsxs("div",{className:"mt-1 text-[11px] text-dark-muted/80",children:[D.label,b[T.name]===D.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:A,disabled:a,className:"px-4 py-2 rounded-lg bg-accent-blue text-white hover:bg-accent-blue/90 disabled:opacity-50 transition-colors",children:a?d("templates.starting"):g.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[h,c]})})]})]})}function NP(t,e,n,r){const a="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:a,children:[!t.required&&g.jsx("option",{value:"",children:r}),(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:ut("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:ut("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:a});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:a})}}function RP({collapsed:t=!1,onDirect:e,onStartTemplate:n,onManageTemplates:r}){const{t:a}=tt(),[i,l]=N.useState(!1),[c,d]=N.useState({kind:"list"}),[h,p]=N.useState([]),[m,b]=N.useState(!1),[x,w]=N.useState(""),[S,E]=N.useState({top:0,left:0}),A=N.useRef(null),T=N.useCallback(()=>{d({kind:"list"}),l(!0)},[]);N.useEffect(()=>{var W;if(!i)return;const U=(W=A.current)==null?void 0:W.getBoundingClientRect();U&&E({top:U.bottom+6,left:Math.max(8,U.left)})},[i,t]),N.useEffect(()=>{if(!i||c.kind!=="list")return;let U=!1;return b(!0),w(""),ct.templates.list().then(W=>{U||(W.success&&W.data?p(W.data):w(W.error||a("templates.loadFailed")))}).catch(()=>{U||w(a("templates.loadFailed"))}).finally(()=>{U||b(!1)}),()=>{U=!0}},[i,c.kind]);const D=N.useMemo(()=>{const U=new Map;for(const W of h){const Y=W.category||a("templates.uncategorized"),oe=U.get(Y)||[];oe.push(W),U.set(Y,oe)}return[...U.entries()]},[h,a]),M=async U=>{const W=await ct.templates.get(U.id);W.success&&W.data?d({kind:"form",template:W.data}):w(W.error||a("templates.loadFailed"))},B=U=>{c.kind==="form"&&(n(c.template,U),l(!1),d({kind:"list"}))},I={top:S.top,left:S.left,width:Math.min(360,typeof window<"u"?window.innerWidth-16:360)};return g.jsxs("div",{ref:A,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:a("templates.newSession"),"aria-label":a("templates.newSession"),children:g.jsx(nu,{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(nu,{size:15,"aria-hidden":"true"}),a("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:a("templates.newFromTemplateTitle"),"aria-label":a("templates.chooseTemplateAria"),children:g.jsx(yi,{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:I,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(l3,{className:"w-3.5 h-3.5"})," ",a("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:a("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:a("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(O1,{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:a("templates.directChat")}),g.jsx("span",{className:"block text-[11px] text-dark-muted truncate",children:a("templates.directChatHint")})]})]}),m&&g.jsxs("div",{className:"flex items-center gap-2 px-2 py-3 text-xs text-dark-muted",children:[g.jsx(Kn,{className:"w-3.5 h-3.5 animate-spin"})," ",a("templates.loadingTemplates")]}),x&&!m&&g.jsx("div",{className:"px-2 py-2 text-xs text-accent-red",children:x}),!m&&!x&&D.length===0&&g.jsx("div",{className:"px-2 py-2 text-xs text-dark-muted",children:a("templates.noTemplatesYet")}),D.map(([U,W])=>g.jsxs("div",{className:"mt-1",children:[g.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1",children:[g.jsx(ug,{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:U}),g.jsx(S5,{size:"sm",children:W.length})]}),W.map(Y=>g.jsxs("button",{onClick:()=>void M(Y),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(ug,{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:Y.name}),g.jsxs(S5,{size:"sm",variant:"info",children:["v",Y.version]})]}),Y.description&&g.jsx("span",{className:"block text-[11px] text-dark-muted truncate",children:Y.description})]})]},Y.id))]},U)),g.jsx("div",{className:"border-t border-dark-border mt-1 pt-1",children:g.jsx("button",{onClick:()=>{l(!1),r()},className:"w-full px-2 py-1.5 rounded-lg hover:bg-dark-hover text-left text-[12.5px] text-dark-muted",children:a("templates.libraryMenu")})})]})})]})]})}function b1(t,e=Date.now(),n){const r=typeof t=="number"?t:new Date(t).getTime();if(!Number.isFinite(r))return"";const a=e-r;if(a<6e4)return n?n("time.justNow"):"刚刚";const i=Math.floor(a/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(r);return`${d.getFullYear()}-${String(d.getMonth()+1).padStart(2,"0")}-${String(d.getDate()).padStart(2,"0")}`}const Bc=10;function MP({isOpen:t,onClose:e,onSwitchSession:n}){const{t:r}=tt(),a=Fe(A=>A.sessionTabs),i=Fe(A=>A.historySessions),l=Fe(A=>A.activeSessionId),c=Be(A=>A.generatingSessions),[d,h]=N.useState(0),p=N.useMemo(()=>{const A=new Map;for(const T of a)A.set(T.id,T);for(const T of i)A.has(T.id)||A.set(T.id,T);return[...A.values()].sort((T,D)=>(D.lastActiveAt??D.createdAt??0)-(T.lastActiveAt??T.createdAt??0))},[a,i]),m=Math.max(1,Math.ceil(p.length/Bc)),b=Math.min(d,m-1),x=N.useMemo(()=>{const A=new Map,T=b*Bc;for(const D of p.slice(T,T+Bc)){const M=D.project||"default",B=A.get(M)||[];B.push(D),A.set(M,B)}return Array.from(A.entries())},[p,b]),w=p.length===0?0:b*Bc+1,S=Math.min((b+1)*Bc,p.length),E=A=>c.includes(A.id)?"running":A.status||"done";return g.jsx(Gf,{isOpen:t,onClose:e,title:r("chat.sessionPickerTitle"),size:"lg",children:g.jsxs("div",{className:"flex flex-col gap-3",children:[g.jsx("div",{className:"max-h-[320px] overflow-y-auto custom-scrollbar rounded-lg border border-dark-border bg-dark-bg p-1.5",children:p.length===0?g.jsx("div",{className:"px-3 py-6 text-center text-xs text-dark-muted/60",children:r("chat.noSessions")}):x.map(([A,T])=>g.jsxs("div",{children:[g.jsxs("div",{className:"flex items-center gap-1 px-2 py-1 text-[10px] text-dark-muted/70",children:[g.jsx(d3,{size:10,"aria-hidden":"true",className:"shrink-0 opacity-60"}),g.jsx("span",{className:"truncate",children:A==="default"?r("nav.mySessions"):A}),g.jsx("span",{className:"ml-auto text-[9px] text-dark-muted/40",children:T.length})]}),g.jsx("div",{className:"space-y-0.5",children:T.map(D=>{const M=D.id===l,B=E(D),I=b1(D.lastActiveAt??D.createdAt,Date.now(),r),U=k0(D),W=_3(D.title,U);return g.jsxs("button",{onClick:()=>{n(D.id),e()},title:r("chat.clickToOpenSession"),className:`group flex w-full cursor-pointer items-center gap-2 rounded-lg px-2.5 py-[7px] text-left text-[13px] transition-colors ${M?"bg-accent-blue/10 font-medium text-accent-blue":"text-dark-muted hover:bg-dark-hover/60 hover:text-dark-text"}`,children:[g.jsx(uf,{status:B}),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:D.title})}),g.jsxs("span",{className:"mt-0.5 flex items-center gap-2 text-[11px] leading-tight text-dark-muted/60",children:[W&&g.jsx("span",{className:"min-w-0 flex-1 truncate",children:U}),g.jsx("span",{className:`shrink-0 ${W?"":"ml-auto"}`,children:I})]})]})]},D.id)})})]},A))}),g.jsxs("div",{className:"flex items-center justify-between text-xs text-dark-muted",children:[g.jsx("span",{children:r("common.pageInfo",{start:w,end:S,total:p.length})}),g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsxs("button",{onClick:()=>h(A=>Math.max(0,A-1)),disabled:b===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(D1,{size:13,"aria-hidden":"true"}),r("common.prevPage")]}),g.jsxs("span",{className:"min-w-[48px] text-center font-mono",children:[b+1,"/",m]}),g.jsxs("button",{onClick:()=>h(A=>Math.min(m-1,A+1)),disabled:b>=m-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:[r("common.nextPage"),g.jsx(f3,{size:13,"aria-hidden":"true"})]})]})]})]})})}function DP(){return{activities:{},order:[],taskTitles:{},artifacts:[]}}const pr=gn()(t=>({bySession:{},applyEvent:(e,n)=>t(r=>{const a=r.bySession[e]??DP();switch(n.type){case"activity_started":return a.activities[n.activity.id]?r:{...r,bySession:{...r.bySession,[e]:{...a,activities:{...a.activities,[n.activity.id]:n.activity},order:[...a.order,n.activity.id]}}};case"activity_updated":{const i=a.activities[n.activityId];return i?{...r,bySession:{...r.bySession,[e]:{...a,activities:{...a.activities,[n.activityId]:{...i,...n.patch}}}}}:r}case"activity_finalized":{const i=a.activities[n.activityId];return i?{...r,bySession:{...r.bySession,[e]:{...a,activities:{...a.activities,[n.activityId]:{...i,status:n.status,endedAt:n.endedAt}}}}}:r}case"artifact_produced":return a.artifacts.some(i=>i.id===n.artifact.id)?r:{...r,bySession:{...r.bySession,[e]:{...a,artifacts:[...a.artifacts,n.artifact]}}};case"task_title_set":return{...r,bySession:{...r.bySession,[e]:{...a,taskTitles:{...a.taskTitles,[n.messageId]:n.title}}}};case"next_action_set":return{...r,bySession:{...r.bySession,[e]:{...a,nextAction:n.text??void 0}}};default:return r}}),resetSession:e=>t(n=>{if(!n.bySession[e])return n;const r={...n.bySession};return delete r[e],{bySession:r}}),finalizeSession:(e,n)=>t(r=>{const a=r.bySession[e];if(!a)return r;const i=Date.now(),l=["pending","running","paused","waiting_user"];let c=!1;const d={};for(const[h,p]of Object.entries(a.activities))l.includes(p.status)?(d[h]={...p,status:n,endedAt:i},c=!0):d[h]=p;return c?{...r,bySession:{...r.bySession,[e]:{...a,activities:d}}}:r}),markStatus:(e,n,r)=>t(a=>{const i=a.bySession[e];if(!i)return a;let l=!1;const c={};for(const[d,h]of Object.entries(i.activities))n.includes(h.status)?(c[d]={...h,status:r},l=!0):c[d]=h;return l?{...a,bySession:{...a.bySession,[e]:{...i,activities:c}}}:a})}));function OP(t,e){if(!e)return;const n=t.bySession[e];if(n)for(let r=n.order.length-1;r>=0;r--){const a=n.order[r];if(!a)continue;const i=n.activities[a];if(i&&(i.status==="running"||i.status==="waiting_user"||i.status==="paused"||i.status==="blocked"))return i}}function xS(t){const e=pr(r=>{var a;return t?(a=r.bySession[t])==null?void 0:a.taskTitles:void 0}),n=Be(r=>t?r.messagesBySession[t]??[]:[]);if(!t||!e)return null;for(let r=n.length-1;r>=0;r--){const a=n[r];if(!a||a.type!=="assistant")continue;const i=e[a.id];if(i)return i}return null}const df=["assistants","templates","plugins","connectors","skills","channels"];function LP(t,e=[]){const n=df.filter(a=>!e.includes(a)),r=t.filter(a=>!df.includes(a));return[...n,...r]}const oi=gn()(Ti(t=>({pinned:df,removedDefaults:[],moreExpanded:!1,morePinned:!1,collapsedProjects:[],togglePin:e=>t(n=>{const r=df.includes(e);return n.pinned.includes(e)?{pinned:n.pinned.filter(a=>a!==e),removedDefaults:r&&!n.removedDefaults.includes(e)?[...n.removedDefaults,e]:n.removedDefaults}:{pinned:[...n.pinned,e],removedDefaults:n.removedDefaults.filter(a=>a!==e)}}),setMoreExpanded:e=>t({moreExpanded:e}),toggleMorePinned:()=>t(e=>({morePinned:!e.morePinned})),toggleProjectCollapsed:e=>t(n=>({collapsedProjects:n.collapsedProjects.includes(e)?n.collapsedProjects.filter(r=>r!==e):[...n.collapsedProjects,e]}))}),{name:"deepseekcode-nav-storage",merge:(t,e)=>{const n=t??{},r=n.removedDefaults??[];return{...e,...n,pinned:LP(n.pinned??[],r),removedDefaults:r,collapsedProjects:n.collapsedProjects??[]}}})),m0=5,jP=10,BP=10;function IP({sessionId:t,fallback:e}){const n=xS(t);return g.jsx("span",{className:"min-w-0 flex-1 truncate",title:n??e,children:n??e})}const _5=["chat","plan","agentflow"],C5=N.memo(function({collapsed:e,onToggleCollapse:n,tabs:r,activeTab:a,onTabChange:i,isConnected:l,onNewSession:c,onStartTemplate:d,onManageTemplates:h,onSwitchSession:p,onCloseSession:m,onRenameSession:b,getTabTitle:x}){const{t:w}=tt(),S=Fe(de=>de.sessionTabs),E=Fe(de=>de.activeSessionId),A=Fe(de=>de.historySessions),T=Fe(de=>de.restoreHistorySession),D=Fe(de=>de.removeHistorySession),[M,B]=N.useState(!1),[I,U]=N.useState(!1),[W,Y]=N.useState(null),[oe,ae]=N.useState(""),[V,he]=N.useState(""),[ve,ge]=N.useState({}),q=N.useRef(null),ie=oi(de=>de.pinned),_e=oi(de=>de.moreExpanded),Se=oi(de=>de.morePinned),Qe=oi(de=>de.togglePin),qe=oi(de=>de.setMoreExpanded),Ke=oi(de=>de.toggleMorePinned),Ie=oi(de=>de.collapsedProjects),vt=oi(de=>de.toggleProjectCollapsed),an=N.useMemo(()=>ie.filter(de=>!_5.includes(de)).map(de=>r.find(Ve=>Ve.id===de)).filter(de=>!!de),[r,ie]),bn=N.useMemo(()=>r.filter(de=>!_5.includes(de.id)&&!ie.includes(de.id)),[r,ie]),Hn=N.useCallback((de,Ve)=>{Y(de),ae(Ve),setTimeout(()=>{var He;return(He=q.current)==null?void 0:He.select()},50)},[]),Ye=N.useCallback(()=>{W&&oe.trim()&&b(W,oe.trim()),Y(null)},[W,oe,b]),vn=N.useCallback((de,Ve)=>{var In;const He=Be.getState().getMessages(de),Ee=[];Ee.push(`# ${Ve||w("nav.chat")}`),Ee.push(""),Ee.push(`> ${w("chat.exportMd")} · ${new Date().toLocaleString()}`),Ee.push(""),Ee.push("---"),Ee.push(""),(!He||He.length===0)&&(Ee.push(w("chat.noSessions")),Ee.push(""));for(const xe of He){if(xe.deleted)continue;const $a=xe.type==="user"?w("chat.you"):w("chat.assistantLabel");if(Ee.push(`## ${$a} · ${new Date(xe.timestamp).toLocaleString()}`),Ee.push(""),xe.thinking&&xe.thinking.trim()&&(Ee.push("<details>"),Ee.push(`<summary>💭 ${w("chat.thoughtProcess")}</summary>`),Ee.push(""),Ee.push(xe.thinking.trim()),Ee.push(""),Ee.push("</details>"),Ee.push("")),xe.content&&xe.content.trim()&&(Ee.push(xe.content.trim()),Ee.push("")),xe.steps&&xe.steps.length>0){Ee.push(`**${w("chat.runningSteps")}:**`),Ee.push("");for(const Vt of xe.steps){if(Ee.push(`- **${Vt.title}**${Vt.status?` (\`${Vt.status}\`)`:""}`),Vt.thought&&Ee.push(` - 💭 ${Vt.thought}`),(In=Vt.toolCalls)!=null&&In.length)for(const Pr of Vt.toolCalls)Ee.push(` - 🛠 \`${Pr.name}\``);Vt.result&&Ee.push(` - ${Vt.result}`)}Ee.push("")}Ee.push("---"),Ee.push("")}const bt=new Blob([Ee.join(`
572
- `)],{type:"text/markdown;charset=utf-8"}),Lt=URL.createObjectURL(bt),It=document.createElement("a");It.href=Lt,It.download=`${(Ve||"session").replace(/[\\/:*?"<>|]/g,"_").slice(0,80)}.md`,It.click(),URL.revokeObjectURL(Lt)},[w]),yr=N.useCallback(de=>{T(de),Oe.setSessionId(de)},[T]),Yn=N.useCallback(de=>{p(de),a!=="chat"&&i("chat")},[p,i,a]),Lr=N.useCallback(de=>{!S.some(He=>He.id===de)?(yr(de),a!=="chat"&&i("chat")):Yn(de)},[S,yr,Yn,a,i]),Zn=Be(de=>de.generatingSessions),Tt=N.useCallback(de=>Zn.includes(de.id)?"running":de.status||"done",[Zn]),jr=V.trim().length>0,br=N.useCallback((de,Ve)=>{ge(He=>({...He,[de]:(He[de]??m0)+Math.min(jP,Ve)}))},[]),Br=N.useCallback(de=>{ge(Ve=>({...Ve,[de]:m0}))},[]),Ir=N.useMemo(()=>{const de=new Map,Ve=V.trim().toLowerCase(),Ee=[...Ve?S.filter(bt=>{const Lt=k0(bt);return bt.title.toLowerCase().includes(Ve)||(bt.project||"").toLowerCase().includes(Ve)||(Lt||"").toLowerCase().includes(Ve)}):S].sort((bt,Lt)=>(Lt.lastActiveAt??Lt.createdAt??0)-(bt.lastActiveAt??bt.createdAt??0));for(const bt of Ee){const Lt=bt.project||"default",It=de.get(Lt)||[];It.push(bt),de.set(Lt,It)}return Array.from(de.entries())},[S,V]),aa=N.useMemo(()=>{const de=new Set(S.map(Ve=>Ve.id));return S.length+A.filter(Ve=>!de.has(Ve.id)).length},[S,A]),ar=(de,Ve)=>{const He=a===de.id,Ee=de.iconComponent,bt=w(Ve?"nav.unpin":"nav.pin");return e?g.jsx("button",{onClick:()=>i(de.id),className:`flex h-9 w-9 items-center justify-center rounded-lg transition-colors ${He?"bg-accent-blue/10 text-accent-blue":"text-dark-muted hover:bg-dark-hover hover:text-dark-text"}`,title:x(de.id,de.title),"aria-label":x(de.id,de.title),"aria-current":He?"page":void 0,children:Ee&&g.jsx(Ee,{size:17,"aria-hidden":"true"})},de.id):g.jsxs("button",{onClick:()=>i(de.id),className:"side-nav-item group","data-active":He,"aria-current":He?"page":void 0,children:[Ee&&g.jsx(Ee,{size:15,"aria-hidden":"true",className:"shrink-0"}),g.jsx("span",{className:"truncate",children:x(de.id,de.title)}),g.jsx("span",{role:"button",tabIndex:0,onClick:Lt=>{Lt.stopPropagation(),Qe(de.id)},onKeyDown:Lt=>{(Lt.key==="Enter"||Lt.key===" ")&&(Lt.stopPropagation(),Qe(de.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:bt,"aria-label":bt,children:g.jsx(lg,{size:11,"aria-hidden":"true",className:Ve?"fill-current text-accent-blue":""})})]},de.id)},sa=de=>{if(bn.length===0)return null;const Ve=`${w("nav.moreOptions")} (${bn.length})`,He=w(Se?"nav.unpinMore":"nav.pinMore"),Ee=e?g.jsx("button",{onClick:()=>qe(!_e),className:`flex h-9 w-9 items-center justify-center rounded-lg transition-colors ${_e?"bg-dark-hover text-dark-text":"text-dark-muted hover:bg-dark-hover hover:text-dark-text"}`,title:Ve,"aria-label":Ve,"aria-expanded":_e,children:g.jsx(sx,{size:17,"aria-hidden":"true"})},"more"):g.jsxs("div",{className:"group flex items-center",children:[g.jsxs("button",{onClick:()=>qe(!_e),className:`side-nav-item flex-1 ${_e?"bg-dark-hover text-dark-text":""}`,"data-active":!1,"aria-expanded":_e,children:[g.jsx(sx,{size:15,"aria-hidden":"true",className:"shrink-0"}),g.jsx("span",{className:"truncate",children:w("nav.moreOptions")}),g.jsx("span",{className:"ml-auto rounded bg-dark-bg px-1.5 py-px text-[10px] text-dark-muted/70",children:bn.length}),g.jsx(yi,{size:13,"aria-hidden":"true",className:`shrink-0 text-dark-muted/70 transition-transform duration-150 ${_e?"rotate-180":""}`})]}),g.jsx("span",{role:"button",tabIndex:0,onClick:bt=>{bt.stopPropagation(),Ke()},onKeyDown:bt=>{(bt.key==="Enter"||bt.key===" ")&&(bt.stopPropagation(),Ke())},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:He,"aria-label":He,children:g.jsx(lg,{size:11,"aria-hidden":"true",className:Se?"fill-current text-accent-blue":""})})]},"more");return g.jsx("div",{className:`${de?"mt-1 border-t border-dark-border/40 pt-1":"mt-1.5 border-t border-dark-border/40 pt-1.5"}`,children:Ee},"more-row")};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:w("nav.collapseSidebar"),"aria-label":w("nav.collapseSidebar"),children:g.jsx(__,{size:16,"aria-hidden":"true"})})]}),g.jsx("div",{className:e?"p-2":"px-3 pt-3",children:d&&h?g.jsx(RP,{collapsed:e,onDirect:c,onStartTemplate:d,onManageTemplates:h}):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(nu,{size:15,"aria-hidden":"true"}),w("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:[(an.length>0||Se)&&g.jsxs("div",{className:`space-y-0.5 ${e?"flex flex-col items-center":""}`,children:[an.map(de=>ar(de,!0)),Se&&sa(!0)]}),!Se&&sa(!1)]}),_e&&bn.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:bn.map(de=>ar(de,!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(h3,{size:13,className:"shrink-0 text-dark-muted","aria-hidden":"true"}),g.jsx("input",{value:V,onChange:de=>he(de.target.value),className:"min-w-0 flex-1 bg-transparent text-xs text-dark-text placeholder:text-dark-muted/55 focus:outline-none",placeholder:w("nav.searchSessionsPlaceholder"),"aria-label":w("nav.searchSessions")}),V&&g.jsx("button",{onClick:()=>he(""),className:"rounded p-0.5 text-dark-muted hover:bg-dark-hover hover:text-dark-text","aria-label":w("nav.clearSessionSearch"),children:g.jsx(Bn,{size:11,"aria-hidden":"true"})})]}),g.jsxs("div",{className:"side-group-label flex items-center justify-between",children:[g.jsx("span",{children:w("nav.sessions")}),A.length>0&&g.jsxs("button",{onClick:()=>B(de=>!de),className:"flex items-center gap-0.5 rounded px-1 py-0.5 text-dark-muted/70 transition-colors hover:text-dark-text",title:w("chat.sessionHistory"),"aria-expanded":M,children:[g.jsx(n3,{size:11,"aria-hidden":"true"}),g.jsx(yi,{size:11,"aria-hidden":"true",className:`transition-transform ${M?"":"-rotate-90"}`})]})]}),g.jsxs("div",{className:"space-y-1.5",children:[Ir.map(([de,Ve])=>{const He=!jr&&Ie.includes(de),Ee=jr?Ve.length:Math.min(ve[de]??m0,Ve.length);let bt=Ve.slice(0,Ee);const Lt=Ve.find(xe=>xe.id===E);Lt&&!bt.some(xe=>xe.id===Lt.id)&&(bt=[Lt,...bt]);const It=Ve.length-bt.length,In=!jr&&Ee>m0;return g.jsxs("div",{children:[g.jsxs("button",{onClick:()=>vt(de),className:"flex w-full 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":!He,title:w(He?"nav.expandGroup":"nav.collapseGroup"),children:[g.jsx(d3,{size:10,"aria-hidden":"true",className:"shrink-0 opacity-60"}),g.jsx("span",{className:"truncate",children:de==="default"?w("nav.mySessions"):de}),g.jsx(yi,{size:10,"aria-hidden":"true",className:`shrink-0 opacity-60 transition-transform duration-150 ${He?"-rotate-90":""}`}),g.jsx("span",{className:"ml-auto text-[9px] text-dark-muted/40",children:Ve.length})]}),!He&&g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"space-y-0.5",children:bt.map(xe=>{const $a=xe.id===E,Vt=W===xe.id,Pr=Tt(xe),Mn=b1(xe.lastActiveAt??xe.createdAt,Date.now(),w),vr=k0(xe),xn=_3(xe.title,vr);return g.jsxs("div",{onClick:()=>!Vt&&Yn(xe.id),onDoubleClick:()=>Hn(xe.id,xe.title),className:`group relative flex cursor-pointer items-center gap-2 rounded-lg px-2.5 py-[6px] text-[13px] transition-colors ${$a?"bg-dark-hover font-medium text-dark-text":"text-dark-muted hover:bg-dark-hover/60 hover:text-dark-text"}`,children:[$a&&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(uf,{status:Pr}),Vt?g.jsx("input",{ref:q,value:oe,onChange:Dn=>ae(Dn.target.value),onBlur:Ye,onKeyDown:Dn=>{Dn.key==="Enter"?Ye():Dn.key==="Escape"&&Y(null)},onClick:Dn=>Dn.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(IP,{sessionId:xe.id,fallback:xe.title})}),g.jsxs("span",{className:"mt-0.5 flex items-center gap-2 text-[11px] leading-tight text-dark-muted/50",children:[xn&&g.jsx("span",{className:"min-w-0 flex-1 truncate",children:vr}),g.jsx("span",{className:`shrink-0 ${xn?"":"ml-auto"}`,children:Mn})]})]}),!Vt&&g.jsxs(g.Fragment,{children:[g.jsx("button",{onClick:Dn=>{Dn.stopPropagation(),Hn(xe.id,xe.title)},className:"shrink-0 rounded p-0.5 opacity-0 transition-all hover:bg-dark-bg group-hover:opacity-100",title:w("chat.renameSession"),"aria-label":w("chat.renameSession"),children:g.jsx(C_,{size:11,"aria-hidden":"true"})}),g.jsx("button",{onClick:Dn=>{Dn.stopPropagation(),vn(xe.id,xe.title)},className:"shrink-0 rounded p-0.5 opacity-0 transition-all hover:bg-dark-bg group-hover:opacity-100",title:w("chat.exportMd"),"aria-label":w("chat.exportMd"),children:g.jsx(tu,{size:11,"aria-hidden":"true"})}),S.length>1&&g.jsx("button",{onClick:Dn=>{Dn.stopPropagation(),m(xe.id)},className:"shrink-0 rounded p-0.5 opacity-0 transition-all hover:bg-dark-bg group-hover:opacity-100","aria-label":w("a11y.close"),children:g.jsx(Bn,{size:12,"aria-hidden":"true"})})]})]},xe.id)})}),(It>0||In)&&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:[It>0&&g.jsxs("button",{onClick:()=>br(de,It),className:"text-dark-muted transition-colors hover:text-accent-blue",children:[w("nav.showMoreSessions"),g.jsxs("span",{className:"ml-1 text-dark-muted/50",children:["(",It,")"]})]}),In&&g.jsx("button",{onClick:()=>Br(de),className:"text-dark-muted/60 transition-colors hover:text-dark-text",children:w("nav.collapseGroup")})]})]})]},de)}),Ir.length===0&&g.jsx("div",{className:"px-2.5 py-2 text-xs text-dark-muted/60",children:w("chat.noSessions")})]}),aa>BP&&g.jsxs("button",{onClick:()=>U(!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:w("chat.viewAllSessions"),children:[g.jsx(E_,{size:12,"aria-hidden":"true"}),w("chat.viewAllSessions"),g.jsxs("span",{className:"text-dark-muted/50",children:["(",aa,")"]})]}),M&&A.length>0&&g.jsx("div",{className:"mt-1 space-y-0.5 border-t border-dark-border/50 pt-1",children:A.slice(0,10).map(de=>{const Ve=k0(de);return g.jsxs("div",{onClick:()=>yr(de.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(uf,{status:"done",label:w("nav.sessionEnded")}),g.jsxs("span",{className:"min-w-0 flex-1",children:[g.jsx("span",{className:"block truncate",children:de.title}),Ve&&g.jsx("span",{className:"block truncate text-[10px] text-dark-muted/50",children:Ve})]}),g.jsx("span",{className:"shrink-0 text-[10px] text-dark-muted/50",children:b1(de.lastActiveAt??de.createdAt,Date.now(),w)}),g.jsx("button",{onClick:He=>{He.stopPropagation(),D(de.id)},className:"shrink-0 rounded p-0.5 opacity-0 transition-all hover:bg-dark-bg group-hover:opacity-100","aria-label":w("chat.removeFromHistory"),children:g.jsx(Bn,{size:11,"aria-hidden":"true"})})]},de.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:w("nav.expandSidebar"),"aria-label":w("nav.expandSidebar"),children:g.jsx(T_,{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":w("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:w(l?"chat.connected":"chat.disconnected")})]})]}),g.jsx(MP,{isOpen:I,onClose:()=>U(!1),onSwitchSession:Lr})]})}),PP={info:"bg-accent-blue",warn:"bg-accent-yellow",error:"bg-accent-red",success:"bg-accent-green",tool:"bg-accent-purple"};function zP(t){return t==null||t===""?"-":new Date(t).toLocaleString()}function $P(){const{t}=tt(),[e,n]=N.useState([]),[r,a]=N.useState(!0),[i,l]=N.useState(null),[c,d]=N.useState(null),[h,p]=N.useState(!1),m=N.useCallback(async()=>{a(!0);try{const S=await ct.logs.list();S.success&&Array.isArray(S.data)&&n(S.data)}catch(S){console.error("Failed to load log files:",S)}a(!1)},[]);N.useEffect(()=>{m()},[m]);const b=N.useCallback(async S=>{if(!S.previewable)return;l(S),p(!0);const E=await ct.logs.read(S.name,500);E.success&&E.data&&d(E.data),p(!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(D1,{size:16})}),g.jsx("span",{className:"text-sm font-medium text-dark-text truncate flex-1",children:i.name}),g.jsxs("a",{href:ct.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(tu,{size:12}),t("logs.download")]})]}),h?g.jsx("div",{className:"flex-1 flex items-center justify-center",children:g.jsx(Kn,{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
573
- 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:r,children:t(r?"logs.refreshing":"logs.refresh")})]}),r?g.jsx("div",{className:"flex items-center justify-center py-8",children:g.jsx(Kn,{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(mo,{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(mo,{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)," · ",zP(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(A1,{size:14})}),g.jsx("a",{href:ct.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(tu,{size:14})})]})]},S.name))})]})}const E5=N.memo(N.forwardRef(function({logs:e},n){const{t:r}=tt();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(Gc,{size:48,className:"mx-auto mb-2 opacity-50"}),g.jsx("p",{children:r("logs.noLogs")})]}):e.map(a=>g.jsxs("div",{className:`p-2 rounded hover:bg-dark-surface transition-colors ${a.level==="error"?"bg-accent-red/10":a.level==="warn"?"bg-accent-yellow/10":a.level==="success"?"bg-accent-green/10":""}`,children:[g.jsx("span",{className:"text-dark-muted text-xs",children:new Date(a.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 ${PP[a.level]}`,children:a.level.toUpperCase()})," ",g.jsxs("span",{className:"text-dark-muted text-xs",children:["[",a.source,"]"]})," ",g.jsx("span",{className:"text-dark-text whitespace-pre-wrap break-all",children:a.message})]},a.id))})})),FP=N.memo(function({logs:e,onClear:n,compact:r}){const{t:a}=tt(),[i,l]=N.useState("stream"),c=N.useRef(null),d=N.useRef(!0),h=N.useCallback(()=>{const m=c.current;return m?m.scrollHeight-m.scrollTop-m.clientHeight<50:!0},[]),p=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=h()};return m.addEventListener("scroll",b,{passive:!0}),()=>m.removeEventListener("scroll",b)},[h]),N.useEffect(()=>{d.current&&p()},[e,p]),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&&p(),b=w});return x.observe(m),()=>x.disconnect()},[p]),r?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(Gc,{size:14,className:"text-accent-blue"}),a("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:a("logs.clear")})]}),g.jsx(E5,{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(Gc,{size:18,className:"text-accent-blue"}),a("logs.backendLogs")]})}),g.jsx("div",{className:"flex gap-1 mb-3 shrink-0 border-b border-dark-border",children:[["stream",a("logs.streamTab"),Gc],["files",a("logs.files"),mo]].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:a("logs.clear")})}),g.jsx(E5,{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($P,{})})})]})}),UP=t=>{if(t==null||t==="")return{};if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}},g0=(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||""),HP=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:[],Km=(t,e,n=0)=>{const r=String(t.id||t.taskId||t.backendId||`plan-task-${n+1}`),a=ja(t.status||t.planStatus,t.completed),i=Date.now()+n;return{id:r,sessionId:e,title:String(t.title||t.name||t.content||t.description||`Task ${n+1}`),description:t.description||t.details||t.content,status:a,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):a==="running"?i:void 0,completedAt:t.completedAt?Number(t.completedAt):a==="completed"||a==="failed"?i:void 0,createdAt:t.createdAt&&Number(t.createdAt)||i,updatedAt:i,raw:t}},T5=(t,e,n=0)=>{const r=String(t.id||t.taskId||t.backendId||`goal-task-${n+1}`),a=ja(t.status),i=Date.now()+n;return{id:r,sessionId:e,title:String(t.title||t.name||t.content||t.description||`Task ${n+1}`),description:t.description||t.details||t.content,status:a,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):a==="running"?i:void 0,completedAt:t.completedAt?Number(t.completedAt):a==="completed"||a==="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 r=ot.getState().getTasksForSession(t).find(c=>c.id===n),a=Fe.getState().getSessionTasks(t).find(c=>c.id===n||c.backendId===n),i=e!=null&&e.status?ja(e.status):(r==null?void 0:r.status)||"pending",l={id:n,sessionId:t,title:(e==null?void 0:e.title)||(r==null?void 0:r.title)||(a==null?void 0:a.title)||n,description:(e==null?void 0:e.description)??(r==null?void 0:r.description)??(a==null?void 0:a.description),status:i,source:"goal",agentType:(e==null?void 0:e.agentType)||(r==null?void 0:r.agentType),progress:(e==null?void 0:e.progress)!=null?Number(e.progress):r==null?void 0:r.progress,result:(e==null?void 0:e.result)??(r==null?void 0:r.result),error:(e==null?void 0:e.error)??(r==null?void 0:r.error),startedAt:i==="running"?Date.now():r==null?void 0:r.startedAt,completedAt:i==="completed"||i==="failed"?Date.now():r==null?void 0:r.completedAt,createdAt:(r==null?void 0:r.createdAt)||Date.now(),updatedAt:Date.now(),raw:e};return ot.getState().upsertTask(t,l),v1(t,l),l},Uc=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}),v1=(t,e)=>{const n=Fe.getState(),r=n.getSessionTasks(t),a=Uc(e);if(r.some(i=>i.id===e.id||i.backendId===e.id)){n.updateTaskPlanStatus(t,e.id,a);return}n.setSessionTasks(t,[...r,a])},y0=t=>{const e=Be.getState(),n=e.getMessages(t),r=n[n.length-1];(!r||r.type!=="assistant")&&e.addMessage(t,{id:`plan-${Date.now()}`,type:"assistant",content:"",timestamp:Date.now()})};function A5(t,e,n){const r=pl.getState(),a=Be.getState(),i=ot.getState(),l=UP(e);switch(t){case"plan_start":{a.startGeneration(n),y0(n);const c=g0(l,"Plan started");c&&r.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=g0(l,"Analyzing request...");r.setThinkingStatus(n,c),y0(n),a.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){r.setPlanContent(String(c)),y0(n);const d=a.getMessages(n),h=d[d.length-1];(h==null?void 0:h.type)==="assistant"&&!h.content.trim()&&a.updateLastMessage(n,String(c))}else{const d=[...a.getMessages(n)].reverse().find(h=>h.type==="assistant");d!=null&&d.content&&r.setPlanContent(d.content)}a.endGeneration(n),i.recordEvent(n,{type:t,source:"plan",title:"Plan complete",message:g0(l,"Plan complete"),status:"completed",data:l});break}case"plan_error":{const c=g0(l,"Plan failed");y0(n),a.updateLastMessage(n,`Plan failed: ${c}`),a.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=HP(l).map((d,h)=>Km(d,n,h));i.setTasks(n,c,"plan"),Fe.getState().setSessionTasks(n,c.map(Uc)),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=Km(l,n),d=t==="plan_task_start"?"running":ja(t==="plan_task_result"?l.status||(l.error?"failed":"completed"):l.status||l.planStatus),h={...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,h),v1(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});break}case"plan_task_complete":{const c=Km(l,n),d=String(l.status||"")==="failed"||!!l.error,p={...c,status:d?"failed":"completed",completedAt:c.completedAt||Date.now()};i.upsertTask(n,p),v1(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});const m=p.title||`task ${p.id}`;d?mt.error(`✘ ${m} 失败`,6e3):mt.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"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"?r.applyBackendMode("normal"):c==="auto"?r.setAuto(!0):(c==="plan"||c==="act"||c==="goal"||c==="auto-plan"||c==="auto-act"||c==="auto-goal")&&r.applyBackendMode(c);const h=d?` [plan: ${d}]`:"";i.recordEvent(n,{type:t,source:"system",title:"Mode changed",message:`${(l==null?void 0:l.previousMode)||"unknown"} -> ${c||"unknown"}${h}`,status:(l==null?void 0:l.success)===!1?"failed":"completed",data:l});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,h)=>T5(d,n,h)):[];i.setTasks(n,c,"goal"),Fe.getState().setSessionTasks(n,c.map(Uc)),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,h)=>T5(d,n,h)):[];i.setTasks(n,c,"goal"),Fe.getState().setSessionTasks(n,c.map(Uc)),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?ja(l.status):void 0,data:l});break}case"goal_completed":{const c=String((l==null?void 0:l.goalId)||""),d=i.getTasksForSession(n).filter(h=>h.source==="goal");if(d.length>0){const h=d.map(p=>p.status==="pending"||p.status==="running"?{...p,status:"completed",completedAt:Date.now(),updatedAt:Date.now()}:p);i.setTasks(n,h,"goal"),Fe.getState().setSessionTasks(n,h.map(Uc))}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 wS=/(?:^|\s|\/|\\)(test|tests|lint|build|tsc|vitest|jest|pytest|typecheck|check)(?:\s|\.|"|'|`|$)/i,kS=/bash|shell|run|exec|terminal|command/i,qP=/read|grep|glob|search|list|find|open|view|web_search|fetch/i;function N5(t){return t.some(e=>Cl(e.name))?"coding":t.some(e=>kS.test(e.name))&&t.some(e=>{const n=typeof e.args=="string"?e.args:JSON.stringify(e.args??"");return wS.test(n)})?"validating":t.some(e=>qP.test(e.name))?"researching":"summarizing"}function R5(t){return t.some(e=>Cl(e.name))?"implementation":t.some(e=>kS.test(e.name))&&t.some(e=>{const n=typeof e.args=="string"?e.args:JSON.stringify(e.args??"");return wS.test(n)})?"optimization":"analysis"}function x1(t){return rn.t(`activity.verb.${t}`)}function SS(t){const e=t.replace(/\\/g,"/");return e.slice(e.lastIndexOf("/")+1)||t}function VP(t,e){const n=x1(t);for(const r of e){const a=cf(r.args);if(a)return rn.t("activity.title.withFile",{verb:n,file:SS(a)})}return e.length>1?rn.t("activity.title.withCount",{verb:n,count:e.length}):n}const WP=1500,KP=3,YP=3,M5=24;let N0=!1,gi=[],ff=0,uo=null;function w1(){return ff>=YP}function D5(){uo==null||uo.abort(),uo=null;const t=gi;gi=[],N0=!1,ff=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>M5?`${e.slice(0,M5-1)}…`:e:null}async function XP(t){var r,a,i;const e=new AbortController;uo=e;const n=setTimeout(()=>e.abort(),WP);try{const l=[`行为类型: ${t.kind}`,t.files.length>0?`涉及文件: ${t.files.map(SS).join(", ")}`:"",`工具调用数: ${t.toolCount}`].filter(Boolean).join(`
574
- `),c=await fetch("/v1/chat/completions",{method:"POST",headers:{"content-type":"application/json"},signal:e.signal,body:JSON.stringify({messages:[{role:"system",content:"你是标题生成器。根据给定的行为类型、涉及文件和工具数,生成一句不超过 16 字的中文活动标题(动词开头,不要标点结尾,不要引号)。只输出标题本身。"},{role:"user",content:l}],max_tokens:60,temperature:.3,stream:!1})});if(!c.ok)return null;const h=(i=(a=(r=(await c.json()).choices)==null?void 0:r[0])==null?void 0:a.message)==null?void 0:i.content;return typeof h=="string"?ZP(h):null}catch{return null}finally{clearTimeout(n),uo===e&&(uo=null)}}async function _S(){if(N0)return;const t=gi.shift();if(t){N0=!0;try{const e=await XP(t.req);e?(ff=0,t.resolve(e)):(ff+=1,t.resolve(null))}finally{if(N0=!1,gi.length>0&&!w1())_S();else if(w1()){const e=gi;gi=[];for(const n of e)n.resolve(null)}}}}function QP(t){return w1()||gi.length>=KP?Promise.resolve(null):new Promise(e=>{gi.push({req:t,resolve:e}),_S()})}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 rz(t,e){const n=t[t.length-1];if(!n)return!1;const r=Cl(n.name),a=/bash|shell|run|exec|terminal/i.test(e);return r&&a||!r&&a&&Cl(e)}class az{constructor(){Z(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 r=Be.getState().messagesBySession[e]||[],a=r[r.length-1];return(a==null?void 0:a.id)??null}resetSession(e){this.sessions.delete(e),pr.getState().resetSession(e)}onWsEvent(e,n,r,a){if(!(a&&JP.has(n)))switch(n){case"start":this.onStart(e);break;case"thinking":this.onThinking(e,r);break;case"content":this.onContent(e);break;case"tool_call":this.onToolCall(e,r);break;case"tool_result":this.onToolResult(e,r);break;case"turn_summary":this.onTurnSummary(e,r);break;case"ask_user_question":case"hook_ask":this.onWaitingUser(e);break;case"generation_paused":pr.getState().markStatus(e,["running","waiting_user"],"paused");break;case"generation_resumed":pr.getState().markStatus(e,["paused"],"running");break;case"error":this.finalizeAll(e,"failed"),D5();break;case"complete":this.finalizeAll(e,"completed"),D5();break}}onStart(e){const n=this.session(e),r=Be.getState().messagesBySession[e]||[],a=r[r.length-1];n.messageId=(a==null?void 0:a.id)??null,n.batch=null,n.seq=0,n.lastBlockIndex=Number.NEGATIVE_INFINITY}onThinking(e,n){const r=this.session(e);if(!r.batch||r.batch.toolCallIds.length===0){this.advanceBlockIndex(r,n);return}const a=this.parseIndex(n);typeof a=="number"&&a>r.lastBlockIndex&&this.sealBatch(r.batch),this.advanceBlockIndex(r,n)}onContent(e){const n=this.session(e);n.batch&&this.sealBatch(n.batch)}onToolCall(e,n){const r=this.session(e),a=this.parseObj(n);if(!a)return;const i=typeof a.id=="string"?a.id:void 0,l=typeof a.index=="number"?a.index:void 0,c=typeof a.name=="string"?a.name:"Unknown",d=a.args??a.arguments??"",h=this.currentMessageId(e)??`session:${e}`;let p=r.batch;if(!p||p.messageId!==h||p.sealed){p&&!p.sealed&&p.toolCallIds.length>0&&this.finalizeBatch(e,p,p.hadError?this.errorStatus(p):"completed"),r.seq+=1;const A=`${h}:act:${r.seq}`,T=N5([{name:c,args:d}]),D=R5([{name:c,args:d}]),M=Date.now(),B=l??(r.lastBlockIndex===Number.NEGATIVE_INFINITY?0:r.lastBlockIndex+1);p={sessionId:e,messageId:h,activityId:A,kind:T,phase:D,tools:[],toolCallIds:[],toolIndexByKey:new Map,pending:new Set,hadError:!1,blockRange:[B,B],startedAt:M,sealed:!1},r.batch=p,pr.getState().applyEvent(e,{type:"activity_started",activity:{id:A,sessionId:e,messageId:h,kind:T,phase:D,status:"running",title:x1(T),titleSource:"rule",toolCallIds:[],blockRange:p.blockRange,startedAt:M}})}if(!p.sealed&&p.toolCallIds.length>=nz&&rz(p.tools,c)){this.finalizeBatch(e,p,p.hadError?"failed":"completed"),r.batch=null,this.onToolCall(e,n);return}const m=l!==void 0?`idx:${l}`:i??null;if(m!==null&&p.toolIndexByKey.has(m)){const A=p.toolIndexByKey.get(m),T=p.tools[A];let D=!1;T&&(T.name==="Unknown"&&c!=="Unknown"&&(T.name=c,D=!0),!T.args&&d&&(T.args=d,D=!0));const M=p.toolCallIds[A];i&&M&&M.startsWith("tc-")&&(p.toolCallIds[A]=i,p.pending.delete(M),p.pending.add(i),D=!0),D&&pr.getState().applyEvent(e,{type:"activity_updated",activityId:p.activityId,patch:{toolCallIds:[...p.toolCallIds]}});return}const b={name:c,args:d};p.tools.push(b),m!==null&&p.toolIndexByKey.set(m,p.tools.length-1);const x=i??`tc-${p.toolCallIds.length}-${p.activityId}`;p.toolCallIds.push(x),p.pending.add(x),l!==void 0&&(p.blockRange=[Math.min(p.blockRange[0],l),Math.max(p.blockRange[1],l)],r.lastBlockIndex=Math.max(r.lastBlockIndex,l));const w=N5(p.tools),S=R5(p.tools),E=pr.getState();if(E.applyEvent(e,{type:"activity_updated",activityId:p.activityId,patch:{kind:w,phase:S,toolCallIds:[...p.toolCallIds],...w!==p.kind?{title:x1(w)}:{}}}),p.kind=w,p.phase=S,Cl(c)){const A=cf(d);A&&E.applyEvent(e,{type:"artifact_produced",artifact:{id:`${p.activityId}:${A}`,path:A,action:"modified",activityId:p.activityId}})}}onToolResult(e,n){const r=this.session(e);if(!r.batch)return;const a=this.parseObj(n);if(!a)return;const i=r.batch,l=typeof a.id=="string"?a.id:void 0,c=typeof a.index=="number"?a.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 h=a.result;typeof h=="string"&&h.startsWith("Error:")&&(i.hadError=!0,i.lastError=String(h).slice(0,200)),i.sealed&&i.pending.size===0&&this.finalizeBatch(e,i,i.hadError?"failed":"completed")}onTurnSummary(e,n){const r=this.parseObj(n);if(!r)return;const a=typeof r.headline=="string"?r.headline:void 0;if(!a)return;const i=this.currentMessageId(e);i&&pr.getState().applyEvent(e,{type:"task_title_set",messageId:i,title:a})}onWaitingUser(e){const n=pr.getState(),r=n.bySession[e];if(r)for(let a=r.order.length-1;a>=0;a--){const i=r.order[a];if(!i)continue;const l=r.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 r=this.session(e);r.batch&&(this.finalizeBatch(e,r.batch,r.batch.hadError?this.errorStatus(r.batch):n),r.batch=null),pr.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,r){if(!n)return;const a=pr.getState(),i=n.kind,l=n.tools,c=VP(i,l);if(a.applyEvent(e,{type:"activity_finalized",activityId:n.activityId,status:r,endedAt:Date.now()}),a.applyEvent(e,{type:"activity_updated",activityId:n.activityId,patch:{title:c,titleSource:"inferred",...(r==="failed"||r==="blocked")&&n.lastError?{blockedReason:n.lastError}:{}}}),r==="completed"&&l.length>=2){const d=l.map(h=>cf(h.args)).filter(h=>typeof h=="string");QP({kind:i,files:d,toolCount:l.length}).then(h=>{h&&pr.getState().applyEvent(e,{type:"activity_updated",activityId:n.activityId,patch:{title:h,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),r=n==null?void 0:n.index;return typeof r=="number"?r:void 0}advanceBlockIndex(e,n){const r=this.parseIndex(n);typeof r=="number"&&(e.lastBlockIndex=Math.max(e.lastBlockIndex,r))}}const sz=new az;let O5=0;const Ym=gn(t=>({compactedBySession:{},ttftBySession:{},addCompacted:(e,n)=>t(r=>{const a=r.compactedBySession[e]??[];return a.some(i=>i.seq===n.seq)?r:{compactedBySession:{...r.compactedBySession,[e]:[...a,n].sort((i,l)=>i.timestamp-l.timestamp)}}}),recordTtft:(e,n,r)=>t(a=>{const i=a.ttftBySession[e]??{};return i[n]!==void 0?a:{ttftBySession:{...a.ttftBySession,[e]:{...i,[n]:r}}}}),resetSession:e=>t(n=>{if(n.compactedBySession[e]===void 0&&n.ttftBySession[e]===void 0)return n;const r={...n.compactedBySession},a={...n.ttftBySession};return delete r[e],delete a[e],{compactedBySession:r,ttftBySession:a}})}));function iz(){return O5+=1,O5}class oz{constructor(){Z(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 r=Be.getState().messagesBySession[e]||[],a=r[r.length-1];return(a==null?void 0:a.id)??null}resetSession(e){this.sessions.delete(e),Ym.getState().resetSession(e)}onWsEvent(e,n,r,a){if(!a)switch(n){case"start":this.onStart(e);break;case"content":case"thinking":this.onFirstToken(e);break;case"context_compressed":this.onCompacted(e,r);break;case"complete":case"error":this.onEnd(e);break}}onStart(e){const n=this.session(e),r=Be.getState().messagesBySession[e]||[],a=r[r.length-1];n.messageId=(a==null?void 0:a.id)??null,n.ttftRecorded=!1}onFirstToken(e){const n=this.session(e);if(n.ttftRecorded)return;const r=n.messageId??this.currentMessageId(e);r&&(n.ttftRecorded=!0,Ym.getState().recordTtft(e,r,Date.now()))}onCompacted(e,n){let r=null;if(n&&typeof n=="object"&&!Array.isArray(n))r=n;else if(typeof n=="string")try{const a=JSON.parse(n);a&&typeof a=="object"&&!Array.isArray(a)&&(r=a)}catch{r=null}r&&Ym.getState().addCompacted(e,{seq:iz(),timestamp:Date.now(),...typeof r.originalCount=="number"?{originalCount:r.originalCount}:{},...typeof r.compressedCount=="number"?{compressedCount:r.compressedCount}:{},...typeof r.tokensSaved=="number"?{tokensSaved:r.tokensSaved}:{}})}onEnd(e){const n=this.session(e);n.messageId=null,n.ttftRecorded=!1}}const lz=new oz;function cz(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:uz(t,n),detail:t,retryable:n!=="auth",timestamp:Date.now()}}function uz(t,e){const n={auth:"API Key 无效或已失效(401 Unauthorized)",rate_limit:"请求频率超限或配额不足(429)",timeout:"请求超时",network:"网络连接异常",tool:"工具执行失败",model:"模型调用失败",unknown:"发生未知错误"},r=(t.split(`
575
- `)[0]||"").trim().slice(0,120);return r?`${n[e]}: ${r}`:n[e]}function L5(t){const e=String(t||"");try{const n=JSON.parse(e),r=n.text||n.content;return{text:typeof r=="string"?r:e,index:typeof n.index=="number"?n.index:void 0}}catch{return{text:e,index:void 0}}}function dz(t,e,n,r){var i,l;const a=Be.getState();if(!(r&&(t==="content"||t==="thinking"||t==="tool_call"||t==="tool_result"))){switch(t){case"start":a.startGeneration(n),a.addMessage(n,{id:Oa(),type:"assistant",content:"",timestamp:Date.now()}),Fe.getState().touchSession(n);break;case"content":{const{text:c,index:d}=L5(e),h=c.replace(/\[FINISH\]/g,"");h&&(a.appendToLastMessageText(n,h,d),st.getState().recordStreamText(h))}break;case"thinking":{const{text:c,index:d}=L5(e);c&&(a.appendToLastMessageThinking(n,c,d),st.getState().recordStreamText(c))}break;case"tool_call":try{const c=JSON.parse(e||"{}"),d=c.id||Oa(),h=typeof c.index=="number"?c.index:void 0,p=c.args||c.arguments||"",m=a.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=>h!==void 0&&S.index===h||S.id===d);if(w)a.updateToolCall(n,w.id??d,{args:p,...d&&w.id&&w.id!==d?{id:d}:{}});else if(h===void 0&&c.name){const S=x.filter(A=>A.name===c.name&&A.status==="running"),E=S[S.length-1];E?a.updateToolCall(n,E.id,{args:p,...d&&E.id!==d?{id:d}:{}}):a.addToolCall(n,{id:d,index:h,name:c.name||"Unknown",args:p,status:"running",timestamp:Date.now()})}else a.addToolCall(n,{id:d,index:h,name:c.name||"Unknown",args:p,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||"{}"),h=Be.getState().messagesBySession[n]||[],p=[];for(const S of h){const E=S.steps||[];for(const A of E)A.toolCalls&&p.push(...A.toolCalls);S.toolCalls&&p.push(...S.toolCalls)}const m=c.toolName,b=c.id,x=typeof c.index=="number"?c.index:void 0;let w;if(b&&(w=p.find(S=>S.id===b)),!w&&x!==void 0&&(w=p.find(S=>S.index===x&&S.name===m)),!w){const S=p.filter(E=>E.name===m&&E.status==="running");S.sort((E,A)=>(E.timestamp||0)-(A.timestamp||0)),w=S[0]}if(!w){const S=p.filter(E=>E.name===m&&E.status==="error"&&E.ended!==void 0&&E.ended!==null);S.sort((E,A)=>(A.timestamp||0)-(E.timestamp||0)),w=S[0]}if(w){const S=Math.floor((Date.now()-(w.timestamp||Date.now()))/1e3),E=typeof c.result=="string"&&c.result.startsWith("Error:");a.updateToolCall(n,w.id,{status:E?"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(A=>typeof A=="string"&&A.length>0)}:{},...Array.isArray(c.attachments)?{attachments:c.attachments.filter(A=>!!A&&typeof A=="object"&&typeof A.url=="string"&&typeof A.mime=="string")}:{}})}}catch(c){console.warn("Failed to parse tool result",String(c))}break;case"tool_diff":try{const c=JSON.parse(e||"{}"),h=Be.getState().messagesBySession[n]||[],p=[];for(const x of h){const w=x.steps||[];for(const S of w)S.toolCalls&&p.push(...S.toolCalls);x.toolCalls&&p.push(...x.toolCalls)}const m=p.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"&&a.updateToolCall(n,b.id,{diff:c.diff})}catch(c){console.warn("Failed to parse tool diff",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[h,p]of Object.entries(c.toolCounts)){const m=Number(p);Number.isFinite(m)&&m>0&&(d[h]=m)}a.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)}`,h=typeof c.index=="number"?c.index:void 0,p=c.status==="searching"||c.status==="in_progress",m=c.status==="failed",b=a.messagesBySession[n]||[],x=b[b.length-1],S=[...((l=x==null?void 0:x.steps)==null?void 0:l.flatMap(E=>E.toolCalls||[]))||[],...(x==null?void 0:x.toolCalls)||[]].find(E=>E.id===d||h!==void 0&&E.index===h&&E.name==="web_search");S?p||a.updateToolCall(n,S.id,{status:m?"error":"completed",result:m?"❌ 联网搜索失败":c.searchUrl?`✅ 搜索完成:${c.searchUrl}`:"✅ 搜索完成"}):a.addToolCall(n,{id:d,index:h,name:"web_search",args:"{}",status:p?"running":"completed",result:p?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||"{}");st.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":a.endGeneration(n),Ix(n);{const c=Be.getState().messagesBySession[n]||[];c.length>0&&st.getState().recalculateFromMessages(c)}Fe.getState().touchSession(n);break;case"generation_paused":a.pauseGeneration(n);break;case"generation_resumed":a.resumeGeneration(n);break;case"compaction_progress":try{const c=JSON.parse(e||"{}");st.getState().setCompactionProgress({stage:c.stage||"",percent:c.percent||0,message:c.message||""})}catch(c){console.error("Failed to parse compaction_progress:",c)}break;case"context_compressed":try{const c=JSON.parse(e||"{}"),d=`Context compressed: ${c.originalCount} -> ${c.compressedCount} msgs, freed ${c.tokensSaved} tokens`;a.appendToLastMessage(n,`
576
-
577
- ---
578
- ${d}
579
-
580
- `),mt.info(d,5e3),st.getState().setCompacting({originalCount:c.originalCount||0,compressedCount:c.compressedCount||0,tokensSaved:c.tokensSaved||0}),st.getState().setCompactionProgress(null)}catch(c){console.error("Failed to parse context_compressed:",c)}break;case"error":{a.endGeneration(n),Ix(n);const c=typeof e=="string"?e:String(e||"Error occurred"),d=cz(c),h=a.messagesBySession[n]||[],p=h[h.length-1];p&&p.type==="assistant"&&!p.errorCard?a.attachErrorCard(n,d):a.addMessage(n,{id:Oa(),type:"assistant",content:"",timestamp:Date.now(),errorCard:d}),Fe.getState().touchSession(n);break}case"context_analysis":try{const c=JSON.parse(e||"{}");c&&c.total!==void 0&&st.getState().setContextDistribution(c)}catch(c){console.error("Failed to parse context_analysis:",c)}break;case"threshold_warning":try{const c=JSON.parse(e||"{}");st.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||"{}");st.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||"{}");st.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,h=c.maxRetries||3,p=c.reason||"no response from model";c.recovering?mt.warning(`⚠ Generation stalled (${p}) — retrying ${d}/${h}`,8e3):mt.error(`⚠ Generation stalled (${p}) — giving up`,1e4)}catch(c){console.warn("Failed to parse stall_detected",String(c))}break}sz.onWsEvent(n,t,e,r),lz.onWsEvent(n,t,e,r)}}const yy=gn()((t,e)=>({backendCommands:[],loaded:!1,setBackendCommands:n=>{t({backendCommands:n,loaded:!0})},getAllCommands:()=>e().backendCommands}));async function fz(t="",e){try{let n=`${t}/api/commands`;e&&(n+=`?lang=${encodeURIComponent(e)}`);const r=await fetch(n);if(!r.ok)return[];const a=await r.json(),i=Array.isArray(a==null?void 0:a.data)?a.data:[];return yy.getState().setBackendCommands(i),i}catch{return[]}}function Zm(t,e,n,r,a){var i,l,c,d;switch(t){case"token_update":try{const p=typeof e=="string"?JSON.parse(e):e||{};if(p.source==="workflow"){st.getState().addWorkflowTokens(Number(p.workflowNodeTokens)||0);break}p.totalTokens>0&&st.getState().updateUsage({promptTokens:p.promptTokens||0,completionTokens:p.completionTokens||0,totalTokens:p.totalTokens||0});const m=p.promptCacheHitTokens??p.prompt_cache_hit_tokens,b=p.promptCacheMissTokens??p.prompt_cache_miss_tokens;(m!==void 0||b!==void 0)&&st.getState().accumulateCacheStats(Number(m)||0,Number(b)||0),p.model&&st.getState().setModel(p.model)}catch{}break;case"context_breakdown":try{const p=typeof e=="string"?JSON.parse(e):e||{};st.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=a&&typeof a.model=="string"&&a.model||(typeof e=="string"?e:(e==null?void 0:e.model)||"");p&&st.getState().setModel(p);const m=a&&typeof a.modelRef=="string"&&a.modelRef||(typeof e=="object"&&e!==null&&typeof e.modelRef=="string"?e.modelRef:"");m&&st.getState().setModelRef(m);const b=a&&typeof a.source=="string"&&a.source||(typeof e=="object"&&e!==null&&typeof e.source=="string"?e.source:"");b&&st.getState().setModelSource(b)}catch{}break;case"auth_required":let h=localStorage.getItem("auth_token");h||(h="default-token",localStorage.setItem("auth_token",h)),Oe.setToken(h),Oe.setAuthenticated(!1),Oe.send({type:"auth",token:h});break;case"auth_success":Oe.setAuthenticated(!0),Oe.send({type:"subscribe_logs"});{const p=wi.getState();fz("",(i=p.language)!=null&&i.startsWith("zh")?"zh":"en");const m=p.workspaceDir;m&&Oe.send({type:"workspace",message:m})}break;case"auth_failed":Ma.error("Auth failed",String(e));break;case"log":try{const p=typeof e=="string"?JSON.parse(e):e,m={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()};r.setLogs(b=>[...b,m].slice(-500)),r.activeTab!=="logs"&&r.setUnreadLogs(b=>b+1)}catch(p){console.warn("Failed to parse log entry",String(p))}break;case"commands_list":try{const p=JSON.parse(e||"[]");yy.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||{};mt.error((p.error||"Command failed").toString(),6e3)}catch{}break;case"notification":{try{const p=typeof e=="string"?JSON.parse(e):e||{},m=p.result&&typeof p.result=="object"?p.result:{},b=String(p.message||m.message||"").trim();if(!b)break;if(p.kind==="command"){const x=Fe.getState().activeSessionId;x&&Be.getState().addMessage(x,{id:`cmd-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,type:"assistant",content:`⚙️ ${String(p.command||"")} → ${b}`,timestamp:Date.now()})}else mt.info(b,5e3)}catch{}break}case"ping":Oe.send({type:"pong",data:Date.now().toString()});break;case"workspace_changed":try{const p=JSON.parse(e||"{}");p.newDir&&wi.getState().setWorkspaceDir(p.newDir)}catch{}break;case"degradation_update":try{const p=typeof e=="string"?JSON.parse(e):e||{},m=p.active,b=p.mode||"normal",x=Number(p.retryCount)||0,w=Number(p.maxRetries)||0,S=p.message||"",A={normal:"normal",retrying:"retrying",alternative:"alternative model",degraded:"degraded",verifying:"verifying",verified_fail:"verify failed"}[b]||b;if(st.getState().setDegradation({active:m,retryCount:x,maxRetries:w,mode:b,message:S,label:A}),m){const T=x>0?` (${x}/${w})`:"";mt.warning(S||`API Degraded: ${A}${T}`,8e3),r.setLogs(D=>[...D,{id:`deg-${Date.now()}`,level:"warn",source:"Infrastructure",message:`Degradation: ${A} | ${S||"no details"}`,timestamp:Date.now()}].slice(-500))}else mt.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||{},m=p.overallStatus||p.status||"unknown",b=p.healthRate,x=p.issues||[],S={healthy:"healthy",degraded:"degraded",unhealthy:"unhealthy",unknown:"unknown"}[m]||m,E=typeof b=="number"?` (${Math.round(b*100)}%)`:"";if(m==="healthy")mt.success(`Doctor: ${S}${E}`);else if(mt.warning(`Doctor: ${S}${E}`,1e4),x&&x.length>0)for(const A of x)r.setLogs(T=>[...T,{id:`doctor-${Date.now()}-${Math.random().toString(36).slice(2,6)}`,level:"warn",source:"Doctor",message:typeof A=="string"?A:A.message||JSON.stringify(A),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&&(Oe.setSessionId(p.id),Fe.getState().updateSession(p.id,p))}catch{}typeof e=="string"&&e&&Ma.info(`Session event: ${t}`);break}case"session_resumed":{try{const p=typeof e=="string"?JSON.parse(e):e||{};if((l=p.session)!=null&&l.id&&(Oe.setSessionId(p.session.id),Fe.getState().updateSession(p.session.id,p.session)),p.messages&&Array.isArray(p.messages)){const m=((c=p.session)==null?void 0:c.id)||n;Be.getState().replaceMessages(m,p.messages.map(w=>({id:w.id||`msg-${w.timestamp||Date.now()}`,type:w.type==="user"?"user":"assistant",content:w.content||"",timestamp:w.timestamp||Date.now(),thinking:w.thinking||void 0})));const b=p.messages.find(w=>w.type==="user"&&!w.deleted),x=typeof(b==null?void 0:b.content)=="string"?b.content.replace(/\s+/g," ").trim():"";Fe.getState().touchSession(m,x||void 0)}}catch(p){console.warn("Failed to process session_resumed",String(p))}typeof e=="string"&&e&&Ma.info(`Session event: ${t}`);break}case"session_delegation_start":{try{const p=typeof e=="string"?JSON.parse(e):e||{},m=p.toSessionId||n;if(m){const b=p.fromTitle||p.fromSessionId||"另一会话",x=String(p.task||"").replace(/\s+/g," ").trim();Be.getState().addMessage(m,{id:`deleg-start-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,type:"system",content:`🔗 「${b}」委派任务:${x.slice(0,200)}${x.length>200?"…":""}`,timestamp:Date.now()})}}catch{}break}case"session_delegation_end":{try{const p=typeof e=="string"?JSON.parse(e):e||{},m=p.toSessionId||n;if(m){const b=p.ok!==!1,x=String(p.summary||"").replace(/\s+/g," ").trim();Be.getState().addMessage(m,{id:`deleg-end-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,type:"system",content:`${b?"✅":"❌"} 委派任务${b?"已完成":"失败"}${x?`:${x.slice(0,200)}${x.length>200?"…":""}`:""}`,timestamp:Date.now()})}}catch{}break}case"session_direct_delivered":{try{const p=typeof e=="string"?JSON.parse(e):e||{},m=p.fromSessionId||n;if(m){const b=p.toTitle||p.toSessionId||"另一会话",x=String(p.text||"").replace(/\s+/g," ").trim(),w=p.queued===!0;Be.getState().addMessage(m,{id:`direct-delivered-${p.deliveryId||Date.now()}`,type:"system",content:`📤 直连投递给「${b}」${w?"(对方正在运行,已排队作新一轮)":"(对方开始独立执行)"}:${x.slice(0,200)}${x.length>200?"…":""}`,timestamp:Date.now()})}}catch{}break}case"session_direct_completed":{try{const p=typeof e=="string"?JSON.parse(e):e||{},m=p.fromSessionId||n;if(m){const b=String(p.toSessionId||""),x=b?((d=Fe.getState().sessions.find(E=>E.id===b))==null?void 0:d.title)||b.slice(0,8):"另一会话",w=p.ok!==!1,S=String(p.summary||"").replace(/\s+/g," ").trim();Be.getState().addMessage(m,{id:`direct-completed-${p.deliveryId||Date.now()}`,type:"system",content:w?`✅ 「${x}」已完成直连消息${S?`:${S.slice(0,300)}${S.length>300?"…":""}`:""}`:`❌ 「${x}」直连消息执行失败:${S||"未知错误"}`,timestamp:Date.now()})}}catch{}break}case"mcp_update":try{const p=typeof e=="string"?JSON.parse(e):e||{},m=p.server||p.name||"MCP",b=p.action||p.status||"updated";Ma.info(`MCP ${m}: ${b}`)}catch{}break}}function DF(t,e){switch(RT(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 OF={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 LF(t,e){return OT(t,e)}function hz(t){try{const e=JSON.parse(t),n=e.payload&&typeof e.payload=="object"?e.payload:e,r=n.resolvedPath;if(typeof r=="string"&&r)return r;const a=n.requestedPath;return typeof a=="string"&&a?a:null}catch{return null}}function pz(t,e){try{const n=typeof t=="string"?JSON.parse(t):t||{},r=hs.getState(),{approvalId:a,toolName:i,askPayload:l,timeoutMs:c,timeoutAction:d}=n,h=hz(String(l||""));if(r.isSessionAllowed(i,h??void 0)){Oe.send({type:"hook_allow",data:JSON.stringify({approvalId:a})});return}if(r.autoMode&&i!=="exit_plan_mode"){Oe.send({type:"hook_allow",data:JSON.stringify({approvalId:a})});return}Be.getState().addMessage(e,{id:`hook-approval-${a||Date.now()}`,type:"assistant",content:"",timestamp:Date.now(),hookApproval:{approvalId:a||"",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}}),r.addApproval({approvalId:a||"",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 Xm(t,e){try{const n=typeof t=="string"?JSON.parse(t):t||{};typeof n.sessionId=="string"&&n.sessionId&&(e=n.sessionId);const r=Fe.getState(),a=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},h=r.tasksBySession[e]||[];r.setSessionTasks(e,[...h,d]),a.upsertTask(e,{id:d.id,title:d.title,description:d.description,status:ja(c.status),source:"task",progress:c.progress!=null?Number(c.progress):void 0,raw:n})}else if((i==="updated"||i==="status_changed")&&c)r.updateTaskPlanStatus(e,l,{backendStatus:c.status,progress:c.progress}),a.upsertTask(e,{id:l,title:c.title||l,description:c.description,status:ja(c.status),source:"task",progress:c.progress!=null?Number(c.progress):void 0,raw:n});else if(i==="deleted"){const d=r.tasksBySession[e]||[];r.setSessionTasks(e,d.filter(h=>h.id!==l&&h.backendId!==l))}else if(n&&!i&&(n.id||n.taskId)){const d=String(n.id||n.taskId),h=n,p=String(h.status||"").toUpperCase()==="COMPLETED",m={id:d,title:String(h.title||h.name||d),completed:p,createdAt:Date.parse(h.createdAt)||Date.now(),backendId:d,backendStatus:h.status,description:h.description,progress:h.progress!=null?Number(h.progress):void 0},b=r.getSessionTasks(e);b.some(x=>x.id===d||x.backendId===d)?r.updateTaskPlanStatus(e,d,{backendStatus:h.status,progress:m.progress,completed:p}):r.setSessionTasks(e,[...b,m]),a.upsertTask(e,{id:d,title:m.title,description:m.description,status:ja(h.status),source:"task",progress:m.progress,raw:n})}a.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,r){try{const a=JSON.parse(e||"{}"),i=r(n,t,a);if(i){const l=Be.getState();switch(t){case"step_start":l.updateStep(n,i.id,{title:a.step||i.title,description:a.description||i.description,status:a.status==="start"?"running":a.status||"running"});break;case"step_thinking":l.updateStep(n,i.id,{thought:a.thought});break;case"step_action":l.updateStep(n,i.id,{action:a.action});break;case"step_complete":l.updateStep(n,i.id,{status:a.status??"success",result:a.result});break}}}catch(a){console.warn("Failed to parse "+t,String(a))}}function gz(t,e){var n,r;try{const a=typeof t=="string"?JSON.parse(t):t||{};let i=[];if(Array.isArray(a)?i=a:(n=a.tasks)!=null&&n.length?i=a.tasks:(r=a.items)!=null&&r.length&&(i=a.items),i.length>0&&e){const l=Fe.getState(),c=ot.getState();i.forEach(d=>{const h=d.content||d.title||d.name||"";if(h.trim()){if(!l.getSessionTasks(e).find(w=>w.title===h.trim())&&(l.addSessionTask(e,h.trim()),d.completed||d.status==="completed"||d.status==="COMPLETED"||d.status==="done"||d.activeForm==="completed")){const E=l.getSessionTasks(e).find(A=>A.title===h.trim());E&&l.toggleSessionTask(e,E.id)}const b=String(d.id||d.taskId||h.trim()),x=d.completed||d.status==="completed"||d.status==="COMPLETED"||d.status==="done"||d.activeForm==="completed";c.upsertTask(e,{id:b,title:h.trim(),description:d.description,status:ja(d.status,x),source:"todo",raw:d})}}),c.recordEvent(e,{type:"todo_update",source:"todo",title:"Todo list updated",message:`${i.length} items`,status:"updated",data:a})}}catch{}}function yz(t,e){try{const n=typeof t=="string"?JSON.parse(t):t||{},r=n.questionId||"",a=n.question||"";if(!r||!a)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:a,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:r,question:a,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,Be.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||{},r=n.title||n.name||"";if(r&&e){const i=Fe.getState().getSessionTasks(e).find(l=>l.title===r&&!l.completed);i&&Fe.getState().toggleSessionTask(e,i.id),ot.getState().upsertTask(e,{id:(i==null?void 0:i.id)||r,title:r,status:"completed",source:"todo"}),ot.getState().recordEvent(e,{type:"todo_item_done",source:"todo",title:r,status:"completed",taskId:(i==null?void 0:i.id)||r,data:n})}}catch{}}function j5(t){if(!t)return null;try{return JSON.parse(t)}catch{return null}}const B5=gn((t,e)=>({automations:[],runsByAutomation:{},loading:!1,error:null,fetchAutomations:async()=>{const n=await ct.automations.list();n.success&&n.data?t({automations:n.data}):t({error:n.error||"加载自动化失败"})},createAutomation:async n=>{const r=await ct.automations.create(n);return r.success&&r.data?(await e().fetchAutomations(),r.data):(t({error:r.error||"创建自动化失败"}),null)},deleteAutomation:async n=>{const r=await ct.automations.remove(n);return r.success?(await e().fetchAutomations(),!0):(t({error:r.error||"删除失败"}),!1)},toggleAutomation:async(n,r)=>{const a=await ct.automations.toggle(n,r);a.success?await e().fetchAutomations():t({error:a.error||"切换失败"})},runAutomation:async n=>{const r=await ct.automations.run(n);r.success?(await e().fetchRuns(n),await e().fetchAutomations()):t({error:r.error||"触发失败"})},fetchRuns:async n=>{const r=await ct.automations.runs(n);r.success&&r.data&&t(a=>({runsByAutomation:{...a.runsByAutomation,[n]:r.data}}))},onAutomationUpdate:n=>{t(r=>({automations:r.automations.some(i=>i.id===n.id)?r.automations.map(i=>i.id===n.id?n:i):[...r.automations,n]}))},onAutomationRun:n=>{t(r=>({runsByAutomation:{...r.runsByAutomation,[n.automationId]:[n,...r.runsByAutomation[n.automationId]||[]].slice(0,50)}}))}})),I5={automationUpdate:t=>{const e=j5(t);e!=null&&e.automation&&B5.getState().onAutomationUpdate(e.automation)},automationRun:t=>{const e=j5(t);e!=null&&e.run&&B5.getState().onAutomationRun(e.run)}};function vz(t,e,n){let r={};if(e&&typeof e=="object")r=e;else try{r=JSON.parse(String(e||"{}"))}catch{}const a=String(r.jobId||`fjob-${Date.now()}`),i=r.stage||(t==="filejob_result"?"complete":t==="filejob_error"?"error":"uploaded"),l={jobId:a,stage:i,parseProgress:r.parseProgress,parsedFiles:r.parsedFiles,mapping:r.mapping,renderProgress:r.renderProgress,currentRow:r.currentRow,totalRows:r.totalRows,result:r.result,error:r.error,errorDetail:r.errorDetail};r.attachments&&(l.attachments=r.attachments),Be.getState().setMessageFileJob(n,l)}const k1=new Map;function xz(t){k1.clear();for(const e of t)e.label&&k1.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 jF(t){return k1.get(t)??wz[t]??t}function BF(t){return kz[t]??"📡"}function IF(t){return Sz.has(t)}async function P5(){const t=await ct.channels.catalog();if(t.success&&Array.isArray(t.data))return xz(t.data),t.data.map(n=>n.type);const e=await ct.channels.types();return e.success&&Array.isArray(e.data)?e.data:[]}const _z=gn((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 P5();t({availableTypes:n,typesLoaded:!0});const{selectedType:r}=e();r&&n.length>0&&!n.includes(r)&&t({selectedType:null})},load:async()=>{t({loading:!0,error:null});const n=await P5(),r=await ct.channels.list(),a=r.success&&Array.isArray(r.data)?r.data:[];t({loading:!1,channels:a,availableTypes:n,typesLoaded:!0,...r.success&&!Array.isArray(r.data)?{error:"服务端返回的频道数据格式异常"}:r.success?{}:{error:r.error??"Failed to load"}});const i=e();if(!i.selectedType&&n.length>0){const l=a.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 r=await ct.channels.create(n);return r.success?(await e().load(),t({formOpen:!1,editing:null}),!0):(t({error:r.error??"Create failed"}),!1)},update:async(n,r)=>{const a=await ct.channels.update(n,r);return a.success?(await e().load(),t({formOpen:!1,editing:null}),!0):(t({error:a.error??"Update failed"}),!1)},remove:async n=>{const r=await ct.channels.delete(n);return r.success?(t(a=>({channels:a.channels.filter(i=>i.id!==n)})),!0):(t({error:r.error??"Delete failed"}),!1)},toggle:async(n,r)=>(await ct.channels.toggle(n,r)).success?(t(i=>({channels:i.channels.map(l=>l.id===n?{...l,enabled:r}: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 r=e();n&&r.availableTypes.length>0&&!r.availableTypes.includes(n)||t({selectedType:n,error:null})},updateChannelStatus:n=>{t(r=>({channels:r.channels.map(a=>a.id===n.channelId?{...a,connected:n.connected,_state:n.state}:a)}))}})),CS=["(the run was interrupted by the user while waiting for an answer","(tool call interrupted by the user before a result was recorded)"];function Cz(t){return t.trim().length>0}function Ez(t,e){if(!(t!=null&&t.length)||!e.length)return[];const n=new Map;for(const a of t){if(a.type!=="tool")continue;const i=typeof a.toolCallId=="string"?a.toolCallId:"";if(!i)continue;const l=typeof a.content=="string"?a.content:"";Cz(l)&&n.set(i,l)}if(n.size===0)return[];const r=[];for(const a of e){const i=n.get(a.id);if(i===void 0)continue;const l=a.status==="running",c=a.status==="error"&&a.ended!==void 0&&a.ended!==null;if(!l&&!c)continue;if(CS.some(h=>i.includes(h))){r.push({id:a.id,status:"error",result:i,ended:void 0,waitingUser:void 0});continue}r.push({id:a.id,status:"completed",result:i,ended:void 0,waitingUser:void 0})}return r}const Tz=["start","content","thinking","tool_call","tool_result","tool_diff","cache_stats","turn_summary","web_search","cache_stats","complete","generation_paused","generation_resumed","error","context_compressed","compaction_progress","context_analysis","threshold_warning","blocking_limit","context_blocked","stall_detected"],R0=(t,e=[])=>{if(typeof t=="string"){const r=t.trim();if(!r)return e;if(r.startsWith("{")||r.startsWith("[")){try{const a=JSON.parse(r);R0(a,e)}catch{e.push(r)}return e}return e.push(r),e}if(Array.isArray(t))return t.forEach(r=>R0(r,e)),e;if(!t||typeof t!="object")return e;const n=t;for(const r of["content","message"]){const a=n[r];typeof a=="string"&&a.trim()?e.push(a.trim()):a!=null&&typeof a=="object"&&R0(a,e)}return e},Az=t=>{if(typeof t=="string"){const n=t.trim();if(!n)return"";if(!n.startsWith("{")&&!n.startsWith("["))return n}const e=R0(t);return e[e.length-1]||""};function z5(...t){for(const e of t){if(e==null||e==="")continue;const n=Number(e);if(Number.isFinite(n))return n}}function Nz(t){const e=Be.getState().messagesBySession[t]||[],n=[];for(const r of e){for(const a of r.toolCalls||[])n.push({id:a.id,name:a.name,status:a.status,result:a.result,ended:a.ended??null,waitingUser:a.waitingUser});for(const a of r.steps||[])for(const i of a.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 Rz(){const t=[...Be.getState().generatingSessions];t.length!==0&&await Promise.all(t.map(async e=>{try{const n=await ct.sessions.resume(e);if(!n.success||!n.data)return;const r=Ez(n.data.messages,Nz(e));if(r.length>0&&Be.getState().applyToolCallPatches(e,r),n.data.activeRun)return;const a=Be.getState();a.isGenerating(e)&&a.endGeneration(e,void 0,{force:!0})}catch{}}))}function Mz(){try{const t=window,e=t.__pendingQuestions;if(!e)return;const n=t.__answeredQuestionIds||new Set,r=Be.getState();for(const a of Object.keys(e)){const i=e[a],l=i==null?void 0:i.questionId;!l||n.has(l)||(r.markWaitingUserToolCall(a,"ask_user_question"),window.dispatchEvent(new CustomEvent("ask-question-required",{detail:a})))}}catch{}}function Dz({activeTab:t,setLogs:e,setUnreadLogs:n}){const r=Be,a=N.useCallback(p=>{if(!p)return{};if(typeof p=="object")return p;if(typeof p!="string")return{};try{return JSON.parse(p)}catch{return{}}},[]),i=N.useCallback((p,m,b,x)=>{const w=a(m),S=ot.getState(),E=Be.getState();if(p==="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(ge=>Array.isArray(ge)?ge.map(String):[]):void 0,estimatedTokens:typeof w.estimatedTokens=="number"?w.estimatedTokens:void 0,runtimeAvailable:w.runtimeAvailable===!0,createdAt:Date.now()});return}if(p==="workflow_confirm_ack"){S.clearPlan(b);return}if(p==="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(p==="dwf_confirm_ack"){S.clearDwfOffer(b,w.offerId?String(w.offerId):"");return}if(p==="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(p==="dwf_promote_ack"){S.clearDwfPromotable(b,w.workflowId?String(w.workflowId):void 0);return}const A=w.runId||x||"";if(!A)return;if(p==="workflow_error"){S.fail(b,A,w.error||"Workflow failed"),(E.isGenerating(b)||E.isPaused(b))&&E.endGeneration(b,w.error||"Workflow failed");return}const T=p==="workflow_finished"?w.status||"COMPLETED":p==="workflow_started"?w.status||"RUNNING":p==="workflow_paused"?w.status||"PAUSED":p==="workflow_resumed"?w.status||"RESUMING":p==="workflow_cancelled"?w.status||"CANCELLED":w.status||void 0,D=w.type||p,M=w.data&&typeof w.data=="object"?w.data:{},B=String(w.kind||M.kind||""),I=w.nodeId||w.node_id||M.nodeId||M.node_id,U=w.role||w.agentRole||w.agent_role||M.role||M.agentRole||M.agent_role,W=w.phase||w.phaseId||M.phase||M.phaseId,Y=w.effectId||M.effectId||I,oe=w.toolName||w.tool_name||M.toolName||M.tool_name,ae=w.error||M.error,V=["effect.scheduled","effect.completed","effect.failed"].includes(D)&&I&&B!=="tool",he=["effect.scheduled","effect.completed","effect.failed"].includes(D)&&B==="tool"&&(oe||I),ve=I?S.getAgentsForSession(b).find(ge=>ge.id===String(I)):void 0;if(S.upsert(b,{runId:A,status:T,title:typeof w.title=="string"&&w.title?String(w.title):void 0,completedPhases:z5(w.completedNodes,w.completedPhases),totalPhases:z5(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:D,agentNode:V?{nodeId:String(I),role:String(U||(ve==null?void 0:ve.role)||(ve==null?void 0:ve.name)||"agent"),phase:W?String(W):ve==null?void 0:ve.phase,status:D==="effect.failed"?"failed":D==="effect.completed"?"completed":"scheduled",tokens:w.tokensUsed!=null?Number(w.tokensUsed):M.tokens!=null&&typeof M.tokens=="number"?Number(M.tokens):void 0,error:ae?String(ae):void 0,updatedAt:Date.now()}:void 0}),he){const ge=D==="effect.failed"?"failed":D==="effect.completed"?"completed":"running",q=String(Y||`${A}-${oe||I}`);S.upsertTask(b,{id:q,title:String(oe||I),description:I?String(I):void 0,status:ge,source:"workflow",runId:A,result:M.artifactRef?String(M.artifactRef):void 0,error:ae?String(ae):void 0,raw:w}),S.recordEvent(b,{type:D,source:"workflow",title:String(oe||I),status:ge,runId:A,taskId:q,message:ae?String(ae):void 0,data:w})}if((p==="workflow_started"||p==="workflow_handoff")&&Array.isArray(w.nodes))S.setNodes(b,A,w.nodes);else if(p==="workflow_node_start"&&I)S.setNodeStatus(b,A,String(I),{status:"running"});else if(p==="workflow_node_complete"&&I){const ge=Number(M.durationMs??w.durationMs),q=Number(M.attempts??w.attempts);S.setNodeStatus(b,A,String(I),{status:String(M.status||w.status||"completed"),result:(M.result??w.result)!=null?String(M.result??w.result):void 0,error:ae?String(ae):void 0,durationMs:Number.isFinite(ge)&&ge>=0?ge:void 0,attempts:Number.isFinite(q)&&q>1?q:void 0})}else if(p==="workflow_node_retry"&&I){const ge=Number(M.attempt??w.attempt);Number.isFinite(ge)&&ge>1&&S.setNodeStatus(b,A,String(I),{attempts:ge})}if(p==="workflow_started")S.clearPlan(b),E.startGeneration(b);else if(p==="workflow_finished"){S.finalizeNodes(b,A,String(T||"COMPLETED"));const ge=Az(w.output);if(ge){const q=E.getMessages(b),ie=q[q.length-1];(ie==null?void 0:ie.type)==="assistant"?E.appendToLastMessage(b,ge):E.addMessage(b,{id:Oa(),type:"assistant",content:ge,timestamp:Date.now()})}E.endGeneration(b)}else p==="workflow_cancelled"?(S.finalizeNodes(b,A,"CANCELLED"),E.endGeneration(b,"workflow cancelled by user")):T==="PAUSED"?E.pauseGeneration(b):(T==="RUNNING"||T==="RESUMING")&&E.resumeGeneration(b)},[a]),l=N.useCallback((p,m)=>{const b=a(p),x=Array.isArray(b.runs)?b.runs:[];if(x.length===0)return;const w=x.slice().sort((T,D)=>String(D.updatedAt||"").localeCompare(String(T.updatedAt||"")))[0],S=String(w.status||"").toUpperCase();if(!S)return;const E=ot.getState(),A=String(w.runId||"");if(E.upsert(m,{runId:A,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)){E.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:A,data:w});const T=r.getState();(T.isGenerating(m)||T.isPaused(m))&&T.clearGenerating(m)}},[a]),c=N.useCallback(p=>{var w;const b=r.getState().messagesBySession[p]||[],x=b[b.length-1];return(w=x==null?void 0:x.steps)==null?void 0:w[x.steps.length-1]},[r]),d=N.useCallback((p,m,b)=>{const x=c(p),w=m==="step_complete",S=x&&(x.status==="success"||x.status==="error");if(!x||S&&!w){const E=(b==null?void 0:b.step)||m.replace("step_","").replace("_"," ");return r.getState().addStep(p,{id:`step-${Date.now()}`,title:E,description:(b==null?void 0:b.description)||"Executing...",status:"running",timestamp:Date.now()}),c(p)}return x},[c,r]),h=N.useCallback(p=>{var w,S;const m=p.type,b=p.data;if(m==="model_name"){Zm(m,b,p.sessionId||"",{activeTab:t,setLogs:e,setUnreadLogs:n},p);return}if(m==="models_updated"||m==="models.updated"){window.dispatchEvent(new CustomEvent("models-updated"));return}if(m==="workspace_changed"){Zm(m,b,p.sessionId||"",{activeTab:t,setLogs:e,setUnreadLogs:n});return}if(m==="question_answer_ack"){const E=a(b),A=E==null?void 0:E.questionId;let T=p.sessionId||"";if(A){const D=window;D.__answeredQuestionIds=D.__answeredQuestionIds||new Set,D.__answeredQuestionIds.add(A);const M=D.__pendingQuestions||{};for(const B of Object.keys(M))((w=M[B])==null?void 0:w.questionId)===A&&(T||(T=B),delete M[B]);((S=D.__pendingQuestion)==null?void 0:S.questionId)===A&&(D.__pendingQuestion=null)}T&&Be.getState().clearWaitingUserToolCalls(T),window.dispatchEvent(new CustomEvent("ask-question-dismiss",{detail:E==null?void 0:E.questionId}));return}const x=p.sessionId||"";if(!x){if(m==="task_update"||m==="task_finished"||m==="task_error"){const E=a(b);E&&typeof E.sessionId=="string"&&E.sessionId&&Xm(b,E.sessionId)}return}if(m==="hook_ask"){pz(b,x);return}if(m==="ask_user_question"){yz(b,x);return}if(m==="task_update"){Xm(b,x);return}if(m==="task_output"){try{r.getState().appendToLastMessage(x,String(b||""))}catch{}return}if(m==="task_finished"||m==="task_error"){m==="task_error"?Ma.error("Task error",String(b)):Xm(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{A5(m,b,x)}catch(E){Ma.error(`Failed to handle ${m}`,String(E))}return}if(m.startsWith("goal_")){if(m==="goal_route_decision"){try{const E=typeof b=="string"?JSON.parse(b):b||{},A=String(E.tier||"");if(A){const T=A==="simple"?"快速模式":A==="medium"?"标准模式":"完整模式";ot.getState().recordEvent(x,{type:"goal_route_decision",source:"goal",title:`✓ 已选择${T}`,message:String(E.summary||""),runId:String(E.runId||p.runId||"")||void 0,status:"completed",data:E})}}catch{}return}try{A5(m,b,x)}catch(E){Ma.error(`Failed to handle ${m}`,String(E))}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"){I5.automationUpdate(b);return}if(m==="automation.run"){I5.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,p.runId);return}if(m==="workflow_status"){l(b,x);return}if(Tz.includes(m)){dz(m,b,x,p.nodeId);return}if(m==="channel_status"){try{const E=JSON.parse(b||"{}");_z.getState().updateChannelStatus(E)}catch{}return}if(m==="channel_message"||m==="channel_error"){try{const E=typeof b=="string"?JSON.parse(b):b||{},A=E.channel||E.platform||"Channel";if(m==="channel_error")mt.error(`${A}: ${E.error||E.message||"channel error"}`);else{const T=E.from||E.sender||"",D=E.text||E.content||E.message||"";D&&mt.info(`📨 ${A}${T?` · ${T}`:""}: ${String(D).slice(0,120)}`)}}catch{}return}if(m==="session_switched"){try{const E=typeof b=="string"?JSON.parse(b):b||{},A=E.id||E.sessionId||(typeof b=="string"?b:"");A&&Fe.getState().setActiveSession(String(A))}catch{}return}if(m==="task_interrupted"){try{const E=typeof b=="string"?JSON.parse(b):b||{},A=E.title||E.taskId||"Task";mt.warning(`⏸ ${A} interrupted — 使用 /continue 恢复生成`,1e4)}catch{mt.warning("A running task was interrupted",1e4)}return}if(m==="code_review_ready"){try{const E=typeof b=="string"?JSON.parse(b):b||{},A=E.title||E.skillId||"Code Review",T=E.summary||"";mt.success(`🔍 ${A} ready${T?`: ${String(T).slice(0,120)}`:""}`,8e3)}catch{mt.success("🔍 Code review ready",8e3)}return}if(m==="hook_auto_ack"){try{const E=typeof b=="string"?JSON.parse(b):b||{};mt.info(`Hook auto-approved: ${E.tool||E.name||"tool"}`,4e3)}catch{}return}if(m==="throttle"){try{const E=typeof b=="string"?JSON.parse(b):b||{},A=E.limit||E.remaining!=null?` (${E.remaining} left)`:"";mt.warning(`⚠ Rate limited${A}`,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)){Zm(m,b,x,{activeTab:t,setLogs:e,setUnreadLogs:n});return}}}},[t,d,i,l,a,e,n]);N.useEffect(()=>{Oe.connect();const p=Oe.onMessage(h),m=Oe.onReconnectGiveUp(()=>{const x=Be.getState();for(const w of x.generatingSessions)x.endGeneration(w,"WebSocket disconnected")}),b=Oe.onOpen(()=>{var w;const x=((w=Oe.getSessionId)==null?void 0:w.call(Oe))||Fe.getState().activeSessionId;if(x){Oe.send({type:"get_workflow_status",sessionId:x,data:JSON.stringify({sessionId:x})});const S=pl.getState().mode;Oe.send({type:"plan_mode_change",sessionId:x,data:JSON.stringify({mode:S})})}Rz(),Mz()});return()=>{p(),m(),b()}},[h])}const Jc={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"}}},S1="linear";function $5(t,e,n){const r=Jc[t]||Jc[S1];if(!r)return{bg:"#fcfaf8",surface:"#f6f1ea",border:"#e7dfd5",text:"#26251e",muted:"#5a574f",accentBlue:"#26251e",accentGreen:"#1f7a4d",accentRed:"#b84f42",accentYellow:"#a16b2d",accentPurple:"#7a5c8f"};const a={...e==="dark"?r.dark:r.light};return n&&Object.assign(a,n),a}const Sa=t=>{const e=parseInt(t.slice(1,3),16),n=parseInt(t.slice(3,5),16),r=parseInt(t.slice(5,7),16);return`${e} ${n} ${r}`},Oz=(t,e,n)=>{const r=[parseInt(t.slice(1,3),16),parseInt(t.slice(3,5),16),parseInt(t.slice(5,7),16)],a=[parseInt(e.slice(1,3),16),parseInt(e.slice(3,5),16),parseInt(e.slice(5,7),16)];return r.map((i,l)=>Math.round(i+((a[l]??i)-i)*n)).join(" ")};function F5(t,e,n,r,a){n.classList.toggle("dark",t==="dark"),n.classList.toggle("light",t==="light"),n.style.setProperty("--color-bg",Sa(e.bg)),n.style.setProperty("--color-surface",Sa(e.surface)),n.style.setProperty("--color-border",Sa(e.border)),n.style.setProperty("--color-text",Sa(e.text)),n.style.setProperty("--color-muted",Sa(e.muted)),n.style.setProperty("--color-accent-blue",Sa(e.accentBlue)),n.style.setProperty("--color-accent-green",Sa(e.accentGreen)),n.style.setProperty("--color-accent-red",Sa(e.accentRed)),n.style.setProperty("--color-accent-yellow",Sa(e.accentYellow)),n.style.setProperty("--color-accent-purple",Sa(e.accentPurple)),n.style.setProperty("--color-hover",Oz(e.surface,e.text,.06)),r&&r.setAttribute("content",e.bg),a&&a.setAttribute("content",t)}function Lz({theme:t,themePresetId:e,customTheme:n,customThemeEnabled:r}){N.useEffect(()=>{const a=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=r?n:void 0,h=$5(e||S1,c,d);if(F5(c,h,a,i,l),t==="auto"){const p=window.matchMedia("(prefers-color-scheme: dark)"),m=()=>{const b=p.matches?"dark":"light",x=$5(e||S1,b,d);F5(b,x,a,i,l)};return p.addEventListener("change",m),()=>p.removeEventListener("change",m)}},[t,e,n,r])}function jz(t){if(!t)return{};try{const e=JSON.parse(t);return e&&typeof e=="object"&&!Array.isArray(e)?e:t}catch{return t}}function Bz(t){const e=new Map;for(const n of t){if(n.type!=="tool"||typeof n.toolCallId!="string"||!n.toolCallId)continue;const r=typeof n.content=="string"?n.content:"";if(!r.trim())continue;const a=typeof n.diff=="string"&&n.diff.trim()?n.diff:void 0;e.set(n.toolCallId,{content:r,diff:a,timestamp:typeof n.timestamp=="number"?n.timestamp:void 0,name:typeof n.name=="string"?n.name:void 0})}return e}function Iz(t,e,n){var a,i;const r=[];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 h=((a=l.function)==null?void 0:a.name)??d.name??"";if(!h)continue;const p=CS.some(m=>d.content.includes(m));r.push({id:c,name:h,args:jz((i=l.function)==null?void 0:i.arguments),result:d.content,status:p?"error":"completed",timestamp:d.timestamp??n,...d.diff?{diff:d.diff}:{}})}return r}function Pz(t){const e=[];if(!(t!=null&&t.length))return e;const n=Bz(t);let r=null;for(const a of t)if(a.type!=="tool"&&!(a.type!=="user"&&a.type!=="assistant"&&a.type!=="system")){if(a.type!=="assistant"){r=null,e.push({id:a.id||`msg-${a.timestamp||Date.now()}`,type:a.type,content:a.content||"",timestamp:a.timestamp||Date.now(),thinking:a.thinking||void 0,images:a.images&&a.images.length>0?a.images:void 0});continue}if(r?(typeof a.content=="string"&&a.content.trim()&&(r.content=r.content?`${r.content}
581
-
582
- ${a.content}`:a.content),typeof a.thinking=="string"&&a.thinking.trim()&&(r.thinking=r.thinking?`${r.thinking}
583
-
584
- ${a.thinking}`:a.thinking)):(r={id:a.id||`msg-${a.timestamp||Date.now()}`,type:"assistant",content:a.content||"",timestamp:a.timestamp||Date.now(),thinking:a.thinking||void 0},e.push(r)),Array.isArray(a.toolCalls)&&a.toolCalls.length>0&&r){const i=Iz(a.toolCalls,n,r.timestamp);i.length>0&&(r.toolCalls=[...r.toolCalls??[],...i])}}return e}function zz({message:t,onRetry:e}){const{t:n}=tt();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(mf,{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(pf,{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 U5 extends N.Component{constructor(n){super(n);Z(this,"handleRetry",()=>{this.setState({hasError:!1,error:null})});this.state={hasError:!1,error:null}}static getDerivedStateFromError(n){return{hasError:!0,error:n}}componentDidCatch(n,r){console.error("[ErrorBoundary] Caught error:",n,r)}render(){var n;return this.state.hasError?this.props.fallback?this.props.fallback:g.jsx(zz,{message:(n=this.state.error)==null?void 0:n.message,onRetry:this.handleRetry}):this.props.children}}var $z=g3();const li=8;function Qm(t,e,n){const r=Math.max(n.width,e.width-li*2),a=Math.max(n.height,e.height-li*2),i=Math.min(Math.max(t.width,n.width),r),l=Math.min(Math.max(t.height,n.height),a),c=Math.max(li,e.width-i-li),d=Math.max(li,e.height-l-li);return{x:Math.min(Math.max(t.x,li),c),y:Math.min(Math.max(t.y,li),d),width:i,height:l}}let ci=null;function Fz(){return(!ci||!ci.isConnected)&&(ci=document.createElement("div"),ci.id="dc-floating-layer",ci.className="fixed inset-0 pointer-events-none",ci.style.zIndex="35",document.body.appendChild(ci)),ci}let Jm=0;function eg(){return{width:window.innerWidth,height:window.innerHeight}}function Uz({title:t,subtitle:e,actions:n,onClose:r,children:a,initialRect:i,minWidth:l=300,minHeight:c=180,resizable:d=!0,className:h,label:p}){const[m,b]=N.useState(()=>{const B=eg(),I=(i==null?void 0:i.width)??520,U=(i==null?void 0:i.height)??420;return Qm({x:(i==null?void 0:i.x)??B.width-I-32,y:(i==null?void 0:i.y)??88,width:I,height:U},B,{width:l,height:c})}),[x,w]=N.useState(()=>++Jm),[S,E]=N.useState(null),A=N.useRef(m);A.current=m;const T={width:l,height:c},D=N.useCallback(B=>I=>{if(I.pointerType==="mouse"&&I.button!==0)return;I.preventDefault();const U=I.currentTarget,W=I.clientX,Y=I.clientY,oe=A.current;try{U.setPointerCapture(I.pointerId)}catch{}w(++Jm),E(B);const ae=he=>{const ve=he.clientX-W,ge=he.clientY-Y,q={...oe};B==="drag"?(q.x=oe.x+ve,q.y=oe.y+ge):((B==="e"||B==="se")&&(q.width=oe.width+ve),(B==="s"||B==="se")&&(q.height=oe.height+ge)),b(Qm(q,eg(),T))},V=()=>{try{U.releasePointerCapture(I.pointerId)}catch{}U.removeEventListener("pointermove",ae),U.removeEventListener("pointerup",V),U.removeEventListener("pointercancel",V),E(null)};U.addEventListener("pointermove",ae),U.addEventListener("pointerup",V),U.addEventListener("pointercancel",V)},[l,c]);N.useEffect(()=>{if(!S)return;const B=document.body.style.userSelect,I=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=I}},[S]),N.useEffect(()=>{const B=()=>b(I=>Qm(I,eg(),T));return window.addEventListener("resize",B),()=>window.removeEventListener("resize",B)},[l,c]);const M=g.jsxs("div",{role:"dialog","aria-label":p??(typeof t=="string"?t:void 0),"data-testid":"floating-window",onPointerDown:()=>w(++Jm),className:ut("pointer-events-auto absolute flex flex-col overflow-hidden","rounded-lg border border-dark-border bg-dark-surface shadow-xl",h),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:D("drag"),className:ut("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:r,"data-testid":"floating-window-close","aria-label":p?`${p} — close`:"Close",title:"Close",className:"rounded p-1 text-dark-muted transition-colors hover:bg-dark-hover hover:text-dark-text",children:g.jsx(Bn,{size:12})})]})]}),g.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:a}),d&&g.jsxs(g.Fragment,{children:[g.jsx("div",{"data-testid":"floating-window-resize-e",onPointerDown:D("e"),className:"absolute right-0 top-0 h-full w-[3px] cursor-ew-resize"}),g.jsx("div",{"data-testid":"floating-window-resize-s",onPointerDown:D("s"),className:"absolute bottom-0 left-0 h-[3px] w-full cursor-ns-resize"}),g.jsx("div",{"data-testid":"floating-window-resize-se",onPointerDown:D("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 $z.createPortal(M,Fz())}const Hz=10;function Gz(t,e=Hz){return t.filter(n=>n&&!!n.id&&(n.messageCount??0)>0).sort((n,r)=>String(r.updatedAt||"").localeCompare(String(n.updatedAt||""))).slice(0,e).map(n=>{const r=new Date(n.createdAt).getTime()||Date.now(),a=new Date(n.updatedAt).getTime()||r;return{id:n.id,title:n.title||n.id,createdAt:r,lastActiveAt:a,messageCount:n.messageCount??0,...n.preview?{preview:n.preview}:{}}})}function qz(t,e,n){return n?t.includes(n)?{tabs:t,active:n}:{tabs:[...t,n],active:n}:{tabs:t,active:e}}function Vz(t,e,n){const r=t.indexOf(n);if(r===-1)return{tabs:t,active:e};const a=t.filter(i=>i!==n);return e!==n?{tabs:a,active:e}:a.length===0?{tabs:a,active:null}:{tabs:a,active:a[Math.min(r,a.length-1)]??null}}const Wz=3,Kz=250;function Yz(t,e={}){const{maxRetries:n=Wz,retryBaseDelayMs:r=Kz,label:a="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 h=r*2**(d-1);return console.warn(`[${a}] dynamic import failed (retry ${d}/${n}) — retrying in ${h}ms. Error: ${c instanceof Error?c.message:String(c)}`),new Promise(p=>setTimeout(p,h)).then(l)});return l()}}function gr(t,e={}){return N.lazy(Yz(t,e))}function H5(t,e){const n=(e==null?void 0:e.wan)??"万",r=(e==null?void 0:e.yi)??"亿";if(t>=1e8)return`${(t/1e8).toFixed(1)}${r}`;if(t>=1e4){const a=t/1e4;return`${a>=100?a.toFixed(0):a.toFixed(1)}${n}`}return String(Math.round(t))}function Zz(t){return`${t>=10?t.toFixed(0):t.toFixed(1)}%`}const Xz=N.memo(function({open:e,onClose:n}){const{t:r}=tt(),a=st(M=>M.currentUsage),i=st(M=>M.maxContextTokens),l=st(M=>M.contextBreakdown),c=st(M=>M.cacheStats),d=st(M=>M.estimateTokens),h=Be(M=>M.messagesBySession),p=Fe(M=>M.activeSessionId),m=p?h[p]||[]:[];N.useEffect(()=>{if(!e)return;const M=B=>{B.key==="Escape"&&n()};return window.addEventListener("keydown",M),()=>window.removeEventListener("keydown",M)},[e,n]);const b=N.useMemo(()=>{if(l)return null;let M=0,B=0;for(const I of m){let U=I.content||"",W="";if(I.thinking&&(U+=" "+I.thinking),I.steps)for(const Y of I.steps)Y.thought&&(U+=" "+Y.thought),Y.action&&(W+=" "+Y.action),Y.result&&(W+=" "+Y.result);if(I.toolCalls)for(const Y of I.toolCalls)W+=" "+(typeof Y.args=="string"?Y.args:JSON.stringify(Y.args));M+=d(U),B+=d(W)}return{messagesTokens:M,toolTokens:B,total:M+B}},[l,m,d]),w=N.useMemo(()=>{const M=l,B=M?M.messagesTokens:(b==null?void 0:b.messagesTokens)??0,I=M?M.toolContentTokens+M.toolDefTokens:(b==null?void 0:b.toolTokens)??0,U=M?M.systemPromptTokens:0,W=M?M.skillTokens:0,Y=(M==null?void 0:M.memoryTokens)??0,oe=(M==null?void 0:M.skillDiscoveryTokens)??0,ae=(M==null?void 0:M.budgetTokens)??0,V=M?M.mcpToolTokens:0,he=M?M.dynamicTokens:0,ve=M?M.total:(b==null?void 0:b.total)??0,ge=Math.max(0,a.totalTokens-ve)+he,q=Math.max(a.totalTokens,ve,1);return[{key:"system",label:r("chat.ctxSystemPrompt"),tokens:U,color:"bg-dark-text/70"},{key:"tools",label:r("chat.ctxSystemTools"),tokens:I,color:"bg-accent-purple"},{key:"mcp",label:r("chat.ctxMcpTools"),tokens:V,color:"bg-accent-cyan"},{key:"skills",label:r("chat.ctxSkills"),tokens:W,color:"bg-accent-yellow"},{key:"memory",label:r("chat.ctxMemory"),tokens:Y,color:"bg-accent-green"},{key:"skillDiscovery",label:r("chat.ctxSkillDiscovery"),tokens:oe,color:"bg-accent-teal"},{key:"budget",label:r("chat.ctxBudget"),tokens:ae,color:"bg-accent-red"},{key:"messages",label:r("chat.ctxMessages"),tokens:B,color:"bg-accent-blue"},{key:"other",label:r("chat.ctxOther"),tokens:ge,color:"bg-dark-muted/60"}].map(ie=>({...ie,pct:ie.tokens/q*100}))},[l,b,a.totalTokens,r]).filter(M=>M.pct>=.05||M.tokens>0),S=a.totalTokens,E=i>0?Math.min(100,S/i*100):0,A=E>=90?"bg-accent-red":E>=70?"bg-accent-yellow":"bg-dark-text/70",T=E>=90?"text-accent-red":E>=70?"text-accent-yellow":"text-dark-text",D=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(A_,{size:15,className:T}),g.jsx("span",{className:"text-sm font-semibold text-dark-text",children:r("chat.contextCapacity")})]}),g.jsx("button",{type:"button","aria-label":r("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(Bn,{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:[H5(S,{wan:r("chat.unitWan"),yi:r("chat.unitYi")}),g.jsxs("span",{className:"text-dark-muted text-sm font-normal",children:[" / ",H5(i,{wan:r("chat.unitWan"),yi:r("chat.unitYi")})]})]}),g.jsxs("span",{className:`text-xs font-mono ${T}`,children:["(",E.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 ${A}`,style:{width:`${E}%`}})})]}),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:r("chat.categoryBreakdown")}),g.jsx("span",{className:"text-[10px] text-dark-muted/50 select-none",title:r("chat.assemblyOrderHint"),children:r("chat.byAssemblyOrder")})]}),g.jsx("div",{className:"px-4 pb-2 space-y-1.5",children:w.map(M=>g.jsxs("div",{"data-row-key":M.key,className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-[11px] text-dark-muted w-16 shrink-0",children:M.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 ${M.color} rounded-full`,style:{width:`${Math.max(.5,M.pct)}%`}})}),g.jsx("span",{className:"text-[11px] font-mono text-dark-text w-12 text-right shrink-0",children:Zz(M.pct)})]},M.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(N_,{size:11}),r("chat.avgCacheHitRate")]}),D!==null?g.jsxs("span",{className:`text-[11px] font-mono font-semibold ${D>=.5?"text-accent-green":"text-accent-yellow"}`,children:[(D*100).toFixed(0),"%"]}):g.jsx("span",{className:"text-[11px] font-mono text-dark-muted/60",children:"–"})]})]})})]}):null});function ES(t){const e=t.trim();if(!e)return{model:""};const n=e.indexOf("/"),r=e.indexOf(":"),a=n>=0&&(r<0||n<r)?n:r;if(a>0){const i=e.slice(0,a).trim(),l=e.slice(a+1).trim();if(i&&l)return{provider:i,model:l}}return{model:e}}function PF(t){return ES(t).provider??""}function Qz(t,e){const n=ES(e),r=t||n.model;return n.provider&&r?`${n.provider} · ${r}`:r}function zF(t){const e=new Map;for(const n of t){const r=n.provider||"default",a=e.get(r);a?a.push(n):e.set(r,[n])}return Array.from(e.entries())}const Jz=N.memo(function(e){const{t:n}=tt(),r=st(Se=>Se.currentUsage),a=st(Se=>Se.maxContextTokens),i=st(Se=>Se.model),l=st(Se=>Se.modelRef),c=st(Se=>Se.modelSource),d=st(Se=>Se.tokenRate),h=st(Se=>Se.compactingUntil),p=st(Se=>Se.lastCompactInfo),m=st(Se=>Se.degradation),b=st(Se=>Se.compactionProgress),x=st(Se=>Se.cacheStats),w=Fe(Se=>Se.activeSessionId),S=Be(Se=>w?Se.isGenerating(w):!1),E=ot(Se=>w?Se.bySession[w]:void 0),A=ot(Se=>w?Se.getRunningAgentCount(w):0),T=pl(Se=>Se.mode),D=hs(Se=>Se.autoMode),[M,B]=N.useState(0),I=N.useRef(0),[U,W]=N.useState(!1),[Y,oe]=N.useState(null);N.useEffect(()=>{const Se=Oe.onReconnectAttempt((Ie,vt)=>oe({attempt:Ie,max:vt})),Qe=Oe.onReconnectSuccess(()=>oe(null)),qe=Oe.onReconnectGiveUp(()=>oe(null)),Ke=Oe.onOpen(()=>oe(null));return()=>{Se(),Qe(),qe(),Ke()}},[]),N.useEffect(()=>{if(S&&!I.current&&(I.current=Date.now()),!S){I.current=0,B(0);return}const Se=setInterval(()=>B(Math.floor((Date.now()-I.current)/1e3)),1e3);return()=>clearInterval(Se)},[S]);const ae=r.totalTokens,V=a>0?Math.min(100,Math.round(r.totalTokens/a*100)):0,he=ET(d),ve=T==="normal"?"act":T,ge=_T[ve],q=Qz(i,l),ie=Zr(ve),_e=ie==="plan"?"brand":ie==="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":_e,children:ge.label}),D&&g.jsx("span",{className:"status-pill","data-tone":"yellow",children:"Auto"}),Y&&g.jsxs("span",{className:"status-pill","data-tone":"yellow",title:n("reconnect.hint"),"data-testid":"reconnect-pill",children:[g.jsx(pf,{size:10,className:"animate-spin"}),n("reconnect.reconnecting",{attempt:Y.attempt,max:Y.max})]}),g.jsx("span",{className:"text-dark-muted truncate max-w-[14rem]",title:q||void 0,children:q||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:Dc(x.cacheHitTokens),miss:Dc(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&&he&&g.jsx("span",{className:"text-accent-purple whitespace-nowrap shrink-0",title:n("chat.tokenRateTitle"),children:he}),g.jsxs("button",{type:"button",onClick:()=>W(!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:Dc(ae)}),g.jsx("span",{className:"text-dark-muted/60",children:"/"}),g.jsx("span",{children:Dc(a)})]}),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 ${V>=90?"bg-accent-red":V>=70?"bg-accent-yellow":"bg-dark-text/70"}`,style:{width:`${V}%`}})}),g.jsxs("span",{className:V>=90?"text-accent-red font-bold":V>=70?"text-accent-yellow":"",children:[V,"%"]})]}),g.jsx(R_,{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(Kn,{size:12,className:"animate-spin"}),L3(M)]}),A>0&&g.jsxs("span",{className:"text-dark-text whitespace-nowrap",children:[A," agent",A>1?"s":""]}),g.jsx("div",{className:"flex-1"}),E&&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:E.status}),g.jsxs("span",{children:[E.completedPhases,"/",E.totalPhases||0]}),g.jsx("span",{className:"text-dark-muted",children:Dc(E.tokensUsed)})]}),b&&g.jsxs("span",{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",style:{width:`${b.percent}%`}})})]}),!b&&Date.now()<h&&p&&g.jsxs("span",{className:"hidden lg:inline text-dark-muted text-[11px] whitespace-nowrap",children:[p.originalCount," ","->"," ",p.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(Xz,{open:U,onClose:()=>W(!1)})]})});function e$({sessionId:t,fallback:e}){const n=xS(t);return g.jsx("span",{className:"min-w-0 flex-1 truncate",children:n??e})}const t$=N.memo(function({tabs:e,activeSessionId:n,onActivate:r,onClose:a,onRename:i,onNew:l,onFork:c,workspaceDir:d,canClose:h=!0}){const{t:p}=tt(),m=N.useRef(null),[b,x]=N.useState(null),[w,S]=N.useState(""),E=N.useRef(null),A=Be(W=>W.generatingSessions),T=N.useCallback(W=>A.includes(W.id)?"running":W.status||"done",[A]),D=N.useMemo(()=>[...e].sort((W,Y)=>W.createdAt-Y.createdAt),[e]);N.useEffect(()=>{var Y,oe;const W=(Y=m.current)==null?void 0:Y.querySelector('[data-active="1"]');(oe=W==null?void 0:W.scrollIntoView)==null||oe.call(W,{block:"nearest",inline:"nearest"})},[n,e.length]);const M=N.useCallback(W=>{x(W.id),S(W.title),setTimeout(()=>{var Y;return(Y=E.current)==null?void 0:Y.select()},0)},[]),B=N.useCallback(()=>{const W=b,Y=w.trim();x(null),W&&Y&&i(W,Y)},[b,w,i]),I=N.useCallback(W=>{var he;if(W.key!=="ArrowLeft"&&W.key!=="ArrowRight")return;const Y=m.current;if(!Y)return;const oe=Array.from(Y.querySelectorAll('[role="tab"]')),ae=oe.indexOf(document.activeElement);if(ae===-1)return;W.preventDefault();const V=W.key==="ArrowRight"?1:-1;(he=oe[(ae+V+oe.length)%oe.length])==null||he.focus()},[]),U=N.useMemo(()=>p(d?"chat.newSessionInWorkspace":"chat.newSession"),[p,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":p("chat.sessionTabs"),onKeyDown:I,className:"flex min-w-0 items-center gap-0.5 overflow-x-auto custom-scrollbar",children:D.map(W=>{const Y=W.id===n,oe=b===W.id,ae=W.title||p("nav.chat");return g.jsxs("div",{"data-active":Y?"1":"0",role:"tab","aria-selected":Y,tabIndex:Y?0:-1,title:d?`${ae} · ${d}`:ae,onClick:()=>!oe&&!Y&&r(W.id),onDoubleClick:()=>!oe&&M(W),onAuxClick:V=>{V.button===1&&(V.preventDefault(),a(W.id))},onKeyDown:V=>{(V.key==="Enter"||V.key===" ")&&(V.preventDefault(),!oe&&!Y&&r(W.id))},className:ut("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",Y?"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(uf,{status:T(W)}),oe?g.jsx("input",{ref:E,value:w,onChange:V=>S(V.target.value),onBlur:B,onKeyDown:V=>{V.key==="Enter"?B():V.key==="Escape"&&x(null)},onClick:V=>V.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(e$,{sessionId:W.id,fallback:ae}),!oe&&h&&g.jsx("button",{type:"button","aria-label":p("chat.closeTab"),title:p("chat.closeTab"),onClick:V=>{V.stopPropagation(),a(W.id)},className:ut("grid h-4 w-4 shrink-0 place-items-center rounded transition-colors",Y?"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(Bn,{size:11})})]},W.id)})}),c&&n&&g.jsx("button",{type:"button",onClick:()=>c(n),title:p("chat.forkSession"),"aria-label":p("chat.forkSession"),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(hf,{size:14,"aria-hidden":"true"})}),g.jsx("button",{type:"button",onClick:l,title:U,"aria-label":U,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(nu,{size:14,"aria-hidden":"true"})})]})}),n$=N.memo(function({sessionId:e}){const{t:n}=tt(),r=pr(d=>OP(d,e)),a=ot(d=>e?d.getForSession(e):void 0),i=N.useMemo(()=>{const d=a==null?void 0:a.nodes;if(!d)return;const h=d.find(p=>p.status==="pending"||p.status==="scheduled"||p.status==="running");return h==null?void 0:h.title},[a==null?void 0:a.nodes]);if(!e||!r&&!i)return null;const l=(r==null?void 0:r.status)==="waiting_user"?"text-accent-yellow":(r==null?void 0:r.status)==="blocked"?"text-accent-red":(r==null?void 0:r.status)==="paused"?"text-dark-300":(r==null?void 0:r.status)==="failed"?"text-accent-red":"text-accent-blue",c=(r==null?void 0:r.status)==="waiting_user"?"bg-accent-yellow":(r==null?void 0:r.status)==="blocked"?"bg-accent-red":(r==null?void 0:r.status)==="paused"?"bg-dark-300":(r==null?void 0:r.status)==="failed"?"bg-accent-red":(r==null?void 0:r.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:[r&&g.jsxs("span",{title:(r==null?void 0:r.status)==="blocked"?r.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:r.title})]}),i&&g.jsxs("span",{className:"shrink-0 min-w-0 truncate text-dark-muted","data-testid":"taskbar-next",children:[n("taskbar.next"),": ",i]})]})}),r$=2e4;function a$(t){const e=wi(n=>n.workspaceDir);N.useEffect(()=>{vs.getState().refreshStatus();const n=setInterval(()=>{document.visibilityState==="visible"&&vs.getState().refreshStatus()},r$);return()=>clearInterval(n)},[e]),N.useEffect(()=>{t>0&&vs.getState().refreshStatus()},[t])}const s$={info:p3,success:e3,warning:mf,error:M1},i$={info:"text-accent-blue",success:"text-accent-green",warning:"text-accent-yellow",error:"text-accent-red"},o$=N.memo(function(){const{toasts:e,dismissToast:n}=ys();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(r=>{const a=s$[r.type];return g.jsxs("div",{className:"toast-card animate-fade-in-up",role:"status",children:[g.jsx(a,{size:16,className:`shrink-0 mt-0.5 ${i$[r.type]}`}),g.jsxs("span",{className:"text-xs flex-1 text-dark-text leading-relaxed",children:[r.message,r.count>1&&g.jsxs("span",{className:"toast-card-count ml-1.5",children:["×",r.count]})]}),g.jsx("button",{onClick:()=>n(r.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(Bn,{size:12})})]},r.id)})})}),l$={critical:{icon:M_,text:"text-accent-red"},error:{icon:M1,text:"text-accent-red"},warning:{icon:mf,text:"text-accent-yellow"},info:{icon:p3,text:"text-accent-blue"}},c$={info:6e3,warning:1e4},u$=N.memo(function(){const e=fl(a=>a.errors),n=fl(a=>a.dismiss),r=e.filter(a=>!a.dismissed);return N.useEffect(()=>{const a=r.filter(i=>!i.action).map(i=>{const l=i.durationMs??c$[i.level];return l?setTimeout(()=>n(i.id),l):null}).filter(i=>i!==null);return()=>a.forEach(clearTimeout)},[r,n]),r.length===0?null:g.jsx("div",{className:"fixed bottom-4 right-4 z-[110] flex flex-col gap-2 max-w-sm",children:r.map(a=>{const i=l$[a.level],l=i.icon;return g.jsx(d$,{entry:a,icon:l,config:i,onDismiss:()=>n(a.id)},a.id)})})});function d$({entry:t,icon:e,config:n,onDismiss:r}){const[a,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]})]}),a&&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(!a),className:"p-0.5 rounded text-dark-muted/70 hover:text-dark-text hover:bg-dark-hover/60 transition-colors","aria-label":a?"Collapse":"Expand",children:a?g.jsx(yi,{size:12}):g.jsx(f3,{size:12})}),g.jsx("button",{onClick:r,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(Bn,{size:12})})]})]})}function f$(t){const{t:e}=tt(),{setActiveTab:n,createNewSession:r,clearMessages:a,setTheme:i,setThemePreset:l,setLogs:c,setUnreadLogs:d}=t,h=yy(V=>V.backendCommands),p=Array.isArray(h)?h:[],[m,b]=N.useState(!1),[x,w]=N.useState(""),[S,E]=N.useState(0),A=N.useRef(null),T=N.useCallback((V,he)=>{const ve=Fe.getState().activeSessionId;return ve?(Oe.setSessionId(ve),Oe.send({type:"command_execute",sessionId:ve,data:JSON.stringify({command:`/${V}`,args:he||""})}),{success:!0,message:e("slashCommands.sent_command")+`/${V}`}):{success:!1,message:e("slashCommands.noActiveSession")}},[e]),D=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:()=>(n("files"),{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:()=>(r(),{success:!0,message:e("slashCommands.new_result")})},{id:"clear",name:"clear",description:e("slashCommands.clear_desc"),icon:"🗑️",local:!0,action:()=>(a(),{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:V=>{const he=V.trim().toLowerCase();if(["dark","light","auto"].includes(he))return i(he),{success:!0,message:e("slashCommands.theme_result")+he};if(Jc[he])return l?(l(he),{success:!0,message:e("slashCommands.theme_preset_result")+Jc[he].nameKey}):{success:!1,message:e("slashCommands.theme_preset_unavailable")};const ve=Object.keys(Jc).join("|");return{success:!1,message:e("slashCommands.theme_error",{presets:ve})}}},{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:V=>T("compact",V)},{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:V=>T("model",V)},{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:V=>T("config",V)},{id:"exit",name:"exit",description:e("slashCommands.exit_desc"),icon:"🚪",local:!1,action:()=>{const V=Fe.getState().activeSessionId;return V&&(Oe.setSessionId(V),Oe.send({type:"exit",sessionId:V})),{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:V=>T("test",V)}],[n,r,a,i,l,c,d,T,e]),M=N.useMemo(()=>p.map(V=>{const he=e(`slashCommands.${V.name}_desc`,V.description||V.usage||"");return{id:`backend-${V.name}`,name:V.name,description:he,icon:"🔌",local:!1,action:ve=>{const ge=Fe.getState().activeSessionId;return ge?(Oe.setSessionId(ge),Oe.send({type:"command_execute",sessionId:ge,data:JSON.stringify({command:`/${V.name}`,args:ve||""})}),{success:!0,message:e("slashCommands.sent_command")+`/${V.name}`}):{success:!1,message:e("slashCommands.noActiveSession")}}}}),[p,e]),B=N.useMemo(()=>{const V=new Set;return[...D,...M].filter(he=>V.has(he.name)?!1:(V.add(he.name),!0))},[D,M]),I=N.useMemo(()=>{if(!x)return B;const V=x.toLowerCase();return B.filter(he=>he.name.toLowerCase().includes(V)||he.description.toLowerCase().includes(V))},[B,x]),U=N.useCallback(()=>{b(!0),w(""),E(0)},[]),W=N.useCallback(()=>{b(!1),w(""),E(0)},[]),Y=N.useCallback(()=>{E(V=>V>=I.length-1?0:V+1)},[I.length]),oe=N.useCallback(()=>{E(V=>V<=0?I.length-1:V-1)},[I.length]),ae=N.useCallback((V,he)=>{const ve=V.action(he);return W(),ve},[W]);return N.useEffect(()=>{if(m&&A.current){const V=A.current.querySelector(`[data-index="${S}"]`);V&&V.scrollIntoView({block:"nearest"})}},[S,m]),{isOpen:m,filter:x,setFilter:w,selectedIndex:S,setSelectedIndex:E,filteredCommands:I,allCommands:B,openMenu:U,closeMenu:W,selectNext:Y,selectPrev:oe,executeCommand:ae,containerRef:A,commands:D}}function $F(t){const e=t.trim();if(!e.startsWith("/"))return null;const r=e.slice(1).split(/\s+/),a=r[0]||"",i=r.slice(1).join(" ");return{command:a,args:i}}function h$({open:t,onClose:e,options:n}){const{t:r}=tt(),{filter:a,setFilter:i,filteredCommands:l,selectedIndex:c,setSelectedIndex:d,selectNext:h,selectPrev:p,executeCommand:m,openMenu:b,closeMenu:x}=f$(n),w=N.useRef(null),S=N.useRef(null),[E,A]=N.useState(!1);if(N.useEffect(()=>{t?(b(),A(!1),setTimeout(()=>{var M;return(M=w.current)==null?void 0:M.focus()},0)):x()},[t,b,x]),N.useEffect(()=>{if(!t||!S.current)return;const M=S.current.querySelector(`[data-cmd-index="${c}"]`);M&&M.scrollIntoView({block:"nearest"})},[c,t]),!t)return null;const T=M=>{M.local||(A(!0),mt.info(r("palette.running")));const B=m(M,"");M.local&&(B!=null&&B.message)&&mt.success(B.message),e()},D=M=>{if(M.key==="ArrowDown")M.preventDefault(),h();else if(M.key==="ArrowUp")M.preventDefault(),p();else if(M.key==="Enter"){M.preventDefault();const B=l[c];B&&T(B)}else M.key==="Escape"&&(M.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":r("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:M=>M.stopPropagation(),children:[g.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-dark-border",children:[g.jsx(h3,{size:16,className:"text-dark-muted shrink-0","aria-hidden":"true"}),g.jsx("input",{ref:w,value:a,onChange:M=>{i(M.target.value),d(0)},onKeyDown:D,placeholder:r("palette.placeholder"),"aria-label":r("palette.placeholder"),className:"flex-1 bg-transparent text-sm text-dark-text placeholder-dark-muted outline-none"}),E&&g.jsx("span",{className:"text-[10px] text-accent-blue animate-pulse-soft shrink-0",children:r("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:r("palette.empty")}):l.map((M,B)=>g.jsxs("button",{"data-cmd-index":B,onClick:()=>T(M),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:M.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:["/",M.name]}),M.args&&g.jsx("span",{className:"text-xs text-dark-muted",children:M.args}),!M.local&&g.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-accent-blue/20 text-accent-blue shrink-0",children:r("slashCommands.backend")})]}),g.jsx("div",{className:"text-xs text-dark-muted truncate",children:M.description})]}),B===c&&g.jsx(D_,{size:14,className:"text-dark-muted shrink-0","aria-hidden":"true"})]},M.id))}),g.jsx("div",{className:"px-4 py-2 border-t border-dark-border text-[10px] text-dark-muted bg-dark-bg",children:r("palette.hint")})]})})}function _a({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 p$({open:t,onClose:e}){const{t:n}=tt(),r=navigator.platform.toLowerCase().includes("mac")?"⌘":"Ctrl";return g.jsx(Gf,{isOpen:t,onClose:e,title:n("shortcuts.title"),size:"md",children:g.jsxs("div",{className:"space-y-0.5",children:[g.jsx(_a,{keys:[r,"K"],label:n("shortcuts.commandPalette")}),g.jsx(_a,{keys:[r,"L"],label:n("shortcuts.clearLogs")}),g.jsx(_a,{keys:[r,"/"],label:n("shortcuts.help")}),g.jsx(_a,{keys:[r,"Enter"],label:n("shortcuts.submit")}),g.jsx(_a,{keys:[r,"Shift","S"],label:n("shortcuts.screenshot")}),g.jsx(_a,{keys:["Shift","Enter"],label:n("shortcuts.newline")}),g.jsx(_a,{keys:["/"],label:n("shortcuts.slashCommand")}),g.jsx(_a,{keys:["@"],label:n("shortcuts.fileRef")}),g.jsx(_a,{keys:["Esc"],label:n("shortcuts.closeDialog")}),g.jsx(_a,{keys:["Esc","Esc"],label:n("shortcuts.stopGen")})]})})}const TS=gn(t=>({isOpen:!1,entries:null,openWhatsNew:e=>t({isOpen:!0,entries:e??null}),closeWhatsNew:()=>t({isOpen:!1})}));function m$(){var c;const{t,i18n:e}=tt(),{isOpen:n,entries:r,closeWhatsNew:a}=TS(),i=r??G0,l=(c=e.language)!=null&&c.toLowerCase().startsWith("zh")?"zh":"en";return g.jsx(Gf,{isOpen:n,onClose:a,title:g.jsxs("span",{className:"flex items-center gap-2",children:[g.jsx(N1,{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 h=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",h.version]}),h.title&&g.jsx("span",{className:"text-sm text-dark-muted",children:h.title}),h.date&&g.jsx("span",{className:"text-xs text-dark-muted/60 ml-auto",children:h.date})]}),g.jsx("ul",{className:"space-y-1.5",children:h.items.map((p,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:p})]},m))})]},d.version)})})})}function g$({isOpen:t,onClose:e,title:n,collapsedSummary:r,badge:a,children:i,maxHeight:l="45vh",onExpandedChange:c,className:d}){const{t:h}=tt(),[p,m]=N.useState(!0);N.useEffect(()=>{t&&m(!0)},[t]),N.useEffect(()=>{c==null||c(p)},[p,c]);const b=N.useCallback(()=>{m(x=>!x)},[]);return t?g.jsxs("div",{className:ut("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":p,tabIndex:0,onClick:b,onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),b())},title:h(p?"commonUi.drawerCollapseTitle":"commonUi.drawerExpandTitle"),className:ut("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:ut("shrink-0 text-dark-muted transition-transform duration-200",!p&&"rotate-180"),children:g.jsx(yi,{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}),a,!p&&r&&g.jsx("span",{className:"min-w-0 flex items-center gap-1.5 text-xs text-dark-muted truncate",children:r})]}),g.jsx("button",{type:"button","aria-label":h("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(Bn,{size:15})})]}),p&&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 y$=gr(()=>j(()=>import("./ModelsView-B3nHezvJ.js"),__vite__mapDeps([125,126,127,128,129,130])).then(t=>({default:t.ModelsView}))),b$=gr(()=>j(()=>import("./ToolsView-CrEHDTEO.js"),__vite__mapDeps([131,126,127,128,129,130])).then(t=>({default:t.ToolsView}))),v$=gr(()=>j(()=>import("./SkillsView-DTZyXald.js"),__vite__mapDeps([132,126,127,128,129,130])).then(t=>({default:t.SkillsView}))),x$=gr(()=>j(()=>import("./TemplatesTab-CE-CfCf2.js"),__vite__mapDeps([133,126,127,128,129,130])).then(t=>({default:t.TemplatesTab}))),w$=gr(()=>j(()=>import("./HookConfigView-CS1QqgPx.js"),__vite__mapDeps([134,126,127,129,128,130])).then(t=>({default:t.HookConfigView}))),k$=gr(()=>j(()=>import("./FileTreeView-DYx-0jFV.js"),__vite__mapDeps([135,126,127,128,129,130])).then(t=>({default:t.FileTreeView}))),S$=gr(()=>j(()=>import("./SessionGrid-C9-LeJH0.js"),__vite__mapDeps([136,126,127,137,128,129,130,138])).then(t=>({default:t.SessionGrid}))),_$=gr(()=>j(()=>import("./SettingsModal-CjWT1C66.js"),__vite__mapDeps([139,126,127,137,128,129,130])).then(t=>({default:t.SettingsModal}))),C$=gr(()=>j(()=>import("./ChannelConfigView-JDljUn42.js"),__vite__mapDeps([140,126,127,128,129,130])).then(t=>({default:t.ChannelConfigView}))),E$=gr(()=>j(()=>import("./AssistantsView-OMdgsTIj.js"),__vite__mapDeps([141,126,127,128,129,130])).then(t=>({default:t.AssistantsView}))),T$=gr(()=>j(()=>import("./ConnectorsView-AemNT1Ae.js"),__vite__mapDeps([142,126,127,128,129,130])).then(t=>({default:t.ConnectorsView}))),A$=gr(()=>j(()=>import("./AutomationView-BPwjLbkL.js"),__vite__mapDeps([143,126,127,128,129,130])).then(t=>({default:t.AutomationView}))),N$=gr(()=>j(()=>import("./PluginsView-C4Xc70ec.js"),__vite__mapDeps([144,126,127,128,129,130])).then(t=>({default:t.PluginsView}))),R$=gr(()=>j(()=>Promise.resolve().then(()=>hB),void 0).then(t=>({default:t.PluginTabContainer}))),M$=()=>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"})}),by=[{id:"chat",labelKey:"nav.chat",icon:O1},{id:"files",labelKey:"nav.files",icon:O_},{id:"models",labelKey:"nav.models",icon:L_},{id:"tools",labelKey:"nav.tools",icon:j_},{id:"skills",labelKey:"nav.skills",icon:N1},{id:"assistants",labelKey:"nav.assistants",icon:B_},{id:"templates",labelKey:"nav.templates",icon:ug},{id:"hooks",labelKey:"nav.hooks",icon:I_},{id:"channels",labelKey:"nav.channels",icon:P_},{id:"connectors",labelKey:"nav.connectors",icon:z_},{id:"scheduled",labelKey:"nav.scheduled",icon:$_},{id:"logs",labelKey:"nav.logs",icon:Gc},{id:"settings",labelKey:"nav.settings",icon:F_},{id:"plugins",labelKey:"nav.plugins",icon:m3}],tg=Object.fromEntries(by.map(t=>[t.id,t.labelKey])),D$=by.map(t=>({id:t.id,title:t.labelKey})),G5=Object.fromEntries(by.map(t=>[t.id,t.icon]));function O$(){const[t,e]=N.useState("chat"),[n,r]=N.useState(!1),[a,i]=N.useState([]),[,l]=N.useState(0),[c,d]=N.useState(!1),[h,p]=N.useState(!1),[m,b]=N.useState(!1),[x,w]=N.useState(!1),[S,E]=N.useState(!1),[A,T]=N.useState({}),[D,M]=N.useState(!1),[B,I]=N.useState([]),[U,W]=N.useState(null),[Y,oe]=N.useState(!1),ae=N.useMemo(()=>{if(!U)return"";const F=U.split(/[\\/]/);return F[F.length-1]||U},[U]);N.useEffect(()=>{Y&&!U&&oe(!1)},[Y,U]);const V=N.useCallback(F=>{F&&I(ee=>{const fe=qz(ee,U,F);return W(fe.active),fe.tabs})},[U]),he=N.useCallback(F=>{I(ee=>{const fe=Vz(ee,U,F);return W(fe.active),fe.tabs})},[U]),[ve,ge]=N.useState(!1),[q,ie]=N.useState("artifacts"),_e=vs(F=>{var ee,fe;return((fe=(ee=F.status)==null?void 0:ee.changes)==null?void 0:fe.length)??0}),Se=N.useCallback(()=>{if(D&&q==="changes"){M(!1);return}ie("changes"),M(!0),ge(!1)},[D,q]),Qe=N.useCallback(F=>{ie(F),M(!0),ge(!1)},[]),qe=N.useRef(null),Ke=N.useRef(null),[Ie,vt]=N.useState(()=>localStorage.getItem("dsc-sidebar-collapsed")==="1"),an=N.useCallback(()=>{vt(F=>(localStorage.setItem("dsc-sidebar-collapsed",F?"0":"1"),!F))},[]),bn=N.useCallback(()=>{M(F=>!F),ge(!1)},[]),Hn=N.useCallback(()=>{const F=qe.current;F&&(ve?F.resize(Ke.current??20):(Ke.current=F.getSize(),F.resize(68)),ge(ee=>!ee))},[ve]);N.useEffect(()=>{const F=window.matchMedia("(min-width: 1400px)"),ee=fe=>{fe.matches||M(!1)};return F.addEventListener("change",ee),()=>F.removeEventListener("change",ee)},[]),N.useEffect(()=>{try{const F=localStorage.getItem("dsc-seen-version"),ee=BT(F);if(ee.length>0){TS.getState().openWhatsNew(ee);const fe=IT();fe&&localStorage.setItem("dsc-seen-version",fe)}}catch{}},[]);const{t:Ye,i18n:vn}=tt(),{theme:yr,setTheme:Yn,setThemePreset:Lr,language:Zn,workspaceDir:Tt,setWorkspaceDir:jr,effort:br}=wi(),Br=hs();N.useEffect(()=>{Zn&&vn.language!==Zn&&vn.changeLanguage(Zn)},[Zn,vn]);const[Ir,aa]=N.useState([]);N.useEffect(()=>{let F=!1;return Q.get("/api/plugins/ui").then(ee=>{var fe;F||aa((((fe=ee==null?void 0:ee.data)==null?void 0:fe.ui)??[]).filter(Me=>Me.mount==="tab"))}).catch(()=>{}),()=>{F=!0}},[]);const ar=F=>`plugin:${F.pluginId}:${F.id}`,sa=N.useMemo(()=>[...D$.map(F=>({...F,iconComponent:G5[F.id]})),...Ir.map(F=>({id:ar(F),title:F.title,icon:F.icon,iconComponent:G5[F.icon??""]??m3}))],[Ir]),[de,Ve]=N.useState(!1),He=N.useCallback(()=>Ve(!1),[]),Ee=N.useCallback(F=>{if(F==="settings"){Ve(!0);return}N.startTransition(()=>{e(F)})},[]),[bt,Lt]=N.useState(null),It=N.useCallback(F=>{Ve(!0),Lt({section:F,nonce:Date.now()})},[]);N.useEffect(()=>{const F=fe=>{const Me=fe.message||Ye("common.unknownError"),Te=fe.filename||"global";Te.includes("chrome-extension://")||Te.includes("moz-extension://")||i(nt=>[...nt,{id:`error-${Date.now()}-${Oa()}`,level:"error",source:"Browser",message:`${Ye("toast.uncaughtError")}${Me}`,timestamp:Date.now()}].slice(-500))},ee=fe=>{var Te;const Me=((Te=fe.reason)==null?void 0:Te.message)||fe.reason||Ye("toast.unknownReason");i(nt=>[...nt,{id:`rejection-${Date.now()}-${Oa()}`,level:"error",source:"Promise",message:`${Ye("toast.uncaughtRejection")}${Me}`,timestamp:Date.now()}].slice(-500))};return window.addEventListener("error",F),window.addEventListener("unhandledrejection",ee),()=>{window.removeEventListener("error",F),window.removeEventListener("unhandledrejection",ee)}},[Ye]);const{sessionTabs:In,activeSessionId:xe,setActiveSession:$a,addSessionTab:Vt,closeSessionTab:Pr,renameSessionTab:Mn,getVisibleSessionTabs:vr,autoNameSession:xn,touchSession:Dn,sessionWorkspaceDirs:Eu}=Fe(),Ll=xe?A[xe]??!0:!0,Ts=ot(F=>xe?Object.keys(F.tasksBySession[xe]||{}).length:0),Ni=N.useCallback(()=>{T(F=>xe?{...F,[xe]:!(F[xe]??!0)}:F)},[xe]),[wn,Fa]=N.useState(()=>typeof window<"u"&&window.innerWidth<768);N.useEffect(()=>{const F=window.matchMedia("(max-width: 767px)"),ee=fe=>Fa(fe.matches);return F.addEventListener("change",ee),()=>F.removeEventListener("change",ee)},[]);const Gn=ot(F=>xe?F.getForSession(xe):void 0),As=N.useRef(null),Tu=N.useRef(null);N.useEffect(()=>{if(wn)return;const F=Gn&&["RUNNING","RESUMING","PAUSED"].includes(String(Gn.status)),ee=Ts>0;F&&Gn&&As.current!==Gn.runId?(As.current=Gn.runId,M(!0)):ee&&Tu.current!==xe&&(Tu.current=xe??null,M(!0))},[Gn==null?void 0:Gn.runId,Gn==null?void 0:Gn.status,Ts,xe,wn]);const Ns=pr(F=>{var ee;return xe?((ee=F.bySession[xe])==null?void 0:ee.artifacts.length)??0:0}),Ri=N.useRef({sessionId:null,count:0});N.useEffect(()=>{const F=Ri.current;if(xe!==F.sessionId){Ri.current={sessionId:xe??null,count:Ns};return}!wn&&Ns>F.count&&M(!0),Ri.current={sessionId:xe??null,count:Math.max(Ns,F.count)}},[Ns,xe,wn]),a$(Ns);const{clearMessages:Rs}=Be(),jl=Be(F=>xe?F.messagesBySession[xe]||[]:[]),{customTheme:Au,customThemeEnabled:Nu,themePresetId:Ru}=wi();Lz({theme:yr,themePresetId:Ru,customTheme:Au,customThemeEnabled:Nu}),Dz({activeTab:t,setLogs:i,setUnreadLogs:l}),N.useEffect(()=>{const F=ee=>{const fe=ee.detail,Me=typeof fe=="string"?fe:fe==null?void 0:fe.tab,Te=typeof fe=="string"||fe==null?void 0:fe.section;Me&&Me!==t&&Ee(Me),Me==="settings"&&Te&&It(Te)};return window.addEventListener("switch-tab",F),()=>window.removeEventListener("switch-tab",F)},[t,Ee,It]),N.useEffect(()=>{const F=ee=>{var Me;const fe=(Me=ee.detail)==null?void 0:Me.path;fe&&(V(fe),M(!0))};return window.addEventListener("preview-file",F),()=>window.removeEventListener("preview-file",F)},[V]);const Ms=N.useCallback(()=>{const F=window.location.hash.replace(/^#\/?/,"");if(!F)return;const[ee,fe]=F.split("/");ee&&ee in tg&&Ee(ee),ee==="settings"&&fe==="stt"&&It("stt")},[Ee,It]);N.useEffect(()=>(Ms(),window.addEventListener("hashchange",Ms),()=>window.removeEventListener("hashchange",Ms)),[Ms]);const Mi=N.useRef(n);N.useEffect(()=>{const F=Oe.onOpen(()=>{Mi.current=!0,r(!0),mt.success(Ye("toast.backendConnected"))}),ee=Oe.onClose(()=>{const fe=Mi.current;Mi.current=!1,r(!1),fe&&mt.warning(Ye("toast.backendDisconnected"))});return()=>{F(),ee()}},[Ye]);const Mu=N.useCallback(async()=>{try{const F=await ct.sessions.list();if(!F.success||!Array.isArray(F.data))return!1;const ee=Gz(F.data);if(ee.length===0)return!1;const fe=ee[0],Me=Te=>({id:Te.id,title:Te.title,createdAt:Te.createdAt,lastActiveAt:Te.lastActiveAt,preview:Te.preview,status:"done"});return Fe.setState(Te=>{const nt=Te.sessionTabs.some(Wt=>Wt.id===fe.id)?Te.sessionTabs:[Me(fe),...Te.sessionTabs].slice(0,gg),Et=new Set(nt.map(Wt=>Wt.id));let Qt=[...ee.map(Me).filter(Wt=>!Et.has(Wt.id)),...Te.historySessions.filter(Wt=>!ee.some(Jt=>Jt.id===Wt.id))].slice(0,Math.max(0,C3-nt.length));const Ft=[...ee.map(Wt=>({id:Wt.id,title:Wt.title,createdAt:new Date(Wt.createdAt).toISOString(),updatedAt:new Date(Wt.lastActiveAt??Wt.createdAt).toISOString(),messageCount:Wt.messageCount??0})),...Te.sessions.filter(Wt=>!ee.some(Jt=>Jt.id===Wt.id))];return{sessionTabs:nt,historySessions:Qt,sessions:Ft,activeSessionId:fe.id}}),!0}catch{return!1}},[]);N.useEffect(()=>{if(Fe.getState().sessionTabs.length>0)return;let F=!1;return Mu().then(ee=>{F||ee||Vt(Ye("chat.defaultSessionTitle",{n:1}))}),()=>{F=!0}},[]),N.useEffect(()=>{const F=()=>p(!0);return window.addEventListener("hook-approval-required",F),()=>window.removeEventListener("hook-approval-required",F)},[]);const Bl=N.useRef(xe);N.useEffect(()=>{Bl.current=xe},[xe]);const xr=N.useCallback(F=>{var Me,Te,nt;if(!F)return!1;const ee=window,fe=(Me=ee.__pendingQuestions)==null?void 0:Me[F];return fe?(Te=ee.__answeredQuestionIds)!=null&&Te.has(fe.questionId)?(delete ee.__pendingQuestions[F],((nt=ee.__pendingQuestion)==null?void 0:nt.questionId)===fe.questionId&&(ee.__pendingQuestion=null),!1):(ee.__pendingQuestion=fe,b(!0),!0):!1},[]);N.useEffect(()=>{const F=ee=>{const fe=ee.detail||Bl.current;xr(fe)};return window.addEventListener("ask-question-required",F),()=>window.removeEventListener("ask-question-required",F)},[xr]),N.useEffect(()=>{xe&&xr(xe)},[xe,xr]);const kn=N.useCallback(()=>{var fe;const F=window,ee=F.__pendingQuestion;if(ee!=null&&ee.questionId){F.__answeredQuestionIds=F.__answeredQuestionIds||new Set,F.__answeredQuestionIds.add(ee.questionId);const Me=F.__pendingQuestions||{};for(const Te of Object.keys(Me))((fe=Me[Te])==null?void 0:fe.questionId)===ee.questionId&&delete Me[Te];F.__pendingQuestion=null}b(!1)},[]);N.useEffect(()=>{Br.autoMode&&Br.pendingApprovals.length>0&&p(!1),Br.pendingApprovals.length>0&&!Br.autoMode&&p(!0)},[Br.autoMode,Br.pendingApprovals.length]);const Sn=N.useRef(0);N.useEffect(()=>{const F=ee=>{var Ft,Wt;if(ee.key!=="Escape"||ee.defaultPrevented)return;const fe=(Ft=ee.target)==null?void 0:Ft.tagName;if(fe==="INPUT"||fe==="TEXTAREA"||(Wt=ee.target)!=null&&Wt.isContentEditable)return;const Me=Be.getState(),nt=Fe.getState().activeSessionId;if(!nt||!Me.isGenerating(nt))return;ee.preventDefault();const Et=Date.now(),Qt=PT(Me.getPending(nt).length,Me.isPaused(nt),Sn.current,Et);if(Sn.current=Et,Qt==="revokeQueue"){const Jt=Me.clearPending(nt);Sn.current=0,Jt>0&&mt.info(Ye("toast.queueRevoked",{count:Jt}))}else if(Qt==="stop"){Oe.send({type:"stop",sessionId:nt});const Jt=Me.clearPending(nt);Sn.current=0,mt.info(Jt>0?Ye("toast.terminatedQueued",{count:Jt}):Ye("toast.terminated"))}else Oe.send({type:"pause",sessionId:nt}),mt.info(Ye("toast.paused"))};return window.addEventListener("keydown",F),()=>window.removeEventListener("keydown",F)},[Ye]);const ia=N.useCallback(()=>{const F=Fe.getState(),ee=F.activeSessionId;return((ee?F.sessionWorkspaceDirs[ee]:"")||Tt||"").trim()},[Tt]),oa=N.useCallback(()=>{N.startTransition(()=>{const F=Vt(void 0,ia()||void 0);Oe.setSessionId(F),pl.getState().setMode("auto-act"),Ee("chat")})},[Vt,ia,Ee]),qf=N.useCallback((F,ee)=>{N.startTransition(()=>{const fe=Fe.getState();fe.sessionTabs.some(Me=>Me.id===F)||fe.addSessionTab(ee,fe.sessionWorkspaceDirs[F]||void 0,F),Oe.setSessionId(F),Ee("chat")})},[Ee]),Vf=N.useCallback(async F=>{const ee=await ct.sessions.fork(F);if(!ee.success||!ee.data){mt.error(ee.error||Ye("chat.forkSessionFailed"));return}const{newSessionId:fe,title:Me}=ee.data;N.startTransition(()=>{Vt(Me,ia()||void 0,fe),Oe.setSessionId(fe),Ee("chat")})},[Vt,ia,Ee,Ye]),Du=N.useCallback(F=>{N.startTransition(()=>{const ee=Fe.getState();let fe=ee.activeSessionId;fe||(fe=ee.addSessionTab(void 0,Tt),Oe.setSessionId(fe)),Be.getState().setSessionInput(fe,`$${F.id} `),Ee("chat")})},[Tt,Ee]),Ds=N.useCallback(()=>Ee("templates"),[Ee]),Di=N.useCallback(async(F,ee)=>{var Qt;const fe=await ct.templates.render(F.id,ee);if(!fe.success||!fe.data){mt.error(fe.error||"模板渲染失败");return}const Me=fe.data,Te=Vt(F.name,Tt);Oe.setSessionId(Te),pl.getState().setMode("auto-act"),Ee("chat");const nt=`wf-${Date.now()}-${Oa()}`;ot.getState().upsert(Te,{runId:nt,status:"RUNNING",completedPhases:0,totalPhases:((Qt=Me.nodes)==null?void 0:Qt.length)??0,completedEffects:0,totalEffects:0,tokensUsed:0,tokensRemaining:0,lastEventType:"workflow_start"});const Et=await ct.workflows.start({sessionId:Te,runId:nt,workflow:Me,message:`[工作流] ${F.name}`});if(!Et.success||!Et.data){mt.error(Et.error||"工作流启动失败"),ot.getState().fail(Te,nt,Et.error||"启动失败");return}if(Et.data.status==="FAILED"){const Ft=Et.data.error||"模板定义无效";mt.error(`工作流启动失败: ${Ft}`),ot.getState().fail(Te,nt,Ft)}},[Vt,Tt,Ee]),Ua=N.useRef(0),Ha=N.useCallback(async F=>{if(!F)return;const ee=++Ua.current;try{const fe=await ct.sessions.resume(F);if(ee!==Ua.current||!fe.success||!fe.data)return;const Me=fe.data;Me.session&&Fe.getState().updateSession(F,Me.session);const Te=Me.messages||[];if(Te.length>0){const nt=Pz(Te);nt.length>0&&Be.getState().replaceMessages(F,nt);const Et=Te.find(Ft=>w0(Ft)),Qt=typeof(Et==null?void 0:Et.content)=="string"?Et.content.replace(/\s+/g," ").trim():"";Fe.getState().touchSession(F,Qt||void 0)}}catch{}},[]),Ga=N.useCallback(F=>{$a(F),Oe.setSessionId(F),W(null),I([])},[$a]),ya=N.useCallback(F=>{Pr(F)},[Pr]),Xt=N.useCallback((F,ee)=>{Mn(F,ee)},[Mn]),Oi=N.useCallback(F=>((F?Eu[F]:"")||Tt||"").trim(),[Eu,Tt]),Ou=N.useMemo(()=>{const F=Oi(xe),ee=In.filter(fe=>Oi(fe.id)===F);if(xe&&!ee.some(fe=>fe.id===xe)){const fe=In.find(Me=>Me.id===xe);if(fe)return[fe,...ee]}return ee},[In,xe,Oi]),la=N.useCallback(()=>{xe&&Rs(xe)},[xe,Rs]);N.useEffect(()=>{if(!xe)return;const F=Be.getState().messagesBySession[xe];F&&F.length>0&&st.getState().recalculateFromMessages(F)},[xe]),N.useEffect(()=>{if(!xe)return;Be.getState().getMessages(xe).length===0&&Ha(xe)},[xe,Ha]);const zr=N.useCallback(async(F,ee,fe,Me,Te)=>{if(!ee.trim()&&!(Te!=null&&Te.force))return;const nt=Be.getState().isGenerating(F),Et=Be.getState().isPaused(F);if(!(Te!=null&&Te.force)){if(nt&&!Et){console.info(`[sendMessage] Session ${F} generating — message queued (${ee.trim().length} chars)`),Be.getState().enqueuePending(F,ee.trim(),fe,Me);return}nt&&Et&&(console.warn(`[sendMessage] Session ${F} paused — force-ending paused run`),Be.getState().endGeneration(F,"Force-ended: new message"))}const Qt=pl.getState();Be.getState().resumeGeneration(F),Oe.setSessionId(F),Be.getState().getMessages(F).some(ba=>w0(ba))?Dn(F):(xn(F,ee.trim()),Dn(F,ee.trim()));let Jt=ee.trim();if(fe&&fe.length>0){const ba=[],Os=[...fe].sort((_n,wr)=>wr.length-_n.length);for(const _n of Os){Jt=Jt.split(`@${_n}`).join("").trim();try{const wr=await ct.files.read(_n),Co=wr.success&&wr.data?wr.data:null;if(Co){const Ls=_n.split(".").pop()||"";ba.push(`<context ref="${_n}">
585
- \`\`\`${Ls}
586
- ${Co}
587
- \`\`\`
588
- </context>`)}}catch(wr){console.warn(`Failed to read @-referenced file: ${_n}`,wr)}}ba.length>0&&(Jt=ba.join(`
589
-
590
- `)+`
591
-
592
- `+Jt.trim(),Jt=Jt.trim())}const ir=(Te==null?void 0:Te.mentions)??[];BE.getState().setObserved(ir);let qa=Jt;if(ir.length>0){for(const ba of ir)for(const Os of[`@${ba.title}`,`@${ba.id}`].sort((_n,wr)=>wr.length-_n.length))qa=qa.split(Os).join("");qa=qa.trim()||Jt}Te!=null&&Te.skipAddUserMessage||Be.getState().addMessage(F,{id:`msg-${Date.now()}`,type:"user",content:Jt,timestamp:Date.now(),...Me&&Me.length>0?{images:Me}:{}});const Il=Qt.mode,Pl=Zr(Il==="normal"?"act":Il),Li=br==="off"?!1:void 0,zl=Me&&Me.length>0||ir.length>0?JSON.stringify({...Me&&Me.length>0?{images:Me}:{},...ir.length>0?{mentions:ir}:{},...ir.length>0?{mentionDeliveryMode:(Te==null?void 0:Te.mentionDeliveryMode)??"enqueue"}:{}}):void 0;Pl==="plan"?Oe.send({type:"plan",sessionId:F,message:qa,effort:br,thinking:Li,data:zl}):Pl==="goal"?Oe.send({type:"chat",sessionId:F,message:qa,effort:br,thinking:Li,data:zl}):Oe.send({type:"chat",sessionId:F,message:qa,effort:br,thinking:Li,data:zl})},[xn,Dn,Tt,br]);N.useEffect(()=>(Bx((F,ee)=>{zr(F,ee.content,ee.files,ee.images,{force:!0})}),()=>Bx(null)),[zr]);const Wf=N.useCallback((F,ee)=>{var Qt;const fe=Be.getState(),Me=fe.getMessages(F),Te=Me.findIndex(Ft=>Ft.id===ee);if(Te===-1)return;let nt=-1;for(let Ft=Te-1;Ft>=0;Ft--)if(w0(Me[Ft])){nt=Ft;break}if(nt===-1)return;const Et=Me[nt];(Qt=Et==null?void 0:Et.content)!=null&&Qt.trim()&&(fe.replaceMessages(F,Me.slice(0,nt+1)),zr(F,Et.content,void 0,void 0,{skipAddUserMessage:!0}))},[zr]),Lu=N.useCallback((F,ee)=>{Be.getState().applyTombstone(F,[ee]),mt.success(Ye("chat.messageDeleted"))},[Ye]),ju=N.useCallback(F=>{const ee=Be.getState().clearPending(F);ee>0&&console.info(`[stopGeneration] Session ${F} — dropped ${ee} queued message(s)`);const fe=ot.getState().getForSession(F);fe&&!["COMPLETED","CANCELLED","ERROR","FAILED"].includes(fe.status)?Oe.send({type:"workflow_cancel",sessionId:F,runId:fe.runId}):Oe.send({type:"stop",sessionId:F}),Be.getState().endGeneration(F,"user stop")},[]),Kf=N.useCallback(F=>{const ee=ot.getState().getForSession(F);ee&&["RUNNING","RESUMING"].includes(ee.status)?Oe.send({type:"workflow_pause",sessionId:F,runId:ee.runId}):Oe.send({type:"pause",sessionId:F}),Be.getState().pauseGeneration(F)},[]),ko=N.useCallback(F=>{const ee=ot.getState().getForSession(F);ee&&ee.status==="PAUSED"?Oe.send({type:"workflow_resume",sessionId:F,runId:ee.runId}):Oe.send({type:"resume",sessionId:F}),Be.getState().resumeGeneration(F)},[]),So=N.useCallback(F=>{const ee=F.trim();if(!ee||ee===Tt)return;jr(ee),Oe.send({type:"workspace",message:ee}),Fe.getState().sessionTabs.forEach(Me=>{Be.getState().clearMessages(Me.id)}),Fe.setState({sessionTabs:[],sessions:[],sessionWorkspaceDirs:{},activeSessionId:null}),setTimeout(()=>{Fe.getState().addSessionTab(Ye("chat.defaultSessionTitle",{n:1}),ee)},0)},[Tt,jr,Ye]),$r=()=>{i([]),l(0)},sr=N.useMemo(()=>({setActiveTab:Ee,createNewSession:oa,clearMessages:la,setTheme:Yn,setThemePreset:Lr,setLogs:i,setUnreadLogs:l}),[Ee,oa,la,Yn,Lr]);N.useEffect(()=>{const F=ee=>{var nt,Et;const fe=ee.ctrlKey||ee.metaKey,Me=(nt=ee.target)==null?void 0:nt.tagName,Te=Me==="INPUT"||Me==="TEXTAREA"||((Et=ee.target)==null?void 0:Et.isContentEditable);if(ee.key==="Escape"){if(x){ee.preventDefault(),w(!1);return}if(S){ee.preventDefault(),E(!1);return}if(c){ee.preventDefault(),d(!1);return}return}if(fe)if(ee.key==="k"||ee.key==="K")ee.preventDefault(),E(!1),w(Qt=>!Qt);else if(ee.key==="l"||ee.key==="L"){if(Te)return;ee.preventDefault(),$r(),mt.success(Ye("slashCommands.logs_clear_result"))}else ee.key==="/"&&(ee.preventDefault(),w(!1),E(Qt=>!Qt))};return window.addEventListener("keydown",F),()=>window.removeEventListener("keydown",F)},[x,S,c,Ye]);const _o=(F,ee)=>tg[F]?Ye(tg[F]):ee,Yf=F=>{switch(F){case"chat":{const ee=vr();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.jsx("span",{className:"ui-status-dot shrink-0","data-status":n?"online":"error",title:Ye(n?"chat.connected":"chat.disconnected"),"aria-label":Ye(n?"chat.connected":"chat.disconnected"),role:"status"}),g.jsx(t$,{tabs:Ou,activeSessionId:xe,onActivate:Ga,onClose:ya,onRename:Xt,onNew:oa,onFork:Vf,workspaceDir:Oi(xe),canClose:In.length>1}),g.jsxs("button",{onClick:Se,className:`flex shrink-0 items-center gap-1.5 rounded-lg px-2 py-1.5 text-xs transition-colors ${D&&q==="changes"?"bg-accent-blue/10 text-accent-blue":"text-dark-muted hover:bg-dark-hover hover:text-dark-text"}`,title:Ye("chat.changesToggle"),"aria-label":Ye("chat.changesToggle"),"aria-expanded":D&&q==="changes","data-testid":"toolbar-changes-button",children:[g.jsx(M0,{size:13,className:"shrink-0","aria-hidden":"true"}),g.jsx("span",{className:"hidden sm:inline",children:Ye("chat.changesTitle")}),_e>0&&g.jsxs("span",{className:"font-mono text-[10px] tabular-nums",children:["(",_e,")"]})]}),Ts>0&&g.jsx("button",{onClick:wn?Ni:bn,className:`ui-icon-button transition-colors ${wn?Ll?"bg-accent-blue/10 text-accent-blue":"text-dark-muted hover:bg-dark-hover hover:text-dark-text":D?"bg-accent-blue/10 text-accent-blue":"text-dark-muted hover:bg-dark-hover hover:text-dark-text"}`,title:wn?"Task Board":"任务看板(右侧)","aria-label":wn?"Task Board":"任务看板(右侧)","aria-expanded":wn?Ll:D,children:g.jsx(i3,{size:16,"aria-hidden":"true"})}),g.jsx("button",{onClick:bn,className:`ui-icon-button transition-colors ${D?"bg-accent-blue/10 text-accent-blue":"text-dark-muted hover:bg-dark-hover hover:text-dark-text"}`,title:"右侧面板","aria-label":"切换右侧面板","aria-expanded":D,children:g.jsx(H_,{size:16,"aria-hidden":"true"})})]}),g.jsx(n$,{sessionId:xe??void 0}),g.jsx(S$,{tabs:ee,activeSessionId:xe,onSend:zr,onStop:ju,onPause:Kf,onResume:ko,activeTab:t,setActiveTab:Ee,createNewSession:oa,clearMessages:la,onOpenSidebarView:Qe,setTheme:Yn,setThemePreset:Lr,setLogs:i,setUnreadLogs:l,showTaskBoard:Ll&&wn,onToggleTaskBoard:Ni,onRegenerate:Wf,onDeleteMessage:Lu,hookDrawerOpen:h,onCloseHookDrawer:()=>p(!1),questionDrawerOpen:m,onCloseQuestionDrawer:kn,workspaceDir:Tt,onWorkspaceSelect:So})]})}case"files":return g.jsx(k$,{});case"models":return g.jsx(y$,{});case"tools":return g.jsx(b$,{});case"skills":return g.jsx(v$,{onUseSkill:Du});case"templates":return g.jsx(x$,{onLaunch:Di,workspaceDir:Tt});case"hooks":return g.jsx(w$,{});case"channels":return g.jsx(C$,{});case"assistants":return g.jsx(E$,{onOpenSession:qf,onNavigate:Ee});case"connectors":return g.jsx(T$,{onNavigate:Ee});case"scheduled":return g.jsx(A$,{});case"logs":return g.jsx(FP,{logs:a,onClear:$r});case"plugins":return g.jsx(N$,{});default:if(F.startsWith("plugin:")){const ee=Ir.find(fe=>ar(fe)===F);if(ee)return g.jsx(R$,{contribution:ee,hostContext:{sessionId:xe,theme:yr,workspaceDir:Tt,wsUrl:I1()}})}return null}};return g.jsxs(U5,{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 ${Ie?"w-14":"w-60"}`,children:g.jsx(C5,{collapsed:Ie,onToggleCollapse:an,tabs:sa,activeTab:t,onTabChange:Ee,isConnected:n,onNewSession:oa,onStartTemplate:Di,onManageTemplates:Ds,onSwitchSession:Ga,onCloseSession:ya,onRenameSession:Xt,getTabTitle:_o})}),c&&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:()=>d(!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(C5,{collapsed:!1,onToggleCollapse:()=>d(!1),tabs:sa,activeTab:t,onTabChange:F=>{Ee(F),d(!1)},isConnected:n,onNewSession:()=>{oa(),d(!1)},onStartTemplate:Di,onManageTemplates:()=>{Ds(),d(!1)},onSwitchSession:F=>{Ga(F),d(!1)},onCloseSession:ya,onRenameSession:Xt,getTabTitle:_o})})]}),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:()=>d(!0),"aria-label":Ye("a11y.openMenu"),children:g.jsx(U_,{size:18,"aria-hidden":"true"})}),g.jsx("span",{className:"text-sm font-semibold truncate",children:_o(t,"")}),g.jsx("div",{className:"flex-1"}),t==="chat"&&g.jsx("button",{onClick:oa,className:"ui-icon-button","aria-label":Ye("chat.newSession"),children:g.jsx(nu,{size:18,"aria-hidden":"true"})})]}),g.jsx("div",{className:"flex-1 flex overflow-hidden min-h-0",children:g.jsxs(y3,{direction:"horizontal",children:[g.jsx(dg,{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(M$,{}),children:g.jsx(U5,{children:Yf(t)})})})}),t==="chat"&&D&&!wn&&!Y&&g.jsx(b3,{className:"w-1 bg-dark-border hover:bg-accent-blue transition-colors cursor-col-resize"}),t==="chat"&&D&&!wn&&!Y&&g.jsx(dg,{id:"rightrail",ref:qe,defaultSize:20,minSize:14,maxSize:70,className:"min-w-0",children:g.jsx(CP,{sessionId:xe??"",messages:jl,previewFile:U,previewTabs:B,onPreview:V,onCloseTab:he,onClosePreview:()=>{W(null),I([])},isMaximized:ve,onToggleMaximize:Hn,view:q,onViewChange:ie,onPopOutPreview:()=>oe(!0)})})]})}),t==="chat"&&D&&!wn&&Y&&U&&g.jsx(Uz,{title:ae,subtitle:U===ae?void 0:U,label:Ye("chat.previewPopOut"),onClose:()=>oe(!1),children:g.jsx(y1,{sessionId:xe??"",messages:jl,previewFile:U,previewTabs:B,onPreview:V,onCloseTab:he,onClosePreview:()=>{oe(!1),W(null),I([])}})}),t==="chat"&&D&&wn&&g.jsx(g$,{isOpen:!0,onClose:()=>M(!1),title:q==="changes"?Ye("chat.changesTitle"):"输出物 · 任务",maxHeight:"60vh",children:g.jsx("div",{className:"flex h-[52vh] flex-col",children:q==="changes"?g.jsx(pS,{}):g.jsx(y1,{sessionId:xe??"",messages:jl,previewFile:U,previewTabs:B,onPreview:V,onCloseTab:he,onClosePreview:()=>{W(null),I([])}})})}),g.jsx(Jz,{activeTab:t})]})]}),g.jsx(h$,{open:x,onClose:()=>w(!1),options:sr}),g.jsx(p$,{open:S,onClose:()=>E(!1)}),g.jsx(m$,{}),g.jsx(N.Suspense,{fallback:null,children:g.jsx(_$,{isOpen:de,onClose:He,onNavigate:F=>{He(),Ee(F)},focusSection:bt})}),g.jsx(o$,{}),g.jsx(u$,{})]})}let b0=new Set;function L$(t){function e(){n(window)}function n(p){p&&typeof p.addEventListener=="function"&&(p.addEventListener("click",i,!0),p.addEventListener("mousedown",l,!0),p.addEventListener("mouseover",l,!0),p.addEventListener("mouseup",l,!0),p.addEventListener("pointerdown",c,!0),p.addEventListener("pointerover",d,!0),p.addEventListener("pointerup",h,!0))}function r(){a(window),b0.forEach(p=>{try{a(p.contentWindow)}catch{}}),b0=new Set}function a(p){p&&typeof p.removeEventListener=="function"&&(p.removeEventListener("click",i,!0),p.removeEventListener("mousedown",l,!0),p.removeEventListener("mouseover",l,!0),p.removeEventListener("mouseup",l,!0),p.removeEventListener("pointerdown",c,!0),p.removeEventListener("pointerover",d,!0),p.removeEventListener("pointerup",h,!0))}function i(p){var m;p.preventDefault(),p.stopPropagation(),r(),(m=t.onClick)===null||m===void 0||m.call(t,p.target)}function l(p){p.preventDefault(),p.stopPropagation()}function c(p){p.preventDefault(),p.stopPropagation()}function d(p){var m;p.preventDefault(),p.stopPropagation();const b=p.target;if(b.tagName==="IFRAME"){const x=b;try{if(!b0.has(x)){const w=x.contentWindow;n(w),b0.add(x)}}catch{}}(m=t.onPointerOver)===null||m===void 0||m.call(t,p.target)}function h(p){p.preventDefault(),p.stopPropagation()}return e(),r}const j$=t=>typeof(t==null?void 0:t.type)=="string",AS=t=>{var e;return typeof((e=t==null?void 0:t.type)===null||e===void 0?void 0:e.$$typeof)=="symbol"},B$=t=>{var e;return((e=t==null?void 0:t.type)===null||e===void 0?void 0:e.$$typeof)===Symbol.for("react.forward_ref")},I$=t=>{const e=Object.keys(t).find(n=>n.startsWith("__reactInternalInstance$")||n.startsWith("__reactFiber$"));if(e)return t[e]},vy=t=>{if(!t)return;const e=I$(t);return e||vy(t.parentElement)},P$=t=>{let e=t.return;for(;e;){if(!AS(e))return e;e=e.return}return null},NS=t=>{const e=t==null?void 0:t.type;if(!e)return;const{displayName:n,name:r}=e;if(typeof n=="string")return n;if(typeof r=="string")return r},z$=t=>{var e,n;if(!t)return;const r=(e=t._debugSource)!==null&&e!==void 0?e:(n=t._debugOwner)===null||n===void 0?void 0:n._debugSource;if(!r)return;const{fileName:a,lineNumber:i,columnNumber:l}=r;if(a&&i)return{lineNumber:String(i),columnNumber:String(l??1),absolutePath:a.match(/^<.*>$/)?a.replace(/^<|>$/g,""):a}},$$=t=>{if(!(t!=null&&t.pendingProps))return;const{"data-inspector-line":e,"data-inspector-column":n,"data-inspector-relative-path":r}=t.pendingProps;if(e&&n&&r)return{lineNumber:e,columnNumber:n,relativePath:r}},xy=t=>{const e=[z$(t),$$(t)].filter(Boolean);if(e.length)return Object.assign({},...e)},RS=t=>{if(!t)return;const e=P$(t);if(!e)return;const n=j$(e),r=!e.child.sibling;let a=!n&&r?e:t;const i=a;for(;a;){if(xy(a))return a;a=a.return}return i},q5=t=>{const e=vy(t),n=RS(e);return xy(n)},F$=t=>{var e,n;let r=t,a;for(;r;){let i=(e=r.return)!==null&&e!==void 0?e:void 0,l;for(;AS(i);)B$(i)&&(l=i),i=(n=i==null?void 0:i.return)!==null&&n!==void 0?n:void 0;if(l&&(r=l),NS(r)&&(a||(a=r),xy(r)))return r;r=i}return a},V5=t=>{const e=vy(t),n=RS(e),r=F$(n),a=NS(r),i=t.nodeName.toLowerCase(),l=a?`${i} in <${a}>`:i;return{fiber:n,name:a,title:l}};function W5(t){return t.getBoundingClientRect()}function U$(t){const e=window.getComputedStyle(t);return{borderLeft:Number.parseInt(e.borderLeftWidth,10),borderRight:Number.parseInt(e.borderRightWidth,10),borderTop:Number.parseInt(e.borderTopWidth,10),borderBottom:Number.parseInt(e.borderBottomWidth,10),marginLeft:Number.parseInt(e.marginLeft,10),marginRight:Number.parseInt(e.marginRight,10),marginTop:Number.parseInt(e.marginTop,10),marginBottom:Number.parseInt(e.marginBottom,10),paddingLeft:Number.parseInt(e.paddingLeft,10),paddingRight:Number.parseInt(e.paddingRight,10),paddingTop:Number.parseInt(e.paddingTop,10),paddingBottom:Number.parseInt(e.paddingBottom,10)}}var ng,K5;function H$(){return K5||(K5=1,ng="/__open-stack-frame-in-editor"),ng}var G$=H$();const Y5=E1(G$),q$=t=>"codeInfo"in t?t.codeInfo:t,V$=t=>{if(!t)return;const e=q$(t),{lineNumber:n,columnNumber:r,relativePath:a,absolutePath:i}=e,l=!!a,c=l?a:i;if(!c){console.error("[react-dev-inspector] Cannot open editor without source fileName",e);return}const d={fileName:c,lineNumber:n,colNumber:r},h=l?`${Y5}/relative`:Y5;fetch(`${h}?${new URLSearchParams(d)}`)},rg=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function ag(t,e,n,r){t.addEventListener?t.addEventListener(e,n,r):t.attachEvent&&t.attachEvent("on".concat(e),n)}function Ic(t,e,n,r){t.removeEventListener?t.removeEventListener(e,n,r):t.detachEvent&&t.detachEvent("on".concat(e),n)}function MS(t,e){const n=e.slice(0,e.length-1);for(let r=0;r<n.length;r++)n[r]=t[n[r].toLowerCase()];return n}function DS(t){typeof t!="string"&&(t=""),t=t.replace(/\s/g,"");const e=t.split(",");let n=e.lastIndexOf("");for(;n>=0;)e[n-1]+=",",e.splice(n,1),n=e.lastIndexOf("");return e}function W$(t,e){const n=t.length>=e.length?t:e,r=t.length>=e.length?e:t;let a=!0;for(let i=0;i<n.length;i++)r.indexOf(n[i])===-1&&(a=!1);return a}const mu={backspace:8,"⌫":8,tab:9,clear:12,enter:13,"↩":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,arrowup:38,arrowdown:40,arrowleft:37,arrowright:39,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":rg?173:189,"=":rg?61:187,";":rg?59:186,"'":222,"{":219,"}":221,"[":219,"]":221,"\\":220},ga={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,meta:91,command:91},Hc={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},Un={16:!1,18:!1,17:!1,91:!1},Zt={};for(let t=1;t<20;t++)mu["f".concat(t)]=111+t;let Ht=[],eu=null,OS="all";const fs=new Map,Ol=t=>mu[t.toLowerCase()]||ga[t.toLowerCase()]||t.toUpperCase().charCodeAt(0),K$=t=>Object.keys(mu).find(e=>mu[e]===t),Y$=t=>Object.keys(ga).find(e=>ga[e]===t);function LS(t){OS=t||"all"}function gu(){return OS||"all"}function Z$(){return Ht.slice(0)}function X$(){return Ht.map(t=>K$(t)||Y$(t)||String.fromCharCode(t))}function Q$(){const t=[];return Object.keys(Zt).forEach(e=>{Zt[e].forEach(n=>{let{key:r,scope:a,mods:i,shortcut:l}=n;t.push({scope:a,shortcut:l,mods:i,keys:r.split("+").map(c=>Ol(c))})})}),t}function J$(t){const e=t.target||t.srcElement,{tagName:n}=e;let r=!0;const a=n==="INPUT"&&!["checkbox","radio","range","button","file","reset","submit","color"].includes(e.type);return(e.isContentEditable||(a||n==="TEXTAREA"||n==="SELECT")&&!e.readOnly)&&(r=!1),r}function eF(t){return typeof t=="string"&&(t=Ol(t)),Ht.indexOf(t)!==-1}function tF(t,e){let n,r;t||(t=gu());for(const a in Zt)if(Object.prototype.hasOwnProperty.call(Zt,a))for(n=Zt[a],r=0;r<n.length;)n[r].scope===t?n.splice(r,1).forEach(l=>{let{element:c}=l;return wy(c)}):r++;gu()===t&&LS(e||"all")}function nF(t){let e=t.keyCode||t.which||t.charCode;t.key&&t.key.toLowerCase()==="capslock"&&(e=Ol(t.key));const n=Ht.indexOf(e);if(n>=0&&Ht.splice(n,1),t.key&&t.key.toLowerCase()==="meta"&&Ht.splice(0,Ht.length),(e===93||e===224)&&(e=91),e in Un){Un[e]=!1;for(const r in ga)ga[r]===e&&(ta[r]=!1)}}function jS(t){if(typeof t>"u")Object.keys(Zt).forEach(a=>{Array.isArray(Zt[a])&&Zt[a].forEach(i=>v0(i)),delete Zt[a]}),wy(null);else if(Array.isArray(t))t.forEach(a=>{a.key&&v0(a)});else if(typeof t=="object")t.key&&v0(t);else if(typeof t=="string"){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];let[a,i]=n;typeof a=="function"&&(i=a,a=""),v0({key:t,scope:a,method:i,splitKey:"+"})}}const v0=t=>{let{key:e,scope:n,method:r,splitKey:a="+"}=t;DS(e).forEach(l=>{const c=l.split(a),d=c.length,h=c[d-1],p=h==="*"?"*":Ol(h);if(!Zt[p])return;n||(n=gu());const m=d>1?MS(ga,c):[],b=[];Zt[p]=Zt[p].filter(x=>{const S=(r?x.method===r:!0)&&x.scope===n&&W$(x.mods,m);return S&&b.push(x.element),!S}),b.forEach(x=>wy(x))})};function Z5(t,e,n,r){if(e.element!==r)return;let a;if(e.scope===n||e.scope==="all"){a=e.mods.length>0;for(const i in Un)Object.prototype.hasOwnProperty.call(Un,i)&&(!Un[i]&&e.mods.indexOf(+i)>-1||Un[i]&&e.mods.indexOf(+i)===-1)&&(a=!1);(e.mods.length===0&&!Un[16]&&!Un[18]&&!Un[17]&&!Un[91]||a||e.shortcut==="*")&&(e.keys=[],e.keys=e.keys.concat(Ht),e.method(t,e)===!1&&(t.preventDefault?t.preventDefault():t.returnValue=!1,t.stopPropagation&&t.stopPropagation(),t.cancelBubble&&(t.cancelBubble=!0)))}}function X5(t,e){const n=Zt["*"];let r=t.keyCode||t.which||t.charCode;if(t.key&&t.key.toLowerCase()==="capslock"||!ta.filter.call(this,t))return;if((r===93||r===224)&&(r=91),Ht.indexOf(r)===-1&&r!==229&&Ht.push(r),["metaKey","ctrlKey","altKey","shiftKey"].forEach(c=>{const d=Hc[c];t[c]&&Ht.indexOf(d)===-1?Ht.push(d):!t[c]&&Ht.indexOf(d)>-1?Ht.splice(Ht.indexOf(d),1):c==="metaKey"&&t[c]&&(Ht=Ht.filter(h=>h in Hc||h===r))}),r in Un){Un[r]=!0;for(const c in ga)if(Object.prototype.hasOwnProperty.call(ga,c)){const d=Hc[ga[c]];ta[c]=t[d]}if(!n)return}for(const c in Un)Object.prototype.hasOwnProperty.call(Un,c)&&(Un[c]=t[Hc[c]]);t.getModifierState&&!(t.altKey&&!t.ctrlKey)&&t.getModifierState("AltGraph")&&(Ht.indexOf(17)===-1&&Ht.push(17),Ht.indexOf(18)===-1&&Ht.push(18),Un[17]=!0,Un[18]=!0);const a=gu();if(n)for(let c=0;c<n.length;c++)n[c].scope===a&&(t.type==="keydown"&&n[c].keydown||t.type==="keyup"&&n[c].keyup)&&Z5(t,n[c],a,e);if(!(r in Zt))return;const i=Zt[r],l=i.length;for(let c=0;c<l;c++)if((t.type==="keydown"&&i[c].keydown||t.type==="keyup"&&i[c].keyup)&&i[c].key){const d=i[c],{splitKey:h}=d,p=d.key.split(h),m=[];for(let b=0;b<p.length;b++)m.push(Ol(p[b]));m.sort().join("")===Ht.sort().join("")&&Z5(t,d,a,e)}}function ta(t,e,n){Ht=[];const r=DS(t);let a=[],i="all",l=document,c=0,d=!1,h=!0,p="+",m=!1,b=!1;for(n===void 0&&typeof e=="function"&&(n=e),Object.prototype.toString.call(e)==="[object Object]"&&(e.scope&&(i=e.scope),e.element&&(l=e.element),e.keyup&&(d=e.keyup),e.keydown!==void 0&&(h=e.keydown),e.capture!==void 0&&(m=e.capture),typeof e.splitKey=="string"&&(p=e.splitKey),e.single===!0&&(b=!0)),typeof e=="string"&&(i=e),b&&jS(t,i);c<r.length;c++)t=r[c].split(p),a=[],t.length>1&&(a=MS(ga,t)),t=t[t.length-1],t=t==="*"?"*":Ol(t),t in Zt||(Zt[t]=[]),Zt[t].push({keyup:d,keydown:h,scope:i,mods:a,shortcut:r[c],method:n,key:r[c],splitKey:p,element:l});if(typeof l<"u"&&window){if(!fs.has(l)){const x=function(){let S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;return X5(S,l)},w=function(){let S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;X5(S,l),nF(S)};fs.set(l,{keydownListener:x,keyupListenr:w,capture:m}),ag(l,"keydown",x,m),ag(l,"keyup",w,m)}if(!eu){const x=()=>{Ht=[]};eu={listener:x,capture:m},ag(window,"focus",x,m)}}}function rF(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(Zt).forEach(n=>{Zt[n].filter(a=>a.scope===e&&a.shortcut===t).forEach(a=>{a&&a.method&&a.method()})})}function wy(t){const e=Object.values(Zt).flat();if(e.findIndex(r=>{let{element:a}=r;return a===t})<0){const{keydownListener:r,keyupListenr:a,capture:i}=fs.get(t)||{};r&&a&&(Ic(t,"keyup",a,i),Ic(t,"keydown",r,i),fs.delete(t))}if((e.length<=0||fs.size<=0)&&(Object.keys(fs).forEach(a=>{const{keydownListener:i,keyupListenr:l,capture:c}=fs.get(a)||{};i&&l&&(Ic(a,"keyup",l,c),Ic(a,"keydown",i,c),fs.delete(a))}),fs.clear(),Object.keys(Zt).forEach(a=>delete Zt[a]),eu)){const{listener:a,capture:i}=eu;Ic(window,"focus",a,i),eu=null}}const sg={getPressedKeyString:X$,setScope:LS,getScope:gu,deleteScope:tF,getPressedKeyCodes:Z$,getAllKeyCodes:Q$,isPressed:eF,filter:J$,trigger:rF,unbind:jS,keyMap:mu,modifier:ga,modifierMap:Hc};for(const t in sg)Object.prototype.hasOwnProperty.call(sg,t)&&(ta[t]=sg[t]);if(typeof window<"u"){const t=window.hotkeys;ta.noConflict=e=>(e&&window.hotkeys===ta&&(window.hotkeys=t),ta),window.hotkeys=ta}var ig;const aF=typeof window<"u"&&(!((ig=window==null?void 0:window.document)===null||ig===void 0)&&ig.createElement)?N.useLayoutEffect:N.useEffect,il=t=>{const e=N.useRef(t);e.current=N.useMemo(()=>t,[t]);const n=N.useRef();return n.current||(n.current=(function(...r){var a;return(a=e.current)===null||a===void 0?void 0:a.apply(this,r)})),n.current},sF=({disable:t})=>{const e=N.useRef({x:0,y:0}),n=r=>{e.current.x=r.clientX,e.current.y=r.clientY};return N.useEffect(()=>(t||document.addEventListener("mousemove",n,!0),()=>{document.removeEventListener("mousemove",n,!0)}),[t]),e};class iF{constructor(e,n){Object.defineProperty(this,"node",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"border",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"padding",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"content",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.node=e.createElement("div"),this.border=e.createElement("div"),this.padding=e.createElement("div"),this.content=e.createElement("div"),this.border.style.borderColor=x0.border,this.padding.style.borderColor=x0.padding,this.content.style.backgroundColor=x0.background,Object.assign(this.node.style,{borderColor:x0.margin,pointerEvents:"none",position:"fixed"}),this.node.style.zIndex="10000000",this.node.appendChild(this.border),this.border.appendChild(this.padding),this.padding.appendChild(this.content),n.prepend(this.node)}remove(){this.node.parentNode&&this.node.parentNode.removeChild(this.node)}update(e,n){og(n,"margin",this.node),og(n,"border",this.border),og(n,"padding",this.padding),Object.assign(this.content.style,{height:`${e.height-n.borderTop-n.borderBottom-n.paddingTop-n.paddingBottom}px`,width:`${e.width-n.borderLeft-n.borderRight-n.paddingLeft-n.paddingRight}px`}),Object.assign(this.node.style,{top:`${e.top-n.marginTop}px`,left:`${e.left-n.marginLeft}px`})}}class oF{constructor(e,n){Object.defineProperty(this,"tip",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"nameSpan",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"titleDiv",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"infoDiv",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"dimSpan",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.tip=e.createElement("div"),Object.assign(this.tip.style,{display:"flex",flexFlow:"row nowrap",alignItems:"center",backgroundColor:"#333740",borderRadius:"2px",fontFamily:'"SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace',fontWeight:"bold",padding:"6px 8px",pointerEvents:"none",position:"fixed",fontSize:"12px",whiteSpace:"nowrap"}),this.nameSpan=e.createElement("span"),this.tip.appendChild(this.nameSpan),Object.assign(this.nameSpan.style,{display:"flex",flexDirection:"column",borderRight:"1px solid #aaaaaa",paddingRight:"0.8rem",marginRight:"0.8rem"}),this.titleDiv=e.createElement("div"),this.nameSpan.appendChild(this.titleDiv),Object.assign(this.titleDiv.style,{color:"#ee78e6",fontSize:"16px"}),this.infoDiv=e.createElement("div"),this.nameSpan.appendChild(this.infoDiv),Object.assign(this.infoDiv.style,{color:"#ee78e6",fontSize:"14px"}),this.dimSpan=e.createElement("span"),this.tip.appendChild(this.dimSpan),Object.assign(this.dimSpan.style,{color:"#d7d7d7"}),this.tip.style.zIndex="10000000",n.appendChild(this.tip)}remove(){this.tip.parentNode&&this.tip.parentNode.removeChild(this.tip)}updateText(e,n,r,a){this.titleDiv.textContent=e,this.infoDiv.textContent=n??"",this.dimSpan.textContent=`${Math.round(r)}px × ${Math.round(a)}px`}updatePosition(e,n){const r=this.tip.getBoundingClientRect(),a=cF(e,n,{width:r.width,height:r.height});Object.assign(this.tip.style,a.style)}}class lF{constructor(){Object.defineProperty(this,"window",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tipBoundsWindow",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tip",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"rects",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"removeCallback",{enumerable:!0,configurable:!0,writable:!0,value:void 0});const e=window.__REACT_DEVTOOLS_TARGET_WINDOW__||window;this.window=e;const n=window.__REACT_DEVTOOLS_TARGET_WINDOW__||window;this.tipBoundsWindow=n;const r=e.document;this.container=r.createElement("div"),this.container.style.zIndex="10000000",this.tip=new oF(r,this.container),this.rects=[],this.removeCallback=()=>{},r.body.appendChild(this.container)}remove(){this.tip.remove(),this.rects.forEach(e=>{e.remove()}),this.rects.length=0,this.container.parentNode&&this.container.parentNode.removeChild(this.container),this.removeCallback()}setRemoveCallback(e){this.removeCallback=e.bind(this)}inspect(e,n,r){var a;const i=e.filter(d=>d.nodeType===Node.ELEMENT_NODE);for(;this.rects.length>i.length;){const d=this.rects.pop();d==null||d.remove()}if(i.length===0)return;for(;this.rects.length<i.length;)this.rects.push(new iF(this.window.document,this.container));const l={top:Number.POSITIVE_INFINITY,right:Number.NEGATIVE_INFINITY,bottom:Number.NEGATIVE_INFINITY,left:Number.POSITIVE_INFINITY};if(i.forEach((d,h)=>{const p=W5(d,this.window),m=U$(d);l.top=Math.min(l.top,p.top-m.marginTop),l.right=Math.max(l.right,p.left+p.width+m.marginRight),l.bottom=Math.max(l.bottom,p.top+p.height+m.marginBottom),l.left=Math.min(l.left,p.left-m.marginLeft),this.rects[h].update(p,m)}),!n){n=i[0].nodeName.toLowerCase();const d=i[0],h=(a=d.ownerDocument.defaultView)===null||a===void 0?void 0:a.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(h!=null&&h.rendererInterfaces){let p=null;for(const m of h.rendererInterfaces.values()){const b=m.getFiberIDForNative(d,!0);if(b!==null){p=m.getDisplayNameForFiberID(b,!0);break}}p&&(n+=` (in ${p})`)}}this.tip.updateText(n,r,l.right-l.left,l.bottom-l.top);const c=W5(this.tipBoundsWindow.document.documentElement,this.window);this.tip.updatePosition({top:l.top,left:l.left,height:l.bottom-l.top,width:l.right-l.left},{top:c.top+this.tipBoundsWindow.scrollY,left:c.left+this.tipBoundsWindow.scrollX,height:this.tipBoundsWindow.innerHeight,width:this.tipBoundsWindow.innerWidth})}}function cF(t,e,n){const r=Math.max(n.height,20),a=Math.max(n.width,60),i=5;let l;t.top+t.height+r<=e.top+e.height?t.top+t.height<e.top+0?l=e.top+i:l=t.top+t.height+i:t.top-r<=e.top+e.height?t.top-r-i<e.top+i?l=e.top+i:l=t.top-r-i:l=e.top+e.height-r-i;let c=t.left+i;return t.left<e.left&&(c=e.left+i),t.left+a>e.left+e.width&&(c=e.left+e.width-a-i),{style:{top:`${l}px`,left:`${c}px`}}}function og(t,e,n){Object.assign(n.style,{borderTopWidth:`${t[`${e}Top`]}px`,borderLeftWidth:`${t[`${e}Left`]}px`,borderRightWidth:`${t[`${e}Right`]}px`,borderBottomWidth:`${t[`${e}Bottom`]}px`,borderStyle:"solid"})}const x0={background:"rgba(120, 170, 210, 0.7)",padding:"rgba(77, 200, 0, 0.3)",margin:"rgba(255, 155, 0, 0.3)",border:"rgba(255, 200, 50, 0.3)"},uF=()=>{var t;return!((t=navigator.platform)===null||t===void 0)&&t.startsWith("Mac")?["Ctrl","Shift","Command","C"]:["Ctrl","Shift","Alt","C"]},dF=t=>{const{keys:e,onHoverElement:n,onClickElement:r,onInspectElement:a,active:i,onActiveChange:l,disableLaunchEditor:c,disable:d=!0,children:h}=t,[p,m]=N.useState(i??!1);aF(()=>{i!==void 0&&m(i)},[i]),N.useEffect(()=>(p?A():T(),T),[p]);const b=e===null?null:(e??[]).join("+"),x=N.useRef(),w=sF({disable:d}),S=il(()=>{l==null||l(!0),i===void 0&&m(!0)}),E=il(()=>{l==null||l(!1),i===void 0&&m(!1)}),A=il(()=>{if(x.current||d)return;const B=new lF;x.current=B,ta("esc",E);const I=L$({onPointerOver:D,onClick:M});B.setRemoveCallback(I);const U=w.current,W=document.elementFromPoint(U.x,U.y);W&&D(W)}),T=il(()=>{var B;(B=x.current)===null||B===void 0||B.remove(),x.current=void 0,ta.unbind("esc",E)}),D=il(B=>{var I;const U=x.current,W=q5(B),Y=W==null?void 0:W.relativePath,oe=W==null?void 0:W.absolutePath,{fiber:ae,name:V,title:he}=V5(B);(I=U==null?void 0:U.inspect)===null||I===void 0||I.call(U,[B],he,Y??oe),n==null||n({element:B,fiber:ae,codeInfo:W,name:V})}),M=il(B=>{E();const I=q5(B),{fiber:U,name:W}=V5(B);r==null||r({element:B,fiber:U,codeInfo:I,name:W}),U&&I&&(a==null||a({element:B,fiber:U,codeInfo:I,name:W}),!a&&!c&&V$(I))});return N.useEffect(()=>{const B=()=>{x.current?E():S()},I=b===null||d?null:b||uF().join("+");if(I)return ta(I,B),()=>{ta.unbind(I,B)}},[b,d]),g.jsx(g.Fragment,{children:h??null})};function fF(){const[t,e]=N.useState(!1),{t:n}=tt();return N.useEffect(()=>{const r=a=>{a.ctrlKey&&a.shiftKey&&a.altKey&&(a.key==="c"||a.key==="C")&&(a.preventDefault(),e(i=>!i))};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[]),g.jsxs(g.Fragment,{children:[g.jsx(dF,{active:t,onActiveChange:e}),g.jsx("button",{onClick:()=>e(r=>!r),title:n(t?"toast.inspectorOff":"toast.inspectorOn"),style:{position:"fixed",bottom:"20px",right:"20px",zIndex:99999,width:"44px",height:"44px",borderRadius:"50%",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"20px",boxShadow:"0 2px 12px rgba(0,0,0,0.25)",transition:"all 0.2s ease",background:t?"#22c55e":"#1e293b",color:"#fff"},children:g.jsxs("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[g.jsx("circle",{cx:"12",cy:"12",r:"3"}),g.jsx("path",{d:"M22 12c0 5.52-4.48 10-10 10S2 17.52 2 12 6.48 2 12 2s10 4.48 10 10z"}),g.jsx("path",{d:"M12 2v20"}),g.jsx("path",{d:"M2 12h20"})]})})]})}X_.createRoot(document.getElementById("root")).render(g.jsxs(G_.StrictMode,{children:[g.jsx(fF,{}),g.jsx(O$,{})]}));export{kF as $,w0 as A,S5 as B,MF as C,KI as D,vF as E,$z as F,Ym as G,_T as H,AP as I,dl as J,st as K,Fe as L,Gf as M,PF as N,zF as O,CF as P,Qz as Q,OF as R,xF as S,b1 as T,f$ as U,$F as V,wF as W,PT as X,BE as Y,g$ as Z,j as _,ct as a,LF as a0,SF as a1,L3 as a2,ot as a3,Jc as a4,S1 as a5,TS as a6,_z as a7,IF as a8,BF as a9,jF as aa,B5 as ab,Q as ac,pl as b,Zr as c,ut as d,Fj as e,Dc as f,cf as g,hz as h,Cl as i,DF as j,hs as k,EF as l,RF as m,rB as n,q0 as o,eB as p,nB as q,NF as r,tB as s,mt as t,tt as u,wi as v,Oe as w,Be as x,oB as y,_F as z};