@moonshot-ai/kimi-code 0.19.2 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.mjs +5348 -883
- package/dist-web/assets/{CodeBlockNode-DWqdMrZf.js → CodeBlockNode-CaV-jku-.js} +1 -1
- package/dist-web/assets/{CodeBlockShell.vue_vue_type_style_index_0_lang-CP8vJ_jY.js → CodeBlockShell.vue_vue_type_style_index_0_lang-D2LMLnjQ.js} +1 -1
- package/dist-web/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- package/dist-web/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- package/dist-web/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- package/dist-web/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- package/dist-web/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- package/dist-web/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- package/dist-web/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- package/dist-web/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- package/dist-web/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- package/dist-web/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- package/dist-web/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- package/dist-web/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- package/dist-web/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- package/dist-web/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- package/dist-web/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- package/dist-web/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- package/dist-web/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- package/dist-web/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- package/dist-web/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- package/dist-web/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- package/dist-web/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- package/dist-web/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- package/dist-web/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- package/dist-web/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- package/dist-web/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- package/dist-web/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- package/dist-web/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- package/dist-web/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- package/dist-web/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- package/dist-web/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- package/dist-web/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- package/dist-web/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- package/dist-web/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- package/dist-web/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- package/dist-web/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- package/dist-web/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- package/dist-web/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- package/dist-web/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- package/dist-web/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- package/dist-web/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- package/dist-web/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- package/dist-web/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- package/dist-web/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- package/dist-web/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- package/dist-web/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- package/dist-web/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- package/dist-web/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- package/dist-web/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- package/dist-web/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- package/dist-web/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- package/dist-web/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- package/dist-web/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- package/dist-web/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- package/dist-web/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- package/dist-web/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- package/dist-web/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- package/dist-web/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- package/dist-web/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- package/dist-web/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- package/dist-web/assets/{Tooltip-DnT9F5O4.js → Tooltip-BkDnpjpB.js} +1 -1
- package/dist-web/assets/{arc-BTqlVy62.js → arc-BpCxx-Lm.js} +1 -1
- package/dist-web/assets/{architectureDiagram-3BPJPVTR-DOs258PA.js → architectureDiagram-3BPJPVTR-BUzyMdWP.js} +1 -1
- package/dist-web/assets/{blockDiagram-GPEHLZMM-YpbL-evQ.js → blockDiagram-GPEHLZMM-BUkuE4Df.js} +1 -1
- package/dist-web/assets/{c4Diagram-AAUBKEIU-BQ0g7h08.js → c4Diagram-AAUBKEIU-Cyx2I5NF.js} +1 -1
- package/dist-web/assets/channel-BPMCBZZJ.js +1 -0
- package/dist-web/assets/{chunk-2J33WTMH-nYkFiTji.js → chunk-2J33WTMH-D1yizOHn.js} +1 -1
- package/dist-web/assets/{chunk-4BX2VUAB-CsmhqO62.js → chunk-4BX2VUAB-Dh0raYq6.js} +1 -1
- package/dist-web/assets/{chunk-55IACEB6-CUzTYEsP.js → chunk-55IACEB6-BEhXMK8a.js} +1 -1
- package/dist-web/assets/{chunk-727SXJPM-BnqEbbXJ.js → chunk-727SXJPM-DNNSkr-u.js} +1 -1
- package/dist-web/assets/{chunk-AQP2D5EJ-DtZARgEl.js → chunk-AQP2D5EJ-BdIEtlnn.js} +1 -1
- package/dist-web/assets/{chunk-FMBD7UC4-R7lWfBOs.js → chunk-FMBD7UC4-CkJ1iFLI.js} +1 -1
- package/dist-web/assets/{chunk-ND2GUHAM-CZaX1ZXe.js → chunk-ND2GUHAM-BHPtuSG5.js} +1 -1
- package/dist-web/assets/{chunk-QZHKN3VN-5MXrqfJe.js → chunk-QZHKN3VN-CkJm98VG.js} +1 -1
- package/dist-web/assets/classDiagram-4FO5ZUOK-JXNmNMT4.js +1 -0
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-JXNmNMT4.js +1 -0
- package/dist-web/assets/{cose-bilkent-S5V4N54A-4f-2zAe6.js → cose-bilkent-S5V4N54A-x5W3gqTd.js} +1 -1
- package/dist-web/assets/{dagre-BM42HDAG-B29IUQLO.js → dagre-BM42HDAG-eSRg4w-M.js} +1 -1
- package/dist-web/assets/{diagram-2AECGRRQ-BLG8l-kW.js → diagram-2AECGRRQ-Cifjip15.js} +1 -1
- package/dist-web/assets/{diagram-5GNKFQAL-D49xpQ0V.js → diagram-5GNKFQAL-DLv5M6zi.js} +1 -1
- package/dist-web/assets/{diagram-KO2AKTUF-CWBzbQ3X.js → diagram-KO2AKTUF-DlsIZYaS.js} +1 -1
- package/dist-web/assets/{diagram-LMA3HP47-CAcmX_XH.js → diagram-LMA3HP47-CbDbbTBN.js} +1 -1
- package/dist-web/assets/{diagram-OG6HWLK6-BInwpJw8.js → diagram-OG6HWLK6-DmIs02eE.js} +1 -1
- package/dist-web/assets/{erDiagram-TEJ5UH35-Dckcr1cP.js → erDiagram-TEJ5UH35-DKiJXrkX.js} +1 -1
- package/dist-web/assets/{flowDiagram-I6XJVG4X-CjWyYa_0.js → flowDiagram-I6XJVG4X-Diwcs-TL.js} +1 -1
- package/dist-web/assets/{ganttDiagram-6RSMTGT7-B8-b8RY7.js → ganttDiagram-6RSMTGT7-C1Z7ZuXq.js} +1 -1
- package/dist-web/assets/{gitGraphDiagram-PVQCEYII-DF8nQ36i.js → gitGraphDiagram-PVQCEYII-zAnihooO.js} +1 -1
- package/dist-web/assets/index-CytBc_Au.css +1 -0
- package/dist-web/assets/index-DsKglRi9.js +273 -0
- package/dist-web/assets/{index-CKGltB1b.js → index-MiWa00oP.js} +2 -2
- package/dist-web/assets/{index-Zbw78XRh.js → index-sGTig1yI.js} +1 -1
- package/dist-web/assets/{index10-Dh4SYXXK.js → index10-D-oYkFkv.js} +1 -1
- package/dist-web/assets/{index11-BIywvtHR.js → index11-BZ-VpLJZ.js} +2 -2
- package/dist-web/assets/{index5-C_80WRqf.js → index5-BHU3YSPN.js} +1 -1
- package/dist-web/assets/{index6-kJ6dO27T.js → index6-DktmVOWV.js} +1 -1
- package/dist-web/assets/{index7-Zg1vvU3j.js → index7-5thVZydO.js} +1 -1
- package/dist-web/assets/{index8-Bqtk0wsj.js → index8-oLPFpvcC.js} +2 -2
- package/dist-web/assets/{infoDiagram-5YYISTIA-m1Ft7ptD.js → infoDiagram-5YYISTIA-CTtKRrDv.js} +1 -1
- package/dist-web/assets/{ishikawaDiagram-YF4QCWOH-Cqe15rN3.js → ishikawaDiagram-YF4QCWOH-CpeSKUEO.js} +1 -1
- package/dist-web/assets/{journeyDiagram-JHISSGLW-2vdQK870.js → journeyDiagram-JHISSGLW-CqozeoGf.js} +1 -1
- package/dist-web/assets/{kanban-definition-UN3LZRKU-DWcbYK3Y.js → kanban-definition-UN3LZRKU-D8fkRjdV.js} +1 -1
- package/dist-web/assets/{linear-DEB4_JxQ.js → linear-CcasoJPT.js} +1 -1
- package/dist-web/assets/{mermaid.core-Bo4PXwhd.js → mermaid.core-DQW_ubr6.js} +4 -4
- package/dist-web/assets/{mindmap-definition-RKZ34NQL-xhnv3DGe.js → mindmap-definition-RKZ34NQL-Ds4S3Jr8.js} +1 -1
- package/dist-web/assets/{pieDiagram-4H26LBE5-Kf-4wCvB.js → pieDiagram-4H26LBE5-B6flMWC0.js} +1 -1
- package/dist-web/assets/{quadrantDiagram-W4KKPZXB-CoEDvyN3.js → quadrantDiagram-W4KKPZXB-Dp7Mce_9.js} +1 -1
- package/dist-web/assets/{requirementDiagram-4Y6WPE33-C02xoAKl.js → requirementDiagram-4Y6WPE33-POD8vh5c.js} +1 -1
- package/dist-web/assets/{sankeyDiagram-5OEKKPKP-Cta2--lY.js → sankeyDiagram-5OEKKPKP-DPTFBsjO.js} +1 -1
- package/dist-web/assets/{sequenceDiagram-3UESZ5HK-BGHuv-fJ.js → sequenceDiagram-3UESZ5HK-D7J9QzqQ.js} +1 -1
- package/dist-web/assets/{stateDiagram-AJRCARHV-CvYSand1.js → stateDiagram-AJRCARHV-BPCTy0Vu.js} +1 -1
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU-CJbfs5Xz.js +1 -0
- package/dist-web/assets/{timeline-definition-PNZ67QCA-Puu2_su-.js → timeline-definition-PNZ67QCA-CjYdXq94.js} +1 -1
- package/dist-web/assets/{vennDiagram-CIIHVFJN-C5KnFfg1.js → vennDiagram-CIIHVFJN-DopODwti.js} +1 -1
- package/dist-web/assets/{vue.runtime.esm-bundler-Cqjpm82Q.js → vue.runtime.esm-bundler-HPT0I7TD.js} +1 -1
- package/dist-web/assets/{wardley-L42UT6IY-B56jdDEk.js → wardley-L42UT6IY-t4Clap_T.js} +1 -1
- package/dist-web/assets/{wardleyDiagram-YWT4CUSO-C5uByZfn.js → wardleyDiagram-YWT4CUSO-DT5OKzVz.js} +1 -1
- package/dist-web/assets/{xychartDiagram-2RQKCTM6-NW-h6Ru2.js → xychartDiagram-2RQKCTM6-BePku_Rt.js} +1 -1
- package/dist-web/index.html +2 -2
- package/package.json +7 -7
- package/dist-web/assets/channel-C9wJxpza.js +0 -1
- package/dist-web/assets/classDiagram-4FO5ZUOK-DqgKlhvP.js +0 -1
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-DqgKlhvP.js +0 -1
- package/dist-web/assets/index-DSjuug95.js +0 -272
- package/dist-web/assets/index-sXB6HLvC.css +0 -1
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU-CvSckOje.js +0 -1
|
@@ -1,272 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mhchem-KEf2LMH_.js","assets/katex-HP8lGamR.js","assets/CodeBlockNode-DWqdMrZf.js","assets/safeRaf-DGuzXxDK.js","assets/CodeBlockShell.vue_vue_type_style_index_0_lang-CP8vJ_jY.js","assets/index8-Bqtk0wsj.js","assets/index11-BIywvtHR.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const r of i.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&s(r)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();/**
|
|
3
|
-
* @vue/shared v3.5.35
|
|
4
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
5
|
-
* @license MIT
|
|
6
|
-
**/function Wf(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const $t={},Gl=[],Eo=()=>{},y2=()=>!1,Jc=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Uf=e=>e.startsWith("onUpdate:"),en=Object.assign,y1=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},tA=Object.prototype.hasOwnProperty,Vt=(e,t)=>tA.call(e,t),dt=Array.isArray,Yl=e=>ya(e)==="[object Map]",cl=e=>ya(e)==="[object Set]",vy=e=>ya(e)==="[object Date]",nA=e=>ya(e)==="[object RegExp]",_t=e=>typeof e=="function",sn=e=>typeof e=="string",ro=e=>typeof e=="symbol",Kt=e=>e!==null&&typeof e=="object",k1=e=>(Kt(e)||_t(e))&&_t(e.then)&&_t(e.catch),k2=Object.prototype.toString,ya=e=>k2.call(e),sA=e=>ya(e).slice(8,-1),qf=e=>ya(e)==="[object Object]",jf=e=>sn(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,tl=Wf(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),zf=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},oA=/-\w/g,Gn=zf(e=>e.replace(oA,t=>t.slice(1).toUpperCase())),iA=/\B([A-Z])/g,Rs=zf(e=>e.replace(iA,"-$1").toLowerCase()),Vf=zf(e=>e.charAt(0).toUpperCase()+e.slice(1)),yd=zf(e=>e?`on${Vf(e)}`:""),is=(e,t)=>!Object.is(e,t),Xl=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},b2=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},Kf=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Dd=e=>{const t=sn(e)?Number(e):NaN;return isNaN(t)?e:t};let yy;const Gf=()=>yy||(yy=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),rA="Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol",lA=Wf(rA);function Ft(e){if(dt(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],o=sn(s)?dA(s):Ft(s);if(o)for(const i in o)t[i]=o[i]}return t}else if(sn(e)||Kt(e))return e}const aA=/;(?![^(]*\))/g,cA=/:([^]+)/,uA=/\/\*[^]*?\*\//g;function dA(e){const t={};return e.replace(uA,"").split(aA).forEach(n=>{if(n){const s=n.split(cA);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function Ie(e){let t="";if(sn(e))t=e;else if(dt(e))for(let n=0;n<e.length;n++){const s=Ie(e[n]);s&&(t+=s+" ")}else if(Kt(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function Ede(e){if(!e)return null;let{class:t,style:n}=e;return t&&!sn(t)&&(e.class=Ie(t)),n&&(e.style=Ft(n)),e}const fA="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",hA=Wf(fA);function _2(e){return!!e||e===""}function pA(e,t){if(e.length!==t.length)return!1;let n=!0;for(let s=0;n&&s<e.length;s++)n=Ii(e[s],t[s]);return n}function Ii(e,t){if(e===t)return!0;let n=vy(e),s=vy(t);if(n||s)return n&&s?e.getTime()===t.getTime():!1;if(n=ro(e),s=ro(t),n||s)return e===t;if(n=dt(e),s=dt(t),n||s)return n&&s?pA(e,t):!1;if(n=Kt(e),s=Kt(t),n||s){if(!n||!s)return!1;const o=Object.keys(e).length,i=Object.keys(t).length;if(o!==i)return!1;for(const r in e){const l=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(l&&!a||!l&&a||!Ii(e[r],t[r]))return!1}}return String(e)===String(t)}function Yf(e,t){return e.findIndex(n=>Ii(n,t))}const w2=e=>!!(e&&e.__v_isRef===!0),L=e=>sn(e)?e:e==null?"":dt(e)||Kt(e)&&(e.toString===k2||!_t(e.toString))?w2(e)?L(e.value):JSON.stringify(e,S2,2):String(e),S2=(e,t)=>w2(t)?S2(e,t.value):Yl(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,o],i)=>(n[Pp(s,i)+" =>"]=o,n),{})}:cl(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Pp(n))}:ro(t)?Pp(t):Kt(t)&&!dt(t)&&!qf(t)?String(t):t,Pp=(e,t="")=>{var n;return ro(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};function mA(e){return e==null?"initial":typeof e=="string"?e===""?" ":e:String(e)}/**
|
|
7
|
-
* @vue/reactivity v3.5.35
|
|
8
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
9
|
-
* @license MIT
|
|
10
|
-
**/let Kn;class C2{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&Kn&&(Kn.active?(this.parent=Kn,this.index=(Kn.scopes||(Kn.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].pause();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].resume();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].resume()}}run(t){if(this._active){const n=Kn;try{return Kn=this,t()}finally{Kn=n}}}on(){++this._on===1&&(this.prevScope=Kn,Kn=this)}off(){if(this._on>0&&--this._on===0){if(Kn===this)Kn=this.prevScope;else{let t=Kn;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,s;for(n=0,s=this.effects.length;n<s;n++)this.effects[n].stop();for(this.effects.length=0,n=0,s=this.cleanups.length;n<s;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,s=this.scopes.length;n<s;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const o=this.parent.scopes.pop();o&&o!==this&&(this.parent.scopes[this.index]=o,o.index=this.index)}this.parent=void 0}}}function gA(e){return new C2(e)}function b1(){return Kn}function _1(e,t=!1){Kn&&Kn.cleanups.push(e)}let un;const Rp=new WeakSet;class Bd{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Kn&&(Kn.active?Kn.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Rp.has(this)&&(Rp.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||T2(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,ky(this),M2(this);const t=un,n=Uo;un=this,Uo=!0;try{return this.fn()}finally{A2(this),un=t,Uo=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)C1(t);this.deps=this.depsTail=void 0,ky(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Rp.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Gm(this)&&this.run()}get dirty(){return Gm(this)}}let x2=0,hc,pc;function T2(e,t=!1){if(e.flags|=8,t){e.next=pc,pc=e;return}e.next=hc,hc=e}function w1(){x2++}function S1(){if(--x2>0)return;if(pc){let t=pc;for(pc=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;hc;){let t=hc;for(hc=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}function M2(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function A2(e){let t,n=e.depsTail,s=n;for(;s;){const o=s.prevDep;s.version===-1?(s===n&&(n=o),C1(s),vA(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=o}e.deps=t,e.depsTail=n}function Gm(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(E2(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function E2(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Ec)||(e.globalVersion=Ec,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Gm(e))))return;e.flags|=2;const t=e.dep,n=un,s=Uo;un=e,Uo=!0;try{M2(e);const o=e.fn(e._value);(t.version===0||is(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{un=n,Uo=s,A2(e),e.flags&=-3}}function C1(e,t=!1){const{dep:n,prevSub:s,nextSub:o}=e;if(s&&(s.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=s,e.nextSub=void 0),n.subs===e&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)C1(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function vA(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function Ide(e,t){e.effect instanceof Bd&&(e=e.effect.fn);const n=new Bd(e);t&&en(n,t);try{n.run()}catch(o){throw n.stop(),o}const s=n.run.bind(n);return s.effect=n,s}function $de(e){e.effect.stop()}let Uo=!0;const I2=[];function $i(){I2.push(Uo),Uo=!1}function Ni(){const e=I2.pop();Uo=e===void 0?!0:e}function ky(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=un;un=void 0;try{t()}finally{un=n}}}let Ec=0;class yA{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Xf{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!un||!Uo||un===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==un)n=this.activeLink=new yA(un,this),un.deps?(n.prevDep=un.depsTail,un.depsTail.nextDep=n,un.depsTail=n):un.deps=un.depsTail=n,$2(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=un.depsTail,n.nextDep=void 0,un.depsTail.nextDep=n,un.depsTail=n,un.deps===n&&(un.deps=s)}return n}trigger(t){this.version++,Ec++,this.notify(t)}notify(t){w1();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{S1()}}}function $2(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)$2(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Fd=new WeakMap,nl=Symbol(""),Ym=Symbol(""),Ic=Symbol("");function ms(e,t,n){if(Uo&&un){let s=Fd.get(e);s||Fd.set(e,s=new Map);let o=s.get(n);o||(s.set(n,o=new Xf),o.map=s,o.key=n),o.track()}}function Si(e,t,n,s,o,i){const r=Fd.get(e);if(!r){Ec++;return}const l=a=>{a&&a.trigger()};if(w1(),t==="clear")r.forEach(l);else{const a=dt(e),c=a&&jf(n);if(a&&n==="length"){const u=Number(s);r.forEach((d,h)=>{(h==="length"||h===Ic||!ro(h)&&h>=u)&&l(d)})}else switch((n!==void 0||r.has(void 0))&&l(r.get(n)),c&&l(r.get(Ic)),t){case"add":a?c&&l(r.get("length")):(l(r.get(nl)),Yl(e)&&l(r.get(Ym)));break;case"delete":a||(l(r.get(nl)),Yl(e)&&l(r.get(Ym)));break;case"set":Yl(e)&&l(r.get(nl));break}}S1()}function kA(e,t){const n=Fd.get(e);return n&&n.get(t)}function El(e){const t=Bt(e);return t===e?t:(ms(t,"iterate",Ic),eo(e)?t:t.map(qo))}function Zf(e){return ms(e=Bt(e),"iterate",Ic),e}function si(e,t){return Li(e)?da(fr(e)?qo(t):t):qo(t)}const bA={__proto__:null,[Symbol.iterator](){return Dp(this,Symbol.iterator,e=>si(this,e))},concat(...e){return El(this).concat(...e.map(t=>dt(t)?El(t):t))},entries(){return Dp(this,"entries",e=>(e[1]=si(this,e[1]),e))},every(e,t){return yi(this,"every",e,t,void 0,arguments)},filter(e,t){return yi(this,"filter",e,t,n=>n.map(s=>si(this,s)),arguments)},find(e,t){return yi(this,"find",e,t,n=>si(this,n),arguments)},findIndex(e,t){return yi(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return yi(this,"findLast",e,t,n=>si(this,n),arguments)},findLastIndex(e,t){return yi(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return yi(this,"forEach",e,t,void 0,arguments)},includes(...e){return Bp(this,"includes",e)},indexOf(...e){return Bp(this,"indexOf",e)},join(e){return El(this).join(e)},lastIndexOf(...e){return Bp(this,"lastIndexOf",e)},map(e,t){return yi(this,"map",e,t,void 0,arguments)},pop(){return Ka(this,"pop")},push(...e){return Ka(this,"push",e)},reduce(e,...t){return by(this,"reduce",e,t)},reduceRight(e,...t){return by(this,"reduceRight",e,t)},shift(){return Ka(this,"shift")},some(e,t){return yi(this,"some",e,t,void 0,arguments)},splice(...e){return Ka(this,"splice",e)},toReversed(){return El(this).toReversed()},toSorted(e){return El(this).toSorted(e)},toSpliced(...e){return El(this).toSpliced(...e)},unshift(...e){return Ka(this,"unshift",e)},values(){return Dp(this,"values",e=>si(this,e))}};function Dp(e,t,n){const s=Zf(e),o=s[t]();return s!==e&&!eo(e)&&(o._next=o.next,o.next=()=>{const i=o._next();return i.done||(i.value=n(i.value)),i}),o}const _A=Array.prototype;function yi(e,t,n,s,o,i){const r=Zf(e),l=r!==e&&!eo(e),a=r[t];if(a!==_A[t]){const d=a.apply(e,i);return l?qo(d):d}let c=n;r!==e&&(l?c=function(d,h){return n.call(this,si(e,d),h,e)}:n.length>2&&(c=function(d,h){return n.call(this,d,h,e)}));const u=a.call(r,c,s);return l&&o?o(u):u}function by(e,t,n,s){const o=Zf(e),i=o!==e&&!eo(e);let r=n,l=!1;o!==e&&(i?(l=s.length===0,r=function(c,u,d){return l&&(l=!1,c=si(e,c)),n.call(this,c,si(e,u),d,e)}):n.length>3&&(r=function(c,u,d){return n.call(this,c,u,d,e)}));const a=o[t](r,...s);return l?si(e,a):a}function Bp(e,t,n){const s=Bt(e);ms(s,"iterate",Ic);const o=s[t](...n);return(o===-1||o===!1)&&eh(n[0])?(n[0]=Bt(n[0]),s[t](...n)):o}function Ka(e,t,n=[]){$i(),w1();const s=Bt(e)[t].apply(e,n);return S1(),Ni(),s}const wA=Wf("__proto__,__v_isRef,__isVue"),N2=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(ro));function SA(e){ro(e)||(e=String(e));const t=Bt(this);return ms(t,"has",e),t.hasOwnProperty(e)}class L2{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){if(n==="__v_skip")return t.__v_skip;const o=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return i;if(n==="__v_raw")return s===(o?i?F2:B2:i?D2:R2).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const r=dt(t);if(!o){let a;if(r&&(a=bA[n]))return a;if(n==="hasOwnProperty")return SA}const l=Reflect.get(t,n,Nn(t)?t:s);if((ro(n)?N2.has(n):wA(n))||(o||ms(t,"get",n),i))return l;if(Nn(l)){const a=r&&jf(n)?l:l.value;return o&&Kt(a)?Hd(a):a}return Kt(l)?o?Hd(l):Js(l):l}}class O2 extends L2{constructor(t=!1){super(!1,t)}set(t,n,s,o){let i=t[n];const r=dt(t)&&jf(n);if(!this._isShallow){const c=Li(i);if(!eo(s)&&!Li(s)&&(i=Bt(i),s=Bt(s)),!r&&Nn(i)&&!Nn(s))return c||(i.value=s),!0}const l=r?Number(n)<t.length:Vt(t,n),a=Reflect.set(t,n,s,Nn(t)?t:o);return t===Bt(o)&&(l?is(s,i)&&Si(t,"set",n,s):Si(t,"add",n,s)),a}deleteProperty(t,n){const s=Vt(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&s&&Si(t,"delete",n,void 0),o}has(t,n){const s=Reflect.has(t,n);return(!ro(n)||!N2.has(n))&&ms(t,"has",n),s}ownKeys(t){return ms(t,"iterate",dt(t)?"length":nl),Reflect.ownKeys(t)}}class P2 extends L2{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const CA=new O2,xA=new P2,TA=new O2(!0),MA=new P2(!0),Xm=e=>e,Bu=e=>Reflect.getPrototypeOf(e);function AA(e,t,n){return function(...s){const o=this.__v_raw,i=Bt(o),r=Yl(i),l=e==="entries"||e===Symbol.iterator&&r,a=e==="keys"&&r,c=o[e](...s),u=n?Xm:t?da:qo;return!t&&ms(i,"iterate",a?Ym:nl),en(Object.create(c),{next(){const{value:d,done:h}=c.next();return h?{value:d,done:h}:{value:l?[u(d[0]),u(d[1])]:u(d),done:h}}})}}function Fu(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function EA(e,t){const n={get(o){const i=this.__v_raw,r=Bt(i),l=Bt(o);e||(is(o,l)&&ms(r,"get",o),ms(r,"get",l));const{has:a}=Bu(r),c=t?Xm:e?da:qo;if(a.call(r,o))return c(i.get(o));if(a.call(r,l))return c(i.get(l));i!==r&&i.get(o)},get size(){const o=this.__v_raw;return!e&&ms(Bt(o),"iterate",nl),o.size},has(o){const i=this.__v_raw,r=Bt(i),l=Bt(o);return e||(is(o,l)&&ms(r,"has",o),ms(r,"has",l)),o===l?i.has(o):i.has(o)||i.has(l)},forEach(o,i){const r=this,l=r.__v_raw,a=Bt(l),c=t?Xm:e?da:qo;return!e&&ms(a,"iterate",nl),l.forEach((u,d)=>o.call(i,c(u),c(d),r))}};return en(n,e?{add:Fu("add"),set:Fu("set"),delete:Fu("delete"),clear:Fu("clear")}:{add(o){const i=Bt(this),r=Bu(i),l=Bt(o),a=!t&&!eo(o)&&!Li(o)?l:o;return r.has.call(i,a)||is(o,a)&&r.has.call(i,o)||is(l,a)&&r.has.call(i,l)||(i.add(a),Si(i,"add",a,a)),this},set(o,i){!t&&!eo(i)&&!Li(i)&&(i=Bt(i));const r=Bt(this),{has:l,get:a}=Bu(r);let c=l.call(r,o);c||(o=Bt(o),c=l.call(r,o));const u=a.call(r,o);return r.set(o,i),c?is(i,u)&&Si(r,"set",o,i):Si(r,"add",o,i),this},delete(o){const i=Bt(this),{has:r,get:l}=Bu(i);let a=r.call(i,o);a||(o=Bt(o),a=r.call(i,o)),l&&l.call(i,o);const c=i.delete(o);return a&&Si(i,"delete",o,void 0),c},clear(){const o=Bt(this),i=o.size!==0,r=o.clear();return i&&Si(o,"clear",void 0,void 0),r}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=AA(o,e,t)}),n}function Jf(e,t){const n=EA(e,t);return(s,o,i)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?s:Reflect.get(Vt(n,o)&&o in s?n:s,o,i)}const IA={get:Jf(!1,!1)},$A={get:Jf(!1,!0)},NA={get:Jf(!0,!1)},LA={get:Jf(!0,!0)},R2=new WeakMap,D2=new WeakMap,B2=new WeakMap,F2=new WeakMap;function OA(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Js(e){return Li(e)?e:Qf(e,!1,CA,IA,R2)}function PA(e){return Qf(e,!1,TA,$A,D2)}function Hd(e){return Qf(e,!0,xA,NA,B2)}function Nde(e){return Qf(e,!0,MA,LA,F2)}function Qf(e,t,n,s,o){if(!Kt(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const i=o.get(e);if(i)return i;const r=OA(sA(e));if(r===0)return e;const l=new Proxy(e,r===2?s:n);return o.set(e,l),l}function fr(e){return Li(e)?fr(e.__v_raw):!!(e&&e.__v_isReactive)}function Li(e){return!!(e&&e.__v_isReadonly)}function eo(e){return!!(e&&e.__v_isShallow)}function eh(e){return e?!!e.__v_raw:!1}function Bt(e){const t=e&&e.__v_raw;return t?Bt(t):e}function cr(e){return!Vt(e,"__v_skip")&&Object.isExtensible(e)&&b2(e,"__v_skip",!0),e}const qo=e=>Kt(e)?Js(e):e,da=e=>Kt(e)?Hd(e):e;function Nn(e){return e?e.__v_isRef===!0:!1}function se(e){return H2(e,!1)}function ul(e){return H2(e,!0)}function H2(e,t){return Nn(e)?e:new RA(e,t)}class RA{constructor(t,n){this.dep=new Xf,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Bt(t),this._value=n?t:qo(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||eo(t)||Li(t);t=s?t:Bt(t),is(t,n)&&(this._rawValue=t,this._value=s?t:qo(t),this.dep.trigger())}}function Lde(e){e.dep&&e.dep.trigger()}function C(e){return Nn(e)?e.value:e}function W2(e){return _t(e)?e():C(e)}const DA={get:(e,t,n)=>t==="__v_raw"?e:C(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const o=e[t];return Nn(o)&&!Nn(n)?(o.value=n,!0):Reflect.set(e,t,n,s)}};function U2(e){return fr(e)?e:new Proxy(e,DA)}class BA{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new Xf,{get:s,set:o}=t(n.track.bind(n),n.trigger.bind(n));this._get=s,this._set=o}get value(){return this._value=this._get()}set value(t){this._set(t)}}function FA(e){return new BA(e)}function Ode(e){const t=dt(e)?new Array(e.length):{};for(const n in e)t[n]=q2(e,n);return t}class HA{constructor(t,n,s){this._object=t,this._defaultValue=s,this.__v_isRef=!0,this._value=void 0,this._key=ro(n)?n:String(n),this._raw=Bt(t);let o=!0,i=t;if(!dt(t)||ro(this._key)||!jf(this._key))do o=!eh(i)||eo(i);while(o&&(i=i.__v_raw));this._shallow=o}get value(){let t=this._object[this._key];return this._shallow&&(t=C(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&Nn(this._raw[this._key])){const n=this._object[this._key];if(Nn(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return kA(this._raw,this._key)}}class WA{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function Pde(e,t,n){return Nn(e)?e:_t(e)?new WA(e):Kt(e)&&arguments.length>1?q2(e,t,n):se(e)}function q2(e,t,n){return new HA(e,t,n)}class UA{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Xf(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Ec-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&un!==this)return T2(this,!0),!0}get value(){const t=this.dep.track();return E2(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function qA(e,t,n=!1){let s,o;return _t(e)?s=e:(s=e.get,o=e.set),new UA(s,o,n)}const Rde={GET:"get",HAS:"has",ITERATE:"iterate"},Dde={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},Hu={},Wd=new WeakMap;let or;function Bde(){return or}function jA(e,t=!1,n=or){if(n){let s=Wd.get(n);s||Wd.set(n,s=[]),s.push(e)}}function zA(e,t,n=$t){const{immediate:s,deep:o,once:i,scheduler:r,augmentJob:l,call:a}=n,c=v=>o?v:eo(v)||o===!1||o===0?Ci(v,1):Ci(v);let u,d,h,p,f=!1,g=!1;if(Nn(e)?(d=()=>e.value,f=eo(e)):fr(e)?(d=()=>c(e),f=!0):dt(e)?(g=!0,f=e.some(v=>fr(v)||eo(v)),d=()=>e.map(v=>{if(Nn(v))return v.value;if(fr(v))return c(v);if(_t(v))return a?a(v,2):v()})):_t(e)?t?d=a?()=>a(e,2):e:d=()=>{if(h){$i();try{h()}finally{Ni()}}const v=or;or=u;try{return a?a(e,3,[p]):e(p)}finally{or=v}}:d=Eo,t&&o){const v=d,_=o===!0?1/0:o;d=()=>Ci(v(),_)}const w=b1(),S=()=>{u.stop(),w&&w.active&&y1(w.effects,u)};if(i&&t){const v=t;t=(..._)=>{v(..._),S()}}let y=g?new Array(e.length).fill(Hu):Hu;const k=v=>{if(!(!(u.flags&1)||!u.dirty&&!v))if(t){const _=u.run();if(o||f||(g?_.some((I,A)=>is(I,y[A])):is(_,y))){h&&h();const I=or;or=u;try{const A=[_,y===Hu?void 0:g&&y[0]===Hu?[]:y,p];y=_,a?a(t,3,A):t(...A)}finally{or=I}}}else u.run()};return l&&l(k),u=new Bd(d),u.scheduler=r?()=>r(k,!1):k,p=v=>jA(v,!1,u),h=u.onStop=()=>{const v=Wd.get(u);if(v){if(a)a(v,4);else for(const _ of v)_();Wd.delete(u)}},t?s?k(!0):y=u.run():r?r(k.bind(null,!0),!0):u.run(),S.pause=u.pause.bind(u),S.resume=u.resume.bind(u),S.stop=S,S}function Ci(e,t=1/0,n){if(t<=0||!Kt(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Nn(e))Ci(e.value,t,n);else if(dt(e))for(let s=0;s<e.length;s++)Ci(e[s],t,n);else if(cl(e)||Yl(e))e.forEach(s=>{Ci(s,t,n)});else if(qf(e)){for(const s in e)Ci(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&Ci(e[s],t,n)}return e}/**
|
|
11
|
-
* @vue/runtime-core v3.5.35
|
|
12
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
13
|
-
* @license MIT
|
|
14
|
-
**/const j2=[];function VA(e){j2.push(e)}function KA(){j2.pop()}function Fde(e,t){}const Hde={SETUP_FUNCTION:0,0:"SETUP_FUNCTION",RENDER_FUNCTION:1,1:"RENDER_FUNCTION",NATIVE_EVENT_HANDLER:5,5:"NATIVE_EVENT_HANDLER",COMPONENT_EVENT_HANDLER:6,6:"COMPONENT_EVENT_HANDLER",VNODE_HOOK:7,7:"VNODE_HOOK",DIRECTIVE_HOOK:8,8:"DIRECTIVE_HOOK",TRANSITION_HOOK:9,9:"TRANSITION_HOOK",APP_ERROR_HANDLER:10,10:"APP_ERROR_HANDLER",APP_WARN_HANDLER:11,11:"APP_WARN_HANDLER",FUNCTION_REF:12,12:"FUNCTION_REF",ASYNC_COMPONENT_LOADER:13,13:"ASYNC_COMPONENT_LOADER",SCHEDULER:14,14:"SCHEDULER",COMPONENT_UPDATE:15,15:"COMPONENT_UPDATE",APP_UNMOUNT_CLEANUP:16,16:"APP_UNMOUNT_CLEANUP"},GA={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function Qc(e,t,n,s){try{return s?e(...s):e()}catch(o){ka(o,t,n)}}function $o(e,t,n,s){if(_t(e)){const o=Qc(e,t,n,s);return o&&k1(o)&&o.catch(i=>{ka(i,t,n)}),o}if(dt(e)){const o=[];for(let i=0;i<e.length;i++)o.push($o(e[i],t,n,s));return o}}function ka(e,t,n,s=!0){const o=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:r}=t&&t.appContext.config||$t;if(t){let l=t.parent;const a=t.proxy,c=`https://vuejs.org/error-reference/#runtime-${n}`;for(;l;){const u=l.ec;if(u){for(let d=0;d<u.length;d++)if(u[d](e,a,c)===!1)return}l=l.parent}if(i){$i(),Qc(i,null,10,[e,a,c]),Ni();return}}YA(e,n,o,s,r)}function YA(e,t,n,s=!0,o=!1){if(o)throw e;console.error(e)}const Ss=[];let ei=-1;const Zl=[];let ir=null,Bl=0;const z2=Promise.resolve();let Ud=null;function vt(e){const t=Ud||z2;return e?t.then(this?e.bind(this):e):t}function XA(e){let t=ei+1,n=Ss.length;for(;t<n;){const s=t+n>>>1,o=Ss[s],i=$c(o);i<e||i===e&&o.flags&2?t=s+1:n=s}return t}function x1(e){if(!(e.flags&1)){const t=$c(e),n=Ss[Ss.length-1];!n||!(e.flags&2)&&t>=$c(n)?Ss.push(e):Ss.splice(XA(t),0,e),e.flags|=1,V2()}}function V2(){Ud||(Ud=z2.then(K2))}function qd(e){dt(e)?Zl.push(...e):ir&&e.id===-1?ir.splice(Bl+1,0,e):e.flags&1||(Zl.push(e),e.flags|=1),V2()}function _y(e,t,n=ei+1){for(;n<Ss.length;n++){const s=Ss[n];if(s&&s.flags&2){if(e&&s.id!==e.uid)continue;Ss.splice(n,1),n--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function jd(e){if(Zl.length){const t=[...new Set(Zl)].sort((n,s)=>$c(n)-$c(s));if(Zl.length=0,ir){ir.push(...t);return}for(ir=t,Bl=0;Bl<ir.length;Bl++){const n=ir[Bl];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}ir=null,Bl=0}}const $c=e=>e.id==null?e.flags&2?-1:1/0:e.id;function K2(e){try{for(ei=0;ei<Ss.length;ei++){const t=Ss[ei];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Qc(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;ei<Ss.length;ei++){const t=Ss[ei];t&&(t.flags&=-2)}ei=-1,Ss.length=0,jd(),Ud=null,(Ss.length||Zl.length)&&K2()}}let Fl,Wu=[];function G2(e,t){var n,s;Fl=e,Fl?(Fl.enabled=!0,Wu.forEach(({event:o,args:i})=>Fl.emit(o,...i)),Wu=[]):typeof window<"u"&&window.HTMLElement&&!((s=(n=window.navigator)==null?void 0:n.userAgent)!=null&&s.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(i=>{G2(i,t)}),setTimeout(()=>{Fl||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Wu=[])},3e3)):Wu=[]}let as=null,th=null;function Nc(e){const t=as;return as=e,th=e&&e.type.__scopeId||null,t}function Wde(e){th=e}function Ude(){th=null}const qde=e=>Mn;function Mn(e,t=as,n){if(!t||e._n)return e;const s=(...o)=>{s._d&&Yd(-1);const i=Nc(t);let r;try{r=e(...o)}finally{Nc(i),s._d&&Yd(1)}return r};return s._n=!0,s._c=!0,s._d=!0,s}function Ot(e,t){if(as===null)return e;const n=su(as),s=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[i,r,l,a=$t]=t[o];i&&(_t(i)&&(i={mounted:i,updated:i}),i.deep&&Ci(r),s.push({dir:i,instance:n,value:r,oldValue:void 0,arg:l,modifiers:a}))}return e}function ni(e,t,n,s){const o=e.dirs,i=t&&t.dirs;for(let r=0;r<o.length;r++){const l=o[r];i&&(l.oldValue=i[r].value);let a=l.dir[s];a&&($i(),$o(a,n,8,[e.el,l,e,t]),Ni())}}function gn(e,t){if(rs){let n=rs.provides;const s=rs.parent&&rs.parent.provides;s===n&&(n=rs.provides=Object.create(s)),n[e]=t}}function Pt(e,t,n=!1){const s=cs();if(s||sl){let o=sl?sl._context.provides:s?s.parent==null||s.ce?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return n&&_t(t)?t.call(s&&s.proxy):t}}function jde(){return!!(cs()||sl)}const ZA=Symbol.for("v-scx"),JA=()=>Pt(ZA);function QA(e,t){return eu(e,null,t)}function zde(e,t){return eu(e,null,{flush:"post"})}function e4(e,t){return eu(e,null,{flush:"sync"})}function Ge(e,t,n){return eu(e,t,n)}function eu(e,t,n=$t){const{immediate:s,deep:o,flush:i,once:r}=n,l=en({},n),a=t&&s||!t&&i!=="post";let c;if(ll){if(i==="sync"){const p=JA();c=p.__watcherHandles||(p.__watcherHandles=[])}else if(!a){const p=()=>{};return p.stop=Eo,p.resume=Eo,p.pause=Eo,p}}const u=rs;l.call=(p,f,g)=>$o(p,u,f,g);let d=!1;i==="post"?l.scheduler=p=>{Pn(p,u&&u.suspense)}:i!=="sync"&&(d=!0,l.scheduler=(p,f)=>{f?p():x1(p)}),l.augmentJob=p=>{t&&(p.flags|=4),d&&(p.flags|=2,u&&(p.id=u.uid,p.i=u))};const h=zA(e,t,l);return ll&&(c?c.push(h):a&&h()),h}function t4(e,t,n){const s=this.proxy,o=sn(e)?e.includes(".")?Y2(s,e):()=>s[e]:e.bind(s,s);let i;_t(t)?i=t:(i=t.handler,n=t);const r=ba(this),l=eu(o,i.bind(s),n);return r(),l}function Y2(e,t){const n=t.split(".");return()=>{let s=e;for(let o=0;o<n.length&&s;o++)s=s[n[o]];return s}}const nr=new WeakMap,X2=Symbol("_vte"),Z2=e=>e.__isTeleport,Gr=e=>e&&(e.disabled||e.disabled===""),n4=e=>e&&(e.defer||e.defer===""),wy=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Sy=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Zm=(e,t)=>{const n=e&&e.to;return sn(n)?t?t(n):null:n},s4={name:"Teleport",__isTeleport:!0,process(e,t,n,s,o,i,r,l,a,c){const{mc:u,pc:d,pbc:h,o:{insert:p,querySelector:f,createText:g,createComment:w,parentNode:S}}=c,y=Gr(t.props);let{dynamicChildren:k}=t;const v=(A,b,M)=>{A.shapeFlag&16&&u(A.children,b,M,o,i,r,l,a)},_=(A=t)=>{const b=Gr(A.props),M=A.target=Zm(A.props,f),N=Jm(M,A,g,p);M&&(r!=="svg"&&wy(M)?r="svg":r!=="mathml"&&Sy(M)&&(r="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(M),b||(v(A,M,N),sc(A,!1)))},I=A=>{const b=()=>{if(nr.get(A)===b){if(nr.delete(A),Gr(A.props)){const M=S(A.el)||n;v(A,M,A.anchor),sc(A,!0)}_(A)}};nr.set(A,b),Pn(b,i)};if(e==null){const A=t.el=g(""),b=t.anchor=g("");if(p(A,n,s),p(b,n,s),n4(t.props)||i&&i.pendingBranch){I(t);return}y&&(v(t,n,b),sc(t,!0)),_()}else{t.el=e.el;const A=t.anchor=e.anchor,b=nr.get(e);if(b){b.flags|=8,nr.delete(e),I(t);return}t.targetStart=e.targetStart;const M=t.target=e.target,N=t.targetAnchor=e.targetAnchor,D=Gr(e.props),$=D?n:M,O=D?A:N;if(r==="svg"||wy(M)?r="svg":(r==="mathml"||Sy(M))&&(r="mathml"),k?(h(e.dynamicChildren,k,$,o,i,r,l),P1(e,t,!0)):a||d(e,t,$,O,o,i,r,l,!1),y)D?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Uu(t,n,A,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const P=t.target=Zm(t.props,f);P&&Uu(t,P,null,c,0)}else D&&Uu(t,M,N,c,1);sc(t,y)}},remove(e,t,n,{um:s,o:{remove:o}},i){const{shapeFlag:r,children:l,anchor:a,targetStart:c,targetAnchor:u,target:d,props:h}=e,p=i||!Gr(h),f=nr.get(e);if(f&&(f.flags|=8,nr.delete(e)),d&&(o(c),o(u)),i&&o(a),!f&&r&16)for(let g=0;g<l.length;g++){const w=l[g];s(w,t,n,p,!!w.dynamicChildren)}},move:Uu,hydrate:o4};function Uu(e,t,n,{o:{insert:s},m:o},i=2){i===0&&s(e.targetAnchor,t,n);const{el:r,anchor:l,shapeFlag:a,children:c,props:u}=e,d=i===2;if(d&&s(r,t,n),!nr.has(e)&&(!d||Gr(u))&&a&16)for(let h=0;h<c.length;h++)o(c[h],t,n,2);d&&s(l,t,n)}function o4(e,t,n,s,o,i,{o:{nextSibling:r,parentNode:l,querySelector:a,insert:c,createText:u}},d){function h(w,S){let y=S;for(;y;){if(y&&y.nodeType===8){if(y.data==="teleport start anchor")t.targetStart=y;else if(y.data==="teleport anchor"){t.targetAnchor=y,w._lpa=t.targetAnchor&&r(t.targetAnchor);break}}y=r(y)}}function p(w,S){S.anchor=d(r(w),S,l(w),n,s,o,i)}const f=t.target=Zm(t.props,a),g=Gr(t.props);if(f){const w=f._lpa||f.firstChild;t.shapeFlag&16&&(g?(p(e,t),h(f,w),t.targetAnchor||Jm(f,t,u,c,l(e)===f?e:null)):(t.anchor=r(e),h(f,w),t.targetAnchor||Jm(f,t,u,c),d(w&&r(w),t,f,n,s,o,i))),sc(t,g)}else g&&t.shapeFlag&16&&(p(e,t),t.targetStart=e,t.targetAnchor=r(e));return t.anchor&&r(t.anchor)}const Vde=s4;function sc(e,t){const n=e.ctx;if(n&&n.ut){let s,o;for(t?(s=e.el,o=e.anchor):(s=e.targetStart,o=e.targetAnchor);s&&s!==o;)s.nodeType===1&&s.setAttribute("data-v-owner",n.uid),s=s.nextSibling;n.ut()}}function Jm(e,t,n,s,o=null){const i=t.targetStart=n(""),r=t.targetAnchor=n("");return i[X2]=r,e&&(s(i,e,o),s(r,e,o)),r}const So=Symbol("_leaveCb"),Ga=Symbol("_enterCb");function J2(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return tn(()=>{e.isMounted=!0}),qs(()=>{e.isUnmounting=!0}),e}const yo=[Function,Array],Q2={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:yo,onEnter:yo,onAfterEnter:yo,onEnterCancelled:yo,onBeforeLeave:yo,onLeave:yo,onAfterLeave:yo,onLeaveCancelled:yo,onBeforeAppear:yo,onAppear:yo,onAfterAppear:yo,onAppearCancelled:yo},eS=e=>{const t=e.subTree;return t.component?eS(t.component):t},i4={name:"BaseTransition",props:Q2,setup(e,{slots:t}){const n=cs(),s=J2();return()=>{const o=t.default&&T1(t.default(),!0),i=o&&o.length?tS(o):n.subTree?le():void 0;if(!i)return;const r=Bt(e),{mode:l}=r;if(s.isLeaving)return Fp(i);const a=Cy(i);if(!a)return Fp(i);let c=Lc(a,r,s,n,d=>c=d);a.type!==Rn&&vr(a,c);let u=n.subTree&&Cy(n.subTree);if(u&&u.type!==Rn&&!Fo(u,a)&&eS(n).type!==Rn){let d=Lc(u,r,s,n);if(vr(u,d),l==="out-in"&&a.type!==Rn)return s.isLeaving=!0,d.afterLeave=()=>{s.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},Fp(i);l==="in-out"&&a.type!==Rn?d.delayLeave=(h,p,f)=>{const g=nS(s,u);g[String(u.key)]=u,h[So]=()=>{p(),h[So]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{f(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return i}}};function tS(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Rn){t=n;break}}return t}const r4=i4;function nS(e,t){const{leavingVNodes:n}=e;let s=n.get(t.type);return s||(s=Object.create(null),n.set(t.type,s)),s}function Lc(e,t,n,s,o){const{appear:i,mode:r,persisted:l=!1,onBeforeEnter:a,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:h,onLeave:p,onAfterLeave:f,onLeaveCancelled:g,onBeforeAppear:w,onAppear:S,onAfterAppear:y,onAppearCancelled:k}=t,v=String(e.key),_=nS(n,e),I=(M,N)=>{M&&$o(M,s,9,N)},A=(M,N)=>{const D=N[1];I(M,N),dt(M)?M.every($=>$.length<=1)&&D():M.length<=1&&D()},b={mode:r,persisted:l,beforeEnter(M){let N=a;if(!n.isMounted)if(i)N=w||a;else return;M[So]&&M[So](!0);const D=_[v];D&&Fo(e,D)&&D.el[So]&&D.el[So](),I(N,[M])},enter(M){if(_[v]===e)return;let N=c,D=u,$=d;if(!n.isMounted)if(i)N=S||c,D=y||u,$=k||d;else return;let O=!1;M[Ga]=R=>{O||(O=!0,R?I($,[M]):I(D,[M]),b.delayedLeave&&b.delayedLeave(),M[Ga]=void 0)};const P=M[Ga].bind(null,!1);N?A(N,[M,P]):P()},leave(M,N){const D=String(e.key);if(M[Ga]&&M[Ga](!0),n.isUnmounting)return N();I(h,[M]);let $=!1;M[So]=P=>{$||($=!0,N(),P?I(g,[M]):I(f,[M]),M[So]=void 0,_[D]===e&&delete _[D])};const O=M[So].bind(null,!1);_[D]=e,p?A(p,[M,O]):O()},clone(M){const N=Lc(M,t,n,s,o);return o&&o(N),N}};return b}function Fp(e){if(tu(e))return e=Oi(e),e.children=null,e}function Cy(e){if(!tu(e))return Z2(e.type)&&e.children?tS(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&_t(n.default))return n.default()}}function vr(e,t){e.shapeFlag&6&&e.component?(e.transition=t,vr(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function T1(e,t=!1,n){let s=[],o=0;for(let i=0;i<e.length;i++){let r=e[i];const l=n==null?r.key:String(n)+String(r.key!=null?r.key:i);r.type===Ne?(r.patchFlag&128&&o++,s=s.concat(T1(r.children,t,l))):(t||r.type!==Rn)&&s.push(l!=null?Oi(r,{key:l}):r)}if(o>1)for(let i=0;i<s.length;i++)s[i].patchFlag=-2;return s}function Je(e,t){return _t(e)?en({name:e.name},t,{setup:e}):e}function Kde(){const e=cs();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""}function M1(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Gde(e){const t=cs(),n=ul(null);if(t){const o=t.refs===$t?t.refs={}:t.refs;Object.defineProperty(o,e,{enumerable:!0,get:()=>n.value,set:i=>n.value=i})}return n}function xy(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const zd=new WeakMap;function Jl(e,t,n,s,o=!1){if(dt(e)){e.forEach((g,w)=>Jl(g,t&&(dt(t)?t[w]:t),n,s,o));return}if(Ai(s)&&!o){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&Jl(e,t,n,s.component.subTree);return}const i=s.shapeFlag&4?su(s.component):s.el,r=o?null:i,{i:l,r:a}=e,c=t&&t.r,u=l.refs===$t?l.refs={}:l.refs,d=l.setupState,h=Bt(d),p=d===$t?y2:g=>xy(u,g)?!1:Vt(h,g),f=(g,w)=>!(w&&xy(u,w));if(c!=null&&c!==a){if(Ty(t),sn(c))u[c]=null,p(c)&&(d[c]=null);else if(Nn(c)){const g=t;f(c,g.k)&&(c.value=null),g.k&&(u[g.k]=null)}}if(_t(a))Qc(a,l,12,[r,u]);else{const g=sn(a),w=Nn(a);if(g||w){const S=()=>{if(e.f){const y=g?p(a)?d[a]:u[a]:f()||!e.k?a.value:u[e.k];if(o)dt(y)&&y1(y,i);else if(dt(y))y.includes(i)||y.push(i);else if(g)u[a]=[i],p(a)&&(d[a]=u[a]);else{const k=[i];f(a,e.k)&&(a.value=k),e.k&&(u[e.k]=k)}}else g?(u[a]=r,p(a)&&(d[a]=r)):w&&(f(a,e.k)&&(a.value=r),e.k&&(u[e.k]=r))};if(r){const y=()=>{S(),zd.delete(e)};y.id=-1,zd.set(e,y),Pn(y,n)}else Ty(e),S()}}}function Ty(e){const t=zd.get(e);t&&(t.flags|=8,zd.delete(e))}let My=!1;const Il=()=>{My||(console.error("Hydration completed but contains mismatches."),My=!0)},l4=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",a4=e=>e.namespaceURI.includes("MathML"),qu=e=>{if(e.nodeType===1){if(l4(e))return"svg";if(a4(e))return"mathml"}},ql=e=>e.nodeType===8;function c4(e){const{mt:t,p:n,o:{patchProp:s,createText:o,nextSibling:i,parentNode:r,remove:l,insert:a,createComment:c}}=e,u=(k,v)=>{if(!v.hasChildNodes()){n(null,k,v),jd(),v._vnode=k;return}d(v.firstChild,k,null,null,null),jd(),v._vnode=k},d=(k,v,_,I,A,b=!1)=>{b=b||!!v.dynamicChildren;const M=ql(k)&&k.data==="[",N=()=>g(k,v,_,I,A,M),{type:D,ref:$,shapeFlag:O,patchFlag:P}=v;let R=k.nodeType;v.el=k,P===-2&&(b=!1,v.dynamicChildren=null);let F=null;switch(D){case hr:R!==3?v.children===""?(a(v.el=o(""),r(k),k),F=k):F=N():(k.data!==v.children&&(Il(),k.data=v.children),F=i(k));break;case Rn:y(k)?(F=i(k),S(v.el=k.content.firstChild,k,_)):R!==8||M?F=N():F=i(k);break;case ta:if(M&&(k=i(k),R=k.nodeType),R===1||R===3){F=k;const V=!v.children.length;for(let K=0;K<v.staticCount;K++)V&&(v.children+=F.nodeType===1?F.outerHTML:F.data),K===v.staticCount-1&&(v.anchor=F),F=i(F);return M?i(F):F}else N();break;case Ne:M?F=f(k,v,_,I,A,b):F=N();break;default:if(O&1)(R!==1||v.type.toLowerCase()!==k.tagName.toLowerCase())&&!y(k)?F=N():F=h(k,v,_,I,A,b);else if(O&6){v.slotScopeIds=A;const V=r(k);if(M?F=w(k):ql(k)&&k.data==="teleport start"?F=w(k,k.data,"teleport end"):F=i(k),t(v,V,null,_,I,qu(V),b),Ai(v)&&!v.type.__asyncResolved){let K;M?(K=bt(Ne),K.anchor=F?F.previousSibling:V.lastChild):K=k.nodeType===3?yt(""):bt("div"),K.el=k,v.component.subTree=K}}else O&64?R!==8?F=N():F=v.type.hydrate(k,v,_,I,A,b,e,p):O&128&&(F=v.type.hydrate(k,v,_,I,qu(r(k)),A,b,e,d))}return $!=null&&Jl($,null,I,v),F},h=(k,v,_,I,A,b)=>{b=b||!!v.dynamicChildren;const{type:M,props:N,patchFlag:D,shapeFlag:$,dirs:O,transition:P}=v,R=M==="input"||M==="option";if(R||D!==-1){O&&ni(v,null,_,"created");let F=!1;if(y(k)){F=_S(null,P)&&_&&_.vnode.props&&_.vnode.props.appear;const K=k.content.firstChild;if(F){const Z=K.getAttribute("class");Z&&(K.$cls=Z),P.beforeEnter(K)}S(K,k,_),v.el=k=K}if($&16&&!(N&&(N.innerHTML||N.textContent))){let K=p(k.firstChild,v,k,_,I,A,b);for(K&&!ju(k,1)&&Il();K;){const Z=K;K=K.nextSibling,l(Z)}}else if($&8){let K=v.children;K[0]===`
|
|
15
|
-
`&&(k.tagName==="PRE"||k.tagName==="TEXTAREA")&&(K=K.slice(1));const{textContent:Z}=k;Z!==K&&Z!==K.replace(/\r\n|\r/g,`
|
|
16
|
-
`)&&(ju(k,0)||Il(),k.textContent=v.children)}if(N){if(R||!b||D&48){const K=k.tagName.includes("-");for(const Z in N)(R&&(Z.endsWith("value")||Z==="indeterminate")||Jc(Z)&&!tl(Z)||Z[0]==="."||K&&!tl(Z))&&s(k,Z,null,N[Z],void 0,_)}else if(N.onClick)s(k,"onClick",null,N.onClick,void 0,_);else if(D&4&&fr(N.style))for(const K in N.style)N.style[K]}let V;(V=N&&N.onVnodeBeforeMount)&&Os(V,_,v),O&&ni(v,null,_,"beforeMount"),((V=N&&N.onVnodeMounted)||O||F)&&xS(()=>{V&&Os(V,_,v),F&&P.enter(k),O&&ni(v,null,_,"mounted")},I)}return k.nextSibling},p=(k,v,_,I,A,b,M)=>{M=M||!!v.dynamicChildren;const N=v.children,D=N.length;let $=!1;for(let O=0;O<D;O++){const P=M?N[O]:N[O]=Ps(N[O]),R=P.type===hr;k?(R&&!M&&O+1<D&&Ps(N[O+1]).type===hr&&(a(o(k.data.slice(P.children.length)),_,i(k)),k.data=P.children),k=d(k,P,I,A,b,M)):R&&!P.children?a(P.el=o(""),_):($||($=!0,ju(_,1)||Il()),n(null,P,_,null,I,A,qu(_),b))}return k},f=(k,v,_,I,A,b)=>{const{slotScopeIds:M}=v;M&&(A=A?A.concat(M):M);const N=r(k),D=p(i(k),v,N,_,I,A,b);return D&&ql(D)&&D.data==="]"?i(v.anchor=D):(Il(),a(v.anchor=c("]"),N,D),D)},g=(k,v,_,I,A,b)=>{if(ju(k.parentElement,1)||Il(),v.el=null,b){const D=w(k);for(;;){const $=i(k);if($&&$!==D)l($);else break}}const M=i(k),N=r(k);return l(k),n(null,v,N,M,_,I,qu(N),A),_&&(_.vnode.el=v.el,oh(_,v.el)),M},w=(k,v="[",_="]")=>{let I=0;for(;k;)if(k=i(k),k&&ql(k)&&(k.data===v&&I++,k.data===_)){if(I===0)return i(k);I--}return k},S=(k,v,_)=>{const I=v.parentNode;I&&I.replaceChild(k,v);let A=_;for(;A;)A.vnode.el===v&&(A.vnode.el=A.subTree.el=k),A=A.parent},y=k=>k.nodeType===1&&k.tagName==="TEMPLATE";return[u,d]}const Ay="data-allow-mismatch",u4={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function ju(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(Ay);)e=e.parentElement;const n=e&&e.getAttribute(Ay);if(n==null)return!1;if(n==="")return!0;{const s=n.split(",");return t===0&&s.includes("children")?!0:s.includes(u4[t])}}const d4=Gf().requestIdleCallback||(e=>setTimeout(e,1)),f4=Gf().cancelIdleCallback||(e=>clearTimeout(e)),Yde=(e=1e4)=>t=>{const n=d4(t,{timeout:e});return()=>f4(n)};function h4(e){const{top:t,left:n,bottom:s,right:o}=e.getBoundingClientRect(),{innerHeight:i,innerWidth:r}=window;return(t>0&&t<i||s>0&&s<i)&&(n>0&&n<r||o>0&&o<r)}const Xde=e=>(t,n)=>{const s=new IntersectionObserver(o=>{for(const i of o)if(i.isIntersecting){s.disconnect(),t();break}},e);return n(o=>{if(o instanceof Element){if(h4(o))return t(),s.disconnect(),!1;s.observe(o)}}),()=>s.disconnect()},Zde=e=>t=>{if(e){const n=matchMedia(e);if(n.matches)t();else return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t)}},Jde=(e=[])=>(t,n)=>{sn(e)&&(e=[e]);let s=!1;const o=r=>{s||(s=!0,i(),t(),r.target.dispatchEvent(new r.constructor(r.type,r)))},i=()=>{n(r=>{for(const l of e)r.removeEventListener(l,o)})};return n(r=>{for(const l of e)r.addEventListener(l,o,{once:!0})}),i};function p4(e,t){if(ql(e)&&e.data==="["){let n=1,s=e.nextSibling;for(;s;){if(s.nodeType===1){if(t(s)===!1)break}else if(ql(s))if(s.data==="]"){if(--n===0)break}else s.data==="["&&n++;s=s.nextSibling}}else t(e)}const Ai=e=>!!e.type.__asyncLoader;function oi(e){_t(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:s,delay:o=200,hydrate:i,timeout:r,suspensible:l=!0,onError:a}=e;let c=null,u,d=0;const h=()=>(d++,c=null,p()),p=()=>{let f;return c||(f=c=t().catch(g=>{if(g=g instanceof Error?g:new Error(String(g)),a)return new Promise((w,S)=>{a(g,()=>w(h()),()=>S(g),d+1)});throw g}).then(g=>f!==c&&c?c:(g&&(g.__esModule||g[Symbol.toStringTag]==="Module")&&(g=g.default),u=g,g)))};return Je({name:"AsyncComponentWrapper",__asyncLoader:p,__asyncHydrate(f,g,w){let S=!1;(g.bu||(g.bu=[])).push(()=>S=!0);const y=()=>{S||w()},k=i?()=>{const v=i(y,_=>p4(f,_));v&&(g.bum||(g.bum=[])).push(v)}:y;u?k():p().then(()=>!g.isUnmounted&&k())},get __asyncResolved(){return u},setup(){const f=rs;if(M1(f),u)return()=>zu(u,f);const g=k=>{c=null,ka(k,f,13,!s)};if(l&&f.suspense||ll)return p().then(k=>()=>zu(k,f)).catch(k=>(g(k),()=>s?bt(s,{error:k}):null));const w=se(!1),S=se(),y=se(!!o);return o&&setTimeout(()=>{y.value=!1},o),r!=null&&setTimeout(()=>{if(!w.value&&!S.value){const k=new Error(`Async component timed out after ${r}ms.`);g(k),S.value=k}},r),p().then(()=>{w.value=!0,f.parent&&tu(f.parent.vnode)&&f.parent.update()}).catch(k=>{g(k),S.value=k}),()=>{if(w.value&&u)return zu(u,f);if(S.value&&s)return bt(s,{error:S.value});if(n&&!y.value)return zu(n,f)}}})}function zu(e,t){const{ref:n,props:s,children:o,ce:i}=t.vnode,r=bt(e,s,o);return r.ref=n,r.ce=i,delete t.vnode.ce,r}const tu=e=>e.type.__isKeepAlive,m4={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=cs(),s=n.ctx;if(!s.renderer)return()=>{const y=t.default&&t.default();return y&&y.length===1?y[0]:y};const o=new Map,i=new Set;let r=null;const l=n.suspense,{renderer:{p:a,m:c,um:u,o:{createElement:d}}}=s,h=d("div");s.activate=(y,k,v,_,I)=>{const A=y.component;c(y,k,v,0,l),a(A.vnode,y,k,v,A,l,_,y.slotScopeIds,I),Pn(()=>{A.isDeactivated=!1,A.a&&Xl(A.a);const b=y.props&&y.props.onVnodeMounted;b&&Os(b,A.parent,y)},l)},s.deactivate=y=>{const k=y.component;Kd(k.m),Kd(k.a),c(y,h,null,1,l),Pn(()=>{k.da&&Xl(k.da);const v=y.props&&y.props.onVnodeUnmounted;v&&Os(v,k.parent,y),k.isDeactivated=!0},l)};function p(y){Hp(y),u(y,n,l,!0)}function f(y){o.forEach((k,v)=>{const _=lg(Ai(k)?k.type.__asyncResolved||{}:k.type);_&&!y(_)&&g(v)})}function g(y){const k=o.get(y);k&&(!r||!Fo(k,r))?p(k):r&&Hp(r),o.delete(y),i.delete(y)}Ge(()=>[e.include,e.exclude],([y,k])=>{y&&f(v=>oc(y,v)),k&&f(v=>!oc(k,v))},{flush:"post",deep:!0});let w=null;const S=()=>{w!=null&&(Gd(n.subTree.type)?Pn(()=>{o.set(w,Vu(n.subTree))},n.subTree.suspense):o.set(w,Vu(n.subTree)))};return tn(S),A1(S),qs(()=>{o.forEach(y=>{const{subTree:k,suspense:v}=n,_=Vu(k);if(y.type===_.type&&y.key===_.key){Hp(_);const I=_.component.da;I&&Pn(I,v);return}p(y)})}),()=>{if(w=null,!t.default)return r=null;const y=t.default(),k=y[0];if(y.length>1)return r=null,y;if(!yr(k)||!(k.shapeFlag&4)&&!(k.shapeFlag&128))return r=null,k;let v=Vu(k);if(v.type===Rn)return r=null,v;const _=v.type,I=lg(Ai(v)?v.type.__asyncResolved||{}:_),{include:A,exclude:b,max:M}=e;if(A&&(!I||!oc(A,I))||b&&I&&oc(b,I))return v.shapeFlag&=-257,r=v,k;const N=v.key==null?_:v.key,D=o.get(N);return v.el&&(v=Oi(v),k.shapeFlag&128&&(k.ssContent=v)),w=N,D?(v.el=D.el,v.component=D.component,v.transition&&vr(v,v.transition),v.shapeFlag|=512,i.delete(N),i.add(N)):(i.add(N),M&&i.size>parseInt(M,10)&&g(i.values().next().value)),v.shapeFlag|=256,r=v,Gd(k.type)?k:v}}},Qde=m4;function oc(e,t){return dt(e)?e.some(n=>oc(n,t)):sn(e)?e.split(",").includes(t):nA(e)?(e.lastIndex=0,e.test(t)):!1}function g4(e,t){sS(e,"a",t)}function v4(e,t){sS(e,"da",t)}function sS(e,t,n=rs){const s=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(nh(t,s,n),n){let o=n.parent;for(;o&&o.parent;)tu(o.parent.vnode)&&y4(s,t,n,o),o=o.parent}}function y4(e,t,n,s){const o=nh(t,e,s,!0);Ht(()=>{y1(s[t],o)},n)}function Hp(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function Vu(e){return e.shapeFlag&128?e.ssContent:e}function nh(e,t,n=rs,s=!1){if(n){const o=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...r)=>{$i();const l=ba(n),a=$o(t,n,e,r);return l(),Ni(),a});return s?o.unshift(i):o.push(i),i}}const Di=e=>(t,n=rs)=>{(!ll||e==="sp")&&nh(e,(...s)=>t(...s),n)},k4=Di("bm"),tn=Di("m"),oS=Di("bu"),A1=Di("u"),qs=Di("bum"),Ht=Di("um"),b4=Di("sp"),_4=Di("rtg"),w4=Di("rtc");function S4(e,t=rs){nh("ec",e,t)}const E1="components",C4="directives";function x4(e,t){return I1(E1,e,!0,t)||e}const iS=Symbol.for("v-ndc");function gs(e){return sn(e)?I1(E1,e,!1)||e:e||iS}function efe(e){return I1(C4,e)}function I1(e,t,n=!0,s=!1){const o=as||rs;if(o){const i=o.type;if(e===E1){const l=lg(i,!1);if(l&&(l===t||l===Gn(t)||l===Vf(Gn(t))))return i}const r=Ey(o[e]||i[e],t)||Ey(o.appContext[e],t);return!r&&s?i:r}}function Ey(e,t){return e&&(e[t]||e[Gn(t)]||e[Vf(Gn(t))])}function Qe(e,t,n,s){let o;const i=n&&n[s],r=dt(e);if(r||sn(e)){const l=r&&fr(e);let a=!1,c=!1;l&&(a=!eo(e),c=Li(e),e=Zf(e)),o=new Array(e.length);for(let u=0,d=e.length;u<d;u++)o[u]=t(a?c?da(qo(e[u])):qo(e[u]):e[u],u,void 0,i&&i[u])}else if(typeof e=="number"){o=new Array(e);for(let l=0;l<e;l++)o[l]=t(l+1,l,void 0,i&&i[l])}else if(Kt(e))if(e[Symbol.iterator])o=Array.from(e,(l,a)=>t(l,a,void 0,i&&i[a]));else{const l=Object.keys(e);o=new Array(l.length);for(let a=0,c=l.length;a<c;a++){const u=l[a];o[a]=t(e[u],u,a,i&&i[a])}}else o=[];return n&&(n[s]=o),o}function tfe(e,t){for(let n=0;n<t.length;n++){const s=t[n];if(dt(s))for(let o=0;o<s.length;o++)e[s[o].name]=s[o].fn;else s&&(e[s.name]=s.key?(...o)=>{const i=s.fn(...o);return i&&(i.key=s.key),i}:s.fn)}return e}function Ql(e,t,n={},s,o){if(as.ce||as.parent&&Ai(as.parent)&&as.parent.ce){const c=Object.keys(n).length>0;return t!=="default"&&(n.name=t),x(),Ke(Ne,null,[bt("slot",n,s&&s())],c?-2:64)}let i=e[t];i&&i._c&&(i._d=!1),x();const r=i&&$1(i(n)),l=n.key||r&&r.key,a=Ke(Ne,{key:(l&&!ro(l)?l:`_${t}`)+(!r&&s?"_fb":"")},r||(s?s():[]),r&&e._===1?64:-2);return!o&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),i&&i._c&&(i._d=!0),a}function $1(e){return e.some(t=>yr(t)?!(t.type===Rn||t.type===Ne&&!$1(t.children)):!0)?e:null}function nfe(e,t){const n={};for(const s in e)n[t&&/[A-Z]/.test(s)?`on:${s}`:yd(s)]=e[s];return n}const Qm=e=>e?IS(e)?su(e):Qm(e.parent):null,mc=en(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Qm(e.parent),$root:e=>Qm(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>N1(e),$forceUpdate:e=>e.f||(e.f=()=>{x1(e.update)}),$nextTick:e=>e.n||(e.n=vt.bind(e.proxy)),$watch:e=>t4.bind(e)}),Wp=(e,t)=>e!==$t&&!e.__isScriptSetup&&Vt(e,t),eg={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:o,props:i,accessCache:r,type:l,appContext:a}=e;if(t[0]!=="$"){const h=r[t];if(h!==void 0)switch(h){case 1:return s[t];case 2:return o[t];case 4:return n[t];case 3:return i[t]}else{if(Wp(s,t))return r[t]=1,s[t];if(o!==$t&&Vt(o,t))return r[t]=2,o[t];if(Vt(i,t))return r[t]=3,i[t];if(n!==$t&&Vt(n,t))return r[t]=4,n[t];tg&&(r[t]=0)}}const c=mc[t];let u,d;if(c)return t==="$attrs"&&ms(e.attrs,"get",""),c(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(n!==$t&&Vt(n,t))return r[t]=4,n[t];if(d=a.config.globalProperties,Vt(d,t))return d[t]},set({_:e},t,n){const{data:s,setupState:o,ctx:i}=e;return Wp(o,t)?(o[t]=n,!0):s!==$t&&Vt(s,t)?(s[t]=n,!0):Vt(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:o,props:i,type:r}},l){let a;return!!(n[l]||e!==$t&&l[0]!=="$"&&Vt(e,l)||Wp(t,l)||Vt(i,l)||Vt(s,l)||Vt(mc,l)||Vt(o.config.globalProperties,l)||(a=r.__cssModules)&&a[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Vt(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},T4=en({},eg,{get(e,t){if(t!==Symbol.unscopables)return eg.get(e,t,e)},has(e,t){return t[0]!=="_"&&!lA(t)}});function sfe(){return null}function ofe(){return null}function ife(e){}function rfe(e){}function lfe(){return null}function afe(){}function cfe(e,t){return null}function ufe(){return rS().slots}function nu(){return rS().attrs}function rS(e){const t=cs();return t.setupContext||(t.setupContext=LS(t))}function Oc(e){return dt(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function dfe(e,t){const n=Oc(e);for(const s in t){if(s.startsWith("__skip"))continue;let o=n[s];o?dt(o)||_t(o)?o=n[s]={type:o,default:t[s]}:o.default=t[s]:o===null&&(o=n[s]={default:t[s]}),o&&t[`__skip_${s}`]&&(o.skipFactory=!0)}return n}function ffe(e,t){return!e||!t?e||t:dt(e)&&dt(t)?e.concat(t):en({},Oc(e),Oc(t))}function hfe(e,t){const n={};for(const s in e)t.includes(s)||Object.defineProperty(n,s,{enumerable:!0,get:()=>e[s]});return n}function pfe(e){const t=cs(),n=ll;let s=e();Rc(),n&&na(!1);const o=()=>{ba(t),n&&na(!0)},i=()=>{cs()!==t&&t.scope.off(),Rc(),n&&na(!1)};return k1(s)&&(s=s.catch(r=>{throw o(),Promise.resolve().then(()=>Promise.resolve().then(i)),r})),[s,()=>{o(),Promise.resolve().then(i)}]}let tg=!0;function M4(e){const t=N1(e),n=e.proxy,s=e.ctx;tg=!1,t.beforeCreate&&Iy(t.beforeCreate,e,"bc");const{data:o,computed:i,methods:r,watch:l,provide:a,inject:c,created:u,beforeMount:d,mounted:h,beforeUpdate:p,updated:f,activated:g,deactivated:w,beforeDestroy:S,beforeUnmount:y,destroyed:k,unmounted:v,render:_,renderTracked:I,renderTriggered:A,errorCaptured:b,serverPrefetch:M,expose:N,inheritAttrs:D,components:$,directives:O,filters:P}=t;if(c&&A4(c,s,null),r)for(const V in r){const K=r[V];_t(K)&&(s[V]=K.bind(n))}if(o){const V=o.call(n,n);Kt(V)&&(e.data=Js(V))}if(tg=!0,i)for(const V in i){const K=i[V],Z=_t(K)?K.bind(n,n):_t(K.get)?K.get.bind(n,n):Eo,G=!_t(K)&&_t(K.set)?K.set.bind(n):Eo,X=H({get:Z,set:G});Object.defineProperty(s,V,{enumerable:!0,configurable:!0,get:()=>X.value,set:pe=>X.value=pe})}if(l)for(const V in l)lS(l[V],s,n,V);if(a){const V=_t(a)?a.call(n):a;Reflect.ownKeys(V).forEach(K=>{gn(K,V[K])})}u&&Iy(u,e,"c");function F(V,K){dt(K)?K.forEach(Z=>V(Z.bind(n))):K&&V(K.bind(n))}if(F(k4,d),F(tn,h),F(oS,p),F(A1,f),F(g4,g),F(v4,w),F(S4,b),F(w4,I),F(_4,A),F(qs,y),F(Ht,v),F(b4,M),dt(N))if(N.length){const V=e.exposed||(e.exposed={});N.forEach(K=>{Object.defineProperty(V,K,{get:()=>n[K],set:Z=>n[K]=Z,enumerable:!0})})}else e.exposed||(e.exposed={});_&&e.render===Eo&&(e.render=_),D!=null&&(e.inheritAttrs=D),$&&(e.components=$),O&&(e.directives=O),M&&M1(e)}function A4(e,t,n=Eo){dt(e)&&(e=ng(e));for(const s in e){const o=e[s];let i;Kt(o)?"default"in o?i=Pt(o.from||s,o.default,!0):i=Pt(o.from||s):i=Pt(o),Nn(i)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>i.value,set:r=>i.value=r}):t[s]=i}}function Iy(e,t,n){$o(dt(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function lS(e,t,n,s){let o=s.includes(".")?Y2(n,s):()=>n[s];if(sn(e)){const i=t[e];_t(i)&&Ge(o,i)}else if(_t(e))Ge(o,e.bind(n));else if(Kt(e))if(dt(e))e.forEach(i=>lS(i,t,n,s));else{const i=_t(e.handler)?e.handler.bind(n):t[e.handler];_t(i)&&Ge(o,i,e)}}function N1(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:o,optionsCache:i,config:{optionMergeStrategies:r}}=e.appContext,l=i.get(t);let a;return l?a=l:!o.length&&!n&&!s?a=t:(a={},o.length&&o.forEach(c=>Vd(a,c,r,!0)),Vd(a,t,r)),Kt(t)&&i.set(t,a),a}function Vd(e,t,n,s=!1){const{mixins:o,extends:i}=t;i&&Vd(e,i,n,!0),o&&o.forEach(r=>Vd(e,r,n,!0));for(const r in t)if(!(s&&r==="expose")){const l=E4[r]||n&&n[r];e[r]=l?l(e[r],t[r]):t[r]}return e}const E4={data:$y,props:Ny,emits:Ny,methods:ic,computed:ic,beforeCreate:ws,created:ws,beforeMount:ws,mounted:ws,beforeUpdate:ws,updated:ws,beforeDestroy:ws,beforeUnmount:ws,destroyed:ws,unmounted:ws,activated:ws,deactivated:ws,errorCaptured:ws,serverPrefetch:ws,components:ic,directives:ic,watch:$4,provide:$y,inject:I4};function $y(e,t){return t?e?function(){return en(_t(e)?e.call(this,this):e,_t(t)?t.call(this,this):t)}:t:e}function I4(e,t){return ic(ng(e),ng(t))}function ng(e){if(dt(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function ws(e,t){return e?[...new Set([].concat(e,t))]:t}function ic(e,t){return e?en(Object.create(null),e,t):t}function Ny(e,t){return e?dt(e)&&dt(t)?[...new Set([...e,...t])]:en(Object.create(null),Oc(e),Oc(t??{})):t}function $4(e,t){if(!e)return t;if(!t)return e;const n=en(Object.create(null),e);for(const s in t)n[s]=ws(e[s],t[s]);return n}function aS(){return{app:null,config:{isNativeTag:y2,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let N4=0;function L4(e,t){return function(s,o=null){_t(s)||(s=en({},s)),o!=null&&!Kt(o)&&(o=null);const i=aS(),r=new WeakSet,l=[];let a=!1;const c=i.app={_uid:N4++,_component:s,_props:o,_container:null,_context:i,_instance:null,version:cE,get config(){return i.config},set config(u){},use(u,...d){return r.has(u)||(u&&_t(u.install)?(r.add(u),u.install(c,...d)):_t(u)&&(r.add(u),u(c,...d))),c},mixin(u){return i.mixins.includes(u)||i.mixins.push(u),c},component(u,d){return d?(i.components[u]=d,c):i.components[u]},directive(u,d){return d?(i.directives[u]=d,c):i.directives[u]},mount(u,d,h){if(!a){const p=c._ceVNode||bt(s,o);return p.appContext=i,h===!0?h="svg":h===!1&&(h=void 0),d&&t?t(p,u):e(p,u,h),a=!0,c._container=u,u.__vue_app__=c,su(p.component)}},onUnmount(u){l.push(u)},unmount(){a&&($o(l,c._instance,16),e(null,c._container),delete c._container.__vue_app__)},provide(u,d){return i.provides[u]=d,c},runWithContext(u){const d=sl;sl=c;try{return u()}finally{sl=d}}};return c}}let sl=null;function mfe(e,t,n=$t){const s=cs(),o=Gn(t),i=Rs(t),r=cS(e,o),l=FA((a,c)=>{let u,d=$t,h;return e4(()=>{const p=e[o];is(u,p)&&(u=p,c())}),{get(){return a(),n.get?n.get(u):u},set(p){const f=n.set?n.set(p):p;if(!is(f,u)&&!(d!==$t&&is(p,d)))return;const g=s.vnode.props;g&&(t in g||o in g||i in g)&&(`onUpdate:${t}`in g||`onUpdate:${o}`in g||`onUpdate:${i}`in g)||(u=p,c()),s.emit(`update:${t}`,f),is(p,f)&&is(p,d)&&!is(f,h)&&c(),d=p,h=f}}});return l[Symbol.iterator]=()=>{let a=0;return{next(){return a<2?{value:a++?r||$t:l,done:!1}:{done:!0}}}},l}const cS=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Gn(t)}Modifiers`]||e[`${Rs(t)}Modifiers`];function O4(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||$t;let o=n;const i=t.startsWith("update:"),r=i&&cS(s,t.slice(7));r&&(r.trim&&(o=n.map(u=>sn(u)?u.trim():u)),r.number&&(o=n.map(Kf)));let l,a=s[l=yd(t)]||s[l=yd(Gn(t))];!a&&i&&(a=s[l=yd(Rs(t))]),a&&$o(a,e,6,o);const c=s[l+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,$o(c,e,6,o)}}const P4=new WeakMap;function uS(e,t,n=!1){const s=n?P4:t.emitsCache,o=s.get(e);if(o!==void 0)return o;const i=e.emits;let r={},l=!1;if(!_t(e)){const a=c=>{const u=uS(c,t,!0);u&&(l=!0,en(r,u))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!i&&!l?(Kt(e)&&s.set(e,null),null):(dt(i)?i.forEach(a=>r[a]=null):en(r,i),Kt(e)&&s.set(e,r),r)}function sh(e,t){return!e||!Jc(t)?!1:(t=t.slice(2).replace(/Once$/,""),Vt(e,t[0].toLowerCase()+t.slice(1))||Vt(e,Rs(t))||Vt(e,t))}function kd(e){const{type:t,vnode:n,proxy:s,withProxy:o,propsOptions:[i],slots:r,attrs:l,emit:a,render:c,renderCache:u,props:d,data:h,setupState:p,ctx:f,inheritAttrs:g}=e,w=Nc(e);let S,y;try{if(n.shapeFlag&4){const v=o||s,_=v;S=Ps(c.call(_,v,u,d,p,h,f)),y=l}else{const v=t;S=Ps(v.length>1?v(d,{attrs:l,slots:r,emit:a}):v(d,null)),y=t.props?l:D4(l)}}catch(v){gc.length=0,ka(v,e,1),S=bt(Rn)}let k=S;if(y&&g!==!1){const v=Object.keys(y),{shapeFlag:_}=k;v.length&&_&7&&(i&&v.some(Uf)&&(y=B4(y,i)),k=Oi(k,y,!1,!0))}return n.dirs&&(k=Oi(k,null,!1,!0),k.dirs=k.dirs?k.dirs.concat(n.dirs):n.dirs),n.transition&&vr(k,n.transition),S=k,Nc(w),S}function R4(e,t=!0){let n;for(let s=0;s<e.length;s++){const o=e[s];if(yr(o)){if(o.type!==Rn||o.children==="v-if"){if(n)return;n=o}}else return}return n}const D4=e=>{let t;for(const n in e)(n==="class"||n==="style"||Jc(n))&&((t||(t={}))[n]=e[n]);return t},B4=(e,t)=>{const n={};for(const s in e)(!Uf(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function F4(e,t,n){const{props:s,children:o,component:i}=e,{props:r,children:l,patchFlag:a}=t,c=i.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&a>=0){if(a&1024)return!0;if(a&16)return s?Ly(s,r,c):!!r;if(a&8){const u=t.dynamicProps;for(let d=0;d<u.length;d++){const h=u[d];if(dS(r,s,h)&&!sh(c,h))return!0}}}else return(o||l)&&(!l||!l.$stable)?!0:s===r?!1:s?r?Ly(s,r,c):!0:!!r;return!1}function Ly(e,t,n){const s=Object.keys(t);if(s.length!==Object.keys(e).length)return!0;for(let o=0;o<s.length;o++){const i=s[o];if(dS(t,e,i)&&!sh(n,i))return!0}return!1}function dS(e,t,n){const s=e[n],o=t[n];return n==="style"&&Kt(s)&&Kt(o)?!Ii(s,o):s!==o}function oh({vnode:e,parent:t,suspense:n},s){for(;t;){const o=t.subTree;if(o.suspense&&o.suspense.activeBranch===e&&(o.suspense.vnode.el=o.el=s,e=o),o===e)(e=t.vnode).el=s,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=s)}const fS={},hS=()=>Object.create(fS),pS=e=>Object.getPrototypeOf(e)===fS;function H4(e,t,n,s=!1){const o={},i=hS();e.propsDefaults=Object.create(null),mS(e,t,o,i);for(const r in e.propsOptions[0])r in o||(o[r]=void 0);n?e.props=s?o:PA(o):e.type.props?e.props=o:e.props=i,e.attrs=i}function W4(e,t,n,s){const{props:o,attrs:i,vnode:{patchFlag:r}}=e,l=Bt(o),[a]=e.propsOptions;let c=!1;if((s||r>0)&&!(r&16)){if(r&8){const u=e.vnode.dynamicProps;for(let d=0;d<u.length;d++){let h=u[d];if(sh(e.emitsOptions,h))continue;const p=t[h];if(a)if(Vt(i,h))p!==i[h]&&(i[h]=p,c=!0);else{const f=Gn(h);o[f]=sg(a,l,f,p,e,!1)}else p!==i[h]&&(i[h]=p,c=!0)}}}else{mS(e,t,o,i)&&(c=!0);let u;for(const d in l)(!t||!Vt(t,d)&&((u=Rs(d))===d||!Vt(t,u)))&&(a?n&&(n[d]!==void 0||n[u]!==void 0)&&(o[d]=sg(a,l,d,void 0,e,!0)):delete o[d]);if(i!==l)for(const d in i)(!t||!Vt(t,d))&&(delete i[d],c=!0)}c&&Si(e.attrs,"set","")}function mS(e,t,n,s){const[o,i]=e.propsOptions;let r=!1,l;if(t)for(let a in t){if(tl(a))continue;const c=t[a];let u;o&&Vt(o,u=Gn(a))?!i||!i.includes(u)?n[u]=c:(l||(l={}))[u]=c:sh(e.emitsOptions,a)||(!(a in s)||c!==s[a])&&(s[a]=c,r=!0)}if(i){const a=Bt(n),c=l||$t;for(let u=0;u<i.length;u++){const d=i[u];n[d]=sg(o,a,d,c[d],e,!Vt(c,d))}}return r}function sg(e,t,n,s,o,i){const r=e[n];if(r!=null){const l=Vt(r,"default");if(l&&s===void 0){const a=r.default;if(r.type!==Function&&!r.skipFactory&&_t(a)){const{propsDefaults:c}=o;if(n in c)s=c[n];else{const u=ba(o);s=c[n]=a.call(null,t),u()}}else s=a;o.ce&&o.ce._setProp(n,s)}r[0]&&(i&&!l?s=!1:r[1]&&(s===""||s===Rs(n))&&(s=!0))}return s}const U4=new WeakMap;function gS(e,t,n=!1){const s=n?U4:t.propsCache,o=s.get(e);if(o)return o;const i=e.props,r={},l=[];let a=!1;if(!_t(e)){const u=d=>{a=!0;const[h,p]=gS(d,t,!0);en(r,h),p&&l.push(...p)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!i&&!a)return Kt(e)&&s.set(e,Gl),Gl;if(dt(i))for(let u=0;u<i.length;u++){const d=Gn(i[u]);Oy(d)&&(r[d]=$t)}else if(i)for(const u in i){const d=Gn(u);if(Oy(d)){const h=i[u],p=r[d]=dt(h)||_t(h)?{type:h}:en({},h),f=p.type;let g=!1,w=!0;if(dt(f))for(let S=0;S<f.length;++S){const y=f[S],k=_t(y)&&y.name;if(k==="Boolean"){g=!0;break}else k==="String"&&(w=!1)}else g=_t(f)&&f.name==="Boolean";p[0]=g,p[1]=w,(g||Vt(p,"default"))&&l.push(d)}}const c=[r,l];return Kt(e)&&s.set(e,c),c}function Oy(e){return e[0]!=="$"&&!tl(e)}const L1=e=>e==="_"||e==="_ctx"||e==="$stable",O1=e=>dt(e)?e.map(Ps):[Ps(e)],q4=(e,t,n)=>{if(t._n)return t;const s=Mn((...o)=>O1(t(...o)),n);return s._c=!1,s},vS=(e,t,n)=>{const s=e._ctx;for(const o in e){if(L1(o))continue;const i=e[o];if(_t(i))t[o]=q4(o,i,s);else if(i!=null){const r=O1(i);t[o]=()=>r}}},yS=(e,t)=>{const n=O1(t);e.slots.default=()=>n},kS=(e,t,n)=>{for(const s in t)(n||!L1(s))&&(e[s]=t[s])},j4=(e,t,n)=>{const s=e.slots=hS();if(e.vnode.shapeFlag&32){const o=t._;o?(kS(s,t,n),n&&b2(s,"_",o,!0)):vS(t,s)}else t&&yS(e,t)},z4=(e,t,n)=>{const{vnode:s,slots:o}=e;let i=!0,r=$t;if(s.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:kS(o,t,n):(i=!t.$stable,vS(t,o)),r=t}else t&&(yS(e,t),r={default:1});if(i)for(const l in o)!L1(l)&&r[l]==null&&delete o[l]},Pn=xS;function V4(e){return bS(e)}function K4(e){return bS(e,c4)}function bS(e,t){const n=Gf();n.__VUE__=!0;const{insert:s,remove:o,patchProp:i,createElement:r,createText:l,createComment:a,setText:c,setElementText:u,parentNode:d,nextSibling:h,setScopeId:p=Eo,insertStaticContent:f}=e,g=(W,J,ue,ie=null,ae=null,U=null,Y=void 0,ce=null,me=!!J.dynamicChildren)=>{if(W===J)return;W&&!Fo(W,J)&&(ie=be(W),pe(W,ae,U,!0),W=null),J.patchFlag===-2&&(me=!1,J.dynamicChildren=null);const{type:Se,ref:Ee,shapeFlag:re}=J;switch(Se){case hr:w(W,J,ue,ie);break;case Rn:S(W,J,ue,ie);break;case ta:W==null&&y(J,ue,ie,Y);break;case Ne:$(W,J,ue,ie,ae,U,Y,ce,me);break;default:re&1?_(W,J,ue,ie,ae,U,Y,ce,me):re&6?O(W,J,ue,ie,ae,U,Y,ce,me):(re&64||re&128)&&Se.process(W,J,ue,ie,ae,U,Y,ce,me,ee)}Ee!=null&&ae?Jl(Ee,W&&W.ref,U,J||W,!J):Ee==null&&W&&W.ref!=null&&Jl(W.ref,null,U,W,!0)},w=(W,J,ue,ie)=>{if(W==null)s(J.el=l(J.children),ue,ie);else{const ae=J.el=W.el;J.children!==W.children&&c(ae,J.children)}},S=(W,J,ue,ie)=>{W==null?s(J.el=a(J.children||""),ue,ie):J.el=W.el},y=(W,J,ue,ie)=>{[W.el,W.anchor]=f(W.children,J,ue,ie,W.el,W.anchor)},k=({el:W,anchor:J},ue,ie)=>{let ae;for(;W&&W!==J;)ae=h(W),s(W,ue,ie),W=ae;s(J,ue,ie)},v=({el:W,anchor:J})=>{let ue;for(;W&&W!==J;)ue=h(W),o(W),W=ue;o(J)},_=(W,J,ue,ie,ae,U,Y,ce,me)=>{if(J.type==="svg"?Y="svg":J.type==="math"&&(Y="mathml"),W==null)I(J,ue,ie,ae,U,Y,ce,me);else{const Se=W.el&&W.el._isVueCE?W.el:null;try{Se&&Se._beginPatch(),M(W,J,ae,U,Y,ce,me)}finally{Se&&Se._endPatch()}}},I=(W,J,ue,ie,ae,U,Y,ce)=>{let me,Se;const{props:Ee,shapeFlag:re,transition:Te,dirs:Ue}=W;if(me=W.el=r(W.type,U,Ee&&Ee.is,Ee),re&8?u(me,W.children):re&16&&b(W.children,me,null,ie,ae,Up(W,U),Y,ce),Ue&&ni(W,null,ie,"created"),A(me,W,W.scopeId,Y,ie),Ee){for(const ct in Ee)ct!=="value"&&!tl(ct)&&i(me,ct,null,Ee[ct],U,ie);"value"in Ee&&i(me,"value",null,Ee.value,U),(Se=Ee.onVnodeBeforeMount)&&Os(Se,ie,W)}Ue&&ni(W,null,ie,"beforeMount");const nt=_S(ae,Te);nt&&Te.beforeEnter(me),s(me,J,ue),((Se=Ee&&Ee.onVnodeMounted)||nt||Ue)&&Pn(()=>{try{Se&&Os(Se,ie,W),nt&&Te.enter(me),Ue&&ni(W,null,ie,"mounted")}finally{}},ae)},A=(W,J,ue,ie,ae)=>{if(ue&&p(W,ue),ie)for(let U=0;U<ie.length;U++)p(W,ie[U]);if(ae){let U=ae.subTree;if(J===U||Gd(U.type)&&(U.ssContent===J||U.ssFallback===J)){const Y=ae.vnode;A(W,Y,Y.scopeId,Y.slotScopeIds,ae.parent)}}},b=(W,J,ue,ie,ae,U,Y,ce,me=0)=>{for(let Se=me;Se<W.length;Se++){const Ee=W[Se]=ce?wi(W[Se]):Ps(W[Se]);g(null,Ee,J,ue,ie,ae,U,Y,ce)}},M=(W,J,ue,ie,ae,U,Y)=>{const ce=J.el=W.el;let{patchFlag:me,dynamicChildren:Se,dirs:Ee}=J;me|=W.patchFlag&16;const re=W.props||$t,Te=J.props||$t;let Ue;if(ue&&Wr(ue,!1),(Ue=Te.onVnodeBeforeUpdate)&&Os(Ue,ue,J,W),Ee&&ni(J,W,ue,"beforeUpdate"),ue&&Wr(ue,!0),(re.innerHTML&&Te.innerHTML==null||re.textContent&&Te.textContent==null)&&u(ce,""),Se?N(W.dynamicChildren,Se,ce,ue,ie,Up(J,ae),U):Y||K(W,J,ce,null,ue,ie,Up(J,ae),U,!1),me>0){if(me&16)D(ce,re,Te,ue,ae);else if(me&2&&re.class!==Te.class&&i(ce,"class",null,Te.class,ae),me&4&&i(ce,"style",re.style,Te.style,ae),me&8){const nt=J.dynamicProps;for(let ct=0;ct<nt.length;ct++){const Re=nt[ct],Pe=re[Re],st=Te[Re];(st!==Pe||Re==="value")&&i(ce,Re,Pe,st,ae,ue)}}me&1&&W.children!==J.children&&u(ce,J.children)}else!Y&&Se==null&&D(ce,re,Te,ue,ae);((Ue=Te.onVnodeUpdated)||Ee)&&Pn(()=>{Ue&&Os(Ue,ue,J,W),Ee&&ni(J,W,ue,"updated")},ie)},N=(W,J,ue,ie,ae,U,Y)=>{for(let ce=0;ce<J.length;ce++){const me=W[ce],Se=J[ce],Ee=me.el&&(me.type===Ne||!Fo(me,Se)||me.shapeFlag&198)?d(me.el):ue;g(me,Se,Ee,null,ie,ae,U,Y,!0)}},D=(W,J,ue,ie,ae)=>{if(J!==ue){if(J!==$t)for(const U in J)!tl(U)&&!(U in ue)&&i(W,U,J[U],null,ae,ie);for(const U in ue){if(tl(U))continue;const Y=ue[U],ce=J[U];Y!==ce&&U!=="value"&&i(W,U,ce,Y,ae,ie)}"value"in ue&&i(W,"value",J.value,ue.value,ae)}},$=(W,J,ue,ie,ae,U,Y,ce,me)=>{const Se=J.el=W?W.el:l(""),Ee=J.anchor=W?W.anchor:l("");let{patchFlag:re,dynamicChildren:Te,slotScopeIds:Ue}=J;Ue&&(ce=ce?ce.concat(Ue):Ue),W==null?(s(Se,ue,ie),s(Ee,ue,ie),b(J.children||[],ue,Ee,ae,U,Y,ce,me)):re>0&&re&64&&Te&&W.dynamicChildren&&W.dynamicChildren.length===Te.length?(N(W.dynamicChildren,Te,ue,ae,U,Y,ce),(J.key!=null||ae&&J===ae.subTree)&&P1(W,J,!0)):K(W,J,ue,Ee,ae,U,Y,ce,me)},O=(W,J,ue,ie,ae,U,Y,ce,me)=>{J.slotScopeIds=ce,W==null?J.shapeFlag&512?ae.ctx.activate(J,ue,ie,Y,me):P(J,ue,ie,ae,U,Y,me):R(W,J,me)},P=(W,J,ue,ie,ae,U,Y)=>{const ce=W.component=ES(W,ie,ae);if(tu(W)&&(ce.ctx.renderer=ee),$S(ce,!1,Y),ce.asyncDep){if(ae&&ae.registerDep(ce,F,Y),!W.el){const me=ce.subTree=bt(Rn);S(null,me,J,ue),W.placeholder=me.el}}else F(ce,W,J,ue,ae,U,Y)},R=(W,J,ue)=>{const ie=J.component=W.component;if(F4(W,J,ue))if(ie.asyncDep&&!ie.asyncResolved){V(ie,J,ue);return}else ie.next=J,ie.update();else J.el=W.el,ie.vnode=J},F=(W,J,ue,ie,ae,U,Y)=>{const ce=()=>{if(W.isMounted){let{next:re,bu:Te,u:Ue,parent:nt,vnode:ct}=W;{const mt=wS(W);if(mt){re&&(re.el=ct.el,V(W,re,Y)),mt.asyncDep.then(()=>{Pn(()=>{W.isUnmounted||Se()},ae)});return}}let Re=re,Pe;Wr(W,!1),re?(re.el=ct.el,V(W,re,Y)):re=ct,Te&&Xl(Te),(Pe=re.props&&re.props.onVnodeBeforeUpdate)&&Os(Pe,nt,re,ct),Wr(W,!0);const st=kd(W),et=W.subTree;W.subTree=st,g(et,st,d(et.el),be(et),W,ae,U),re.el=st.el,Re===null&&oh(W,st.el),Ue&&Pn(Ue,ae),(Pe=re.props&&re.props.onVnodeUpdated)&&Pn(()=>Os(Pe,nt,re,ct),ae)}else{let re;const{el:Te,props:Ue}=J,{bm:nt,m:ct,parent:Re,root:Pe,type:st}=W,et=Ai(J);if(Wr(W,!1),nt&&Xl(nt),!et&&(re=Ue&&Ue.onVnodeBeforeMount)&&Os(re,Re,J),Wr(W,!0),Te&&ge){const mt=()=>{W.subTree=kd(W),ge(Te,W.subTree,W,ae,null)};et&&st.__asyncHydrate?st.__asyncHydrate(Te,W,mt):mt()}else{Pe.ce&&Pe.ce._hasShadowRoot()&&Pe.ce._injectChildStyle(st,W.parent?W.parent.type:void 0);const mt=W.subTree=kd(W);g(null,mt,ue,ie,W,ae,U),J.el=mt.el}if(ct&&Pn(ct,ae),!et&&(re=Ue&&Ue.onVnodeMounted)){const mt=J;Pn(()=>Os(re,Re,mt),ae)}(J.shapeFlag&256||Re&&Ai(Re.vnode)&&Re.vnode.shapeFlag&256)&&W.a&&Pn(W.a,ae),W.isMounted=!0,J=ue=ie=null}};W.scope.on();const me=W.effect=new Bd(ce);W.scope.off();const Se=W.update=me.run.bind(me),Ee=W.job=me.runIfDirty.bind(me);Ee.i=W,Ee.id=W.uid,me.scheduler=()=>x1(Ee),Wr(W,!0),Se()},V=(W,J,ue)=>{J.component=W;const ie=W.vnode.props;W.vnode=J,W.next=null,W4(W,J.props,ie,ue),z4(W,J.children,ue),$i(),_y(W),Ni()},K=(W,J,ue,ie,ae,U,Y,ce,me=!1)=>{const Se=W&&W.children,Ee=W?W.shapeFlag:0,re=J.children,{patchFlag:Te,shapeFlag:Ue}=J;if(Te>0){if(Te&128){G(Se,re,ue,ie,ae,U,Y,ce,me);return}else if(Te&256){Z(Se,re,ue,ie,ae,U,Y,ce,me);return}}Ue&8?(Ee&16&&de(Se,ae,U),re!==Se&&u(ue,re)):Ee&16?Ue&16?G(Se,re,ue,ie,ae,U,Y,ce,me):de(Se,ae,U,!0):(Ee&8&&u(ue,""),Ue&16&&b(re,ue,ie,ae,U,Y,ce,me))},Z=(W,J,ue,ie,ae,U,Y,ce,me)=>{W=W||Gl,J=J||Gl;const Se=W.length,Ee=J.length,re=Math.min(Se,Ee);let Te;for(Te=0;Te<re;Te++){const Ue=J[Te]=me?wi(J[Te]):Ps(J[Te]);g(W[Te],Ue,ue,null,ae,U,Y,ce,me)}Se>Ee?de(W,ae,U,!0,!1,re):b(J,ue,ie,ae,U,Y,ce,me,re)},G=(W,J,ue,ie,ae,U,Y,ce,me)=>{let Se=0;const Ee=J.length;let re=W.length-1,Te=Ee-1;for(;Se<=re&&Se<=Te;){const Ue=W[Se],nt=J[Se]=me?wi(J[Se]):Ps(J[Se]);if(Fo(Ue,nt))g(Ue,nt,ue,null,ae,U,Y,ce,me);else break;Se++}for(;Se<=re&&Se<=Te;){const Ue=W[re],nt=J[Te]=me?wi(J[Te]):Ps(J[Te]);if(Fo(Ue,nt))g(Ue,nt,ue,null,ae,U,Y,ce,me);else break;re--,Te--}if(Se>re){if(Se<=Te){const Ue=Te+1,nt=Ue<Ee?J[Ue].el:ie;for(;Se<=Te;)g(null,J[Se]=me?wi(J[Se]):Ps(J[Se]),ue,nt,ae,U,Y,ce,me),Se++}}else if(Se>Te)for(;Se<=re;)pe(W[Se],ae,U,!0),Se++;else{const Ue=Se,nt=Se,ct=new Map;for(Se=nt;Se<=Te;Se++){const xt=J[Se]=me?wi(J[Se]):Ps(J[Se]);xt.key!=null&&ct.set(xt.key,Se)}let Re,Pe=0;const st=Te-nt+1;let et=!1,mt=0;const dn=new Array(st);for(Se=0;Se<st;Se++)dn[Se]=0;for(Se=Ue;Se<=re;Se++){const xt=W[Se];if(Pe>=st){pe(xt,ae,U,!0);continue}let ln;if(xt.key!=null)ln=ct.get(xt.key);else for(Re=nt;Re<=Te;Re++)if(dn[Re-nt]===0&&Fo(xt,J[Re])){ln=Re;break}ln===void 0?pe(xt,ae,U,!0):(dn[ln-nt]=Se+1,ln>=mt?mt=ln:et=!0,g(xt,J[ln],ue,null,ae,U,Y,ce,me),Pe++)}const wn=et?G4(dn):Gl;for(Re=wn.length-1,Se=st-1;Se>=0;Se--){const xt=nt+Se,ln=J[xt],Sn=J[xt+1],Xe=xt+1<Ee?Sn.el||SS(Sn):ie;dn[Se]===0?g(null,ln,ue,Xe,ae,U,Y,ce,me):et&&(Re<0||Se!==wn[Re]?X(ln,ue,Xe,2):Re--)}}},X=(W,J,ue,ie,ae=null)=>{const{el:U,type:Y,transition:ce,children:me,shapeFlag:Se}=W;if(Se&6){X(W.component.subTree,J,ue,ie);return}if(Se&128){W.suspense.move(J,ue,ie);return}if(Se&64){Y.move(W,J,ue,ee);return}if(Y===Ne){s(U,J,ue);for(let re=0;re<me.length;re++)X(me[re],J,ue,ie);s(W.anchor,J,ue);return}if(Y===ta){k(W,J,ue);return}if(ie!==2&&Se&1&&ce)if(ie===0)ce.persisted&&!U[So]?s(U,J,ue):(ce.beforeEnter(U),s(U,J,ue),Pn(()=>ce.enter(U),ae));else{const{leave:re,delayLeave:Te,afterLeave:Ue}=ce,nt=()=>{W.ctx.isUnmounted?o(U):s(U,J,ue)},ct=()=>{const Re=U._isLeaving||!!U[So];U._isLeaving&&U[So](!0),ce.persisted&&!Re?nt():re(U,()=>{nt(),Ue&&Ue()})};Te?Te(U,nt,ct):ct()}else s(U,J,ue)},pe=(W,J,ue,ie=!1,ae=!1)=>{const{type:U,props:Y,ref:ce,children:me,dynamicChildren:Se,shapeFlag:Ee,patchFlag:re,dirs:Te,cacheIndex:Ue,memo:nt}=W;if(re===-2&&(ae=!1),ce!=null&&($i(),Jl(ce,null,ue,W,!0),Ni()),Ue!=null&&(J.renderCache[Ue]=void 0),Ee&256){J.ctx.deactivate(W);return}const ct=Ee&1&&Te,Re=!Ai(W);let Pe;if(Re&&(Pe=Y&&Y.onVnodeBeforeUnmount)&&Os(Pe,J,W),Ee&6)_e(W.component,ue,ie);else{if(Ee&128){W.suspense.unmount(ue,ie);return}ct&&ni(W,null,J,"beforeUnmount"),Ee&64?W.type.remove(W,J,ue,ee,ie):Se&&!Se.hasOnce&&(U!==Ne||re>0&&re&64)?de(Se,J,ue,!1,!0):(U===Ne&&re&384||!ae&&Ee&16)&&de(me,J,ue),ie&&oe(W)}const st=nt!=null&&Ue==null;(Re&&(Pe=Y&&Y.onVnodeUnmounted)||ct||st)&&Pn(()=>{Pe&&Os(Pe,J,W),ct&&ni(W,null,J,"unmounted"),st&&(W.el=null)},ue)},oe=W=>{const{type:J,el:ue,anchor:ie,transition:ae}=W;if(J===Ne){ye(ue,ie);return}if(J===ta){v(W);return}const U=()=>{o(ue),ae&&!ae.persisted&&ae.afterLeave&&ae.afterLeave()};if(W.shapeFlag&1&&ae&&!ae.persisted){const{leave:Y,delayLeave:ce}=ae,me=()=>Y(ue,U);ce?ce(W.el,U,me):me()}else U()},ye=(W,J)=>{let ue;for(;W!==J;)ue=h(W),o(W),W=ue;o(J)},_e=(W,J,ue)=>{const{bum:ie,scope:ae,job:U,subTree:Y,um:ce,m:me,a:Se}=W;Kd(me),Kd(Se),ie&&Xl(ie),ae.stop(),U&&(U.flags|=8,pe(Y,W,J,ue)),ce&&Pn(ce,J),Pn(()=>{W.isUnmounted=!0},J)},de=(W,J,ue,ie=!1,ae=!1,U=0)=>{for(let Y=U;Y<W.length;Y++)pe(W[Y],J,ue,ie,ae)},be=W=>{if(W.shapeFlag&6)return be(W.component.subTree);if(W.shapeFlag&128)return W.suspense.next();const J=h(W.anchor||W.el),ue=J&&J[X2];return ue?h(ue):J};let xe=!1;const Le=(W,J,ue)=>{let ie;W==null?J._vnode&&(pe(J._vnode,null,null,!0),ie=J._vnode.component):g(J._vnode||null,W,J,null,null,null,ue),J._vnode=W,xe||(xe=!0,_y(ie),jd(),xe=!1)},ee={p:g,um:pe,m:X,r:oe,mt:P,mc:b,pc:K,pbc:N,n:be,o:e};let ke,ge;return t&&([ke,ge]=t(ee)),{render:Le,hydrate:ke,createApp:L4(Le,ke)}}function Up({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function Wr({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function _S(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function P1(e,t,n=!1){const s=e.children,o=t.children;if(dt(s)&&dt(o))for(let i=0;i<s.length;i++){const r=s[i];let l=o[i];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=o[i]=wi(o[i]),l.el=r.el),!n&&l.patchFlag!==-2&&P1(r,l)),l.type===hr&&(l.patchFlag===-1&&(l=o[i]=wi(l)),l.el=r.el),l.type===Rn&&!l.el&&(l.el=r.el)}}function G4(e){const t=e.slice(),n=[0];let s,o,i,r,l;const a=e.length;for(s=0;s<a;s++){const c=e[s];if(c!==0){if(o=n[n.length-1],e[o]<c){t[s]=o,n.push(s);continue}for(i=0,r=n.length-1;i<r;)l=i+r>>1,e[n[l]]<c?i=l+1:r=l;c<e[n[i]]&&(i>0&&(t[s]=n[i-1]),n[i]=s)}}for(i=n.length,r=n[i-1];i-- >0;)n[i]=r,r=t[r];return n}function wS(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:wS(t)}function Kd(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function SS(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?SS(t.subTree):null}const Gd=e=>e.__isSuspense;let og=0;const Y4={name:"Suspense",__isSuspense:!0,process(e,t,n,s,o,i,r,l,a,c){if(e==null)X4(t,n,s,o,i,r,l,a,c);else{if(i&&i.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}Z4(e,t,n,s,o,r,l,a,c)}},hydrate:J4,normalize:Q4},gfe=Y4;function Pc(e,t){const n=e.props&&e.props[t];_t(n)&&n()}function X4(e,t,n,s,o,i,r,l,a){const{p:c,o:{createElement:u}}=a,d=u("div"),h=e.suspense=CS(e,o,s,t,d,n,i,r,l,a);c(null,h.pendingBranch=e.ssContent,d,null,s,h,i,r),h.deps>0?(Pc(e,"onPending"),Pc(e,"onFallback"),c(null,e.ssFallback,t,n,s,null,i,r),ea(h,e.ssFallback)):h.resolve(!1,!0)}function Z4(e,t,n,s,o,i,r,l,{p:a,um:c,o:{createElement:u}}){const d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;const h=t.ssContent,p=t.ssFallback,{activeBranch:f,pendingBranch:g,isInFallback:w,isHydrating:S}=d;if(g)d.pendingBranch=h,Fo(g,h)?(a(g,h,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0?d.resolve():w&&(S||(a(f,p,n,s,o,null,i,r,l),ea(d,p)))):(d.pendingId=og++,S?(d.isHydrating=!1,d.activeBranch=g):c(g,o,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u("div"),w?(a(null,h,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0?d.resolve():(a(f,p,n,s,o,null,i,r,l),ea(d,p))):f&&Fo(f,h)?(a(f,h,n,s,o,d,i,r,l),d.resolve(!0)):(a(null,h,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0&&d.resolve()));else if(f&&Fo(f,h))a(f,h,n,s,o,d,i,r,l),ea(d,h);else if(Pc(t,"onPending"),d.pendingBranch=h,h.shapeFlag&512?d.pendingId=h.component.suspenseId:d.pendingId=og++,a(null,h,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0)d.resolve();else{const{timeout:y,pendingId:k}=d;y>0?setTimeout(()=>{d.pendingId===k&&d.fallback(p)},y):y===0&&d.fallback(p)}}function CS(e,t,n,s,o,i,r,l,a,c,u=!1){const{p:d,m:h,um:p,n:f,o:{parentNode:g,remove:w}}=c;let S;const y=eE(e);y&&t&&t.pendingBranch&&(S=t.pendingId,t.deps++);const k=e.props?Dd(e.props.timeout):void 0,v=i,_={vnode:e,parent:t,parentComponent:n,namespace:r,container:s,hiddenContainer:o,deps:0,pendingId:og++,timeout:typeof k=="number"?k:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve(I=!1,A=!1){const{vnode:b,activeBranch:M,pendingBranch:N,pendingId:D,effects:$,parentComponent:O,container:P,isInFallback:R}=_;let F=!1;if(_.isHydrating)_.isHydrating=!1;else if(!I){F=M&&N.transition&&N.transition.mode==="out-in";let Z=!1;F&&(M.transition.afterLeave=()=>{D===_.pendingId&&(h(N,P,i===v&&!Z?f(M):i,0),qd($),R&&b.ssFallback&&(b.ssFallback.el=null))}),M&&!_.isFallbackMountPending&&(g(M.el)===P&&(i=f(M),Z=!0),p(M,O,_,!0),!F&&R&&b.ssFallback&&Pn(()=>b.ssFallback.el=null,_)),F||h(N,P,i,0)}_.isFallbackMountPending=!1,ea(_,N),_.pendingBranch=null,_.isInFallback=!1;let V=_.parent,K=!1;for(;V;){if(V.pendingBranch){V.effects.push(...$),K=!0;break}V=V.parent}!K&&!F&&qd($),_.effects=[],y&&t&&t.pendingBranch&&S===t.pendingId&&(t.deps--,t.deps===0&&!A&&t.resolve()),Pc(b,"onResolve")},fallback(I){if(!_.pendingBranch)return;const{vnode:A,activeBranch:b,parentComponent:M,container:N,namespace:D}=_;Pc(A,"onFallback");const $=f(b),O=()=>{_.isFallbackMountPending=!1,_.isInFallback&&(d(null,I,N,$,M,null,D,l,a),ea(_,I))},P=I.transition&&I.transition.mode==="out-in";P&&(_.isFallbackMountPending=!0,b.transition.afterLeave=O),_.isInFallback=!0,p(b,M,null,!0),P||O()},move(I,A,b){_.activeBranch&&h(_.activeBranch,I,A,b),_.container=I},next(){return _.activeBranch&&f(_.activeBranch)},registerDep(I,A,b){const M=!!_.pendingBranch;M&&_.deps++;const N=I.vnode.el;I.asyncDep.catch(D=>{ka(D,I,0)}).then(D=>{if(I.isUnmounted||_.isUnmounted||_.pendingId!==I.suspenseId)return;Rc(),I.asyncResolved=!0;const{vnode:$}=I;ig(I,D,!1),N&&($.el=N);const O=!N&&I.subTree.el;A(I,$,g(N||I.subTree.el),N?null:f(I.subTree),_,r,b),O&&($.placeholder=null,w(O)),oh(I,$.el),M&&--_.deps===0&&_.resolve()})},unmount(I,A){_.isUnmounted=!0,_.activeBranch&&p(_.activeBranch,n,I,A),_.pendingBranch&&p(_.pendingBranch,n,I,A)}};return _}function J4(e,t,n,s,o,i,r,l,a){const c=t.suspense=CS(t,s,n,e.parentNode,document.createElement("div"),null,o,i,r,l,!0),u=a(e,c.pendingBranch=t.ssContent,n,c,i,r);return c.deps===0&&c.resolve(!1,!0),u}function Q4(e){const{shapeFlag:t,children:n}=e,s=t&32;e.ssContent=Py(s?n.default:n),e.ssFallback=s?Py(n.fallback):bt(Rn)}function Py(e){let t;if(_t(e)){const n=rl&&e._c;n&&(e._d=!1,x()),e=e(),n&&(e._d=!0,t=vs,TS())}return dt(e)&&(e=R4(e)),e=Ps(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(n=>n!==e)),e}function xS(e,t){t&&t.pendingBranch?dt(e)?t.effects.push(...e):t.effects.push(e):qd(e)}function ea(e,t){e.activeBranch=t;const{vnode:n,parentComponent:s}=e;let o=t.el;for(;!o&&t.component;)t=t.component.subTree,o=t.el;n.el=o,s&&s.subTree===n&&(s.vnode.el=o,oh(s,o))}function eE(e){const t=e.props&&e.props.suspensible;return t!=null&&t!==!1}const Ne=Symbol.for("v-fgt"),hr=Symbol.for("v-txt"),Rn=Symbol.for("v-cmt"),ta=Symbol.for("v-stc"),gc=[];let vs=null;function x(e=!1){gc.push(vs=e?null:[])}function TS(){gc.pop(),vs=gc[gc.length-1]||null}let rl=1;function Yd(e,t=!1){rl+=e,e<0&&vs&&t&&(vs.hasOnce=!0)}function MS(e){return e.dynamicChildren=rl>0?vs||Gl:null,TS(),rl>0&&vs&&vs.push(e),e}function E(e,t,n,s,o,i){return MS(m(e,t,n,s,o,i,!0))}function Ke(e,t,n,s,o){return MS(bt(e,t,n,s,o,!0))}function yr(e){return e?e.__v_isVNode===!0:!1}function Fo(e,t){return e.type===t.type&&e.key===t.key}function vfe(e){}const AS=({key:e})=>e??null,bd=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?sn(e)||Nn(e)||_t(e)?{i:as,r:e,k:t,f:!!n}:e:null);function m(e,t=null,n=null,s=0,o=null,i=e===Ne?0:1,r=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&AS(t),ref:t&&bd(t),scopeId:th,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:s,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:as};return l?(R1(a,n),i&128&&e.normalize(a)):n&&(a.shapeFlag|=sn(n)?8:16),rl>0&&!r&&vs&&(a.patchFlag>0||i&6)&&a.patchFlag!==32&&vs.push(a),a}const bt=tE;function tE(e,t=null,n=null,s=0,o=null,i=!1){if((!e||e===iS)&&(e=Rn),yr(e)){const l=Oi(e,t,!0);return n&&R1(l,n),rl>0&&!i&&vs&&(l.shapeFlag&6?vs[vs.indexOf(e)]=l:vs.push(l)),l.patchFlag=-2,l}if(lE(e)&&(e=e.__vccOpts),t){t=nE(t);let{class:l,style:a}=t;l&&!sn(l)&&(t.class=Ie(l)),Kt(a)&&(eh(a)&&!dt(a)&&(a=en({},a)),t.style=Ft(a))}const r=sn(e)?1:Gd(e)?128:Z2(e)?64:Kt(e)?4:_t(e)?2:0;return m(e,t,n,s,o,r,i,!0)}function nE(e){return e?eh(e)||pS(e)?en({},e):e:null}function Oi(e,t,n=!1,s=!1){const{props:o,ref:i,patchFlag:r,children:l,transition:a}=e,c=t?Qt(o||{},t):o,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&AS(c),ref:t&&t.ref?n&&i?dt(i)?i.concat(bd(t)):[i,bd(t)]:bd(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Ne?r===-1?16:r|16:r,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Oi(e.ssContent),ssFallback:e.ssFallback&&Oi(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&s&&vr(u,a.clone(u)),u}function yt(e=" ",t=0){return bt(hr,null,e,t)}function kr(e,t){const n=bt(ta,null,e);return n.staticCount=t,n}function le(e="",t=!1){return t?(x(),Ke(Rn,null,e)):bt(Rn,null,e)}function Ps(e){return e==null||typeof e=="boolean"?bt(Rn):dt(e)?bt(Ne,null,e.slice()):yr(e)?wi(e):bt(hr,null,String(e))}function wi(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Oi(e)}function R1(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(dt(t))n=16;else if(typeof t=="object")if(s&65){const o=t.default;o&&(o._c&&(o._d=!1),R1(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!pS(t)?t._ctx=as:o===3&&as&&(as.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else _t(t)?(t={default:t,_ctx:as},n=32):(t=String(t),s&64?(n=16,t=[yt(t)]):n=8);e.children=t,e.shapeFlag|=n}function Qt(...e){const t={};for(let n=0;n<e.length;n++){const s=e[n];for(const o in s)if(o==="class")t.class!==s.class&&(t.class=Ie([t.class,s.class]));else if(o==="style")t.style=Ft([t.style,s.style]);else if(Jc(o)){const i=t[o],r=s[o];r&&i!==r&&!(dt(i)&&i.includes(r))?t[o]=i?[].concat(i,r):r:r==null&&i==null&&!Uf(o)&&(t[o]=r)}else o!==""&&(t[o]=s[o])}return t}function Os(e,t,n,s=null){$o(e,t,7,[n,s])}const sE=aS();let oE=0;function ES(e,t,n){const s=e.type,o=(t?t.appContext:e.appContext)||sE,i={uid:oE++,vnode:e,type:s,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new C2(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:gS(s,o),emitsOptions:uS(s,o),emit:null,emitted:null,propsDefaults:$t,inheritAttrs:s.inheritAttrs,ctx:$t,data:$t,props:$t,attrs:$t,slots:$t,refs:$t,setupState:$t,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return i.ctx={_:i},i.root=t?t.root:i,i.emit=O4.bind(null,i),e.ce&&e.ce(i),i}let rs=null;const cs=()=>rs||as;let Xd,na;{const e=Gf(),t=(n,s)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(s),i=>{o.length>1?o.forEach(r=>r(i)):o[0](i)}};Xd=t("__VUE_INSTANCE_SETTERS__",n=>rs=n),na=t("__VUE_SSR_SETTERS__",n=>ll=n)}const ba=e=>{const t=rs;return Xd(e),e.scope.on(),()=>{e.scope.off(),Xd(t)}},Rc=()=>{rs&&rs.scope.off(),Xd(null)};function IS(e){return e.vnode.shapeFlag&4}let ll=!1;function $S(e,t=!1,n=!1){t&&na(t);const{props:s,children:o}=e.vnode,i=IS(e);H4(e,s,i,t),j4(e,o,n||t);const r=i?iE(e,t):void 0;return t&&na(!1),r}function iE(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,eg);const{setup:s}=n;if(s){$i();const o=e.setupContext=s.length>1?LS(e):null,i=ba(e),r=Qc(s,e,0,[e.props,o]),l=k1(r);if(Ni(),i(),(l||e.sp)&&!Ai(e)&&M1(e),l){if(r.then(Rc,Rc),t)return r.then(a=>{ig(e,a,t)}).catch(a=>{ka(a,e,0)});e.asyncDep=r}else ig(e,r,t)}else NS(e,t)}function ig(e,t,n){_t(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Kt(t)&&(e.setupState=U2(t)),NS(e,n)}let Zd,rg;function yfe(e){Zd=e,rg=t=>{t.render._rc&&(t.withProxy=new Proxy(t.ctx,T4))}}const kfe=()=>!Zd;function NS(e,t,n){const s=e.type;if(!e.render){if(!t&&Zd&&!s.render){const o=s.template||N1(e).template;if(o){const{isCustomElement:i,compilerOptions:r}=e.appContext.config,{delimiters:l,compilerOptions:a}=s,c=en(en({isCustomElement:i,delimiters:l},r),a);s.render=Zd(o,c)}}e.render=s.render||Eo,rg&&rg(e)}{const o=ba(e);$i();try{M4(e)}finally{Ni(),o()}}}const rE={get(e,t){return ms(e,"get",""),e[t]}};function LS(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,rE),slots:e.slots,emit:e.emit,expose:t}}function su(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(U2(cr(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in mc)return mc[n](e)},has(t,n){return n in t||n in mc}})):e.proxy}function lg(e,t=!0){return _t(e)?e.displayName||e.name:e.name||t&&e.__name}function lE(e){return _t(e)&&"__vccOpts"in e}const H=(e,t)=>qA(e,t,ll);function Zt(e,t,n){try{Yd(-1);const s=arguments.length;return s===2?Kt(t)&&!dt(t)?yr(t)?bt(e,null,[t]):bt(e,t):bt(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&yr(n)&&(n=[n]),bt(e,t,n))}finally{Yd(1)}}function bfe(){}function _fe(e,t,n,s){const o=n[s];if(o&&aE(o,e))return o;const i=t();return i.memo=e.slice(),i.cacheIndex=s,n[s]=i}function aE(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let s=0;s<n.length;s++)if(is(n[s],t[s]))return!1;return rl>0&&vs&&vs.push(e),!0}const cE="3.5.35",wfe=Eo,Sfe=GA,Cfe=Fl,xfe=G2,uE={createComponentInstance:ES,setupComponent:$S,renderComponentRoot:kd,setCurrentRenderingInstance:Nc,isVNode:yr,normalizeVNode:Ps,getComponentPublicInstance:su,ensureValidVNode:$1,pushWarningContext:VA,popWarningContext:KA},Tfe=uE,Mfe=null,Afe=null,Efe=null;/**
|
|
17
|
-
* @vue/runtime-dom v3.5.35
|
|
18
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
19
|
-
* @license MIT
|
|
20
|
-
**/let ag;const Ry=typeof window<"u"&&window.trustedTypes;if(Ry)try{ag=Ry.createPolicy("vue",{createHTML:e=>e})}catch{}const OS=ag?e=>ag.createHTML(e):e=>e,dE="http://www.w3.org/2000/svg",fE="http://www.w3.org/1998/Math/MathML",bi=typeof document<"u"?document:null,Dy=bi&&bi.createElement("template"),hE={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const o=t==="svg"?bi.createElementNS(dE,e):t==="mathml"?bi.createElementNS(fE,e):n?bi.createElement(e,{is:n}):bi.createElement(e);return e==="select"&&s&&s.multiple!=null&&o.setAttribute("multiple",s.multiple),o},createText:e=>bi.createTextNode(e),createComment:e=>bi.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>bi.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,o,i){const r=n?n.previousSibling:t.lastChild;if(o&&(o===i||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===i||!(o=o.nextSibling)););else{Dy.innerHTML=OS(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const l=Dy.content;if(s==="svg"||s==="mathml"){const a=l.firstChild;for(;a.firstChild;)l.appendChild(a.firstChild);l.removeChild(a)}t.insertBefore(l,n)}return[r?r.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Xi="transition",Ya="animation",fa=Symbol("_vtc"),PS={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},RS=en({},Q2,PS),pE=e=>(e.displayName="Transition",e.props=RS,e),Pi=pE((e,{slots:t})=>Zt(r4,DS(e),t)),Ur=(e,t=[])=>{dt(e)?e.forEach(n=>n(...t)):e&&e(...t)},By=e=>e?dt(e)?e.some(t=>t.length>1):e.length>1:!1;function DS(e){const t={};for(const $ in e)$ in PS||(t[$]=e[$]);if(e.css===!1)return t;const{name:n="v",type:s,duration:o,enterFromClass:i=`${n}-enter-from`,enterActiveClass:r=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:a=i,appearActiveClass:c=r,appearToClass:u=l,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:h=`${n}-leave-active`,leaveToClass:p=`${n}-leave-to`}=e,f=mE(o),g=f&&f[0],w=f&&f[1],{onBeforeEnter:S,onEnter:y,onEnterCancelled:k,onLeave:v,onLeaveCancelled:_,onBeforeAppear:I=S,onAppear:A=y,onAppearCancelled:b=k}=t,M=($,O,P,R)=>{$._enterCancelled=R,sr($,O?u:l),sr($,O?c:r),P&&P()},N=($,O)=>{$._isLeaving=!1,sr($,d),sr($,p),sr($,h),O&&O()},D=$=>(O,P)=>{const R=$?A:y,F=()=>M(O,$,P);Ur(R,[O,F]),Fy(()=>{sr(O,$?a:i),Qo(O,$?u:l),By(R)||Hy(O,s,g,F)})};return en(t,{onBeforeEnter($){Ur(S,[$]),Qo($,i),Qo($,r)},onBeforeAppear($){Ur(I,[$]),Qo($,a),Qo($,c)},onEnter:D(!1),onAppear:D(!0),onLeave($,O){$._isLeaving=!0;const P=()=>N($,O);Qo($,d),$._enterCancelled?(Qo($,h),cg($)):(cg($),Qo($,h)),Fy(()=>{$._isLeaving&&(sr($,d),Qo($,p),By(v)||Hy($,s,w,P))}),Ur(v,[$,P])},onEnterCancelled($){M($,!1,void 0,!0),Ur(k,[$])},onAppearCancelled($){M($,!0,void 0,!0),Ur(b,[$])},onLeaveCancelled($){N($),Ur(_,[$])}})}function mE(e){if(e==null)return null;if(Kt(e))return[qp(e.enter),qp(e.leave)];{const t=qp(e);return[t,t]}}function qp(e){return Dd(e)}function Qo(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[fa]||(e[fa]=new Set)).add(t)}function sr(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const n=e[fa];n&&(n.delete(t),n.size||(e[fa]=void 0))}function Fy(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let gE=0;function Hy(e,t,n,s){const o=e._endId=++gE,i=()=>{o===e._endId&&s()};if(n!=null)return setTimeout(i,n);const{type:r,timeout:l,propCount:a}=BS(e,t);if(!r)return s();const c=r+"end";let u=0;const d=()=>{e.removeEventListener(c,h),i()},h=p=>{p.target===e&&++u>=a&&d()};setTimeout(()=>{u<a&&d()},l+1),e.addEventListener(c,h)}function BS(e,t){const n=window.getComputedStyle(e),s=f=>(n[f]||"").split(", "),o=s(`${Xi}Delay`),i=s(`${Xi}Duration`),r=Wy(o,i),l=s(`${Ya}Delay`),a=s(`${Ya}Duration`),c=Wy(l,a);let u=null,d=0,h=0;t===Xi?r>0&&(u=Xi,d=r,h=i.length):t===Ya?c>0&&(u=Ya,d=c,h=a.length):(d=Math.max(r,c),u=d>0?r>c?Xi:Ya:null,h=u?u===Xi?i.length:a.length:0);const p=u===Xi&&/\b(?:transform|all)(?:,|$)/.test(s(`${Xi}Property`).toString());return{type:u,timeout:d,propCount:h,hasTransform:p}}function Wy(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,s)=>Uy(n)+Uy(e[s])))}function Uy(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function cg(e){return(e?e.ownerDocument:document).body.offsetHeight}function vE(e,t,n){const s=e[fa];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Jd=Symbol("_vod"),FS=Symbol("_vsh"),Ho={name:"show",beforeMount(e,{value:t},{transition:n}){e[Jd]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):Xa(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:s}){!t!=!n&&(s?t?(s.beforeEnter(e),Xa(e,!0),s.enter(e)):s.leave(e,()=>{Xa(e,!1)}):Xa(e,t))},beforeUnmount(e,{value:t}){Xa(e,t)}};function Xa(e,t){e.style.display=t?e[Jd]:"none",e[FS]=!t}function yE(){Ho.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}}}const HS=Symbol("");function Ife(e){const t=cs();if(!t)return;const n=t.ut=(o=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(i=>Qd(i,o))},s=()=>{const o=e(t.proxy);t.ce?Qd(t.ce,o):ug(t.subTree,o),n(o)};oS(()=>{qd(s)}),tn(()=>{Ge(s,Eo,{flush:"post"});const o=new MutationObserver(s);o.observe(t.subTree.el.parentNode,{childList:!0}),Ht(()=>o.disconnect())})}function ug(e,t){if(e.shapeFlag&128){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{ug(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)Qd(e.el,t);else if(e.type===Ne)e.children.forEach(n=>ug(n,t));else if(e.type===ta){let{el:n,anchor:s}=e;for(;n&&(Qd(n,t),n!==s);)n=n.nextSibling}}function Qd(e,t){if(e.nodeType===1){const n=e.style;let s="";for(const o in t){const i=mA(t[o]);n.setProperty(`--${o}`,i),s+=`--${o}: ${i};`}n[HS]=s}}const kE=/(?:^|;)\s*display\s*:/;function bE(e,t,n){const s=e.style,o=sn(n);let i=!1;if(n&&!o){if(t)if(sn(t))for(const r of t.split(";")){const l=r.slice(0,r.indexOf(":")).trim();n[l]==null&&rc(s,l,"")}else for(const r in t)n[r]==null&&rc(s,r,"");for(const r in n){r==="display"&&(i=!0);const l=n[r];l!=null?wE(e,r,!sn(t)&&t?t[r]:void 0,l)||rc(s,r,l):rc(s,r,"")}}else if(o){if(t!==n){const r=s[HS];r&&(n+=";"+r),s.cssText=n,i=kE.test(n)}}else t&&e.removeAttribute("style");Jd in e&&(e[Jd]=i?s.display:"",e[FS]&&(s.display="none"))}const qy=/\s*!important$/;function rc(e,t,n){if(dt(n))n.forEach(s=>rc(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=_E(e,t);qy.test(n)?e.setProperty(Rs(s),n.replace(qy,""),"important"):e[s]=n}}const jy=["Webkit","Moz","ms"],jp={};function _E(e,t){const n=jp[t];if(n)return n;let s=Gn(t);if(s!=="filter"&&s in e)return jp[t]=s;s=Vf(s);for(let o=0;o<jy.length;o++){const i=jy[o]+s;if(i in e)return jp[t]=i}return t}function wE(e,t,n,s){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&sn(s)&&n===s}const zy="http://www.w3.org/1999/xlink";function Vy(e,t,n,s,o,i=hA(t)){s&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(zy,t.slice(6,t.length)):e.setAttributeNS(zy,t,n):n==null||i&&!_2(n)?e.removeAttribute(t):e.setAttribute(t,i?"":ro(n)?String(n):n)}function Ky(e,t,n,s,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?OS(n):n);return}const i=e.tagName;if(t==="value"&&i!=="PROGRESS"&&!i.includes("-")){const l=i==="OPTION"?e.getAttribute("value")||"":e.value,a=n==null?e.type==="checkbox"?"on":"":String(n);(l!==a||!("_value"in e))&&(e.value=a),n==null&&e.removeAttribute(t),e._value=n;return}let r=!1;if(n===""||n==null){const l=typeof e[t];l==="boolean"?n=_2(n):n==null&&l==="string"?(n="",r=!0):l==="number"&&(n=0,r=!0)}try{e[t]=n}catch{}r&&e.removeAttribute(o||t)}function xi(e,t,n,s){e.addEventListener(t,n,s)}function SE(e,t,n,s){e.removeEventListener(t,n,s)}const Gy=Symbol("_vei");function CE(e,t,n,s,o=null){const i=e[Gy]||(e[Gy]={}),r=i[t];if(s&&r)r.value=s;else{const[l,a]=xE(t);if(s){const c=i[t]=AE(s,o);xi(e,l,c,a)}else r&&(SE(e,l,r,a),i[t]=void 0)}}const Yy=/(?:Once|Passive|Capture)$/;function xE(e){let t;if(Yy.test(e)){t={};let s;for(;s=e.match(Yy);)e=e.slice(0,e.length-s[0].length),t[s[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Rs(e.slice(2)),t]}let zp=0;const TE=Promise.resolve(),ME=()=>zp||(TE.then(()=>zp=0),zp=Date.now());function AE(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;const o=n.value;if(dt(o)){const i=s.stopImmediatePropagation;s.stopImmediatePropagation=()=>{i.call(s),s._stopped=!0};const r=o.slice(),l=[s];for(let a=0;a<r.length&&!s._stopped;a++){const c=r[a];c&&$o(c,t,5,l)}}else $o(o,t,5,[s])};return n.value=e,n.attached=ME(),n}const Xy=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,EE=(e,t,n,s,o,i)=>{const r=o==="svg";t==="class"?vE(e,s,r):t==="style"?bE(e,n,s):Jc(t)?Uf(t)||CE(e,t,n,s,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):IE(e,t,s,r))?(Ky(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Vy(e,t,s,r,i,t!=="value")):e._isVueCE&&($E(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!sn(s)))?Ky(e,Gn(t),s,i,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),Vy(e,t,s,r))};function IE(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&Xy(t)&&_t(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return Xy(t)&&sn(n)?!1:t in e}function $E(e,t){const n=e._def.props;if(!n)return!1;const s=Gn(t);return Array.isArray(n)?n.some(o=>Gn(o)===s):Object.keys(n).some(o=>Gn(o)===s)}const Zy={};function NE(e,t,n){let s=Je(e,t);qf(s)&&(s=en({},s,t));class o extends D1{constructor(r){super(s,r,n)}}return o.def=s,o}const $fe=((e,t)=>NE(e,t,GE)),LE=typeof HTMLElement<"u"?HTMLElement:class{};class D1 extends LE{constructor(t,n={},s=sf){super(),this._def=t,this._props=n,this._createApp=s,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._patching=!1,this._dirty=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._styleAnchors=new WeakMap,this._ob=null,this.shadowRoot&&s!==sf?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(en({},t.shadowRootOptions,{mode:"open"})),this._root=this.shadowRoot):this._root=this}connectedCallback(){if(!this.isConnected)return;!this.shadowRoot&&!this._resolved&&this._parseSlots(),this._connected=!0;let t=this;for(;t=t&&(t.assignedSlot||t.parentNode||t.host);)if(t instanceof D1){this._parent=t;break}this._instance||(this._resolved?this._mount(this._def):t&&t._pendingResolve?this._pendingResolve=t._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(t=this._parent){t&&(this._instance.parent=t._instance,this._inheritParentContext(t))}_inheritParentContext(t=this._parent){t&&this._app&&Object.setPrototypeOf(this._app._context.provides,t._instance.provides)}disconnectedCallback(){this._connected=!1,vt(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&(this._teleportTargets.clear(),this._teleportTargets=void 0))})}_processMutations(t){for(const n of t)this._setAttr(n.attributeName)}_resolveDef(){if(this._pendingResolve)return;for(let s=0;s<this.attributes.length;s++)this._setAttr(this.attributes[s].name);this._ob=new MutationObserver(this._processMutations.bind(this)),this._ob.observe(this,{attributes:!0});const t=(s,o=!1)=>{this._resolved=!0,this._pendingResolve=void 0;const{props:i,styles:r}=s;let l;if(i&&!dt(i))for(const a in i){const c=i[a];(c===Number||c&&c.type===Number)&&(a in this._props&&(this._props[a]=Dd(this._props[a])),(l||(l=Object.create(null)))[Gn(a)]=!0)}this._numberProps=l,this._resolveProps(s),this.shadowRoot&&this._applyStyles(r),this._mount(s)},n=this._def.__asyncLoader;n?this._pendingResolve=n().then(s=>{s.configureApp=this._def.configureApp,t(this._def=s,!0)}):t(this._def)}_mount(t){this._app=this._createApp(t),this._inheritParentContext(),t.configureApp&&t.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const n=this._instance&&this._instance.exposed;if(n)for(const s in n)Vt(this,s)||Object.defineProperty(this,s,{get:()=>C(n[s])})}_resolveProps(t){const{props:n}=t,s=dt(n)?n:Object.keys(n||{});for(const o of Object.keys(this))o[0]!=="_"&&s.includes(o)&&this._setProp(o,this[o]);for(const o of s.map(Gn))Object.defineProperty(this,o,{get(){return this._getProp(o)},set(i){this._setProp(o,i,!0,!this._patching)}})}_setAttr(t){if(t.startsWith("data-v-"))return;const n=this.hasAttribute(t);let s=n?this.getAttribute(t):Zy;const o=Gn(t);n&&this._numberProps&&this._numberProps[o]&&(s=Dd(s)),this._setProp(o,s,!1,!0)}_getProp(t){return this._props[t]}_setProp(t,n,s=!0,o=!1){if(n!==this._props[t]&&(this._dirty=!0,n===Zy?delete this._props[t]:(this._props[t]=n,t==="key"&&this._app&&(this._app._ceVNode.key=n)),o&&this._instance&&this._update(),s)){const i=this._ob;i&&(this._processMutations(i.takeRecords()),i.disconnect()),n===!0?this.setAttribute(Rs(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute(Rs(t),n+""):n||this.removeAttribute(Rs(t)),i&&i.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),KE(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const n=bt(this._def,en(t,this._props));return this._instance||(n.ce=s=>{this._instance=s,s.ce=this,s.isCE=!0;const o=(i,r)=>{this.dispatchEvent(new CustomEvent(i,qf(r[0])?en({detail:r},r[0]):{detail:r}))};s.emit=(i,...r)=>{o(i,r),Rs(i)!==i&&o(Rs(i),r)},this._setParent()}),n}_applyStyles(t,n,s){if(!t)return;if(n){if(n===this._def||this._styleChildren.has(n))return;this._styleChildren.add(n)}const o=this._nonce,i=this.shadowRoot,r=s?this._getStyleAnchor(s)||this._getStyleAnchor(this._def):this._getRootStyleInsertionAnchor(i);let l=null;for(let a=t.length-1;a>=0;a--){const c=document.createElement("style");o&&c.setAttribute("nonce",o),c.textContent=t[a],i.insertBefore(c,l||r),l=c,a===0&&(s||this._styleAnchors.set(this._def,c),n&&this._styleAnchors.set(n,c))}}_getStyleAnchor(t){if(!t)return null;const n=this._styleAnchors.get(t);return n&&n.parentNode===this.shadowRoot?n:(n&&this._styleAnchors.delete(t),null)}_getRootStyleInsertionAnchor(t){for(let n=0;n<t.childNodes.length;n++){const s=t.childNodes[n];if(!(s instanceof HTMLStyleElement))return s}return null}_parseSlots(){const t=this._slots={};let n;for(;n=this.firstChild;){const s=n.nodeType===1&&n.getAttribute("slot")||"default";(t[s]||(t[s]=[])).push(n),this.removeChild(n)}}_renderSlots(){const t=this._getSlots(),n=this._instance.type.__scopeId;for(let s=0;s<t.length;s++){const o=t[s],i=o.getAttribute("name")||"default",r=this._slots[i],l=o.parentNode;if(r)for(const a of r){if(n&&a.nodeType===1){const c=n+"-s",u=document.createTreeWalker(a,1);a.setAttribute(c,"");let d;for(;d=u.nextNode();)d.setAttribute(c,"")}l.insertBefore(a,o)}else for(;o.firstChild;)l.insertBefore(o.firstChild,o);l.removeChild(o)}}_getSlots(){const t=[this];this._teleportTargets&&t.push(...this._teleportTargets);const n=new Set;for(const s of t){const o=s.querySelectorAll("slot");for(let i=0;i<o.length;i++)n.add(o[i])}return Array.from(n)}_injectChildStyle(t,n){this._applyStyles(t.styles,t,n)}_beginPatch(){this._patching=!0,this._dirty=!1}_endPatch(){this._patching=!1,this._dirty&&this._instance&&this._update()}_hasShadowRoot(){return this._def.shadowRoot!==!1}_removeChildStyle(t){}}function OE(e){const t=cs(),n=t&&t.ce;return n||null}function Nfe(){const e=OE();return e&&e.shadowRoot}function Lfe(e="$style"){{const t=cs();if(!t)return $t;const n=t.type.__cssModules;if(!n)return $t;const s=n[e];return s||$t}}const WS=new WeakMap,US=new WeakMap,ef=Symbol("_moveCb"),Jy=Symbol("_enterCb"),PE=e=>(delete e.props.mode,e),RE=PE({name:"TransitionGroup",props:en({},RS,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=cs(),s=J2();let o,i;return A1(()=>{if(!o.length)return;const r=e.moveClass||`${e.name||"v"}-move`;if(!HE(o[0].el,n.vnode.el,r)){o=[];return}o.forEach(DE),o.forEach(BE);const l=o.filter(FE);cg(n.vnode.el),l.forEach(a=>{const c=a.el,u=c.style;Qo(c,r),u.transform=u.webkitTransform=u.transitionDuration="";const d=c[ef]=h=>{h&&h.target!==c||(!h||h.propertyName.endsWith("transform"))&&(c.removeEventListener("transitionend",d),c[ef]=null,sr(c,r))};c.addEventListener("transitionend",d)}),o=[]}),()=>{const r=Bt(e),l=DS(r);let a=r.tag||Ne;if(o=[],i)for(let c=0;c<i.length;c++){const u=i[c];u.el&&u.el instanceof Element&&(o.push(u),vr(u,Lc(u,l,s,n)),WS.set(u,qS(u.el)))}i=t.default?T1(t.default()):[];for(let c=0;c<i.length;c++){const u=i[c];u.key!=null&&vr(u,Lc(u,l,s,n))}return bt(a,null,i)}}}),Ofe=RE;function DE(e){const t=e.el;t[ef]&&t[ef](),t[Jy]&&t[Jy]()}function BE(e){US.set(e,qS(e.el))}function FE(e){const t=WS.get(e),n=US.get(e),s=t.left-n.left,o=t.top-n.top;if(s||o){const i=e.el,r=i.style,l=i.getBoundingClientRect();let a=1,c=1;return i.offsetWidth&&(a=l.width/i.offsetWidth),i.offsetHeight&&(c=l.height/i.offsetHeight),(!Number.isFinite(a)||a===0)&&(a=1),(!Number.isFinite(c)||c===0)&&(c=1),Math.abs(a-1)<.01&&(a=1),Math.abs(c-1)<.01&&(c=1),r.transform=r.webkitTransform=`translate(${s/a}px,${o/c}px)`,r.transitionDuration="0s",e}}function qS(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function HE(e,t,n){const s=e.cloneNode(),o=e[fa];o&&o.forEach(l=>{l.split(/\s+/).forEach(a=>a&&s.classList.remove(a))}),n.split(/\s+/).forEach(l=>l&&s.classList.add(l)),s.style.display="none";const i=t.nodeType===1?t:t.parentNode;i.appendChild(s);const{hasTransform:r}=BS(s);return i.removeChild(s),r}const br=e=>{const t=e.props["onUpdate:modelValue"]||!1;return dt(t)?n=>Xl(t,n):t};function WE(e){e.target.composing=!0}function Qy(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Io=Symbol("_assign");function ek(e,t,n){return t&&(e=e.trim()),n&&(e=Kf(e)),e}const An={created(e,{modifiers:{lazy:t,trim:n,number:s}},o){e[Io]=br(o);const i=s||o.props&&o.props.type==="number";xi(e,t?"change":"input",r=>{r.target.composing||e[Io](ek(e.value,n,i))}),(n||i)&&xi(e,"change",()=>{e.value=ek(e.value,n,i)}),t||(xi(e,"compositionstart",WE),xi(e,"compositionend",Qy),xi(e,"change",Qy))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:o,number:i}},r){if(e[Io]=br(r),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?Kf(e.value):e.value,a=t??"";if(l===a)return;const c=e.getRootNode();(c instanceof Document||c instanceof ShadowRoot)&&c.activeElement===e&&e.type!=="range"&&(s&&t===n||o&&e.value.trim()===a)||(e.value=a)}},tf={deep:!0,created(e,t,n){e[Io]=br(n),xi(e,"change",()=>{const s=e._modelValue,o=ha(e),i=e.checked,r=e[Io];if(dt(s)){const l=Yf(s,o),a=l!==-1;if(i&&!a)r(s.concat(o));else if(!i&&a){const c=[...s];c.splice(l,1),r(c)}}else if(cl(s)){const l=new Set(s);i?l.add(o):l.delete(o),r(l)}else r(zS(e,i))})},mounted:tk,beforeUpdate(e,t,n){e[Io]=br(n),tk(e,t,n)}};function tk(e,{value:t,oldValue:n},s){e._modelValue=t;let o;if(dt(t))o=Yf(t,s.props.value)>-1;else if(cl(t))o=t.has(s.props.value);else{if(t===n)return;o=Ii(t,zS(e,!0))}e.checked!==o&&(e.checked=o)}const jS={created(e,{value:t},n){e.checked=Ii(t,n.props.value),e[Io]=br(n),xi(e,"change",()=>{e[Io](ha(e))})},beforeUpdate(e,{value:t,oldValue:n},s){e[Io]=br(s),t!==n&&(e.checked=Ii(t,s.props.value))}},nf={deep:!0,created(e,{value:t,modifiers:{number:n}},s){const o=cl(t);xi(e,"change",()=>{const i=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?Kf(ha(r)):ha(r));e[Io](e.multiple?o?new Set(i):i:i[0]),e._assigning=!0,vt(()=>{e._assigning=!1})}),e[Io]=br(s)},mounted(e,{value:t}){nk(e,t)},beforeUpdate(e,t,n){e[Io]=br(n)},updated(e,{value:t}){e._assigning||nk(e,t)}};function nk(e,t){const n=e.multiple,s=dt(t);if(!(n&&!s&&!cl(t))){for(let o=0,i=e.options.length;o<i;o++){const r=e.options[o],l=ha(r);if(n)if(s){const a=typeof l;a==="string"||a==="number"?r.selected=t.some(c=>String(c)===String(l)):r.selected=Yf(t,l)>-1}else r.selected=t.has(l);else if(Ii(ha(r),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function ha(e){return"_value"in e?e._value:e.value}function zS(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const UE={created(e,t,n){Ku(e,t,n,null,"created")},mounted(e,t,n){Ku(e,t,n,null,"mounted")},beforeUpdate(e,t,n,s){Ku(e,t,n,s,"beforeUpdate")},updated(e,t,n,s){Ku(e,t,n,s,"updated")}};function VS(e,t){switch(e){case"SELECT":return nf;case"TEXTAREA":return An;default:switch(t){case"checkbox":return tf;case"radio":return jS;default:return An}}}function Ku(e,t,n,s,o){const r=VS(e.tagName,n.props&&n.props.type)[o];r&&r(e,t,n,s)}function qE(){An.getSSRProps=({value:e})=>({value:e}),jS.getSSRProps=({value:e},t)=>{if(t.props&&Ii(t.props.value,e))return{checked:!0}},tf.getSSRProps=({value:e},t)=>{if(dt(e)){if(t.props&&Yf(e,t.props.value)>-1)return{checked:!0}}else if(cl(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},UE.getSSRProps=(e,t)=>{if(typeof t.type!="string")return;const n=VS(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}const jE=["ctrl","shift","alt","meta"],zE={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>jE.some(n=>e[`${n}Key`]&&!t.includes(n))},Ze=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=((o,...i)=>{for(let r=0;r<t.length;r++){const l=zE[t[r]];if(l&&l(o,t))return}return e(o,...i)}))},VE={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Mo=(e,t)=>{const n=e._withKeys||(e._withKeys={}),s=t.join(".");return n[s]||(n[s]=(o=>{if(!("key"in o))return;const i=Rs(o.key);if(t.some(r=>r===i||VE[r]===i))return e(o)}))},KS=en({patchProp:EE},hE);let vc,sk=!1;function GS(){return vc||(vc=V4(KS))}function YS(){return vc=sk?vc:K4(KS),sk=!0,vc}const KE=((...e)=>{GS().render(...e)}),Pfe=((...e)=>{YS().hydrate(...e)}),sf=((...e)=>{const t=GS().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=ZS(s);if(!o)return;const i=t._component;!_t(i)&&!i.render&&!i.template&&(i.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const r=n(o,!1,XS(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),r},t}),GE=((...e)=>{const t=YS().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=ZS(s);if(o)return n(o,!0,XS(o))},t});function XS(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function ZS(e){return sn(e)?document.querySelector(e):e}let ok=!1;const Rfe=()=>{ok||(ok=!0,qE(),yE())};/*!
|
|
21
|
-
* shared v11.4.5
|
|
22
|
-
* (c) 2026 kazuya kawaguchi
|
|
23
|
-
* Released under the MIT License.
|
|
24
|
-
*/function YE(e,t){typeof console<"u"&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const of=typeof window<"u",xr=(e,t=!1)=>t?Symbol.for(e):Symbol(e),XE=(e,t,n)=>ZE({l:e,k:t,s:n}),ZE=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),Dn=e=>typeof e=="number"&&isFinite(e),JS=e=>F1(e)==="[object Date]",pa=e=>F1(e)==="[object RegExp]",ih=e=>Lt(e)&&Object.keys(e).length===0,Bn=Object.assign,JE=Object.create,nn=(e=null)=>JE(e);let ik;const Jr=()=>ik||(ik=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:nn());function rk(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/").replace(/=/g,"=")}function QE(e){return e.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}const eI=/^\s*javascript\s*(?::|�*58;?|�*3a;?|:?)/i,tI=/^(?:href|src|action|formaction)$/i;function B1(e){return eI.test(e)}function nI(e){const t=/url\s*\(/gi;let n="",s=0,o;for(;(o=t.exec(e))!==null;){const i=o.index,r=t.lastIndex-1;let l=r+1,a=1,c=null;for(;l<e.length;l++){const h=e[l];if(c){h===c&&(c=null);continue}if(h==='"'||h==="'")c=h;else if(h==="(")a++;else if(h===")"&&(a--,a===0))break}if(a!==0)break;const u=e.slice(r+1,l).trim(),d=u.startsWith('"')&&u.endsWith('"')||u.startsWith("'")&&u.endsWith("'")?u.slice(1,-1).trim():u;n+=e.slice(s,i),n+=B1(d)?"url(about:blank)":e.slice(i,l+1),s=l+1}return n+e.slice(s)}function lk(e,t){if(tI.test(e)&&B1(t))return"about:blank";const n=e.toLowerCase()==="style"?nI(t):t;return QE(n)}function sI(e){return e=e.replace(/([\w:-]+)\s*=\s*"([^"]*)"/g,(n,s,o)=>`${s}="${lk(s,o)}"`),e=e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g,(n,s,o)=>`${s}='${lk(s,o)}'`),/\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi.test(e)&&(e=e.replace(/(\s+)(on)(\w+\s*=)/gi,"$1on$3")),e=e.replace(/(\s+(?:href|src|action|formaction)\s*=\s*)([^\s"'=<>`]+)/gi,(n,s,o)=>B1(o)?`${s}about:blank`:n),e}const oI=Object.prototype.hasOwnProperty;function Ao(e,t){return oI.call(e,t)}const Tn=Array.isArray,vn=e=>typeof e=="function",at=e=>typeof e=="string",Ut=e=>typeof e=="boolean",qt=e=>e!==null&&typeof e=="object",iI=e=>qt(e)&&vn(e.then)&&vn(e.catch),QS=Object.prototype.toString,F1=e=>QS.call(e),Lt=e=>F1(e)==="[object Object]",rI=e=>e==null?"":Tn(e)||Lt(e)&&e.toString===QS?JSON.stringify(e,null,2):String(e);function H1(e,t=""){return e.reduce((n,s,o)=>o===0?n+s:n+t+s,"")}const Gu=e=>!qt(e)||Tn(e);function _d(e,t){if(Gu(e)||Gu(t))throw new Error("Invalid value");const n=[{src:e,des:t}];for(;n.length;){const{src:s,des:o}=n.pop();Object.keys(s).forEach(i=>{i!=="__proto__"&&(qt(s[i])&&!qt(o[i])&&(o[i]=Array.isArray(s[i])?[]:nn()),Gu(o[i])||Gu(s[i])?o[i]=s[i]:n.push({src:s[i],des:o[i]}))})}}/*!
|
|
25
|
-
* message-compiler v11.4.5
|
|
26
|
-
* (c) 2026 kazuya kawaguchi
|
|
27
|
-
* Released under the MIT License.
|
|
28
|
-
*/function lI(e,t,n){return{line:e,column:t,offset:n}}function dg(e,t,n){return{start:e,end:t}}const Xt={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14},aI=17;function rh(e,t,n={}){const{domain:s,messages:o,args:i}=n,r=e,l=new SyntaxError(String(r));return l.code=e,t&&(l.location=t),l.domain=s,l}function cI(e){throw e}const Zo=" ",uI="\r",ds=`
|
|
29
|
-
`,dI="\u2028",fI="\u2029";function hI(e){const t=e;let n=0,s=1,o=1,i=0;const r=A=>t[A]===uI&&t[A+1]===ds,l=A=>t[A]===ds,a=A=>t[A]===fI,c=A=>t[A]===dI,u=A=>r(A)||l(A)||a(A)||c(A),d=()=>n,h=()=>s,p=()=>o,f=()=>i,g=A=>r(A)||a(A)||c(A)?ds:t[A],w=()=>g(n),S=()=>g(n+i);function y(){return i=0,u(n)&&(s++,o=0),r(n)&&n++,n++,o++,t[n]}function k(){return r(n+i)&&i++,i++,t[n+i]}function v(){n=0,s=1,o=1,i=0}function _(A=0){i=A}function I(){const A=n+i;for(;A!==n;)y();i=0}return{index:d,line:h,column:p,peekOffset:f,charAt:g,currentChar:w,currentPeek:S,next:y,peek:k,reset:v,resetPeek:_,skipToPeek:I}}const ki=void 0,pI=".",ak="'",mI="tokenizer";function gI(e,t={}){const n=t.location!==!1,s=hI(e),o=()=>s.index(),i=()=>lI(s.line(),s.column(),s.index()),r=i(),l=o(),a={currentType:13,offset:l,startLoc:r,endLoc:r,lastType:13,lastOffset:l,lastStartLoc:r,lastEndLoc:r,braceNest:0,inLinked:!1,text:""},c=()=>a,{onError:u}=t;function d(U,Y,ce,...me){const Se=c();if(Y.column+=ce,Y.offset+=ce,u){const Ee=n?dg(Se.startLoc,Y):null,re=rh(U,Ee,{domain:mI,args:me});u(re)}}function h(U,Y,ce){U.endLoc=i(),U.currentType=Y;const me={type:Y};return n&&(me.loc=dg(U.startLoc,U.endLoc)),ce!=null&&(me.value=ce),me}const p=U=>h(U,13);function f(U,Y){return U.currentChar()===Y?(U.next(),Y):(d(Xt.EXPECTED_TOKEN,i(),0,Y),"")}function g(U){let Y="";for(;U.currentPeek()===Zo||U.currentPeek()===ds;)Y+=U.currentPeek(),U.peek();return Y}function w(U){const Y=g(U);return U.skipToPeek(),Y}function S(U){if(U===ki)return!1;const Y=U.charCodeAt(0);return Y>=97&&Y<=122||Y>=65&&Y<=90||Y===95}function y(U){if(U===ki)return!1;const Y=U.charCodeAt(0);return Y>=48&&Y<=57}function k(U,Y){const{currentType:ce}=Y;if(ce!==2)return!1;g(U);const me=S(U.currentPeek());return U.resetPeek(),me}function v(U,Y){const{currentType:ce}=Y;if(ce!==2)return!1;g(U);const me=U.currentPeek()==="-"?U.peek():U.currentPeek(),Se=y(me);return U.resetPeek(),Se}function _(U,Y){const{currentType:ce}=Y;if(ce!==2)return!1;g(U);const me=U.currentPeek()===ak;return U.resetPeek(),me}function I(U,Y){const{currentType:ce}=Y;if(ce!==7)return!1;g(U);const me=U.currentPeek()===".";return U.resetPeek(),me}function A(U,Y){const{currentType:ce}=Y;if(ce!==8)return!1;g(U);const me=S(U.currentPeek());return U.resetPeek(),me}function b(U,Y){const{currentType:ce}=Y;if(!(ce===7||ce===11))return!1;g(U);const me=U.currentPeek()===":";return U.resetPeek(),me}function M(U,Y){const{currentType:ce}=Y;if(ce!==9)return!1;const me=()=>{const Ee=U.currentPeek();return Ee==="{"?S(U.peek()):Ee==="@"||Ee==="|"||Ee===":"||Ee==="."||Ee===Zo||!Ee?!1:Ee===ds?(U.peek(),me()):D(U,!1)},Se=me();return U.resetPeek(),Se}function N(U){g(U);const Y=U.currentPeek()==="|";return U.resetPeek(),Y}function D(U,Y=!0){const ce=(Se=!1,Ee="")=>{const re=U.currentPeek();return re==="{"||re==="@"||!re?Se:re==="|"?!(Ee===Zo||Ee===ds):re===Zo?(U.peek(),ce(!0,Zo)):re===ds?(U.peek(),ce(!0,ds)):!0},me=ce();return Y&&U.resetPeek(),me}function $(U,Y){const ce=U.currentChar();return ce===ki?ki:Y(ce)?(U.next(),ce):null}function O(U){const Y=U.charCodeAt(0);return Y>=97&&Y<=122||Y>=65&&Y<=90||Y>=48&&Y<=57||Y===95||Y===36}function P(U){return $(U,O)}function R(U){const Y=U.charCodeAt(0);return Y>=97&&Y<=122||Y>=65&&Y<=90||Y>=48&&Y<=57||Y===95||Y===36||Y===45}function F(U){return $(U,R)}function V(U){const Y=U.charCodeAt(0);return Y>=48&&Y<=57}function K(U){return $(U,V)}function Z(U){const Y=U.charCodeAt(0);return Y>=48&&Y<=57||Y>=65&&Y<=70||Y>=97&&Y<=102}function G(U){return $(U,Z)}function X(U){let Y="",ce="";for(;Y=K(U);)ce+=Y;return ce}function pe(U){let Y="";for(;;){const ce=U.currentChar();if(ce==="\\"){const me=U.peek();me==="{"||me==="}"||me==="@"||me==="|"||me==="\\"?(Y+=ce+me,U.next(),U.next()):(U.resetPeek(),Y+=ce,U.next())}else{if(ce==="{"||ce==="}"||ce==="@"||ce==="|"||!ce)break;if(ce===Zo||ce===ds)if(D(U))Y+=ce,U.next();else{if(N(U))break;Y+=ce,U.next()}else Y+=ce,U.next()}}return Y}function oe(U){w(U);let Y="",ce="";for(;Y=F(U);)ce+=Y;const me=U.currentChar();if(me&&me!=="}"&&me!==ki&&me!==Zo&&me!==ds&&me!==" "){const Se=ee(U);return d(Xt.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,ce+Se),ce+Se}return U.currentChar()===ki&&d(Xt.UNTERMINATED_CLOSING_BRACE,i(),0),ce}function ye(U){w(U);let Y="";return U.currentChar()==="-"?(U.next(),Y+=`-${X(U)}`):Y+=X(U),U.currentChar()===ki&&d(Xt.UNTERMINATED_CLOSING_BRACE,i(),0),Y}function _e(U){return U!==ak&&U!==ds}function de(U){w(U),f(U,"'");let Y="",ce="";for(;Y=$(U,_e);)Y==="\\"?ce+=be(U):ce+=Y;const me=U.currentChar();return me===ds||me===ki?(d(Xt.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,i(),0),me===ds&&(U.next(),f(U,"'")),ce):(f(U,"'"),ce)}function be(U){const Y=U.currentChar();switch(Y){case"\\":case"'":return U.next(),`\\${Y}`;case"u":return xe(U,Y,4);case"U":return xe(U,Y,6);default:return d(Xt.UNKNOWN_ESCAPE_SEQUENCE,i(),0,Y),""}}function xe(U,Y,ce){f(U,Y);let me="";for(let Se=0;Se<ce;Se++){const Ee=G(U);if(!Ee){d(Xt.INVALID_UNICODE_ESCAPE_SEQUENCE,i(),0,`\\${Y}${me}${U.currentChar()}`);break}me+=Ee}return`\\${Y}${me}`}function Le(U){return U!=="{"&&U!=="}"&&U!==Zo&&U!==ds}function ee(U){w(U);let Y="",ce="";for(;Y=$(U,Le);)ce+=Y;return ce}function ke(U){let Y="",ce="";for(;Y=P(U);)ce+=Y;return ce}function ge(U){const Y=ce=>{const me=U.currentChar();return me==="{"||me==="@"||me==="|"||me==="("||me===")"||!me||me===Zo?ce:(ce+=me,U.next(),Y(ce))};return Y("")}function W(U){w(U);const Y=f(U,"|");return w(U),Y}function J(U,Y){let ce=null;switch(U.currentChar()){case"{":return Y.braceNest>=1&&d(Xt.NOT_ALLOW_NEST_PLACEHOLDER,i(),0),U.next(),ce=h(Y,2,"{"),w(U),Y.braceNest++,ce;case"}":return Y.braceNest>0&&Y.currentType===2&&d(Xt.EMPTY_PLACEHOLDER,i(),0),U.next(),ce=h(Y,3,"}"),Y.braceNest--,Y.braceNest>0&&w(U),Y.inLinked&&Y.braceNest===0&&(Y.inLinked=!1),ce;case"@":return Y.braceNest>0&&d(Xt.UNTERMINATED_CLOSING_BRACE,i(),0),ce=ue(U,Y)||p(Y),Y.braceNest=0,ce;default:{let Se=!0,Ee=!0,re=!0;if(N(U))return Y.braceNest>0&&d(Xt.UNTERMINATED_CLOSING_BRACE,i(),0),ce=h(Y,1,W(U)),Y.braceNest=0,Y.inLinked=!1,ce;if(Y.braceNest>0&&(Y.currentType===4||Y.currentType===5||Y.currentType===6))return d(Xt.UNTERMINATED_CLOSING_BRACE,i(),0),Y.braceNest=0,ie(U,Y);if(Se=k(U,Y))return ce=h(Y,4,oe(U)),w(U),ce;if(Ee=v(U,Y))return ce=h(Y,5,ye(U)),w(U),ce;if(re=_(U,Y))return ce=h(Y,6,de(U)),w(U),ce;if(!Se&&!Ee&&!re)return ce=h(Y,12,ee(U)),d(Xt.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,ce.value),w(U),ce;break}}return ce}function ue(U,Y){const{currentType:ce}=Y;let me=null;const Se=U.currentChar();switch((ce===7||ce===8||ce===11||ce===9)&&(Se===ds||Se===Zo)&&d(Xt.INVALID_LINKED_FORMAT,i(),0),Se){case"@":return U.next(),me=h(Y,7,"@"),Y.inLinked=!0,me;case".":return w(U),U.next(),h(Y,8,".");case":":return w(U),U.next(),h(Y,9,":");default:return N(U)?(me=h(Y,1,W(U)),Y.braceNest=0,Y.inLinked=!1,me):I(U,Y)||b(U,Y)?(w(U),ue(U,Y)):A(U,Y)?(w(U),h(Y,11,ke(U))):M(U,Y)?(w(U),Se==="{"?J(U,Y)||me:h(Y,10,ge(U))):(ce===7&&d(Xt.INVALID_LINKED_FORMAT,i(),0),Y.braceNest=0,Y.inLinked=!1,ie(U,Y))}}function ie(U,Y){let ce={type:13};if(Y.braceNest>0)return J(U,Y)||p(Y);if(Y.inLinked)return ue(U,Y)||p(Y);switch(U.currentChar()){case"{":return J(U,Y)||p(Y);case"}":return d(Xt.UNBALANCED_CLOSING_BRACE,i(),0),U.next(),h(Y,3,"}");case"@":return ue(U,Y)||p(Y);default:{if(N(U))return ce=h(Y,1,W(U)),Y.braceNest=0,Y.inLinked=!1,ce;if(D(U))return h(Y,0,pe(U));break}}return ce}function ae(){const{currentType:U,offset:Y,startLoc:ce,endLoc:me}=a;return a.lastType=U,a.lastOffset=Y,a.lastStartLoc=ce,a.lastEndLoc=me,a.offset=o(),a.startLoc=i(),s.currentChar()===ki?h(a,13):ie(s,a)}return{nextToken:ae,currentOffset:o,currentPosition:i,context:c}}const vI="parser",yI=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,kI=/\\([\\@{}|])/g;function bI(e,t){return t}function _I(e,t,n){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const s=parseInt(t||n,16);return s<=55295||s>=57344?String.fromCodePoint(s):"�"}}}function wI(e={}){const t=e.location!==!1,{onError:n}=e;function s(S,y,k,v,..._){const I=S.currentPosition();if(I.offset+=v,I.column+=v,n){const A=t?dg(k,I):null,b=rh(y,A,{domain:vI,args:_});n(b)}}function o(S,y,k){const v={type:S};return t&&(v.start=y,v.end=y,v.loc={start:k,end:k}),v}function i(S,y,k,v){t&&(S.end=y,S.loc&&(S.loc.end=k))}function r(S,y){const k=S.context(),v=o(3,k.offset,k.startLoc);return v.value=y.replace(kI,bI),i(v,S.currentOffset(),S.currentPosition()),v}function l(S,y){const k=S.context(),{lastOffset:v,lastStartLoc:_}=k,I=o(5,v,_);return I.index=parseInt(y,10),S.nextToken(),i(I,S.currentOffset(),S.currentPosition()),I}function a(S,y){const k=S.context(),{lastOffset:v,lastStartLoc:_}=k,I=o(4,v,_);return I.key=y,S.nextToken(),i(I,S.currentOffset(),S.currentPosition()),I}function c(S,y){const k=S.context(),{lastOffset:v,lastStartLoc:_}=k,I=o(9,v,_);return I.value=y.replace(yI,_I),S.nextToken(),i(I,S.currentOffset(),S.currentPosition()),I}function u(S){const y=S.nextToken(),k=S.context(),{lastOffset:v,lastStartLoc:_}=k,I=o(8,v,_);return y.type!==11?(s(S,Xt.UNEXPECTED_EMPTY_LINKED_MODIFIER,k.lastStartLoc,0),I.value="",i(I,v,_),{nextConsumeToken:y,node:I}):(y.value==null&&s(S,Xt.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,Jo(y)),I.value=y.value||"",i(I,S.currentOffset(),S.currentPosition()),{node:I})}function d(S,y){const k=S.context(),v=o(7,k.offset,k.startLoc);return v.value=y,i(v,S.currentOffset(),S.currentPosition()),v}function h(S){const y=S.context(),k=o(6,y.offset,y.startLoc);let v=S.nextToken();if(v.type===8){const _=u(S);k.modifier=_.node,v=_.nextConsumeToken||S.nextToken()}switch(v.type!==9&&s(S,Xt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Jo(v)),v=S.nextToken(),v.type===2&&(v=S.nextToken()),v.type){case 10:v.value==null&&s(S,Xt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Jo(v)),k.key=d(S,v.value||"");break;case 4:v.value==null&&s(S,Xt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Jo(v)),k.key=a(S,v.value||"");break;case 5:v.value==null&&s(S,Xt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Jo(v)),k.key=l(S,v.value||"");break;case 6:v.value==null&&s(S,Xt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Jo(v)),k.key=c(S,v.value||"");break;default:{s(S,Xt.UNEXPECTED_EMPTY_LINKED_KEY,y.lastStartLoc,0);const _=S.context(),I=o(7,_.offset,_.startLoc);return I.value="",i(I,_.offset,_.startLoc),k.key=I,i(k,_.offset,_.startLoc),{nextConsumeToken:v,node:k}}}return i(k,S.currentOffset(),S.currentPosition()),{node:k}}function p(S){const y=S.context(),k=y.currentType===1?S.currentOffset():y.offset,v=y.currentType===1?y.endLoc:y.startLoc,_=o(2,k,v);_.items=[];let I=null;do{const M=I||S.nextToken();switch(I=null,M.type){case 0:M.value==null&&s(S,Xt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Jo(M)),_.items.push(r(S,M.value||""));break;case 5:M.value==null&&s(S,Xt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Jo(M)),_.items.push(l(S,M.value||""));break;case 4:M.value==null&&s(S,Xt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Jo(M)),_.items.push(a(S,M.value||""));break;case 6:M.value==null&&s(S,Xt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Jo(M)),_.items.push(c(S,M.value||""));break;case 7:{const N=h(S);_.items.push(N.node),I=N.nextConsumeToken||null;break}}}while(y.currentType!==13&&y.currentType!==1);const A=y.currentType===1?y.lastOffset:S.currentOffset(),b=y.currentType===1?y.lastEndLoc:S.currentPosition();return i(_,A,b),_}function f(S,y,k,v){const _=S.context();let I=v.items.length===0;const A=o(1,y,k);A.cases=[],A.cases.push(v);do{const b=p(S);I||(I=b.items.length===0),A.cases.push(b)}while(_.currentType!==13);return I&&s(S,Xt.MUST_HAVE_MESSAGES_IN_PLURAL,k,0),i(A,S.currentOffset(),S.currentPosition()),A}function g(S){const y=S.context(),{offset:k,startLoc:v}=y,_=p(S);return y.currentType===13?_:f(S,k,v,_)}function w(S){const y=gI(S,Bn({},e)),k=y.context(),v=o(0,k.offset,k.startLoc);return t&&v.loc&&(v.loc.source=S),v.body=g(y),e.onCacheKey&&(v.cacheKey=e.onCacheKey(S)),k.currentType!==13&&s(y,Xt.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,S[k.offset]||""),i(v,y.currentOffset(),y.currentPosition()),v}return{parse:w}}function Jo(e){if(e.type===13)return"EOF";const t=(e.value||"").replace(/\r?\n/gu,"\\n");return t.length>10?t.slice(0,9)+"…":t}function SI(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:i=>(n.helpers.add(i),i)}}function ck(e,t){for(let n=0;n<e.length;n++)W1(e[n],t)}function W1(e,t){switch(e.type){case 1:ck(e.cases,t),t.helper("plural");break;case 2:ck(e.items,t);break;case 6:{W1(e.key,t),t.helper("linked"),t.helper("type");break}case 5:t.helper("interpolate"),t.helper("list");break;case 4:t.helper("interpolate"),t.helper("named");break}}function CI(e,t={}){const n=SI(e);n.helper("normalize"),e.body&&W1(e.body,n);const s=n.context();e.helpers=Array.from(s.helpers)}function xI(e){const t=e.body;return t.type===2?uk(t):t.cases.forEach(n=>uk(n)),e}function uk(e){if(e.items.length===1){const t=e.items[0];(t.type===3||t.type===9)&&(e.static=t.value,delete t.value)}else{const t=[];for(let n=0;n<e.items.length;n++){const s=e.items[n];if(!(s.type===3||s.type===9)||s.value==null)break;t.push(s.value)}if(t.length===e.items.length){e.static=H1(t);for(let n=0;n<e.items.length;n++){const s=e.items[n];(s.type===3||s.type===9)&&delete s.value}}}}function Hl(e){switch(e.t=e.type,e.type){case 0:{const t=e;Hl(t.body),t.b=t.body,delete t.body;break}case 1:{const t=e,n=t.cases;for(let s=0;s<n.length;s++)Hl(n[s]);t.c=n,delete t.cases;break}case 2:{const t=e,n=t.items;for(let s=0;s<n.length;s++)Hl(n[s]);t.i=n,delete t.items,t.static&&(t.s=t.static,delete t.static);break}case 3:case 9:case 8:case 7:{const t=e;t.value&&(t.v=t.value,delete t.value);break}case 6:{const t=e;Hl(t.key),t.k=t.key,delete t.key,t.modifier&&(Hl(t.modifier),t.m=t.modifier,delete t.modifier);break}case 5:{const t=e;t.i=t.index,delete t.index;break}case 4:{const t=e;t.k=t.key,delete t.key;break}}delete e.type}function TI(e,t){const{filename:n,breakLineCode:s,needIndent:o}=t,i=t.location!==!1,r={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:s,needIndent:o,indentLevel:0};i&&e.loc&&(r.source=e.loc.source);const l=()=>r;function a(g,w){r.code+=g}function c(g,w=!0){const S=w?s:"";a(o?S+" ".repeat(g):S)}function u(g=!0){const w=++r.indentLevel;g&&c(w)}function d(g=!0){const w=--r.indentLevel;g&&c(w)}function h(){c(r.indentLevel)}return{context:l,push:a,indent:u,deindent:d,newline:h,helper:g=>`_${g}`,needIndent:()=>r.needIndent}}function MI(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),ma(e,t.key),t.modifier?(e.push(", "),ma(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function AI(e,t){const{helper:n,needIndent:s}=e;e.push(`${n("normalize")}([`),e.indent(s());const o=t.items.length;for(let i=0;i<o&&(ma(e,t.items[i]),i!==o-1);i++)e.push(", ");e.deindent(s()),e.push("])")}function EI(e,t){const{helper:n,needIndent:s}=e;if(t.cases.length>1){e.push(`${n("plural")}([`),e.indent(s());const o=t.cases.length;for(let i=0;i<o&&(ma(e,t.cases[i]),i!==o-1);i++)e.push(", ");e.deindent(s()),e.push("])")}}function II(e,t){t.body?ma(e,t.body):e.push("null")}function ma(e,t){const{helper:n}=e;switch(t.type){case 0:II(e,t);break;case 1:EI(e,t);break;case 2:AI(e,t);break;case 6:MI(e,t);break;case 8:e.push(JSON.stringify(t.value),t);break;case 7:e.push(JSON.stringify(t.value),t);break;case 5:e.push(`${n("interpolate")}(${n("list")}(${t.index}))`,t);break;case 4:e.push(`${n("interpolate")}(${n("named")}(${JSON.stringify(t.key)}))`,t);break;case 9:e.push(JSON.stringify(t.value),t);break;case 3:e.push(JSON.stringify(t.value),t);break}}const $I=(e,t={})=>{const n=at(t.mode)?t.mode:"normal",s=at(t.filename)?t.filename:"message.intl";t.sourceMap;const o=t.breakLineCode!=null?t.breakLineCode:n==="arrow"?";":`
|
|
30
|
-
`,i=t.needIndent?t.needIndent:n!=="arrow",r=e.helpers||[],l=TI(e,{filename:s,breakLineCode:o,needIndent:i});l.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(i),r.length>0&&(l.push(`const { ${H1(r.map(u=>`${u}: _${u}`),", ")} } = ctx`),l.newline()),l.push("return "),ma(l,e),l.deindent(i),l.push("}"),delete e.helpers;const{code:a,map:c}=l.context();return{ast:e,code:a,map:c?c.toJSON():void 0}};function NI(e,t={}){const n=Bn({},t),s=!!n.jit,o=!!n.minify,i=n.optimize==null?!0:n.optimize,l=wI(n).parse(e);return s?(i&&xI(l),o&&Hl(l),{ast:l,code:""}):(CI(l,n),$I(l,n))}/*!
|
|
31
|
-
* core-base v11.4.5
|
|
32
|
-
* (c) 2026 kazuya kawaguchi
|
|
33
|
-
* Released under the MIT License.
|
|
34
|
-
*/function LI(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Jr().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Jr().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function ii(e){return qt(e)&&U1(e)===0&&(Ao(e,"b")||Ao(e,"body"))}const eC=["b","body"];function OI(e){return Tr(e,eC)}const tC=["c","cases"];function PI(e){return Tr(e,tC,[])}const nC=["s","static"];function RI(e){return Tr(e,nC)}const sC=["i","items"];function DI(e){return Tr(e,sC,[])}const oC=["t","type"];function U1(e){return Tr(e,oC)}const iC=["v","value"];function Yu(e,t){const n=Tr(e,iC);if(n!=null)return n;throw Dc(t)}const rC=["m","modifier"];function BI(e){return Tr(e,rC)}const lC=["k","key"];function FI(e){const t=Tr(e,lC);if(t)return t;throw Dc(6)}function Tr(e,t,n){for(let s=0;s<t.length;s++){const o=t[s];if(Ao(e,o)&&e[o]!=null)return e[o]}return n}const aC=[...eC,...tC,...nC,...sC,...lC,...rC,...iC,...oC];function Dc(e){return new Error(`unhandled node type: ${e}`)}function Vp(e){return n=>HI(n,e)}function HI(e,t){const n=OI(t);if(n==null)throw Dc(0);if(U1(n)===1){const i=PI(n);return e.plural(i.reduce((r,l)=>[...r,dk(e,l)],[]))}else return dk(e,n)}function dk(e,t){const n=RI(t);if(n!=null)return e.type==="text"?n:e.normalize([n]);{const s=DI(t).reduce((o,i)=>[...o,fg(e,i)],[]);return e.normalize(s)}}function fg(e,t){const n=U1(t);switch(n){case 3:return Yu(t,n);case 9:return Yu(t,n);case 4:{const s=t;if(Ao(s,"k")&&s.k)return e.interpolate(e.named(s.k));if(Ao(s,"key")&&s.key)return e.interpolate(e.named(s.key));throw Dc(n)}case 5:{const s=t;if(Ao(s,"i")&&Dn(s.i))return e.interpolate(e.list(s.i));if(Ao(s,"index")&&Dn(s.index))return e.interpolate(e.list(s.index));throw Dc(n)}case 6:{const s=t,o=BI(s),i=FI(s);return e.linked(fg(e,i),o?fg(e,o):void 0,e.type)}case 7:return Yu(t,n);case 8:return Yu(t,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const WI=e=>e;let Xu=nn();function UI(e,t={}){let n=!1;const s=t.onError||cI;return t.onError=o=>{n=!0,s(o)},{...NI(e,t),detectError:n}}function qI(e,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&at(e)){Ut(t.warnHtmlMessage)&&t.warnHtmlMessage;const s=(t.onCacheKey||WI)(e),o=Xu[s];if(o)return o;const{ast:i,detectError:r}=UI(e,{...t,location:!1,jit:!0}),l=Vp(i);return r?l:Xu[s]=l}else{const n=e.cacheKey;if(n){const s=Xu[n];return s||(Xu[n]=Vp(e))}else return Vp(e)}}let Bc=null;function jI(e){Bc=e}function zI(e,t,n){Bc&&Bc.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const VI=KI("function:translate");function KI(e){return t=>Bc&&Bc.emit(e,t)}const Ti={INVALID_ARGUMENT:aI,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},GI=24;function Mi(e){return rh(e,null,void 0)}function q1(e,t){return t.locale!=null?fk(t.locale):fk(e.locale)}let Kp;function fk(e){if(at(e))return e;if(vn(e)){if(e.resolvedOnce&&Kp!=null)return Kp;if(e.constructor.name==="Function"){const t=e();if(iI(t))throw Mi(Ti.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return Kp=t}else throw Mi(Ti.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw Mi(Ti.NOT_SUPPORT_LOCALE_TYPE)}function YI(e,t,n){return[...new Set([n,...Tn(t)?t:qt(t)?Object.keys(t):at(t)?[t]:[n]])]}function hg(e,t,n){const s=at(n)?n:Fc,o=e;o.__localeChainCache||(o.__localeChainCache=new Map);let i=o.__localeChainCache.get(s);if(!i){i=[];let r=[n];for(;Tn(r);)r=hk(i,r,t);const l=Tn(t)||!Lt(t)?t:t.default?t.default:null;r=at(l)?[l]:l,Tn(r)&&hk(i,r,!1),o.__localeChainCache.set(s,i)}return i}function hk(e,t,n){let s=!0;for(let o=0;o<t.length&&Ut(s);o++){const i=t[o];at(i)&&(s=XI(e,t[o],n))}return s}function XI(e,t,n){let s;const o=t.split("-");do{const i=o.join("-");s=ZI(e,i,n),o.splice(-1,1)}while(o.length&&s===!0);return s}function ZI(e,t,n){let s=!1;if(!e.includes(t)&&(s=!0,t)){s=t[t.length-1]!=="!";const o=t.replace(/!/g,"");e.push(o),(Tn(n)||Lt(n))&&n[o]&&(s=n[o])}return s}const Mr=[];Mr[0]={w:[0],i:[3,0],"[":[4],o:[7]};Mr[1]={w:[1],".":[2],"[":[4],o:[7]};Mr[2]={w:[2],i:[3,0],0:[3,0]};Mr[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};Mr[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};Mr[5]={"'":[4,0],o:8,l:[5,0]};Mr[6]={'"':[4,0],o:8,l:[6,0]};const JI=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function QI(e){return JI.test(e)}function e6(e){const t=e.charCodeAt(0),n=e.charCodeAt(e.length-1);return t===n&&(t===34||t===39)?e.slice(1,-1):e}function t6(e){if(e==null)return"o";switch(e.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return e;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function n6(e){const t=e.trim();return e.charAt(0)==="0"&&isNaN(parseInt(e))?!1:QI(t)?e6(t):"*"+t}function s6(e){const t=[];let n=-1,s=0,o=0,i,r,l,a,c,u,d;const h=[];h[0]=()=>{r===void 0?r=l:r+=l},h[1]=()=>{r!==void 0&&(t.push(r),r=void 0)},h[2]=()=>{h[0](),o++},h[3]=()=>{if(o>0)o--,s=4,h[0]();else{if(o=0,r===void 0||(r=n6(r),r===!1))return!1;h[1]()}};function p(){const f=e[n+1];if(s===5&&f==="'"||s===6&&f==='"')return n++,l="\\"+f,h[0](),!0}for(;s!==null;)if(n++,i=e[n],!(i==="\\"&&p())){if(a=t6(i),d=Mr[s],c=d[a]||d.l||8,c===8||(s=c[0],c[1]!==void 0&&(u=h[c[1]],u&&(l=i,u()===!1))))return;if(s===7)return t}}const pk=new Map;function o6(e,t){return qt(e)?e[t]:null}function i6(e,t){if(!qt(e))return null;let n=pk.get(t);if(n||(n=s6(t),n&&pk.set(t,n)),!n)return null;const s=n.length;let o=e,i=0;for(;i<s;){const r=n[i];if(aC.includes(r)&&ii(o)||!qt(o)||!Ao(o,r))return null;const l=o[r];if(l===void 0||vn(o))return null;o=l,i++}return o}const r6="11.4.5",lh=-1,Fc="en-US",rf="",mk=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function l6(){return{upper:(e,t)=>t==="text"&&at(e)?e.toUpperCase():t==="vnode"&&qt(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&&at(e)?e.toLowerCase():t==="vnode"&&qt(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&&at(e)?mk(e):t==="vnode"&&qt(e)&&"__v_isVNode"in e?mk(e.children):e}}let cC;function a6(e){cC=e}let uC;function c6(e){uC=e}let dC;function u6(e){dC=e}let fC=null;const d6=e=>{fC=e},f6=()=>fC;let hC=null;const gk=e=>{hC=e},h6=()=>hC;let vk=0;function p6(e={}){const t=vn(e.onWarn)?e.onWarn:YE,n=at(e.version)?e.version:r6,s=at(e.locale)||vn(e.locale)?e.locale:Fc,o=vn(s)?Fc:s,i=Tn(e.fallbackLocale)||Lt(e.fallbackLocale)||at(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:o,r=Lt(e.messages)?e.messages:Gp(o),l=Lt(e.datetimeFormats)?e.datetimeFormats:Gp(o),a=Lt(e.numberFormats)?e.numberFormats:Gp(o),c=Bn(nn(),e.modifiers,l6()),u=e.pluralRules||nn(),d=vn(e.missing)?e.missing:null,h=Ut(e.missingWarn)||pa(e.missingWarn)?e.missingWarn:!0,p=Ut(e.fallbackWarn)||pa(e.fallbackWarn)?e.fallbackWarn:!0,f=!!e.fallbackFormat,g=!!e.unresolving,w=vn(e.postTranslation)?e.postTranslation:null,S=Lt(e.processor)?e.processor:null,y=Ut(e.warnHtmlMessage)?e.warnHtmlMessage:!0,k=!!e.escapeParameter,v=vn(e.messageCompiler)?e.messageCompiler:cC,_=vn(e.messageResolver)?e.messageResolver:uC||o6,I=vn(e.localeFallbacker)?e.localeFallbacker:dC||YI,A=qt(e.fallbackContext)?e.fallbackContext:void 0,b=e,M=qt(b.__datetimeFormatters)?b.__datetimeFormatters:new Map,N=qt(b.__numberFormatters)?b.__numberFormatters:new Map,D=qt(b.__meta)?b.__meta:{};vk++;const $={version:n,cid:vk,locale:s,fallbackLocale:i,messages:r,modifiers:c,pluralRules:u,missing:d,missingWarn:h,fallbackWarn:p,fallbackFormat:f,unresolving:g,postTranslation:w,processor:S,warnHtmlMessage:y,escapeParameter:k,messageCompiler:v,messageResolver:_,localeFallbacker:I,fallbackContext:A,onWarn:t,__meta:D};return $.datetimeFormats=l,$.numberFormats=a,$.__datetimeFormatters=M,$.__numberFormatters=N,__INTLIFY_PROD_DEVTOOLS__&&zI($,n,D),$}const Gp=e=>({[e]:nn()});function j1(e,t,n,s,o){const{missing:i,onWarn:r}=e;if(i!==null){const l=i(e,n,t,o);return at(l)?l:t}else return t}function Za(e,t,n){const s=e;s.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function m6(e,t){return e===t?!1:e.split("-")[0]===t.split("-")[0]}function g6(e,t){const n=t.indexOf(e);if(n===-1)return!1;for(let s=n+1;s<t.length;s++)if(m6(e,t[s]))return!0;return!1}function yk(e,...t){const{datetimeFormats:n,unresolving:s,fallbackLocale:o,onWarn:i,localeFallbacker:r}=e,{__datetimeFormatters:l}=e;if(!at(t[0])&&!JS(t[0])&&!Dn(t[0]))return rf;const[a,c,u,d]=pg(...t),h=Ut(u.missingWarn)?u.missingWarn:e.missingWarn;Ut(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const p=!!u.part,f=q1(e,u),g=r(e,o,f);if(!at(a)||a===""){const I=new Intl.DateTimeFormat(f.replace(/!/g,""),d);return p?I.formatToParts(c):I.format(c)}let w={},S,y=null;const k="datetime format";for(let I=0;I<g.length&&(S=g[I],w=n[S]||{},y=w[a],!Lt(y));I++)j1(e,a,S,h,k);if(!Lt(y)||!at(S))return s?lh:a;let v=`${S}__${a}`;ih(d)||(v=`${v}__${JSON.stringify(d)}`);let _=l.get(v);return _||(_=new Intl.DateTimeFormat(S,Bn({},y,d)),l.set(v,_)),p?_.formatToParts(c):_.format(c)}const pC=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function pg(...e){const[t,n,s,o]=e,i=nn();let r=nn(),l;if(at(t)){const a=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!a)throw Mi(Ti.INVALID_ISO_DATE_ARGUMENT);const c=a[3]?a[3].trim().startsWith("T")?`${a[1].trim()}${a[3].trim()}`:`${a[1].trim()}T${a[3].trim()}`:a[1].trim();l=new Date(c);try{l.toISOString()}catch{throw Mi(Ti.INVALID_ISO_DATE_ARGUMENT)}}else if(JS(t)){if(isNaN(t.getTime()))throw Mi(Ti.INVALID_DATE_ARGUMENT);l=t}else if(Dn(t))l=t;else throw Mi(Ti.INVALID_ARGUMENT);return at(n)?i.key=n:Lt(n)&&Object.keys(n).forEach(a=>{pC.includes(a)?r[a]=n[a]:i[a]=n[a]}),at(s)?i.locale=s:Lt(s)&&(r=s),Lt(o)&&(r=o),[i.key||"",l,i,r]}function kk(e,t,n){const s=e;for(const o in n){const i=`${t}__${o}`;s.__datetimeFormatters.has(i)&&s.__datetimeFormatters.delete(i)}}function bk(e,...t){const{numberFormats:n,unresolving:s,fallbackLocale:o,onWarn:i,localeFallbacker:r}=e,{__numberFormatters:l}=e;if(!Dn(t[0]))return rf;const[a,c,u,d]=mg(...t),h=Ut(u.missingWarn)?u.missingWarn:e.missingWarn;Ut(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const p=!!u.part,f=q1(e,u),g=r(e,o,f);if(!at(a)||a===""){const I=new Intl.NumberFormat(f.replace(/!/g,""),d);return p?I.formatToParts(c):I.format(c)}let w={},S,y=null;const k="number format";for(let I=0;I<g.length&&(S=g[I],w=n[S]||{},y=w[a],!Lt(y));I++)j1(e,a,S,h,k);if(!Lt(y)||!at(S))return s?lh:a;let v=`${S}__${a}`;ih(d)||(v=`${v}__${JSON.stringify(d)}`);let _=l.get(v);return _||(_=new Intl.NumberFormat(S,Bn({},y,d)),l.set(v,_)),p?_.formatToParts(c):_.format(c)}const mC=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function mg(...e){const[t,n,s,o]=e,i=nn();let r=nn();if(!Dn(t))throw Mi(Ti.INVALID_ARGUMENT);const l=t;return at(n)?i.key=n:Lt(n)&&Object.keys(n).forEach(a=>{mC.includes(a)?r[a]=n[a]:i[a]=n[a]}),at(s)?i.locale=s:Lt(s)&&(r=s),Lt(o)&&(r=o),[i.key||"",l,i,r]}function _k(e,t,n){const s=e;for(const o in n){const i=`${t}__${o}`;s.__numberFormatters.has(i)&&s.__numberFormatters.delete(i)}}const v6=e=>e,y6=e=>"",k6="text",b6=e=>e.length===0?"":H1(e),_6=rI;function Yp(e,t){return e=Math.abs(e),t===2?e===1?0:1:Math.min(e,2)}function w6(e){const t=Dn(e.pluralIndex)?e.pluralIndex:-1;return Dn(e.named?.count)?e.named.count:Dn(e.named?.n)?e.named.n:t}function S6(e={}){const t=e.locale,n=w6(e),s=at(t)&&vn(e.pluralRules?.[t])?e.pluralRules[t]:Yp,o=s===Yp?void 0:Yp,i=S=>S[s(n,S.length,o)],r=e.list||[],l=S=>r[S],a=e.named||nn();Dn(e.pluralIndex)&&(a.count||=e.pluralIndex,a.n||=e.pluralIndex);const c=S=>a[S];function u(S,y){const k=vn(e.messages)?e.messages(S,!!y):qt(e.messages)?e.messages[S]:!1;return k||(e.parent?e.parent.message(S):y6)}const d=S=>e.modifiers?e.modifiers[S]:v6,h=vn(e.processor?.normalize)?e.processor.normalize:b6,p=vn(e.processor?.interpolate)?e.processor.interpolate:_6,f=at(e.processor?.type)?e.processor.type:k6,w={list:l,named:c,plural:i,linked:(S,...y)=>{const[k,v]=y;let _="text",I="";y.length===1?qt(k)?(I=k.modifier||I,_=k.type||_):at(k)&&(I=k||I):y.length===2&&(at(k)&&(I=k||I),at(v)&&(_=v||_));const A=u(S,!0)(w),b=A===""||A===void 0?S:A,M=_==="vnode"&&Tn(b)&&I?b[0]:b;return I?d(I)(M,_):M},message:u,type:f,interpolate:p,normalize:h,values:Bn(nn(),r,a)};return w}const wk=()=>"",Co=e=>vn(e);function Sk(e,...t){const{fallbackFormat:n,postTranslation:s,unresolving:o,messageCompiler:i,fallbackLocale:r,messages:l}=e,[a,c]=gg(...t),u=Ut(c.missingWarn)?c.missingWarn:e.missingWarn,d=Ut(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn,h=Ut(c.escapeParameter)?c.escapeParameter:e.escapeParameter,p=!!c.resolvedMessage,f=at(c.default)||Ut(c.default)?Ut(c.default)?i?a:()=>a:c.default:n?i?a:()=>a:null,g=n||f!=null&&(at(f)||vn(f)),w=q1(e,c);h&&C6(c);let[S,y,k]=p?[a,w,l[w]||nn()]:gC(e,a,w,r,d,u),v=S,_=a;if(!p&&!(at(v)||ii(v)||Co(v))&&g&&(v=f,_=v),!p&&(!(at(v)||ii(v)||Co(v))||!at(y)))return o?lh:a;let I=!1;const A=()=>{I=!0},b=Co(v)?v:vC(e,a,y,v,_,A);if(I)return v;const M=M6(e,y,k,c),N=S6(M),D=x6(e,b,N);let $=s?s(D,a):D;if(h&&at($)&&($=sI($)),__INTLIFY_PROD_DEVTOOLS__){const O={timestamp:Date.now(),key:at(a)?a:Co(v)?v.key:"",locale:y||(Co(v)?v.locale:""),format:at(v)?v:Co(v)?v.source:"",message:$};O.meta=Bn({},e.__meta,f6()||{}),VI(O)}return $}function C6(e){Tn(e.list)?e.list=e.list.map(t=>at(t)?rk(t):t):qt(e.named)&&Object.keys(e.named).forEach(t=>{at(e.named[t])&&(e.named[t]=rk(e.named[t]))})}function gC(e,t,n,s,o,i){const{messages:r,onWarn:l,messageResolver:a,localeFallbacker:c}=e,u=c(e,s,n);let d=nn(),h,p=null;const f="translate";for(let g=0;g<u.length&&(h=u[g],d=r[h]||nn(),(p=a(d,t))===null&&(p=d[t]),!(at(p)||ii(p)||Co(p)));g++)if(!g6(h,u)){const w=j1(e,t,h,i,f);w!==t&&(p=w)}return[p,h,d]}function vC(e,t,n,s,o,i){const{messageCompiler:r,warnHtmlMessage:l}=e;if(Co(s)){const c=s;return c.locale=c.locale||n,c.key=c.key||t,c}if(r==null){const c=(()=>s);return c.locale=n,c.key=t,c}const a=r(s,T6(e,n,o,s,l,i));return a.locale=n,a.key=t,a.source=s,a}function x6(e,t,n){return t(n)}function gg(...e){const[t,n,s]=e,o=nn();if(!at(t)&&!Dn(t)&&!Co(t)&&!ii(t))throw Mi(Ti.INVALID_ARGUMENT);const i=Dn(t)?String(t):(Co(t),t);return Dn(n)?o.plural=n:at(n)?o.default=n:Lt(n)&&!ih(n)?o.named=n:Tn(n)&&(o.list=n),Dn(s)?o.plural=s:at(s)?o.default=s:Lt(s)&&Bn(o,s),[i,o]}function T6(e,t,n,s,o,i){return{locale:t,key:n,warnHtmlMessage:o,onError:r=>{throw i&&i(r),r},onCacheKey:r=>XE(t,n,r)}}function M6(e,t,n,s){const{modifiers:o,pluralRules:i,messageResolver:r,fallbackLocale:l,fallbackWarn:a,missingWarn:c,fallbackContext:u}=e,h={locale:t,modifiers:o,pluralRules:i,messages:(p,f)=>{let g=r(n,p);if(g==null&&(u||f)){const[w,,S]=gC(u||e,p,t,l,a,c);g=w??r(S,p)}if(at(g)||ii(g)){let w=!1;const y=vC(e,p,t,g,p,()=>{w=!0});return w?wk:y}else return Co(g)?g:wk}};return e.processor&&(h.processor=e.processor),s.list&&(h.list=s.list),s.named&&(h.named=s.named),Dn(s.plural)&&(h.pluralIndex=s.plural),h}LI();/*!
|
|
35
|
-
* vue-i18n v11.4.5
|
|
36
|
-
* (c) 2026 kazuya kawaguchi
|
|
37
|
-
* Released under the MIT License.
|
|
38
|
-
*/const A6="11.4.5";function E6(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(Jr().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(Jr().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Jr().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Jr().__INTLIFY_PROD_DEVTOOLS__=!1)}const Cs={UNEXPECTED_RETURN_TYPE:GI,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32,NOT_AVAILABLE_COMPOSITION_IN_LEGACY:34};function Ds(e,...t){return rh(e,null,void 0)}const vg=xr("__translateVNode"),yg=xr("__datetimeParts"),kg=xr("__numberParts"),yC=xr("__setPluralRules"),kC=xr("__injectWithOption"),jl=xr("__dispose");function Hc(e){if(!qt(e)||ii(e))return e;for(const t in e)if(Ao(e,t))if(!t.includes("."))qt(e[t])&&Hc(e[t]);else{const n=t.split("."),s=n.length-1;let o=e,i=!1;for(let r=0;r<s;r++){if(n[r]==="__proto__")throw new Error(`unsafe key: ${n[r]}`);if(n[r]in o||(o[n[r]]=nn()),!qt(o[n[r]])){i=!0;break}o=o[n[r]]}if(i||(ii(o)?aC.includes(n[s])||delete e[t]:(o[n[s]]=e[t],delete e[t])),!ii(o)){const r=o[n[s]];qt(r)&&Hc(r)}}return e}function z1(e,t){const{messages:n,__i18n:s,messageResolver:o,flatJson:i}=t,r=Lt(n)?n:Tn(s)?nn():{[e]:nn()};if(Tn(s)&&s.forEach(l=>{if("locale"in l&&"resource"in l){const{locale:a,resource:c}=l;a?(r[a]=r[a]||nn(),_d(c,r[a])):_d(c,r)}else at(l)&&_d(JSON.parse(l),r)}),o==null&&i)for(const l in r)Ao(r,l)&&Hc(r[l]);return r}function bC(e){return e.type}function _C(e,t,n){let s=qt(t.messages)?t.messages:nn();"__i18nGlobal"in n&&(s=z1(e.locale.value,{messages:s,__i18n:n.__i18nGlobal}));const o=Object.keys(s);o.length&&o.forEach(i=>{e.mergeLocaleMessage(i,s[i])});{if(qt(t.datetimeFormats)){const i=Object.keys(t.datetimeFormats);i.length&&i.forEach(r=>{e.mergeDateTimeFormat(r,t.datetimeFormats[r])})}if(qt(t.numberFormats)){const i=Object.keys(t.numberFormats);i.length&&i.forEach(r=>{e.mergeNumberFormat(r,t.numberFormats[r])})}}}function Ck(e){return bt(hr,null,e,0)}function Wc(){return cs()}const xk="__INTLIFY_META__",Tk=()=>[],I6=()=>!1;let Mk=0;function Ak(e){return((t,n,s,o)=>e(n,s,Wc()||void 0,o))}const $6=()=>{const e=Wc();let t=null;return e&&(t=bC(e)[xk])?{[xk]:t}:null};function lf(e={}){const{__root:t,__injectWithOption:n}=e,s=t===void 0,o=e.flatJson,i=of?se:ul;let r=Ut(e.inheritLocale)?e.inheritLocale:!0;const l=i(t&&r?t.locale.value:at(e.locale)?e.locale:Fc),a=i(t&&r?t.fallbackLocale.value:at(e.fallbackLocale)||Tn(e.fallbackLocale)||Lt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:l.value),c=i(z1(l.value,e)),u=i(Lt(e.datetimeFormats)?e.datetimeFormats:{[l.value]:{}}),d=i(Lt(e.numberFormats)?e.numberFormats:{[l.value]:{}});let h=t?t.missingWarn:Ut(e.missingWarn)||pa(e.missingWarn)?e.missingWarn:!0,p=t?t.fallbackWarn:Ut(e.fallbackWarn)||pa(e.fallbackWarn)?e.fallbackWarn:!0,f=t?t.fallbackRoot:Ut(e.fallbackRoot)?e.fallbackRoot:!0,g=!!e.fallbackFormat,w=vn(e.missing)?e.missing:null,S=vn(e.missing)?Ak(e.missing):null,y=vn(e.postTranslation)?e.postTranslation:null,k=t?t.warnHtmlMessage:Ut(e.warnHtmlMessage)?e.warnHtmlMessage:!0,v=!!e.escapeParameter;const _=t?t.modifiers:Lt(e.modifiers)?e.modifiers:{};let I=e.pluralRules||t&&t.pluralRules,A;A=(()=>{s&&gk(null);const re={version:A6,locale:l.value,fallbackLocale:a.value,messages:c.value,modifiers:_,pluralRules:I,missing:S===null?void 0:S,missingWarn:h,fallbackWarn:p,fallbackFormat:g,unresolving:!0,postTranslation:y===null?void 0:y,warnHtmlMessage:k,escapeParameter:v,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};re.datetimeFormats=u.value,re.numberFormats=d.value,re.__datetimeFormatters=Lt(A)?A.__datetimeFormatters:void 0,re.__numberFormatters=Lt(A)?A.__numberFormatters:void 0;const Te=p6(re);return s&&gk(Te),Te})(),Za(A,l.value,a.value);function M(){return[l.value,a.value,c.value,u.value,d.value]}const N=H({get:()=>l.value,set:re=>{A.locale=re,l.value=re}}),D=H({get:()=>a.value,set:re=>{A.fallbackLocale=re,a.value=re,Za(A,l.value,re)}}),$=H(()=>c.value),O=H(()=>u.value),P=H(()=>d.value);function R(){return vn(y)?y:null}function F(re){y=re,A.postTranslation=re}function V(){return w}function K(re){re!==null&&(S=Ak(re)),w=re,A.missing=S}const Z=(re,Te,Ue,nt,ct,Re)=>{M();let Pe;try{__INTLIFY_PROD_DEVTOOLS__,s||(A.fallbackContext=t?h6():void 0),Pe=re(A)}finally{__INTLIFY_PROD_DEVTOOLS__,s||(A.fallbackContext=void 0)}if(Ue!=="translate exists"&&Dn(Pe)&&Pe===lh||Ue==="translate exists"&&!Pe){const[st,et]=Te();return t&&f?nt(t):ct(st)}else{if(Re(Pe))return Pe;throw Ds(Cs.UNEXPECTED_RETURN_TYPE)}};function G(...re){return Z(Te=>Reflect.apply(Sk,null,[Te,...re]),()=>gg(...re),"translate",Te=>Reflect.apply(Te.t,Te,[...re]),Te=>Te,Te=>at(Te))}function X(...re){const[Te,Ue,nt]=re;if(nt&&!qt(nt))throw Ds(Cs.INVALID_ARGUMENT);return G(Te,Ue,Bn({resolvedMessage:!0},nt||{}))}function pe(...re){return Z(Te=>Reflect.apply(yk,null,[Te,...re]),()=>pg(...re),"datetime format",Te=>Reflect.apply(Te.d,Te,[...re]),()=>rf,Te=>at(Te)||Tn(Te))}function oe(...re){return Z(Te=>Reflect.apply(bk,null,[Te,...re]),()=>mg(...re),"number format",Te=>Reflect.apply(Te.n,Te,[...re]),()=>rf,Te=>at(Te)||Tn(Te))}function ye(re){return re.map(Te=>at(Te)||Dn(Te)||Ut(Te)?Ck(String(Te)):Te)}const de={normalize:ye,interpolate:re=>re,type:"vnode"};function be(...re){return Z(Te=>{let Ue;const nt=Te;try{nt.processor=de,Ue=Reflect.apply(Sk,null,[nt,...re])}finally{nt.processor=null}return Ue},()=>gg(...re),"translate",Te=>Te[vg](...re),Te=>[Ck(Te)],Te=>Tn(Te))}function xe(...re){return Z(Te=>Reflect.apply(bk,null,[Te,...re]),()=>mg(...re),"number format",Te=>Te[kg](...re),Tk,Te=>at(Te)||Tn(Te))}function Le(...re){return Z(Te=>Reflect.apply(yk,null,[Te,...re]),()=>pg(...re),"datetime format",Te=>Te[yg](...re),Tk,Te=>at(Te)||Tn(Te))}function ee(re){I=re,A.pluralRules=I}function ke(re,Te){return Z(()=>{if(!re)return!1;const Ue=at(Te)?Te:l.value,nt=at(Te)?[Ue]:hg(A,a.value,Ue);for(let ct=0;ct<nt.length;ct++){const Re=J(nt[ct]);let Pe=A.messageResolver(Re,re);if(Pe===null&&(Pe=Re[re]),ii(Pe)||Co(Pe)||at(Pe))return!0}return!1},()=>[re],"translate exists",Ue=>Reflect.apply(Ue.te,Ue,[re,Te]),I6,Ue=>Ut(Ue))}function ge(re){let Te=null;const Ue=hg(A,a.value,l.value);for(let nt=0;nt<Ue.length;nt++){const ct=c.value[Ue[nt]]||{},Re=A.messageResolver(ct,re);if(Re!=null){Te=Re;break}}return Te}function W(re){const Te=ge(re);return Te??(t?t.tm(re)||{}:{})}function J(re){return c.value[re]||{}}function ue(re,Te){if(o){const Ue={[re]:Te};for(const nt in Ue)Ao(Ue,nt)&&Hc(Ue[nt]);Te=Ue[re]}c.value[re]=Te,A.messages=c.value}function ie(re,Te){c.value[re]=c.value[re]||{};const Ue={[re]:Te};if(o)for(const nt in Ue)Ao(Ue,nt)&&Hc(Ue[nt]);Te=Ue[re],_d(Te,c.value[re]),A.messages=c.value}function ae(re){return u.value[re]||{}}function U(re,Te){u.value[re]=Te,A.datetimeFormats=u.value,kk(A,re,Te)}function Y(re,Te){u.value[re]=Bn(u.value[re]||{},Te),A.datetimeFormats=u.value,kk(A,re,Te)}function ce(re){return d.value[re]||{}}function me(re,Te){d.value[re]=Te,A.numberFormats=d.value,_k(A,re,Te)}function Se(re,Te){d.value[re]=Bn(d.value[re]||{},Te),A.numberFormats=d.value,_k(A,re,Te)}Mk++,t&&of&&(Ge(t.locale,re=>{r&&(l.value=re,A.locale=re,Za(A,l.value,a.value))}),Ge(t.fallbackLocale,re=>{r&&(a.value=re,A.fallbackLocale=re,Za(A,l.value,a.value))}));const Ee={id:Mk,locale:N,fallbackLocale:D,get inheritLocale(){return r},set inheritLocale(re){r=re,re&&t&&(l.value=t.locale.value,a.value=t.fallbackLocale.value,Za(A,l.value,a.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:$,get modifiers(){return _},get pluralRules(){return I||{}},get isGlobal(){return s},get missingWarn(){return h},set missingWarn(re){h=re,A.missingWarn=h},get fallbackWarn(){return p},set fallbackWarn(re){p=re,A.fallbackWarn=p},get fallbackRoot(){return f},set fallbackRoot(re){f=re},get fallbackFormat(){return g},set fallbackFormat(re){g=re,A.fallbackFormat=g},get warnHtmlMessage(){return k},set warnHtmlMessage(re){k=re,A.warnHtmlMessage=re},get escapeParameter(){return v},set escapeParameter(re){v=re,A.escapeParameter=re},t:G,getLocaleMessage:J,setLocaleMessage:ue,mergeLocaleMessage:ie,getPostTranslationHandler:R,setPostTranslationHandler:F,getMissingHandler:V,setMissingHandler:K,[yC]:ee};return Ee.datetimeFormats=O,Ee.numberFormats=P,Ee.rt=X,Ee.te=ke,Ee.tm=W,Ee.d=pe,Ee.n=oe,Ee.getDateTimeFormat=ae,Ee.setDateTimeFormat=U,Ee.mergeDateTimeFormat=Y,Ee.getNumberFormat=ce,Ee.setNumberFormat=me,Ee.mergeNumberFormat=Se,Ee[kC]=n,Ee[vg]=be,Ee[yg]=Le,Ee[kg]=xe,Ee}function N6(e){const t=at(e.locale)?e.locale:Fc,n=at(e.fallbackLocale)||Tn(e.fallbackLocale)||Lt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,s=vn(e.missing)?e.missing:void 0,o=Ut(e.silentTranslationWarn)||pa(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,i=Ut(e.silentFallbackWarn)||pa(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,r=Ut(e.fallbackRoot)?e.fallbackRoot:!0,l=!!e.formatFallbackMessages,a=Lt(e.modifiers)?e.modifiers:{},c=e.pluralizationRules,u=vn(e.postTranslation)?e.postTranslation:void 0,d=at(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,h=!!e.escapeParameterHtml,p=Ut(e.sync)?e.sync:!0;let f=e.messages;if(Lt(e.sharedMessages)){const _=e.sharedMessages;f=Object.keys(_).reduce((A,b)=>{const M=A[b]||(A[b]={});return Bn(M,_[b]),A},f||{})}const{__i18n:g,__root:w,__injectWithOption:S}=e,y=e.datetimeFormats,k=e.numberFormats,v=e.flatJson;return{locale:t,fallbackLocale:n,messages:f,flatJson:v,datetimeFormats:y,numberFormats:k,missing:s,missingWarn:o,fallbackWarn:i,fallbackRoot:r,fallbackFormat:l,modifiers:a,pluralRules:c,postTranslation:u,warnHtmlMessage:d,escapeParameter:h,messageResolver:e.messageResolver,inheritLocale:p,__i18n:g,__root:w,__injectWithOption:S}}function bg(e={}){const t=lf(N6(e)),{__extender:n}=e,s={id:t.id,get locale(){return t.locale.value},set locale(o){t.locale.value=o},get fallbackLocale(){return t.fallbackLocale.value},set fallbackLocale(o){t.fallbackLocale.value=o},get messages(){return t.messages.value},get datetimeFormats(){return t.datetimeFormats.value},get numberFormats(){return t.numberFormats.value},get availableLocales(){return t.availableLocales},get missing(){return t.getMissingHandler()},set missing(o){t.setMissingHandler(o)},get silentTranslationWarn(){return Ut(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(o){t.missingWarn=Ut(o)?!o:o},get silentFallbackWarn(){return Ut(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(o){t.fallbackWarn=Ut(o)?!o:o},get modifiers(){return t.modifiers},get formatFallbackMessages(){return t.fallbackFormat},set formatFallbackMessages(o){t.fallbackFormat=o},get postTranslation(){return t.getPostTranslationHandler()},set postTranslation(o){t.setPostTranslationHandler(o)},get sync(){return t.inheritLocale},set sync(o){t.inheritLocale=o},get warnHtmlInMessage(){return t.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(o){t.warnHtmlMessage=o!=="off"},get escapeParameterHtml(){return t.escapeParameter},set escapeParameterHtml(o){t.escapeParameter=o},get pluralizationRules(){return t.pluralRules||{}},__composer:t,t(...o){return Reflect.apply(t.t,t,[...o])},rt(...o){return Reflect.apply(t.rt,t,[...o])},te(o,i){return t.te(o,i)},tm(o){return t.tm(o)},getLocaleMessage(o){return t.getLocaleMessage(o)},setLocaleMessage(o,i){t.setLocaleMessage(o,i)},mergeLocaleMessage(o,i){t.mergeLocaleMessage(o,i)},d(...o){return Reflect.apply(t.d,t,[...o])},getDateTimeFormat(o){return t.getDateTimeFormat(o)},setDateTimeFormat(o,i){t.setDateTimeFormat(o,i)},mergeDateTimeFormat(o,i){t.mergeDateTimeFormat(o,i)},n(...o){return Reflect.apply(t.n,t,[...o])},getNumberFormat(o){return t.getNumberFormat(o)},setNumberFormat(o,i){t.setNumberFormat(o,i)},mergeNumberFormat(o,i){t.mergeNumberFormat(o,i)}};return s.__extender=n,s}function L6(e,t,n){return{beforeCreate(){const s=Wc();if(!s)throw Ds(Cs.UNEXPECTED_ERROR);const o=this.$options;if(o.i18n){const i=o.i18n;if(o.__i18n&&(i.__i18n=o.__i18n),i.__root=t,this===this.$root)this.$i18n=Ek(e,i);else{i.__injectWithOption=!0,i.__extender=n.__vueI18nExtend,this.$i18n=bg(i);const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}}else if(o.__i18n)if(this===this.$root)this.$i18n=Ek(e,o);else{this.$i18n=bg({__i18n:o.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:t});const i=this.$i18n;i.__extender&&(i.__disposer=i.__extender(this.$i18n))}else this.$i18n=e;o.__i18nGlobal&&_C(t,o,o),this.$t=(...i)=>this.$i18n.t(...i),this.$rt=(...i)=>this.$i18n.rt(...i),this.$te=(i,r)=>this.$i18n.te(i,r),this.$d=(...i)=>this.$i18n.d(...i),this.$n=(...i)=>this.$i18n.n(...i),this.$tm=i=>this.$i18n.tm(i),n.__setInstance(s,this.$i18n)},mounted(){},unmounted(){const s=Wc();if(!s)throw Ds(Cs.UNEXPECTED_ERROR);const o=this.$i18n;delete this.$t,delete this.$rt,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,o.__disposer&&(o.__disposer(),delete o.__disposer,delete o.__extender),n.__deleteInstance(s),delete this.$i18n}}}function Ek(e,t){e.locale=t.locale||e.locale,e.fallbackLocale=t.fallbackLocale||e.fallbackLocale,e.missing=t.missing||e.missing,e.silentTranslationWarn=t.silentTranslationWarn||e.silentFallbackWarn,e.silentFallbackWarn=t.silentFallbackWarn||e.silentFallbackWarn,e.formatFallbackMessages=t.formatFallbackMessages||e.formatFallbackMessages,e.postTranslation=t.postTranslation||e.postTranslation,e.warnHtmlInMessage=t.warnHtmlInMessage||e.warnHtmlInMessage,e.escapeParameterHtml=t.escapeParameterHtml||e.escapeParameterHtml,e.sync=t.sync||e.sync,e.__composer[yC](t.pluralizationRules||e.pluralizationRules);const n=z1(e.locale,{messages:t.messages,__i18n:t.__i18n});return Object.keys(n).forEach(s=>e.mergeLocaleMessage(s,n[s])),t.datetimeFormats&&Object.keys(t.datetimeFormats).forEach(s=>e.mergeDateTimeFormat(s,t.datetimeFormats[s])),t.numberFormats&&Object.keys(t.numberFormats).forEach(s=>e.mergeNumberFormat(s,t.numberFormats[s])),e}const V1={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function O6({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((s,o)=>[...s,...o.type===Ne?o.children:[o]],[]):t.reduce((n,s)=>{const o=e[s];return o&&(n[s]=o()),n},nn())}function wC(){return Ne}const P6=Je({name:"i18n-t",props:Bn({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>Dn(e)||!isNaN(e)}},V1),setup(e,t){const{slots:n,attrs:s}=t,o=e.i18n||St({useScope:e.scope,__useComponent:!0});return()=>{const i=()=>{const a=Object.keys(n).filter(d=>d[0]!=="_"),c=nn();e.locale&&(c.locale=e.locale),e.plural!==void 0&&(c.plural=at(e.plural)?+e.plural:e.plural);const u=O6(t,a);return o[vg](e.keypath,u,c)},r=Bn(nn(),s),l=at(e.tag)||qt(e.tag)?e.tag:wC();return qt(l)?Zt(l,r,{default:i}):Zt(l,r,i())}}}),Ik=P6;function R6(e){return Tn(e)&&!at(e[0])}function SC(e,t,n,s){const{slots:o,attrs:i}=t;return()=>{const r=()=>{const c={part:!0};let u=nn();e.locale&&(c.locale=e.locale),at(e.format)?c.key=e.format:qt(e.format)&&(at(e.format.key)&&(c.key=e.format.key),u=Object.keys(e.format).reduce((p,f)=>n.includes(f)?Bn(nn(),p,{[f]:e.format[f]}):p,nn()));const d=s(e.value,c,u);let h=[c.key];return Tn(d)?h=d.map((p,f)=>{const g=o[p.type],w=g?g({[p.type]:p.value,index:f,parts:d}):[p.value];return R6(w)&&(w[0].key=`${p.type}-${f}`),w}):at(d)&&(h=[d]),h},l=Bn(nn(),i),a=at(e.tag)||qt(e.tag)?e.tag:wC();return qt(a)?Zt(a,l,{default:r}):Zt(a,l,r())}}const D6=Je({name:"i18n-n",props:Bn({value:{type:Number,required:!0},format:{type:[String,Object]}},V1),setup(e,t){const n=e.i18n||St({useScope:e.scope,__useComponent:!0});return SC(e,t,mC,(...s)=>n[kg](...s))}}),$k=D6;function B6(e,t){const n=e;if(e.mode==="composition")return n.__getInstance(t)||e.global;{const s=n.__getInstance(t);return s!=null?s.__composer:e.global.__composer}}function F6(e){const t=r=>{const{instance:l,value:a}=r;if(!l||!l.$)throw Ds(Cs.UNEXPECTED_ERROR);const c=B6(e,l.$),u=Nk(a);return[Reflect.apply(c.t,c,[...Lk(u)]),c]};return{created:(r,l)=>{const[a,c]=t(l);of&&(r.__i18nWatcher=Ge(c.locale,()=>{l.instance&&l.instance.$forceUpdate()})),r.__composer=c,r.textContent=a},unmounted:r=>{of&&r.__i18nWatcher&&(r.__i18nWatcher(),r.__i18nWatcher=void 0,delete r.__i18nWatcher),r.__composer&&(r.__composer=void 0,delete r.__composer)},beforeUpdate:(r,{value:l})=>{if(r.__composer){const a=r.__composer,c=Nk(l);r.textContent=Reflect.apply(a.t,a,[...Lk(c)])}},getSSRProps:r=>{const[l]=t(r);return{textContent:l}}}}function Nk(e){if(at(e))return{path:e};if(Lt(e)){if(!("path"in e))throw Ds(Cs.REQUIRED_VALUE,"path");return e}else throw Ds(Cs.INVALID_VALUE)}function Lk(e){const{path:t,locale:n,args:s,choice:o,plural:i}=e,r={},l=s||{};return at(n)&&(r.locale=n),Dn(o)&&(r.plural=o),Dn(i)&&(r.plural=i),[t,l,r]}function H6(e,t,...n){const s=Lt(n[0])?n[0]:{};(Ut(s.globalInstall)?s.globalInstall:!0)&&([Ik.name,"I18nT"].forEach(i=>e.component(i,Ik)),[$k.name,"I18nN"].forEach(i=>e.component(i,$k)),[Rk.name,"I18nD"].forEach(i=>e.component(i,Rk))),e.directive("t",F6(t))}const W6=xr("global-vue-i18n");function U6(e={}){const t=__VUE_I18N_LEGACY_API__&&Ut(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,n=Ut(e.globalInjection)?e.globalInjection:!0,s=new Map,[o,i]=q6(e,t),r=xr("");function l(d){return s.get(d)||null}function a(d,h){s.set(d,h)}function c(d){s.delete(d)}const u={get mode(){return __VUE_I18N_LEGACY_API__&&t?"legacy":"composition"},async install(d,...h){if(d.__VUE_I18N_SYMBOL__=r,d.provide(d.__VUE_I18N_SYMBOL__,u),Lt(h[0])){const g=h[0];u.__composerExtend=g.__composerExtend,u.__vueI18nExtend=g.__vueI18nExtend}let p=null;!t&&n&&(p=X6(d,u.global)),__VUE_I18N_FULL_INSTALL__&&H6(d,u,...h),__VUE_I18N_LEGACY_API__&&t&&d.mixin(L6(i,i.__composer,u));const f=d.unmount;d.unmount=()=>{p&&p(),u.dispose(),f()}},get global(){return i},dispose(){o.stop()},__instances:s,__getInstance:l,__setInstance:a,__deleteInstance:c};return u}function St(e={}){const t=Wc();if(t==null)throw Ds(Cs.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw Ds(Cs.NOT_INSTALLED);const n=j6(t),s=V6(n),o=bC(t),i=z6(e,o);if(i==="global")return _C(s,e,o),s;if(i==="parent"){let a=Ok(n,t,e.__useComponent);return a==null&&(a=s),a}if(i==="isolated"){if(n.mode!=="composition")throw Ds(Cs.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const a=n,c=Bn({},e),u=Ok(n,t);c.__root=u||s;const d=lf(c);return a.__composerExtend&&(d[jl]=a.__composerExtend(d)),b1()&&_1(()=>{const p=d[jl];p&&(p(),delete d[jl])}),d}const r=n;let l=r.__getInstance(t);if(l==null){const a=Bn({},e);"__i18n"in o&&(a.__i18n=o.__i18n),s&&(a.__root=s),l=lf(a),r.__composerExtend&&(l[jl]=r.__composerExtend(l)),G6(r,t,l),r.__setInstance(t,l)}return l}function q6(e,t){const n=gA(),s=__VUE_I18N_LEGACY_API__&&t?n.run(()=>bg(e)):n.run(()=>lf(e));if(s==null)throw Ds(Cs.UNEXPECTED_ERROR);return[n,s]}function j6(e){const t=Pt(e.isCE?W6:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw Ds(e.isCE?Cs.NOT_INSTALLED_WITH_PROVIDE:Cs.UNEXPECTED_ERROR);return t}function z6(e,t){return ih(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function V6(e){return e.mode==="composition"?e.global:e.global.__composer}function Ok(e,t,n=!1){let s=null;const o=t.root;let i=K6(t,n);for(;i!=null;){const r=e;if(e.mode==="composition")s=r.__getInstance(i);else if(__VUE_I18N_LEGACY_API__){const l=r.__getInstance(i);l!=null&&(s=l.__composer,n&&s&&!s[kC]&&(s=null))}if(s!=null||o===i)break;i=i.parent}return s}function K6(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function G6(e,t,n){tn(()=>{},t),Ht(()=>{const s=n;e.__deleteInstance(t);const o=s[jl];o&&(o(),delete s[jl])},t)}const Y6=["locale","fallbackLocale","availableLocales"],Pk=["t","rt","d","n","tm","te"];function X6(e,t){const n=Object.create(null);return Y6.forEach(o=>{const i=Object.getOwnPropertyDescriptor(t,o);if(!i)throw Ds(Cs.UNEXPECTED_ERROR);const r=Nn(i.value)?{get(){return i.value.value},set(l){i.value.value=l}}:{get(){return i.get&&i.get()}};Object.defineProperty(n,o,r)}),e.config.globalProperties.$i18n=n,Pk.forEach(o=>{const i=Object.getOwnPropertyDescriptor(t,o);if(!i||!i.value)throw Ds(Cs.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${o}`,i)}),()=>{delete e.config.globalProperties.$i18n,Pk.forEach(o=>{delete e.config.globalProperties[`$${o}`]})}}const Z6=Je({name:"i18n-d",props:Bn({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},V1),setup(e,t){const n=e.i18n||St({useScope:e.scope,__useComponent:!0});return SC(e,t,pC,(...s)=>n[yg](...s))}}),Rk=Z6;E6();a6(qI);c6(i6);u6(hg);if(__INTLIFY_PROD_DEVTOOLS__){const e=Jr();e.__INTLIFY__=!0,jI(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const Et={permission:"kimi-web.permission",activeWorkspace:"kimi-active-workspace",thinking:"kimi-web.thinking",planMode:"kimi-web.plan-mode",swarmMode:"kimi-web.swarm-mode",goalMode:"kimi-web.goal-mode",theme:"kimi-web.theme",uiFontSize:"kimi-web.ui-font-size",starredModels:"kimi-web.starred-models",unread:"kimi-web.unread",onboarded:"kimi-web.onboarded",accent:"kimi-web.accent",colorScheme:"kimi-web.color-scheme",hiddenWorkspaces:"kimi-web.hidden-workspaces",collapsedWorkspaces:"kimi-web.collapsed-workspaces",workspaceOrder:"kimi-web.workspace-order",betaToc:"kimi-web.beta-toc",notifyOnComplete:"kimi-web.notify-on-complete",inputHistory:"kimi-web.input-history",locale:"kimi-locale",clientId:"kimi-web.client-id",debug:"kimi-web.debug",openInLastTarget:"kimi-web.open-in.last-target",sidebarCollapsed:"kimi-web.sidebar-collapsed",sidebarWidth:"kimi-web.sidebar-width",codeFont:"kimi-web.code-font",contentAlign:"kimi-web.content-align"};function Dk(e){return`kimi-web.draft.${e&&e.length>0?e:"__new__"}`}function _n(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function In(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function Uc(e){try{globalThis.localStorage.removeItem(e)}catch{}}function K1(e){const t=_n(e);if(t===null)return null;try{return JSON.parse(t)}catch{return null}}function G1(e,t){try{globalThis.localStorage.setItem(e,JSON.stringify(t))}catch{}}function Y1(){const e=_n(Et.unread);if(!e)return{};try{const t=JSON.parse(e);if(!t||typeof t!="object")return{};const n={};for(const[s,o]of Object.entries(t))o===!0&&(n[s]=!0);return n}catch{return{}}}function X1(e){const n={...Y1()};for(const[s,o]of Object.entries(e))o?n[s]=!0:delete n[s];In(Et.unread,JSON.stringify(n))}function J6(){const e=K1(Et.collapsedWorkspaces);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function Q6(e){G1(Et.collapsedWorkspaces,Array.from(e))}function e$(){const e=K1(Et.workspaceOrder);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function CC(e){G1(Et.workspaceOrder,Array.from(e))}const Bk=Et.clientId,t$="kimi-code-web",n$="web";function s$(){return{serverHttpUrl:i$(),clientId:c$(),clientName:t$,clientVersion:u$(),clientUiMode:n$}}function o$(){return typeof window<"u"&&window.location?.origin?window.location.origin:"http://127.0.0.1:58627"}function i$(e){const t=o$(),n=new URL(t);return n.pathname=n.pathname.replace(/\/v1\/?$/,"").replace(/\/$/,""),n.search="",n.hash="",n.toString().replace(/\/$/,"")}function r$(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}function l$(){const e=typeof window<"u"&&window.location?.origin?window.location.origin:"";return r$(e)}function af(e,t){return`${e}/api/v1${t.startsWith("/")?t:`/${t}`}`}function a$(e,t){const n=new URL(`${e}/api/v1/ws`);return n.protocol=n.protocol==="https:"?"wss:":"ws:",n.searchParams.set("client_id",t),n.toString()}function c$(){const e=_n(Bk);if(e)return e;const t=`web_${globalThis.crypto?.randomUUID?.()||Math.random().toString(36).slice(2)}`;return In(Bk,t),t}function u$(){return"0.1.1".trim()?"0.1.1":"0.0.0-dev"}async function xs(e){const t=typeof navigator<"u"?navigator.clipboard:void 0;if(t&&typeof t.writeText=="function")try{return await t.writeText(e),!0}catch{}return d$(e)}function d$(e){if(typeof document>"u"||typeof document.execCommand!="function")return!1;const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.top="-9999px",t.style.left="-9999px",t.style.opacity="0",document.body.appendChild(t);let n=!1;try{t.focus(),t.select(),n=document.execCommand("copy")}catch{n=!1}finally{document.body.removeChild(t)}return n}function f$(e,t){if(e.length===0)return null;const n=new Set(e),s=t.filter(i=>n.has(i)),o=e.filter(i=>!t.includes(i));return o.length===0&&s.length===t.length?null:[...o,...s]}function h$(e,t){const n=new Map(t.map((s,o)=>[s,o]));return e.toSorted((s,o)=>(n.get(s.id)??-1)-(n.get(o.id)??-1))}function p$(e,t,n,s="before"){const o=e.indexOf(t),i=e.indexOf(n);if(o===-1||i===-1||o===i)return e;const r=[...e];r.splice(o,1);const l=o<i?i-1:i,a=s==="before"?l:l+1;return r.splice(a,0,t),r}const m$={class:"row"},g$={class:"lead","aria-hidden":"true"},v$={key:0,class:"run-ico",viewBox:"0 0 16 16",width:"12",height:"12",fill:"none"},y$={key:1,class:"unread-dot"},k$={class:"archive-label"},b$={class:"left"},_$=["onKeydown"],w$={class:"ts"},S$=["title"],C$={class:"tag-text"},x$=["title"],T$={class:"tag-text"},M$=["title"],A$={class:"tag-text"},E$=["title"],I$=Je({__name:"SessionRow",props:{session:{},active:{type:Boolean},approvalCount:{default:0},questionCount:{default:0},unread:{type:Boolean,default:!1}},emits:["select","rename","archive","fork"],setup(e,{expose:t,emit:n}){const{t:s}=St(),o=e,i=n,r=se(!1),l=se(null),a=se(null);function c(N){const D=N.target;a.value?.contains(D)||l.value?.contains(D)||d()}function u(N){N.stopPropagation(),r.value?d():(r.value=!0,setTimeout(()=>document.addEventListener("mousedown",c),0))}function d(){r.value=!1,document.removeEventListener("mousedown",c)}Ht(()=>document.removeEventListener("mousedown",c));const h=se(!1),p=se(""),f=se(null);async function g(){d(),h.value=!0,p.value=o.session.title,await vt();try{f.value?.focus(),f.value?.select()}catch{}}function w(){const N=p.value.trim();N&&i("rename",o.session.id,N),h.value=!1}function S(){h.value=!1}const y=se(!1),k=se(!1);async function v(){const N=await xs(o.session.id);y.value=N,k.value=!N,setTimeout(()=>{y.value=!1,k.value=!1,d()},1500)}function _(){d(),i("fork",o.session.id)}const I=se(!1);function A(){d(),I.value=!0}function b(){i("archive",o.session.id),I.value=!1}function M(){I.value=!1}return t({closeMenu:d,cancelArchive:M}),(N,D)=>(x(),E("div",{class:Ie(["se",{on:e.active}]),onClick:D[5]||(D[5]=$=>i("select",e.session.id))},[m("div",m$,[m("span",g$,[e.session.busy?(x(),E("svg",v$,[...D[6]||(D[6]=[m("circle",{class:"run-track",cx:"8",cy:"8",r:"6","stroke-width":"2"},null,-1),m("path",{class:"run-arc",d:"M8 2 A6 6 0 1 1 2 8","stroke-width":"2","stroke-linecap":"round"},null,-1)])])):e.unread?(x(),E("span",y$)):le("",!0)]),I.value?(x(),E("div",{key:0,class:"archive-confirm",onClick:D[0]||(D[0]=Ze(()=>{},["stop"]))},[m("span",k$,L(C(s)("sidebar.archiveConfirm")),1),m("button",{class:"btn-confirm",onClick:Ze(b,["stop"])},L(C(s)("sidebar.confirm")),1),m("button",{class:"btn-cancel",onClick:Ze(M,["stop"])},L(C(s)("sidebar.cancel")),1)])):(x(),E(Ne,{key:1},[m("div",b$,[h.value?Ot((x(),E("input",{key:0,ref_key:"renameInputRef",ref:f,"onUpdate:modelValue":D[1]||(D[1]=$=>p.value=$),class:"rename-input",onClick:D[2]||(D[2]=Ze(()=>{},["stop"])),onKeydown:[Mo(Ze(w,["stop"]),["enter"]),Mo(Ze(S,["stop"]),["esc"])],onBlur:w},null,40,_$)),[[An,p.value]]):(x(),E("span",{key:1,class:"t",onDblclick:Ze(g,["stop"])},L(e.session.title),33))]),m("span",w$,L(e.session.time),1),!h.value&&(e.questionCount>0||e.session.status==="awaitingQuestion")?(x(),E("span",{key:0,class:"tag tag-ask",title:C(s)("workspace.awaitingAnswerTitle")},[m("span",C$,L(C(s)("workspace.awaitingAnswer")),1)],8,S$)):le("",!0),!h.value&&(e.approvalCount>0||e.session.status==="awaitingApproval")?(x(),E("span",{key:1,class:"tag tag-approve",title:C(s)("workspace.awaitingPermissionTitle")},[m("span",T$,L(C(s)("workspace.awaitingPermission")),1)],8,x$)):le("",!0),!h.value&&e.session.status==="aborted"?(x(),E("span",{key:2,class:"tag tag-aborted",title:C(s)("workspace.abortedTitle")},[m("span",A$,L(C(s)("workspace.aborted")),1)],8,M$)):le("",!0),h.value?le("",!0):(x(),E("button",{key:3,ref_key:"kebabRef",ref:l,class:Ie(["kebab",{open:r.value}]),title:C(s)("sidebar.options"),onClick:D[3]||(D[3]=Ze($=>u($),["stop"]))},[...D[7]||(D[7]=[m("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[m("circle",{cx:"8",cy:"3",r:"1.3"}),m("circle",{cx:"8",cy:"8",r:"1.3"}),m("circle",{cx:"8",cy:"13",r:"1.3"})],-1)])],10,E$))],64))]),r.value?(x(),E("div",{key:0,ref_key:"menuRef",ref:a,class:"menu",onClick:D[4]||(D[4]=Ze(()=>{},["stop"]))},[m("button",{class:Ie(["menu-item copy-id",{failed:k.value}]),onClick:Ze(v,["stop"])},L(k.value?C(s)("sidebar.copyFailed"):y.value?C(s)("sidebar.copied"):C(s)("sidebar.copySessionId")),3),D[8]||(D[8]=m("div",{class:"menu-divider"},null,-1)),m("button",{class:"menu-item",onClick:Ze(g,["stop"])},L(C(s)("sidebar.rename")),1),m("button",{class:"menu-item",onClick:Ze(_,["stop"])},L(C(s)("sidebar.fork")),1),m("button",{class:"menu-item archive",onClick:Ze(A,["stop"])},L(C(s)("sidebar.archive")),1)],512)):le("",!0)],2))}}),wt=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},xC=wt(I$,[["__scopeId","data-v-8222aa18"]]),$$={class:"gh-top"},N$={class:"gh-folder",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor","stroke-width":"1.2","aria-hidden":"true"},L$={key:0,class:"gh-name"},O$=["title","aria-label","aria-expanded"],P$=["title","aria-label"],R$=["title"],D$={class:"group-sessions"},B$={key:1,class:"group-empty"},F$=Je({__name:"WorkspaceGroup",props:{group:{},activeWorkspaceId:{},activeId:{},selectedIds:{},renamingId:{},renameValue:{},renameInputRef:{},pendingBySession:{},unreadBySession:{},wsMenuOpenId:{},dragging:{type:Boolean},isCollapsed:{type:Function},isExpanded:{type:Function},visibleSessions:{type:Function}},emits:["groupClick","groupContextmenu","toggleWsMenu","createInWorkspace","selectSession","renameSession","archiveSession","forkSession","toggleExpand","confirmRename","cancelRename","updateRenameValue","wsDragstart","wsDragend"],setup(e,{emit:t}){const{t:n}=St(),s=e,o=t,i=H({get:()=>s.renameValue,set:a=>o("updateRenameValue",a)});function r(a){s.renameInputRef.value=a instanceof HTMLInputElement?a:null}function l(a){a.dataTransfer&&(a.dataTransfer.effectAllowed="move",a.dataTransfer.setData("text/plain",s.group.workspace.id),o("wsDragstart",s.group.workspace.id))}return(a,c)=>(x(),E("div",{class:Ie(["group",{dragging:e.dragging}])},[m("div",{class:Ie(["gh",{on:e.group.workspace.id===e.activeWorkspaceId,sel:e.selectedIds.has(e.group.workspace.id)}]),draggable:"true",onClick:c[7]||(c[7]=Ze(u=>o("groupClick",e.group.workspace.id,u),["stop"])),onContextmenu:c[8]||(c[8]=u=>o("groupContextmenu",e.group.workspace,u)),onDragstart:l,onDragend:c[9]||(c[9]=u=>o("wsDragend"))},[m("div",$$,[(x(),E("svg",N$,[e.isCollapsed(e.group.workspace.id)?(x(),E(Ne,{key:0},[c[15]||(c[15]=m("rect",{x:"1",y:"3.5",width:"12",height:"8.5",rx:"1"},null,-1)),c[16]||(c[16]=m("path",{d:"M1 5V3.5A1 1 0 0 1 2 2.5h3.5l1.3 2"},null,-1))],64)):(x(),E(Ne,{key:1},[c[17]||(c[17]=m("path",{d:"M1 3.5V2.5A1 1 0 0 1 2 1.5h3.5l1.3 2h5.2a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1z"},null,-1)),c[18]||(c[18]=m("path",{d:"M1 5.5h12"},null,-1))],64))])),e.renamingId!==e.group.workspace.id?(x(),E("span",L$,L(e.group.workspace.name),1)):Ot((x(),E("input",{key:1,ref:r,"onUpdate:modelValue":c[0]||(c[0]=u=>i.value=u),class:"gh-rename",type:"text",onKeydown:[c[1]||(c[1]=Mo(u=>o("confirmRename"),["enter"])),c[2]||(c[2]=Mo(u=>o("cancelRename"),["esc"]))],onBlur:c[3]||(c[3]=u=>o("cancelRename")),onClick:c[4]||(c[4]=Ze(()=>{},["stop"]))},null,544)),[[An,i.value]]),m("button",{type:"button",class:Ie(["gh-more",{open:e.wsMenuOpenId===e.group.workspace.id}]),title:C(n)("sidebar.options"),"aria-label":C(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":e.wsMenuOpenId===e.group.workspace.id,onClick:c[5]||(c[5]=Ze(u=>o("toggleWsMenu",e.group.workspace,u),["stop"]))},[...c[19]||(c[19]=[m("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[m("circle",{cx:"8",cy:"3",r:"1.3"}),m("circle",{cx:"8",cy:"8",r:"1.3"}),m("circle",{cx:"8",cy:"13",r:"1.3"})],-1)])],10,O$),m("button",{type:"button",class:"gh-add",title:C(n)("workspace.newInGroup"),"aria-label":C(n)("workspace.newInGroup"),onClick:c[6]||(c[6]=Ze(u=>o("createInWorkspace",e.group.workspace.id),["stop"]))},[...c[20]||(c[20]=[m("svg",{viewBox:"0 0 16 16",width:"15",height:"15",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("path",{d:"M8 3v10M3 8h10"})],-1)])],8,P$)]),m("div",{class:"gh-path",title:e.group.workspace.root},L(e.group.workspace.shortPath||e.group.workspace.root),9,R$)],34),Ot(m("div",D$,[(x(!0),E(Ne,null,Qe(e.visibleSessions(e.group.sessions,e.isExpanded(e.group.workspace.id),e.activeId),u=>(x(),Ke(xC,{key:u.id,session:u,active:u.id===e.activeId,"approval-count":e.pendingBySession[u.id]?.approvals??0,"question-count":e.pendingBySession[u.id]?.questions??0,unread:e.unreadBySession[u.id]??!1,onSelect:c[10]||(c[10]=d=>o("selectSession",d)),onRename:c[11]||(c[11]=(d,h)=>o("renameSession",d,h)),onArchive:c[12]||(c[12]=d=>o("archiveSession",d)),onFork:c[13]||(c[13]=d=>o("forkSession",d))},null,8,["session","active","approval-count","question-count","unread"]))),128)),!e.isExpanded(e.group.workspace.id)&&e.visibleSessions(e.group.sessions,!1,e.activeId).length<e.group.sessions.length?(x(),E("button",{key:0,class:"show-more",onClick:c[14]||(c[14]=Ze(u=>o("toggleExpand",e.group.workspace.id),["stop"]))},L(C(n)("sidebar.showMore",{count:e.group.sessions.length-e.visibleSessions(e.group.sessions,!1,e.activeId).length})),1)):le("",!0),e.group.sessions.length===0?(x(),E("div",B$,L(C(n)("sidebar.noSessions")),1)):le("",!0)],512),[[Ho,!e.isCollapsed(e.group.workspace.id)]])],2))}}),H$=wt(F$,[["__scopeId","data-v-b46c8125"]]),W$={class:"side"},U$={class:"ch"},q$={class:"ch-brand"},j$={class:"ch-name"},z$={key:0,class:"ch-endpoint"},V$=["title","aria-label"],K$=["title","aria-label"],G$={class:"search"},Y$=["placeholder","aria-label","onKeydown"],X$=["title","aria-label"],Z$={class:"btn-wrap"},J$={key:0,class:"sessions"},Q$={key:1,class:"empty"},e5={key:1,class:"sessions"},t5={key:0,class:"empty"},n5=["onDragover","onDrop"],Xp=10,s5=Je({__name:"Sidebar",props:{activeWorkspace:{default:null},activeWorkspaceId:{default:null},sessions:{},groups:{},activeId:{},attentionBySession:{default:()=>({})},pendingBySession:{default:()=>({})},unreadBySession:{default:()=>({})},colWidth:{default:220}},emits:["select","create","createInWorkspace","selectWorkspace","selectWorkspaces","addWorkspace","rename","archive","fork","renameWorkspace","deleteWorkspace","reorderWorkspaces","openSettings","collapse"],setup(e,{emit:t}){const{t:n}=St(),s=!1,o="",i=e,r=t,l=se(""),a=H(()=>l.value.trim()),c=H(()=>a.value.length>0),u=H(()=>{const Re=a.value.toLowerCase();return Re?i.sessions.filter(Pe=>{const st=(Pe.title??"").toLowerCase(),et=(Pe.lastPrompt??"").toLowerCase();return st.includes(Re)||et.includes(Re)}):[]});function d(){l.value=""}function h(Re){d(),O(Re)}const p=se(new Set(J6()));function f(Re){return p.value.has(Re)}function g(Re){const Pe=new Set(p.value);if(Pe.has(Re)){Pe.delete(Re);const st=new Set(A.value);st.delete(Re),A.value=st}else Pe.add(Re);p.value=Pe,Q6(Pe)}const w=se(null),S=se(null);function y(Re){w.value=Re}function k(){w.value=null,S.value=null}function v(Re){const Pe=Re.currentTarget.getBoundingClientRect();return Re.clientY<Pe.top+Pe.height/2?"before":"after"}function _(Re,Pe){w.value===null||w.value===Pe||(Re.preventDefault(),Re.dataTransfer&&(Re.dataTransfer.dropEffect="move"),S.value={id:Pe,position:v(Re)})}function I(Re){const Pe=w.value,st=S.value?.id===Re?S.value.position:"before";if(S.value=null,w.value=null,!Pe||Pe===Re)return;const et=p$(i.groups.map(mt=>mt.workspace.id),Pe,Re,st);r("reorderWorkspaces",et)}const A=se(new Set);function b(Re){return A.value.has(Re)}function M(Re){const Pe=new Set(A.value);Pe.has(Re)?Pe.delete(Re):Pe.add(Re),A.value=Pe}function N(Re,Pe,st){if(Pe||Re.length<=Xp)return Re;const et=Re.slice(0,Xp);if(st&&!et.some(mt=>mt.id===st)){const mt=Re.find(dn=>dn.id===st);mt&&(et[Xp-1]=mt)}return et}const D=se(new Set);function $(Re,Pe){if(Pe.shiftKey){Pe.stopPropagation();const st=new Set(D.value);st.has(Re)?st.delete(Re):st.add(Re),D.value=st,r("selectWorkspaces",Array.from(st));return}D.value=new Set,r("selectWorkspaces",[]),g(Re)}function O(Re){D.value=new Set,r("selectWorkspaces",[]),r("select",Re)}const P=se(null),R=se(""),F=se(null);function V(){return F}function K(Re,Pe){P.value=Re,R.value=Pe,vt().then(()=>F.value?.focus())}function Z(){const Re=P.value,Pe=R.value.trim();Re&&Pe&&r("renameWorkspace",Re,Pe),P.value=null}function G(){P.value=null}function X(Re){R.value=Re}const pe=se(!1),oe=se(null),ye=se({}),_e=se(null);function de(Re){_e.value&&!_e.value.contains(Re.target)&&xe()}function be(Re,Pe){if(Pe.shiftKey){Pe.stopPropagation();const st=new Set(D.value);st.has(Re.id)?st.delete(Re.id):st.add(Re.id),D.value=st,r("selectWorkspaces",Array.from(st));return}Pe.preventDefault(),Pe.stopPropagation(),oe.value=Re,ye.value={top:`${Pe.clientY}px`,left:`${Pe.clientX}px`},pe.value=!0,document.addEventListener("mousedown",de,!0)}function xe(){pe.value=!1,document.removeEventListener("mousedown",de,!0),oe.value=null,J()}function Le(){oe.value&&xs(oe.value.root),xe()}function ee(){oe.value&&K(oe.value.id,oe.value.name),xe()}function ke(){const Re=oe.value;Re&&ue(Re.id)&&(r("deleteWorkspace",Re.id),xe())}const ge=se(null);let W;function J(){clearTimeout(W),ge.value=null}function ue(Re){return ge.value===Re?(J(),!0):(clearTimeout(W),ge.value=Re,W=setTimeout(()=>{ge.value=null},2500),!1)}const ie=se(null),ae=se(null),U=se({}),Y=se(null);function ce(Re){const Pe=Re.target;Pe.closest(".gh-more")||Pe.closest(".ws-menu")||Se()}async function me(Re,Pe){if(ie.value===Re.id){Se();return}const st=Pe.currentTarget;ae.value=Re,ie.value=Re.id,document.addEventListener("mousedown",ce),document.addEventListener("scroll",Se,!0),window.addEventListener("resize",Se),await vt();const et=Y.value,mt=st.getBoundingClientRect(),dn=4,wn=8,xt=et?.offsetHeight??0,ln=et?.offsetWidth??0;let Sn=mt.bottom+dn;Sn+xt>window.innerHeight-wn&&(Sn=Math.max(wn,mt.top-xt-dn));let Xe=mt.right-ln;Xe<wn&&(Xe=wn),U.value={top:`${Math.round(Sn)}px`,left:`${Math.round(Xe)}px`}}function Se(){ie.value=null,ae.value=null,J(),document.removeEventListener("mousedown",ce),document.removeEventListener("scroll",Se,!0),window.removeEventListener("resize",Se)}function Ee(Re){xs(Re.root),Se()}function re(Re){K(Re.id,Re.name),Se()}function Te(Re){ue(Re.id)&&(r("deleteWorkspace",Re.id),Se())}qs(()=>{document.removeEventListener("mousedown",de,!0),document.removeEventListener("mousedown",ce),document.removeEventListener("scroll",Se,!0),window.removeEventListener("resize",Se),clearTimeout(W)});const Ue=se(null);let nt;function ct(){const Re=Ue.value;Re&&(Re.classList.remove("blink-now"),Re.getBoundingClientRect(),Re.classList.add("blink-now"),clearTimeout(nt),nt=setTimeout(()=>Re.classList.remove("blink-now"),300))}return(Re,Pe)=>(x(),E("aside",W$,[m("div",{class:"col",style:Ft({width:e.colWidth+"px"})},[m("div",U$,[m("div",q$,[(x(),E("svg",{ref_key:"logoRef",ref:Ue,class:Ie(["ch-logo",{"is-dev":C(s)}]),viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onClick:ct},[...Pe[18]||(Pe[18]=[kr('<defs data-v-418e4596><mask id="kimiEyes" maskUnits="userSpaceOnUse" data-v-418e4596><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-418e4596></rect><g class="ch-eyes" fill="#000" data-v-418e4596><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-418e4596></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-418e4596></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#kimiEyes)" data-v-418e4596></rect>',2)])],2)),m("span",j$,[Pe[19]||(Pe[19]=yt("Kimi Code",-1)),C(s)?(x(),E("span",z$," · "+L(C(o)),1)):le("",!0)])]),m("button",{type:"button",class:"collapse-btn",title:C(n)("sidebar.collapseSidebar"),"aria-label":C(n)("sidebar.collapseSidebar"),onClick:Pe[0]||(Pe[0]=Ze(st=>r("collapse"),["stop"]))},[...Pe[20]||(Pe[20]=[kr('<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-418e4596><path d="M11 6h9" data-v-418e4596></path><path d="M11 12h9" data-v-418e4596></path><path d="M11 18h9" data-v-418e4596></path><path d="M7 9l-3 3 3 3" data-v-418e4596></path></svg>',1)])],8,V$),m("button",{type:"button",class:"settings-btn",title:C(n)("settings.title"),"aria-label":C(n)("settings.title"),onClick:Pe[1]||(Pe[1]=Ze(st=>r("openSettings"),["stop"]))},[...Pe[21]||(Pe[21]=[m("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("circle",{cx:"12",cy:"12",r:"3"}),m("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l-.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09A1.65 1.65 0 0 0 15 4.6a1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09A1.65 1.65 0 0 0 19.4 15z"})],-1)])],8,K$)]),m("div",G$,[Pe[23]||(Pe[23]=m("svg",{class:"search-icon",viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("circle",{cx:"7",cy:"7",r:"5"}),m("path",{d:"M11 11l3 3"})],-1)),Ot(m("input",{"onUpdate:modelValue":Pe[2]||(Pe[2]=st=>l.value=st),class:"search-input",type:"text",placeholder:C(n)("sidebar.searchPlaceholder"),"aria-label":C(n)("sidebar.searchPlaceholder"),onKeydown:Mo(Ze(d,["stop"]),["esc"])},null,40,Y$),[[An,l.value]]),c.value?(x(),E("button",{key:0,type:"button",class:"search-clear",title:C(n)("sidebar.searchClear"),"aria-label":C(n)("sidebar.searchClear"),onClick:Ze(d,["stop"])},[...Pe[22]||(Pe[22]=[m("svg",{viewBox:"0 0 10 10",width:"10",height:"10",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true"},[m("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),m("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,X$)):le("",!0)]),m("div",Z$,[m("button",{class:"btn-new-chat",onClick:Pe[3]||(Pe[3]=Ze(st=>r("create"),["stop"]))},[Pe[24]||(Pe[24]=m("svg",{viewBox:"0 0 16 16",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("path",{d:"M4 2.5h8a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2H8.5l-2.5 2V11.5H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2z"})],-1)),m("span",null,L(C(n)("sidebar.newChat")),1)]),le("",!0)]),c.value?(x(),E("div",J$,[u.value.length>0?(x(!0),E(Ne,{key:0},Qe(u.value,st=>(x(),Ke(xC,{key:st.id,session:st,active:st.id===e.activeId,"approval-count":e.pendingBySession[st.id]?.approvals??0,"question-count":e.pendingBySession[st.id]?.questions??0,unread:e.unreadBySession[st.id]??!1,onSelect:Pe[5]||(Pe[5]=et=>h(et)),onRename:Pe[6]||(Pe[6]=(et,mt)=>r("rename",et,mt)),onArchive:Pe[7]||(Pe[7]=et=>r("archive",et)),onFork:Pe[8]||(Pe[8]=et=>r("fork",et))},null,8,["session","active","approval-count","question-count","unread"]))),128)):(x(),E("div",Q$,L(C(n)("sidebar.searchNoResults")),1))])):(x(),E("div",e5,[e.groups.length===0?(x(),E("div",t5,L(C(n)("workspace.noWorkspace")),1)):(x(!0),E(Ne,{key:1},Qe(e.groups,st=>(x(),E("div",{key:st.workspace.id,class:Ie(["ws-drop-target",{"drop-before":S.value?.id===st.workspace.id&&S.value.position==="before","drop-after":S.value?.id===st.workspace.id&&S.value.position==="after"}]),onDragover:et=>_(et,st.workspace.id),onDrop:et=>I(st.workspace.id)},[bt(H$,{group:st,"active-workspace-id":e.activeWorkspaceId,"active-id":e.activeId,"selected-ids":D.value,"renaming-id":P.value,"rename-value":R.value,"rename-input-ref":V(),"pending-by-session":e.pendingBySession,"unread-by-session":e.unreadBySession,"ws-menu-open-id":ie.value,dragging:w.value===st.workspace.id,"is-collapsed":f,"is-expanded":b,"visible-sessions":N,onGroupClick:$,onGroupContextmenu:be,onToggleWsMenu:me,onCreateInWorkspace:Pe[9]||(Pe[9]=et=>r("createInWorkspace",et)),onSelectSession:O,onRenameSession:Pe[10]||(Pe[10]=(et,mt)=>r("rename",et,mt)),onArchiveSession:Pe[11]||(Pe[11]=et=>r("archive",et)),onForkSession:Pe[12]||(Pe[12]=et=>r("fork",et)),onToggleExpand:M,onConfirmRename:Z,onCancelRename:G,onUpdateRenameValue:X,onWsDragstart:y,onWsDragend:k},null,8,["group","active-workspace-id","active-id","selected-ids","renaming-id","rename-value","rename-input-ref","pending-by-session","unread-by-session","ws-menu-open-id","dragging"])],42,n5))),128))]))],4),pe.value?(x(),E("div",{key:0,ref_key:"ghMenuRef",ref:_e,class:"gh-menu",style:Ft(ye.value),onClick:Pe[13]||(Pe[13]=Ze(()=>{},["stop"]))},[m("button",{type:"button",class:"ghm-item",onClick:Le},L(C(n)("sidebar.copyPath")),1),m("button",{type:"button",class:"ghm-item",onClick:ee},L(C(n)("sidebar.rename")),1),m("button",{type:"button",class:"ghm-item del",onClick:ke},L(oe.value&&ge.value===oe.value.id?C(n)("sidebar.confirm"):C(n)("sidebar.removeWorkspace")),1)],4)):le("",!0),ie.value!==null&&ae.value?(x(),E("div",{key:1,ref_key:"wsMenuRef",ref:Y,class:"ws-menu",style:Ft(U.value),onClick:Pe[17]||(Pe[17]=Ze(()=>{},["stop"]))},[m("button",{class:"ws-menu-item",onClick:Pe[14]||(Pe[14]=Ze(st=>Ee(ae.value),["stop"]))},L(C(n)("sidebar.copyPath")),1),Pe[26]||(Pe[26]=m("div",{class:"ws-menu-divider"},null,-1)),m("button",{class:"ws-menu-item",onClick:Pe[15]||(Pe[15]=Ze(st=>re(ae.value),["stop"]))},L(C(n)("sidebar.rename")),1),Pe[27]||(Pe[27]=m("div",{class:"ws-menu-divider"},null,-1)),m("button",{class:"ws-menu-item del",onClick:Pe[16]||(Pe[16]=Ze(st=>Te(ae.value),["stop"]))},L(ge.value===ae.value.id?C(n)("sidebar.confirm"):C(n)("sidebar.removeWorkspace")),1)],4)):le("",!0)]))}}),o5=wt(s5,[["__scopeId","data-v-418e4596"]]);function i5(e){try{const t=_n(e);if(t===null)return null;const n=Number(t);return Number.isFinite(n)?n:null}catch{return null}}function r5(e,t){try{In(e,String(t))}catch{}}function l5(e){const{storageKey:t,defaultWidth:n,min:s,max:o,reverse:i=!1}=e;function r(S){return Number.isFinite(S)?Math.min(W2(o),Math.max(s,Math.round(S))):n}const l=se(r(i5(t)??n)),a=se(!1);function c(S){const y=r(S);l.value=y,r5(t,y)}let u=0,d=0,h=null,p=-1;function f(S){if(!a.value)return;const y=S.clientX-u;c(d+(i?-y:y))}function g(){if(a.value){if(a.value=!1,typeof document<"u"&&(document.body.style.userSelect="",document.body.style.cursor=""),h){try{h.releasePointerCapture(p)}catch{}h.removeEventListener("pointermove",f),h.removeEventListener("pointerup",g),h.removeEventListener("pointercancel",g)}h=null,p=-1}}function w(S){S.preventDefault(),a.value=!0,u=S.clientX,d=r(l.value),h=S.currentTarget,p=S.pointerId,typeof document<"u"&&(document.body.style.userSelect="none",document.body.style.cursor="col-resize");try{h.setPointerCapture(p)}catch{}h.addEventListener("pointermove",f),h.addEventListener("pointerup",g),h.addEventListener("pointercancel",g)}return qs(g),{width:l,dragging:a,clamp:r,setWidth:c,onPointerDown:w}}const a5=["aria-label"],c5=Je({__name:"ResizeHandle",props:{storageKey:{},defaultWidth:{},min:{},max:{},reverse:{type:Boolean},ariaLabel:{}},emits:["update:width","update:dragging"],setup(e,{emit:t}){const n=e,s=t,{t:o}=St(),{width:i,dragging:r,onPointerDown:l}=l5({storageKey:n.storageKey,defaultWidth:n.defaultWidth,min:n.min,max:()=>n.max,reverse:n.reverse});return s("update:width",i.value),Ge(i,a=>s("update:width",a)),Ge(r,a=>s("update:dragging",a)),(a,c)=>(x(),E("div",{class:Ie(["rh",{dragging:C(r)}]),role:"separator","aria-orientation":"vertical","aria-label":e.ariaLabel??C(o)("layout.resizeHandleAria"),onPointerdown:c[0]||(c[0]=(...u)=>C(l)&&C(l)(...u))},[...c[1]||(c[1]=[m("span",{class:"rh-bar","aria-hidden":"true"},null,-1)])],42,a5))}}),Fk=wt(c5,[["__scopeId","data-v-0d454900"]]),u5={preview:"Preview"},d5={authBannerMessage:"Not signed in · Sign in to Kimi Code to start a conversation",authBannerLogin:"Sign in",authPageTitle:"Sign in to Kimi Code",authPageMessage:"Connect your Kimi Code account before starting or continuing conversations.",authPageLogin:"Sign in",connecting:"Connecting…",comingSoon:"Coming soon…"},f5={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",newSession:"New Session",newChat:"New Chat",newWorkspace:"New Workspace",emptyState:"No sessions yet · click New Session to start",archiveConfirm:"Archive session?",confirm:"Confirm",cancel:"Cancel",options:"Options",rename:"Rename",copyPath:"Copy path",copySessionId:"Copy session ID ⧉",copied:"Copied ✓",copyFailed:"Copy failed",archive:"Archive",fork:"Fork session",delete:"Delete",removeWorkspace:"Remove workspace",brand:"Kimi Code",signedIn:"Signed in",signOut:"Sign out",notSignedIn:"Not signed in",signIn:"Sign in",language:"Language",daemon:"Daemon",noSessions:"No conversations yet",showMore:"Show more ({count})",collapseSidebar:"Collapse sidebar",expandSidebar:"Expand sidebar",searchPlaceholder:"Search sessions",searchClear:"Clear search",searchNoResults:"No matching sessions"},h5={switcherTitle:"Switch workspace",switchTooltip:"Switch workspace",eyebrow:"Workspace",branchLabel:"branch: {branch}",noBranch:"no branch",sessionCount:"{count} session | {count} sessions",allWorkspaces:"All workspaces",currentWorkspace:"Current workspace only",addWorkspace:"Add workspace…",noWorkspace:"No workspace",deleteHasSessions:"This workspace still has sessions — archive them before deleting it",scopeCurrent:"this workspace",scopeAll:"all workspaces",newInGroup:"New session in this workspace",addTitle:"Add workspace",pathLabel:"Path",pathPlaceholder:"/absolute/path/to/project",recentLabel:"Recent folders",add:"Add",cancel:"Cancel",addHint:"Paste an absolute folder path, or pick a recent one.",openThisFolder:"Open this folder",up:"Up",browsing:"Browsing…",filterPlaceholder:"Filter subfolders…",searchPlaceholder:"Fuzzy-search under this folder…",searching:"Searching…",pasteToggle:"Enter an absolute path",noFilterMatch:"No subfolders match “{q}”",noSubfolders:"No subfolders here",gitTag:"git",browseHint:'Click a folder to enter it, then "Open this folder" to add it as a workspace.',attentionTitle:"{count} item needs your attention | {count} items need your attention",awaitingAnswer:"Answer",awaitingAnswerTitle:"A question is waiting for your answer",awaitingPermission:"Approve",awaitingPermissionTitle:"An action is waiting for your approval",aborted:"Stopped",abortedTitle:"This session was interrupted before finishing"},p5={jumpToLatestAria:"Jump to latest message",toc:"Conversation outline",newMessages:"Latest messages",loading:"Loading…",emptyWorkspaceHint:"Send in {name}",switchWorkspace:"Switch workspace",addWorkspace:"New workspace",moreWorkspaces:"More workspaces ({count})",compacting:"Compacting context…",compactedPlain:"Context compacted",compactedAuto:"Context auto-compacted",compactedTokens:" ({before} → {after} tokens)",viewSummary:"View summary",summaryTitle:"Compaction summary",manuallyAborted:"Manually stopped",activatedSkill:"Activated skill: {name}",undo:"Undo",undoTooltip:"Undoing the conversation will not roll back code changes",undoConfirm:"Undo last message?",confirm:"Confirm",cancel:"Cancel",yesterday:"Yesterday",loadOlder:"Load earlier messages",loadingOlder:"Loading earlier messages…"},m5={connectionConnected:"Connected",connectionConnecting:"Connecting…",connectionDisconnected:"Disconnected",ctxTooltip:"Used {used} / {max} tokens ({pct}%)",modelLabel:"Model",modelTooltip:"Click to switch model",permissionManual:"Manual",permissionAuto:"Auto",permissionYolo:"YOLO",permissionTooltip:"Click to cycle permission mode",permissionManualDesc:"Ask for approval on every tool action",permissionAutoDesc:"Fully autonomous — agent decides everything without asking",permissionYoloDesc:"Auto-approve tool actions, but agent may still ask questions",planLabel:"Plan",planOn:"on",planOff:"off",planTooltip:"Toggle plan mode (research before editing)",modesLabel:"Mode",modesTooltip:"Mode: Plan / Goal / Swarm",goalLabel:"Goal",swarmLabel:"Swarm",modeOff:"Off",goalPlaceholder:"What should the agent achieve?",goalStart:"Start",goalPause:"Pause",goalResume:"Resume",goalCancel:"Cancel",modeNotSupported:"Not supported",thinkingLabel:"thinking",thinkingTooltip:"Toggle thinking mode",starredModels:"Starred",moreModels:"More models…",statusPanelTitle:"Session status",statusPanelClose:"Close",statusModel:"Model",statusThinking:"Thinking",statusPermission:"Permission",statusPlanMode:"Plan mode",statusSwarmMode:"Swarm mode",swarmOn:"on",swarmOff:"off",statusContext:"Context",statusCost:"Cost",statusContextValue:"{used} / {max} ({pct}%)",statusNone:"—",activityRunning:"Running…",activityAwaitingApproval:"Awaiting approval",activityAwaitingQuestion:"Awaiting answer",interrupt:"Interrupt",runningShort:"in progress"},g5={placeholder:"Type a message…",send:"Send ↵",queueLabel:"Queue",editQueued:"Edit (load back into the input)",queuedImageOnly:"image ×{n}",queuedHasImage:"Contains {n} image(s) — remove only, not editable",remove:"Remove",removeNamed:"Remove {name}",uploading:"Uploading",uploadFailed:"Upload failed",attachImage:"Attach image",previewAttachment:"Preview {name}",interrupt:"Interrupt",interruptTitle:"Interrupt current operation",steerNow:"Steer now ⌃S",steerTitle:"Inject into the running turn without waiting (Ctrl+S / ⌘S)",emptyConversationTitle:"Kimi Code",emptyConversation:"No messages yet — type below to start the conversation",quickStartPlaceholder:"Type a message to start a new conversation…",thinkingSuffix:" · thinking"},v5={title:"Sign in to Kimi Code",close:"Close (Esc)",starting:"Starting authorization flow…",lead:"Click the button below to authorize in a new browser tab.",authorizeInBrowser:"Authorize in browser",orDivider:"or",fallbackPrefix:"On another device? Open ",fallbackSuffix:" and enter the device code:",copy:"Copy",copied:"Copied",waitingAuth:"Waiting for authorization",waitingAutoClose:"Waiting for authorization, signs in automatically…",success:"Authorized",successHint:"Loading, will close automatically…",expiredTitle:"Authorization code expired",expiredHint:"Please restart the authorization flow",retry:"Retry",closeBtn:"Close",errorTitle:"The current daemon does not support login yet",errorHint:"Please upgrade kimi-code and try again"},y5={dialogLabel:"Manage providers",title:"Provider management",close:"Close (Esc)",loading:"Loading providers…",unavailable:"The daemon does not support provider management yet",empty:"No providers yet",status:{connected:"Connected",error:"Error",unconfigured:"Not configured"},keySet:"key set",keyNotSet:"key not set",modelCount:"{count} models",confirmDelete:"Confirm delete?",confirm:"Confirm",cancel:"Cancel",refresh:"Refresh",delete:"Delete",refreshTitle:"Refresh {type}",deleteTitle:"Delete {type}",loginKimi:"Sign in to Kimi",loginAnthropic:"Sign in to Anthropic",enterApiKey:"Enter API Key",fieldType:"Type",fieldApiKey:"API Key",fieldBaseUrl:"Base URL",fieldDefaultModel:"Default model",baseUrlPlaceholder:"https://… (optional)",optional:"Optional",apiKeyRequired:"API Key cannot be empty",add:"Add",escClose:"Esc to close"},k5={dialogLabel:"Switch model",title:"Switch model",close:"Close (Esc)",allTab:"All",providerTabs:"Model providers",searchPlaceholder:"Search models or providers…",loading:"Loading models…",unavailable:"The daemon does not support model listing yet",contextSuffix:"{size}k ctx",emptyNoModels:"The daemon offers no selectable models",emptyNoMatch:"No matching models",starTitle:"Add to favorites",unstarTitle:"Remove from favorites",footerHint:"↑↓ Navigate · Enter Select · Esc Close"},b5={title:"New session",close:"Close (Esc)",cwdLabel:"Working directory",cwdPlaceholder:"Absolute path of the working directory, e.g. /Users/you/project",recentLabel:"Recent directories",titleFieldLabel:"Title",titleFieldPlaceholder:"Optional, named automatically if left blank",create:"Create",cancel:"Cancel",footerHint:"Enter to create · Esc to close"},_5={title:"Sessions",close:"Close",searchPlaceholder:"Search sessions by title…",noWorkspace:"No workspace",emptyNone:"No sessions yet",emptyNoMatch:"No matching sessions",footerHint:"↑↓ to navigate · Enter to switch · Esc to close",justNow:"just now"},w5={title:{shell:"Run command?",diff:"Apply changes?",file:"Write file?",fileop:"File operation?",url:"Fetch URL?",search:"Search?",invocation:"Invoke?",todo:"Update todo?",generic:"Approve action?"},subagentBadge:"sub agent · {name}",required:"APPROVAL REQUIRED",danger:"Danger: {detail}",searchQueryLabel:"query",searchScope:"scope: {scope}",feedbackPlaceholder:"Explain why you are rejecting… (Enter to submit, Esc to cancel)",feedbackHint:"Enter to submit · Esc to cancel",approve:"Approve",approveSession:"Approve for session",reject:"Reject",feedback:"+Feedback"},S5={title:"Question",step:"Q{current}/{total}",prev:"‹ Prev",next:"Next ›",otherDefault:"Other…",submit:"Submit",dismiss:"Dismiss",minimize:"Minimize",expand:"Expand"},C5={tag:"tasks",summary:"{run} running · {done} done",stop:"stop",defaultDescription:"Background task",dockTasks:"Background tasks",dockBash:"Bash",dockSubagent:"Sub Agent",dockTodos:"Todos",dockQueue:"Queue",running:"running",closePanel:"Close panel",timingRunning:"Running · {time}",timingDone:"Done · {sec}s",todoTag:"todos",emptyTasks:"No background tasks running",emptyBash:"No bash tasks running",emptySubagent:"No sub agent tasks running",emptyTodo:"No todos yet",openTab:"Open the tasks tab",collapse:"Collapse",expand:"Expand"},x5={panelTitle:"Thinking",close:"Close"},T5={title:"Changes",branch:"branch",aheadTitle:"ahead of remote",behindTitle:"behind remote",changeCount:"{count} changes",empty:"No git changes / not provided by daemon",clean:"Working tree clean, no changes",back:"Back",loading:"Loading diff…",noDiff:"No line changes for this file",list:"List",tree:"Tree",close:"Close"},M5={},A5={empty:"Select a file on the left to preview",loading:"Loading…",lineCount:"{count} lines",copy:"Copy",copied:"Copied",copyPath:"Copy path",openInEditor:"Open",reveal:"Reveal",download:"Download",close:"Close",search:"Search",prevMatch:"Previous match",nextMatch:"Next match",htmlMode:"HTML preview mode",markdownMode:"Markdown preview mode",preview:"Preview",source:"Source",imageFit:"Image sizing",fit:"Fit",actual:"Actual",pdfNoPreview:"This PDF cannot be embedded here. Download it to view.",imageNoPreview:"Image file · {mime} · {size} · preview unavailable",binaryNoPreview:"Binary file · {mime} · {size} bytes · preview unavailable",unknownType:"unknown type",copyCode:"Copy code",errors:{emptyPath:"File path is empty",unsupportedPath:"URLs and remote paths cannot be previewed",outsideWorkspace:"Only files inside the current workspace can be previewed",isDirectory:"Select a file instead of a directory",loadFailed:"Unable to read this file"}},E5={searching:"Searching…",noMatch:"No matches"},I5={dismiss:"Close",errorLabel:"Error",noteLabel:"Note",details:{cause:"Cause",code:"Error code",contentType:"Content type",details:"Server details",endpoint:"Endpoint",errorName:"Error type",message:"Message",operation:"Operation",phase:"Failure phase",request:"Request",requestId:"Request ID",responsePreview:"Response preview",sessionId:"Session ID",status:"HTTP status",timeout:"Timeout"},daemonApiTitle:"Kimi daemon returned an error",daemonNetworkMessage:"Web did not receive a response from the local service. Check that Kimi daemon is still running, or refresh the page.",daemonNetworkTitle:"Cannot connect to Kimi daemon",diagnostics:"Diagnostics",hideDetails:"Hide details",operationFailedMessage:"The last operation did not finish. Try again later.",operationFailedTitle:"Operation failed",sessionSnapshotMessage:"Web could not load the current conversation. Check that Kimi daemon is still running, or refresh the page.",sessionSnapshotTitle:"Cannot load current conversation",showDetails:"Show details",copyDetails:"Copy diagnostics",copied:"Copied",wsTitle:"Realtime connection error",goal:{alreadyExists:"This session already has an active goal. Cancel it before starting a new one.",notFound:"No goal to act on — it may have already finished or been cancelled.",statusInvalid:"The current goal state does not allow this action.",notResumable:"This goal cannot be resumed (it may be cancelled or completed).",objectiveTooLong:"The objective is too long. Please shorten it and try again."}},$5={help:{desc:"Show the list of available commands"},new:{desc:"Create a new session"},sessions:{desc:"Browse & switch sessions"},clear:{desc:"Clear and start a new session"},model:{desc:"Switch model"},provider:{desc:"Manage providers (add / remove / refresh)"},login:{desc:"Sign in to Kimi in the browser"},permission:{desc:"Switch approval mode (manual / auto / yolo)"},plan:{desc:"Toggle plan mode on/off"},swarm:{desc:"Toggle swarm mode; /swarm <task> runs a task in swarm"},goal:{desc:"Create/control a goal: /goal <objective>, /goal pause|resume|cancel"},btw:{desc:"Side chat: /btw <question> asks a forked side session"},yolo:{desc:"Auto-approve everything (yolo mode)"},auto:{desc:"Auto-approve safe edits/reads"},thinking:{desc:"Set the thinking level"},compact:{desc:"Compact the conversation history"},fork:{desc:"Fork this session into a new one"},undoNotImplemented:"/undo isn't supported by the daemon yet",status:{desc:"View session status"},undo:{desc:"Undo the last message"}},N5={label:{read:"Read",bash:"Run",edit:"Edit",write:"Write",grep:"Search",glob:"Find",ls:"List",web_fetch:"Fetch",search:"Search",todo:"Plan",task:"Task"},chip:{lines:"{count} lines",results:"{count} results",edited:"edited",created:"created",todos:"{count} items"}},L5={resizeHandleAria:"Resize sidebar width",resizePreviewAria:"Resize preview panel width",detailPanelAria:"Detail panel"},O5={openSwitcher:"Switch session / workspace",openSettings:"Session settings",settingsTitle:"Session settings",sheetLabel:"Sheet",closeSheet:"Close",tapToCycle:"tap to cycle",running:"running",idle:"idle",sessionCount:"{n} sessions",newSession:"New session",permManualSub:"confirm every tool",permAutoSub:"auto-approve edits",permYoloSub:"auto-approve all",planModeSub:"Plan mode",swarmModeSub:"Swarm mode"},P5={label:"Theme",modern:"Explore",kimi:"Native",colorSchemeLabel:"Appearance",light:"Light",dark:"Dark",system:"System"},R5={preview:"预览"},D5={authBannerMessage:"未登录 · 需要登录 Kimi Code 才能开始对话",authBannerLogin:"登录",authPageTitle:"登录 Kimi Code",authPageMessage:"先连接 Kimi Code 账号,然后再开始或继续对话。",authPageLogin:"登录",connecting:"连接中…",comingSoon:"敬请期待"},B5={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",newSession:"新建会话",newChat:"新建对话",newWorkspace:"新建工作区",emptyState:"还没有会话 · 点击 新建会话 开始",archiveConfirm:"归档会话?",confirm:"确认",cancel:"取消",options:"选项",rename:"重命名",copyPath:"复制路径",copySessionId:"复制 Session ID ⧉",copied:"已复制 ✓",copyFailed:"复制失败",archive:"归档",fork:"分叉会话",delete:"删除",removeWorkspace:"移除工作区",brand:"Kimi Code",signedIn:"已登录",signOut:"退出登录",notSignedIn:"未登录",signIn:"登录",language:"语言",daemon:"后台",noSessions:"暂无对话",showMore:"展开更多 ({count})",collapseSidebar:"收起侧边栏",expandSidebar:"展开侧边栏",searchPlaceholder:"搜索会话",searchClear:"清除搜索",searchNoResults:"没有匹配的会话"},F5={switcherTitle:"切换工作区",switchTooltip:"切换工作区",eyebrow:"工作区",branchLabel:"分支: {branch}",noBranch:"无分支",sessionCount:"{count} 个会话",allWorkspaces:"全部工作区",currentWorkspace:"仅当前工作区",addWorkspace:"添加工作区…",noWorkspace:"暂无工作区",deleteHasSessions:"工作区内还有会话,请先归档这些会话再删除",scopeCurrent:"当前工作区",scopeAll:"全部工作区",newInGroup:"在此工作区新建会话",addTitle:"添加工作区",pathLabel:"路径",pathPlaceholder:"/项目的绝对路径",recentLabel:"最近的文件夹",add:"添加",cancel:"取消",addHint:"粘贴一个绝对路径,或从最近用过的文件夹中选择。",openThisFolder:"打开此文件夹",up:"上一级",browsing:"加载中…",filterPlaceholder:"过滤子文件夹…",searchPlaceholder:"在此目录下模糊搜索…",searching:"搜索中…",pasteToggle:"直接输入绝对路径",noFilterMatch:"没有匹配「{q}」的子文件夹",noSubfolders:"此处没有子文件夹",gitTag:"git",browseHint:'点击文件夹进入,再点"打开此文件夹"将其添加为工作区。',attentionTitle:"{count} 项待处理",awaitingAnswer:"待回答",awaitingAnswerTitle:"有提问等待你回答",awaitingPermission:"待授权",awaitingPermissionTitle:"有操作等待你授权",aborted:"已中断",abortedTitle:"此会话在完成前被中断"},H5={jumpToLatestAria:"跳到最新消息",toc:"对话目录",newMessages:"最新消息",loading:"加载中…",emptyWorkspaceHint:"在 {name} 中发送",switchWorkspace:"切换工作区",addWorkspace:"添加工作区",moreWorkspaces:"更多工作区 ({count})",compacting:"正在压缩上下文…",compactedPlain:"上下文已压缩",compactedAuto:"已自动压缩上下文",compactedTokens:"({before} → {after} tokens)",viewSummary:"查看摘要",summaryTitle:"压缩摘要",manuallyAborted:"您已手动终止",activatedSkill:"已激活技能: {name}",undo:"撤销",undoTooltip:"撤销对话不会回滚代码",undoConfirm:"确定撤销?",confirm:"确定",cancel:"取消",yesterday:"昨天",loadOlder:"加载更早的消息",loadingOlder:"正在加载更早的消息…"},W5={connectionConnected:"已连接",connectionConnecting:"连接中…",connectionDisconnected:"未连接",ctxTooltip:"使用 {used} / {max} tokens ({pct}%)",modelLabel:"模型",modelTooltip:"点击切换模型",permissionManual:"逐条确认",permissionAuto:"完全自主",permissionYolo:"自动通过",permissionTooltip:"点击循环切换审批模式",permissionManualDesc:"每个工具操作都需要你手动确认",permissionAutoDesc:"完全自主运行,agent 自己做决定,不再询问",permissionYoloDesc:"自动批准工具操作,但遇到关键问题仍会询问",planLabel:"计划",planOn:"开",planOff:"关",planTooltip:"切换计划模式(先调研再修改)",modesLabel:"模式",modesTooltip:"模式:计划 / 目标 / Swarm",goalLabel:"目标",swarmLabel:"Swarm",modeOff:"未启用",goalPlaceholder:"让 Agent 完成什么目标?",goalStart:"开始",goalPause:"暂停",goalResume:"继续",goalCancel:"取消",modeNotSupported:"暂不支持",thinkingLabel:"思考",thinkingTooltip:"切换思考模式",starredModels:"收藏",moreModels:"更多模型…",statusPanelTitle:"会话状态",statusPanelClose:"关闭",statusModel:"模型",statusThinking:"思考强度",statusPermission:"权限",statusPlanMode:"计划模式",statusSwarmMode:"Swarm 模式",swarmOn:"开",swarmOff:"关",statusContext:"上下文",statusCost:"花费",statusContextValue:"{used} / {max} ({pct}%)",statusNone:"—",activityRunning:"运行中…",activityAwaitingApproval:"等待批准",activityAwaitingQuestion:"等待回答",interrupt:"中断",runningShort:"进行中"},U5={placeholder:"输入消息…",send:"发送 ↵",queueLabel:"队列",editQueued:"编辑(载入到输入框)",queuedImageOnly:"图片 ×{n}",queuedHasImage:"包含 {n} 张图片 — 只能移除,不能编辑",remove:"移除",removeNamed:"移除 {name}",uploading:"上传中",uploadFailed:"上传失败",attachImage:"附加图片",previewAttachment:"预览 {name}",interrupt:"中断",interruptTitle:"中断当前操作",steerNow:"立即插入 ⌃S",steerTitle:"不等当前回合结束,把消息直接插进正在运行的任务(Ctrl+S / ⌘S)",emptyConversationTitle:"Kimi Code",emptyConversation:"还没有消息 —— 在下方输入开始对话",quickStartPlaceholder:"输入消息开始新对话…",thinkingSuffix:" · thinking"},q5={title:"登录 Kimi Code",close:"关闭 (Esc)",starting:"正在启动授权流程…",lead:"点击下方按钮,在新标签页中完成授权。",authorizeInBrowser:"在浏览器中授权",orDivider:"或者",fallbackPrefix:"换个设备?在浏览器打开 ",fallbackSuffix:" 输入设备码:",copy:"复制",copied:"已复制",waitingAuth:"等待授权",waitingAutoClose:"等待授权,完成后自动登录…",success:"已授权",successHint:"正在加载,稍后自动关闭…",expiredTitle:"授权码已过期",expiredHint:"请重新开始授权流程",retry:"重试",closeBtn:"关闭",errorTitle:"当前 daemon 暂不支持登录",errorHint:"请升级 kimi-code 后重试"},j5={dialogLabel:"管理提供商",title:"提供商管理",close:"关闭 (Esc)",loading:"加载提供商中…",unavailable:"daemon 暂不支持提供商管理",empty:"暂无提供商",status:{connected:"已连接",error:"错误",unconfigured:"未配置"},keySet:"key 已设置",keyNotSet:"未设置 key",modelCount:"{count} 个模型",confirmDelete:"确认删除?",confirm:"确认",cancel:"取消",refresh:"刷新",delete:"删除",refreshTitle:"刷新 {type}",deleteTitle:"删除 {type}",loginKimi:"登录 Kimi",loginAnthropic:"登录 Anthropic",enterApiKey:"填写 API Key",fieldType:"类型",fieldApiKey:"API Key",fieldBaseUrl:"Base URL",fieldDefaultModel:"默认模型",baseUrlPlaceholder:"https://… (可选)",optional:"可选",apiKeyRequired:"API Key 不能为空",add:"添加",escClose:"Esc 关闭"},z5={dialogLabel:"切换模型",title:"切换模型",close:"关闭 (Esc)",allTab:"全部",providerTabs:"模型提供商",searchPlaceholder:"搜索模型或提供商…",loading:"加载模型中…",unavailable:"daemon 暂不支持模型列表",contextSuffix:"{size}k ctx",emptyNoModels:"daemon 未提供可选模型",emptyNoMatch:"无匹配模型",starTitle:"添加到收藏",unstarTitle:"取消收藏",footerHint:"↑↓ 导航 · Enter 选择 · Esc 关闭"},V5={title:"新建会话",close:"关闭 (Esc)",cwdLabel:"工作目录",cwdPlaceholder:"工作目录绝对路径,如 /Users/you/project",recentLabel:"最近目录",titleFieldLabel:"标题",titleFieldPlaceholder:"可选,留空则自动命名",create:"新建",cancel:"取消",footerHint:"Enter 新建 · Esc 关闭"},K5={title:"会话",close:"关闭",searchPlaceholder:"按标题搜索会话…",noWorkspace:"无工作区",emptyNone:"暂无会话",emptyNoMatch:"没有匹配的会话",footerHint:"↑↓ 切换 · Enter 进入 · Esc 关闭",justNow:"刚刚"},G5={title:{shell:"运行命令?",diff:"应用修改?",file:"写入文件?",fileop:"文件操作?",url:"抓取 URL?",search:"搜索?",invocation:"调用?",todo:"更新 todo?",generic:"批准操作?"},subagentBadge:"子 agent · {name}",required:"APPROVAL REQUIRED",danger:"危险: {detail}",searchQueryLabel:"query",searchScope:"scope: {scope}",feedbackPlaceholder:"说明拒绝原因… (Enter 提交, Esc 取消)",feedbackHint:"Enter 提交 · Esc 取消",approve:"批准",approveSession:"本会话内批准",reject:"拒绝",feedback:"+反馈"},Y5={title:"提问",step:"Q{current}/{total}",prev:"‹ 上一",next:"下一 ›",otherDefault:"其他…",submit:"提交",dismiss:"放弃",minimize:"最小化",expand:"展开"},X5={tag:"tasks",summary:"{run} 运行中 · {done} 完成",stop:"stop",defaultDescription:"后台任务",dockTasks:"后台任务",dockBash:"后台 Bash",dockSubagent:"子 Agent",dockTodos:"待办",dockQueue:"队列",running:"运行中",closePanel:"关闭面板",timingRunning:"运行中 · {time}",timingDone:"完成 · {sec}s",todoTag:"待办",emptyTasks:"暂无后台任务",emptyBash:"暂无后台 Bash 任务",emptySubagent:"暂无子 Agent 任务",emptyTodo:"暂无待办事项",openTab:"查看全部后台任务",collapse:"折叠",expand:"展开"},Z5={panelTitle:"思考过程",close:"关闭"},J5={title:"改动",branch:"branch",aheadTitle:"ahead of remote",behindTitle:"behind remote",changeCount:"{count} 改动",empty:"无 git 改动 / daemon 未提供",clean:"工作区干净,无改动",back:"返回",loading:"正在加载 diff…",noDiff:"该文件没有行级改动",list:"列表",tree:"树形",close:"关闭"},Q5={},eN={empty:"选择左侧文件预览",loading:"加载中…",lineCount:"{count} 行",copy:"复制",copied:"已复制",copyPath:"复制路径",openInEditor:"打开",reveal:"显示",download:"下载",close:"关闭",search:"搜索",prevMatch:"上一个匹配",nextMatch:"下一个匹配",htmlMode:"HTML 预览模式",markdownMode:"Markdown 预览模式",preview:"预览",source:"源码",imageFit:"图片缩放",fit:"适应",actual:"原始",pdfNoPreview:"无法内嵌预览此 PDF,可以下载后查看",imageNoPreview:"图片文件 · {mime} · {size} · 暂不预览",binaryNoPreview:"二进制文件 · {mime} · {size} 字节 · 暂不预览",unknownType:"未知类型",copyCode:"复制代码",errors:{emptyPath:"文件路径为空",unsupportedPath:"不支持预览 URL 或远程路径",outsideWorkspace:"只能预览当前 workspace 内的文件",isDirectory:"请选择具体文件,而不是目录",loadFailed:"无法读取这个文件"}},tN={searching:"搜索中…",noMatch:"无匹配"},nN={dismiss:"关闭",errorLabel:"错误",noteLabel:"提示",details:{cause:"底层原因",code:"错误码",contentType:"响应类型",details:"服务端详情",endpoint:"请求地址",errorName:"错误类型",message:"错误信息",operation:"操作",phase:"失败阶段",request:"请求",requestId:"Request ID",responsePreview:"响应预览",sessionId:"Session ID",status:"HTTP 状态",timeout:"超时设置"},daemonApiTitle:"Kimi daemon 返回错误",daemonNetworkMessage:"Web 没有拿到本地服务的响应。请确认 Kimi daemon 仍在运行,或刷新页面重试。",daemonNetworkTitle:"无法连接到 Kimi daemon",diagnostics:"诊断信息",hideDetails:"收起详情",operationFailedMessage:"刚才的操作没有完成,请稍后重试。",operationFailedTitle:"操作失败",sessionSnapshotMessage:"Web 没能加载当前会话内容。请确认 Kimi daemon 仍在运行,或刷新页面重试。",sessionSnapshotTitle:"无法加载当前会话内容",showDetails:"查看详情",copyDetails:"复制诊断信息",copied:"已复制",wsTitle:"实时连接出错",goal:{alreadyExists:"当前会话已有一个进行中的目标,请先取消它再创建新目标。",notFound:"没有找到可操作的目标,可能它已经结束或被取消。",statusInvalid:"当前目标状态不支持这个操作。",notResumable:"这个目标无法恢复(可能已取消或已完成)。",objectiveTooLong:"目标描述太长了,请精简后重试。"}},sN={help:{desc:"显示可用命令列表"},new:{desc:"创建新会话"},sessions:{desc:"浏览/切换会话"},clear:{desc:"清空并新建会话"},model:{desc:"切换模型"},provider:{desc:"管理提供商 (添加/删除/刷新)"},login:{desc:"在浏览器中登录 Kimi"},permission:{desc:"切换审批模式 (manual/auto/yolo)"},plan:{desc:"切换计划模式 开/关"},swarm:{desc:"切换 swarm 模式;/swarm <任务> 直接在 swarm 下执行"},goal:{desc:"创建/控制目标:/goal <目标>、/goal pause|resume|cancel"},btw:{desc:"侧边聊天:/btw <问题> 向 fork 的侧边会话提问"},yolo:{desc:"自动批准一切 (yolo 模式)"},auto:{desc:"自动批准安全的读写"},thinking:{desc:"设置思考强度"},compact:{desc:"压缩会话历史"},fork:{desc:"把当前会话 fork 出一个新会话"},undoNotImplemented:"daemon 尚未支持 /undo",status:{desc:"查看会话状态"},undo:{desc:"撤销上一条消息"}},oN={label:{read:"读取",bash:"运行",edit:"编辑",write:"写入",grep:"搜索",glob:"查找",ls:"列目录",web_fetch:"抓取",search:"搜索",todo:"计划",task:"任务"},chip:{lines:"{count} 行",results:"{count} 结果",edited:"已编辑",created:"已创建",todos:"{count} 项"}},iN={resizeHandleAria:"调整侧栏宽度",resizePreviewAria:"调整预览面板宽度",detailPanelAria:"详情面板"},rN={openSwitcher:"切换会话 / 工作区",openSettings:"会话设置",settingsTitle:"会话设置",sheetLabel:"面板",closeSheet:"关闭",tapToCycle:"点击切换",running:"运行中",idle:"空闲",sessionCount:"{n} 个会话",newSession:"新建会话",permManualSub:"每个工具都确认",permAutoSub:"自动批准编辑",permYoloSub:"全部自动批准",planModeSub:"Plan mode",swarmModeSub:"Swarm mode"},lN={label:"主题",modern:"探索",kimi:"原生",colorSchemeLabel:"外观",light:"浅色",dark:"深色",system:"跟随系统"},aN={title:"Welcome to Kimi Web",subtitle:"Pick a few preferences — you can change them anytime in Settings.",languageLabel:"Language",themeLabel:"Theme",modernDesc:"Bubbles, conversational, softer.",kimiDesc:"Native look: calm, flat.",start:"Get started",skip:"Skip",reopen:"Preferences / onboarding"},cN={title:"欢迎来使用 Kimi Web",subtitle:"来选择一些你的偏好 —— 之后也可以在设置里随时修改。",languageLabel:"语言",themeLabel:"主题",modernDesc:"气泡、对话感、更柔和。",kimiDesc:"原生风格:安静、扁平。",start:"开始使用",skip:"跳过",reopen:"偏好 / 引导"},uN={title:"Settings",tabs:{general:"General",agent:"Agent",advanced:"Advanced",experimental:"Experimental"},appearance:"Appearance",notifications:"Notifications",notifyOnComplete:"Notify when a turn completes",notifyDenied:"Blocked in browser settings",notifyBody:"Finished a turn",account:"Account",uiFontSize:"Font size",agentDefaults:"Agent defaults",saving:"Saving",defaultModel:"Default model",defaultModelHint:"New sessions prefer this model",noDefaultModel:"No default model",defaultPermission:"Default permission",defaultPermissionHint:"Only affects newly-created sessions",permission:{manual:"Manual",auto:"Auto",yolo:"YOLO"},defaultThinking:"Thinking by default",defaultThinkingHint:"Whether new sessions start with thinking enabled",defaultPlanMode:"Plan mode by default",defaultPlanModeHint:"Whether new sessions start in plan mode",mergeSkills:"Merge all available skills",mergeSkillsHint:"Show project, plugin, and user skills together",telemetry:"Telemetry",credentialReady:"Credential configured",credentialMissing:"Missing credential",configUnavailable:"The server did not return config yet. These settings are unavailable.",advanced:"Advanced",build:"Build",serverVersion:"Server version",exportLog:"Troubleshooting log",logHint:"Enable with ?debug=1 to capture",exportLogBtn:"Export log",beta:"Experimental",betaToc:"Proportional conversation outline",betaTocHint:" Larger bubbles, viewport indicator, and hover tooltip"},dN={title:"设置",tabs:{general:"通用",agent:"Agent",advanced:"高级",experimental:"实验性"},appearance:"外观",notifications:"通知",notifyOnComplete:"会话完成时通知",notifyDenied:"已在浏览器设置中被阻止",notifyBody:"已完成一轮",account:"账户",uiFontSize:"字体大小",agentDefaults:"Agent 默认值",saving:"保存中",defaultModel:"默认模型",defaultModelHint:"新会话会优先使用这个模型",noDefaultModel:"未设置默认模型",defaultPermission:"默认权限",defaultPermissionHint:"只影响之后新建的会话",permission:{manual:"手动",auto:"自动",yolo:"全自动"},defaultThinking:"默认开启思考",defaultThinkingHint:"新会话默认是否开启 thinking",defaultPlanMode:"默认计划模式",defaultPlanModeHint:"新会话默认进入 plan mode",mergeSkills:"合并所有可用 Skills",mergeSkillsHint:"让项目、插件和用户 Skills 一起出现在可用列表中",telemetry:"遥测",credentialReady:"凭据已配置",credentialMissing:"缺少凭据",configUnavailable:"当前服务端没有返回 config,设置项暂不可用。",advanced:"高级",build:"构建",serverVersion:"服务端版本",exportLog:"故障排查日志",logHint:"加 ?debug=1 开启采集",exportLogBtn:"导出日志",beta:"实验性",betaToc:"对话目录增强",betaTocHint:"更大的气泡、视口指示器和悬停提示"},fN={openInEditor:"Open in editor",openInEditorShort:"Open",chooseOpenApp:"Choose application",copyAll:"Copy all as Markdown",copyFinalSummary:"Copy final summary",copied:"Copied",copyPath:"Copy path",changed:"{n} changed",gitTooltip:"Open Files > Changed",detached:"detached",openPr:"Open pull request",options:"Options",copySessionId:"Copy Session ID",renameSession:"Rename",forkSession:"Fork session",archiveSession:"Archive",confirmArchive:"Confirm archive?"},hN={openInEditor:"在编辑器中打开",openInEditorShort:"打开",chooseOpenApp:"选择应用",copyAll:"复制全部对话为 Markdown",copyFinalSummary:"仅复制最终总结",copied:"已复制",copyPath:"复制路径",changed:"{n} 处改动",gitTooltip:"打开「文件 > 改动」",detached:"detached",openPr:"打开 Pull Request",options:"选项",copySessionId:"复制 Session ID",renameSession:"重命名",forkSession:"分叉会话",archiveSession:"归档",confirmArchive:"确认归档?"},pN={title:"Side chat",subtitle:"forked from this session",empty:"Ask a quick question on the side — it shares this session’s context.",placeholder:"Ask the side chat…",send:"Send"},mN={title:"侧边聊天",subtitle:"从当前会话 fork",empty:"在侧边随手问一句 —— 它共享当前会话的上下文。",placeholder:"问问侧边聊天…",send:"发送"},gN={en:{common:u5,app:d5,sidebar:f5,workspace:h5,conversation:p5,status:m5,composer:g5,login:v5,providers:y5,model:k5,newSession:b5,sessions:_5,approval:w5,question:S5,tasks:C5,thinking:x5,diff:T5,fileTree:M5,filePreview:A5,mention:E5,warnings:I5,commands:$5,tools:N5,layout:L5,mobile:O5,theme:P5,onboarding:aN,settings:uN,header:fN,sideChat:pN},zh:{common:R5,app:D5,sidebar:B5,workspace:F5,conversation:H5,status:W5,composer:U5,login:q5,providers:j5,model:z5,newSession:V5,sessions:K5,approval:G5,question:Y5,tasks:X5,thinking:Z5,diff:J5,fileTree:Q5,filePreview:eN,mention:tN,warnings:nN,commands:sN,tools:oN,layout:iN,mobile:rN,theme:lN,onboarding:cN,settings:dN,header:hN,sideChat:mN}},TC=[{code:"en",label:"English"},{code:"zh",label:"中文"}];function vN(){const e=_n(Et.locale);return e==="en"||e==="zh"?e:globalThis.navigator?.language?.toLowerCase().startsWith("zh")?"zh":"en"}const $n=U6({legacy:!1,locale:vN(),fallbackLocale:"en",messages:gN});function MC(e){$n.global.locale.value=e,In(Et.locale,e)}const sa=$n.global.t,yN={read:"tools.label.read",bash:"tools.label.bash",edit:"tools.label.edit",multi_edit:"tools.label.edit",write:"tools.label.write",grep:"tools.label.grep",glob:"tools.label.glob",ls:"tools.label.ls",web_fetch:"tools.label.web_fetch",search:"tools.label.search",todo:"tools.label.todo",task:"tools.label.task"},kN={multiedit:"multi_edit",multiedits:"multi_edit",shell:"bash",run:"bash",exec:"bash",ripgrep:"grep",rg:"grep",find:"glob",fetch:"web_fetch",webfetch:"web_fetch",url_fetch:"web_fetch",urlfetch:"web_fetch",list:"ls",listdir:"ls",list_dir:"ls",todowrite:"todo",todo_write:"todo",todoread:"todo",todolist:"todo",todo_list:"todo",agent:"task",subagent:"task",websearch:"search",web_search:"search"};function ou(e){const t=(e??"").trim().toLowerCase().replace(/[\s-]+/g,"_");return kN[t]??t}function Hk(e){const t=yN[ou(e)];return t?sa(t):e}const bN='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><rect x="2.5" y="1.5" width="9" height="13" rx="1"/><line x1="5" y1="5" x2="9" y2="5"/><line x1="5" y1="7.5" x2="11" y2="7.5"/><line x1="5" y1="10" x2="10" y2="10"/></svg>',_N='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><rect x="1.5" y="2.5" width="13" height="11" rx="1.5"/><polyline points="4,6 6.5,8 4,10"/><line x1="8" y1="10" x2="12" y2="10"/></svg>',Wk='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><path d="M10.5 2.5l3 3-8 8H2.5v-3l8-8z"/><line x1="8.5" y1="4.5" x2="11.5" y2="7.5"/></svg>',wN='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><path d="M3 12V4.5L8 2l5 2.5V12H3z"/><line x1="6" y1="7" x2="10" y2="7"/><line x1="8" y1="5" x2="8" y2="9"/></svg>',Uk='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><circle cx="6.5" cy="6.5" r="4"/><line x1="9.5" y1="9.5" x2="13.5" y2="13.5"/></svg>',SN='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><path d="M5 2.5C3.5 2.5 3.5 5 3.5 6.5S2.5 8 2.5 8s1 0 1 1.5S3.5 13.5 5 13.5"/><path d="M11 2.5c1.5 0 1.5 2.5 1.5 4S13.5 8 13.5 8s-1 0-1 1.5.5 4-1.5 4"/><line x1="8" y1="6" x2="8" y2="10"/><line x1="6.3" y1="6.8" x2="9.7" y2="9.2"/><line x1="9.7" y1="6.8" x2="6.3" y2="9.2"/></svg>',CN='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><path d="M1.5 4.5a1 1 0 0 1 1-1h3l1.2 1.4H13a1 1 0 0 1 1 1v6.1a1 1 0 0 1-1 1H2.5a1 1 0 0 1-1-1V4.5z"/></svg>',xN='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><circle cx="8" cy="8" r="6"/><path d="M8 2c-2 2-3 3.6-3 6s1 4 3 6"/><path d="M8 2c2 2 3 3.6 3 6s-1 4-3 6"/><line x1="2" y1="8" x2="14" y2="8"/></svg>',qk='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><polyline points="2,4.5 3.5,6 5.5,3"/><polyline points="2,11 3.5,12.5 5.5,9.5"/><line x1="8" y1="4.5" x2="14" y2="4.5"/><line x1="8" y1="11" x2="14" y2="11"/></svg>',TN='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><path d="M8.5 1L3 9h4l-1.5 6 5.5-8h-4l1.5-6z"/></svg>',MN="";function AN(e){switch(ou(e)){case"read":return bN;case"bash":return _N;case"edit":return Wk;case"multi_edit":return Wk;case"write":return wN;case"grep":return Uk;case"search":return Uk;case"glob":return SN;case"ls":return CN;case"web_fetch":return xN;case"todo":return qk;case"task":return qk;default:return(e??"").trim().toLowerCase().includes("skill")?TN:MN}}const AC=80;function EN(e,t=AC){const n=e.trim();return n.length>t?n.slice(0,t-1)+"…":n}function IN(e,t){const n=e.trim();return!!(n===""||n==="{}"||n==="[]"||n==="null"||t&&Object.keys(t).length===0)}function $N(e){const t=e.trim();if(!t.startsWith("{"))return null;try{const n=JSON.parse(t);return n&&typeof n=="object"&&!Array.isArray(n)?n:null}catch{return null}}function zt(e){return typeof e=="string"&&e.length>0?e:void 0}function qr(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function NN(e){try{const t=new URL(e),n=t.pathname.split("/").filter(Boolean)[0];return n?`${t.host}/${n}`:t.host}catch{return e.replace(/^https?:\/\//,"")}}function Zp(e){return zt(e.path)??zt(e.file_path)??zt(e.filePath)??zt(e.filename)}const LN=64;function jk(e,t,n=!1){const s=(o,i=AC)=>n?o.trim():EN(o,i);try{const o=$N(t);if(!n&&IN(t,o))return"";const i=()=>s(t.replace(/^·\s*/,""));if(!o)return i();switch(ou(e)){case"read":{const r=Zp(o);if(!r)return i();const l=qr(o.offset)??qr(o.line_start)??qr(o.start_line),a=qr(o.limit)??qr(o.length),c=qr(o.line_end)??qr(o.end_line)??(l!==void 0&&a!==void 0?l+a:void 0);return s(l!==void 0&&c!==void 0?`${r}:${l}-${c}`:l!==void 0?`${r}:${l}`:r)}case"write":{const r=Zp(o);return r?s(`${r} ${sa("tools.chip.created")}`):i()}case"edit":case"multi_edit":{const r=Zp(o);return r?s(r):i()}case"bash":{const r=zt(o.command)??zt(o.cmd)??zt(o.script);return r?s(r,LN):i()}case"grep":case"search":{const r=zt(o.pattern)??zt(o.query)??zt(o.regex),l=zt(o.path)??zt(o.glob)??zt(o.include);return r&&l?s(`${r} in ${l}`):r?s(r):i()}case"glob":{const r=zt(o.pattern)??zt(o.glob)??zt(o.query),l=zt(o.path)??zt(o.cwd);return r&&l?s(`${r} in ${l}`):r?s(r):zt(o.path)?s(zt(o.path)):i()}case"ls":{const r=zt(o.path)??zt(o.dir)??zt(o.directory)??zt(o.cwd);return r?s(r):i()}case"web_fetch":{const r=zt(o.url)??zt(o.uri);return r?s(NN(r)):i()}case"todo":case"task":{const r=zt(o.description)??zt(o.title)??zt(o.prompt)??zt(o.name)??zt(o.subagent_type);if(r)return s(r);const l=Array.isArray(o.todos)?o.todos:Array.isArray(o.items)?o.items:void 0;return l?s(sa("tools.chip.todos",{count:l.length})):i()}default:return i()}}catch{return t}}function ON(e){try{switch(ou(e.name)){case"bash":return e.timing?e.timing:"";case"read":{if(e.output&&e.output.length>0){const t=e.output.length;return sa("tools.chip.lines",{count:t})}return""}case"edit":case"multi_edit":case"write":{if(e.output){for(const n of e.output){const s=n.match(/\+(\d+).*[-−](\d+)/);if(s)return`+${s[1]} −${s[2]}`}const t=e.output.find(n=>/\d+/.test(n));if(t){const n=t.match(/\+(\d+)/),s=t.match(/[-−](\d+)/);if(n||s)return`${n?`+${n[1]}`:""} ${s?`−${s[1]}`:""}`.trim()}if(e.status!=="error")return sa("tools.chip.edited")}return""}case"grep":case"search":return e.output&&e.output.length>0?sa("tools.chip.results",{count:e.output.length}):"";default:return""}}catch{return""}}const PN=["title"],RN=["title"],DN=["src","alt"],BN=["src"],FN=["src"],HN={class:"car",viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},WN=["points"],UN=["innerHTML"],qN={class:"a"},jN=["title"],zN={class:"rt"},VN={key:0,class:"chip"},KN={key:1,class:"spin",role:"status","aria-label":"running"},GN={key:3,class:"tm"},YN={key:0,class:"bb"},XN={key:0,class:"bb-summary"},ZN={key:1,class:"bb-empty"},JN=Je({__name:"ToolCall",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"}},emits:["openMedia"],setup(e,{emit:t}){const n=e,s=t,o=H(()=>n.tool.status==="running"&&/^bash$/i.test(n.tool.name)),i=H(()=>!!n.tool.output&&n.tool.output.length>0),r=H(()=>i.value||o.value),l=se(n.tool.defaultExpanded===!0&&r.value);function a(){r.value&&(l.value=!l.value)}Ge(()=>[n.tool.defaultExpanded,n.tool.output?.length,n.tool.status,n.tool.name],()=>{n.tool.defaultExpanded===!0&&r.value&&(l.value=!0)});const c=()=>n.tool.status==="error"?"✕":"✓",u=()=>Hk(n.tool.name),d=()=>AN(n.tool.name),h=()=>jk(n.tool.name,n.tool.arg),p=()=>jk(n.tool.name,n.tool.arg,!0),f=()=>ON({name:n.tool.name,arg:n.tool.arg,output:n.tool.output,timing:n.tool.timing,status:n.tool.status}),g=()=>n.tool.status==="error",w=H(()=>n.tool.status==="ok"?n.tool.media:void 0);function S(_){return _.split(/[\\/]+/).pop()||_}function y(_){return _<1024?`${_} B`:_<1024*1024?`${(_/1024).toFixed(1)} KB`:`${(_/1024/1024).toFixed(1)} MB`}const k=H(()=>{const _=w.value;if(!_)return"";const I=[_.path?S(_.path):Hk(n.tool.name)];return _.mimeType&&I.push(_.mimeType),_.bytes!==void 0&&I.push(y(_.bytes)),_.dimensions&&I.push(_.dimensions),I.join(" · ")});function v(){const _=w.value;_?.kind==="image"&&s("openMedia",_)}return(_,I)=>w.value?(x(),E("div",{key:0,class:Ie(["media-tool",{mob:e.mobile}])},[m("div",{class:"media-title",title:w.value.path||k.value},L(k.value),9,PN),w.value.kind==="image"?(x(),E("button",{key:0,type:"button",class:"media-image-button",title:w.value.path||k.value,onClick:v},[m("img",{class:"media-image",src:w.value.url,alt:w.value.path?S(w.value.path):k.value,loading:"lazy"},null,8,DN)],8,RN)):w.value.kind==="video"?(x(),E("video",{key:1,class:"media-video",src:w.value.url,controls:"",preload:"metadata"},null,8,BN)):(x(),E("audio",{key:2,class:"media-audio",src:w.value.url,controls:""},null,8,FN))],2)):(x(),E("div",{key:1,class:Ie(["box",{open:l.value,err:g(),mob:e.mobile,stacked:e.stackPosition!=="single","stack-first":e.stackPosition==="first","stack-middle":e.stackPosition==="middle","stack-last":e.stackPosition==="last"}])},[m("div",{class:"bh",onClick:a},[(x(),E("svg",HN,[m("polyline",{points:l.value?"4,6 8,10 12,6":"6,4 10,8 6,12"},null,8,WN)])),d()?(x(),E("span",{key:0,class:"gl",innerHTML:d(),"aria-hidden":"true"},null,8,UN)):le("",!0),m("span",qN,L(u()),1),l.value?le("",!0):(x(),E("span",{key:1,class:"p",title:h()},L(h()),9,jN)),m("span",zN,[f()?(x(),E("span",VN,L(f()),1)):le("",!0),e.tool.status==="running"?(x(),E("span",KN)):(x(),E("span",{key:2,class:Ie(e.tool.status==="ok"?"ok":"er")},L(c()),3)),e.tool.timing&&e.tool.name!=="bash"?(x(),E("span",GN,L(e.tool.timing),1)):le("",!0)])]),l.value?(x(),E("div",YN,[p()?(x(),E("div",XN,L(p()),1)):le("",!0),i.value?le("",!0):(x(),E("div",ZN,"Waiting for output…")),(x(!0),E(Ne,null,Qe(e.tool.output??[],(A,b)=>(x(),E("div",{key:b},L(A),1))),128))])):le("",!0)],2))}}),Zu=wt(JN,[["__scopeId","data-v-7e55d5a6"]]);var QN=Object.create,Z1=Object.defineProperty,e8=Object.getOwnPropertyDescriptor,EC=Object.getOwnPropertyNames,t8=Object.getPrototypeOf,n8=Object.prototype.hasOwnProperty,IC=(e,t)=>function(){return t||(0,e[EC(e)[0]])((t={exports:{}}).exports,t),t.exports},$C=e=>{let t={};for(var n in e)Z1(t,n,{get:e[n],enumerable:!0});return t},s8=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=EC(t),i=0,r=o.length,l;i<r;i++)l=o[i],!n8.call(e,l)&&l!==n&&Z1(e,l,{get:(a=>t[a]).bind(null,l),enumerable:!(s=e8(t,l))||s.enumerable});return e},NC=(e,t,n)=>(n=e!=null?QN(t8(e)):{},s8(Z1(n,"default",{value:e,enumerable:!0}),e));function o8(e,t,n,s){const o=Number(e[t].meta.id+1).toString();let i="";return typeof s.docId=="string"&&(i=`-${s.docId}-`),i+o}function i8(e,t){let n=Number(e[t].meta.id+1).toString();return e[t].meta.subId>0&&(n+=`:${e[t].meta.subId}`),`[${n}]`}function r8(e,t,n,s,o){const i=o.rules.footnote_anchor_name(e,t,n,s,o),r=o.rules.footnote_caption(e,t,n,s,o);let l=i;return e[t].meta.subId>0&&(l+=`:${e[t].meta.subId}`),`<sup class="footnote-ref"><a href="#fn${i}" id="fnref${l}">${r}</a></sup>`}function l8(e,t,n){return(n.xhtmlOut?`<hr class="footnotes-sep" />
|
|
39
|
-
`:`<hr class="footnotes-sep">
|
|
40
|
-
`)+`<section class="footnotes">
|
|
41
|
-
<ol class="footnotes-list">
|
|
42
|
-
`}function a8(){return`</ol>
|
|
43
|
-
</section>
|
|
44
|
-
`}function c8(e,t,n,s,o){let i=o.rules.footnote_anchor_name(e,t,n,s,o);return e[t].meta.subId>0&&(i+=`:${e[t].meta.subId}`),`<li id="fn${i}" class="footnote-item">`}function u8(){return`</li>
|
|
45
|
-
`}function d8(e,t,n,s,o){let i=o.rules.footnote_anchor_name(e,t,n,s,o);return e[t].meta.subId>0&&(i+=`:${e[t].meta.subId}`),` <a href="#fnref${i}" class="footnote-backref">↩︎</a>`}function f8(e){const t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=r8,e.renderer.rules.footnote_block_open=l8,e.renderer.rules.footnote_block_close=a8,e.renderer.rules.footnote_open=c8,e.renderer.rules.footnote_close=u8,e.renderer.rules.footnote_anchor=d8,e.renderer.rules.footnote_caption=i8,e.renderer.rules.footnote_anchor_name=o8;function s(l,a,c,u){const d=l.bMarks[a]+l.tShift[a],h=l.eMarks[a];if(d+4>h||l.src.charCodeAt(d)!==91||l.src.charCodeAt(d+1)!==94)return!1;let p;for(p=d+2;p<h;p++){if(l.src.charCodeAt(p)===32)return!1;if(l.src.charCodeAt(p)===93)break}if(p===d+2||p+1>=h||l.src.charCodeAt(++p)!==58)return!1;if(u)return!0;p++,l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.refs||(l.env.footnotes.refs={});const f=l.src.slice(d+2,p-2);l.env.footnotes.refs[`:${f}`]=-1;const g=new l.Token("footnote_reference_open","",1);g.meta={label:f},g.level=l.level++,l.tokens.push(g);const w=l.bMarks[a],S=l.tShift[a],y=l.sCount[a],k=l.parentType,v=p,_=l.sCount[a]+p-(l.bMarks[a]+l.tShift[a]);let I=_;for(;p<h;){const b=l.src.charCodeAt(p);if(n(b))b===9?I+=4-I%4:I++;else break;p++}l.tShift[a]=p-v,l.sCount[a]=I-_,l.bMarks[a]=v,l.blkIndent+=4,l.parentType="footnote",l.sCount[a]<l.blkIndent&&(l.sCount[a]+=l.blkIndent),l.md.block.tokenize(l,a,c,!0),l.parentType=k,l.blkIndent-=4,l.tShift[a]=S,l.sCount[a]=y,l.bMarks[a]=w;const A=new l.Token("footnote_reference_close","",-1);return A.level=--l.level,l.tokens.push(A),!0}function o(l,a){const c=l.posMax,u=l.pos;if(u+2>=c||l.src.charCodeAt(u)!==94||l.src.charCodeAt(u+1)!==91)return!1;const d=u+2,h=t(l,u+1);if(h<0)return!1;if(!a){l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.list||(l.env.footnotes.list=[]);const p=l.env.footnotes.list.length,f=[];l.md.inline.parse(l.src.slice(d,h),l.md,l.env,f);const g=l.push("footnote_ref","",0);g.meta={id:p},l.env.footnotes.list[p]={content:l.src.slice(d,h),tokens:f}}return l.pos=h+1,l.posMax=c,!0}function i(l,a){const c=l.posMax,u=l.pos;if(u+3>c||!l.env.footnotes||!l.env.footnotes.refs||l.src.charCodeAt(u)!==91||l.src.charCodeAt(u+1)!==94)return!1;let d;for(d=u+2;d<c;d++){if(l.src.charCodeAt(d)===32||l.src.charCodeAt(d)===10)return!1;if(l.src.charCodeAt(d)===93)break}if(d===u+2||d>=c)return!1;d++;const h=l.src.slice(u+2,d-1);if(typeof l.env.footnotes.refs[`:${h}`]>"u")return!1;if(!a){l.env.footnotes.list||(l.env.footnotes.list=[]);let p;l.env.footnotes.refs[`:${h}`]<0?(p=l.env.footnotes.list.length,l.env.footnotes.list[p]={label:h,count:0},l.env.footnotes.refs[`:${h}`]=p):p=l.env.footnotes.refs[`:${h}`];const f=l.env.footnotes.list[p].count;l.env.footnotes.list[p].count++;const g=l.push("footnote_ref","",0);g.meta={id:p,subId:f,label:h}}return l.pos=d,l.posMax=c,!0}function r(l){let a,c,u,d=!1;const h={};if(!l.env.footnotes||(l.tokens=l.tokens.filter(function(f){return f.type==="footnote_reference_open"?(d=!0,c=[],u=f.meta.label,!1):f.type==="footnote_reference_close"?(d=!1,h[":"+u]=c,!1):(d&&c.push(f),!d)}),!l.env.footnotes.list))return;const p=l.env.footnotes.list;l.tokens.push(new l.Token("footnote_block_open","",1));for(let f=0,g=p.length;f<g;f++){const w=new l.Token("footnote_open","",1);if(w.meta={id:f,label:p[f].label},l.tokens.push(w),p[f].tokens){a=[];const k=new l.Token("paragraph_open","p",1);k.block=!0,a.push(k);const v=new l.Token("inline","",0);v.children=p[f].tokens,v.content=p[f].content,a.push(v);const _=new l.Token("paragraph_close","p",-1);_.block=!0,a.push(_)}else p[f].label&&(a=h[`:${p[f].label}`]);a&&(l.tokens=l.tokens.concat(a));let S;l.tokens[l.tokens.length-1].type==="paragraph_close"?S=l.tokens.pop():S=null;const y=p[f].count>0?p[f].count:1;for(let k=0;k<y;k++){const v=new l.Token("footnote_anchor","",0);v.meta={id:f,subId:k,label:p[f].label},l.tokens.push(v)}S&&l.tokens.push(S),l.tokens.push(new l.Token("footnote_close","",-1))}l.tokens.push(new l.Token("footnote_block_close","",-1))}e.block.ruler.before("reference","footnote_def",s,{alt:["paragraph","reference"]}),e.inline.ruler.after("image","footnote_inline",o),e.inline.ruler.after("footnote_inline","footnote_ref",i),e.core.ruler.after("inline","footnote_tail",r)}function h8(e){function t(s,o){const i=s.pos,r=s.src.charCodeAt(i);if(o||r!==43)return!1;const l=s.scanDelims(s.pos,!0);let a=l.length;const c=String.fromCharCode(r);if(a<2)return!1;if(a%2){const u=s.push("text","",0);u.content=c,a--}for(let u=0;u<a;u+=2){const d=s.push("text","",0);d.content=c+c,!(!l.can_open&&!l.can_close)&&s.delimiters.push({marker:r,length:0,jump:u/2,token:s.tokens.length-1,end:-1,open:l.can_open,close:l.can_close})}return s.pos+=l.length,!0}function n(s,o){let i;const r=[],l=o.length;for(let a=0;a<l;a++){const c=o[a];if(c.marker!==43||c.end===-1)continue;const u=o[c.end];i=s.tokens[c.token],i.type="ins_open",i.tag="ins",i.nesting=1,i.markup="++",i.content="",i=s.tokens[u.token],i.type="ins_close",i.tag="ins",i.nesting=-1,i.markup="++",i.content="",s.tokens[u.token-1].type==="text"&&s.tokens[u.token-1].content==="+"&&r.push(u.token-1)}for(;r.length;){const a=r.pop();let c=a+1;for(;c<s.tokens.length&&s.tokens[c].type==="ins_close";)c++;c--,a!==c&&(i=s.tokens[c],s.tokens[c]=s.tokens[a],s.tokens[a]=i)}}e.inline.ruler.before("emphasis","ins",t),e.inline.ruler2.before("emphasis","ins",function(s){const o=s.tokens_meta,i=(s.tokens_meta||[]).length;n(s,s.delimiters);for(let r=0;r<i;r++)o[r]&&o[r].delimiters&&n(s,o[r].delimiters)})}function p8(e){function t(s,o){const i=s.pos,r=s.src.charCodeAt(i);if(o||r!==61)return!1;const l=s.scanDelims(s.pos,!0);let a=l.length;const c=String.fromCharCode(r);if(a<2)return!1;if(a%2){const u=s.push("text","",0);u.content=c,a--}for(let u=0;u<a;u+=2){const d=s.push("text","",0);d.content=c+c,!(!l.can_open&&!l.can_close)&&s.delimiters.push({marker:r,length:0,jump:u/2,token:s.tokens.length-1,end:-1,open:l.can_open,close:l.can_close})}return s.pos+=l.length,!0}function n(s,o){const i=[],r=o.length;for(let l=0;l<r;l++){const a=o[l];if(a.marker!==61||a.end===-1)continue;const c=o[a.end],u=s.tokens[a.token];u.type="mark_open",u.tag="mark",u.nesting=1,u.markup="==",u.content="";const d=s.tokens[c.token];d.type="mark_close",d.tag="mark",d.nesting=-1,d.markup="==",d.content="",s.tokens[c.token-1].type==="text"&&s.tokens[c.token-1].content==="="&&i.push(c.token-1)}for(;i.length;){const l=i.pop();let a=l+1;for(;a<s.tokens.length&&s.tokens[a].type==="mark_close";)a++;if(a--,l!==a){const c=s.tokens[a];s.tokens[a]=s.tokens[l],s.tokens[l]=c}}}e.inline.ruler.before("emphasis","mark",t),e.inline.ruler2.before("emphasis","mark",function(s){let o;const i=s.tokens_meta,r=(s.tokens_meta||[]).length;for(n(s,s.delimiters),o=0;o<r;o++)i[o]&&i[o].delimiters&&n(s,i[o].delimiters)})}const m8=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function g8(e,t){const n=e.posMax,s=e.pos;if(e.src.charCodeAt(s)!==126||t||s+2>=n)return!1;e.pos=s+1;let o=!1;for(;e.pos<n;){if(e.src.charCodeAt(e.pos)===126){o=!0;break}e.md.inline.skipToken(e)}if(!o||s+1===e.pos)return e.pos=s,!1;const i=e.src.slice(s+1,e.pos);if(i.match(/(^|[^\\])(\\\\)*\s/))return e.pos=s,!1;e.posMax=e.pos,e.pos=s+1;const r=e.push("sub_open","sub",1);r.markup="~";const l=e.push("text","",0);l.content=i.replace(m8,"$1");const a=e.push("sub_close","sub",-1);return a.markup="~",e.pos=e.posMax+1,e.posMax=n,!0}function v8(e){e.inline.ruler.after("emphasis","sub",g8)}const y8=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function k8(e,t){const n=e.posMax,s=e.pos;if(e.src.charCodeAt(s)!==94||t||s+2>=n)return!1;e.pos=s+1;let o=!1;for(;e.pos<n;){if(e.src.charCodeAt(e.pos)===94){o=!0;break}e.md.inline.skipToken(e)}if(!o||s+1===e.pos)return e.pos=s,!1;const i=e.src.slice(s+1,e.pos);if(i.match(/(^|[^\\])(\\\\)*\s/))return e.pos=s,!1;e.posMax=e.pos,e.pos=s+1;const r=e.push("sup_open","sup",1);r.markup="^";const l=e.push("text","",0);l.content=i.replace(y8,"$1");const a=e.push("sup_close","sup",-1);return a.markup="^",e.pos=e.posMax+1,e.posMax=n,!0}function b8(e){e.inline.ruler.after("emphasis","sup",k8)}var _8=IC({"../../node_modules/.pnpm/markdown-it-task-checkbox@1.0.6/node_modules/markdown-it-task-checkbox/index.js":((e,t)=>{t.exports=function(g,w){w=Object.assign({},{disabled:!0,divWrap:!1,divClass:"checkbox",idPrefix:"cbx_",ulClass:"task-list",liClass:"task-list-item"},w),g.core.ruler.after("inline","github-task-lists",function(S){for(var y=S.tokens,k=0,v=2;v<y.length;v++)o(y,v)&&(i(y[v],k,w,S.Token),k+=1,n(y[v-2],"class",w.liClass),n(y[s(y,v-2)],"class",w.ulClass))})};function n(g,w,S){var y=g.attrIndex(w),k=[w,S];y<0?g.attrPush(k):g.attrs[y]=k}function s(g,w){for(var S=g[w].level-1,y=w-1;y>=0;y--)if(g[y].level===S)return y;return-1}function o(g,w){return d(g[w])&&h(g[w-1])&&p(g[w-2])&&f(g[w])}function i(g,w,S,y){var k=S.idPrefix+w;g.children[0].content=g.children[0].content.slice(3),g.children.unshift(l(k,y)),g.children.push(a(y)),g.children.unshift(r(g,k,S,y)),S.divWrap&&(g.children.unshift(c(S,y)),g.children.push(u(y)))}function r(g,w,S,y){var k=new y("checkbox_input","input",0);return k.attrs=[["type","checkbox"],["id",w]],/^\[[xX]\][ \u00A0]/.test(g.content)===!0&&k.attrs.push(["checked","true"]),S.disabled===!0&&k.attrs.push(["disabled","true"]),k}function l(g,w){var S=new w("label_open","label",1);return S.attrs=[["for",g]],S}function a(g){return new g("label_close","label",-1)}function c(g,w){var S=new w("checkbox_open","div",0);return S.attrs=[["class",g.divClass]],S}function u(g){return new g("checkbox_close","div",-1)}function d(g){return g.type==="inline"}function h(g){return g.type==="paragraph_open"}function p(g){return g.type==="list_item_open"}function f(g){return/^\[[xX \u00A0]\][ \u00A0]/.test(g.content)}})}),w8=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),S8=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0))),Jp;const C8=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),x8=(Jp=String.fromCodePoint)!==null&&Jp!==void 0?Jp:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function T8(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=C8.get(e))!==null&&t!==void 0?t:e}var Qn;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(Qn||(Qn={}));const M8=32;var ur;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(ur||(ur={}));function _g(e){return e>=Qn.ZERO&&e<=Qn.NINE}function A8(e){return e>=Qn.UPPER_A&&e<=Qn.UPPER_F||e>=Qn.LOWER_A&&e<=Qn.LOWER_F}function E8(e){return e>=Qn.UPPER_A&&e<=Qn.UPPER_Z||e>=Qn.LOWER_A&&e<=Qn.LOWER_Z||_g(e)}function I8(e){return e===Qn.EQUALS||E8(e)}var Jn;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(Jn||(Jn={}));var lr;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(lr||(lr={}));var $8=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=Jn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=lr.Strict}startEntity(e){this.decodeMode=e,this.state=Jn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case Jn.EntityStart:return e.charCodeAt(t)===Qn.NUM?(this.state=Jn.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=Jn.NamedEntity,this.stateNamedEntity(e,t));case Jn.NumericStart:return this.stateNumericStart(e,t);case Jn.NumericDecimal:return this.stateNumericDecimal(e,t);case Jn.NumericHex:return this.stateNumericHex(e,t);case Jn.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|M8)===Qn.LOWER_X?(this.state=Jn.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=Jn.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,s){if(t!==n){const o=n-t;this.result=this.result*Math.pow(s,o)+parseInt(e.substr(t,o),s),this.consumed+=o}}stateNumericHex(e,t){const n=t;for(;t<e.length;){const s=e.charCodeAt(t);if(_g(s)||A8(s))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(s,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){const n=t;for(;t<e.length;){const s=e.charCodeAt(t);if(_g(s))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(s,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)===null||n===void 0||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===Qn.SEMI)this.consumed+=1;else if(this.decodeMode===lr.Strict)return 0;return this.emitCodePoint(T8(this.result),this.consumed),this.errors&&(e!==Qn.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){const{decodeTree:n}=this;let s=n[this.treeIndex],o=(s&ur.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){const i=e.charCodeAt(t);if(this.treeIndex=N8(n,s,this.treeIndex+Math.max(1,o),i),this.treeIndex<0)return this.result===0||this.decodeMode===lr.Attribute&&(o===0||I8(i))?0:this.emitNotTerminatedNamedEntity();if(s=n[this.treeIndex],o=(s&ur.VALUE_LENGTH)>>14,o!==0){if(i===Qn.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==lr.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:t,decodeTree:n}=this,s=(n[t]&ur.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,s,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){const{decodeTree:s}=this;return this.emitCodePoint(t===1?s[e]&~ur.VALUE_LENGTH:s[e+1],n),t===3&&this.emitCodePoint(s[e+2],n),n}end(){var e;switch(this.state){case Jn.NamedEntity:return this.result!==0&&(this.decodeMode!==lr.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Jn.NumericDecimal:return this.emitNumericEntity(0,2);case Jn.NumericHex:return this.emitNumericEntity(0,3);case Jn.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Jn.EntityStart:return 0}}};function LC(e){let t="";const n=new $8(e,s=>t+=x8(s));return function(o,i){let r=0,l=0;for(;(l=o.indexOf("&",l))>=0;){t+=o.slice(r,l),n.startEntity(i);const c=n.write(o,l+1);if(c<0){r=l+n.end();break}r=l+c,l=c===0?r+1:r}const a=t+o.slice(r);return t="",a}}function N8(e,t,n,s){const o=(t&ur.BRANCH_LENGTH)>>7,i=t&ur.JUMP_TABLE;if(o===0)return i!==0&&s===i?n:-1;if(i){const a=s-i;return a<0||a>=o?-1:e[n+a]-1}let r=n,l=r+o-1;for(;r<=l;){const a=r+l>>>1,c=e[a];if(c<s)r=a+1;else if(c>s)l=a-1;else return e[a+o]}return-1}const L8=LC(w8);LC(S8);function J1(e,t=lr.Legacy){return L8(e,t)}var O8=NC(_8());const zk={};function P8(e){let t=zk[e];if(t)return t;t=zk[e]=[];for(let n=0;n<128;n++){const s=String.fromCharCode(n);t.push(s)}for(let n=0;n<e.length;n++){const s=e.charCodeAt(n);t[s]="%"+("0"+s.toString(16).toUpperCase()).slice(-2)}return t}function ah(e,t){typeof t!="string"&&(t=ah.defaultChars);const n=P8(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(s){let o="";for(let i=0,r=s.length;i<r;i+=3){const l=parseInt(s.slice(i+1,i+3),16);if(l<128){o+=n[l];continue}if((l&224)===192&&i+3<r){const a=parseInt(s.slice(i+4,i+6),16);if((a&192)===128){const c=l<<6&1984|a&63;c<128?o+="��":o+=String.fromCharCode(c),i+=3;continue}}if((l&240)===224&&i+6<r){const a=parseInt(s.slice(i+4,i+6),16),c=parseInt(s.slice(i+7,i+9),16);if((a&192)===128&&(c&192)===128){const u=l<<12&61440|a<<6&4032|c&63;u<2048||u>=55296&&u<=57343?o+="���":o+=String.fromCharCode(u),i+=6;continue}}if((l&248)===240&&i+9<r){const a=parseInt(s.slice(i+4,i+6),16),c=parseInt(s.slice(i+7,i+9),16),u=parseInt(s.slice(i+10,i+12),16);if((a&192)===128&&(c&192)===128&&(u&192)===128){let d=l<<18&1835008|a<<12&258048|c<<6&4032|u&63;d<65536||d>1114111?o+="����":(d-=65536,o+=String.fromCharCode(55296+(d>>10),56320+(d&1023))),i+=9;continue}}o+="�"}return o})}ah.defaultChars=";/?:@&=+$,#";ah.componentChars="";var wg=ah;const Vk={};function R8(e){let t=Vk[e];if(t)return t;t=Vk[e]=[];for(let n=0;n<128;n++){const s=String.fromCharCode(n);/^[0-9a-z]$/i.test(s)?t.push(s):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function ch(e,t,n){typeof t!="string"&&(n=t,t=ch.defaultChars),typeof n>"u"&&(n=!0);const s=R8(t);let o="";for(let i=0,r=e.length;i<r;i++){const l=e.charCodeAt(i);if(n&&l===37&&i+2<r&&/^[0-9a-f]{2}$/i.test(e.slice(i+1,i+3))){o+=e.slice(i,i+3),i+=2;continue}if(l<128){o+=s[l];continue}if(l>=55296&&l<=57343){if(l>=55296&&l<=56319&&i+1<r){const a=e.charCodeAt(i+1);if(a>=56320&&a<=57343){o+=encodeURIComponent(e[i]+e[i+1]),i++;continue}}o+="%EF%BF%BD";continue}o+=encodeURIComponent(e[i])}return o}ch.defaultChars=";/?:@&=+$,-_.!~*'()#";ch.componentChars="-_.!~*'()";var OC=ch;function Q1(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function cf(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const D8=/^([a-z0-9.+-]+:)/i,B8=/:[0-9]*$/,F8=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,H8=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
|
|
46
|
-
`," "]),W8=["'"].concat(H8),Kk=["%","/","?",";","#"].concat(W8),Gk=["/","?","#"],U8=255,Yk=/^[+a-z0-9A-Z_-]{0,63}$/,q8=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Xk={javascript:!0,"javascript:":!0},Zk={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function j8(e,t){if(e&&e instanceof cf)return e;const n=new cf;return n.parse(e,t),n}cf.prototype.parse=function(e,t){let n,s,o,i=e;if(i=i.trim(),!t&&e.split("#").length===1){const c=F8.exec(i);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}let r=D8.exec(i);if(r&&(r=r[0],n=r.toLowerCase(),this.protocol=r,i=i.substr(r.length)),(t||r||i.match(/^\/\/[^@\/]+@[^@\/]+/))&&(o=i.substr(0,2)==="//",o&&!(r&&Xk[r])&&(i=i.substr(2),this.slashes=!0)),!Xk[r]&&(o||r&&!Zk[r])){let c=-1;for(let f=0;f<Gk.length;f++)s=i.indexOf(Gk[f]),s!==-1&&(c===-1||s<c)&&(c=s);let u,d;c===-1?d=i.lastIndexOf("@"):d=i.lastIndexOf("@",c),d!==-1&&(u=i.slice(0,d),i=i.slice(d+1),this.auth=u),c=-1;for(let f=0;f<Kk.length;f++)s=i.indexOf(Kk[f]),s!==-1&&(c===-1||s<c)&&(c=s);c===-1&&(c=i.length),i[c-1]===":"&&c--;const h=i.slice(0,c);i=i.slice(c),this.parseHost(h),this.hostname=this.hostname||"";const p=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!p){const f=this.hostname.split(/\./);for(let g=0,w=f.length;g<w;g++){const S=f[g];if(S&&!S.match(Yk)){let y="";for(let k=0,v=S.length;k<v;k++)S.charCodeAt(k)>127?y+="x":y+=S[k];if(!y.match(Yk)){const k=f.slice(0,g),v=f.slice(g+1),_=S.match(q8);_&&(k.push(_[1]),v.unshift(_[2])),v.length&&(i=v.join(".")+i),this.hostname=k.join(".");break}}}}this.hostname.length>U8&&(this.hostname=""),p&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const l=i.indexOf("#");l!==-1&&(this.hash=i.substr(l),i=i.slice(0,l));const a=i.indexOf("?");return a!==-1&&(this.search=i.substr(a),i=i.slice(0,a)),i&&(this.pathname=i),Zk[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};cf.prototype.parseHost=function(e){let t=B8.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var ev=j8,PC=$C({decode:()=>wg,encode:()=>OC,format:()=>Q1,parse:()=>ev}),RC=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,DC=/[\0-\x1F\x7F-\x9F]/,z8=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,BC=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,V8=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,FC=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,K8=$C({Any:()=>RC,Cc:()=>DC,Cf:()=>z8,P:()=>BC,S:()=>V8,Z:()=>FC}),G8=Object.defineProperty,HC=e=>{let t={};for(var n in e)G8(t,n,{get:e[n],enumerable:!0});return t},Y8=HC({arrayReplaceAt:()=>nL,assign:()=>eL,countLines:()=>xn,escapeHtml:()=>dL,escapeRE:()=>hL,fromCodePoint:()=>jc,has:()=>Q8,isMdAsciiPunct:()=>ff,isPunctChar:()=>df,isPunctCode:()=>Sg,isSpace:()=>tL,isString:()=>Z8,isValidEntityCode:()=>dh,isWhiteSpace:()=>qc,lib:()=>pL,mdurl:()=>PC,normalizeReference:()=>uh,ucmicro:()=>uf,unescapeAll:()=>zc,unescapeMd:()=>rL});const uf=K8;function X8(e){return Object.prototype.toString.call(e)}function Z8(e){return X8(e)==="[object String]"}const J8=Object.prototype.hasOwnProperty;function Q8(e,t){return J8.call(e,t)}function eL(e,...t){return t.forEach(n=>{if(n){if(typeof n!="object")throw new TypeError(`${String(n)}must be object`);Object.keys(n).forEach(s=>{e[s]=n[s]})}}),e}function tL(e){return e===9||e===32}function qc(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function df(e){return uf.P.test(e)||uf.S.test(e)}const Jk=new Map;function Sg(e){if(ff(e))return!0;const t=Jk.get(e);if(t!==void 0)return t;const n=df(String.fromCharCode(e));return Jk.set(e,n),n}function ff(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function uh(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function nL(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function dh(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function jc(e){if(e>65535){e-=65536;const t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}const WC=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,sL=new RegExp(`${WC.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),oL=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function iL(e,t){if(t.charCodeAt(0)===35&&oL.test(t)){const s=t[1].toLowerCase()==="x"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return dh(s)?jc(s):e}const n=J1(e);return n!==e?n:e}function rL(e){return e.includes("\\")?e.replace(WC,"$1"):e}function zc(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(sL,(t,n,s)=>n||iL(t,s))}const lL=/[&<>"]/,aL=/[&<>"]/g,cL={"&":"&","<":"<",">":">",'"':"""};function uL(e){return cL[e]}function dL(e){return lL.test(e)?e.replace(aL,uL):e}const fL=/[.?*+^$[\]\\(){}|-]/g;function hL(e){return e.replace(fL,"\\$&")}const pL={mdurl:PC,ucmicro:uf};function xn(e){if(e.length===0)return 0;let t=0,n=-1;for(;(n=e.indexOf(`
|
|
47
|
-
`,n+1))!==-1;)t++;return t}const mL=/(?:^|\n)[ \t]{0,3}\[\^[^\]\n]+\]:/m,gL=/(?:^|\n)[ \t]{0,3}\*\[[^\]\n]+\]:/m,vL=/(?:^|\n)[ \t]{0,3}\[(?!\^)(?:\\[\s\S]|[^\]\\[])+\][ \t]*:/m,tv=["references","footnotes","abbreviations","abbr","abbrs"],nv=Symbol.for("markdown-it-ts.global-state"),sv=Object.prototype.hasOwnProperty;function Qk(e){return e==="reference-definition"||e==="footnote-definition"||e==="abbreviation-definition"}function Wo(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function pr(e){if(Array.isArray(e))return e.map(t=>pr(t));if(Wo(e)){const t={};for(const n of Object.keys(e))t[n]=pr(e[n]);return t}return e}function hf(e){return Array.isArray(e)?e.map((t,n)=>String(n)):Wo(e)?Object.keys(e):[]}function Cg(e,t){if(Array.isArray(e)||Array.isArray(t)){if(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Cg(e[n],t[n]))return!1;return!0}if(Wo(e)||Wo(t)){if(!Wo(e)||!Wo(t))return!1;const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(const o of n)if(!sv.call(t,o)||!Cg(e[o],t[o]))return!1;return!0}return Object.is(e,t)}function UC(e,t){if(Array.isArray(e))return e[Number(t)];if(Wo(e))return e[t]}function yL(e,t){if(Array.isArray(e)&&Array.isArray(t)){e.length=t.length;for(let n=0;n<t.length;n++)e[n]=pr(t[n]);return e}if(Wo(e)&&Wo(t)){for(const n of Object.keys(e))sv.call(t,n)||delete e[n];for(const n of Object.keys(t))e[n]=pr(t[n]);return e}return pr(t)}function kL(e,t,n){const s=n.ownedKeys??[],o=e[t];if(Wo(o)||Array.isArray(o)){const i=new Set(hf(n.value));for(const r of s)n.existed&&i.has(r)?o[r]=pr(UC(n.value,r)):delete o[r];!n.existed&&hf(o).length===0&&delete e[t];return}n.existed?e[t]=pr(n.value):delete e[t]}function ov(e){const t=e[nv];return Qk(t)?{reason:t,snapshot:{}}:t&&typeof t=="object"&&Qk(t.reason)&&t.snapshot&&typeof t.snapshot=="object"?t:null}function bL(e,t){Object.defineProperty(e,nv,{value:t,enumerable:!1,configurable:!0,writable:!0})}function fs(e){return e?mL.test(e)?"footnote-definition":gL.test(e)?"abbreviation-definition":vL.test(e)?"reference-definition":null:null}function iu(e){return ov(e)?.reason??null}function oa(e,t,n){if(iu(e)&&Ri(e),!t)return n();iv(e,t);try{const s=n();return rv(e),s}catch(s){throw Ri(e),s}}function iv(e,t){try{Ri(e);const n={};for(const s of tv)n[s]=sv.call(e,s)?{existed:!0,value:pr(e[s])}:{existed:!1};bL(e,{reason:t,snapshot:n})}catch{}}function rv(e){const t=ov(e);if(t)for(const n of tv){const s=t.snapshot[n];if(!s)continue;s.ownedKeys=[];const o=e[n];if(!Wo(o)&&!Array.isArray(o))continue;const i=new Set(hf(s.existed?s.value:void 0));s.ownedKeys=hf(o).filter(r=>i.has(r)?!Cg(o[r],UC(s.value,r)):!0)}}function Ri(e){const t=ov(e);if(t){for(const n of tv){const s=t.snapshot[n];if(!s){delete e[n];continue}if(s.ownedKeys){kL(e,n,s);continue}s.existed?e[n]=yL(e[n],s.value):delete e[n]}delete e[nv]}}const xg=Symbol.for("markdown-it-ts.diagnostics");function fh(e,t){if(e)try{const n=e[xg];if(n&&typeof n=="object")return n;if(!t)return;const s={};return Object.defineProperty(e,xg,{value:s,enumerable:!1,configurable:!0,writable:!0}),s}catch{return}}function _i(e){return fh(e,!1)}function _L(e){if(e)try{delete e[xg]}catch{}}function Zs(e){_L(e)}function os(e,t){const n=fh(e,!0);n&&(n.strategy=t)}function Qp(e,t){const n=fh(e,!0);n&&(n.chunk=t)}function qC(e,t){const n=fh(e,!0);n&&(n.unbounded=t)}function wL(e){const t={};e=e||{},t.src_Any=RC.source,t.src_Cc=DC.source,t.src_Z=FC.source,t.src_P=BC.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");const n="[><|]";return t.src_pseudo_letter="(?:(?!"+n+"|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|"+n+"|"+t.src_ZPCc+")(?!"+(e["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+`|[><|]|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]|$)|"+(e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+t.src_ZCc+"|$)|;(?!"+t.src_ZCc+"|$)|\\!+(?!"+t.src_ZCc+"|[!]|$)|\\?(?!"+t.src_ZCc+"|[?]|$))+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy="(^|"+n+'|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}function Tg(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function hh(e){return Object.prototype.toString.call(e)}function SL(e){return hh(e)==="[object String]"}function CL(e){return hh(e)==="[object Object]"}function xL(e){return hh(e)==="[object RegExp]"}function eb(e){return hh(e)==="[object Function]"}function TL(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const jC={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function ML(e){return Object.keys(e||{}).reduce(function(t,n){return t||jC.hasOwnProperty(n)},!1)}const AL={"http:":{validate:function(e,t,n){const s=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(s)?s.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){const s=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(s)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:s.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const s=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(s)?s.match(n.re.mailto)[0].length:0}}},EL="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",IL="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function $L(e){e.__index__=-1,e.__text_cache__=""}function NL(e){return function(t,n){const s=t.slice(n);return e.test(s)?s.match(e)[0].length:0}}function tb(){return function(e,t){t.normalize(e)}}function pf(e){const t=e.re=wL(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(EL),n.push(t.src_xn),t.src_tlds=n.join("|");function s(l){return l.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(s(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(s(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(s(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(s(t.tpl_host_fuzzy_test),"i");const o=[];e.__compiled__={};function i(l,a){throw new Error('(LinkifyIt) Invalid schema "'+l+'": '+a)}Object.keys(e.__schemas__).forEach(function(l){const a=e.__schemas__[l];if(a===null)return;const c={validate:null,link:null};if(e.__compiled__[l]=c,CL(a)){xL(a.validate)?c.validate=NL(a.validate):eb(a.validate)?c.validate=a.validate:i(l,a),eb(a.normalize)?c.normalize=a.normalize:a.normalize?i(l,a):c.normalize=tb();return}if(SL(a)){o.push(l);return}i(l,a)}),o.forEach(function(l){e.__compiled__[e.__schemas__[l]]&&(e.__compiled__[l].validate=e.__compiled__[e.__schemas__[l]].validate,e.__compiled__[l].normalize=e.__compiled__[e.__schemas__[l]].normalize)}),e.__compiled__[""]={validate:null,normalize:tb()};const r=Object.keys(e.__compiled__).filter(function(l){return l.length>0&&e.__compiled__[l]}).map(TL).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+r+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+r+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),$L(e)}function LL(e,t){const n=e.__index__,s=e.__last_index__,o=e.__text_cache__.slice(n,s);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=s+t,this.raw=o,this.text=o,this.url=o}function Mg(e,t){const n=new LL(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function lo(e,t){if(!(this instanceof lo))return new lo(e,t);t||ML(e)&&(t=e,e={}),this.__opts__=Tg({},jC,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=Tg({},AL,e),this.__compiled__={},this.__tlds__=IL,this.__tlds_replaced__=!1,this.re={},pf(this)}lo.prototype.add=function(t,n){return this.__schemas__[t]=n,pf(this),this};lo.prototype.set=function(t){return this.__opts__=Tg(this.__opts__,t),this};lo.prototype.test=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return!1;let n,s,o,i,r,l,a,c,u;if(this.re.schema_test.test(t)){for(a=this.re.schema_search,a.lastIndex=0;(n=a.exec(t))!==null;)if(i=this.testSchemaAt(t,n[2],a.lastIndex),i){this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+i;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(c=t.search(this.re.host_fuzzy_test),c>=0&&(this.__index__<0||c<this.__index__)&&(s=t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(r=s.index+s[1].length,(this.__index__<0||r<this.__index__)&&(this.__schema__="",this.__index__=r,this.__last_index__=s.index+s[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(u=t.indexOf("@"),u>=0&&(o=t.match(this.re.email_fuzzy))!==null&&(r=o.index+o[1].length,l=o.index+o[0].length,(this.__index__<0||r<this.__index__||r===this.__index__&&l>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=r,this.__last_index__=l))),this.__index__>=0};lo.prototype.pretest=function(t){return this.re.pretest.test(t)};lo.prototype.testSchemaAt=function(t,n,s){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,s,this):0};lo.prototype.match=function(t){const n=[];let s=0;this.__index__>=0&&this.__text_cache__===t&&(n.push(Mg(this,s)),s=this.__last_index__);let o=s?t.slice(s):t;for(;this.test(o);)n.push(Mg(this,s)),o=o.slice(this.__last_index__),s+=this.__last_index__;return n.length?n:null};lo.prototype.matchAtStart=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return null;const n=this.re.schema_at_start.exec(t);if(!n)return null;const s=this.testSchemaAt(t,n[2],n[0].length);return s?(this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+s,Mg(this,0)):null};lo.prototype.tlds=function(t,n){return t=Array.isArray(t)?t:[t],n?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(s,o,i){return s!==i[o-1]}).reverse(),pf(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,pf(this),this)};lo.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};lo.prototype.onCompile=function(){};var zC=lo,OL=IC({"../../node_modules/.pnpm/punycode.js@2.3.1/node_modules/punycode.js/punycode.js":((e,t)=>{const d=/^xn--/,h=/[^\0-\x7F]/,p=/[\x2E\u3002\uFF0E\uFF61]/g,f={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=35,w=Math.floor,S=String.fromCharCode;function y(R){throw new RangeError(f[R])}function k(R,F){const V=[];let K=R.length;for(;K--;)V[K]=F(R[K]);return V}function v(R,F){const V=R.split("@");let K="";V.length>1&&(K=V[0]+"@",R=V[1]),R=R.replace(p,".");const Z=k(R.split("."),F).join(".");return K+Z}function _(R){const F=[];let V=0;const K=R.length;for(;V<K;){const Z=R.charCodeAt(V++);if(Z>=55296&&Z<=56319&&V<K){const G=R.charCodeAt(V++);(G&64512)==56320?F.push(((Z&1023)<<10)+(G&1023)+65536):(F.push(Z),V--)}else F.push(Z)}return F}const I=R=>String.fromCodePoint(...R),A=function(R){return R>=48&&R<58?26+(R-48):R>=65&&R<91?R-65:R>=97&&R<123?R-97:36},b=function(R,F){return R+22+75*(R<26)-((F!=0)<<5)},M=function(R,F,V){let K=0;for(R=V?w(R/700):R>>1,R+=w(R/F);R>g*26>>1;K+=36)R=w(R/g);return w(K+(g+1)*R/(R+38))},N=function(R){const F=[],V=R.length;let K=0,Z=128,G=72,X=R.lastIndexOf("-");X<0&&(X=0);for(let pe=0;pe<X;++pe)R.charCodeAt(pe)>=128&&y("not-basic"),F.push(R.charCodeAt(pe));for(let pe=X>0?X+1:0;pe<V;){const oe=K;for(let _e=1,de=36;;de+=36){pe>=V&&y("invalid-input");const be=A(R.charCodeAt(pe++));be>=36&&y("invalid-input"),be>w((2147483647-K)/_e)&&y("overflow"),K+=be*_e;const xe=de<=G?1:de>=G+26?26:de-G;if(be<xe)break;const Le=36-xe;_e>w(2147483647/Le)&&y("overflow"),_e*=Le}const ye=F.length+1;G=M(K-oe,ye,oe==0),w(K/ye)>2147483647-Z&&y("overflow"),Z+=w(K/ye),K%=ye,F.splice(K++,0,Z)}return String.fromCodePoint(...F)},D=function(R){const F=[];R=_(R);const V=R.length;let K=128,Z=0,G=72;for(const oe of R)oe<128&&F.push(S(oe));const X=F.length;let pe=X;for(X&&F.push("-");pe<V;){let oe=2147483647;for(const _e of R)_e>=K&&_e<oe&&(oe=_e);const ye=pe+1;oe-K>w((2147483647-Z)/ye)&&y("overflow"),Z+=(oe-K)*ye,K=oe;for(const _e of R)if(_e<K&&++Z>2147483647&&y("overflow"),_e===K){let de=Z;for(let be=36;;be+=36){const xe=be<=G?1:be>=G+26?26:be-G;if(de<xe)break;const Le=de-xe,ee=36-xe;F.push(S(b(xe+Le%ee,0))),de=w(Le/ee)}F.push(S(b(de,0))),G=M(Z,ye,pe===X),Z=0,++pe}++Z,++K}return F.join("")},P={version:"2.3.1",ucs2:{decode:_,encode:I},decode:N,encode:D,toASCII:function(R){return v(R,function(F){return h.test(F)?"xn--"+D(F):F})},toUnicode:function(R){return v(R,function(F){return d.test(F)?N(F.slice(4).toLowerCase()):F})}};t.exports=P})}),VC=NC(OL()),ls=class{type;tag;attrs;map;nesting;level;children;content;markup;info;meta;block;hidden;constructor(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}attrIndex(e){if(!this.attrs)return-1;const t=this.attrs;for(let n=0,s=t.length;n<s;n++)if(t[n][0]===e)return n;return-1}attrPush(e){this.attrs?this.attrs.push(e):this.attrs=[e]}attrSet(e,t){const n=this.attrIndex(e),s=[e,t];n<0?this.attrPush(s):this.attrs[n]=s}attrGet(e){const t=this.attrIndex(e);let n=null;return t>=0&&(n=this.attrs[t][1]),n}attrJoin(e,t){const n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=`${this.attrs[n][1]} ${t}`}};function lv(e,t,n){let s,o=t;const i={ok:!1,pos:0,str:""};if(e.charCodeAt(o)===60){for(o++;o<n;){if(s=e.charCodeAt(o),s===10||s===60)return i;if(s===62)return i.pos=o+1,i.str=zc(e.slice(t+1,o)),i.ok=!0,i;if(s===92&&o+1<n){o+=2;continue}o++}return i}let r=0;for(;o<n&&(s=e.charCodeAt(o),!(s===32||s<32||s===127));){if(s===92&&o+1<n){if(e.charCodeAt(o+1)===32)break;o+=2;continue}if(s===40&&(r++,r>32))return i;if(s===41){if(r===0)break;r--}o++}return t===o||r!==0||(i.str=zc(e.slice(t,o)),i.pos=o,i.ok=!0),i}var KC=lv;const wd=-2;function PL(e,t,n){let s=t+1;for(;s<n;){const o=e.charCodeAt(s);if(o===93)return s;if(o===92){s+=2;continue}if(o===96||o===60||o===33&&s+1<n&&e.charCodeAt(s+1)===91||o===91)return wd;s++}return-1}function av(e,t,n){let s=1,o=!1,i,r;const l=e.src,a=e.posMax,c=e.pos,u=e.__mdtsLinkLabelNoCloseFrom;if(typeof u=="number"&&t+1>=u)return-1;const d=l.indexOf("]",t+1);if(d<0||d>=a)return e.__mdtsLinkLabelNoCloseFrom=t+1,-1;const h=PL(l,t,a);if(h!==wd)return h;for(e.pos=t+1;e.pos<a;){if(i=l.charCodeAt(e.pos),i===93&&(s--,s===0)){o=!0;break}if(r=e.pos,e.md.inline.skipToken(e),i===91){if(r===e.pos-1)s++;else if(n)return e.pos=c,-1}}let p=-1;return o&&(p=e.pos),e.pos=c,p}var mf=av;function cv(e,t,n,s){let o,i=t;const r={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(s)r.str=s.str,r.marker=s.marker;else{if(i>=n)return r;let l=e.charCodeAt(i);if(l!==34&&l!==39&&l!==40)return r;t++,i++,l===40&&(l=41),r.marker=l}for(;i<n;){if(o=e.charCodeAt(i),o===r.marker)return r.pos=i+1,r.str+=zc(e.slice(t,i)),r.ok=!0,r;if(o===40&&r.marker===41)return r;o===92&&i+1<n&&i++,i++}return r.can_continue=!0,r.str+=zc(e.slice(t,i)),r}var GC=cv;function ph(e,t){if(!e.attrs)return-1;for(let n=0;n<e.attrs.length;n++)if(e.attrs[n][0]===t)return n;return-1}function uv(e,t){e.attrs||(e.attrs=[]),e.attrs.push(t)}function RL(e,t,n){const s=ph(e,t),o=[t,n];s<0?uv(e,o):e.attrs[s]=o}function DL(e,t){const n=ph(e,t);return n>=0?e.attrs[n][1]:null}function BL(e,t,n){const s=ph(e,t);s<0?uv(e,[t,n]):e.attrs[s][1]=`${e.attrs[s][1]} ${n}`}var FL=HC({attrGet:()=>DL,attrIndex:()=>ph,attrJoin:()=>BL,attrPush:()=>uv,attrSet:()=>RL,parseLinkDestination:()=>lv,parseLinkLabel:()=>av,parseLinkTitle:()=>cv});function HL(e){return e.includes("\r")||e.includes("\0")}function YC(e){return typeof e=="string"?e:e.toString()}function WL(e){if(e.inlineMode){const t=new ls("inline","",0);t.content=YC(e.src),t.map=[0,1],t.children=[],t.level=0,e.tokens.push(t)}else e.md&&e.md.block&&e.md.block.parse(e.src,e.md,e.env,e.tokens)}const UL=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,qL=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function jL(e,t){let n=e.pos;const s=e.src;if(s.charCodeAt(n)!==60)return!1;const o=n,i=e.posMax;for(;;){if(++n>=i)return!1;const l=s.charCodeAt(n);if(l===60)return!1;if(l===62)break}const r=s.slice(o+1,n);if(qL.test(r)){const l=e.md.normalizeLink(r);if(!e.md.validateLink(l))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",l]],a.markup="autolink",a.info="auto";const c=e.push("text","",0);c.content=e.md.normalizeLinkText(r);const u=e.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return e.pos+=r.length+2,!0}if(UL.test(r)){const l=e.md.normalizeLink(`mailto:${r}`);if(!e.md.validateLink(l))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",l]],a.markup="autolink",a.info="auto";const c=e.push("text","",0);c.content=e.md.normalizeLinkText(r);const u=e.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return e.pos+=r.length+2,!0}return!1}var zL=jL;function VL(e,t){const n=e.src;let s=e.pos;if(n.charCodeAt(s)!==96)return!1;const o=s;s++;const i=e.posMax;for(;s<i&&n.charCodeAt(s)===96;)s++;const r=n.slice(o,s),l=r.length;if(e.backticksScanned&&(e.backticks[l]||0)<=o)return t||(e.pending+=r),e.pos+=l,!0;let a=s,c;for(;(c=n.indexOf("`",a))!==-1;){for(a=c+1;a<i&&n.charCodeAt(a)===96;)a++;const u=a-c;if(u===l){if(!t){const d=e.push("code_inline","code",0);d.markup=r;let h=n.slice(s,c);h.includes(`
|
|
48
|
-
`)&&(h=h.replace(/\n/g," ")),h.length>2&&h.charCodeAt(0)===32&&h.charCodeAt(h.length-1)===32&&(h=h.slice(1,-1)),d.content=h}return e.pos=a,!0}e.backticks[u]=c}return e.backticksScanned=!0,t||(e.pending+=r),e.pos+=l,!0}var KL=VL;function nb(e){const t={},n=e.length;if(!n)return;let s=0,o=-2;const i=[];for(let r=0;r<n;r++){const l=e[r];if(i.push(0),(e[s].marker!==l.marker||o!==l.token-1)&&(s=r),o=l.token,l.length=l.length||0,!l.close)continue;Object.prototype.hasOwnProperty.call(t,l.marker)||(t[l.marker]=[-1,-1,-1,-1,-1,-1]);const a=t[l.marker][(l.open?3:0)+l.length%3];let c=s-i[s]-1,u=c;for(;c>a;c-=i[c]+1){const d=e[c];if(d.marker===l.marker&&d.open&&d.end<0){let h=!1;if((d.close||l.open)&&(d.length+l.length)%3===0&&(d.length%3!==0||l.length%3!==0)&&(h=!0),!h){const p=c>0&&!e[c-1].open?i[c-1]+1:0;i[r]=r-c+p,i[c]=p,l.open=!1,d.end=r,d.close=!1,u=-1,o=-2;break}}}u!==-1&&(t[l.marker][(l.open?3:0)+(l.length||0)%3]=u)}}function GL(e){const t=e.tokens_meta,n=e.tokens_meta.length;nb(e.delimiters);for(let s=0;s<n;s++)t[s]&&t[s].delimiters&&nb(t[s].delimiters)}var YL=GL;function XL(e,t){const n=e.pos,s=e.src.charCodeAt(n);if(t||s!==95&&s!==42)return!1;const o=e.scanDelims(e.pos,s===42);if(!o||o.length===0)return!1;for(let i=0;i<o.length;i++){const r=e.push("text","",0);r.content=String.fromCharCode(s),e.delimiters.push({marker:s,length:o.length,token:e.tokens.length-1,end:-1,open:o.can_open,close:o.can_close})}return e.pos+=o.length,!0}function sb(e,t){const n=t.length;for(let s=n-1;s>=0;s--){const o=t[s];if(o.marker!==95&&o.marker!==42||o.end===-1)continue;const i=t[o.end],r=s>0&&t[s-1].end===o.end+1&&t[s-1].marker===o.marker&&t[s-1].token===o.token-1&&t[o.end+1].token===i.token+1,l=String.fromCharCode(o.marker),a=e.tokens[o.token];a.type=r?"strong_open":"em_open",a.tag=r?"strong":"em",a.nesting=1,a.markup=r?l+l:l,a.content="";const c=e.tokens[i.token];c.type=r?"strong_close":"em_close",c.tag=r?"strong":"em",c.nesting=-1,c.markup=r?l+l:l,c.content="",r&&(e.tokens[t[s-1].token].content="",e.tokens[t[o.end+1].token].content="",s--)}}function ZL(e){const t=e.tokens_meta,n=e.tokens_meta.length;sb(e,e.delimiters);for(let s=0;s<n;s++)t[s]&&t[s].delimiters&&sb(e,t[s].delimiters)}const ob={tokenize:XL,postProcess:ZL};function XC(e){return J1(e)}function dv(e){return e>=48&&e<=57}function JL(e){const t=e|32;return dv(e)||t>=97&&t<=102}function ZC(e){const t=e|32;return t>=97&&t<=122}function QL(e){return ZC(e)||dv(e)}function eO(e,t,n){let s=t+2;if(s>=n)return null;let o=!1,i=7,r=s;for((e.charCodeAt(s)|32)===120&&(o=!0,i=6,s++,r=s);s<n&&s-r<i;){const l=e.charCodeAt(s);if(!(o?JL(l):dv(l)))break;s++}return s===r||s>=n||e.charCodeAt(s)!==59?null:e.slice(t,s+1)}function tO(e,t,n){let s=t+1;if(s>=n||!ZC(e.charCodeAt(s)))return null;for(s++;s<n&&s-t-1<32&&QL(e.charCodeAt(s));)s++;if(s-t-1<2||s>=n||e.charCodeAt(s)!==59)return null;const o=e.slice(t,s+1);return XC(o)!==o?o:null}function nO(e,t){const n=e.pos,s=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=s)return!1;if(e.src.charCodeAt(n+1)===35){const o=eO(e.src,n,s);if(o){if(!t){const i=(o.charCodeAt(2)|32)===120?Number.parseInt(o.slice(3,-1),16):Number.parseInt(o.slice(2,-1),10),r=e.push("text_special","",0);r.content=dh(i)?jc(i):jc(65533),r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}else{const o=tO(e.src,n,s);if(o){const i=XC(o);if(!t){const r=e.push("text_special","",0);r.content=i,r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}return!1}var sO=nO;const JC=(()=>{const e=new Array(256).fill(0),t="\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-";for(let n=0;n<32;n++)e[t.charCodeAt(n)]=1;return e})(),Ag=new Array(128),QC=new Array(128);for(let e=0;e<128;e++){const t=String.fromCharCode(e);Ag[e]=`\\${t}`,QC[e]=JC[e]?t:Ag[e]}function ib(e,t,n){e.pending&&e.pushPending();const s=new ls("text_special","",0);s.level=e.level,s.content=t,s.markup=n,s.info="escape",e.pendingLevel=e.level,e.tokens.push(s),e.tokens_meta.push(null)}function oO(e,t){let n=e.pos;const s=e.posMax,o=e.src;if(o.charCodeAt(n)!==92||(n++,n>=s))return!1;let i=o.charCodeAt(n);if(i===10){for(t||e.push("hardbreak","br",0),n++;n<s&&(i=o.charCodeAt(n),!(i!==9&&i!==32));)n++;return e.pos=n,!0}if(i<128)return t?(e.pos=n+1,!0):(ib(e,QC[i],Ag[i]),e.pos=n+1,!0);if(t){if(i>=55296&&i<=56319&&n+1<s){const a=o.charCodeAt(n+1);a>=56320&&a<=57343&&n++}return e.pos=n+1,!0}let r=o.charAt(n);if(i>=55296&&i<=56319&&n+1<s){const a=o.charCodeAt(n+1);a>=56320&&a<=57343&&(r+=o.charAt(n+1),n++)}const l=`\\${r}`;return ib(e,i<256&&JC[i]?r:l,l),e.pos=n+1,!0}var iO=oO;function rO(e){let t,n,s=0;const o=e.tokens,i=e.tokens.length;for(t=n=0;t<i;t++){const r=o[t];r&&(r.nesting&&r.nesting<0&&s--,r.level=s,r.nesting&&r.nesting>0&&s++,r.type==="text"&&t+1<i&&o[t+1]?.type==="text"?o[t+1].content=r.content+o[t+1].content:(t!==n&&(o[n]=r),n++))}t!==n&&(o.length=n)}var lO=rO;const ex=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,tx="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",aO=new RegExp(`^(?:${ex}|${tx}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<\\?[\\s\\S]*?\\?>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),cO=new RegExp(`^(?:${ex}|${tx})`);function nx(e){return e===32||e===9||e===10||e===12||e===13}function uO(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!==97)return!1;const t=e.charCodeAt(2);return t===62||nx(t)}function dO(e){if(e.length<4||e.charCodeAt(0)!==60||e.charCodeAt(1)!==47||(e.charCodeAt(2)|32)!==97)return!1;for(let t=3;t<e.length;t++){const n=e.charCodeAt(t);if(n===62)return!0;if(!nx(n))return!1}return!1}function fO(e){const t=e|32;return t>=97&&t<=122}function hO(e,t){if(!e.md.options.html)return!1;const n=e.posMax,s=e.pos,o=e.src;if(o.charCodeAt(s)!==60||s+2>=n)return!1;const i=o.charCodeAt(s+1);if(i!==33&&i!==63&&i!==47&&!fO(i))return!1;const r=o.slice(s).match(aO);if(!r)return!1;const l=r[0];if(!t){const a=e.pushSimple("html_inline","");a.content=l,uO(l)&&e.linkLevel++,dO(l)&&e.linkLevel--}return e.pos+=l.length,!0}var pO=hO;function mO(e,t){let n,s,o,i,r,l,a,c,u="";const d=e.pos,h=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const p=e.pos+2,f=mf(e,e.pos+1,!1);if(f<0)return!1;if(i=f+1,i<h&&e.src.charCodeAt(i)===40){for(i++;i<h&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);if(i>=h)return!1;if(l=KC(e.src,i,e.posMax),l.ok){for(u=e.md.normalizeLink(l.str),e.md.validateLink(u)?i=l.pos:u="",c=i;i<h&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);if(l=GC(e.src,i,e.posMax),i<h&&c!==i&&l.ok)for(a=l.str,i=l.pos;i<h&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);else a=""}if(i>=h||e.src.charCodeAt(i)!==41)return e.pos=d,!1;i++}else{if(typeof e.env.references>"u")return!1;if(i<h&&e.src.charCodeAt(i)===91?(c=i+1,i=mf(e,i),i>=0?o=e.src.slice(c,i++):i=f+1):i=f+1,o||(o=e.src.slice(p,f)),r=e.env.references[uh(o)],!r)return e.pos=d,!1;u=r.href,a=r.title}if(!t){s=e.src.slice(p,f);const g=[];e.md.inline.parse(s,e.md,e.env,g);const w=e.push("image","img",0);w.attrs=[["src",u],["alt",""]],w.children=g,w.content=s,a&&w.attrs.push(["title",a])}return e.pos=i,e.posMax=h,!0}var gO=mO;function vO(e,t){let n,s,o,i,r="",l="",a=e.pos,c=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const u=e.pos,d=e.posMax,h=e.pos+1,p=mf(e,e.pos,!0);if(p<0)return!1;let f=p+1;if(f<d&&e.src.charCodeAt(f)===40){for(c=!1,f++;f<d&&(n=e.src.charCodeAt(f),!(n!==32&&n!==10));f++);if(f>=d)return!1;if(o=KC(e.src,f,e.posMax),o.ok){for(r=e.md.normalizeLink(o.str),e.md.validateLink(r)?f=o.pos:r="",a=f;f<d&&(n=e.src.charCodeAt(f),!(n!==32&&n!==10));f++);if(o=GC(e.src,f,e.posMax),f<d&&a!==f&&o.ok)for(l=o.str,f=o.pos;f<d&&(n=e.src.charCodeAt(f),!(n!==32&&n!==10));f++);}(f>=d||e.src.charCodeAt(f)!==41)&&(c=!0),f++}if(c){if(typeof e.env.references>"u")return!1;if(f<d&&e.src.charCodeAt(f)===91?(a=f+1,f=mf(e,f),f>=0?s=e.src.slice(a,f++):f=p+1):f=p+1,s||(s=e.src.slice(h,p)),i=e.env.references[uh(s)],!i)return e.pos=u,!1;r=i.href,l=i.title}if(!t){e.pos=h,e.posMax=p;const g=e.push("link_open","a",1),w=[["href",r]];g.attrs=w,l&&w.push(["title",l]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=f,e.posMax=d,!0}var yO=vO;function sx(e){const t=e|32;return t>=97&&t<=122}function kO(e){return e>=48&&e<=57}function bO(e){return sx(e)||kO(e)||e===43||e===45||e===46}function _O(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&bO(e.charCodeAt(t));)t--;return t++,t>=e.length||!sx(e.charCodeAt(t))?null:e.slice(t)}function wO(e,t,n){let s=t;for(;s<n;){const o=e.charCodeAt(s);if(o<=32||o===127||o===60)break;s++}return e.slice(t,s)}function SO(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const n=e.pos,s=e.posMax;if(n+3>s||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const o=_O(e.pending);if(!o)return!1;const i=wO(e.src,n-o.length,s),r=e.md.linkify.matchAtStart(i);if(!r)return!1;let l=r.url;if(l.length<=o.length)return!1;let a=l.length;for(;a>0&&l.charCodeAt(a-1)===42;)a--;a!==l.length&&(l=l.slice(0,a));const c=e.md.normalizeLink(l);if(!e.md.validateLink(c))return!1;if(!t){e.pending=e.pending.slice(0,-o.length);const u=e.push("link_open","a",1);u.attrs=[["href",c]],u.markup="linkify",u.info="auto";const d=e.push("text","",0);d.content=e.md.normalizeLinkText(l);const h=e.push("link_close","a",-1);h.markup="linkify",h.info="auto"}return e.pos+=l.length-o.length,!0}function CO(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const s=e.pending.length-1,o=e.posMax;if(!t)if(s>=0&&e.pending.charCodeAt(s)===32)if(s>=1&&e.pending.charCodeAt(s-1)===32){let i=s-1;for(;i>=1&&e.pending.charCodeAt(i-1)===32;)i--;e.pending=e.pending.slice(0,i),e.pushSimple("hardbreak","br")}else e.pending=e.pending.slice(0,-1),e.pushSimple("softbreak","br");else e.pushSimple("softbreak","br");for(n++;n<o;){const i=e.src.charCodeAt(n);if(i!==9&&i!==32)break;n++}return e.pos=n,!0}var xO=CO;function TO(e,t){const n=e.pos,s=e.src.charCodeAt(n);if(t||s!==126)return!1;const o=e.scanDelims(e.pos,!0);if(!o)return!1;let i=o.length;const r=String.fromCharCode(s);if(i<2)return!1;let l;i%2&&(l=e.push("text","",0),l.content=r,i--);for(let a=0;a<i;a+=2)l=e.push("text","",0),l.content=r+r,e.delimiters.push({marker:s,length:0,token:e.tokens.length-1,end:-1,open:o.can_open,close:o.can_close});return e.pos+=o.length,!0}function rb(e,t){let n;const s=[],o=t.length;for(let i=0;i<o;i++){const r=t[i];if(r.marker!==126||r.end===-1)continue;const l=t[r.end];n=e.tokens[r.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=e.tokens[l.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",e.tokens[l.token-1].type==="text"&&e.tokens[l.token-1].content==="~"&&s.push(l.token-1)}for(;s.length;){const i=s.pop();let r=i+1;for(;r<e.tokens.length&&e.tokens[r].type==="s_close";)r++;r--,i!==r&&(n=e.tokens[r],e.tokens[r]=e.tokens[i],e.tokens[i]=n)}}function MO(e){const t=e.delimiters;rb(e,t);const n=e.tokens_meta;if(n)for(let s=0;s<n.length;s++)n[s]&&n[s].delimiters&&rb(e,n[s].delimiters)}const lb={tokenize:TO,postProcess:MO};function ab(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function AO(e,t){const n=e.src,s=e.pos,o=e.posMax;if(s>=o||ab(n.charCodeAt(s)))return!1;let i=s+1;for(;i<o&&!ab(n.charCodeAt(i));)i++;return t||(e.pending+=i===s+1?n.charAt(s):n.slice(s,i)),e.pos=i,!0}var EO=AO;function fv(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function IO(e){if(e.length===0)return 0;const t=e.slice().sort((s,o)=>s-o),n=Math.floor(t.length/2);return t.length%2===0?(t[n-1]+t[n])/2:t[n]}function $O(e,t){return{chain:e,name:t,calls:0,hits:0,inclusiveMs:0,medianMs:0,maxMs:0,normalCalls:0,normalHits:0,silentCalls:0,silentHits:0,samples:[]}}function ox(e){const t=e;if(!t)return null;if(t.__mdtsRuleProfile)return t.__mdtsRuleProfile;if(!t.__mdtsProfileRules)return null;const n=t.__mdtsProfileRules===!0?{}:t.__mdtsProfileRules,s={enabled:!0,fixture:n.fixture,mode:n.mode,startedAt:fv(),records:Object.create(null)};return t.__mdtsRuleProfile=s,s}function ia(e,t,n,s,o,i){const r=ox(e);if(!r)return;const l=`${t}:${n}`,a=r.records[l]??(r.records[l]=$O(t,n));a.calls++,a.inclusiveMs+=s,s>a.maxMs&&(a.maxMs=s),a.samples.push(s),i?(a.silentCalls++,o&&a.silentHits++):(a.normalCalls++,o&&a.normalHits++),o&&a.hits++,r.completedAt=fv()}function NO(e){const t=ox(e);if(!t)return null;const n=Object.keys(t.records);for(let s=0;s<n.length;s++){const o=t.records[n[s]];o.medianMs=IO(o.samples)}return t.completedAt=fv(),t}var cb=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t,n){const s=this.rules.findIndex(o=>o.name===e);s>=0&&this.rules.splice(s,1),this.rules.push({name:e,fn:t,alt:n?.alt||[],enabled:!0}),this.invalidateCache()}at(e,t,n){const s=this.rules.findIndex(o=>o.name===e);if(t===void 0){if(s<0)return;const o=this.rules[s];return Object.freeze({name:o.name,fn:o.fn,alt:o.alt?Object.freeze(o.alt.slice()):void 0,enabled:o.enabled})}if(s<0)throw new Error(`Parser rule not found: ${e}`);this.rules[s].fn=t,n?.alt!==void 0&&(this.rules[s].alt=n.alt),this.invalidateCache()}before(e,t,n,s){const o=this.rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const i=this.rules.findIndex(r=>r.name===t);i>=0&&this.rules.splice(i,1),this.rules.splice(o,0,{name:t,fn:n,alt:s?.alt||[],enabled:!0}),this.invalidateCache()}after(e,t,n,s){const o=this.rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const i=this.rules.findIndex(r=>r.name===t);i>=0&&this.rules.splice(i,1),this.rules.splice(o+1,0,{name:t,fn:n,alt:s?.alt||[],enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}s.push(i),this.rules[r].enabled||(this.rules[r].enabled=!0,o=!0)}return o&&this.invalidateCache(),s}disable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}s.push(i),this.rules[r].enabled&&(this.rules[r].enabled=!1,o=!0)}return o&&this.invalidateCache(),s}enableOnly(e){const t=new Set(e);let n=!1;for(const s of this.rules){const o=t.has(s.name);s.enabled!==o&&(s.enabled=o,n=!0)}n&&this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache.get(t)??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache.get(t)??[]}compileCache(){const e=new Set([""]);for(const s of this.rules)if(s.enabled&&s.alt)for(const o of s.alt)e.add(o);const t=new Map,n=new Map;for(const s of e){const o=[],i=[];for(const r of this.rules)r.enabled&&(s!==""&&!r.alt?.includes(s)||(o.push(r.fn),i.push({name:r.name,fn:r.fn})));t.set(s,o),n.set(s,i)}this.cache=t,this.namedCache=n}},ix=class{src;md;env;tokens;tokens_meta;pos;posMax;level;pending;pendingLevel;cache;delimiters;_prev_delimiters;backticks;backticksScanned;linkLevel;maxNesting;constructor(e,t,n,s){this.src=e,this.md=t,this.env=n,this.tokens=s,this.tokens_meta=new Array(s.length),this.pos=0,this.posMax=e.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache=[],this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0,this.maxNesting=t.options.maxNesting}pushPending(){const e=new ls("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e}pushSimple(e,t){this.pending&&this.pushPending();const n=new ls(e,t,0);return n.level=this.level,this.pendingLevel=this.level,this.tokens.push(n),this.tokens_meta.push(null),n}push(e,t,n){if(this.pending&&this.pushPending(),n===0)return this.pushSimple(e,t);const s=new ls(e,t,n);let o=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),s.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(s),this.tokens_meta.push(o),s}scanDelims(e,t){const{src:n,posMax:s}=this,o=n.charCodeAt(e);let i=e;for(;i<s&&n.charCodeAt(i)===o;)i++;const r=i-e,l=e>0?n.charCodeAt(e-1):32,a=i<s?n.charCodeAt(i):32,c=qc(l),u=qc(a),d=Sg(l),h=Sg(a),p=!u&&(!h||c||d),f=!c&&(!d||u||h);return{can_open:p&&(t||!f||d),can_close:f&&(t||!p||h),length:r}}};ix.prototype.Token=ls;function LO(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function rx(e){for(let t=0;t<e.length;t++)if(LO(e.charCodeAt(t)))return!1;return!0}var OO=class{ruler;ruler2;cachedRulesVersion=-1;cachedRules=[];cachedRules2Version=-1;cachedRules2=[];defaultRulerVersion;defaultRuler2Version;constructor(){this.ruler=new cb,this.ruler2=new cb,this.ruler.push("text",EO),this.ruler.push("linkify",SO),this.ruler.push("newline",xO),this.ruler.push("escape",iO),this.ruler.push("backticks",KL),this.ruler.push("strikethrough",lb.tokenize),this.ruler.push("emphasis",ob.tokenize),this.ruler.push("link",yO),this.ruler.push("image",gO),this.ruler.push("autolink",zL),this.ruler.push("html_inline",pO),this.ruler.push("entity",sO),this.ruler2.push("balance_pairs",YL),this.ruler2.push("strikethrough",lb.postProcess),this.ruler2.push("emphasis",ob.postProcess),this.ruler2.push("fragments_join",lO),this.defaultRulerVersion=this.ruler.version,this.defaultRuler2Version=this.ruler2.version}skipToken(e){const t=e.pos,n=this.getRules(),s=n.length,o=e.cache,i=o[t],r=!!e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules"));if(i!==void 0){e.pos=i;return}let l=!1;if(e.level<e.maxNesting){if(r){const a=this.ruler.getNamedRules("");for(let c=0;c<s;c++){e.level++;const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();l=a[c].fn(e,!0);const d=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(ia(e.env,"inline",a[c].name,d-u,!!l,!0),e.level--,l){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}}else for(let a=0;a<s;a++)if(e.level++,l=n[a](e,!0),e.level--,l){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;l||e.pos++,o[t]=e.pos}tokenize(e){const t=this.getRules(),n=t.length,s=e.posMax;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){for(;e.pos<s;){const i=e.pos;let r=!1;if(e.level<e.maxNesting){for(let l=0;l<n;l++)if(r=t[l](e,!1),r){if(i>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(r){if(e.pos>=s)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending();return}const o=this.ruler.getNamedRules("");for(;e.pos<s;){const i=e.pos;let r=!1;if(e.level<e.maxNesting)for(let l=0;l<n;l++){const a=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();r=o[l].fn(e,!1);const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(ia(e.env,"inline",o[l].name,c-a,!!r,!1),r){if(i>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(r){if(e.pos>=s)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending()}isDefaultRuleset(){return this.ruler.version===this.defaultRulerVersion&&this.ruler2.version===this.defaultRuler2Version}parseSource(e,t,n,s){if(typeof e=="string"&&e.length>0&&this.isDefaultRuleset()&&rx(e)){const a=new ls("text","",0);a.content=e,s.push(a);return}const o=new ix(e,t,n,s);this.tokenize(o);const i=this.getRules2(),r=i.length;if(!(o.env&&(Object.prototype.hasOwnProperty.call(o.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(o.env,"__mdtsProfileRules")))){for(let a=0;a<r;a++)i[a](o,!1);return}const l=this.ruler2.getNamedRules("");for(let a=0;a<r;a++){const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();l[a].fn(o,!1);const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();ia(o.env,"inline2",l[a].name,u-c,!0,!1)}}parse(e,t,n,s){this.parseSource(e,t,n,s)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}getRules2(){return this.cachedRules2Version!==this.ruler2.version&&(this.cachedRules2=this.ruler2.getRules(""),this.cachedRules2Version=this.ruler2.version),this.cachedRules2}};function PO(e){const t=e.tokens,n=!!e.md?.inline?.isDefaultRuleset?.();for(let s=0,o=t.length;s<o;s++){const i=t[s];if(i.type==="inline"&&e.md){if(i.children||(i.children=[]),n&&i.content.length>0&&rx(i.content)){const r=new ls("text","",0);r.content=i.content,i.children.push(r);continue}e.md.inline.parse(i.content,e.md,e.env,i.children)}}}const RO=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,DO=/[0-9a-z]/i;function BO(e){return/^<a[>\s]/i.test(e)}function FO(e){return/^<\/a\s*>/i.test(e)}function HO(e,t){if(t.schema||t.index!==0||!t.raw)return t;for(let n=1;n<t.raw.length;n++){const s=t.raw[n-1],o=t.raw[n];if(!RO.test(s)||!DO.test(o))continue;const i=t.raw.slice(n),r=e.match(i)?.[0];if(!(!r||r.index!==0||r.lastIndex!==i.length))return{...r,index:t.index+n,lastIndex:t.index+n+r.lastIndex}}return t}function WO(e){const t=e.tokens;if(e.md?.options?.linkify)for(let n=0;n<t.length;n++){const s=t[n];if(s.type!=="inline"||!e.md.linkify.pretest(s.content))continue;let o=s.children;o||(o=[],s.children=o);let i=0;for(let r=o.length-1;r>=0;r--){const l=o[r];if(l.type==="link_close"){for(r--;r>=0&&o[r].level!==l.level&&o[r].type!=="link_open";)r--;continue}if(l.type==="html_inline"&&(BO(l.content)&&i>0&&i--,FO(l.content)&&i++),i>0||l.type!=="text"||!e.md.linkify.test(l.content))continue;const a=l.content;let c=(e.md.linkify.match(a)||[]).map(p=>HO(e.md.linkify,p));if(c.length===0)continue;const u=[];let d=l.level,h=0;c.length>0&&c[0].index===0&&r>0&&o[r-1].type==="text_special"&&(c=c.slice(1));for(let p=0;p<c.length;p++){const f=c[p],g=e.md.normalizeLink(f.url);if(!e.md.validateLink(g))continue;let w=f.text;f.schema?f.schema==="mailto:"&&!/^mailto:/i.test(w)?w=e.md.normalizeLinkText(`mailto:${w}`).replace(/^mailto:/,""):w=e.md.normalizeLinkText(w):w=e.md.normalizeLinkText(`http://${w}`).replace(/^http:\/\//,"");const S=f.index;if(S>h){const _=new ls("text","",0);_.content=a.slice(h,S),_.level=d,u.push(_)}const y=new ls("link_open","a",1);y.attrs=[["href",g]],y.level=d++,y.markup="linkify",y.info="auto",u.push(y);const k=new ls("text","",0);k.content=w,k.level=d,u.push(k);const v=new ls("link_close","a",-1);v.level=--d,v.markup="linkify",v.info="auto",u.push(v),h=f.lastIndex}if(h!==0){if(h<a.length){const p=new ls("text","",0);p.content=a.slice(h),p.level=d,u.push(p)}o.splice(r,1,...u)}}}}const UO=/\r\n?|\n/g,qO=/\0/g;function jO(e){if(!e||typeof e.src!="string")return;const t=e.src,n=t.includes("\r"),s=t.includes("\0");if(!n&&!s)return;let o=t;n&&(o=o.replace(UO,`
|
|
49
|
-
`)),s&&(o=o.replace(qO,"�")),e.src=o}const lx=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,zO=/\((?:c|tm|r)\)/i,VO=/\((c|tm|r)\)/gi,KO={c:"©",r:"®",tm:"™"};function GO(e,t){return KO[t.toLowerCase()]}function YO(e){let t=0;for(let n=e.length-1;n>=0;n--){const s=e[n];s.type==="text"&&!t&&(s.content=s.content.replace(VO,GO)),s.type==="link_open"&&s.info==="auto"&&t--,s.type==="link_close"&&s.info==="auto"&&t++}}function XO(e){let t=0;for(let n=e.length-1;n>=0;n--){const s=e[n];s.type==="text"&&!t&&lx.test(s.content)&&(s.content=s.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),s.type==="link_open"&&s.info==="auto"&&t--,s.type==="link_close"&&s.info==="auto"&&t++}}function ZO(e){if(e.md?.options?.typographer)for(let t=e.tokens.length-1;t>=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const s=n.content||(Array.isArray(n.children)?n.children.map(o=>o.type==="text"?o.content:"").join(""):"");zO.test(s)&&YO(n.children||[]),lx.test(s)&&XO(n.children||[])}}var JO=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t){const n=this.rules.findIndex(s=>s.name===e);n>=0&&this.rules.splice(n,1),this.rules.push({name:e,fn:t,enabled:!0}),this.invalidateCache()}at(e,t){const n=this.rules.findIndex(s=>s.name===e);if(n<0)throw new Error(`Parser rule not found: ${e}`);this.rules[n].fn=t,this.invalidateCache()}before(e,t,n){const s=this.rules.findIndex(i=>i.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const o=this.rules.findIndex(i=>i.name===t);o>=0&&this.rules.splice(o,1),this.rules.splice(s,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}after(e,t,n){const s=this.rules.findIndex(i=>i.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const o=this.rules.findIndex(i=>i.name===t);o>=0&&this.rules.splice(o,1),this.rules.splice(s+1,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}s.push(i),this.rules[r].enabled||(this.rules[r].enabled=!0,o=!0)}return o&&this.invalidateCache(),s}disable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}s.push(i),this.rules[r].enabled&&(this.rules[r].enabled=!1,o=!0)}return o&&this.invalidateCache(),s}enableOnly(e){const t=new Set(e);let n=!1;for(const s of this.rules){const o=t.has(s.name);s.enabled!==o&&(s.enabled=o,n=!0)}n&&this.invalidateCache()}compileCache(){this.cache=this.rules.filter(e=>e.enabled).map(e=>e.fn),this.namedCache=this.rules.filter(e=>e.enabled).map(e=>({name:e.name,fn:e.fn}))}getRules(e=""){return this.cache||this.compileCache(),this.cache}getNamedRules(e=""){return this.namedCache||this.compileCache(),this.namedCache}};const QO=/['"]/,ub=/['"]/g,db="’";function Ju(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function eP(e,t){let n;const s=[],o=t.md&&t.md.options&&t.md.options.quotes||"“”‘’";for(let i=0;i<e.length;i++){const r=e[i],l=e[i].level;for(n=s.length-1;n>=0&&!(s[n].level<=l);n--);if(s.length=n+1,r.type!=="text")continue;let a=r.content,c=0,u=a.length;e:for(;c<u;){ub.lastIndex=c;const d=ub.exec(a);if(!d)break;let h=!0,p=!0;c=d.index+1;const f=d[0]==="'";let g=32;if(d.index-1>=0)g=a.charCodeAt(d.index-1);else for(n=i-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){g=e[n].content.charCodeAt(e[n].content.length-1);break}let w=32;if(c<u)w=a.charCodeAt(c);else for(n=i+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){w=e[n].content.charCodeAt(0);break}const S=ff(g)||df(String.fromCharCode(g)),y=ff(w)||df(String.fromCharCode(w)),k=qc(g),v=qc(w);if(v?h=!1:y&&(k||S||(h=!1)),k?p=!1:S&&(v||y||(p=!1)),w===34&&d[0]==='"'&&g>=48&&g<=57&&(p=h=!1),h&&p&&(h=S,p=y),!h&&!p){f&&(r.content=Ju(r.content,d.index,db));continue}if(p)for(n=s.length-1;n>=0;n--){let _=s[n];if(s[n].level<l)break;if(_.single===f&&s[n].level===l){_=s[n];let I,A;f?(I=o[2]||"‘",A=o[3]||"’"):(I=o[0]||"“",A=o[1]||"”"),r.content=Ju(r.content,d.index,A),e[_.token].content=Ju(e[_.token].content,_.pos,I),c+=A.length-1,_.token===i&&(c+=I.length-1),a=r.content,u=a.length,s.length=n;continue e}}h?s.push({token:i,pos:d.index,single:f,level:l}):p&&f&&(r.content=Ju(r.content,d.index,db))}}}function tP(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const s=typeof n.content=="string"?n.content:(n.children||[]).map(o=>o.content||"").join("");!QO.test(s)||!n.children||eP(n.children,e)}}function nP(e){const t=e.tokens||[],n=t.length;for(let s=0;s<n;s++){const o=t[s];if(o.type!=="inline"||!Array.isArray(o.children))continue;const i=o.children,r=i.length;for(let c=0;c<r;c++)i[c].type==="text_special"&&(i[c].type="text");let l=0,a=0;for(;a<r;a++)i[a].type==="text"&&a+1<r&&i[a+1].type==="text"?i[a+1].content=i[a].content+i[a+1].content:(a!==l&&(i[l]=i[a]),l++);a!==l&&(i.length=l)}}const sP=/^(?:vbscript|javascript|file|data):/,oP=/^data:image\/(?:gif|png|jpeg|webp);/,ax=["http:","https:","mailto:"];function cx(e){const t=e.trim().toLowerCase();return sP.test(t)?oP.test(t):!0}function ux(e){const t=ev(e,!0);if(t.hostname&&(!t.protocol||ax.includes(t.protocol)))try{t.hostname=VC.default.toASCII(t.hostname)}catch{}return OC(Q1(t))}function dx(e){const t=ev(e,!0);if(t.hostname&&(!t.protocol||ax.includes(t.protocol)))try{t.hostname=VC.default.toUnicode(t.hostname)}catch{}return wg(Q1(t),`${wg.defaultChars}%`)}function iP(e){switch(e){case 9:case 32:return!0}return!1}function rP(e,t,n,s){const o=e.src,i=e.bMarks,r=e.eMarks,l=e.tShift,a=e.sCount,c=e.bsCount;let u=i[t]+l[t],d=r[t];const h=e.lineMax;if(a[t]-e.blkIndent>=4||o.charCodeAt(u)!==62)return!1;if(s)return!0;const p=[],f=[],g=[],w=[],S=e.md.block.ruler.getRulesForState(e,"blockquote"),y=e.parentType;e.parentType="blockquote";let k=!1,v;for(v=t;v<n;v++){const M=a[v]<e.blkIndent;if(u=i[v]+l[v],d=r[v],u>=d)break;if(o.charCodeAt(u++)===62&&!M){let D=a[v]+1,$,O;o.charCodeAt(u)===32?(u++,D++,O=!1,$=!0):o.charCodeAt(u)===9?($=!0,(c[v]+D)%4===3?(u++,D++,O=!1):O=!0):$=!1;let P=D;for(p.push(i[v]),i[v]=u;u<d;){const R=o.charCodeAt(u);if(iP(R))R===9?P+=4-(P+c[v]+(O?1:0))%4:P++;else break;u++}k=u>=d,f.push(c[v]),c[v]=a[v]+1+($?1:0),g.push(a[v]),a[v]=P-D,w.push(l[v]),l[v]=u-i[v];continue}if(k)break;let N=!1;for(let D=0,$=S.length;D<$;D++)if(S[D](e,v,n,!0)){N=!0;break}if(N){e.lineMax=v,e.blkIndent!==0&&(p.push(i[v]),f.push(c[v]),w.push(l[v]),g.push(a[v]),a[v]-=e.blkIndent);break}p.push(i[v]),f.push(c[v]),w.push(l[v]),g.push(a[v]),a[v]=-1}const _=e.blkIndent;e.blkIndent=0;const I=e.push("blockquote_open","blockquote",1);I.markup=">";const A=[t,0];I.map=A,e.md.block.tokenize(e,t,v);const b=e.push("blockquote_close","blockquote",-1);b.markup=">",e.lineMax=h,e.parentType=y,A[1]=e.line;for(let M=0;M<w.length;M++)i[M+t]=p[M],l[M+t]=w[M],a[M+t]=g[M],c[M+t]=f[M];return e.blkIndent=_,!0}function lP(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let s=t+1,o=s;for(;s<n;){if(e.isEmpty(s)){s++;continue}if(e.sCount[s]-e.blkIndent>=4){s++,o=s;continue}break}e.line=o;const i=e.push("code_block","code",0);return i.content=`${e.getLines(t,o,4+e.blkIndent,!1)}
|
|
50
|
-
`,i.map=[t,e.line],!0}function aP(e,t,n,s){let o=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||o+3>i)return!1;const r=e.src.charCodeAt(o);if(r!==126&&r!==96)return!1;let l=o;o=e.skipChars(o,r);let a=o-l;if(a<3)return!1;const c=e.src.slice(l,o),u=e.src.slice(o,i);if(r===96&&u.includes(String.fromCharCode(r)))return!1;if(s)return!0;let d=t,h=!1;for(;d++,!(d>=n||(o=l=e.bMarks[d]+e.tShift[d],i=e.eMarks[d],o<i&&e.sCount[d]<e.blkIndent));)if(e.src.charCodeAt(o)===r&&!(e.sCount[d]-e.blkIndent>=4)&&(o=e.skipChars(o,r),!(o-l<a)&&(o=e.skipSpaces(o),!(o<i)))){h=!0;break}a=e.sCount[t],e.line=d+(h?1:0);const p=e.push("fence","code",0);return p.info=u,p.content=e.getLines(t+1,d,a,!0),p.markup=c,p.map=[t,e.line],!0}const fb=["","h1","h2","h3","h4","h5","h6"],hb=["","#","##","###","####","#####","######"];function pb(e){switch(e){case 9:case 32:return!0}return!1}function cP(e,t,n,s){const o=e.src,i=e.bMarks,r=e.tShift,l=e.eMarks;let a=i[t]+r[t],c=l[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let u=o.charCodeAt(a);if(u!==35||a>=c)return!1;let d=1;for(u=o.charCodeAt(++a);u===35&&a<c&&d<=6;)d++,u=o.charCodeAt(++a);if(d>6||a<c&&!pb(u))return!1;if(s)return!0;c=e.skipSpacesBack(c,a);const h=e.skipCharsBack(c,35,a);h>a&&pb(o.charCodeAt(h-1))&&(c=h),e.line=t+1;const p=e.push("heading_open",fb[d],1);p.markup=hb[d],p.map=[t,e.line];const f=e.push("inline","",0);f.content=o.slice(a,c).trim(),f.map=[t,e.line],f.children=[];const g=e.push("heading_close",fb[d],-1);return g.markup=hb[d],!0}function uP(e){switch(e){case 9:case 32:return!0}return!1}function dP(e,t,n,s){const o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.bMarks[t]+e.tShift[t];const r=e.src.charCodeAt(i++);if(r!==42&&r!==45&&r!==95)return!1;let l=1;for(;i<o;){const c=e.src.charCodeAt(i++);if(c!==r&&!uP(c))return!1;c===r&&l++}if(l<3)return!1;if(s)return!0;e.line=t+1;const a=e.push("hr","hr",0);return a.map=[t,e.line],a.markup=new Array(l+1).join(String.fromCharCode(r)),!0}const $l=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp(`^</?(${["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"].join("|")})(?=(\\s|/?>|$))`,"i"),/^$/,!0],[new RegExp(`${cO.source}\\s*$`),/^$/,!1]];function fP(e,t,n,s){let o=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(o)!==60)return!1;let r=e.src.slice(o,i),l=0;for(;l<$l.length&&!$l[l][0].test(r);l++);if(l===$l.length)return!1;if(s)return $l[l][2];let a=t+1;if(!$l[l][1].test(r)){for(;a<n&&!(e.sCount[a]<e.blkIndent);a++)if(o=e.bMarks[a]+e.tShift[a],i=e.eMarks[a],r=e.src.slice(o,i),$l[l][1].test(r)){r.length!==0&&a++;break}}e.line=a;const c=e.push("html_block","",0);return c.map=[t,a],c.content=e.getLines(t,a,e.blkIndent,!0),!0}function hP(e,t,n){for(let s=t;s<n;s++)if(e.charCodeAt(s)===124)return!0;return!1}function fx(e){const t=e?.md?.block?.ruler;return t?t.version===t.__mdtsDefaultVersion:!1}function hx(e,t,n){if(t>=n)return!1;const s=e.charCodeAt(t);switch(s){case 35:case 42:case 43:case 45:case 60:case 62:case 95:case 96:case 126:return!0}return s>=48&&s<=57?!0:hP(e,t,n)}const mb=["","h1","h2"];function pP(e,t,n){const s=e.md.block.ruler.getRulesForState(e,"paragraph"),o=e.src,i=e.bMarks,r=e.tShift,l=e.eMarks,a=e.sCount,c=e.blkIndent,u=fx(e);if(a[t]-c>=4)return!1;const d=e.parentType;e.parentType="paragraph";let h=0,p,f=t+1;for(;f<n;f++){const v=i[f]+r[f],_=l[f];if(v>=_)break;if(a[f]-c>3)continue;if(a[f]>=c&&(p=o.charCodeAt(v),p===45||p===61)){let A=v+1,b=A;for(;A<_&&o.charCodeAt(A)===p;)A++;for(b=A;A<_;){const M=o.charCodeAt(A);if(M!==9&&M!==32)break;A++}if(A>=_){h=p===61?1:2;break}if(b-v>1)continue}if(a[f]<0||u&&!hx(o,v,_))continue;let I=!1;for(let A=0,b=s.length;A<b;A++)if(s[A](e,f,n,!0)){I=!0;break}if(I)break}if(!h)return!1;let g;if(f===t+1){const v=i[t]+r[t];let _=l[t];for(;_>v;){const I=o.charCodeAt(_-1);if(I!==9&&I!==32)break;_--}g=o.slice(v,_)}else g=e.getLines(t,f,c,!1).trim();e.line=f+1;const w=p===61?"=":"-",S=e.push("heading_open",mb[h],1);S.markup=w,S.map=[t,e.line];const y=e.push("inline","",0);y.content=g,y.map=[t,e.line-1],y.children=[];const k=e.push("heading_close",mb[h],-1);return k.markup=w,e.parentType=d,!0}function px(e){switch(e){case 9:case 32:return!0}return!1}function gb(e,t){const n=e.eMarks,s=e.bMarks,o=e.tShift,i=e.src,r=n[t];let l=s[t]+o[t];const a=i.charCodeAt(l++);return a!==42&&a!==45&&a!==43||l<r&&!px(i.charCodeAt(l))?-1:l}function vb(e,t){const n=e.bMarks,s=e.tShift,o=e.eMarks,i=e.src,r=n[t]+s[t],l=o[t];let a=r;if(a+1>=l)return-1;let c=i.charCodeAt(a++);if(c<48||c>57)return-1;for(;;){if(a>=l)return-1;if(c=i.charCodeAt(a++),c>=48&&c<=57){if(a-r>=10)return-1;continue}if(c===41||c===46)break;return-1}return a<l&&(c=i.charCodeAt(a),!px(c))?-1:a}function mP(e,t,n){const s=e.bMarks,o=e.tShift,i=e.src,r=s[t]+o[t];let l=0;for(let a=r;a<n-1;a++)l=l*10+i.charCodeAt(a)-48;return l}const gP=["0","1","2","3","4","5","6","7","8","9"];function vP(e,t){const n=e.level+2,s=e.tokens;for(let o=t+2,i=s.length-2;o<i;o++){const r=s[o];if(r.level===n){if(r.type==="paragraph_open"){r.hidden=!0,s[o+2].hidden=!0,o+=2;continue}if(r.nesting===1){let l=1;for(;l>0&&++o<i;)l+=s[o].nesting}}}}function yP(e,t,n,s){let o,i,r=0,l=t,a=!0;if(e.sCount[l]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]<e.blkIndent)return!1;let c=!1;s&&e.parentType==="paragraph"&&e.sCount[l]>=e.blkIndent&&(c=!0);let u,d,h;const p=e.src,f=e.bMarks,g=e.tShift,w=e.eMarks,S=e.sCount,y=e.bsCount,k=f[l]+g[l];if(k>=w[l])return!1;const v=p.charCodeAt(k);if(v>=48&&v<=57){if(h=vb(e,l),h<0||(u=!0,r=k,d=mP(e,l,h),c&&d!==1))return!1}else if(v===42||v===45||v===43){if(h=gb(e,l),h<0)return!1;u=!1}else return!1;if(c&&e.skipSpaces(h)>=w[l])return!1;if(s)return!0;const _=p.charCodeAt(h-1),I=String.fromCharCode(_);if(u){const $=e.push("ordered_list_open","ol",1);d!==void 0&&d!==1&&($.attrs=[["start",String(d)]])}else e.push("bullet_list_open","ul",1);const A=[l,0];e.tokens[e.tokens.length-1].map=A,e.tokens[e.tokens.length-1].markup=I;let b=!1;const M=e.tokens.length-1,N=e.md.block.ruler.getRulesForState(e,"list"),D=e.parentType;for(e.parentType="list";l<n;){i=h,o=w[l];const $=S[l]+h-(f[l]+g[l]);let O=$;for(;i<o;){const ye=p.charCodeAt(i);if(ye===9)O+=4-(O+y[l])%4;else if(ye===32)O++;else break;i++}const P=i;let R;P>=o?R=1:R=O-$,R>4&&(R=1);const F=$+R,V=e.push("list_item_open","li",1);V.markup=I;const K=[l,0];V.map=K,u&&(V.info=h-r-1===1?gP[p.charCodeAt(r)-48]:p.slice(r,h-1));const Z=e.tight,G=e.tShift[l],X=e.sCount[l],pe=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=F,e.tight=!0,e.tShift[l]=P-f[l],e.sCount[l]=O,P>=o&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),(!e.tight||b)&&(a=!1),b=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=pe,e.tShift[l]=G,e.sCount[l]=X,e.tight=Z,e.push("list_item_close","li",-1).markup=I,l=e.line,K[1]=l,l>=n||e.sCount[l]<e.blkIndent||e.sCount[l]-e.blkIndent>=4)break;let oe=!1;for(let ye=0,_e=N.length;ye<_e;ye++)if(N[ye](e,l,n,!0)){oe=!0;break}if(oe)break;if(u){if(h=vb(e,l),h<0)break;r=f[l]+g[l]}else if(h=gb(e,l),h<0)break;if(_!==p.charCodeAt(h-1))break}return u?e.push("ordered_list_close","ol",-1).markup=I:e.push("bullet_list_close","ul",-1).markup=I,A[1]=l,e.line=l,e.parentType=D,a&&vP(e,M),!0}function yb(e){return e===9||e===32}function kP(e,t,n){const s=e.md.block.ruler.getRulesForState(e,"paragraph"),o=e.parentType,i=e.src,r=e.bMarks,l=e.tShift,a=e.eMarks,c=e.sCount,u=e.blkIndent,d=fx(e);let h=t+1;for(e.parentType="paragraph";h<n&&!e.isEmpty(h);h++){if(c[h]-u>3||c[h]<0)continue;if(o==="list"&&c[h]>=u){const k=r[h]+l[h],v=a[h];if(k<v){const _=i.charCodeAt(k);if(_===42||_===45||_===43){if(k+1>=v||yb(i.charCodeAt(k+1)))break}else if(_>=48&&_<=57&&k+1<v){let I=k+1;for(;;){if(I>=v){I=-1;break}const A=i.charCodeAt(I++);if(A>=48&&A<=57){if(I-k>=10){I=-1;break}continue}if((A===41||A===46)&&(I>=v||yb(i.charCodeAt(I))))break;I=-1;break}if(I>=0)break}}}const w=r[h]+l[h],S=a[h];if(d&&!hx(i,w,S))continue;let y=!1;for(let k=0,v=s.length;k<v;k++)if(s[k](e,h,n,!0)){y=!0;break}if(y)break}const p=e.getLines(t,h,u,!1).trim();e.line=h;const f=e.push("paragraph_open","p",1);f.map=[t,e.line];const g=e.push("inline","",0);return g.content=p,g.map=[t,e.line],g.children=[],e.push("paragraph_close","p",-1),e.parentType=o,!0}function Qu(e){switch(e){case 9:case 32:return!0}return!1}function bP(e,t,n,s){let o=e.bMarks[t]+e.tShift[t],i=e.eMarks[t],r=t+1;const l=e.md.block.ruler.getRulesForState(e,"reference");if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(o)!==91)return!1;function a(k){const v=e.lineMax;if(k>=v||e.isEmpty(k))return null;let _=!1;if(e.sCount[k]-e.blkIndent>3&&(_=!0),e.sCount[k]<0&&(_=!0),!_){const b=e.parentType;e.parentType="reference";let M=!1;for(let N=0,D=l.length;N<D;N++)if(l[N](e,k,v,!0)){M=!0;break}if(e.parentType=b,M)return null}const I=e.bMarks[k]+e.tShift[k],A=e.eMarks[k];return e.src.slice(I,A+1)}let c=e.src.slice(o,i+1);i=c.length;let u=-1;for(o=1;o<i;o++){const k=c.charCodeAt(o);if(k===91)return!1;if(k===93){u=o;break}else if(k===10){const v=a(r);v!==null&&(c+=v,i=c.length,r++)}else if(k===92&&(o++,o<i&&c.charCodeAt(o)===10)){const v=a(r);v!==null&&(c+=v,i=c.length,r++)}}if(u<0||c.charCodeAt(u+1)!==58)return!1;for(o=u+2;o<i;o++){const k=c.charCodeAt(o);if(k===10){const v=a(r);v!==null&&(c+=v,i=c.length,r++)}else if(!Qu(k))break}const d=e.md.helpers.parseLinkDestination(c,o,i);if(!d.ok)return!1;const h=e.md.normalizeLink(d.str);if(!e.md.validateLink(h))return!1;o=d.pos;const p=o,f=r,g=o;for(;o<i;o++){const k=c.charCodeAt(o);if(k===10){const v=a(r);v!==null&&(c+=v,i=c.length,r++)}else if(!Qu(k))break}let w=e.md.helpers.parseLinkTitle(c,o,i);for(;w.can_continue;){const k=a(r);if(k===null)break;c+=k,o=i,i=c.length,r++,w=e.md.helpers.parseLinkTitle(c,o,i,w)}let S;for(o<i&&g!==o&&w.ok?(S=w.str,o=w.pos):(S="",o=p,r=f);o<i&&Qu(c.charCodeAt(o));)o++;if(o<i&&c.charCodeAt(o)!==10&&S)for(S="",o=p,r=f;o<i&&Qu(c.charCodeAt(o));)o++;if(o<i&&c.charCodeAt(o)!==10)return!1;const y=uh(c.slice(1,u));return y?(s||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[y]>"u"&&(e.env.references[y]={title:S,href:h}),e.line=r),!0):!1}function em(e){switch(e){case 9:case 32:return!0}return!1}const _P=65536;function tm(e,t){const n=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];return e.src.slice(n,s)}function wP(e,t){for(let n=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];n<s;n++)if(e.src.charCodeAt(n)===124)return!0;return!1}function kb(e){const t=[],n=e.length;let s=0,o=e.charCodeAt(s),i=!1,r=0,l="";for(;s<n;)o===124&&(i?(l+=e.substring(r,s-1),r=s):(t.push(l+e.substring(r,s)),l="",r=s+1)),i=o===92,s++,o=e.charCodeAt(s);return t.push(l+e.substring(r)),t}function SP(e,t,n,s){if(t+2>n)return!1;let o=t+1;if(e.sCount[o]<e.blkIndent||e.sCount[o]-e.blkIndent>=4)return!1;let i=e.bMarks[o]+e.tShift[o];if(i>=e.eMarks[o])return!1;const r=e.src.charCodeAt(i++);if(r!==124&&r!==45&&r!==58||i>=e.eMarks[o])return!1;const l=e.src.charCodeAt(i++);if(l!==124&&l!==45&&l!==58&&!em(l)||r===45&&em(l)||!wP(e,t))return!1;for(;i<e.eMarks[o];){const v=e.src.charCodeAt(i);if(v!==124&&v!==45&&v!==58&&!em(v))return!1;i++}let a=tm(e,t+1),c=a.split("|");const u=[];for(let v=0;v<c.length;v++){const _=c[v].trim();if(!_){if(v===0||v===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(_))return!1;_.charCodeAt(_.length-1)===58?u.push(_.charCodeAt(0)===58?"center":"right"):_.charCodeAt(0)===58?u.push("left"):u.push("")}if(a=tm(e,t).trim(),e.sCount[t]-e.blkIndent>=4)return!1;c=kb(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop();const d=c.length;if(d===0||d!==u.length)return!1;if(s)return!0;const h=e.parentType;e.parentType="table";const p=e.md.block.ruler.getRulesForState(e,"blockquote"),f=e.push("table_open","table",1),g=[t,0];f.map=g;const w=e.push("thead_open","thead",1);w.map=[t,t+1];const S=e.push("tr_open","tr",1);S.map=[t,t+1];for(let v=0;v<c.length;v++){const _=e.push("th_open","th",1);u[v]&&(_.attrs=[["style",`text-align:${u[v]}`]]);const I=e.push("inline","",0);I.content=c[v].trim(),I.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let y,k=0;for(o=t+2;o<n&&!(e.sCount[o]<e.blkIndent);o++){let v=!1;for(let I=0,A=p.length;I<A;I++)if(p[I](e,o,n,!0)){v=!0;break}if(v||(a=tm(e,o).trim(),!a)||e.sCount[o]-e.blkIndent>=4||(c=kb(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop(),k+=d-c.length,k>_P))break;if(o===t+2){const I=e.push("tbody_open","tbody",1);I.map=y=[t+2,0]}const _=e.push("tr_open","tr",1);_.map=[o,o+1];for(let I=0;I<d;I++){const A=e.push("td_open","td",1);u[I]&&(A.attrs=[["style",`text-align:${u[I]}`]]);const b=e.push("inline","",0);b.content=c[I]?c[I].trim():"",b.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return y&&(e.push("tbody_close","tbody",-1),y[1]=o),e.push("table_close","table",-1),g[1]=o,e.parentType=h,e.line=o,!0}var CP=class{_rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t,n){this._rules.push({name:e,enabled:!0,fn:t,alt:n?.alt||[]}),this.invalidateCache()}before(e,t,n,s){const o=this._rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const i=this._rules.findIndex(r=>r.name===t);i>=0&&this._rules.splice(i,1),this._rules.splice(o,0,{name:t,enabled:!0,fn:n,alt:s?.alt||[]}),this.invalidateCache()}after(e,t,n,s){const o=this._rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const i=this._rules.findIndex(r=>r.name===t);i>=0&&this._rules.splice(i,1),this._rules.splice(o+1,0,{name:t,enabled:!0,fn:n,alt:s?.alt||[]}),this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache[t]??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache[t]??[]}getRulesForState(e,t){const n=e?.env;return n&&(Object.prototype.hasOwnProperty.call(n,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(n,"__mdtsProfileRules"))?this.getNamedRules(t).map(({name:s,fn:o})=>(i,r,l,a)=>{const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now(),u=o(i,r,l,a),d=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();return ia(i?.env,"block",s,d-c,u,!!a),u}):this.getRules(t)}at(e,t,n){const s=this._rules.findIndex(o=>o.name===e);if(s===-1)throw new Error(`Parser rule not found: ${e}`);this._rules[s].fn=t,n?.alt&&(this._rules[s].alt=n.alt),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!1;return n.forEach(i=>{const r=this._rules.findIndex(l=>l.name===i);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${i}`)}s.push(i),this._rules[r].enabled||(this._rules[r].enabled=!0,o=!0)}),o&&this.invalidateCache(),s}disable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!1;return n.forEach(i=>{const r=this._rules.findIndex(l=>l.name===i);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${i}`)}s.push(i),this._rules[r].enabled&&(this._rules[r].enabled=!1,o=!0)}),o&&this.invalidateCache(),s}enableOnly(e){const t=new Set(e);let n=!1;for(const s of this._rules){const o=t.has(s.name);s.enabled!==o&&(s.enabled=o,n=!0)}n&&this.invalidateCache()}compileCache(){const e=new Set([""]);for(const s of this._rules)if(s.enabled)for(const o of s.alt)e.add(o);const t=Object.create(null),n=Object.create(null);for(const s of e){const o=[],i=[];for(const r of this._rules)r.enabled&&(s!==""&&!r.alt.includes(s)||(o.push(r.fn),i.push({name:r.name,fn:r.fn})));t[s]=o,n[s]=i}this.cache=t,this.namedCache=n}};function bb(e){switch(e){case 9:case 32:return!0}return!1}var mx=class{src;md;env;tokens;bMarks=[];eMarks=[];tShift=[];sCount=[];bsCount=[];blkIndent=0;line=0;lineMax=0;tight=!1;ddIndent=-1;listIndent=-1;parentType="root";level=0;constructor(e,t,n,s){this.src=e,this.md=t,this.env=n,this.tokens=s;const o=this.src;let i=0,r=0,l=0,a=!1;for(let c=0,u=o.length;c<u;c++){const d=o.charCodeAt(c);if(!a)if(bb(d)){i++,d===9?r+=4-r%4:r++;continue}else a=!0;(d===10||c===u-1)&&(d!==10&&c++,this.bMarks.push(l),this.eMarks.push(c),this.tShift.push(i),this.sCount.push(r),this.bsCount.push(0),a=!1,i=0,r=0,l=c+1)}this.bMarks.push(o.length),this.eMarks.push(o.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}push(e,t,n){if(n===0){const o=new ls(e,t,0);return o.block=!0,o.level=this.level,this.tokens.push(o),o}const s=new ls(e,t,n);return s.block=!0,n<0&&this.level--,s.level=this.level,n>0&&this.level++,this.tokens.push(s),s}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){const t=this.bMarks,n=this.tShift,s=this.eMarks;for(let o=this.lineMax;e<o&&!(t[e]+n[e]<s[e]);e++);return e}skipSpaces(e){const t=this.src;for(let n=t.length;e<n;e++){const s=t.charCodeAt(e);if(s!==9&&s!==32)break}return e}skipSpacesBack(e,t){if(e<=t)return e;const n=this.src;for(;e>t;){const s=n.charCodeAt(--e);if(s!==9&&s!==32)return e+1}return e}skipChars(e,t){const n=this.src;for(let s=n.length;e<s&&n.charCodeAt(e)===t;e++);return e}skipCharsBack(e,t,n){if(e<=n)return e;const s=this.src;for(;e>n;)if(t!==s.charCodeAt(--e))return e+1;return e}getLines(e,t,n,s){if(e>=t)return"";if(e+1===t){const u=e,d=this.bMarks[u];let h=d;const p=s?this.eMarks[u]+1:this.eMarks[u];let f=0;const g=this.src,w=this.bsCount,S=this.tShift;for(;h<p&&f<n;){const y=g.charCodeAt(h);if(y===9||y===32)y===9?f+=4-(f+w[u])%4:f++;else if(h-d<S[u])f++;else break;h++}return f>n?new Array(f-n+1).join(" ")+g.slice(h,p):g.slice(h,p)}const o=new Array(t-e),i=this.src,r=this.bMarks,l=this.eMarks,a=this.bsCount,c=this.tShift;for(let u=0,d=e;d<t;d++,u++){let h=0;const p=r[d];let f=p,g;for(d+1<t||s?g=l[d]+1:g=l[d];f<g&&h<n;){const w=i.charCodeAt(f);if(bb(w))w===9?h+=4-(h+a[d])%4:h++;else if(f-p<c[d])h++;else break;f++}h>n?o[u]=new Array(h-n+1).join(" ")+i.slice(f,g):o[u]=i.slice(f,g)}return o.join("")}};mx.prototype.Token=ls;const ed=[["table",SP,["paragraph","reference"]],["code",lP],["fence",aP,["paragraph","reference","blockquote","list"]],["blockquote",rP,["paragraph","reference","blockquote","list"]],["hr",dP,["paragraph","reference","blockquote","list"]],["list",yP,["paragraph","reference","blockquote"]],["reference",bP],["html_block",fP,["paragraph","reference","blockquote"]],["heading",cP,["paragraph","reference","blockquote"]],["lheading",pP],["paragraph",kP]];var xP=class{ruler;cachedRulesVersion=-1;cachedRules=[];constructor(){this.ruler=new CP;for(let e=0;e<ed.length;e++)this.ruler.push(ed[e][0],ed[e][1],{alt:(ed[e][2]||[]).slice()});this.ruler.__mdtsDefaultVersion=this.ruler.version}tokenize(e,t,n){const s=this.getRules(),o=s.length,i=e.md.options.maxNesting,r=e.bMarks,l=e.tShift,a=e.eMarks,c=e.sCount;let u=t,d=!1;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){for(;u<n;){for(;u<n&&r[u]+l[u]>=a[u];)u++;if(e.line=u,u>=n||c[u]<e.blkIndent)break;if(e.level>=i){e.line=n;break}const p=e.line;let f=!1;for(let g=0;g<o;g++)if(f=s[g](e,u,n,!1),f){if(p>=e.line)throw new Error("block rule didn't increment state.line");break}if(!f)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),u=e.line,u<n&&r[u]+l[u]>=a[u]&&(d=!0,u++,e.line=u)}return}const h=this.ruler.getNamedRules("");for(;u<n;){for(;u<n&&r[u]+l[u]>=a[u];)u++;if(e.line=u,u>=n||c[u]<e.blkIndent)break;if(e.level>=i){e.line=n;break}const p=e.line;let f=!1;for(let g=0;g<o;g++){const w=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();f=h[g].fn(e,u,n,!1);const S=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(ia(e.env,"block",h[g].name,S-w,f,!1),f){if(p>=e.line)throw new Error("block rule didn't increment state.line");break}}if(!f)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),u=e.line,u<n&&r[u]+l[u]>=a[u]&&(d=!0,u++,e.line=u)}}parse(e,t,n,s){if(!e||e.length===0)return;const o=new mx(e,t,n,s);this.tokenize(o,o.line,o.lineMax)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}},gx=class{src;env;tokens;inlineMode;md;constructor(e,t,n={}){this.src=typeof e=="string"?e||"":e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}};gx.prototype.Token=ls;const _b=[["normalize",jO],["block",WL],["inline",PO],["linkify",WO],["replacements",ZO],["smartquotes",tP],["text_join",nP]],TP={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:100},MP={parseLinkLabel:av,parseLinkDestination:lv,parseLinkTitle:cv};function AP(){return{...TP}}function EP(){return{...MP}}var IP=class{fallbackParser;lastState=null;block;inline;ruler;linkifyInstance=null;cachedCoreRulesVersion=-1;cachedCoreRules=[];cachedCoreNamedRulesVersion=-1;cachedCoreNamedRules=[];constructor(){this.block=new xP,this.inline=new OO,this.ruler=new JO;for(let e=0;e<_b.length;e++){const[t,n]=_b[e];this.ruler.push(t,n)}this.fallbackParser={block:this.block,inline:this.inline,core:this,options:AP(),helpers:EP(),normalizeLink:ux,normalizeLinkText:dx,validateLink:cx,linkify:null}}resolveParser(e){return e||(this.linkifyInstance||(this.linkifyInstance=new zC),this.fallbackParser.block!==this.block&&(this.fallbackParser.block=this.block),this.fallbackParser.inline!==this.inline&&(this.fallbackParser.inline=this.inline),this.fallbackParser.core=this,this.fallbackParser.linkify=this.linkifyInstance,this.fallbackParser)}createState(e,t={},n){return new gx(e,this.resolveParser(n),t)}getCoreRules(){return this.cachedCoreRulesVersion!==this.ruler.version&&(this.cachedCoreRules=this.ruler.getRules(""),this.cachedCoreRulesVersion=this.ruler.version),this.cachedCoreRules}getCoreNamedRules(){return this.cachedCoreNamedRulesVersion!==this.ruler.version&&(this.cachedCoreNamedRules=this.ruler.getNamedRules(""),this.cachedCoreNamedRulesVersion=this.ruler.version),this.cachedCoreNamedRules}process(e){if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){const n=this.getCoreRules();for(let s=0;s<n.length;s++)n[s](e);return}const t=this.getCoreNamedRules();for(let n=0;n<t.length;n++){const s=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();t[n].fn(e);const o=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();ia(e.env,"core",t[n].name,o-s,!0,!1)}NO(e.env)}parseSource(e,t={},n){if(typeof e!="string"&&HL(e))return this.parse(YC(e),t,n);const s=this.createState(e,t,n);return this.process(s),this.lastState=s,s}parse(e,t={},n){if(typeof e!="string")throw new TypeError("Input data should be a String");return this.parseSource(e,t,n)}getTokens(){return this.lastState?this.lastState.tokens:[]}};const $P={maxChunkChars:1e4,maxChunkLines:200,fenceAware:!0,maxChunks:void 0,fallbackOnGlobalState:!0};function gf(e,t,n={},s){Zs(n);const o={...$P,...s||{}},i=fs(t);if(o.fallbackOnGlobalState!==!1&&i)return Qp(n,{count:1,fallback:!0,fallbackReason:i,globalStateDetected:i,maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines}),oa(n,i,()=>e.core.parse(t,n,e).tokens);let r=Sd(t,o);if(o.maxChunks&&r.length>o.maxChunks&&(r=PP(r,o.maxChunks)),Cd(t,r))return Qp(n,{count:1,fallback:!0,fallbackReason:"unsafe-chunk-boundary",maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines}),oa(n,i,()=>e.core.parse(t,n,e).tokens);let l=0;const a=[];return Qp(n,{count:r.length,maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines,globalStateDetected:i||void 0,globalStateFallbackDisabled:o.fallbackOnGlobalState===!1&&!!i}),oa(n,i,()=>{for(let c=0;c<r.length;c++){const u=r[c],d=t.slice(u.start,u.end),h=e.core.parse(d,n,e).tokens;l!==0&&h.length&&LP(h,l),OP(a,h),l+=u.lineCount}return a})}function Sd(e,t,n=!0){const s=[];let o=0,i=0,r=0,l=0,a=0,c=0,u=null;function d(h){h<=r||(s.push({start:r,end:h,lineCount:l}),r=h,o=0,i=0,l=0)}for(let h=0;h<e.length;){let p=e.indexOf(`
|
|
51
|
-
`,h),f=p;p===-1?(p=e.length,f=e.length):f=p+1;const g=RP(e,h,p);if(t.fenceAware){let y=h;for(;y<p;){const v=e.charCodeAt(y);if(v===32||v===9)y++;else break}const k=e[y];if(k==="`"||k==="~"){let v=y;for(;v<p&&e[v]===k;)v++;const _=v-y;_>=3&&(u?u.marker===k&&_>=u.length&&(u=null):u={marker:k,length:_})}}const w=f-h;o+=w,i+=1,l+=1,g?(a=0,c=0):(a+=1,c+=w);const S=g;if((o>=t.maxChunkChars||i>=t.maxChunkLines)&&!u)if(S)d(f);else{const y=Math.max(10,Math.floor(t.maxChunkLines*.5)),k=Math.max(t.maxChunkChars,8e3);(a>=y||c>=k)&&d(f)}h=f}return n&&d(e.length),s}function Cd(e,t,n={rangesCoverWholeSource:!0}){const s=n.rangesCoverWholeSource?t.length-1:t.length;for(let o=0;o<s;o++)if(!NP(e,t[o].end))return!0;return!1}function NP(e,t){if(t<=0||t>e.length||e.charCodeAt(t-1)!==10)return!1;let n=t-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;for(let s=n+1;s<t-1;s++){const o=e.charCodeAt(s);if(o!==32&&o!==9&&o!==13)return!1}return!0}function LP(e,t){if(t===0)return;const n=[];for(let s=e.length-1;s>=0;s--)n.push(e[s]);for(;n.length;){const s=n.pop();if(s.map&&(s.map[0]+=t,s.map[1]+=t),s.children)for(let o=s.children.length-1;o>=0;o--)n.push(s.children[o])}}function OP(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function PP(e,t){if(e.length<=t)return e;const n=[];let s=0;for(let o=0;o<t;o++){const i=t-o,r=e.length-s,l=Math.ceil(r/i),a=e.slice(s,s+l);let c=0;for(let u=0;u<a.length;u++)c+=a[u].lineCount;n.push({start:a[0].start,end:a[a.length-1].end,lineCount:c}),s+=l}return n}function RP(e,t,n){for(let s=t;s<n;s++){const o=e.charCodeAt(s);if(o!==32&&o!==9&&o!==13)return!1}return!0}const vx=4e6,yx=8e4,DP=1e4,BP=200,FP=1e4,HP=200;function kx(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function WP(e,t){if(t===0)return;const n=[];for(let s=e.length-1;s>=0;s--)n.push(e[s]);for(;n.length;){const s=n.pop();if(s.map&&(s.map[0]+=t,s.map[1]+=t),s.children)for(let o=s.children.length-1;o>=0;o--)n.push(s.children[o])}}function Zi(e){return e.length===0?0:xn(e)+(e.charCodeAt(e.length-1)===10?0:1)}function UP(e,t,n){for(let s=t;s<n;s++){const o=e.charCodeAt(s);if(o!==32&&o!==9&&o!==13)return!1}return!0}function qP(e,t){if(!t||e.length===0)return!1;let n=null;for(let s=0;s<e.length;){let o=e.indexOf(`
|
|
52
|
-
`,s);o===-1&&(o=e.length);let i=s;for(;i<o;){const l=e.charCodeAt(i);if(l===32||l===9)i++;else break}const r=e[i];if(r==="`"||r==="~"){let l=i;for(;l<o&&e[l]===r;)l++;const a=l-i;a>=3&&(n?n.marker===r&&a>=n.length&&(n=null):n={marker:r,length:a})}s=o===e.length?e.length:o+1}return n!==null}function jP(e,t){if(e.length===0||e.charCodeAt(e.length-1)!==10)return!1;let n=e.length-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;return UP(e,n+1,e.length-1)?!qP(e,t):!1}function zP(e,t,n,s={}){const o=s.mode??"full",i=s.fenceAware??(o==="stream"?e.options.streamChunkFenceAware??!0:e.options.fullChunkFenceAware??!0);if(s.maxChunkChars!==void 0||s.maxChunkLines!==void 0||s.autoTune===!1){const r=s.maxChunkChars??(o==="stream"?e.options.streamChunkSizeChars??FP:e.options.fullChunkSizeChars??DP),l=s.maxChunkLines??(o==="stream"?e.options.streamChunkSizeLines??HP:e.options.fullChunkSizeLines??BP);return{maxChunkChars:r,maxChunkLines:l,holdBelowChars:r,holdBelowLines:l,fenceAware:i}}return o==="stream"?t<=5e3?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:i}:t<=2e4?{maxChunkChars:16e3,maxChunkLines:200,holdBelowChars:16e3,holdBelowLines:200,fenceAware:i}:t<=5e4?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:i}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:i}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:i}:t<=1e5&&n<=2500?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:1e5,holdBelowLines:2500,fenceAware:i}:t<=2e5?{maxChunkChars:2e4,maxChunkLines:150,holdBelowChars:2e4,holdBelowLines:150,fenceAware:i}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:i}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:i}}var ru=class{md;options;pending="";tokens=[];committedChars=0;committedLines=0;fedChunks=0;parsedChunks=0;globalStateEnv=null;markedGlobalStateReason=null;constructor(e,t={}){if(this.md=e,this.options={mode:"full",autoTune:!0,retainTokens:!0,...t},this.options.retainTokens===!1&&!this.options.onChunkTokens)throw new Error("UnboundedBuffer with retainTokens=false requires onChunkTokens")}feed(e){e&&(this.pending+=e,this.fedChunks+=1)}flushAvailable(e={}){if(!this.pending)return null;const t=this.resolveWindow(),n=Zi(this.pending);if(this.pending.length<t.holdBelowChars&&n<t.holdBelowLines)return this.updateEnvDiagnostics(e,t,n),null;const s=Sd(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!1);if(!s.length)return this.updateEnvDiagnostics(e,t,n),null;if(Cd(this.pending,s,{rangesCoverWholeSource:!1}))return this.updateEnvDiagnostics(e,t,n),null;const o=this.commitRanges(s,e);return this.pending=this.pending.slice(o),this.updateEnvDiagnostics(e,t,Zi(this.pending)),this.tokens}flushIfBoundary(e={}){if(!this.pending)return null;const t=this.resolveWindow();if(!jP(this.pending,t.fenceAware))return this.updateEnvDiagnostics(e,t,Zi(this.pending)),null;const n=Sd(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(!n.length)return this.updateEnvDiagnostics(e,t,Zi(this.pending)),null;const s=Cd(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:Zi(this.pending)}]:n;return this.commitRanges(s,e),this.pending="",this.updateEnvDiagnostics(e,t,0),this.tokens}flushForce(e={}){if(!this.pending){this.prepareGlobalStateEnv(e,"");const s=this.resolveWindow();return this.updateEnvDiagnostics(e,s,0),this.tokens}const t=this.resolveWindow(),n=Sd(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(n.length){const s=Cd(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:Zi(this.pending)}]:n;this.commitRanges(s,e),this.pending=""}return this.updateEnvDiagnostics(e,t,0),this.tokens}reset(){this.pending="",this.tokens=[],this.committedChars=0,this.committedLines=0,this.fedChunks=0,this.parsedChunks=0,this.globalStateEnv=null,this.markedGlobalStateReason=null}peek(){return this.tokens}pendingText(){return this.pending}stats(){return{mode:this.options.mode??"full",fedChunks:this.fedChunks,parsedChunks:this.parsedChunks,committedChars:this.committedChars,committedLines:this.committedLines,pendingChars:this.pending.length,pendingLines:Zi(this.pending),retainedTokens:this.options.retainTokens!==!1}}resolveWindow(){const e=this.committedChars+this.pending.length,t=this.committedLines+Zi(this.pending);return zP(this.md,e,t,this.options)}prepareGlobalStateEnv(e,t){if(this.globalStateEnv!==e&&(iu(e)&&Ri(e),this.globalStateEnv=e,this.markedGlobalStateReason=null),this.markedGlobalStateReason)return;const n=fs(t);n&&(iv(e,n),this.markedGlobalStateReason=n)}commitRanges(e,t){if(!e.length)return 0;this.prepareGlobalStateEnv(t,this.pending);let n=0;try{for(let s=0;s<e.length;s++){const o=e[s],i=this.pending.slice(o.start,o.end),r=this.md.core.parse(i,t,this.md).tokens,l=this.committedChars,a=this.committedLines;a!==0&&r.length&&WP(r,a),this.options.retainTokens!==!1&&kx(this.tokens,r),this.committedChars+=i.length,this.committedLines+=o.lineCount,this.parsedChunks+=1,this.options.onChunkTokens&&this.options.onChunkTokens(r,{chunkIndex:this.parsedChunks,chunkChars:i.length,chunkLines:o.lineCount,tokenCount:r.length,startOffset:l,endOffset:this.committedChars,startLine:a,endLine:this.committedLines}),n=o.end}return this.markedGlobalStateReason&&rv(t),n}catch(s){throw this.markedGlobalStateReason&&(Ri(t),this.globalStateEnv=null,this.markedGlobalStateReason=null),s}}updateEnvDiagnostics(e,t,n){qC(e,{mode:this.options.mode??"full",maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,committedChars:this.committedChars,committedLines:this.committedLines,pendingChars:this.pending.length,pendingLines:n,fedChunks:this.fedChunks,parsedChunks:this.parsedChunks,globalStateDetected:this.markedGlobalStateReason||void 0})}};function VP(e,t,n={},s={}){Zs(n);const o=new ru(e,{mode:"full",...s});for(const i of t)o.feed(i),o.flushAvailable(n);return o.flushForce(n)}async function KP(e,t,n={},s={}){Zs(n);const o=new ru(e,{mode:"full",...s});for await(const i of t)o.feed(i),o.flushAvailable(n);return o.flushForce(n)}function GP(e,t,n,s={},o={}){Zs(s);const i=new ru(e,{mode:"full",...o,retainTokens:!1,onChunkTokens:n});for(const r of t)i.feed(r),i.flushAvailable(s);return i.flushForce(s),i.stats()}async function YP(e,t,n,s={},o={}){Zs(s);const i=new ru(e,{mode:"full",...o,retainTokens:!1,onChunkTokens:n});for await(const r of t)i.feed(r),i.flushAvailable(s);return i.flushForce(s),i.stats()}function bx(e,t,n){if(e.options.autoUnbounded===!1)return!1;const s=e.options.autoUnboundedThresholdChars??vx,o=e.options.autoUnboundedThresholdLines??yx;return t>=s||n>=o}function _x(e,t,n){if(e.options.autoUnbounded===!1)return"no";if(t>=(e.options.autoUnboundedThresholdChars??vx))return"yes";const s=e.options.autoUnboundedThresholdLines??yx;return n!==void 0?n>=s?"yes":"no":t+1<s?"no":"need-lines"}function yc(e,t,n={},s={}){Zs(n);const o=fs(t);if(iu(n)&&Ri(n),s.fallbackOnGlobalState!==!1&&o)return qC(n,{mode:"full",fallback:!0,fallbackReason:o,committedChars:t.length,committedLines:xn(t),pendingChars:0,pendingLines:0,fedChunks:1,parsedChunks:1,globalStateDetected:o}),oa(n,o,()=>e.core.parse(t,n,e).tokens);const i=[],r=new ru(e,{mode:"full",...s,retainTokens:!1,onChunkTokens(l){kx(i,l)}});if(o&&iv(n,o),r.feed(t),r.flushForce(n),o&&(rv(n),s.fallbackOnGlobalState===!1)){const l=_i(n)?.unbounded;l&&(l.globalStateDetected=o,l.globalStateFallbackDisabled=!0)}return i}const ra=(e,t,n)=>e<t?t:e>n?n:e;function wx(e){return e.experimental?{...e,...e.experimental}:e}const wb=[{max:5e3,strategy:"discrete",maxChunkChars:32e3,maxChunkLines:150,maxChunks:8,notes:"<=5k"},{max:2e4,strategy:"discrete",maxChunkChars:24e3,maxChunkLines:200,maxChunks:12,notes:"<=20k"},{max:1e5,strategy:"plain",notes:"<=100k plain"},{max:2e5,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:150,maxChunks:12,notes:"<=200k"},{max:5e5,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:16,notes:"<=500k"},{max:5e6,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:16,notes:"<=5M"}],Sb=[{max:5e3,strategy:"discrete",maxChunkChars:16e3,maxChunkLines:250,maxChunks:8,notes:"<=5k"},{max:2e4,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:200,maxChunks:24,notes:"<=20k"},{max:1e5,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:200,maxChunks:24,notes:"<=100k"},{max:5e5,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:32,notes:"<=500k"},{max:5e6,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:32,notes:"<=5M"}];function Sx(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function XP(e,t=Math.max(0,e/40|0),n={}){const s=wx(n),o=s.fullChunkFenceAware??!0,i=s.fullChunkTargetChunks??8,r=s.fullChunkAdaptive!==!1;for(let l=0;l<wb.length;l++){const a=wb[l];if(e<=a.max){if(a.strategy!=="adaptive")return Sx(o,a);break}}return e>5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:ra(Math.ceil(e/i),8e3,64e3),maxChunkLines:ra(Math.ceil(t/i),150,700),maxChunks:ra(Math.ceil(e/64e3),i,16),fenceAware:o,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:s.fullChunkSizeChars??1e4,maxChunkLines:s.fullChunkSizeLines??200,fenceAware:o,maxChunks:s.fullChunkMaxChunks}}function Cb(e,t=Math.max(0,e/40|0),n={}){const s=wx(n),o=s.streamChunkFenceAware??!0,i=s.streamChunkTargetChunks??8,r=s.streamChunkAdaptive!==!1;for(let l=0;l<Sb.length;l++){const a=Sb[l];if(e<=a.max){if(a.strategy!=="adaptive")return Sx(o,a);break}}return e>5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:ra(Math.ceil(e/i),8e3,64e3),maxChunkLines:ra(Math.ceil(t/i),150,700),maxChunks:ra(Math.ceil(e/64e3),i,32),fenceAware:o,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:s.streamChunkSizeChars??1e4,maxChunkLines:s.streamChunkSizeLines??200,maxChunks:s.streamChunkMaxChunks,fenceAware:o}}var ZP={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"]},inline2:{rules:["balance_pairs","emphasis","fragments_join"]}}},JP={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},QP={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"]},inline2:{rules:["balance_pairs","fragments_join"]}}};const eR=/[&<>"]/,xb=/[&<>"]/g,tR=/&/g,nR=/[<>"]/g,sR={"&":"&","<":"<",">":">",'"':"""};function nm(e){return sR[e]||e}function hn(e){if(e.length===0)return"";if(e.length<32)return eR.test(e)?e.replace(xb,nm):e;const t=e.includes("&"),n=e.includes("<"),s=e.includes(">"),o=e.includes('"');return!t&&!n&&!s&&!o?e:t&&!n&&!s&&!o?e.replace(tR,"&"):t?e.replace(xb,nm):e.replace(nR,nm)}const oR=new RegExp(`${/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),iR=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function Cx(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(oR,(t,n,s)=>{if(n)return n;if(iR.test(s)){const i=s[1].toLowerCase()==="x"?Number.parseInt(s.slice(2),16):Number.parseInt(s.slice(1),10);return dh(i)?jc(i):"�"}const o=J1(t);return o!==t?o:t})}function mh(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function xd(e,t){if(mh(e))throw new TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}const Tb=e=>mh(e)?e:Promise.resolve(e);function kc(e){switch(e){case"alt":case"class":case"href":case"id":case"lang":case"rel":case"src":case"start":case"style":case"target":case"title":return e;default:return hn(e)}}function _r(e){if(!e||e.length===0)return"";const t=e[0];let n=` ${kc(t[0])}="${hn(t[1])}"`;for(let s=1;s<e.length;s++){const o=e[s];n+=` ${kc(o[0])}="${hn(o[1])}"`}return n}function xx(e){if(!e)return{langName:"",langAttrs:""};let t=0;for(;t<e.length;){const s=e.charCodeAt(t);if(s===32||s===9||s===10)break;t++}if(t>=e.length)return{langName:e,langAttrs:""};let n=t;for(;n<e.length;){const s=e.charCodeAt(n);if(s!==32&&s!==9&&s!==10)break;n++}return{langName:e.slice(0,t),langAttrs:n<e.length?e.slice(n):""}}function bc(e,t,n,s,o){if(t.indexOf("<pre")===0)return`${t}
|
|
53
|
-
`;if(n){if(!e.attrs||e.attrs.length===0)return`<pre><code class="${hn(`${o.langPrefix??"language-"}${s}`)}">${t}</code></pre>
|
|
54
|
-
`;const i=e.attrIndex("class"),r=e.attrs?e.attrs.slice():[],l=`${o.langPrefix??"language-"}${s}`;return i<0?r.push(["class",l]):(r[i]=r[i].slice(),r[i][1]+=` ${l}`),`<pre><code${_r(r)}>${t}</code></pre>
|
|
55
|
-
`}return`<pre><code${_r(e.attrs)}>${t}</code></pre>
|
|
56
|
-
`}function vf(e){return!e.attrs||e.attrs.length===0?`<code>${hn(e.content)}</code>`:`<code${_r(e.attrs)}>${hn(e.content)}</code>`}function Eg(e){const t=hn(e.content);return e.attrs?`<pre${_r(e.attrs)}><code>${t}</code></pre>
|
|
57
|
-
`:`<pre><code>${t}</code></pre>
|
|
58
|
-
`}function rR(e,t){const n=e.attrs;if(!n||n.length===0)switch(e.type){case"paragraph_open":return`${t}<p>`;case"heading_open":return`<${e.tag}>`;case"td_open":return`${t}<td>`;case"th_open":return`${t}<th>`;default:return null}if(n.length===1&&n[0][0]==="style"){if(e.type==="td_open")return`${t}<td style="${hn(n[0][1])}">`;if(e.type==="th_open")return`${t}<th style="${hn(n[0][1])}">`}return null}function Mb(e){const t=e.attrs;return!t||t.length===0?"<a>":t.length===1?`<a ${kc(t[0][0])}="${hn(t[0][1])}">`:t.length===2?`<a ${kc(t[0][0])}="${hn(t[0][1])}" ${kc(t[1][0])}="${hn(t[1][1])}">`:`<a${_r(t)}>`}function lR(e){switch(e.type){case"text":case"text_special":case"softbreak":case"hardbreak":case"html_inline":case"code_inline":case"image":return!0;default:return!1}}function Ab(e){switch(e.type){case"text":case"text_special":case"softbreak":case"hardbreak":case"html_inline":case"code_inline":return!0;default:return!1}}function yf(e,t){if(e.hidden)return"";const n=e.attrs,s=e.nesting,o=e.tag;if(!n||n.length===0)return s===0?t?`<${o} />`:`<${o}>`:s===-1?`</${o}>`:`<${o}>`;let i=(s===-1?"</":"<")+o+_r(n);return s===0&&t&&(i+=" /"),`${i}>`}const aR={langPrefix:"language-",xhtmlOut:!1,breaks:!1},td=Object.prototype.hasOwnProperty,rn={code_inline(e,t){return vf(e[t])},code_block(e,t){return Eg(e[t])},fence(e,t,n,s,o){const i=e[t],r=i.info?Cx(i.info).trim():"",{langName:l,langAttrs:a}=xx(r),c=n.highlight,u=hn(i.content);if(!c)return bc(i,u,r,l,n);const d=c(i.content,l,a);return mh(d)?d.then(h=>bc(i,h||u,r,l,n)):bc(i,d||u,r,l,n)},image(e,t,n,s,o){const i=e[t],r=o.renderInlineAsText(i.children||[],n,s),l=i.attrIndex("alt");return l>=0&&i.attrs?i.attrs[l][1]=r:i.attrs?i.attrs.push(["alt",r]):i.attrs=[["alt",r]],yf(i,n.xhtmlOut===!0)},hardbreak(e,t,n){return n.xhtmlOut?`<br />
|
|
59
|
-
`:`<br>
|
|
60
|
-
`},softbreak(e,t,n){return n.breaks?n.xhtmlOut?`<br />
|
|
61
|
-
`:`<br>
|
|
62
|
-
`:`
|
|
63
|
-
`},text(e,t){return hn(e[t].content)},text_special(e,t){return hn(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function Eb(e,t,n){const s=e.info?Cx(e.info).trim():"",{langName:o,langAttrs:i}=xx(s),r=t.highlight,l=hn(e.content);if(!r)return bc(e,l,s,o,t);const a=r(e.content,o,i);if(mh(a))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return bc(e,a||l,s,o,t)}function nd(e,t,n,s,o,i,r){const l=e[0];switch(l.type){case"text":if(o.text===rn.text)return l.content.length===0?"":hn(l.content);break;case"text_special":if(o.text_special===rn.text_special)return l.content.length===0?"":hn(l.content);break;case"softbreak":if(o.softbreak===rn.softbreak)return r;break;case"hardbreak":if(o.hardbreak===rn.hardbreak)return i;break;case"html_inline":if(o.html_inline===rn.html_inline)return l.content;break;case"code_inline":if(o.code_inline===rn.code_inline)return vf(l);break}const a=o[l.type];if(!a)return yf(l,t.xhtmlOut===!0);const c=a(e,0,t,n,s);return typeof c=="string"?c:xd(c,l.type)}var cR=class{rules;baseOptions;normalizedBase;constructor(e={}){this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={...rn}}set(e){return this.baseOptions={...this.baseOptions,...e},this.normalizedBase=this.buildNormalizedBase(),this}render(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");if(e.length===1)return this.renderSingleToken(e,e[0],t,n);const s=this.mergeOptions(t),o=n??{},i=this.rules,r=s.xhtmlOut===!0;let l,a,c,u,d,h,p="",f="",g=!1,w="";for(let S=0;S<e.length;S++){const y=e[S],k=y.type,v=S>0&&e[S-1].hidden?`
|
|
64
|
-
`:"";if(k==="list_item_open"&&(!y.attrs||y.attrs.length===0)&&S+3<e.length){const A=e[S+1],b=e[S+2],M=e[S+3];if(A.type==="paragraph_open"&&A.hidden&&b.type==="inline"&&M.type==="paragraph_close"&&M.hidden){w+=`${v}<li>${this.renderInlineTokens(b.children||[],s,o)}`,S+=3;continue}}if(S+2<e.length){const A=e[S+1],b=e[S+2];if(A.type==="inline"&&b.nesting===-1&&b.tag===y.tag&&!b.hidden){const M=rR(y,v);if(M!==null){w+=`${M+this.renderInlineTokens(A.children||[],s,o)}</${y.tag}>
|
|
65
|
-
`,S+=2;continue}}}if(k==="inline"){const A=y.children||[];if(A.length===1){g||(l=i.text,a=i.text_special,c=i.softbreak,u=i.hardbreak,d=i.html_inline,h=i.code_inline,p=s.xhtmlOut?`<br />
|
|
66
|
-
`:`<br>
|
|
67
|
-
`,f=s.breaks?p:`
|
|
68
|
-
`,g=!0);const b=A[0];switch(b.type){case"text":if(l===rn.text){w+=hn(b.content);continue}break;case"text_special":if(a===rn.text_special){w+=hn(b.content);continue}break;case"softbreak":if(c===rn.softbreak){w+=f;continue}break;case"hardbreak":if(u===rn.hardbreak){w+=p;continue}break;case"html_inline":if(d===rn.html_inline){w+=b.content;continue}break;case"code_inline":if(h===rn.code_inline){w+=vf(b);continue}break}}w+=this.renderInlineTokens(A,s,o);continue}const _=i[k];if(!_){const A=y.attrs;if(!y.hidden){if(!A||A.length===0)switch(k){case"hr":w+=r?`<hr />
|
|
69
|
-
`:`<hr>
|
|
70
|
-
`;continue;case"heading_open":w+=`<${y.tag}>`;continue;case"heading_close":w+=`</${y.tag}>
|
|
71
|
-
`;continue;case"paragraph_open":w+=`${v}<p>`;continue;case"paragraph_close":w+=`</p>
|
|
72
|
-
`;continue;case"list_item_open":{const b=e[S+1];w+=v+(b&&(b.type==="inline"||b.hidden||b.nesting===-1&&b.tag==="li")?"<li>":`<li>
|
|
73
|
-
`);continue}case"list_item_close":w+=`</li>
|
|
74
|
-
`;continue;case"bullet_list_open":w+=`${v}<ul>
|
|
75
|
-
`;continue;case"bullet_list_close":w+=`</ul>
|
|
76
|
-
`;continue;case"blockquote_open":w+=v+(e[S+1]&&e[S+1].nesting===-1&&e[S+1].tag==="blockquote"?"<blockquote>":`<blockquote>
|
|
77
|
-
`);continue;case"blockquote_close":w+=`</blockquote>
|
|
78
|
-
`;continue;case"ordered_list_open":w+=`${v}<ol>
|
|
79
|
-
`;continue;case"ordered_list_close":w+=`</ol>
|
|
80
|
-
`;continue;case"table_open":w+=`${v}<table>
|
|
81
|
-
`;continue;case"table_close":w+=`</table>
|
|
82
|
-
`;continue;case"thead_open":w+=`${v}<thead>
|
|
83
|
-
`;continue;case"thead_close":w+=`</thead>
|
|
84
|
-
`;continue;case"tbody_open":w+=`${v}<tbody>
|
|
85
|
-
`;continue;case"tbody_close":w+=`</tbody>
|
|
86
|
-
`;continue;case"tr_open":w+=`${v}<tr>
|
|
87
|
-
`;continue;case"tr_close":w+=`</tr>
|
|
88
|
-
`;continue;case"td_open":w+=`${v}<td>`;continue;case"td_close":w+=`</td>
|
|
89
|
-
`;continue;case"th_open":w+=`${v}<th>`;continue;case"th_close":w+=`</th>
|
|
90
|
-
`;continue}else if(A.length===1){const b=A[0];if(k==="ordered_list_open"&&b[0]==="start"){w+=`${v}<ol start="${hn(b[1])}">
|
|
91
|
-
`;continue}if(k==="td_open"&&b[0]==="style"){w+=`${v}<td style="${hn(b[1])}">`;continue}if(k==="th_open"&&b[0]==="style"){w+=`${v}<th style="${hn(b[1])}">`;continue}}}w+=this.renderToken(e,S,s);continue}if(k==="code_block"&&_===rn.code_block){w+=Eg(y);continue}if(k==="fence"&&_===rn.fence){w+=Eb(y,s);continue}if(k==="html_block"&&_===rn.html_block){w+=y.content;continue}const I=_(e,S,s,o,this);typeof I=="string"?w+=I:w+=xd(I,y.type)}return w}async renderAsync(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");const s=this.mergeOptions(t),o=n??{},i=this.rules;let r="";for(let l=0;l<e.length;l++){const a=e[l];if(a.type==="inline"){r+=await this.renderInlineTokensAsync(a.children||[],s,o);continue}const c=i[a.type];c?r+=await Tb(c(e,l,s,o,this)):r+=this.renderToken(e,l,s)}return r}renderInline(e,t,n){const s=this.mergeOptions(t),o=n??{};return this.renderInlineTokens(e,s,o)}async renderInlineAsync(e,t,n){const s=this.mergeOptions(t),o=n??{};return this.renderInlineTokensAsync(e,s,o)}renderInlineAsText(e,t,n){const s=this.mergeOptions(t),o=n??{};return this.renderInlineAsTextInternal(e,s,o)}renderAttrs(e){return _r(e.attrs)}renderToken(e,t,n){const s=e[t];if(s.hidden)return"";const o=s.block,i=s.nesting,r=s.tag,l=s.attrs;let a=!1;if(o&&(a=!0,i===1&&t+1<e.length)){const h=e[t+1];(h.type==="inline"||h.hidden||h.nesting===-1&&h.tag===r)&&(a=!1)}const c=o&&i!==-1&&t>0&&e[t-1].hidden?`
|
|
92
|
-
`:"",u=a?`>
|
|
93
|
-
`:">";if(!l||l.length===0)return i===0?n.xhtmlOut?`${c}<${r} /${u}`:`${c}<${r}${u}`:i===-1?`${c}</${r}${u}`:`${c}<${r}${u}`;let d=c+(i===-1?"</":"<")+r+_r(l);return i===0&&n.xhtmlOut&&(d+=" /"),d+u}mergeOptions(e){const t=this.normalizedBase;if(!e||e.highlight===t.highlight&&e.langPrefix===t.langPrefix&&e.xhtmlOut===t.xhtmlOut&&e.breaks===t.breaks)return t;let n=null;const s=()=>(n||(n={...t}),n);if(td.call(e,"highlight")&&e.highlight!==t.highlight&&(s().highlight=e.highlight),td.call(e,"langPrefix")){const o=e.langPrefix;o!==t.langPrefix&&(s().langPrefix=o)}if(td.call(e,"xhtmlOut")){const o=e.xhtmlOut;o!==t.xhtmlOut&&(s().xhtmlOut=o)}if(td.call(e,"breaks")){const o=e.breaks;o!==t.breaks&&(s().breaks=o)}return n||t}buildNormalizedBase(){return Object.freeze({...aR,...this.baseOptions})}renderSingleToken(e,t,n,s){const o=this.rules,i=t.type;if(i==="code_block"&&o.code_block===rn.code_block)return Eg(t);if(i==="html_block"&&o.html_block===rn.html_block)return t.content;const r=this.mergeOptions(n),l=s??{};if(i==="inline")return this.renderInlineTokens(t.children||[],r,l);const a=o[i];if(!a)return t.block?this.renderToken(e,0,r):yf(t,r.xhtmlOut===!0);if(i==="fence"&&a===rn.fence)return Eb(t,r);const c=a(e,0,r,l,this);return typeof c=="string"?c:xd(c,i)}renderInlineTokens(e,t,n){if(!e||e.length===0)return"";const s=this.rules,o=s.text,i=s.text_special,r=s.softbreak,l=s.hardbreak,a=s.html_inline,c=s.code_inline,u=s.link_open,d=s.link_close,h=s.em_open,p=s.em_close,f=s.strong_open,g=s.strong_close,w=t.xhtmlOut===!0,S=w?`<br />
|
|
94
|
-
`:`<br>
|
|
95
|
-
`,y=t.breaks?S:`
|
|
96
|
-
`;if(e.length===1)return nd(e,t,n,this,s,S,y);let k="";for(let v=0;v<e.length;v++){const _=e[v];if(_.type==="link_open"&&!u&&!d&&v+2<e.length){const b=e[v+1];if(e[v+2].type==="link_close"&&lR(b)){const M=`${Mb(_)+nd([b],t,n,this,s,S,y)}</a>`;if(r===rn.softbreak&&v+3<e.length&&e[v+3].type==="softbreak"){k+=M+y,v+=3;continue}k+=M,v+=2;continue}}if(_.type==="link_open"&&!u&&!d&&v+1<e.length&&e[v+1].type==="link_close"){k+=`${Mb(_)}</a>`,v+=1;continue}if(_.type==="em_open"&&!h&&!p&&v+2<e.length){const b=e[v+1];if(e[v+2].type==="em_close"&&Ab(b)){k+=`<em>${nd([b],t,n,this,s,S,y)}</em>`,v+=2;continue}}if(_.type==="strong_open"&&!f&&!g&&v+2<e.length){const b=e[v+1];if(e[v+2].type==="strong_close"&&Ab(b)){k+=`<strong>${nd([b],t,n,this,s,S,y)}</strong>`,v+=2;continue}}switch(_.type){case"text":if(o===rn.text){const b=_.content.length===0?"":hn(_.content);if(a===rn.html_inline&&v+1<e.length&&e[v+1].type==="html_inline"){for(k+=b+e[++v].content;v+1<e.length&&e[v+1].type==="html_inline";)k+=e[++v].content;continue}k+=b;continue}break;case"text_special":if(i===rn.text_special){_.content.length!==0&&(k+=hn(_.content));continue}break;case"softbreak":if(r===rn.softbreak){k+=y;continue}break;case"hardbreak":if(l===rn.hardbreak){k+=S;continue}break;case"html_inline":if(a===rn.html_inline){for(k+=_.content;v+1<e.length&&e[v+1].type==="html_inline";)k+=e[++v].content;continue}break;case"code_inline":if(c===rn.code_inline){k+=vf(_);continue}break}const I=s[_.type];if(!I){k+=_.block?this.renderToken(e,v,t):yf(_,w);continue}const A=I(e,v,t,n,this);typeof A=="string"?k+=A:k+=xd(A,_.type)}return k}async renderInlineTokensAsync(e,t,n){if(!e||e.length===0)return"";const s=this.rules;let o="";for(let i=0;i<e.length;i++){const r=s[e[i].type];r?o+=await Tb(r(e,i,t,n,this)):o+=this.renderToken(e,i,t)}return o}renderInlineAsTextInternal(e,t,n){if(!e||e.length===0)return"";let s="";for(let o=0;o<e.length;o++){const i=e[o];switch(i.type){case"text":case"text_special":s+=i.content;break;case"image":s+=this.renderInlineAsTextInternal(i.children||[],t,n);break;case"html_inline":case"html_block":s+=i.content;break;case"softbreak":case"hardbreak":s+=`
|
|
97
|
-
`;break}}return s}},uR=cR;const dR=[];function Ib(){return{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}}var fR=class{core;cache=null;stats=Ib();MIN_SIZE_FOR_OPTIMIZATION=1e3;DEFAULT_SKIP_CACHE_CHARS=1e6;DEFAULT_SKIP_CACHE_LINES=1e5;IMPLICIT_STREAM_CHUNK_MIN_CHARS=16e4;MIN_LIST_LINES_FOR_MERGE=80;MIN_LIST_CHARS_FOR_MERGE=800;MIN_TABLE_LINES_FOR_MERGE=48;MIN_TABLE_CHARS_FOR_MERGE=1200;MIN_UNBOUNDED_APPEND_TOTAL_CHARS=5e5;MIN_UNBOUNDED_APPEND_CHARS=64e3;MIN_UNBOUNDED_APPEND_LINES=700;constructor(e){this.core=e}reset(){this.cache=null,this.stats.resets+=1,this.stats.lastMode="reset"}resetStats(){const{resets:e}=this.stats;this.stats=Ib(),this.stats.resets=e}parse(e,t,n){const s=t,o=this.cache;if(Zs(s??o?.env),!o||s&&s!==o.env){const $=s??{},O=!!n.__explicitStreamChunkFallbackSetting,P=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,R=!!n.options?.streamChunkedFallback,F=!O&&P,V=R||F,K=n.options?.streamChunkAdaptive!==!1,Z=n.options?.streamChunkTargetChunks??8,G=n.options?.streamChunkSizeChars,X=n.options?.streamChunkSizeLines,pe=n.options?.streamChunkMaxChunks,oe=!!n.__explicitStreamChunkConfig,ye=n.options?.autoTuneChunks!==!1,_e=n.options?.streamChunkFenceAware??!0,de=n.options?.streamSkipCacheAboveChars??this.DEFAULT_SKIP_CACHE_CHARS,be=n.options?.streamSkipCacheAboveLines??this.DEFAULT_SKIP_CACHE_LINES;let xe,Le=e.length>=de;if(!Le&&be!==void 0&&(xe=xn(e),Le=xe>=be),Le){const ke=this.parseFullDocument(e,$,n,xe,!1);return this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",os($,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!_i($)?.unbounded}),ke.tokens}else if(V){const ke=(U,Y,ce)=>U<Y?Y:U>ce?ce:U;xe===void 0&&(xe=xn(e));const ge=ye&&!oe?Cb(e.length,xe,n.options):null,W=ge?.maxChunkChars??(K?ke(Math.ceil(e.length/Z),8e3,64e3):G??1e4),J=ge?.maxChunkLines??(K?ke(Math.ceil(xe/Z),150,700):X??200),ue=ge?.maxChunks??(K?ke(Math.ceil(e.length/64e3),Z,32):pe),ie=e.length>0&&e.charCodeAt(e.length-1)===10,ae=F&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&ge?.strategy!=="plain";if((R||ae)&&(e.length>=W*2||xe>=J*2)&&ie){const U=gf(n,e,$,{maxChunkChars:W,maxChunkLines:J,fenceAware:ge?.fenceAware??_e,maxChunks:ue});return this.cache={src:e,tokens:U,env:$,lineCount:xe,lastSegment:void 0,globalStateReason:fs(e)},this.updateCacheLineCount(this.cache,xe),this.recordChunkedParseResult($,R?"explicit-initial-large-doc":"default-initial-large-doc"),U}}const ee=this.parseFullDocument(e,$,n,xe);return xe=ee.lineCount,this.cache={src:e,tokens:ee.tokens,env:$,lineCount:xe,lastSegment:void 0,globalStateReason:fs(e)},this.updateCacheLineCount(this.cache,xe),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",os($,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!_i($)?.unbounded}),ee.tokens}if(e===o.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode="cache",os(o.env,{area:"stream",path:"stream-cache",reason:"same-source"}),o.tokens;let i=o.globalStateReason;i===void 0&&(i=fs(o.src),o.globalStateReason=i);const r=fs(e),l=i||r;if(l){const $=s??o.env;Ri($);const O=this.parseFullDocument(e,$,n),P=O.tokens,R=O.lineCount;return this.cache={src:e,tokens:P,env:$,lineCount:R,lastSegment:void 0,globalStateReason:r},this.updateCacheLineCount(this.cache,R),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",os($,{area:"stream",path:"stream-full",reason:`global-state:${l}`,unbounded:!!_i($)?.unbounded}),P}const a=n.options?.streamOptimizationMinSize??this.MIN_SIZE_FOR_OPTIMIZATION;if(o.src.length<a&&e.length<a*1.5&&!e.startsWith(o.src)){const $=s??o.env,O=this.parseFullDocument(e,$,n),P=O.tokens,R=O.lineCount;return this.cache={src:e,tokens:P,env:$,lineCount:R,lastSegment:void 0,globalStateReason:fs(e)},this.updateCacheLineCount(this.cache,R),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",os($,{area:"stream",path:"stream-full",reason:"small-non-append",unbounded:!!_i($)?.unbounded}),P}const c=this.getAppendedSegment(o.src,e);if(c&&!this.shouldPreferTailReparseForAppend(o)){let K=function(_e){const de=_e.length;let be=0;for(;be<=de;){let xe=_e.indexOf(`
|
|
98
|
-
`,be);xe===-1&&(xe=de);const Le=xe<de;let ee=be,ke=0;for(;ee<xe;){const ge=_e.charCodeAt(ee);if(ge===32){if(ke++,ee++,ke>=4)return!0;continue}if(ge===9){if(ke+=4-ke%4,ee++,ke>=4)return!0;continue}break}if(ee<xe){const ge=_e.charCodeAt(ee);switch(ge){case 35:{let W=ee;for(;W<xe&&_e.charCodeAt(W)===35;)W++;const J=W-ee;if(J>0&&J<=6){if(W<xe){const ue=_e.charCodeAt(W);if(ue===32||ue===9||ue===13)return!0}else if(W===xe&&Le)return!0}break}case 62:{const W=ee+1;if(W<xe){const J=_e.charCodeAt(W);if(J===32||J===9||J===13)return!0}else if(W===xe&&Le)return!0;break}case 45:case 42:case 43:{const W=ee+1;if(W<xe){const J=_e.charCodeAt(W);if(J===32||J===9||J===13)return!0}else if(W===xe&&Le)return!0;break}case 96:case 126:{let W=ee;for(;W<xe&&_e.charCodeAt(W)===ge;)W++;if(W-ee>=3)return!0;break}default:if(ge>=48&&ge<=57){let W=ee+1;for(;W<xe;){const J=_e.charCodeAt(W);if(J<48||J>57)break;W++}if(W<xe&&_e.charCodeAt(W)===46){const J=W+1;if(J<xe){const ue=_e.charCodeAt(J);if(ue===32||ue===9||ue===13)return!0}else if(J===xe&&Le)return!0}}break}}if(xe===de)break;be=xe+1}return!1};const $=o.lineCount??xn(o.src);let O=3;c.length>5e3?O=8:c.length>1e3?O=6:c.length>200&&(O=4),O=Math.min(O,$);let P=null;const R=n.options?.streamContextParseStrategy??"chars",F=n.options?.streamContextParseMinChars??200,V=n.options?.streamContextParseMinLines??2;let Z=null;const G=()=>(Z===null&&(Z=xn(c)),Z),X=this.canDirectlyParseAppend(o),pe=X&&this.shouldUseUnboundedAppend(e,o,c);let oe=!1;if(!X)switch(R){case"lines":oe=G()>=V;break;case"constructs":if(c.length>=F){oe=!0;break}if(K(c)){oe=!0;break}oe=G()>=V;break;case"chars":default:oe=c.length>=F}if(O>0&&oe){const _e=this.getTailLines(o.src,O)+c;try{const de=this.core.parse(_e,o.env,n).tokens,be=de.findIndex(xe=>xe.map&&typeof xe.map[1]=="number"&&xe.map[1]>O);if(be!==-1){const xe=de.slice(be),Le=$-O;Le!==0&&this.shiftTokenLines(xe,Le),P={tokens:xe}}}catch{P=null}}else P=null;if(!P){const _e=$;if(pe)P={tokens:yc(n,c,o.env,{mode:"stream"})},_e>0&&this.shiftTokenLines(P.tokens,_e);else{const de=this.core.parse(c,o.env,n);_e>0&&this.shiftTokenLines(de.tokens,_e),P=de}}if(o.tokens.length>0&&P.tokens.length>0){const _e=o.tokens[o.tokens.length-1],de=P.tokens[0];try{_e.type==="inline"&&de.type==="inline"&&(de.children&&de.children.length>0&&(_e.children||(_e.children=[]),this.appendTokens(_e.children,de.children)),_e.content=(_e.content||"")+(de.content||""),P.tokens.shift())}catch{}}const ye=o.tokens.length;if(P.tokens.length>0){let xe=function(ge,W){if(!ge&&!W)return!0;if(!ge||!W||ge.length!==W.length)return!1;for(let J=0;J<ge.length;J++)if(ge[J][0]!==W[J][0]||ge[J][1]!==W[J][1])return!1;return!0},Le=function(ge,W){if(!ge&&!W)return!0;if(!ge||!W||ge.length!==W.length)return!1;for(let J=0;J<ge.length;J++)if(!ee(ge[J],W[J]))return!1;return!0},ee=function(ge,W){if(!ge||!W||ge.type!==W.type)return!1;const J=ge.map,ue=W.map;return!!J!=!!ue||J&&ue&&(J[0]!==ue[0]||J[1]!==ue[1])||ge.tag!==W.tag||ge.nesting!==W.nesting||ge.markup!==W.markup||ge.info!==W.info||ge.block!==W.block||ge.hidden!==W.hidden||!xe(ge.attrs,W.attrs)||!Le(ge.children,W.children)?!1:(ge.type==="inline",(ge.content||"")===(W.content||""))};const _e=o.tokens,de=P.tokens,be=Math.min(_e.length,de.length);let ke=0;for(let ge=be;ge>0;ge--){let W=!0;for(let J=0;J<ge;J++){const ue=_e[_e.length-ge+J],ie=de[J];if(!ee(ue,ie)){W=!1;break}}if(W){ke=ge;break}}ke>0&&de.splice(0,ke),de.length>0&&this.appendTokens(o.tokens,de)}if(o.src=e,o.globalStateReason=fs(e),o.lineCount=$+(Z??xn(c)),o.tokens.length>ye){const _e=this.getLastSegment(o.tokens.slice(ye),e);_e?o.lastSegment={tokenStart:ye+_e.tokenStart,tokenEnd:ye+_e.tokenEnd,lineStart:_e.lineStart,lineEnd:_e.lineEnd,srcOffset:_e.srcOffset}:o.lastSegment=void 0}else o.lastSegment=void 0;return this.stats.total+=1,this.stats.appendHits+=1,pe&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode="append",os(o.env,{area:"stream",path:pe?"stream-unbounded-append":"stream-append",reason:pe?"large-delta":"safe-append",unbounded:pe}),o.tokens}const u=s??o.env,d=this.tryTailSegmentReparse(e,o,u,n);if(d)return this.stats.total+=1,this.stats.tailHits+=1,this.stats.lastMode="tail",os(u,{area:"stream",path:"stream-tail",reason:"tail-reparse"}),d;const h=!!n.__explicitStreamChunkFallbackSetting,p=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,f=!!n.options?.streamChunkedFallback,g=!h&&!c&&p,w=f||g,S=n.options?.streamChunkAdaptive!==!1,y=n.options?.streamChunkTargetChunks??8,k=n.options?.streamChunkSizeChars,v=n.options?.streamChunkSizeLines,_=n.options?.streamChunkMaxChunks,I=!!n.__explicitStreamChunkConfig,A=n.options?.autoTuneChunks!==!1,b=n.options?.streamChunkFenceAware??!0;let M=c&&o.lineCount!==void 0?o.lineCount+xn(c):void 0;if(w){M===void 0&&(M=xn(e));const $=(Z,G,X)=>Z<G?G:Z>X?X:Z,O=A&&!I?Cb(e.length,M,n.options):null,P=O?.maxChunkChars??(S?$(Math.ceil(e.length/y),8e3,64e3):k??1e4),R=O?.maxChunkLines??(S?$(Math.ceil(M/y),150,700):v??200),F=O?.maxChunks??(S?$(Math.ceil(e.length/64e3),y,32):_),V=e.length>0&&e.charCodeAt(e.length-1)===10,K=g&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&O?.strategy!=="plain";if((f||K)&&(e.length>=P*2||M>=R*2)&&V){const Z=gf(n,e,u,{maxChunkChars:P,maxChunkLines:R,fenceAware:O?.fenceAware??b,maxChunks:F});return this.cache={src:e,tokens:Z,env:u,lineCount:M,lastSegment:void 0,globalStateReason:fs(e)},this.updateCacheLineCount(this.cache,M),this.recordChunkedParseResult(u,f?"explicit-fallback-large-doc":"default-fallback-large-doc"),Z}}const N=this.parseFullDocument(e,u,n,M),D=N.tokens;return M=N.lineCount,this.cache={src:e,tokens:D,env:u,lineCount:M,lastSegment:void 0,globalStateReason:fs(e)},this.updateCacheLineCount(this.cache,M),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",os(u,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!_i(u)?.unbounded}),D}recordChunkedParseResult(e,t){const n=_i(e)?.chunk,s=n?.fallback?String(n.fallbackReason||"global-state"):null;if(this.stats.total+=1,s){this.stats.fullParses+=1,this.stats.lastMode="full",os(e,{area:"stream",path:"stream-full",reason:`global-state:${s}`,unbounded:!!_i(e)?.unbounded});return}this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode="chunked",os(e,{area:"stream",path:"stream-chunked",chunked:!0,reason:t})}parseFullDocument(e,t,n,s,o=!0){const i=fs(e);iu(t)&&Ri(t);const r=typeof n.__canUseImplicitLargeInputStrategy!="function"||n.__canUseImplicitLargeInputStrategy()?_x(n,e.length,s):"no";if(r==="yes"){const a=yc(n,e,t);return os(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-char-threshold",unbounded:!0}),{tokens:a,lineCount:s??(o?xn(e):0)}}let l=s;if(r==="need-lines"&&(l=xn(e),bx(n,e.length,l))){const a=yc(n,e,t);return os(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-line-threshold",unbounded:!0}),{tokens:a,lineCount:l}}return l===void 0&&(l=o?xn(e):0),{tokens:oa(t,i,()=>this.core.parse(e,t,n).tokens),lineCount:l}}shouldUseUnboundedAppend(e,t,n){return!n||e.length<this.MIN_UNBOUNDED_APPEND_TOTAL_CHARS&&n.length<this.MIN_UNBOUNDED_APPEND_CHARS?!1:n.length>=this.MIN_UNBOUNDED_APPEND_CHARS?!0:xn(n)>=this.MIN_UNBOUNDED_APPEND_LINES}getAppendedSegment(e,t){if(!t.startsWith(e)||!e.endsWith(`
|
|
99
|
-
`))return null;const n=t.slice(e.length);if(!n)return null;const s=n.length;if(n.charCodeAt(s-1)!==10)return null;let o=0,i=-1;for(let l=0;l<s&&!(n.charCodeAt(l)===10&&(i===-1&&(i=l),o++,o>=2));l++);if(o<2)return null;const r=(i===-1?n:n.slice(0,i)).trim();if(r.length===0)return null;if(/^[-=]+$/.test(r)){const l=e.slice(0,-1),a=l.lastIndexOf(`
|
|
100
|
-
`);if(l.slice(a+1).trim().length>0)return null}return this.endsInsideOpenFence(e)||this.mayContainReferenceDefinition(n)?null:n}tryTailSegmentReparse(e,t,n,s){const o=this.ensureLastSegment(t);if(!o||o.srcOffset<=0&&o.tokenStart<=0)return null;const i=t.src.slice(0,o.srcOffset);if(!e.startsWith(i))return null;const r=t.src.slice(o.srcOffset),l=e.slice(o.srcOffset);if(l===r)return null;const a=e.startsWith(t.src)?e.slice(t.src.length):null;if(a){const c=this.tryContainerTailAppendMerge(e,t,n,s,o,a);if(c)return c}if(this.mayContainReferenceDefinition(r)||this.mayContainReferenceDefinition(l))return null;try{const c=this.core.parse(l,n,s),u=this.getLastSegment(c.tokens,l);return o.lineStart>0&&this.shiftTokenLines(c.tokens,o.lineStart),t.src=e,t.env=n,t.globalStateReason=fs(e),t.tokens.length=o.tokenStart,this.appendTokens(t.tokens,c.tokens),t.lineCount=xn(e),u?t.lastSegment={tokenStart:o.tokenStart+u.tokenStart,tokenEnd:o.tokenStart+u.tokenEnd,lineStart:o.lineStart+u.lineStart,lineEnd:o.lineStart+u.lineEnd,srcOffset:o.srcOffset+u.srcOffset}:t.lastSegment=null,t.tokens}catch{return null}}getTailLines(e,t){if(t<=0)return"";let n=t;for(let s=e.length-1;s>=0;s--)if(e.charCodeAt(s)===10&&(n--,n===0))return e.slice(s+1);return e}endsInsideOpenFence(e){const n=e.length>4e3?e.length-4e3:0,s=e.slice(n),o=s.length;let i=null,r=0;for(;r<=o;){let l=s.indexOf(`
|
|
101
|
-
`,r);l===-1&&(l=o);let a=r;for(;a<l;){const c=s.charCodeAt(a);if(c===32||c===9)a++;else break}if(a<l){const c=s.charCodeAt(a);if(c===96||c===126){let u=a;for(;u<l&&s.charCodeAt(u)===c;)u++;const d=u-a;d>=3&&(i?i.marker===c&&d>=i.length&&(i=null):i={marker:c,length:d})}}if(l===o)break;r=l+1}return i!==null}peek(){return this.cache?.tokens??dR}getStats(){return{...this.stats}}appendTokens(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}updateCacheLineCount(e,t){e.lineCount=t??xn(e.src),e.lastSegment=void 0}ensureLastSegment(e){return e.lastSegment!==void 0||(e.lastSegment=this.getLastSegment(e.tokens,e.src)),e.lastSegment}getLastSegment(e,t){if(e.length===0)return null;let n=Number.POSITIVE_INFINITY,s=-1,o=0;for(let i=e.length-1;i>=0;i--){const r=e[i];if(r.map&&(r.map[0]<n&&(n=r.map[0]),r.map[1]>s&&(s=r.map[1])),r.nesting<0){o+=-r.nesting;continue}if(r.nesting>0){if(o-=r.nesting,r.level===0&&o<=0){const l=Number.isFinite(n)?n:r.map?.[0]??0,a=s>=l?s:r.map?.[1]??l;return{tokenStart:i,tokenEnd:e.length,lineStart:l,lineEnd:a,srcOffset:this.getLineStartOffset(t,l)}}continue}if(r.level===0&&o===0){const l=Number.isFinite(n)?n:r.map?.[0]??0,a=s>=l?s:r.map?.[1]??l;return{tokenStart:i,tokenEnd:e.length,lineStart:l,lineEnd:a,srcOffset:this.getLineStartOffset(t,l)}}}return null}getLineStartOffset(e,t){if(t<=0)return 0;let n=t,s=-1;for(;n>0;){if(s=e.indexOf(`
|
|
102
|
-
`,s+1),s===-1)return e.length;n--}return s+1}mayContainReferenceDefinition(e){return e.includes("]:")?/(?:^|\n)[ \t]{0,3}\[[^\]\n]+\]:/.test(e):!1}canDirectlyParseAppend(e){if(!this.endsWithBlankLine(e.src))return!1;const t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case"paragraph_open":case"heading_open":case"fence":case"code_block":case"html_block":case"hr":case"table_open":return!0;default:return!1}}tryContainerTailAppendMerge(e,t,n,s,o,i){if(!i||this.mayContainReferenceDefinition(i))return null;const r=t.tokens[o.tokenStart];switch(r?.type){case"bullet_list_open":case"ordered_list_open":return this.tryListTailAppendMerge(e,t,n,s,o,i,r);case"table_open":return this.tryTableTailAppendMerge(e,t,n,s,o,i,r);default:return null}}tryListTailAppendMerge(e,t,n,s,o,i,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10)return null;const l=o.lineEnd-o.lineStart,a=t.src.length-o.srcOffset;if(l<this.MIN_LIST_LINES_FOR_MERGE&&a<this.MIN_LIST_CHARS_FOR_MERGE)return null;const c=r.type==="bullet_list_open"?"bullet_list_close":"ordered_list_close";let u;try{u=this.core.parse(i,n,s).tokens}catch{return null}if(!this.isSingleTopLevelContainer(u,r.type,c,r.markup))return null;const d=u.slice(1,-1);if(d.length===0)return null;const h=t.lineCount??xn(t.src);h>0&&this.shiftTokenLines(d,h);const p=this.getListParagraphMode(t.tokens,o.tokenStart,t.tokens.length,r.level),f=this.getListParagraphMode(u,0,u.length,0);return(p==="loose"||f==="loose"||this.endsWithBlankLine(t.src)||(u[0]?.map?.[0]??0)>0)&&(this.setListParagraphVisibility(t.tokens,o.tokenStart,t.tokens.length,r.level,!1),this.setListParagraphVisibility(d,0,d.length,r.level,!1)),t.tokens.splice(t.tokens.length-1,0,...d),t.src=e,t.env=n,t.globalStateReason=fs(e),t.lineCount=xn(e),r.map&&(r.map[1]=this.getDocLineCount(e)),t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:this.getDocLineCount(e),srcOffset:o.srcOffset},t.tokens}tryTableTailAppendMerge(e,t,n,s,o,i,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10||/(?:^|\n)[ \t]*\n/.test(i))return null;const l=o.lineEnd-o.lineStart,a=t.src.length-o.srcOffset;if(l<this.MIN_TABLE_LINES_FOR_MERGE&&a<this.MIN_TABLE_CHARS_FOR_MERGE)return null;const c=this.getTableHeaderContext(t.src.slice(o.srcOffset));if(!c)return null;const u=`${c}${i}`;let d;try{d=this.core.parse(u,n,s).tokens}catch{return null}if(!this.isSingleTopLevelContainer(d,"table_open","table_close")||(d[0]?.map?.[1]??-1)!==this.getDocLineCount(u))return null;const h=this.getTableBodySection(d,0,d.length,0),p=this.getTableBodySection(t.tokens,o.tokenStart,t.tokens.length,r.level);if(!h||!p||h.tbodyOpenIndex<0||h.tbodyCloseIndex<0)return null;const f=p.tbodyOpenIndex>=0?d.slice(h.tbodyOpenIndex+1,h.tbodyCloseIndex):d.slice(h.tbodyOpenIndex,h.tbodyCloseIndex+1);if(f.length===0)return null;const g=o.lineEnd-2;g!==0&&this.shiftTokenLines(f,g);const w=p.tbodyCloseIndex>=0?p.tbodyCloseIndex:p.tableCloseIndex;t.tokens.splice(w,0,...f),t.src=e,t.env=n,t.globalStateReason=fs(e),t.lineCount=xn(e);const S=this.getDocLineCount(e);if(r.map&&(r.map[1]=S),p.tbodyOpenIndex>=0){const y=t.tokens[p.tbodyOpenIndex];y?.map&&(y.map[1]=S)}return t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:S,srcOffset:o.srcOffset},t.tokens}getTableHeaderContext(e){const t=e.indexOf(`
|
|
103
|
-
`);if(t<0)return null;const n=e.indexOf(`
|
|
104
|
-
`,t+1);return n<0?null:e.slice(0,n+1)}getTableBodySection(e,t,n,s){if(t<0||t>=n||e[t]?.type!=="table_open")return null;let o=-1;for(let l=n-1;l>t;l--){const a=e[l];if(a.type==="table_close"&&a.level===s){o=l;break}}if(o<0)return null;let i=-1,r=-1;for(let l=t+1;l<o;l++){const a=e[l];if(a.type==="tbody_open"&&a.level===s+1){i=l;break}}if(i>=0){for(let l=o-1;l>i;l--){const a=e[l];if(a.type==="tbody_close"&&a.level===s+1){r=l;break}}if(r<0)return null}return{tableCloseIndex:o,tbodyOpenIndex:i,tbodyCloseIndex:r}}isSingleTopLevelContainer(e,t,n,s){if(e.length<2)return!1;const o=e[0],i=e[e.length-1];if(o.type!==t||i.type!==n||o.level!==0||i.level!==0||s!==void 0&&o.markup!==s)return!1;let r=0;for(let l=0;l<e.length;l++){const a=e[l];if(a.level===0&&l>0&&l<e.length-1&&r===0)return!1;(a.nesting>0||a.nesting<0)&&(r+=a.nesting)}return r===0}getListParagraphMode(e,t,n,s){let o=!1,i=!1;const r=s+2;for(let l=t;l<n;l++){const a=e[l];if(!(a.type!=="paragraph_open"||a.level!==r)&&(a.hidden?o=!0:i=!0,o&&i))return"loose"}return i?"loose":o?"tight":"none"}setListParagraphVisibility(e,t,n,s,o){const i=s+2;for(let r=t;r<n;r++){const l=e[r];(l.type==="paragraph_open"||l.type==="paragraph_close")&&l.level===i&&(l.hidden=o)}}shouldPreferTailReparseForAppend(e){const t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case"bullet_list_open":case"ordered_list_open":case"blockquote_open":case"table_open":return!0;case"paragraph_open":case"code_block":case"html_block":return!this.endsWithBlankLine(e.src);default:return!1}}endsWithBlankLine(e){const t=e.length;if(t<2||e.charCodeAt(t-1)!==10)return!1;let n=t-2;for(;n>=0;){const s=e.charCodeAt(n);if(s===32||s===9){n--;continue}return s===10}return!0}getDocLineCount(e){const t=xn(e);return e.length===0?0:e.charCodeAt(e.length-1)===10?t:t+1}shiftTokenLines(e,t){if(t===0)return;const n=[...e];for(;n.length>0;){const s=n.pop();if(s.map&&(s.map[0]+=t,s.map[1]+=t),s.children)for(let o=s.children.length-1;o>=0;o--)n.push(s.children[o])}}};const $b={default:JP,zero:QP,commonmark:ZP};function hR(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version}}function pR(e,t){return e.core.ruler.version!==t.core||e.block.ruler.version!==t.block||e.inline.ruler.version!==t.inline||e.inline.ruler2.version!==t.inline2}function Nb(e){return e.experimental?{...e,...e.experimental}:e}function _o(e,t){if(!e)return!1;if(Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==void 0)return!0;const n=e.experimental;return!!n&&Object.prototype.hasOwnProperty.call(n,t)&&n[t]!==void 0}function Lb(e,t,n){for(let s=0;s<n.length;s++){const o=n[s];if(_o(t,o)||_o(e,o))return!0}return!1}function Ob(e,t,n){return _o(t,n)||_o(e,n)}function Pb(e,t){const n=_i(e)?.chunk;if(n?.fallback){os(e,{area:"parse",path:"plain",reason:`global-state:${n.fallbackReason||"unknown"}`});return}os(e,{area:"parse",path:"full-chunk",chunked:!0,reason:t})}function mR(e,t){let n={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100,stream:!1,streamOptimizationMinSize:1e3,streamChunkedFallback:!1,streamChunkSizeChars:1e4,streamChunkSizeLines:200,streamChunkFenceAware:!0,streamChunkAdaptive:!0,streamChunkTargetChunks:8,streamChunkMaxChunks:void 0,streamSkipCacheAboveChars:1e6,streamSkipCacheAboveLines:1e5,fullChunkedFallback:!1,fullChunkThresholdChars:2e4,fullChunkThresholdLines:400,fullChunkSizeChars:1e4,fullChunkSizeLines:200,fullChunkFenceAware:!0,fullChunkAdaptive:!0,fullChunkTargetChunks:8,fullChunkMaxChunks:void 0,autoTuneChunks:!0,autoUnbounded:!0,autoUnboundedThresholdChars:4e6,autoUnboundedThresholdLines:8e4},s="default",o;!t&&typeof e!="string"?(o=e,s="default"):typeof e=="string"&&(s=e,o=t);const i=$b[s];if(!i)throw new Error(`Wrong \`markdown-it\` preset "${s}", check name`);if(i?.options&&(n={...n,...i.options}),o&&(n={...n,...o}),n=Nb(n),typeof n.quotes=="string"){const _=n.quotes;_.length>=4?n.quotes=[_[0],_[1],_[2],_[3]]:n.quotes=["“","”","‘","’"]}let r=Lb(i?.options,o,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),l=Lb(i?.options,o,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),a=Ob(i?.options,o,"fullChunkedFallback"),c=Ob(i?.options,o,"streamChunkedFallback"),u=!1,d=null;const h=new IP;let p=null;const f=()=>(p||(p=new uR(n)),p);let g=null;const w=()=>(g||(g=new fR(h)),g);let S=null;const y=()=>(S||(S=new zC),S),k=_=>!u&&!!d&&!pR(_,d),v={core:h,block:h.block,inline:h.inline,get linkify(){const _=y();return Object.defineProperty(this,"linkify",{value:_,writable:!0,configurable:!0}),_},get renderer(){const _=f();return Object.defineProperty(this,"renderer",{value:_,writable:!0,configurable:!0}),_},options:n,__explicitFullChunkConfig:r,__explicitStreamChunkConfig:l,__explicitFullChunkFallbackSetting:a,__explicitStreamChunkFallbackSetting:c,__canUseImplicitLargeInputStrategy(){return k(this)},set(_){const I=Nb(_);return this.options={...this.options,...I},(_o(_,"fullChunkSizeChars")||_o(_,"fullChunkSizeLines")||_o(_,"fullChunkMaxChunks"))&&(r=!0,this.__explicitFullChunkConfig=!0),(_o(_,"streamChunkSizeChars")||_o(_,"streamChunkSizeLines")||_o(_,"streamChunkMaxChunks"))&&(l=!0,this.__explicitStreamChunkConfig=!0),_o(_,"fullChunkedFallback")&&(a=!0,this.__explicitFullChunkFallbackSetting=!0),_o(_,"streamChunkedFallback")&&(c=!0,this.__explicitStreamChunkFallbackSetting=!0),p&&p.set(I),typeof I.stream=="boolean"&&(this.stream.enabled=I.stream,g&&(g.reset(),g.resetStats())),this},configure(_){const I=typeof _=="string"?$b[_]:_;if(!I)throw new Error("Wrong `markdown-it` preset, can't be empty");if(I.options&&this.set(I.options),I.components){const A=I.components;A.core?.rules&&this.core.ruler.enableOnly(A.core.rules),A.block?.rules&&this.block.ruler.enableOnly(A.block.rules),A.inline?.rules&&this.inline.ruler.enableOnly(A.inline.rules),A.inline2?.rules&&this.inline.ruler2.enableOnly(A.inline2.rules)}return this},enable(_,I){const A=Array.isArray(_)?_:[_],b=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],M=new Set;for(const N of b){if(!N)continue;const D=N.enable(A,!0);for(let $=0;$<D.length;$++)M.add(D[$])}if(!I){const N=A.filter(D=>!M.has(D));if(N.length)throw new Error(`Rules manager: invalid rule name ${N.join(", ")}`)}return this},disable(_,I){const A=Array.isArray(_)?_:[_],b=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],M=new Set;for(const N of b){if(!N)continue;const D=N.disable(A,!0);for(let $=0;$<D.length;$++)M.add(D[$])}if(!I){const N=A.filter(D=>!M.has(D));if(N.length)throw new Error(`Rules manager: invalid rule name ${N.join(", ")}`)}return this},use(_,...I){const A=typeof _=="function"?_:_&&typeof _.default=="function"?_.default:void 0;if(!A)throw new TypeError("MarkdownIt.use: plugin must be a function");const b=[this,...I],M=_;return u=!0,A.apply(M,b),this},render(_,I={}){const A=this.parse(_,I);return f().render(A,this.options,I)},async renderAsync(_,I={}){const A=this.parse(_,I);return f().renderAsync(A,this.options,I)},renderIterable(_,I={}){const A=this.parseIterable(_,I);return f().render(A,this.options,I)},async renderAsyncIterable(_,I={}){const A=await this.parseAsyncIterable(_,I);return f().renderAsync(A,this.options,I)},renderInline(_,I={}){const A=this.parseInline(_,I);return f().render(A,this.options,I)},validateLink:cx,normalizeLink:ux,normalizeLinkText:dx,utils:Y8,helpers:{...FL},parse(_,I={}){if(typeof _!="string")throw new TypeError("Input data should be a String");Zs(I);let A;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&k(this)){const M=_x(this,_.length);if(M==="yes"){const N=yc(this,_,I);return os(I,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),N}M==="need-lines"&&(A=xn(_))}if(!this.stream.enabled){const M=_.length,N=A??xn(_),D=this.options.autoTuneChunks!==!1,$=r,O=!a&&k(this),P=!!this.options.fullChunkedFallback,R=O&&M>=2e5,F=D&&!$?XP(M,N,this.options):null;if((P||R)&&(P?M>=(this.options.fullChunkThresholdChars??2e4)||N>=(this.options.fullChunkThresholdLines??400):R)){if(F&&F.strategy!=="plain"){const V=gf(this,_,I,{maxChunkChars:F.maxChunkChars,maxChunkLines:F.maxChunkLines,fenceAware:F.fenceAware,maxChunks:F.maxChunks});return Pb(I,P?"explicit-full-chunk":"default-large-string"),V}if(P){const V=(de,be,xe)=>de<be?be:de>xe?xe:de,K=this.options.fullChunkAdaptive!==!1,Z=this.options.fullChunkTargetChunks??8,G=V(Math.ceil(M/Z),8e3,64e3),X=V(Math.ceil(N/Z),150,700),pe=K?G:this.options.fullChunkSizeChars??1e4,oe=K?X:this.options.fullChunkSizeLines??200,ye=K?V(Math.ceil(M/64e3),Z,32):this.options.fullChunkMaxChunks,_e=gf(this,_,I,{maxChunkChars:pe,maxChunkLines:oe,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:ye});return Pb(I,"explicit-full-chunk"),_e}}if(A!==void 0&&k(this)&&bx(this,M,N)){const V=yc(this,_,I);return os(I,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),V}}const b=fs(_);return os(I,{area:"parse",path:"plain",reason:"default-plain"}),oa(I,b,()=>h.parse(_,I,this).tokens)},parseIterable(_,I={}){return Zs(I),VP(this,_,I)},parseAsyncIterable(_,I={}){return Zs(I),KP(this,_,I)},parseIterableToSink(_,I,A={}){return Zs(A),GP(this,_,I,A)},parseAsyncIterableToSink(_,I,A={}){return Zs(A),YP(this,_,I,A)},parseInline(_,I={}){if(typeof _!="string")throw new TypeError("Input data should be a String");Zs(I),iu(I)&&Ri(I);const A=h.createState(_,I,this);return A.inlineMode=!0,h.process(A),A.tokens}};if(v.stream={enabled:!!n.stream,parse(_,I){return v.stream.enabled?w().parse(_,I,v):v.parse(_,I??{})},reset(){w().reset()},peek(){return g?g.peek():[]},stats(){return g?g.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}},resetStats(){g&&g.resetStats()}},i?.components){const _=i.components;_.core?.rules&&v.core.ruler.enableOnly(_.core.rules),_.block?.rules&&v.block.ruler.enableOnly(_.block.rules),_.inline?.rules&&v.inline.ruler.enableOnly(_.inline.rules),_.inline2?.rules&&v.inline.ruler2.enableOnly(_.inline2.rules)}return d=hR(v),v}var gR=mR;function vR(e,t,n){function s(h){return h.trim().split(" ",2)[0]===t}function o(h,p,f,g,w){return h[p].nesting===1&&h[p].attrJoin("class",t),w.renderToken(h,p,f,g,w)}n=n||{};const i=3,r=n.marker||":",l=r.charCodeAt(0),a=r.length,c=n.validate||s,u=n.render||o;function d(h,p,f,g){let w,S=!1,y=h.bMarks[p]+h.tShift[p],k=h.eMarks[p];if(l!==h.src.charCodeAt(y))return!1;for(w=y+1;w<=k&&r[(w-y)%a]===h.src[w];w++);const v=Math.floor((w-y)/a);if(v<i)return!1;w-=(w-y)%a;const _=h.src.slice(y,w),I=h.src.slice(w,k);if(!c(I,_))return!1;if(g)return!0;let A=p;for(;A++,!(A>=f||(y=h.bMarks[A]+h.tShift[A],k=h.eMarks[A],y<k&&h.sCount[A]<h.blkIndent));)if(l===h.src.charCodeAt(y)&&!(h.sCount[A]-h.blkIndent>=4)){for(w=y+1;w<=k&&r[(w-y)%a]===h.src[w];w++);if(!(Math.floor((w-y)/a)<v)&&(w-=(w-y)%a,w=h.skipSpaces(w),!(w<k))){S=!0;break}}const b=h.parentType,M=h.lineMax;h.parentType="container",h.lineMax=A;const N=h.push("container_"+t+"_open","div",1);N.markup=_,N.block=!0,N.info=I,N.map=[p,A],h.md.block.tokenize(h,p+1,A);const D=h.push("container_"+t+"_close","div",-1);return D.markup=h.src.slice(y,w),D.block=!0,h.parentType=b,h.lineMax=M,h.line=A+(S?1:0),!0}e.block.ruler.before("fence","container_"+t,d,{alt:["paragraph","reference","blockquote","list"]}),e.renderer.rules["container_"+t+"_open"]=u,e.renderer.rules["container_"+t+"_close"]=u}function yR(e){const t=String(e??"").trim();if(!t.startsWith("{")||!t.endsWith("}"))return null;const n=t.slice(1,-1).trim();if(!n)return{};if(n.includes("{")||n.includes("[")||n.includes("]"))return null;const s=[];let o="",i=!1,r=!1;for(let a=0;a<n.length;a++){const c=n[a];if(c==="\\"){o+=c,a+1<n.length&&(o+=n[a+1],a++);continue}if(!r&&c==="'"){i=!i,o+=c;continue}if(!i&&c==='"'){r=!r,o+=c;continue}if(!i&&!r&&c===","){s.push(o.trim()),o="";continue}o+=c}o.trim()&&s.push(o.trim());const l={};for(const a of s){if(!a)continue;let c=!1,u=!1,d=-1;for(let w=0;w<a.length;w++){const S=a[w];if(S==="\\"){w++;continue}if(!u&&S==="'"){c=!c;continue}if(!c&&S==='"'){u=!u;continue}if(!c&&!u&&S===":"){d=w;break}}if(d===-1)return null;const h=a.slice(0,d).trim(),p=a.slice(d+1).trim();if(!h)return null;let f=h;if(f.startsWith('"')&&f.endsWith('"')||f.startsWith("'")&&f.endsWith("'"))try{f=JSON.parse(f.replace(/^'/,'"').replace(/'$/,'"'))}catch{return null}if(!/^[_$A-Z][\w$-]*$/i.test(f))return null;let g;if(!p)g="";else if(p.startsWith('"')&&p.endsWith('"')||p.startsWith("'")&&p.endsWith("'"))try{g=JSON.parse(p.replace(/^'/,'"').replace(/'$/,'"'))}catch{g=p}else/^-?\d+(?:\.\d+)?$/.test(p)?g=Number(p):p==="true"||p==="false"?g=p==="true":p==="null"?g=null:g=p;l[f]=g}return l}function kR(e){["admonition","info","warning","error","tip","danger","note","caution"].forEach(t=>{e.use(vR,t,{render(n,s){return n[s].nesting===1?`<div class="vmr-container vmr-container-${t}">`:`</div>
|
|
105
|
-
`}})}),e.block.ruler.before("fence","vmr_container_fallback",(t,n,s,o)=>{const i=t,r=i.bMarks[n]+i.tShift[n],l=i.eMarks[n],a=i.src.slice(r,l),c=a.match(/^:::\s*([^\s{]+)/);if(!c)return!1;const u=c[1];if(!u.trim())return!1;const d=a.slice(c[0].length).trim();let h,p;const f=d.indexOf("{"),g=f>=0?d.slice(f).trimStart():void 0;if(f===-1)h=d||void 0;else{if(h=d.slice(0,f).trim()||void 0,g?.startsWith("{")){let _=0,I=-1;for(let A=0;A<g.length;A++)if(g[A]==="{"?_++:g[A]==="}"&&_--,_===0){I=A+1;break}I>0&&(p=g.slice(0,I))}p||(h=d||void 0)}if(o)return!0;const w=!!i.env.__markstreamFinal;let S=n+1,y=!1;for(;S<=s;){const _=i.bMarks[S]+i.tShift[S],I=i.eMarks[S];if(i.src.slice(_,I).trim()===":::"){y=!0;break}S++}y||(S=s);const k=i.push("vmr_container_open","div",1);if(k.attrSet("class",`vmr-container vmr-container-${u}`),k.meta={...k.meta??{},unclosed:!y&&!w},h&&k.attrSet("data-args",h),p)try{const _=JSON.parse(p);for(const[I,A]of Object.entries(_)){const b=A!=null&&typeof A=="object";k.attrSet(`data-${I}`,b?JSON.stringify(A):String(A))}}catch{const _=yR(p);if(_)for(const[I,A]of Object.entries(_)){const b=A!=null&&typeof A=="object";k.attrSet(`data-${I}`,b?JSON.stringify(A):String(A))}else k.attrSet("data-attrs",p)}const v=[];for(let _=n+1;_<S;_++){const I=i.bMarks[_]+i.tShift[_],A=i.eMarks[_];v.push(i.src.slice(I,A))}if(v.some(_=>_.trim().length>0)){let _=v.join(`
|
|
106
|
-
`);_.endsWith(`
|
|
107
|
-
`)||(_+=`
|
|
108
|
-
`),_.endsWith(`
|
|
109
|
-
|
|
110
|
-
`)||(_+=`
|
|
111
|
-
`);const I=i.tokens[i.tokens.length-1];I&&(I.raw=_);const A=[];i.md.block.parse(_,i.md,i.env,A),i.tokens.push(...A)}return y&&i.push("vmr_container_close","div",-1),i.line=y?S+1:S,!0},{alt:["paragraph","reference","blockquote","list"]})}const Tx=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],bR=["a","abbr","b","bdi","bdo","button","cite","code","data","del","dfn","em","font","i","ins","kbd","label","mark","q","s","samp","small","span","strong","sub","sup","time","u","var"],Mx=["article","aside","blockquote","details","div","figcaption","figure","footer","header","h1","h2","h3","h4","h5","h6","li","main","nav","ol","p","pre","section","summary","table","tbody","td","th","thead","tr","ul"],_R=["svg","g","path"],wR=["address","audio","body","canvas","caption","colgroup","datalist","dd","dialog","dl","dt","fieldset","form","head","hgroup","html","iframe","legend","map","menu","meter","noscript","object","optgroup","option","output","picture","progress","rp","rt","ruby","script","select","style","template","textarea","tfoot","title","video"],SR=["onclick","onerror","onload","onmouseover","onmouseout","onmousedown","onmouseup","onkeydown","onkeyup","onfocus","onblur","onsubmit","onreset","onchange","onselect","ondblclick","ontouchstart","ontouchend","ontouchmove","ontouchcancel","onwheel","onscroll","oncopy","oncut","onpaste","oninput","oninvalid","onsearch","srcdoc","ping"],CR=["action","data","href","src","srcset","poster","xlink:href","formaction"],xR=["script"],TR=["pre","script","style","table","tbody","td","tfoot","th","thead","textarea","tr","title"],dl=new Set(Tx),MR=new Set(Mx),Vc=new Set([...Tx,...bR,...Mx,..._R]),Ax=new Set([...Vc,...wR]),AR=new Set(SR),ER=new Set(CR),lu=new Set(xR),Ex=new Set(TR);function Ix(e){let t="";for(const n of e){const s=n.charCodeAt(0);s<=31||s>=127&&s<=159||/\s/u.test(n)||(t+=n)}return t}const IR={amp:"&",bsol:"\\",colon:":",newline:`
|
|
112
|
-
`,sol:"/",tab:" "};function $x(e){return e.replace(/&(?:#(\d+)|#x([0-9a-f]+)|([a-z][a-z0-9]+));?/gi,(t,n,s,o)=>{const i=n??s;if(i){const r=Number.parseInt(i,n?10:16);try{return Number.isFinite(r)?String.fromCodePoint(r):""}catch{return""}}return IR[String(o??"").toLowerCase()]??t})}const sd=new Set(["http","https","mailto","tel"]),Ja=new Set(["http","https"]);function Nx(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??""}function $R(e,t){return t==="href"||t==="xlink:href"?sd:t==="src"||t==="srcset"||t==="poster"||t==="action"||t==="formaction"||t==="data"?Ja:sd}function la(e,t={}){const n=Ix($x(e)).toLowerCase(),s=String(t.tagName??"").toLowerCase(),o=String(t.attrName??"").toLowerCase();if(!n)return!1;if(n.startsWith("data:")){const r=/^data:image\/(?:png|gif|jpe?g|webp|avif|bmp);/i.test(n);return s==="img"&&o==="src"?!r:!0}if(/^[\\/]{2}/.test(n))return!0;if(n.startsWith("/")||n.startsWith("./")||n.startsWith("../")||n.startsWith("#")||n.startsWith("?"))return!1;const i=Nx(n);return i?!$R(s,o).has(i):!1}function NR(e){const t=$x(String(e??"")).trim();if(!t||t.startsWith("#")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("?"))return!1;const n=Nx(Ix(t).toLowerCase());return n==="http"||n==="https"}function LR(e,t={}){const n=String(e??"").trim();return n?la(n,t)?"":n:""}function Rb(e){return LR(e,{tagName:"img",attrName:"src"})}function to(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function kn(e){let t=!1,n=!1;for(let s=0;s<e.length;s++){const o=e[s];if(o==="\\"){s++;continue}if(!n&&o==="'"){t=!t;continue}if(!t&&o==='"'){n=!n;continue}if(!t&&!n&&o===">")return s}return-1}function gh(e){const t=[],n=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let s;for(;(s=n.exec(e))!==null;){const o=s[1];if(!o)continue;const i=s[2]||s[3]||s[4]||"";t.push([o,i])}return t}const OR=/^[a-z][a-z0-9_-]*$/;function Db(e){return OR.test(String(e??"").trim().toLowerCase())}function No(e){const t=String(e??"").trim();if(!t)return"";if(!t.startsWith("<"))return Db(t)?t.toLowerCase():"";let n=1;for(;n<t.length&&/\s/.test(t[n]);)n++;if(t[n]==="/")for(n++;n<t.length&&/\s/.test(t[n]);)n++;const s=n;for(;n<t.length&&/[\w-]/.test(t[n]);)n++;const o=t.slice(s,n).toLowerCase(),i=t[n]??"";return i&&!/[\s/>]/.test(i)?"":Db(o)?o:""}function _a(e){if(!e||e.length===0)return[];const t=new Set,n=[];for(const s of e){const o=No(s);!o||t.has(o)||(t.add(o),n.push(o))}return n}function PR(...e){const t=new Set,n=[];for(const s of e)for(const o of _a(s))t.has(o)||(t.add(o),n.push(o));return n}function RR(e){const t=_a(e);return{key:t.join(","),tags:t}}function Lx(e){return No(e)}function DR(e,t){const n=String(e??""),s=No(t);if(!s)return!1;const o=to(s),i=n.match(new RegExp(String.raw`^\s*<\s*${o}(?:\s[^>]*)?(\s*\/)?>`,"i"));return i?i[1]?!0:new RegExp(String.raw`<\s*\/\s*${o}\s*>`,"i").test(n):!1}function Ox(e,t){const n=No(t);return!!n&&!Vc.has(n)&&!DR(e,n)}function BR(e,t){const n=String(e??""),s=No(t);if(!s)return n;const o=to(s),i=new RegExp(String.raw`^\s*<\s*${o}(?:\s[^>]*)?>\s*`,"i"),r=new RegExp(String.raw`\s*<\s*\/\s*${o}\s*>\s*$`,"i");return n.replace(i,"").replace(r,"")}const Px=dl,FR=Vc,Rx=new Set(MR);Rx.delete("details");const HR=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,WR=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,Ig=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,UR=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function kf(e){return(e.match(Ig)?.[1]??"").toLowerCase()}function hv(e){return/^\s*<\s*\//.test(e)}function pv(e,t){return Px.has(t)||/\/\s*>\s*$/.test(e)}function qR(e,t){let n=0;for(let s=0;s<e.length;s++){const o=e[s];if(!o||o.type!=="html_inline")continue;const i=String(o.content??""),r=kf(i);if(r===t){if(hv(i)){if(n===0)return s;n--;continue}pv(i,r)||n++}}return-1}function jR(e,t){let n=0;for(const s of e){if(!s||s.type!=="html_inline")continue;const o=String(s.content??""),i=kf(o);if(i===t){if(hv(o)){n>0&&n--;continue}pv(o,i)||n++}}return n}function Bb(e,t,n=0){const s=new RegExp(String.raw`<\s*(\/?)\s*${to(t)}(?=[\s>/])[^>]*>`,"gi");s.lastIndex=Math.max(0,n);let o=0,i;for(;(i=s.exec(e))!==null;){const r=i[0]??"",l=!!i[1],a=!l&&/\/\s*>$/.test(r);if(l){if(o===0)return{start:i.index,end:i.index+r.length};o--;continue}a||o++}return null}function zR(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${to(t)}(?=[\s>/])[^>]*>`,"gi");let s=0,o;for(;(o=n.exec(e))!==null;){const i=o[0]??"",r=!!o[1],l=!r&&/\/\s*>$/.test(i);if(r){s>0&&s--;continue}l||s++}return s}function bf(e){const t=e;return String(t.raw??t.content??t.markup??"")}function VR(e){const t=e;return t.meta||(t.meta={}),t.meta}function sm(e,t,n){const s=VR(e);s.markstreamCustomHtmlRaw=t,s.markstreamCustomHtmlInner=n}function KR(e,t){if(!t.size)return;const n=Array.from(t,p=>new RegExp(String.raw`<\s*${to(p)}(?=[\s>/])`,"i")),s=[];let o=!1;const i=p=>p?n.some(f=>f.test(p)):!1,r=p=>{if(!(!p||!s.length))for(const f of s)f.raw+=p,f.inner+=p},l=()=>{!s.length||!o||(r(`
|
|
113
|
-
`),o=!1)},a=p=>{r(p)},c=p=>{for(let g=0;g<s.length;g++)s[g].raw+=p,g<s.length-1&&(s[g].inner+=p);const f=s.pop();sm(f.token,f.raw,f.inner)},u=p=>{const f=s[s.length-1]?.tag;if(!f)return null;const g=new RegExp(String.raw`^\s*<\s*\/\s*${to(f)}\s*>`,"i");return p.match(g)?.[0]??null},d=p=>!!u(p),h=(p,f,g)=>{const w=g??(p.type==="html_inline"?kf(f):"");if(!(w&&t.has(w))){r(f);return}const S=hv(f),y=!S&&pv(f,w);if(S){if(!s.length||s[s.length-1].tag!==w){r(f);return}c(f);return}if(r(f),y){sm(p,f,"");return}s.push({tag:w,token:p,raw:f,inner:""})};for(const p of e){if(p.type==="inline"&&Array.isArray(p.children)){const f=String(p.content??"");if(d(f)?o=!1:l(),!s.length&&!i(f)){o=!1;continue}let g=0,w=!0;for(const S of p.children){const y=bf(S),k=S.type==="html_inline"?kf(y):"",v=k&&t.has(k);let _=y;if(w&&f&&y&&(s.length||v)){const I=f.indexOf(y,g);if(I!==-1)a(f.slice(g,I)),_=f.slice(I,I+y.length),g=I+y.length;else{if(s.length&&!v)continue;w=!1}}h(S,_,k)}w&&f&&g<f.length&&s.length&&a(f.slice(g)),o=s.length>0;continue}if(s.length&&typeof p.content=="string"){const f=bf(p),g=p.type==="html_block"?u(f):null;if(g){c(`${o?`
|
|
114
|
-
`:""}${g}`),o=s.length>0;continue}if(!p.content)continue;l(),r(p.content),o=!0}}for(const p of s)sm(p.token,p.raw,p.inner)}function GR(e){return/^\s*<\s*[!?]/.test(e)}function YR(e){const t=new Set(FR);if(e&&Array.isArray(e))for(const n of e){const s=String(n??"").trim();if(!s)continue;const o=s.match(/^[<\s/]*([A-Z][\w-]*)/i);o&&t.add(o[1].toLowerCase())}return t}function Fb(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function XR(e,t){let n=null;for(const i of e.matchAll(HR)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();Fb(l,t)&&kn(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!1})}for(const i of e.matchAll(WR)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();Fb(l,t)&&kn(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!0})}const s=/<\/\s*$/.exec(e);if(s&&typeof s.index=="number"){const i=s.index;!e.slice(i).includes(">")&&(!n||i<n.index)&&(n={index:i,tag:"",closing:!0})}const o=/<\s*$/.exec(e);if(o&&typeof o.index=="number"){const i=o.index,r=e.slice(i);!r.startsWith("</")&&!r.includes(">")&&(!n||i<n.index)&&(n={index:i,tag:"",closing:!1})}return n}function ZR(e,t){const n=e;return Object.assign(Object.create(Object.getPrototypeOf(n)),n,{type:"text",content:t,raw:t})}function JR(e,t){if(!e.length)return{children:e};const n=[];let s=null,o=null;function i(a,c){a&&(c?n.push(ZR(c,a)):n.push({type:"text",content:a,raw:a}))}function r(a,c){let u=0;for(;u<a.length;){const d=a.indexOf("<",u);if(d===-1){i(a.slice(u),c);break}i(a.slice(u,d),c);const h=a.slice(d),p=h.match(Ig);if(!p){i("<",c),u=d+1;continue}const f=kn(h);if(f===-1){i("<",c),u=d+1;continue}const g=h.slice(0,f+1),w=(p[1]??"").toLowerCase();t.has(w)?n.push({type:"html_inline",tag:"",content:g,raw:g}):i(g,c),u=d+g.length}}function l(a,c){if(!a)return;const u=XR(a,t);if(!u){r(a,c);return}const d=a.slice(0,u.index);d&&r(d,c),s={tag:u.tag,buffer:a.slice(u.index),closing:u.closing},o=s.buffer}for(const a of e){if(s){s.buffer+=bf(a),o=s.buffer;const c=kn(s.buffer);if(c===-1)continue;const u=s.buffer.slice(0,c+1),d=s.buffer.slice(c+1);n.push({type:"html_inline",tag:"",content:u,raw:u}),s=null,o=null,d&&l(d);continue}if(a.type==="html_inline"){const c=bf(a),u=(c.match(Ig)?.[1]??"").toLowerCase();if(u&&t.has(u)&&kn(c)===-1){s={tag:u,buffer:c,closing:/^<\s*\//.test(c)},o=s.buffer;continue}}if(a.type==="text"){const c=String(a.content??"");if(!c.includes("<")){n.push(a);continue}l(c,a);continue}n.push(a)}return{children:n,pendingBuffer:o??void 0}}const QR=["a","span","strong","em","b","i","u"];function e7(e,t={}){const n=new Set;if(t.customHtmlTags?.length)for(const h of t.customHtmlTags){const p=No(h);p&&n.add(p)}const s=h=>{const p=h,f=new Set(n),g=Array.isArray(p.env?.__markstreamCustomHtmlTags)?p.env.__markstreamCustomHtmlTags:[];for(const k of g){const v=No(String(k??""));v&&f.add(v)}const w=YR(Array.from(f)),S=new Set(QR);for(const k of f)S.add(k);return{autoCloseInlineTagSet:S,commonHtmlTags:w,customTagSet:f,shouldMergeHtmlBlockTag:k=>f.has(k)||!w.has(k)||Rx.has(k)}},o=h=>{if(h.type==="html_block")return String(h.content??"");if(h.type!=="inline"||!Array.isArray(h.children)||h.children.length!==1)return"";const p=h.children[0];return p?.type!=="html_block"?"":String(h.content??p.content??"")},i=(h,p)=>{h.type="html_block",h.content=p,h.raw=p,h.children=[]},r=h=>h.replace(/^(?:\r?\n)+/,""),l=h=>/^(?: {4}|\t)/.test(h),a=h=>h.replace(/^(?: {4}|\t)/gm,""),c=(h,p)=>{const f=r(h);if(!/\S/.test(f))return[];if(l(f))return[{type:"code_block",content:a(f),raw:f}];const g=f.replace(/^[\t ]+/,"");if(!g)return[];if(g.startsWith("<"))return[{type:"html_block",content:g}];const w={type:"inline",tag:"",nesting:0,content:g,children:[{type:"text",content:g,raw:g}]};return p==="paragraph"?[{type:"paragraph_open",tag:"p",nesting:1},w,{type:"paragraph_close",tag:"p",nesting:-1}]:p==="text"?[{type:"text",content:g,raw:g}]:[w]},u=(h,p,f)=>h[p-1]?.type==="paragraph_open"&&h[p+1]?.type==="paragraph_close"?"inline":f,d=(h,p)=>{const f=r(p);return!/\S/.test(f)||h.type!=="inline"||!Array.isArray(h.children)?!1:(h.content=`${String(h.content??"")}${f}`,h.children.push({type:"text",content:f,raw:f}),!0)};e.core.ruler.after("inline","fix_html_inline_streaming",h=>{const p=h.tokens??[],{commonHtmlTags:f,customTagSet:g}=s(h);for(const w of p){const S=w;if(S.type!=="inline"||!Array.isArray(S.children))continue;const y=String(S.content??""),k=S.children.length?S.children:y.includes("<")?[{type:"text",content:y,raw:y}]:null;if(k)try{const v=JR(k,f);if(S.children=v.children,v.pendingBuffer){const _=y.lastIndexOf(v.pendingBuffer);if(_!==-1){const I=y.slice(0,_);S.content=I,typeof S.raw=="string"&&(S.raw=I)}}}catch(v){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",v)}}KR(p,g)}),e.core.ruler.push("fix_html_inline_tokens",h=>{const p=h.tokens??[],{autoCloseInlineTagSet:f,customTagSet:g,shouldMergeHtmlBlockTag:w}=s(h),S=[];for(let y=0;y<p.length;y++){const k=p[y];if(S.length>0){const[_,I]=S[S.length-1];if(y!==I){if(k.type==="paragraph_open"||k.type==="paragraph_close"){p.splice(y,1),y--;continue}const A=String(k.content??k.raw??"");if(A){const b=p[I],M=`${String(b.content||"")}
|
|
115
|
-
${A}`,N=kn(M),D=N===-1?null:Bb(M,_,N+1);if(D){const $=M.slice(0,D.end),O=M.slice(D.end);b.content=$,b.loading=!1,p.splice(y,1),S.pop();const P=d(b,O)?[]:c(O,u(p,y,"paragraph"));P.length&&p.splice(y,0,...P),y--;continue}b.content=M,b.loading!==!1&&(b.loading=!0)}p.splice(y,1),y--;continue}}const v=o(k);if(v){if(GR(v))continue;const _=(v.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??"").toLowerCase(),I=/^\s*<\s*\//.test(v);if(!_||!w(_))continue;if(i(k,v),!I)_&&!new RegExp(`^\\s*<\\s*${_}\\b[^>]*\\/\\s*>`,"i").test(v)&&zR(v,_)>0&&S.push([_,y]);else if(S.length>0&&_&&S[S.length-1][0]===_){const[,A]=S[S.length-1],b=p[A];b.content=`${String(b.content||"")}
|
|
116
|
-
${v}`,b.loading=!1,S.pop(),p.splice(y,1),y--}continue}else if(S.length>0){if(k.type==="paragraph_open"||k.type==="paragraph_close"){p.splice(y,1),y--;continue}const _=k.content||"",I=new RegExp(`<\\s*\\/\\s*${S[S.length-1][0]}\\s*>`,"i").test(_);if(_){const[,A]=S[S.length-1],b=p[A];b.content=`${b.content||""}
|
|
117
|
-
${_}`,b.loading!==!1&&(b.loading=!I)}I&&S.pop(),p.splice(y,1),y--}else continue}if(g.size>0){const y=new Map,k=new Map,v=A=>{let b=y.get(A);return b||(b=new RegExp(`<\\s*${A}\\b`,"i"),y.set(A,b)),b},_=A=>{let b=k.get(A);return b||(b=new RegExp(`<\\s*\\/\\s*${A}\\s*>`,"i"),k.set(A,b)),b},I=[];for(let A=0;A<p.length;A++){const b=p[A],M=String(b.content??"");if(I.length>0){const D=I[I.length-1],$=p[D.index],O=b.type==="html_block"?_(D.tag).exec(M):null;if(O){const F=O.index+O[0].length,V=M.slice(0,F),K=M.slice(F);$.content=`${String($.content??"")}
|
|
118
|
-
${V}`,Array.isArray($.children)&&$.children.push({type:"html_inline",content:`</${D.tag}>`,raw:`</${D.tag}>`}),I.pop();const Z=d($,K)?[]:c(K,u(p,A,"paragraph"));Z.length?p.splice(A,1,...Z):(p.splice(A,1),A--);continue}if(b.type!=="inline")continue;const P=Array.isArray(b.children)?b.children:[],R=qR(P,D.tag);if(R!==-1){const F=P.slice(0,R+1),V=P.slice(R+1),K=F.map(Z=>String(Z?.content??Z?.raw??"")).join("");if($.content=`${String($.content??"")}
|
|
119
|
-
${K}`,Array.isArray($.children)&&$.children.push(...F),V.length){const Z=V.map(G=>String(G.content??G.raw??"")).join("");if(Z.trim()){const G=Z.replace(/^\s+/,"");if(d($,Z))p.splice(A,1),A--;else if(G.startsWith("<"))p.splice(A,1,{type:"html_block",content:G});else{const X=c(Z,u(p,A,"paragraph"));p.splice(A,1,...X)}}else p.splice(A,1),A--}else p.splice(A,1),A--;I.pop();continue}$.content=`${String($.content??"")}
|
|
120
|
-
${M}`,Array.isArray($.children)&&$.children.push(...P),p.splice(A,1),A--;continue}if(b.type!=="inline")continue;const N=Array.isArray(b.children)?b.children:[];for(const D of g)if((N.length?jR(N,D):v(D).test(M)&&!_(D).test(M)?1:0)>0){I.push({tag:D,index:A});break}}}{let y=0;for(let k=0;k<p.length;k++){const v=p[k];if(v.type==="paragraph_open"){y++;continue}v.type==="paragraph_close"&&(y>0?y--:(p.splice(k,1),k--))}}for(let y=0;y<p.length;y++){const k=p[y];if(k.type==="html_block"){const b=(k.content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(b.startsWith("!")||b.startsWith("?")){k.loading=!1;continue}if(g.has(b)){const R=String(k.content??""),F=kn(R),V=F===-1?null:Bb(R,b,F+1);k.loading=V?!1:k.loading!==void 0?k.loading:!0;const K=V?.start??-1,Z=V?V.end-V.start:0;if(K!==-1){const G=R.slice(0,K+Z);let X="";F!==-1&&F<K&&(X=R.slice(F+1,K)),k.children=[{type:b,content:X,raw:G,attrs:[],tag:b,loading:!1}],k.content=G,k.raw=G;const pe=c(R.slice(K+Z)||"","text");pe.length&&p.splice(y+1,0,...pe)}else k.children=[{type:b,content:"",raw:R,attrs:[],tag:b,loading:!0}];continue}if(["br","hr","img","input","link","meta","div","p","ul","li"].includes(b))continue;k.type="inline";const M=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let N;for(;(N=M.exec(k.content||""))!==null;)N[1],N[2]||N[3]||N[4];const D=String(k.content??""),$=new RegExp(`<\\/\\s*${b}\\s*>`,"i").exec(D),O=$?$.index:-1,P=$?$[0].length:0;if(O!==-1){const R=D.slice(0,O+P),F=(D.slice(O+P)||"").replace(/^\s+/,"");k.children=[{type:"html_block",content:R,tag:b,loading:!1}],k.content=R,k.raw=R,F&&p.splice(y+1,0,F.startsWith("<")?{type:"html_block",content:F}:{type:"text",content:F,raw:F})}else k.children=[{type:"html_block",content:k.content,tag:b,loading:!0}];continue}if(!k||k.type!=="inline")continue;if(k.children.length===2&&k.children[0].type==="html_inline"){const b=(k.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase(),M=k.children[1],N=String(M?.content??"").match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??"";if(M?.type==="html_inline"&&N===b)continue;f.has(b)?(k.children[0].loading=!0,k.children[0].tag=b,k.children.push({type:"html_inline",tag:b,loading:!0,content:`</${b}>`})):k.children=[{type:"html_block",loading:!0,tag:b,content:String(k.children[0]?.content??"")+String(k.children[1]?.content??"")}];continue}else if(k.children.length===3&&k.children[0].type==="html_inline"&&k.children[2].type==="html_inline"){const b=(k.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(f.has(b))continue;k.children=[{type:"html_block",loading:!1,tag:b,content:k.children.map(M=>M.content).join("")}];continue}if(!k.content?.startsWith("<")||k.children?.length!==1)continue;const v=String(k.content),_=k,I=_.children[0];if(I?.type!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(v)&&(_.children.length=0);continue}const A=String(I.content??v).match(UR)?.[1]?.toLowerCase()??"";if(A){if(/\/\s*>\s*$/.test(v)||Px.has(A)){_.children=[{type:"html_inline",content:v}];continue}_.children.length=0}}})}function t7(e){const t=e.trim();return!t||/^&[a-z0-9#]+;/i.test(t)?!1:!!(/^(?:const|let|var|function|class|import|export|if|for|while|return|await|async|yield|try|catch|throw|new|typeof|instanceof|switch|case|break|continue|def|ruby|perl|print|echo|true|false|null|undefined|NaN|Infinity|this)\b/.test(t)||/[a-z_$][\w$]*(?:\.[a-z_$][\w$]*|\['[^']*'\]|\["[^"]*"\]|\[\d+\])*\s*\(/i.test(t)||/[a-z_$][\w$]*(?:\.[a-z_$][\w$]*|\['[^']*'\]|\["[^"]*"\]|\[[\d+\]])+/i.test(t)||/\w+\s*(?:===?|!==?|<=?|>=?|\+\+|--|&&|\|\||\?\.)/.test(t)||/^(?:!!|\+\+|--)\s*\w/.test(t)||/[\w$]+\s*(?:\+=|-=|\*=|\/=|%=|\*\*=|=)/.test(t)||/^(?:https?:\/\/|ftp:\/\/|file:\/\/|\/\/|www\.)/i.test(t)||/`[^`]*\$\{[^}]*\}[^`]*`/.test(t)||/<\/?[A-Z][a-zA-Z0-9]*/.test(t)||/<[a-z][a-z0-9]*\s[^>]+>/.test(t)||/^(["'`]).*\1\s*[;,]?$/.test(t)||/^\[[\s\S]*\]$/.test(t)||/^\{[\s\S]*\}$/.test(t)||/^\(\s*\)$/.test(t)||/[\w$]+(?:\s*[+\-*/%<>=!&|^~:]+\s*[\w$]+|\s*\.\s*[\w$]+)/.test(t)||/=>|->|::/.test(t)||/^@[\w.$]+$/.test(t)||/^(?:0x[0-9a-fA-F]+|0b[01]+|0o[0-7]+|\d+(?:\.\d*)?(?:px|em|rem|%|vh|vw|deg|s|ms)?)$/.test(t)||/^\$[\w$]+\s*[=:]/.test(t)||/\|\s*\w+|\w+\s*\|/.test(t)||/^(?:git|npm|yarn|pnpm|bun|pip|cargo|go|rust|python|node|java|mvn|gradle|docker|kubectl)\s+/.test(t)||/(?:console|window|document|Math|JSON|Date|Array|Object|String|Number|Boolean)\.[a-zA-Z]/.test(t)||/^(?:\/\/|#|\/\*|\*\/|<!--|-->)/.test(t)||/^(?:<<<|<<\s*['"]?\w+['"]?)/.test(t))}function n7(e,t={}){t.enabled!==!1&&e.core.ruler.after("inline","fix_indented_code_block",n=>{const s=n.tokens??[];for(let o=0;o<s.length;o++){const i=s[o];if(i.type!=="code_block")continue;const r=String(i.content??"").trim();if(!r)continue;const l=r.split(/\r?\n/).filter(a=>a.trim().length>0);if(l.length===1&&!t7(l[0]??"")){const a=l[0]??"",c=i.level??0;s.splice(o,1,{type:"paragraph_open",tag:"p",nesting:1,level:c},{type:"inline",tag:"",nesting:0,level:c,content:a,children:[{type:"text",content:a,level:c+1,raw:a}],block:!0},{type:"paragraph_close",tag:"p",nesting:-1,level:c}),o+=2}}})}const Dx=/\.([a-z0-9]{1,15})$/i,s7=/[_()[\]{}<>]/u,o7=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,i7=/[?#@]/u,r7=/[\\/]/u,l7=/^[\p{L}\p{N}./\\-]+$/u,a7=/^[A-Za-z0-9-]{1,63}$/u,c7=/^xn--[a-z0-9-]{2,59}$/i,u7=/^(?:[A-Z]{1,6}|\d{1,8})$/u,d7=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,f7=/文件名\s*[::]?|附件\s*[::]?|路径\s*[::]?|路徑\s*[::]?|文件列表\s*[::]?|文档列表\s*[::]?|文檔列表\s*[::]?|\bfile\s*names?\b\s*[::]?|\battachments?\b\s*[::]?|\bpaths?\b\s*[::]?|\bfile\s+lists?\b\s*[::]?|\bdocument\s+lists?\b\s*[::]?/iu,h7=/文件名\s*[::]?|文件\s*[::]?|附件\s*[::]?|档案\s*[::]?|檔案\s*[::]?|文档\s*[::]?|文檔\s*[::]?|资料\s*[::]?|資料\s*[::]?|路径\s*[::]?|路徑\s*[::]?|\bfile\s*name\b\s*[::]?|\battachments?\b\s*[::]?|\bfiles?\b\s*[::]?|\bdocuments?\b\s*[::]?|\bdocs?\b\s*[::]?|\bpaths?\b\s*[::]?/iu,p7=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,m7=new Set(["ai","md","py","rs","sh","zip"]),Bx=new Set(["as","bj","de","hk","l","ln","ny","pa","sh","ss","sz","t","us"]),g7=new Set([...Bx,"at","ax","cn","co","it","jp","ks","mc","mx","nz","pl","sa","si","to","tw"]),v7=new Set(["com","dev","io","page","site"]),y7=new Set(["app","apk","dmg","exe","ipa","lock","log","markdown","webmanifest"]),k7=new Set(["7z","ai","astro","avi","bash","bz2","c","cjs","cpp","cs","csv","doc","docx","fish","flac","gif","go","gz","h","hpp","html","java","jpeg","jpg","js","json","jsx","kt","md","mdx","mjs","mov","mp3","mp4","pdf","php","png","ppt","pptx","ps1","py","rar","rb","rs","sh","sql","svg","swift","svelte","tar","tgz","toml","ts","tsx","txt","vue","wav","webp","xls","xlsx","xml","yaml","yml","zip","zsh"]);function Kc(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function om(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return Kc(n)?n:void 0}function Hb(e,t){if(!Kc(t))return e;const n=e?.__linkifyDemotionContext;return{...e,__linkifyDemotionContext:{filename:n?.filename||t?.filename,explicitFilename:n?.explicitFilename||t?.explicitFilename,marketTicker:n?.marketTicker||t?.marketTicker}}}function Wb(e){const t=au(e);return Kc(t)?t:void 0}function b7(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,"").replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,"")}function Ub(e,t){if(!Kc(t))return;const n=String(e??"").trim().split(/\s+/u).map(b7).filter(Boolean);if(n.length===0)return;const s={};return t?.filename&&n.every(o=>_f(o,{filename:!0,explicitFilename:t.explicitFilename}))&&(s.filename=!0),t?.explicitFilename&&s.filename&&(s.explicitFilename=!0),t?.marketTicker&&n.every(o=>_f(o,{marketTicker:!0}))&&(s.marketTicker=!0),Kc(s)?s:void 0}function Ar(e,t=!1){let n;return{options(s){return t||s==null?Hb(e,n):Hb(e,om(Wb(s),Ub(s,n)))},remember(s){const o=Wb(s);n=t?om(n,o):om(o,Ub(s,n))},reset(){n=void 0}}}function qb(e){return a7.test(e)&&!e.startsWith("-")&&!e.endsWith("-")}function _7(e){const t=e.split(".");if(t.length<2)return!1;const n=t[t.length-1]?.toLowerCase()??"";return qb(n)||c7.test(n)?t.every(qb):!1}function Fx(e){return Array.from(e).some(t=>t.charCodeAt(0)>127)}function w7(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??""}function S7(e){return e.split(".").some(t=>t.toLowerCase().startsWith("xn--"))}function Hx(e,t,n){const s=w7(t);return Fx(e)&&S7(s)&&String(n??"").toLowerCase().includes(s.toLowerCase())}function au(e){const t=String(e??"");return{explicitFilename:f7.test(t),filename:h7.test(t),marketTicker:p7.test(t)}}function C7(e){return _7(e.split(/[\\/]/)[0]??"")}function x7(e){const t=e.replace(/[^a-z]/gi,"");return t.length>=2&&t===t.toUpperCase()}function T7(e){if(s7.test(e)||!l7.test(e))return!0;if(r7.test(e))return!C7(e);const t=e.replace(Dx,"");return Fx(t)?!0:t.split(".").filter(Boolean).some(x7)}function M7(e,t,n){if(!(n?g7:Bx).has(t))return!1;const s=e.slice(0,-(t.length+1));return s===""?e.startsWith("."):(n?d7:u7).test(s)}function _f(e,t={}){if(!e||o7.test(e)||i7.test(e))return!1;const n=e.match(Dx);if(!n)return!1;const s=String(n[1]??"").toLowerCase();return M7(e,s,t.marketTicker===!0)?!0:k7.has(s)?!m7.has(s)||t.filename?!0:T7(e):!!(t.explicitFilename&&v7.has(s)||t.filename&&y7.has(s))}const jb=["!"];function Ls(e){return{type:"text",content:e,raw:e}}function jr(e,t){t===1?e.push({type:"em_open",tag:"em",nesting:1}):t===2?e.push({type:"strong_open",tag:"strong",nesting:1}):t===3&&(e.push({type:"strong_open",tag:"strong",nesting:1}),e.push({type:"em_open",tag:"em",nesting:1}))}function zr(e,t){t===1?e.push({type:"em_close",tag:"em",nesting:-1}):t===2?e.push({type:"strong_close",tag:"strong",nesting:-1}):t===3&&(e.push({type:"em_close",tag:"em",nesting:-1}),e.push({type:"strong_close",tag:"strong",nesting:-1}))}function Ji(e,t,n){let s="";if(t.includes('"')){const o=t.split('"');t=o[0].trim(),s=o[1].trim()}return{type:"link",loading:n,href:t,title:s,text:e,children:[{type:"text",content:e,raw:e}],raw:`[${e}](${t})`}}function A7(e,t){if(!(!e||!t)&&(e.href=String(e.href??"")+t,e.text=String(e.text??"")+t,e.raw=`[${e.text}](${e.href})`,Array.isArray(e.children)&&e.children.length)){const n=e.children[e.children.length-1];n?.type==="text"?(n.content=String(n.content??"")+t,n.raw=String(n.raw??"")+t):e.children.push(Ls(t))}}function zb(e,t){let n=-1;for(const s of t){const o=e.indexOf(s);o!==-1&&(n===-1||o<n)&&(n=o)}return n}function E7(e){const t=e.attrs?.find(n=>n?.[0]==="href")?.[1];return typeof t=="string"?t:""}function I7(e,t){if(!e)return;e.attrs=Array.isArray(e.attrs)?e.attrs:[];const n=e.attrs.findIndex(s=>s?.[0]==="href");n>=0?e.attrs[n][1]=t:e.attrs.push(["href",t])}function $7(e,t,n){let s="";for(let o=t+1;o<n;o++){const i=e[o];if(i?.type!=="text"||typeof i.content!="string")return null;s+=i.content}return s||null}function N7(e){e.core.ruler.after("inline","fix_link_tokens",t=>{const n=t.tokens??[];for(let s=0;s<n.length;s++){const o=n[s];if(o&&o.type==="inline"&&Array.isArray(o.children))try{o.children=L7(o.children,typeof o.content=="string"?o.content:void 0)}catch(i){console.error("[applyFixLinkTokens] failed to fix inline children",i)}}})}function L7(e,t){if(e.length<3||e.some(s=>s.type==="code_inline"))return e;const n=au(t);for(let s=0;s<=e.length-1;s++){s<0&&(s=0);const o=e[s];if(!o)break;if(o.type==="link_open"&&(o.markup==="linkify"||o.markup==="autolink")){let i=-1;for(let r=s+1;r<e.length;r++)if(e[r]?.type==="link_close"){i=r;break}if(i!==-1){const r=$7(e,s,i),l=E7(o);if(o.markup==="linkify"&&r&&!Hx(r,l,t)&&_f(r,n)){e.splice(s,i-s+1,Ls(r));continue}const a=zb(l,jb);for(let c=s+1;c<i;c++){const u=e[c];if(u?.type!=="text"||typeof u.content!="string")continue;const d=zb(u.content,jb);if(d===-1)continue;const h=u.content[d],p=u.content.slice(0,d);let f=u.content.slice(d);for(let S=c+1;S<i;S++){const y=e[S];y?.type==="text"&&typeof y.content=="string"&&(f+=y.content)}u.content=p,u.raw=p;const g=i-(c+1);g>0&&(e.splice(c+1,g),i=c+1);let w=l;if(a!==-1)w=l.slice(0,a);else if(f){const S=encodeURI(f);if(S&&l.endsWith(S))w=l.slice(0,l.length-S.length);else{const y=h?encodeURI(h):"",k=y?l.indexOf(y):-1;k!==-1&&(w=l.slice(0,k))}}w!==l&&I7(o,w),f&&e.splice(i+1,0,Ls(f));break}}}if(o?.type==="em_open"&&e[s-1]?.type==="text"&&e[s-1].content?.endsWith("*")){const i=e[s-1].content?.replace(/(\*+)$/,"")||"";e[s-1].content=i,o.type="strong_open",o.tag="strong",o.markup="**";for(let r=s+1;r<e.length;r++)if(e[r]?.type==="em_close"){e[r].type="strong_close",e[r].tag="strong",e[r].markup="**";break}}else if(o?.type==="text"&&o.content?.endsWith("(")&&e[s+1]?.type==="link_open"){const i=o.content.match(/\[([^\]]+)\]/);if(i){let r=o.content.slice(0,i.index);const l=r.match(/(\*+)$/),a=[];if(l){r=r.slice(0,l.index),r&&a.push(Ls(r));const c=i[1],u=l[1].length;jr(a,u);let d=e[s+2]?.content||"";if(e[s+4]?.type==="text"&&!e[s+4].content?.startsWith(")")&&(d+=e[s+4]?.content||"",e[s+4].content=""),a.push(Ji(c,d,!e[s+4]?.content?.startsWith(")"))),zr(a,u),e[s+4]?.type==="text"){const h=e[s+4].content?.replace(/^\)\**/,"");h&&a.push(Ls(h)),e.splice(s,5,...a)}else e.splice(s,4,...a)}else{r&&a.push(Ls(r));let c=i[1];const u=c.match(/^\*+/);if(u){const h=u[0].length;c=c.replace(/^\*+/,"").replace(/\*+$/,"");let p=e[s+2]?.content||"";if(e[s+4]?.type==="text"&&!e[s+4].content?.startsWith(")")&&(p+=e[s+4]?.content||"",e[s+4].content=""),jr(a,h),a.push(Ji(c,p,!e[s+4]?.content?.startsWith(")"))),zr(a,h),e[s+4]?.type==="text"){const f=e[s+4].content?.replace(/^\)/,"");f&&a.push(Ls(f)),e.splice(s,5,...a)}else e.splice(s,4,...a);s===0?s=a.length-1:s-=a.length+1;continue}let d=e[s+2]?.content||"";if(e[s+4]?.type==="text"&&!e[s+4].content?.startsWith(")")&&(d+=e[s+4]?.content||"",e[s+4].content=""),a.push(Ji(c,d,!e[s+4]?.content?.startsWith(")"))),e[s+4]?.type==="text"){const h=e[s+4].content?.replace(/^\)/,"");h&&a.push(Ls(h)),e.splice(s,5,...a)}else e.splice(s,4,...a)}s-=a.length+1;continue}}else if(o.type==="link_open"&&o.markup==="linkify"&&e[s-1]?.type==="text"&&e[s-1].content?.endsWith("(")){if(e[s-2]?.type==="link_close"){const i=[],r=e[s-3].content||"";let l=o.attrs?.find(a=>a[0]==="href")?.[1]||"";if(e[s+3]?.type==="text"){const a=(e[s+3]?.content??"").indexOf(")"),c=a===-1;a===-1&&(l+=e[s+3]?.content?.slice(0,a)||"",e[s+3].content=""),i.push(Ji(r,l,c));const u=e[s+3].content?.replace(/^\)\**/,"");u&&i.push(Ls(u)),e.splice(s-4,8,...i)}else i.push({type:"link",loading:!0,href:l,title:"",text:r,children:[{type:"text",content:l,raw:l}],raw:`[${r}](${l})`}),e.splice(s-4,7,...i);continue}else if(e[s-1].content==="]("&&e[s-3]?.type==="text"&&e[s-3].content?.endsWith(")"))if(e[s-2]?.type==="strong_open"){const[i,r]=e[s-3].content?.split("[**")||[];e[s+1].content=r||"",e[s-3].content=i||"",e[s-1].content=""}else if(e[s-2]?.type==="em_open"){const[i,r]=e[s-3].content?.split("[*")||[];e[s+1].content=r||"",e[s-3].content=i||"",e[s-1].content=""}else{const[i,r]=e[s-3].content?.split("[")||[];e[s+1].content=r||"",e[s-3].content=i||"",e[s-1].content=""}}if(o.type==="link_close"&&o.nesting===-1&&e[s-2]?.type==="link_open"&&e[s+1]?.type==="text"&&e[s-1]?.type==="text"){const i=e[s-1].content||"",r=e[s-2].attrs||[],l=r.find(f=>f[0]==="href")?.[1]||"",a=r.find(f=>f[0]==="title")?.[1]||"";let c=3,u=2;const d=(e[s-3]?.content||"").match(/^(\*+)$/),h=[];if(d){u+=1;const f=d[1].length;jr(h,f)}if(o.markup!=="linkify"&&e[s+1].type==="text"&&e[s+1]?.content?.startsWith("](")){c+=1;for(let f=s+1;f<e.length;f++){const g=d?d[1].length:e[s-3].markup.length,w=e[f];if(g===1&&w.type==="em_close")break;if(g===2&&w.type==="strong_close")break;if(g===3&&(w.type==="em_close"||w.type==="strong_close"))break;c+=1}}const p={type:"link",loading:!1,href:l,title:a,text:i,children:[{type:"text",content:i,raw:i}],raw:`[${i}](${l})`};if(h.push(p),d){const f=d[1].length;zr(h,f)}e.splice(s-u,c,...h),s-=h.length+1;continue}else if(o.content?.startsWith("](")&&e[s-1].markup?.includes("*")&&e[s-4]?.type==="text"&&e[s-4].content?.endsWith("[")){const i=e[s-1].markup.length,r=[],l=e[s-4].content.slice(0,e[s-4].content.length-i);l&&r.push(Ls(l)),jr(r,i);const a=e[s-2].content||"";let c=o.content.slice(2),u=!0;if(e[s+1]?.type==="text"){const d=(e[s+1]?.content??"").indexOf(")");u=d===-1,d===-1&&(c+=e[s+1]?.content?.slice(0,d)||"",e[s+1].content="")}if(r.push(Ji(a,c,u)),zr(r,i),e[s+1]?.type==="text"){const d=e[s+1].content?.replace(/^\)\**/,"");d&&r.push(Ls(d)),e.splice(s-4,8,...r)}else e[s+1]?.type==="link_open"?e.splice(s-4,10,...r):e.splice(s-4,7,...r);s-=r.length+1;continue}else if(o.content?.startsWith("](")&&e[s-1].type==="strong_close"&&e[s-4]?.type==="text"&&e[s-4]?.content?.includes("**[")){const i=[],r=e[s-4].content.split("**[")[0];r&&i.push(Ls(r)),jr(i,2);const l=e[s-2].content||"";let a=o.content.slice(2),c=!0;if(e[s+1]?.type==="text"){const u=(e[s+1]?.content??"").indexOf(")");c=u===-1,u===-1&&(a+=e[s+1]?.content?.slice(0,u)||"",e[s+1].content="")}if(i.push(Ji(l,a,c)),zr(i,2),e[s+1]?.type==="text"){const u=e[s+1].content?.replace(/^\)\**/,"");u&&i.push(Ls(u)),e.splice(s-4,8,...i)}else e[s+1]?.type==="link_open"?e.splice(s-4,10,...i):e.splice(s-4,7,...i);s-=i.length+1;continue}else if(o.type==="strong_close"&&e[s+1]?.type==="text"&&e[s+1].content?.includes("](")&&e[s-1].type==="text"&&/\[.*$/.test(e[s-1].content||"")){const i=[],[r,l]=e[s-1].content?.split("[")||["",""];r&&i.push(Ls(r)),jr(i,2);let[a,c]=e[s+1].content.split("](");a=l+a;let u=4;if(e[s+2]?.type==="link_open"){const h=e[s+2].attrs?.find(p=>p[0]==="href")?.[1];e[s+5]?.type==="text"&&e[s+5].content==="."?(c=(h||c)+e[s+5].content,e[s+5].content=""):c=h||c,u+=3}let d=!0;if(o.nesting===-1&&(a=a.replace(/\*+$/,"")),e[s+2]?.type==="text"){const h=(e[s+2]?.content??"").indexOf(")");d=h===-1,h===-1&&(c+=e[s+2]?.content?.slice(0,h)||"",e[s+2].content="")}i.push(Ji(a,c,d)),zr(i,2),e.splice(s-2,u,...i)}if(o.type==="text"&&/\*+\[[^\]]*$/.test(o.content||"")&&e[s+1]?.type==="strong_open"&&e[s+2]?.type==="text"&&e[s+2].content==="]("&&e[s+3]?.type==="link_open"&&e[s+5]?.type==="link_close"&&e[s+6]?.type==="text"&&e[s+6].content===")"&&e[s+7]?.type==="strong_close"){const i=(o.content||"").match(/^(\*+)\[(.*)$/);if(i){const r=(i[2]||"")+i[1];let l=e[s+3]?.attrs?.find(c=>c[0]==="href")?.[1]||"";!l&&e[s+4]?.type==="text"&&(l=e[s+4].content||"");const a=[];jr(a,2),a.push(Ji(r,l,!1)),zr(a,2),e.splice(s,9,...a),s-=a.length-1;continue}}}for(let s=0;s<e.length-1;s++){const o=e[s],i=e[s+1];if(o?.type!=="link"||i?.type!=="text"||typeof i.content!="string"||!i.content.startsWith("!"))continue;const r=String(o.href??"");if(String(o.text??"")!==r||!r.endsWith("=")&&!r.endsWith("#"))continue;A7(o,"!");const l=i.content.slice(1);l?(i.content=l,i.raw=l):e.splice(s+1,1)}return e}function O7(e){e.core.ruler.after("inline","fix_list_item_tokens",t=>{const n=t.tokens??[];for(let s=0;s<n.length;s++){const o=n[s];if(o&&o.type==="inline"&&Array.isArray(o.children))try{o.children=P7(o.children)}catch(i){console.error("[applyFixListItem] failed to fix inline children",i)}}})}function P7(e){const t=e[e.length-1],n=String(t?.content??"");return t?.type==="text"&&/^\s*\d+\.\s*$/.test(n)&&e[e.length-2]?.tag==="br"&&e.splice(e.length-1,1),e}function R7(e){e.core.ruler.after("inline","fix_strong_tokens",t=>{const n=t.tokens??[];for(let s=0;s<n.length;s++){const o=n[s];if(o&&o.type==="inline"&&Array.isArray(o.children))try{o.children=D7(o.children)}catch(i){console.error("[applyFixStrongTokens] failed to fix inline children",i)}}})}function D7(e){let t=0;const n=new Set,s=new Set;let o=0;for(let u=0;u<e.length;u++){const d=e[u],h=d.type;if(h==="strong_open"){t++;const p=String(d.markup??"");let f=u-1;for(;f>=0&&e[f].type==="text"&&e[f].content==="";)f--;const g=e[f];let w=u+1;for(;w<e.length&&e[w].type==="text"&&e[w].content==="";)w++;const S=e[w];p==="__"&&(g?.content?.endsWith("_")||S?.content?.startsWith("_")||S?.markup?.includes("_"))&&(d.type="text",d.tag="",d.content=p,d.raw=p,d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null,n.add(t))}else if(h==="strong_close")n.has(t)&&d.markup==="__"&&(d.type="text",d.content=d.markup,d.raw=String(d.markup??""),d.tag="",d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null),t--,t<0&&(t=0);else if(h==="em_open"){o++;const p=String(d.markup??"");let f=u-1;for(;f>=0&&e[f].type==="text"&&e[f].content==="";)f--;const g=e[f];let w=u+1;for(;w<e.length&&e[w].type==="text"&&e[w].content==="";)w++;const S=e[w];p==="_"&&(g?.content?.endsWith("_")||S?.content?.startsWith("_")||S?.markup?.includes("_"))&&(d.type="text",d.tag="",d.content=p,d.raw=p,d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null,s.add(o))}else h==="em_close"&&(s.has(o)&&d.markup==="_"&&(d.type="text",d.content=d.markup,d.raw=String(d.markup??""),d.tag="",d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null),o--,o<0&&(o=0))}if(e.length<5)return e;const i=e.length-4,r=e[i];let l=[...e];const a=e[i+1],c=String(r.content??"");if(r.type==="link_open"&&e[i-1]?.type==="em_open"&&e[i-2]?.type==="text"&&e[i-2].content?.endsWith("*")){const u=String(e[i-2].content??"").slice(0,-1),d=[{type:"strong_open",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""},e[i],e[i+1],e[i+2],{type:"strong_close",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""}];u&&d.unshift({type:"text",content:u,raw:u}),l.splice(i-2,6,...d)}else if(r.type==="text"&&c.endsWith("*")&&a.type==="em_open"){const u=e[i+2],d=u?.type==="text"?4:3,h=[{type:"strong_open",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""},{type:"text",content:u?.type==="text"?String(u.content??""):"",raw:u?.type==="text"?String(u.content??""):""},{type:"strong_close",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""}],p=c.slice(0,-1);p&&h.unshift({type:"text",content:p,raw:p}),l.splice(i,d,...h)}return l=B7(l),l}function B7(e){if(e.length<7)return e;const t=[];for(let n=0;n<e.length;n++){const s=e[n],o=e[n+1],i=e[n+2],r=e[n+3],l=e[n+4],a=e[n+5],c=e[n+6];if(s?.type==="strong_open"&&o?.type==="text"&&i?.type==="strong_close"&&r?.type==="strong_open"&&l?.type==="math_inline"&&a?.type==="strong_close"&&c?.type==="text"){const u=String(c.content??""),d=u.indexOf("**");if(d!==-1){const h=u.slice(0,d),p=u.slice(d+2);t.push(s),t.push(o),t.push(l),h&&t.push({...c,type:"text",content:h,raw:h}),t.push(a),p&&t.push({...c,type:"text",content:p,raw:p}),n+=6;continue}}if(s?.type==="strong_open"&&o?.type==="text"&&i?.type==="strong_close"&&r?.type==="strong_open"&&l?.type==="math_inline"&&a?.type==="strong_close"){const u=F7(e,n+6);if(u){t.push(s),t.push(o),t.push(l);for(let d=n+6;d<u.index;d++)t.push(e[d]);u.beforeClose&&t.push({...e[u.index],type:"text",content:u.beforeClose,raw:u.beforeClose}),t.push(a),u.afterClose&&t.push({...e[u.index],type:"text",content:u.afterClose,raw:u.afterClose}),n=u.index;continue}}t.push(s)}return t}function F7(e,t){for(let n=t;n<e.length;n++){const s=e[n];if(s?.type==="strong_open")return null;if(s?.type!=="text")continue;const o=String(s.content??""),i=o.indexOf("**");if(i!==-1)return{index:n,beforeClose:o.slice(0,i),afterClose:o.slice(i+2)}}return null}function H7(e){e.core.ruler.after("block","fix_table_tokens",t=>{const n=t;try{const s=V7(n.tokens??[],!!n.env?.__markstreamFinal,n.src??"");Array.isArray(s)&&(n.tokens=s)}catch(s){console.error("[applyFixTableTokens] failed to fix table tokens",s)}})}function Vb(){return[{type:"table_open",tag:"table",attrs:null,map:null,children:null,content:"",markup:"",info:"",level:0,loading:!0,meta:null},{type:"thead_open",tag:"thead",attrs:null,block:!0,level:1,children:null},{type:"tr_open",tag:"tr",attrs:null,block:!0,level:2,children:null}]}function Kb(){return[{type:"tr_close",tag:"tr",attrs:null,block:!0,level:2,children:null},{type:"thead_close",tag:"thead",attrs:null,block:!0,level:1,children:null},{type:"table_close",tag:"table",attrs:null,map:null,children:null,content:"",markup:"",info:"",level:0,meta:null}]}function Gb(e){return[{type:"th_open",tag:"th",attrs:null,block:!0,level:3,children:null},{type:"inline",tag:"",children:null,content:e,level:4,attrs:null,block:!0},{type:"th_close",tag:"th",attrs:null,block:!0,level:3,children:null}]}function Wx(e,t){if(!e.startsWith("|")||e.includes(`
|
|
121
|
-
`)||!e.endsWith("|"))return null;const n=e.slice(1).split("|");return n.at(-1)===""&&n.pop(),n.length>0&&n.every(s=>s.trim().length>0)?n:null}function im(e){return Wx(e)!==null}function Ux(e){return/^:?-+:?$/.test(e.trim())}function W7(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(Ux)}function U7(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function q7(e){if(e==="")return!0;if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|"),n=t.at(-1)??"";return t.slice(0,-1).every(Ux)&&U7(n)}function j7(e){return e==="|"||e==="|:"}function z7(e){const t=Wx(e);return t!==null&&t.every(n=>!n.includes(":"))}function V7(e,t=!1,n=""){const s=[...e];if(e.length<3)return s;const o=e.length-2,i=e[o];if(i.type==="inline"){const r=String(i.content??""),l=r.split(`
|
|
122
|
-
`)[0]??"",[a="",c="",...u]=r.split(`
|
|
123
|
-
`),d=!t&&!r.includes(`
|
|
124
|
-
`)&&/\r?\n$/.test(n)&&im(r);if(!t&&(r.includes(`
|
|
125
|
-
`)&&u.length===0&&im(a)&&q7(c)||d)){const h=l.slice(1,-1).split("|").map(f=>f.trim()).flatMap(f=>Gb(f)),p=[...Vb(),...h,...Kb()];s.splice(o-1,3,...p)}else if(r.includes(`
|
|
126
|
-
`)&&u.length===0&&im(a)&&W7(c)){const h=l.slice(1,-1).split("|").map(f=>f.trim()).flatMap(f=>Gb(f)),p=[...Vb(),...h,...Kb()];s.splice(o-1,3,...p)}else r.includes(`
|
|
127
|
-
`)&&u.length===0&&z7(a)&&j7(c)&&(i.content=r.slice(0,-2),i.children.splice(2,1))}return s}function K7(e,t,n,s){const o=e.length;if(n==="$$"&&s==="$$"){let c=t;for(;c<o-1;){if(e[c]==="$"&&e[c+1]==="$"){let u=c-1,d=0;for(;u>=0&&e[u]==="\\";)d++,u--;if(d%2===0)return c}c++}return-1}const i=n[n.length-1],r=s;let l=0,a=t;for(;a<o;){if(e.slice(a,a+r.length)===r){let u=a-1,d=0;for(;u>=0&&e[u]==="\\";)d++,u--;if(d%2===0){if(l===0)return a;l--,a+=r.length;continue}}const c=e[a];if(c==="\\"){a+=2;continue}c===i?l++:c===r[r.length-1]&&l>0&&l--,a++}return-1}var G7=K7;const Y7=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],wf=Y7.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),X7=/\\[a-z]+/i,qx="(?:\\\\|\\u0008)",Z7=new RegExp(String.raw`${qx}(?:${wf})\s*\{[^}]+\}`,"i"),J7=new RegExp(String.raw`(?:${qx})?(?:${wf})\s*\{`,"i"),Q7=/\\(?:text|frac|left|right|times)/,eD=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,tD=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,nD=/[A-Z]+\s*\([^)]+\)/i,sD=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,oD=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,iD=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,rD={"\b":"\\b","\v":"\\v","\f":"\\f"};function lD(e){let t="";for(const n of e)t+=rD[n]??n;return t}function zl(e){if(!e)return!1;const t=lD(e),n=t.trim();if(iD.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const s=X7.test(t),o=Z7.test(t),i=J7.test(t),r=Q7.test(t),l=/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)_(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t)||/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)\^(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t),a=eD.test(t)&&!tD.test(t),c=nD.test(t),u=sD.test(n),d=oD.test(t),h=/^\([a-z]\)$/i.test(n)||/^(?:[a-z]|pi)$/i.test(n),p=/^(?:[A-Z][a-z]?(?:_\{?\d+\}?|\^\{?\d+\}?)?)+$/.test(n);return s||o||i||r||l||a||c||u||d||h||p}const jx="__markstreamMathPluginApplied",$g=80,zx=2e4,Yb=zx+4096;function Vx(e){return!!e[jx]}function aD(e){e[jx]=!0}const Kx=["ldots","cdots","quad","in","displaystyle","int_","lim","lim_","ce","pu","end","infty","perp","mid","operatorname","to","rightarrow","leftarrow","math","mathrm","mathit","mathbb","mathcal","mathfrak","implies","alpha","beta","gamma","delta","epsilon","lambda","sum","sum_","prod","sqrt","fbox","boxed","color","rule","edef","fcolorbox","hline","hdashline","cdot","times","pm","le","ge","neq","sin","cos","tan","log","ln","exp","frac","text","left","right"],cD=["cdot","mathbf{","partial","mu_{"],Gx=Kx.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),Yx="[ \r\b\f\v]",uD=new RegExp(`([^\\\\])(${cD.map(e=>e).join("|")})+`,"g"),dD=/span\{([^}]+)\}/,fD=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,hD=/(^|[^\\])\\\r?\n/g,pD=/(^|[^\\])\\$/g,mD=new RegExp(`(${Yx})|(${Gx})\\b`,"g"),Xb=new Map,Zb=new Map;function gD(e){if(!e)return mD;const t=[...e];t.sort((r,l)=>l.length-r.length);const n=t.join(""),s=Xb.get(n);if(s)return s;const o=`(?:${t.map(r=>r.replace(/[.*+?^${}()|[\\]\\"\]/g,"\\$&")).join("|")})`,i=new RegExp(`(${Yx})|(${o})\\b`,"g");return Xb.set(n,i),i}function vD(e,t){const n=e?[]:[...t??[]];e||n.sort((l,a)=>a.length-l.length);const s=e?"__default__":n.join(""),o=Zb.get(s);if(o)return o;const i=e?[wf,Gx].filter(Boolean).join("|"):[n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),wf].filter(Boolean).join("|"),r=new RegExp(`(^|[^\\\\\\w])(${i})\\s*\\{`,"g");return Zb.set(s,r),r}const Jb={" ":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function Qb(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function e_(e){const t=/(^|[^\\])(__|\*\*)/g;let n,s=null;for(;(n=t.exec(e))!==null;)s={marker:n[2],index:n.index+(n[1]?.length??0)};return s}function Qi(e,t){const n=t?.commands??Kx,s=t?.escapeExclamation??!0,o=t?.commands==null,i=gD(o?void 0:n);let r=e.replace(i,(c,u,d,h,p)=>{if(u!==void 0&&Jb[u]!==void 0)return`\\${Jb[u]}`;if(d&&n.includes(d)){const f=p&&typeof h=="number"?p[h-1]:void 0;return f==="\\"||f&&/\w/.test(f)?c:`\\${d}`}return c});s&&(r=r.replace(/(^|[^\\])!/g,"$1\\!"));let l=r;const a=vD(o,o?void 0:n);return l=l.replace(a,(c,u,d)=>`${u}\\${d}{`),l=l.replace(dD,"span\\{$1\\}").replace(fD,"\\operatorname{span}\\{$1\\}"),l=l.replace(hD,`$1\\\\
|
|
128
|
-
`),l=l.replace(pD,"$1\\\\"),l=l.replace(uD,"$1\\$2"),l}function t_(e){const t=e.trim();return!(!zl(t)||/"[^"\n]{1,80}"\s*:\s*/.test(t)||!(/\\[a-z]+/i.test(t)||/[=+*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/.test(t)||/[_^]/.test(t))&&/\s-\s/.test(t))}function Xx(e){const t=[];let n=0;for(;n<e.length;){if(e[n]!=="`"){n++;continue}const s=n;let o=1;for(;s+o<e.length&&e[s+o]==="`";)o++;let i=s+o,r=-1;for(;i<e.length;){if(e[i]!=="`"){i++;continue}let l=1;for(;i+l<e.length&&e[i+l]==="`";)l++;if(l===o){r=i;break}i+=l}if(r!==-1){t.push([s,r+o]),n=r+o;continue}n=s+o}return t}function Sf(e,t){for(const n of e)if(t>=n[0]&&t<n[1])return n;return null}function yD(e,t=!1){const n=[];let s=0;for(;s<e.length-1;){if(e[s]==="!"&&e[s+1]==="["){const o=s;let i=s+2,r=1;for(;i<e.length&&r>0;){if(e[i]==="\\"&&i+1<e.length){i+=2;continue}e[i]==="["?r++:e[i]==="]"&&r--,i++}if(r===0&&i<e.length&&e[i]==="("){let l=i+1,a=1;for(;l<e.length&&a>0;){if(e[l]==="\\"&&l+1<e.length){l+=2;continue}e[l]==="("?a++:e[l]===")"&&a--,l++}if(a===0){n.push([o,l]),s=l;continue}if(t){n.push([o,e.length]),s=e.length;continue}}}s++}return n}function cu(e,t){let n=t-1,s=0;for(;n>=0&&e[n]==="\\";)s++,n--;return s%2===1}function Ng(e,t){let n=t;for(;n<e.length;){const s=e.indexOf("$",n);if(s===-1)return-1;if(cu(e,s)){n=s+1;continue}return s}return-1}function rm(e,t){let n=t;for(;n<e.length;){const s=Ng(e,n);if(s===-1)return-1;if(s>0&&e[s-1]==="$"||s+1<e.length&&e[s+1]==="$"){n=s+1;continue}return s}return-1}function lc(e,t,n=0){let s=Math.max(0,n);for(;s<e.length;){const o=e.indexOf(t,s);if(o===-1)return-1;if(!cu(e,o))return o;s=o+Math.max(1,t.length)}return-1}function n_(e,t,n=0,s=e.length,o=[]){let i=0,r=Math.max(0,n);const l=Math.min(e.length,Math.max(0,s));for(;r<l;){const a=e.indexOf(t,r);if(a===-1||a>=l)break;const c=Sf(o,a);if(c){r=Math.max(a+Math.max(1,t.length),c[1]);continue}cu(e,a)||i++,r=a+Math.max(1,t.length)}return i}function mv(e,t,n){const s=Yc(String(e??""));if(!s.endsWith(t))return-1;const o=s.length-t.length;if(o<=0||!Yc(s.slice(0,o)).trim()||cu(s,o))return-1;const i=Xx(s);if(Sf(i,o))return-1;const r=n_(s,t,0,o,i);if(t==="$$"){if(r%2===1)return-1}else if(r>n_(s,n,0,o,i))return-1;return o}function Gc(e){return e===" "||e===" "}function Yc(e){let t=e.length;for(;t>0&&Gc(e[t-1]);)t--;return e.slice(0,t)}function s_(e){let t=0;for(let n=0;n<e.length;n++)e[n]===`
|
|
129
|
-
`&&t++;return t}function o_(e){if(!e)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}function kD(e){if(e.length<3)return!1;const t=e[0];if(t!=="-"&&t!=="*"&&t!=="_"&&t!=="=")return!1;let n=0;for(let s=0;s<e.length;s++){const o=e[s];if(o===t){n++;continue}if(!Gc(o))return!1}return n>=3}function bD(e){const t=e.trim();if(!t)return!1;let n=0;t[n]===":"&&n++;let s=0;for(;t[n]==="-";)s++,n++;return s<3?!1:(t[n]===":"&&n++,n===t.length)}function _D(e){if(!e.includes("|"))return!1;const t=e[0]==="|"?e.slice(1):e;return(t.endsWith("|")?t.slice(0,-1):t).split("|").every(bD)}function wD(e){let t=0;if(!o_(e[t]))return!1;for(;o_(e[t]);)t++;return e[t]!=="."&&e[t]!==")"?!1:Gc(e[t+1])}function Zx(e){const t=e.trimStart();if(!t||t.startsWith("```")||t.startsWith("~~~")||t.startsWith(":::")||t[0]===">"||t[0]==="<")return!0;if(t[0]==="#"){let n=0;for(;t[n]==="#";)n++;if(n>=1&&n<=6&&Gc(t[n]))return!0}return!!((t[0]==="-"||t[0]==="+"||t[0]==="*")&&Gc(t[1])||wD(t)||kD(t)||_D(t))}function i_(e,t){return e?t?`${e}
|
|
130
|
-
${t}`:e:t}function Lg(e){const t=String(e??"").trim();return t?zl(t):!1}function r_(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return t.toString(36)}function Jx(e){if(e.length<=Yb)return{source:e,lineOffset:0};let t=e.length-Yb;const n=e.indexOf(`
|
|
131
|
-
`,t);return n===-1?{source:"",lineOffset:s_(e)}:(t=n+1,{source:e.slice(t),lineOffset:s_(e.slice(0,t))})}function Qx(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return!1;const{source:n}=Jx(t);if(!n)return!1;const s=n.split(/\r?\n/),o=Math.max(0,s.length-$g-2),i=[["$$","$$"],["\\[","\\]"]];for(let r=o;r<s.length;r++){const l=Yc(s[r]);if(l&&!Zx(l)){for(const[a,c]of i)if(mv(l,a,c)!==-1)return!0}}return!1}function SD(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return null;const{source:n,lineOffset:s}=Jx(t);if(!n)return null;const o=n.split(/\r?\n/),i=Math.max(0,o.length-$g-2),r=[["$$","$$"],["\\[","\\]"]];for(let l=i;l<o.length-1;l++){const a=Yc(o[l]);for(const[c,u]of r){const d=mv(a,c,u);if(d===-1)continue;let h="",p=!1;for(let f=l+1;f<o.length;f++){if(f-l>$g){p=!0;break}const g=o[f],w=lc(g,u);if(w!==-1){const S=i_(h,g.slice(0,w));if(!Lg(S)){p=!0;break}const y=g.slice(w+u.length),k=y.trim()?`suffix:${r_(y)}`:"nosuffix";return["closed",c,s+l,d,s+f,w,r_(S),k].join(":")}if(Zx(g)){p=!0;break}if(h=i_(h,g),h.length>zx){p=!0;break}}if(!p&&Lg(h))return["pending",c,s+l,d].join(":")}}return null}function lm(e,t){const n=String(e??"").trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??""))}function CD(e){const t=String(e??"").trimStart(),n=t.match(/^\d+(?:,\d{3})*(?:\.\d+)?/);if(!n)return!1;const s=t.slice(n[0].length);return/^\s*(?:[+\-*/^_=<>]|\\[a-z]+)/i.test(s)?!1:s===""||/^[)\s,.!?;:]/.test(s)}function am(e){const t=String(e??"").trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function xD(e,t){aD(e);const n=(r,l,a)=>{const c=String(l??"").replace(/^[\t ]+/,"").replace(/[\t ]+$/,"");if(!c)return;const u=r.push("paragraph_open","p",1);u.map=[a,a+1];const d=r.push("inline","",0);d.content=c,d.map=[a,a+1],d.children=[],r.push("paragraph_close","p",-1)},s=(r,l)=>{const a=r,c=!!t?.strictDelimiters,u=!a?.env?.__markstreamFinal,d=(y,k)=>{let v=k;for(;v<y.length&&(y[v]===" "||y[v]===" ");)v++;if(v===k||!(y[v]===`
|
|
132
|
-
`||y[v]==="\r"&&y[v+1]===`
|
|
133
|
-
`))return k;const _=y.slice(k,v),I=a.push("text","",0);return I.content=_,v};if(/^\*[^*]+/.test(a.src))return!1;if(a.src[a.pos]==="$"){let y=a.pos+1;for(;a.src[y]==="$";)y++;const k=y-a.pos,v=a.src[y];if(k>=3&&(!v||/\s/.test(v))){const _=a.push("text","",0);return _.content=a.src.slice(a.pos,y),a.pos=y,!0}}const h=[["$$","$$"],["$","$"],["\\(","\\)"]],p=String(a.pending??""),f=Math.max(0,a.pos-p.length);let g=f,w=f;const S=f;for(const[y,k]of h){const v=a.src,_=Xx(v),I=yD(v,u);let A=!1;y==="$$"&&g!==S&&(g=S);let b=-1,M=-1,N=0;const D=$=>{if(($==="undefined"||$==null)&&($=""),$==="\\"){a.pos=a.pos+$.length,g=a.pos;return}if($==="\\)"||$==="\\("){const R=a.push("text_special","",0);R.content=$==="\\)"?")":"(",R.markup=$,a.pos=a.pos+$.length,g=a.pos;return}if(!$)return;if(y==="$$"&&$.includes("$")){let R=0;for(;R<$.length;){const F=Ng($,R);if(F===-1){const de=$.slice(R);if(de){const be=a.push("text","",0);be.content=de,a.pos=a.pos+de.length,g=a.pos}break}if(F>0&&$[F-1]==="$"||F+1<$.length&&$[F+1]==="$"){const de=$.slice(R,F+1);if(de){const be=a.push("text","",0);be.content=de,a.pos=a.pos+de.length,g=a.pos}R=F+1;continue}const V=$.slice(R,F);if(V){const de=a.push("text","",0);de.content=V,a.pos=a.pos+V.length,g=a.pos}const K=rm($,F+1);if(K===-1){const de=$.slice(F),be=a.push("text","",0);be.content=de,a.pos=a.pos+de.length,g=a.pos;break}const Z=$.slice(F+1,K),G=Z.includes("`"),X=!Z||!Z.trim(),pe=$[K+1],oe=lm(Z,pe),ye=am(Z);if(!G&&!X&&!oe&&!ye){const de=a.push("math_inline","math",0);de.content=Qi(Z,t),de.markup="$",de.raw=`$${Z}$`,de.loading=!1,a.pos=a.pos+(K-F+1),g=a.pos,R=K+1;continue}const _e=a.push("text","",0);_e.content="$",a.pos=a.pos+1,g=a.pos,R=F+1}return}const O=$.indexOf("![");if(O!==-1){if(O>0){const V=$.slice(0,O),K=a.push("text","",0);K.content=V,a.pos=a.pos+V.length,g=a.pos}const R=$.slice(O).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(R){const[,V,K]=R,Z=K.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),G=Z?Z[1]:K,X=Z&&Z[2]?Z[2]:null,pe=a.push("image","img",0);pe.attrs=[["src",G],["alt",V]],X&&pe.attrs.push(["title",X]),pe.content=V,pe.children=[{type:"text",content:V,tag:""}],a.pos=a.pos+R[0].length,g=a.pos;const oe=$.slice(O+R[0].length);oe&&D(oe);return}const F=a.push("text","",0);F.content=$,a.pos=a.pos+$.length,g=a.pos;return}const P=a.push("text","",0);P.content=$,a.pos=a.pos+$.length,g=a.pos};for(;!(g>=v.length);){const $=v.indexOf(y,g);if($===-1)break;if(cu(v,$)){g=$+Math.max(1,y.length);continue}const O=Sf(_,$);if(O){g=O[1];continue}const P=Sf(I,$);if(P){g=P[1];continue}if($===b&&g===M){if(N++,N>2){g=$+Math.max(1,y.length);continue}}else N=0,b=$,M=g;if(y==="("&&$>0){let oe=$-1;for(;oe>=0&&v[oe]===" ";)oe--;if(oe>=0&&v[oe]==="]"){g=$+y.length;continue}}if(y==="$"&&$>0&&v[$-1]==="$"){g=$+1;continue}if(y==="$"&&$<v.length-1&&v[$+1]==="$"){g=$+2;continue}const R=y==="$"?rm(v,$+y.length):G7(v,$+y.length,y,k);if(R===-1){const oe=v.slice($+y.length);if(oe.includes(y)){g=v.indexOf(y,$+y.length);continue}if(R===-1){const ye=y==="$"&&CD(oe);if(u&&!c&&!ye&&zl(oe)&&!oe.includes("`")){if(g=$+y.length,A=!0,!l){a.pending="";const _e=w?v.slice(w,g):v.slice(0,g),de=Qb(_e)%2===1;if(w)D(v.slice(w,g));else{let be=v.slice(0,g);be.endsWith(y)&&(be=be.slice(0,be.length-y.length)),D(be)}if(de){const be=e_(_e)?.marker??"**",xe=a.push("strong_open","",0);xe.markup=be;const Le=a.push("math_inline","math",0);Le.content=Qi(oe,t),Le.markup=y==="$$"?"$$":y==="\\("?"\\(\\)":y==="$"?"$":"()",Le.raw=`${y}${oe}${k}`,Le.loading=!0,xe.content=oe,a.push("strong_close","",0)}else{const be=a.push("math_inline","math",0);be.content=Qi(oe,t),be.markup=y==="$$"?"$$":y==="\\("?"\\(\\)":y==="$"?"$":"()",be.raw=`${y}${oe}${k}`,be.loading=!0}a.pos=v.length}g=v.length,w=g}break}}const F=v.slice($+y.length,R),V=F.includes("`"),K=!F||!F.trim(),Z=y==="$",G=v[R+k.length],X=Z&&lm(F,G),pe=Z&&am(F);if(c?V||K||X||pe:V||K||X||pe||!Z&&!zl(F)){g=R+k.length;const oe=v.slice(a.pos,g);a.pending||(D(oe),w=g);continue}if(A=!0,!l){const oe=v.slice(a.pos-(a.pending??"").length,$);let ye=v.slice(0,g)?v.slice(w,$):oe;const _e=Qb(ye)%2===1;$!==a.pos&&_e&&(ye=a.pending+v.slice(a.pos,$));const de=_e?e_(ye):null,be=de?.marker??"**";if(a.pending!==ye)if(a.pending="",_e)if(de){const xe=ye.slice(de.index+be.length);D(ye.slice(0,de.index));const Le=a.push("strong_open","",0);Le.markup=be;const ee=a.push("text","",0);ee.content=xe,a.push("strong_close","",0)}else D(ye);else D(ye);if(_e){const xe=a.push("strong_open","",0);xe.markup=be;const Le=a.push("math_inline","math",0);Le.content=Qi(F,t),Le.markup=y==="$$"?"$$":y==="\\("?"\\(\\)":y==="$"?"$":"()",Le.raw=`${y}${F}${k}`,Le.loading=!1;const ee=v.slice(R+k.length).startsWith(be);return ee&&a.push("strong_close","",0),a.pos=d(v,R+k.length),g=a.pos,w=g,ee||a.push("strong_close","",0),!0}else{const xe=a.push("math_inline","math",0);xe.content=Qi(F,t),xe.markup=y==="$$"?"$$":y==="\\("?"\\(\\)":y==="$"?"$":"()",xe.raw=`${y}${F}${k}`,xe.loading=!1}}return g=d(v,R+k.length),w=g,a.pos=g,!0}if(A){if(l)a.pos=g;else{if(y==="$$"&&g<v.length&&v.slice(g).includes("$")){let $=g;for(;!($>=v.length);){const O=Ng(v,$);if(O===-1)break;if(O+1<v.length&&v[O+1]==="$"){$=O+2;continue}if(O>0&&v[O-1]==="$"){$=O+1;continue}const P=rm(v,O+1);if(P===-1)break;const R=v.slice(O+1,P),F=R.includes("`"),V=!R||!R.trim(),K=v[P+1],Z=lm(R,K),G=am(R);if(!F&&!V&&!Z&&!G){const X=v.slice(g,O);X&&D(X);const pe=a.push("math_inline","math",0);pe.content=Qi(R,t),pe.markup="$",pe.raw=`$${R}$`,pe.loading=!1,g=P+1,$=P+1}else D("$"),$=O+1}$<v.length&&D(v.slice($))}else g<v.length&&D(v.slice(g));a.pos=v.length}return!0}}return!1},o=(r,l,a,c)=>{const u=r,d=!u?.env?.__markstreamFinal,h=t?.strictDelimiters,p=h?[["\\[","\\]"],["$$","$$"]]:[["\\[","\\]"],["[","]"],["$$","$$"]],f=u.bMarks[l]+u.tShift[l];let g=u.src.slice(f,u.eMarks[l]).trim(),w=!1,S="",y="",k=!1,v="",_=!1;for(const[X,pe]of p)if(g.startsWith(X))if(X.includes("["))if(t?.strictDelimiters){if(g.replace("\\","")==="["){if(l+1<a){w=!0,S=X,y=pe;break}continue}}else if(g.replace("\\","")==="["){if(l+1<a){w=!0,S=X,y=pe;break}continue}else{const oe=u.tokens[u.tokens.length-1];if(oe&&oe.type==="list_item_open"&&oe.mark==="-"&&g.slice(X.length,g.indexOf("]")).trim()==="x")continue;if(g.replace("\\","").startsWith("[")&&!g.includes("](")){const ye=g.indexOf("]");if(g.slice(ye).trim()!=="]")continue;const _e=g.slice(X.length,ye);if(X==="["?t_(_e):zl(_e)){w=!0,S=X,y=pe;break}continue}}else{w=!0,S=X,y=pe;break}else if((X==="$$"||X==="\\[")&&g.endsWith(X)&&l+1<a){const oe=mv(g,X,pe);if(oe===-1)continue;v=Yc(g.slice(0,oe)),_=!0;const ye=u.bMarks[l+1]+u.tShift[l+1];g=u.src.slice(ye,u.eMarks[l+1]).trim(),k=!0,w=!0,S=X,y=pe;break}if(!w)return!1;if(c&&!_)return!0;const I=g.indexOf(S),A=I+S.length,b=!h&&S==="["?g.indexOf("\\]",A):-1,M=b>=0?"\\]":y,N=b>=0?b:lc(g,y,A);if(!k&&N>S.length){const X=g.slice(I+S.length,N),pe=u.push("math_block","math",0);pe.content=Qi(X),pe.markup=S==="$$"?"$$":S==="["?"[]":"\\[\\]",pe.map=[l,l+1],pe.raw=`${S}${X}${M}`,pe.block=!0,pe.loading=!1,u.line=l+1;const oe=g.slice(N+M.length);return oe.trim()&&n(u,oe,l),!0}let D=l,$="",O=!1,P="",R=l;const F=k?g:g===S?"":g.slice(S.length),V=!h&&S==="\\["?"]":"",K=lc(F,y);if(K!==-1){const X=K;$=F.slice(0,X),P=F.slice(X+y.length),R=k?l+1:l,O=!0,D=R}else for(F&&!k&&($=F),D=l+1;D<a;D++){const X=u.bMarks[D]+u.tShift[D],pe=u.eMarks[D],oe=u.src.slice(X,pe),ye=oe.trim();if(!h&&S==="["&&ye==="\\]"){y="\\]",O=!0;break}if(V&&oe.trim()===V){y=V,O=!0;break}if(ye===y){O=!0;break}else if(!h&&S==="["&&oe.includes("\\]")){O=!0;const _e=oe.indexOf("\\]");y="\\]";const de=oe.slice(0,_e);de&&($+=($?`
|
|
134
|
-
`:"")+de),P=oe.slice(_e+y.length),R=D;break}else if(lc(oe,y)!==-1){O=!0;const _e=lc(oe,y),de=oe.slice(0,_e);de&&($+=($?`
|
|
135
|
-
`:"")+de),P=oe.slice(_e+y.length),R=D;break}$+=($?`
|
|
136
|
-
`:"")+oe}if((!d||h)&&!O)return!1;const Z=/^\s*!\[/.test($);if(!(_?!Z&&Lg($):S==="$$"?!Z:S==="["?t_($):zl($)))return!1;if(c)return!0;v&&n(u,v,l);const G=u.push("math_block","math",0);return G.content=Qi($),G.markup=S==="$$"?"$$":S==="["?"[]":"\\[\\]",G.raw=`${S}${$}${$.startsWith(`
|
|
137
|
-
`)?`
|
|
138
|
-
`:""}${y}`,G.map=[l,D+1],G.block=!0,G.loading=!O,u.line=D+1,P.trim()&&n(u,P,R),!0},i=(r,l,a,c)=>{const u=r,d=u.bMarks[l]+u.tShift[l],h=u.src.slice(d,u.eMarks[l]).trim();return!h.startsWith("$$")&&!h.startsWith("\\[")?!1:o(r,l,a,c)};e.inline.ruler.before("escape","math",s),e.block.ruler.before("lheading","explicit_math_block",i,{alt:["paragraph","reference","blockquote","list"]}),e.block.ruler.before("paragraph","math_block",o,{alt:["paragraph","reference","blockquote","list"]})}function TD(e){const t=e.renderer.rules.image||function(n,s,o,i,r){const l=n,a=r;return a.renderToken?a.renderToken(l,s,o):""};e.renderer.rules.image=(n,s,o,i,r)=>{const l=n;return l[s].attrSet?.("loading","lazy"),t(l,s,o,i,r)},e.renderer.rules.fence=e.renderer.rules.fence||((n,s)=>{const o=n[s],i=String(o.info??"").trim();return`<pre class="${i?`language-${e.utils.escapeHtml(i.split(/\s+/g)[0])}`:""}"><code>${e.utils.escapeHtml(String(o.content??""))}</code></pre>`})}function MD(e={}){const t=e.markdownItOptions??{},n=typeof t.experimental=="object"&&t.experimental!==null?t.experimental:{},s=Object.prototype.hasOwnProperty.call(t,"stream")?!!t.stream:!0,o=new gR({html:!0,linkify:!0,typographer:!0,...t,experimental:{stream:s,...n}});return(e.enableMath??!0)&&xD(o,{...e.mathOptions??{}}),(e.enableContainers??!0)&&kR(o),e.enableFixIndentedCodeBlock!==!1&&n7(o),N7(o),R7(o),O7(o),H7(o),TD(o),e7(o,{customHtmlTags:e.customHtmlTags}),o}function ol(e){const t=Object.assign(Object.create(Object.getPrototypeOf(e)),e);return Array.isArray(e.attrs)&&(t.attrs=e.attrs.map(n=>[...n])),Array.isArray(e.map)&&(t.map=[...e.map]),Array.isArray(e.children)&&(t.children=e.children.map(n=>ol(n))),t}function AD(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function ED(e){const t=e,n=t.attrGet?t.attrGet("checked"):void 0,s=n===""||n==="true";return{type:"checkbox_input",checked:s,raw:s?"[x]":"[ ]"}}function ID(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function od(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="em_close";){const l=e[i];o+=String(e[i].content??l.text??""),r.push(e[i]),i++}return s.push(...bn(r,void 0,void 0,n)),{node:{type:"emphasis",children:s,raw:`*${o}*`},nextIndex:i<e.length?i+1:e.length}}const l_=/\r?\n[ \t]*`+\s*$/,eT=["diff ","index ","--- ","+++ ","@@ "],$D=/\r?\n/;function ND(e){const t=String(e??"");return t?eT.some(n=>n.startsWith(t)||t.startsWith(n)):!1}function a_(e,t,n,s){n.length>0&&e.push(...n),s.length>0&&t.push(...s),n.length=0,s.length=0}function LD(e,t){const n=[],s=[],o=[],i=[],r=e.split($D),l=/\r?\n$/.test(e),a=r.some(p=>p.startsWith("diff ")||p.startsWith("--- ")||p.startsWith("+++ ")||p.startsWith("@@ ")),c=p=>{const f=p;if(!eT.some(g=>f.startsWith(g)))if(f.startsWith("-")){const g=f.slice(1);o.push(!a&&g.startsWith(" ")?` ${g}`:g)}else if(f.startsWith("+")){const g=f.slice(1);i.push(!a&&g.startsWith(" ")?` ${g}`:g)}else{a_(n,s,o,i);const g=a&&f.startsWith(" ")?f.slice(1):f;n.push(g),s.push(g)}},u=l?Math.max(0,r.length-1):r.length;for(let p=0;p<u;p++){const f=r[p]??"";!t&&!l&&p===u-1&&ND(f)||c(f)}(t||o.length>0||i.length>0)&&a_(n,s,o,i);const d=n.join(`
|
|
139
|
-
`),h=s.join(`
|
|
140
|
-
`);return{original:t&&l&&d?`${d}
|
|
141
|
-
`:d,updated:t&&l&&h?`${h}
|
|
142
|
-
`:h}}function gv(e){const t=Array.isArray(e.map)&&e.map.length===2,n=e.meta??{},s=typeof n.closed=="boolean"?n.closed:void 0,o=s===!0||s!==!1&&t,i=String(e.info??""),r=i.startsWith("diff"),l=r?(()=>{const c=i,u=c.indexOf(" ");return u===-1?"":String(c.slice(u+1)??"")})():i;let a=String(e.content??"");if(l_.test(a)&&(a=a.replace(l_,"")),r){const{original:c,updated:u}=LD(a,o===!0);return{type:"code_block",language:l,code:String(u??""),raw:String(a??""),diff:r,loading:s===!0?!1:s===!1?!0:!t,originalCode:c,updatedCode:u}}return{type:"code_block",language:l,code:String(a??""),raw:String(a??""),diff:r,loading:s===!0?!1:s===!1?!0:!t}}function OD(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function PD(){return{type:"hardbreak",raw:`\\
|
|
143
|
-
`}}function RD(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="mark_close";)o+=String(e[i].content??""),r.push(e[i]),i++;return s.push(...bn(r,void 0,void 0,n)),{node:{type:"highlight",children:s,raw:`==${o}==`},nextIndex:i<e.length?i+1:e.length}}let cm=null;const um=new WeakMap;function c_(){return cm||(cm={customTagSet:null,allowedTagSet:kh()}),cm}function tT(e){const t=e.match(/^<\s*(?:\/\s*)?([\w-]+)/);return t?t[1].toLowerCase():""}function nT(e){return/^<\s*\//.test(e)}function sT(e,t){return/\/\s*>\s*$/.test(t)||dl.has(e)}function DD(e){if(!e||e.length===0)return c_();const t=um.get(e);if(t)return t;const n=e.map(No).filter(Boolean);if(!n.length){const o=c_();return um.set(e,o),o}const s={customTagSet:new Set(n),allowedTagSet:kh({customHtmlTags:e})};return um.set(e,s),s}function oT(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function BD(e){const t=e.meta,n=t?.markstreamCustomHtmlRaw,s=t?.markstreamCustomHtmlInner;return typeof n=="string"&&typeof s=="string"?{raw:n,inner:s}:null}function Cf(e,t){const n=t.toLowerCase();for(let s=e.length-1;s>=0;s--){const[o,i]=e[s];if(String(o).toLowerCase()===n)return i}}function FD(e,t,n){const s=e.slice();return Cf(s,"href")||s.push(["href",t]),n!=null&&!Cf(s,"title")&&s.push(["title",n]),s}function Og(e){return e.map(oT).join("")}function Td(e){const t=[],n=s=>{const o=String(s??"");if(!o)return;const i=t[t.length-1];if(i?.type==="text"){i.content=`${i.content}${o}`,i.raw=`${i.raw}${o}`;return}t.push({type:"text",content:o,raw:o})};for(const s of e)if(s){if(s.type==="reference"||s.type==="footnote_reference"){n(String(s.raw??""));continue}if("children"in s&&Array.isArray(s.children)){t.push({...s,children:Td(s.children)});continue}t.push(s)}return t}function HD(e,t,n){let s=0;for(let o=t;o<e.length;o++){const i=e[o];if(i.type!=="html_inline")continue;const r=String(i.content??""),l=tT(r),a=nT(r),c=sT(l,r);if(!a&&!c&&l===n){s++;continue}if(a&&l===n){if(s===0)return o;s--}}return-1}function dm(e,t,n){const s=[e[t]];let o=[],i=t+1,r=!1;const l=n?HD(e,t+1,n):-1;return l!==-1?(o=e.slice(t+1,l),s.push(...o,e[l]),i=l+1,r=!0):(o=e.slice(t+1),o.length&&s.push(...o),i=e.length),{closed:r,html:Og(s),innerTokens:o,nextIndex:i}}function WD(e,t,n,s,o,i,r){const l=String(e.content??""),a=tT(l),{customTagSet:c,allowedTagSet:u}=DD(r?.customHtmlTags);if(!a)return[{type:"inline_code",code:l,raw:l},n+1];if(!u.has(a)&&!dm(t,n,a).closed){const _=oT(e);return[{type:"text",content:_,raw:_},n+1]}if(a==="br")return[{type:"hardbreak",raw:l},n+1];const d=nT(l),h=sT(a,l);if(d)return[{type:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];if(a==="a"){const _=dm(t,n,a),I=gh(l),A=_.innerTokens,b=String(Cf(I,"href")??""),M=Cf(I,"title"),N=M==null?null:String(M),D=FD(I,b,N),$=Td(A.length?s(A,o,i,r):[]),O=A.length?Og(A):b||"";return!$.length&&O&&$.push({type:"text",content:O,raw:O}),[{type:"link",href:b,title:N,text:O,attrs:D,children:$,loading:!_.closed,raw:_.html||l},_.nextIndex]}if(h)return[{type:c?.has(a)?a:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];const p=dm(t,n,a);if(a==="p"||a==="div")return[{type:"paragraph",children:Td(p.innerTokens.length?s(p.innerTokens,o,i,r):[]),raw:p.html},p.nextIndex];const f=Td(p.innerTokens.length?s(p.innerTokens,o,i,r):[]);let g=p.html||l,w=!p.closed,S=!1;if(!p.closed){const _=`</${a}>`;g.toLowerCase().includes(_.toLowerCase())||(g+=_),S=!0,w=!0}const y=[],k=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let v;for(;(v=k.exec(l))!==null;){const _=v[1],I=v[2]||v[3]||v[4]||"";y.push([_,I])}if(c?.has(a)){const _=BD(e);return[{type:a,tag:a,attrs:y,content:_?_.inner:p.innerTokens.length?Og(p.innerTokens):"",children:p.innerTokens.length?s(p.innerTokens,o,i,r):[],raw:_?.raw??g,loading:e.loading||w,autoClosed:S},p.nextIndex]}return[{type:"html_inline",tag:a,attrs:y,content:g,children:f,raw:g,loading:w,autoClosed:S},p.nextIndex]}function iT(e){if(e.type==="math_inline"){if(e.raw)return String(e.raw);const t=e.markup==="$$"?"$$":"$";return`${t}${String(e.content??"")}${t}`}return Array.isArray(e.children)&&e.children.length>0?e.children.map(t=>iT(t)).join(""):String(e.content??"")}function UD(e){return!e||!Array.isArray(e.children)||e.children.length===0?"":e.children.map(t=>iT(t)).join("")}function u_(e,t=!1){let n=e.attrs??[],s=null;if((!n||n.length===0)&&Array.isArray(e.children))for(const d of e.children){const h=d.attrs;if(Array.isArray(h)&&h.length>0){n=h,s=d;break}}const o=String(n.find(d=>d[0]==="src")?.[1]??""),i=n.find(d=>d[0]==="alt")?.[1],r=UD(s??e);let l="";r?l=r:i!=null&&String(i).length>0?l=String(i):s?.content!=null&&String(s.content).length>0?l=String(s.content):Array.isArray(s?.children)&&s.children[0]?.content?l=String(s.children[0].content):Array.isArray(e.children)&&e.children[0]?.content?l=String(e.children[0].content):e.content!=null&&String(e.content).length>0&&(l=String(e.content));const a=n.find(d=>d[0]==="title")?.[1]??null,c=a===null?null:String(a),u=String(e.content??"");return{type:"image",src:o,alt:l,title:c,raw:u,loading:t}}function qD(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function jD(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="ins_close";)o+=String(e[i].content??""),r.push(e[i]),i++;return s.push(...bn(r,void 0,void 0,n)),{node:{type:"insert",children:s,raw:`++${String(o)}++`},nextIndex:i<e.length?i+1:e.length}}function zD(e){const t=[];if(!Array.isArray(e))return t;for(const n of e){const s=n?.[0];s&&t.push([String(s),String(n?.[1]??"")])}return t}function xf(e,t){const n=t.toLowerCase();for(let s=e.length-1;s>=0;s--){const[o,i]=e[s];if(String(o).toLowerCase()===n)return i}}function VD(e,t,n){const s=e.slice();return xf(s,"href")||s.push(["href",t]),n!=null&&!xf(s,"title")&&s.push(["title",n]),s}function id(e,t,n){const s=e[t],o=zD(s.attrs),i=String(xf(o,"href")??""),r=xf(o,"title"),l=r==null?null:String(r),a=VD(o,i,l);let c=t+1;const u=[];let d=!0;for(;c<e.length&&e[c].type!=="link_close";)u.push(e[c]),c++;e[c]?.type==="link_close"&&(d=!1);let h=u;const p=u[u.length-1];if(n?.__insideStrong&&p?.type==="text"&&String(p.content??"").endsWith("**")&&!u.some(w=>w.type==="strong_open")){const w=String(p.content??""),S=String(p.raw??w),y=ol(p);y.content=w.slice(0,-2),y.raw=S.replace(/\*\*$/,""),h=u.slice(),h[h.length-1]=y}const f=bn(h,void 0,void 0,n),g=f.map(w=>{const S=w;return"content"in w?String(S.content??""):String(S.raw??"")}).join("");return{node:{type:"link",href:i,title:l,text:g,children:f,raw:`[${g}](${i}${l?` "${l}"`:""})`,loading:d,attrs:a},nextIndex:c<e.length?c+1:e.length}}function d_(e){const t=e.content??"",n=e.raw==="$$"?`$${t}$`:e.raw||"";return{type:"math_inline",content:t,loading:!!e.loading,raw:n,markup:e.markup}}function KD(e){return{type:"reference",id:String(e.content??""),raw:String(e.markup??`[${e.content??""}]`)}}function f_(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="s_close";)o+=String(e[i].content??""),r.push(e[i]),i++;return s.push(...bn(r,void 0,void 0,n)),{node:{type:"strikethrough",children:s,raw:`~~${o}~~`},nextIndex:i<e.length?i+1:e.length}}const GD=/\\([\\()[\]`$|*_\-!])/g;function YD(e,t){if(!e)return;const n=String(e);if(n&&(n===t||n.replace(GD,"$1")===t))return n}function Qa(e,t,n,s){const o=[];let i="",r=t+1;const l=[];let a=1;for(;r<e.length;){if(e[r].type==="strong_close"){if(a===1)break;a--}e[r].type==="strong_open"&&a++,i+=String(e[r].content??""),l.push(e[r]),r++}const c={...s,__insideStrong:!0};return o.push(...bn(l,YD(n,i),void 0,c)),{node:{type:"strong",children:o,raw:`**${String(i)}**`},nextIndex:r<e.length?r+1:e.length}}function XD(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="sub_close";)o+=String(e[i].content??""),r.push(e[i]),i++;s.push(...bn(r,void 0,void 0,n));const l=String(e[t].content??""),a=o||l;return{node:{type:"subscript",children:s.length>0?s:[{type:"text",content:a,raw:a}],raw:`~${a}~`},nextIndex:i<e.length?i+1:e.length}}function ZD(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="sup_close";)o+=String(e[i].content??""),r.push(e[i]),i++;return s.push(...bn(r,void 0,void 0,n)),{node:{type:"superscript",children:s.length>0?s:[{type:"text",content:o||String(e[t].content??""),raw:o||String(e[t].content??"")}],raw:`^${o||String(e[t].content??"")}^`},nextIndex:i<e.length?i+1:e.length}}function JD(e){const t=String(e.content??"");return{type:"text",content:t,raw:t}}const QD=/[^~]*~{2,}[^~]+/,eB=/\*\*/,tB=/[[_*^~]/,nB=/\\([\\()[\]`$|*_\-!])/g,vv=new Set(["\\","(",")","[","]","`","$","|","*","_","-","!"]),sB=/\s/u,oB=/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/,iB=/\p{P}/u,rB=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,lB=/:\/\//;function aB(e){let t=0,n=0;for(;n<e.length;){if(e[n]==="\\"&&n+1<e.length&&e[n+1]==="*"){n+=2;continue}e[n]==="*"&&t++,n++}return t}function rT(e,t=0){if(!e)return-1;let n=0;for(let s=0;s<e.length;s++){const o=e[s],i=e[s+1];if(o==="\\"&&i&&vv.has(i)){if(i==="*"&&n>=t){n++,s++;continue}n++,s++;continue}if(o==="*"&&n>=t)return n;n++}return-1}function wr(e){return!!e&&sB.test(e)}function Sr(e){return!!e&&(oB.test(e)||iB.test(e))}function cB(e,t){const n=t>0?e[t-1]:void 0,s=e[t+1];return!s||wr(s)?!1:!(Sr(s)&&n&&!wr(n)&&!Sr(n))}function uB(e,t){const n=t>0?e[t-1]:void 0,s=e[t+1];return!n||wr(n)?!1:!(Sr(n)&&s&&!wr(s)&&!Sr(s))}function dB(e,t,n=0){let s=n,o=!1;for(;s<t.length;){const i=e?rT(e,s):t.indexOf("*",s);if(i===-1)break;if(uB(t,i))return{index:i,sawInvalidClose:o};o=!0,s=i+1}return{index:-1,sawInvalidClose:o}}function fB(e,t){const n=t>0?e[t-1]:void 0,s=e[t+2];return!s||wr(s)?!1:!(Sr(s)&&n&&!wr(n)&&!Sr(n))}function hB(e,t){const n=t>0?e[t-1]:void 0,s=e[t+2];return!n||wr(n)?!1:!(Sr(n)&&s&&!wr(s)&&!Sr(s))}function pB(e,t=0){let n=t,s=!1;for(;n<e.length;){const o=e.indexOf("**",n);if(o===-1)break;if(hB(e,o))return{index:o,sawInvalidClose:s};s=!0,n=o+2}return{index:-1,sawInvalidClose:s}}function mB(e){let t="",n=0;for(;n<e.length;){if(e[n]!=="\\"){t+=e[n],n++;continue}let s=0;for(;n+s<e.length&&e[n+s]==="\\";)s++;const o=e[n+s];if(t+="\\".repeat(Math.floor(s/2)),s%2===1){if(o&&vv.has(o)){t+=o,n+=s+1;continue}t+="\\"}n+=s}return t}function gB(e,t){let n=0;for(let s=0;s<e.length;s++){const o=e[s],i=e[s+1];if(o==="\\"&&i&&vv.has(i)){if(n===t)return s+1;n++,s++;continue}if(n===t)return s;n++}return-1}function vB(e,t,n){const s=gB(e,t);if(s===-1||e[s]!==n)return!1;let o=0;for(let i=s-1;i>=0&&e[i]==="\\";i--)o++;return o%2===1}const yB=/[\p{L}\p{N}]/u,kB=/^[\p{L}\p{N}]+$/u;function Pg(e){return e?yB.test(e):!1}function lT(e){return e?kB.test(e):!1}function _c(e,t){let n=t;for(;n<e.length&&e[n]==="*";)n++;const s=t>0?e[t-1]:void 0,o=n<e.length?e[n]:void 0;return{len:n-t,prev:s,next:o,intraword:Pg(s)&&Pg(o)}}function bB(e){const t=[];for(let n=0;n<e.length;){if(e[n]!=="*"){n++;continue}const s=_c(e,n),o=n+s.len;s.len>=2&&s.intraword&&t.push({start:n,end:o}),n=o}for(let n=0;n<t.length-1;n++){const s=t[n],o=t[n+1];if(!lT(e.slice(s.end,o.start)))return o.end}return-1}function _B(e){return!!e&&e.trim()===e&&/^[\p{L}\p{N}\s]+$/u.test(e)}function wB(e,t){let n=t;for(;n<e.length;){const s=e.indexOf("***",n);if(s===-1)return-1;const o=_c(e,s);if(o.len>=3)return s;n=s+o.len}return-1}function SB(e){return e?rB.test(e)||lB.test(e):!1}function CB(e,t){if(!e||!t)return null;const n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function bn(e,t,n,s){if(!e||e.length===0)return[];const o=s?.__linkifyDemotionContext,i=au(t),r={filename:o?.filename||i.filename,explicitFilename:o?.explicitFilename||i.explicitFilename,marketTicker:o?.marketTicker||i.marketTicker};(r.filename||r.explicitFilename||r.marketTicker)&&(s={...s,__linkifyDemotionContext:r});const l=s,a=[];let c=null,u=0;const d=s?.requireClosingStrong,h=e;function p(){return e===h&&(e=e.slice()),e}function f(){c=null}function g(ee,ke){const ge=e.length===1?t:String(ke.content??""),W=[],J=bB(ee);if(J!==-1){_(ee.slice(0,J),ee.slice(0,J));const ie=ee.slice(J);return ie&&(N({type:"text",content:ie,raw:ie}),u--),u++,!0}if(QD.test(ee)){const ie=ee.indexOf("~~");ie!==-1&&W.push({type:"strikethrough",index:ie})}if(eB.test(ee)){const ie=ee.indexOf("**");ie!==-1&&W.push({type:"strong",index:ie})}if(/[^*]*\*[^*]+/.test(ee)){const ie=ge?rT(ge,0):ee.indexOf("*");if(ge&&ie===-1)return!1;ie!==-1&&W.push({type:"emphasis",index:ie})}W.sort((ie,ae)=>ie.index!==ae.index?ie.index-ae.index:ie.type===ae.type?0:ie.type==="strong"?-1:ae.type==="strong"?1:0);const ue=W[0];if(!ue)return!1;if(ue.type==="strikethrough"){const ie=ue.index,ae=ie>-1?ee.slice(0,ie):"";if(ae&&_(ae,ae),ie===-1)return u++,!0;const U=ee.indexOf("~~",ie+2),Y=U===-1?ee.slice(ie+2):ee.slice(ie+2,U),ce=U===-1?"":ee.slice(U+2),{node:me}=f_([{type:"s_open",tag:"s",content:"",markup:"~~",info:"",meta:null},{type:"text",tag:"",content:Y,markup:"",info:"",meta:null},{type:"s_close",tag:"s",content:"",markup:"~~",info:"",meta:null}],0,s);return f(),v(me),ce&&(N({type:"text",content:ce,raw:ce}),u--),u++,!0}if(ue.type==="strong"){const ie=ue.index,ae=ie>-1?ee.slice(0,ie):"";if(ae&&_(ae,ae),ie===-1)return u++,!0;if(t&&ie===0){let Ee=!1,re=0;for(;re<ee.length&&ee[re]==="*";)re++;if(t.startsWith("\\*")&&(Ee=!0),Ee){let Te=0,Ue=0;for(;Ue<t.length&&Te<re;)if(t[Ue]==="\\"&&Ue+1<t.length&&t[Ue+1]==="*")Te+=1,Ue+=2;else{if(t[Ue]==="*")break;Ue++}if(Te>=2)return _(ee,ee),u++,!0}}if(t&&(ee.match(/\*/g)||[]).length>aB(t))return _(ee.slice(ae.length),ee.slice(ae.length)),u++,!0;const U=_c(ee,ie);if(U.len>=3){const Ee=wB(ee,ie+U.len);if(Ee!==-1){const re=ee.slice(ie+U.len,Ee);if(_B(re)){const{node:Te}=Qa([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:re,markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,s);f(),v(Te);const Ue=ee.slice(Ee+3);return Ue&&(N({type:"text",content:Ue,raw:Ue}),u--),u++,!0}}}if(!fB(ee,ie)){const Ee=ee.slice(ie,ie+U.len);_(Ee,Ee);const re=ee.slice(ie+U.len);return re&&(N({type:"text",content:re,raw:re}),u--),u++,!0}const Y=pB(ee,ie+2);let ce="",me="";if(Y.index!==-1){ce=ee.slice(ie+2,Y.index),me=ee.slice(Y.index+2);const Ee=Y.index,re=_c(ee,Ee);if(U.intraword&&re.intraword&&!lT(ce)||!ce&&U.len>=4&&U.intraword)return _(ee.slice(ae.length),ee.slice(ae.length)),u++,!0}else{if(d||Y.sawInvalidClose||U.intraword)return _(ee.slice(ae.length),ee.slice(ae.length)),u++,!0;ce=ee.slice(ie+2),me=""}if(!ce&&/^\*+$/.test(me))return _(ee,ee),u++,!0;const{node:Se}=Qa([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"text",tag:"",content:ce,markup:"",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,s);return f(),v(Se),me&&(N({type:"text",content:me,raw:me}),u--),u++,!0}if(ue.type==="emphasis"){let ie=ue.index;ie===-1&&(ie=0);const ae=ee.slice(0,ie);if(ae&&_(ae,ae),!cB(ee,ie)){_(ee[ie],ee[ie]);const Ee=ee.slice(ie+1);return Ee&&(N({type:"text",content:Ee,raw:Ee}),u--),u++,!0}const U=_c(ee,ie),Y=dB(ge,ee,ie+1),ce=Y.index,me=e[u+1];if(s?.final&&me?.type==="em_open"&&ce!==-1&&ee.slice(ie+1,ce).trim()!==ee.slice(ie+1,ce)||ce===-1&&(Y.sawInvalidClose||s?.final||U.intraword||!Pg(ee[ie+1])))return _(ee.slice(ie),ee.slice(ie)),u++,!0;const{node:Se}=od([{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:ce>-1?ee.slice(ie+1,ce):ee.slice(ie+1),markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null}],0,s);if(f(),v(Se),ce!==-1&&ce<ee.length-1){const Ee=ee.slice(ce+1);Ee&&(N({type:"text",content:Ee,raw:Ee}),u--)}return u++,!0}return!1}function w(ee,ke){if(!ee.includes("`"))return!1;const W=(me=>{for(let Se=0;Se<me.length;Se++){if(me[Se]!=="`")continue;let Ee=0;for(let re=Se-1;re>=0&&me[re]==="\\";re--)Ee++;if(Ee%2===0)return Se}return-1})(ee);if(W===-1)return!1;let J=1;for(let me=W+1;me<ee.length&&ee[me]==="`";me++)J++;const ue="`".repeat(J),ie=W+J,ae=ee.indexOf(ue,ie);if(ae===-1){if(J===1){const Se=ee.slice(0,W),Ee=ee.slice(W+1);return Se&&(g(Se,ke)?u--:_(Se,Se)),y({type:"inline_code",code:Ee,raw:String(Ee)}),u++,!0}let me=ee;for(let Se=u+1;Se<e.length;Se++)me+=String((e[Se].content??"")+(e[Se].markup??""));return u=e.length-1,_(me,me),u++,!0}f();const U=ee.slice(0,W),Y=ee.slice(W+J,ae),ce=ee.slice(ae+J);return U&&(g(U,ke)?u--:_(U,U)),y({type:"inline_code",code:Y,raw:String(Y??"")}),ce&&(N({type:"text",content:ce,raw:ce}),u--),u++,!0}function S(ee){const ke=l?.__markdownIt;if(!ke||e.length<=1||!e.some(ue=>ue?.type==="math_inline")||!tB.test(ee))return null;const ge=ke.parseInline(ee,{__markstreamFinal:!!s?.final});if(!Array.isArray(ge)||ge.length===0)return null;const W=(ge.find(ue=>ue?.type==="inline")?.children??[]).filter(ue=>!(ue?.type==="text"&&String(ue.content??"")===""));if(!W.length||!W.some(ue=>ue?.type!=="text")||W.length===1&&W[0]?.type==="text"&&String(W[0].content??"")===ee)return null;const J=bn(W,ee,n,s);return J.length?J:null}function y(ee){f(),a.push(ee)}function k(ee){f();const ke=ol(ee);a.push(ke)}function v(ee){y(ee)}function _(ee,ke){c?(c.content+=ee,c.raw+=ke??ee):(c={type:"text",content:String(ee??""),raw:String(ke??ee??"")},a.push(c))}function I(ee,ke){if(!ee)return;const ge=bn([{...ke,type:"text",content:ee,raw:ee}],ee,n,s);if(ge.length===1&&ge[0]?.type==="text"){const W=ge[0];_(String(W.content??""),String(W.raw??W.content??""));return}for(const W of ge)v(W)}function A(ee,ke){return String(ee.markup??"").startsWith(ke)}function b(ee){return ee.endsWith("](")?e[u+1]?.type==="link_open"&&e[u+1]?.markup==="linkify"&&e[u+2]?.type==="text"&&e[u+3]?.type==="link_close"&&e[u+4]?.type==="text"&&String(e[u+4]?.content??"").startsWith(")"):!1}function M(ee,ke){let ge=ee;const W=String(ke.content??"");return ge.endsWith("\\")&&!A(ke,"\\\\")&&!W.endsWith("\\\\")&&(ge=ge.slice(0,-1)),ge.endsWith("(")&&!A(ke,"\\(")&&!W.endsWith("\\(")&&(ge=ge.slice(0,-1)),/\*+$/.test(ge)&&!A(ke,"\\*")&&!W.endsWith("\\*")&&(ge=ge.replace(/\*+$/,"")),ge}for(;u<e.length;){const ee=e[u];N(ee)}function N(ee){switch(ee.type){case"text":$(ee);break;case"softbreak":c?(c.content+=`
|
|
144
|
-
`,c.raw+=`
|
|
145
|
-
`):(c={type:"text",content:`
|
|
146
|
-
`,raw:`
|
|
147
|
-
`},a.push(c)),u++;break;case"code_inline":v(qD(ee)),u++;break;case"html_inline":{const[ke,ge]=WD(ee,e,u,bn,t,n,s);v(ke),u=ge;break}case"link_open":O(ee);break;case"image":oe(ee)||(f(),v(u_(ee)),u++);break;case"strong_open":{f();const{node:ke,nextIndex:ge}=Qa(e,u,ee.content,s);v(ke),u=ge;break}case"em_open":{f();const{node:ke,nextIndex:ge}=od(e,u,s);v(ke),u=ge;break}case"s_open":{f();const{node:ke,nextIndex:ge}=f_(e,u,s);v(ke),u=ge;break}case"mark_open":{f();const{node:ke,nextIndex:ge}=RD(e,u,s);v(ke),u=ge;break}case"ins_open":{f();const{node:ke,nextIndex:ge}=jD(e,u,s);v(ke),u=ge;break}case"sub_open":{f();const{node:ke,nextIndex:ge}=XD(e,u,s);v(ke),u=ge;break}case"sup_open":{f();const{node:ke,nextIndex:ge}=ZD(e,u,s);v(ke),u=ge;break}case"sub":f(),v({type:"subscript",children:[{type:"text",content:String(ee.content??""),raw:String(ee.content??"")}],raw:`~${String(ee.content??"")}~`}),u++;break;case"sup":f(),v({type:"superscript",children:[{type:"text",content:String(ee.content??""),raw:String(ee.content??"")}],raw:`^${String(ee.content??"")}^`}),u++;break;case"emoji":{f();const ke=e[u-1];ke?.type==="text"&&/\|:-+/.test(String(ke.content??""))?_("",""):v(ID(ee)),u++;break}case"checkbox":f(),v(AD(ee)),u++;break;case"checkbox_input":f(),v(ED(ee)),u++;break;case"footnote_ref":f(),v(OD(ee)),u++;break;case"footnote_anchor":{f();const ke=ee.meta??{};y({type:"footnote_anchor",id:String(ke.label??ee.content??""),raw:String(ee.content??"")}),u++;break}case"hardbreak":f(),v(PD()),u++;break;case"fence":f(),v(gv(e[u])),u++;break;case"math_inline":f(),!ee.content&&ee.markup==="$"&&e[u+1]?.type==="text"&&e[u+2]?.type==="math_inline"?(v(d_({...ee,content:e[u+1].content})),u+=2):v(d_(ee)),u++;break;case"reference":R(ee);break;case"text_special":_(String(ee.content??""),String(ee.content??"")),u++;break;default:{const ke=ee;if(ee.type==="link"&&ke.href!=null&&s?.validateLink&&!s.validateLink(String(ke.href))){f();const ge=String(ke.text??"");_(ge,ge),u++}else ye(ee)||V(ee)||Z(ee)||F(ee)||k(ee),u++;break}}}function D(ee,ke,ge,W){const J=JD({...ke,content:ee});if(c){c.content+=M(J.content,ke),c.raw+=J.raw;return}const ue=ge?.tag==="br"&&e[u-2]?.content==="[";W||(J.content=M(J.content,ke)),c=J,c.center=ue,a.push(c)}function $(ee){const ke=String(ee.content??""),ge=e.length===1&&ke.includes("\\")&&typeof t=="string"?String(t):"";let W=ge?mB(ge):ke.replace(nB,"$1");if(ee.content==="<"||W==="1"&&e[u-1]?.tag==="br"){u++;return}const J=W.indexOf("$");J!==-1&&J===W.lastIndexOf("$")&&W.endsWith("$")&&(W=W.slice(0,-1)),W.endsWith("undefined")&&!t?.endsWith("undefined")&&(W=W.slice(0,-9));let ue=a.length,ie="";for(let ce=a.length-1;ce>=0;ce--){const me=a[ce];if(me.type!=="text")break;ue=ce,ie=String(me.content??"")+ie}ue<a.length&&(W.startsWith(ie)?(c=null,a.length=ue):c=a[a.length-1]);const ae=e[u+1];if((W==="`"||W==="|"||W==="$")&&!A(ee,`\\${W}`)||/^\*+$/.test(W)&&!A(ee,"\\*")){u++;return}if(!ae&&/[^\]]\s*\(\s*$/.test(W)&&(W=W.replace(/\(\s*$/,"")),!W){u++;return}if(pe(W)||_e(W))return;if(!(W.includes("*")||W.includes("_")||W.includes("~")||W.includes("`")||W.includes("[")||W.includes("!")||W.includes("$")||W.includes("|")||W.includes("("))){D(W,ee,e[u-1],ae),u++;return}if(Le(W))return;const U=e[u-1];if(W==="["&&!ae?.markup?.includes("*")&&!A(ee,"\\[")||W==="]"&&!U?.markup?.includes("*")&&!A(ee,"\\]")){u++;return}if(w(ke,ee)||xe(W)||(e[u+1]?.type!=="link_open"||b(W))&&be(W,ee))return;const Y=S(ke);if(Y){f();for(const ce of Y)v(ce);u++;return}g(W,ee)||(D(W,ee,U,ae),u++)}function O(ee){if(P(ee))return;if(de()){const{node:ae,nextIndex:U}=id(e,u,s),Y=String(ae.text||ae.href||"");_(Y,Y),u=U;return}f();const{node:ke,nextIndex:ge}=id(e,u,s);u=ge;const W=ke.text||ke.href||"";if(ee.markup==="linkify"&&!Hx(W,ke.href,t)&&_f(W,l?.__linkifyDemotionContext)){_(W,W);return}const J=ke.children.length===1&&ke.children[0]?.type==="text";if(ke.loading&&t&&ke.text===ke.href&&J){const ae=CB(t,ke.href);ae&&(ke.text=ae,ke.children=[{type:"text",content:ae,raw:ae}],ke.raw=`[${ae}](${ke.href}${ke.title?` "${ke.title}"`:""})`)}if(s?.validateLink&&!s.validateLink(ke.href)){_(ke.text,ke.text);return}const ue=ee.attrs?.find(([ae])=>ae==="href")?.[1],ie=String(ue??"");if(t&&ie){const ae=t.indexOf("](");if(ae!==-1){const U=t.indexOf(")",ae+2);U===-1?ke.loading=!0:ke.loading&&t.slice(ae+2,U).includes(ie)&&(ke.loading=!1)}}F(ke)||y(ke)}function P(ee){if(ee.markup!=="linkify")return!1;const{node:ke,nextIndex:ge}=id(e,u,s);return K(ke,ge)?(u=ge,!0):!1}function R(ee){f(),v(KD(ee)),u++}function F(ee){if(ee.type!=="link")return!1;const ke=a[a.length-1];if(!ke||ke.type!=="text")return!1;const ge=String(ke.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!ge)return!1;const W=ee,J=String(W.href??""),ue=String(W.text??""),ie=String(ge[2]??""),ae=J.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!J||!(ue===J||ue===ae||SB(ue)))return!1;const U=String(ge[1]??"");return U?(ke.content=U,ke.raw=U):a.pop(),y({...ee,text:ie,children:[{type:"text",content:ie,raw:ie}],raw:`[${ie}](${J}${W.title?` "${W.title}"`:""})`}),!0}function V(ee){if(ee.type!=="link")return!1;const ke=ee,ge=String(ke.href??"");return ge?K({href:ge,title:ke.title==null||ke.title===""?null:String(ke.title),loading:!!ke.loading},u+1):!1}function K(ee,ke){const ge=a[a.length-1];if(ge?.type!=="image"||ge.src||!ge.loading||!String(ge.raw??"").endsWith("]("))return!1;const W=e[ke],J=String(W?.content??"");if(W?.type!=="text"||!J.startsWith(")"))return!1;a.pop(),c=null;const ue=String(ge.alt??"");y({type:"image",src:ee.href,alt:ue,title:ee.title,raw:``,loading:!!ee.loading});const ie=J.slice(1),ae=ol(W);return ae.content=ie,ae.raw=ie,p()[ke]=ae,!0}function Z(ee){if(ee.type!=="link")return!1;const ke=a[a.length-1],ge=e[u-1];if(!ke||ke.type!=="text"||ge?.type!=="text")return!1;const W=String(ke.content??""),J=String(ge.content??"");if(!W.endsWith("!")||!J.endsWith("!")||A(ge,"\\!"))return!1;const ue=W.slice(0,-1);ue?(ke.content=ue,ke.raw=ue,c=ke):(a.pop(),c=null);const ie=ee,ae=String(ie.text??ie.children?.map(ce=>String(ce?.content??ce?.raw??"")).join("")??""),U=String(ie.href??""),Y=ie.title==null||ie.title===""?null:String(ie.title);return y({type:"image",src:U,alt:ae,title:Y,raw:``,loading:!!ie.loading}),!0}function G(ee,ke="",ge=null){const W=String(ee.alt??ee.raw??"");return{type:"link",href:ke,title:ge,text:W,children:[ee],raw:`[${W}](${ke}${ge?` "${ge}"`:""})`,loading:!0}}function X(ee){const ke=ee.startsWith(";return{type:"image",src:"",alt:W===-1?ge.replace(/\]$/,""):ge.slice(0,W),title:null,raw:ke,loading:!0}}function pe(ee){const ke=ee.indexOf("[![");if(ke===-1||typeof t=="string"&&e.length===1&&vB(t,ke,"["))return!1;const ge=ee.slice(0,ke);return ge&&_(ge,ge),y(G(X(ee.slice(ke+1)))),u++,!0}function oe(ee){if(s?.final)return!1;const ke=e[u-1];if(ke?.type!=="text"||!String(ke.content??"").endsWith("[")||A(ke,"\\["))return!1;const ge=a[a.length-1];if(ge?.type==="text"&&ge.content.endsWith("[")){const W=ge.content.slice(0,-1);W?(ge.content=W,ge.raw=W,c=ge):(a.pop(),c=null)}return y(G(u_(ee))),u++,!0}function ye(ee){if(ee.type!=="link")return!1;const ke=ee,ge=String(ke.raw??""),W=String(ke.text??"");if(!ge.startsWith("[![")&&!W.startsWith("!["))return!1;const J=ke.title==null||ke.title===""?null:String(ke.title);return y(G({type:"image",src:String(ke.href??""),alt:W.replace(/^!\[/,"").replace(/\]$/,""),title:J,raw:ge.startsWith("[)return!1;const ke=e[u-2];if(ke?.type==="text"&&String(ke.content??"").endsWith("[")&&A(ke,"\\["))return!1;const ge=a[a.length-1];if(ge?.type!=="image"&&ge?.type!=="link")return!1;const W=ge,J=ge?.type==="link"&&Array.isArray(W.children)&&W.children.length===1&&W.children[0]?.type==="image"?a.pop():null,ue=J?J.children[0]:a.pop();if(!ue||ue.type!=="image")return!1;const ie=e[u+1];let ae=String(J?.href??""),U=J?.title==null?null:String(J.title),Y=!0;if(ie?.type==="link_open"){const{node:me,nextIndex:Se}=id(e,u+1,s);ae=me.href,U=me.title,Y=!0,u=Se}else{if(ae=ee.slice(2),ae.includes('"')){const me=ae.split('"');ae=String(me[0]??"").trim(),U=me[1]==null?null:String(me[1]).trim()}u++}const ce=G(ue,ae,U);return ce.loading=Y,y(ce),!0}function de(){const ee=e[u-3];return e[u-2]?.type==="image"&&e[u-1]?.type==="text"&&String(e[u-1].content??"")==="]("&&ee?.type==="text"&&String(ee.content??"").endsWith("[")&&A(ee,"\\[")}function be(ee,ke){const ge=ee.indexOf("[");if(ge===-1)return!1;let W=ee.slice(0,ge);const J=ee.indexOf("](",ge);if(J!==-1){const ue=e[u+2];let ie=ee.slice(ge+1,J);if(ie.includes("[")){const Ee=ie.indexOf("[");W+=ee.slice(0,ge+Ee+1);const re=ge+Ee+1;ie=ee.slice(re+1,J)}const ae=e[u+1];if(ee.endsWith("](")&&ae?.type==="link_open"&&ue){const Ee=e[u+4];let re=4,Te=!0;if(Ee?.type==="text"){const nt=String(Ee.content??"");if(nt.startsWith(")")){Te=!1;const ct=nt.slice(1);if(ct){const Re=ol(Ee);Re.content=ct,Re.raw=ct,p()[u+4]=Re}else re++}else nt==="."&&re++}I(W,ke);const Ue=String(ue.content??"");return s?.validateLink&&!s.validateLink(Ue)?_(ie,ie):y({type:"link",href:Ue,title:null,text:ie,children:[{type:"text",content:ie,raw:ie}],loading:Te}),u+=re,!0}const U=ee.indexOf(")",J),Y=U!==-1?ee.slice(J+2,U):"",ce=U===-1;let me=W.match(/\*+$/);if(me&&(W=W.replace(/\*+$/,"")),I(W,ke),me||(me=ie.match(/^\*+/)),!d&&me){const Ee=me[0].length;ie=ie.replace(/^\*+/,"").replace(/\*+$/,"");const re=[];if(Ee===1?re.push({type:"em_open",tag:"em",nesting:1}):Ee===2?re.push({type:"strong_open",tag:"strong",nesting:1}):Ee===3&&(re.push({type:"strong_open",tag:"strong",nesting:1}),re.push({type:"em_open",tag:"em",nesting:1})),re.push({type:"link",href:Y,title:null,text:ie,children:[{type:"text",content:ie,raw:ie}],loading:ce}),Ee===1){re.push({type:"em_close",tag:"em",nesting:-1});const{node:Te}=od(re,0,s);v(Te)}else if(Ee===2){re.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Te}=Qa(re,0,void 0,s);v(Te)}else if(Ee===3){re.push({type:"em_close",tag:"em",nesting:-1}),re.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Te}=Qa(re,0,void 0,s);v(Te)}else{const{node:Te}=od(re,0,s);v(Te)}}else s?.validateLink&&!s.validateLink(Y)?_(ie,ie):y({type:"link",href:Y,title:null,text:ie,children:[{type:"text",content:ie,raw:ie}],loading:ce});const Se=U!==-1?ee.slice(U+1):"";return Se&&(N({type:"text",content:Se,raw:Se}),u--),u++,!0}return!1}function xe(ee){const ke=ee.indexOf("![");if(ke===-1)return!1;const ge=ee.slice(0,ke);return ge&&!c?c={type:"text",content:ge,raw:ge}:ge&&c&&(c.content+=ge),c&&(a.push(c),c=null),y(X(ee.slice(ke))),u++,!0}function Le(ee){if(!(ee?.startsWith("[")&&n?.type==="list_item_open"))return!1;const ke=ee.slice(1).match(/[^\s\]]/);if(ke===null)return u++,!0;if(ke&&/x/i.test(ke[0])){const ge=ke[0]==="x"||ke[0]==="X";return y({type:"checkbox_input",checked:ge,raw:ge?"[x]":"[ ]"}),u++,!0}return!1}return a}function xB(e){const t=String(e.content??""),n=t.replace(/[ \t\r\n]+$/g,"");if(n===t)return;e.content=n;const s=e.children;if(!(!Array.isArray(s)||s.length===0))for(;s.length;){const o=s[s.length-1];if(!o){s.pop();continue}if(o.type==="softbreak"||o.type==="hardbreak"){s.pop();continue}if(o.type==="text"){const i=String(o.content??""),r=i.replace(/[ \t\r\n]+$/g,"");if(r===i)break;if(r){o.content=r;break}s.pop();continue}break}}function TB(e){const t=String(e.content??""),n=t.match(/\r?\n\s*\d+[.)]?\s*$/);if(!n||typeof n.index!="number")return;e.content=t.slice(0,n.index);const s=e.children;if(!(!Array.isArray(s)||s.length===0))for(;s.length;){const o=s[s.length-1];if(!o){s.pop();continue}if(o.type==="softbreak"||o.type==="hardbreak"){s.pop();continue}if(o.type==="text"){const i=String(o.content??"");if(/^[ \t\r\n\d.)]*$/.test(i)){s.pop();continue}const r=i.replace(/[ \t\r\n\d.)]+$/g,"");r!==i&&(r?o.content=r:s.pop())}break}}function MB(e){const t=String(e.content??"");return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function wa(e,t,n){const s=e[t],o=[],i=Ar(n,!0);let r=t+1;for(;r<e.length&&e[r].type!=="bullet_list_close"&&e[r].type!=="ordered_list_close";)if(e[r].type==="list_item_open"){const l=[];let a=r+1;for(;a<e.length&&e[a].type!=="list_item_close";)if(e[a].type==="paragraph_open"){const c=e[a+1],u=MB(c)?ol(c):c,d=e[a-1];u!==c&&(TB(u),xB(u));const h=String(u.content??"");l.push({type:"paragraph",children:bn(u.children||[],h,d,i.options()),raw:h}),i.remember(h),a+=3}else if(e[a].type==="blockquote_open"){const[c,u]=Sa(e,a,i.options());l.push(c),i.remember(c.raw),a=u}else if(e[a].type==="bullet_list_open"||e[a].type==="ordered_list_open"){const[c,u]=wa(e,a,i.options());l.push(c),i.remember(c.raw),a=u}else{const c=kv(e,a,i.options(),yv);c?(l.push(c[0]),i.remember(c[0].raw),a=c[1]):a+=1}o.push({type:"list_item",children:l,raw:l.map(c=>c.raw).join("")}),r=a+1}else r+=1;return[{type:"list",ordered:s.type==="ordered_list_open",start:(()=>{if(s.attrs&&s.attrs.length){const l=s.attrs.find(a=>a[0]==="start");if(l){const a=Number(l[1]);return Number.isFinite(a)&&a!==0?a:1}}})(),items:o,raw:o.map(l=>l.raw).join(`
|
|
148
|
-
`)},r+1]}function AB(e,t,n,s){const o=String(n[1]??"note"),i=String(n[2]??o.charAt(0).toUpperCase()+o.slice(1)),r=[],l=Ar(s,!0);let a=t+1;for(;a<e.length&&e[a].type!=="container_close";)if(e[a].type==="paragraph_open"){const c=e[a+1];if(c){const u={type:"paragraph",children:bn(c.children||[],String(c.content??""),void 0,l.options()),raw:String(c.content??"")};r.push(u),l.remember(u.raw)}a+=3}else if(e[a].type==="bullet_list_open"||e[a].type==="ordered_list_open"){const[c,u]=wa(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else if(e[a].type==="blockquote_open"){const[c,u]=Sa(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else{const c=vh(e,a,l.options());c?(r.push(c[0]),l.remember(c[0].raw),a=c[1]):a++}return[{type:"admonition",kind:o,title:i,children:r,raw:`:::${o} ${i}
|
|
149
|
-
${r.map(c=>c.raw).join(`
|
|
150
|
-
`)}
|
|
151
|
-
:::`},a+1]}const EB=new Set(["warning","info","note","tip","danger","caution"]);function IB(e){let t=0;for(;t<e.length&&t<3&&e[t]===":";)t++;if(t===0||e[t]===":")return null;const n=e.slice(t).trimStart();if(!n)return null;const s=n.search(/\s/),o=(s===-1?n:n.slice(0,s)).toLowerCase();return EB.has(o)?{kind:o,title:s===-1?"":n.slice(s).trim()}:null}function $B(e,t,n){const s=e[t];let o="note",i="";const r=s.type.match(/^container_(\w+)_open$/);if(r){o=r[1];const d=String(s.info??"").trim();if(d&&!d.startsWith(":::")&&d.toLowerCase().startsWith(o)){const h=d.slice(o.length).trim();h&&(i=h)}}else{const d=IB(String(s.info??"").trim());d&&(o=d.kind,i=d.title)}i||(i=o.charAt(0).toUpperCase()+o.slice(1));const l=[],a=Ar(n,!0);let c=t+1;const u=new RegExp(`^container_${o}_close$`);for(;c<e.length&&e[c].type!=="container_close"&&!u.test(e[c].type);)if(e[c].type==="paragraph_open"){const d=e[c+1];if(d){const h=d.children||[];let p=-1;for(let g=h.length-1;g>=0;g--){const w=h[g];if(w.type==="text"&&/:+/.test(w.content)){p=g;break}}const f={type:"paragraph",children:bn((p!==-1?h.slice(0,p):h)||[],void 0,void 0,a.options()),raw:String(d.content??"").replace(/\n:+$/,"").replace(/\n\s*:::\s*$/,"")};l.push(f),a.remember(f.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[d,h]=wa(e,c,a.options());l.push(d),a.remember(d.raw),c=h}else if(e[c].type==="blockquote_open"){const[d,h]=Sa(e,c,a.options());l.push(d),a.remember(d.raw),c=h}else{const d=vh(e,c,a.options());d?(l.push(d[0]),a.remember(d[0].raw),c=d[1]):c++}return[{type:"admonition",kind:o,title:i,children:l,raw:`:::${o} ${i}
|
|
152
|
-
${l.map(d=>d.raw).join(`
|
|
153
|
-
`)}
|
|
154
|
-
:::`},c+1]}const NB=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function LB(e,t,n){const s=e[t];if(s.type!=="container_open")return null;const o=NB.exec(String(s.info??""));return o?AB(e,t,o,n):null}const yv={parseContainer:(e,t,n)=>$B(e,t,n),matchAdmonition:LB};function Sa(e,t,n){const s=[],o=Ar(n,!0);let i=t+1;for(;i<e.length&&e[i].type!=="blockquote_close";)switch(e[i].type){case"paragraph_open":{const r=e[i+1],l={type:"paragraph",children:bn(r.children||[],String(r.content??""),void 0,o.options()),raw:String(r.content??"")};s.push(l),o.remember(l.raw),i+=3;break}case"bullet_list_open":case"ordered_list_open":{const[r,l]=wa(e,i,o.options());s.push(r),o.remember(r.raw),i=l;break}case"blockquote_open":{const[r,l]=Sa(e,i,o.options());s.push(r),o.remember(r.raw),i=l;break}default:{const r=kv(e,i,o.options(),yv);r?(s.push(r[0]),o.remember(r[0].raw),i=r[1]):i++;break}}return[{type:"blockquote",children:s,raw:s.map(r=>r.raw).join(`
|
|
155
|
-
`)},i+1]}function OB(e){if(e.info?.startsWith("diff"))return gv(e);const t=String(e.content??""),n=t.match(/ type="application\/vnd\.ant\.([^"]+)"/);let s=t;n?.[1]&&(s=t.replace(/<antArtifact[^>]*>/g,"").replace(/<\/antArtifact>/g,""));const o=Array.isArray(e.map)&&e.map.length===2;return{type:"code_block",language:n?n[1]:String(e.info??""),code:s,raw:s,loading:!o}}function PB(e,t,n){const s=[];let o=t+1,i=[],r=[];const l=Ar(n,!0);for(;o<e.length&&e[o].type!=="dl_close";)if(e[o].type==="dt_open"){const a=e[o+1];i=bn(a.children||[],void 0,void 0,l.options()),l.remember(i.map(c=>c.raw).join("")),o+=3}else if(e[o].type==="dd_open"){let a=o+1;for(r=[];a<e.length&&e[a].type!=="dd_close";)if(e[a].type==="paragraph_open"){const c=e[a+1];r.push({type:"paragraph",children:bn(c.children||[],String(c.content??""),void 0,l.options()),raw:String(c.content??"")}),l.remember(String(c.content??"")),a+=3}else a++;i.length>0&&(s.push({type:"definition_item",term:i,definition:r,raw:`${i.map(c=>c.raw).join("")}: ${r.map(c=>c.raw).join(`
|
|
156
|
-
`)}`}),i=[]),o=a+1}else o++;return[{type:"definition_list",items:s,raw:s.map(a=>a.raw).join(`
|
|
157
|
-
`)},o+1]}function RB(e,t,n){const s=e[t].meta??{},o=String(s?.label??"0"),i=[],r=Ar(n,!0);let l=t+1;for(;l<e.length&&e[l].type!=="footnote_close";)if(e[l].type==="paragraph_open"){const a=e[l+1],c=a.children?[...a.children]:[];e[l+2].type==="footnote_anchor"&&c.push(e[l+2]);const u={type:"paragraph",children:bn(c,String(a.content??""),void 0,r.options()),raw:String(a.content??"")};i.push(u),r.remember(u.raw),l+=3}else l++;return[{type:"footnote",id:o,children:i,raw:`[^${o}]: ${i.map(a=>a.raw).join(`
|
|
158
|
-
`)}`},l+1]}function DB(e,t,n){const s=e[t],o=s.attrs,i=Array.isArray(o)&&o.length?Object.fromEntries(o.filter(u=>Array.isArray(u)&&u.length>=1&&u[0]).map(([u,d])=>[String(u),d==null||d===""?!0:String(d)])):void 0,r=String(s.tag?.substring(1)??"1"),l=Number.parseInt(r,10),a=e[t+1],c=String(a.content??"");return{type:"heading",level:l,text:c,...i?{attrs:i}:{},children:bn(a.children||[],c,void 0,n),raw:c}}function BB(e,t,n){const s=t.toLowerCase(),o=new RegExp(String.raw`^<\s*${s}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${s}(?=\s|>)`,"i");let r=0,l=Math.max(0,n);for(;l<e.length;){const a=e.indexOf("<",l);if(a===-1)return-1;const c=e.slice(a);if(i.test(c)){const u=kn(c);if(u===-1)return-1;if(r===0)return a+u+1;r--,l=a+u+1;continue}if(o.test(c)){const u=kn(c);if(u===-1)return-1;const d=c.slice(0,u+1);/\/\s*>$/.test(d)||r++,l=a+u+1;continue}l=a+1}return-1}function aT(e){const t=String(e.content??"");if(/^\s*<!--/.test(t)||/^\s*<!/.test(t)||/^\s*<\?/.test(t))return{type:"html_block",content:t,raw:t,tag:"",loading:!1};const n=(t.match(/^\s*<([A-Z][\w:-]*)/i)?.[1]||"").toLowerCase();if(!n)return{type:"html_block",content:t,raw:t,tag:"",loading:!1};const s=kn(t),o=s===-1?t:t.slice(0,s+1),i=s!==-1&&/\/\s*>$/.test(o),r=dl.has(n),l=gh(o),a=(s===-1?-1:BB(t,n,s+1))!==-1,c=!(r||i||a);return{type:"html_block",content:c?`${t.replace(/<[^>]*$/,"")}
|
|
159
|
-
</${n}>`:t,raw:t,tag:n,attrs:l.length?l:void 0,loading:c}}function FB(e){const t=String(e.content??""),n=e.raw==="$$"?`$$${t}$$`:String(e.raw??"");return{type:"math_block",content:t,loading:!!e.loading,raw:n,markup:e.markup}}function HB(e){if(!e)return"left";for(const t of e){if(!t)continue;const[n,s]=t;if(!s)continue;const o=String(s).trim().toLowerCase();if(n==="style"){const i=/text-align\s*:\s*(left|right|center)/i.exec(o);if(i)return i[1].toLowerCase()}}return"left"}function cT(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function uT(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return cT(n)?n:void 0}function WB(e,t,n){const s=uT(au(t),n);if(!cT(s))return e;const o=e?.__linkifyDemotionContext;return{...e,__linkifyDemotionContext:{filename:o?.filename||s?.filename,explicitFilename:o?.explicitFilename||s?.explicitFilename,marketTicker:o?.marketTicker||s?.marketTicker}}}function UB(e,t,n){let s=t+1,o=null;const i=[];let r=!1;for(;s<e.length&&e[s].type!=="table_close";)if(e[s].type==="thead_open")r=!0,s++;else if(e[s].type==="thead_close")r=!1,s++;else if(e[s].type==="tbody_open"||e[s].type==="tbody_close")s++;else if(e[s].type==="tr_open"){const a=[];let c=s+1,u;for(;c<e.length&&e[c].type!=="tr_close";)if(e[c].type==="th_open"||e[c].type==="td_open"){const h=e[c].type==="th_open",p=e[c+1],f=String(p.content??""),g=HB(e[c].attrs),w=a.length,S=!h&&!r,y=S?o?.cells[w]?.raw:void 0;a.push({type:"table_cell",header:h||r,children:bn(p.children||[],f,void 0,WB(n,y,S?u:void 0)),raw:f,align:g}),S&&(u=uT(u,au(f))),c+=3}else c++;const d={type:"table_row",cells:a,raw:a.map(h=>h.raw).join("|")};r?o=d:i.push(d),s=c+1}else s++;o||(o={type:"table_row",cells:[],raw:""});const l=e[t].loading===!0;return[{type:"table",header:o,rows:i,loading:l&&!n?.final&&i.length===0,raw:[o,...i].map(a=>a.raw).join(`
|
|
160
|
-
`)},s+1]}function qB(){return{type:"thematic_break",raw:"---"}}let fm=null;const hm=new WeakMap;function h_(){return fm||(fm={allowedTagSet:kh(),customTagSet:null}),fm}function jB(e){if(!e||e.length===0)return h_();const t=hm.get(e);if(t)return t;const n=e.map(No).filter(Boolean);if(!n.length){const o=h_();return hm.set(e,o),o}const s={allowedTagSet:kh({customHtmlTags:e}),customTagSet:new Set(n)};return hm.set(e,s),s}function zB(e,t,n){const s=e[t],o=s.attrs;let i="";const r={};if(o){for(const[p,f]of o)if(p==="class"){const g=f.match(/(?:\s|^)vmr-container-(\S+)/);g&&(i=g[1])}else if(p.startsWith("data-")){const g=p.slice(5);try{r[g]=JSON.parse(f)}catch{r[g]=f}}}const l=[],a=Ar(n,!0);let c=t+1;for(;c<e.length&&e[c].type!=="vmr_container_close";)if(e[c].type==="paragraph_open"){const p=e[c+1];if(p){const f={type:"paragraph",children:bn(p.children||[],void 0,void 0,a.options()),raw:String(p.content??"")};l.push(f),a.remember(f.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[p,f]=wa(e,c,a.options());l.push(p),a.remember(p.raw),c=f}else if(e[c].type==="blockquote_open"){const[p,f]=Sa(e,c,a.options());l.push(p),a.remember(p.raw),c=f}else{const p=vh(e,c,a.options());p?(l.push(p[0]),a.remember(p[0].raw),c=p[1]):c++}const u=c<e.length&&e[c].type==="vmr_container_close",d=u||!!n?.final;let h=`::: ${i}`;return Object.keys(r).length>0&&(h+=` ${JSON.stringify(r)}`),h+=`
|
|
161
|
-
`,l.length>0&&(h+=s.raw??l.map(p=>p.raw).join(`
|
|
162
|
-
`),h+=`
|
|
163
|
-
`),h+=":::",[{type:"vmr_container",name:i,loading:!d,attrs:Object.keys(r).length>0?r:void 0,children:l,raw:h},u?c+1:c]}function VB(e){return e.replace(/^\r?\n/,"").replace(/\r?\n$/,"")}function KB(e,t){if(!e||!t)return e;const n=new RegExp(String.raw`[\t ]*<\s*\/\s*${t}[^>]*$`,"i");return e.replace(n,"")}function GB(e,t,n){if(!e||!t)return null;const s=t.toLowerCase(),o=new RegExp(String.raw`^<\s*${to(s)}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${to(s)}(?=\s|>)`,"i");let r=0,l=Math.max(0,n);for(;l<e.length;){const a=e.indexOf("<",l);if(a===-1)break;const c=e.slice(a);if(i.test(c)){const u=kn(c);if(u===-1)return null;if(r===0)return{start:a,end:a+u+1};r--,l=a+u+1;continue}if(o.test(c)){const u=kn(c);if(u===-1)return null;const d=c.slice(0,u+1);/\/\s*>$/.test(d)||r++,l=a+u+1;continue}l=a+1}return null}function YB(e,t,n){if(!e||!t)return null;const s=t.toLowerCase(),o=new RegExp(String.raw`<\s*${s}(?=\s|>|/)`,"gi");o.lastIndex=Math.max(0,n||0);const i=o.exec(e);if(!i||i.index==null)return null;const r=i.index,l=e.slice(r),a=kn(l);if(a===-1)return null;const c=r+a;if(/\/\s*>\s*$/.test(l.slice(0,a+1))){const f=c+1;return{raw:e.slice(r,f),end:f}}let u=1,d=c+1;const h=f=>{const g=e.slice(f);return new RegExp(String.raw`^<\s*${s}(?=\s|>|/)`,"i").test(g)},p=f=>{const g=e.slice(f);return new RegExp(String.raw`^<\s*\/\s*${s}(?=\s|>)`,"i").test(g)};for(;d<e.length;){const f=e.indexOf("<",d);if(f===-1)return{raw:e.slice(r),end:e.length};if(p(f)){const g=e.indexOf(">",f);if(g===-1)return null;if(u--,u===0){const w=g+1;return{raw:e.slice(r,w),end:w}}d=g+1;continue}if(h(f)){const g=kn(e.slice(f));if(g===-1)return null;u++,d=f+g+1;continue}d=f+1}return{raw:e.slice(r),end:e.length}}function Rg(e){return Number.isFinite(e)&&e>0?e:0}function XB(e,t){const n=Rg(t);if(!e||n<=0)return 0;let s=0;for(let o=0;o<e.length;o++)if(e[o]===`
|
|
164
|
-
`&&(s++,s===n))return o+1;return e.length}function vh(e,t,n){const s=e[t];switch(s.type){case"heading_open":return[DB(e,t,n),t+3];case"code_block":return[OB(s),t+1];case"fence":return[gv(s),t+1];case"math_block":return[FB(s),t+1];case"html_block":{const o=aT(s),i=o.tag?jB(n?.customHtmlTags):null;if(o.tag&&o.loading&&i&&!i.allowedTagSet.has(o.tag)){const r=String(s.content??"").replace(/\n+$/,"");return[{type:"paragraph",children:r?[{type:"text",content:r,raw:r}]:[],raw:r},t+1]}if(o.tag&&i?.customTagSet?.has(o.tag)){const r=o.tag,l=String(n?.__sourceMarkdown??""),a=Number(n?.__customHtmlBlockCursor??0),c=Array.isArray(s.map)?XB(l,Number(s.map?.[0]??0)):0,u=YB(l,r,Math.max(Rg(a),Rg(c)));u&&n&&(n.__customHtmlBlockCursor=u.end);const d=String(u?.raw??o.raw??""),h=kn(d),p=h!==-1?d.slice(0,h+1):d,f=h!==-1&&/\/\s*>\s*$/.test(p),g=h===-1?null:GB(d,r,h+1),w=g?.start??-1;let S="";h!==-1&&(w!==-1&&h<w?S=d.slice(h+1,w):S=d.slice(h+1)),w===-1&&(S=KB(S,r));const y=[],k=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let v;for(;(v=k.exec(p))!==null;){const I=v[1];if(!I||I.toLowerCase()===r)continue;const A=v[2]||v[3]||v[4]||"";y.push([I,A])}const _=!n?.final&&!f&&g==null;return[{type:r,tag:r,content:VB(S),raw:String(u?.raw??o.raw??d),loading:_,attrs:y.length?y:void 0},t+1]}return[o,t+1]}case"table_open":{const[o,i]=UB(e,t,n);return[o,i]}case"dl_open":{const[o,i]=PB(e,t,n);return[o,i]}case"footnote_open":{const[o,i]=RB(e,t,n);return[o,i]}case"hr":return[qB(),t+1]}return null}function kv(e,t,n,s){const o=vh(e,t,n);if(o)return o;switch(e[t].type){case"container_warning_open":case"container_info_open":case"container_note_open":case"container_tip_open":case"container_danger_open":case"container_caution_open":case"container_error_open":if(s?.parseContainer)return s.parseContainer(e,t,n);break;case"container_open":if(s?.matchAdmonition){const i=s.matchAdmonition(e,t,n);if(i)return i}break;case"vmr_container_open":return zB(e,t,n)}return null}function ZB(){return{type:"hardbreak",raw:`\\
|
|
165
|
-
`}}function JB(e,t,n){const s=e[t+1],o=String(s.content??"");return{type:"paragraph",children:bn(s.children||[],o,void 0,n),raw:o}}const p_=new WeakMap,yh=new WeakMap,QB=["$$","\\["];function ga(){return typeof performance<"u"?performance.now():Date.now()}function bv(e,t,n){e&&(e[t]=(e[t]??0)+n)}function dT(e){return e.__timing}function pm(e,t,n){return t&&bv(t,"parseMarkdownToStructureTotalMs",ga()-n),e}function m_(e,t,n){if(!n)return S_(e,t);const s=ga(),o=S_(e,t);return bv(n,"processTokensMs",ga()-s),o}function e9(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return null;const n=_a(t);return n.length?new Set(n):null}function t9(e,t){const n=e;let s=p_.get(n);s||(s=new Map,p_.set(n,s));const o=t.__markstreamFinal===!0?"final":"streaming";let i=s.get(o);i||(i={},s.set(o,i));for(const r of Object.keys(i))Object.prototype.hasOwnProperty.call(t,r)||delete i[r];return Object.assign(i,t),i}function n9(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function rd(e,t,n){for(const s of Reflect.ownKeys(e)){const o=Object.getOwnPropertyDescriptor(e,s);if(!o||!("value"in o))continue;const i=Object.getOwnPropertyDescriptor(t,s);i&&(!("value"in i)||i.writable===!1)||(t[s]=Yr(o.value,n))}}function Yr(e,t=new WeakMap){if(!e||typeof e!="object")return e;const n=e,s=t.get(n);if(s)return s;if(Array.isArray(e)){const r=[];t.set(n,r);for(const l of e)r.push(Yr(l,t));return r}if(e instanceof Map){const r=new Map;t.set(n,r);for(const[l,a]of e)r.set(Yr(l,t),Yr(a,t));return r}if(e instanceof Set){const r=new Set;t.set(n,r);for(const l of e)r.add(Yr(l,t));return r}if(e instanceof Date){const r=new Date(e.getTime());return t.set(n,r),r}if(e instanceof RegExp){const r=new RegExp(e.source,e.flags);return r.lastIndex=e.lastIndex,t.set(n,r),r}if(typeof URL<"u"&&e instanceof URL){const r=new URL(e.href);return t.set(n,r),rd(n,r,t),r}if(typeof URLSearchParams<"u"&&e instanceof URLSearchParams){const r=new URLSearchParams(e.toString());return t.set(n,r),rd(n,r,t),r}if(e instanceof Error){let r;const l=e.constructor;try{r=new l(e.message)}catch{r=new Error(e.message)}return Object.setPrototypeOf(r,Object.getPrototypeOf(e)),t.set(n,r),rd(n,r,t),r}if(typeof Promise<"u"&&e instanceof Promise||typeof Node<"u"&&e instanceof Node)return t.set(n,e),e;if(!n9(e)){const r=Object.create(Object.getPrototypeOf(e));return t.set(n,r),rd(n,r,t),r}const o={};t.set(n,o);const i=e;for(const r of Object.keys(i))o[r]=Yr(i[r],t);return o}function fT(e,t=!0){if(!t)return ol(e);const n=Object.create(Object.getPrototypeOf(e)),s=new WeakMap;for(const o of Reflect.ownKeys(e)){const i=Object.getOwnPropertyDescriptor(e,o);if(!i)continue;if(!("value"in i)){Object.defineProperty(n,o,i);continue}const r=i.value;let l=r;o==="attrs"&&Array.isArray(r)?l=r.map(a=>[...a]):o==="map"&&Array.isArray(r)?l=[...r]:o==="children"&&Array.isArray(r)?l=r.map(a=>fT(a,t)):t&&r&&typeof r=="object"&&(l=Yr(r,s)),Object.defineProperty(n,o,{...i,value:l})}return n}function g_(e,t=!0){return e.map(n=>fT(n,t))}function hT(e,t){const n=t,s=e.stream,o=t.streamParse??"auto";return n.__disableStreamParse!==!0&&(o===!0||o==="auto"&&t.final!==!0)&&s?.enabled===!0&&typeof s.parse=="function"}function s9(e,t){const n=t,s=t.streamParse??"auto",o=e.stream;return t.final===!0&&s==="auto"&&n.__disableStreamParse!==!0&&o?.enabled===!0&&typeof o.reset=="function"}function o9(e){yh.delete(e)}function i9(e,t,n){yh.set(e,{source:t,key:n,pendingCandidate:n===null&&Qx(t)})}function r9(e){return e.endsWith("$")||e.endsWith("\\")}function l9(e){const t=Math.max(e.lastIndexOf(`
|
|
166
|
-
`)+1,0),n=e.slice(t).replace(/[\t ]+$/,"");return QB.some(s=>n.endsWith(s))}function a9(e,t){return t?!!(t.includes("$$")||t.includes("\\[")||t.includes("\\]")||e.endsWith("$")&&t[0]==="$"||e.endsWith("\\")&&(t[0]==="["||t[0]==="]")||l9(e)&&/[\r\n]/.test(t)):!1}function c9(e,t){if(!Vx(e))return;const n=e.stream;if(typeof n?.reset!="function")return;const s=e,o=yh.get(s);if(o?.source===t)return;if(o&&t.startsWith(o.source)){const l=t.slice(o.source.length);if(o.key===null&&o.pendingCandidate===!1&&!a9(o.source,l)&&!r9(t)){o.source=t;return}}const i=SD(t),r=o?!t.startsWith(o.source):!1;(o&&(r||o.key!==i)||!o&&i)&&n.reset(),i9(e,t,i)}function u9(e){return typeof e.preTransformTokens=="function"||typeof e.postTransformTokens=="function"}function d9(e,t){const n=e?.map,s=t?.map;return n===s?!0:!Array.isArray(n)||!Array.isArray(s)?!1:n.length===s.length&&n.every((o,i)=>o===s[i])}function mm(e,t){return!!e&&!!t&&e.type===t.type&&e.tag===t.tag&&e.nesting===t.nesting&&e.markup===t.markup&&e.content===t.content&&d9(e,t)}function v_(e,t){return e[t]?.type==="paragraph_open"&&e[t+1]?.type==="inline"&&e[t+2]?.type==="paragraph_close"}function f9(e){for(let t=0;t+5<e.length;t++)if(v_(e,t)&&v_(e,t+3)&&mm(e[t],e[t+3])&&mm(e[t+1],e[t+4])&&mm(e[t+2],e[t+5]))return!0;return!1}function h9(e,t,n){return Vx(e)&&Qx(t)&&f9(n)}function p9(e){const t=yh.get(e);return typeof t?.key=="string"&&t.key.startsWith("pending:")}function y_(e,t,n,s){if(s.customHtmlTags?.length&&(n.__markstreamCustomHtmlTags=s.customHtmlTags),!hT(e,s)||(c9(e,t),p9(e)))return e.parse(t,n);const o=e.stream.parse(t,t9(e,n));if(h9(e,t,o))return e.stream?.reset?.(),e.parse(t,n);if(!u9(s))return o;const i=dT(s);if(!i)return g_(o,!0);const r=ga(),l=g_(o,!0);return bv(i,"tokenCloneMs",ga()-r),l}function kh(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return Vc;const n=new Set(Vc);for(const s of _a(t))s&&n.add(s);return n}function m9(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:e.type==="hardbreak"?"<br>":""}function k_(e){return{type:"paragraph",children:e,raw:e.map(m9).join("")}}function b_(e,t){if(e.type!=="paragraph")return null;const n=e.children,s=Array.isArray(n)?n:[];if(s.length===0)return null;const o=e9(t);if(!o?.size)return null;let i=-1;for(let u=0;u<s.length;u++){const d=s[u];if(!o.has(String(d?.type??"").toLowerCase()))continue;const h=s.slice(0,u);if(String(d.content??"").trim()&&h.some(p=>p?.type==="hardbreak")){i=u;break}}if(i===-1)return null;const r=s.slice(0,i),l=s[i];if(!l)return null;const a=[];r.length&&a.push(k_(r)),a.push(l);const c=s.slice(i+1);return c.length&&a.push(k_(c)),a}function g9(e){const t=e.trim();if(!t)return null;const n=/^(?:<!doctype\s+html[^>]*>\s*)?<html(?:\s[^>]*)?>/i.test(t),s=/<\/html>\s*$/i.test(t);return!n||!s?null:[{type:"html_block",tag:"html",raw:e,content:e,loading:!1}]}function wc(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:""}function v9(e,t){if(e.type!=="html_block"||!t)return!1;const n=String(e.raw??e.content??"");return new RegExp(String.raw`^\s*<\s*\/\s*${to(t)}\s*>\s*$`,"i").test(n)}function _v(e,t,n){if(!e||!t)return null;const s=t.toLowerCase(),o=new RegExp(String.raw`<\s*${to(s)}(?=\s|>|/)`,"gi");o.lastIndex=Math.max(0,n);const i=o.exec(e);if(!i||i.index==null)return null;const r=i.index,l=kn(e.slice(r));if(l===-1)return null;const a=r+l,c=e.slice(r,a+1);if(dl.has(s)||/\/\s*>$/.test(c))return{raw:c,start:r,end:a+1,closed:!0};let u=1,d=a+1;const h=f=>{const g=e.slice(f);return new RegExp(String.raw`^<\s*${to(s)}(?=\s|>|/)`,"i").test(g)},p=f=>{const g=e.slice(f);return new RegExp(String.raw`^<\s*\/\s*${to(s)}(?=\s|>)`,"i").test(g)};for(;d<e.length;){const f=e.indexOf("<",d);if(f===-1)return{raw:e.slice(r),start:r,end:e.length,closed:!1};if(p(f)){const g=kn(e.slice(f));if(g===-1)return null;u--;const w=f+g+1;if(u===0)return{raw:e.slice(r,w),start:r,end:w,closed:!0};d=w;continue}if(h(f)){const g=kn(e.slice(f));if(g===-1)return null;const w=e.slice(f,f+g+1);/\/\s*>$/.test(w)||u++,d=f+g+1;continue}d=f+1}return{raw:e.slice(r),start:r,end:e.length,closed:!1}}function y9(e,t){if(!t)return 0;let n=0,s=0;for(;n<e.length&&s<t.length;){if(e[n]===t[s]){n++,s++;continue}if(e[n]==="\r"||e[n]===`
|
|
167
|
-
`){n++;continue}return-1}return s===t.length?n:-1}function k9(e,t,n){return n?e:`${e.replace(/<[^>]*$/,"")}
|
|
168
|
-
</${t}>`}function __(e){return e.replace(/\r\n/g,`
|
|
169
|
-
`).replace(/(^|\n)[ \t]{1,4}/g,"$1")}function b9(e,t,n){return n?e.includes(n,t)?!0:__(e.slice(Math.max(0,t))).includes(__(n)):!1}function _9(e,t){let n=Math.max(0,t);for(;n<e.length&&(e[n]===" "||e[n]===" ");)n++;return e[n]==="\r"?(n++,e[n]===`
|
|
170
|
-
`&&n++,n):e[n]===`
|
|
171
|
-
`?n+1:t}function w_(e){if(e.type!=="html_block"||String(e.tag??"").toLowerCase()!=="details")return!1;const t=String(e.raw??e.content??"");return/^\s*<details\b/i.test(t)}function w9(e){if(e.type!=="html_block")return!1;const t=String(e.raw??e.content??"");return/^\s*<\/details\b/i.test(t)}function wv(e,t){const n=new RegExp(String.raw`<\s*\/\s*${to(t)}(?=\s|>)`,"gi");let s=-1,o;for(;(o=n.exec(e))!==null;)s=o.index;return s}function pT(e,t){return{final:t,__disableStreamParse:!0,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink}}const S9=new Set(["admonition","blockquote","code_block","definition_list","footnote","heading","list","math_block","table","thematic_break"]),C9=/(?:^|\n)\s{0,3}(?:#{1,6}\s+\S|[-+*]\s+\S|\d+[.)]\s+\S|>\s*\S|`{3,}|~{3,}|(?:\*{3,}|-{3,}|_{3,})(?:\s|$)|\|.*\|)/m;function x9(e){return/\n\s*\n/.test(e)||C9.test(e)}function T9(e,t){if(!e.trim()||t.length===0)return!1;if(t.some(s=>S9.has(String(s?.type??"").toLowerCase()))||t.some(s=>{if(s?.type!=="html_block")return!1;const o=s;return Array.isArray(o.children)&&o.children.length>0}))return!0;if(!x9(e))return!1;if(t.length>1)return!0;const[n]=t;return!!(n&&n.type==="paragraph")}function M9(e,t,n,s){return e.map(o=>{if(o?.type!=="html_block")return o;const i=o,r=String(i.tag??"").toLowerCase();if(!r||r==="details"||Ex.has(r)||Array.isArray(i.children))return o;const l=String(o.raw??i.content??"");if(!l)return o;const a=kn(l);if(a===-1)return o;const c=wv(l,r),u=c!==-1&&c>=a+1?l.slice(a+1,c):l.slice(a+1);if(!u.trim())return o;const d=Sc(u,t,pT(n,s));return T9(u,d)?{...o,children:d}:o})}function Sc(e,t,n){return e.trim()?gT(e,t,{...n,__disableStreamParse:!0}):[]}function A9(e,t,n){const s=Sc(e,t,n),o=s[0];return s.length===1&&o?.type==="paragraph"&&Array.isArray(o.children)?o.children:s}function E9(e,t,n){const s=aT({content:e}),o=kn(e),i=wv(e,"summary");if(o!==-1&&i!==-1&&i>=o+1){const r=A9(e.slice(o+1,i),t,n);r.length>0&&(s.children=r)}return s.raw=e,s}function I9(e,t,n){const s=kn(e);if(s===-1)return[];const o=e.slice(s+1);if(!o.trim())return[];const i=_v(o,"summary",0);if(!i)return Sc(o,t,n);const r=o.slice(0,i.start),l=o.slice(i.end);return[...Sc(r,t,n),E9(i.raw,t,n),...Sc(l,t,n)]}function mT(e,t,n,s,o,i=0){const r=[];let l=i;for(let a=0;a<e.length;a++){const c=e[a],u=wc(c);let d=-1;if(u&&(d=t.indexOf(u,l),d!==-1&&(l=d+u.length)),!w_(c)){r.push(c);continue}const h=String(c.raw??wc(c)??""),p=d!==-1?d:t.indexOf(h,Math.max(0,l-h.length));if(p===-1){r.push(c);continue}let f=1,g=-1;for(let Z=a+1;Z<e.length;Z++){const G=e[Z];if(w_(G)){f++;continue}if(w9(G)&&(f--,f===0)){g=Z;break}}const w=_v(t,"details",p),S=g===-1&&w?.closed===!0,y=S?(()=>{const Z=wv(h,"details");return Z!==-1?h.slice(0,Z):h})():h,[k]=mT(S?[]:g===-1?e.slice(a+1):e.slice(a+1,g),t,n,s,o,p+h.length),v=I9(y,n,pT(s,o)),_=g===-1?"</details>":String(e[g].raw??wc(e[g])??"</details>"),I=S||g!==-1&&w?.closed===!0,A=_.replace(/[\t\r\n ]+$/,""),b=I?(()=>{const Z=(w?.raw??"").lastIndexOf(A);return Z===-1?t.length:p+Z})():t.length,M=kn(h),N=S&&M!==-1?p+M+1:p+h.length,D=t.slice(N,b===-1?t.length:b),$=n.parse(D,{__markstreamFinal:o}),O=n.renderer.render($,n.options,{__markstreamFinal:o}),P=b+A.length,R=I?Math.max(b+_.length,_9(t,P)):t.length,F=I?t.slice(b,R):_,V=I?t.slice(p,R):t.slice(p),K=S&&M!==-1?h.slice(0,M+1):h;if(r.push({...c,tag:"details",attrs:gh(h.slice(0,M+1)),raw:V,content:`${K}${O}${F}`,children:[...v,...k],loading:!o&&!I}),l=I?R:t.length,g===-1&&!S)break;g!==-1&&(a=g)}return[r,l]}function $9(e,t,n){if(!n)return e;const s=e.slice();let o=0;for(let i=0;i<s.length;i++){const r=s[i],l=wc(r),a=l?n.indexOf(l,o):-1;if(r?.type!=="html_block"){a!==-1&&(o=a+l.length);continue}const c=String(r.tag??"").toLowerCase();if(!c)continue;if(c==="details"){a!==-1&&(o=a+l.length);continue}const u=_v(n,c,a!==-1?a:o);if(!u)continue;o=u.end;const d=String(r.content??l),h=String(r.raw??d),p=k9(u.raw,c,u.closed),f=!t&&!u.closed,g=d!==p||h!==u.raw||!!r.loading!==f,w=kn(u.raw),S=w===-1?"":u.raw.slice(0,w+1),y=S?gh(S):[];if(r.content=p,r.raw=u.raw,r.loading=f,r.attrs=y.length?y:void 0,!g)continue;let k=y9(u.raw,h);k===-1&&(k=0);const v=i+1;for(;v<s.length;){if(u.closed&&v9(s[v],c)){s.splice(v,1);continue}const _=wc(s[v]);if(!_)break;const I=u.raw.indexOf(_,k);if(I===-1){if(b9(n,u.end,_))break;s.splice(v,1);continue}k=I+_.length,s.splice(v,1)}}return s}function N9(e){const t=l=>l===" "||l===" "||l===`
|
|
172
|
-
`||l==="\r",n=l=>{if(!l||l[0]!=="<"||l.includes(">"))return!1;let a=1;if(a<l.length&&t(l[a])||l[a]==="/"&&(a++,a<l.length&&t(l[a])))return!1;const c=g=>{const w=g.charCodeAt(0);return w>=65&&w<=90||w>=97&&w<=122},u=g=>{const w=g.charCodeAt(0);return w>=48&&w<=57},d=g=>g==="!"||c(g),h=g=>c(g)||u(g)||g===":"||g==="-",p=g=>c(g)||u(g)||g==="_"||g==="."||g===":"||g==="-",f=p;if(a>=l.length||!d(l[a]))return!1;for(a++;a<l.length&&h(l[a]);)a++;for(;a<l.length;){for(;a<l.length&&t(l[a]);)a++;if(a>=l.length)return!0;if(l[a]==="/"){for(a++;a<l.length&&t(l[a]);)a++;return a>=l.length}if(!p(l[a]))return!1;for(a++;a<l.length&&f(l[a]);)a++;for(;a<l.length&&t(l[a]);)a++;if(a<l.length&&l[a]==="="){for(a++;a<l.length&&t(l[a]);)a++;if(a>=l.length)return!0;const g=l[a];if(g==='"'||g==="'"){for(a++;a<l.length&&l[a]!==g;)a++;if(a>=l.length)return!0;a++}else{for(;a<l.length;){const w=l[a];if(t(w)||w==="<"||w===">"||w==='"'||w==="'"||w==="`")break;a++}if(a>=l.length)return!0}}}return!0},s=(l,a)=>{let c=!1,u="",d=0;const h=y=>y===" "||y===" ",p=y=>{let k=0;for(;k<y.length&&h(y[k]);)k++;const v=y[k];if(v!=="`"&&v!=="~")return null;let _=k;for(;_<y.length&&y[_]===v;)_++;const I=_-k;return I<3?null:{markerChar:v,markerLen:I,rest:y.slice(_)}},f=y=>{let k=0;for(;k<y.length&&h(y[k]);)k++;let v=!1;for(;k<y.length&&y[k]===">";)for(v=!0,k++;k<y.length&&h(y[k]);)k++;return v?y.slice(k):null},g=y=>{const k=p(y);if(k)return k;const v=f(y);return v==null?null:p(v)};let w=0;const S=l.split(/\r?\n/);for(const y of S){const k=w,v=w+y.length;if(a<k)break;const _=g(y);if(_){const I=_.markerChar,A=_.markerLen;c?I===u&&A>=d&&/^\s*$/.test(_.rest)&&(c=!1,u="",d=0):(c=!0,u=I,d=A)}if(a<=v)break;w=v+1}return c},o=String(e??""),i=o.lastIndexOf("<");if(i===-1||s(o,i))return o;if(i>0){const l=o[i-1],a=l===" "||l===" "||l===`
|
|
173
|
-
`||l==="\r",c=o[i-2];if(!a&&!((l==="n"||l==="r")&&c==="\\"))return o}const r=o.slice(i);return r.includes(">")||r.length>1&&(r[1]===" "||r[1]===" "||r[1]===`
|
|
174
|
-
`||r[1]==="\r")||!n(r)?o:o.slice(0,i)}function L9(e,t){if(!e||!t.length)return e;const n=new Set(t.map(f=>String(f??"").toLowerCase()).filter(Boolean));if(!n.size)return e;const s=f=>f===" "||f===" ",o=f=>{const g=f.charCodeAt(0);return g>=65&&g<=90||g>=97&&g<=122||g>=48&&g<=57||f==="_"||f==="-"||f===":"},i=f=>{if(!f)return!1;if(f[0]===" ")return!0;let g=0;for(let w=0;w<f.length;w++){const S=f[w];if(S===" "){if(g++,g>=4)return!0;continue}if(S===" ")return!0;break}return!1},r=f=>{let g=!1,w=!1;for(let S=0;S<f.length;S++){const y=f[S];if(y==="\\"){S++;continue}if(!w&&y==="'"){g=!g;continue}if(!g&&y==='"'){w=!w;continue}if(!g&&!w&&y===">")return S}return-1},l=f=>{let g=0;for(;g<f.length&&s(f[g]);)g++;const w=f[g];if(w!=="`"&&w!=="~")return null;let S=g;for(;S<f.length&&f[S]===w;)S++;const y=S-g;return y<3?null:{markerChar:w,markerLen:y,rest:f.slice(S)}},a=(f,g)=>{if(i(f))return-1;const w=f.replace(/^[ \t]+/,"");if(!w||w.startsWith(">")||w.startsWith("|")||/^(?:[*+-]|\d+[.)])[\t ]+/.test(w))return-1;let S=!1,y=0;for(;y<f.length;){const k=f[y];if(k!=="<"){s(k)||(S=!0),y++;continue}const v=r(f.slice(y));if(v===-1){S=!0,y++;continue}const _=f.slice(y,y+v+1);let I=1;for(;I<_.length&&s(_[I]);)I++;if(I>=_.length){S=!0,y++;continue}const A=_[I];if(A==="!"||A==="?"){S=!0,y+=v+1;continue}if(A==="/"){S=!0,y+=v+1;continue}const b=I;for(;I<_.length&&o(_[I]);)I++;if(I===b){S=!0,y++;continue}const M=_.slice(b,I).toLowerCase(),N=_[I];if(N&&N!==" "&&N!==" "&&N!==">"&&N!=="/"){S=!0,y++;continue}const D=new RegExp(String.raw`<\s*\/\s*${M}\s*>`,"i"),$=/\/\s*>$/.test(_),O=D.test(f.slice(y+v+1)),P=D.test(e.slice(g+y+v+1)),R=/[\r\n]/.test(e.slice(g+y+v+1));if(S&&n.has(M)&&!$&&!O&&(P||R))return y;S=!0,y+=v+1}return-1};let c=!1,u="",d=0,h="",p=0;for(;p<e.length;){const f=e.indexOf(`
|
|
175
|
-
`,p),g=f!==-1,w=g&&f>p&&e[f-1]==="\r",S=g?w?f-1:f:e.length,y=e.slice(p,S),k=g?w?`\r
|
|
176
|
-
`:`
|
|
177
|
-
`:"",v=l(y);let _=y;if(!c&&!v){const I=a(y,p);if(I!==-1){const A=k||`
|
|
178
|
-
`;_=`${y.slice(0,I).replace(/[ \t]+$/,"")}${A}${A}${y.slice(I).replace(/^[ \t]+/,"")}`}}h+=_,h+=k,v&&(c?v.markerChar===u&&v.markerLen>=d&&/^\s*$/.test(v.rest)&&(c=!1,u="",d=0):(c=!0,u=v.markerChar,d=v.markerLen)),p=g?f+1:e.length}return h}function O9(e,t){if(!e||!t.length)return e;const n=new Set(t.map(d=>String(d??"").toLowerCase()));if(!n.size)return e;const s=d=>d===" "||d===" ",o=d=>{const h=d.charCodeAt(0);return h>=65&&h<=90||h>=97&&h<=122||h>=48&&h<=57||d==="_"||d==="-"},i=d=>{let h=0;for(;h<d.length&&s(d[h]);)h++;return d.slice(h)},r=d=>{let h=!1,p=!1;for(let f=0;f<d.length;f++){const g=d[f];if(g==="\\"){f++;continue}if(!p&&g==="'"){h=!h;continue}if(!h&&g==='"'){p=!p;continue}if(!h&&!p&&g===">")return f}return-1},l=(d,h,p)=>{const f=p.toLowerCase();let g=d.indexOf("<",h);for(;g!==-1;){let w=g+1;for(;w<d.length&&s(d[w]);)w++;if(w>=d.length||d[w]!=="/"){g=d.indexOf("<",g+1);continue}for(w++;w<d.length&&s(d[w]);)w++;if(w+f.length>d.length){g=d.indexOf("<",g+1);continue}let S=!0;for(let k=0;k<f.length;k++){const v=d[w+k];if((v>="A"&&v<="Z"?String.fromCharCode(v.charCodeAt(0)+32):v)!==f[k]){S=!1;break}}if(!S){g=d.indexOf("<",g+1);continue}let y=w+f.length;if(y<d.length&&o(d[y])){g=d.indexOf("<",g+1);continue}for(;y<d.length&&s(d[y]);)y++;if(y<d.length&&d[y]===">")return!0;g=d.indexOf("<",g+1)}return!1},a=d=>{let h=0;for(;h<d.length&&s(d[h]);)h++;if(h>=d.length||d[h]!=="<")return d;for(h++;h<d.length&&s(d[h]);)h++;if(h>=d.length||d[h]==="/")return d;const p=h;for(;h<d.length&&o(d[h]);)h++;if(h===p)return d;const f=d.slice(p,h).toLowerCase();if(!n.has(f))return d;const g=r(d.slice(h));if(g===-1)return d;const w=h+g;if(l(d,w+1,f))return d;const S=i(d.slice(w+1));return S?`${d.slice(0,w+1)}
|
|
179
|
-
${S}`:d};let c="",u=0;for(;u<e.length;){const d=e.indexOf(`
|
|
180
|
-
`,u);if(d===-1){c+=a(e.slice(u));break}const h=d>u&&e[d-1]==="\r",p=h?d-1:d,f=e.slice(u,p);c+=a(f),c+=h?`\r
|
|
181
|
-
`:`
|
|
182
|
-
`,u=d+1}return c}function P9(e,t){if(!e||!t.length)return e;const n=new Set(t.map(h=>String(h??"").toLowerCase()));if(!n.size)return e;const s=h=>h===" "||h===" ",o=h=>{let p=0,f=!1,g=0;for(;p<h.length;){for(;p<h.length&&s(h[p]);)p++;if(p>=h.length||h[p]!==">")break;for(f=!0,p++;p<h.length&&s(h[p]);)p++;g=p}return f?{prefix:h.slice(0,g),content:h.slice(g)}:null},i=h=>{let p=0;for(;p<h.length&&s(h[p]);)p++;const f=h[p];if(f!=="`"&&f!=="~")return null;let g=p;for(;g<h.length&&h[g]===f;)g++;const w=g-p;return w<3?null:{markerChar:f,markerLen:w,rest:h.slice(g)}},r=Array.from(n).map(h=>new RegExp(String.raw`(<\s*\/\s*${h}\s*>)${"(?=[\\t ]*(?:#{1,6}[\\t ]+|>|(?:[*+-]|\\d+[.)])[\\t ]+|(?:`{3,}|~{3,})|\\||\\$\\$|:{3,}|\\[\\^[^\\]]+\\]:|(?:-{3,}|\\*{3,}|_{3,})))"}`,"gi"));let l=!1,a="",c=0,u="",d=0;for(;d<e.length;){const h=e.indexOf(`
|
|
183
|
-
`,d),p=h!==-1,f=p&&h>d&&e[h-1]==="\r",g=p?f?h-1:h:e.length,w=e.slice(d,g),S=p?f?`\r
|
|
184
|
-
`:`
|
|
185
|
-
`:"",y=o(w),k=y?.prefix??"",v=y?.content??w,_=i(v);_&&(l?_.markerChar===a&&_.markerLen>=c&&/^\s*$/.test(_.rest)&&(l=!1,a="",c=0):(l=!0,a=_.markerChar,c=_.markerLen));let I=v;if(!l&&I.includes("</"))for(const A of r)I=I.replace(A,(b,M,N,D)=>{if(D.replace(/^[\t ]+/,"").startsWith("|"))return b;const $=D.slice(0,N).replace(/^[\t ]+/,"");if($.length>0){const O=M.match(/^<\s*\/\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"",P=$.match(/^<\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"";if(!O||!P||O!==P)return b}return`${M}
|
|
186
|
-
|
|
187
|
-
`});if(k){const A=k+I.split(`
|
|
188
|
-
`).join(`
|
|
189
|
-
${k}`);u+=A}else u+=I;u+=S,d=p?h+1:e.length}return u}function R9(e,t){if(!e||!t.length)return e;const n=new Set(t.map($=>String($??"").toLowerCase()));if(!n.size)return e;const s=$=>$===" "||$===" ",o=$=>{if(!$)return!1;if($[0]===" ")return!0;let O=0;for(let P=0;P<$.length;P++){const R=$[P];if(R===" "){if(O++,O>=4)return!0;continue}if(R===" ")return!0;break}return!1},i=$=>{const O=$.charCodeAt(0);return O>=65&&O<=90||O>=97&&O<=122||O>=48&&O<=57||$==="_"||$==="-"||$===":"},r=$=>{let O=0;for(;O<$.length&&s($[O]);)O++;return $.slice(O)},l=$=>{let O=0,P=!1,R=0;for(;O<$.length;){for(;O<$.length&&s($[O]);)O++;if(O>=$.length||$[O]!==">")break;for(P=!0,O++;O<$.length&&s($[O]);)O++;R=O}if(!P)return null;const F=$.slice(0,R);return{prefix:F,key:F.replace(/[ \t]+$/,""),content:$.slice(R)}},a=$=>r($).startsWith("<"),c=$=>{for(let O=0;O<$.length;O++){const P=$[O];if(P!==" "&&P!==" ")return!1}return!0},u=$=>{if(o($))return"";const O=r($);if(!O.startsWith("<"))return"";let P=1;for(;P<O.length&&s(O[P]);)P++;if(P>=O.length||O[P]==="/"||O[P]==="!"||O[P]==="?")return"";const R=P;for(;P<O.length&&i(O[P]);)P++;if(P===R)return"";const F=O.slice(R,P).toLowerCase();if(!n.has(F))return"";const V=O[P];return V&&V!==" "&&V!==" "&&V!==">"&&V!=="/"?"":F},d=$=>{if(o($))return null;const O=r($);if(!O.startsWith("<"))return null;let P=1;for(;P<O.length&&s(O[P]);)P++;if(P>=O.length)return null;const R=O[P]==="/";if(R)for(P++;P<O.length&&s(O[P]);)P++;const F=O[P];if(!F||F==="!"||F==="?")return null;const V=P;for(;P<O.length&&i(O[P]);)P++;if(P===V)return null;const K=O.slice(V,P).toLowerCase();if(!n.has(K))return null;const Z=O[P];if(Z&&Z!==" "&&Z!==" "&&Z!==">"&&Z!=="/")return null;if(R)return{type:"close",name:K};if(/\/\s*>\s*$/.test(O))return{type:"open",name:K,complete:!0};const G=O.indexOf(">",P);if(G!==-1){const X=O.slice(G+1);if(new RegExp(`<\\s*\\/\\s*${K}\\s*>`,"i").test(X))return{type:"open",name:K,complete:!0}}return{type:"open",name:K,complete:!1}},h=$=>{if(o($))return null;const O=r($).replace(/[ \t]+$/,"");if(!O.startsWith("<")||/^<\s*(?:!--|!doctype\b|\?)/i.test(O))return null;const P=O.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(P?.[1])return P[1].toLowerCase();const R=O.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!R?.[1]||!R[2])return null;const F=R[1].toLowerCase();return F===R[2].toLowerCase()?F:null};let p=!1,f="",g=0;const w=$=>{let O=0;for(;O<$.length&&s($[O]);)O++;const P=$[O];if(P!=="`"&&P!=="~")return null;let R=O;for(;R<$.length&&$[R]===P;)R++;const F=R-O;return F<3?null:{markerChar:P,markerLen:F,rest:$.slice(R)}},S=$=>w($),y=$=>{const O=r($);return O?o($)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test(O):!1},k=($,O,P)=>{let R=$,F=0;for(;R<e.length;){const V=e.indexOf(`
|
|
190
|
-
`,R),K=V!==-1,Z=K&&V>R&&e[V-1]==="\r",G=K?Z?V-1:V:e.length,X=e.slice(R,G),pe=l(X),oe=pe?.key??"";if(F>0&&O&&oe!==O)break;const ye=pe?.content??X,_e=d(ye);if(_e?.name===P){if(_e.type==="open")_e.complete||F++;else if(F>0&&(F--,F===0))return!1}else if(F>0&&(c(ye)||y(ye)))return!0;if(K)R=V+1;else break}return!1};let v="",_=0,I=!0,A=!1,b=!1,M=`
|
|
191
|
-
`;const N=[];let D="";for(;_<e.length;){const $=e.indexOf(`
|
|
192
|
-
`,_),O=$!==-1,P=O&&$>_&&e[$-1]==="\r",R=O?P?$-1:$:e.length,F=e.slice(_,R),V=O?P?`\r
|
|
193
|
-
`:`
|
|
194
|
-
`:"",K=l(F),Z=K?.key??"",G=K?.content??F,X=S(G);X&&(p?X.markerChar===f&&X.markerLen>=g&&/^\s*$/.test(X.rest)&&(p=!1,f="",g=0):(p=!0,f=X.markerChar,g=X.markerLen));const pe=N.length>0;if(!p&&!pe){const ye=u(G),_e=!!ye&&!I&&A&&b&&k(_,Z,ye);ye&&!I&&(!A||_e)&&(Z&&D&&Z===D?v+=`${Z}${M}`:Z||(v+=M))}if(v+=F,v+=V,V&&(M=V),!p){const ye=d(G);if(ye){if(ye.type==="open")ye.complete||N.push(ye.name);else for(let _e=N.length-1;_e>=0;_e--)if(N[_e]===ye.name){N.length=_e;break}}}const oe=c(G);I=oe,A=!oe&&a(G),b=!oe&&!!h(G),D=Z,_=O?$+1:e.length}return v}function gT(e,t,n={}){const s=dT(n),o=s?ga():0,i=!!n.final;let r=(e??"").toString().replace(/([^\\])\r(ight|ho)/g,"$1\\r$2").replace(/([^\\])\n(abla|eq|ot|exists)/g,"$1\\n$2");if(s9(t,n)&&(t.stream.reset(),o9(t)),i||(r.endsWith("- *")&&(r=r.replace(/- \*$/,"- \\*")),/(?:^|\n)\s*-\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*-\s*$/,w=>w.startsWith(`
|
|
195
|
-
`)?`
|
|
196
|
-
`:""):/(?:^|\n)\s*--\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*--\s*$/,w=>w.startsWith(`
|
|
197
|
-
`)?`
|
|
198
|
-
`:""):/(?:^|\n)\s*>\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*>\s*$/,w=>w.startsWith(`
|
|
199
|
-
`)?`
|
|
200
|
-
`:""):/\n\s*[*+]\s*$/.test(r)?r=r.replace(/\n\s*[*+]\s*$/,`
|
|
201
|
-
`):/(?:^|\n)\s*\d+\s*$/.test(r)?/^\d+$/.test(r.trim())||(r=r.replace(/(?:^|\n)\s*\d+\s*$/,w=>w.startsWith(`
|
|
202
|
-
`)?`
|
|
203
|
-
`:"")):/(?:^|\n)\s*\d+[.)]\s+\*{1,3}\s*$/.test(r)?r=r.replace(/((?:^|\n)\s*\d+[.)]\s+)(\*{1,3})\s*$/,(w,S,y)=>`${S}${y.split("").map(()=>"\\*").join("")}`):/(?:^|\n)\s*\d+[.)]\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*\d+[.)]\s*$/,w=>w.startsWith(`
|
|
204
|
-
`)?`
|
|
205
|
-
`:""):/\n[[(]\n*$/.test(r)&&(r=r.replace(/(\n\[|\n\()+\n*$/g,`
|
|
206
|
-
`))),n.customHtmlTags?.length&&r.includes("<")){const w=_a(n.customHtmlTags);if(w.length&&(r=L9(r,w),r=O9(r,w),r=R9(r,w),r=P9(r,w),r.includes("</")))for(const S of w){const y=new RegExp(String.raw`(^[\t ]*<\s*\/\s*${S}\s*>[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,"gim");r=r.replace(y,"$1$2$2")}}i||(r=N9(r));const l=g9(r);if(l){const w=n.preTransformTokens,S=n.postTransformTokens;if(hT(t,n)||typeof w=="function"||typeof S=="function"){const y=y_(t,r,{__markstreamFinal:i},n),k=typeof w=="function"&&w(y)||y;typeof S=="function"&&S(k)}return pm(l,s,o)}const a=y_(t,r,{__markstreamFinal:i},n);if(!a||!Array.isArray(a))return pm([],s,o);const c=n.preTransformTokens,u=n.postTransformTokens;let d=a;c&&typeof c=="function"&&(d=c(d)||d);const h=t,p=n.validateLink??h.options?.validateLink??(typeof h.validateLink=="function"?h.validateLink:void 0),f={...n,validateLink:p,__markdownIt:t,__sourceMarkdown:r,__customHtmlBlockCursor:0};let g=m_(d,f,s);if(u&&typeof u=="function"){const w=u(d);if(Array.isArray(w)){const S=w[0],y=S?.type;S&&typeof y=="string"?g=m_(w,void 0,s):g=w}}if(g=$9(g,i,r),g=mT(g,r,t,n,i)[0],g=M9(g,t,n,i),i){const w=new WeakSet,S=y=>{if(!y||typeof y!="object"||w.has(y))return;if(w.add(y),Array.isArray(y)){for(const v of y)S(v);return}const k=y;k.type==="html_block"&&k.loading===!0&&(k.loading=!1);for(const v of Object.values(k))S(v)};S(g)}return n.debug&&console.log("Parsed Markdown Tree Structure:",g),pm(g,s,o)}function S_(e,t){if(!e||!Array.isArray(e))return[];const n=[],s=Ar(t);let o=0;for(;o<e.length;){const i=kv(e,o,s.options(),yv);if(i){n.push(i[0]),s.remember(i[0].raw),o=i[1];continue}const r=e[o];switch(r.type){case"paragraph_open":{const l=String(e[o+1]?.content??""),a=JB(e,o,s.options(l)),c=b_(a,t);c?n.push(...c):n.push(a),s.remember(a.raw),o+=3;break}case"bullet_list_open":case"ordered_list_open":{const[l,a]=wa(e,o,s.options());n.push(l),s.remember(l.raw),o=a;break}case"blockquote_open":{const[l,a]=Sa(e,o,s.options());n.push(l),s.remember(l.raw),o=a;break}case"footnote_anchor":{const l=r.meta??{},a=String(l.label??r.content??"");n.push({type:"footnote_anchor",id:a,raw:String(r.content??"")}),s.remember(String(r.content??"")),o++;break}case"hardbreak":n.push(ZB()),s.reset(),o++;break;case"text":{const l=String(r.content??"");n.push({type:"paragraph",raw:l,children:l?[{type:"text",content:l,raw:l}]:[]}),s.remember(l),o++;break}case"inline":{const l=String(r.content??""),a=bn(r.children||[],l,void 0,s.options(l));if(a.length!==0)if(a.every(c=>c.type==="html_block"))n.push(...a);else{const c={type:"paragraph",raw:l,children:a},u=b_(c,t);u?n.push(...u):n.push(c)}s.remember(l)}o+=1;break;default:o+=1;break}}return n}const D9=new Set([...lu,"base","button","datalist","dialog","embed","fieldset","form","iframe","input","legend","link","meta","object","optgroup","option","output","param","select","style","template","textarea","title"]),B9=new Set(["a","abbr","b","blockquote","br","caption","code","col","colgroup","dd","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","li","mark","ol","p","pre","s","small","span","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","ul"]),C_=/<([a-z][a-z0-9-]*)\b[^>]*>/gi;function x_(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function F9(e){return typeof e=="string"?e:e==null?"":String(e)}function vT(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function ar(e){return F9(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function yT(e){return ar(e).replace(/`/g,"`")}function bh(e){return String(e??"").trim().toLowerCase()}function Sv(e,t="safe"){const n=bh(e);return n?t==="escape"?!0:t==="trusted"?lu.has(n):!B9.has(n):!1}function kT(e,t="safe"){const n=bh(e);return n?t==="escape"?!0:t==="trusted"?lu.has(n):D9.has(n):!1}function T_(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,s])=>s===""?` ${n}`:` ${n}="${yT(s)}"`).join("")}function H9(e,t){const n=e.split(",").map(s=>s.trim()).filter(Boolean);return n.length===0?!1:n.some(s=>{const o=s.split(/\s+/,1)[0]??"";return!o||la(o,{tagName:t,attrName:"srcset"})})}function bT(e,t,n,s){return AR.has(e)||n==="safe"&&e==="style"?!0:e==="srcset"?H9(t,s):!!(ER.has(e)&&t&&la(t,{tagName:s,attrName:e}))}function Xr(e,t){const n=t.toLowerCase();return Object.keys(e).find(s=>s.toLowerCase()===n)}function _T(e,t,n,s=!1){if(t!=="safe"||bh(n)!=="a")return e;const o=Xr(e,"href");if(s&&(!o||!e[o])){const a=Xr(e,"target"),c=Xr(e,"rel");return a&&delete e[a],c&&delete e[c],e}const i=Xr(e,"target");if((i?String(e[i]).trim():"").toLowerCase()!=="_blank")return e;const r=Xr(e,"rel"),l=new Set(String(r?e[r]:"").split(/\s+/).map(a=>a.trim()).filter(Boolean).filter(a=>a.toLowerCase()!=="opener"));return l.add("noopener"),l.add("noreferrer"),r&&r!=="rel"&&delete e[r],e.rel=Array.from(l).join(" "),e}function M_(e,t="safe",n){const s={};for(const[o,i]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!vT(r)||bT(l,i,t,n)||(s[r]=i)}return _T(s,t,n,!!Xr(e,"href"))}function wT(e,t){const n=e.toLowerCase();return Ax.has(n)?!1:x_(t,n)||x_(t,e)}function Cv(e,t="safe",n){const s={};for(const[o,i]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!vT(r)||bT(l,i,t,n)||(s[r]=i)}return _T(s,t,n,!!Xr(e,"href"))}function Tf(e){const t={};if(!Array.isArray(e)||e.length===0)return t;for(const[n,s]of e)n&&(t[String(n)]=s==null?"":String(s));return t}function Dg(e,t="safe",n){const s=Cv(Tf(e),t,n),o=Object.entries(s).map(([i,r])=>[i,r]);return o.length>0?o:void 0}function W9(e,t){const n=t.toLowerCase();if(["checked","disabled","readonly","required","autofocus","multiple","hidden"].includes(n))return e==="true"||e===""||e===t;if(["value","min","max","step","width","height","size","maxlength"].includes(n)){const s=Number(e);if(e!==""&&!Number.isNaN(s))return s}return e}function U9(e){const t={};for(const[n,s]of Object.entries(e))t[n]=W9(s,n);return t}function A_(e){return e.trim().length>0}function q9(e){const t=[];let n=0;for(;n<e.length;){if(e.startsWith("<!--",n)){const a=e.indexOf("-->",n);if(a!==-1){n=a+3;continue}break}const s=e.indexOf("<",n);if(s===-1){if(n<e.length){const a=e.slice(n);A_(a)&&t.push({type:"text",content:a})}break}if(s>n){const a=e.slice(n,s);A_(a)&&t.push({type:"text",content:a})}if(e.startsWith("![CDATA[",s+1)){const a=e.indexOf("]]>",s);if(a!==-1){t.push({type:"text",content:e.slice(s,a+3)}),n=a+3;continue}break}if(e.startsWith("!",s+1)){const a=e.indexOf(">",s);if(a!==-1){n=a+1;continue}break}const o=e.indexOf(">",s);if(o===-1)break;const i=e.slice(s+1,o).trim(),r=i.startsWith("/"),l=i.endsWith("/");if(r){const a=i.slice(1).trim();t.push({type:"tag_close",tagName:a})}else{const a=i.indexOf(" ");let c,u="";a===-1?c=l?i.slice(0,-1).trim():i.trim():(c=i.slice(0,a).trim(),u=i.slice(a+1));const d={};if(u){const h=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let p;for(;(p=h.exec(u))!==null;){const f=p[1],g=p[2]??p[3]??p[4]??"";f&&!f.endsWith("/")&&(d[f]=g)}}t.push({type:l||dl.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d})}n=o+1}return t}function j9(e){const t=[];let n=0;for(;n<e.length;){if(e.startsWith("<!--",n)){const h=e.indexOf("-->",n);if(h!==-1){n=h+3;continue}break}const s=e.indexOf("<",n);if(s===-1){n<e.length&&t.push({type:"text",content:e.slice(n)});break}if(s>n&&t.push({type:"text",content:e.slice(n,s)}),e.startsWith("![CDATA[",s+1)){const h=e.indexOf("]]>",s);if(h!==-1){t.push({type:"text",content:e.slice(s,h+3)}),n=h+3;continue}break}if(e.startsWith("!",s+1)){const h=e.indexOf(">",s);if(h!==-1){n=h+1;continue}break}const o=e.indexOf(">",s);if(o===-1)break;const i=e.slice(s+1,o).trim();if(!i){n=o+1;continue}const r=i.startsWith("/"),l=i.endsWith("/");if(r){const h=i.slice(1).trim();t.push({type:"tag_close",tagName:h}),n=o+1;continue}const a=i.indexOf(" ");let c="",u="";a===-1?c=l?i.slice(0,-1).trim():i.trim():(c=i.slice(0,a).trim(),u=i.slice(a+1));const d={};if(u){const h=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let p;for(;(p=h.exec(u))!==null;){const f=p[1],g=p[2]??p[3]??p[4]??"";f&&!f.endsWith("/")&&(d[f]=g)}}t.push({type:l||dl.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d}),n=o+1}return t}function z9(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`</${ar(t)}>`;const n=Object.entries(e.attrs??{}).map(([s,o])=>o===""?` ${ar(s)}`:` ${ar(s)}="${yT(o)}"`).join("");return e.type==="self_closing"?`<${ar(t)}${n} />`:`<${ar(t)}${n}>`}function V9(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;C_.lastIndex=0;let n;for(;(n=C_.exec(e))!==null;)if(wT(n[1],t))return!0;return!1}function aa(e,t="safe"){if(!e)return"";if(t==="escape")return ar(e);const n=j9(e),s=[],o=[],i=[];for(const r of n){if(r.type==="text"){i.length===0&&o.push(ar(r.content??""));continue}const l=bh(r.tagName);if(!l)continue;if(kT(l,t)){r.type==="tag_open"?i.push(l):r.type==="tag_close"&&i[i.length-1]===l&&i.pop();continue}if(i.length>0)continue;if(t==="safe"&&Sv(l,t)){o.push(z9(r));continue}if(r.type==="self_closing"){o.push(`<${l}${T_(M_(r.attrs??{},t,l))}>`);continue}if(r.type==="tag_open"){o.push(`<${l}${T_(M_(r.attrs??{},t,l))}>`),dl.has(l)||s.push(l);continue}const a=s.lastIndexOf(l);if(a===-1)continue;for(;s.length>a+1;){const u=s.pop();u&&o.push(`</${u}>`)}const c=s.pop();c&&o.push(`</${c}>`)}for(;s.length>0;){const r=s.pop();r&&o.push(`</${r}>`)}return o.join("")}const K9=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],E_="http://www.w3.org/2000/svg",G9=new Set(["script","style","iframe","object","embed","link","meta"]),Y9=new Set(["svg","style","g","a","defs","marker","path","rect","circle","ellipse","line","polyline","polygon","text","tspan","title","desc","use","image","lineargradient","radialgradient","stop","clippath","mask","pattern"]),X9=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),Z9=new Set(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),J9=new Set(["circle","ellipse","image","line","path","polygon","polyline","rect","text","tspan","use"]);function Q9(e){return(e.getAttribute("href")||e.getAttribute("xlink:href"))?.startsWith("#")===!0}function eF(e){return!!(e.getAttribute("href")||e.getAttribute("xlink:href")||e.getAttribute("src"))}function tF(e){const t=e.nodeName.toLowerCase();return t==="use"?Q9(e):t==="image"?eF(e):t==="text"||t==="tspan"?!!e.textContent?.trim():J9.has(t)}function nF(e){return e.replace(/(["'])\s*javascript:/gi,"$1#").replace(/\bjavascript:/gi,"#").replace(/(["'])\s*vbscript:/gi,"$1#").replace(/\bvbscript:/gi,"#").replace(/\bdata:text\/html/gi,"#")}function sF(e,t,n){const s=e.toLowerCase(),o=t.toLowerCase(),i=String(n??"").trim();return i?(s==="use"||s==="marker"||s==="clippath"||s==="mask")&&(o==="href"||o==="xlink:href")?i.startsWith("#")?i:"":s==="a"&&(o==="href"||o==="xlink:href")?la(i,{tagName:"a",attrName:"href"})?"":i:s==="image"&&(o==="href"||o==="xlink:href"||o==="src")?la(i,{tagName:"img",attrName:"src"})?"":i:o==="href"||o==="xlink:href"?i.startsWith("#")?i:"":la(i,{tagName:s,attrName:o})?"":i:""}function oF(e,t){let n=t+4;for(;n<e.length&&/\s/.test(e[n]??"");)n++;const s=e[n];if(s==='"'||s==="'"){const i=n+1,r=e.indexOf(s,i);if(r===-1)return{next:e.length,url:""};for(n=r+1;n<e.length&&/\s/.test(e[n]??"");)n++;return{next:n<e.length&&e[n]===")"?n+1:n,url:e.slice(i,r)}}const o=n;for(;n<e.length&&e[n]!==")";)n++;return{next:n<e.length?n+1:n,url:e.slice(o,n)}}function ST(e){return e.replace(/\\([0-9a-f]{1,6}\s?|.)/gi,(t,n)=>{const s=n.trim();if(/^[0-9a-f]+$/i.test(s)){const o=Number.parseInt(s,16);try{return Number.isFinite(o)?String.fromCodePoint(o):""}catch{return""}}return String(n).trim()})}function CT(e){const t=ST(e),n=t.toLowerCase();let s=0;for(;s<n.length;){const o=n.indexOf("url(",s);if(o===-1)return!1;const i=oF(t,o);if(s=Math.max(i.next,o+4),!i.url.trim().startsWith("#"))return!0}return!1}function I_(e){const t=ST(e);return K9.some(n=>n.test(t))||CT(t)}function iF(e){if(e.tagName.toLowerCase()!=="a"||e.getAttribute("target")?.trim().toLowerCase()!=="_blank")return;const t=new Set(String(e.getAttribute("rel")??"").split(/\s+/).map(n=>n.trim()).filter(Boolean).filter(n=>n.toLowerCase()!=="opener"));t.add("noopener"),t.add("noreferrer"),e.setAttribute("rel",Array.from(t).join(" "))}function ld(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function xT(e,t){if(e.nodeType===Node.TEXT_NODE){const o=e.textContent??"";o&&t.push(o);return}if(e.nodeType!==Node.ELEMENT_NODE)return;const n=e,s=n.tagName.toLowerCase();if(!G9.has(s)){if(s==="br"){t.push(`
|
|
207
|
-
`);return}for(const o of Array.from(n.childNodes))xT(o,t)}}function rF(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];xT(t,n);const s=n.join("").split(/\r?\n/).map(u=>u.trim()).filter(Boolean);if(!s.length){t.remove();continue}const o=ld(t.getAttribute("width")),i=ld(t.getAttribute("height")),r=ld(t.getAttribute("x")),l=ld(t.getAttribute("y")),a=e.ownerDocument.createElementNS(E_,"text");a.setAttribute("x",String(r+o/2)),a.setAttribute("y",String(l+i/2)),a.setAttribute("text-anchor","middle"),a.setAttribute("dominant-baseline","central");const c=t.querySelector(".nodeLabel");if(c?.getAttribute("class")&&a.setAttribute("class",c.getAttribute("class")),s.length===1)a.textContent=s[0];else{const u=-.6*(s.length-1);for(const[d,h]of s.entries()){const p=e.ownerDocument.createElementNS(E_,"tspan");p.setAttribute("x",String(r+o/2)),p.setAttribute("dy",d===0?`${u}em`:"1.2em"),p.textContent=h,a.appendChild(p)}}t.parentNode?.replaceChild(a,t)}}function lF(e){rF(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const s=n.tagName.toLowerCase();if(!Y9.has(s)){n.remove();continue}if(s==="style"&&I_(n.textContent??"")){n.remove();continue}const o=Array.from(n.attributes);for(const i of o){const r=i.name.toLowerCase();if(/^on/i.test(r)){n.removeAttribute(i.name);continue}if(r==="style"&&i.value&&I_(i.value)){n.removeAttribute(i.name);continue}if(r==="srcdoc"){n.removeAttribute(i.name);continue}if(X9.has(r)&&i.value){const l=sF(s,r,i.value);if(!l){n.removeAttribute(i.name);continue}l!==i.value&&n.setAttribute(i.name,l);continue}if(Z9.has(r)&&i.value&&CT(i.value)){n.removeAttribute(i.name);continue}if(i.value){const l=nF(i.value);l!==i.value&&n.setAttribute(i.name,l)}}iF(n)}}function Dfe(e){if(typeof DOMParser>"u"||!e)return null;try{const t=new DOMParser().parseFromString(e,"image/svg+xml").documentElement;if(!t||t.nodeName.toLowerCase()!=="svg")return null;const n=t;return lF(n),aF(n)?null:n}catch{return null}}function aF(e){const t=e.getAttribute("viewBox");if(t){const o=t.trim().split(/[\s,]+/);if(o.length===4){const i=Number.parseFloat(o[2]||""),r=Number.parseFloat(o[3]||"");if(!Number.isFinite(i)||!Number.isFinite(r)||i<=0||r<=0)return!0}}const n=[e,...Array.from(e.querySelectorAll("*"))];let s=!1;for(const o of n){tF(o)&&(s=!0);for(const i of Array.from(o.attributes))if(/\bNaN\b/i.test(i.value)||i.name==="style"&&/max-width:\s*0(?:px)?/i.test(i.value))return!0}return!s}const $_=[];function gm(e){return String(e??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function cF(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function uF(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function N_(e=`editor-${Date.now()}`,t={}){const n=MD(t),s={"common.copy":"Copy"};let o;if(typeof t.i18n=="function")o=t.i18n;else if(t.i18n&&typeof t.i18n=="object"){const h=t.i18n;o=p=>h[p]??s[p]??p}else o=h=>s[h]??h;if(Array.isArray(t.plugin))for(const h of t.plugin){const p=h;if(Array.isArray(p)){const[f,...g]=p;typeof f=="function"&&n.use(f,...g)}else typeof p=="function"&&n.use(p)}if(Array.isArray(t.apply))for(const h of t.apply)try{h(n)}catch(p){console.error("[getMarkdown] apply function threw an error",p)}if($_.length)for(const h of $_)if(Array.isArray(h)){const[p,...f]=h;typeof p=="function"&&n.use(p,...f)}else typeof h=="function"&&n.use(h);n.use(v8),n.use(b8),n.use(p8);const i=O8,r=i.default??i;n.use(r),n.use(h8),n.use(f8),n.core.ruler.after("block","mark_fence_closed",h=>{const p=h,f=p.src,g=!!p.env?.__markstreamFinal,w=f.split(/\r?\n/);for(const S of p.tokens){if(S.type!=="fence"||!S.map||!S.markup)continue;const y=S.map[0],k=S.map[1],v=S.markup,_=v[0],I=v.length,A=w[Math.max(0,k-1)]??"";let b=0;for(;b<A.length&&(A[b]===" "||A[b]===" ");)b++;let M=0;for(;b+M<A.length&&A[b+M]===_;)M++;let N=b+M;for(;N<A.length&&(A[N]===" "||A[N]===" ");)N++;const D=g?!0:k>y+1&&M>=I&&N===A.length,$=S;$.meta=$.meta??{},$.meta.unclosed=!D,$.meta.closed=!!D}});const l=(h,p)=>{const f=h,g=f.pos;if(f.src[g]!=="~")return!1;const w=f.src[g-1],S=f.src[g+1];if(/\d/.test(w)&&/\d/.test(S)){if(!p){const y=f.push("text","",0);y.content="~"}return f.pos+=1,!0}return!1};n.inline.ruler.before("sub","wave",l),n.renderer.rules.fence=(h,p)=>{const f=h[p],g=String(f.info??"").trim(),w=String(f.content??""),S=btoa(unescape(encodeURIComponent(w))),y=cF(g),k=gm(y),v=uF(`editor-${e}-${p}-${y}`),_=gm(o("common.copy"));return`<div class="code-block" data-code="${S}" data-lang="${k}" id="${v}">
|
|
208
|
-
<div class="code-header">
|
|
209
|
-
<span class="code-lang">${gm(y.toUpperCase())}</span>
|
|
210
|
-
<button class="copy-button" data-code="${S}">${_}</button>
|
|
211
|
-
</div>
|
|
212
|
-
<div class="code-editor"></div>
|
|
213
|
-
</div>`};const a=/^\[(\d+)\]/,c=/^\[([^\]\n]+)\]/,u=h=>{if(!h.startsWith("["))return!1;const p=c.exec(h);if(!p)return h!=="["&&!/^\[\d+$/.test(h);const f=String(p[1]??"");return h.slice(p[0].length).startsWith("(")?!1:!/^\d+$/.test(f)},d=(h,p)=>{const f=h;if(f.src[f.pos]!=="[")return!1;const g=a.exec(f.src.slice(f.pos));if(!g)return!1;const w=f.src.slice(Math.max(0,f.pos-120),f.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(w))return!1;const S=f.src.slice(f.pos+g[0].length);if(S.startsWith("](")||S.startsWith("(")||u(S))return!1;if(!p){const y=g[1],k=f.push("reference","span",0);k.content=y,k.markup=g[0],k.raw=g[0]}return f.pos+=g[0].length,!0};return n.inline.ruler.before("escape","reference",d),n.renderer.rules.reference=(h,p)=>{const g=String(h[p].content??"");return`<span class="reference-link" data-reference-id="${g}" role="button" tabindex="0" title="Click to view reference">${g}</span>`},n}const dF="modulepreload",fF=function(e){return"/"+e},L_={},Qs=function(t,n,s){let o=Promise.resolve();if(n&&n.length>0){let r=function(c){return Promise.all(c.map(u=>Promise.resolve(u).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),a=l?.nonce||l?.getAttribute("nonce");o=r(n.map(c=>{if(c=fF(c),c in L_)return;L_[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const h=document.createElement("link");if(h.rel=u?"stylesheet":dF,u||(h.as="script"),h.crossOrigin="",h.href=c,a&&h.setAttribute("nonce",a),document.head.appendChild(h),u)return new Promise((p,f)=>{h.addEventListener("load",p),h.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(r){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=r,window.dispatchEvent(l),!l.defaultPrevented)throw r}return o.then(r=>{for(const l of r||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})};function hF({nextContent:e,previousContent:t,typewriterEnabled:n}){return n?e===t?{settledContent:e,streamedDelta:"",appended:!1}:t&&e.startsWith(t)&&e.length>t.length?{settledContent:t,streamedDelta:e.slice(t.length),appended:!0}:{settledContent:e,streamedDelta:"",appended:!1}:{settledContent:e,streamedDelta:"",appended:!1}}function TT({nextContent:e,persistedContent:t,currentState:n,typewriterEnabled:s,streamRenderVersionChanged:o=!1}){const i=`${n.settledContent}${n.streamedDelta}`;return s?n.streamedDelta&&i===e?o?{settledContent:i,streamedDelta:"",appended:!1}:{settledContent:n.settledContent,streamedDelta:n.streamedDelta,appended:!1}:hF({nextContent:e,previousContent:t??i,typewriterEnabled:s}):{settledContent:e,streamedDelta:"",appended:!1}}const O_=new WeakMap;function pF(e){let t=O_.get(e);return t||(t={inFlight:new Map,completed:new Set,registeredAllLangs:!1,registeredThemes:[],registeredLangs:[],tail:Promise.resolve()},O_.set(e,t)),t}function P_(e,t){if(!t?.length)return[...e];const n=[...e],s=new Set(n);for(const o of t)s.has(o)||(s.add(o),n.push(o));return n}function xv(e){return!!(e.themes?.length||e.langs?.length)}function MT(e,t){if(!t?.length)return!0;const n=new Set(e);return t.every(s=>n.has(s))}function mF(e,t){return!t?.length||e.registeredAllLangs?!0:MT(e.registeredLangs,t)}function vm(e,t){return xv(t)&&MT(e.registeredThemes,t.themes)&&mF(e,t.langs)}function gF(e,t){if(!xv(t))return t;const n=P_(e.registeredThemes,t.themes),s=e.registeredAllLangs?[]:P_(e.registeredLangs,t.langs);return{...n.length?{themes:n}:{},...s.length?{langs:s}:{}}}const vF={plain:"plaintext",text:"plaintext",txt:"plaintext",js:"javascript",mjs:"javascript",cjs:"javascript",ts:"typescript",mts:"typescript",cts:"typescript",golang:"go",py:"python",rb:"ruby",rs:"rust",kt:"kotlin",kts:"kotlin",md:"markdown",yml:"yaml",sh:"shellscript",bash:"shellscript",zsh:"shellscript",shell:"shellscript",shellscript:"shellscript",ps:"powershell",ps1:"powershell",pwsh:"powershell","c++":"cpp","c#":"csharp",cs:"csharp",objc:"objective-c",objectivec:"objective-c","objective-c":"objective-c",objectivecpp:"objective-cpp","objective-c++":"objective-cpp","objective-cpp":"objective-cpp"};function yF(e){const t=String(e??"").trim();if(!t)return"";const[n=""]=t.split(/\s+/);return n.split(":")[0]?.trim().toLowerCase()??""}function AT(e){const t=yF(e);return vF[t]??t}function ET(e){if(!Array.isArray(e))return;const t=e.filter(s=>typeof s=="string").map(s=>AT(s)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function IT(e){if(!Array.isArray(e))return;const t=[],n=new Set;for(const s of e){if(typeof s!="string")continue;const o=s.trim();!o||n.has(o)||(n.add(o),t.push(o))}return t.length>0?t:void 0}function kF(e){return IT(e)?.join("\0")??""}function $T(e,t){const n=IT(e),s=ET(t);return{...n?.length?{themes:n}:{},...s?.length?{langs:s}:{}}}function Mf(e,t){return`${kF(e)}\0\0${ET(t)?.join("\0")??""}`}function Bfe(e,t,n={hasRegisterHighlight:!0,hasCreateRenderer:!0}){const s=$T(e,t),o={...s},i=!!(o.langs?.length&&n.hasCreateRenderer&&!n.hasRegisterHighlight);return i&&(delete s.langs,delete o.langs),{key:Mf(o.themes,o.langs),registerOptions:s,rendererOptions:o,ignoredLangs:i}}async function Ffe(e,t={},n){if(!e)return"ready";const s=$T(t.themes,t.langs),o=Mf(s.themes,s.langs),i=n&&n===o?n:o,r=pF(e);if(r.completed.has(i))return"ready";if(vm(r,s))return r.completed.add(i),"ready";const l=r.inFlight.get(i);if(l)return l;const a=r.tail.catch(()=>{}).then(()=>{if(r.completed.has(i)||vm(r,s))return r.completed.add(i),"ready";const c=gF(r,s),u=Mf(c.themes,c.langs);return r.completed.has(u)||vm(r,c)?(r.completed.add(i),r.completed.add(u),"ready"):Promise.resolve(e(c)).then(()=>(xv(c)?(r.registeredThemes=c.themes?[...c.themes]:r.registeredThemes,r.registeredLangs=c.langs?[...c.langs]:r.registeredLangs):r.registeredAllLangs=!0,r.completed.add(u),"ready"))}).then(()=>(r.completed.add(i),"ready")).finally(()=>{r.inFlight.get(i)===a&&r.inFlight.delete(i)});return r.inFlight.set(i,a),r.tail=a.catch(()=>{}),a}function Nl(e,t,n=1){const s=Number(e);return Number.isFinite(s)?Math.max(n,s):t}function R_(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var bF=class{constructor(e={},t){this.source="",this.visible="",this.done=!1,this.paused=!1,this.listeners=new Set,this.rafId=0,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.hasStarted=!1,this.destroyed=!1,this.getSnapshot=()=>({source:this.source,visible:this.visible,done:this.done,paused:this.paused,pendingChars:this.pendingChars,caughtUp:this.caughtUp,final:this.final}),this.subscribe=d=>this.destroyed?()=>{}:(this.listeners.add(d),()=>{this.listeners.delete(d)}),this.enqueue=d=>{if(this.destroyed||!d)return;this.done&&(this.done=!1);const h=this.source.length>0,p=this.pendingChars<=0;if(this.source+=d,p){const f=D_();this.startedAt=h&&this.hasStarted?f-this.normalizedStartDelayMs:f,this.lastTick=f,this.charBudget=0}this.hasStarted=!0,this.emit(),this.ensureLoop()},this.finish=(d={})=>{if(!this.destroyed){if(this.done=!0,d.flush??this.flushOnFinish){this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit();return}this.emit(),this.ensureLoop()}},this.flush=()=>{this.destroyed||(this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit())},this.reset=(d="")=>{this.destroyed||(this.cancelLoop(),this.source=d,this.visible=d,this.done=!1,this.paused=!1,this.hasStarted=!1,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.emit())},this.pause=()=>{this.destroyed||this.paused||(this.paused=!0,this.cancelLoop(),this.emit())},this.resume=()=>{if(this.destroyed||!this.paused)return;this.paused=!1;const d=D_();this.lastTick=d,this.startedAt||=d,this.emit(),this.ensureLoop()},this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.cancelLoop(),this.listeners.clear())},this.dispose=()=>{this.destroy()},this.tick=d=>{if(this.rafId=0,this.destroyed||this.paused)return;if(this.pendingChars<=0){this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond;return}if(d-this.startedAt<this.normalizedStartDelayMs){this.rafId=requestAnimationFrame(this.tick);return}const h=1e3/Math.max(1,this.maxCommitFps),p=Math.min(100,Math.max(0,d-this.lastTick));if(p<h){this.rafId=requestAnimationFrame(this.tick);return}this.lastTick=d;const f=this.pendingChars,g=f>this.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,w=CF(f/Math.max(.001,g/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(w-this.currentCps)*.2,this.charBudget+=this.currentCps*(p/1e3),this.charBudget<1){this.ensureLoop();return}const S=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),y=SF(this.source.slice(this.visible.length),S,this.segmenter);y.text&&(this.visible+=y.text,this.charBudget=Math.max(0,this.charBudget-y.graphemeCount),this.emit()),this.ensureLoop()};const{minCharsPerSecond:n=40,maxCharsPerSecond:s=1e3,targetLatencyMs:o=900,catchUpLatencyMs:i=350,catchUpThreshold:r=600,maxCommitFps:l=30,startDelayMs:a=80,maxCharsPerCommit:c=80,flushOnFinish:u=!1}=e;this.minCharsPerSecond=Nl(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,Nl(s,1e3,1)),this.normalizedTargetLatencyMs=Nl(o,900,1),this.normalizedCatchUpLatencyMs=Nl(i,350,1),this.normalizedCatchUpThreshold=R_(r,600),this.normalizedStartDelayMs=R_(a,80),this.maxCommitFps=Math.trunc(Nl(l,30,1)),this.maxCharsPerCommit=Math.trunc(Nl(c,80,1)),this.flushOnFinish=u,this.segmenter=wF(),t&&this.listeners.add(t),this.currentCps=this.minCharsPerSecond}get pendingChars(){return Math.max(0,this.source.length-this.visible.length)}get caughtUp(){return this.pendingChars===0}get final(){return this.done&&this.caughtUp}ensureLoop(){if(!(this.destroyed||this.rafId||this.paused||this.pendingChars<=0)){if(typeof requestAnimationFrame!="function"){this.flush();return}this.rafId=requestAnimationFrame(this.tick)}}cancelLoop(){this.rafId&&(typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(this.rafId),this.rafId=0)}emit(){if(!this.destroyed)for(const e of this.listeners)e()}};function _F(e={},t){const n=new bF(e,t);return{getSnapshot:n.getSnapshot,subscribe:n.subscribe,enqueue:n.enqueue,finish:n.finish,flush:n.flush,reset:n.reset,pause:n.pause,resume:n.resume,destroy:n.destroy,dispose:n.dispose}}function wF(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function SF(e,t,n){if(!e||t<=0)return{text:"",graphemeCount:0};if(!n){const i=Array.from(e).slice(0,t);return{text:i.join(""),graphemeCount:i.length}}let s="",o=0;for(const i of n.segment(e)){if(o>=t)break;s+=i.segment,o++}return{text:s,graphemeCount:o}}function D_(){return typeof performance<"u"?performance.now():Date.now()}function CF(e,t,n){return Math.min(n,Math.max(t,e))}var xF=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const Bg=Symbol.for("markstream-vue:node-lifecycle"),B_='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M30 14v-2h-2V8h-2v4h-2V8h-2v4h-2v2h2v2h-2v2h2v4h2v-4h2v4h2v-4h2v-2h-2v-2Zm-4 2h-2v-2h2Zm-12.437 6A5.57 5.57 0 0 1 8 16.437v-2.873A5.57 5.57 0 0 1 13.563 8H18V2h-4.437A11.563 11.563 0 0 0 2 13.563v2.873A11.564 11.564 0 0 0 13.563 28H18v-6Z"/></svg>',F_='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path d="M0 0h24v24H0z"/><path fill="#42a5f5" d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm4 18H6V4h7v5h5z"/></svg>',TF={id:"material",core:{"":F_,plain:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path d="M0 0h24v24H0z"/><path fill="#42a5f5" d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm4 18H6V4h7v5h5z"/></svg>',text:F_,javascript:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#ffca28" d="M2 2v12h12V2zm6 6h1v4a1.003 1.003 0 0 1-1 1H7a1.003 1.003 0 0 1-1-1v-1h1v1h1zm3 0h2v1h-2v1h1a1.003 1.003 0 0 1 1 1v1a1.003 1.003 0 0 1-1 1h-2v-1h2v-1h-1a1.003 1.003 0 0 1-1-1V9a1.003 1.003 0 0 1 1-1"/></svg>',typescript:'<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="0 0 16 16"><path fill="#0288d1" d="M2 2v12h12V2zm4 6h3v1H8v4H7V9H6zm5 0h2v1h-2v1h1a1.003 1.003 0 0 1 1 1v1a1.003 1.003 0 0 1-1 1h-2v-1h2v-1h-1a1.003 1.003 0 0 1-1-1V9a1.003 1.003 0 0 1 1-1"/></svg>',jsx:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#00bcd4" d="M16 12c7.444 0 12 2.59 12 4s-4.556 4-12 4-12-2.59-12-4 4.556-4 12-4m0-2c-7.732 0-14 2.686-14 6s6.268 6 14 6 14-2.686 14-6-6.268-6-14-6"/><path fill="#00bcd4" d="M16 14a2 2 0 1 0 2 2 2 2 0 0 0-2-2"/><path fill="#00bcd4" d="M10.458 5.507c2.017 0 5.937 3.177 9.006 8.493 3.722 6.447 3.757 11.687 2.536 12.392a.9.9 0 0 1-.457.1c-2.017 0-5.938-3.176-9.007-8.492C8.814 11.553 8.779 6.313 10 5.608a.9.9 0 0 1 .458-.1m-.001-2A2.87 2.87 0 0 0 9 3.875C6.13 5.532 6.938 12.304 10.804 19c3.284 5.69 7.72 9.493 10.74 9.493A2.87 2.87 0 0 0 23 28.124c2.87-1.656 2.062-8.428-1.804-15.124-3.284-5.69-7.72-9.493-10.74-9.493Z"/><path fill="#00bcd4" d="M21.543 5.507a.9.9 0 0 1 .457.1c1.221.706 1.186 5.946-2.536 12.393-3.07 5.316-6.99 8.493-9.007 8.493a.9.9 0 0 1-.457-.1C8.779 25.686 8.814 20.446 12.536 14c3.07-5.316 6.99-8.493 9.007-8.493m0-2c-3.02 0-7.455 3.804-10.74 9.493C6.939 19.696 6.13 26.468 9 28.124a2.87 2.87 0 0 0 1.457.369c3.02 0 7.455-3.804 10.74-9.493C25.061 12.304 25.87 5.532 23 3.876a2.87 2.87 0 0 0-1.457-.369"/></svg>',tsx:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M16 12c7.444 0 12 2.59 12 4s-4.556 4-12 4-12-2.59-12-4 4.556-4 12-4m0-2c-7.732 0-14 2.686-14 6s6.268 6 14 6 14-2.686 14-6-6.268-6-14-6"/><path fill="#0288d1" d="M16 14a2 2 0 1 0 2 2 2 2 0 0 0-2-2"/><path fill="#0288d1" d="M10.458 5.507c2.017 0 5.937 3.177 9.006 8.493 3.722 6.447 3.757 11.687 2.536 12.392a.9.9 0 0 1-.457.1c-2.017 0-5.938-3.176-9.007-8.492C8.814 11.553 8.779 6.313 10 5.608a.9.9 0 0 1 .458-.1m-.001-2A2.87 2.87 0 0 0 9 3.875C6.13 5.532 6.938 12.304 10.804 19c3.284 5.69 7.72 9.493 10.74 9.493A2.87 2.87 0 0 0 23 28.124c2.87-1.656 2.062-8.428-1.804-15.124-3.284-5.69-7.72-9.493-10.74-9.493Z"/><path fill="#0288d1" d="M21.543 5.507a.9.9 0 0 1 .457.1c1.221.706 1.186 5.946-2.536 12.393-3.07 5.316-6.99 8.493-9.007 8.493a.9.9 0 0 1-.457-.1C8.779 25.686 8.814 20.446 12.536 14c3.07-5.316 6.99-8.493 9.007-8.493m0-2c-3.02 0-7.455 3.804-10.74 9.493C6.939 19.696 6.13 26.468 9 28.124a2.87 2.87 0 0 0 1.457.369c3.02 0 7.455-3.804 10.74-9.493C25.061 12.304 25.87 5.532 23 3.876a2.87 2.87 0 0 0-1.457-.369"/></svg>',html:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#e65100" d="m4 4 2 22 10 2 10-2 2-22Zm19.72 7H11.28l.29 3h11.86l-.802 9.335L15.99 25l-6.635-1.646L8.93 19h3.02l.19 2 3.86.77 3.84-.77.29-4H8.84L8 8h16Z"/></svg>',css:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#7e57c2" d="M20 18h-2v-2h-2v2c0 .193 0 .703 1.254 1.033A3.345 3.345 0 0 1 20 22h2v2h2v-2c0-.388-.562-.851-1.254-1.034C20.356 20.34 20 18.84 20 18m-3.254 2.966C14.356 20.34 14 18.84 14 18h-2v-2h-2v8h2v-2h4v2h2v-2c0-.388-.562-.851-1.254-1.034"/><path fill="#7e57c2" d="M24 4H4v20a4 4 0 0 0 4 4h16.16A3.84 3.84 0 0 0 28 24.16V8a4 4 0 0 0-4-4m2 14h-2v-2h-2v2c0 .193 0 .703 1.254 1.033A3.345 3.345 0 0 1 26 22v2a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2 2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2 2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2 2 2 0 0 1 2-2h2a2 2 0 0 1 2 2 2 2 0 0 1 2-2h2a2 2 0 0 1 2 2Z"/></svg>',scss:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ec407a" d="M27.837 5.673a4.33 4.33 0 0 0-2.293-2.701c-2.362-1.261-6.11-1.298-9.548-.092a26.3 26.3 0 0 0-8.76 4.966c-2.752 2.542-3.438 4.925-3.189 6.194.523 2.668 3.274 4.539 5.485 6.042.418.284.822.559 1.175.816-1.429.76-4.261 2.444-5.088 4.248a3.88 3.88 0 0 0-.118 3.332A2.37 2.37 0 0 0 6.869 29.8a5.6 5.6 0 0 0 1.49.2 6.35 6.35 0 0 0 5.19-2.856 6.74 6.74 0 0 0 .864-5.382 7.3 7.3 0 0 1 2.044-.03 3.92 3.92 0 0 1 2.816 1.311 1.82 1.82 0 0 1 .423 1.262 1.55 1.55 0 0 1-.772 1.05c-.234.14-.586.355-.504.803.036.194.198.633.894.512a2.93 2.93 0 0 0 2.145-2.651 4 4 0 0 0-1.197-2.904 5.94 5.94 0 0 0-4.396-1.626 10.6 10.6 0 0 0-2.672.304 20 20 0 0 0-2.203-1.846c-1.712-1.3-3.33-2.529-3.235-4.26.125-2.263 2.468-4.532 6.964-6.744 4.016-1.976 7.254-2.037 8.944-1.438a2 2 0 0 1 1.204.883 2.77 2.77 0 0 1-.36 2.47 9.71 9.71 0 0 1-7.425 4.304 3.86 3.86 0 0 1-3.238-.757c-.278-.302-.593-.645-1.074-.383q-.565.31-.225 1.189a3.9 3.9 0 0 0 2.407 1.92 11.7 11.7 0 0 0 7.128-.671c3.527-1.35 6.681-5.202 5.756-8.787M11.895 24.475a4 4 0 0 1-.192.468 4.5 4.5 0 0 1-.753 1.081 2.83 2.83 0 0 1-2.533 1.107c-.056-.032-.078-.146-.085-.193a3.28 3.28 0 0 1 1.076-2.284 11.3 11.3 0 0 1 2.644-1.933 3.85 3.85 0 0 1-.157 1.754"/></svg>',json:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="#f9a825" d="M560-160v-80h120q17 0 28.5-11.5T720-280v-80q0-38 22-69t58-44v-14q-36-13-58-44t-22-69v-80q0-17-11.5-28.5T680-720H560v-80h120q50 0 85 35t35 85v80q0 17 11.5 28.5T840-560h40v160h-40q-17 0-28.5 11.5T800-360v80q0 50-35 85t-85 35zm-280 0q-50 0-85-35t-35-85v-80q0-17-11.5-28.5T120-400H80v-160h40q17 0 28.5-11.5T160-600v-80q0-50 35-85t85-35h120v80H280q-17 0-28.5 11.5T240-680v80q0 38-22 69t-58 44v14q36 13 58 44t22 69v80q0 17 11.5 28.5T280-240h120v80z"/></svg>',python:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#0288d1" d="M9.86 2A2.86 2.86 0 0 0 7 4.86v1.68h4.29c.39 0 .71.57.71.96H4.86A2.86 2.86 0 0 0 2 10.36v3.781a2.86 2.86 0 0 0 2.86 2.86h1.18v-2.68a2.85 2.85 0 0 1 2.85-2.86h5.25c1.58 0 2.86-1.271 2.86-2.851V4.86A2.86 2.86 0 0 0 14.14 2zm-.72 1.61c.4 0 .72.12.72.71s-.32.891-.72.891c-.39 0-.71-.3-.71-.89s.32-.711.71-.711"/><path fill="#fdd835" d="M17.959 7v2.68a2.85 2.85 0 0 1-2.85 2.859H9.86A2.85 2.85 0 0 0 7 15.389v3.75a2.86 2.86 0 0 0 2.86 2.86h4.28A2.86 2.86 0 0 0 17 19.14v-1.68h-4.291c-.39 0-.709-.57-.709-.96h7.14A2.86 2.86 0 0 0 22 13.64V9.86A2.86 2.86 0 0 0 19.14 7zM8.32 11.513l-.004.004.038-.004zm6.54 7.276c.39 0 .71.3.71.89a.71.71 0 0 1-.71.71c-.4 0-.72-.12-.72-.71s.32-.89.72-.89"/></svg>',ruby:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#f44336" d="M18.041 3.177c2.24.382 2.879 1.919 2.843 3.527V6.67l-1.013 13.266-13.132.897h.008c-1.093-.044-3.518-.151-3.634-3.545l1.217-2.222 2.462 5.74 2.097-6.77-.045.009.018-.018 6.85 2.186L13.945 9.3l6.53-.409-5.144-4.212 2.71-1.51v.009M3.113 17.252v.017zM6.916 6.874c2.63-2.622 6.033-4.168 7.34-2.844 1.297 1.306-.072 4.523-2.702 7.135-2.666 2.613-6.015 4.248-7.322 2.933-1.306-1.324.036-4.612 2.675-7.224z"/></svg>',go:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#00acc1" d="M2 12h4v2H2zm-2 4h6v2H0zm4 4h2v2H4zm16.954-5H14v3h3.239a4.42 4.42 0 0 1-3.531 2 2.65 2.65 0 0 1-2.053-.858 2.86 2.86 0 0 1-.628-2.28A4.515 4.515 0 0 1 15.292 13a2.73 2.73 0 0 1 1.749.584l2.962-1.185A5.6 5.6 0 0 0 15.292 10a7.526 7.526 0 0 0-7.243 6.5 5.614 5.614 0 0 0 5.659 6.5 7.526 7.526 0 0 0 7.243-6.5 6.4 6.4 0 0 0 .003-1.5"/><path fill="#00acc1" d="M26.292 10a7.526 7.526 0 0 0-7.243 6.5 5.614 5.614 0 0 0 5.659 6.5 7.526 7.526 0 0 0 7.243-6.5 5.614 5.614 0 0 0-5.659-6.5m2.681 6.137A4.515 4.515 0 0 1 24.708 20a2.65 2.65 0 0 1-2.053-.858 2.86 2.86 0 0 1-.628-2.28A4.515 4.515 0 0 1 26.292 13a2.65 2.65 0 0 1 2.053.858 2.86 2.86 0 0 1 .628 2.28Z"/></svg>',java:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#f44336" d="M4 26h24v2H4zM28 4H7a1 1 0 0 0-1 1v13a4 4 0 0 0 4 4h10a4 4 0 0 0 4-4v-4h4a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2m0 8h-4V6h4Z"/></svg>',kotlin:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><defs><linearGradient id="a" x1="1.725" x2="22.185" y1="22.67" y2="1.982" gradientTransform="translate(1.306 1.129)scale(.89324)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#7c4dff"/><stop offset=".5" stop-color="#d500f9"/><stop offset="1" stop-color="#ef5350"/></linearGradient></defs><path fill="url(#a)" d="M2.975 2.976v18.048h18.05v-.03l-4.478-4.511-4.48-4.515 4.48-4.515 4.443-4.477z"/></svg>',c:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M19.563 22A5.57 5.57 0 0 1 14 16.437v-2.873A5.57 5.57 0 0 1 19.563 8H24V2h-4.437A11.563 11.563 0 0 0 8 13.563v2.873A11.564 11.564 0 0 0 19.563 28H24v-6Z"/></svg>',cpp:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M28 14v-4h-2v4h-6v-4h-2v4h-4v2h4v4h2v-4h6v4h2v-4h4v-2z"/><path fill="#0288d1" d="M13.563 22A5.57 5.57 0 0 1 8 16.437v-2.873A5.57 5.57 0 0 1 13.563 8H18V2h-4.437A11.563 11.563 0 0 0 2 13.563v2.873A11.564 11.564 0 0 0 13.563 28H18v-6Z"/></svg>',cs:B_,csharp:B_,php:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#1e88e5" d="M12 18.08c-6.63 0-12-2.72-12-6.08s5.37-6.08 12-6.08S24 8.64 24 12s-5.37 6.08-12 6.08m-5.19-7.95c.54 0 .91.1 1.09.31.18.2.22.56.13 1.03-.1.53-.29.87-.58 1.09q-.42.33-1.29.33h-.87l.53-2.76zm-3.5 5.55h1.44l.34-1.75h1.23c.54 0 .98-.06 1.33-.17.35-.12.67-.31.96-.58.24-.22.43-.46.58-.73.15-.26.26-.56.31-.88.16-.78.05-1.39-.33-1.82-.39-.44-.99-.65-1.82-.65H4.59zm7.25-8.33-1.28 6.58h1.42l.74-3.77h1.14c.36 0 .6.06.71.18s.13.34.07.66l-.57 2.93h1.45l.59-3.07c.13-.62.03-1.07-.27-1.36-.3-.27-.85-.4-1.65-.4h-1.27L12 7.35zM18 10.13c.55 0 .91.1 1.09.31.18.2.22.56.13 1.03-.1.53-.29.87-.57 1.09-.29.22-.72.33-1.3.33h-.85l.5-2.76zm-3.5 5.55h1.44l.34-1.75h1.22c.55 0 1-.06 1.35-.17.35-.12.65-.31.95-.58.24-.22.44-.46.58-.73.15-.26.26-.56.32-.88.15-.78.04-1.39-.34-1.82-.36-.44-.99-.65-1.82-.65h-2.75z"/></svg>',shell:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#ff7043" d="M2 2a1 1 0 0 0-1 1v10c0 .554.446 1 1 1h12c.554 0 1-.446 1-1V3a1 1 0 0 0-1-1zm0 3h12v8H2zm1 2 2 2-2 2 1 1 3-3-3-3zm5 3.5V12h5v-1.5z"/></svg>',powershell:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#03a9f4" d="M29.07 6H7.677A1.535 1.535 0 0 0 6.24 7.113l-4.2 17.774A.852.852 0 0 0 2.93 26h21.393a1.535 1.535 0 0 0 1.436-1.113L29.96 7.112A.852.852 0 0 0 29.07 6M8.626 23.797a1.4 1.4 0 0 1-1.814-.31l-.007-.009a1.075 1.075 0 0 1 .315-1.599l9.6-6.061-6.102-5.852-.01-.01a1.068 1.068 0 0 1 .084-1.625l.037-.03a1.38 1.38 0 0 1 1.8.07l7.233 6.957a1.1 1.1 0 0 1 .236.739 1.08 1.08 0 0 1-.412.79c-.074.04-.146.119-10.951 6.935ZM24 22.94A1.135 1.135 0 0 1 22.803 24h-5.634a1.061 1.061 0 1 1 .001-2.112h5.633A1.134 1.134 0 0 1 24 22.938Z"/></svg>',sql:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ffca28" d="M16 24c-5.525 0-10-.9-10-2v4c0 1.1 4.475 2 10 2s10-.9 10-2v-4c0 1.1-4.475 2-10 2m0-8c-5.525 0-10-.9-10-2v4c0 1.1 4.475 2 10 2s10-.9 10-2v-4c0 1.1-4.475 2-10 2m0-12C10.477 4 6 4.895 6 6v4c0 1.1 4.475 2 10 2s10-.9 10-2V6c0-1.105-4.477-2-10-2"/></svg>',yaml:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#ff5252" d="M13 9h5.5L13 3.5zM6 2h8l6 6v12c0 1.1-.9 2-2 2H6c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2m12 16v-2H9v2zm-4-4v-2H6v2z"/></svg>',markdown:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#42a5f5" d="m14 10-4 3.5L6 10H4v12h4v-6l2 2 2-2v6h4V10zm12 6v-6h-4v6h-4l6 8 6-8z"/></svg>',xml:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#8bc34a" d="M13 9h5.5L13 3.5zM6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4c0-1.11.89-2 2-2m.12 13.5 3.74 3.74 1.42-1.41-2.33-2.33 2.33-2.33-1.42-1.41zm11.16 0-3.74-3.74-1.42 1.41 2.33 2.33-2.33 2.33 1.42 1.41z"/></svg>',rust:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ff7043" d="m30 12-4-2V6h-4l-2-4-4 2-4-2-2 4H6v4l-4 2 2 4-2 4 4 2v4h4l2 4 4-2 4 2 2-4h4v-4l4-2-2-4ZM6 16a9.9 9.9 0 0 1 .842-4H10v8H6.842A9.9 9.9 0 0 1 6 16m10 10a9.98 9.98 0 0 1-7.978-4H16v-2h-2v-2h4c.819.819.297 2.308 1.179 3.37a1.89 1.89 0 0 0 1.46.63h3.34A9.98 9.98 0 0 1 16 26m-2-12v-2h4a1 1 0 0 1 0 2Zm11.158 6H24a2.006 2.006 0 0 1-2-2 2 2 0 0 0-2-2 3 3 0 0 0 3-3q0-.08-.004-.161A3.115 3.115 0 0 0 19.83 10H8.022a9.986 9.986 0 0 1 17.136 10"/></svg>',vue:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#41b883" d="M1.791 3.851 12 21.471 22.209 3.936V3.85H18.24l-6.18 10.616L5.906 3.851z"/><path fill="#35495e" d="m5.907 3.851 6.152 10.617L18.24 3.851h-3.723L12.084 8.03 9.66 3.85z"/></svg>',mermaid:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#42a5f5" d="m14 10-4 3.5L6 10H4v12h4v-6l2 2 2-2v6h4V10zm12 6v-6h-4v6h-4l6 8 6-8z"/></svg>'},fallback:'<svg width="16" height="16" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#ff7043" d="M2 2a1 1 0 0 0-1 1v10c0 .554.446 1 1 1h12c.554 0 1-.446 1-1V3a1 1 0 0 0-1-1zm0 3h12v8H2zm1 2 2 2-2 2 1 1 3-3-3-3zm5 3.5V12h5v-1.5z"/></svg>',loadExtended:()=>Qs(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},Fg=new Map;let H_="material";const Vl=new Map,W_=new Map;let Hg=null;function MF(e){Fg.set(e.id,e)}function AF(e){return xF(this,null,function*(){var t,n,s;if(Vl.has(e.id))return(t=Vl.get(e.id))!=null?t:null;let o=W_.get(e.id);return o||(o=((s=(n=e.loadExtended)==null?void 0:n.call(e))!=null?s:Promise.resolve(null)).then(i=>(Vl.set(e.id,i),Hg?.(),i)).catch(()=>(Vl.set(e.id,null),null)),W_.set(e.id,o)),o})}const EF=ul(0);Hg=()=>{EF.value++},MF(TF);const IF={"":"",javascript:"javascript",js:"javascript",mjs:"javascript",cjs:"javascript",typescript:"typescript",ts:"typescript",jsx:"jsx",tsx:"tsx",golang:"go",py:"python",rb:"ruby",sh:"shell",bash:"shell",zsh:"shell",shellscript:"shell",bat:"shell",batch:"shell",ps1:"powershell",plaintext:"plain",text:"plain",txt:"plain","c++":"cpp","c#":"csharp",cs:"csharp","objective-c":"objectivec","objective-c++":"objectivecpp",yml:"yaml",md:"markdown",rs:"rust",kt:"kotlin"};function Tv(e){var t;const n=(function(s){if(!s)return"";const o=s.trim();if(!o)return"";const[i]=o.split(/\s+/),[r]=i.split(":");return r.toLowerCase()})(e);return(t=IF[n])!=null?t:n}function Hfe(e){const t=Tv(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return t}}function Wfe(e){return(function(s){const o=Fg.get(H_);if(!o)return;const i=o.core[s];if(i)return i;const r=Vl.get(o.id);if(r){const l=r[s];if(l)return l}o.loadExtended&&!Vl.has(o.id)&&AF(o)})(Tv(e))||((n=(t=Fg.get(H_))==null?void 0:t.fallback)!=null?n:"");var t,n}const Ufe={js:"JavaScript",javascript:"JavaScript",ts:"TypeScript",jsx:"JSX",tsx:"TSX",html:"HTML",css:"CSS",scss:"SCSS",json:"JSON",py:"Python",python:"Python",rb:"Ruby",go:"Go",java:"Java",c:"C",cpp:"C++",cs:"C#",csharp:"C#",php:"PHP",sh:"Shell",bash:"Bash",sql:"SQL",yaml:"YAML",md:"Markdown",d2:"D2",d2lang:"D2","":"Plain Text",plain:"Plain Text"};let NT=!1;function qfe(){return NT}function jfe(){NT=!0}var _h=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});let xo=null,ym=!1,Mv=LT;function wh(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function Av(){try{const e=globalThis;return wh(e?.katex)}catch{return null}}function LT(){return _h(null,null,function*(){const e=Av();if(e)return e;const t=yield Qs(()=>import("./katex-HP8lGamR.js"),[]);try{yield Qs(()=>import("./mhchem-KEf2LMH_.js"),__vite__mapDeps([0,1]))}catch{}return wh(t)})}function OT(){return typeof Mv=="function"}function zfe(){var e;const t=Mv;if(!t||t===LT)return null;if(xo)return xo;const n=Av();if(n)return xo=n,xo;try{const s=t();return s&&typeof s?.then!="function"?(xo=(e=wh(s))!=null?e:s,xo):null}catch{return null}}function Ev(){return _h(this,null,function*(){var e;const t=Av();if(t)return xo=t,xo;if(xo)return xo;if(ym)return null;const n=Mv;if(!n)return ym=!0,null;try{const s=yield n();if(s)return xo=(e=wh(s))!=null?e:s,xo}catch{}return ym=!0,null})}function PT(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let Ll=null;const RT=new Map,ac=new Map;let DT=5;const Qr=new Set;function $F(){if(RT.size<DT&&Qr.size){const e=Array.from(Qr);Qr.clear();for(const t of e)try{t()}catch{}}}function NF(e,t=!0,n=2e3,s){return _h(this,null,function*(){performance.now();const o=PT(e);if(!OT()){const l=new Error("KaTeX rendering disabled");return l.name="KaTeXDisabled",l.code="KATEX_DISABLED",Promise.reject(l)}if(Ll)return Promise.reject(Ll);const i=`${t?"d":"i"}:${o}`,r=ac.get(i);return r?Promise.resolve(r):(Ll=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),Ll.name="WorkerInitError",Ll.code="WORKER_INIT_ERROR",Promise.reject(Ll))})}function Vfe(e,t=!0,n){const s=`${t?"d":"i"}:${PT(e)}`;if(ac.set(s,n),ac.size>200){const o=ac.keys().next().value;ac.delete(o)}}const LF="WORKER_BUSY";function OF(e=2e3,t){return RT.size<DT?Promise.resolve():new Promise((n,s)=>{let o,i=!1;const r=()=>{i||(i=!0,o&&globalThis.clearTimeout(o),Qr.delete(r),n())};if(Qr.add(r),o=globalThis.setTimeout(()=>{if(i)return;i=!0,Qr.delete(r);const l=new Error("Wait for worker slot timed out");l.name="WorkerBusyTimeout",l.code="WORKER_BUSY_TIMEOUT",s(l)},e),queueMicrotask(()=>$F()),t){const l=()=>{if(i)return;i=!0,o&&globalThis.clearTimeout(o),Qr.delete(r);const a=new Error("Aborted");a.name="AbortError",s(a)};t.aborted?l():t.addEventListener("abort",l,{once:!0})}})}const ec={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function Kfe(e){return _h(this,arguments,function*(t,n=!0,s={}){var o,i,r,l;if(!OT()){const g=new Error("KaTeX rendering disabled");throw g.name="KaTeXDisabled",g.code="KATEX_DISABLED",g}const a=(o=s.timeout)!=null?o:ec.timeout,c=(i=s.waitTimeout)!=null?i:ec.waitTimeout,u=(r=s.backoffMs)!=null?r:ec.backoffMs,d=(l=s.maxRetries)!=null?l:ec.maxRetries,h=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):ec.maxRetries,p=s.signal;let f=0;for(;;){if(p?.aborted){const g=new Error("Aborted");throw g.name="AbortError",g}try{return yield NF(t,n,a,p)}catch(g){if(g?.code!==LF||f>=h)throw g;if(f++,yield OF(c,p).catch(()=>{}),p?.aborted){const w=new Error("Aborted");throw w.name="AbortError",w}u>0&&(yield new Promise(w=>globalThis.setTimeout(w,u*f)))}}})}function Kl(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function PF(e){var t;for(const n of e.split(/\r?\n/)){const s=n.trim();if(!s||s.startsWith("%%"))continue;const o=s.match(/^([A-Z][\w-]*)\b/i);return((t=o?.[1])==null?void 0:t.toLowerCase())||""}return""}function Wg(e){const t=e.split(/\r?\n/).map(o=>o.trim()).filter(o=>o&&!o.startsWith("%%")),n=Math.max(1,t.length),s=PF(e);return s==="gantt"?220+28*n:s==="sequencediagram"?180+26*n:s==="classdiagram"||s==="statediagram"||s==="erdiagram"?180+24*n:s==="flowchart"||s==="graph"?170+28*n:200+22*n}function Ug(e){const t=e.split(/\r?\n/).filter(n=>/^\s*-\s+/.test(n)).length;return t>=3?500:t>0?280+60*t:360}function BT(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function qg(e,t=360,n=500){return BT(e,t,n)}function jg(e,t=360,n=500){return BT(e,t,n)}var RF=Object.defineProperty,DF=Object.defineProperties,BF=Object.getOwnPropertyDescriptors,U_=Object.getOwnPropertySymbols,FF=Object.prototype.hasOwnProperty,HF=Object.prototype.propertyIsEnumerable,q_=(e,t,n)=>t in e?RF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,tt=(e,t)=>{for(var n in t||(t={}))FF.call(t,n)&&q_(e,n,t[n]);if(U_)for(var n of U_(t))HF.call(t,n)&&q_(e,n,t[n]);return e},Ct=(e,t)=>DF(e,BF(t)),yn=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const WF="__global__",km="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",zg=(()=>{const e=globalThis;if(e[km])return e[km];const t={scopedCustomComponents:{},revision:ul(0)};return e[km]=t,t})(),j_=zg.revision,UF=Symbol("markstreamCustomComponents"),qF=new Set(["text","paragraph","heading","code_block","list","list_item","blockquote","table","table_row","table_cell","definition_list","definition_item","footnote","footnote_reference","footnote_anchor","admonition","hardbreak","link","image","thematic_break","math_inline","math_block","strong","emphasis","strikethrough","highlight","insert","subscript","superscript","emoji","checkbox","checkbox_input","inline_code","html_inline","html_block","reference","mermaid","infographic","d2","vmr_container"]);function uu(e){return qF.has(String(e).trim().toLowerCase())}function jF(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function bm(e={}){const t={};for(const[n,s]of Object.entries(e))if(s!=null){t[n]=s;for(const o of new Set([No(n),No(jF(n))]))!o||uu(o)||Object.prototype.hasOwnProperty.call(t,o)||(t[o]=s)}return t}function Fn(e){const t=Pt(UF,null);return H(()=>{var n;return j_.value,(function(s,o={}){return j_.value,tt(tt(tt({},bm(zg.scopedCustomComponents[WF]||{})),bm(o)),bm((function(i){return i&&zg.scopedCustomComponents[i]||{}})(s)))})(e?.(),(n=t?.value)!=null?n:{})})}const zF=["aria-label"],VF={key:0,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"checkbox-icon checkbox-unchecked"},KF={key:1,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"checkbox-icon checkbox-checked"},Jt=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},no=Jt(Je({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(x(),E("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(x(),E("svg",KF,[...n[1]||(n[1]=[m("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),m("path",{d:"M9 12l2 2 4-4",stroke:"hsl(var(--ms-background))","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(x(),E("svg",VF,[...n[0]||(n[0]=[m("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,zF))}),[["__scopeId","data-v-be21ab83"]]);no.install=e=>{e.component(no.__name,no)};const GF={class:"emoji-node"},Bs=Jt(Je({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(x(),E("span",GF,L(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);Bs.install=e=>{e.component(Bs.__name,Bs)};const YF=["id"],XF=["title"],so=Jt(Je({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const t=`#fnref--${e.node.id}`;function n(){if(typeof document>"u")return;const s=document.querySelector(t);s?s.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${t} not found`)}return(s,o)=>(x(),E("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[m("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+L(e.node.id)+"]",9,XF)],8,YF))}}),[["__scopeId","data-v-c1463a29"]]);so.install=e=>{e.component(so.__name,so)};const FT=(()=>{try{return!1}catch{}return!1})();function _m(e){FT&&console.warn(e)}function z_(e,t="safe",n){return Cv(e,t,n)}function HT(e){return U9(e)}function wm(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function Iv(e,t="safe"){const n=String(e.tag||e.type||"").trim(),s=Dg((o=e.attrs)?Array.isArray(o)?o.every(Array.isArray)?o.map(([r,l])=>[String(r),wm(l)]):o.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),wm(r.value)]):Object.entries(o).map(([r,l])=>[r,wm(l)]):null,t,n);var o;if(!s)return;const i=HT(Tf(s));return Object.keys(i).length>0?i:void 0}function V_(e,t,n=!1){const s=Object.entries(t??{}),o=s.length>0?s.map(([i,r])=>r===""?` ${i}`:` ${i}="${r}"`).join(""):"";return n?`<${e}${o} />`:`<${e}${o}>`}function tc(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function Sm(e,t,n,s,o,i,r=!1){const l=(function(d,h){return wT(d,h)})(e,s);if(lu.has(e.toLowerCase())||!l&&kT(e,i))return null;if(!l&&Sv(e,i))return r?[V_(e,t,!0)]:[V_(e,t),...n,`</${e}>`];const a=Cv(t,i,e),c=a.key,u=c!=null&&c!==""?c:o;if(l){const d=s[e]||s[e.toLowerCase()],h=HT(a);return Zt(d,Ct(tt({},h),{key:u}),n.length>0?n:void 0)}return Zt(e,Ct(tt({},a),{innerHTML:void 0,key:u}),n.length>0?n:void 0)}function WT(e,t){return V9(e,t)}function Af(e,t,n="safe"){if(!e)return[];try{return(function(i,r,l="safe"){let a=0;const c=[],u=[];for(const d of i)if(d.type==="text")(c.length>0?c[c.length-1].children:u).push(d.content);else if(d.type==="self_closing"){const h=Sm(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);tc(c.length>0?c[c.length-1].children:u,h)}else if(d.type==="tag_open")c.push({tagName:d.tagName,children:[],attrs:d.attrs,autoKey:"ms-html-"+a++});else if(d.type==="tag_close"){const h=d.tagName.toLowerCase();let p=-1;for(let f=c.length-1;f>=0;f--)if(c[f].tagName.toLowerCase()===h){p=f;break}if(p!==-1)for(;c.length>p;){const f=c.pop(),g=Sm(f.tagName,f.attrs||{},f.children,r,f.autoKey,l);c.length>0?tc(c[c.length-1].children,g):tc(u,g),f.tagName.toLowerCase()!==h&&c.length>p&&_m(`Auto-closing unclosed tag: <${f.tagName}>`)}else _m(`Ignoring closing tag with no matching opening tag: </${d.tagName}>`)}for(;c.length>0;){const d=c.pop(),h=Sm(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);c.length>0?tc(c[c.length-1].children,h):tc(u,h),_m(`Auto-closing unclosed tag: <${d.tagName}>`)}return u})(q9(e),t,n)}catch(o){return s=o,FT&&console.error("Failed to parse HTML to VNodes:",s),null}var s}const ZF=["innerHTML"],oo=Jt(Je({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Pt("markstreamHtmlPolicy",void 0),s=H(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),o=Fn(()=>t.customId),i=Je({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=H(()=>{const l=t.node.content;if(!l)return{mode:"html",content:""};if(s.value==="escape")return{mode:"html",content:aa(l,s.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const c=Af(l,o.value,s.value);if(c!==null)return{mode:"dynamic",nodes:c}}if(!WT(l,o.value))return{mode:"html",content:aa(l,s.value)};const a=Af(l,o.value,s.value);return a===null?{mode:"html",content:aa(l,s.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(x(),E("span",{key:0,class:Ie(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[bt(C(i),{nodes:r.value.nodes},null,8,["nodes"])],2)):r.value.mode==="text"?(x(),E("span",{key:1,class:Ie(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},L(r.value.content),3)):(x(),E("span",{key:2,class:Ie(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,ZF))}}),[["__scopeId","data-v-d17f12b0"]]);oo.install=e=>{e.component(oo.__name,oo)};const JF={class:"inline-code"},QF={key:0},ys=Jt(Je({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=nu(),s=Pt("markstreamFade",void 0),o=Pt("markstreamTextStreamState",void 0),i=Pt("markstreamStreamVersion",void 0),r=H(()=>{const y=n.fade;return y===""||y===!0||y==="true"||y!==!1&&y!=="false"&&void 0}),l=H(()=>typeof r.value=="boolean"?r.value:typeof s?.value!="boolean"||s.value),a=H(()=>{var y;return String((y=t.node.code)!=null?y:"")}),c=H(()=>!l.value),u=H(()=>{var y;const k=(y=n["index-key"])!=null?y:n.indexKey;return k==null||k===""?"":String(k)}),d=se(t.node.code),h=se("");let p=i?.value;const f=se(0);function g(){return d.value+h.value}function w(){h.value&&(d.value=g(),h.value="")}Ge([()=>t.node.code,u,l,()=>i?.value],([y,k,v,_])=>{const I=String(y??""),A=u.value,b=_!==p;p=_;const M=TT({nextContent:I,persistedContent:A?o?.get(A):void 0,currentState:{settledContent:d.value,streamedDelta:h.value},typewriterEnabled:l.value,streamRenderVersionChanged:b});d.value=M.settledContent,h.value=M.streamedDelta,M.appended&&(f.value+=1),A&&o?.set(A,I)},{immediate:!0}),Ge(l,y=>{var k;y||(k=g(),d.value=k,h.value="")});const S=H(()=>f.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(y,k)=>(x(),E("code",JF,[c.value?(x(),E(Ne,{key:0},[yt(L(a.value),1)],64)):(x(),E(Ne,{key:1},[d.value?(x(),E("span",QF,L(d.value),1)):le("",!0),h.value?(x(),E("span",{key:1,class:Ie(["inline-code-stream-delta",[S.value]]),onAnimationend:w},L(h.value),35)):le("",!0)],64))]))}}),[["__scopeId","data-v-1b73ee4e"]]);ys.install=e=>{e.component(ys.__name,ys)};const Vg=se(!1),K_=se(""),G_=se("top"),Cc=se(null),xc=se(null),Kg=se(null),Gg=se(null),Y_=se(null);let Md=null,Ad=null,Yg=0;function UT(){Md&&(clearTimeout(Md),Md=null),Ad&&(clearTimeout(Ad),Ad=null)}let ad=!1,cd=null,X_=!1;function eH(e,t,n="top",s=!1,o,i){if(!e)return;const r=++Yg;UT();const l=()=>yn(null,null,function*(){var a,c;if(yield(function(){return yn(this,null,function*(){if(!ad&&!X_&&typeof document<"u"){cd!=null||(cd=yn(null,null,function*(){const[{createApp:u,h:d},{default:h}]=yield Promise.all([Qs(()=>import("./vue.runtime.esm-bundler-Cqjpm82Q.js"),[]),Qs(()=>import("./Tooltip-DnT9F5O4.js"),[])]),p=document.createElement("div");p.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(p),u({setup:()=>()=>{var f;return d(h,{visible:Vg.value,"anchor-el":Cc.value,content:K_.value,placement:G_.value,id:xc.value,originX:Kg.value,originY:Gg.value,isDark:(f=Y_.value)!=null?f:void 0})}}).mount(p),ad=!0}));try{yield cd}catch(u){ad=!1,cd=null,X_=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",u)}}})})(),ad&&r===Yg){xc.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,Cc.value=e,K_.value=t,G_.value=n,Kg.value=(a=o?.x)!=null?a:null,Gg.value=(c=o?.y)!=null?c:null,Y_.value=typeof i=="boolean"?i:null,Vg.value=!0;try{e.setAttribute("aria-describedby",xc.value)}catch{}}});s?l():Md=setTimeout(l,80)}function tH(e=!1){Yg+=1,UT();const t=()=>{if(Cc.value&&xc.value)try{Cc.value.removeAttribute("aria-describedby")}catch{}Vg.value=!1,Cc.value=null,xc.value=null,Kg.value=null,Gg.value=null};e?t():Ad=setTimeout(t,120)}const Xg={"common.copy":"Copy","common.copied":"Copied","common.decrease":"Decrease","common.reset":"Reset","common.increase":"Increase","common.expand":"Expand","common.collapse":"Collapse","common.preview":"Preview","common.source":"Source","common.export":"Export","common.open":"Open","common.minimize":"Minimize","common.zoomIn":"Zoom in","common.zoomOut":"Zoom out","common.resetZoom":"Reset zoom","image.loadError":"Image failed to load","image.loading":"Loading image..."},Zg=e=>{var t;return(t=Xg[e])!=null?t:(function(n){return(n.split(".").pop()||n).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,s=>s.toUpperCase()).trim()})(e)};function Z_(e){return{t(t){if(e.te&&Xg[t]&&!e.te(t))return Zg(t);const n=e.t(t);return n===t&&Xg[t]?Zg(t):n}}}function nH(){const e=(function(){var t,n;try{const s=cs(),o=s?.proxy,i=o?.$t;if(typeof i=="function"){const a=o?.$te;return{t:i.bind(o),te:typeof a=="function"?a.bind(o):void 0}}const r=(n=(t=s?.appContext)==null?void 0:t.config)==null?void 0:n.globalProperties,l=r?.$t;if(typeof l=="function"){const a=r?.$te;return{t:l.bind(r),te:typeof a=="function"?a.bind(r):void 0}}}catch{}return null})();if(e)return Z_(e);try{const t=globalThis.$vueI18nUse||null;if(t&&typeof t=="function")try{const n=t();if(n&&typeof n.t=="function")return Z_({t:n.t.bind(n),te:typeof n.te=="function"?n.te.bind(n):void 0})}catch{}}catch{}return{t:Zg}}function sH(e,t){var n,s;const o=(s=(n=e.indexKey)!=null?n:t["index-key"])!=null?s:t.indexKey;return o==null||o===""?"":String(o)}const oH=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],iH={key:1,class:"image-placeholder"},rH={key:1,class:"image-node__raw-text"},lH={key:0,class:"image-shimmer-overlay"},aH={key:1,class:"image-node__raw-text"},cH={key:2,class:"image-error"},mr=Jt(Je({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},lazy:{type:Boolean,default:!1},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){const n=e,s=t,o=se(!1),i=se(!1),r=se(""),l=se("primary"),a=se(null),c=nu(),u=Pt(Bg,null);let d="",h=null;const p=H(()=>Rb(n.node.src)),f=H(()=>Rb(n.fallbackSrc)),g=H(()=>r.value),w=H(()=>!n.lazy),S=H(()=>!n.node.loading&&l.value!=="failed"&&r.value.length>0),y=H(()=>l.value==="failed"),k=H(()=>!w.value&&!o.value&&!i.value&&l.value!=="failed"&&r.value.length>0),v=H(()=>sH(n,c));function _(P=v.value){P&&a.value&&u?.reportHeight(P,a.value.offsetHeight)}function I(P=v.value){P&&vt(()=>{_(P)})}function A(){h&&(clearTimeout(h),h=null)}function b(){const P=v.value;P&&d!==P&&(d&&u?.markSettled(d),A(),d=P,u?.markPending(P),typeof window<"u"&&(h=window.setTimeout(()=>{d===P&&(I(P),M())},8e3)))}function M(){return yn(this,null,function*(){const P=d;P&&(A(),d="",yield vt(),_(P),u?.markSettled(P))})}function N(){if(l.value==="primary"&&f.value&&f.value!==r.value)return l.value="fallback",r.value=f.value,o.value=!1,i.value=!1,void I();l.value="failed",i.value=!0,s("error",r.value),I()}function D(){o.value=!0,i.value=!1,s("load",g.value),I()}function $(P){P.preventDefault(),o.value&&!i.value&&s("click",[P,g.value])}const{t:O}=nH();return Ge([p,f,()=>n.node.loading],()=>(o.value=!1,i.value=!1,n.node.loading||p.value?(r.value=p.value,void(l.value="primary")):f.value?(r.value=f.value,void(l.value="fallback")):(r.value="",l.value="failed",void(i.value=!0))),{immediate:!0}),Ge([S,o,i,g,()=>n.lazy],([P,R,F,V,K])=>P&&V&&!F?R?(M(),void I()):K?(b(),void I()):void(R||F||b()):(M(),void I()),{flush:"post",immediate:!0}),qs(()=>{(function(){const P=d;P&&(A(),d="",u?.markSettled(P))})()}),(P,R)=>{var F,V,K,Z,G;return x(),E("span",{ref_key:"rootRef",ref:a,class:"image-node-container"},[S.value?(x(),E("img",{key:0,src:g.value,alt:String((V=(F=n.node.alt)!=null?F:n.node.title)!=null?V:""),title:String((Z=(K=n.node.title)!=null?K:n.node.alt)!=null?Z:""),class:Ie(["image-node__img",{"is-loading":!w.value&&!o.value,"is-loaded":w.value||o.value,"has-natural-size":o.value,"cursor-pointer":o.value}]),loading:n.lazy?"lazy":void 0,fetchpriority:w.value?"high":void 0,decoding:w.value?"sync":"async",tabindex:o.value?0:-1,"aria-label":(G=n.node.alt)!=null?G:C(O)("image.preview"),onError:N,onLoad:D,onClick:$},null,42,oH)):le("",!0),e.node.loading&&!i.value?(x(),E("span",iH,[n.usePlaceholder?Ql(P.$slots,"placeholder",{key:0,node:n.node,displaySrc:g.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[R[0]||(R[0]=m("span",{class:"image-shimmer"},null,-1))],!0):(x(),E("span",rH,L(e.node.raw),1))])):le("",!0),bt(Pi,{name:"shimmer-fade"},{default:Mn(()=>[k.value&&!e.node.loading?(x(),E("span",lH,[n.usePlaceholder?Ql(P.$slots,"placeholder",{key:0,node:n.node,displaySrc:g.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[R[1]||(R[1]=m("span",{class:"image-shimmer"},null,-1))],!0):(x(),E("span",aH,L(e.node.raw),1))])):le("",!0)]),_:3}),y.value?(x(),E("span",cH,[Ql(P.$slots,"error",{node:n.node,displaySrc:g.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[R[2]||(R[2]=m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[m("path",{fill:"currentColor",d:"M2 2h20v10h-2V4H4v9.586l5-5L14.414 14L13 15.414l-4-4l-5 5V20h8v2H2zm13.547 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-3 1a3 3 0 1 1 6 0a3 3 0 0 1-6 0m3.625 6.757L19 17.586l2.828-2.829l1.415 1.415L20.414 19l2.829 2.828l-1.415 1.415L19 20.414l-2.828 2.829l-1.415-1.415L17.586 19l-2.829-2.828z"})],-1)),m("span",null,L(C(O)("image.loadError")),1)],!0)])):le("",!0)],512)}}}),[["__scopeId","data-v-cbb5c63e"]]);mr.install=e=>{e.component(mr.__name,mr)};const uH={key:2},li=Je({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=Fn(()=>t.customId),s=Pt("markstreamHtmlPolicy",void 0),o=Pt("markstreamNestedRendererProps",void 0),i=H(()=>{var f;return(f=s?.value)!=null?f:"safe"}),r=H(()=>{var f,g;const w=(f=o?.value)!=null?f:{};return Ct(tt({},w),{customId:(g=t.customId)!=null?g:w.customId,htmlPolicy:i.value})}),l=oi({loader:()=>Promise.resolve().then(()=>Dv),suspensible:!1}),a=H(()=>t.components[String(t.node.type)]),c=H(()=>!!(a.value&&n.value[t.node.type]&&!uu(String(t.node.type)))),u=H(()=>c.value?Iv(t.node,i.value):void 0),d=H(()=>Array.isArray(t.node.children)&&t.node.children.length>0),h=H(()=>{var f;return String((f=t.node.content)!=null?f:"")}),p=H(()=>{var f,g;return String((g=(f=t.node.content)!=null?f:t.node.raw)!=null?g:"")});return(f,g)=>a.value&&c.value?(x(),Ke(gs(a.value),Qt({key:0},u.value,{node:e.node,loading:e.node.loading,"index-key":e.indexKey,"custom-id":e.customId,"is-dark":r.value.isDark}),{default:Mn(()=>[d.value?(x(),Ke(C(l),Qt({key:0},r.value,{nodes:e.node.children,"index-key":e.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):h.value?(x(),Ke(C(l),Qt({key:1},r.value,{content:h.value,final:!e.node.loading,"index-key":`${e.indexKey||"child"}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):le("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(x(),Ke(gs(a.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey},null,8,["node","custom-id","index-key"])):e.fallbackToText?(x(),E("span",uH,L(p.value),1)):le("",!0)}}),dH=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],fH={key:0,translate:"no",class:"markstream-pre__diff-code"},hH={class:"markstream-pre__diff-number","aria-hidden":"true"},pH={class:"markstream-pre__diff-content"},mH={class:"markstream-pre__diff-content-inner"},gH={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},vH=["textContent"],Xs=Je({__name:"PreCodeNode",props:{node:{},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},reservedHeightPx:{}},setup(e){const t=e,n=H(()=>{var $,O,P;const R=String((O=($=t.node)==null?void 0:$.language)!=null?O:"");return String((P=String(R).split(/\s+/g)[0])!=null?P:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),s=H(()=>`language-${n.value}`),o=H(()=>{var $,O,P,R,F;return(($=t.node)==null?void 0:$.diff)===!0?String((P=(O=t.node)==null?void 0:O.code)!=null?P:""):(function(V,K){const Z=String(V??"");return K?Z:Z.replace(/\r\n$|\n$|\r$/,"")})((R=t.node)==null?void 0:R.code,((F=t.node)==null?void 0:F.loading)===!0)}),i=H(()=>o.value.split(/\r\n|\n|\r/)),r=H(()=>Array.from({length:Math.max(1,i.value.length)},($,O)=>O+1)),l=H(()=>{var $;return t.showLineNumbers===!0&&(($=t.node)==null?void 0:$.diff)===!0}),a=H(()=>l.value&&t.diffInline===!0),c=H(()=>{const $=Number(t.reservedHeightPx);if(!Number.isFinite($)||$<=0)return;const O=`${Math.ceil($)}px`;return{height:O,minHeight:O,maxHeight:O,overflow:"auto"}});function u($){return String($??"").trim().length===0}function d($,O="context",P={}){const R=u($);return{code:$,kind:R&&O!=="hunk"&&!P.preserveBlankKind?"context":O,empty:R}}function h($){const O=String($??"");return O?O.split(/\r\n|\n|\r/):[]}function p($,O){return!u($[O])||O<$.length-1}function f($){return $.startsWith("-")&&!$.startsWith("---")}function g($){return $.startsWith("+")&&!$.startsWith("+++")}function w($,O){const P=h($),R=h(O),F=(function(pe,oe){const ye=pe.length,_e=oe.length;if((ye+1)*(_e+1)>15e5)return null;const de=_e+1,be=new Uint32Array((ye+1)*(_e+1));for(let ke=1;ke<=ye;ke++)for(let ge=1;ge<=_e;ge++){const W=ke*de+ge;if(pe[ke-1]===oe[ge-1])be[W]=be[(ke-1)*de+(ge-1)]+1;else{const J=be[(ke-1)*de+ge],ue=be[ke*de+(ge-1)];be[W]=J>=ue?J:ue}}const xe=[];let Le=ye,ee=_e;for(;Le>0&&ee>0;)pe[Le-1]===oe[ee-1]?(xe.push({originalIndex:Le-1,modifiedIndex:ee-1}),Le--,ee--):be[(Le-1)*de+ee]>=be[Le*de+(ee-1)]?Le--:ee--;return xe.reverse(),xe})(P,R);if(F){const pe=[];let oe=0,ye=0;for(const _e of F){for(;oe<_e.originalIndex;)pe.push(Ct(tt({},d(P[oe],"removed",{preserveBlankKind:p(P,oe)})),{key:`inline-removed-source-${oe}`,number:""})),oe++;for(;ye<_e.modifiedIndex;)pe.push(Ct(tt({},d(R[ye],"added",{preserveBlankKind:p(R,ye)})),{key:`inline-added-source-${ye}`,number:ye+1})),ye++;pe.push(Ct(tt({},d(R[_e.modifiedIndex])),{key:`inline-context-source-${_e.originalIndex}-${_e.modifiedIndex}`,number:_e.modifiedIndex+1})),oe=_e.originalIndex+1,ye=_e.modifiedIndex+1}for(;oe<P.length;)pe.push(Ct(tt({},d(P[oe],"removed",{preserveBlankKind:p(P,oe)})),{key:`inline-removed-source-${oe}`,number:""})),oe++;for(;ye<R.length;)pe.push(Ct(tt({},d(R[ye],"added",{preserveBlankKind:p(R,ye)})),{key:`inline-added-source-${ye}`,number:ye+1})),ye++;return pe}const V=[];let K=0,Z=P.length-1,G=R.length-1;for(;K<=Z&&K<=G&&P[K]===R[K];)V.push(Ct(tt({},d(R[K])),{key:`inline-prefix-${K}`,number:K+1})),K++;const X=[];for(;Z>=K&&G>=K&&P[Z]===R[G];)X.unshift(Ct(tt({},d(R[G])),{key:`inline-suffix-${G}`,number:G+1})),Z--,G--;for(let pe=K;pe<=Z;pe++)V.push(Ct(tt({},d(P[pe],"removed",{preserveBlankKind:p(P,pe)})),{key:`inline-removed-source-${pe}`,number:""}));for(let pe=K;pe<=G;pe++)V.push(Ct(tt({},d(R[pe],"added",{preserveBlankKind:p(R,pe)})),{key:`inline-added-source-${pe}`,number:pe+1}));return V.concat(X)}const S=H(()=>{var $,O,P,R;const F=(function(G){const X=G.some(oe=>f(oe)),pe=G.some(oe=>g(oe));return X&&pe||(function(){var oe,ye,_e,de;if(n.value==="diff")return!0;const be=(de=(_e=String((ye=(oe=t.node)==null?void 0:oe.raw)!=null?ye:"").split(/\r?\n/,1)[0])==null?void 0:_e.trim())!=null?de:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(be)})()&&(X||pe)})(i.value),V=(function(){var G,X;return((G=t.node)==null?void 0:G.originalCode)!=null||((X=t.node)==null?void 0:X.updatedCode)!=null})();if(a.value)return[{key:"inline",className:"markstream-pre__diff-pane--inline",lines:F?(function(G){const X=[];let pe=1;for(const[oe,ye]of G.entries())if(ye.startsWith("@@"))X.push(Ct(tt({},d(ye,"hunk")),{key:`inline-hunk-${oe}`,number:""}));else if(f(ye))X.push(Ct(tt({},d(ye.slice(1),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${oe}`,number:""}));else if(g(ye))X.push(Ct(tt({},d(ye.slice(1),"added",{preserveBlankKind:!0})),{key:`inline-added-${oe}`,number:pe++}));else{const _e=ye.startsWith(" ")?ye.slice(1):ye;X.push(Ct(tt({},d(_e)),{key:`inline-context-${oe}`,number:pe})),pe++}return X})(i.value):w(($=t.node)==null?void 0:$.originalCode,(O=t.node)==null?void 0:O.updatedCode)}];if(!F&&V){const G=h((P=t.node)==null?void 0:P.originalCode),X=h((R=t.node)==null?void 0:R.updatedCode);return[{key:"original",className:"markstream-pre__diff-pane--original",lines:G.map((pe,oe)=>{const ye=X[oe]===pe?"context":"removed";return Ct(tt({},d(pe,ye,{preserveBlankKind:p(G,oe)})),{key:`original-${oe}`,number:oe+1})})},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:X.map((pe,oe)=>{const ye=G[oe]===pe?"context":"added";return Ct(tt({},d(pe,ye,{preserveBlankKind:p(X,oe)})),{key:`modified-${oe}`,number:oe+1})})}]}const K=[],Z=[];for(const G of i.value)if(G.startsWith("@@"))K.push(d(G,"hunk")),Z.push(d(G,"hunk"));else if(G.startsWith("-")&&!G.startsWith("---"))K.push(d(G.slice(1),"removed",{preserveBlankKind:!0}));else if(G.startsWith("+")&&!G.startsWith("+++"))Z.push(d(G.slice(1),"added",{preserveBlankKind:!0}));else{const X=G.startsWith(" ")?G.slice(1):G;K.push(d(X)),Z.push(d(X))}return[{key:"original",className:"markstream-pre__diff-pane--original",lines:K.map((G,X)=>Ct(tt({},G),{key:`original-${X}`,number:X+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:Z.map((G,X)=>Ct(tt({},G),{key:`modified-${X}`,number:X+1}))}]}),y=H(()=>{const $=n.value;return $?`Code block: ${$}`:"Code block"}),k=se(null),v=se([]);let _=null,I=null;function A($){const O=Number.parseFloat(String($??""));return Number.isFinite(O)&&O>0?O:0}function b($,O){var P;if(!$)return O;const R=$.querySelector(".markstream-pre__diff-content"),F=R?.getBoundingClientRect(),V=(P=F?.height)!=null?P:0;return Math.max(O,Math.ceil(V))}function M(){typeof window<"u"&&(_!=null&&window.cancelAnimationFrame(_),_=window.requestAnimationFrame(()=>{(function(){var $,O;_=null;const P=k.value;if(!P||!l.value)return void(v.value.length&&(v.value=[]));const R=(function(pe){const oe=window.getComputedStyle(pe),ye=A(oe.getPropertyValue("--markstream-pre-diff-line-height"));if(ye>0)return ye;const _e=A(oe.lineHeight);return _e>0?_e:18})(P),F=Array.from(P.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),V=Array.from(P.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),K=Math.max(F.length,V.length),Z=[];for(let pe=0;pe<K;pe++){const oe=b(($=F[pe])!=null?$:null,R),ye=b((O=V[pe])!=null?O:null,R),_e=Math.max(R,oe,ye);Z.push({rowHeight:_e,originalHeight:oe,modifiedHeight:ye})}var G,X;G=v.value,X=Z,G.length===X.length&&G.every((pe,oe)=>{const ye=X[oe];return ye&&Math.abs(pe.rowHeight-ye.rowHeight)<=.5&&Math.abs(pe.originalHeight-ye.originalHeight)<=.5&&Math.abs(pe.modifiedHeight-ye.modifiedHeight)<=.5})||(v.value=Z)})()}))}function N($){I?.disconnect(),I=null,$&&l.value&&typeof ResizeObserver<"u"&&(I=new ResizeObserver(()=>{M()}),I.observe($))}function D($,O){const P=v.value[$];if(!P)return;const R=O==="original"?P.originalHeight:P.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(P.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(R)}px`}}return Ge(k,$=>{N($),vt(()=>M())},{flush:"post"}),Ge([l,S],()=>{N(k.value),vt(()=>M())},{flush:"post",immediate:!0}),qs(()=>{_!=null&&(window.cancelAnimationFrame(_),_=null),I?.disconnect(),I=null}),($,O)=>(x(),E("pre",{ref_key:"preRef",ref:k,style:Ft(c.value),class:Ie([s.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":l.value,"markstream-pre--diff-inline":a.value}]),"aria-busy":e.node.loading===!0,"aria-label":y.value,"data-language":n.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[l.value?(x(),E("code",fH,[(x(!0),E(Ne,null,Qe(S.value,P=>(x(),E("span",{key:P.key,class:Ie(["markstream-pre__diff-pane",P.className])},[(x(!0),E(Ne,null,Qe(P.lines,(R,F)=>(x(),E("span",{key:R.key,class:Ie(["markstream-pre__diff-line",[`markstream-pre__diff-line--${R.kind}`,{"markstream-pre__diff-line--empty":R.empty}]]),style:Ft(D(F,P.key))},[O[0]||(O[0]=m("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),m("span",hH,L(R.number),1),m("span",pH,[m("span",mH,L(R.code),1)])],6))),128))],2))),128))])):(x(),E(Ne,{key:1},[t.showLineNumbers?(x(),E("span",gH,[(x(!0),E(Ne,null,Qe(r.value,P=>(x(),E("span",{key:P,class:"markstream-pre__line-number"},L(P),1))),128))])):le("",!0),m("code",{translate:"no",class:"markstream-pre__code",textContent:L(o.value)},null,8,vH)],64))],14,dH))}});Xs.install=e=>{e.component(Xs.__name,Xs)};const Cm=ul(!1);let J_=null;const yH={key:0},En=Jt(Je({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=(J_||(J_=Ev().then(S=>{Cm.value=!!S}).catch(()=>{Cm.value=!1})),Hd(Cm)),s=nu(),o=Pt("markstreamFade",void 0),i=Pt("markstreamTextStreamState",void 0),r=Pt("markstreamStreamVersion",void 0),l=H(()=>{const S=s.fade;return S===""||S===!0||S==="true"||S!==!1&&S!=="false"&&void 0}),a=H(()=>typeof l.value=="boolean"?l.value:typeof o?.value!="boolean"||o.value),c=H(()=>{var S;const y=(S=s["index-key"])!=null?S:s.indexKey;return y==null||y===""?"":String(y)}),u=se(t.node.content),d=se("");let h=r?.value;const p=se(0);function f(){return u.value+d.value}function g(){d.value&&(u.value=f(),d.value="")}Ge([()=>t.node.content,c,a,()=>r?.value],([S,y,k,v])=>{const _=String(S??""),I=c.value,A=v!==h;h=v;const b=TT({nextContent:_,persistedContent:I?i?.get(I):void 0,currentState:{settledContent:u.value,streamedDelta:d.value},typewriterEnabled:a.value,streamRenderVersionChanged:A});u.value=b.settledContent,d.value=b.streamedDelta,b.appended&&(p.value+=1),I&&i?.set(I,_)},{immediate:!0}),Ge(a,S=>{var y;S||(y=f(),u.value=y,d.value="")});const w=H(()=>p.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(S,y)=>(x(),E("span",{class:Ie([[C(n)&&e.node.center?"text-node-center":""],"text-node"])},[u.value?(x(),E("span",yH,L(u.value),1)):le("",!0),d.value?(x(),E("span",{key:1,class:Ie(["text-node-stream-delta",[w.value]]),onAnimationend:g},L(d.value),35)):le("",!0)],2))}}),[["__scopeId","data-v-aae85f13"]]);En.install=e=>{e.component(En.__name,En)};const qT=Je({name:"CodeBlockNodeLoading",inheritAttrs:!1,setup(e,{attrs:t}){const n=t;return()=>{var s;return Zt(Xs,Ct(tt({},t),{node:n.node,showLineNumbers:!0,reservedHeightPx:(s=n.estimatedHeightPx)!=null?s:n.estimatedContentHeightPx,class:["code-pre-fallback",t.class],"data-markstream-code-loading":"1"}))}}}),xm=oi({loader:()=>yn(null,null,function*(){try{return(yield Qs(()=>import("./CodeBlockNode-DWqdMrZf.js"),__vite__mapDeps([2,3,4]))).default}catch(e){return console.warn('[markstream-vue] Optional peer dependencies for CodeBlockNode are missing. Falling back to preformatted code rendering (no Monaco). To enable full code block features, please install "stream-monaco".',e),Xs}}),loadingComponent:qT,delay:0,suspensible:!1}),jo=oi(()=>yn(null,null,function*(){var e;if(((e=(function(){const t=Reflect.get(globalThis,"process");return t?.env})())==null?void 0:e.NODE_ENV)==="test"&&typeof window<"u")return t=>{var n,s,o,i;return Zt(En,Ct(tt({},t),{node:{type:"text",content:(s=t.node.raw)!=null?s:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(o=t.node.content)!=null?o:""}$`}}))};try{if(yield Ev())return(yield Qs(()=>import("./index6-kJ6dO27T.js"),[])).default}catch(t){console.warn('[markstream-vue] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',t)}return t=>{var n,s,o,i;return Zt(En,Ct(tt({},t),{node:{type:"text",content:(s=t.node.raw)!=null?s:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(o=t.node.content)!=null?o:""}$`}}))}})),jT=oi(()=>yn(null,null,function*(){try{if(yield Ev())return(yield Qs(()=>import("./index5-C_80WRqf.js"),[])).default}catch(e){console.warn('[markstream-vue] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',e)}return e=>{var t,n,s,o;return Zt(En,Ct(tt({},e),{node:{type:"text",content:(n=e.node.raw)!=null?n:`$$${(t=e.node.content)!=null?t:""}$$`,raw:(o=e.node.raw)!=null?o:`$$${(s=e.node.content)!=null?s:""}$$`}}))}})),Ts=Jt(Je({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(x(),E("span",{class:"reference-node cursor-pointer text-xs rounded-md px-1.5 mx-0.5",role:"button",tabindex:"0",onClick:n[0]||(n[0]=s=>t.$emit("click",s,e.node.id,e.messageId,e.threadId)),onMouseenter:n[1]||(n[1]=s=>t.$emit("mouseEnter",s,e.node.id,e.messageId,e.threadId)),onMouseleave:n[2]||(n[2]=s=>t.$emit("mouseLeave",s,e.node.id,e.messageId,e.threadId))},L(e.node.id),33))}),[["__scopeId","data-v-775c65e4"]]);Ts.install=e=>{e.component(Ts.__name,Ts)};const kH={class:"superscript-node"},Fs=Jt(Je({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Fn(()=>t.customId),s=H(()=>tt({text:En,inline_code:ys,link:Es,html_inline:oo,strong:Ms,emphasis:Is,footnote_reference:so,strikethrough:As,highlight:io,insert:Ws,subscript:Hs,emoji:Bs,math_inline:jo,reference:Ts},n.value));return(o,i)=>(x(),E("sup",kH,[(x(!0),E(Ne,null,Qe(e.node.children,(r,l)=>(x(),Ke(C(li),{key:`${e.indexKey||"superscript"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"superscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-24160b22"]]);Fs.install=e=>{e.component(Fs.__name,Fs)};const bH={class:"subscript-node"},Hs=Jt(Je({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Fn(()=>t.customId),s=H(()=>tt({text:En,inline_code:ys,link:Es,html_inline:oo,strong:Ms,emphasis:Is,footnote_reference:so,strikethrough:As,highlight:io,insert:Ws,superscript:Fs,emoji:Bs,math_inline:jo,reference:Ts},n.value));return(o,i)=>(x(),E("sub",bH,[(x(!0),E(Ne,null,Qe(e.node.children,(r,l)=>(x(),Ke(C(li),{key:`${e.indexKey||"subscript"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"subscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-197fa13b"]]);Hs.install=e=>{e.component(Hs.__name,Hs)};const _H={class:"strong-node"},Ms=Jt(Je({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Fn(()=>t.customId),s=H(()=>tt({text:En,inline_code:ys,link:Es,html_inline:oo,emphasis:Is,strikethrough:As,highlight:io,insert:Ws,subscript:Hs,superscript:Fs,emoji:Bs,footnote_reference:so,math_inline:jo,reference:Ts},n.value));return(o,i)=>(x(),E("strong",_H,[(x(!0),E(Ne,null,Qe(e.node.children,(r,l)=>(x(),Ke(C(li),{key:`${e.indexKey||"strong"}-${l}`,components:s.value,node:r,"index-key":`${e.indexKey||"strong"}-${l}`,"custom-id":t.customId},null,8,["components","node","index-key","custom-id"]))),128))]))}}),[["__scopeId","data-v-a8647104"]]);Ms.install=e=>{e.component(Ms.__name,Ms)};const wH={class:"strikethrough-node"},As=Jt(Je({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Fn(()=>t.customId),s=H(()=>tt({text:En,inline_code:ys,link:Es,html_inline:oo,strong:Ms,emphasis:Is,highlight:io,insert:Ws,subscript:Hs,superscript:Fs,emoji:Bs,footnote_reference:so,math_inline:jo,reference:Ts},n.value));return(o,i)=>(x(),E("del",wH,[(x(!0),E(Ne,null,Qe(e.node.children,(r,l)=>(x(),Ke(C(li),{key:`${e.indexKey||"strikethrough"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"strikethrough"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-b7a531fa"]]);As.install=e=>{e.component(As.__name,As)};const SH=["href","title","aria-label","aria-hidden","target","rel"],CH=["aria-hidden"],xH={class:"link-text-wrapper relative inline-flex"},TH={class:"leading-[normal] link-text"},Es=Jt(Je({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=Pt("markstreamShowTooltips",void 0),s=H(()=>{const S=n?.value;return typeof S=="boolean"?S:t.showTooltip}),o=H(()=>{var S,y,k,v,_;const I=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",A=(S=t.animationOpacity)!=null?S:.35,b=Math.max(.12,Math.min(.5*A,A)),M={"--underline-height":`${(y=t.underlineHeight)!=null?y:2}px`,"--underline-bottom":I,"--underline-opacity":String(A),"--underline-rest-opacity":String(b),"--underline-duration":`${(k=t.animationDuration)!=null?k:1.6}s`,"--underline-timing":(v=t.animationTiming)!=null?v:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(_=t.animationIteration)!=null?_:"infinite"};return t.color&&(M["--link-color"]=t.color),M}),i=Fn(()=>t.customId),r=H(()=>tt({text:En,strong:Ms,strikethrough:As,emphasis:Is,image:mr,html_inline:oo,inline_code:ys},i.value)),l=nu(),a=H(()=>{var S,y;const k=(S=t.node)==null?void 0:S.attrs;if(!k||typeof k!="object")return{};const v={};if(Array.isArray(k))for(const _ of k)Array.isArray(_)&&_[0]&&(v[String(_[0])]=String((y=_[1])!=null?y:""));else for(const[_,I]of Object.entries(k))_&&I!=null&&I!==!1&&(v[_]=I===!0?"":String(I));return z_(v,"safe","a")}),c=H(()=>tt(tt({},l),a.value)),u=H(()=>{var S,y;return z_({href:String((y=(S=t.node)==null?void 0:S.href)!=null?y:"")},"safe","a").href}),d=H(()=>{if(!u.value)return;const S=c.value.target;return(typeof S=="string"?S.trim():String(S??"").trim())||(NR(u.value)?"_blank":void 0)}),h=H(()=>{var S;return String((S=d.value)!=null?S:"").trim().toLowerCase()==="_blank"}),p=H(()=>{if(!u.value)return;const S=c.value.rel,y=new Set((typeof S=="string"?S:String(S??"")).split(/\s+/).filter(Boolean)),k=new Set(Array.from(y).filter(v=>v.toLowerCase()!=="opener"));return h.value&&(k.add("noopener"),k.add("noreferrer")),k.size>0?Array.from(k).join(" "):void 0}),f=H(()=>{const S=tt({},c.value);return delete S.title,delete S.href,delete S.target,delete S.rel,S});function g(){s.value&&tH()}const w=H(()=>{var S,y;const k=(S=t.node)==null?void 0:S.title;return typeof k=="string"&&k.trim().length>0?k:String((y=u.value)!=null?y:"")});return(S,y)=>{var k,v;return e.node.loading?(x(),E("span",Qt({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},C(l),{style:o.value}),[m("span",xH,[m("span",TH,[bt(C(En),{class:"leading-[normal] link-text",node:{type:"text",content:String((k=e.node.text)!=null?k:""),raw:String((v=e.node.text)!=null?v:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),y[1]||(y[1]=m("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,CH)):(x(),E("a",Qt({key:0,class:"link-node",href:u.value,title:s.value?"":w.value,"aria-label":`Link: ${w.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:p.value},f.value,{style:o.value,onMouseenter:y[0]||(y[0]=_=>(function(I){var A,b,M,N;if(!s.value)return;const D=I,$=D?.clientX!=null&&D?.clientY!=null?{x:D.clientX,y:D.clientY}:void 0,O=((A=t.node)==null?void 0:A.title)||((b=u.value)!=null&&b.includes("xn--")&&((N=(M=t.node)==null?void 0:M.text)!=null&&N.includes("://"))?t.node.text:u.value)||"";eH(I.currentTarget,O,"top",!1,$)})(_)),onMouseleave:g}),[(x(!0),E(Ne,null,Qe(e.node.children,(_,I)=>(x(),Ke(C(li),{key:`${e.indexKey||"emphasis"}-${I}`,components:r.value,node:_,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${I}`},null,8,["components","node","custom-id","index-key"]))),128))],16,SH))}}}),[["__scopeId","data-v-367e6ca4"]]);Es.install=e=>{e.component(Es.__name,Es)};const MH={class:"insert-node"},Ws=Jt(Je({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Fn(()=>t.customId),s=H(()=>tt({text:En,inline_code:ys,link:Es,html_inline:oo,strong:Ms,emphasis:Is,strikethrough:As,highlight:io,subscript:Hs,superscript:Fs,emoji:Bs,footnote_reference:so,math_inline:jo,reference:Ts},n.value));return(o,i)=>(x(),E("ins",MH,[(x(!0),E(Ne,null,Qe(e.node.children,(r,l)=>(x(),Ke(C(li),{key:`${e.indexKey||"insert"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"insert"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-1e2c29d4"]]);Ws.install=e=>{e.component(Ws.__name,Ws)};const AH={class:"highlight-node"},io=Jt(Je({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Fn(()=>t.customId),s=H(()=>tt({text:En,inline_code:ys,link:Es,html_inline:oo,strong:Ms,emphasis:Is,strikethrough:As,insert:Ws,subscript:Hs,superscript:Fs,emoji:Bs,footnote_reference:so,math_inline:jo,reference:Ts},n.value));return(o,i)=>(x(),E("mark",AH,[(x(!0),E(Ne,null,Qe(e.node.children,(r,l)=>(x(),Ke(C(li),{key:`${e.indexKey||"highlight"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"highlight"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-7a62982a"]]);io.install=e=>{e.component(io.__name,io)};const EH={class:"emphasis-node"},Is=Jt(Je({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Fn(()=>t.customId),s=H(()=>tt({text:En,inline_code:ys,link:Es,html_inline:oo,strong:Ms,strikethrough:As,highlight:io,insert:Ws,subscript:Hs,superscript:Fs,emoji:Bs,footnote_reference:so,math_inline:jo,reference:Ts},n.value));return(o,i)=>(x(),E("em",EH,[(x(!0),E(Ne,null,Qe(e.node.children,(r,l)=>(x(),Ke(C(li),{key:`${e.indexKey||"emphasis"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"emphasis"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-2a5aafbf"]]);Is.install=e=>{e.component(Is.__name,Is)};const IH={class:"hard-break"},gr=Jt(Je({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(x(),E("br",IH))}),[["__scopeId","data-v-50c58f70"]]);gr.install=e=>{e.component(gr.__name,gr)};const Xc=Je({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=cr({checkbox:no,checkbox_input:no,emoji:Bs,emphasis:Is,hardbreak:gr,highlight:io,inline_code:ys,insert:Ws,link:Es,reference:Ts,strikethrough:As,strong:Ms,subscript:Hs,superscript:Fs,text:En}),s=Fn(()=>t.customId),o=H(()=>{const i=s.value;return Object.keys(i).length>0?tt(tt({},n),i):n});return(i,r)=>(x(!0),E(Ne,null,Qe(e.nodes,(l,a)=>(x(),Ke(C(li),{key:a,components:o.value,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"inline"}-${a}`},null,8,["components","node","custom-id","index-key"]))),128))}});function Jg(e){if(!e||typeof e!="object")return!1;const t=`|${e.type}|`;if(!"|checkbox|checkbox_input|emoji|emphasis|hardbreak|highlight|inline_code|insert|link|reference|strikethrough|strong|subscript|superscript|text|".includes(t))return!1;if(!"|emphasis|highlight|insert|link|strikethrough|strong|subscript|superscript|".includes(t))return!0;const n=e.children;return Array.isArray(n)&&n.every(Jg)}function Ef(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(Jg))return e;if(!t||e.length!==1)return null;const s=e[0];if(s?.type!=="paragraph"||!Array.isArray(s.children))return null;const o=s.children;return(n||o.length>0)&&o.every(Jg)?o:null}function va(e){var t,n;if(!e?.length)return null;let s="";for(const o of e){if(o?.type!=="text"||o.center===!0)return null;s+=String((n=(t=o.content)!=null?t:o.raw)!=null?n:"")}return s}const $H=["cite"],NH={key:0,dir:"auto",class:"paragraph-node"},LH=["custom-id"],Ed=Jt(Je({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=Fn(()=>t.customId),s=H(()=>!!n.value.paragraph),o=H(()=>!!n.value.text),i=H(()=>Ef(t.node.children,!s.value)),r=H(()=>t.fade!==!1||o.value?null:va(i.value));return gn("markstreamShowTooltips",H(()=>t.showTooltips)),gn("markstreamFade",H(()=>t.fade)),(l,a)=>(x(),E("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[i.value?(x(),E("p",NH,[r.value!==null?(x(),E("span",{key:0,class:"text-node","custom-id":t.customId},L(r.value),9,LH)):(x(),Ke(C(Xc),{key:1,nodes:i.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(x(),Ke(C(Us),{key:1,"show-tooltips":t.showTooltips,"index-key":`blockquote-${t.indexKey}`,nodes:t.node.children||[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:a[0]||(a[0]=c=>l.$emit("copy",c))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade"]))],8,$H))}}),[["__scopeId","data-v-abfecebc"]]);Ed.install=e=>{e.component(Ed.__name,Ed)};const OH={class:"definition-list"},PH={class:"definition-term"},RH={class:"definition-desc"},Id=Jt(Je({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,s)=>(x(),E("dl",OH,[(x(!0),E(Ne,null,Qe(t.node.items,(o,i)=>(x(),E(Ne,{key:i},[m("dt",PH,[bt(C(Us),{"index-key":`definition-term-${t.indexKey}-${i}`,nodes:o.term,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:s[0]||(s[0]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])]),m("dd",RH,[bt(C(Us),{"index-key":`definition-desc-${t.indexKey}-${i}`,nodes:o.definition,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:s[1]||(s[1]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],64))),128))]))}}),[["__scopeId","data-v-4e103b30"]]);Id.install=e=>{e.component(Id.__name,Id)};const DH=["href","title"],Tc=Jt(Je({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const t=e;function n(s){var o;if(s.preventDefault(),typeof document>"u")return;const i=`fnref-${String((o=t.node.id)!=null?o:"")}`,r=document.getElementById(i);r&&r.scrollIntoView({behavior:"smooth",block:"center"})}return(s,o)=>(x(),E("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,DH))}}),[["__scopeId","data-v-e1eb37b6"]]);Tc.install=e=>{e.component(Tc.__name,Tc)};const BH=["id"],FH={class:"flex-1"},$d=Je({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,s)=>(x(),E("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[m("div",FH,[bt(C(Us),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:s[0]||(s[0]=o=>n.$emit("copy",o))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],8,BH))}});$d.install=e=>{e.component($d.__name,$d)};const HH=["custom-id"],Qg=Jt(Je({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Fn(()=>t.customId),s=Pt("markstreamFade",void 0),o=H(()=>s?.value!==!1||n.value.text?null:va(t.node.children)),i=H(()=>tt({text:En,inline_code:ys,link:Es,image:mr,strong:Ms,emphasis:Is,strikethrough:As,highlight:io,insert:Ws,subscript:Hs,superscript:Fs,emoji:Bs,checkbox:no,checkbox_input:no,footnote_reference:so,hardbreak:gr,math_inline:jo,reference:Ts},n.value));return(r,l)=>(x(),Ke(gs(`h${e.node.level}`),Qt({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:Mn(()=>[o.value!==null?(x(),E("span",{key:0,class:"text-node","custom-id":t.customId},L(o.value),9,HH)):(x(!0),E(Ne,{key:1},Qe(e.node.children,(a,c)=>(x(),Ke(C(li),{key:c,components:i.value,"custom-id":t.customId,node:a,"index-key":`${e.indexKey||"heading"}-${c}`},null,8,["components","custom-id","node","index-key"]))),128))]),_:1},16,["class"]))}}),[["__scopeId","data-v-7122dbe1"]]),If=Qg;If.install=e=>{e.component(Qg.__name,Qg)};const WH={key:0,dir:"auto",class:"paragraph-node"},UH=["custom-id"],qH={dir:"auto",class:"paragraph-node"},jH=["custom-id"],ca=Jt(Je({__name:"ListItemNode",props:{node:{},item:{},indexKey:{},customId:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},value:{},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=H(()=>{var p;return(p=t.node)!=null?p:t.item}),s=Fn(()=>t.customId),o=H(()=>!!s.value.paragraph),i=H(()=>!!s.value.text),r=H(()=>{var p;return Ef((p=n.value)==null?void 0:p.children,!o.value)}),l=H(()=>{var p;if(o.value)return null;const f=(p=n.value)==null?void 0:p.children;if(!Array.isArray(f)||f.length<2)return null;const g=f[0];if(g?.type!=="paragraph"||!Array.isArray(g.children))return null;const w=f.slice(1);if(!w.every(y=>y?.type==="list"))return null;const S=Ef([g]);return S?{paragraphChildren:S,nestedLists:w}:null});function a(){return t.fade===!1&&!i.value}const c=H(()=>a()?va(r.value):null),u=H(()=>{var p;return a()?va((p=l.value)==null?void 0:p.paragraphChildren):null}),d=Object.freeze({}),h=H(()=>{const{value:p}=t;return typeof p=="number"&&Number.isFinite(p)?{value:p}:d});return gn("markstreamShowTooltips",H(()=>t.showTooltips)),gn("markstreamFade",H(()=>t.fade)),(p,f)=>{var g,w;return x(),E("li",Qt({class:"list-item",dir:"auto"},h.value),[r.value?(x(),E("p",WH,[c.value!==null?(x(),E("span",{key:0,class:"text-node","custom-id":t.customId},L(c.value),9,UH)):(x(),Ke(C(Xc),{key:1,nodes:r.value,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):l.value?(x(),E(Ne,{key:1},[m("p",qH,[u.value!==null?(x(),E("span",{key:0,class:"text-node","custom-id":t.customId},L(u.value),9,jH)):(x(),Ke(C(Xc),{key:1,nodes:l.value.paragraphChildren,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))]),(x(!0),E(Ne,null,Qe(l.value.nestedLists,(S,y)=>(x(),Ke(C(Us),{key:y,nodes:[S],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${y}`,"show-tooltips":t.showTooltips,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0,onCopy:f[0]||(f[0]=k=>p.$emit("copy",k))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade","is-dark"]))),128))],64)):(x(),Ke(C(Us),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(w=(g=n.value)==null?void 0:g.children)!=null?w:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,onCopy:f[1]||(f[1]=S=>p.$emit("copy",S))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade","is-dark"]))],16)}}}),[["__scopeId","data-v-617214f9"]]);ca.install=e=>{e.component(ca.__name,ca)};const ua=Jt(Je({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=Fn(()=>e.customId),n=H(()=>t.value.list_item||ca);return(s,o)=>(x(),Ke(gs(e.node.ordered?"ol":"ul"),{class:Ie(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:Mn(()=>[(x(!0),E(Ne,null,Qe(e.node.items,(i,r)=>{var l;return x(),Ke(gs(n.value),Qt({key:`${e.indexKey||"list"}-${r}`},{ref_for:!0},{showTooltips:e.showTooltips},{node:i,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${r}`,typewriter:e.typewriter,fade:e.fade,"is-dark":e.isDark,value:e.node.ordered?((l=e.node.start)!=null?l:1)+r:void 0,onCopy:o[0]||(o[0]=a=>s.$emit("copy",a))}),null,16,["node","custom-id","index-key","typewriter","fade","is-dark","value"])}),128))]),_:1},8,["class"]))}}),[["__scopeId","data-v-99cb95e0"]]);ua.install=e=>{e.component(ua.__name,ua)};const zT=Symbol("ViewportPriority");function zH(e,t){var n,s;const o=typeof window<"u"&&typeof document<"u",i=typeof t=="boolean"?se(t):t,r=o?(n=window.requestIdleCallback)!=null?n:S=>window.setTimeout(()=>S({didTimeout:!0,timeRemaining:()=>0}),16):null,l=o?(s=window.cancelIdleCallback)!=null?s:S=>window.clearTimeout(S):null;let a=null,c=null;const u=new Map,d=new Set;let h=null;function p(){if(!u.size){try{a?.disconnect()}catch{}a=null,c=null,d.size||(function(){if(h!=null){try{l?.(h)}catch{}h=null}})()}}function f(S){const y=u.get(S);if(y){if(!y.visible.value){y.visible.value=!0;try{y.resolve()}catch{}}try{a?.unobserve(S)}catch{}u.delete(S),d.delete(S),p()}}function g(){r&&h==null&&d.size&&(h=r(()=>{h=null;const S=d.values().next().value;S&&(d.delete(S),f(S),d.size&&g())},{timeout:1200}))}const w=(S,y)=>{const k=se(!1);let v,_=!1;const I=new Promise(M=>{v=()=>{_||(_=!0,M())}}),A=()=>{try{a?.unobserve(S)}catch{}u.delete(S),d.delete(S),p()};if(!o||!i.value)return k.value=!0,v(),{isVisible:k,whenVisible:I,destroy:A};const b=(function(M,N){if(!o)return a;if(typeof IntersectionObserver>"u")return null;const D=(function(P,R){var F,V,K;return{root:(F=e?.(P??null))!=null?F:null,rootMargin:(V=R?.rootMargin)!=null?V:"300px",threshold:(K=R?.threshold)!=null?K:0}})(M,N);if(a&&(O=D,($=c)&&$.root===O.root&&$.rootMargin===O.rootMargin&&$.threshold===O.threshold))return a;var $,O;if(a)try{a.disconnect()}catch{}a=new IntersectionObserver(P=>{for(const R of P)(R.isIntersecting||R.intersectionRatio>0)&&f(R.target)},{root:D.root,rootMargin:D.rootMargin,threshold:D.threshold}),c=D;for(const P of u.keys())a.observe(P);return a})(S,y);return b?(u.set(S,{resolve:v,visible:k}),b.observe(S),d.add(S),g(),{isVisible:k,whenVisible:I,destroy:A}):(k.value=!0,v(),{isVisible:k,whenVisible:I,destroy:A})};return gn(zT,w),w}function VH(){var e,t;const n=Pt(zT,void 0);if(n)return n;const s=new WeakMap;let o=null;const i=new Set;let r=null;const l=typeof window<"u"?(e=window.requestIdleCallback)!=null?e:h=>window.setTimeout(()=>h({didTimeout:!0,timeRemaining:()=>0}),16):null,a=typeof window<"u"?(t=window.cancelIdleCallback)!=null?t:h=>window.clearTimeout(h):null,c=()=>{if(r!=null){try{a?.(r)}catch{}r=null}},u=h=>{const p=s.get(h);if(p){if(!p.visible.value){p.visible.value=!0;try{p.resolve()}catch{}}try{o?.unobserve(h)}catch{}s.delete(h),i.delete(h),i.size||c()}},d=()=>{l&&r==null&&i.size&&(r=l(()=>{r=null;const h=i.values().next().value;h&&(i.delete(h),u(h),i.size&&d())},{timeout:1200}))};return h=>{const p=se(!1);let f,g=!1;const w=new Promise(k=>{f=()=>{g||(g=!0,k())}}),S=()=>{try{o?.unobserve(h)}catch{}s.delete(h),i.delete(h),i.size||c()},y=o||(typeof window>"u"||typeof IntersectionObserver>"u"?null:(o=new IntersectionObserver(k=>{for(const v of k)(v.isIntersecting||v.intersectionRatio>0)&&u(v.target)},{root:null,rootMargin:"300px",threshold:0}),o));return y?(s.set(h,{resolve:f,visible:p}),y.observe(h),i.add(h),d(),{isVisible:p,whenVisible:w,destroy:S}):(p.value=!0,f(),{isVisible:p,whenVisible:w,destroy:S})}}const KH={key:2,class:"html-block-node__raw"},GH=["innerHTML"],YH={key:1,class:"html-block-node__placeholder"},Mc=Jt(Je({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Pt("markstreamHtmlPolicy",void 0),s=Pt("markstreamNestedRendererProps",void 0),o=H(()=>{var I,A;return(A=(I=t.htmlPolicy)!=null?I:n?.value)!=null?A:"safe"}),i=H(()=>{var I,A;const b=(I=s?.value)!=null?I:{};return Ct(tt({},b),{customId:(A=t.customId)!=null?A:b.customId,htmlPolicy:o.value})}),r=oi({loader:()=>Promise.resolve().then(()=>Dv),suspensible:!1}),l=H(()=>{const I=Dg(t.node.attrs,o.value);if(!I)return;const A=Tf(I);return Object.keys(A).length>0?A:void 0}),a=H(()=>{const I=String(t.node.tag||"").trim(),A=Dg(t.node.attrs,o.value,I);if(!A)return;const b=Tf(A);return Object.keys(b).length>0?b:void 0}),c=Fn(()=>t.customId),u=Je({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=se(null),h=se(typeof window>"u"),p=se(t.node.content),f=H(()=>Array.isArray(t.node.children)?t.node.children:[]),g=H(()=>String(t.node.tag||"div")),w=H(()=>{const I=g.value.trim().toLowerCase();return Ex.has(I)||Sv(I,o.value)}),S=H(()=>f.value.length>0&&!!t.node.tag&&!w.value),y=H(()=>{var I,A,b;if(S.value)return{mode:"structured"};if(!h.value)return{mode:"html",content:(I=p.value)!=null?I:""};const M=(A=p.value)!=null?A:t.node.content;if(!M)return{mode:"html",content:""};if(o.value==="escape")return{mode:"html",content:aa(M,o.value)};if(t.node.loading){const D=Af(M,c.value,o.value);return D===null?{mode:"text",content:(b=t.node.raw)!=null?b:M}:{mode:"dynamic",nodes:D}}if(!WT(M,c.value))return{mode:"html",content:aa(M,o.value)};const N=Af(M,c.value,o.value);return N===null?{mode:"html",content:aa(M,o.value)}:{mode:"dynamic",nodes:N}}),k=VH(),v=se(null),_=!!t.node.loading;return typeof window<"u"?(Ge(d,I=>{var A,b;if((b=(A=v.value)==null?void 0:A.destroy)==null||b.call(A),v.value=null,!_)return h.value=!0,void(p.value=t.node.content);if(!I)return void(h.value=!1);const M=k(I,{rootMargin:"400px"});v.value=M,h.value=M.isVisible.value,M.whenVisible.then(()=>{h.value=!0})},{immediate:!0}),Ge(()=>t.node.content,I=>{_&&!h.value||(p.value=I)})):h.value=!0,qs(()=>{var I,A;(A=(I=v.value)==null?void 0:I.destroy)==null||A.call(I),v.value=null}),(I,A)=>(x(),Ke(gs(S.value?g.value:"div"),Qt({ref_key:"htmlRef",ref:d,class:"html-block-node"},S.value?a.value:void 0),{default:Mn(()=>[h.value?(x(),E(Ne,{key:0},[y.value.mode==="structured"?(x(),Ke(C(r),Qt({key:0},i.value,{nodes:f.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):y.value.mode==="dynamic"?(x(),Ke(C(u),{key:1,nodes:y.value.nodes},null,8,["nodes"])):y.value.mode==="text"?(x(),E("pre",KH,L(y.value.content),1)):(x(),E("div",Qt({key:3},l.value,{innerHTML:y.value.content}),null,16,GH))],64)):(x(),E("div",YH,[Ql(I.$slots,"placeholder",{node:e.node},()=>[A[0]||(A[0]=m("span",{class:"html-block-node__placeholder-bar"},null,-1)),A[1]||(A[1]=m("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),A[2]||(A[2]=m("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16))}}),[["__scopeId","data-v-f1744dfb"]]);Mc.install=e=>{e.component(Mc.__name,Mc)};const XH={dir:"auto",class:"paragraph-node"},ZH=["custom-id"],il=Jt(Je({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=Fn(()=>t.customId),s=Pt("markstreamHtmlPolicy",void 0),o=Pt("markstreamFade",void 0),i=Pt("markstreamParseOptions",void 0),r=Pt("markstreamCustomMarkdownIt",void 0),l=Pt("markstreamNestedRendererProps",void 0),a=H(()=>{var b;return(b=s?.value)!=null?b:"safe"}),c=H(()=>{var b;return(b=t.parseOptions)!=null?b:i?.value}),u=H(()=>{var b;return(b=t.customMarkdownIt)!=null?b:r?.value}),d=H(()=>{var b,M;return(M=t.customHtmlTags)!=null?M:(b=l?.value)==null?void 0:b.customHtmlTags}),h=H(()=>{var b,M;const N=(b=l?.value)!=null?b:{};return Ct(tt({},N),{customId:(M=t.customId)!=null?M:N.customId,customHtmlTags:d.value,parseOptions:c.value,customMarkdownIt:u.value,htmlPolicy:a.value})}),p=oi({loader:()=>Promise.resolve().then(()=>Dv),suspensible:!1});function f(b){var M;return b.type==="text"&&String((M=b.content)!=null?M:"").trim()===""}const g=H(()=>t.node.children.filter(b=>!f(b))),w=H(()=>g.value.length>0&&g.value.every(b=>b.type==="image"||(function(M){var N;const D=(function($){return $.type==="link"&&Array.isArray($.children)?$.children.filter(O=>!f(O)):[]})(M);return D.length===1&&((N=D[0])==null?void 0:N.type)==="image"})(b))),S=H(()=>new Set(_a(d.value))),y=H(()=>{if(!w.value||g.value.length<=1)return t.node.children;const b=[];for(let M=0;M<t.node.children.length;M++){const N=t.node.children[M];if(!f(N)){b.push(N);continue}const D=b.length>0,$=t.node.children.slice(M+1).some(O=>!f(O));D&&$&&b.push(Ct(tt({},N),{content:" ",raw:" "}))}return b}),k=H(()=>o?.value===!1&&!n.value.text),v=H(()=>k.value?va(y.value):null);function _(b,M){return{node:b,"index-key":`${t.indexKey}-${M}`,"custom-id":t.customId,"custom-html-tags":d.value}}const I=H(()=>tt({inline_code:ys,image:mr,link:Es,hardbreak:gr,emphasis:Is,strong:Ms,strikethrough:As,highlight:io,insert:Ws,subscript:Hs,superscript:Fs,html_inline:oo,html_block:Mc,emoji:Bs,checkbox:no,math_inline:jo,checkbox_input:no,reference:Ts,footnote_anchor:Tc,footnote_reference:so,text:En},n.value)),A=H(()=>y.value.map((b,M)=>{var N;const D=(function($){var O,P,R,F;if($.type==="html_block"||$.type==="html_inline"){const V=String((O=$.tag)!=null?O:"").trim().toLowerCase()||Lx($.content);if(V&&!S.value.has(V)&&Ox((P=$.content)!=null?P:$.raw,V)){const K=String((F=(R=$.content)!=null?R:$.raw)!=null?F:"");return{child:{type:"text",content:K,raw:K},component:En,isCustomComponent:!1}}}return{child:$,component:I.value[$.type],isCustomComponent:!!(n.value[$.type]&&!uu(String($.type)))}})(b);return Ct(tt({},D),{index:M,key:`${t.indexKey||"paragraph"}-${M}`,customAttrs:D.isCustomComponent?Iv(D.child,a.value):void 0,hasSlotChildren:Array.isArray(D.child.children)&&D.child.children.length>0,slotContent:String((N=D.child.content)!=null?N:""),originalChild:b})}));return(b,M)=>(x(),E("p",XH,[v.value!==null?(x(),E("span",{key:0,class:"text-node","custom-id":t.customId},L(v.value),9,ZH)):(x(!0),E(Ne,{key:1},Qe(A.value,N=>{return x(),E(Ne,{key:N.key},[w.value&&f(N.originalChild)?(x(),E(Ne,{key:0},[yt(L((D=N.originalChild,String(($=D.content)!=null?$:""))),1)],64)):N.isCustomComponent?(x(),Ke(gs(N.component),Qt({key:1,ref_for:!0},N.customAttrs,{node:N.child,loading:N.child.loading,"index-key":N.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":h.value.isDark}),{default:Mn(()=>[N.hasSlotChildren?(x(),Ke(C(p),Qt({key:0,ref_for:!0},h.value,{nodes:N.child.children,"index-key":N.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):N.slotContent?(x(),Ke(C(p),Qt({key:1,ref_for:!0},h.value,{content:N.slotContent,final:!N.child.loading,"index-key":`${N.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):le("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(x(),Ke(gs(N.component),Qt({key:2,ref_for:!0},_(N.child,N.index)),null,16))],64);var D,$}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);il.install=e=>{e.component(il.__name,il)};const JH={class:"table-node-wrapper"},QH=["aria-busy"],eW={key:0},tW=["custom-id"],nW=["aria-label","onPointerdown"],sW=["custom-id"],oW={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},Ac=Jt(Je({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=H(()=>{var S;return(S=t.node.loading)!=null&&S}),s=H(()=>{var S;return(S=t.node.rows)!=null?S:[]}),o=se(null),i=se([]);let r=null;const l=H(()=>t.node.header.cells.length),a=H(()=>i.value.some(S=>Number.isFinite(S)&&S>0)),c=H(()=>a.value?i.value.map(S=>S>0?{width:`${S}px`}:void 0):[]);gn("markstreamShowTooltips",H(()=>t.showTooltips)),gn("markstreamFade",H(()=>t.fade));const u=Fn(()=>t.customId),d=H(()=>!!u.value.text),h=H(()=>!!u.value.paragraph),p=new WeakMap;function f(S){const y=t.fade===!1&&!d.value,k=!h.value,v=p.get(S);if(v?.children===S.children&&v.textFastPath===y&&v.paragraphFastPath===k)return v.info;const _=Ef(S.children,k,!0),I={simpleChildren:_,plainText:_&&y?va(_):null};return p.set(S,{children:S.children,textFastPath:y,paragraphFastPath:k,info:I}),I}function g(S){if(!r)return;S.preventDefault();const y=r.startWidth+r.nextStartWidth,k=Math.min(48,Math.floor(y/2)),v=Math.max(k,Math.min(y-k,Math.round(r.startWidth+S.clientX-r.startX))),_=[...r.widths];_[r.index]=v,_[r.index+1]=y-v,i.value=_}function w(){r&&(window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",w),window.removeEventListener("pointercancel",w),r=null)}return Ge(l,()=>{w(),i.value=[]}),qs(w),(S,y)=>(x(),E("div",JH,[m("table",{ref_key:"tableRef",ref:o,class:Ie(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(x(),E("colgroup",eW,[(x(!0),E(Ne,null,Qe(e.node.header.cells,(k,v)=>(x(),E("col",{key:v,style:Ft(c.value[v])},null,4))),128))])):le("",!0),m("thead",null,[m("tr",null,[(x(!0),E(Ne,null,Qe(e.node.header.cells,(k,v)=>(x(),E("th",{key:v,dir:"auto",class:Ie([k.align==="right"?"text-right":k.align==="center"?"text-center":"text-left"])},[f(k).plainText!==null?(x(),E("span",{key:0,class:"text-node","custom-id":t.customId},L(f(k).plainText),9,tW)):f(k).simpleChildren?(x(),Ke(C(Xc),{key:1,nodes:f(k).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${v}`},null,8,["nodes","custom-id","index-key"])):(x(),Ke(C(Us),{key:2,nodes:k.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:y[0]||(y[0]=_=>S.$emit("copy",_))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),v<e.node.header.cells.length-1?(x(),E("button",{key:3,type:"button",class:"table-node__resize-handle","aria-label":`Resize columns ${v+1} and ${v+2}`,onPointerdown:_=>(function(I,A){if(A.button!==0)return;const b=(function(){var D;const $=(D=o.value)==null?void 0:D.querySelectorAll("thead th");return Array.from($??[],O=>Math.round(O.getBoundingClientRect().width))})(),M=b[I],N=b[I+1];M&&N&&(A.preventDefault(),r={index:I,startX:A.clientX,startWidth:M,nextStartWidth:N,widths:b},i.value=b,window.addEventListener("pointermove",g),window.addEventListener("pointerup",w),window.addEventListener("pointercancel",w))})(v,_)},null,40,nW)):le("",!0)],2))),128))])]),m("tbody",null,[(x(!0),E(Ne,null,Qe(s.value,(k,v)=>(x(),E("tr",{key:v},[(x(!0),E(Ne,null,Qe(k.cells,(_,I)=>(x(),E("td",{key:I,class:Ie([_.align==="right"?"text-right":_.align==="center"?"text-center":"text-left"]),dir:"auto"},[f(_).plainText!==null?(x(),E("span",{key:0,class:"text-node","custom-id":t.customId},L(f(_).plainText),9,sW)):f(_).simpleChildren?(x(),Ke(C(Xc),{key:1,nodes:f(_).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${v}-${I}`},null,8,["nodes","custom-id","index-key"])):(x(),Ke(C(Us),{key:2,nodes:_.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:y[1]||(y[1]=A=>S.$emit("copy",A))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,QH),bt(Pi,{name:"table-node-fade"},{default:Mn(()=>[n.value?(x(),E("div",oW,[Ql(S.$slots,"loading",{isLoading:n.value},()=>[y[2]||(y[2]=m("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),y[3]||(y[3]=m("span",{class:"sr-only"},"Loading",-1))],!0)])):le("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);Ac.install=e=>{e.component(Ac.__name,Ac)};const iW={class:"hr-node"},Nd=Jt({},[["render",function(e,t){return x(),E("hr",iW)}],["__scopeId","data-v-39b2349c"]]);Nd.install=e=>{e.component(Nd.__name,Nd)};const rW={class:"unknown-node"},e1=Je({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(x(),E("div",rW,L(e.node.raw),1))}),Ld=Jt(Je({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){const t=e,n=H(()=>`vmr-container vmr-container-${t.node.name}`),s=Fn(()=>t.customId),o=H(()=>tt({text:En,paragraph:il,heading:If,inline_code:ys,link:Es,image:mr,strong:Ms,emphasis:Is,strikethrough:As,insert:Ws,subscript:Hs,superscript:Fs,checkbox:no,checkbox_input:no,hardbreak:gr,math_inline:jo,reference:Ts,list:ua,math_block:jT,table:Ac},s.value));return(i,r)=>(x(),E("div",Qt({class:n.value},e.node.attrs),[(x(!0),E(Ne,null,Qe(e.node.children,(l,a)=>{return x(),Ke(gs((c=l.type,o.value[c]||e1)),{key:`${e.indexKey||"vmr-container"}-${a}`,"custom-id":t.customId,node:l,"index-key":`${e.indexKey||"vmr-container"}-${a}`,typewriter:t.typewriter,fade:t.fade},null,8,["custom-id","node","index-key","typewriter","fade"]);var c}),128))],16))}}),[["__scopeId","data-v-911e41c4"]]);Ld.install=e=>{e.component(Ld.__name,Ld)};const lW=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],Q_=[[697,698,"ON"],[706,719,"ON"],[722,735,"ON"],[741,749,"ON"],[751,767,"ON"],[768,879,"NSM"],[884,885,"ON"],[894,894,"ON"],[900,901,"ON"],[903,903,"ON"],[1014,1014,"ON"],[1155,1161,"NSM"],[1418,1418,"ON"],[1421,1422,"ON"],[1423,1423,"ET"],[1424,1424,"R"],[1425,1469,"NSM"],[1470,1470,"R"],[1471,1471,"NSM"],[1472,1472,"R"],[1473,1474,"NSM"],[1475,1475,"R"],[1476,1477,"NSM"],[1478,1478,"R"],[1479,1479,"NSM"],[1480,1535,"R"],[1536,1541,"AN"],[1542,1543,"ON"],[1544,1544,"AL"],[1545,1546,"ET"],[1547,1547,"AL"],[1548,1548,"CS"],[1549,1549,"AL"],[1550,1551,"ON"],[1552,1562,"NSM"],[1563,1610,"AL"],[1611,1631,"NSM"],[1632,1641,"AN"],[1642,1642,"ET"],[1643,1644,"AN"],[1645,1647,"AL"],[1648,1648,"NSM"],[1649,1749,"AL"],[1750,1756,"NSM"],[1757,1757,"AN"],[1758,1758,"ON"],[1759,1764,"NSM"],[1765,1766,"AL"],[1767,1768,"NSM"],[1769,1769,"ON"],[1770,1773,"NSM"],[1774,1775,"AL"],[1776,1785,"EN"],[1786,1808,"AL"],[1809,1809,"NSM"],[1810,1839,"AL"],[1840,1866,"NSM"],[1867,1957,"AL"],[1958,1968,"NSM"],[1969,1983,"AL"],[1984,2026,"R"],[2027,2035,"NSM"],[2036,2037,"R"],[2038,2041,"ON"],[2042,2044,"R"],[2045,2045,"NSM"],[2046,2069,"R"],[2070,2073,"NSM"],[2074,2074,"R"],[2075,2083,"NSM"],[2084,2084,"R"],[2085,2087,"NSM"],[2088,2088,"R"],[2089,2093,"NSM"],[2094,2136,"R"],[2137,2139,"NSM"],[2140,2143,"R"],[2144,2191,"AL"],[2192,2193,"AN"],[2194,2198,"AL"],[2199,2207,"NSM"],[2208,2249,"AL"],[2250,2273,"NSM"],[2274,2274,"AN"],[2275,2306,"NSM"],[2362,2362,"NSM"],[2364,2364,"NSM"],[2369,2376,"NSM"],[2381,2381,"NSM"],[2385,2391,"NSM"],[2402,2403,"NSM"],[2433,2433,"NSM"],[2492,2492,"NSM"],[2497,2500,"NSM"],[2509,2509,"NSM"],[2530,2531,"NSM"],[2546,2547,"ET"],[2555,2555,"ET"],[2558,2558,"NSM"],[2561,2562,"NSM"],[2620,2620,"NSM"],[2625,2626,"NSM"],[2631,2632,"NSM"],[2635,2637,"NSM"],[2641,2641,"NSM"],[2672,2673,"NSM"],[2677,2677,"NSM"],[2689,2690,"NSM"],[2748,2748,"NSM"],[2753,2757,"NSM"],[2759,2760,"NSM"],[2765,2765,"NSM"],[2786,2787,"NSM"],[2801,2801,"ET"],[2810,2815,"NSM"],[2817,2817,"NSM"],[2876,2876,"NSM"],[2879,2879,"NSM"],[2881,2884,"NSM"],[2893,2893,"NSM"],[2901,2902,"NSM"],[2914,2915,"NSM"],[2946,2946,"NSM"],[3008,3008,"NSM"],[3021,3021,"NSM"],[3059,3064,"ON"],[3065,3065,"ET"],[3066,3066,"ON"],[3072,3072,"NSM"],[3076,3076,"NSM"],[3132,3132,"NSM"],[3134,3136,"NSM"],[3142,3144,"NSM"],[3146,3149,"NSM"],[3157,3158,"NSM"],[3170,3171,"NSM"],[3192,3198,"ON"],[3201,3201,"NSM"],[3260,3260,"NSM"],[3276,3277,"NSM"],[3298,3299,"NSM"],[3328,3329,"NSM"],[3387,3388,"NSM"],[3393,3396,"NSM"],[3405,3405,"NSM"],[3426,3427,"NSM"],[3457,3457,"NSM"],[3530,3530,"NSM"],[3538,3540,"NSM"],[3542,3542,"NSM"],[3633,3633,"NSM"],[3636,3642,"NSM"],[3647,3647,"ET"],[3655,3662,"NSM"],[3761,3761,"NSM"],[3764,3772,"NSM"],[3784,3790,"NSM"],[3864,3865,"NSM"],[3893,3893,"NSM"],[3895,3895,"NSM"],[3897,3897,"NSM"],[3898,3901,"ON"],[3953,3966,"NSM"],[3968,3972,"NSM"],[3974,3975,"NSM"],[3981,3991,"NSM"],[3993,4028,"NSM"],[4038,4038,"NSM"],[4141,4144,"NSM"],[4146,4151,"NSM"],[4153,4154,"NSM"],[4157,4158,"NSM"],[4184,4185,"NSM"],[4190,4192,"NSM"],[4209,4212,"NSM"],[4226,4226,"NSM"],[4229,4230,"NSM"],[4237,4237,"NSM"],[4253,4253,"NSM"],[4957,4959,"NSM"],[5008,5017,"ON"],[5120,5120,"ON"],[5760,5760,"WS"],[5787,5788,"ON"],[5906,5908,"NSM"],[5938,5939,"NSM"],[5970,5971,"NSM"],[6002,6003,"NSM"],[6068,6069,"NSM"],[6071,6077,"NSM"],[6086,6086,"NSM"],[6089,6099,"NSM"],[6107,6107,"ET"],[6109,6109,"NSM"],[6128,6137,"ON"],[6144,6154,"ON"],[6155,6157,"NSM"],[6158,6158,"BN"],[6159,6159,"NSM"],[6277,6278,"NSM"],[6313,6313,"NSM"],[6432,6434,"NSM"],[6439,6440,"NSM"],[6450,6450,"NSM"],[6457,6459,"NSM"],[6464,6464,"ON"],[6468,6469,"ON"],[6622,6655,"ON"],[6679,6680,"NSM"],[6683,6683,"NSM"],[6742,6742,"NSM"],[6744,6750,"NSM"],[6752,6752,"NSM"],[6754,6754,"NSM"],[6757,6764,"NSM"],[6771,6780,"NSM"],[6783,6783,"NSM"],[6832,6877,"NSM"],[6880,6891,"NSM"],[6912,6915,"NSM"],[6964,6964,"NSM"],[6966,6970,"NSM"],[6972,6972,"NSM"],[6978,6978,"NSM"],[7019,7027,"NSM"],[7040,7041,"NSM"],[7074,7077,"NSM"],[7080,7081,"NSM"],[7083,7085,"NSM"],[7142,7142,"NSM"],[7144,7145,"NSM"],[7149,7149,"NSM"],[7151,7153,"NSM"],[7212,7219,"NSM"],[7222,7223,"NSM"],[7376,7378,"NSM"],[7380,7392,"NSM"],[7394,7400,"NSM"],[7405,7405,"NSM"],[7412,7412,"NSM"],[7416,7417,"NSM"],[7616,7679,"NSM"],[8125,8125,"ON"],[8127,8129,"ON"],[8141,8143,"ON"],[8157,8159,"ON"],[8173,8175,"ON"],[8189,8190,"ON"],[8192,8202,"WS"],[8203,8205,"BN"],[8207,8207,"R"],[8208,8231,"ON"],[8232,8232,"WS"],[8233,8233,"B"],[8234,8238,"BN"],[8239,8239,"CS"],[8240,8244,"ET"],[8245,8259,"ON"],[8260,8260,"CS"],[8261,8286,"ON"],[8287,8287,"WS"],[8288,8303,"BN"],[8304,8304,"EN"],[8308,8313,"EN"],[8314,8315,"ES"],[8316,8318,"ON"],[8320,8329,"EN"],[8330,8331,"ES"],[8332,8334,"ON"],[8352,8399,"ET"],[8400,8432,"NSM"],[8448,8449,"ON"],[8451,8454,"ON"],[8456,8457,"ON"],[8468,8468,"ON"],[8470,8472,"ON"],[8478,8483,"ON"],[8485,8485,"ON"],[8487,8487,"ON"],[8489,8489,"ON"],[8494,8494,"ET"],[8506,8507,"ON"],[8512,8516,"ON"],[8522,8525,"ON"],[8528,8543,"ON"],[8585,8587,"ON"],[8592,8721,"ON"],[8722,8722,"ES"],[8723,8723,"ET"],[8724,9013,"ON"],[9083,9108,"ON"],[9110,9257,"ON"],[9280,9290,"ON"],[9312,9351,"ON"],[9352,9371,"EN"],[9450,9899,"ON"],[9901,10239,"ON"],[10496,11123,"ON"],[11126,11263,"ON"],[11493,11498,"ON"],[11503,11505,"NSM"],[11513,11519,"ON"],[11647,11647,"NSM"],[11744,11775,"NSM"],[11776,11869,"ON"],[11904,11929,"ON"],[11931,12019,"ON"],[12032,12245,"ON"],[12272,12287,"ON"],[12288,12288,"WS"],[12289,12292,"ON"],[12296,12320,"ON"],[12330,12333,"NSM"],[12336,12336,"ON"],[12342,12343,"ON"],[12349,12351,"ON"],[12441,12442,"NSM"],[12443,12444,"ON"],[12448,12448,"ON"],[12539,12539,"ON"],[12736,12773,"ON"],[12783,12783,"ON"],[12829,12830,"ON"],[12880,12895,"ON"],[12924,12926,"ON"],[12977,12991,"ON"],[13004,13007,"ON"],[13175,13178,"ON"],[13278,13279,"ON"],[13311,13311,"ON"],[19904,19967,"ON"],[42128,42182,"ON"],[42509,42511,"ON"],[42607,42610,"NSM"],[42611,42611,"ON"],[42612,42621,"NSM"],[42622,42623,"ON"],[42654,42655,"NSM"],[42736,42737,"NSM"],[42752,42785,"ON"],[42888,42888,"ON"],[43010,43010,"NSM"],[43014,43014,"NSM"],[43019,43019,"NSM"],[43045,43046,"NSM"],[43048,43051,"ON"],[43052,43052,"NSM"],[43064,43065,"ET"],[43124,43127,"ON"],[43204,43205,"NSM"],[43232,43249,"NSM"],[43263,43263,"NSM"],[43302,43309,"NSM"],[43335,43345,"NSM"],[43392,43394,"NSM"],[43443,43443,"NSM"],[43446,43449,"NSM"],[43452,43453,"NSM"],[43493,43493,"NSM"],[43561,43566,"NSM"],[43569,43570,"NSM"],[43573,43574,"NSM"],[43587,43587,"NSM"],[43596,43596,"NSM"],[43644,43644,"NSM"],[43696,43696,"NSM"],[43698,43700,"NSM"],[43703,43704,"NSM"],[43710,43711,"NSM"],[43713,43713,"NSM"],[43756,43757,"NSM"],[43766,43766,"NSM"],[43882,43883,"ON"],[44005,44005,"NSM"],[44008,44008,"NSM"],[44013,44013,"NSM"],[64285,64285,"R"],[64286,64286,"NSM"],[64287,64296,"R"],[64297,64297,"ES"],[64298,64335,"R"],[64336,64450,"AL"],[64451,64466,"ON"],[64467,64829,"AL"],[64830,64847,"ON"],[64848,64911,"AL"],[64912,64913,"ON"],[64914,64967,"AL"],[64968,64975,"ON"],[64976,65007,"BN"],[65008,65020,"AL"],[65021,65023,"ON"],[65024,65039,"NSM"],[65040,65049,"ON"],[65056,65071,"NSM"],[65072,65103,"ON"],[65104,65104,"CS"],[65105,65105,"ON"],[65106,65106,"CS"],[65108,65108,"ON"],[65109,65109,"CS"],[65110,65118,"ON"],[65119,65119,"ET"],[65120,65121,"ON"],[65122,65123,"ES"],[65124,65126,"ON"],[65128,65128,"ON"],[65129,65130,"ET"],[65131,65131,"ON"],[65136,65278,"AL"],[65279,65279,"BN"],[65281,65282,"ON"],[65283,65285,"ET"],[65286,65290,"ON"],[65291,65291,"ES"],[65292,65292,"CS"],[65293,65293,"ES"],[65294,65295,"CS"],[65296,65305,"EN"],[65306,65306,"CS"],[65307,65312,"ON"],[65339,65344,"ON"],[65371,65381,"ON"],[65504,65505,"ET"],[65506,65508,"ON"],[65509,65510,"ET"],[65512,65518,"ON"],[65520,65528,"BN"],[65529,65533,"ON"],[65534,65535,"BN"],[65793,65793,"ON"],[65856,65932,"ON"],[65936,65948,"ON"],[65952,65952,"ON"],[66045,66045,"NSM"],[66272,66272,"NSM"],[66273,66299,"EN"],[66422,66426,"NSM"],[67584,67870,"R"],[67871,67871,"ON"],[67872,68096,"R"],[68097,68099,"NSM"],[68100,68100,"R"],[68101,68102,"NSM"],[68103,68107,"R"],[68108,68111,"NSM"],[68112,68151,"R"],[68152,68154,"NSM"],[68155,68158,"R"],[68159,68159,"NSM"],[68160,68324,"R"],[68325,68326,"NSM"],[68327,68408,"R"],[68409,68415,"ON"],[68416,68863,"R"],[68864,68899,"AL"],[68900,68903,"NSM"],[68904,68911,"AL"],[68912,68921,"AN"],[68922,68927,"AL"],[68928,68937,"AN"],[68938,68968,"R"],[68969,68973,"NSM"],[68974,68974,"ON"],[68975,69215,"R"],[69216,69246,"AN"],[69247,69290,"R"],[69291,69292,"NSM"],[69293,69311,"R"],[69312,69327,"AL"],[69328,69336,"ON"],[69337,69369,"AL"],[69370,69375,"NSM"],[69376,69423,"R"],[69424,69445,"AL"],[69446,69456,"NSM"],[69457,69487,"AL"],[69488,69505,"R"],[69506,69509,"NSM"],[69510,69631,"R"],[69633,69633,"NSM"],[69688,69702,"NSM"],[69714,69733,"ON"],[69744,69744,"NSM"],[69747,69748,"NSM"],[69759,69761,"NSM"],[69811,69814,"NSM"],[69817,69818,"NSM"],[69826,69826,"NSM"],[69888,69890,"NSM"],[69927,69931,"NSM"],[69933,69940,"NSM"],[70003,70003,"NSM"],[70016,70017,"NSM"],[70070,70078,"NSM"],[70089,70092,"NSM"],[70095,70095,"NSM"],[70191,70193,"NSM"],[70196,70196,"NSM"],[70198,70199,"NSM"],[70206,70206,"NSM"],[70209,70209,"NSM"],[70367,70367,"NSM"],[70371,70378,"NSM"],[70400,70401,"NSM"],[70459,70460,"NSM"],[70464,70464,"NSM"],[70502,70508,"NSM"],[70512,70516,"NSM"],[70587,70592,"NSM"],[70606,70606,"NSM"],[70608,70608,"NSM"],[70610,70610,"NSM"],[70625,70626,"NSM"],[70712,70719,"NSM"],[70722,70724,"NSM"],[70726,70726,"NSM"],[70750,70750,"NSM"],[70835,70840,"NSM"],[70842,70842,"NSM"],[70847,70848,"NSM"],[70850,70851,"NSM"],[71090,71093,"NSM"],[71100,71101,"NSM"],[71103,71104,"NSM"],[71132,71133,"NSM"],[71219,71226,"NSM"],[71229,71229,"NSM"],[71231,71232,"NSM"],[71264,71276,"ON"],[71339,71339,"NSM"],[71341,71341,"NSM"],[71344,71349,"NSM"],[71351,71351,"NSM"],[71453,71453,"NSM"],[71455,71455,"NSM"],[71458,71461,"NSM"],[71463,71467,"NSM"],[71727,71735,"NSM"],[71737,71738,"NSM"],[71995,71996,"NSM"],[71998,71998,"NSM"],[72003,72003,"NSM"],[72148,72151,"NSM"],[72154,72155,"NSM"],[72160,72160,"NSM"],[72193,72198,"NSM"],[72201,72202,"NSM"],[72243,72248,"NSM"],[72251,72254,"NSM"],[72263,72263,"NSM"],[72273,72278,"NSM"],[72281,72283,"NSM"],[72330,72342,"NSM"],[72344,72345,"NSM"],[72544,72544,"NSM"],[72546,72548,"NSM"],[72550,72550,"NSM"],[72752,72758,"NSM"],[72760,72765,"NSM"],[72850,72871,"NSM"],[72874,72880,"NSM"],[72882,72883,"NSM"],[72885,72886,"NSM"],[73009,73014,"NSM"],[73018,73018,"NSM"],[73020,73021,"NSM"],[73023,73029,"NSM"],[73031,73031,"NSM"],[73104,73105,"NSM"],[73109,73109,"NSM"],[73111,73111,"NSM"],[73459,73460,"NSM"],[73472,73473,"NSM"],[73526,73530,"NSM"],[73536,73536,"NSM"],[73538,73538,"NSM"],[73562,73562,"NSM"],[73685,73692,"ON"],[73693,73696,"ET"],[73697,73713,"ON"],[78912,78912,"NSM"],[78919,78933,"NSM"],[90398,90409,"NSM"],[90413,90415,"NSM"],[92912,92916,"NSM"],[92976,92982,"NSM"],[94031,94031,"NSM"],[94095,94098,"NSM"],[94178,94178,"ON"],[94180,94180,"NSM"],[113821,113822,"NSM"],[113824,113827,"BN"],[117760,117973,"ON"],[118e3,118009,"EN"],[118010,118012,"ON"],[118016,118451,"ON"],[118458,118480,"ON"],[118496,118512,"ON"],[118528,118573,"NSM"],[118576,118598,"NSM"],[119143,119145,"NSM"],[119155,119162,"BN"],[119163,119170,"NSM"],[119173,119179,"NSM"],[119210,119213,"NSM"],[119273,119274,"ON"],[119296,119361,"ON"],[119362,119364,"NSM"],[119365,119365,"ON"],[119552,119638,"ON"],[120513,120513,"ON"],[120539,120539,"ON"],[120571,120571,"ON"],[120597,120597,"ON"],[120629,120629,"ON"],[120655,120655,"ON"],[120687,120687,"ON"],[120713,120713,"ON"],[120745,120745,"ON"],[120771,120771,"ON"],[120782,120831,"EN"],[121344,121398,"NSM"],[121403,121452,"NSM"],[121461,121461,"NSM"],[121476,121476,"NSM"],[121499,121503,"NSM"],[121505,121519,"NSM"],[122880,122886,"NSM"],[122888,122904,"NSM"],[122907,122913,"NSM"],[122915,122916,"NSM"],[122918,122922,"NSM"],[123023,123023,"NSM"],[123184,123190,"NSM"],[123566,123566,"NSM"],[123628,123631,"NSM"],[123647,123647,"ET"],[124140,124143,"NSM"],[124398,124399,"NSM"],[124643,124643,"NSM"],[124646,124646,"NSM"],[124654,124655,"NSM"],[124661,124661,"NSM"],[124928,125135,"R"],[125136,125142,"NSM"],[125143,125251,"R"],[125252,125258,"NSM"],[125259,126063,"R"],[126064,126143,"AL"],[126144,126207,"R"],[126208,126287,"AL"],[126288,126463,"R"],[126464,126703,"AL"],[126704,126705,"ON"],[126706,126719,"AL"],[126720,126975,"R"],[126976,127019,"ON"],[127024,127123,"ON"],[127136,127150,"ON"],[127153,127167,"ON"],[127169,127183,"ON"],[127185,127221,"ON"],[127232,127242,"EN"],[127243,127247,"ON"],[127279,127279,"ON"],[127338,127343,"ON"],[127405,127405,"ON"],[127584,127589,"ON"],[127744,128728,"ON"],[128732,128748,"ON"],[128752,128764,"ON"],[128768,128985,"ON"],[128992,129003,"ON"],[129008,129008,"ON"],[129024,129035,"ON"],[129040,129095,"ON"],[129104,129113,"ON"],[129120,129159,"ON"],[129168,129197,"ON"],[129200,129211,"ON"],[129216,129217,"ON"],[129232,129240,"ON"],[129280,129623,"ON"],[129632,129645,"ON"],[129648,129660,"ON"],[129664,129674,"ON"],[129678,129734,"ON"],[129736,129736,"ON"],[129741,129756,"ON"],[129759,129770,"ON"],[129775,129784,"ON"],[129792,129938,"ON"],[129940,130031,"ON"],[130032,130041,"EN"],[130042,130042,"ON"],[131070,131071,"BN"],[196606,196607,"BN"],[262142,262143,"BN"],[327678,327679,"BN"],[393214,393215,"BN"],[458750,458751,"BN"],[524286,524287,"BN"],[589822,589823,"BN"],[655358,655359,"BN"],[720894,720895,"BN"],[786430,786431,"BN"],[851966,851967,"BN"],[917502,917759,"BN"],[917760,917999,"NSM"],[918e3,921599,"BN"],[983038,983039,"BN"],[1048574,1048575,"BN"],[1114110,1114111,"BN"]];function aW(e){if(e<=255)return lW[e];let t=0,n=Q_.length-1;for(;t<=n;){const s=t+n>>1,o=Q_[s];if(e<o[0])n=s-1;else{if(!(e>o[1]))return o[2];t=s+1}}return"L"}const cW=/[ \t\n\r\f]+/g,uW=/[\t\n\r\f]| {2,}|^ | $/;let Tm=null;const dW=new RegExp("\\p{Script=Arabic}","u"),Sh=new RegExp("\\p{M}","u"),VT=new RegExp("\\p{Nd}","u");function ew(e){return dW.test(e)}function tw(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=44032&&e<=55215||e>=65280&&e<=65519}function Ei(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(!(n<12288)){if(n>=55296&&n<=56319&&t+1<e.length){const s=e.charCodeAt(t+1);if(s>=56320&&s<=57343){if(tw(s-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(tw(n))return!0}}return!1}const fW=new Set([" "," ","","\uFEFF"]);function hW(e){return Ei(e)}function t1(e){return!(function(t){const n=$f(t);return n!==null&&($v.has(n)||al.has(n))})(e)&&!(function(t){const n=$f(t);return n!==null&&fW.has(n)})(e)}const $v=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),Ch=new Set(['"',"(","[","{","“","‘","«","‹","(","〔","〈","《","「","『","【","〖","〘","〚"]),Nv=new Set(["'","’"]),al=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),pW=new Set([":",".","،","؛"]),mW=new Set(["၏"]),gW=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function vW(e){if(Lv(e))return!0;let t=!1;for(const n of e)if(al.has(n))t=!0;else if(!t||!Sh.test(n))return!1;return t}function yW(e){for(const t of e)if(!$v.has(t)&&!al.has(t))return!1;return e.length>0}function kW(e){if(Lv(e))return!0;for(const t of e)if(!Ch.has(t)&&!Nv.has(t)&&!Sh.test(t))return!1;return e.length>0}function Lv(e){let t=!1;for(const n of e)if(n!=="\\"&&!Sh.test(n)){if(!(Ch.has(n)||al.has(n)||Nv.has(n)))return!1;t=!0}return t}function KT(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const s=e.charCodeAt(n);if(s<56320||s>57343)return n;const o=n-1;if(o<0)return n;const i=e.charCodeAt(o);return i>=55296&&i<=56319?o:n}function $f(e){if(e.length===0)return null;const t=KT(e,e.length);return e.slice(t)}function bW(e){const t=Array.from(e);let n=t.length;for(;n>0;){const s=t[n-1];if(Sh.test(s))n--;else{if(!Ch.has(s)&&!Nv.has(s))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function _W(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function nw(e,t,n,s){const o=t[s],i=e[s];if(o==null)return i;const r=n[s];if(i.length===r)return i;const l=o.repeat(r);return e[s]=l,l}function sw(e,t){return e&&t!==null&&pW.has(t)}function wW(e){const t=$f(e);return t!==null&&mW.has(t)}function SW(e){if(e.length<2||e[0]!==" ")return null;const t=e.slice(1);return new RegExp("^\\p{M}+$","u").test(t)?{space:" ",marks:t}:null}function n1(e){let t=e.length;for(;t>0;){const n=KT(e,t),s=e.slice(n,t);if(gW.has(s))return!0;if(!al.has(s))return!1;t=n}return!1}function CW(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
|
|
214
|
-
`)return"hard-break"}return e===" "?"space":e===" "||e===" "||e===""||e==="\uFEFF"?"glue":e===""?"zero-width-break":e===""?"soft-hyphen":"text"}const xW=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function wo(e){return e.length===1?e[0]:e.join("")}function TW(e,t){const n=[];for(let s=e.length-1;s>=0;s--)n.push(e[s]);return n.push(t),wo(n)}function MW(e,t,n,s){if(!xW.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const o=[];let i=null,r=[],l=n,a=!1,c=0;for(const u of e){const d=CW(u,s),h=d==="text"&&t;i===null||d!==i||h!==a?(i!==null&&o.push({text:wo(r),isWordLike:a,kind:i,start:l}),i=d,r=[u],l=n+c,a=h,c+=u.length):(r.push(u),c+=u.length)}return i!==null&&o.push({text:wo(r),isWordLike:a,kind:i,start:l}),o}function Mm(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const AW=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function EW(e,t){const n=e.texts[t];return!!n.startsWith("www.")||AW.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function IW(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}const $W=new Set([":","-","/","×",",",".","+","–","—"]),ow=/^[A-Za-z0-9_]+[,:;]*$/,iw=/[,:;]+$/;function rw(e){for(const t of e)if(VT.test(t))return!0;return!1}function Od(e){if(e.length===0)return!1;for(const t of e)if(!VT.test(t)&&!$W.has(t))return!1;return!0}function lw(e,t,n){var s,o,i;const r=(Tm===null&&(Tm=new Intl.Segmenter(void 0,{granularity:"word"})),Tm);let l=0;const a=[],c=[],u=[],d=[],h=[],p=[],f=[],g=[],w=[],S=[],y=[],k=[];for(const b of r.segment(e))for(const M of MW(b.segment,(s=b.isWordLike)!=null&&s,b.index,n)){let N=function(){p[K]!==null&&(c[K]=[nw(a,p,f,K)],p[K]=null),c[K].push(M.text),u[K]=u[K]||M.isWordLike,g[K]=g[K]||O,w[K]=w[K]||P,S[K]=F,y[K]=V,k[K]=sw(w[K],R)};const D=M.kind==="text",$=_W(M.text,M.isWordLike,M.kind),O=Ei(M.text),P=ew(M.text),R=$f(M.text),F=n1(M.text),V=wW(M.text),K=l-1;t.carryCJKAfterClosingQuote&&D&&l>0&&d[K]==="text"&&O&&g[K]&&S[K]||D&&l>0&&d[K]==="text"&&yW(M.text)&&g[K]||D&&l>0&&d[K]==="text"&&y[K]?N():D&&l>0&&d[K]==="text"&&M.isWordLike&&P&&k[K]?(N(),u[K]=!0):$!==null&&l>0&&d[K]==="text"&&p[K]===$?f[K]=((o=f[K])!=null?o:1)+1:D&&!M.isWordLike&&l>0&&d[K]==="text"&&(vW(M.text)||M.text==="-"&&u[K])?N():(a[l]=M.text,c[l]=[M.text],u[l]=M.isWordLike,d[l]=M.kind,h[l]=M.start,p[l]=$,f[l]=$===null?0:1,g[l]=O,w[l]=P,S[l]=F,y[l]=V,k[l]=sw(P,R),l++)}for(let b=0;b<l;b++)p[b]===null?a[b]=wo(c[b]):a[b]=nw(a,p,f,b);for(let b=1;b<l;b++)d[b]==="text"&&!u[b]&&Lv(a[b])&&d[b-1]==="text"&&(a[b-1]+=a[b],u[b-1]=u[b-1]||u[b],a[b]="");const v=Array.from({length:l},()=>null);let _=-1;for(let b=l-1;b>=0;b--){const M=a[b];if(M.length!==0){if(d[b]==="text"&&!u[b]&&kW(M)&&_>=0&&d[_]==="text"){const N=(i=v[_])!=null?i:[];N.push(M),v[_]=N,h[_]=h[b],a[b]="";continue}_=b}}for(let b=0;b<l;b++){const M=v[b];M!=null&&(a[b]=TW(M,a[b]))}let I=0;for(let b=0;b<l;b++){const M=a[b];M.length!==0&&(I!==b&&(a[I]=M,u[I]=u[b],d[I]=d[b],h[I]=h[b]),I++)}a.length=I,u.length=I,d.length=I,h.length=I;const A=(function(b){const M=b.texts.slice(),N=b.isWordLike.slice(),D=b.kinds.slice(),$=b.starts.slice();for(let O=0;O<M.length-1;O++){if(D[O]!=="text"||D[O+1]!=="text"||!Ei(M[O])||!Ei(M[O+1]))continue;const P=bW(M[O]);P!==null&&(M[O]=P.head,M[O+1]=P.tail+M[O+1],$[O+1]=$[O]+P.head.length)}return{len:M.length,texts:M,isWordLike:N,kinds:D,starts:$}})((function(b){const M=[],N=[],D=[],$=[];for(let O=0;O<b.len;O++){const P=b.texts[O],R=b.kinds[O],F=b.isWordLike[O];if(R==="text"&&F&&ow.test(P)){const V=[P];let K=iw.test(P),Z=O+1;for(;K&&Z<b.len&&b.kinds[Z]==="text"&&b.isWordLike[Z]&&ow.test(b.texts[Z]);){const G=b.texts[Z];V.push(G),K=iw.test(G),Z++}M.push(wo(V)),N.push(!0),D.push("text"),$.push(b.starts[O]),O=Z-1;continue}M.push(P),N.push(F),D.push(R),$.push(b.starts[O])}return{len:M.length,texts:M,isWordLike:N,kinds:D,starts:$}})((function(b){const M=[],N=[],D=[],$=[];for(let O=0;O<b.len;O++){const P=b.texts[O];if(b.kinds[O]==="text"&&P.includes("-")){const R=P.split("-");let F=R.length>1;for(let V=0;V<R.length;V++){const K=R[V];if(!F)break;K.length!==0&&rw(K)&&Od(K)||(F=!1)}if(F){let V=0;for(let K=0;K<R.length;K++){const Z=R[K],G=K<R.length-1?`${Z}-`:Z;M.push(G),N.push(!0),D.push("text"),$.push(b.starts[O]+V),V+=G.length}continue}}M.push(P),N.push(b.isWordLike[O]),D.push(b.kinds[O]),$.push(b.starts[O])}return{len:M.length,texts:M,isWordLike:N,kinds:D,starts:$}})((function(b){const M=[],N=[],D=[],$=[];for(let O=0;O<b.len;O++){const P=b.texts[O],R=b.kinds[O];if(R==="text"&&Od(P)&&rw(P)){const F=[P];let V=O+1;for(;V<b.len&&b.kinds[V]==="text"&&Od(b.texts[V]);)F.push(b.texts[V]),V++;M.push(wo(F)),N.push(!0),D.push("text"),$.push(b.starts[O]),O=V-1;continue}M.push(P),N.push(b.isWordLike[O]),D.push(R),$.push(b.starts[O])}return{len:M.length,texts:M,isWordLike:N,kinds:D,starts:$}})((function(b){const M=[],N=[],D=[],$=[];for(let O=0;O<b.len;O++){const P=b.texts[O];if(M.push(P),N.push(b.isWordLike[O]),D.push(b.kinds[O]),$.push(b.starts[O]),!IW(P))continue;const R=O+1;if(R>=b.len||Mm(b.kinds[R]))continue;const F=[],V=b.starts[R];let K=R;for(;K<b.len&&!Mm(b.kinds[K]);)F.push(b.texts[K]),K++;F.length>0&&(M.push(wo(F)),N.push(!0),D.push("text"),$.push(V),O=K-1)}return{len:M.length,texts:M,isWordLike:N,kinds:D,starts:$}})((function(b){const M=b.texts.slice(),N=b.isWordLike.slice(),D=b.kinds.slice(),$=b.starts.slice();for(let P=0;P<b.len;P++){if(D[P]!=="text"||!EW(b,P))continue;const R=[M[P]];let F=P+1;for(;F<b.len&&!Mm(D[F]);){R.push(M[F]),N[P]=!0;const V=M[F].includes("?");if(D[F]="text",M[F]="",F++,V)break}M[P]=wo(R)}let O=0;for(let P=0;P<M.length;P++){const R=M[P];R.length!==0&&(O!==P&&(M[O]=R,N[O]=N[P],D[O]=D[P],$[O]=$[P]),O++)}return M.length=O,N.length=O,D.length=O,$.length=O,{len:O,texts:M,isWordLike:N,kinds:D,starts:$}})((function(b){const M=[],N=[],D=[],$=[];let O=0;for(;O<b.len;){const P=[b.texts[O]];let R=b.isWordLike[O],F=b.kinds[O],V=b.starts[O];if(F==="glue"){const K=[P[0]],Z=V;for(O++;O<b.len&&b.kinds[O]==="glue";)K.push(b.texts[O]),O++;const G=wo(K);if(!(O<b.len&&b.kinds[O]==="text")){M.push(G),N.push(!1),D.push("glue"),$.push(Z);continue}P[0]=G,P.push(b.texts[O]),R=b.isWordLike[O],F="text",V=Z,O++}else O++;if(F==="text")for(;O<b.len&&b.kinds[O]==="glue";){const K=[];for(;O<b.len&&b.kinds[O]==="glue";)K.push(b.texts[O]),O++;const Z=wo(K);O<b.len&&b.kinds[O]==="text"?(P.push(Z,b.texts[O]),R=R||b.isWordLike[O],O++):P.push(Z)}M.push(wo(P)),N.push(R),D.push(F),$.push(V)}return{len:M.length,texts:M,isWordLike:N,kinds:D,starts:$}})({len:I,texts:a,isWordLike:u,kinds:d,starts:h})))))));for(let b=0;b<A.len-1;b++){const M=SW(A.texts[b]);M!==null&&(A.kinds[b]!=="space"&&A.kinds[b]!=="preserved-space"||A.kinds[b+1]!=="text"||!ew(A.texts[b+1])||(A.texts[b]=M.space,A.isWordLike[b]=!1,A.kinds[b]=A.kinds[b]==="preserved-space"?"preserved-space":"space",A.texts[b+1]=M.marks+A.texts[b+1],A.starts[b+1]=A.starts[b]+M.space.length))}return A}function NW(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let s=0;for(let o=0;o<e.len;o++)e.kinds[o]==="hard-break"&&(n.push({startSegmentIndex:s,endSegmentIndex:o,consumedEndSegmentIndex:o+1}),s=o+1);return s<e.len&&n.push({startSegmentIndex:s,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}let Ol=null;const aw=new Map;let Pl=null;const LW=new RegExp("\\p{Emoji_Presentation}","u"),OW=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let Am=null;const cw=new Map;function s1(){if(Ol!==null)return Ol;if(typeof OffscreenCanvas<"u")return Ol=new OffscreenCanvas(1,1).getContext("2d"),Ol;if(typeof document<"u")return Ol=document.createElement("canvas").getContext("2d"),Ol;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function er(e,t){let n=t.get(e);return n===void 0&&(n={width:s1().measureText(e).width,containsCJK:Ei(e)},t.set(e,n)),n}function xh(){if(Pl!==null)return Pl;if(typeof navigator>"u")return Pl={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},Pl;const e=navigator.userAgent,t=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),n=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return Pl={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},Pl}function GT(){return Am===null&&(Am=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Am}function PW(e){return LW.test(e)||e.includes("️")}function Vr(e,t,n){return n===0?t.width:t.width-(function(s,o){return o.emojiCount===void 0&&(o.emojiCount=(function(i){let r=0;const l=GT();for(const a of l.segment(i))PW(a.segment)&&r++;return r})(s)),o.emojiCount})(e,t)*n}function RW(e,t){for(;t<e.widths.length;){const n=e.kinds[t];if(n!=="space"&&n!=="zero-width-break"&&n!=="soft-hyphen")break;t++}return t}function DW(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function uw(e,t,n){const{widths:s,kinds:o,breakableFitAdvances:i}=e;if(s.length===0)return 0;const r=t+xh().lineFitEpsilon;let l=0,a=0,c=!1,u=0,d=0,h=-1,p=0;function f(v=u,_=d,I=a){l++,a=0,c=!1,h=-1,p=0}function g(v,_){c=!0,u=v+1,d=0,a=_}function w(v,_,I){c=!0,u=v,d=_+1,a=I}function S(v,_){c?(a+=_,u=v+1,d=0):g(v,_)}function y(v,_){const I=i[v];for(let A=_;A<I.length;A++){const b=I[A];c?a+b>r?(f(),w(v,A,b)):(a+=b,u=v,d=A+1):w(v,A,b)}c&&u===v&&d===I.length&&(u=v+1,d=0)}let k=0;for(;k<s.length&&(c||(k=RW(e,k),!(k>=s.length)));){const v=s[k],_=o[k],I=_==="space"||_==="preserved-space"||_==="tab"||_==="zero-width-break"||_==="soft-hyphen";if(c)if(a+v>r){if(I){S(k,v),f(k+1,0,a-v),k++;continue}if(h>=0){if(u>h||u===h&&d>0){f();continue}f(h,0,p);continue}if(v>t&&i[k]!==null){f(),y(k,0),k++;continue}f()}else S(k,v),I&&(h=k+1,p=a-v),k++;else v>t&&i[k]!==null?y(k,0):g(k,v),I&&(h=k+1,p=a-v),k++}return c&&f(),l}let Em=null;function BW(e,t){const n=[];let s=[],o=0,i=!1,r=!1,l=!1;function a(){s.length!==0&&(n.push({text:s.length===1?s[0]:s.join(""),start:o}),s=[],i=!1,r=!1,l=!1)}function c(d,h,p){s=[d],o=h,i=p,r=n1(d),l=Ch.has(d)}function u(d,h){s.push(d),i=i||h;const p=n1(d);r=d.length===1&&al.has(d)&&r||p,l=!1}for(const d of(Em===null&&(Em=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Em).segment(e)){const h=d.segment,p=Ei(h);s.length!==0?l||$v.has(h)||al.has(h)||t.carryCJKAfterClosingQuote&&p&&r?u(h,p):i||p?(a(),c(h,d.index,p)):u(h,p):c(h,d.index,p)}return a(),n}function FW(e){if(e.length<=1)return e;const t=[];let n=[e[0].text],s=e[0].start,o=Ei(e[0].text),i=t1(e[0].text);function r(){t.push({text:n.length===1?n[0]:n.join(""),start:s})}for(let l=1;l<e.length;l++){const a=e[l],c=Ei(a.text),u=t1(a.text);o&&i?(n.push(a.text),o=o||c,i=u):(r(),n=[a.text],s=a.start,o=c,i=u)}return r(),t}function HW(e,t,n,s){const o=xh(),{cache:i,emojiCorrection:r}=(function(A,b){s1().font=A;const M=(function($){let O=aw.get($);return O||(O=new Map,aw.set($,O)),O})(A),N=(function($){const O=$.match(/(\d+(?:\.\d+)?)\s*px/);return O?parseFloat(O[1]):16})(A),D=b?(function($,O){let P=cw.get($);if(P!==void 0)return P;const R=s1();R.font=$;const F=R.measureText("😀").width;if(P=0,F>O+.5&&typeof document<"u"&&document.body!==null){const V=document.createElement("span");V.style.font=$,V.style.display="inline-block",V.style.visibility="hidden",V.style.position="absolute",V.textContent="😀",document.body.appendChild(V);const K=V.getBoundingClientRect().width;document.body.removeChild(V),F-K>.5&&(P=F-K)}return cw.set($,P),P})(A,N):0;return{cache:M,fontSize:N,emojiCorrection:D}})(t,(l=e.normalized,OW.test(l)));var l;const a=Vr("-",er("-",i),r),c=8*Vr(" ",er(" ",i),r);if(e.len===0)return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]};const u=[],d=[],h=[],p=[];let f=e.chunks.length<=1;const g=null,w=[],S=n?[]:null,y=Array.from({length:e.len});function k(A,b,M,N,D,$,O){D!=="text"&&D!=="space"&&D!=="zero-width-break"&&(f=!1),u.push(b),d.push(M),h.push(N),p.push(D),w.push(O),S!==null&&S.push(A)}function v(A,b,M,N,D){const $=er(A,i),O=Vr(A,$,r),P=b==="space"||b==="preserved-space"||b==="zero-width-break"?0:O,R=b==="space"||b==="zero-width-break"?0:O;if(D&&N&&A.length>1){let F="sum-graphemes";Od(A)?F="pair-context":o.preferPrefixWidthsForBreakableRuns&&(F="segment-prefixes");const V=(function(K,Z,G,X,pe){if(Z.breakableFitAdvances!==void 0)return Z.breakableFitAdvances;const oe=GT(),ye=[];for(const xe of oe.segment(K))ye.push(xe.segment);if(ye.length<=1)return Z.breakableFitAdvances=null,Z.breakableFitAdvances;if(pe==="sum-graphemes"){const xe=[];for(const Le of ye){const ee=er(Le,G);xe.push(Vr(Le,ee,X))}return Z.breakableFitAdvances=xe,Z.breakableFitAdvances}if(pe==="pair-context"||ye.length>96){const xe=[];let Le=null,ee=0;for(const ke of ye){const ge=Vr(ke,er(ke,G),X);if(Le===null)xe.push(ge);else{const W=Le+ke,J=er(W,G);xe.push(Vr(W,J,X)-ee)}Le=ke,ee=ge}return Z.breakableFitAdvances=xe,Z.breakableFitAdvances}const _e=[];let de="",be=0;for(const xe of ye){de+=xe;const Le=Vr(de,er(de,G),X);_e.push(Le-be),be=Le}return Z.breakableFitAdvances=_e,Z.breakableFitAdvances})(A,$,i,r,F);return void k(A,O,P,R,b,M,V)}k(A,O,P,R,b,M,null)}for(let A=0;A<e.len;A++){y[A]=u.length;const b=e.texts[A],M=e.isWordLike[A],N=e.kinds[A],D=e.starts[A];if(N==="soft-hyphen"){k(b,0,a,a,N,D,null);continue}if(N==="hard-break"){k(b,0,0,0,N,D,null);continue}if(N==="tab"){k(b,0,0,0,N,D,null);continue}const $=er(b,i);if(N==="text"&&$.containsCJK){const O=BW(b,o),P=s==="keep-all"?FW(O):O;for(let R=0;R<P.length;R++){const F=P[R];v(F.text,"text",D+F.start,M,s==="keep-all"||!Ei(F.text))}continue}v(b,N,D,M,!0)}const _=(function(A,b,M){const N=[];for(let D=0;D<A.length;D++){const $=A[D],O=$.startSegmentIndex<b.length?b[$.startSegmentIndex]:M,P=$.endSegmentIndex<b.length?b[$.endSegmentIndex]:M,R=$.consumedEndSegmentIndex<b.length?b[$.consumedEndSegmentIndex]:M;N.push({startSegmentIndex:O,endSegmentIndex:P,consumedEndSegmentIndex:R})}return N})(e.chunks,y,u.length),I=g===null?null:(function(A,b){const M=(function(D){const $=D.length;if($===0)return null;const O=new Array($);let P=!1;for(let G=0;G<$;){const X=D.charCodeAt(G);let pe=X,oe=1;if(X>=55296&&X<=56319&&G+1<$){const _e=D.charCodeAt(G+1);_e>=56320&&_e<=57343&&(pe=_e-56320+(X-55296<<10)+65536,oe=2)}const ye=aW(pe);ye!=="R"&&ye!=="AL"&&ye!=="AN"||(P=!0);for(let _e=0;_e<oe;_e++)O[G+_e]=ye;G+=oe}if(!P)return null;let R=0;for(let G=0;G<$;G++){const X=O[G];if(X==="L"){R=0;break}if(X==="R"||X==="AL"){R=1;break}}const F=new Int8Array($);for(let G=0;G<$;G++)F[G]=R;const V=1&R?"R":"L",K=V;let Z=K;for(let G=0;G<$;G++)O[G]==="NSM"?O[G]=Z:Z=O[G];Z=K;for(let G=0;G<$;G++){const X=O[G];X==="EN"?O[G]=Z==="AL"?"AN":"EN":X!=="R"&&X!=="L"&&X!=="AL"||(Z=X)}for(let G=0;G<$;G++)O[G]==="AL"&&(O[G]="R");for(let G=1;G<$-1;G++)O[G]==="ES"&&O[G-1]==="EN"&&O[G+1]==="EN"&&(O[G]="EN"),O[G]!=="CS"||O[G-1]!=="EN"&&O[G-1]!=="AN"||O[G+1]!==O[G-1]||(O[G]=O[G-1]);for(let G=0;G<$;G++){if(O[G]!=="EN")continue;let X;for(X=G-1;X>=0&&O[X]==="ET";X--)O[X]="EN";for(X=G+1;X<$&&O[X]==="ET";X++)O[X]="EN"}for(let G=0;G<$;G++){const X=O[G];X!=="WS"&&X!=="ES"&&X!=="ET"&&X!=="CS"||(O[G]="ON")}Z=K;for(let G=0;G<$;G++){const X=O[G];X==="EN"?O[G]=Z==="L"?"L":"EN":X!=="R"&&X!=="L"||(Z=X)}for(let G=0;G<$;G++){if(O[G]!=="ON")continue;let X=G+1;for(;X<$&&O[X]==="ON";)X++;const pe=(G>0?O[G-1]:K)!=="L"?"R":"L";if(pe===((X<$?O[X]:K)!=="L"?"R":"L"))for(let oe=G;oe<X;oe++)O[oe]=pe;G=X-1}for(let G=0;G<$;G++)O[G]==="ON"&&(O[G]=V);for(let G=0;G<$;G++){const X=O[G];1&F[G]?X!=="L"&&X!=="AN"&&X!=="EN"||F[G]++:X==="R"?F[G]++:X!=="AN"&&X!=="EN"||(F[G]+=2)}return F})(A);if(M===null)return null;const N=new Int8Array(b.length);for(let D=0;D<b.length;D++)N[D]=M[b[D]];return N})(e.normalized,g);return S!==null?{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:h,kinds:p,simpleLineWalkFastPath:f,segLevels:I,breakableFitAdvances:w,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:_,segments:S}:{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:h,kinds:p,simpleLineWalkFastPath:f,segLevels:I,breakableFitAdvances:w,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:_}}function WW(e,t,n){return(function(s,o,i,r){var l;const a=(l=r?.wordBreak)!=null?l:"normal";return HW((function(c,u,d="normal",h="normal"){const p=(function(w){const S=w??"normal";return S==="pre-wrap"?{mode:S,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:S,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}})(d),f=p.mode==="pre-wrap"?(function(w){return/[\r\f]/.test(w)?w.replace(/\r\n/g,`
|
|
215
|
-
`).replace(/[\r\f]/g,`
|
|
216
|
-
`):w.replace(/\r\n/g,`
|
|
217
|
-
`)})(c):(function(w){if(!uW.test(w))return w;let S=w.replace(cW," ");return S.charCodeAt(0)===32&&(S=S.slice(1)),S.length>0&&S.charCodeAt(S.length-1)===32&&(S=S.slice(0,-1)),S})(c);if(f.length===0)return{normalized:f,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const g=h==="keep-all"?(function(w){if(w.len<=1)return w;const S=[],y=[],k=[],v=[];let _=null,I=!1,A=0,b=!1,M=!1;function N(){_!==null&&(S.push(wo(_)),y.push(I),k.push("text"),v.push(A),_=null)}for(let D=0;D<w.len;D++){const $=w.texts[D],O=w.kinds[D],P=w.isWordLike[D],R=w.starts[D];if(O==="text"){const F=hW($),V=t1($);if(_!==null&&b&&M){_.push($),I=I||P,b=b||F,M=V;continue}N(),_=[$],I=P,A=R,b=F,M=V;continue}N(),S.push($),y.push(P),k.push(O),v.push(R)}return N(),{len:S.length,texts:S,isWordLike:y,kinds:k,starts:v}})(lw(f,u,p)):lw(f,u,p);return tt({normalized:f,chunks:NW(g,p)},g)})(s,xh(),r?.whiteSpace,a),o,!1,a)})(e,t,0,n)}const Im="__MARKSTREAM_VUE_HEIGHT_ESTIMATION_EXPERIMENT__",Vn=(()=>{const e=globalThis;if(e[Im])return e[Im];const t={configs:{},controllers:{},revision:ul(0),preparedCache:new Map,blockEstimateCache:new Map};return e[Im]=t,t})();let nc=null;const dw=Vn.revision;function fw(e){var t;return e&&(t=Vn.configs[e])!=null?t:null}function hw(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function UW(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function $m(e){var t,n,s;if(!Array.isArray(e)||e.length===0)return null;let o="";for(const i of e){if(!UW(i))return null;i.type==="text"?o+=String((t=i.content)!=null?t:""):i.type==="emoji"?o+=String((s=(n=i.name)!=null?n:i.raw)!=null?s:""):i.type==="hardbreak"&&(o+=`
|
|
218
|
-
`)}return o.length>0?o:null}function Nm(e,t,n){var s,o;if(!e||!Number.isFinite(t)||t<=0||!(function(){var i;if(nc!=null)return nc;if(typeof document>"u")return!1;try{const r=document.createElement("canvas");return nc=!!((i=r.getContext)!=null&&i.call(r,"2d")),nc}catch{return nc=!1,!1}})())return null;try{const i=Math.round(100*t)/100,r=[(s=n.whiteSpace)!=null?s:"pre-wrap",n.font,n.lineHeight,n.wrapperOverhead,n.widthAdjustment,i,e].join("\0"),l=Vn.blockEstimateCache.get(r);if(l)return Vn.blockEstimateCache.delete(r),Vn.blockEstimateCache.set(r,l),{kind:"simple-text",height:l.height,contentHeight:l.contentHeight};const a=(o=n.whiteSpace)!=null?o:"pre-wrap",c=(function(p,f,g){const w=`${g}\0${f}\0${p}`,S=Vn.preparedCache.get(w);if(S)return Vn.preparedCache.delete(w),Vn.preparedCache.set(w,S),S.prepared;const y=WW(p,f,{whiteSpace:g});for(Vn.preparedCache.set(w,{prepared:y});Vn.preparedCache.size>240;){const k=Vn.preparedCache.keys().next().value;if(!k)break;Vn.preparedCache.delete(k)}return y})(e,n.font,a),u=(function(p,f,g){const w=(function(S,y){return S.simpleLineWalkFastPath?uw(S,y):(function(k,v){if(k.simpleLineWalkFastPath)return uw(k,v);const{widths:_,lineEndFitAdvances:I,lineEndPaintAdvances:A,kinds:b,breakableFitAdvances:M,discretionaryHyphenWidth:N,tabStopAdvance:D,chunks:$}=k;if(_.length===0||$.length===0)return 0;const O=xh(),P=O.lineFitEpsilon,R=v+P;let F=0,V=0,K=!1,Z=0,G=0,X=-1,pe=0,oe=0,ye=null;function _e(){X=-1,pe=0,oe=0,ye=null}function de(J=Z,ue=G,ie=V){F++,V=0,K=!1,_e()}function be(J,ue){K=!0,Z=J+1,G=0,V=ue}function xe(J,ue,ie){K=!0,Z=J,G=ue+1,V=ie}function Le(J,ue){K?(V+=ue,Z=J+1,G=0):be(J,ue)}function ee(J,ue,ie,ae){if(!ue)return;const U=J==="tab"?0:I[ie],Y=J==="tab"?ae:A[ie];X=ie+1,pe=V-ae+U,oe=V-ae+Y,ye=J}function ke(J,ue){const ie=M[J];for(let ae=ue;ae<ie.length;ae++){const U=ie[ae];K?V+U>R?(de(),xe(J,ae,U)):(V+=U,Z=J,G=ae+1):xe(J,ae,U)}K&&Z===J&&G===ie.length&&(Z=J+1,G=0)}function ge(J){if(ye!=="soft-hyphen")return!1;const ue=M[J];if(ue==null)return!1;const{fitCount:ie,fittedWidth:ae}=(function(U,Y,ce,me,Se){let Ee=0,re=Y;for(;Ee<U.length;){const Te=re+U[Ee];if((Ee+1<U.length?Te+Se:Te)>ce+me)break;re=Te,Ee++}return{fitCount:Ee,fittedWidth:re}})(ue,V,v,P,N);return ie!==0&&(V=ae,Z=J,G=ie,_e(),ie===ue.length?(Z=J+1,G=0,!0):(de(J,ie,ae+N),ke(J,ie),!0))}function W(J){F++,_e()}for(let J=0;J<$.length;J++){const ue=$[J];if(ue.startSegmentIndex===ue.endSegmentIndex){W();continue}K=!1,V=0,ue.startSegmentIndex,Z=ue.startSegmentIndex,G=0,_e();let ie=ue.startSegmentIndex;for(;ie<ue.endSegmentIndex;){const ae=b[ie],U=ae==="space"||ae==="preserved-space"||ae==="tab"||ae==="zero-width-break"||ae==="soft-hyphen",Y=ae==="tab"?DW(V,D):_[ie];if(ae!=="soft-hyphen")if(K){if(V+Y>R){const ce=V+(ae==="tab"?0:I[ie]),me=V+(ae==="tab"?Y:A[ie]);if(ye==="soft-hyphen"&&O.preferEarlySoftHyphenBreak&&pe<=R){de(X,0,oe);continue}if(ye==="soft-hyphen"&&ge(ie)){ie++;continue}if(U&&ce<=R){Le(ie,Y),de(ie+1,0,me),ie++;continue}if(X>=0&&pe<=R){if(Z>X||Z===X&&G>0){de();continue}const Se=X;de(Se,0,oe),ie=Se;continue}if(Y>v&&M[ie]!==null){de(),ke(ie,0),ie++;continue}de();continue}Le(ie,Y),ee(ae,U,ie,Y),ie++}else Y>v&&M[ie]!==null?ke(ie,0):be(ie,Y),ee(ae,U,ie,Y),ie++;else K&&(Z=ie+1,G=0,X=ie+1,pe=V+N,oe=V+N,ye=ae),ie++}if(K){const ae=X===ue.consumedEndSegmentIndex?oe:V;de(ue.consumedEndSegmentIndex,0,ae)}}return F})(S,y)})(p,f);return{lineCount:w,height:w*g}})(c,Math.max(24,i-n.widthAdjustment),n.lineHeight),d=Math.max(n.lineHeight,u.height),h=Math.max(n.lineHeight,Math.round(d+n.wrapperOverhead));for(Vn.blockEstimateCache.set(r,{height:h,contentHeight:Math.round(d)});Vn.blockEstimateCache.size>4e3;){const p=Vn.blockEstimateCache.keys().next().value;if(!p)break;Vn.blockEstimateCache.delete(p)}return{kind:"simple-text",height:h,contentHeight:Math.round(d)}}catch{return null}}function YT(e,t,n){var s,o;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const i=$m(e.children);return i&&n.paragraph?Nm(i,t,n.paragraph):null}if(e.type==="heading"){const i=Number(e.level||0),r=$m(e.children),l=n.headings[i];return r&&l?Nm(r,t,l):null}if(e.type==="list_item"){const i=Array.isArray(e.children)?e.children:[];if(i.length!==1||((s=i[0])==null?void 0:s.type)!=="paragraph"||!n.listItem)return null;const r=$m((o=i[0])==null?void 0:o.children);return r?Nm(r,t,n.listItem):null}if(e.type==="list"){const i=Array.isArray(e.items)?e.items:[];if(!i.length)return null;let r=Math.max(0,n.listWrapperOverhead);for(const l of i){const a=YT(l,t,n);if(!a)return null;r+=a.height}return{kind:"simple-text",height:Math.max(1,Math.round(r)),contentHeight:Math.max(1,Math.round(r))}}return null}function ud(e){if(!e)return 1;const t=String(e).split(/\r?\n/);return Math.max(1,t.length)}function qW(e,t){var n;if(!e||e.type!=="code_block")return null;const s=t.rendererKind,o=t.showHeader!==!1,i=(function(u){var d,h,p;return u.diff?Math.max(ud(String((d=u.originalCode)!=null?d:"")),ud(String((h=u.updatedCode)!=null?h:"")),ud(String((p=u.code)!=null?p:""))):ud((function(f,g){const w=String(f??"");return g?w:w.replace(/\r\n$|\n$|\r$/,"")})(u.code,u.loading===!0))})(e),r=!!e.diff;let l=0,a=500;if(s==="monaco"){const u=(n=t.monacoOptions)!=null?n:{},d=(function(p,f){const g=typeof p?.fontSize=="number"&&p.fontSize>0?p.fontSize:f?13:12;return typeof p?.lineHeight=="number"&&p.lineHeight>0?p.lineHeight:f?30:Math.round(1.5*g)})(u,r),h=(function(p,f){var g,w;if(!f)return 0;const S=typeof((g=p?.padding)==null?void 0:g.top)=="number"?p.padding.top:10,y=typeof((w=p?.padding)==null?void 0:w.bottom)=="number"?p.padding.bottom:22;return Math.max(0,S)+Math.max(0,y)})(u,r);a=typeof u.MAX_HEIGHT=="number"&&u.MAX_HEIGHT>0?u.MAX_HEIGHT:500,l=Math.round(r?i*d+h:i*(d+1.5))}else s==="markdown"?l=Math.round(21*i+32):(l=Math.round(21*i+32),a=Number.POSITIVE_INFINITY);const c=Math.max(1,Math.min(l,a));return{kind:"code-block",height:Math.round(c+(o?40:0)),contentHeight:c,rendererKind:s}}function jW(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function Lm(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const s=window.getComputedStyle(t),o=e.offsetHeight,i=hw(s.lineHeight,1.5*hw(s.fontSize,16)),r=e.getBoundingClientRect().width,l=t.getBoundingClientRect().width;return{font:jW(s),lineHeight:i,wrapperOverhead:Math.max(0,o-i),widthAdjustment:Math.max(0,r-l),whiteSpace:n}}const zW=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function pw(e,t={}){var n;const s={},o=new Set((n=t.omit)!=null?n:[]);if(!e||typeof e!="object")return s;const i=Object.getOwnPropertyDescriptors(e);for(const[r,l]of Object.entries(i))zW.has(r)||o.has(r)||l.enumerable&&"value"in l&&(s[r]=l.value);return s}const VW=!1;function Gfe(){return VW}function mw(e,t,n,s){var o;const i=(function(h){return Math.max(0,Math.ceil(h.scrollHeight||0)-Math.ceil(h.clientHeight||0))})(e),r=(function(h,p){return Number.isFinite(h)?Math.min(Math.max(0,h),p):0})(n,i);if(!s.isReverseFlexScrollRoot(e))return void(e.scrollTop=r);const l=Math.max(0,i-r),a=[-l,l];let c=a[0],u=Number.POSITIVE_INFINITY;for(const h of a){e.scrollTop=h;const p=s.getNormalizedScrollTop(e,t,!1),f=Math.abs(p-r);f<u&&(u=f,c=h)}e.scrollTop=c;const d=(o=s.epsilonPx)!=null?o:2;Math.abs(s.getNormalizedScrollTop(e,t,!1)-r)>d&&(e.scrollTop=c)}const XT=Symbol("MarkstreamMathBlockMinHeightCache");function Yfe(){return Pt(XT,null)}const KW=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],GW=["tokenCloneMs","processTokensMs","parseMarkdownToStructureTotalMs"],YW=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition"]),ZT=["raw","content","code","originalCode","updatedCode"],gw=new WeakMap,vw=new WeakMap;let XW=1;function Bo(){return typeof performance<"u"?performance.now():Date.now()}function yw(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function To(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=gw.get(t);return n||(n=XW++,gw.set(t,n)),String(n)}function kw(e,t,n,s={}){var o,i;const r=s.includeFinal!==!1,l={md:To(t),customMarkdownIt:To(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(o=e.customHtmlTags)!=null?o:[],streamParse:(i=e.streamParse)!=null?i:"auto",validateLink:To(e.validateLink),preTransformTokens:To(e.preTransformTokens),postTransformTokens:To(e.postTransformTokens)};return r&&(l.final=e.final===!0),JSON.stringify(l)}function bw(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===10;)t-=1;const n=e.lastIndexOf(`
|
|
219
|
-
`,t-1)+1;return e.slice(n,t).trim()}function _w(e){const t=JT(e);return t.length>=2&&t.every(n=>{const s=n.trim();return s.length>=1&&s.replace(/^:/,"").replace(/:$/,"").split("").every(o=>o==="-")})}function JT(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function QT(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function Ov(e){const t=String(e??"");return`${t.length}:${QT(t)}`}function o1(e,t=new WeakMap,n=0){if(e==null||typeof e=="number"||typeof e=="boolean")return String(e);if(typeof e=="string")return`s:${(function(r){return r.length<=8192?Ov(r):`${r.length}:${QT(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${To(e)}`;if(typeof e!="object")return typeof e;const s=e,o=t.get(s);if(o)return`cycle:${o}`;if(n>=6)return`object:${To(s)}`;const i=To(s);if(t.set(s,i),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(l=>o1(l,t,n+1)).join(",")}`}if(typeof e=="object"){const r=e,l=Object.keys(r).sort(),a=l.slice(0,80);return`o:${l.length}:${a.sort().map(c=>`${c}:${o1(r[c],t,n+1)}`).join(";")}`}return typeof e}function Nf(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function e3(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(s=>Nf(s)?Cr(s,t,n+1):e3(s,t,n+1)).join(",")}`:Nf(e)?Cr(e,t,n):o1(e,t,n)}function ZW(e,t,n){return Object.keys(e).sort().filter(s=>s!=="children"&&!ZT.includes(s)).map(s=>{const o=e[s];return typeof o=="string"?`${s}=s:${Ov(o)}`:typeof o=="number"||typeof o=="boolean"||o==null?`${s}=${String(o)}`:typeof o=="function"?`${s}=fn:${To(o)}`:YW.has(s)&&(Array.isArray(o)||typeof o=="object")?`${s}=${e3(o,t,n+1)}`:o&&typeof o=="object"?`${s}=object:${To(o)}`:""}).filter(Boolean).join(";")}function JW(e){return ZT.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${Ov(n)}`:""}).filter(Boolean).join(";")}function Cr(e,t=new WeakMap,n=0){const s=vw.get(e);if(s)return s;const o=e,i=t.get(o);if(i)return`node-cycle:${i}`;if(n>=6)return`node:${e.type}:${To(o)}`;const r=To(o);t.set(o,r);const l=(function(a,c,u){const d=a,h=Array.isArray(d.children)?d.children:[],p=h.length?h.slice(0,200).map(f=>Cr(f,c,u+1)).join("|"):"";return[a.type,JW(d),ZW(d,c,u),h.length,p].join(":")})(e,t,n);return vw.set(o,l),l}function t3(e,t){return Cr(e)===Cr(t)}function Pv(e,t,n){const s=Bo(),o=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=Bo()-s,e[o]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function ww(e,t,n){return Pv(t,n,()=>Cr(e))}function n3(e,t,n){return ww(e,n,"stabilizeSignatureMs")===ww(t,n,"stabilizeSignatureMs")}function Om(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function Sw(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function QW(e,t){return e.length===t.length&&e===t}function Rv(e,t,n=0){if(n>=4)return null;if(e.type!==t.type)return!1;const s=e,o=t,i=Object.keys(s).filter(u=>u!=="type"&&u!=="children").sort(),r=Object.keys(o).filter(u=>u!=="type"&&u!=="children").sort();if(i.length!==r.length)return!1;for(let u=0;u<i.length;u++){const d=i[u];if(d!==r[u])return!1;const h=s[d],p=o[d];if(typeof h!=typeof p)return!1;if(typeof h!="string"){if(typeof h!="number"&&typeof h!="boolean"&&h!=null)return null;if(!Object.is(h,p))return!1}else if(typeof p!="string"||!QW(h,p))return!1}const l=Object.prototype.hasOwnProperty.call(s,"children");if(l!==Object.prototype.hasOwnProperty.call(o,"children"))return!1;if(!l)return!0;const a=s.children,c=o.children;if(!Array.isArray(a)||!Array.isArray(c))return null;if(a.length!==c.length)return!1;for(let u=0;u<a.length;u++){const d=a[u],h=c[u];if(!Nf(d)||!Nf(h))return null;const p=Rv(d,h,n+1);if(p==null)return null;if(!p)return!1}return!0}function eU(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;const n=Rv(e,t);return n??t3(e,t)}function tU(e,t,n){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;let s=null;return Pv(n,"stabilizeSignatureMs",()=>{s=Rv(e,t)}),s??n3(e,t,n)}function nU(e,t){const n={};for(const s of KW){const o=e[s],i=t?.[s];typeof o=="number"&&(n[s]=o-(typeof i=="number"?i:0))}return n}function sU(e,t){var n;const s=N_(t.instanceMsgId),o=new Map,i=(n=t.smoothStreamingEnabled)!=null?n:H(()=>!1),r=se(t.renderContent.value);let l,a=[],c="",u="",d="",h=0,p=0,f=Bo();function g(){l&&(clearTimeout(l),l=void 0)}function w(){g();const M=t.renderContent.value;r.value!==M&&(r.value=M),f=Bo()}Ge([t.renderContent,t.effectiveFinal,i],([M,N,D])=>{r.value!==M&&(!D||N||(function($,O){if(!$&&O||O.length<=80||O.length<$.length||!O.startsWith($))return!0;const P=O.slice($.length);return!!P&&(!!_w(bw(O))||!(!P.includes(`
|
|
220
|
-
|
|
221
|
-
`)&&!/(?:^|\n)(?:#{1,6}\s|[-+*]\s+|\d+[.)]\s+|>\s*|`{3,}|~{3,})/.test(P))||P.endsWith(`
|
|
222
|
-
`)&&!(function(R){const F=bw(R);if(_w(F))return!1;const V=JT(F);return V.length>=2&&V.some(K=>K.trim())})(O))})(r.value,M)?w():(function(){if(p+=1,l)return;const $=Math.max(0,(function(O){const P=O.parseCoalesceMs;return typeof P=="number"&&Number.isFinite(P)&&P>=0?P:80})(e)-(Bo()-f));$<=0?w():l=setTimeout(w,$)})())},{flush:"sync",immediate:!0}),_1(g);const S=H(()=>{var M,N,D,$;return PR(e.customHtmlTags,(M=e.parseOptions)==null?void 0:M.customHtmlTags,($=(D=(N=t.customComponentsMap)==null?void 0:N.value)!=null?D:{},Object.entries($).map(([O,P])=>{const R=No(O);return P==null||!R||uu(R)||Ax.has(R)||lu.has(R)?"":R}).filter(Boolean)))}),y=H(()=>{const{key:M,tags:N}=RR(S.value);if(!M)return s;const D=o.get(M);if(D)return D;const $=N_(t.instanceMsgId,{customHtmlTags:N});return o.set(M,$),$}),k=H(()=>{const M=y.value;return e.customMarkdownIt?e.customMarkdownIt(M):M}),v=H(()=>{var M,N;const D=(M=e.parseOptions)!=null?M:{},$=t.effectiveFinal.value,O=S.value,P=$!=null,R=O.length>0;return P||R||D.streamParse==null?tt(tt(Ct(tt({},D),{streamParse:(N=D.streamParse)==null||N}),P?{final:$}:{}),R?{customHtmlTags:O}:{}):D}),_=H(()=>{var M;return new Set(((M=v.value.customHtmlTags)!=null?M:[]).map(N=>String(N).trim().toLowerCase()).filter(Boolean))}),I=H(()=>kw(v.value,k.value,e.customMarkdownIt,{includeFinal:!0})),A=H(()=>kw(v.value,k.value,e.customMarkdownIt,{includeFinal:!1}));Ge([I,A],([M,N],[D,$])=>{D&&(M===D&&N===$||(w(),N!==$&&(a=[],d="")))},{flush:"sync"});const b=H(()=>{var M,N,D,$,O,P,R,F;if((M=e.nodes)!=null&&M.length)return a=[],d="",cr(e.nodes.slice());const V=r.value;if(!V)return a=[],d="",[];const K=t.debugPerformanceEnabled.value,Z=K?Bo():0,G=k.value,X=I.value,pe=A.value;c&&X!==c&&(function(ue){var ie,ae;(ae=(ie=ue.stream)==null?void 0:ie.reset)==null||ae.call(ie)})(G),u&&pe!==u&&(a=[],d="");const oe=a.length>0&&V.startsWith(d)&&pe===u,ye=K?yw(G):null,_e=K?{}:void 0,de=_e?Ct(tt({},v.value),{__timing:_e}):v.value,be=gT(V,G,de),xe=K?Bo():0,Le=K?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let ee,ke=K?Om(be.length):void 0,ge=0,W=0;if(oe){const ue=K?Bo():0;if(Le){const ie=(function(ae,U,Y){if(!U.length)return{nodes:ae,metrics:Om(ae.length)};const ce=(function(Ee,re,Te){const Ue=Math.min(Ee.length,re.length);for(let nt=0;nt<Ue;nt++)if(!tU(re[nt],Ee[nt],Te))return nt;return Ee.length===re.length?-1:Ue})(ae,U,Y);if(ce<0)return{nodes:U,metrics:{reusedNodeCount:ae.length,dirtyStartIndex:ce,stablePrefixNodeCount:ae.length,dirtyTailNodeCount:0}};const me=ae.slice();let Se=ce;for(let Ee=0;Ee<ce;Ee++)me[Ee]=U[Ee];for(let Ee=ce;Ee<ae.length;Ee++){const re=U[Ee],Te=ae[Ee];re&&n3(re,Te,Y)&&(me[Ee]=re,Se+=1)}return{nodes:me,metrics:{reusedNodeCount:Se,dirtyStartIndex:ce,stablePrefixNodeCount:ce,dirtyTailNodeCount:Sw(ce,ae,U)}}})(be,a,Le);ee=ie.nodes,ke=ie.metrics}else{const ie=(function(ae,U){if(!U.length)return{nodes:ae,metrics:Om(ae.length)};const Y=(function(Se,Ee){const re=Math.min(Se.length,Ee.length);for(let Te=0;Te<re;Te++)if(!eU(Ee[Te],Se[Te]))return Te;return Se.length===Ee.length?-1:re})(ae,U);if(Y<0)return{nodes:U,metrics:{reusedNodeCount:ae.length,dirtyStartIndex:Y,stablePrefixNodeCount:ae.length,dirtyTailNodeCount:0}};const ce=ae.slice();let me=Y;for(let Se=0;Se<Y;Se++)ce[Se]=U[Se];for(let Se=Y;Se<ae.length;Se++){const Ee=U[Se],re=ae[Se];Ee&&t3(Ee,re)&&(ce[Se]=Ee,me+=1)}return{nodes:ce,metrics:{reusedNodeCount:me,dirtyStartIndex:Y,stablePrefixNodeCount:Y,dirtyTailNodeCount:Sw(Y,ae,U)}}})(be,a);ee=ie.nodes,ke=ie.metrics}ge=K?Bo()-ue:0,W=ke?.dirtyStartIndex==null||ke.dirtyStartIndex<0?ee.length:ke.dirtyStartIndex}else ee=be;Le?(function(ue,ie,ae=0){for(let U=Math.max(0,ae);U<ue.length;U++)Pv(ie,"primeSignatureMs",()=>Cr(ue[U]))})(ee,Le,W):(function(ue,ie=0){for(let ae=Math.max(0,ie);ae<ue.length;ae++)Cr(ue[ae])})(ee,W);const J=K?Bo()-xe:0;if(h+=1,d=V,c=X,u=pe,a=ee,K){const ue=yw(G),ie=typeof ue?.total=="number"&&ue.total>((N=ye?.total)!=null?N:0);t.logPerf(ie?"parse(stream)":"parse(sync)",tt(tt(tt({rendererId:t.instanceMsgId,ms:Math.round(Bo()-Z),nodes:ee.length,contentLength:V.length,parseCommitCount:h,parseCoalescedCount:p,nodeReuseMs:J,signatureMs:(D=Le?.signatureMs)!=null?D:0,stabilizeSignatureMs:($=Le?.stabilizeSignatureMs)!=null?$:0,primeSignatureMs:(O=Le?.primeSignatureMs)!=null?O:0,signatureCallCount:(P=Le?.signatureCallCount)!=null?P:0,stabilizeSignatureCallCount:(R=Le?.stabilizeSignatureCallCount)!=null?R:0,primeSignatureCallCount:(F=Le?.primeSignatureCallCount)!=null?F:0,stabilizeMs:ge},ke??{}),_e?Object.fromEntries(GW.map(ae=>{var U;return[ae,(U=_e[ae])!=null?U:0]})):{}),ue?{streamMode:ue.lastMode,streamDelta:nU(ue,ye),streamStats:ue}:{}))}return cr(ee)});return{effectiveCustomHtmlTags:S,effectiveCustomHtmlTagsSet:_,mdBase:y,mdInstance:k,mergedParseOptions:v,parsedNodes:b}}function oU(e){const{isClient:t}=e,n=se(new Set),s=new Map,o=new Map,i=new Map;function r(c){if(!t)return;const u=i.get(c);u!=null&&(window.clearTimeout(u),i.delete(c))}function l(){if(t)for(const c of i.values())window.clearTimeout(c);i.clear()}function a(){n.value=new Set}return{visibleNodeIndices:n,nodeVisibilityHandles:s,nodeVisibilityWatchStops:o,nodeVisibilityFallbackTimers:i,clearVisibilityFallback:r,clearAllVisibilityFallbacks:l,markNodeVisible:function(c,u=!0){var d;u&&r(c),(function(h,p){if((g=(f=e.shouldTrackVisibleNodeIndices)==null?void 0:f.call(e))!=null&&!g)return;var f,g;const w=n.value,S=w.has(h);if(p){if(S)return;const k=new Set(w);return k.add(h),void(n.value=k)}if(!S)return;const y=new Set(w);y.delete(h),n.value=y})(c,u),u&&((d=e.onNodeMarkedVisible)==null||d.call(e,c))},resetNodeVisibleState:a,cleanupNodeVisibility:function(c){var u;if(e.shouldCleanupNodeVisibility&&!e.shouldCleanupNodeVisibility())return;for(const[h,p]of o.entries())h<c||(p(),o.delete(h));for(const[h,p]of s.entries())h<c||(p.destroy(),s.delete(h),r(h),(u=e.onNodeVisibilityCleaned)==null||u.call(e,h));for(const h of Array.from(i.keys()))h<c||r(h);if(!n.value.size)return;const d=new Set;for(const h of n.value)h<c&&d.add(h);n.value=d},destroyNodeVisibilityState:function(){a();for(const c of o.values())c();o.clear();for(const c of s.values())c.destroy();s.clear(),l()}}}function iU(e={}){const t=se(""),n=se(""),s=se(!1),o=_F(e),i=()=>{const u=o.getSnapshot();t.value=u.source,n.value=u.visible,s.value=u.done},r=o.subscribe(i);i();const l=H(()=>Math.max(0,t.value.length-n.value.length)),a=H(()=>l.value===0),c=H(()=>s.value&&a.value);return b1()&&_1(()=>{r(),o.destroy()}),{source:t,visible:n,done:s,final:c,caughtUp:a,pendingChars:l,enqueue:u=>o.enqueue(u),finish:u=>o.finish(u),flush:()=>o.flush(),reset:u=>o.reset(u),pause:()=>o.pause(),resume:()=>o.resume()}}const Cw=/auto|scroll|overlay/i;function rU(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return Cw.test(t)||Cw.test(n)}function lU(e){const t=Math.ceil(e.scrollHeight)>Math.ceil(e.clientHeight)+1,n=Math.ceil(e.scrollWidth)>Math.ceil(e.clientWidth)+1;return t||n}const aU=Je({name:"InfographicBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=H(()=>{var n,s;return jg((s=Kl(e.estimatedPreviewHeightPx))!=null?s:Ug(String((n=e.node.code)!=null?n:"")))});return()=>Zt("div",{class:"infographic-block-container rounded-lg border overflow-hidden",style:{margin:"var(--ms-flow-diagram-y) 0",background:"var(--diagram-bg)",borderColor:"var(--diagram-border)",color:"hsl(var(--ms-foreground))"},"data-markstream-infographic":"1","data-markstream-mode":"pending"},[e.showHeader?Zt("div",{class:"infographic-block-header flex justify-between items-center border-b",style:{padding:"var(--ms-inset-panel-y) var(--ms-inset-panel-x)",background:"var(--diagram-header-bg)",borderColor:"var(--diagram-border)",minHeight:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding) + var(--ms-inset-panel-y) + var(--ms-inset-panel-y) + 1px)"}},[Zt("div",{class:"flex items-center gap-x-2 overflow-hidden"},[Zt("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),Zt("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),Zt("div",{class:"infographic-header-actions flex items-center opacity-0 pointer-events-none",style:{gap:"var(--ms-gap-header-actions)"},"aria-hidden":"true"},Array.from({length:4},()=>Zt("span",{class:"infographic-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded",style:{width:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding))",height:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding))"}})))]):null,Zt("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[Zt("div",{class:"absolute inset-0"},[Zt("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}),cU=Je({name:"MermaidBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=H(()=>{var n,s;return qg((s=Kl(e.estimatedPreviewHeightPx))!=null?s:Wg(String((n=e.node.code)!=null?n:"")))});return()=>Zt("div",{class:"mermaid-block-container rounded-lg border overflow-hidden",style:{margin:"var(--ms-flow-diagram-y) 0",borderColor:"var(--diagram-border)"},"data-markstream-mermaid":"1","data-markstream-mode":"pending"},[e.showHeader?Zt("div",{class:"mermaid-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)]",style:{background:"var(--diagram-header-bg)",borderColor:"var(--diagram-border)"}},[Zt("div",{class:"flex items-center gap-x-2 overflow-hidden"},[Zt("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),Zt("div",{class:"mermaid-header-actions flex items-center gap-[var(--ms-gap-header-actions)] opacity-0 pointer-events-none","aria-hidden":"true"},Array.from({length:4},()=>Zt("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[Zt("span",{class:"action-icon block"})])))]):null,Zt("div",{class:"mermaid-preview-area relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[Zt("div",{class:"_mermaid w-full text-center flex items-center justify-center min-h-full",style:{fontFamily:"inherit",contentVisibility:"auto",contain:"content",containIntrinsicSize:"var(--ms-size-diagram-min-height) 240px"}})])])}}),uU=["data-custom-id"],dU={class:"m-0 p-0"},fU=["data-probe"],hU=["data-node-index","data-node-type"],s3=Jt(Je(Ct(tt({},{name:"NodeRenderer"}),{__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},mode:{},htmlPolicy:{},viewportPriority:{type:Boolean},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:{},codeBlockLightTheme:{},codeBlockMonacoOptions:{},codeRenderer:{},renderCodeBlocksAsPre:{type:Boolean,default:void 0},codeBlockMinWidth:{},codeBlockMaxWidth:{},codeBlockProps:{},mermaidProps:{},d2Props:{},infographicProps:{},showTooltips:{type:Boolean,default:void 0},themes:{},langs:{},isDark:{type:Boolean},customId:{},indexKey:{},typewriter:{type:Boolean,default:!1},smoothStreaming:{type:[Boolean,String],default:"auto"},smoothStreamingOptions:{},parseCoalesceMs:{},fade:{type:Boolean,default:void 0},batchRendering:{type:Boolean,default:void 0},initialRenderBatchSize:{},renderBatchSize:{},renderBatchDelay:{},renderBatchBudgetMs:{},renderBatchIdleTimeoutMs:{},deferNodesUntilVisible:{type:Boolean,default:void 0},maxLiveNodes:{},liveNodeBuffer:{},nodeVirtual:{type:[Boolean,String],default:void 0},virtualScroll:{},renderAsFragment:{type:Boolean}},emits:["copy","handleArtifactClick","click","mouseover","mouseout","virtual-state-change","height-change","render-settled","render-final","anchor-change"],setup(e,{expose:t,emit:n}){const s=e,o=n,i=cs(),r=Pt("markstreamNestedRendererProps",void 0);function l(T){var B,j;const z=s[T];return(function(Q){const fe=i?.vnode.props;return!!fe&&(Object.prototype.hasOwnProperty.call(fe,Q)||Object.prototype.hasOwnProperty.call(fe,String(Q).replace(/[A-Z]/g,ve=>`-${ve.toLowerCase()}`)))})(T)?z:(j=(B=r?.value)==null?void 0:B[T])!=null?j:z}const a={docs:{showTooltips:!0,fade:!0,batchRendering:!0,initialRenderBatchSize:40,renderBatchSize:80,renderBatchDelay:16,renderBatchBudgetMs:6,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:320,liveNodeBuffer:60,nodeVirtual:"auto"},chat:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:16,renderBatchSize:16,renderBatchDelay:8,renderBatchBudgetMs:4,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"},minimal:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:16,renderBatchSize:16,renderBatchDelay:8,renderBatchBudgetMs:4,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"}},c=H(()=>{return(T=l("mode"))==="chat"||T==="minimal"||T==="docs"?T:"docs";var T}),u=H(()=>{const T=l("renderCodeBlocksAsPre"),B=l("codeRenderer");return T===!0?"pre":B==="pre"||B==="shiki"||B==="monaco"?B:T===!1||c.value==="docs"?"monaco":"pre"}),d=H(()=>a[c.value]),h=H(()=>{var T;return(T=l("showTooltips"))!=null?T:d.value.showTooltips}),p=H(()=>{var T;return(T=l("fade"))!=null?T:d.value.fade}),f=H(()=>{var T;return(T=l("batchRendering"))!=null?T:d.value.batchRendering}),g=H(()=>{var T;return(T=l("initialRenderBatchSize"))!=null?T:d.value.initialRenderBatchSize}),w=H(()=>{var T;return(T=l("renderBatchSize"))!=null?T:d.value.renderBatchSize}),S=H(()=>{var T;return(T=l("renderBatchDelay"))!=null?T:d.value.renderBatchDelay}),y=H(()=>{var T;return(T=l("renderBatchBudgetMs"))!=null?T:d.value.renderBatchBudgetMs}),k=H(()=>{var T;return(T=l("renderBatchIdleTimeoutMs"))!=null?T:d.value.renderBatchIdleTimeoutMs}),v=H(()=>{var T;return(T=l("deferNodesUntilVisible"))!=null?T:d.value.deferNodesUntilVisible}),_=H(()=>{var T;return(T=l("maxLiveNodes"))!=null?T:d.value.maxLiveNodes}),I=H(()=>{var T;return(T=l("liveNodeBuffer"))!=null?T:d.value.liveNodeBuffer}),A=H(()=>{var T;return(T=l("nodeVirtual"))!=null?T:d.value.nodeVirtual}),b={get content(){return s.content},get nodes(){return s.nodes},get final(){return s.final},get parseOptions(){return l("parseOptions")},get customMarkdownIt(){return l("customMarkdownIt")},get debugPerformance(){return s.debugPerformance},get customHtmlTags(){return l("customHtmlTags")},get mode(){return l("mode")},get htmlPolicy(){return l("htmlPolicy")},get viewportPriority(){return l("viewportPriority")},get codeBlockStream(){return l("codeBlockStream")},get codeBlockDarkTheme(){return l("codeBlockDarkTheme")},get codeBlockLightTheme(){return l("codeBlockLightTheme")},get codeBlockMonacoOptions(){return l("codeBlockMonacoOptions")},get codeRenderer(){return l("codeRenderer")},get renderCodeBlocksAsPre(){return l("renderCodeBlocksAsPre")},get codeBlockMinWidth(){return l("codeBlockMinWidth")},get codeBlockMaxWidth(){return l("codeBlockMaxWidth")},get codeBlockProps(){return l("codeBlockProps")},get mermaidProps(){return l("mermaidProps")},get d2Props(){return l("d2Props")},get infographicProps(){return l("infographicProps")},get showTooltips(){return h.value},get themes(){return l("themes")},get langs(){return l("langs")},get isDark(){return l("isDark")},get customId(){return l("customId")},get indexKey(){return s.indexKey},get typewriter(){return l("typewriter")},get smoothStreaming(){return s.smoothStreaming},get smoothStreamingOptions(){return l("smoothStreamingOptions")},get parseCoalesceMs(){return l("parseCoalesceMs")},get fade(){return p.value},get batchRendering(){return f.value},get initialRenderBatchSize(){return g.value},get renderBatchSize(){return w.value},get renderBatchDelay(){return S.value},get renderBatchBudgetMs(){return y.value},get renderBatchIdleTimeoutMs(){return k.value},get deferNodesUntilVisible(){return v.value},get maxLiveNodes(){return _.value},get liveNodeBuffer(){return I.value},get nodeVirtual(){return A.value},get virtualScroll(){return s.virtualScroll},get renderAsFragment(){return s.renderAsFragment}};function M(T){o("height-change",T)}function N(T){o("virtual-state-change",T)}function D(T){o("anchor-change",T)}const $=se(),O=se(null),P=se(null),R=se(null),F=Js({1:null,2:null,3:null,4:null,5:null,6:null}),V=se(!1),K=new Map,Z=se(0),G=se(0),X=se({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function pe(){var T,B;if(((T=s.virtualScroll)==null?void 0:T.enabled)!==!0)return null;const j=(B=s.virtualScroll)==null?void 0:B.scrollRoot;return oe(typeof j=="function"?j():j)}function oe(T){return T?typeof HTMLElement<"u"&&T instanceof HTMLElement?T:typeof T=="object"&&"value"in T?oe(T.value):typeof T=="object"&&"$el"in T?oe(T.$el):null:null}const{isClient:ye,renderAsFragment:_e,debugPerformanceEnabled:de,resolvedShowTooltips:be,resolvedHtmlPolicy:xe,inheritedSmoothStreaming:Le,ownsTypewriterCursor:ee}=(function(T){const B=typeof window<"u",j=nu(),z=Pt("markstreamHtmlPolicy",void 0),Q=Pt("markstreamTypewriterCursor",void 0),fe=Pt("markstreamSmoothStreaming",void 0),ve=H(()=>T.renderAsFragment===!0),we=H(()=>!!(T.debugPerformance&&B&&typeof console<"u")),Oe=H(()=>{var De;if(typeof T.showTooltips=="boolean")return T.showTooltips;const Ae=(De=j.showTooltips)!=null?De:j["show-tooltips"];return Ae===""||Ae===!0||Ae==="true"||Ae!==!1&&Ae!=="false"&&void 0}),Me=H(()=>{var De,Ae;return(Ae=(De=T.htmlPolicy)!=null?De:z?.value)!=null?Ae:"safe"}),Fe=H(()=>Q?.value!==!0);return{isClient:B,renderAsFragment:ve,debugPerformanceEnabled:we,resolvedShowTooltips:Oe,resolvedHtmlPolicy:Me,inheritedSmoothStreaming:fe,inheritedTypewriterCursor:Q,ownsTypewriterCursor:Fe}})(b),{resolveViewportRoot:ke,resolveScrollContainer:ge,isReverseFlexScrollRoot:W,getNormalizedScrollTop:J,getOffsetTopWithinRoot:ue}=(function(T,B){function j(){var we,Oe;return(Oe=(we=B.scrollRoot)==null?void 0:we.call(B))!=null?Oe:null}function z(we){if(typeof window>"u")return null;const Oe=j();if(Oe)return Oe;const Me=we??T.value;if(!Me)return null;const Fe=Me.ownerDocument||document,De=Fe.scrollingElement||Fe.documentElement;let Ae=Me;for(;Ae&&Ae!==Fe.body&&Ae!==De;){if(rU(window.getComputedStyle(Ae))&&lU(Ae))return Ae;Ae=Ae.parentElement}return null}function Q(we){if(!B.isClient)return!1;try{const Oe=window.getComputedStyle(we);return!!(Oe.display||"").toLowerCase().includes("flex")&&(Oe.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function fe(we,Oe,Me){var Fe,De;if(Me)return ve(Oe);const Ae=we.scrollTop;if(!Q(we))return Ae;const Be=Ae<0?-Ae:Ae;return Math.max(0,((Fe=we.scrollHeight)!=null?Fe:0)-((De=we.clientHeight)!=null?De:0))-Be}function ve(we){var Oe,Me,Fe,De,Ae;const Be=Number((Oe=we.scrollingElement)==null?void 0:Oe.scrollTop),ze=Number((Fe=(Me=we.documentElement)==null?void 0:Me.scrollTop)!=null?Fe:0),Ve=Number((Ae=(De=we.body)==null?void 0:De.scrollTop)!=null?Ae:0);return Math.max(0,Number.isFinite(Be)?Be:0,Number.isFinite(ze)?ze:0,Number.isFinite(Ve)?Ve:0)}return{resolveViewportRoot:z,resolveScrollContainer:function(we){var Oe,Me,Fe,De;const Ae=j();if(Ae)return Ae;const Be=z((Oe=we??T.value)!=null?Oe:null);if(Be)return Be;const ze=(De=(Fe=we?.ownerDocument)!=null?Fe:(Me=T.value)==null?void 0:Me.ownerDocument)!=null?De:typeof document<"u"?document:null;return ze?.scrollingElement||ze?.documentElement||null},isReverseFlexScrollRoot:Q,getNormalizedScrollTop:fe,getOffsetTopWithinRoot:function(we,Oe){const Me=Oe.ownerDocument||we.ownerDocument||document;if((function(Be,ze){return Be===ze.documentElement||Be===ze.body||Be===ze.scrollingElement})(Oe,Me))return we.getBoundingClientRect().top+ve(Me);const Fe=Oe.getBoundingClientRect(),De=we.getBoundingClientRect(),Ae=fe(Oe,Me,!1);return De.top-Fe.top+Ae}}})($,{isClient:ye,scrollRoot:pe});gn("markstreamShowTooltips",be),gn("markstreamHtmlPolicy",xe),gn("markstreamTypewriter",H(()=>b.typewriter!==!1)),gn("markstreamFade",H(()=>b.fade!==!1)),gn("markstreamTypewriterCursor",H(()=>!0)),gn("markstreamTextStreamState",K),gn("markstreamStreamVersion",Z),gn("markstreamParseOptions",H(()=>b.parseOptions)),gn("markstreamCustomMarkdownIt",H(()=>b.customMarkdownIt));const{smoothStreamingEnabled:ie,renderContent:ae,effectiveFinal:U}=(function(T,B){const j=iU(T.smoothStreamingOptions),z=H(()=>{var Me,Fe,De;return T.smoothStreaming!==!1&&!((Me=T.nodes)!=null&&Me.length)&&(T.smoothStreaming===!0||!((Fe=B.inheritedSmoothStreaming)!=null&&Fe.value))&&(T.smoothStreaming===!0||T.typewriter===!0||((De=T.maxLiveNodes)!=null?De:0)<=0)}),Q=se(!B.isClient||T.smoothStreaming===!0);tn(()=>{Q.value=!0});const fe=H(()=>Q.value&&z.value),ve=H(()=>{var Me;return fe.value?j.visible.value:(Me=T.content)!=null?Me:""}),we=H(()=>{var Me,Fe;const De=(Me=T.parseOptions)!=null?Me:{};return(Fe=T.final)!=null?Fe:De.final}),Oe=H(()=>{const Me=we.value;return fe.value&&Me!=null?!!Me&&j.caughtUp.value:Me});return Ge([()=>T.content,()=>T.nodes,fe,we],([Me,Fe,De,Ae])=>{if(Fe?.length)return void j.reset("");const Be=Me??"";if(!De)return j.reset(Be),void(Ae&&j.finish({flush:!0}));const ze=j.source.value;Be?Be===ze||(Be.startsWith(ze)?j.enqueue(Be.slice(ze.length)):j.reset(Be)):j.reset(""),Ae&&j.finish()},{immediate:!0}),{smoothStream:j,smoothStreamingEligible:z,smoothStreamingEnabled:fe,renderContent:ve,requestedFinal:we,effectiveFinal:Oe}})(b,{isClient:ye,inheritedSmoothStreaming:Le});gn("markstreamSmoothStreaming",ie);const Y=se(!1);let ce="",me=!1,Se=null;function Ee(){ye&&Se!=null&&(window.clearTimeout(Se),Se=null)}function re(){Y.value=!1,Ee()}function Te(T,B){if(!de.value)return;const j=(function(){if(!de.value)return null;const z=Pe(Ue),Q=Pe(nt),fe=Math.max(Re,Q);if(z<=0&&fe<=0)return null;const ve={total:z,maxPerFrame:fe,byLabel:(we=Ue,Object.fromEntries(Array.from(we.entries()).sort((Oe,Me)=>Me[1]-Oe[1]||Oe[0].localeCompare(Me[0]))))};var we;return Ue.clear(),nt.clear(),Re=0,ve})();console.info(`[markstream-vue][perf] ${T}`,j?Ct(tt({},B),{layoutReads:j}):B)}Ge([ae,()=>s.nodes,U],([T,B,j])=>{const z=T??"";return B?.length||j===!0?(re(),ce=z,void(me=!0)):me?(ce&&z.length>ce.length&&z.startsWith(ce)?(Y.value=!0,ye&&(Ee(),Se=window.setTimeout(()=>{var Q;Se=null,U.value===!0||(Q=s.nodes)!=null&&Q.length||(Sl(),Y.value=!1,hi())},1200))):(z.length<ce.length||!z.startsWith(ce))&&re(),void(ce=z)):(ce=z,void(me=!0))},{flush:"sync",immediate:!0});const Ue=new Map,nt=new Map;let ct=!1,Re=0;function Pe(T){let B=0;for(const j of T.values())B+=j;return B}function st(){Re=Math.max(Re,Pe(nt)),nt.clear(),ct=!1}function et(T,B){return(function(j){var z,Q;de.value&&(Ue.set(j,((z=Ue.get(j))!=null?z:0)+1),nt.set(j,((Q=nt.get(j))!=null?Q:0)+1),ct||(ct=!0,ye&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(st):typeof queueMicrotask!="function"?setTimeout(st,0):queueMicrotask(st)))})(T),B()}const mt=b.customId?`renderer-${b.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,dn=(function(T){const B=new Map;return{scope:T,cache:B,clear:()=>B.clear()}})(mt),wn=H(()=>`${mt}:${Z.value}`);gn(XT,dn);const xt=Fn(()=>b.customId),{effectiveCustomHtmlTagsSet:ln,mergedParseOptions:Sn,parsedNodes:Xe}=sU(b,{instanceMsgId:mt,renderContent:ae,effectiveFinal:U,smoothStreamingEnabled:ie,debugPerformanceEnabled:de,customComponentsMap:xt,logPerf:Te});Ge(Xe,()=>{dn.clear(),Z.value+=1},{immediate:!0});const Ln=H(()=>({customId:b.customId,customHtmlTags:Sn.value.customHtmlTags,parseOptions:b.parseOptions,customMarkdownIt:b.customMarkdownIt,htmlPolicy:xe.value,viewportPriority:b.viewportPriority,mode:c.value,codeRenderer:u.value,codeBlockStream:b.codeBlockStream,codeBlockDarkTheme:b.codeBlockDarkTheme,codeBlockLightTheme:b.codeBlockLightTheme,codeBlockMonacoOptions:b.codeBlockMonacoOptions,renderCodeBlocksAsPre:b.renderCodeBlocksAsPre,codeBlockMinWidth:b.codeBlockMinWidth,codeBlockMaxWidth:b.codeBlockMaxWidth,codeBlockProps:b.codeBlockProps,mermaidProps:b.mermaidProps,d2Props:b.d2Props,infographicProps:b.infographicProps,showTooltips:be.value,themes:b.themes,langs:b.langs,isDark:b.isDark,typewriter:b.typewriter,smoothStreamingOptions:b.smoothStreamingOptions,parseCoalesceMs:b.parseCoalesceMs,fade:b.fade}));gn("markstreamNestedRendererProps",Ln);const es=H(()=>Xe.value),$s=H(()=>Xe.value.length),Cn=se(null),fn=se(null),Hn=se(null),Wn=se(null),Yn=s.indexKey!=null&&String(s.indexKey).startsWith("list-item-"),ks=!Yn&&b.customId?fw(b.customId):null,Un=H(()=>ks?(dw.value,fw(b.customId)):null),bs=H(()=>{var T;return!!(ye&&!_e.value&&b.customId&&!Yn&&((T=Un.value)!=null&&T.enabled))}),Ye=H(()=>{var T;return!!(!_e.value&&((T=s.virtualScroll)!=null&&T.enabled))}),je=se(!1);tn(()=>{je.value=!0});const qe=H(()=>!!(ye&&Ye.value));gn("markstreamHostScrollManaged",qe);const Tt=H(()=>!!(je.value&&qe.value)),on=H(()=>bs.value||qe.value),ao=H(()=>bs.value||Tt.value),Lo=H(()=>{var T;return on.value&&((T=Un.value)==null?void 0:T.textEstimation)!==!1}),Er=H(()=>{var T;return on.value&&((T=Un.value)==null?void 0:T.codeBlockEstimation)!==!1});function Oo(){const T=G.value||et("getMeasuredContainerWidth.clientWidth",()=>{var B;return((B=$.value)==null?void 0:B.clientWidth)||0});return Number.isFinite(T)&&T>0?T:0}const ci=H(()=>{const T=Oo();return T>0?Math.max(1,Math.round(T)):640}),$e=H(()=>{var T;return Math.max(1,(T=b.maxLiveNodes)!=null?T:320)}),he=H(()=>{var T;return!_e.value&&b.nodeVirtual!==!1&&!(((T=b.maxLiveNodes)!=null?T:0)<=0)&&(b.nodeVirtual===!0?Xe.value.length>0:Xe.value.length>$e.value)}),We=H(()=>he.value||bs.value||qe.value),jt=H(()=>b.viewportPriority!==!1&&!V.value),Gt=zH(T=>{var B;return ke((B=T??$.value)!=null?B:null)},jt),{requestFrame:It,cancelFrame:Nt,hasIdleCallback:co,isTestEnv:uo}=(function(T){const B=T.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,j=T.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,z=T.isClient&&typeof window.requestIdleCallback=="function",Q=(function(){var fe;if(typeof globalThis>"u"||!("process"in globalThis))return;const ve=(fe=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:fe.value;return ve?.env})();return{requestFrame:B,cancelFrame:j,hasIdleCallback:z,isTestEnv:Q?.NODE_ENV==="test"}})({isClient:ye}),{resolvedBatchSize:ui,resolvedInitialBatch:fo,batchingEnabled:Bi,incrementalRenderingActive:ne,renderedCount:q,previousRenderContext:te,adaptiveBatchSize:He,previousBatchConfig:lt}=(function(T,B){var j;const z=H(()=>{var De;const Ae=Math.trunc((De=T.renderBatchSize)!=null?De:80);return Number.isFinite(Ae)?Math.max(0,Ae):0}),Q=H(()=>{var De;const Ae=Math.trunc((De=T.initialRenderBatchSize)!=null?De:z.value);return Number.isFinite(Ae)?Math.max(0,Ae):z.value}),fe=H(()=>!B.renderAsFragment.value&&T.batchRendering!==!1&&z.value>0&&B.isClient&&!B.isTestEnv),ve=se(0),we=se({key:T.indexKey,total:0}),Oe=se(Math.max(1,z.value||1)),Me=H(()=>{var De;return fe.value&&((De=T.maxLiveNodes)!=null?De:0)<=0}),Fe=se({batchSize:z.value,initial:Q.value,delay:(j=T.renderBatchDelay)!=null?j:16,enabled:Me.value});return{resolvedBatchSize:z,resolvedInitialBatch:Q,batchingEnabled:fe,incrementalRenderingActive:Me,renderedCount:ve,previousRenderContext:we,adaptiveBatchSize:Oe,previousBatchConfig:Fe}})(b,{isClient:ye,isTestEnv:uo,renderAsFragment:_e}),it=new Map,Rt=new Map,ts=new WeakMap;let pn=null;const ho=new WeakMap,Dt=new Map,an=se(0),qn=H(()=>(an.value,Array.from(it.entries()).sort((T,B)=>T[0]-B[0]))),Po=se(null),jn=se(null);let js=null,Fi=0,zo=null;const{activeRestoreAnchor:Hi,getRelativeScrollTopWithinContainer:aM,setRelativeScrollTopWithinContainer:cM,resolveAnchorOffset:uM,clearRestoreReconcile:hu,scheduleRestoreReconcile:Ta,captureRestoreAnchor:Yv,restoreAnchor:Xv,getAnchorDrift:dM}=(function(T){const{isClient:B,containerRef:j,parsedNodeCount:z,requestFrame:Q,cancelFrame:fe,resolveScrollContainer:ve,getNormalizedScrollTop:we,getOffsetTopWithinRoot:Oe,isReverseFlexScrollRoot:Me,estimateIndexForOffset:Fe,estimateHeightRange:De,getFallbackNodeHeight:Ae,clamp:Be}=T,ze=se(null);let Ve=null,ht=[];function ot(){const kt=ve(),At=j.value;if(!kt||!At)return null;const Mt=kt.ownerDocument||At.ownerDocument||document;if(kt===Mt.documentElement||kt===Mt.body||kt===Mt.scrollingElement){const Yt=At.getBoundingClientRect();return Math.max(0,-Yt.top)}return Math.max(0,we(kt,Mt,!1)-Oe(At,kt))}function rt(kt){var At;const Mt=ve(),Yt=j.value;if(!Mt||!Yt)return;const Gs=Math.max(0,kt),_s=Mt.ownerDocument||Yt.ownerDocument||document,Ro=_s.defaultView||(typeof window<"u"?window:null);if(Mt===_s.documentElement||Mt===_s.body||Mt===_s.scrollingElement){const Vi=we(Mt,_s,!0)+Yt.getBoundingClientRect().top;return void((At=Ro?.scrollTo)==null||At.call(Ro,0,Math.max(0,Vi+Gs)))}mw(Mt,_s,Oe(Yt,Mt)+Gs,{isReverseFlexScrollRoot:Vi=>{var Ki;return(Ki=Me?.(Vi))!=null&&Ki},getNormalizedScrollTop:we})}function gt(kt){const At=z.value,Mt=Be(kt.nodeIndex,0,Math.max(0,At-1));return De(0,Mt)+Math.max(0,kt.offsetWithinNodePx)}function pt(){if(Ve!=null&&(fe?.(Ve),Ve=null),B)for(const kt of ht)window.clearTimeout(kt);ht=[]}function Wt(kt){const At=gt(kt),Mt=ot();Mt!=null&&Math.abs(Mt-At)<=.5||rt(At)}return{activeRestoreAnchor:ze,getRelativeScrollTopWithinContainer:ot,setRelativeScrollTopWithinContainer:rt,resolveAnchorOffset:gt,clearRestoreReconcile:pt,applyRestoreAnchor:Wt,scheduleRestoreReconcile:function(){ze.value&&B&&Ve==null&&(Ve=Q?Q(()=>{Ve=null,ze.value&&Wt(ze.value)}):null,Ve==null&&ze.value&&Wt(ze.value))},captureRestoreAnchor:function(){const kt=ot(),At=z.value;if(kt==null||At<=0)return null;const Mt=Be(Fe(kt+1),0,At-1),Yt=De(0,Mt),Gs=Ae(Mt);return{nodeIndex:Mt,offsetWithinNodePx:Be(kt-Yt,0,Math.max(0,Gs-1))}},restoreAnchor:function(kt){const At=z.value;if(ze.value={nodeIndex:Be(kt.nodeIndex,0,Math.max(0,At-1)),offsetWithinNodePx:Math.max(0,kt.offsetWithinNodePx)},pt(),Wt(ze.value),B)for(const Mt of[0,120,280,480])ht.push(window.setTimeout(()=>{ze.value&&Wt(ze.value)},Mt))},getAnchorDrift:function(kt){const At=ot();return At==null?null:At-gt(kt)}}})({isClient:ye,containerRef:$,parsedNodeCount:$s,requestFrame:It,cancelFrame:Nt,resolveScrollContainer:()=>Po.value||ge(),getNormalizedScrollTop:J,getOffsetTopWithinRoot:ue,isReverseFlexScrollRoot:W,estimateIndexForOffset:wp,estimateHeightRange:zi,getFallbackNodeHeight:Su,clamp:ss}),{nodeHeights:po,heightStats:mo,heightTreeSize:Ma,heightSumTree:Bh,heightKnownTree:Fh,averageNodeHeight:Vo,resetHeightMeasurements:fM,pruneHeightMeasurements:hM,rebuildHeightTrees:pu,recordNodeHeight:pM,removeNodeHeights:mM,exportHeightCache:gM,importHeightCache:vM,fenwickRangeSum:mu}=(function(T={}){const B=Js({}),j=Js({total:0,count:0}),z=se(0),Q=se([]),fe=se([]);function ve(){for(const Ae of Object.keys(B))delete B[Number(Ae)];j.total=0,j.count=0,z.value=0,Q.value=[],fe.value=[]}function we(Ae,Be,ze){for(let Ve=Be+1;Ve<Ae.length;Ve+=Ve&-Ve)Ae[Ve]+=ze}function Oe(Ae,Be){let ze=0;for(let Ve=Be+1;Ve>0;Ve-=Ve&-Ve)ze+=Ae[Ve];return ze}function Me(Ae){z.value=Ae;const Be=new Array(Ae+1).fill(0),ze=new Array(Ae+1).fill(0);for(const[Ve,ht]of Object.entries(B)){const ot=Number(Ve),rt=Number(ht);!Number.isFinite(ot)||ot<0||ot>=Ae||!Number.isFinite(rt)||rt<=0||(we(Be,ot,rt),we(ze,ot,1))}Q.value=Be,fe.value=ze}function Fe(Ae){if(!Number.isInteger(Ae)||Ae<0)return!1;const Be=B[Ae];if(!Number.isFinite(Be)||Be<=0)return!1;if(delete B[Ae],j.total=Math.max(0,j.total-Be),j.count=Math.max(0,j.count-1),z.value>Ae){const ze=Q.value,Ve=fe.value;ze.length&&Ve.length&&(we(ze,Ae,-Be),we(Ve,Ae,-1))}return!0}const De=H(()=>j.count>0?Math.max(12,j.total/j.count):32);return{nodeHeights:B,heightStats:j,heightTreeSize:z,heightSumTree:Q,heightKnownTree:fe,averageNodeHeight:De,resetHeightMeasurements:ve,pruneHeightMeasurements:function(Ae){if(Ae<=0)return void ve();let Be=0,ze=0;for(const[Ve,ht]of Object.entries(B)){const ot=Number(Ve),rt=Number(ht);!Number.isFinite(ot)||ot<0||ot>=Ae||!Number.isFinite(rt)||rt<=0?delete B[ot]:(Be+=rt,ze++)}j.total=Be,j.count=ze},rebuildHeightTrees:Me,recordNodeHeight:function(Ae,Be,ze={}){(function(Ve,ht,ot={}){var rt;if(!Number.isFinite(ht)||ht<=0)return!1;const gt=B[Ve];if(gt&&(ot.allowShrink===!1&&ht<gt||Math.abs(ht-gt)<=1))return!1;if(B[Ve]=ht,gt?j.total+=ht-gt:(j.total+=ht,j.count++),z.value>Ve){const pt=Q.value,Wt=fe.value;if(pt.length&&Wt.length)if(gt){const kt=ht-gt;kt!==0&&we(pt,Ve,kt)}else we(pt,Ve,ht),we(Wt,Ve,1)}ot.notify!==!1&&((rt=T.onHeightRecorded)==null||rt.call(T))})(Ae,Be,Ct(tt({},ze),{notify:!0}))},removeNodeHeight:function(Ae,Be={}){var ze;const Ve=Fe(Ae);return Ve&&Be.notify!==!1&&((ze=T.onHeightRecorded)==null||ze.call(T)),Ve},removeNodeHeights:function(Ae,Be={}){var ze;let Ve=0;for(const ht of Ae)Fe(Number(ht))&&Ve++;return Ve>0&&Be.notify!==!1&&((ze=T.onHeightRecorded)==null||ze.call(T)),Ve},exportHeightCache:function(){return Object.entries(B).map(([Ae,Be])=>({index:Number(Ae),height:Number(Be)})).filter(Ae=>Number.isFinite(Ae.index)&&Ae.index>=0&&Number.isFinite(Ae.height)&&Ae.height>0).sort((Ae,Be)=>Ae.index-Be.index)},importHeightCache:function(Ae,Be={}){var ze;if(!Array.isArray(Ae))return;const Ve=z.value;let ht=!1;if(Be.mode!=="merge"){const ot=Object.keys(B);if(ot.length>0){for(const rt of ot)delete B[Number(rt)];ht=!0}}for(const ot of Ae){const rt=Number(ot.index),gt=Number(ot.height);if(!Number.isInteger(rt)||rt<0||Ve>0&&rt>=Ve||!Number.isFinite(gt)||gt<=0)continue;const pt=B[rt];pt&&Math.abs(pt-gt)<=1||(B[rt]=gt,ht=!0)}ht&&((function(){let ot=0,rt=0;const gt=z.value;for(const[pt,Wt]of Object.entries(B)){const kt=Number(pt),At=Number(Wt);!Number.isFinite(kt)||kt<0||gt>0&&kt>=gt||!Number.isFinite(At)||At<=0?delete B[kt]:(ot+=At,rt++)}j.total=ot,j.count=rt})(),Ve>0&&Me(Ve),(ze=T.onHeightRecorded)==null||ze.call(T))},fenwickRangeSum:function(Ae,Be,ze){if(ze<=Be)return 0;const Ve=Oe(Ae,ze-1);return Be<=0?Ve:Ve-Oe(Ae,Be-1)}}})({onHeightRecorded:()=>{vo(),qe.value&&qa(),Hi.value&&Ta(),jn.value&&bl(),cn("node-resize")}});function gu(){fM(),Dt.clear()}function Zv(T){!Number.isInteger(T)||T<0||T>=Xe.value.length||Dt.set(T,Na(T))}function Jv(T,B,j={}){const z=po[T];pM(T,B,j);const Q=po[T];Q&&Q>0?Zv(T):z&&Dt.delete(T)}function Qv(T,B){const j=et("getNodeLayoutHeight.slot.offsetHeight",()=>{var z,Q;return(Q=(z=it.get(T))==null?void 0:z.offsetHeight)!=null?Q:0});return j>0?j:et("getNodeLayoutHeight.content.offsetHeight",()=>B.offsetHeight)}function e0(T,B={}){vM(T,B),hp()}const Wi=H(()=>{var T;return!_e.value&&b.deferNodesUntilVisible!==!1&&!(((T=b.maxLiveNodes)!=null?T:0)<=0)&&!he.value&&!(Xe.value.length>900)&&jt.value}),t0=H(()=>!!Gt&&(Wi.value||he.value)),n0=H(()=>he.value||qe.value),{liveNodeBufferResolved:Aa,focusIndex:go,liveRange:ns,updateLiveRange:Ir}=(function(T,B){const{parsedNodeCount:j,virtualizationEnabled:z,maxLiveNodesResolved:Q,clamp:fe}=B,ve=H(()=>{var Me;return Math.max(0,(Me=T.liveNodeBuffer)!=null?Me:60)}),we=se(0),Oe=Js({start:0,end:0});return{liveNodeBufferResolved:ve,focusIndex:we,liveRange:Oe,updateLiveRange:function(){const Me=j.value;if(!z.value||Me===0)return Oe.start=0,void(Oe.end=Me);const Fe=Math.min(Q.value,Me),De=ve.value,Ae=fe(we.value-De,0,Math.max(0,Me-Fe));Oe.start=Ae,Oe.end=Math.min(Me,Ae+Fe)}}})(b,{parsedNodeCount:$s,virtualizationEnabled:he,maxLiveNodesResolved:$e,clamp:ss}),Ko=new Map,$r=new Map,Ui=new Map,vu=[],di=new Map,qi=new Set,s0=se(0);let Hh=!1;const o0=H(()=>(s0.value,qi.size)),zs=new Map,Go=new Map,i0=se(0),Wh=H(()=>{i0.value;let T=0;for(const B of zs.values())T+=Math.max(0,B);return T});let Vs=null,Uh=!0,r0=[0],l0="";function vo(){Uh=!0}const yu=H(()=>{if(!he.value)return Xe.value.length;const T=Aa.value,B=Math.max(ns.end+T,fo.value),j=Math.min(Xe.value.length,B);return Math.max(q.value,j)});function ku(){Hh||(Hh=!0,queueMicrotask(()=>{Hh=!1,s0.value+=1}))}function a0(T,B,j="node-resize"){if(!ye||typeof window>"u")return null;const z=window.setTimeout(()=>{qi.delete(z)&&ku();try{B()}finally{cn(j)}},Math.max(0,T));return qi.add(z),ku(),z}function bu(T){ye&&T!=null&&(qi.delete(T)&&ku(),window.clearTimeout(T))}function c0(){if(ye&&typeof window<"u")for(const T of qi)window.clearTimeout(T);qi.size&&(qi.clear(),ku()),vu.length=0,Ui.clear()}function yM(T){var B,j;return(j=(B=Wn.value)==null?void 0:B[T])!=null?j:null}const{cancelScheduledFocusSync:qh,scheduleFocusSync:Yo}=(function(T){const{isClient:B,containerRef:j,virtualizationEnabled:z,requestFrame:Q,cancelFrame:fe,syncFocusToScroll:ve}=T;let we=null;function Oe(){var Fe,De,Ae;return(Ae=(De=(Fe=j.value)==null?void 0:Fe.ownerDocument)==null?void 0:De.defaultView)!=null?Ae:typeof window<"u"?window:null}function Me(){if(!we)return;const Fe=Oe();we.viaTimeout?Fe?Fe.clearTimeout(we.id):clearTimeout(we.id):fe?.(we.id),we=null}return{cancelScheduledFocusSync:Me,scheduleFocusSync:function(Fe={}){if(!z.value)return;if(!B)return void ve(!0);if(Fe.immediate)return Me(),void ve(!0);if(we)return;const De=()=>{we=null,ve()};if(Q)return void(we={id:Q(De),viaTimeout:!1});const Ae=Oe();we={id:Ae?Ae.setTimeout(De,16):setTimeout(De,16),viaTimeout:!0}}}})({isClient:ye,containerRef:$,virtualizationEnabled:he,requestFrame:It,cancelFrame:Nt,syncFocusToScroll:function(T=!1){var B;if(!he.value)return;const j=Po.value||ge();if(!j)return;const z=j.ownerDocument||((B=$.value)==null?void 0:B.ownerDocument)||document,Q=z?.defaultView||(typeof window<"u"?window:null),fe=j===z?.documentElement||j===z?.body,ve=Xe.value.length;if(!fe&&ve>0&&W(j)){const ze=et("syncFocusToScroll.clientHeight",()=>j.clientHeight||0),Ve=et("syncFocusToScroll.scrollTop",()=>j.scrollTop),ht=Ve<0?-Ve:Ve,ot=(function(gt){var pt,Wt;const kt=Xe.value;if(!kt.length)return 0;if(gt<=0)return Math.max(0,kt.length-1);if(on.value){const Mt=(pt=Gh()[kt.length])!=null?pt:0;return v0(Math.max(0,Mt-gt))}if(Ma.value===kt.length){const Mt=zi(0,kt.length);return wp(Math.max(0,Mt-gt))}let At=gt;for(let Mt=kt.length-1;Mt>=0;Mt--){const Yt=(Wt=po[Mt])!=null?Wt:Vo.value;if(At<=Yt)return Mt;At-=Yt}return 0})(Math.max(0,ht)+.5*Math.max(0,ze)),rt=ss(ot,0,Math.max(0,ve-1));return void((T||Math.abs(rt-go.value)>1)&&(go.value=rt,Ir()))}const we=fe?null:et("syncFocusToScroll.root.getBoundingClientRect",()=>j.getBoundingClientRect()),Oe=fe?0:we.top,Me=fe?et("syncFocusToScroll.viewport.clientHeight",()=>{var ze,Ve;return(Ve=(ze=Q?.innerHeight)!=null?ze:j.clientHeight)!=null?Ve:0}):we.bottom,Fe=qn.value;let De=null,Ae=null;for(const[ze,Ve]of Fe){if(!Ve)continue;const ht=et("syncFocusToScroll.slot.getBoundingClientRect",()=>Ve.getBoundingClientRect());ht.bottom<=Oe||ht.top>=Me||(De==null&&(De=ze),Ae=ze)}if(De==null||Ae==null){const ze=$.value;if(!ze)return;const Ve=fe?{top:0}:et("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>j.getBoundingClientRect()),ht=et("syncFocusToScroll.fallback.scrollTop",()=>J(j,z,fe)),ot=fe?(()=>{const pt=et("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>ze.getBoundingClientRect()),Wt=(fe?0:Ve.top)-pt.top;return Math.max(0,Wt)})():(()=>{const pt=ue(ze,j);return Math.max(0,ht-pt)})(),rt=fe?et("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var pt,Wt,kt,At;return(At=(kt=(Wt=Q?.innerHeight)!=null?Wt:(pt=z?.documentElement)==null?void 0:pt.clientHeight)!=null?kt:j.clientHeight)!=null?At:0}):et("syncFocusToScroll.fallback.root.clientHeight",()=>j.clientHeight),gt=wp(ot+.5*Math.max(0,rt));return go.value=ss(gt,0,Math.max(0,Xe.value.length-1)),void Ir()}const Be=Math.round((De+Ae)/2);!T&&Math.abs(Be-go.value)<=1||(go.value=ss(Be,0,Math.max(0,Xe.value.length-1)),Ir())}}),{visibleNodeIndices:jh,nodeVisibilityHandles:hl,nodeVisibilityWatchStops:_u,nodeVisibilityFallbackTimers:u0,clearVisibilityFallback:wu,markNodeVisible:ji,cleanupNodeVisibility:kM,destroyNodeVisibilityState:zh}=oU({isClient:ye,shouldTrackVisibleNodeIndices:()=>Wi.value,shouldCleanupNodeVisibility:()=>he.value,onNodeMarkedVisible:T=>{he.value?Yo():go.value=ss(T,0,Math.max(0,Xe.value.length-1))},onNodeVisibilityCleaned:T=>{it.delete(T)&&F0()}}),{cleanupScrollListener:d0,setupScrollListener:bM}=(function(T){const{isClient:B,virtualizationEnabled:j,listenerEnabled:z,scrollRootElement:Q,resolveScrollContainer:fe,scheduleFocusSync:ve,onScroll:we}=T;let Oe=null,Me=null;function Fe(){Oe&&(Oe(),Oe=null),Me=null,Q.value=null}function De(Ae){const Be=T.getScrollTop?T.getScrollTop(Ae):Ae.scrollTop;return Math.max(0,Number.isFinite(Be)?Math.abs(Be):0)}return{cleanupScrollListener:Fe,setupScrollListener:function(){if(!B)return;if(!((Ae=z?.value)!=null?Ae:j.value))return void Fe();var Ae;const Be=fe();if(!Be)return void Fe();if(Q.value===Be&&Oe)return;Fe(),Me=De(Be);const ze=()=>{if(we?.(),j.value){const Ve=(function(ht){const ot=De(ht),rt=Me;Me=ot;const gt=Math.max(480,.75*(ht.clientHeight||0));return rt==null?ot>gt?{immediate:!0}:void 0:Math.abs(ot-rt)>gt?{immediate:!0}:void 0})(Be);Ve?ve(Ve):ve()}};Be.addEventListener("scroll",ze,{passive:!0}),Q.value=Be,Oe=()=>{Be.removeEventListener("scroll",ze)}}}})({isClient:ye,virtualizationEnabled:he,listenerEnabled:n0,scrollRootElement:Po,resolveScrollContainer:ge,scheduleFocusSync:Yo,onScroll:function(){const T=jn.value;if(!T)return;const B=$a();if(!B||(function(z){if(Da()>=Fi)return zo=null,!1;const Q=zo;if(Q==null)return!0;const fe=Math.abs(z.scrollTop-Q)<=2;return fe||(zo=null),fe})(B))return;const j=T0(B);j!=null?(j<-32||Math.abs(Math.max(0,j)-Math.max(0,T.distanceFromBottomPx))>32)&&kl("restore"):kl("restore")},getScrollTop:T=>{var B;const j=T.ownerDocument||((B=$.value)==null?void 0:B.ownerDocument)||document,z=T===j.documentElement||T===j.body||T===j.scrollingElement;return et("scrollListener.getScrollTop",()=>J(T,j,z))}});function ss(T,B,j){return Math.min(Math.max(T,B),j)}function Vh(T){return T?.firstElementChild}function f0(T,B){var j;return T?(j=T.matches)!=null&&j.call(T,B)?T:T.querySelector(B):null}function h0(){if(!on.value)return void(G.value=0);const T=et("updateExperimentContainerWidth.clientWidth",()=>{var B,j;return(j=(B=$.value)==null?void 0:B.clientWidth)!=null?j:0});G.value=T>0?T:0}let Ea=null;function Kh(){Ea?.disconnect(),Ea=null}const p0=oi({loader:()=>yn(null,null,function*(){return(yield Qs(()=>import("./index8-Bqtk0wsj.js"),__vite__mapDeps([5,4]))).default}),loadingComponent:qT,delay:0,suspensible:!1});function m0(T){return T===p0}const g0=H(()=>u.value==="pre"?Xs:u.value==="shiki"?p0:xm),Nr=H(()=>{const T=Xe.value;if(!T.length||!on.value)return T.map(()=>null);const B=G.value||et("estimatedNodeHeights.clientWidth",()=>{var j;return((j=$.value)==null?void 0:j.clientWidth)||0});return!Number.isFinite(B)||B<=0?T.map(()=>null):T.map((j,z)=>{const Q=po[z],fe=typeof Q=="number"&&Q>0;if(Lo.value&&!fe){const we=YT(j,B,X.value);if(we)return we}if(Er.value&&j.type==="code_block"){const we=(function(Oe){if(Oe.type!=="code_block")return null;const Me=J0(Oe,Iu(Oe));return m0(Me)?"markdown":Me===Xs?"pre":Me===g0.value||Me===xm?"monaco":null})(j);if(we==="monaco"||we==="markdown"||we==="pre")return qW(j,{rendererKind:we,monacoOptions:b.codeBlockMonacoOptions,showHeader:((ve=b.codeBlockProps)==null?void 0:ve.showHeader)!==!1})}var ve;return null})});function Su(T){var B;const j=po[T];if(Number.isFinite(j)&&j>0)return j;const z=(B=Nr.value[T])==null?void 0:B.height;return Number.isFinite(z)&&z>0?z:Math.max(Vo.value,(function(Q){var fe,ve,we,Oe,Me,Fe,De,Ae,Be,ze,Ve,ht,ot;const rt=Xe.value[Q];if(!rt||typeof rt!="object")return 32;const gt=String((fe=rt.type)!=null?fe:""),pt=Oo()||640;switch(gt){case"heading":return 44;case"paragraph":return pl(String((we=(ve=rt.raw)!=null?ve:rt.content)!=null?we:""),pt,34);case"list":{const Wt=Array.isArray(rt.items)?rt.items.length:1;return Math.max(48,30*Wt+12)}case"list_item":return pl(String((Me=(Oe=rt.raw)!=null?Oe:rt.content)!=null?Me:""),pt,34);case"blockquote":return pl(String((De=(Fe=rt.raw)!=null?Fe:rt.content)!=null?De:""),pt,56);case"table":{const Wt=Array.isArray(rt.rows)?rt.rows.length:Array.isArray(rt.children)?rt.children.length:3;return Math.max(120,38*Wt+48)}case"code_block":return pl(String((Be=(Ae=rt.code)!=null?Ae:rt.raw)!=null?Be:""),pt,96,20);case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return pl(String((Ve=(ze=rt.raw)!=null?ze:rt.content)!=null?Ve:""),pt,96);case"thematic_break":return 24;default:return pl(String((ot=(ht=rt.raw)!=null?ht:rt.content)!=null?ot:""),pt,40)}})(T))}function pl(T,B,j,z=22){const Q=String(T??"");if(!Q)return j;const fe=Math.max(18,Math.floor(Math.max(320,B)/8)),ve=Q.split(/\r?\n/).length,we=Math.ceil(Q.length/fe),Oe=Math.max(1,ve,we);return Math.max(j,Math.ceil(Oe*z+12))}function Ia(T){const B=Number(T);return!Number.isFinite(B)||B<=0?-1:Math.round(B/32)}function Gh(){var T,B;const j=Xe.value.length,z=Ia(G.value||et("getFallbackHeightPrefix.clientWidth",()=>{var we;return((we=$.value)==null?void 0:we.clientWidth)||0})),Q=((T=s.virtualScroll)==null?void 0:T.measurementKey)==null?"":String(s.virtualScroll.measurementKey),fe=[j,mo.count,Math.round(mo.total),Math.round(100*Vo.value),Q,z,on.value?1:0,dw.value,Z.value].join(":");if(!Uh&&l0===fe)return r0;const ve=new Array(j+1);ve[0]=0;for(let we=0;we<j;we++)ve[we+1]=ve[we]+(on.value?Su(we):(B=po[we])!=null?B:Vo.value);return r0=ve,l0=fe,Uh=!1,ve}function v0(T){var B,j;const z=Xe.value.length;if(z<=0||T<=0)return 0;const Q=Gh();if(T>=((B=Q[z])!=null?B:0))return z-1;let fe=0,ve=z-1,we=z-1;for(;fe<=ve;){const Oe=fe+ve>>1;((j=Q[Oe+1])!=null?j:0)>=T?(we=Oe,ve=Oe-1):fe=Oe+1}return we}function zi(T,B){var j,z;if(T>=B)return 0;if(on.value)return(function(ve,we){var Oe,Me;const Fe=Xe.value.length,De=ss(Math.trunc(ve),0,Fe),Ae=ss(Math.trunc(we),De,Fe);if(De>=Ae)return 0;const Be=Gh();return((Oe=Be[Ae])!=null?Oe:0)-((Me=Be[De])!=null?Me:0)})(T,B);if(Ma.value!==Xe.value.length){let ve=0;for(let we=T;we<B;we++)ve+=(j=po[we])!=null?j:Vo.value;return ve}const Q=Bh.value,fe=Fh.value;if(!Q.length||!fe.length){let ve=0;for(let we=T;we<B;we++)ve+=(z=po[we])!=null?z:Vo.value;return ve}return mu(Q,T,B)+(B-T-mu(fe,T,B))*Vo.value}Ge(()=>Xe.value.length,T=>{vo(),T<=0?gu():(T<Ma.value&&hM(T),T!==Ma.value&&pu(T))},{immediate:!0});const _M=H(()=>{if(!he.value)return Xe.value.map((z,Q)=>({node:z,index:Q}));const T=Xe.value.length,B=ss(ns.start,0,T),j=ss(ns.end,B,T);return Xe.value.slice(B,j).map((z,Q)=>({node:z,index:B+Q}))}),Yh=H(()=>he.value?zi(0,Math.min(ns.start,Xe.value.length)):0),Xh=H(()=>{if(!he.value)return 0;const T=Xe.value.length;return zi(Math.min(ns.end,T),T)});function y0(){if(!on.value)return 0;let T=0;const B=Nr.value;for(let j=0;j<B.length;j++){if(!B[j])continue;const z=po[j];Number.isFinite(z)&&z>0||T++}return T}function k0(){const T=Xe.value.length;return{totalNodes:T,measuredCount:mo.count,estimatedCount:y0(),averageNodeHeight:Vo.value,topSpacerHeight:Yh.value,bottomSpacerHeight:Xh.value,estimatedTotalHeight:zi(0,T),width:Lr()}}function wM(){const T=Xe.value,B=k0();return Ct(tt({},B),{probe:{paragraphReady:!!X.value.paragraph,listItemReady:!!X.value.listItem,listWrapperOverhead:X.value.listWrapperOverhead,headingReadyLevels:Object.entries(X.value.headings).filter(([,j])=>!!j).map(([j])=>Number(j))},nodes:T.map((j,z)=>{var Q,fe,ve,we,Oe,Me,Fe,De,Ae;return{index:z,type:j.type,estimateKind:(fe=(Q=Nr.value[z])==null?void 0:Q.kind)!=null?fe:null,rendererKind:(we=(ve=Nr.value[z])==null?void 0:ve.rendererKind)!=null?we:null,estimatedHeight:(Me=(Oe=Nr.value[z])==null?void 0:Oe.height)!=null?Me:null,estimatedContentHeight:(De=(Fe=Nr.value[z])==null?void 0:Fe.contentHeight)!=null?De:null,measuredHeight:(Ae=po[z])!=null?Ae:null}})})}function Zh(){return s.indexKey!=null?String(s.indexKey):Ye.value?`virtual-${mn()}`:"markdown-renderer"}function b0(T){const B=String(T),j=`${Zh()}-`;if(!B.startsWith(j))return null;const z=B.slice(j.length).match(/^(\d+)(?:$|-)/);if(!z)return null;const Q=Number(z[1]);return!Number.isInteger(Q)||Q<0||Q>=Xe.value.length?null:Q}function mn(){var T,B,j;const z=(T=s.virtualScroll)==null?void 0:T.sessionKey;return String(z!=null&&z!==""?z:(j=(B=s.indexKey)!=null?B:b.customId)!=null?j:mt)}function zn(){var T;const B=(T=s.virtualScroll)==null?void 0:T.threadKey;return B==null||B===""?void 0:String(B)}function Jh(T){var B;return(T??"")===((B=zn())!=null?B:"")}function SM(){var T;const B=(T=s.virtualScroll)==null?void 0:T.measurementKey;return B==null?"":String(B)}function CM(){var T,B;const j=u.value,z=j==="monaco"?b.codeBlockMonacoOptions:void 0,Q=b.codeBlockProps,fe=j==="shiki";return[b.isDark?"dark":"light",j==="monaco"?"code-rich":j==="pre"?"code-pre":"code-shiki",b.codeBlockStream===!1?"code-static":"code-stream",Xn(b.codeBlockMinWidth),Xn(b.codeBlockMaxWidth),...fe?[Mf((T=Q?.themes)!=null?T:b.themes,(B=Q?.langs)!=null?B:b.langs)]:[],Xn(z?.fontSize),Xn(z?.lineHeight),Xn(z?.fontFamily),Xn(z?.tabSize),Xn(z?.MAX_HEIGHT),Xn(z?.wordWrap),Xn(z?.wrappingIndent),Xn(z?.padding),Xn(Q?.showHeader),Xn(Q?.showCopyButton),Xn(Q?.showExpandButton),Xn(Q?.showPreviewButton),Xn(Q?.showCollapseButton),Xn(Q?.showFontSizeButtons)].join("\0")}function fi(){return[SM(),CM()].join("\0")}function Lr(){return Oo()}const Cu=H(()=>Ia(Lr())),Ks=H(()=>[fi(),Cu.value].join("\0")),xM=H(()=>{var T;return Ye.value?["virtual",(T=zn())!=null?T:"",mn(),Ks.value].join("\0"):s.indexKey});function ml(){i0.value+=1}function Qh(T){return!(!T||!Number.isInteger(T.index)||T.index<0||T.index>=Xe.value.length||T.sessionKey!==mn()||T.threadKey!==zn()||T.layoutEpochKey!==Ks.value)}function _0(T){const B=String(T),j=Go.get(B);return j?Qh(j)?j.index:null:b0(B)}function w0(T="async-node"){(zs.size||Go.size)&&(zs.clear(),Go.clear(),ml(),cn(T))}const gl=Pt(Bg,null),ep={reportHeight(T,B){if(!qe.value)return;const j=_0(T);if(j==null)return;const z=Ko.get(j);if(!z)return;const Q=Number(B),fe=Qv(j,z);Jv(j,Number.isFinite(Q)&&Q>0?Math.max(Q,fe||0):fe)},markPending(T){if(!qe.value)return;const B=b0(T);B!=null&&(function(j,z){var Q;const fe=Go.get(j);if(fe&&Qh(fe))return zs.set(j,Math.max(0,(Q=zs.get(j))!=null?Q:0)+1),ml(),void cn("async-node");zs.set(j,1),Go.set(j,(function(ve){return{index:ve,sessionKey:mn(),threadKey:zn(),layoutEpochKey:Ks.value}})(z)),ml(),cn("async-node")})(String(T),B)},markSettled(T){if(!qe.value)return;const B=String(T),j=_0(T);(j!=null||(function(z){return zs.has(String(z))})(B))&&(function(z){var Q;const fe=(Q=zs.get(z))!=null?Q:0;return!(fe<=0||(fe<=1?(zs.delete(z),Go.delete(z)):zs.set(z,fe-1),ml(),fe===1&&cn("async-node"),0))})(B)&&j!=null&&hi()}};function TM(){let T=0;for(const B of Ko.values())T+=et("getVisibleDomHeight.offsetHeight",()=>{var j;return(j=B?.offsetHeight)!=null?j:0});return Math.ceil(Math.max(0,T))}gn(Bg,{reportHeight(T,B){ep.reportHeight(T,B),gl?.reportHeight(T,B)},markPending(T){ep.markPending(T),gl?.markPending(T)},markSettled(T){ep.markSettled(T),gl?.markSettled(T)}});let tp,np=null,vl=null;function xu(T){return T!==!1&&T!=null&&T!==""}function S0(){return he.value?(function(){if(!he.value)return!0;const T=Xe.value.length,B=ss(ns.start,0,T),j=ss(ns.end,B,T);if(B>=j)return!0;for(let z=B;z<j;z++)if(!it.has(z)||Sp(z)&&!Ko.has(z))return!1;return!0})():q.value>=yu.value}function sp(){return U.value===!0&&!Y.value&&Wh.value===0&&qi.size===0&&di.size===0&&Vs==null&&S0()}function C0(){var T,B;if(((T=s.virtualScroll)==null?void 0:T.settleMode)!=="manual"||np===mn()&&tp===zn())return!0;const j=(B=s.virtualScroll)==null?void 0:B.settledToken;return!!xu(j)&&vl===ja(j)}function op(){return sp()&&C0()}function MM(T,B){return B.totalNodes<=0?T==="final"?"final":"estimate":B.measuredCount>=B.totalNodes?T==="final"?"final":"measured":B.measuredCount>0||B.estimatedCount>0?"mixed":"estimate"}function Or(T="manual",B){const j=k0(),z=(function(Q){return Q||(U.value!==!0?Xe.value.length>0?"streaming":"estimating":!S0()||di.size>0||Vs!=null?"measuring":op()?"settled":"settling")})(B);return{sessionKey:mn(),threadKey:zn(),phase:z,nodeCount:j.totalNodes,liveRange:{start:ns.start,end:ns.end},renderedCount:q.value,measuredCount:j.measuredCount,estimatedCount:j.estimatedCount,averageNodeHeight:j.averageNodeHeight,topSpacerHeight:j.topSpacerHeight,bottomSpacerHeight:j.bottomSpacerHeight,visibleDomHeight:TM(),totalHeight:x0(),width:j.width,final:U.value===!0,stable:op(),confidence:MM(z,j),reason:T}}function $a(){const T=Po.value||ge(),B=$.value;if(!T||!B)return null;const j=T.ownerDocument||B.ownerDocument||document,z=T===j.documentElement||T===j.body||T===j.scrollingElement,Q=et("getScrollBox.scrollTop",()=>J(T,j,z)),fe=et("getScrollBox.scrollHeight",()=>{var we,Oe,Me,Fe,De;return z?Math.max((Oe=(we=j.documentElement)==null?void 0:we.scrollHeight)!=null?Oe:0,(Fe=(Me=j.body)==null?void 0:Me.scrollHeight)!=null?Fe:0,(De=T.scrollHeight)!=null?De:0):T.scrollHeight}),ve=et("getScrollBox.clientHeight",()=>{var we;return z?((we=j.documentElement)==null?void 0:we.clientHeight)||T.clientHeight||0:T.clientHeight});return{root:T,doc:j,isViewportRoot:z,scrollTop:Q,scrollHeight:fe,clientHeight:ve}}function x0(){const T=Xe.value.length,B=Math.max(0,zi(0,T)),j=et("getRendererLogicalHeight.offsetHeight",()=>{var Q,fe;return(fe=(Q=$.value)==null?void 0:Q.offsetHeight)!=null?fe:0}),z=Math.max(0,j>0?j:et("getRendererLogicalHeight.scrollHeight",()=>{var Q,fe;return(fe=(Q=$.value)==null?void 0:Q.scrollHeight)!=null?fe:0}));return T<=0?Math.ceil(j):he.value?B>0?Math.max(1,Math.ceil(B),(function(){let Q=Yh.value+Xh.value;for(const fe of it.values())fe&&(Q+=Math.max(0,et("getVirtualizedDomLogicalHeight.offsetHeight",()=>fe.offsetHeight||0)));return Math.ceil(Math.max(0,Q))})(),(function(Q,fe){return Q<=0||fe<=0?0:fe<=Q+Math.max(512,.05*Q)?Math.ceil(fe):0})(B,z)):Math.max(1,Math.ceil(z)):qe.value?B>0||mo.count>0||y0()>0?(ne.value&&q.value,Math.max(1,Math.ceil(z),Math.ceil(B))):Math.ceil(z):Math.max(1,Math.ceil(z),Math.ceil(B))}function T0(T){const B=$.value;if(!B)return null;const j=et("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>B.getBoundingClientRect());return(function(Q){return Q.isViewportRoot?Q.clientHeight:et("getViewportBottomInRoot.getBoundingClientRect",()=>Q.root.getBoundingClientRect().bottom)})(T)-j.bottom}function AM(T={}){const B=T.requireViewport!==!1,j=(function(fe=64){const ve=$a(),we=$.value;if(!ve||!we)return!1;const Oe=(function(Fe){if(Fe.isViewportRoot)return{top:0,bottom:Fe.clientHeight};const De=et("getVirtualViewportRect.getBoundingClientRect",()=>Fe.root.getBoundingClientRect());return{top:De.top,bottom:De.bottom}})(ve),Me=et("isRendererNearVirtualViewport.getBoundingClientRect",()=>we.getBoundingClientRect());return Me.bottom>=Oe.top-fe&&Me.top<=Oe.bottom+fe})();if(B&&!j)return null;const z=(function(){const fe=$a(),ve=$.value;if(!fe||!ve||Math.max(0,fe.scrollHeight-fe.scrollTop-fe.clientHeight)>64)return null;const we=T0(fe);return we==null?null:we>=-8&&we<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,we)}:null})();if(z)return{anchor:z,captured:!0};const Q=Yv();if(Q)return{anchor:{type:"node",nodeIndex:Q.nodeIndex,offsetWithinNodePx:Q.offsetWithinNodePx},captured:j};if(T.allowFallback===!0){const fe=(function(){const ve=Xe.value.length;return ve<=0?null:{type:"node",nodeIndex:ss(go.value,0,Math.max(0,ve-1)),offsetWithinNodePx:0}})();return fe?{anchor:fe,captured:!1}:null}return null}function ip(T){let B=2166136261;for(let j=0;j<T.length;j++)B^=T.charCodeAt(j),B=Math.imul(B,16777619);return(B>>>0).toString(36)}function EM(T,B){let j=T;for(let z=0;z<B.length;z++)j^=B.charCodeAt(z),j=Math.imul(j,16777619);return j^=31,j=Math.imul(j,16777619),j}const IM=new Set(["children","items","header","rows","cells","attrs","data","term","definition"]);function Tu(T,B=new WeakSet,j=0){if(T==null||typeof T=="number"||typeof T=="boolean")return String(T);if(typeof T=="string")return`s:${(function(z){const Q=z.length>8192?`${z.slice(0,8192)}...${z.length}`:z;return`${z.length}:${ip(Q)}`})(T)}`;if(typeof T=="function")return"fn";if(typeof T!="object")return typeof T;if(B.has(T))return"cycle";if(j>=6)return"max-depth";B.add(T);try{if(Array.isArray(T)){if(T.length<=160){const Me=[];for(let Fe=0;Fe<T.length;Fe++)Me.push(Tu(T[Fe],B,j+1));return`a:${T.length}:${Me.join(",")}`}const fe=[],ve=[],we=Math.max(0,T.length-32);let Oe=2166136261;for(let Me=0;Me<T.length;Me++){const Fe=Tu(T[Me],B,j+1);Oe=EM(Oe,Fe),Me<32&&fe.push(Fe),Me>=we&&ve.push(Fe)}return[`a:${T.length}`,`h=${fe.join(",")}`,`t=${ve.join(",")}`,`all=${(Oe>>>0).toString(36)}`].join(":")}const z=T,Q=Object.keys(z).filter(fe=>{const ve=z[fe];return fe!=="parent"&&fe!=="el"&&fe!=="component"&&(ve==null||typeof ve=="string"||typeof ve=="number"||typeof ve=="boolean"||IM.has(fe))}).sort();return`o:${Q.length}:${Q.map(fe=>`${fe}=${Tu(z[fe],B,j+1)}`).join(";")}`}finally{B.delete(T)}}let M0=-1,rp="";function Na(T){const B=Xe.value[T];return B?ip(Tu(B)):""}function lp(){const T=Z.value;if(M0===T)return rp;let B=2166136261;for(let j=0;j<Xe.value.length;j++){const z=Na(j);for(let Q=0;Q<z.length;Q++)B^=z.charCodeAt(Q),B=Math.imul(B,16777619)}return rp=(B>>>0).toString(36),M0=T,rp}function yl(T,B={}){var j;const z=B.includeHeightCache===!0,Q=(j=B.includeContentHash)!=null?j:z,fe=z?(function(we){const Oe=(function(){var Ve,ht;const ot=Number((ht=(Ve=s.virtualScroll)==null?void 0:Ve.heightCacheLimit)!=null?ht:5e3);return!Number.isFinite(ot)||ot<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(ot))})();if(!Number.isFinite(Oe)||we.length<=Oe)return we;const Me=new Map,Fe=Ve=>{!Ve||Me.size>=Oe||Me.set(Ve.index,Ve)},De=Xe.value.length,Ae=ss(ns.start-2*Aa.value,0,De),Be=ss(ns.end+2*Aa.value,Ae,De);for(const Ve of we)Ve.index>=Ae&&Ve.index<Be&&Fe(Ve);const ze=Math.max(1,Math.ceil(we.length/Oe));for(let Ve=0;Ve<we.length&&Me.size<Oe;Ve+=ze)Fe(we[Ve]);for(let Ve=we.length-1;Ve>=0&&Me.size<Oe;Ve-=ze)Fe(we[Ve]);return Array.from(Me.values()).sort((Ve,ht)=>Ve.index-ht.index).slice(0,Oe)})(gM().map(we=>{var Oe;const Me=Xe.value[we.index];return Me?Ct(tt({},we),{nodeType:String((Oe=Me.type)!=null?Oe:""),signature:Na(we.index)}):null}).filter(we=>!!we)):[],ve=AM({allowFallback:B.allowAnchorFallback===!0,requireViewport:B.requireViewport});return ve||fe.length||B.includeEmptyState===!0?Ct(tt({sessionKey:T.sessionKey,threadKey:T.threadKey},ve?{anchor:ve.anchor,anchorCaptured:ve.captured}:{anchorCaptured:!1}),{metrics:T,width:T.width,contentHash:Q?lp():void 0,measurementKey:fi()||void 0,heightCache:fe.length?fe:void 0}):null}function ap(T){var B,j;const z=$a();if(!z)return;const Q=(function(we){const Oe=$.value;if(!Oe)return null;const Me=ue(Oe,we.root),Fe=Xe.value.length,De=et("getRendererBottomOffsetWithinRoot.offsetHeight",()=>Oe.offsetHeight||0),Ae=Math.max(0,De>0?De:Fe>0?et("getRendererBottomOffsetWithinRoot.scrollHeight",()=>Oe.scrollHeight||0):0),Be=x0();return Me+Math.max(Ae,Be)})(z);if(Q==null)return;const fe=Math.max(0,T.distanceFromBottomPx),ve=Math.max(0,Q-z.clientHeight-fe);(function(we){Fi=Da()+120,zo=we})(ve),z.isViewportRoot?(j=(B=z.doc.defaultView)==null?void 0:B.scrollTo)==null||j.call(B,0,ve):mw(z.root,z.doc,ve,{isReverseFlexScrollRoot:W,getNormalizedScrollTop:J})}const cp=[];function A0(){if(ye)for(js!=null&&(Nt?.(js),js=null);cp.length;){const T=cp.pop();T!=null&&window.clearTimeout(T)}}function kl(T){const B=!!jn.value;jn.value=null,Fi=0,zo=null,A0(),B&&T&&cn(T)}function bl(){if(!jn.value||!ye||js!=null)return;const T=()=>{js=null;const B=jn.value;B&&ap(B)};js=It?It(T):null,js==null&&T()}function E0(T,B={}){const j=Xe.value.length;return j<=0?[]:T.filter(z=>!(!Number.isInteger(z.index)||z.index<0||z.index>=j)&&!(!Number.isFinite(z.height)||z.height<=0)&&!(B.requireSignature&&!z.signature)&&!(B.requireCompatibilityMetadata&&!z.nodeType&&!z.signature)&&(function(Q){var fe;const ve=Xe.value[Q.index];return!(!ve||Q.nodeType&&Q.nodeType!==String((fe=ve.type)!=null?fe:"")||Q.signature&&Q.signature!==Na(Q.index))})(z))}function I0(T){const B=Ia(Lr()),j=Ia(T);return B!==-1&&j!==-1&&B===j}function up(T){var B;const j=Number(T?.width);if(Number.isFinite(j)&&j>0)return j;const z=Number((B=T?.metrics)==null?void 0:B.width);return Number.isFinite(z)&&z>0?z:null}function $0(T){var B;return T.sessionKey===mn()&&!!Jh(T.threadKey)&&((B=T.measurementKey)!=null?B:"")===fi()&&!!I0(up(T))&&!!(function(j){const z=j.heightCache;return!!z?.length&&(N0(j)?z.some(Q=>!!(Q.nodeType||Q.signature)):z.some(Q=>!!Q.signature))})(T)}function N0(T){return!!(T.contentHash&&T.contentHash===lp())}function $M(T){return!N0(T)}let Pr=null,Rr=null,Mu=null,La=null,Oa=null;function dp(T){var B;const j=T.map(Q=>{var fe,ve;return[Q.index,Math.round(10*Q.height),(fe=Q.nodeType)!=null?fe:"",(ve=Q.signature)!=null?ve:""].join("")}).join(""),z=Ia(Lr());return[(B=zn())!=null?B:"",mn(),fi(),Xe.value.length,z,T.length,ip(j)].join(":")}function L0(T=(B=>(B=s.virtualScroll)==null?void 0:B.heightCache)()){if(!qe.value||!T?.length||Xe.value.length<=0||!I0((B=s.virtualScroll)==null?void 0:B.heightCacheWidth))return!1;var B;const j=E0(T,{requireSignature:!0});if(!j.length)return!1;const z=dp(j);return z===Pr?(Rr="standalone",!0):(e0(j,{mode:"merge"}),vo(),Pr=z,Rr="standalone",Fa(),cn("restore"),!0)}function fp(T,B={}){var j,z,Q;if(!qe.value||!T||T.sessionKey!==mn()||!Jh(T.threadKey)||Xe.value.length<=0)return!1;const fe=!!((j=T.heightCache)!=null&&j.length)&&!Au(),ve=!T.anchor||T.anchorCaptured===!1&&B.allowUncapturedAnchor!==!0?null:T.anchor,we=B.restoreAnchor===!0&&!!ve&&!Au()&&Number(up(T))>0;let Oe=!1;if((z=T.heightCache)!=null&&z.length&&$0(T)){const Fe=E0(T.heightCache,{requireCompatibilityMetadata:!T.contentHash,requireSignature:$M(T)});Fe.length&&(e0(Fe,{mode:"merge"}),vo(),Pr=dp(Fe),Rr="restore",Fa(),Oe=!0)}if(fe||we)return!1;if(!B.restoreAnchor||!ve)return Oe&&cn("restore"),!0;const Me=(function(Fe,De){var Ae;const Be=Fe.anchor,ze=Be?Be.type==="bottom"?`bottom:${Math.round(Be.distanceFromBottomPx)}`:`node:${Be.nodeIndex}:${Math.round(Be.offsetWithinNodePx)}`:"none";return[(Ae=zn())!=null?Ae:"",mn(),fi(),Cu.value,De,ze].join(":")})(T,(Q=B.restoreToken)!=null?Q:"imperative");return Mu===Me?(Oe&&cn("restore"),!0):(Mu=Me,(function(Fe){const De=()=>{if(Fe.type==="node")return kl(),void Xv({nodeIndex:Fe.nodeIndex,offsetWithinNodePx:Fe.offsetWithinNodePx});if(hu(),Hi.value=null,jn.value=Fe,A0(),ap(Fe),ye)for(const Ae of[0,120,280,480])cp.push(window.setTimeout(()=>{const Be=jn.value;Be&&ap(Be)},Ae))};(function(Ae){if(!he.value)return!1;const Be=Xe.value.length;return!(Be<=0||(go.value=Ae.type==="node"?ss(Ae.nodeIndex,0,Be-1):Be-1,Ir(),0))})(Fe)?vt(De):De()})(ve),cn("restore"),!0)}function Au(){const T=Lr();return Number.isFinite(T)&&T>0}function O0(T){var B;return T.sessionKey===mn()&&!!Jh(T.threadKey)&&(Xe.value.length<=0||!(!((B=T.heightCache)!=null&&B.length)||Au())||!(!(T.anchor&&Number(up(T))>0)||Au()))}function hp(){Dt.clear();for(const T of Object.keys(po)){const B=Number(T);Number.isInteger(B)&&B>=0&&B<Xe.value.length&&Zv(B)}}function Pa(){Vs!=null&&(Nt?.(Vs),Vs=null),Cp()}function P0(){return!ye||uo?Promise.resolve():new Promise(T=>{let B=!1,j=null;const z=()=>{B||(B=!0,j!=null&&window.clearTimeout(j),T())};if(It)return It(z),void(j=window.setTimeout(z,50));j=window.setTimeout(z,0)})}function pp(T,B=zn(),j=Ks.value){return mn()===T&&zn()===B&&Ks.value===j}function mp(){return yn(this,arguments,function*(T={}){var B,j,z,Q,fe;const ve=mn(),we=zn(),Oe=Ks.value,Me=(B=T.frames)!=null?B:2,Fe=(j=T.timeoutMs)!=null?j:120,De=(z=T.reason)!=null?z:"manual",Ae=T.expectedSettledTokenKey,Be=T.flushPendingTimers===!0,ze=Or(De),Ve=()=>Ct(tt({},ze),{phase:ze.final?"settling":ze.phase,stable:!1,confidence:ze.confidence==="final"?"mixed":ze.confidence,reason:De}),ht=()=>pp(ve,we,Oe)&&(Ae==null||Ba()===Ae);for(let pt=0;pt<Me;pt++){if(yield vt(),!ht()||(yield P0(),!ht()))return Ve();hi(),Pa()}if(yield(function(pt){return!ye||pt<=0?Promise.resolve():new Promise(Wt=>window.setTimeout(Wt,pt))})(Fe),!ht()||(Be&&c0(),hi(),Pa(),!ht()))return Ve();const ot=sp();ot&&(np=ve,tp=we,((Q=s.virtualScroll)==null?void 0:Q.settleMode)==="manual"&&Ae!=null&&xu((fe=s.virtualScroll)==null?void 0:fe.settledToken)&&Ba()===Ae&&(vl=ja(s.virtualScroll.settledToken)));const rt=ht()&&ot&&C0(),gt=Or(De,rt?"final":void 0);return bp(gt,!0),gt})}let gp="content",Dr=null,Br=null,vp=0,Ra=null,_l=null,yp=null,kp=null;function Da(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function R0(T){var B,j;const z=Ra;if(!z)return!0;const Q=(j=(B=s.virtualScroll)==null?void 0:B.heightDiffThresholdPx)!=null?j:1;return Math.abs(T.totalHeight-z.totalHeight)>Q||T.sessionKey!==z.sessionKey||T.phase!==z.phase||T.stable!==z.stable||T.final!==z.final||T.threadKey!==z.threadKey||T.nodeCount!==z.nodeCount||T.measuredCount!==z.measuredCount||T.width!==z.width}function Xn(T){if(T==null)return"";if(typeof T=="string"||typeof T=="number"||typeof T=="boolean")return String(T);try{return JSON.stringify(T)}catch{return String(T)}}function Ba(T=(B=>(B=s.virtualScroll)==null?void 0:B.settledToken)()){return Xn(T)}function D0(T,B){var j,z;return[T,B.sessionKey,(j=B.threadKey)!=null?j:"",fi(),lp(),Xn((z=s.virtualScroll)==null?void 0:z.settledToken),Math.round(B.totalHeight),Math.round(B.width)].join("\0")}function Fa(){yp=null,kp=null,_l=null}function NM(T){const B=T.heightCache;return B?.length?dp(B):""}function Ha(T){var B,j,z;const Q=T.metrics,fe=T.anchor?(ve=T.anchor).type==="bottom"?`bottom:${Math.round(ve.distanceFromBottomPx)}`:`node:${ve.nodeIndex}:${Math.round(ve.offsetWithinNodePx)}`:"none";var ve;return[T.sessionKey,(B=T.threadKey)!=null?B:"",(j=T.measurementKey)!=null?j:fi(),(z=T.contentHash)!=null?z:"",NM(T),fe,T.anchorCaptured?1:0,Q.liveRange.start,Q.liveRange.end,Q.renderedCount,Q.nodeCount,Math.round(Q.totalHeight),Math.round(Q.width),Q.phase,Q.stable?1:0].join("\0")}function bp(T,B=!1){if(!qe.value||(function(ve=!1){return!ve&&Ye.value&&!Tt.value})(B))return;const j=B||R0(T),z=(function(ve,we=!1){return we||ve.stable||ve.phase==="final"?{state:yl(ve,{includeHeightCache:!0})}:{state:yl(ve)}})(T,B),Q=z.state,fe=!!(Q&&(j||(function(ve,we=!1){return!!we||Ha(ve)!==_l})(Q,B)));if(j&&(M(T),Ra=T,vp=Da()),Q&&fe&&(N(Q),Q.anchor&&D(Q.anchor),_l=Ha(Q)),T.stable){const ve=D0("settled",T);if(ve!==yp){yp=ve;const we=yl(T,{includeHeightCache:!0});we&&(N(we),_l=Ha(we)),(function(Oe){o("render-settled",Oe)})(T)}}if(T.phase==="final"){const ve=D0("final",T);if(ve!==kp){kp=ve;const we=yl(T,{includeHeightCache:!0});we&&(N(we),_l=Ha(we)),(function(Oe){o("render-final",Oe)})(T)}}}function _p(){Dr!=null&&(Nt?.(Dr),Dr=null),Br!=null&&ye&&(window.clearTimeout(Br),Br=null)}function B0(){Dr=null,Br=null,(function(T){if(di.size>0||Vs!=null)return!0;switch(T){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(gp)&&(hi(),Pa()),bp(Or(gp))}function cn(T){var B,j;if(!qe.value||(gp=T,Dr!=null||Br!=null))return;const z=Math.max(0,(j=(B=s.virtualScroll)==null?void 0:B.emitIntervalMs)!=null?j:32),Q=Math.max(0,z-(Da()-vp)),fe=()=>{Br=null,Dr=It?It(B0):null,Dr==null&&B0()};ye&&Q>0?Br=window.setTimeout(fe,Q):fe()}function wp(T){var B;if(T<=0)return 0;const j=Xe.value;if(on.value)return v0(T);if(Ma.value===j.length&&Bh.value.length&&Fh.value.length){const Q=Vo.value,fe=Bh.value,ve=Fh.value,we=De=>De<=0?0:mu(fe,0,De)+(De-mu(ve,0,De))*Q;let Oe=0,Me=j.length-1,Fe=j.length-1;for(;Oe<=Me;){const De=Oe+Me>>1;we(De+1)>=T?(Fe=De,Me=De-1):Oe=De+1}return Fe}let z=T;for(let Q=0;Q<j.length;Q++){const fe=(B=po[Q])!=null?B:Vo.value;if(z<=fe)return Q;z-=fe}return Math.max(0,j.length-1)}function F0(){an.value+=1}function Sp(T){return!(ne.value&&T>=q.value)&&(!Wi.value||T<fo.value||jh.value.has(T))}function wl(T){const B=_u.get(T);B&&(B(),_u.delete(T));const j=hl.get(T);j&&(j.destroy(),hl.delete(T)),wu(T)}function H0(T,B){let j=!1;if(B){const fe=it.get(T);it.set(T,B),fe!==B&&(j=!0)}else it.delete(T)&&(j=!0);if(j&&F0(),B||wu(T),!t0.value||!Gt||!he.value&&Wi.value&&!V.value&&hl.size>=640&&(V.value||(V.value=!0,zh()),!t0.value||!Gt))return wl(T),void(B&&ji(T,!0));if(T<fo.value&&!he.value||jh.value.has(T))return wl(T),void ji(T,!0);if(!B)return void wl(T);wl(T);const z=Gt(B,{rootMargin:"400px"});if(!z)return;hl.set(T,z),ji(T,z.isVisible.value),Wi.value&&(function(fe){if(!ye||!Wi.value)return;wu(fe);const ve=fe%17*23,we=window.setTimeout(()=>{if(u0.delete(fe),!Wi.value||jh.value.has(fe))return;const Oe=it.get(fe);if(!Oe)return;const Me=ge(Oe),Fe=Oe.ownerDocument||document,De=Fe.defaultView||window,Ae=!Me||Me===Fe.documentElement||Me===Fe.body,Be=!Ae&&Me?et("nodeVisibilityFallback.root.getBoundingClientRect",()=>Me.getBoundingClientRect()):null,ze=Ae?0:Be.top,Ve=Ae?et("nodeVisibilityFallback.clientHeight",()=>{var ot,rt;return(rt=(ot=De.innerHeight)!=null?ot:Me?.clientHeight)!=null?rt:0}):Be.bottom,ht=et("nodeVisibilityFallback.node.getBoundingClientRect",()=>Oe.getBoundingClientRect());ht.bottom>=ze-500&&ht.top<=Ve+500&&ji(fe,!0)},1800+ve);u0.set(fe,we)})(T);let Q=null;Q=Ge(()=>z.isVisible.value,fe=>{if(fe){wu(T),ji(T,!0),Q?.(),_u.delete(T),hl.get(T)===z&&hl.delete(T);try{z.destroy()}catch{}}},{immediate:!0}),_u.set(T,Q),he.value&&Yo()}function Cp(){Vs=null;for(const[T,B]of di)di.delete(T),Ko.get(T)===B.el&&$r.get(T)===B.version&&Jv(T,B.height,{allowShrink:B.allowShrink})}function Sl(){Vs!=null&&(Nt?.(Vs),Vs=null),di.clear()}function Eu(T,B){(function(j,z,Q){var fe;if(!Number.isFinite(Q)||Q<=0||Ko.get(j)!==z)return;const ve=$r.get(j);if(ve==null)return;const we=Xe.value[j],Oe=Y.value&&U.value!==!0&&!((fe=s.nodes)!=null&&fe.length)&&j>=Xe.value.length-2,Me=!(we?.loading===!0||Oe),Fe=di.get(j),De=Fe?Fe.allowShrink&&Me:Me,Ae=Fe&&!De?Math.max(Fe.height,Q):Q;di.set(j,{height:Ae,allowShrink:De,version:ve,el:z}),Vs==null&&(Vs=It?It(Cp):null,Vs==null&&Cp())})(T,B,Qv(T,B))}function hi(){for(const[T,B]of Ko)B&&Eu(T,B)}function W0(){pn?.disconnect(),pn=null,Rt.clear()}function xp(){for(;vu.length;)bu(vu.pop())}Ge(Tt,T=>{T&&cn("content")},{flush:"post"}),t({getVirtualMetrics:Or,captureVirtualState:function(T={}){var B;return yl(Or("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:T.allowFallbackAnchor===!0,requireViewport:T.requireViewport===!0,includeEmptyState:(B=T.includeEmptyState)==null||B})},restoreVirtualState:function(T,B={}){const j=B.restoreAnchor===!0,z=B.restoreToken==null?"imperative":String(B.restoreToken);La=T,Oa={restoreAnchor:j,restoreToken:z,allowUncapturedAnchor:B.allowUncapturedAnchor===!0},!fp(T,{restoreAnchor:j,restoreToken:z,allowUncapturedAnchor:B.allowUncapturedAnchor===!0})&&O0(T)||(La=null,Oa=null)},forceMeasure:function(T="manual"){return yn(this,null,function*(){yield vt(),yield P0(),hi(),Pa(),yield vt();const B=Or(T);return bp(B,!0),B})},settle:mp,scrollToNode:function(T,B="start"){kl(),hu();const j=Xe.value.length;if(j<=0)return;const z=ss(T,0,j-1),Q=()=>{var fe;const ve=uM({nodeIndex:z,offsetWithinNodePx:0}),we=Su(z),Oe=$a(),Me=(fe=Oe?.clientHeight)!=null?fe:0,Fe=aM();let De=ve;if(B==="center")De=ve-Me/2+we/2;else if(B==="end")De=ve-Me+we;else if(B==="nearest"&&Fe!=null){if(ve>=Fe&&ve+we<=Fe+Me)return;De=ve<Fe?ve:ve-Me+we}cM(Math.max(0,De)),Yo({immediate:!0}),he.value&&(go.value=z,Ir())};if(he.value)return go.value=z,Ir(),void vt(Q);Q()}}),Ge(()=>We.value,T=>{if(!T){W0();for(const B of Ui.values())for(const j of B)bu(j);Ui.clear(),$r.clear(),xp(),Sl()}},{immediate:!0}),Ge(U,T=>{T&&(function(){if(ye&&U.value&&Ko.size){xp();for(const B of[80,240,640]){const j=a0(B,()=>{for(const[z,Q]of Ko)Q&&Eu(z,Q)},"final");j!=null&&vu.push(j)}}})(),cn(T?"final":"content")}),Ge([()=>Xe.value.length,()=>q.value],()=>{jn.value&&bl(),cn("content")},{flush:"post",immediate:!0}),Ge([()=>ns.start,()=>ns.end],()=>{cn("batch")},{flush:"post"});const{cleanupBatchScheduler:LM}=(function(T){const{props:B,isClient:j,isTestEnv:z,parsedNodesIdentity:Q,parsedNodeCount:fe,desiredRenderedCount:ve,datasetKey:we,batchingEnabled:Oe,incrementalRenderingActive:Me,resolvedBatchSize:Fe,resolvedInitialBatch:De,renderedCount:Ae,adaptiveBatchSize:Be,previousRenderContext:ze,previousBatchConfig:Ve,requestFrame:ht,cancelFrame:ot,hasIdleCallback:rt,cleanupNodeVisibility:gt,onDatasetKeyChanged:pt,onDatasetChanged:Wt}=T;let kt=null,At=null,Mt=!1,Yt=null,Gs=null,_s=0,Ro=!1,Vi=!1;const Ki=new Set,Hr=new Set;function iy(){if(j){kt!=null&&(ot?.(kt),kt=null),At!=null&&(window.clearTimeout(At),At=null),Gs!=null&&typeof window.cancelIdleCallback=="function"&&(window.cancelIdleCallback(Gs),Gs=null),_s+=1;for(const us of Ki)ot?.(us);Ki.clear();for(const us of Hr)window.clearTimeout(us);Hr.clear(),Mt=!1,Yt=null,Ro=!1,Vi=!1}}function Ru(){return typeof performance<"u"?performance.now():Date.now()}function ry(us){(function(pi){var Gi;if(!Me.value)return;const mi=Math.max(2,(Gi=B.renderBatchBudgetMs)!=null?Gi:6),gi=Math.max(1,Fe.value||1),Do=Math.max(1,Math.floor(gi/4));pi>1.2*mi?Be.value=Math.max(Do,Math.floor(.7*Be.value)):pi<.5*mi&&Be.value<gi&&(Be.value=Math.min(gi,Math.ceil(1.2*Be.value)))})(us),Ro=!1;const Ns=Vi||Ae.value<ve.value;Vi=!1,Ns&&cy()}function ly(us,Ns={}){var pi,Gi;if(!Me.value)return;const mi=ve.value;if(Ae.value>=mi)return;const gi=Math.max(1,us),Do=()=>{const Tl=Ru();let Ml=0;kt=null,At=null,Gs=null,Mt=!1;const Al=Yt??gi;Yt=null;const Lp=Ru();Ae.value=Math.min(mi,Ae.value+Al),gt(Ae.value),Ml=Ru()-Lp,(function(Op,uy){if(!j)return void ry(uy);Ro=!0;const dy=++_s;vt().then(()=>{var fy;if(dy!==_s)return;const QM=Ru(),eA=Math.max(uy,QM-Op),hy=()=>{dy===_s&&ry(eA)};if(ht){let my=!1,vi=null;const gy=()=>{my||(my=!0,hy())},Du=ht(()=>{Ki.delete(Du),vi!=null&&(window.clearTimeout(vi),Hr.delete(vi),vi=null),gy()});return Ki.add(Du),vi=window.setTimeout(()=>{vi!=null&&Hr.delete(vi),vi=null,ot?.(Du),Ki.delete(Du),gy()},Math.max(32,(fy=B.renderBatchIdleTimeoutMs)!=null?fy:120)),void Hr.add(vi)}const py=window.setTimeout(()=>{Hr.delete(py),hy()},0);Hr.add(py)})})(Tl,Ml)};if(!j||Ns.immediate)return void Do();const Yi=Math.max(0,(pi=B.renderBatchDelay)!=null?pi:16);if(Yt=Yt!=null?Math.max(Yt,gi):gi,!Mt){if(Mt=!0,!z&&rt&&window.requestIdleCallback){const Tl=Math.max(0,(Gi=B.renderBatchIdleTimeoutMs)!=null?Gi:120);return void(Gs=window.requestIdleCallback(()=>Do(),{timeout:Tl}))}ht&&!z?kt=ht(()=>{Yi!==0?At=window.setTimeout(()=>Do(),Yi):Do()}):At=window.setTimeout(()=>Do(),Yi)}}function ay(us,Ns={}){Ro?Vi=!0:us==null?cy():ly(us,Ns)}function cy(){Me.value&&ly(Oe.value?Math.max(1,Math.round(Be.value)):Math.max(1,Fe.value))}return Ge([Q,fe,we,Me,Fe,De,()=>B.renderBatchDelay],()=>{var us;const Ns=fe.value,pi=ze.value,Gi=we.value,mi=!Object.is(Gi,pi.key),gi=Ns!==pi.total,Do=mi||gi;ze.value={key:Gi,total:Ns};const Yi=Ve.value,Tl=(us=B.renderBatchDelay)!=null?us:16,Ml=Yi.batchSize!==Fe.value||Yi.initial!==De.value||Yi.delay!==Tl||Yi.enabled!==Me.value;Ve.value={batchSize:Fe.value,initial:De.value,delay:Tl,enabled:Me.value},mi&&pt(Ns),(Do||Ml||!Me.value)&&iy(),(Do||Ml)&&(Be.value=Math.max(1,Fe.value||1)),Do&&Wt();const Al=ve.value;if(!Ns)return Ae.value=0,void gt(0);if(!Me.value)return Ae.value=Al,void gt(Ae.value);const Lp=mi||pi.total===0;Ae.value=Lp||Ml?Math.min(Al,De.value):Math.min(Ae.value,Al);const Op=Math.max(1,De.value||Fe.value||Ns);Ae.value<Al?ay(Op,{immediate:!j}):gt(Ae.value)},{immediate:!0}),Ge(ve,(us,Ns)=>{Me.value&&(typeof Ns=="number"&&us<=Ns||us>Ae.value&&ay())}),{cleanupBatchScheduler:iy}})({props:b,isClient:ye,isTestEnv:uo,parsedNodesIdentity:es,parsedNodeCount:$s,desiredRenderedCount:yu,datasetKey:xM,batchingEnabled:Bi,incrementalRenderingActive:ne,resolvedBatchSize:ui,resolvedInitialBatch:fo,renderedCount:q,adaptiveBatchSize:He,previousRenderContext:te,previousBatchConfig:lt,requestFrame:It,cancelFrame:Nt,hasIdleCallback:co,cleanupNodeVisibility:kM,onDatasetKeyChanged:T=>{Sl(),gu(),vo(),Fa(),T>0&&pu(T)},onDatasetChanged:()=>{he.value&&Yo({immediate:!0})}});Ge([n0,he,()=>$.value,()=>pe()],([T,B])=>{if(!T)return d0(),void qh();bM(),B?Yo({immediate:!0}):qh()},{flush:"post",immediate:!0}),Ge([()=>Xe.value.length,()=>he.value],T=>yn(null,[T],function*([B,j]){j&&B&&ye&&(yield vt(),Yo({immediate:!0}))}),{flush:"post"}),Ge(on,T=>{T&&(function(){var B;if(Cn.value&&fn.value&&Hn.value&&((B=Wn.value)!=null&&B[1]))return;const j=cr({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),z=cr({type:"list_item",children:[j],raw:"- Probe paragraph text"}),Q=cr({type:"list",ordered:!1,items:[z],raw:"- Probe paragraph text"});Cn.value=j,fn.value=z,Hn.value=Q;const fe={1:null,2:null,3:null,4:null,5:null,6:null};for(let ve=1;ve<=6;ve++)fe[ve]=cr({type:"heading",level:ve,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(ve)} Probe heading`});Wn.value=fe})()},{immediate:!0}),Ge([()=>$.value,on],()=>{if(!on.value)return Kh(),void(G.value=0);h0(),Kh(),on.value&&$.value&&typeof ResizeObserver<"u"&&(Ea=new ResizeObserver(()=>{h0(),Hi.value&&Ta(),jn.value&&bl(),cn("resize")}),Ea.observe($.value))},{immediate:!0}),Ge([on,ci,Ks],()=>yn(null,null,function*(){if(!on.value)return X.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void vo();yield vt(),(function(){if(!on.value||typeof window>"u")return X.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void vo();const T={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},B=f0(Vh(O.value),".paragraph-node");T.paragraph=Lm(O.value,B,"pre-wrap");const j=Vh(P.value),z=j?.querySelector(".paragraph-node");T.listItem=Lm(P.value,z,"pre-wrap");const Q=et("readSimpleTextProbeProfile.list.offsetHeight",()=>{var ve,we;return(we=(ve=R.value)==null?void 0:ve.offsetHeight)!=null?we:0}),fe=et("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var ve,we;return(we=(ve=P.value)==null?void 0:ve.offsetHeight)!=null?we:0});T.listWrapperOverhead=Math.max(0,Q-fe);for(let ve=1;ve<=6;ve++){const we=f0(Vh(F[ve]),`h${ve}`);T.headings[ve]=Lm(F[ve],we,"pre-wrap")}X.value=T,vo()})()}),{flush:"post",immediate:!0}),Ge(()=>Xe.value.length,()=>{he.value&&Yo({immediate:!0})}),Ge([on,G],()=>{vo(),he.value&&Yo({immediate:!0}),Hi.value&&Ta(),jn.value&&bl(),cn("resize")},{immediate:!1}),Ge(()=>Wi.value,T=>{if(T)for(const[B,j]of it)H0(B,j);else{zh();for(const[B,j]of it)j&&ji(B,!0)}},{immediate:!1}),Ge([()=>b.viewportPriority,()=>Xe.value.length],([T,B])=>{T!==!1?V.value&&B<=200&&(V.value=!1):V.value=!1}),Ge(()=>q.value,()=>{he.value&&Yo({immediate:!0})}),Ge([go,$e,Aa,()=>Xe.value.length,he],()=>{Ir()},{immediate:!0});let Wa=null,Ua=!1,Cl=null;function qa(){Wa=null,np=null,tp=void 0,vl=null,Fa()}function Tp(){Sl(),gu(),vo(),Dt.clear();const T=Xe.value.length;T>0&&pu(T),hp()}function Mp(){_p(),c0(),Ra=null,Pr=null,Rr=null,Mu=null,La=null,Oa=null,Ua=!1,qa(),w0("restore"),hu(),kl()}function ja(T){var B;return[(B=zn())!=null?B:"",mn(),fi(),Cu.value,Ba(T),Xe.value.length,Math.round(zi(0,Xe.value.length)),Math.round(Lr()),mo.count,Math.round(mo.total)].join(":")}function U0(){return yn(this,null,function*(){var T,B,j,z;const Q=(T=s.virtualScroll)==null?void 0:T.settledToken,fe=Ba(Q),ve=mn(),we=zn(),Oe=Ks.value;if(qe.value&&((B=s.virtualScroll)==null?void 0:B.settleMode)==="manual"&&xu(Q))if(sp()){if(ja(Q)!==vl&&!Ua){Ua=!0;try{const Me=yield mp({reason:"manual",expectedSettledTokenKey:fe}),Fe=Ba()===fe;pp(ve,we,Oe)&&Me.sessionKey===ve&&Me.threadKey===we&&Fe&&Me.stable&&Me.phase==="final"&&(vl=ja((j=s.virtualScroll)==null?void 0:j.settledToken))}finally{Ua=!1,yield vt();const Me=(z=s.virtualScroll)==null?void 0:z.settledToken,Fe=xu(Me)?ja(Me):"";pp(ve,we,Oe)&&Fe&&vl!==Fe&&U0()}}}else cn("manual")})}Ge(qe,(T,B)=>{if(T!==B){if(!T)return Mp(),void _p();Mp(),Tp(),Cl=Ks.value,cn("content")}},{flush:"post"}),Ge([qe,Ks],([T,B])=>{T?Cl!=null?Cl!==B&&(Cl=B,(function(j="resize"){Sl(),gu(),vo(),Dt.clear();const z=Xe.value.length;z>0&&pu(z),hp(),Pr=null,Rr=null,Mu=null,Ra=null,Ua=!1,qa(),L0(),vt(()=>{hi(),Hi.value&&Ta(),jn.value&&bl(),cn(j)})})("resize")):Cl=B:Cl=null},{flush:"post",immediate:!0}),Ge([qe,()=>mn(),()=>zn()],([T])=>{T&&(Mp(),Tp(),w0("content"),cn("content"))}),Ge([qe,()=>mn(),()=>zn(),Ks,()=>Xe.value.length],([T])=>{T&&(function(B="async-node"){let j=!1;for(const[z,Q]of Array.from(Go.entries()))Qh(Q)||(Go.delete(z),zs.delete(z),j=!0);j&&(ml(),cn(B))})("async-node")},{flush:"post"}),Ge([qe,()=>{var T;return(T=s.virtualScroll)==null?void 0:T.sessionKey},()=>{var T;return(T=s.virtualScroll)==null?void 0:T.measurementKey},()=>s.indexKey,()=>Z.value],([T])=>{T&&(Fa(),(function(B="content"){if(!qe.value)return;const j=[],z=Xe.value.length;for(const Q of Array.from(Dt.keys())){if(Q>=z){j.push(Q);continue}const fe=Na(Q),ve=Dt.get(Q);ve!=null&&ve!==fe&&j.push(Q),Dt.set(Q,fe)}for(const Q of Array.from(Dt.keys()))Q>=z&&Dt.delete(Q);j.length&&((function(Q,fe={}){const ve=Array.from(Q,Number);mM(ve,fe)>0&&(function(Oe){for(const Me of Oe)Dt.delete(Me)})(ve)})(j,{notify:!1}),vo(),qa(),Hi.value&&Ta(),jn.value&&bl(),cn(B))})("content"))},{flush:"post",immediate:!0}),Ge([qe,()=>Xe.value.length,()=>mn(),()=>zn()],([T,B,j,z],[Q,fe,ve,we])=>{T&&Q&&j===ve&&z===we&&B!==fe&&qa()},{flush:"post"}),Ge([qe,()=>{var T;return(T=s.virtualScroll)==null?void 0:T.heightCache},()=>{var T;return(T=s.virtualScroll)==null?void 0:T.heightCacheWidth},()=>{var T;return(T=s.virtualScroll)==null?void 0:T.restoreState},()=>{var T;return(T=s.virtualScroll)==null?void 0:T.measurementKey},()=>Xe.value.length,()=>mn(),G],()=>{L0()},{flush:"post",immediate:!0}),Ge([qe,()=>{var T;return(T=s.virtualScroll)==null?void 0:T.restoreState},()=>{var T;return(T=s.virtualScroll)==null?void 0:T.restoreAnchor},()=>{var T;return(T=s.virtualScroll)==null?void 0:T.measurementKey},()=>Xe.value.length,()=>mn(),G],T=>yn(null,[T],function*([B,j]){if(!B||!j)return;yield vt();const z=(function(){var Q;const fe=(Q=s.virtualScroll)==null?void 0:Q.restoreAnchor;return fe==null||fe===!1?null:fe===!0?"true":String(fe)})();fp(j,{restoreAnchor:z!=null,restoreToken:z??void 0})}),{flush:"post",immediate:!0}),Ge([qe,G,()=>{var T;return(T=s.virtualScroll)==null?void 0:T.restoreState},()=>{var T;return(T=s.virtualScroll)==null?void 0:T.measurementKey}],([T])=>{var B;if(!T)return;const j=(B=s.virtualScroll)==null?void 0:B.restoreState;j&&Pr&&Rr==="restore"&&($0(j)||(Tp(),Pr=null,Rr=null,cn("resize")))},{flush:"post"}),Ge([qe,()=>Xe.value.length,()=>mn(),G],T=>yn(null,[T],function*([B]){var j;const z=La,Q=Oa;B&&z&&(yield vt(),!fp(z,{restoreAnchor:Q?.restoreAnchor===!0,restoreToken:(j=Q?.restoreToken)!=null?j:"imperative",allowUncapturedAnchor:Q?.allowUncapturedAnchor===!0})&&O0(z)||(La=null,Oa=null))}),{flush:"post",immediate:!0}),Ge([qe,U,()=>{var T;return(T=s.virtualScroll)==null?void 0:T.settleMode},()=>mn(),()=>zn(),Ks,Wh,o0,()=>q.value,yu,()=>mo.count,()=>mo.total],([T,B,j])=>{if(!T||B!==!0||j==="manual"||!op())return;const z=(function(){var Q;const fe=Xe.value.length;return[(Q=zn())!=null?Q:"",mn(),fi(),Cu.value,fe,Math.round(zi(0,fe)),Math.round(Lr()),mo.count,Math.round(mo.total)].join(":")})();Wa!==z&&(Wa=z,mp({reason:"final"}).then(Q=>{Q.stable||Wa!==z||(Wa=null)}))},{flush:"post",immediate:!0}),Ge([qe,U,()=>{var T;return(T=s.virtualScroll)==null?void 0:T.settleMode},()=>{var T;return(T=s.virtualScroll)==null?void 0:T.settledToken},()=>mn(),()=>zn(),Ks,Wh,o0,()=>q.value,yu,()=>Xe.value.length,()=>mo.count,()=>mo.total],()=>{U0()},{flush:"post",immediate:!0}),Ge([()=>Xe.value.length,he,$e,Aa,()=>ns.start,()=>ns.end],([T,B,j,z,Q,fe])=>{de.value&&Te("virtualization",{nodes:T,virtualization:B,maxLiveNodes:j,buffer:z,focusIndex:go.value,scroll:B?(()=>{const ve=Po.value||ge();return ve?{reverse:W(ve),scrollTop:Math.round(ve.scrollTop),scrollTopAbs:Math.round(Math.abs(ve.scrollTop)),scrollHeight:Math.round(ve.scrollHeight),clientHeight:Math.round(ve.clientHeight)}:null})():null,liveRange:{start:Q,end:fe},rendered:q.value})}),Ge([()=>b.customId],([T],B,j)=>{if(!T||Yn)return;const z=(function(Q,fe){return Q?(Vn.controllers[Q]=fe,()=>{Vn.controllers[Q]===fe&&delete Vn.controllers[Q]}):()=>{}})(T,{captureRestoreAnchor:Yv,restoreAnchor:Xv,getAnchorDrift:dM,getReport:wM});j(()=>{z()})},{immediate:!0}),qs(()=>{(function(){if(qe.value)try{hi(),Pa();const T=Or("manual");R0(T)&&(M(T),Ra=T,vp=Da());const B=yl(T,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});B&&(N(B),B.anchor&&D(B.anchor),_l=Ha(B))}catch{}})(),LM(),zh(),Ee(),W0();for(const T of Ui.values())for(const B of T)bu(B);Ui.clear(),$r.clear(),Dt.clear(),xp(),Sl(),Kh(),hu(),kl(),_p(),d0(),qh()});const OM=oi({loader:()=>yn(null,null,function*(){try{return(yield Qs(()=>import("./index11-BIywvtHR.js"),__vite__mapDeps([6,3]))).default}catch(T){return console.warn('[markstream-vue] Optional peer dependencies for MermaidBlockNode are missing. Falling back to preformatted code rendering. To enable Mermaid rendering, please install "mermaid".',T),Xs}}),loadingComponent:cU,delay:0}),PM=oi({loader:()=>yn(null,null,function*(){try{return(yield Qs(()=>import("./index10-Dh4SYXXK.js"),[])).default}catch(T){return console.warn('[markstream-vue] Failed to load InfographicBlockNode. Falling back to preformatted code rendering. To enable Infographic rendering, install "@antv/infographic" and configure setInfographicLoader with a dynamic loader.',T),Xs}}),loadingComponent:aU,delay:0}),RM=oi(()=>yn(null,null,function*(){try{return(yield Qs(()=>import("./index7-Zg1vvU3j.js"),[])).default}catch(T){return console.warn('[markstream-vue] Optional peer dependencies for D2BlockNode are missing. Falling back to preformatted code rendering. To enable D2 rendering, please install "@terrastruct/d2".',T),Xs}})),q0={text:En,paragraph:il,heading:If,code_block:xm,list:ua,list_item:ca,blockquote:Ed,table:Ac,definition_list:Id,footnote:$d,footnote_reference:so,footnote_anchor:Tc,admonition:Pd,vmr_container:Ld,hardbreak:gr,link:Es,image:mr,thematic_break:Nd,math_inline:jo,math_block:jT,strong:Ms,emphasis:Is,strikethrough:As,highlight:io,insert:Ws,subscript:Hs,superscript:Fs,emoji:Bs,checkbox:no,checkbox_input:no,inline_code:ys,html_inline:oo,reference:Ts,html_block:Mc},DM=H(()=>Zh()),j0=H(()=>pw(b.codeBlockProps)),BM=H(()=>pw(b.codeBlockProps,{omit:["langs"]})),z0=H(()=>tt(tt({stream:b.codeBlockStream,darkTheme:b.codeBlockDarkTheme,lightTheme:b.codeBlockLightTheme,monacoOptions:b.codeBlockMonacoOptions,themes:b.themes,langs:u.value==="shiki"?b.langs:void 0,minWidth:b.codeBlockMinWidth,maxWidth:b.codeBlockMaxWidth},typeof be.value=="boolean"?{showTooltips:be.value}:{}),BM.value)),V0=H(()=>tt(Ct(tt({},z0.value),{langs:b.langs}),j0.value));function K0(T){return typeof T=="boolean"?T:void 0}const FM=H(()=>{const T=b.codeBlockProps||{},B={},j=K0(T.showLineNumbers);j!==void 0&&(B.showLineNumbers=j);const z=K0(T.diffInline);z!==void 0&&(B.diffInline=z);const Q=(function(fe){const ve=Number(fe);return Number.isFinite(ve)&&ve>0?ve:void 0})(T.reservedHeightPx);return Q!==void 0&&(B.reservedHeightPx=Q),B}),HM=H(()=>tt(tt({stream:b.codeBlockStream,darkTheme:b.codeBlockDarkTheme,lightTheme:b.codeBlockLightTheme,themes:b.themes,langs:b.langs,minWidth:b.codeBlockMinWidth,maxWidth:b.codeBlockMaxWidth},typeof be.value=="boolean"?{showTooltips:be.value}:{}),j0.value)),WM=H(()=>tt({},b.mermaidProps||{})),G0=H(()=>tt({},b.d2Props||{})),UM=H(()=>tt({},b.infographicProps||{})),za=H(()=>({typewriter:b.typewriter,fade:b.fade,customHtmlTags:Sn.value.customHtmlTags})),qM=H(()=>tt(tt({},za.value),typeof be.value=="boolean"?{showTooltip:be.value}:{})),jM=H(()=>tt(tt({},za.value),typeof be.value=="boolean"?{showTooltips:be.value}:{})),zM=H(()=>tt(tt({},za.value),typeof be.value=="boolean"?{showTooltips:be.value}:{})),VM=H(()=>tt(tt({},za.value),typeof be.value=="boolean"?{showTooltips:be.value}:{}));function KM(T){return Array.isArray(T.children)&&T.children.length>0}const Ap=H(()=>_M.value.map(T=>{var B,j,z,Q,fe,ve,we,Oe;let Me=(function(ot){var rt,gt,pt,Wt,kt,At,Mt;if(ot.type!=="code_block")return ot;const Yt=ot,Gs=[String((rt=Yt.language)!=null?rt:""),String((gt=Yt.loading)!=null?gt:""),String((pt=Yt.diff)!=null?pt:""),String((Wt=Yt.code)!=null?Wt:""),String((kt=Yt.originalCode)!=null?kt:""),String((At=Yt.updatedCode)!=null?At:""),String((Mt=Yt.raw)!=null?Mt:"")].join("\0"),_s=ho.get(Yt);if(_s&&_s.signature===Gs)return _s.node;const Ro=tt({},Yt);return ho.set(Yt,{signature:Gs,node:Ro}),Ro})(T.node);const Fe=Iu(Me);let De=J0(Me,Fe);if((Me.type==="html_block"||Me.type==="html_inline")&&De===q0[Me.type]){const ot=Me,rt=String((B=ot.tag)!=null?B:"").trim().toLowerCase()||Lx(ot.content);if(rt){const gt=xt.value[rt];if(ln.value.has(rt)&>)De=gt,Me=Ct(tt({},ot),{type:rt,tag:rt,content:BR(ot.content,rt)});else if(Ox((j=ot.content)!=null?j:ot.raw,rt)){const pt=String((Q=(z=ot.content)!=null?z:ot.raw)!=null?Q:"");Me.type==="html_inline"?(De=En,Me={type:"text",content:pt,raw:pt}):(De=il,Me={type:"paragraph",children:[{type:"text",content:pt,raw:pt}],raw:pt})}}}const Ae=Me.type==="code_block"&&u.value==="pre"&&De===Xs&&!Ep(xt.value,Fe);let Be=tt({},(function(ot,rt,gt){const pt=rt??Iu(ot);if(ot.type==="code_block"){const Wt=pt?Ep(xt.value,pt):void 0;if(gt&&u.value==="pre"&&!Wt&>===Xs)return FM.value;if(gt&&pt&>===Wt)return pt==="mermaid"?X0(ot):pt==="infographic"?Z0(ot):pt==="d2"||pt==="d2lang"?G0.value:V0.value;if(gt&>===xt.value.code_block)return V0.value;if(m0(gt))return HM.value}return pt==="mermaid"?X0(ot):pt==="infographic"?Z0(ot):pt==="d2"||pt==="d2lang"?G0.value:ot.type==="link"?qM.value:ot.type==="list"?jM.value:ot.type==="blockquote"?zM.value:ot.type==="table"?VM.value:ot.type==="code_block"?z0.value:za.value})(Me,Fe,De));const ze=Nr.value[T.index];Me.type==="code_block"&&ze?.kind==="code-block"&&(Be=Ct(tt({},Be),Ae?{reservedHeightPx:(fe=ze.height)!=null?fe:ze.contentHeight}:{estimatedHeightPx:ze.height,estimatedContentHeightPx:ze.contentHeight})),Ae||Me.type!=="code_block"||Fe!=="mermaid"||Kl(Be.estimatedPreviewHeightPx)!=null||(Be=Ct(tt({},Be),{estimatedPreviewHeightPx:qg(Wg(String((ve=Me.code)!=null?ve:"")))})),Ae||Me.type!=="code_block"||Fe!=="infographic"||Kl(Be.estimatedPreviewHeightPx)!=null||(Be=Ct(tt({},Be),{estimatedPreviewHeightPx:jg(Ug(String((we=Me.code)!=null?we:"")))})),Me.type==="math_block"&&(Be=Ct(tt({},Be),{cacheScope:wn.value}));const Ve=(function(ot,rt){const gt=String(ot.type);return!uu(gt)&&xt.value[gt]===rt})(Me,De),ht=Ve?Iv(Me,xe.value):void 0;return Ct(tt({},T),{node:Me,component:De,bindings:Be,customBindings:tt(tt({},ht??{}),Be),rendersCustomNode:Ve,hasSlotChildren:KM(Me),slotContent:String((Oe=Me.content)!=null?Oe:""),isCodeBlock:Me.type==="code_block",indexKey:`${DM.value}-${T.index}`})}));function Iu(T){var B;return T?.type==="code_block"?String((B=T.language)!=null?B:"").trim().toLowerCase():""}function Ep(T,B){const j=B.trim().toLowerCase();if(j)for(const z of[j,Tv(j),AT(j)]){const Q=z&&T[z];if(Q)return Q}}function Y0(T,B,j,z){var Q,fe;const ve=tt({},T.value);return Kl(ve.estimatedPreviewHeightPx)==null&&(ve.estimatedPreviewHeightPx=z(j(String((Q=B?.code)!=null?Q:"")),void 0,ve.maxHeight==="none"?null:(fe=Kl(ve.maxHeight))!=null?fe:void 0)),ve}function X0(T){return Y0(WM,T,Wg,qg)}function Z0(T){return Y0(UM,T,Ug,jg)}function J0(T,B){if(!T)return e1;const j=xt.value,z=j[String(T.type)];if(T.type==="code_block"){const Q=B??Iu(T),fe=Q?Ep(j,Q):void 0;return fe||(u.value==="pre"?j.code_block||Xs:Q==="mermaid"?j.mermaid||OM:Q==="infographic"?j.infographic||PM:Q==="d2"||Q==="d2lang"?j.d2||RM:z||j.code_block||g0.value)}return z||q0[String(T.type)]||e1}function Ip(T){o("click",T)}function GM(T){var B;(B=T.target)!=null&&B.closest("[data-node-index]")&&o("mouseover",T)}function YM(T){var B;(B=T.target)!=null&&B.closest("[data-node-index]")&&o("mouseout",T)}function Q0(T){o("mouseover",T)}function ey(T){o("mouseout",T)}const Fr=se(null),Xo=se(!1);let Va,xl=null,$p=0,$u=0,Nu=0;const ty=["code_block","admonition","table","math_block","html_block","image","thematic_break"],XM=new Set(ty),ny=[".typewriter-cursor",".height-estimation-probes",...ty.map(T=>`[data-node-type="${T}"]`),"script","style"].join(",");function sy(T){if(!T||typeof T!="object")return!1;const B=T.type;return typeof B=="string"&&XM.has(B)}function Lu(T){var B,j;if(!T||typeof T!="object")return 0;const z=T,Q=(j=(B=z.raw)!=null?B:z.content)!=null?j:z.code;if(typeof Q=="string")return Q.length;const fe=z.children;if(Array.isArray(fe))return fe.reduce((we,Oe)=>we+Lu(Oe),0);const ve=z.items;return Array.isArray(ve)?ve.reduce((we,Oe)=>we+Lu(Oe),0):0}function Ou(){Va&&(clearTimeout(Va),Va=void 0)}function oy(){$p+=1,xl!=null&&(Nt?.(xl),xl=null)}function Pu(){oy(),Fr.value&&(Fr.value.style.visibility="hidden")}function ZM(T){var B;if(T.nodeType!==Node.TEXT_NODE||!((B=T.textContent)!=null?B:"").trim())return!1;const j=T.parentElement;return!!j&&!j.closest(ny)}function JM(T){let B=T.lastChild;for(;B;){if(ZM(B))return B;if(B.nodeType===Node.ELEMENT_NODE){const j=B;if(!j.matches(ny)&&j.lastChild){B=j.lastChild;continue}}for(;B&&B!==T&&!B.previousSibling;)B=B.parentNode;if(!B||B===T)break;B=B.previousSibling}return null}function Np(){if(!ye||!Xo.value||xl!=null)return;const T=$p,B=()=>{xl=null,T===$p&&(function(){var j,z;if(!(ye&&Xo.value&&$.value&&Fr.value))return;const Q=$.value,fe=Fr.value;fe.style.visibility="hidden";const ve=(function(){const De=Ap.value;for(let Ae=De.length-1;Ae>=0;Ae--){const Be=De[Ae];if(!Be||sy(Be.node)||!Sp(Be.index))continue;const ze=it.get(Be.index);if(!ze)continue;const Ve=JM(ze);if(Ve)return Ve}return null})();if(!ve)return;let we=0,Oe=0,Me=20,Fe=!1;if(ve?.textContent){const De=ve.textContent.length,Ae=document.createRange();Ae.setStart(ve,Math.max(0,De-1)),Ae.setEnd(ve,De);const Be=typeof Ae.getClientRects=="function"?Ae.getClientRects():void 0,ze=(z=Be?.[Be.length-1])!=null?z:(j=ve.parentElement)==null?void 0:j.getBoundingClientRect();if(ze){const Ve=et("typewriterCursor.root.getBoundingClientRect",()=>Q.getBoundingClientRect());we=ze.right-Ve.left+Q.scrollLeft,Oe=ze.top-Ve.top+Q.scrollTop,Me=ze.height||Me,Fe=!0}Ae.detach()}Fe&&(fe.style.transform=`translate(${Math.max(0,we)}px, ${Math.max(0,Oe)}px)`,fe.style.height=`${Me}px`,fe.style.visibility="visible")})()};It?xl=It(B):B()}return Ge([ae,()=>s.content,()=>s.nodes,()=>b.typewriter,U],()=>yn(null,null,function*(){var T,B;if(!ye||_e.value||!ee.value)return;if(U.value)return Xo.value=!1,Ou(),void Pu();if((T=s.nodes)!=null&&T.length)return Xo.value=!1,Ou(),Pu(),$u=((B=s.content)!=null?B:"").length,void(Nu=ae.value.length);const j=(function(){var we,Oe;return(we=s.nodes)!=null&&we.length?s.nodes.reduce((Me,Fe)=>Me+Lu(Fe),0):((Oe=s.content)!=null?Oe:"").length})(),z=(function(){var we;return(we=s.nodes)!=null&&we.length?s.nodes.reduce((Oe,Me)=>Oe+Lu(Me),0):ae.value.length})(),Q=!sy(Xe.value[Xe.value.length-1]),fe=j>$u,ve=z>Nu;if(b.typewriter===!1||!Q||!fe&&!ve)return b.typewriter!==!1&&Q||(Xo.value=!1,Pu()),$u=j,void(Nu=z);$u=j,Nu=z,Xo.value=!0,Fr.value&&(Fr.value.style.visibility="hidden"),Ou(),yield vt(),Np(),Va=setTimeout(()=>{Va=void 0,Xo.value=!1},3e3)}),{flush:"post",immediate:!0}),Ge(Xo,T=>yn(null,null,function*(){T?(yield vt(),Np()):Pu()}),{flush:"post"}),Ge([()=>q.value,()=>ns.start,()=>ns.end],()=>yn(null,null,function*(){ye&&!_e.value&&ee.value&&Xo.value&&(yield vt(),Np())}),{flush:"post"}),qs(()=>{Ou(),oy(),dn.clear()}),(T,B)=>{const j=x4("NodeRenderer",!0);return C(_e)?(x(!0),E(Ne,{key:0},Qe(Ap.value,z=>(x(),E(Ne,{key:z.index},[z.rendersCustomNode?(x(),Ke(gs(z.component),Qt({key:0,ref_for:!0},z.customBindings,{node:z.node,loading:z.node.loading,"index-key":z.indexKey,"custom-id":b.customId,"is-dark":b.isDark,onClick:Ip,onMouseover:Q0,onMouseout:ey,onCopy:B[0]||(B[0]=Q=>o("copy",Q)),onHandleArtifactClick:B[1]||(B[1]=Q=>o("handleArtifactClick",Q))}),{default:Mn(()=>[z.hasSlotChildren?(x(),Ke(j,Qt({key:0,ref_for:!0},Ln.value,{nodes:z.node.children,"index-key":z.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):z.slotContent?(x(),Ke(j,Qt({key:1,ref_for:!0},Ln.value,{content:z.slotContent,final:!z.node.loading,"index-key":`${z.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):le("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(x(),Ke(gs(z.component),Qt({key:1,node:z.node,loading:z.node.loading,"index-key":z.indexKey},{ref_for:!0},z.bindings,{"custom-id":b.customId,"is-dark":b.isDark,onClick:Ip,onMouseover:Q0,onMouseout:ey,onCopy:B[2]||(B[2]=Q=>o("copy",Q)),onHandleArtifactClick:B[3]||(B[3]=Q=>o("handleArtifactClick",Q))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(x(),E("div",{key:1,ref_key:"containerRef",ref:$,class:Ie(["markstream-vue markdown-renderer",[{dark:b.isDark},{virtualized:he.value},{"virtual-scroll-coordinated":Tt.value}]]),"data-custom-id":b.customId,onClick:Ip,onMouseover:GM,onMouseout:YM},[ao.value||he.value?(x(),E(Ne,{key:0},[ao.value?(x(),E("div",{key:0,class:"height-estimation-probes",style:Ft({width:`${ci.value}px`}),"aria-hidden":"true"},[m("div",{ref_key:"paragraphProbeWrapperRef",ref:O,class:"node-content","data-probe":"paragraph"},[bt(C(il),{node:Cn.value,"index-key":"probe-paragraph"},null,8,["node"])],512),m("div",{ref_key:"listItemProbeWrapperRef",ref:P,class:"node-content","data-probe":"list-item"},[m("ul",dU,[bt(C(ca),{node:fn.value,"index-key":"probe-list-item"},null,8,["node"])])],512),m("div",{ref_key:"listProbeWrapperRef",ref:R,class:"node-content","data-probe":"list"},[bt(C(ua),{node:Hn.value,"index-key":"probe-list"},null,8,["node"])],512),(x(),E(Ne,null,Qe(6,z=>m("div",{key:`probe-heading-${z}`,ref_for:!0,ref:Q=>(function(fe,ve){fe<1||fe>6||(F[fe]=ve)})(z,Q),class:"node-content","data-probe":`heading-${z}`},[bt(C(If),{node:yM(z),"index-key":`probe-heading-${z}`},null,8,["node","index-key"])],8,fU)),64))],4)):le("",!0),he.value?(x(),E("div",{key:1,class:"node-spacer",style:Ft({height:`${Yh.value}px`}),"aria-hidden":"true"},null,4)):le("",!0)],64)):le("",!0),(x(!0),E(Ne,null,Qe(Ap.value,z=>(x(),E("div",{key:z.index,ref_for:!0,ref:Q=>H0(z.index,Q),class:"node-slot","data-node-index":z.index,"data-node-type":z.node.type},[Sp(z.index)?(x(),E("div",{key:0,ref_for:!0,ref:Q=>(function(fe,ve){var we;ve||(function(De){const Ae=`${Zh()}-${De}`;let Be=!1;for(const ze of Array.from(zs.keys())){const Ve=Go.get(ze);(Ve?.index===De||ze===Ae||ze.startsWith(`${Ae}-`))&&(zs.delete(ze),Go.delete(ze),Be=!0)}Be&&(ml(),cn("async-node"))})(fe),di.delete(fe),(function(De){var Ae;const Be=((Ae=$r.get(De))!=null?Ae:0)+1;$r.set(De,Be)})(fe);const Oe=Ui.get(fe);if(Oe){for(const De of Oe)bu(De);Ui.delete(fe)}if((function(De){const Ae=Rt.get(De);Ae&&(pn?.unobserve(Ae),ts.delete(Ae),Rt.delete(De))})(fe),!ve||!We.value)return Ko.delete(fe),void $r.delete(fe);Ko.set(fe,ve);const Me=()=>{Eu(fe,ve)};queueMicrotask(Me);const Fe=(pn||typeof ResizeObserver>"u"||(pn=new ResizeObserver(De=>{if(De.length)for(const Ae of De){const Be=ts.get(Ae.target),ze=Rt.get(Be??-1);Be!=null&&ze&&Eu(Be,ze)}else hi()})),pn);if(Fe&&(Rt.set(fe,ve),ts.set(ve,fe),Fe.observe(ve)),typeof window<"u"){const De=((we=Xe.value[fe])==null?void 0:we.type)==="code_block"?[16,80,240,800]:U.value?[80]:[];if(De.length){const Ae=De.map(Be=>a0(Be,Me,"node-resize")).filter(Be=>Be!=null);Ae.length&&Ui.set(fe,Ae)}}})(z.index,Q),class:"node-content"},[z.isCodeBlock?z.rendersCustomNode?(x(),Ke(gs(z.component),Qt({key:1,ref_for:!0},z.customBindings,{node:z.node,loading:z.node.loading,"index-key":z.indexKey,"custom-id":b.customId,"is-dark":b.isDark,onCopy:B[8]||(B[8]=Q=>o("copy",Q)),onHandleArtifactClick:B[9]||(B[9]=Q=>o("handleArtifactClick",Q))}),{default:Mn(()=>[z.hasSlotChildren?(x(),Ke(j,Qt({key:0,ref_for:!0},Ln.value,{nodes:z.node.children,"index-key":z.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):z.slotContent?(x(),Ke(j,Qt({key:1,ref_for:!0},Ln.value,{content:z.slotContent,final:!z.node.loading,"index-key":`${z.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):le("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(x(),Ke(gs(z.component),Qt({key:2,node:z.node,loading:z.node.loading,"index-key":z.indexKey},{ref_for:!0},z.bindings,{"custom-id":b.customId,"is-dark":b.isDark,onCopy:B[10]||(B[10]=Q=>o("copy",Q)),onHandleArtifactClick:B[11]||(B[11]=Q=>o("handleArtifactClick",Q))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(x(),Ke(Pi,{key:0,name:"fade",css:b.fade!==!1,appear:b.fade!==!1},{default:Mn(()=>[z.rendersCustomNode?(x(),Ke(gs(z.component),Qt({key:0,ref_for:!0},z.customBindings,{node:z.node,loading:z.node.loading,"index-key":z.indexKey,"custom-id":b.customId,"is-dark":b.isDark,onCopy:B[4]||(B[4]=Q=>o("copy",Q)),onHandleArtifactClick:B[5]||(B[5]=Q=>o("handleArtifactClick",Q))}),{default:Mn(()=>[z.hasSlotChildren?(x(),Ke(j,Qt({key:0,ref_for:!0},Ln.value,{nodes:z.node.children,"index-key":z.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):z.slotContent?(x(),Ke(j,Qt({key:1,ref_for:!0},Ln.value,{content:z.slotContent,final:!z.node.loading,"index-key":`${z.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):le("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(x(),Ke(gs(z.component),Qt({key:1,node:z.node,loading:z.node.loading,"index-key":z.indexKey},{ref_for:!0},z.bindings,{"custom-id":b.customId,"is-dark":b.isDark,onCopy:B[6]||(B[6]=Q=>o("copy",Q)),onHandleArtifactClick:B[7]||(B[7]=Q=>o("handleArtifactClick",Q))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(x(),E("div",{key:1,class:"node-placeholder",style:Ft({height:`${Su(z.index)}px`})},null,4))],8,hU))),128)),Xo.value?(x(),E("span",{key:1,ref_key:"typewriterCursorRef",ref:Fr,class:"typewriter-cursor","aria-hidden":"true"},null,512)):le("",!0),he.value?(x(),E("div",{key:2,class:"node-spacer",style:Ft({height:`${Xh.value}px`}),"aria-hidden":"true"},null,4)):le("",!0)],42,uU))}}})),[["__scopeId","data-v-6eca2e33"]]),Us=s3;Us.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",Us.__name,Us.name].filter(n=>!!n));for(const n of t)e.component(n,s3)};const Dv=Object.freeze(Object.defineProperty({__proto__:null,default:Us},Symbol.toStringTag,{value:"Module"})),pU={key:0,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},mU={key:1,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},gU={key:2,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},vU={key:3,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},yU={class:"admonition-title"},kU=["aria-expanded","aria-controls"],bU=["id"],Pd=Jt(Je({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:t}){var n;const s=e,o=t,i=H(()=>{if(s.node.title&&s.node.title.trim().length)return s.node.title;const c=s.node.kind||"note";return c.charAt(0).toUpperCase()+c.slice(1)}),r=se(!!s.node.collapsible&&!((n=s.node.open)==null||n));function l(){s.node.collapsible&&(r.value=!r.value)}const a=`admonition-${Math.random().toString(36).slice(2,9)}`;return(c,u)=>(x(),E("div",{class:Ie(["admonition",[`admonition-${s.node.kind}`]])},[m("div",{id:a,class:"admonition-legend"},[s.node.kind==="note"||s.node.kind==="info"?(x(),E("svg",pU,[...u[1]||(u[1]=[m("circle",{cx:"12",cy:"12",r:"10"},null,-1),m("path",{d:"M12 16v-4"},null,-1),m("path",{d:"M12 8h.01"},null,-1)])])):s.node.kind==="tip"?(x(),E("svg",mU,[...u[2]||(u[2]=[m("path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5"},null,-1),m("path",{d:"M9 18h6"},null,-1),m("path",{d:"M10 22h4"},null,-1)])])):s.node.kind==="warning"||s.node.kind==="caution"?(x(),E("svg",gU,[...u[3]||(u[3]=[m("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"},null,-1),m("path",{d:"M12 9v4"},null,-1),m("path",{d:"M12 17h.01"},null,-1)])])):s.node.kind==="danger"||s.node.kind==="error"?(x(),E("svg",vU,[...u[4]||(u[4]=[m("polygon",{points:"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"},null,-1),m("path",{d:"M12 8v4"},null,-1),m("path",{d:"M12 16h.01"},null,-1)])])):le("",!0),m("span",yU,L(i.value),1),s.node.collapsible?(x(),E("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(x(),E("svg",{style:Ft({rotate:r.value?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[...u[5]||(u[5]=[m("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,kU)):le("",!0)]),Ot(m("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[bt(C(Us),{"index-key":`admonition-${e.indexKey}`,nodes:s.node.children,"custom-id":s.customId,typewriter:s.typewriter,fade:s.fade,onCopy:u[0]||(u[0]=d=>o("copy",d))},null,8,["index-key","nodes","custom-id","typewriter","fade"])],8,bU),[[Ho,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);Pd.install=e=>{e.component(Pd.__name,Pd)};const o3=()=>Qs(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let dd=null,_U=o3;function Xfe(){return yn(this,null,function*(){if(dd)return dd;const e=_U;if(!e)return null;let t;try{t=yield e()}catch(n){throw e===o3?new Error('Optional dependency "@terrastruct/d2" is not installed. Please install it to enable D2 diagrams.'):n}return t?(dd=(function(n){var s;if(!n)return n;if(n.D2&&typeof n.D2=="function")return n.D2;if(n.default&&n.default.D2&&typeof n.default.D2=="function")return n.default.D2;const o=(s=n.default)!=null?s:n;return typeof o=="function"?o:o?.D2&&typeof o.D2=="function"?o.D2:o})(t),dd):null})}function Zfe(){return!1}function Jfe(){return yn(this,null,function*(){return null})}const fd=se(!1);let xw=!1;function Pm(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function wU(){return!xw&&typeof window<"u"&&typeof document<"u"&&(xw=!0,fd.value=Pm(),new MutationObserver(()=>{fd.value=Pm()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{fd.value=Pm()})),fd}const i3=["cjs","css","csv","gif","htm","html","jpeg","jpg","js","json","jsx","log","md","mjs","pdf","png","scss","svg","ts","tsx","txt","vue","webp","xml","yaml","yml"],SU=new Set(["AGENTS.md","CHANGELOG.md","Dockerfile","LICENSE","Makefile","README.md","package.json","pnpm-lock.yaml","pnpm-workspace.yaml","tsconfig.json","vite.config.ts"]),i1=[...i3].sort((e,t)=>t.length-e.length).join("|"),Rm=new RegExp([String.raw`(?:^|[\s([{"'`+"`"+String.raw`])`,String.raw`(`,String.raw`(?:~|\.{1,2}|/)?(?:[A-Za-z0-9_.@+()[\]-]+/)+[A-Za-z0-9_.@+()[\]-]+(?:\.(?:${i1}))?`,String.raw`|`,String.raw`[A-Za-z0-9_.@+()[\]-]+\.(?:${i1})`,String.raw`)`,String.raw`(?:#L?(\d+)|:(\d+))?`,String.raw`(?=$|[\s)"'\]}>.,;!?,。;!?)])`].join(""),"gi"),r3=/[),.;!?,。;!?)]+$/;function CU(e){const t=e.toLowerCase();return i3.some(n=>t.endsWith(`.${n}`))}function xU(e){const t=new Map,n=new RegExp(String.raw`\b(?:path|src)=["'](\/[^"']+\.(?:${i1}))["']`,"gi");let s;for(;(s=n.exec(e))!==null;){const o=s[1];if(!o)continue;const i=o.split("/").pop();i&&t.set(i,o)}return t}function TU(e,t={}){const n=e.trim();if(!n||/^[a-z][a-z0-9+.-]*:\/\//i.test(n))return null;const s=n.match(/^(.*?)(?:#L?(\d+)|:(\d+))?$/i);if(!s)return null;let o=(s[1]??"").replace(r3,"");if(!o)return null;const i=o.split("/").pop()??o,r=o.includes("/"),l=SU.has(i),a=CU(i);if(r&&!l&&!a)return null;if(!r&&!l){const d=t.aliases?.get(i);if(!d)return null;o=d}const c=s[2]??s[3],u=c?Number(c):void 0;return{path:o,line:u!==void 0&&Number.isFinite(u)&&u>0?u:void 0}}function MU(e,t={}){const n=[];Rm.lastIndex=0;let s;for(;(s=Rm.exec(e))!==null;){const o=s[0]??"",i=s[1]??"",r=o.indexOf(i);if(r<0)continue;const l=s[2]??s[3];let a=i+(l?o.slice(r+i.length):"");const c=a.replace(r3,""),u=a.length-c.length;a=c;const d=TU(a,t);if(!d)continue;const h=s.index+r,p=h+a.length;n.push({...d,start:h,end:p,text:a}),u>0&&(Rm.lastIndex-=u)}return n}const AU=12e4,EU=6e4,IU=32,$U=3e4,Tw=/(^|\n)(`{3,}|~{3,})[^\n]*\n([\s\S]*?)(?:\n)?\2(?=\n|$)/g;function NU(e){let t=0,n=0,s=0;Tw.lastIndex=0;let o;for(;(o=Tw.exec(e))!==null;){const r=o[3]??"";t+=1,n+=r.length,s=Math.max(s,r.length)}return{codeRenderer:e.length>=AU||n>=EU||t>=IU||s>=$U?"pre":"shiki",codeFenceCount:t,codeChars:n}}const LU={key:1,class:"diff-wrap"},OU={class:"diff-bar"},PU=["title","onClick"],RU={class:"diff-pre"},DU="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",Mw="github-light",Aw="github-dark",BU=Je({__name:"Markdown",props:{text:{},openFile:{},streaming:{type:Boolean,default:!1}},setup(e){const{t}=St(),n=Pt("resolveImage"),s=se(null),o=e,i=H(()=>!o.streaming),r=H(()=>xU(o.text??"")),l=H(()=>o.streaming?{codeRenderer:"shiki",codeFenceCount:0,codeChars:0}:NU(o.text??"")),a=wU(),c=H(()=>!o.streaming),u=Js(new Map),d=new Set,h=/(!\[[^\]]*\]\()\s*([^)\s]+)([^)]*\))/g,p=/(<img\b[^>]*?\bsrc=")([^"]+)(")/gi;function f(O){return!/^(https?:|data:|blob:)/i.test(O)}function g(O){if(!n)return;const P=[];for(const R of[h,p]){R.lastIndex=0;let F;for(;(F=R.exec(O))!==null;)P.push(F[2]??"")}for(const R of P)!R||!f(R)||u.has(R)||d.has(R)||(d.add(R),n(R).then(F=>{u.set(R,F!==R?F:"")}).catch(()=>{u.set(R,"")}).finally(()=>{d.delete(R)}))}function w(O){if(!n)return O;const P=R=>{if(!f(R))return null;const F=u.get(R);return F===void 0?DU:F===""?null:F};return O.replace(h,(R,F,V,K)=>{const Z=P(V);return Z===null?R:`${F}${Z}${K}`}).replace(p,(R,F,V,K)=>{const Z=P(V);return Z===null?R:`${F}${Z}${K}`})}Ge(()=>o.text,O=>g(O??""),{immediate:!0});function S(){if(!s.value||!o.openFile||o.streaming)return;const O=document.createTreeWalker(s.value,NodeFilter.SHOW_TEXT),P=[];let R=O.nextNode();for(;R;){const F=R,V=F.parentElement;V&&!V.closest("a, pre, .md-file-link")&&F.data.trim().length>0&&P.push(F),R=O.nextNode()}for(const F of P){const V=MU(F.data,{aliases:r.value});if(V.length===0||!F.parentNode)continue;const K=document.createDocumentFragment();let Z=0;for(const G of V){G.start>Z&&K.append(document.createTextNode(F.data.slice(Z,G.start)));const X=document.createElement("button");X.type="button",X.className="md-file-link",X.textContent=G.text,X.title=G.line?`${G.path}:${G.line}`:G.path,X.addEventListener("click",pe=>{pe.preventDefault(),pe.stopPropagation(),o.openFile?.({path:G.path,line:G.line})}),K.append(X),Z=G.end}Z<F.data.length&&K.append(document.createTextNode(F.data.slice(Z))),F.parentNode.replaceChild(K,F)}}function y(O){return!(!O||/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(O))}function k(O){let P=O.length;for(const R of["#","?"]){const F=O.indexOf(R);F!==-1&&F<P&&(P=F)}return O.slice(0,P)}function v(){if(!s.value||!o.openFile||o.streaming)return;const O=s.value.querySelectorAll("a[href]");for(const P of O){if(P.dataset.mdLinkHandled==="true")continue;const R=P.getAttribute("href")??"";y(R)&&(P.dataset.mdLinkHandled="true",P.addEventListener("click",F=>{F.preventDefault(),F.stopPropagation(),o.openFile?.({path:k(R)})}))}}function _(){vt().then(()=>{S(),v()})}Ge(()=>o.text,_),Ge(()=>o.streaming,_);let I=null;tn(()=>{_(),s.value&&(I=new MutationObserver(_),I.observe(s.value,{childList:!0,subtree:!0}))}),Ht(()=>{I?.disconnect()});const A={showHeader:!0,showCopyButton:!0,showExpandButton:!1,showPreviewButton:!1,showCollapseButton:!1,showFontSizeButtons:!1,loading:!1},b=/(^|\n)(?:```|~~~)diff\b[^\n]*\n([\s\S]*?)(?:\n)?(?:```|~~~)(?=\n|$)/g,M=H(()=>{const O=w(o.text??""),P=[];let R=0;b.lastIndex=0;let F;for(;(F=b.exec(O))!==null;){const K=F[1]??"",Z=O.slice(R,F.index)+(K||"");Z.trim()&&P.push({kind:"md",text:Z}),P.push({kind:"diff",code:F[2]??""}),R=b.lastIndex}const V=O.slice(R);return(V.trim()||P.length===0)&&P.push({kind:"md",text:V}),P});function N(O){return O.split(`
|
|
223
|
-
`).map(P=>/^\+(?!\+\+)/.test(P)?{cls:"diff-add",text:P}:/^-(?!--)/.test(P)?{cls:"diff-del",text:P}:P.startsWith("@@")?{cls:"diff-hunk",text:P}:{cls:"diff-ctx",text:P})}const D=se(null);function $(O,P){xs(O).then(R=>{R&&(D.value=P,setTimeout(()=>{D.value=null},1400))})}return(O,P)=>(x(),E("div",{ref_key:"mdRef",ref:s,class:"md"},[(x(!0),E(Ne,null,Qe(M.value,(R,F)=>(x(),E(Ne,{key:F},[R.kind==="md"?(x(),Ke(C(Us),{key:0,content:R.text,mode:"chat","code-renderer":l.value.codeRenderer,"is-dark":C(a),"code-block-light-theme":Mw,"code-block-dark-theme":Aw,themes:[Mw,Aw],"code-block-props":A,final:i.value,"smooth-streaming":e.streaming,"batch-rendering":c.value,"defer-nodes-until-visible":!1},null,8,["content","code-renderer","is-dark","themes","final","smooth-streaming","batch-rendering"])):(x(),E("div",LU,[m("div",OU,[P[0]||(P[0]=m("span",{class:"diff-lang"},"diff",-1)),m("button",{class:"diff-copy",title:C(t)("filePreview.copyCode"),onClick:V=>$(R.code,F)},L(D.value===F?"✓":"⧉"),9,PU)]),m("pre",RU,[m("code",null,[(x(!0),E(Ne,null,Qe(N(R.code),(V,K)=>(x(),E("span",{key:K,class:Ie(V.cls)},L(V.text),3))),128))])])]))],64))),128))],512))}}),Lf=wt(BU,[["__scopeId","data-v-5314bac6"]]),FU={class:"tc-anim"},HU={class:"prev-anim"},WU={class:"prev"},UU=Je({__name:"ThinkingBlock",props:{text:{},mobile:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1},foldable:{type:Boolean,default:!0}},emits:["open"],setup(e,{emit:t}){const n=e,s=t,o=H(()=>n.text.split(/\n{2,}/).filter(c=>c.trim().length>0)),i=H(()=>n.foldable&&o.value.length>1),r=H(()=>n.streaming||!i.value),l=H(()=>o.value.pop()??""),a=se(null);return tn(()=>{if(!n.streaming)return;const c=a.value;c&&(c.scrollTop=c.scrollHeight)}),Ge(()=>n.text,()=>{const c=a.value;!c||!(c.scrollHeight-c.scrollTop-c.clientHeight<24)||vt(()=>{a.value&&(a.value.scrollTop=a.value.scrollHeight)})},{immediate:!0}),(c,u)=>(x(),E("div",{class:Ie(["think",{mob:e.mobile}])},[i.value?(x(),E("div",{key:0,class:Ie(["tc-wrap",{"is-collapsed":!r.value}]),onClick:u[0]||(u[0]=d=>s("open"))},[m("div",FU,[m("pre",{ref_key:"bodyEl",ref:a,class:"tc"},L(e.text),513)]),m("div",HU,[m("span",WU,L(l.value),1)])],2)):(x(),E("pre",{key:1,ref_key:"bodyEl",ref:a,class:"tc"},L(e.text),513))],2))}}),Ew=wt(UU,[["__scopeId","data-v-42c6573c"]]),qU={class:"activity-notice",role:"status"},jU={class:"an-moon","aria-hidden":"true"},zU={class:"an-label"},VU=120,KU=Je({__name:"ActivityNotice",props:{label:{}},setup(e){const t=["🌑","🌒","🌓","🌔","🌕","🌖","🌗","🌘"],n=se(0);let s=null;return tn(()=>{s=setInterval(()=>{n.value=(n.value+1)%t.length},VU)}),Ht(()=>{s&&(clearInterval(s),s=null)}),(o,i)=>(x(),E("div",qU,[m("span",jU,L(t[n.value]),1),m("span",zU,L(e.label),1)]))}}),Iw=wt(KU,[["__scopeId","data-v-dfa53d2b"]]),GU=["disabled"],YU={class:"agent-main"},XU={class:"agent-title-row"},ZU={class:"agent-name"},JU={key:0,class:"agent-type"},QU={class:"agent-phase"},eq={key:0,class:"agent-chevron",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},tq=Je({__name:"AgentCard",props:{member:{},compact:{type:Boolean}},emits:["open"],setup(e,{emit:t}){const n=e,s=t,o=H(()=>(n.member.outputLines??[]).map(u=>u.trimEnd()).filter(u=>u.length>0).slice(-8)),i=H(()=>o.value.at(-1)),r=H(()=>n.member.phase==="queued"||n.member.phase==="working"||n.member.phase==="suspended"),l=H(()=>!!(n.member.summary||n.member.suspendedReason||n.member.prompt||o.value.length>0));function a(u){switch(u){case"queued":return"Queued";case"working":return"Working";case"suspended":return"Suspended";case"completed":return"Completed";case"failed":return"Failed"}}function c(){l.value&&s("open",n.member.id)}return(u,d)=>(x(),E("div",{class:Ie(["agent-card",[`phase-${e.member.phase}`,{compact:e.compact}]])},[m("button",{class:"agent-head",type:"button",disabled:!l.value,onClick:c},[d[1]||(d[1]=m("span",{class:"agent-dot","aria-hidden":"true"},null,-1)),m("span",YU,[m("span",XU,[m("span",ZU,L(e.member.name),1),e.member.subagentType?(x(),E("span",JU,L(e.member.subagentType),1)):le("",!0),r.value?(x(),E("span",{key:1,class:Ie(["agent-live",{empty:!i.value}])},L(i.value),3)):le("",!0)])]),m("span",QU,L(a(e.member.phase)),1),l.value?(x(),E("svg",eq,[...d[0]||(d[0]=[m("path",{d:"M6 4l4 4-4 4"},null,-1)])])):le("",!0)],8,GU)],2))}}),r1=wt(tq,[["__scopeId","data-v-bb535d33"]]),nq={class:"agent-group"},sq={class:"group-count"},oq={key:0,class:"group-live"},iq={key:0,class:"group-body"},rq=Je({__name:"AgentGroup",props:{members:{}},emits:["open"],setup(e,{emit:t}){const n=e,s=t,o=se(!0),i=H(()=>n.members.filter(l=>l.phase==="completed"||l.phase==="failed").length),r=H(()=>n.members.filter(l=>l.phase==="queued"||l.phase==="working"||l.phase==="suspended").length);return(l,a)=>(x(),E("section",nq,[m("button",{class:"group-head",type:"button",onClick:a[0]||(a[0]=c=>o.value=!o.value)},[a[3]||(a[3]=m("span",{class:"group-title"},"Agents",-1)),m("span",sq,L(i.value)+"/"+L(e.members.length),1),r.value>0?(x(),E("span",oq,L(r.value)+" running",1)):le("",!0),(x(),E("svg",{class:Ie(["group-chevron",{open:o.value}]),viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...a[2]||(a[2]=[m("path",{d:"M6 4l4 4-4 4"},null,-1)])],2))]),o.value?(x(),E("div",iq,[(x(!0),E(Ne,null,Qe(e.members,c=>(x(),Ke(r1,{key:c.id,member:c,compact:"",onOpen:a[1]||(a[1]=u=>s("open",u))},null,8,["member"]))),128))])):le("",!0)]))}}),$w=wt(rq,[["__scopeId","data-v-17ab3c41"]]),lq=["aria-label"],aq=120,cq=60,uq=Je({__name:"MoonSpinner",props:{fast:{type:Boolean},label:{default:"Working…"}},setup(e){const t=["🌑","🌒","🌓","🌔","🌕","🌖","🌗","🌘"];function n(s){return{"--moon-frame-delay":`${s*aq}ms`,"--moon-frame-fast-delay":`${s*cq}ms`}}return(s,o)=>(x(),E("span",{class:Ie(["moon-spin",{"moon-spin--fast":e.fast}]),"aria-label":e.label,role:"img"},[(x(),E(Ne,null,Qe(t,(i,r)=>m("span",{key:i,class:"moon-frame",style:Ft(n(r)),"aria-hidden":"true"},L(i),5)),64))],10,lq))}}),l1=wt(uq,[["__scopeId","data-v-e7ccbb9a"]]);function dq(e,t="昨天"){try{const n=new Date(e);if(Number.isNaN(n.getTime()))return e;const s=new Date,o=u=>String(u).padStart(2,"0"),i=`${o(n.getHours())}:${o(n.getMinutes())}`,r=n.getFullYear()===s.getFullYear(),l=n.getMonth()===s.getMonth(),a=n.getDate()===s.getDate();if(r&&l&&a)return i;const c=new Date(s);return c.setDate(s.getDate()-1),n.getFullYear()===c.getFullYear()&&n.getMonth()===c.getMonth()&&n.getDate()===c.getDate()?`${t} ${i}`:r?`${o(n.getMonth()+1)}-${o(n.getDate())} ${i}`:`${n.getFullYear()}-${o(n.getMonth()+1)}-${o(n.getDate())} ${i}`}catch{return e}}function Nw(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function Lw(e){if(e<1e3)return`${e}ms`;if(e<6e4)return`${(e/1e3).toFixed(1)}s`;const t=Math.floor(e/6e4),n=(e%6e4/1e3).toFixed(1);return`${t}m${n}s`}function Th(e){if(e.blocks)return e.blocks;const t=[];e.thinking&&t.push({kind:"thinking",thinking:e.thinking}),e.text&&t.push({kind:"text",text:e.text});for(const n of e.tools??[])t.push({kind:"tool",tool:n});return t}function fq(e){return!(e.tool.status==="ok"&&e.tool.media)}function Ow(e,t){return t<=1?"single":e===0?"first":e===t-1?"last":"middle"}function Pw(e){const t=Th(e),n=[];let s=[];const o=()=>{if(s.length===1){const[i]=s;i&&n.push({kind:"tool",tool:i.tool,sourceIndex:i.sourceIndex})}else s.length>1&&n.push({kind:"tool-stack",tools:s});s=[]};return t.forEach((i,r)=>{if(i.kind==="tool"){if(fq(i)){s.push({tool:i.tool,sourceIndex:r});return}o(),n.push({kind:"tool",tool:i.tool,sourceIndex:r});return}o(),i.kind==="thinking"?n.push({kind:"thinking",thinking:i.thinking,sourceIndex:r}):i.kind==="text"?n.push({kind:"text",text:i.text,sourceIndex:r}):i.kind==="agent"?n.push({kind:"agent",member:i.member,sourceIndex:r}):n.push({kind:"agentGroup",members:i.members,sourceIndex:r})}),o(),n}function hq(e){return Th(e).flatMap(t=>t.kind==="text"&&t.text?[t.text]:[]).join(`
|
|
224
|
-
|
|
225
|
-
`)}function pq(e){const t=[];for(const n of Th(e))if(n.kind==="thinking"&&n.thinking)t.push(`> **Thinking**
|
|
226
|
-
> ${n.thinking.split(`
|
|
227
|
-
`).join(`
|
|
228
|
-
> `)}`);else if(n.kind==="text"&&n.text)t.push(n.text);else if(n.kind==="tool"&&n.tool.output&&n.tool.output.length>0){const s=n.tool.output.join(`
|
|
229
|
-
`);t.push(`\`\`\`
|
|
230
|
-
[${n.tool.name}]
|
|
231
|
-
${s}
|
|
232
|
-
\`\`\``)}else n.kind==="agent"?t.push(`**Agent** ${n.member.name} (${n.member.phase})`):n.kind==="agentGroup"&&t.push(`**Agents**
|
|
233
|
-
|
|
234
|
-
${n.members.map(s=>`- ${s.name}: ${s.phase}`).join(`
|
|
235
|
-
`)}`);return t.join(`
|
|
236
|
-
|
|
237
|
-
`)}function a1(e){return e.tool.id||`tool-${e.sourceIndex}`}function Rw(e,t){return e.kind==="tool-stack"?`tool-stack-${e.tools[0]?.sourceIndex??t}`:e.kind==="tool"?a1({tool:e.tool,sourceIndex:e.sourceIndex}):e.kind==="agent"?`agent-${e.member.id}-${e.sourceIndex}`:e.kind==="agentGroup"?`agent-group-${e.members[0]?.id??e.sourceIndex}`:`${e.kind}-${e.sourceIndex}`}const mq={key:0,class:"chat"},gq={key:0,class:"chat-loading"},vq={class:"chat-loading-text"},yq={key:1,class:"chat-empty"},kq={key:1,class:"top-sentinel-text"},bq=["data-turn-id"],_q={key:0,class:"u-imgs"},wq=["src"],Sq=["src","alt"],Cq={key:1,class:"skill-act"},xq={class:"skill-act-head"},Tq={key:0,class:"skill-act-args"},Mq={key:2,class:"u-text"},Aq={key:0,class:"u-meta"},Eq=["data-tooltip","onClick"],Iq={class:"u-edit-text"},$q=["onClick"],Nq=["onClick"],Lq=["data-turn-id"],Oq=["onClick"],Pq={class:"cd-view"},Rq={key:1,class:"cd-label"},Dq=["data-turn-id"],Bq={key:1,class:"msg"},Fq={key:2,class:"tool-stack"},Hq={key:0,class:"a-msg-ft"},Wq=["title"],Uq=["onClick"],qq={key:0,viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},jq={key:1,viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},zq={class:"a-cpbtn-text"},Vq={key:4,class:"sending-placeholder"},Kq={key:1,class:"term"},Gq={key:0,class:"chat-loading"},Yq={class:"chat-loading-text"},Xq={key:1,class:"chat-empty"},Zq={key:1,class:"top-sentinel-text"},Jq=["data-turn-id"],Qq=["onClick"],ej={class:"cd-view"},tj={key:1,class:"cd-label"},nj=["data-turn-id"],sj={class:"no"},oj={class:"tx"},ij={class:"role-row"},rj=["onClick"],lj={key:0,viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},aj={key:1,viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},cj={class:"cpbtn-text"},uj=["title"],dj={key:0,class:"u-text"},fj={key:0,class:"skill-act"},hj={class:"skill-act-head"},pj={key:0,class:"skill-act-args"},mj={key:2,class:"tool-stack"},gj=["data-tooltip","onClick"],vj={class:"u-edit-text"},yj=["onClick"],kj={key:4,class:"ln sending-line"},bj={class:"tx"},_j=Je({__name:"ChatPane",props:{turns:{},approvals:{default:()=>[]},bubble:{type:Boolean,default:!1},mobile:{type:Boolean,default:!1},running:{type:Boolean,default:!1},sending:{type:Boolean,default:!1},fastMoon:{type:Boolean,default:!1},sessionLoading:{type:Boolean},compaction:{default:null},hasMoreMessages:{type:Boolean,default:!1},loadingMore:{type:Boolean,default:!1},loadingMoreError:{type:Boolean,default:!1},isFollowing:{type:Boolean,default:!1}},emits:["openFile","openMedia","copyConversationCopied","openThinking","openCompaction","openAgent","editMessage","loadOlderMessages"],setup(e,{expose:t,emit:n}){const{t:s}=St();Ht(()=>{F!==null&&(clearTimeout(F),F=null),M!==null&&(clearTimeout(M),M=null),y!==null&&(clearTimeout(y),y=null)});const o=e,i=H(()=>o.bubble||o.mobile),r=se(null);let l=null;function a(){!r.value||typeof IntersectionObserver>"u"||(l?.disconnect(),l=new IntersectionObserver(Z=>{Z[0]?.isIntersecting&&o.hasMoreMessages&&!o.loadingMore&&!o.loadingMoreError&&!o.sessionLoading&&!o.isFollowing&&d("loadOlderMessages")},{root:null,rootMargin:"200px 0px 0px 0px",threshold:0}),l.observe(r.value))}tn(a),Ht(()=>{l?.disconnect(),l=null}),Ge(()=>[o.hasMoreMessages,o.loadingMore,o.loadingMoreError],()=>{vt().then(a)});const c=H(()=>{if(!o.running||o.turns.length===0)return null;const Z=o.turns.at(-1);return Z.role==="assistant"?Z.id:null}),u=H(()=>o.sending||o.running),d=n,h=H(()=>{for(let Z=o.turns.length-1;Z>=0;Z--)if(o.turns[Z].role==="user")return o.turns[Z].id;return null});function p(Z){return Z.role==="user"&&Z.id===h.value&&!o.running&&!o.sending&&!Z.skillActivation}function f(Z){const G=Z.compaction,X=G?.trigger==="auto"?s("conversation.compactedAuto"):s("conversation.compactedPlain");return typeof G?.tokensBefore=="number"&&typeof G?.tokensAfter=="number"?X+s("conversation.compactedTokens",{before:Nw(G.tokensBefore),after:Nw(G.tokensAfter)}):X}const g=se(null),w=se(null),S=se(null);let y=null;const k=se(new Set);function v(Z){return k.value.has(Z)}function _(Z){const G=new Set(k.value);G.has(Z)?G.delete(Z):G.add(Z),k.value=G}function I(Z,G){if(v(G)){const X=new Date(Z);if(Number.isNaN(X.getTime()))return Z;const pe=oe=>String(oe).padStart(2,"0");return`${X.getFullYear()}-${pe(X.getMonth()+1)}-${pe(X.getDate())} ${pe(X.getHours())}:${pe(X.getMinutes())}`}return dq(Z,s("conversation.yesterday"))}function A(Z){S.value===null&&(w.value=null,S.value=Z.id,y=setTimeout(()=>{y=null,d("editMessage",Z.text),S.value=null},240))}const b=se(!1);let M=null;function N(){if(o.turns.length===0)return;const Z=[];for(const X of o.turns){if(X.role==="compaction")continue;const pe=X.role==="user"?"User":"Assistant",oe=pq(X);oe.trim()&&Z.push(`**${pe}**
|
|
238
|
-
|
|
239
|
-
${oe}`)}const G=Z.join(`
|
|
240
|
-
|
|
241
|
-
---
|
|
242
|
-
|
|
243
|
-
`);xs(G).then(X=>{X&&(b.value=!0,d("copyConversationCopied"),M!==null&&clearTimeout(M),M=setTimeout(()=>{M=null,b.value=!1},2e3))}).catch(()=>{})}function D(Z){const G=[];for(let X=Z;X>=0;X--){const pe=o.turns[X];if(!pe||pe.role!=="assistant")break;G.unshift(pe)}return G}function $(Z){return D(Z).map(G=>hq(G)).filter(Boolean).join(`
|
|
244
|
-
|
|
245
|
-
`)}function O(){for(let Z=o.turns.length-1;Z>=0;Z-=1)if(o.turns[Z]?.role==="assistant")return $(Z);return""}function P(){const Z=O();Z.trim()&&xs(Z).then(G=>{G&&(b.value=!0,d("copyConversationCopied"),M!==null&&clearTimeout(M),M=setTimeout(()=>{M=null,b.value=!1},2e3))}).catch(()=>{})}t({copyConversation:N,copyFinalSummary:P});function R(Z){const G=o.turns[Z];if(!G||G.role!=="assistant")return!1;const X=o.turns[Z+1];return!X||X.role!=="assistant"}let F=null;function V(Z){const G=o.turns[Z];if(!G)return;const X=$(Z);X.trim()&&xs(X).then(pe=>{pe&&(g.value=G.id,F!==null&&clearTimeout(F),F=setTimeout(()=>{F=null,g.value=null},1400))}).catch(()=>{})}function K(Z,G){return Z.id!==c.value?!1:G.sourceIndex===Th(Z).length-1}return(Z,G)=>i.value?(x(),E("div",mq,[e.sessionLoading?(x(),E("div",gq,[G[10]||(G[10]=m("span",{class:"dot-pulse","aria-hidden":"true"},null,-1)),m("span",vq,L(C(s)("conversation.loading")),1)])):e.turns.length===0&&(!e.approvals||e.approvals.length===0)?(x(),E("div",yq)):le("",!0),e.hasMoreMessages||e.loadingMore?(x(),E("div",{key:2,ref_key:"topSentinelRef",ref:r,class:Ie(["top-sentinel",{"top-sentinel-loading":e.loadingMore}])},[e.loadingMore?(x(),E("span",kq,[G[11]||(G[11]=m("span",{class:"dot-pulse","aria-hidden":"true"},null,-1)),yt(" "+L(C(s)("conversation.loadingOlder")),1)])):(x(),E("button",{key:0,type:"button",class:"top-sentinel-btn",onClick:G[0]||(G[0]=X=>d("loadOlderMessages"))},L(C(s)("conversation.loadOlder")),1))],2)):le("",!0),(x(!0),E(Ne,null,Qe(e.turns,(X,pe)=>(x(),E(Ne,{key:X.id},[X.role==="user"?(x(),E(Ne,{key:0},[m("div",{class:Ie(["u-bub turn-anchor",{undoing:S.value===X.id}]),"data-turn-id":X.id},[X.images&&X.images.length>0?(x(),E("div",_q,[(x(!0),E(Ne,null,Qe(X.images,(oe,ye)=>(x(),E(Ne,{key:ye},[oe.kind==="video"?(x(),E("video",{key:0,class:"u-img",src:oe.url,controls:"",playsinline:"",preload:"metadata"},null,8,wq)):(x(),E("img",{key:1,class:"u-img",src:oe.url,alt:oe.alt||"",loading:"lazy"},null,8,Sq))],64))),128))])):le("",!0),X.skillActivation?(x(),E("div",Cq,[m("div",xq,[G[12]||(G[12]=m("span",{class:"skill-act-arrow"},"▶",-1)),m("span",null,L(C(s)("conversation.activatedSkill",{name:X.skillActivation.name})),1)]),X.skillActivation.args?(x(),E("div",Tq,L(X.skillActivation.args),1)):le("",!0)])):(x(),E("div",Mq,L(X.text),1))],10,bq),X.createdAt||p(X)?(x(),E("div",Aq,[p(X)?(x(),E("div",{key:0,class:Ie(["u-edit-wrap",{undoing:S.value===X.id}])},[w.value!==X.id?(x(),E("button",{key:0,type:"button",class:"u-edit","data-tooltip":C(s)("conversation.undoTooltip"),onClick:oe=>w.value=X.id},[m("span",Iq,L(C(s)("conversation.undo")),1),G[13]||(G[13]=m("svg",{viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("path",{d:"M6.5 2.5 3 6l3.5 3.5"}),m("path",{d:"M3 6h6.5a3.8 3.8 0 1 1 0 7.6H7.5"})],-1))],8,Eq)):(x(),E("div",{key:1,class:"u-edit-confirm",onClick:G[2]||(G[2]=Ze(()=>{},["stop"]))},[m("span",null,L(C(s)("conversation.undoConfirm")),1),m("button",{type:"button",class:"u-edit-confirm-btn confirm",onClick:Ze(oe=>A(X),["stop"])},L(C(s)("conversation.confirm")),9,$q),m("button",{type:"button",class:"u-edit-confirm-btn",onClick:G[1]||(G[1]=Ze(oe=>w.value=null,["stop"]))},L(C(s)("conversation.cancel")),1)]))],2)):le("",!0),X.createdAt?(x(),E("button",{key:1,type:"button",class:"u-time",onClick:Ze(oe=>_(X.id),["stop"])},L(I(X.createdAt,X.id)),9,Nq)):le("",!0)])):le("",!0)],64)):X.role==="compaction"?(x(),E("div",{key:1,class:"compact-divider turn-anchor","data-turn-id":X.id,role:"separator"},[G[14]||(G[14]=m("span",{class:"cd-line","aria-hidden":"true"},null,-1)),X.text?(x(),E("button",{key:0,type:"button",class:"cd-label cd-btn",onClick:oe=>d("openCompaction",{turnId:X.id})},[m("span",null,L(f(X)),1),m("span",Pq,L(C(s)("conversation.viewSummary")),1)],8,Oq)):(x(),E("span",Rq,L(f(X)),1)),G[15]||(G[15]=m("span",{class:"cd-line","aria-hidden":"true"},null,-1))],8,Lq)):(x(),E("div",{key:2,class:"a-msg turn-anchor","data-turn-id":X.id},[(x(!0),E(Ne,null,Qe(C(Pw)(X),(oe,ye)=>(x(),E(Ne,{key:C(Rw)(oe,ye)},[oe.kind==="thinking"?(x(),Ke(Ew,{key:0,text:oe.thinking,mobile:i.value,streaming:K(X,oe),onOpen:_e=>d("openThinking",{turnId:X.id,blockIndex:oe.sourceIndex})},null,8,["text","mobile","streaming","onOpen"])):oe.kind==="text"&&oe.text?(x(),E("div",Bq,[bt(Lf,{text:oe.text,streaming:K(X,oe),"open-file":_e=>d("openFile",_e)},null,8,["text","streaming","open-file"])])):oe.kind==="tool-stack"?(x(),E("div",Fq,[(x(!0),E(Ne,null,Qe(oe.tools,(_e,de)=>(x(),Ke(Zu,{key:C(a1)(_e),tool:_e.tool,mobile:i.value,"stack-position":C(Ow)(de,oe.tools.length),onOpenMedia:G[3]||(G[3]=be=>d("openMedia",be))},null,8,["tool","mobile","stack-position"]))),128))])):oe.kind==="agent"?(x(),Ke(r1,{key:3,member:oe.member,onOpen:_e=>d("openAgent",{turnId:X.id,blockIndex:oe.sourceIndex,memberId:_e})},null,8,["member","onOpen"])):oe.kind==="agentGroup"?(x(),Ke($w,{key:4,members:oe.members,onOpen:_e=>d("openAgent",{turnId:X.id,blockIndex:oe.sourceIndex,memberId:_e})},null,8,["members","onOpen"])):oe.kind==="tool"?(x(),Ke(Zu,{key:5,tool:oe.tool,mobile:i.value,onOpenMedia:G[4]||(G[4]=_e=>d("openMedia",_e))},null,8,["tool","mobile"])):le("",!0)],64))),128)),X.id!==c.value&&R(pe)&&($(pe).trim().length>0||X.durationMs!==void 0)?(x(),E("div",Hq,[X.durationMs!==void 0?(x(),E("span",{key:0,class:"a-duration",title:`${X.durationMs} ms`},L(C(Lw)(X.durationMs)),9,Wq)):le("",!0),$(pe).trim().length>0?(x(),E("button",{key:1,class:"a-cpbtn",tabindex:"-1",onClick:oe=>V(pe)},[g.value!==X.id?(x(),E("svg",qq,[...G[16]||(G[16]=[m("rect",{x:"3",y:"3",width:"9",height:"9",rx:"1.5"},null,-1),m("path",{d:"M6 1h7a1 1 0 0 1 1 1v7"},null,-1)])])):(x(),E("svg",jq,[...G[17]||(G[17]=[m("polyline",{points:"3,8 6.5,11.5 13,5"},null,-1)])])),m("span",zq,L(C(s)("filePreview.copy")),1)],8,Uq)):le("",!0)])):le("",!0)],8,Dq))],64))),128)),e.compaction?(x(),Ke(Iw,{key:3,label:C(s)("conversation.compacting")},null,8,["label"])):le("",!0),u.value?(x(),E("div",Vq,[bt(l1,{fast:e.fastMoon},null,8,["fast"])])):le("",!0)])):(x(),E("div",Kq,[e.sessionLoading?(x(),E("div",Gq,[G[18]||(G[18]=m("span",{class:"dot-pulse","aria-hidden":"true"},null,-1)),m("span",Yq,L(C(s)("conversation.loading")),1)])):e.turns.length===0&&(!e.approvals||e.approvals.length===0)?(x(),E("div",Xq)):le("",!0),e.hasMoreMessages||e.loadingMore?(x(),E("div",{key:2,ref_key:"topSentinelRef",ref:r,class:Ie(["top-sentinel",{"top-sentinel-loading":e.loadingMore}])},[e.loadingMore?(x(),E("span",Zq,[G[19]||(G[19]=m("span",{class:"dot-pulse","aria-hidden":"true"},null,-1)),yt(" "+L(C(s)("conversation.loadingOlder")),1)])):(x(),E("button",{key:0,type:"button",class:"top-sentinel-btn",onClick:G[5]||(G[5]=X=>d("loadOlderMessages"))},L(C(s)("conversation.loadOlder")),1))],2)):le("",!0),(x(!0),E(Ne,null,Qe(e.turns,(X,pe)=>(x(),E(Ne,{key:X.id},[X.role==="compaction"?(x(),E("div",{key:0,class:"compact-divider turn-anchor","data-turn-id":X.id,role:"separator"},[G[20]||(G[20]=m("span",{class:"cd-line","aria-hidden":"true"},null,-1)),X.text?(x(),E("button",{key:0,type:"button",class:"cd-label cd-btn",onClick:oe=>d("openCompaction",{turnId:X.id})},[m("span",null,L(f(X)),1),m("span",ej,L(C(s)("conversation.viewSummary")),1)],8,Qq)):(x(),E("span",tj,L(f(X)),1)),G[21]||(G[21]=m("span",{class:"cd-line","aria-hidden":"true"},null,-1))],8,Jq)):(x(),E("div",{key:1,class:Ie(["ln turn-anchor",[X.role==="user"?"userline":"ai",{undoing:S.value===X.id}]]),"data-turn-id":X.id},[m("span",sj,L(X.no),1),m("div",oj,[m("div",ij,[X.role==="user"?(x(),E(Ne,{key:0},[G[22]||(G[22]=m("span",{class:"pr"},"user@kimi",-1)),G[23]||(G[23]=m("span",{class:"who"}," $ ",-1))],64)):(x(),E(Ne,{key:1},[G[24]||(G[24]=m("span",{class:"pr"},"kimi",-1)),G[25]||(G[25]=m("span",{class:"who"}," > ",-1))],64)),X.id!==c.value&&R(pe)&&$(pe).trim().length>0?(x(),E("button",{key:2,class:"cpbtn",onClick:oe=>V(pe),tabindex:"-1"},[g.value!==X.id?(x(),E("svg",lj,[...G[26]||(G[26]=[m("rect",{x:"3",y:"3",width:"9",height:"9",rx:"1.5"},null,-1),m("path",{d:"M6 1h7a1 1 0 0 1 1 1v7"},null,-1)])])):(x(),E("svg",aj,[...G[27]||(G[27]=[m("polyline",{points:"3,8 6.5,11.5 13,5"},null,-1)])])),m("span",cj,L(C(s)("filePreview.copy")),1)],8,rj)):le("",!0),X.durationMs!==void 0&&X.role==="assistant"?(x(),E("span",{key:3,class:"turn-duration",title:`${X.durationMs} ms`},L(C(Lw)(X.durationMs)),9,uj)):le("",!0)]),X.role==="user"?(x(),E("div",dj,[X.skillActivation?(x(),E("div",fj,[m("div",hj,[G[28]||(G[28]=m("span",{class:"skill-act-arrow"},"▶",-1)),m("span",null,L(C(s)("conversation.activatedSkill",{name:X.skillActivation.name})),1)]),X.skillActivation.args?(x(),E("div",pj,L(X.skillActivation.args),1)):le("",!0)])):(x(),E(Ne,{key:1},[yt(L(X.text),1)],64))])):(x(!0),E(Ne,{key:1},Qe(C(Pw)(X),(oe,ye)=>(x(),E(Ne,{key:C(Rw)(oe,ye)},[oe.kind==="thinking"?(x(),Ke(Ew,{key:0,text:oe.thinking,streaming:K(X,oe),onOpen:_e=>d("openThinking",{turnId:X.id,blockIndex:oe.sourceIndex})},null,8,["text","streaming","onOpen"])):oe.kind==="text"&&oe.text?(x(),Ke(Lf,{key:1,text:oe.text,streaming:K(X,oe),"open-file":_e=>d("openFile",_e)},null,8,["text","streaming","open-file"])):oe.kind==="tool-stack"?(x(),E("div",mj,[(x(!0),E(Ne,null,Qe(oe.tools,(_e,de)=>(x(),Ke(Zu,{key:C(a1)(_e),tool:_e.tool,"stack-position":C(Ow)(de,oe.tools.length),onOpenMedia:G[6]||(G[6]=be=>d("openMedia",be))},null,8,["tool","stack-position"]))),128))])):oe.kind==="agent"?(x(),Ke(r1,{key:3,member:oe.member,onOpen:_e=>d("openAgent",{turnId:X.id,blockIndex:oe.sourceIndex,memberId:_e})},null,8,["member","onOpen"])):oe.kind==="agentGroup"?(x(),Ke($w,{key:4,members:oe.members,onOpen:_e=>d("openAgent",{turnId:X.id,blockIndex:oe.sourceIndex,memberId:_e})},null,8,["members","onOpen"])):oe.kind==="tool"?(x(),Ke(Zu,{key:5,tool:oe.tool,onOpenMedia:G[7]||(G[7]=_e=>d("openMedia",_e))},null,8,["tool"])):le("",!0)],64))),128))]),X.role==="user"&&p(X)?(x(),E("div",{key:0,class:Ie(["u-edit-wrap ln-edit-wrap",{undoing:S.value===X.id}])},[w.value!==X.id?(x(),E("button",{key:0,type:"button",class:"u-edit","data-tooltip":C(s)("conversation.undoTooltip"),onClick:oe=>w.value=X.id},[G[29]||(G[29]=m("svg",{viewBox:"0 0 16 16",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("path",{d:"M6.5 2.5 3 6l3.5 3.5"}),m("path",{d:"M3 6h6.5a3.8 3.8 0 1 1 0 7.6H7.5"})],-1)),m("span",vj,L(C(s)("conversation.undo")),1)],8,gj)):(x(),E("div",{key:1,class:"u-edit-confirm",onClick:G[9]||(G[9]=Ze(()=>{},["stop"]))},[m("span",null,L(C(s)("conversation.undoConfirm")),1),m("button",{type:"button",class:"u-edit-confirm-btn confirm",onClick:Ze(oe=>A(X),["stop"])},L(C(s)("conversation.confirm")),9,yj),m("button",{type:"button",class:"u-edit-confirm-btn",onClick:G[8]||(G[8]=Ze(oe=>w.value=null,["stop"]))},L(C(s)("conversation.cancel")),1)]))],2)):le("",!0)],10,nj))],64))),128)),e.compaction?(x(),Ke(Iw,{key:3,label:C(s)("conversation.compacting")},null,8,["label"])):le("",!0),u.value?(x(),E("div",kj,[G[31]||(G[31]=m("span",{class:"no"},"—",-1)),m("div",bj,[G[30]||(G[30]=m("div",{class:"role-row"},[m("span",{class:"pr"},"kimi"),m("span",{class:"who"}," > ")],-1)),bt(l1,{fast:e.fastMoon,label:"Sending…"},null,8,["fast"])])])):le("",!0)]))}}),l3=wt(_j,[["__scopeId","data-v-c670cc35"]]),wj={class:"chat-header"},Sj={class:"ch-id"},Cj={key:0,class:"ch-ws"},xj={key:1,class:"ch-sep"},Tj=["onKeydown"],Mj=["title"],Aj=["title","aria-label","aria-expanded"],Ej=["title"],Ij=["title"],$j={key:0,class:"ch-pill ch-sync-pill"},Nj={key:0,class:"ch-ahead"},Lj={key:1,class:"ch-behind"},Oj={key:1,class:"ch-pill ch-diff-pill"},Pj={key:0,class:"ch-add"},Rj={key:1,class:"ch-del"},Dj=["title"],Bj=Je({__name:"ChatHeader",props:{sessionId:{},workspaceName:{},workspaceRoot:{},sessionTitle:{},branch:{},ahead:{},behind:{},changesCount:{},gitDiffStats:{},isGitRepo:{type:Boolean},pr:{},copied:{type:Boolean}},emits:["copyAll","copyFinalSummary","openChanges","openPr","renameSession","forkSession","archiveSession"],setup(e,{emit:t}){const{t:n}=St(),s=e,o=t,i=H(()=>s.ahead??0),r=H(()=>s.behind??0),l=H(()=>s.gitDiffStats?.totalAdditions??0),a=H(()=>s.gitDiffStats?.totalDeletions??0),c=H(()=>l.value>0||a.value>0),u=se(!1),d=se(null),h=se(null),p=se({});function f(V){const K=V.target;h.value?.contains(K)||d.value?.contains(K)||S()}function g(){S()}async function w(V){if(V.stopPropagation(),u.value){S();return}u.value=!0,document.addEventListener("mousedown",f),document.addEventListener("scroll",g,!0),window.addEventListener("resize",g),await vt();const K=d.value,Z=h.value;if(!K||!Z)return;const G=K.getBoundingClientRect(),X=4,pe=8,oe=Z.offsetWidth,ye=Z.offsetHeight;let _e=G.bottom+X;_e+ye>window.innerHeight-pe&&(_e=Math.max(pe,G.top-ye-X));let de=G.left;de+oe>window.innerWidth-pe&&(de=Math.max(pe,G.right-oe)),p.value={top:`${Math.round(_e)}px`,left:`${Math.round(de)}px`}}function S(){u.value=!1,R(),document.removeEventListener("mousedown",f),document.removeEventListener("scroll",g,!0),window.removeEventListener("resize",g)}Ht(()=>{document.removeEventListener("mousedown",f),document.removeEventListener("scroll",g,!0),window.removeEventListener("resize",g)});function y(){o("copyAll"),S()}function k(){o("copyFinalSummary"),S()}const v=se(!1);function _(){s.sessionId&&xs(s.sessionId).then(V=>{V&&(v.value=!0,setTimeout(()=>{v.value=!1},1200))})}const I=se(!1),A=se(""),b=se(null);async function M(){if(S(),!!s.sessionId){I.value=!0,A.value=s.sessionTitle??"",await vt();try{b.value?.focus(),b.value?.select()}catch{}}}function N(){const V=A.value.trim();V&&s.sessionId&&V!==(s.sessionTitle??"").trim()&&o("renameSession",s.sessionId,V),I.value=!1}function D(){I.value=!1}function $(){s.sessionId&&(S(),o("forkSession",s.sessionId))}const O=se(!1);let P;function R(){clearTimeout(P),O.value=!1}function F(){if(s.sessionId){if(O.value){o("archiveSession",s.sessionId),S();return}O.value=!0,P=setTimeout(()=>{O.value=!1},2500)}}return(V,K)=>(x(),E("header",wj,[m("div",Sj,[e.workspaceName?(x(),E("span",Cj,L(e.workspaceName),1)):le("",!0),e.workspaceName&&e.sessionTitle?(x(),E("span",xj,"/")):le("",!0),I.value?Ot((x(),E("input",{key:2,ref_key:"renameInputRef",ref:b,"onUpdate:modelValue":K[0]||(K[0]=Z=>A.value=Z),class:"ch-rename",type:"text",onKeydown:[Mo(Ze(N,["stop"]),["enter"]),Mo(Ze(D,["stop"]),["esc"])],onBlur:N,onClick:K[1]||(K[1]=Ze(()=>{},["stop"]))},null,40,Tj)),[[An,A.value]]):e.sessionTitle?(x(),E("span",{key:3,class:"ch-ses",title:e.sessionTitle},L(e.sessionTitle),9,Mj)):le("",!0)]),m("button",{ref_key:"kebabRef",ref:d,type:"button",class:Ie(["ch-act ch-act-more",{open:u.value}]),title:C(n)("header.options"),"aria-label":C(n)("header.options"),"aria-expanded":u.value,"aria-haspopup":"menu",onClick:K[2]||(K[2]=Ze(Z=>w(Z),["stop"]))},[...K[6]||(K[6]=[m("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[m("circle",{cx:"3",cy:"8",r:"1.3"}),m("circle",{cx:"8",cy:"8",r:"1.3"}),m("circle",{cx:"13",cy:"8",r:"1.3"})],-1)])],10,Aj),u.value?(x(),E("div",{key:0,ref_key:"menuRef",ref:h,class:"ch-menu",style:Ft(p.value),onClick:K[3]||(K[3]=Ze(()=>{},["stop"]))},[m("button",{type:"button",class:"chm-item",onClick:Ze(y,["stop"])},L(e.copied?C(n)("header.copied"):C(n)("header.copyAll")),1),m("button",{type:"button",class:"chm-item",onClick:Ze(k,["stop"])},L(C(n)("header.copyFinalSummary")),1),e.sessionId?(x(),E(Ne,{key:0},[K[7]||(K[7]=m("div",{class:"chm-divider"},null,-1)),m("button",{type:"button",class:"chm-item",onClick:Ze(_,["stop"])},[m("span",null,L(v.value?C(n)("header.copied"):C(n)("header.copySessionId")),1)]),m("button",{type:"button",class:"chm-item",onClick:Ze(M,["stop"])},L(C(n)("header.renameSession")),1),m("button",{type:"button",class:"chm-item",onClick:Ze($,["stop"])},L(C(n)("header.forkSession")),1),m("button",{type:"button",class:"chm-item del",onClick:Ze(F,["stop"])},L(O.value?C(n)("header.confirmArchive"):C(n)("header.archiveSession")),1)],64)):le("",!0)],4)):le("",!0),K[9]||(K[9]=m("div",{class:"ch-spacer"},null,-1)),e.isGitRepo?(x(),E("button",{key:1,type:"button",class:"ch-git",title:C(n)("header.gitTooltip"),onClick:K[4]||(K[4]=Z=>o("openChanges"))},[m("span",{class:Ie(["ch-branch",{"ch-detached":!e.branch}]),title:e.branch||C(n)("header.detached")},L(e.branch||C(n)("header.detached")),11,Ij),i.value>0||r.value>0?(x(),E("span",$j,[i.value>0?(x(),E("span",Nj,"↑"+L(i.value),1)):le("",!0),r.value>0?(x(),E("span",Lj,"↓"+L(r.value),1)):le("",!0)])):le("",!0),c.value?(x(),E("span",Oj,[l.value>0?(x(),E("span",Pj,"+"+L(l.value),1)):le("",!0),a.value>0?(x(),E("span",Rj,"-"+L(a.value),1)):le("",!0)])):le("",!0)],8,Ej)):le("",!0),e.pr?(x(),E("button",{key:2,type:"button",class:Ie(["ch-pill ch-pr",`pr-${e.pr.state}`]),title:C(n)("header.openPr"),onClick:K[5]||(K[5]=Z=>e.pr&&o("openPr",e.pr.url))},[K[8]||(K[8]=kr('<svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-7eb81c61><circle cx="5" cy="6" r="3" data-v-7eb81c61></circle><path d="M5 9v12" data-v-7eb81c61></path><circle cx="19" cy="18" r="3" data-v-7eb81c61></circle><path d="m15 9-3-3 3-3" data-v-7eb81c61></path><path d="M12 6h5a2 2 0 0 1 2 2v7" data-v-7eb81c61></path></svg>',1)),m("span",null,"PR #"+L(e.pr.number)+" · "+L(e.pr.state),1)],10,Dj)):le("",!0)]))}}),Fj=wt(Bj,[["__scopeId","data-v-7eb81c61"]]),Hj={key:0,class:"slash-menu",role:"listbox"},Wj=["aria-selected","onMouseenter","onMousedown"],Uj={class:"slash-name"},qj={class:"slash-desc"},jj=Je({__name:"SlashMenu",props:{items:{},activeIndex:{}},emits:["select","hover"],setup(e,{emit:t}){const{t:n}=St(),s=e,o=t,i=se([]);return Ge(()=>s.activeIndex,r=>{i.value[r]?.scrollIntoView({block:"nearest"})}),(r,l)=>e.items.length>0?(x(),E("div",Hj,[(x(!0),E(Ne,null,Qe(e.items,(a,c)=>(x(),E("div",{ref_for:!0,ref:u=>{u&&(i.value[c]=u)},key:`${a.name}-${c}`,class:Ie(["slash-item",{active:c===s.activeIndex}]),role:"option","aria-selected":c===s.activeIndex,onMouseenter:u=>o("hover",c),onMousedown:Ze(u=>o("select",a),["prevent"])},[m("span",Uj,L(a.name),1),m("span",qj,L(a.isSkill?a.desc:C(n)(a.desc)),1)],42,Wj))),128))])):le("",!0)}}),zj=wt(jj,[["__scopeId","data-v-738976e5"]]),Vj={class:"mention-menu",role:"listbox"},Kj={key:0,class:"mention-state dim"},Gj={key:1,class:"mention-state dim"},Yj=["aria-selected","onMouseenter","onMousedown"],Xj=["innerHTML"],Zj={class:"mention-name"},Jj={class:"mention-path"},Qj='<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.3" xmlns="http://www.w3.org/2000/svg"><path d="M1.5 4.5a1 1 0 0 1 1-1h3l1.2 1.4H13a1 1 0 0 1 1 1v6.1a1 1 0 0 1-1 1H2.5a1 1 0 0 1-1-1V4.5z"/></svg>',ez='<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.3" xmlns="http://www.w3.org/2000/svg"><polyline points="5.5,5 2.5,8 5.5,11"/><polyline points="10.5,5 13.5,8 10.5,11"/></svg>',tz='<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.3" xmlns="http://www.w3.org/2000/svg"><path d="M4 1.5h5l3 3v10H4z"/><line x1="6" y1="8" x2="11" y2="8"/><line x1="6" y1="10.5" x2="11" y2="10.5"/></svg>',nz='<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.3" xmlns="http://www.w3.org/2000/svg"><rect x="2" y="3" width="12" height="10" rx="1"/><circle cx="5.5" cy="6.5" r="1.1"/><path d="M3 12l3.5-3.5L9 11l2-2 3 3"/></svg>',Dw='<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.3" xmlns="http://www.w3.org/2000/svg"><path d="M4 1.5h5l3 3v10H4z"/><polyline points="9,1.5 9,4.5 12,4.5"/></svg>',sz=Je({__name:"MentionMenu",props:{items:{},activeIndex:{},loading:{type:Boolean}},emits:["select","hover"],setup(e,{emit:t}){const n=e,s=t,{t:o}=St(),i=new Set(["ts","tsx","js","jsx","mjs","cjs","vue","json","py","go","rs","java","kt","c","h","cpp","cc","hpp","cs","rb","php","swift","sh","bash","zsh","css","scss","less","html","htm","xml","sql","yaml","yml","toml","lua","dart","scala","clj","ex","exs"]),r=new Set(["md","markdown","mdx","txt","rst","adoc","pdf","doc","docx"]),l=new Set(["png","jpg","jpeg","gif","svg","webp","bmp","ico","avif"]);function a(c){const u=c.path;if(u.endsWith("/"))return Qj;const d=c.name||u.split("/").pop()||u,h=d.lastIndexOf("."),p=h>0?d.slice(h+1).toLowerCase():"";return p?i.has(p)?ez:r.has(p)?tz:l.has(p)?nz:Dw:Dw}return(c,u)=>(x(),E("div",Vj,[n.loading?(x(),E("div",Kj,L(C(o)("mention.searching")),1)):n.items.length===0?(x(),E("div",Gj,L(C(o)("mention.noMatch")),1)):(x(!0),E(Ne,{key:2},Qe(n.items,(d,h)=>(x(),E("div",{key:d.path,class:Ie(["mention-item",{active:h===n.activeIndex}]),role:"option","aria-selected":h===n.activeIndex,onMouseenter:p=>s("hover",h),onMousedown:Ze(p=>s("select",d),["prevent"])},[m("span",{class:"mention-icon",innerHTML:a(d),"aria-hidden":"true"},null,8,Xj),m("span",Zj,L(d.name),1),m("span",Jj,L(d.path),1)],42,Yj))),128))]))}}),oz=wt(sz,[["__scopeId","data-v-86e06bbf"]]),a3=[{name:"/help",desc:"commands.help.desc"},{name:"/new",desc:"commands.new.desc"},{name:"/sessions",desc:"commands.sessions.desc"},{name:"/clear",desc:"commands.clear.desc"},{name:"/model",desc:"commands.model.desc"},{name:"/provider",desc:"commands.provider.desc"},{name:"/login",desc:"commands.login.desc"},{name:"/permission",desc:"commands.permission.desc"},{name:"/plan",desc:"commands.plan.desc"},{name:"/swarm",desc:"commands.swarm.desc",acceptsInput:!0},{name:"/goal",desc:"commands.goal.desc",acceptsInput:!0},{name:"/btw",desc:"commands.btw.desc",acceptsInput:!0},{name:"/auto",desc:"commands.auto.desc"},{name:"/yolo",desc:"commands.yolo.desc"},{name:"/thinking",desc:"commands.thinking.desc"},{name:"/compact",desc:"commands.compact.desc",acceptsInput:!0},{name:"/undo",desc:"commands.undo.desc"},{name:"/fork",desc:"commands.fork.desc"},{name:"/status",desc:"commands.status.desc"}];function iz(e){if(!e.startsWith("/"))return null;const t=e.indexOf(" ");return t===-1?{cmd:e,arg:""}:{cmd:e.slice(0,t),arg:e.slice(t+1)}}function c3(e=[]){const t=e.map(n=>({name:`/${n.name}`,desc:n.description,isSkill:!0,acceptsInput:!0}));return[...a3,...t]}function rz(e,t=a3){const n=e.toLowerCase().trim().replace(/^\//,"");return n===""?t:t.map((s,o)=>{const i=s.name.toLowerCase().replace(/^\//,"");let r=0;return i===n?r=3:i.startsWith(n)?r=2:i.includes(n)&&(r=1),{item:s,index:o,score:r}}).filter(({score:s})=>s>0).sort((s,o)=>s.score!==o.score?o.score-s.score:s.index-o.index).map(({item:s})=>s)}function u3(e){if(e===void 0)return"toggle";const t=e.capabilities??[];return t.includes("always_thinking")?"always-on":t.includes("thinking")||e.adaptiveThinking===!0?"toggle":"unsupported"}function Bw(e,t){switch(u3(e)){case"always-on":return t==="off"?"high":t;case"unsupported":return"off";case"toggle":return t}}const Fw=200;function lz(){const e=K1(Et.inputHistory);return Array.isArray(e)?e.filter(t=>typeof t=="string"&&t.length>0):[]}function az(e){const{text:t,textareaRef:n,autosize:s}=e,o=se(lz());let i=-1,r="";function l(g){const w=g.trim();if(i=-1,!w||o.value.at(-1)===w)return;const S=[...o.value,w];o.value=S.length>Fw?S.slice(-Fw):S,G1(Et.inputHistory,o.value)}function a(){const g=n.value;if(!g)return!1;const w=g.selectionStart??0;return g.value.lastIndexOf(`
|
|
246
|
-
`,w-1)===-1}function c(g){t.value=g,vt(()=>{const w=n.value;if(!w)return;s();const S=g.length;w.setSelectionRange(S,S)})}function u(){if(o.value.length!==0){if(i===-1)r=t.value,i=o.value.length-1;else if(i>0)i-=1;else return;c(o.value[i])}}function d(){i!==-1&&(i<o.value.length-1?(i+=1,c(o.value[i])):(i=-1,c(r)))}function h(){i=-1}function p(){return i!==-1}function f(){return o.value.length>0}return{push:l,caretAtFirstLine:a,recallOlder:u,recallNewer:d,resetBrowsing:h,isBrowsing:p,hasHistory:f}}function cz(e){const{text:t,textareaRef:n,autosize:s,skills:o,emitCommand:i,historyPush:r}=e,l=se(!1),a=se([]),c=se(0);function u(){const h=t.value;h.startsWith("/")&&!h.includes(" ")?(a.value=rz(h,c3(o())),c.value=0,l.value=a.value.length>0):l.value=!1}function d(h){if(l.value=!1,h.acceptsInput){t.value=`${h.name} `,vt(()=>{const p=n.value;if(!p)return;const f=t.value.length;p.setSelectionRange(f,f),p.focus(),s()});return}t.value="",r(h.name),i(h.name)}return{open:l,items:a,active:c,update:u,select:d}}function uz(e){const{text:t,textareaRef:n,autosize:s,searchFiles:o}=e,i=se(!1),r=se([]),l=se(0),a=se(!1);let c=null;function u(){const p=t.value,f=n.value?.selectionStart??p.length;let g=f-1;for(;g>=0&&!/\s/.test(p[g]);)g--;g++;const w=p.slice(g,f);return w.startsWith("@")?{token:w.slice(1),start:g,end:f}:null}function d(){const p=u(),f=o();if(!p||!f){i.value=!1;return}const g=p.token;c!==null&&clearTimeout(c),c=setTimeout(async()=>{a.value=!0,i.value=!0,l.value=0;try{r.value=await f(g)}catch{r.value=[]}finally{a.value=!1}},200)}function h(p){const f=u();if(!f)return;const g=t.value;t.value=g.slice(0,f.start)+p.path+g.slice(f.end),i.value=!1,vt(()=>{const w=n.value;if(!w)return;const S=f.start+p.path.length;w.setSelectionRange(S,S),w.focus(),s()})}return{open:i,items:r,active:l,loading:a,update:d,select:h}}function dz(e){const{sessionId:t}=e;function n(a){return _n(Dk(a))??""}function s(a,c){const u=Dk(a);c?In(u,c):Uc(u)}const o=se(n(t())),i=se(null);function r(){const a=i.value;a&&a.style.removeProperty("height")}Ge(o,a=>{vt(r),s(t(),a)}),Ge(t,(a,c)=>{a!==c&&(s(c,o.value),o.value=n(a),vt(r))});function l(a){o.value=a,vt(()=>{const c=i.value;if(!c)return;c.focus();const u=a.length;c.setSelectionRange(u,u),r()})}return{text:o,textareaRef:i,autosize:r,loadForEdit:l}}function fz(e){const{uploadImage:t}=e,n=se([]),s=se(null),o=se(null),i=se(!1);let r=0;function l(){return`att_${++r}`}function a(_){try{URL.revokeObjectURL(_.previewUrl)}catch{}}function c(_){return _.startsWith("image/")?"image":_.startsWith("video/")?"video":null}async function u(_){const I=t();if(!I)return;const A=_.map(b=>({file:b,kind:c(b.type)})).filter(b=>b.kind!==null);if(A.length!==0)for(const{file:b,kind:M}of A){const N=l(),D=URL.createObjectURL(b),$={localId:N,name:b.name,kind:M,previewUrl:D,uploading:!0};n.value=[...n.value,$],I(b,b.name).then(O=>{n.value=n.value.map(P=>P.localId===N?{...P,uploading:!1,fileId:O?.fileId,error:O===null}:P)}).catch(()=>{n.value=n.value.map(O=>O.localId===N?{...O,uploading:!1,error:!0}:O)})}}function d(_){const I=n.value.find(A=>A.localId===_);s.value?.localId===_&&(s.value=null),I&&a(I),n.value=n.value.filter(A=>A.localId!==_)}function h(_){s.value=_}function p(){s.value=null}function f(){o.value?.click()}function g(_){const I=_.target,A=Array.from(I.files??[]);u(A),I.value=""}function w(_){if(!t())return;const I=_.clipboardData;if(!I)return;const A=[],b=new Set,M=(N,D)=>{const $=`${N.size}:${N.type}:${D}`;if(b.has($))return;b.add($);const O=N.type.split("/")[1]??"png",P=D.includes(".")?D:`paste-${Date.now()}.${O}`;A.push(N instanceof File?N:new File([N],P,{type:N.type}))};for(const N of Array.from(I.items))if(N.kind==="file"&&c(N.type)){const D=N.getAsFile();D&&M(D,D.name||`paste-${Date.now()}.${N.type.split("/")[1]??"png"}`)}for(const N of Array.from(I.files))c(N.type)&&M(N,N.name);A.length!==0&&(_.preventDefault(),u(A))}function S(_){!t()||!Array.from(_.dataTransfer?.items??[]).some(A=>A.kind==="file")||(_.preventDefault(),i.value=!0)}function y(){i.value=!1}function k(_){if(i.value=!1,!t())return;_.preventDefault();const I=Array.from(_.dataTransfer?.files??[]);u(I)}function v(){for(const _ of n.value)a(_);n.value=[]}return tn(()=>{document.addEventListener("paste",w)}),Ht(()=>{document.removeEventListener("paste",w);for(const _ of n.value)a(_);s.value=null}),{attachments:n,previewAttachment:s,fileInputRef:o,isDragOver:i,removeAttachment:d,openAttachmentPreview:h,closeAttachmentPreview:p,openFilePicker:f,handleFileInputChange:g,handleDragOver:S,handleDragLeave:y,handleDrop:k,clearAfterSubmit:v}}const hz={key:0,class:"att-strip"},pz=["title","onClick"],mz=["src"],gz=["src","alt"],vz={key:2,class:"att-video-badge","aria-hidden":"true"},yz={class:"att-name"},kz=["aria-label"],bz=["title"],_z=["title","onClick"],wz={class:"att-lightbox-card"},Sz=["title"],Cz=["src"],xz=["src","alt"],Tz={class:"att-lightbox-name"},Mz={class:"composer-card"},Az={class:"cin-wrap"},Ez={class:"input-row"},Iz=["placeholder"],$z=["aria-label","title"],Nz={class:"toolbar-left"},Lz=["title"],Oz=["title","onKeydown"],Pz=["onClick"],Rz={class:"pd-check"},Dz={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},Bz={class:"pd-info"},Fz={class:"pd-desc"},Hz=["title"],Wz={class:"mode-label"},Uz={key:0,class:"mode-tag"},qz={key:1,class:"mode-tag"},jz={key:2,class:"mode-tag"},zz={class:"mode-row-name"},Vz={class:"mode-row-name"},Kz={class:"mode-row-name"},Gz={key:0,class:"mode-row-actions"},Yz={class:"toolbar-right"},Xz=["title"],Zz={class:"ctx-ring",viewBox:"0 0 20 20","aria-hidden":"true"},Jz=["stroke-dasharray","stroke-dashoffset"],Qz={class:"ctx-num"},eV=["title","onKeydown"],tV={key:0,class:"think-suffix"},nV={key:0,class:"md-section"},sV=["onClick"],oV={class:"md-check"},iV={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},rV={class:"md-name"},lV={class:"md-provider"},aV={key:1,class:"md-divider"},cV={key:2,class:"md-section"},uV=["onClick"],dV={class:"md-check"},fV={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},hV={class:"md-name"},pV={key:0,class:"md-star",viewBox:"0 0 24 24",width:"14",height:"14","aria-hidden":"true"},mV={key:3,class:"md-divider"},gV=["disabled"],vV={class:"md-check"},yV={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},kV={class:"md-name"},bV={key:0,class:"md-note"},_V={key:1,class:"md-note"},wV={class:"md-name"},SV=Je({__name:"Composer",props:{running:{type:Boolean,default:!1},sessionId:{},queued:{default:()=>[]},searchFiles:{type:Function,default:void 0},uploadImage:{type:Function,default:void 0},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},activationBadges:{},models:{default:()=>[]},starredIds:{default:()=>[]},skills:{default:()=>[]},hideContext:{type:Boolean}},emits:["submit","steer","command","interrupt","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","openBtw","createGoal","controlGoal","focusGoal","focusSwarm","compact","pickModel","selectModel"],setup(e,{expose:t,emit:n}){const s=e,o=H(()=>s.goalMode?r("status.goalPlaceholder"):r("composer.placeholder")),i=n,{t:r}=St(),{text:l,textareaRef:a,autosize:c,loadForEdit:u}=dz({sessionId:()=>s.sessionId}),d=az({text:l,textareaRef:a,autosize:c}),{open:h,items:p,active:f,update:g,select:w}=cz({text:l,textareaRef:a,autosize:c,skills:()=>s.skills,emitCommand:Ye=>i("command",Ye),historyPush:Ye=>d.push(Ye)}),{open:S,items:y,active:k,loading:v,update:_,select:I}=uz({text:l,textareaRef:a,autosize:c,searchFiles:()=>s.searchFiles});function A(){d.resetBrowsing(),g(),_()}const{attachments:b,previewAttachment:M,fileInputRef:N,isDragOver:D,removeAttachment:$,openAttachmentPreview:O,closeAttachmentPreview:P,openFilePicker:R,handleFileInputChange:F,handleDragOver:V,handleDragLeave:K,handleDrop:Z,clearAfterSubmit:G}=fz({uploadImage:()=>s.uploadImage});tn(()=>{l.value&&vt(c)}),Ht(()=>{document.removeEventListener("mousedown",Xe),_e()}),t({loadForEdit:u});function X(){const Ye=l.value.trim();if(b.value.some(Tt=>Tt.uploading))return;const je=b.value.filter(Tt=>!Tt.uploading&&!Tt.error&&Tt.fileId);if(!Ye&&je.length===0)return;if(d.push(Ye),Ye){const Tt=iz(Ye),on=Tt?c3(s.skills).some(ao=>ao.name===Tt.cmd):!1;if(Tt&&on){l.value="",h.value=!1,i("command",Tt.arg?`${Tt.cmd} ${Tt.arg}`:Tt.cmd);return}}const qe={text:Ye,attachments:je.map(Tt=>({fileId:Tt.fileId,kind:Tt.kind}))};M.value=null,G(),l.value="",h.value=!1,S.value=!1,i("submit",qe)}function pe(){if(!s.running||b.value.some(Tt=>Tt.uploading))return;const Ye=l.value.trim(),je=b.value.filter(Tt=>!Tt.uploading&&!Tt.error&&Tt.fileId);if(!Ye&&je.length===0&&s.queued.length===0)return;const qe={text:Ye,attachments:je.map(Tt=>({fileId:Tt.fileId,kind:Tt.kind}))};G(),d.push(Ye),l.value="",h.value=!1,S.value=!1,i("steer",qe)}let oe=!1,ye=null;function _e(){ye!==null&&(clearTimeout(ye),ye=null)}function de(){_e(),oe=!0}function be(){_e(),ye=setTimeout(()=>{ye=null,oe=!1},0)}function xe(Ye){return oe||Ye.isComposing||Ye.keyCode===229}function Le(Ye){if(!xe(Ye)){if(Ye.key==="Escape"){if(ge.value){Ye.preventDefault(),ie();return}if(W.value){Ye.preventDefault(),U();return}}if(h.value){if(Ye.key==="ArrowDown"){Ye.preventDefault(),f.value=(f.value+1)%p.value.length;return}if(Ye.key==="ArrowUp"){Ye.preventDefault(),f.value=(f.value-1+p.value.length)%p.value.length;return}if(Ye.key==="Enter"||Ye.key==="Tab"){Ye.preventDefault();const je=p.value[f.value];je&&w(je);return}if(Ye.key==="Escape"){Ye.preventDefault(),h.value=!1;return}}if(S.value&&!v.value){if(Ye.key==="ArrowDown"){Ye.preventDefault(),k.value=(k.value+1)%Math.max(1,y.value.length);return}if(Ye.key==="ArrowUp"){Ye.preventDefault(),k.value=(k.value-1+Math.max(1,y.value.length))%Math.max(1,y.value.length);return}if(Ye.key==="Enter"||Ye.key==="Tab"){Ye.preventDefault();const je=y.value[k.value];je&&I(je);return}if(Ye.key==="Escape"){Ye.preventDefault(),S.value=!1;return}}if(Ye.key==="s"&&(Ye.ctrlKey||Ye.metaKey)&&!Ye.shiftKey&&!Ye.altKey){s.running&&(Ye.preventDefault(),pe());return}if(!h.value&&!S.value&&!Ye.shiftKey&&!Ye.altKey&&!Ye.metaKey&&!Ye.ctrlKey){const je=d.isBrowsing();if(Ye.key==="ArrowUp"&&d.hasHistory()&&(je||d.caretAtFirstLine())){Ye.preventDefault(),d.recallOlder();return}if(Ye.key==="ArrowDown"&&je){Ye.preventDefault(),d.recallNewer();return}}Ye.key==="Enter"&&!Ye.shiftKey&&(Ye.preventDefault(),X())}}const ee=H(()=>s.running?r("composer.interrupt"):r("composer.send")),ke=H(()=>!!s.uploadImage),ge=se(!1),W=se(!1),J=se(null);function ue(){ge.value=!ge.value,ge.value?(W.value=!1,document.addEventListener("click",Y,!0)):document.removeEventListener("click",Y,!0)}function ie(){ge.value=!1,W.value||document.removeEventListener("click",Y,!0)}function ae(){W.value=!W.value,W.value?(ge.value=!1,document.addEventListener("click",Y,!0)):document.removeEventListener("click",Y,!0)}function U(){W.value=!1,ge.value||document.removeEventListener("click",Y,!0)}function Y(Ye){J.value&&!J.value.contains(Ye.target)&&(ie(),U())}Ht(()=>{document.removeEventListener("click",Y,!0)});const ce=Ye=>`${Math.round(Ye/1e3)}k`,me=H(()=>{const Ye=s.status?.ctxMax??0;return Ye<=0?0:Math.min(100,Math.max(0,Math.round((s.status?.ctxUsed??0)/Ye*100)))}),Se=H(()=>{const Ye=(s.status?.ctxUsed??0).toLocaleString(),je=(s.status?.ctxMax??0).toLocaleString();return r("status.ctxTooltip",{used:Ye,max:je,pct:me.value})}),Ee=H(()=>me.value>=80),re=H(()=>{const Ye=s.status?.modelId??s.status?.model??"";return s.models?.find(je=>je.id===Ye||je.model===Ye||je.displayName===s.status?.model)}),Te=H(()=>u3(re.value)),Ue=H(()=>Te.value==="toggle"),nt=H(()=>Te.value==="always-on"?!0:Te.value==="unsupported"?!1:(s.thinking??"off")!=="off");function ct(){Ue.value&&i("setThinking",nt.value?"off":"high")}const Re=H(()=>s.planMode===!0),Pe=H(()=>s.swarmMode===!0),st=H(()=>s.activationBadges?.goal!==null),et=H(()=>st.value||s.goalMode===!0),mt=se(!1),dn=se(null),wn=se(null),xt=se({}),ln=H(()=>Re.value||Pe.value||et.value);function Sn(){mt.value=!1,document.removeEventListener("mousedown",Xe)}function Xe(Ye){const je=Ye.target;dn.value?.contains(je)||wn.value?.contains(je)||Sn()}function Ln(){if(mt.value){Sn();return}const Ye=dn.value?.getBoundingClientRect();Ye&&(xt.value={left:`${Math.round(Ye.left)}px`,bottom:`${Math.round(window.innerHeight-Ye.top+8)}px`}),mt.value=!0,setTimeout(()=>document.addEventListener("mousedown",Xe),0)}const es=[{mode:"manual",color:"var(--dim)",labelKey:"status.permissionManual",descKey:"status.permissionManualDesc"},{mode:"yolo",color:"var(--warn)",labelKey:"status.permissionYolo",descKey:"status.permissionYoloDesc"},{mode:"auto",color:"var(--err)",labelKey:"status.permissionAuto",descKey:"status.permissionAutoDesc"}];function $s(Ye){i("setPermission",Ye),U()}const Cn=H(()=>es.find(Ye=>Ye.mode===s.status?.permission)),fn=H(()=>Cn.value?r(Cn.value.labelKey):""),Hn=H(()=>re.value?.provider??""),Wn=H(()=>!Hn.value||!s.models?.length?[]:s.models.filter(Ye=>Ye.provider===Hn.value)),Yn=H(()=>new Set(s.starredIds??[]));function ks(Ye){return Yn.value.has(Ye)}const Un=H(()=>s.models?.length?s.models.filter(Ye=>ks(Ye.id)&&Ye.provider!==Hn.value):[]);function bs(Ye){i("selectModel",Ye),ie()}return(Ye,je)=>(x(),E("div",{class:Ie(["composer",{"drag-over":C(D)}]),onDragover:je[18]||(je[18]=(...qe)=>C(V)&&C(V)(...qe)),onDragleave:je[19]||(je[19]=(...qe)=>C(K)&&C(K)(...qe)),onDrop:je[20]||(je[20]=(...qe)=>C(Z)&&C(Z)(...qe))},[C(b).length>0?(x(),E("div",hz,[(x(!0),E(Ne,null,Qe(C(b),qe=>(x(),E("div",{key:qe.localId,class:Ie(["att-chip",{"att-error":qe.error}])},[m("button",{type:"button",class:"att-preview",title:C(r)("composer.previewAttachment",{name:qe.name}),onClick:Tt=>C(O)(qe)},[qe.kind==="video"?(x(),E("video",{key:0,class:"att-thumb",src:qe.previewUrl,muted:"",playsinline:"",preload:"metadata"},null,8,mz)):(x(),E("img",{key:1,class:"att-thumb",src:qe.previewUrl,alt:qe.name},null,8,gz)),qe.kind==="video"?(x(),E("span",vz,[...je[21]||(je[21]=[m("svg",{viewBox:"0 0 16 16",width:"9",height:"9",fill:"currentColor"},[m("path",{d:"M5 3.5v9l7-4.5z"})],-1)])])):le("",!0)],8,pz),m("span",yz,L(qe.name),1),qe.uploading?(x(),E("span",{key:0,class:"att-spinner","aria-label":C(r)("composer.uploading")},[...je[22]||(je[22]=[m("svg",{viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.6",xmlns:"http://www.w3.org/2000/svg"},[m("circle",{cx:"8",cy:"8",r:"6","stroke-opacity":"0.25"}),m("path",{d:"M8 2 A6 6 0 0 1 14 8","stroke-linecap":"round"},[m("animateTransform",{attributeName:"transform",type:"rotate",from:"0 8 8",to:"360 8 8",dur:"0.8s",repeatCount:"indefinite"})])],-1)])],8,kz)):qe.error?(x(),E("span",{key:1,class:"att-err-icon",title:C(r)("composer.uploadFailed")},[...je[23]||(je[23]=[m("svg",{viewBox:"0 0 12 12",width:"10",height:"10",fill:"none",stroke:"currentColor","stroke-width":"1.6",xmlns:"http://www.w3.org/2000/svg"},[m("circle",{cx:"6",cy:"6",r:"5"}),m("line",{x1:"6",y1:"3.5",x2:"6",y2:"6.5"}),m("circle",{cx:"6",cy:"8.5",r:"0.5",fill:"currentColor"})],-1)])],8,bz)):le("",!0),m("button",{class:"att-rm",title:C(r)("composer.removeNamed",{name:qe.name}),onClick:Tt=>C($)(qe.localId)},[...je[24]||(je[24]=[m("svg",{viewBox:"0 0 12 12",width:"9",height:"9",fill:"none",stroke:"currentColor","stroke-width":"1.6",xmlns:"http://www.w3.org/2000/svg"},[m("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),m("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,_z)],2))),128))])):le("",!0),C(M)?(x(),E("div",{key:1,class:"att-lightbox",onClick:je[1]||(je[1]=Ze((...qe)=>C(P)&&C(P)(...qe),["self"]))},[m("div",wz,[m("button",{type:"button",class:"att-lightbox-close",title:C(r)("model.close"),onClick:je[0]||(je[0]=(...qe)=>C(P)&&C(P)(...qe))},"✕",8,Sz),C(M).kind==="video"?(x(),E("video",{key:0,class:"att-lightbox-media",src:C(M).previewUrl,controls:"",playsinline:""},null,8,Cz)):(x(),E("img",{key:1,class:"att-lightbox-media",src:C(M).previewUrl,alt:C(M).name},null,8,xz)),m("div",Tz,L(C(M).name),1)])])):le("",!0),m("div",Mz,[m("div",Az,[C(h)?(x(),Ke(zj,{key:0,items:C(p),"active-index":C(f),onSelect:C(w),onHover:je[2]||(je[2]=qe=>f.value=qe)},null,8,["items","active-index","onSelect"])):le("",!0),C(S)?(x(),Ke(oz,{key:1,items:C(y),"active-index":C(k),loading:C(v),onSelect:C(I),onHover:je[3]||(je[3]=qe=>k.value=qe)},null,8,["items","active-index","loading","onSelect"])):le("",!0),m("div",Ez,[Ot(m("textarea",{ref_key:"textareaRef",ref:a,"onUpdate:modelValue":je[4]||(je[4]=qe=>Nn(l)?l.value=qe:null),class:"ph",placeholder:o.value,rows:"1",onKeydown:Le,onCompositionstart:de,onCompositionend:be,onInput:A},null,40,Iz),[[An,C(l)]]),m("button",{class:Ie(["send",{aborting:e.running}]),"aria-label":ee.value,title:e.running?C(r)("composer.interruptTitle"):ee.value,onClick:je[5]||(je[5]=qe=>e.running?i("interrupt"):X())},[(x(),E("svg",{class:Ie(["send-icon",{hidden:e.running}]),viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...je[25]||(je[25]=[m("path",{d:"M8 3l6 5.5M8 3L2 8.5M8 3v10"},null,-1)])],2)),(x(),E("svg",{class:Ie(["send-icon",{hidden:!e.running}]),viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[...je[26]||(je[26]=[m("rect",{x:"3",y:"3",width:"10",height:"10",rx:"1.5"},null,-1)])],2))],10,$z)])]),ke.value?(x(),E("input",{key:0,ref_key:"fileInputRef",ref:N,type:"file",accept:"image/*,video/*",multiple:"",class:"file-input-hidden",onChange:je[6]||(je[6]=(...qe)=>C(F)&&C(F)(...qe))},null,544)):le("",!0),m("div",{ref_key:"toolbarRef",ref:J,class:"toolbar"},[m("div",Nz,[ke.value?(x(),E("button",{key:0,class:"attach-btn",title:C(r)("composer.attachImage"),type:"button",onClick:je[7]||(je[7]=(...qe)=>C(R)&&C(R)(...qe))},[...je[27]||(je[27]=[m("svg",{class:"attach-icon",viewBox:"0 0 16 16",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round",xmlns:"http://www.w3.org/2000/svg"},[m("path",{d:"M8 3v10M3 8h10"})],-1)])],8,Lz)):le("",!0),e.status?(x(),E("span",{key:1,class:Ie(["perm-pill",["perm-"+e.status.permission,{open:W.value}]]),role:"button",tabindex:"0",title:C(r)("status.permissionTooltip"),onClick:Ze(ae,["stop"]),onKeydown:[Mo(ae,["enter"]),Mo(Ze(ae,["prevent"]),["space"])]},L(fn.value),43,Oz)):le("",!0),W.value&&e.status?(x(),E("div",{key:2,class:"perm-dropdown",role:"menu",onClick:je[8]||(je[8]=Ze(()=>{},["stop"]))},[(x(),E(Ne,null,Qe(es,qe=>m("button",{key:qe.mode,class:Ie(["pd-row",{"is-current":qe.mode===e.status.permission}]),role:"menuitem",onClick:Tt=>$s(qe.mode)},[m("span",Rz,[qe.mode===e.status.permission?(x(),E("svg",Dz,[...je[28]||(je[28]=[m("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):le("",!0)]),m("span",Bz,[m("span",{class:"pd-name",style:Ft({color:qe.color})},L(C(r)(qe.labelKey)),5),m("span",Fz,L(C(r)(qe.descKey)),1)])],10,Pz)),64))])):le("",!0),e.status?(x(),E("div",{key:3,ref_key:"modesRef",ref:dn,class:"modes"},[m("button",{type:"button",class:Ie(["mode-pill",{on:ln.value}]),title:C(r)("status.modesTooltip"),onClick:Ze(Ln,["stop"])},[m("span",Wz,L(C(r)("status.modesLabel")),1),Re.value?(x(),E("span",Uz,L(C(r)("status.planLabel")),1)):le("",!0),Pe.value?(x(),E("span",qz,L(C(r)("status.swarmLabel")),1)):le("",!0),et.value?(x(),E("span",jz,L(C(r)("status.goalLabel")),1)):le("",!0)],10,Hz),mt.value?(x(),E("div",{key:0,ref_key:"modesMenuRef",ref:wn,class:"modes-menu",style:Ft(xt.value)},[m("button",{type:"button",class:Ie(["mode-row",{on:Re.value}]),onClick:je[9]||(je[9]=qe=>i("togglePlan"))},[m("span",zz,L(C(r)("status.planLabel")),1),m("span",{class:Ie(["mode-switch",{on:Re.value}])},[...je[29]||(je[29]=[m("span",{class:"mode-knob"},null,-1)])],2)],2),m("button",{type:"button",class:Ie(["mode-row",{on:Pe.value}]),onClick:je[10]||(je[10]=qe=>i("toggleSwarm"))},[m("span",Vz,L(C(r)("status.swarmLabel")),1),m("span",{class:Ie(["mode-switch",{on:Pe.value}])},[...je[30]||(je[30]=[m("span",{class:"mode-knob"},null,-1)])],2)],2),m("div",{class:Ie(["mode-row mode-row-goal",{on:st.value||s.goalMode}])},[m("button",{type:"button",class:"mode-row-main",onClick:je[11]||(je[11]=qe=>st.value?i("controlGoal","cancel"):i("toggleGoal"))},[m("span",Kz,L(C(r)("status.goalLabel")),1),st.value?le("",!0):(x(),E("span",{key:0,class:Ie(["mode-switch",{on:s.goalMode}])},[...je[31]||(je[31]=[m("span",{class:"mode-knob"},null,-1)])],2))]),st.value?(x(),E("div",Gz,[m("button",{type:"button",class:"mode-row-action",onClick:je[12]||(je[12]=qe=>i("controlGoal","pause"))},L(C(r)("status.goalPause")),1),m("button",{type:"button",class:"mode-row-action",onClick:je[13]||(je[13]=qe=>i("controlGoal","resume"))},L(C(r)("status.goalResume")),1)])):le("",!0)],2)],4)):le("",!0)],512)):le("",!0)]),m("div",Yz,[Ee.value?(x(),E("button",{key:0,class:"compact-chip",onClick:je[14]||(je[14]=Ze(qe=>i("compact"),["stop"]))},"/compact")):le("",!0),e.status&&!e.hideContext?(x(),E("span",{key:1,class:"ctx-group",title:Se.value},[(x(),E("svg",Zz,[je[32]||(je[32]=m("circle",{class:"ctx-ring-track",cx:"10",cy:"10",r:"7",fill:"none","stroke-width":"2.5"},null,-1)),m("circle",{class:"ctx-ring-fill",cx:"10",cy:"10",r:"7",fill:"none","stroke-width":"2.5","stroke-linecap":"round","stroke-dasharray":`${2*Math.PI*7}`,"stroke-dashoffset":`${2*Math.PI*7*(1-me.value/100)}`},null,8,Jz)])),m("span",Qz,L(ce(e.status.ctxUsed))+"/"+L(ce(e.status.ctxMax)),1)],8,Xz)):le("",!0),e.status?(x(),E("span",{key:2,class:Ie(["model-pill",{open:ge.value}]),role:"button",tabindex:"0",title:C(r)("status.modelTooltip"),onClick:Ze(ue,["stop"]),onKeydown:[Mo(ue,["enter"]),Mo(Ze(ue,["prevent"]),["space"])]},[m("b",null,L(e.status.model),1),nt.value?(x(),E("span",tV,L(C(r)("composer.thinkingSuffix")),1)):le("",!0),je[33]||(je[33]=m("svg",{class:"cv",viewBox:"0 0 16 16",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("path",{d:"M4 6l4 4 4-4"})],-1))],42,eV)):le("",!0)]),ge.value&&e.status?(x(),E("div",{key:0,class:"model-dropdown",role:"menu",onClick:je[17]||(je[17]=Ze(()=>{},["stop"]))},[Un.value.length>0?(x(),E("div",nV,L(C(r)("status.starredModels")),1)):le("",!0),(x(!0),E(Ne,null,Qe(Un.value,qe=>(x(),E("button",{key:qe.id,class:Ie(["md-row",{"is-current":qe.id===e.status.modelId}]),role:"menuitem",onClick:Tt=>bs(qe.id)},[m("span",oV,[qe.id===e.status.model||qe.model===e.status.model||qe.displayName===e.status.model?(x(),E("svg",iV,[...je[34]||(je[34]=[m("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):le("",!0)]),m("span",rV,L(qe.displayName??qe.model),1),m("span",lV,L(qe.provider),1),je[35]||(je[35]=m("svg",{class:"md-star",viewBox:"0 0 24 24",width:"14",height:"14","aria-hidden":"true"},[m("path",{fill:"currentColor",d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"})],-1))],10,sV))),128)),Un.value.length>0?(x(),E("div",aV)):le("",!0),Wn.value.length>0?(x(),E("div",cV,L(Hn.value),1)):le("",!0),(x(!0),E(Ne,null,Qe(Wn.value,qe=>(x(),E("button",{key:qe.id,class:Ie(["md-row",{"is-current":qe.id===e.status.modelId}]),role:"menuitem",onClick:Tt=>bs(qe.id)},[m("span",dV,[qe.id===e.status.model||qe.model===e.status.model||qe.displayName===e.status.model?(x(),E("svg",fV,[...je[36]||(je[36]=[m("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):le("",!0)]),m("span",hV,L(qe.displayName??qe.model),1),ks(qe.id)?(x(),E("svg",pV,[...je[37]||(je[37]=[m("path",{fill:"currentColor",d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"},null,-1)])])):le("",!0)],10,uV))),128)),Wn.value.length>0?(x(),E("div",mV)):le("",!0),m("button",{class:Ie(["md-row md-row-toggle",{"is-on":nt.value,"is-disabled":!Ue.value}]),role:"menuitem",disabled:!Ue.value,onClick:je[15]||(je[15]=qe=>ct())},[m("span",vV,[nt.value?(x(),E("svg",yV,[...je[38]||(je[38]=[m("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):le("",!0)]),m("span",kV,L(C(r)("status.thinkingLabel")),1),Te.value==="always-on"?(x(),E("span",bV,L(C(r)("status.planOn")),1)):Te.value==="unsupported"?(x(),E("span",_V,L(C(r)("status.modeNotSupported")),1)):le("",!0)],10,gV),je[39]||(je[39]=m("div",{class:"md-divider"},null,-1)),m("button",{class:"md-row md-row-more",role:"menuitem",onClick:je[16]||(je[16]=qe=>{ie(),i("pickModel")})},[m("span",wV,L(C(r)("status.moreModels")),1)])])):le("",!0)],512)])],34))}}),d3=wt(SV,[["__scopeId","data-v-09837c89"]]),CV=["id"],xV={class:"swarm-head"},TV={class:"swarm-count"},MV={class:"swarm-grid"},AV={class:"member-top"},EV={class:"member-name"},IV={class:"member-phase"},$V={class:"member-mid"},NV={class:"member-bar"},LV={key:0,class:"member-type"},OV={key:0,class:"member-bottom"},PV=Je({__name:"SwarmCard",props:{group:{}},setup(e){const t=e,n=H(()=>t.group.members.length),s=H(()=>t.group.counts.completed+t.group.counts.failed);function o(l){switch(l){case"queued":return"Queued";case"working":return"Working";case"suspended":return"Suspended";case"completed":return"Completed";case"failed":return"Failed"}}function i(l){switch(l.phase){case"queued":return"......";case"working":return":::...";case"suspended":return"::....";case"completed":return"::::::";case"failed":return"!!...."}}function r(l){return l.outputLines?.map(a=>a.trimEnd()).filter(Boolean).at(-1)}return(l,a)=>(x(),E("section",{class:"swarm-card",id:`swarm-${e.group.id}`},[m("header",xV,[a[0]||(a[0]=m("div",{class:"swarm-title"},[m("span",{class:"swarm-mark","aria-hidden":"true"}),m("span",null,"Swarm")],-1)),m("div",TV,L(s.value)+"/"+L(n.value),1)]),m("div",MV,[(x(!0),E(Ne,null,Qe(e.group.members,c=>(x(),E("article",{key:c.id,class:Ie(["swarm-member",`phase-${c.phase}`])},[m("div",AV,[m("span",EV,L(c.name),1),m("span",IV,L(o(c.phase)),1)]),m("div",$V,[m("span",NV,L(i(c)),1),c.subagentType?(x(),E("span",LV,L(c.subagentType),1)):le("",!0)]),c.suspendedReason||r(c)||c.summary?(x(),E("div",OV,L(c.suspendedReason||r(c)||c.summary),1)):le("",!0)],2))),128))])],8,CV))}}),RV=wt(PV,[["__scopeId","data-v-2cfb7bcf"]]),DV={class:"goal-progress","aria-hidden":"true"},BV={key:0,class:"goal-body"},FV={class:"goal-full"},HV={key:0,class:"goal-criterion"},WV={class:"goal-stats"},UV={key:0},qV={class:"goal-actions"},jV=Je({__name:"GoalStrip",props:{goal:{},forceExpanded:{}},emits:["controlGoal"],setup(e,{emit:t}){const n=e,s=t,{t:o}=St(),i=se(!1);Ge(()=>n.forceExpanded,()=>{n.forceExpanded!==void 0&&(i.value=!0)});const r=H(()=>{const a=n.goal.budget.tokenBudget;return!a||a<=0?0:Math.max(0,Math.min(100,Math.round(n.goal.tokensUsed/a*100)))});function l(a){const c=Math.max(0,Math.round(a/1e3)),u=Math.floor(c/60),d=c%60;return u<=0?`${d}s`:u<60?`${u}m ${d}s`:`${Math.floor(u/60)}h ${u%60}m`}return(a,c)=>(x(),E("section",{class:Ie(["goal-strip",{expanded:i.value}])},[m("button",{class:"goal-row",type:"button",onClick:c[0]||(c[0]=u=>i.value=!i.value)},[c[5]||(c[5]=m("span",{class:"goal-kicker"},"Goal",-1)),m("span",{class:Ie(["goal-objective",{"expanded-hidden":i.value}])},L(e.goal.objective),3),m("span",{class:Ie(["goal-status",`status-${e.goal.status}`])},L(e.goal.status),3),m("span",DV,[m("span",{class:"goal-progress-fill",style:Ft({width:`${r.value}%`})},null,4)]),(x(),E("svg",{class:Ie(["goal-chevron",{open:i.value}]),viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...c[4]||(c[4]=[m("path",{d:"M6 4l4 4-4 4"},null,-1)])],2))]),i.value?(x(),E("div",BV,[m("div",FV,L(e.goal.objective),1),e.goal.completionCriterion?(x(),E("div",HV,[c[6]||(c[6]=m("span",null,"Done when",-1)),m("p",null,L(e.goal.completionCriterion),1)])):le("",!0),m("div",WV,[m("span",null,L(e.goal.turnsUsed)+" turns",1),m("span",null,L(e.goal.tokensUsed.toLocaleString())+" tokens",1),m("span",null,L(l(e.goal.wallClockMs)),1),e.goal.budget.tokenBudget!==null?(x(),E("span",UV,L(r.value)+"% token budget",1)):le("",!0)]),m("div",qV,[e.goal.status!=="paused"?(x(),E("button",{key:0,type:"button",class:"goal-action",onClick:c[1]||(c[1]=Ze(u=>s("controlGoal","pause"),["stop"]))},L(C(o)("status.goalPause")),1)):le("",!0),e.goal.status==="paused"?(x(),E("button",{key:1,type:"button",class:"goal-action primary",onClick:c[2]||(c[2]=Ze(u=>s("controlGoal","resume"),["stop"]))},L(C(o)("status.goalResume")),1)):le("",!0),m("button",{type:"button",class:"goal-action danger",onClick:c[3]||(c[3]=Ze(u=>s("controlGoal","cancel"),["stop"]))},L(C(o)("status.goalCancel")),1)])])):le("",!0)],2))}}),zV=wt(jV,[["__scopeId","data-v-dcbae4b7"]]),VV={class:"qh"},KV={class:"qtitle"},GV={class:"qstep"},YV=["disabled"],XV=["disabled"],ZV={key:1,class:"qmin-peek"},JV=["title","aria-label"],QV={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","aria-hidden":"true"},eK={key:1,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","aria-hidden":"true"},tK={key:0,class:"qbody"},nK={key:0,class:"qheader-chip"},sK={class:"qtext"},oK={class:"qopts"},iK=["onClick"],rK={class:"qopt-key"},lK={class:"qopt-glyph"},aK={key:0,class:"chk"},cK={key:1,class:"rad"},uK={class:"qopt-text"},dK={class:"qopt-label"},fK={key:0,class:"qopt-desc"},hK={class:"qopt-glyph"},pK={key:0,class:"chk"},mK={key:1,class:"rad"},gK={class:"qopt-label"},vK=["placeholder"],yK={key:1,class:"qfooter"},kK=["disabled"],bK=Je({__name:"QuestionCard",props:{question:{}},emits:["answer","dismiss"],setup(e,{emit:t}){const n=e,{t:s}=St(),o=t,i=se(0),r=se(!1),l=H(()=>n.question.questions[i.value]),a=H(()=>n.question.questions.length);function c(){i.value>0&&i.value--}function u(){i.value<a.value-1&&i.value++}const d=se({});function h(b){return b.recommended===!0?!0:/\b(?:recommended|recommend)\b|推荐/.test(`${b.label} ${b.description??""}`.toLowerCase())}function p(){const b={...d.value};let M=!1;for(const N of n.question.questions){if(b[N.id])continue;const D=N.options.filter(h);D.length!==0&&(b[N.id]=N.multiSelect?{kind:"multi",optionIds:D.map($=>$.id)}:{kind:"single",optionId:D[0].id},M=!0)}M&&(d.value=b)}Ge(()=>n.question.questionId,()=>{i.value=0,r.value=!1,d.value={},w.value={}}),Ge(()=>n.question,()=>{i.value>=n.question.questions.length&&(i.value=0),p()},{immediate:!0,deep:!0});function f(b,M){const N=d.value[b];if(N&&N.kind==="single"&&N.optionId===M){const D={...d.value};delete D[b],d.value=D}else d.value={...d.value,[b]:{kind:"single",optionId:M}}}function g(b,M){const N=d.value[b],D=N&&(N.kind==="multi"||N.kind==="multiWithOther")?N.kind==="multi"?[...N.optionIds]:[...N.optionIds]:[],$=D.indexOf(M);$>=0?D.splice($,1):D.push(M);const O=d.value[b],P=O&&O.kind==="multiWithOther"?O.otherText:"";P?d.value={...d.value,[b]:{kind:"multiWithOther",optionIds:D,otherText:P}}:d.value={...d.value,[b]:{kind:"multi",optionIds:D}}}const w=se({});function S(b){const M=n.question.questions.find(D=>D.id===b),N=w.value[b]??"";if(M.multiSelect){const D=d.value[b],$=D&&(D.kind==="multi"||D.kind==="multiWithOther")?D.kind==="multi"?[...D.optionIds]:[...D.optionIds]:[];d.value={...d.value,[b]:{kind:"multiWithOther",optionIds:$,otherText:N}}}else d.value={...d.value,[b]:{kind:"other",text:N}}}function y(b,M){const N=d.value[b];return N?N.kind==="single"?N.optionId===M:N.kind==="multi"||N.kind==="multiWithOther"?N.optionIds.includes(M):!1:!1}function k(b){const M=d.value[b];return!!(M&&(M.kind==="other"||M.kind==="multiWithOther"))}function v(){return n.question.questions.every(b=>{const M=d.value[b.id];return M?M.kind==="multi"?M.optionIds.length>0:M.kind==="multiWithOther"?M.optionIds.length>0||M.otherText.trim().length>0:M.kind==="other"?M.text.trim().length>0:!0:!1})}function _(){if(!v())return;const b={answers:d.value,method:"click"};o("answer",n.question.questionId,b)}function I(){o("dismiss",n.question.questionId)}function A(b){const M=(document.activeElement?.tagName??"").toLowerCase();if(M==="input"||M==="textarea"||r.value&&b.key!=="Escape")return;if(b.key==="Escape"){b.preventDefault(),I();return}if(b.key==="Enter"){b.preventDefault(),_();return}const N=parseInt(b.key,10);if(!isNaN(N)&&N>=1&&N<=9){b.preventDefault();const D=l.value,$=N-1,O=D.options[$];O&&(D.multiSelect?g(D.id,O.id):f(D.id,O.id))}}return tn(()=>document.addEventListener("keydown",A)),Ht(()=>document.removeEventListener("keydown",A)),(b,M)=>(x(),E("div",{class:Ie(["qcard",{minimized:r.value}])},[m("div",VV,[m("span",KV,L(C(s)("question.title")),1),a.value>1&&!r.value?(x(),E(Ne,{key:0},[m("span",GV,L(C(s)("question.step",{current:i.value+1,total:a.value})),1),m("button",{class:"qnav",disabled:i.value===0,onClick:c},L(C(s)("question.prev")),9,YV),m("button",{class:"qnav",disabled:i.value===a.value-1,onClick:u},L(C(s)("question.next")),9,XV)],64)):le("",!0),r.value?(x(),E("span",ZV,L(l.value.question),1)):le("",!0),m("button",{class:"qmin",title:r.value?C(s)("question.expand"):C(s)("question.minimize"),"aria-label":r.value?C(s)("question.expand"):C(s)("question.minimize"),onClick:M[0]||(M[0]=N=>r.value=!r.value)},[r.value?(x(),E("svg",QV,[...M[4]||(M[4]=[m("path",{d:"M3 6l5 5 5-5"},null,-1)])])):(x(),E("svg",eK,[...M[5]||(M[5]=[m("path",{d:"M3 8h10"},null,-1)])]))],8,JV)]),r.value?le("",!0):(x(),E("div",tK,[l.value.header?(x(),E("div",nK,L(l.value.header),1)):le("",!0),m("div",sK,L(l.value.question),1),l.value.body?(x(),Ke(Lf,{key:1,text:l.value.body,class:"qmdbody"},null,8,["text"])):le("",!0),m("div",oK,[(x(!0),E(Ne,null,Qe(l.value.options,(N,D)=>(x(),E("label",{key:N.id,class:Ie(["qopt",{selected:y(l.value.id,N.id)}]),onClick:Ze($=>l.value.multiSelect?g(l.value.id,N.id):f(l.value.id,N.id),["prevent"])},[m("span",rK,L(D+1),1),m("span",lK,[l.value.multiSelect?(x(),E("span",aK,L(y(l.value.id,N.id)?"■":"□"),1)):(x(),E("span",cK,L(y(l.value.id,N.id)?"●":"○"),1))]),m("span",uK,[m("span",dK,L(N.label),1),N.description?(x(),E("span",fK,L(N.description),1)):le("",!0)])],10,iK))),128)),l.value.allowOther?(x(),E("label",{key:0,class:Ie(["qopt",{selected:k(l.value.id)}]),onClick:Ze(()=>{},["prevent"])},[M[6]||(M[6]=m("span",{class:"qopt-key"},null,-1)),m("span",hK,[l.value.multiSelect?(x(),E("span",pK,L(k(l.value.id)?"■":"□"),1)):(x(),E("span",mK,L(k(l.value.id)?"●":"○"),1))]),m("span",gK,L(l.value.otherLabel??C(s)("question.otherDefault")),1),Ot(m("input",{"onUpdate:modelValue":M[1]||(M[1]=N=>w.value[l.value.id]=N),class:"other-input",type:"text",placeholder:l.value.otherLabel??C(s)("question.otherDefault"),onInput:M[2]||(M[2]=N=>S(l.value.id)),onFocus:M[3]||(M[3]=N=>S(l.value.id))},null,40,vK),[[An,w.value[l.value.id]]])],2)):le("",!0)])])),r.value?le("",!0):(x(),E("div",yK,[m("button",{class:"qbtn pri",disabled:!v(),onClick:_},L(C(s)("question.submit")),9,kK),m("button",{class:"qbtn",onClick:I},L(C(s)("question.dismiss")),1)]))],2))}}),_K=wt(bK,[["__scopeId","data-v-0ac38c4b"]]),wK={class:"ah"},SK={class:"akind"},CK={class:"apath"},xK={key:0,class:"abadge"},TK={key:1,class:"aw"},MK=["title","aria-label"],AK={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","aria-hidden":"true"},EK={key:1,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","aria-hidden":"true"},IK={key:0,class:"diff"},$K={class:"dg"},NK={class:"dc"},LK={key:1,class:"body-shell"},OK={class:"shell-cmd"},PK={key:0,class:"shell-cwd"},RK={key:1,class:"shell-danger"},DK={key:2,class:"body-file"},BK={class:"file-bar"},FK={class:"file-lang"},HK={class:"file-content"},WK={class:"file-ln"},UK={class:"file-text"},qK={key:3,class:"body-chip"},jK={class:"chip-label"},zK={class:"chip-value"},VK={key:0,class:"chip-detail"},KK={key:4,class:"body-chip"},GK={key:0,class:"chip-label"},YK={class:"chip-value"},XK={key:5,class:"body-chip"},ZK={class:"chip-label"},JK={class:"chip-value"},QK={key:0,class:"chip-detail"},eG={key:6,class:"body-chip"},tG={class:"chip-label"},nG={class:"chip-value"},sG={key:0,class:"chip-detail"},oG={key:7,class:"body-todo"},iG={class:"todo-glyph"},rG={key:8,class:"body-generic"},lG={class:"gen-text"},aG={key:9,class:"feedback-wrap"},cG=["placeholder"],uG={class:"feedback-hint"},dG={class:"abtn"},fG=Je({__name:"ApprovalCard",props:{block:{},agentName:{}},emits:["decide"],setup(e,{emit:t}){const n=e,s=t,{t:o}=St(),i=se(!1),r=["shell","diff","file","fileop","url","search","invocation","todo","generic"];function l(){const k=r.includes(n.block.kind)?n.block.kind:"generic";return o(`approval.title.${k}`)}const a=se(!1),c=se(""),u=se(null);function d(){a.value=!0,c.value="",setTimeout(()=>u.value?.focus(),0)}function h(){const k=c.value.trim();s("decide",{decision:"rejected",feedback:k||void 0}),a.value=!1,c.value=""}function p(){a.value=!1,c.value=""}function f(k){k.key==="Enter"&&!k.shiftKey?(k.preventDefault(),h()):k.key==="Escape"&&(k.preventDefault(),p())}function g(){s("decide",{decision:"approved"})}function w(){s("decide",{decision:"approved",scope:"session"})}function S(){s("decide",{decision:"rejected"})}function y(k){const v=(document.activeElement?.tagName??"").toLowerCase();v==="input"||v==="textarea"||i.value||(k.key==="1"?(k.preventDefault(),g()):k.key==="2"?(k.preventDefault(),w()):k.key==="3"?(k.preventDefault(),S()):k.key==="4"&&(k.preventDefault(),d()))}return tn(()=>document.addEventListener("keydown",y)),Ht(()=>document.removeEventListener("keydown",y)),(k,v)=>(x(),E("div",{class:Ie(["appr",{minimized:i.value}])},[m("div",wK,[m("span",SK,L(l()),1),m("span",CK,[e.block.kind==="diff"||e.block.kind==="file"||e.block.kind==="fileop"?(x(),E(Ne,{key:0},[yt(L(e.block.path),1)],64)):e.block.kind==="shell"?(x(),E(Ne,{key:1},[yt(L(e.block.command),1)],64)):e.block.kind==="url"?(x(),E(Ne,{key:2},[yt(L(e.block.url),1)],64)):e.block.kind==="search"?(x(),E(Ne,{key:3},[yt(L(e.block.query),1)],64)):e.block.kind==="invocation"?(x(),E(Ne,{key:4},[yt(L(e.block.name),1)],64)):e.block.kind==="generic"?(x(),E(Ne,{key:5},[yt(L(e.block.summary),1)],64)):le("",!0)]),e.agentName&&!i.value?(x(),E("span",xK,L(C(o)("approval.subagentBadge",{name:e.agentName})),1)):le("",!0),i.value?le("",!0):(x(),E("span",TK,L(C(o)("approval.required")),1)),m("button",{class:"amin",title:i.value?C(o)("question.expand"):C(o)("question.minimize"),"aria-label":i.value?C(o)("question.expand"):C(o)("question.minimize"),onClick:v[0]||(v[0]=_=>i.value=!i.value)},[i.value?(x(),E("svg",AK,[...v[2]||(v[2]=[m("path",{d:"M3 6l5 5 5-5"},null,-1)])])):(x(),E("svg",EK,[...v[3]||(v[3]=[m("path",{d:"M3 8h10"},null,-1)])]))],8,MK)]),i.value?le("",!0):(x(),E(Ne,{key:0},[e.block.kind==="diff"?(x(),E("div",IK,[(x(!0),E(Ne,null,Qe(e.block.diff,(_,I)=>(x(),E("div",{key:I,class:Ie(["dl",_.kind==="add"?"add":_.kind==="rem"?"del":""])},[m("span",$K,L(_.gutter),1),m("span",NK,L(_.text),1)],2))),128))])):e.block.kind==="shell"?(x(),E("div",LK,[m("div",OK,[v[4]||(v[4]=m("span",{class:"shell-dollar"},"$",-1)),yt(" "+L(e.block.command),1)]),e.block.cwd?(x(),E("div",PK,"cwd: "+L(e.block.cwd),1)):le("",!0),e.block.danger?(x(),E("div",RK,L(C(o)("approval.danger",{detail:e.block.danger})),1)):le("",!0)])):e.block.kind==="file"?(x(),E("div",DK,[m("div",BK,[m("span",FK,L(e.block.language??""),1)]),m("div",HK,[(x(!0),E(Ne,null,Qe(e.block.content.split(`
|
|
247
|
-
`),(_,I)=>(x(),E("div",{key:I,class:"file-line"},[m("span",WK,L(I+1),1),m("span",UK,L(_),1)]))),128))])])):e.block.kind==="fileop"?(x(),E("div",qK,[m("span",jK,L(e.block.op),1),m("span",zK,L(e.block.path),1),e.block.detail?(x(),E("span",VK,L(e.block.detail),1)):le("",!0)])):e.block.kind==="url"?(x(),E("div",KK,[e.block.method?(x(),E("span",GK,L(e.block.method),1)):le("",!0),m("span",YK,L(e.block.url),1)])):e.block.kind==="search"?(x(),E("div",XK,[m("span",ZK,L(C(o)("approval.searchQueryLabel")),1),m("span",JK,L(e.block.query),1),e.block.scope?(x(),E("span",QK,L(C(o)("approval.searchScope",{scope:e.block.scope})),1)):le("",!0)])):e.block.kind==="invocation"?(x(),E("div",eG,[m("span",tG,L(e.block.kind2),1),m("span",nG,L(e.block.name),1),e.block.description?(x(),E("span",sG,L(e.block.description),1)):le("",!0)])):e.block.kind==="todo"?(x(),E("div",oG,[(x(!0),E(Ne,null,Qe(e.block.items,(_,I)=>(x(),E("div",{key:I,class:"todo-item"},[m("span",iG,L(_.status==="done"||_.status==="completed"?"✓":"○"),1),m("span",{class:Ie(["todo-title",{"todo-done":_.status==="done"||_.status==="completed"}])},L(_.title),3)]))),128))])):(x(),E("div",rG,[m("span",lG,L(e.block.summary),1)])),a.value?(x(),E("div",aG,[Ot(m("textarea",{ref_key:"feedbackRef",ref:u,"onUpdate:modelValue":v[1]||(v[1]=_=>c.value=_),class:"feedback-ta",placeholder:C(o)("approval.feedbackPlaceholder"),rows:"2",onKeydown:f},null,40,cG),[[An,c.value]]),m("div",uG,L(C(o)("approval.feedbackHint")),1)])):le("",!0),m("div",dG,[m("div",{class:"kbtn pri",onClick:g},[yt(L(C(o)("approval.approve")),1),v[5]||(v[5]=m("span",{class:"k"},"[1]",-1))]),m("div",{class:"kbtn",onClick:w},[yt(L(C(o)("approval.approveSession")),1),v[6]||(v[6]=m("span",{class:"k"},"[2]",-1))]),m("div",{class:"kbtn",onClick:S},[yt(L(C(o)("approval.reject")),1),v[7]||(v[7]=m("span",{class:"k"},"[3]",-1))]),m("div",{class:"kbtn",onClick:d},[yt(L(C(o)("approval.feedback")),1),v[8]||(v[8]=m("span",{class:"k"},"[4]",-1))])])],64))],2))}}),hG=wt(fG,[["__scopeId","data-v-4712b8cd"]]),pG={class:"taskspane"},mG={class:"tp-head"},gG={class:"tp-title"},vG={class:"tp-count"},yG={class:"tp-list"},kG={key:0,class:"tp-empty"},bG=["role","onClick"],_G={class:"tp-name"},wG={class:"tp-kind"},SG={class:"tp-time"},CG=["onClick"],xG={key:0,class:"tp-detail"},TG={key:0,class:"tp-codebox"},MG=["onClick"],AG={class:"tp-pre"},EG={class:"tp-cmd"},IG={key:1,class:"tp-codebox"},$G=["onClick"],NG={class:"tp-pre"},LG=Je({__name:"TasksPane",props:{tasks:{}},emits:["cancel"],setup(e,{emit:t}){const n=t,{t:s}=St(),o=Js(new Set),i=Js(new Set),r=Js(new Set);function l(f){return!!(f.output&&f.output.length>0||f.meta)}function a(f){l(f)&&(o.has(f.id)?o.delete(f.id):o.add(f.id))}function c(f){switch(f){case"run":return"●";case"done":return"✓";case"fail":return"✗";default:return"○"}}function u(f){switch(f){case"run":return"s-run";case"done":return"s-done";case"fail":return"s-fail";default:return"s-pending"}}async function d(f,g,w){await xs(f)&&(w.add(g),setTimeout(()=>w.delete(g),1500))}async function h(f){f.meta&&await d(f.meta,f.id,i)}async function p(f){const g=f.output?.join(`
|
|
248
|
-
`)??"";g&&await d(g,f.id,r)}return(f,g)=>(x(),E("div",pG,[m("div",mG,[m("span",gG,L(C(s)("tasks.tag")),1),m("span",vG,L(e.tasks.length),1)]),m("div",yG,[e.tasks.length===0?(x(),E("div",kG,L(C(s)("tasks.emptyTasks")),1)):(x(!0),E(Ne,{key:1},Qe(e.tasks,w=>(x(),E("div",{key:w.id,class:Ie(["tp-row",{done:w.state==="done",fail:w.state==="fail",expandable:l(w)}])},[m("div",{class:"tp-main",role:l(w)?"button":void 0,onClick:S=>a(w)},[m("span",{class:Ie(["tp-glyph",u(w.state)])},L(c(w.state)),3),m("span",_G,L(w.name),1),m("span",wG,L(w.kind),1),m("span",SG,L(w.timing),1),w.state==="run"?(x(),E("button",{key:0,class:"tp-stop",onClick:Ze(S=>n("cancel",w.id),["stop"])},L(C(s)("tasks.stop")),9,CG)):le("",!0),l(w)?(x(),E("svg",{key:1,class:Ie(["tp-chevron",{open:o.has(w.id)}]),viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...g[0]||(g[0]=[m("path",{d:"M6 4l4 4-4 4"},null,-1)])],2)):le("",!0)],8,bG),o.has(w.id)&&l(w)?(x(),E("div",xG,[w.meta?(x(),E("div",TG,[m("button",{class:Ie(["tp-copy",{copied:i.has(w.id)}]),onClick:Ze(S=>h(w),["stop"])},L(i.has(w.id)?"已复制":"复制"),11,MG),m("pre",AG,[m("code",null,[m("span",EG,L(w.meta),1)])])])):le("",!0),w.output&&w.output.length>0?(x(),E("div",IG,[m("button",{class:Ie(["tp-copy",{copied:r.has(w.id)}]),onClick:Ze(S=>p(w),["stop"])},L(r.has(w.id)?"已复制":"复制"),11,$G),m("pre",NG,[m("code",null,[g[1]||(g[1]=yt(`
|
|
249
|
-
`,-1)),(x(!0),E(Ne,null,Qe(w.output,(S,y)=>(x(),E("span",{key:y,class:"tp-line"},L(S),1))),128)),g[2]||(g[2]=yt(`
|
|
250
|
-
`,-1))])])])):le("",!0)])):le("",!0)],2))),128))])]))}}),Hw=wt(LG,[["__scopeId","data-v-bdbdc201"]]),OG={class:"tc-title"},PG={key:0,class:"tc-count"},RG={key:0,class:"tc-list"},DG={key:0,class:"tc-empty"},BG={class:"tc-name"},FG=Je({__name:"TodoCard",props:{todos:{},inline:{type:Boolean}},setup(e){const t=e,{t:n}=St(),s=se(!1),o=H(()=>!t.inline),i=H(()=>t.inline||!s.value);function r(){o.value&&(s.value=!s.value)}const l=H(()=>t.todos.filter(c=>c.status==="done").length);function a(c){return c==="done"?"done":c==="in_progress"?"in_progress":"pending"}return(c,u)=>(x(),E("div",{class:Ie(["todo-card",{"tab-mode":e.inline}])},[(x(),Ke(gs(o.value?"button":"div"),{class:Ie(["tc-head",{static:!o.value}]),type:o.value?"button":void 0,onClick:r},{default:Mn(()=>[u[1]||(u[1]=m("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.4","aria-hidden":"true"},[m("polyline",{points:"2,4.5 3.5,6 5.5,3"}),m("polyline",{points:"2,11 3.5,12.5 5.5,9.5"}),m("line",{x1:"8",y1:"4.5",x2:"14",y2:"4.5"}),m("line",{x1:"8",y1:"11",x2:"14",y2:"11"})],-1)),m("span",OG,L(C(n)("tasks.todoTag")),1),e.todos.length>0?(x(),E("span",PG,L(l.value)+"/"+L(e.todos.length),1)):le("",!0),o.value&&e.todos.length>0?(x(),E("svg",{key:1,class:Ie(["tc-chev",{open:!s.value}]),viewBox:"0 0 16 16",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...u[0]||(u[0]=[m("polyline",{points:"4,6 8,10 12,6"},null,-1)])],2)):le("",!0)]),_:1},8,["class","type"])),i.value?(x(),E("div",RG,[e.todos.length===0?(x(),E("div",DG,L(C(n)("tasks.emptyTodo")),1)):le("",!0),(x(!0),E(Ne,null,Qe(e.todos,(d,h)=>(x(),E("div",{key:h,class:Ie(["tc-row",`s-${d.status}`])},[m("span",{class:Ie(["tc-glyph",`g-${a(d.status)}`])},null,2),m("span",BG,L(d.title),1)],2))),128))])):le("",!0)],2))}}),HG=wt(FG,[["__scopeId","data-v-26afda08"]]),WG={key:0,class:"queue-head"},UG={class:"queue-label"},qG=["title"],jG={class:"queue-list"},zG=["disabled","title","onClick"],VG={key:0,class:"queue-img",viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg"},KG=["title","onClick"],GG=Je({__name:"QueuePane",props:{queued:{},running:{type:Boolean},inline:{type:Boolean}},emits:["steer","unqueue","editQueued"],setup(e,{emit:t}){const n=t,{t:s}=St();function o(i,r){r.attachmentCount>0||n("editQueued",i)}return(i,r)=>(x(),E("div",{class:Ie(["queue-pane",{"tab-mode":e.inline}])},[e.inline?le("",!0):(x(),E("div",WG,[m("span",UG,L(C(s)("composer.queueLabel"))+" · "+L(e.queued.length),1),e.running?(x(),E("button",{key:0,class:"queue-steer",type:"button",title:C(s)("composer.steerTitle"),onClick:r[0]||(r[0]=l=>n("steer"))},L(C(s)("composer.steerNow")),9,qG)):le("",!0)])),m("div",jG,[(x(!0),E(Ne,null,Qe(e.queued,(l,a)=>(x(),E("div",{key:a,class:"queue-item"},[m("button",{class:"queue-text",type:"button",disabled:l.attachmentCount>0,title:l.attachmentCount>0?C(s)("composer.queuedHasImage",{n:l.attachmentCount}):C(s)("composer.editQueued"),onClick:c=>o(a,l)},[l.attachmentCount>0?(x(),E("svg",VG,[...r[1]||(r[1]=[m("rect",{x:"1.5",y:"2.5",width:"13",height:"11",rx:"1.5"},null,-1),m("circle",{cx:"5.5",cy:"6.5",r:"1.2"},null,-1),m("path",{d:"M2.5 12l3.5-3.5 2.5 2.5 3-3 2 2"},null,-1)])])):le("",!0),m("span",{class:Ie(["queue-text-inner",{placeholder:!l.text}])},L(l.text||C(s)("composer.queuedImageOnly",{n:l.attachmentCount})),3)],8,zG),m("button",{class:"queue-rm",title:C(s)("composer.remove"),onClick:c=>n("unqueue",a)},[...r[2]||(r[2]=[m("svg",{viewBox:"0 0 12 12",width:"10",height:"10",fill:"none",stroke:"currentColor","stroke-width":"1.6",xmlns:"http://www.w3.org/2000/svg"},[m("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),m("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,KG)]))),128))])],2))}}),YG=wt(GG,[["__scopeId","data-v-b5832f1f"]]),XG={class:"dock-work-head"},ZG={key:0,class:"dock-work-tab static"},JG={key:1,class:"dock-work-tab static"},QG={key:2,class:"dock-work-tab static"},eY={key:3,class:"dock-work-tab static"},tY=["title"],nY={class:"dock-work-body"},sY=["aria-pressed"],oY={class:"dw-count"},iY=["aria-pressed"],rY={class:"dw-count"},lY=["aria-pressed"],aY={class:"dw-count"},cY=["aria-pressed"],uY={class:"dw-count"},dY=Je({__name:"ChatDock",props:{sessionId:{},running:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},activationBadges:{},models:{},starredIds:{},skills:{},goal:{},goalExpandSignal:{},dockPanel:{},bashTasks:{},subagentTasks:{},bashRunning:{},subagentRunning:{},todoDoneCount:{},hasDockWork:{type:Boolean},todos:{},pendingQuestion:{},pendingApproval:{},mobile:{type:Boolean}},emits:["submit","steer","command","interrupt","unqueue","editQueued","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","openBtw","createGoal","controlGoal","focusGoal","focusSwarm","compact","pickModel","selectModel","answer","dismiss","approval","cancelTask","toggle-dock-panel","close-dock-panel"],setup(e,{expose:t,emit:n}){const s=e,o=n,{t:i}=St(),r=se(null),l=se(null),a=se(null);function c(h){r.value?.loadForEdit(h)}function u(h){const p=s.queued?.[h]?.text??"";p&&c(p),o("editQueued",h)}function d(h){if(!s.dockPanel)return;const p=h.target;p&&(l.value?.contains(p)||a.value?.contains(p)||o("close-dock-panel"))}return Ge(()=>s.dockPanel,h=>{typeof document>"u"||(document.removeEventListener("mousedown",d,!0),h&&document.addEventListener("mousedown",d,!0))},{immediate:!0}),Ht(()=>{typeof document<"u"&&document.removeEventListener("mousedown",d,!0)}),t({loadForEdit:c}),(h,p)=>(x(),E("div",{class:Ie(["chat-dock",[e.mobile?"align-mobile":"align-center"]]),onClick:p[31]||(p[31]=Ze(()=>{},["stop"]))},[bt(Pi,{name:"dock-panel"},{default:Mn(()=>[e.dockPanel?(x(),E("div",{key:0,ref_key:"workPanelRef",ref:l,class:"dock-work-panel",onClick:p[5]||(p[5]=Ze(()=>{},["stop"]))},[m("div",XG,[e.dockPanel==="bash"?(x(),E("span",ZG,L(C(i)("tasks.dockBash"))+" · "+L(e.bashRunning)+" "+L(C(i)("tasks.running")),1)):e.dockPanel==="subagent"?(x(),E("span",JG,L(C(i)("tasks.dockSubagent"))+" · "+L(e.subagentRunning)+" "+L(C(i)("tasks.running")),1)):e.dockPanel==="todos"?(x(),E("span",QG,L(C(i)("tasks.dockTodos"))+" · "+L(e.todoDoneCount)+"/"+L(e.todos?.length??0),1)):e.dockPanel==="queue"?(x(),E("span",eY,L(C(i)("tasks.dockQueue"))+" · "+L(e.queued?.length??0),1)):le("",!0),e.dockPanel==="queue"&&e.running?(x(),E("button",{key:4,type:"button",class:"dock-queue-steer",title:C(i)("composer.steerTitle"),onClick:p[0]||(p[0]=f=>o("steer",{text:"",attachments:[]}))},L(C(i)("composer.steerNow")),9,tY)):le("",!0)]),m("div",nY,[e.dockPanel==="bash"?(x(),Ke(Hw,{key:0,tasks:e.bashTasks,onCancel:p[1]||(p[1]=f=>o("cancelTask",f))},null,8,["tasks"])):e.dockPanel==="subagent"?(x(),Ke(Hw,{key:1,tasks:e.subagentTasks,onCancel:p[2]||(p[2]=f=>o("cancelTask",f))},null,8,["tasks"])):e.dockPanel==="todos"?(x(),Ke(HG,{key:2,todos:e.todos??[],inline:""},null,8,["todos"])):(x(),Ke(YG,{key:3,queued:e.queued??[],running:e.running,inline:"",onSteer:p[3]||(p[3]=f=>o("steer",{text:"",attachments:[]})),onUnqueue:p[4]||(p[4]=f=>o("unqueue",f)),onEditQueued:u},null,8,["queued","running"]))])],512)):le("",!0)]),_:1}),e.goal?(x(),Ke(zV,{key:0,goal:e.goal,"force-expanded":e.goalExpandSignal,onControlGoal:p[6]||(p[6]=f=>o("controlGoal",f))},null,8,["goal","force-expanded"])):le("",!0),e.hasDockWork?(x(),E("div",{key:1,ref_key:"workbarRef",ref:a,class:"dock-workbar"},[e.bashTasks.length>0?(x(),E("button",{key:0,type:"button",class:Ie(["dock-work-chip",{on:e.dockPanel==="bash"}]),"aria-pressed":e.dockPanel==="bash",onClick:p[7]||(p[7]=f=>o("toggle-dock-panel","bash"))},[p[34]||(p[34]=m("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true"},[m("circle",{cx:"8",cy:"8",r:"5.5"}),m("path",{d:"M8 4.5V8l2.5 1.5"})],-1)),m("span",null,L(C(i)("tasks.dockBash")),1),m("span",oY,[p[32]||(p[32]=yt("(",-1)),m("b",null,L(e.bashTasks.length),1),p[33]||(p[33]=yt(")",-1))])],10,sY)):le("",!0),e.subagentTasks.length>0?(x(),E("button",{key:1,type:"button",class:Ie(["dock-work-chip",{on:e.dockPanel==="subagent"}]),"aria-pressed":e.dockPanel==="subagent",onClick:p[8]||(p[8]=f=>o("toggle-dock-panel","subagent"))},[p[37]||(p[37]=m("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("path",{d:"M8 2l1.5 4.5L14 8l-4.5 1.5L8 14l-1.5-4.5L2 8l4.5-1.5z"})],-1)),m("span",null,L(C(i)("tasks.dockSubagent")),1),m("span",rY,[p[35]||(p[35]=yt("(",-1)),m("b",null,L(e.subagentTasks.length),1),p[36]||(p[36]=yt(")",-1))])],10,iY)):le("",!0),(e.todos?.length??0)>0?(x(),E("button",{key:2,type:"button",class:Ie(["dock-work-chip",{on:e.dockPanel==="todos"}]),"aria-pressed":e.dockPanel==="todos",onClick:p[9]||(p[9]=f=>o("toggle-dock-panel","todos"))},[p[40]||(p[40]=kr('<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true" data-v-bfd24aaf><path d="M3 4.5l1.5 1.5L7 3.5" data-v-bfd24aaf></path><path d="M8.5 5h4" data-v-bfd24aaf></path><path d="M3 11l1.5 1.5L7 10" data-v-bfd24aaf></path><path d="M8.5 11.5h4" data-v-bfd24aaf></path></svg>',1)),m("span",null,L(C(i)("tasks.dockTodos")),1),m("span",aY,[p[38]||(p[38]=yt("(",-1)),m("b",null,L(e.todoDoneCount)+"/"+L(e.todos?.length??0),1),p[39]||(p[39]=yt(")",-1))])],10,lY)):le("",!0),(e.queued?.length??0)>0?(x(),E("button",{key:3,type:"button",class:Ie(["dock-work-chip",{on:e.dockPanel==="queue"}]),"aria-pressed":e.dockPanel==="queue",onClick:p[10]||(p[10]=f=>o("toggle-dock-panel","queue"))},[p[43]||(p[43]=m("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true"},[m("path",{d:"M2 4l6 4 6-4"}),m("rect",{x:"2",y:"4",width:"12",height:"8",rx:"1.5"})],-1)),m("span",null,L(C(i)("tasks.dockQueue")),1),m("span",uY,[p[41]||(p[41]=yt("(",-1)),m("b",null,L(e.queued?.length??0),1),p[42]||(p[42]=yt(")",-1))])],10,cY)):le("",!0)],512)):le("",!0),e.pendingQuestion?(x(),Ke(_K,{key:e.pendingQuestion.questionId,question:e.pendingQuestion,onAnswer:p[11]||(p[11]=(f,g)=>o("answer",f,g)),onDismiss:p[12]||(p[12]=f=>o("dismiss",f))},null,8,["question"])):e.pendingApproval?(x(),Ke(hG,{key:e.pendingApproval.approvalId,class:"dock-approval",block:e.pendingApproval.block,"agent-name":e.pendingApproval.agentName,onDecide:p[13]||(p[13]=f=>o("approval",e.pendingApproval.approvalId,f))},null,8,["block","agent-name"])):(x(),Ke(d3,{key:4,ref_key:"composerRef",ref:r,"session-id":e.sessionId,running:e.running,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,onSubmit:p[14]||(p[14]=f=>o("submit",f)),onSteer:p[15]||(p[15]=f=>o("steer",f)),onCommand:p[16]||(p[16]=f=>o("command",f)),onInterrupt:p[17]||(p[17]=f=>o("interrupt")),onSetPermission:p[18]||(p[18]=f=>o("setPermission",f)),onSetThinking:p[19]||(p[19]=f=>o("setThinking",f)),onTogglePlan:p[20]||(p[20]=f=>o("togglePlan")),onToggleSwarm:p[21]||(p[21]=f=>o("toggleSwarm")),onToggleGoal:p[22]||(p[22]=f=>o("toggleGoal")),onOpenBtw:p[23]||(p[23]=f=>o("openBtw")),onCreateGoal:p[24]||(p[24]=f=>o("createGoal",f)),onControlGoal:p[25]||(p[25]=f=>o("controlGoal",f)),onFocusGoal:p[26]||(p[26]=f=>o("focusGoal")),onFocusSwarm:p[27]||(p[27]=f=>o("focusSwarm")),onCompact:p[28]||(p[28]=f=>o("compact")),onPickModel:p[29]||(p[29]=f=>o("pickModel")),onSelectModel:p[30]||(p[30]=f=>o("selectModel",f))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","activation-badges","models","starred-ids","skills"]))],2))}}),fY=wt(dY,[["__scopeId","data-v-bfd24aaf"]]),hY=["aria-label"],pY={class:"toc-track"},mY=["aria-label","onMouseenter","onClick"],gY={class:"toc-no"},vY=Je({__name:"ConversationToc",props:{items:{},metrics:{},activeTurnId:{},viewport:{},mobile:{type:Boolean},sessionLoading:{type:Boolean}},emits:["select"],setup(e,{emit:t}){const n=e,s=t,{t:o}=St(),i=H(()=>!n.mobile&&!n.sessionLoading&&n.items.length>1),r=se({visible:!1,text:"",top:0});function l(c,u){const d=u.currentTarget;d&&(r.value={visible:!0,text:c,top:d.offsetTop})}function a(){r.value.visible=!1}return(c,u)=>i.value?(x(),E("nav",{key:0,class:"conversation-toc","aria-label":C(o)("conversation.toc")},[m("div",pY,[(x(!0),E(Ne,null,Qe(e.items,(d,h)=>(x(),E("button",{key:d.id,type:"button",class:Ie(["toc-bubble",[d.role,{active:e.activeTurnId===d.id}]]),style:Ft({height:e.metrics[h]?.height+"px"}),"aria-label":`#${d.no} ${d.title}`,onMouseenter:p=>l(d.title,p),onMouseleave:a,onClick:p=>s("select",d.id)},[m("span",gY,L(d.no),1)],46,mY))),128)),e.viewport?(x(),E("div",{key:0,class:"toc-viewport",style:Ft({top:e.viewport.top+"px",height:e.viewport.height+"px"})},null,4)):le("",!0)]),bt(Pi,{name:"toc-tip"},{default:Mn(()=>[Ot(m("div",{class:"toc-tooltip",style:Ft({top:r.value.top+"px"})},L(r.value.text),5),[[Ho,r.value.visible]])]),_:1})],8,hY)):le("",!0)}}),yY=wt(vY,[["__scopeId","data-v-dc54da9a"]]),kY=5;function bY(e,t,n,s=kY){if(n||e.length<=s)return e;const o=e.slice(0,s);if(t&&!o.some(i=>i.id===t)){const i=e.find(r=>r.id===t);i&&(o[s-1]=i)}return o}const _Y={class:"chat-layout"},wY={class:"empty-hint"},SY={class:"empty-hint-title"},CY={class:"empty-hint-text"},xY={key:0,class:"ws-pick"},TY=["title"],MY={class:"ws-pick-name"},AY={key:1,class:"ws-pick-menu"},EY=["onClick"],IY={class:"ws-pick-item-name"},$Y={class:"ws-pick-item-path"},NY={key:0,class:"swarm-stack"},LY=["aria-label"],OY={key:0,class:"abort-toast",role:"status","aria-live":"polite"},PY={class:"abort-toast-text"},hd=10,RY=56,DY=420,Ww=80,BY=1e3,FY=3e3,HY=Je({__name:"ConversationPane",props:{turns:{},sessionId:{},approvals:{},gitInfo:{},tasks:{},todos:{},goal:{},swarms:{},activationBadges:{},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},questions:{},running:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},changes:{},fileReloadKey:{},sending:{type:Boolean},fastMoon:{type:Boolean},mobile:{type:Boolean},modern:{type:Boolean},sessionLoading:{type:Boolean},compaction:{},hasMoreMessages:{type:Boolean},loadingMore:{type:Boolean},loadingMoreError:{type:Boolean},loadOlderMessages:{type:Function},models:{},starredIds:{},skills:{},workspaceName:{},workspaceRoot:{},gitDiffStats:{},workspaces:{},activeWorkspaceId:{},sessionTitle:{},pr:{},betaToc:{type:Boolean}},emits:["submit","steer","approval","cancelTask","answer","dismiss","command","interrupt","unqueue","editQueued","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","createGoal","controlGoal","compact","pickModel","selectModel","openFile","openMedia","openThinking","openCompaction","openAgent","openChanges","refreshGitStatus","editMessage","selectWorkspace","addWorkspace","openPr","renameSession","forkSession","archiveSession"],setup(e,{expose:t,emit:n}){const s=e,o=n,i=se(!1),r=se(!1),l=H(()=>s.workspaces?.find(he=>he.id===s.activeWorkspaceId)?.name??s.workspaceName??""),a=H(()=>(s.workspaces?.length??0)>0),c=H(()=>bY(s.workspaces??[],s.activeWorkspaceId,r.value)),u=H(()=>(s.workspaces?.length??0)-c.value.length);Ge(i,$e=>{$e||(r.value=!1)});const d=H(()=>s.swarms?.filter($e=>$e.members.some(he=>he.phase!=="completed"&&he.phase!=="failed"))??[]);function h($e){i.value=!1,$e!==s.activeWorkspaceId&&o("selectWorkspace",$e)}const{t:p}=St();Uc(Et.contentAlign);const f=se(null),g=se(null),w=se(null),S=se(!1),y=se(0);let k=null;function v($e){(w.value??g.value)?.loadForEdit($e)}function _(){S.value=!0,k!==null&&clearTimeout(k),k=setTimeout(()=>{k=null,S.value=!1},2e3)}function I(){y.value++}function A(){vt(()=>{Le.value?.querySelector(".swarm-card")?.scrollIntoView({behavior:"smooth",block:"center"})})}const b=H(()=>s.mobile===!0||s.modern===!0),M=H(()=>s.tasks.filter($e=>$e.kind!=="subagent")),N=H(()=>s.tasks.filter($e=>$e.kind==="subagent")),D=H(()=>M.value.filter($e=>$e.state==="run").length),$=H(()=>N.value.filter($e=>$e.state==="run").length),O=H(()=>(s.todos??[]).filter($e=>$e.status==="done").length),P=H(()=>s.tasks.length>0||(s.todos?.length??0)>0||(s.queued?.length??0)>0),R=se(null),F=H(()=>s.gitInfo?s.changes?.length??0:0);function V($e){R.value=R.value===$e?null:$e}function K(){R.value=null}Ge(P,$e=>{$e||K()});function Z($e){if($e.role==="compaction")return p("conversation.compactedPlain");if($e.role==="user"){if($e.skillActivation)return`/${$e.skillActivation.name}`;const We=$e.text.trim().replaceAll(/\s+/g," ");return We.length>0?We:"user"}const he=($e.text||$e.thinking||"").trim().replaceAll(/\s+/g," ");return he.length>0?he:($e.tools?.length??0)>0?`${$e.tools.length} tools`:"kimi"}const G=H(()=>s.turns.map(($e,he)=>({id:$e.id,role:$e.role,no:$e.no||he+1,title:Z($e)})));function X($e){return $e.role==="compaction"?20:$e.role==="user"?($e.text?.length??0)+($e.skillActivation?20:0):($e.text?.length??0)+($e.thinking?.length??0)+($e.tools?.reduce((he,We)=>he+We.name.length+(We.arg?.length??0)+(We.output?.join("").length??0),0)??0)}const pe=H(()=>{const $e=G.value,he=$e.map(jt=>{const Gt=s.turns.find(It=>It.id===jt.id);return Gt?X(Gt):hd}),We=he.reduce((jt,Gt)=>jt+Gt,0)||$e.length*hd;return $e.map((jt,Gt)=>{const It=he[Gt]??hd,Nt=We>0?It/We:0,co=Math.max(hd,Math.min(RY,Nt*DY));return{id:jt.id,height:Math.round(co)}})}),oe=H(()=>pe.value.reduce(($e,he)=>$e+he.height,0)+(G.value.length-1)*4),ye=se(null),_e=se(null);function de(){const $e=Le.value;if(!$e)return;const he=$e.querySelectorAll(".turn-anchor[data-turn-id]");if(he.length===0)return;const We=$e.getBoundingClientRect(),jt=We.height/2;let Gt=null,It=1/0;he.forEach(Bi=>{const ne=Bi.getBoundingClientRect(),q=ne.top-We.top,te=Math.abs(q+ne.height/2-jt);te<It&&(It=te,Gt=Bi.dataset.turnId??null)}),ye.value=Gt;const Nt=$e.scrollHeight-$e.clientHeight,co=Nt>0?$e.scrollTop/Nt:0,uo=oe.value,ui=co*uo,fo=$e.scrollHeight>0?$e.clientHeight/$e.scrollHeight*uo:uo;_e.value={top:Math.max(0,ui),height:Math.max(8,Math.min(fo,uo-ui))}}const be=H(()=>s.questions&&s.questions.length>0?s.questions[0]:void 0),xe=H(()=>s.approvals&&s.approvals.length>0?s.approvals[0]:void 0),Le=se(null),ee=se(null),ke=se(0),ge=se(0),W=H(()=>({"--panes-scrollbar-width":`${ke.value}px`}));function J($e){return $e instanceof HTMLElement?$e:$e&&"$el"in $e&&$e.$el instanceof HTMLElement?$e.$el:null}function ue(){const $e=Le.value;ke.value=$e?Math.max(0,$e.offsetWidth-$e.clientWidth):0,ge.value=ee.value?.offsetHeight??0}function ie($e){const he=J($e);Le.value=he,he&&qe()}function ae($e){const he=J($e);ee.value=he??null,$e&&"loadForEdit"in $e&&typeof $e.loadForEdit=="function"?w.value={loadForEdit:$e.loadForEdit.bind($e)}:w.value=null,je()}const U=se(!0),Y=se(!1);function ce(){const $e=Le.value;return $e?$e.scrollHeight-$e.scrollTop-$e.clientHeight:0}let me=0,Se=0,Ee=0,re=0,Te=0;function Ue(){return Date.now()<Se}function nt(){const $e=Le.value;if(!$e)return;const he=$e.scrollTop;if(performance.now()-Ee<100){me=he;return}const We=ce();if(Ue()){U.value=!0,Y.value=!1,me=he;return}he<me-1&&We>1?U.value=!1:We<=Ww&&he>me+1&&(U.value=!0,Y.value=!1),me=he,de()}function ct($e=!1){const he=Le.value;he&&($e&&typeof he.scrollTo=="function"?(Ee=performance.now(),he.scrollTo({top:he.scrollHeight,behavior:"smooth"})):he.scrollTop=he.scrollHeight,me=he.scrollTop,U.value=!0,Y.value=!1)}function Re($e,he){const We=$e.querySelectorAll(".turn-anchor");for(const jt of We)if(jt.offsetTop>=he){const Gt=jt.dataset.turnId;if(Gt)return{id:Gt,top:jt.offsetTop}}return null}async function Pe(){if(!s.sessionId||!s.loadOlderMessages||s.loadingMore||!s.hasMoreMessages)return;const $e=s.sessionId,he=Le.value,We=he?.scrollTop??0,jt=he?.scrollHeight??0,Gt=he?Re(he,We):null;Un.value=!0;try{await s.loadOlderMessages($e),await vt()}finally{Un.value=!1}if(s.sessionId!==$e)return;const It=Le.value;if(!It)return;let Nt=0;if(Gt){const co=It.querySelector(`.turn-anchor[data-turn-id="${st(Gt.id)}"]`);co&&(Nt=co.offsetTop-Gt.top)}Nt===0&&(Nt=It.scrollHeight-jt),It.scrollTop=We+Nt}function st($e){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape($e):$e.replaceAll(/["\\]/g,"\\$&")}function et($e){const he=Le.value;if(!he)return;const We=he.querySelector(`.turn-anchor[data-turn-id="${st($e)}"]`);We&&(U.value=!1,Y.value=ce()>Ww,We.scrollIntoView({behavior:"smooth",block:"center"}))}function mt(){const $e=Le.value;if(!$e)return"none";const he=$e.firstElementChild,We=he instanceof HTMLElement?he.offsetHeight:0,jt=ee.value?.offsetHeight??0;return`${$e.scrollHeight}:${$e.clientHeight}:${We}:${jt}`}function dn($e){return typeof requestAnimationFrame=="function"?requestAnimationFrame($e):setTimeout($e,16)}function wn($e){typeof cancelAnimationFrame=="function"?cancelAnimationFrame($e):clearTimeout($e)}function xt($e=36){if(!U.value&&!Ue())return;const he=++Te;let We="",jt=0,Gt=0;re&&(wn(re),re=0);const It=()=>{if(re=0,he!==Te||!U.value&&!Ue())return;ct(!1);const Nt=mt();jt=Nt===We?jt+1:0,We=Nt,Gt++,jt<3&&Gt<$e&&(re=dn(It))};re=dn(It)}function ln($e,he){return $e!==void 0&&$e.length>0&&he.length>=$e.length&&$e.firstId!==he.firstId&&$e.lastId===he.lastId&&$e.lastTextLen===he.lastTextLen&&$e.lastThinkingLen===he.lastThinkingLen&&$e.lastToolsLen===he.lastToolsLen&&$e.approvalIds===he.approvalIds}const Sn=H(()=>{const $e=(s.approvals??[]).map(It=>It.approvalId).join(","),he=s.turns,We=he.at(-1),jt=We?.thinking?.length??0,Gt=We?.tools?.reduce((It,Nt)=>It+Nt.name.length+(Nt.arg?.length??0)+(Nt.output?.join("").length??0),0)??0;return{length:he.length,firstId:he[0]?.id??"",lastId:We?.id??"",lastTextLen:We?.text.length??0,lastThinkingLen:jt,lastToolsLen:Gt,approvalIds:$e}});Ge(Sn,async($e,he)=>{if(Un.value&&ln(he,$e)){de();return}await vt(),U.value||Ue()?ct(!1):Y.value=!0,de()}),Ge(ee,()=>{je()}),Ge(()=>s.mobile,async()=>{await vt(),ue()}),Ge(()=>s.fileReloadKey,async()=>{U.value=!0,me=0,await vt(),xt(),de()}),Ge(()=>s.sessionLoading,async($e,he)=>{$e||!he||(U.value=!0,await vt(),xt(),de())}),Ge(()=>s.running,async($e,he)=>{$e||!he||!U.value&&!Ue()||(await vt(),xt(48),de())});function Xe(){U.value=!0,Y.value=!1,Se=Date.now()+BY,vt(()=>{ct(!1),xt(16)})}function Ln($e){Xe(),o("submit",$e)}function es($e,he){Xe(),o("answer",$e,he)}function $s($e,he){!$e||!he||o("approval",$e,he)}let Cn=null,fn=null,Hn=null,Wn=null,Yn=0,ks=!1;const Un=se(!1);function bs($e){if(Un.value||(ks=ks||$e,Yn))return;Yn=(typeof requestAnimationFrame=="function"?requestAnimationFrame:We=>setTimeout(We,16))(()=>{Yn=0;const We=ks;ks=!1,U.value||Ue()?ct(!1):We&&(Y.value=!0)})}function Ye(){if(!fn)return;const $e=Le.value?.firstElementChild??null;$e!==Hn&&(Hn&&fn.unobserve(Hn),Hn=$e,$e&&fn.observe($e))}function je(){if(!fn)return;const $e=ee.value;$e!==Wn&&(Wn&&fn.unobserve(Wn),Wn=$e,$e&&fn.observe($e))}function qe(){const $e=Le.value;ue(),Cn&&(Cn.disconnect(),$e&&Cn.observe($e,{childList:!0,subtree:!0,characterData:!0})),fn&&(fn.disconnect(),Hn=null,Wn=null,$e&&fn.observe($e),Ye(),je())}function Tt(){Ye(),bs(!0)}function on(){typeof document>"u"||document.visibilityState==="visible"&&U.value&&xt()}const ao=se(!1);let Lo=null;function Er(){ao.value=!0,Lo!==null&&clearTimeout(Lo),Lo=setTimeout(()=>{ao.value=!1},FY)}function Oo(){Er(),o("interrupt")}function ci($e){$e.key==="Escape"&&(s.running||s.sending)&&($e.preventDefault(),Oo())}return tn(()=>{vt(()=>{typeof MutationObserver=="function"&&(Cn=new MutationObserver(Tt)),typeof ResizeObserver=="function"&&(fn=new ResizeObserver(()=>{ue(),bs(!1)})),qe(),xt(48),de(),typeof document<"u"&&(document.addEventListener("visibilitychange",on),document.addEventListener("keydown",ci))})}),Ht(()=>{Cn&&Cn.disconnect(),fn&&fn.disconnect(),Yn&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(Yn),re&&wn(re),Lo!==null&&clearTimeout(Lo),k!==null&&(clearTimeout(k),k=null),typeof document<"u"&&(document.removeEventListener("visibilitychange",on),document.removeEventListener("keydown",ci))}),t({loadComposerForEdit:v}),($e,he)=>(x(),E("section",{class:Ie(["con",{mobile:e.mobile}])},[!e.mobile&&!(e.turns.length===0&&!e.sessionLoading)?(x(),Ke(Fj,{key:0,"session-id":e.sessionId,"workspace-name":e.workspaceName,"workspace-root":e.workspaceRoot,"session-title":e.sessionTitle,branch:e.gitInfo?.branch,ahead:e.gitInfo?.ahead,behind:e.gitInfo?.behind,"changes-count":F.value,"git-diff-stats":e.gitDiffStats,"is-git-repo":!!e.gitInfo,pr:e.pr,copied:S.value,onOpenChanges:he[0]||(he[0]=We=>o("openChanges")),onCopyAll:he[1]||(he[1]=We=>f.value?.copyConversation()),onCopyFinalSummary:he[2]||(he[2]=We=>f.value?.copyFinalSummary()),onOpenPr:he[3]||(he[3]=We=>e.pr&&o("openPr",e.pr.url)),onRenameSession:he[4]||(he[4]=(We,jt)=>o("renameSession",We,jt)),onForkSession:he[5]||(he[5]=We=>o("forkSession",We)),onArchiveSession:he[6]||(he[6]=We=>o("archiveSession",We))},null,8,["session-id","workspace-name","workspace-root","session-title","branch","ahead","behind","changes-count","git-diff-stats","is-git-repo","pr","copied"])):le("",!0),e.betaToc?(x(),Ke(yY,{key:1,items:G.value,metrics:pe.value,"active-turn-id":ye.value,viewport:_e.value,mobile:e.mobile,"session-loading":e.sessionLoading,onSelect:et},null,8,["items","metrics","active-turn-id","viewport","mobile","session-loading"])):le("",!0),m("div",_Y,[m("div",{ref:ie,class:"panes chat-scroll",onScrollPassive:nt},[m("div",{class:Ie(["content-wrap",[e.mobile?"align-mobile":"align-center"]])},[e.turns.length===0&&!e.sessionLoading?(x(),E(Ne,{key:0},[he[58]||(he[58]=m("div",{class:"empty-spacer"},null,-1)),m("div",wY,[m("span",SY,L(C(p)("composer.emptyConversationTitle")),1),m("span",CY,L(C(p)("composer.emptyConversation")),1),a.value?(x(),E("div",xY,[m("button",{type:"button",class:"ws-pick-btn",title:C(p)("conversation.switchWorkspace"),onClick:he[7]||(he[7]=Ze(We=>i.value=!i.value,["stop"]))},[he[54]||(he[54]=m("svg",{viewBox:"0 0 14 14",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.2","aria-hidden":"true"},[m("path",{d:"M1 3.5V2.5A1 1 0 0 1 2 1.5h3.5l1.3 2h5.2a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1z"}),m("path",{d:"M1 5.5h12"})],-1)),m("span",MY,L(l.value),1),(x(),E("svg",{class:Ie(["ws-pick-chev",{open:i.value}]),viewBox:"0 0 16 16",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...he[53]||(he[53]=[m("polyline",{points:"4,6 8,10 12,6"},null,-1)])],2))],8,TY),i.value?(x(),E("div",{key:0,class:"ws-pick-backdrop",onClick:he[8]||(he[8]=We=>i.value=!1)})):le("",!0),i.value?(x(),E("div",AY,[(x(!0),E(Ne,null,Qe(c.value,We=>(x(),E("button",{key:We.id,type:"button",class:Ie(["ws-pick-item",{on:We.id===e.activeWorkspaceId}]),onClick:Ze(jt=>h(We.id),["stop"])},[m("span",IY,L(We.name),1),m("span",$Y,L(We.shortPath),1)],10,EY))),128)),u.value>0?(x(),E("button",{key:0,type:"button",class:"ws-pick-item ws-pick-more",onClick:he[9]||(he[9]=Ze(We=>r.value=!r.value,["stop"]))},[m("span",null,L(C(p)("conversation.moreWorkspaces",{count:u.value})),1)])):le("",!0),he[56]||(he[56]=m("div",{class:"ws-pick-divider"},null,-1)),m("button",{type:"button",class:"ws-pick-action",onClick:he[10]||(he[10]=Ze(We=>{i.value=!1,o("addWorkspace")},["stop"]))},[he[55]||(he[55]=m("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[m("path",{d:"M8 3v10M3 8h10"})],-1)),m("span",null,L(C(p)("conversation.addWorkspace")),1)])])):le("",!0)])):(x(),E("button",{key:1,type:"button",class:"empty-add-workspace",onClick:he[11]||(he[11]=We=>o("addWorkspace"))},[he[57]||(he[57]=m("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[m("path",{d:"M1 3.5V2.5A1 1 0 0 1 2 1.5h3.5l1.3 2h5.2a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1z"}),m("path",{d:"M1 5.5h12"}),m("path",{d:"M8 7.25v4.5M5.75 9.5h4.5"})],-1)),m("span",null,L(C(p)("conversation.addWorkspace")),1)]))]),bt(d3,{ref_key:"emptyComposerRef",ref:g,class:"empty-composer","session-id":e.sessionId,running:e.running,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,"hide-context":"",onSubmit:Ln,onSteer:he[12]||(he[12]=We=>o("steer",We)),onCommand:he[13]||(he[13]=We=>o("command",We)),onInterrupt:Oo,onUnqueue:he[14]||(he[14]=We=>o("unqueue",We)),onEditQueued:he[15]||(he[15]=We=>o("editQueued",We)),onSetPermission:he[16]||(he[16]=We=>o("setPermission",We)),onSetThinking:he[17]||(he[17]=We=>o("setThinking",We)),onTogglePlan:he[18]||(he[18]=We=>o("togglePlan")),onToggleSwarm:he[19]||(he[19]=We=>o("toggleSwarm")),onToggleGoal:he[20]||(he[20]=We=>o("toggleGoal")),onOpenBtw:he[21]||(he[21]=We=>o("command","/btw")),onCreateGoal:he[22]||(he[22]=We=>o("createGoal",We)),onControlGoal:he[23]||(he[23]=We=>o("controlGoal",We)),onFocusGoal:I,onFocusSwarm:A,onCompact:he[24]||(he[24]=We=>o("compact")),onPickModel:he[25]||(he[25]=We=>o("pickModel")),onSelectModel:he[26]||(he[26]=We=>o("selectModel",We))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","activation-badges","models","starred-ids","skills"]),he[59]||(he[59]=m("div",{class:"empty-spacer"},null,-1))],64)):(x(),E(Ne,{key:1},[(x(),Ke(l3,{ref_key:"chatPaneRef",ref:f,key:e.fileReloadKey??"no-session",turns:e.turns,approvals:e.approvals,bubble:b.value,mobile:e.mobile,running:e.running,sending:e.sending,"fast-moon":e.fastMoon,"session-loading":e.sessionLoading,compaction:e.compaction,"has-more-messages":e.hasMoreMessages,"loading-more":e.loadingMore,"loading-more-error":e.loadingMoreError,"is-following":U.value,onOpenFile:he[27]||(he[27]=We=>o("openFile",We)),onOpenMedia:he[28]||(he[28]=We=>o("openMedia",We)),onCopyConversationCopied:_,onOpenThinking:he[29]||(he[29]=We=>o("openThinking",We)),onOpenCompaction:he[30]||(he[30]=We=>o("openCompaction",We)),onOpenAgent:he[31]||(he[31]=We=>o("openAgent",We)),onEditMessage:he[32]||(he[32]=We=>o("editMessage",We)),onLoadOlderMessages:Pe},null,8,["turns","approvals","bubble","mobile","running","sending","fast-moon","session-loading","compaction","has-more-messages","loading-more","loading-more-error","is-following"])),d.value.length>0?(x(),E("div",NY,[(x(!0),E(Ne,null,Qe(d.value,We=>(x(),Ke(RV,{key:We.id,group:We},null,8,["group"]))),128))])):le("",!0)],64))],2)],32),e.turns.length===0&&!e.sessionLoading?le("",!0):(x(),Ke(fY,{key:0,ref:ae,style:Ft(W.value),"session-id":e.sessionId,running:e.running,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,goal:e.goal,"goal-expand-signal":y.value,"dock-panel":R.value,"bash-tasks":M.value,"subagent-tasks":N.value,"bash-running":D.value,"subagent-running":$.value,"todo-done-count":O.value,"has-dock-work":P.value,todos:e.todos,"pending-question":be.value,"pending-approval":xe.value,mobile:e.mobile,onToggleDockPanel:he[33]||(he[33]=We=>V(We)),onCloseDockPanel:he[34]||(he[34]=We=>K()),onAnswer:es,onDismiss:he[35]||(he[35]=We=>o("dismiss",We)),onApproval:$s,onCancelTask:he[36]||(he[36]=We=>o("cancelTask",We)),onControlGoal:he[37]||(he[37]=We=>o("controlGoal",We)),onSubmit:Ln,onSteer:he[38]||(he[38]=We=>o("steer",We)),onCommand:he[39]||(he[39]=We=>o("command",We)),onInterrupt:Oo,onUnqueue:he[40]||(he[40]=We=>o("unqueue",We)),onEditQueued:he[41]||(he[41]=We=>o("editQueued",We)),onSetPermission:he[42]||(he[42]=We=>o("setPermission",We)),onSetThinking:he[43]||(he[43]=We=>o("setThinking",We)),onTogglePlan:he[44]||(he[44]=We=>o("togglePlan")),onToggleSwarm:he[45]||(he[45]=We=>o("toggleSwarm")),onToggleGoal:he[46]||(he[46]=We=>o("toggleGoal")),onOpenBtw:he[47]||(he[47]=We=>o("command","/btw")),onCreateGoal:he[48]||(he[48]=We=>o("createGoal",We)),onFocusGoal:I,onFocusSwarm:A,onCompact:he[49]||(he[49]=We=>o("compact")),onPickModel:he[50]||(he[50]=We=>o("pickModel")),onSelectModel:he[51]||(he[51]=We=>o("selectModel",We))},null,8,["style","session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","activation-badges","models","starred-ids","skills","goal","goal-expand-signal","dock-panel","bash-tasks","subagent-tasks","bash-running","subagent-running","todo-done-count","has-dock-work","todos","pending-question","pending-approval","mobile"]))]),bt(Pi,{name:"pill"},{default:Mn(()=>[Y.value?(x(),E("button",{key:0,class:"newmsg-pill",style:Ft({bottom:`${ge.value+12}px`}),"aria-label":C(p)("conversation.jumpToLatestAria"),onClick:he[52]||(he[52]=We=>ct(!0))},[he[60]||(he[60]=m("svg",{class:"pill-chevron",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("polyline",{points:"4,6 8,10 12,6"})],-1)),yt(" "+L(C(p)("conversation.newMessages")),1)],12,LY)):le("",!0)]),_:1}),bt(Pi,{name:"abort-toast"},{default:Mn(()=>[ao.value?(x(),E("div",OY,[m("span",PY,L(C(p)("conversation.manuallyAborted")),1)])):le("",!0)]),_:1})],2))}}),WY=wt(HY,[["__scopeId","data-v-2a546fd5"]]),UY={key:0,class:"fp-empty fp-error"},qY={key:1,class:"fp-empty"},jY={key:2,class:"fp-loading"},zY={class:"fp-header"},VY={class:"fp-title"},KY=["title"],GY={class:"fp-meta"},YY={key:0,class:"fp-lines"},XY={class:"fp-size"},ZY=["aria-label"],JY=["aria-label"],QY=["aria-label"],eX={key:3,class:"fp-search"},tX=["placeholder"],nX={key:0,class:"fp-search-count"},sX=["disabled","title"],oX=["disabled","title"],iX=["title"],rX={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},lX={key:1,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},aX=["title"],cX=["title"],uX=["href","title"],dX=["title"],fX={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},hX={key:1,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},pX=["title","aria-label"],mX={key:1,class:"fp-code"},gX={class:"fp-line-table"},vX=["data-line"],yX={class:"fp-gutter"},kX=["innerHTML"],bX={key:1,class:"fp-body fp-code"},_X={class:"fp-line-table"},wX=["data-line"],SX={class:"fp-gutter"},CX=["innerHTML"],xX={key:2,class:"fp-body"},TX=["srcdoc","title"],MX={key:1,class:"fp-code"},AX={class:"fp-line-table"},EX=["data-line"],IX={class:"fp-gutter"},$X=["innerHTML"],NX={key:3,class:"fp-body fp-pdf-wrap"},LX=["src","title"],OX={key:1,class:"fp-binary-card"},PX={class:"fp-binary-label"},RX={key:4,class:"fp-body fp-table-wrap"},DX={class:"fp-table"},BX=["data-line"],FX={key:5,class:"fp-body fp-image-wrap"},HX=["src","alt"],WX={key:1,class:"fp-binary-card"},UX={class:"fp-binary-label"},qX={key:6,class:"fp-body fp-code"},jX={class:"fp-line-table"},zX=["data-line"],VX={class:"fp-gutter"},KX=["innerHTML"],GX={key:7,class:"fp-body fp-binary-wrap"},YX={class:"fp-binary-card"},XX={class:"fp-binary-label"},ZX=Je({__name:"FilePreview",props:{file:{},loading:{type:Boolean},error:{},line:{},downloadUrl:{},closable:{type:Boolean},externalActions:{type:Boolean},openFile:{type:Function}},emits:["close","openExternal","reveal"],setup(e,{emit:t}){const{t:n}=St();function s(de,be){const xe=be?be.split("/").filter(Boolean):[];for(const Le of de.split("/"))Le===""||Le==="."||(Le===".."?xe.pop():xe.push(Le));return xe.join("/")}const o=Pt("resolveImage",async de=>de),i=H(()=>{const de=c.file?.path??"",be=de.lastIndexOf("/");return be>0?de.slice(0,be):""});function r(de){if(/^(https?:|data:|blob:)/i.test(de)||de.startsWith("/"))return de;const be=i.value;return be?s(de,be):de}async function l(de){const be=r(de);return o?o(be):be}gn("resolveImage",l);function a(de){let be=de.path;if(/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(be)||be.startsWith("/"))return de;for(const Le of["#","?"]){const ee=be.indexOf(Le);ee!==-1&&(be=be.slice(0,ee))}const xe=i.value;return{...de,path:s(be,xe)}}const c=e,u=t;function d(de){c.openFile?.(a(de))}const h=se(null),p=H(()=>{const de=c.file;if(!de)return"binary";const be=de.mime??"",xe=de.languageId??"",Le=de.path.toLowerCase();return be==="text/markdown"||xe==="markdown"||xe==="md"||Le.endsWith(".mdx")?"markdown":be==="application/json"||xe==="json"?"json":be==="text/html"||xe==="html"||Le.endsWith(".html")||Le.endsWith(".htm")?"html":be==="application/pdf"||Le.endsWith(".pdf")?"pdf":be==="text/csv"||xe==="csv"||Le.endsWith(".csv")?"csv":be.startsWith("image/")?"image":de.isBinary?"binary":be.startsWith("text/")||xe!==""?"text":"binary"});function f(de){const be=atob(de),xe=Uint8Array.from(be,Le=>Le.charCodeAt(0));return new TextDecoder().decode(xe)}const g=H(()=>{const de=c.file;if(!de)return"";if(de.encoding==="base64")try{return f(de.content)}catch{return de.content}return de.content}),w=H(()=>{if(p.value!=="json"||!c.file)return"";try{return JSON.stringify(JSON.parse(g.value),null,2)}catch{return g.value}}),S=H(()=>c.file?(p.value==="json"?w.value:g.value).split(`
|
|
251
|
-
`):[]),y=H(()=>c.file?p.value==="json"?w.value:g.value:""),k=se(""),v=se(0),_=H(()=>{const de=k.value.trim().toLowerCase();if(!de)return[];const be=[];return S.value.forEach((xe,Le)=>{xe.toLowerCase().includes(de)&&be.push(Le+1)}),be});Ge(k,()=>{v.value=0});function I(de,be=!1){de&&vt(()=>{const xe=h.value?.querySelector(".fp-body"),Le=xe?.querySelector(`[data-line="${de}"]`);if(!xe||!Le)return;be&&(xe.scrollTop=0);const ee=xe.getBoundingClientRect(),ke=Le.getBoundingClientRect(),ge=ke.top-ee.top+xe.scrollTop;xe.scrollTop=ge-xe.clientHeight/2+ke.height/2})}Ge(()=>[c.file?.path,c.line],()=>I(c.line,!0),{immediate:!0});function A(de){const be=_.value;be.length!==0&&(v.value=(v.value+de+be.length)%be.length,I(be[v.value]))}function b(de){const be=_.value;return{target:c.line===de,hit:be.includes(de),active:be[v.value]===de}}function M(de){return de<1024?`${de} B`:de<1024*1024?`${(de/1024).toFixed(1)} KB`:`${(de/(1024*1024)).toFixed(1)} MB`}const N=se(!1),D=se(!1);function $(){c.file&&xs(y.value).then(de=>{de&&(N.value=!0,setTimeout(()=>{N.value=!1},1400))})}function O(){c.file&&xs(c.file.path).then(de=>{de&&(D.value=!0,setTimeout(()=>{D.value=!1},1400))})}const P=se("preview"),R=se("preview"),F=se("fit");Ge(p,de=>{P.value=de==="html"?"preview":"source",R.value="preview",F.value="fit"});const V=H(()=>{const de=c.file;return!de||p.value!=="image"?null:de.sourceUrl?de.sourceUrl:de.encoding==="base64"?`data:${de.mime};base64,${de.content}`:de.mime==="image/svg+xml"?`data:${de.mime};charset=utf-8,${encodeURIComponent(de.content)}`:null}),K=H(()=>{const de=c.file;return!de||p.value!=="pdf"?null:c.downloadUrl?c.downloadUrl:de.encoding==="base64"?`data:${de.mime};base64,${de.content}`:null}),Z=H(()=>c.file?["<!doctype html>",'<meta charset="utf-8">',`<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src data: blob:; style-src 'unsafe-inline'; font-src data:;">`,g.value].join(""):"");function G(de){const be=[];let xe="",Le=!1;for(let ee=0;ee<de.length;ee++){const ke=de[ee];ke==='"'&&de[ee+1]==='"'?(xe+='"',ee++):ke==='"'?Le=!Le:ke===","&&!Le?(be.push(xe),xe=""):xe+=ke}return be.push(xe),be}const X=H(()=>S.value.slice(0,200).map(G));function pe(de){return de.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""")}function oe(){const de=c.file;if(!de)return"";const be=de.languageId?.toLowerCase();return be||(de.path.split(".").pop()?.toLowerCase()??"")}function ye(de){const be=oe();let xe=pe(de);return p.value==="json"||be==="json"||be==="jsonc"?(xe=xe.replace(/("[^&]*?")(\s*:)/g,'<span class="tok-key">$1</span>$2'),xe=xe.replace(/(:\s*)("[^&]*?")/g,'$1<span class="tok-string">$2</span>'),xe=xe.replace(/\b(true|false|null)\b/g,'<span class="tok-literal">$1</span>'),xe=xe.replace(/(:\s*)(-?\d+(?:\.\d+)?)/g,'$1<span class="tok-number">$2</span>'),xe):p.value==="html"||be==="html"||be==="xml"||be==="svg"?(xe=xe.replace(/\s([A-Za-z_:][-A-Za-z0-9_:.]*)(=)/g,' <span class="tok-attr">$1</span>$2'),xe=xe.replace(/(".*?")/g,'<span class="tok-string">$1</span>'),xe=xe.replace(/(<\/?)([A-Za-z][\w:-]*)/g,'$1<span class="tok-tag">$2</span>'),xe):(xe=xe.replace(/\b(async|await|break|case|catch|class|const|continue|else|export|extends|finally|for|from|function|if|import|interface|let|new|return|switch|throw|try|type|while)\b/g,'<span class="tok-keyword">$1</span>'),xe=xe.replace(/(".*?"|'.*?')/g,'<span class="tok-string">$1</span>'),xe=xe.replace(/(\/\/.*)$/g,'<span class="tok-comment">$1</span>'),xe)}function _e(de,be=55){return!de||de.length<=be?de:"…"+de.slice(de.length-be+1)}return(de,be)=>(x(),E("div",{ref_key:"rootRef",ref:h,class:"file-preview"},[e.error&&!e.loading?(x(),E("div",UY,[m("span",null,L(e.error),1),e.closable?(x(),E("button",{key:0,type:"button",class:"fp-action",onClick:be[0]||(be[0]=xe=>u("close"))},L(C(n)("filePreview.close")),1)):le("",!0)])):!e.file&&!e.loading?(x(),E("div",qY,L(C(n)("filePreview.empty")),1)):e.loading?(x(),E("div",jY,[be[13]||(be[13]=m("span",{class:"spinner"},null,-1)),m("span",null,L(C(n)("filePreview.loading")),1)])):e.file?(x(),E(Ne,{key:3},[m("div",zY,[m("span",VY,L(C(n)("common.preview")),1),m("span",{class:"fp-path",title:e.file.path},L(_e(e.file.path)),9,KY),m("span",GY,[e.file.lineCount?(x(),E("span",YY,L(C(n)("filePreview.lineCount",{count:e.file.lineCount})),1)):le("",!0),m("span",XY,L(M(e.file.size)),1)]),p.value==="html"?(x(),E("div",{key:0,class:"fp-seg",role:"group","aria-label":C(n)("filePreview.htmlMode")},[m("button",{type:"button",class:Ie(["fp-seg-btn",{on:P.value==="preview"}]),onClick:be[1]||(be[1]=xe=>P.value="preview")},L(C(n)("filePreview.preview")),3),m("button",{type:"button",class:Ie(["fp-seg-btn",{on:P.value==="source"}]),onClick:be[2]||(be[2]=xe=>P.value="source")},L(C(n)("filePreview.source")),3)],8,ZY)):le("",!0),p.value==="markdown"?(x(),E("div",{key:1,class:"fp-seg",role:"group","aria-label":C(n)("filePreview.markdownMode")},[m("button",{type:"button",class:Ie(["fp-seg-btn",{on:R.value==="preview"}]),onClick:be[3]||(be[3]=xe=>R.value="preview")},L(C(n)("filePreview.preview")),3),m("button",{type:"button",class:Ie(["fp-seg-btn",{on:R.value==="source"}]),onClick:be[4]||(be[4]=xe=>R.value="source")},L(C(n)("filePreview.source")),3)],8,JY)):le("",!0),p.value==="image"?(x(),E("div",{key:2,class:"fp-seg",role:"group","aria-label":C(n)("filePreview.imageFit")},[m("button",{type:"button",class:Ie(["fp-seg-btn",{on:F.value==="fit"}]),onClick:be[5]||(be[5]=xe=>F.value="fit")},L(C(n)("filePreview.fit")),3),m("button",{type:"button",class:Ie(["fp-seg-btn",{on:F.value==="actual"}]),onClick:be[6]||(be[6]=xe=>F.value="actual")},L(C(n)("filePreview.actual")),3)],8,QY)):le("",!0),p.value==="text"||p.value==="json"||p.value==="html"||p.value==="csv"?(x(),E("div",eX,[Ot(m("input",{"onUpdate:modelValue":be[7]||(be[7]=xe=>k.value=xe),class:"fp-search-input",type:"search",placeholder:C(n)("filePreview.search")},null,8,tX),[[An,k.value]]),k.value.trim()?(x(),E("span",nX,L(_.value.length),1)):le("",!0),m("button",{type:"button",class:"fp-icon-btn",disabled:_.value.length===0,title:C(n)("filePreview.prevMatch"),onClick:be[8]||(be[8]=xe=>A(-1))},"↑",8,sX),m("button",{type:"button",class:"fp-icon-btn",disabled:_.value.length===0,title:C(n)("filePreview.nextMatch"),onClick:be[9]||(be[9]=xe=>A(1))},"↓",8,oX)])):le("",!0),m("button",{type:"button",class:Ie(["fp-action fp-act-icon",{copied:D.value}]),title:D.value?C(n)("filePreview.copied"):C(n)("filePreview.copyPath"),onClick:O},[D.value?(x(),E("svg",lX,[...be[15]||(be[15]=[m("polyline",{points:"3,8 6.5,11.5 13,5"},null,-1)])])):(x(),E("svg",rX,[...be[14]||(be[14]=[m("path",{d:"M6.5 9.5a3 3 0 0 0 4.2.3l2-2a3 3 0 0 0-4.2-4.2l-1 1"},null,-1),m("path",{d:"M9.5 6.5a3 3 0 0 0-4.2-.3l-2 2a3 3 0 0 0 4.2 4.2l1-1"},null,-1)])]))],10,iX),e.externalActions?(x(),E("button",{key:4,type:"button",class:"fp-action fp-act-icon",title:C(n)("filePreview.openInEditor"),onClick:be[10]||(be[10]=xe=>u("openExternal"))},[...be[16]||(be[16]=[m("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("path",{d:"M12 8.7V12a1.5 1.5 0 0 1-1.5 1.5H4A1.5 1.5 0 0 1 2.5 12V5.5A1.5 1.5 0 0 1 4 4h3.3"}),m("path",{d:"M9.5 2.5h4v4"}),m("path",{d:"M13.5 2.5 7.5 8.5"})],-1)])],8,aX)):le("",!0),e.externalActions?(x(),E("button",{key:5,type:"button",class:"fp-action fp-act-icon",title:C(n)("filePreview.reveal"),onClick:be[11]||(be[11]=xe=>u("reveal"))},[...be[17]||(be[17]=[m("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("path",{d:"M1.5 4.5A1.5 1.5 0 0 1 3 3h3l1.5 1.5H13A1.5 1.5 0 0 1 14.5 6v6A1.5 1.5 0 0 1 13 13.5H3A1.5 1.5 0 0 1 1.5 12z"})],-1)])],8,cX)):le("",!0),e.downloadUrl?(x(),E("a",{key:6,class:"fp-action fp-act-icon",href:e.downloadUrl,target:"_blank",rel:"noreferrer",download:"",title:C(n)("filePreview.download")},[...be[18]||(be[18]=[m("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("path",{d:"M8 2v8"}),m("path",{d:"M4.5 6.5 8 10l3.5-3.5"}),m("path",{d:"M2.5 13.5h11"})],-1)])],8,uX)):le("",!0),!e.file.isBinary&&p.value!=="image"?(x(),E("button",{key:7,type:"button",class:Ie(["fp-action fp-act-icon",{copied:N.value}]),title:N.value?C(n)("filePreview.copied"):C(n)("filePreview.copy"),onClick:$},[N.value?(x(),E("svg",hX,[...be[20]||(be[20]=[m("polyline",{points:"3,8 6.5,11.5 13,5"},null,-1)])])):(x(),E("svg",fX,[...be[19]||(be[19]=[m("rect",{x:"3",y:"3",width:"9",height:"9",rx:"1.5"},null,-1),m("path",{d:"M6 1h7a1 1 0 0 1 1 1v7"},null,-1)])]))],10,dX)):le("",!0),e.closable?(x(),E("button",{key:8,type:"button",class:"fp-close",title:C(n)("filePreview.close"),"aria-label":C(n)("filePreview.close"),onClick:be[12]||(be[12]=xe=>u("close"))}," × ",8,pX)):le("",!0)]),p.value==="markdown"?(x(),E("div",{key:0,class:Ie(["fp-body",{"fp-markdown":R.value==="preview"}])},[R.value==="preview"?(x(),Ke(Lf,{key:0,text:g.value,"open-file":c.openFile?d:void 0},null,8,["text","open-file"])):(x(),E("div",mX,[m("div",gX,[(x(!0),E(Ne,null,Qe(S.value,(xe,Le)=>(x(),E("div",{key:Le,class:Ie(["fp-line-row",b(Le+1)]),"data-line":Le+1},[m("span",yX,L(Le+1),1),m("span",{class:"fp-line-text",innerHTML:ye(xe)},null,8,kX)],10,vX))),128))])]))],2)):p.value==="json"?(x(),E("div",bX,[m("div",_X,[(x(!0),E(Ne,null,Qe(S.value,(xe,Le)=>(x(),E("div",{key:Le,class:Ie(["fp-line-row",b(Le+1)]),"data-line":Le+1},[m("span",SX,L(Le+1),1),m("span",{class:"fp-line-text",innerHTML:ye(xe)},null,8,CX)],10,wX))),128))])])):p.value==="html"?(x(),E("div",xX,[P.value==="preview"?(x(),E("iframe",{key:0,class:"fp-html-frame",sandbox:"",srcdoc:Z.value,title:e.file.path},null,8,TX)):(x(),E("div",MX,[m("div",AX,[(x(!0),E(Ne,null,Qe(S.value,(xe,Le)=>(x(),E("div",{key:Le,class:Ie(["fp-line-row",b(Le+1)]),"data-line":Le+1},[m("span",IX,L(Le+1),1),m("span",{class:"fp-line-text",innerHTML:ye(xe)},null,8,$X)],10,EX))),128))])]))])):p.value==="pdf"?(x(),E("div",NX,[K.value?(x(),E("iframe",{key:0,class:"fp-pdf-frame",src:K.value,title:e.file.path},null,8,LX)):(x(),E("div",OX,[m("span",PX,L(C(n)("filePreview.pdfNoPreview")),1)]))])):p.value==="csv"?(x(),E("div",RX,[m("table",DX,[m("tbody",null,[(x(!0),E(Ne,null,Qe(X.value,(xe,Le)=>(x(),E("tr",{key:Le,class:Ie(b(Le+1)),"data-line":Le+1},[m("th",null,L(Le+1),1),(x(!0),E(Ne,null,Qe(xe,(ee,ke)=>(x(),E("td",{key:ke},L(ee),1))),128))],10,BX))),128))])])])):p.value==="image"?(x(),E("div",FX,[V.value?(x(),E("img",{key:0,src:V.value,alt:e.file.path,class:Ie(["fp-image",{actual:F.value==="actual"}])},null,10,HX)):(x(),E("div",WX,[be[21]||(be[21]=m("span",{class:"fp-binary-icon"},[m("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true"},[m("rect",{x:"2",y:"2",width:"16",height:"16",rx:"2",stroke:"currentColor","stroke-width":"1.2",fill:"none"}),m("path",{d:"M7 10h6M10 7v6",stroke:"currentColor","stroke-width":"1.2","stroke-linecap":"round"})])],-1)),m("span",UX,L(C(n)("filePreview.imageNoPreview",{mime:e.file.mime,size:M(e.file.size)})),1)]))])):p.value==="text"?(x(),E("div",qX,[m("div",jX,[(x(!0),E(Ne,null,Qe(S.value,(xe,Le)=>(x(),E("div",{key:Le,class:Ie(["fp-line-row",b(Le+1)]),"data-line":Le+1},[m("span",VX,L(Le+1),1),m("span",{class:"fp-line-text",innerHTML:ye(xe)},null,8,KX)],10,zX))),128))])])):(x(),E("div",GX,[m("div",YX,[be[22]||(be[22]=m("span",{class:"fp-binary-icon"},[m("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true"},[m("path",{d:"M5 3h7l4 4v10H5V3z",stroke:"currentColor","stroke-width":"1.2",fill:"none"}),m("path",{d:"M12 3v4h4",stroke:"currentColor","stroke-width":"1.2","stroke-linecap":"round"})])],-1)),m("span",XX,L(C(n)("filePreview.binaryNoPreview",{mime:e.file.mime||C(n)("filePreview.unknownType"),size:M(e.file.size)})),1)])]))],64)):le("",!0)],512))}}),JX=wt(ZX,[["__scopeId","data-v-93380983"]]),QX={class:"tp"},eZ={class:"tp-header"},tZ={class:"tp-title"},nZ={class:"tp-sub"},sZ=["title","aria-label"],oZ=Je({__name:"ThinkingPanel",props:{text:{},subtitle:{}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=St(),i=se(null);return Ge(()=>n.text,()=>{const r=i.value;!r||!(r.scrollHeight-r.scrollTop-r.clientHeight<24)||vt(()=>{i.value&&(i.value.scrollTop=i.value.scrollHeight)})},{immediate:!0}),(r,l)=>(x(),E("div",QX,[m("div",eZ,[m("span",tZ,L(C(o)("common.preview")),1),m("span",nZ,L(e.subtitle??C(o)("thinking.panelTitle")),1),m("button",{type:"button",class:"tp-close",title:C(o)("thinking.close"),"aria-label":C(o)("thinking.close"),onClick:l[0]||(l[0]=a=>s("close"))},[...l[1]||(l[1]=[m("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[m("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),m("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,sZ)]),m("pre",{ref_key:"bodyEl",ref:i,class:"tp-body"},L(e.text),513)]))}}),Uw=wt(oZ,[["__scopeId","data-v-2f5e8c0f"]]),iZ={class:"ap"},rZ={class:"ap-header"},lZ={class:"ap-title"},aZ={class:"ap-sub"},cZ=["title","aria-label"],uZ={key:0,class:"ap-type"},dZ={key:1,class:"ap-reason"},fZ={key:2,class:"ap-field"},hZ={class:"ap-field-body"},pZ={key:3,class:"ap-field"},mZ={class:"ap-field-body ap-progress"},gZ={key:4,class:"ap-field"},vZ={class:"ap-field-body"},yZ=Je({__name:"AgentDetailPanel",props:{member:{}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=St(),i=H(()=>(n.member.outputLines??[]).map(a=>a.trimEnd()).filter(a=>a.length>0));function r(a){switch(a){case"queued":return"Queued";case"working":return"Working";case"suspended":return"Suspended";case"completed":return"Completed";case"failed":return"Failed"}}const l=se(null);return Ge(()=>i.value.length,()=>{const a=l.value;!a||!(a.scrollHeight-a.scrollTop-a.clientHeight<24)||vt(()=>{l.value&&(l.value.scrollTop=l.value.scrollHeight)})},{immediate:!0}),(a,c)=>(x(),E("div",iZ,[m("div",rZ,[m("span",lZ,L(C(o)("common.preview")),1),m("span",aZ,L(e.member.name),1),m("span",{class:Ie(["ap-phase",`phase-${e.member.phase}`])},L(r(e.member.phase)),3),m("button",{type:"button",class:"ap-close",title:C(o)("thinking.close"),"aria-label":C(o)("thinking.close"),onClick:c[0]||(c[0]=u=>s("close"))},[...c[1]||(c[1]=[m("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[m("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),m("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,cZ)]),m("div",{ref_key:"bodyEl",ref:l,class:"ap-body"},[e.member.subagentType?(x(),E("div",uZ,L(e.member.subagentType),1)):le("",!0),e.member.suspendedReason?(x(),E("div",dZ,L(e.member.suspendedReason),1)):le("",!0),e.member.prompt?(x(),E("div",fZ,[c[2]||(c[2]=m("span",{class:"ap-field-label"},"Task",-1)),m("div",hZ,L(e.member.prompt),1)])):le("",!0),i.value.length>0?(x(),E("div",pZ,[c[3]||(c[3]=m("span",{class:"ap-field-label"},"Progress",-1)),m("div",mZ,[(x(!0),E(Ne,null,Qe(i.value,(u,d)=>(x(),E("span",{key:d},L(u),1))),128))])])):le("",!0),e.member.summary?(x(),E("div",gZ,[c[4]||(c[4]=m("span",{class:"ap-field-label"},"Result",-1)),m("div",vZ,L(e.member.summary),1)])):le("",!0)],512)]))}}),kZ=wt(yZ,[["__scopeId","data-v-2f04ded6"]]),bZ={class:"sc"},_Z={class:"sc-header"},wZ={class:"sc-title"},SZ=["title"],CZ=["title","aria-label"],xZ={key:0,class:"sc-empty"},TZ={key:2,class:"sc-loading","aria-hidden":"true"},MZ={class:"sc-composer"},AZ=["placeholder"],EZ=["disabled","title"],IZ=Je({__name:"SideChatPanel",props:{turns:{},running:{type:Boolean},sending:{type:Boolean},title:{},subtitle:{}},emits:["send","close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=St(),i=H(()=>n.turns.find(y=>y.role==="user")?.text?.trim()??""),r=H(()=>n.title?.trim()||o("sideChat.title")),l=H(()=>n.subtitle?.trim()?n.subtitle.trim():i.value||o("sideChat.subtitle")),a=se(""),c=se(null),u=se(null);function d(){const S=a.value.trim();S&&(s("send",S),a.value="",vt(()=>{c.value&&(c.value.style.height="auto"),h()}))}function h(){const S=u.value;S&&(S.scrollTop=S.scrollHeight)}const p=H(()=>{const S=n.turns;if(S.length===0)return"0";const y=S.at(-1),k=y.thinking?.length??0,v=y.tools?.reduce((_,I)=>_+I.name.length+(I.arg?.length??0)+(I.output?.join("").length??0),0)??0;return`${S.length}:${y.text.length}:${k}:${v}`});Ge(p,async()=>{!n.running&&!n.sending||(await vt(),h())});const f=H(()=>n.sending?n.turns.at(-1)?.role==="user":!1);function g(S){S.key==="Enter"&&!S.shiftKey&&!S.isComposing&&(S.preventDefault(),d())}function w(){const S=c.value;S&&(S.style.height="auto",S.style.height=`${Math.min(S.scrollHeight,160)}px`)}return(S,y)=>(x(),E("div",bZ,[m("div",_Z,[m("span",wZ,L(r.value),1),m("span",{class:"sc-subtitle",title:l.value},L(l.value),9,SZ),m("button",{type:"button",class:"sc-close",title:C(o)("thinking.close"),"aria-label":C(o)("thinking.close"),onClick:y[0]||(y[0]=k=>s("close"))},[...y[2]||(y[2]=[m("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[m("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),m("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,CZ)]),m("div",{ref_key:"bodyRef",ref:u,class:"sc-body"},[e.turns.length===0?(x(),E("div",xZ,L(C(o)("sideChat.empty")),1)):(x(),Ke(l3,{key:1,turns:e.turns,approvals:[],running:e.running,sending:e.sending,bubble:""},null,8,["turns","running","sending"])),f.value?(x(),E("div",TZ,[bt(l1)])):le("",!0)],512),m("div",MZ,[Ot(m("textarea",{ref_key:"inputRef",ref:c,"onUpdate:modelValue":y[1]||(y[1]=k=>a.value=k),class:"sc-input",rows:"1",placeholder:C(o)("sideChat.placeholder"),onInput:w,onKeydown:g},null,40,AZ),[[An,a.value]]),m("button",{type:"button",class:"sc-send",disabled:!a.value.trim(),title:C(o)("sideChat.send"),onClick:d},[...y[3]||(y[3]=[m("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("path",{d:"M2 8h10"}),m("path",{d:"M8 4l4 4-4 4"})],-1)])],8,EZ)])]))}}),$Z=wt(IZ,[["__scopeId","data-v-5d7c220f"]]),NZ={class:"changes-pane"},LZ={class:"dv-panel-head"},OZ={class:"dv-title"},PZ=["title"],RZ=["title","aria-label"],DZ={class:"diff-head"},BZ=["title"],FZ={class:"back-label"},HZ={key:0,class:"empty-state"},WZ={key:1,class:"diff-lines"},UZ={key:0,class:"hunk-text"},qZ={class:"dl-gutter old"},jZ={class:"dl-gutter new"},zZ={class:"dl-sign"},VZ={class:"dl-text"},KZ={key:2,class:"empty-state"},GZ={class:"dv-panel-head"},YZ={class:"dv-title"},XZ={class:"dv-change-count"},ZZ=["aria-label"],JZ=["aria-pressed"],QZ=["aria-pressed"],eJ=["title","aria-label"],tJ={class:"ch-head"},nJ={class:"br-label"},sJ={class:"br-name"},oJ={key:0,class:"sync-info"},iJ=["title"],rJ=["title"],lJ={key:1,class:"empty-head"},aJ={key:0,class:"ch-list"},cJ=["title","onClick"],uJ={class:"fpath"},dJ={key:1,class:"ch-list ch-tree"},fJ={class:"tree-list"},hJ=["onClick"],pJ={class:"tree-icon",viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},mJ=["d"],gJ={class:"tree-name"},vJ=["title","onClick"],yJ={class:"tree-name"},kJ={key:2,class:"empty-state"},bJ={key:3,class:"empty-state"},_J=Je({__name:"DiffView",props:{changes:{},gitInfo:{},fileDiff:{},selectedDiffPath:{},fileDiffLoading:{type:Boolean},mode:{default:"full"},hideBack:{type:Boolean,default:!1},closable:{type:Boolean,default:!0}},emits:["open","back","close"],setup(e,{emit:t}){const{t:n}=St(),s=e,o=t;function i(R){const F=R.toLowerCase();return F==="modified"?"modified":F==="added"?"added":F==="deleted"?"deleted":F==="renamed"?"renamed":F==="untracked"?"untracked":F==="conflicted"?"conflicted":F==="ignored"?"ignored":F==="clean"?"clean":"unknown"}const r={modified:"M",added:"A",deleted:"D",renamed:"R",untracked:"U",conflicted:"C",ignored:"I",clean:"·",unknown:"?"};function l(R){return r[i(R)]??"?"}function a(R,F=60){return R.length<=F?R:"…"+R.slice(R.length-F+1)}const c=H(()=>s.gitInfo!==null),u=H(()=>s.changes.length>0),d=H(()=>(s.selectedDiffPath??null)!==null),h=H(()=>s.mode==="detail"||s.mode==="full"&&d.value),p=H(()=>s.fileDiff??[]),f=H(()=>s.fileDiffLoading===!0);function g(R){return R.oldNo!==void 0?String(R.oldNo):""}function w(R){return R.newNo!==void 0?String(R.newNo):""}function S(R){return`dl-${R.type}`}function y(R){o("open",R)}function k(){o("back")}function v(){o("close")}const _=se("list");function I(R){_.value=R}function A(R){const F={children:[]},V=[...R].sort((K,Z)=>K.path.localeCompare(Z.path));for(const K of V){const Z=K.path.split("/");let G=F;for(let X=0;X<Z.length;X++){const pe=Z[X],oe=X===Z.length-1,ye=Z.slice(0,X+1).join("/");let _e=G.children.find(de=>de.name===pe&&de.kind===(oe?"file":"folder"));_e||(_e={name:pe,path:ye,kind:oe?"file":"folder",status:oe?K.status:void 0,children:[]},G.children.push(_e)),G=_e}}return F.children}const b=H(()=>A(s.changes)),M=se(new Set);function N(R){return!M.value.has(R)}const D=H(()=>{const R=[];function F(V,K){for(const Z of V)R.push({node:Z,depth:K}),Z.kind==="folder"&&N(Z.path)&&F(Z.children,K+1)}return F(b.value,0),R});function $(R){const F=new Set(M.value);F.has(R.path)?F.delete(R.path):F.add(R.path),M.value=F}const O=R=>"M1.5 3.5h3l1.5 2h7a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1h-11a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1z";function P(R){return`${16+R*16}px`}return(R,F)=>(x(),E("div",NZ,[h.value?(x(),E(Ne,{key:0},[m("div",LZ,[m("span",OZ,L(C(n)("diff.title")),1),m("span",{class:"dv-path",title:e.selectedDiffPath??""},L(a(e.selectedDiffPath??"",50)),9,PZ),e.closable?(x(),E("button",{key:0,type:"button",class:"dv-close",title:C(n)("diff.close"),"aria-label":C(n)("diff.close"),onClick:v},[...F[2]||(F[2]=[m("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[m("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),m("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,RZ)):le("",!0)]),m("div",DZ,[e.hideBack?le("",!0):(x(),E("button",{key:0,class:"back-btn",type:"button",onClick:k,title:C(n)("diff.back")},[F[3]||(F[3]=m("span",{"aria-hidden":"true"},"←",-1)),m("span",FZ,L(C(n)("diff.back")),1)],8,BZ))]),f.value?(x(),E("div",HZ,L(C(n)("diff.loading")),1)):p.value.length>0?(x(),E("div",WZ,[(x(!0),E(Ne,null,Qe(p.value,(V,K)=>(x(),E("div",{key:K,class:Ie(["dl",S(V)])},[V.type==="hunk"?(x(),E("span",UZ,L(V.text),1)):(x(),E(Ne,{key:1},[m("span",qZ,L(g(V)),1),m("span",jZ,L(w(V)),1),m("span",zZ,L(V.type==="add"?"+":V.type==="del"?"-":" "),1),m("span",VZ,L(V.text),1)],64))],2))),128))])):(x(),E("div",KZ,L(C(n)("diff.noDiff")),1))],64)):(x(),E(Ne,{key:1},[m("div",GZ,[m("span",YZ,L(C(n)("diff.title")),1),m("span",XZ,L(C(n)("diff.changeCount",{count:e.changes.length})),1),m("div",{class:"dv-toggle",role:"group","aria-label":C(n)("diff.list")+" / "+C(n)("diff.tree")},[m("button",{type:"button",class:Ie(["dv-toggle-btn",{active:_.value==="list"}]),"aria-pressed":_.value==="list",onClick:F[0]||(F[0]=V=>I("list"))},L(C(n)("diff.list")),11,JZ),m("button",{type:"button",class:Ie(["dv-toggle-btn",{active:_.value==="tree"}]),"aria-pressed":_.value==="tree",onClick:F[1]||(F[1]=V=>I("tree"))},L(C(n)("diff.tree")),11,QZ)],8,ZZ),e.closable?(x(),E("button",{key:0,type:"button",class:"dv-close",title:C(n)("diff.close"),"aria-label":C(n)("diff.close"),onClick:v},[...F[4]||(F[4]=[m("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[m("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),m("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,eJ)):le("",!0)]),m("div",tJ,[c.value?(x(),E(Ne,{key:0},[m("span",nJ,L(C(n)("diff.branch")),1),m("span",sJ,L(e.gitInfo.branch),1),e.gitInfo.ahead>0||e.gitInfo.behind>0?(x(),E("span",oJ,[e.gitInfo.ahead>0?(x(),E("span",{key:0,class:"ahead",title:C(n)("diff.aheadTitle")},"↑"+L(e.gitInfo.ahead),9,iJ)):le("",!0),e.gitInfo.behind>0?(x(),E("span",{key:1,class:"behind",title:C(n)("diff.behindTitle")},"↓"+L(e.gitInfo.behind),9,rJ)):le("",!0)])):le("",!0)],64)):(x(),E("span",lJ,L(C(n)("diff.empty")),1))]),u.value&&_.value==="list"?(x(),E("div",aJ,[(x(!0),E(Ne,null,Qe(e.changes,V=>(x(),E("button",{key:V.path,type:"button",class:"ch-row",title:V.path,onClick:K=>y(V.path)},[m("span",{class:Ie(["badge",i(V.status)])},L(l(V.status)),3),m("span",uJ,L(a(V.path)),1)],8,cJ))),128))])):u.value&&_.value==="tree"?(x(),E("div",dJ,[m("ul",fJ,[(x(!0),E(Ne,null,Qe(D.value,({node:V,depth:K})=>(x(),E("li",{key:V.path,class:"tree-node"},[V.kind==="folder"?(x(),E("button",{key:0,type:"button",class:"tree-row tree-folder",style:Ft({paddingLeft:P(K)}),onClick:Z=>$(V)},[(x(),E("svg",pJ,[m("path",{d:O(N(V.path))},null,8,mJ)])),m("span",gJ,L(V.name),1)],12,hJ)):(x(),E("button",{key:1,type:"button",class:"tree-row tree-file",style:Ft({paddingLeft:P(K)}),title:V.path,onClick:Z=>y(V.path)},[m("span",{class:Ie(["badge",i(V.status)])},L(l(V.status)),3),m("span",yJ,L(V.name),1)],12,vJ))]))),128))])])):c.value?(x(),E("div",kJ,L(C(n)("diff.clean")),1)):(x(),E("div",bJ,L(C(n)("diff.empty")),1))],64))]))}}),wJ=wt(_J,[["__scopeId","data-v-80c92679"]]);function Mh(e,t){let n=null;tn(()=>{n=typeof document<"u"&&document.activeElement instanceof HTMLElement?document.activeElement:null,vt(()=>{const s=t?.value??e.value;try{s?.focus()}catch{}})}),qs(()=>{const s=n;if(n=null,!(!s||typeof document>"u"||!document.contains(s)))try{s.focus()}catch{}})}const SJ=["aria-label"],CJ={class:"dh"},xJ={class:"dtitle"},TJ=["title"],MJ={class:"search-wrap"},AJ=["placeholder"],EJ=["aria-label"],IJ=["aria-selected","onClick"],$J={key:1,class:"loading-state"},NJ={key:2,class:"unavail-state"},LJ={key:3,class:"model-list"},OJ=["aria-selected","onClick","onMouseenter"],PJ={class:"check"},RJ={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},DJ={class:"model-main"},BJ={class:"model-name"},FJ={class:"model-id"},HJ={class:"model-provider"},WJ={class:"model-ctx"},UJ={key:0,class:"caps"},qJ=["title","onClick"],jJ={viewBox:"0 0 24 24",width:"16",height:"16","aria-hidden":"true"},zJ=["fill"],VJ={key:0,class:"empty"},KJ={class:"footer-hint"},GJ=Je({__name:"ModelPicker",props:{models:{},current:{},starredIds:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["select","toggle-star","close"],setup(e,{emit:t}){const{t:n}=St(),s=e,o=t,i=H(()=>new Set(s.starredIds??[]));function r(k){return i.value.has(k)}const l=se(""),a=se(null),c=se(null),u=se("all");Mh(c,a);const d=H(()=>{const k=new Set,v=[{id:"all",label:n("model.allTab")}];for(const _ of s.models)k.has(_.provider)||(k.add(_.provider),v.push({id:_.provider,label:_.provider}));return v}),h=H(()=>{const k=l.value.toLowerCase().trim(),v=s.models.filter(_=>{if(u.value!=="all"&&_.provider!==u.value)return!1;const I=(_.displayName??_.model).toLowerCase().includes(k),A=_.provider.toLowerCase().includes(k),b=_.id.toLowerCase().includes(k);return!k||I||A||b});return u.value!=="all"?v:v.sort((_,I)=>{const A=r(_.id)?1:0;return(r(I.id)?1:0)-A})}),p=H(()=>h.value),f=se(0);Ge([l,u],()=>{f.value=0}),Ge(d,k=>{k.some(v=>v.id===u.value)||(u.value="all")}),Ge(p,k=>{f.value=Math.min(f.value,Math.max(k.length-1,0))});function g(k){if(k.key==="Escape"){o("close");return}if(k.key==="ArrowDown")k.preventDefault(),f.value=Math.min(f.value+1,p.value.length-1);else if(k.key==="ArrowUp")k.preventDefault(),f.value=Math.max(f.value-1,0);else if(k.key==="Enter"){const v=p.value[f.value];v&&o("select",v.id)}}tn(()=>{document.addEventListener("keydown",g)}),Ht(()=>{document.removeEventListener("keydown",g)});function w(k){o("select",k)}function S(k){return p.value.indexOf(k)}function y(k){u.value=k}return(k,v)=>(x(),E("div",{class:"backdrop",onClick:v[3]||(v[3]=Ze(_=>o("close"),["self"]))},[m("div",{ref_key:"dialogRef",ref:c,class:"dialog",role:"dialog","aria-modal":"true",tabindex:"-1","aria-label":C(n)("model.dialogLabel")},[m("div",CJ,[m("span",xJ,L(C(n)("model.title")),1),m("button",{class:"close-btn",title:C(n)("model.close"),onClick:v[0]||(v[0]=_=>o("close"))},"✕",8,TJ)]),m("div",MJ,[Ot(m("input",{ref_key:"searchRef",ref:a,"onUpdate:modelValue":v[1]||(v[1]=_=>l.value=_),class:"search-input",type:"text",placeholder:C(n)("model.searchPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,AJ),[[An,l.value]])]),d.value.length>1?(x(),E("div",{key:0,class:"tab-strip",role:"tablist","aria-label":C(n)("model.providerTabs")},[(x(!0),E(Ne,null,Qe(d.value,_=>(x(),E("button",{key:_.id,type:"button",class:Ie(["tab-btn",{on:_.id===u.value}]),role:"tab","aria-selected":_.id===u.value,onClick:I=>y(_.id)},L(_.label),11,IJ))),128))],8,EJ)):le("",!0),e.loading?(x(),E("div",$J,[v[4]||(v[4]=m("svg",{class:"spin-icon",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"var(--blue)","stroke-width":"1.5"},[m("circle",{cx:"8",cy:"8",r:"6","stroke-dasharray":"24 12","stroke-linecap":"round"},[m("animateTransform",{attributeName:"transform",type:"rotate",from:"0 8 8",to:"360 8 8",dur:"1s",repeatCount:"indefinite"})])],-1)),m("span",null,L(C(n)("model.loading")),1)])):e.unavailable?(x(),E("div",NJ,[v[5]||(v[5]=m("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",stroke:"var(--warn)","stroke-width":"1.5"},[m("path",{d:"M10 2 L19 18 H1 Z"}),m("line",{x1:"10",y1:"9",x2:"10",y2:"13"}),m("circle",{cx:"10",cy:"16",r:"0.8",fill:"var(--warn)"})],-1)),m("span",null,L(C(n)("model.unavailable")),1)])):(x(),E("div",LJ,[(x(!0),E(Ne,null,Qe(p.value,_=>(x(),E("div",{key:_.id,class:Ie(["model-row",{"is-current":_.id===e.current,"is-selected":S(_)===f.value}]),role:"option","aria-selected":_.id===e.current,onClick:I=>w(_.id),onMouseenter:I=>f.value=S(_)},[m("span",PJ,[_.id===e.current?(x(),E("svg",RJ,[...v[6]||(v[6]=[m("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):le("",!0)]),m("span",DJ,[m("span",BJ,L(_.displayName??_.model),1),m("span",FJ,L(_.id),1)]),m("span",HJ,L(_.provider),1),m("span",WJ,L(C(n)("model.contextSuffix",{size:Math.round(_.maxContextSize/1e3)})),1),_.capabilities&&_.capabilities.length>0?(x(),E("span",UJ,L(_.capabilities.join(", ")),1)):le("",!0),m("button",{type:"button",class:Ie(["star-btn",{starred:r(_.id)}]),title:r(_.id)?C(n)("model.unstarTitle"):C(n)("model.starTitle"),onClick:Ze(I=>o("toggle-star",_.id),["stop"]),onMouseenter:v[2]||(v[2]=Ze(()=>{},["stop"]))},[(x(),E("svg",jJ,[m("path",{fill:r(_.id)?"currentColor":"none",stroke:"currentColor","stroke-width":"1.6","stroke-linejoin":"round",d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"},null,8,zJ)]))],42,qJ)],42,OJ))),128)),p.value.length===0&&!e.loading&&!e.unavailable?(x(),E("div",VJ,L(s.models.length===0?C(n)("model.emptyNoModels"):C(n)("model.emptyNoMatch")),1)):le("",!0)])),m("div",KJ,L(C(n)("model.footerHint")),1)],8,SJ)]))}}),YJ=wt(GJ,[["__scopeId","data-v-34f036d8"]]),XJ=["aria-label"],ZJ={class:"dh"},JJ={class:"dtitle"},QJ=["title"],eQ={class:"prov-list"},tQ={key:0,class:"state-row"},nQ={key:1,class:"state-row unavail"},sQ={key:2,class:"empty"},oQ=["title"],iQ={key:0,width:"8",height:"8",viewBox:"0 0 8 8"},rQ=["fill"],lQ={key:1,width:"8",height:"8",viewBox:"0 0 8 8"},aQ=["fill"],cQ={key:2,width:"8",height:"8",viewBox:"0 0 8 8"},uQ={class:"prov-info"},dQ={class:"prov-type"},fQ={key:0,class:"prov-url"},hQ={class:"prov-meta"},pQ={key:0},mQ={key:0,class:"confirm-row"},gQ={class:"confirm-text"},vQ={key:1,class:"prov-actions"},yQ=["title","onClick"],kQ=["title","onClick"],bQ={key:0,class:"add-section"},_Q={key:0,class:"add-btns"},wQ={key:1,class:"add-form"},SQ={class:"form-row"},CQ={class:"flabel"},xQ=["value"],TQ={class:"form-row"},MQ={class:"flabel"},AQ={class:"form-row"},EQ={class:"flabel"},IQ=["placeholder"],$Q={class:"form-row"},NQ={class:"flabel"},LQ=["placeholder"],OQ={key:0,class:"add-error"},PQ={class:"form-btns"},RQ={class:"footer-hint"},DQ=Je({__name:"ProviderManager",props:{providers:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["add","refresh","delete","openLogin","close"],setup(e,{emit:t}){const{t:n}=St(),s=se(null);Mh(s);const o=t,i=se(null);function r(k){i.value=k}function l(){i.value&&(o("delete",i.value),i.value=null)}function a(){i.value=null}const c=se(!1),u=Js({type:"moonshot",apiKey:"",baseUrl:"",defaultModel:""}),d=se(""),h=["moonshot","anthropic","openai","custom"];function p(){u.type="moonshot",u.apiKey="",u.baseUrl="",u.defaultModel="",d.value="",c.value=!0}function f(){c.value=!1}function g(){if(!u.apiKey.trim()){d.value=n("providers.apiKeyRequired");return}d.value="",o("add",{type:u.type,apiKey:u.apiKey.trim()||void 0,baseUrl:u.baseUrl.trim()||void 0,defaultModel:u.defaultModel.trim()||void 0}),c.value=!1}function w(k){if(k.key==="Escape"){if(c.value){f();return}if(i.value){a();return}o("close")}}tn(()=>document.addEventListener("keydown",w)),Ht(()=>document.removeEventListener("keydown",w));function S(k){return k==="connected"?"var(--ok)":k==="error"?"var(--err)":"var(--faint)"}function y(k){return n(k==="connected"?"providers.status.connected":k==="error"?"providers.status.error":"providers.status.unconfigured")}return(k,v)=>(x(),E("div",{class:"backdrop",onClick:v[7]||(v[7]=Ze(_=>o("close"),["self"]))},[m("div",{ref_key:"dialogRef",ref:s,class:"dialog",role:"dialog","aria-modal":"true",tabindex:"-1","aria-label":C(n)("providers.dialogLabel")},[m("div",ZJ,[m("span",JJ,L(C(n)("providers.title")),1),m("button",{class:"close-btn",title:C(n)("providers.close"),onClick:v[0]||(v[0]=_=>o("close"))},"✕",8,QJ)]),m("div",eQ,[e.loading?(x(),E("div",tQ,[v[8]||(v[8]=m("svg",{class:"spin-icon",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"var(--blue)","stroke-width":"1.5"},[m("circle",{cx:"7",cy:"7",r:"5","stroke-dasharray":"20 12","stroke-linecap":"round"},[m("animateTransform",{attributeName:"transform",type:"rotate",from:"0 7 7",to:"360 7 7",dur:"1s",repeatCount:"indefinite"})])],-1)),m("span",null,L(C(n)("providers.loading")),1)])):e.unavailable?(x(),E("div",nQ,[v[9]||(v[9]=m("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"var(--warn)","stroke-width":"1.5"},[m("path",{d:"M8 1.5 L15.5 14.5 H0.5 Z"}),m("line",{x1:"8",y1:"7",x2:"8",y2:"10.5"}),m("circle",{cx:"8",cy:"12.5",r:"0.7",fill:"var(--warn)"})],-1)),m("span",null,L(C(n)("providers.unavailable")),1)])):e.providers.length===0?(x(),E("div",sQ,L(C(n)("providers.empty")),1)):(x(!0),E(Ne,{key:3},Qe(e.providers,_=>(x(),E("div",{key:_.id,class:"prov-row"},[m("span",{class:"status-dot",style:Ft({color:S(_.status)}),title:y(_.status)},[_.status==="connected"?(x(),E("svg",iQ,[m("circle",{cx:"4",cy:"4",r:"3.5",fill:S(_.status)},null,8,rQ)])):_.status==="error"?(x(),E("svg",lQ,[m("circle",{cx:"4",cy:"4",r:"3.5",fill:S(_.status)},null,8,aQ)])):(x(),E("svg",cQ,[...v[10]||(v[10]=[m("circle",{cx:"4",cy:"4",r:"3",fill:"none",stroke:"var(--faint)","stroke-width":"1"},null,-1)])]))],12,oQ),m("div",uQ,[m("span",dQ,L(_.type),1),_.baseUrl?(x(),E("span",fQ,L(_.baseUrl),1)):le("",!0),m("span",hQ,[m("span",{class:Ie(["prov-key-state",_.hasApiKey?"has-key":"no-key"])},L(_.hasApiKey?C(n)("providers.keySet"):C(n)("providers.keyNotSet")),3),_.models&&_.models.length>0?(x(),E("span",pQ," · "+L(C(n)("providers.modelCount",{count:_.models.length})),1)):le("",!0)])]),i.value===_.id?(x(),E("div",mQ,[m("span",gQ,L(C(n)("providers.confirmDelete")),1),m("button",{class:"act-btn danger",onClick:l},L(C(n)("providers.confirm")),1),m("button",{class:"act-btn",onClick:a},L(C(n)("providers.cancel")),1)])):(x(),E("div",vQ,[m("button",{class:"act-btn",title:C(n)("providers.refreshTitle",{type:_.type}),onClick:I=>o("refresh",_.id)},L(C(n)("providers.refresh")),9,yQ),m("button",{class:"act-btn danger",title:C(n)("providers.deleteTitle",{type:_.type}),onClick:I=>r(_.id)},L(C(n)("providers.delete")),9,kQ)]))]))),128))]),e.unavailable?le("",!0):(x(),E("div",bQ,[c.value?(x(),E("div",wQ,[m("div",SQ,[m("label",CQ,L(C(n)("providers.fieldType")),1),Ot(m("select",{"onUpdate:modelValue":v[3]||(v[3]=_=>u.type=_),class:"finput fselect"},[(x(),E(Ne,null,Qe(h,_=>m("option",{key:_,value:_},L(_),9,xQ)),64))],512),[[nf,u.type]])]),m("div",TQ,[m("label",MQ,L(C(n)("providers.fieldApiKey")),1),Ot(m("input",{"onUpdate:modelValue":v[4]||(v[4]=_=>u.apiKey=_),class:"finput",type:"password",placeholder:"sk-…",autocomplete:"off",spellcheck:"false"},null,512),[[An,u.apiKey]])]),m("div",AQ,[m("label",EQ,L(C(n)("providers.fieldBaseUrl")),1),Ot(m("input",{"onUpdate:modelValue":v[5]||(v[5]=_=>u.baseUrl=_),class:"finput",type:"text",placeholder:C(n)("providers.baseUrlPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,IQ),[[An,u.baseUrl]])]),m("div",$Q,[m("label",NQ,L(C(n)("providers.fieldDefaultModel")),1),Ot(m("input",{"onUpdate:modelValue":v[6]||(v[6]=_=>u.defaultModel=_),class:"finput",type:"text",placeholder:C(n)("providers.optional"),autocomplete:"off",spellcheck:"false"},null,8,LQ),[[An,u.defaultModel]])]),d.value?(x(),E("div",OQ,L(d.value),1)):le("",!0),m("div",PQ,[m("button",{class:"act-btn primary",onClick:g},L(C(n)("providers.add")),1),m("button",{class:"act-btn",onClick:f},L(C(n)("providers.cancel")),1)])])):(x(),E("div",_Q,[m("button",{class:"add-btn-oauth",onClick:v[1]||(v[1]=_=>o("openLogin","moonshot"))},[v[11]||(v[11]=m("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[m("circle",{cx:"5",cy:"3",r:"2"}),m("path",{d:"M1 9c0-2.2 1.8-4 4-4s4 1.8 4 4"})],-1)),yt(" "+L(C(n)("providers.loginKimi")),1)]),m("button",{class:"add-btn-oauth",onClick:v[2]||(v[2]=_=>o("openLogin","anthropic"))},[v[12]||(v[12]=m("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[m("circle",{cx:"5",cy:"3",r:"2"}),m("path",{d:"M1 9c0-2.2 1.8-4 4-4s4 1.8 4 4"})],-1)),yt(" "+L(C(n)("providers.loginAnthropic")),1)]),m("button",{class:"add-btn add-btn-key",onClick:p},[v[13]||(v[13]=m("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[m("line",{x1:"5",y1:"1",x2:"5",y2:"9"}),m("line",{x1:"1",y1:"5",x2:"9",y2:"5"})],-1)),yt(" "+L(C(n)("providers.enterApiKey")),1)])]))])),m("div",RQ,L(C(n)("providers.escClose")),1)],8,XJ)]))}}),BQ=wt(DQ,[["__scopeId","data-v-28ec3774"]]),FQ={class:"backdrop"},HQ=["aria-label"],WQ={class:"dh"},UQ={class:"dtitle"},qQ=["title"],jQ={key:0,class:"center-body"},zQ={class:"center-text"},VQ={key:1,class:"nb"},KQ={class:"nb-lead"},GQ=["href"],YQ={class:"nb-or"},XQ={class:"nb-fallback"},ZQ={class:"nb-fb-text"},JQ=["href"],QQ={class:"nb-code-row"},eee={class:"nb-code"},tee={class:"nb-status"},nee=["aria-label"],see={class:"nb-status-text"},oee={class:"nb-countdown"},iee={key:2,class:"center-body"},ree={class:"center-text success-text"},lee={class:"center-hint"},aee={class:"center-body"},cee={class:"center-text err-text"},uee={class:"center-hint"},dee={class:"actions"},fee={class:"center-body"},hee={class:"center-text warn-text"},pee={class:"center-hint"},mee={class:"actions"},gee=Je({__name:"LoginDialog",props:{onStartOAuthLogin:{type:Function},onPollOAuthLogin:{type:Function},onCancelOAuthLogin:{type:Function}},emits:["success","close"],setup(e,{emit:t}){const{t:n}=St(),s=se(null);Mh(s);const o=t,i=e,r=se("starting"),l=se(null),a=se(0),c=se(!1);let u=null,d=null;tn(async()=>{document.addEventListener("keydown",k),await h()}),Ht(()=>{document.removeEventListener("keydown",k),g()});async function h(){g(),l.value=null,r.value="starting";const _=await i.onStartOAuthLogin();if(!_){r.value="error";return}l.value={flowId:_.flowId,verificationUri:_.verificationUri,verificationUriComplete:_.verificationUriComplete,userCode:_.userCode,expiresIn:_.expiresIn,interval:_.interval},a.value=_.expiresIn,r.value="device-code",p(),f(_.interval)}function p(){d&&clearInterval(d),d=setInterval(()=>{a.value>0?a.value--:(d&&clearInterval(d),d=null)},1e3)}function f(_){u&&clearTimeout(u),u=setTimeout(async()=>{const I=await i.onPollOAuthLogin();I?.status==="authenticated"?(g(),r.value="success",setTimeout(()=>{o("success"),o("close")},1200)):I?.status==="expired"||I?.status==="cancelled"?(g(),r.value="expired"):f(_)},_*1e3)}function g(){u&&(clearTimeout(u),u=null),d&&(clearInterval(d),d=null)}async function w(){await h()}async function S(){!l.value||!await xs(l.value.userCode)||(c.value=!0,setTimeout(()=>{c.value=!1},2e3))}async function y(){g(),r.value==="device-code"&&i.onCancelOAuthLogin(),o("close")}function k(_){_.key==="Escape"&&y()}function v(_){const I=Math.floor(_/60),A=_%60;return`${I}:${String(A).padStart(2,"0")}`}return(_,I)=>(x(),E("div",FQ,[m("div",{ref_key:"dialogRef",ref:s,class:"dialog",role:"dialog","aria-modal":"true",tabindex:"-1","aria-label":C(n)("login.title")},[m("div",WQ,[m("span",UQ,L(C(n)("login.title")),1),m("button",{class:"close-btn",title:C(n)("login.close"),onClick:y},[...I[0]||(I[0]=[m("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[m("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),m("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,qQ)]),r.value==="starting"?(x(),E("div",jQ,[I[1]||(I[1]=m("svg",{class:"spin-icon",width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",stroke:"var(--blue)","stroke-width":"1.5"},[m("circle",{cx:"11",cy:"11",r:"8","stroke-dasharray":"30 18","stroke-linecap":"round"},[m("animateTransform",{attributeName:"transform",type:"rotate",from:"0 11 11",to:"360 11 11",dur:"0.9s",repeatCount:"indefinite"})])],-1)),m("span",zQ,L(C(n)("login.starting")),1)])):r.value==="device-code"&&l.value?(x(),E("div",VQ,[m("div",KQ,L(C(n)("login.lead")),1),m("a",{class:"nb-primary",href:l.value.verificationUriComplete,target:"_blank",rel:"noopener noreferrer"},[yt(L(C(n)("login.authorizeInBrowser"))+" ",1),I[2]||(I[2]=m("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor","stroke-width":"1.6"},[m("path",{d:"M6 2H2.5a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V8"}),m("path",{d:"M9.5 1.5h3v3M12.5 1.5 7 7"})],-1))],8,GQ),m("div",YQ,L(C(n)("login.orDivider")),1),m("div",XQ,[m("div",ZQ,[yt(L(C(n)("login.fallbackPrefix")),1),m("a",{class:"nb-fb-link",href:l.value.verificationUri,target:"_blank",rel:"noopener noreferrer"},L(l.value.verificationUri),9,JQ),yt(L(C(n)("login.fallbackSuffix")),1)]),m("div",QQ,[m("span",eee,L(l.value.userCode),1),m("button",{class:Ie(["nb-copy",{"is-copied":c.value}]),onClick:S},[c.value?(x(),E(Ne,{key:0},[I[3]||(I[3]=m("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor","stroke-width":"2"},[m("polyline",{points:"1,6 4,9 11,2"})],-1)),yt(" "+L(C(n)("login.copied")),1)],64)):(x(),E(Ne,{key:1},[I[4]||(I[4]=m("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[m("rect",{x:"4",y:"4",width:"7",height:"7",rx:"1"}),m("path",{d:"M8 4V2a1 1 0 0 0-1-1H2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h2"})],-1)),yt(" "+L(C(n)("login.copy")),1)],64))],2)])]),m("div",tee,[m("span",{class:"nb-spinner","aria-label":C(n)("login.waitingAuth")},[...I[5]||(I[5]=[m("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"var(--blue)","stroke-width":"1.5"},[m("circle",{cx:"7",cy:"7",r:"5","stroke-dasharray":"20 12","stroke-linecap":"round"},[m("animateTransform",{attributeName:"transform",type:"rotate",from:"0 7 7",to:"360 7 7",dur:"1s",repeatCount:"indefinite"})])],-1)])],8,nee),m("span",see,L(C(n)("login.waitingAutoClose")),1),m("span",oee,L(v(a.value)),1)])])):r.value==="success"?(x(),E("div",iee,[I[6]||(I[6]=m("svg",{width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",stroke:"var(--ok)","stroke-width":"2"},[m("circle",{cx:"18",cy:"18",r:"15"}),m("polyline",{points:"10,18 15,24 26,12"})],-1)),m("span",ree,L(C(n)("login.success")),1),m("span",lee,L(C(n)("login.successHint")),1)])):r.value==="expired"?(x(),E(Ne,{key:3},[m("div",aee,[I[7]||(I[7]=m("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--err)","stroke-width":"1.5"},[m("circle",{cx:"14",cy:"14",r:"12"}),m("line",{x1:"14",y1:"8",x2:"14",y2:"15"}),m("circle",{cx:"14",cy:"19",r:"1.2",fill:"var(--err)"})],-1)),m("span",cee,L(C(n)("login.expiredTitle")),1),m("span",uee,L(C(n)("login.expiredHint")),1)]),m("div",dee,[m("button",{class:"act-btn primary",onClick:w},L(C(n)("login.retry")),1),m("button",{class:"act-btn",onClick:y},L(C(n)("login.closeBtn")),1)])],64)):r.value==="error"?(x(),E(Ne,{key:4},[m("div",fee,[I[8]||(I[8]=m("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--warn)","stroke-width":"1.5"},[m("path",{d:"M14 3 L26 24 H2 Z"}),m("line",{x1:"14",y1:"12",x2:"14",y2:"18"}),m("circle",{cx:"14",cy:"21.5",r:"1",fill:"var(--warn)"})],-1)),m("span",hee,L(C(n)("login.errorTitle")),1),m("span",pee,L(C(n)("login.errorHint")),1)]),m("div",mee,[m("button",{class:"act-btn primary",onClick:w},L(C(n)("login.retry")),1),m("button",{class:"act-btn",onClick:y},L(C(n)("login.closeBtn")),1)])],64)):le("",!0)],8,HQ)]))}}),vee=wt(gee,[["__scopeId","data-v-98c6ec96"]]),yee=["aria-label"],kee={class:"dh"},bee={class:"dtitle"},_ee=["title"],wee={class:"form-body"},See={class:"form-row"},Cee={class:"flabel",for:"ns-cwd"},xee=["placeholder"],Tee={key:0,class:"recent-section"},Mee={class:"recent-label"},Aee={class:"recent-list"},Eee=["title","onClick"],Iee={class:"recent-path"},$ee={class:"form-row"},Nee={class:"flabel",for:"ns-title"},Lee=["placeholder"],Oee={class:"actions"},Pee=["disabled"],Ree={class:"footer-hint"},Dee=Je({__name:"NewSessionDialog",props:{recentCwds:{}},emits:["create","close"],setup(e,{emit:t}){const{t:n}=St(),s=e,o=t,i=se(""),r=se("");Ge(()=>s.recentCwds,h=>{i.value===""&&h.length>0&&(i.value=h[0])},{immediate:!0});const l=H(()=>i.value.trim()),a=H(()=>l.value.length>0);function c(){if(!a.value)return;const h={cwd:l.value},p=r.value.trim();p&&(h.title=p),o("create",h)}function u(h){i.value=h}function d(h){h.key==="Escape"?o("close"):h.key==="Enter"&&!(h.target instanceof HTMLButtonElement)&&c()}return tn(()=>document.addEventListener("keydown",d)),Ht(()=>document.removeEventListener("keydown",d)),(h,p)=>(x(),E("div",{class:"backdrop",onClick:p[4]||(p[4]=Ze(f=>o("close"),["self"]))},[m("div",{class:"dialog",role:"dialog","aria-label":C(n)("newSession.title")},[m("div",kee,[m("span",bee,L(C(n)("newSession.title")),1),m("button",{class:"close-btn",title:C(n)("newSession.close"),onClick:p[0]||(p[0]=f=>o("close"))},[...p[5]||(p[5]=[m("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[m("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),m("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,_ee)]),m("div",wee,[m("div",See,[m("label",Cee,L(C(n)("newSession.cwdLabel")),1),Ot(m("input",{id:"ns-cwd","onUpdate:modelValue":p[1]||(p[1]=f=>i.value=f),class:"finput",type:"text",placeholder:C(n)("newSession.cwdPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,xee),[[An,i.value]])]),e.recentCwds.length>0?(x(),E("div",Tee,[m("div",Mee,L(C(n)("newSession.recentLabel")),1),m("div",Aee,[(x(!0),E(Ne,null,Qe(e.recentCwds,f=>(x(),E("button",{key:f,class:Ie(["recent-item",{"is-active":i.value===f}]),title:f,onClick:g=>u(f)},[p[6]||(p[6]=m("svg",{class:"dir-icon",width:"11",height:"11",viewBox:"0 0 11 11",fill:"none",stroke:"currentColor","stroke-width":"1.2"},[m("rect",{x:"1",y:"3",width:"9",height:"6.5",rx:"1"}),m("path",{d:"M1 4.5V3a1 1 0 0 1 1-1h2.5l1 1.5"})],-1)),m("span",Iee,L(f),1)],10,Eee))),128))])])):le("",!0),m("div",$ee,[m("label",Nee,L(C(n)("newSession.titleFieldLabel")),1),Ot(m("input",{id:"ns-title","onUpdate:modelValue":p[2]||(p[2]=f=>r.value=f),class:"finput",type:"text",placeholder:C(n)("newSession.titleFieldPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,Lee),[[An,r.value]])])]),m("div",Oee,[m("button",{class:"act-btn primary",disabled:!a.value,onClick:c},L(C(n)("newSession.create")),9,Pee),m("button",{class:"act-btn",onClick:p[3]||(p[3]=f=>o("close"))},L(C(n)("newSession.cancel")),1)]),m("div",Ree,L(C(n)("newSession.footerHint")),1)],8,yee)]))}}),Bee=wt(Dee,[["__scopeId","data-v-80a69ecb"]]),Fee={class:"lang-switch",role:"group","aria-label":"Language"},Hee=["aria-pressed","onClick"],Wee=Je({__name:"LanguageSwitcher",setup(e){const{locale:t}=St();function n(s){t.value!==s&&MC(s)}return(s,o)=>(x(),E("div",Fee,[(x(!0),E(Ne,null,Qe(C(TC),i=>(x(),E("button",{key:i.code,type:"button",class:Ie(["lang-opt",{on:C(t)===i.code}]),"aria-pressed":C(t)===i.code,onClick:Ze(r=>n(i.code),["stop"])},L(i.label),11,Hee))),128))]))}}),f3=wt(Wee,[["__scopeId","data-v-907613b6"]]),qw=1e3,Dm=16384,Bm=500,Fm=50,Uee=6,qee=/api[_-]?key|authorization|token|secret|password|cookie|credential/i,jee=/^[A-Za-z0-9+/=_-]{200,}$/;let Hm=null;function ai(){if(Hm!==null)return Hm;let e=!1;try{if(typeof location<"u"){const t=new URLSearchParams(location.search).get("debug");(t==="1"||t==="true")&&(e=!0)}}catch{}return e||(e=_n(Et.debug)==="1"),Hm=e,e}const dr=[];let zee=1;const Bv=se(0),cc=ul(!1);function Vee(){return dr}function Kee(){dr.length=0,Bv.value++}function fl(e){cc.value||(dr.push({id:zee++,ts:Date.now(),...e}),dr.length>qw&&dr.splice(0,dr.length-qw),Bv.value++)}function c1(e,t=0){if(e==null)return e;const n=typeof e;if(n==="number"||n==="boolean")return e;if(n==="string"){const o=e;return jee.test(o)?`[base64-like, ${o.length} chars omitted]`:o.length>Bm?`${o.slice(0,Bm)}… [+${o.length-Bm} chars]`:o}if(n!=="object")return String(e);if(t>=Uee)return"[max depth]";if(Array.isArray(e)){const o=e.slice(0,Fm).map(i=>c1(i,t+1));return e.length>Fm&&o.push(`[+${e.length-Fm} more items]`),o}const s={};for(const[o,i]of Object.entries(e))s[o]=qee.test(o)?"[redacted]":c1(i,t+1);return s}function Ca(e){if(e===void 0)return;const t=c1(e);try{const n=JSON.stringify(t);if(n!==void 0&&n.length>Dm)return{_truncated:`detail JSON was ${n.length} chars; first ${Dm} kept`,preview:n.slice(0,Dm)}}catch{return"[unserializable detail]"}return t}function jw(e){ai()&&fl({source:"rest",kind:"rest:request",label:`→ ${e.method} ${e.path}`,method:e.method,path:e.path,requestId:e.requestId,detail:{url:e.url,body:Ca(e.body)}})}function zw(e){if(!ai())return;const t=e.code!==0;fl({source:"rest",kind:t?"rest:error":"rest:response",label:`← ${e.method} ${e.path} ${e.status} code=${e.code}${t?` "${e.msg}"`:""} ${Math.round(e.durationMs)}ms`,method:e.method,path:e.path,requestId:e.requestId,status:e.status,code:e.code,durationMs:e.durationMs,detail:{envelope:{code:e.code,msg:e.msg,request_id:e.envelopeRequestId},data:Ca(e.data)}})}function pd(e){ai()&&fl({source:"rest",kind:"rest:error",label:`✕ ${e.method} ${e.path} ${e.phase} error${e.status!==void 0?` (HTTP ${e.status})`:""} ${Math.round(e.durationMs)}ms`,method:e.method,path:e.path,requestId:e.requestId,status:e.status,durationMs:e.durationMs,detail:{phase:e.phase,error:String(e.error)}})}function Rl(e,t){ai()&&fl({source:"ws",kind:"ws:lifecycle",eventType:e,label:`ws ${e}`,detail:Ca(t)})}function Gee(e){if(!ai())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",s=t.payload,o=typeof s?.session_id=="string"?s.session_id:void 0;fl({source:"ws",kind:"ws:out",eventType:n,sessionId:o,label:`→ ${n}`,detail:Ca(e)})}function Yee(e){if(!ai())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",s=typeof t.session_id=="string"?t.session_id:typeof t.payload?.session_id=="string"?t.payload.session_id:void 0,o=typeof t.seq=="number"?t.seq:void 0,i=typeof t.offset=="number"?t.offset:void 0,r=[s,o!==void 0?`seq=${o}`:void 0,i!==void 0?`offset=${i}`:void 0,t.volatile===!0?"volatile":void 0].filter(Boolean);fl({source:"ws",kind:"ws:in",eventType:n,sessionId:s,seq:o,offset:i,label:`← ${n}${r.length>0?` (${r.join(" ")})`:""}`,detail:Ca(t.payload)})}const Xee={error:"✕",warn:"⚠",info:"ℹ",debug:"·",log:"·"};function Wm(e,t,n){ai()&&fl({source:"client",kind:`client:${e}`,label:`${Xee[e]} ${t}`,detail:Ca(n)})}let Vw=!1;function Zee(){if(!(Vw||!ai())){Vw=!0;try{typeof window<"u"&&(window.addEventListener("error",e=>{Wm("error",e.message||"window error",{source:e.filename,line:e.lineno,col:e.colno,stack:e.error instanceof Error?e.error.stack:void 0})}),window.addEventListener("unhandledrejection",e=>{const t=e.reason;Wm("error","unhandled promise rejection",{reason:t instanceof Error?`${t.name}: ${t.message}`:t,stack:t instanceof Error?t.stack:void 0})}))}catch{}for(const e of["error","warn","log","info","debug"]){const t=console[e];typeof t=="function"&&(console[e]=(...n)=>{try{Wm(e,n.map(Jee).join(" "),n.length>1?n:n[0])}catch{}t.apply(console,n)})}}}function Jee(e){if(typeof e=="string")return e;if(e instanceof Error)return`${e.name}: ${e.message}`;try{return JSON.stringify(e)}catch{return String(e)}}function h3(e=dr){if(typeof document>"u")return;const t=new Blob([Qee(e)],{type:"application/x-ndjson"}),n=URL.createObjectURL(t),s=document.createElement("a");s.href=n,s.download=`kimi-web-log-${new Date().toISOString().replace(/[:.]/g,"-")}.jsonl`,document.body.appendChild(s),s.click(),s.remove(),URL.revokeObjectURL(n)}function Qee(e=dr){return e.map(t=>JSON.stringify(t)).join(`
|
|
252
|
-
`)}const ete=["aria-label"],tte={class:"dh"},nte={class:"dtitle"},ste=["title"],ote={class:"settings-layout"},ite=["aria-label"],rte=["aria-selected","aria-controls","id","onClick"],lte={class:"body"},ate={id:"settings-panel-general",class:"panel",role:"tabpanel","aria-labelledby":"settings-tab-general"},cte={class:"sec"},ute={class:"sec-title"},dte={class:"row"},fte={class:"rlabel"},hte=["aria-label"],pte=["aria-pressed"],mte=["aria-pressed"],gte={class:"row"},vte={class:"rlabel"},yte=["aria-label"],kte=["aria-pressed"],bte=["aria-pressed"],_te=["aria-pressed"],wte={class:"row"},Ste={class:"rlabel"},Cte={class:"num-field"},xte=["value","aria-label"],Tte={class:"row"},Mte={class:"rlabel"},Ate={class:"sec"},Ete={class:"sec-title"},Ite={class:"row"},$te={class:"rlabel"},Nte={key:0,class:"hint"},Lte=["aria-checked","disabled"],Ote={class:"sec"},Pte={class:"sec-title"},Rte={class:"row"},Dte={class:"rlabel"},Bte=["title"],Fte={class:"actions"},Hte={class:"sec"},Wte={class:"sec-title"},Ute={class:"row"},qte={class:"rlabel"},jte={class:"rvalue mono"},zte={id:"settings-panel-agent",class:"panel",role:"tabpanel","aria-labelledby":"settings-tab-agent"},Vte={class:"sec"},Kte={class:"sec-head"},Gte={class:"sec-title"},Yte={key:0,class:"saving"},Xte={class:"row"},Zte={class:"rlabel"},Jte={class:"hint"},Qte=["value","disabled","aria-label"],ene={key:0,value:"",disabled:""},tne=["label"],nne=["value"],sne={key:1,class:"rvalue mono"},one={class:"row"},ine={class:"rlabel"},rne={class:"hint"},lne=["aria-label"],ane=["aria-pressed","disabled","onClick"],cne={class:"row"},une={class:"rlabel"},dne={class:"hint"},fne=["aria-checked","disabled"],hne={class:"row"},pne={class:"rlabel"},mne={class:"hint"},gne=["aria-checked","disabled"],vne={class:"row"},yne={class:"rlabel"},kne={class:"hint"},bne=["aria-checked","disabled"],_ne={key:0,class:"row"},wne={class:"rlabel"},Sne=["aria-checked","disabled"],Cne={key:1,class:"provider-list"},xne={class:"provider-main"},Tne={class:"provider-id"},Mne={class:"provider-type"},Ane={class:"provider-meta"},Ene={key:0,class:"provider-model"},Ine={key:1,class:"empty-config"},$ne={id:"settings-panel-advanced",class:"panel",role:"tabpanel","aria-labelledby":"settings-tab-advanced"},Nne={class:"sec"},Lne={class:"sec-title"},One={class:"row"},Pne={class:"rlabel"},Rne={class:"rvalue mono"},Dne={class:"row"},Bne={class:"rlabel"},Fne={key:0,class:"hint"},Hne={id:"settings-panel-experimental",class:"panel",role:"tabpanel","aria-labelledby":"settings-tab-experimental"},Wne={class:"sec"},Une={class:"sec-title"},qne={class:"row"},jne={class:"rlabel"},zne={class:"hint"},Vne=["aria-checked"],Kne=Je({__name:"SettingsDialog",props:{theme:{},colorScheme:{},uiFontSize:{},authReady:{type:Boolean},accountModel:{},notify:{type:Boolean},notifyPermission:{},betaToc:{type:Boolean},config:{},models:{},configSaving:{type:Boolean},serverVersion:{}},emits:["setTheme","setColorScheme","setUiFontSize","setNotify","setBetaToc","login","logout","openOnboarding","updateConfig","close"],setup(e,{emit:t}){const{t:n}=St(),s=e,o=t,i=se("general"),r=[{id:"general",labelKey:"settings.tabs.general"},{id:"agent",labelKey:"settings.tabs.agent"},{id:"advanced",labelKey:"settings.tabs.advanced"},{id:"experimental",labelKey:"settings.tabs.experimental"}],l=l$(),a=["manual","auto","yolo"],c=se(null);Mh(c);function u(A){A.key==="Escape"&&o("close")}tn(()=>document.addEventListener("keydown",u)),Ht(()=>document.removeEventListener("keydown",u));function d(){h3()}const h=H(()=>{const A=new Map;for(const b of s.models??[])A.set(b.id,{id:b.id,label:b.displayName??b.model??b.id,provider:b.provider});for(const[b,M]of Object.entries(s.config?.models??{})){if(A.has(b))continue;const N=w(M);A.set(b,{id:b,label:S(b,M,N),provider:N??b})}return Array.from(A.values())}),p=H(()=>{const A=new Map;for(const b of h.value){const M=A.get(b.provider)??[];M.push(b),A.set(b.provider,M)}for(const b of A.values())b.sort((M,N)=>M.label.localeCompare(N.label));return Array.from(A.entries()).toSorted(([b],[M])=>b.localeCompare(M)).map(([b,M])=>({provider:b,options:M}))}),f=H(()=>Object.entries(s.config?.providers??{}).map(([A,b])=>({id:A,provider:b})).sort((A,b)=>A.id.localeCompare(b.id))),g=H(()=>{const A=s.config?.defaultPermissionMode;return A==="auto"||A==="yolo"||A==="manual"?A:"manual"});function w(A){if(!A||typeof A!="object")return;const b=A;return typeof b.provider=="string"?b.provider:void 0}function S(A,b,M){if(!b||typeof b!="object")return A;const N=b,D=typeof N.model=="string"?N.model:void 0,$=M??w(b);return D&&$?`${A} (${$}/${D})`:D?`${A} (${D})`:A}function y(A){return A===!0}function k(A){const b=A.target.value;!b||b===s.config?.defaultModel||o("updateConfig",{defaultModel:b})}function v(A){A!==g.value&&o("updateConfig",{defaultPermissionMode:A})}function _(A){const b=s.config?.[A];o("updateConfig",{[A]:!y(b)})}function I(A){i.value=A}return(A,b)=>(x(),E("div",{class:"backdrop",onClick:b[16]||(b[16]=Ze(M=>o("close"),["self"]))},[m("div",{ref_key:"dialogRef",ref:c,class:"dialog",role:"dialog","aria-modal":"true",tabindex:"-1","aria-label":C(n)("settings.title")},[m("div",tte,[m("span",nte,L(C(n)("settings.title")),1),m("button",{class:"close-btn",title:C(n)("newSession.close"),onClick:b[0]||(b[0]=M=>o("close"))},[...b[17]||(b[17]=[m("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[m("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),m("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,ste)]),m("div",ote,[m("nav",{class:"settings-tabs",role:"tablist","aria-label":C(n)("settings.title")},[(x(),E(Ne,null,Qe(r,M=>m("button",{key:M.id,type:"button",class:Ie(["tab",{on:i.value===M.id}]),role:"tab","aria-selected":i.value===M.id,"aria-controls":`settings-panel-${M.id}`,id:`settings-tab-${M.id}`,onClick:N=>I(M.id)},L(C(n)(M.labelKey)),11,rte)),64))],8,ite),m("div",lte,[Ot(m("section",ate,[m("section",cte,[m("h3",ute,L(C(n)("settings.appearance")),1),m("div",dte,[m("span",fte,L(C(n)("theme.label")),1),m("div",{class:"seg",role:"group","aria-label":C(n)("theme.label")},[m("button",{type:"button",class:Ie(["opt",{on:e.theme==="modern"}]),"aria-pressed":e.theme==="modern",onClick:b[1]||(b[1]=M=>o("setTheme","modern"))},L(C(n)("theme.modern")),11,pte),m("button",{type:"button",class:Ie(["opt",{on:e.theme==="kimi"}]),"aria-pressed":e.theme==="kimi",onClick:b[2]||(b[2]=M=>o("setTheme","kimi"))},L(C(n)("theme.kimi")),11,mte)],8,hte)]),m("div",gte,[m("span",vte,L(C(n)("theme.colorSchemeLabel")),1),m("div",{class:"seg",role:"group","aria-label":C(n)("theme.colorSchemeLabel")},[m("button",{type:"button",class:Ie(["opt",{on:e.colorScheme==="light"}]),"aria-pressed":e.colorScheme==="light",onClick:b[3]||(b[3]=M=>o("setColorScheme","light"))},L(C(n)("theme.light")),11,kte),m("button",{type:"button",class:Ie(["opt",{on:e.colorScheme==="dark"}]),"aria-pressed":e.colorScheme==="dark",onClick:b[4]||(b[4]=M=>o("setColorScheme","dark"))},L(C(n)("theme.dark")),11,bte),m("button",{type:"button",class:Ie(["opt",{on:e.colorScheme==="system"}]),"aria-pressed":e.colorScheme==="system",onClick:b[5]||(b[5]=M=>o("setColorScheme","system"))},L(C(n)("theme.system")),11,_te)],8,yte)]),m("div",wte,[m("span",Ste,L(C(n)("settings.uiFontSize")),1),m("label",Cte,[m("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":C(n)("settings.uiFontSize"),onInput:b[6]||(b[6]=M=>o("setUiFontSize",Number(M.target.value)))},null,40,xte),b[18]||(b[18]=m("span",{class:"num-unit"},"px",-1))])]),m("div",Tte,[m("span",Mte,L(C(n)("sidebar.language")),1),bt(f3)])]),m("section",Ate,[m("h3",Ete,L(C(n)("settings.notifications")),1),m("div",Ite,[m("span",$te,[yt(L(C(n)("settings.notifyOnComplete"))+" ",1),e.notifyPermission==="denied"?(x(),E("span",Nte,L(C(n)("settings.notifyDenied")),1)):le("",!0)]),m("button",{type:"button",class:Ie(["switch",{on:e.notify}]),role:"switch","aria-checked":e.notify,disabled:e.notifyPermission==="denied",onClick:b[7]||(b[7]=M=>o("setNotify",!e.notify))},[...b[19]||(b[19]=[m("span",{class:"knob"},null,-1)])],10,Lte)])]),m("section",Ote,[m("h3",Pte,L(C(n)("settings.account")),1),m("div",Rte,[m("span",Dte,L(e.authReady?"managed:kimi-code":C(n)("sidebar.notSignedIn")),1),e.authReady&&e.accountModel?(x(),E("span",{key:0,class:"rvalue",title:e.accountModel},L(e.accountModel),9,Bte)):le("",!0)]),m("div",Fte,[m("button",{type:"button",class:"act",onClick:b[8]||(b[8]=M=>{o("openOnboarding"),o("close")})},L(C(n)("onboarding.reopen")),1),e.authReady?(x(),E("button",{key:0,type:"button",class:"act danger",onClick:b[9]||(b[9]=M=>o("logout"))},L(C(n)("sidebar.signOut")),1)):(x(),E("button",{key:1,type:"button",class:"act signin",onClick:b[10]||(b[10]=M=>o("login"))},L(C(n)("sidebar.signIn")),1))])]),m("section",Hte,[m("h3",Wte,L(C(n)("settings.build")),1),m("div",Ute,[m("span",qte,L(C(n)("settings.serverVersion")),1),m("span",jte,L(e.serverVersion||"-"),1)])])],512),[[Ho,i.value==="general"]]),Ot(m("section",zte,[m("section",Vte,[m("div",Kte,[m("h3",Gte,L(C(n)("settings.agentDefaults")),1),e.configSaving?(x(),E("span",Yte,L(C(n)("settings.saving")),1)):le("",!0)]),e.config?(x(),E(Ne,{key:0},[m("div",Xte,[m("span",Zte,[yt(L(C(n)("settings.defaultModel"))+" ",1),m("span",Jte,L(C(n)("settings.defaultModelHint")),1)]),p.value.length>0?(x(),E("select",{key:0,class:"select-field",value:e.config.defaultModel??"",disabled:e.configSaving,"aria-label":C(n)("settings.defaultModel"),onChange:k},[e.config.defaultModel?le("",!0):(x(),E("option",ene,L(C(n)("settings.noDefaultModel")),1)),(x(!0),E(Ne,null,Qe(p.value,M=>(x(),E("optgroup",{key:M.provider,label:M.provider},[(x(!0),E(Ne,null,Qe(M.options,N=>(x(),E("option",{key:N.id,value:N.id},L(N.label),9,nne))),128))],8,tne))),128))],40,Qte)):(x(),E("span",sne,L(e.config.defaultModel??C(n)("settings.noDefaultModel")),1))]),m("div",one,[m("span",ine,[yt(L(C(n)("settings.defaultPermission"))+" ",1),m("span",rne,L(C(n)("settings.defaultPermissionHint")),1)]),m("div",{class:"seg",role:"group","aria-label":C(n)("settings.defaultPermission")},[(x(),E(Ne,null,Qe(a,M=>m("button",{key:M,type:"button",class:Ie(["opt",{on:g.value===M}]),"aria-pressed":g.value===M,disabled:e.configSaving,onClick:N=>v(M)},L(C(n)(`settings.permission.${M}`)),11,ane)),64))],8,lne)]),m("div",cne,[m("span",une,[yt(L(C(n)("settings.defaultThinking"))+" ",1),m("span",dne,L(C(n)("settings.defaultThinkingHint")),1)]),m("button",{type:"button",class:Ie(["switch",{on:y(e.config.defaultThinking)}]),role:"switch","aria-checked":y(e.config.defaultThinking),disabled:e.configSaving,onClick:b[11]||(b[11]=M=>_("defaultThinking"))},[...b[20]||(b[20]=[m("span",{class:"knob"},null,-1)])],10,fne)]),m("div",hne,[m("span",pne,[yt(L(C(n)("settings.defaultPlanMode"))+" ",1),m("span",mne,L(C(n)("settings.defaultPlanModeHint")),1)]),m("button",{type:"button",class:Ie(["switch",{on:y(e.config.defaultPlanMode)}]),role:"switch","aria-checked":y(e.config.defaultPlanMode),disabled:e.configSaving,onClick:b[12]||(b[12]=M=>_("defaultPlanMode"))},[...b[21]||(b[21]=[m("span",{class:"knob"},null,-1)])],10,gne)]),m("div",vne,[m("span",yne,[yt(L(C(n)("settings.mergeSkills"))+" ",1),m("span",kne,L(C(n)("settings.mergeSkillsHint")),1)]),m("button",{type:"button",class:Ie(["switch",{on:y(e.config.mergeAllAvailableSkills)}]),role:"switch","aria-checked":y(e.config.mergeAllAvailableSkills),disabled:e.configSaving,onClick:b[13]||(b[13]=M=>_("mergeAllAvailableSkills"))},[...b[22]||(b[22]=[m("span",{class:"knob"},null,-1)])],10,bne)]),e.config.telemetry!==void 0?(x(),E("div",_ne,[m("span",wne,L(C(n)("settings.telemetry")),1),m("button",{type:"button",class:Ie(["switch",{on:y(e.config.telemetry)}]),role:"switch","aria-checked":y(e.config.telemetry),disabled:e.configSaving,onClick:b[14]||(b[14]=M=>_("telemetry"))},[...b[23]||(b[23]=[m("span",{class:"knob"},null,-1)])],10,Sne)])):le("",!0),f.value.length>0?(x(),E("div",Cne,[(x(!0),E(Ne,null,Qe(f.value,({id:M,provider:N})=>(x(),E("div",{key:M,class:"provider-row"},[m("div",xne,[m("span",Tne,L(M),1),m("span",Mne,L(N.type),1)]),m("div",Ane,[m("span",{class:Ie(["provider-badge",N.hasApiKey?"ok":"warn"])},L(N.hasApiKey?C(n)("settings.credentialReady"):C(n)("settings.credentialMissing")),3),N.defaultModel?(x(),E("span",Ene,L(N.defaultModel),1)):le("",!0)])]))),128))])):le("",!0)],64)):(x(),E("div",Ine,L(C(n)("settings.configUnavailable")),1))])],512),[[Ho,i.value==="agent"]]),Ot(m("section",$ne,[m("section",Nne,[m("h3",Lne,L(C(n)("settings.advanced")),1),m("div",One,[m("span",Pne,L(C(n)("sidebar.daemon")),1),m("span",Rne,L(C(l)),1)]),m("div",Dne,[m("span",Bne,[yt(L(C(n)("settings.exportLog"))+" ",1),C(ai)()?le("",!0):(x(),E("span",Fne,L(C(n)("settings.logHint")),1))]),m("button",{type:"button",class:"act",onClick:d},L(C(n)("settings.exportLogBtn")),1)])])],512),[[Ho,i.value==="advanced"]]),Ot(m("section",Hne,[m("section",Wne,[m("h3",Une,L(C(n)("settings.beta")),1),m("div",qne,[m("span",jne,[yt(L(C(n)("settings.betaToc"))+" ",1),m("span",zne,L(C(n)("settings.betaTocHint")),1)]),m("button",{type:"button",class:Ie(["switch",{on:e.betaToc}]),role:"switch","aria-checked":e.betaToc,onClick:b[15]||(b[15]=M=>o("setBetaToc",!e.betaToc))},[...b[24]||(b[24]=[m("span",{class:"knob"},null,-1)])],10,Vne)])])],512),[[Ho,i.value==="experimental"]])])])],8,ete)]))}}),Gne=wt(Kne,[["__scopeId","data-v-2f40622b"]]),Yne=["aria-label"],Xne={class:"dh"},Zne={class:"dtitle"},Jne={class:"count"},Qne=["aria-label","title"],ese={class:"search-wrap"},tse=["placeholder"],nse={class:"session-list"},sse=["aria-selected","onClick","onMouseenter"],ose={class:"meta"},ise={class:"title"},rse={class:"sub"},lse={class:"ws"},ase={class:"time"},cse={key:0,class:"attn-badge"},use={key:0,class:"empty"},dse={class:"footer-hint"},fse=Je({__name:"SessionsDialog",props:{sessions:{},workspaceGroups:{},attentionBySession:{},activeId:{}},emits:["select","close"],setup(e,{emit:t}){const{t:n}=St(),s=e,o=t,i=H(()=>{const f={};for(const g of s.workspaceGroups)for(const w of g.sessions)f[w.id]=g.workspace.name;return f}),r=se(""),l=se(null),a=H(()=>{const f=r.value.toLowerCase().trim();return f?s.sessions.filter(g=>g.title.toLowerCase().includes(f)):s.sessions}),c=se(0);Ge(r,()=>{c.value=0});function u(f){o("select",f)}function d(f){return s.attentionBySession[f]??0}function h(f){return d(f.id)>0||f.status==="awaitingApproval"||f.status==="awaitingQuestion"?"attn":f.busy?"run":f.status==="aborted"?"aborted":"idle"}function p(f){if(f.key==="Escape"){o("close");return}if(f.key==="ArrowDown")f.preventDefault(),c.value=Math.min(c.value+1,a.value.length-1);else if(f.key==="ArrowUp")f.preventDefault(),c.value=Math.max(c.value-1,0);else if(f.key==="Enter"){const g=a.value[c.value];g&&u(g.id)}}return tn(()=>{document.addEventListener("keydown",p),vt(()=>l.value?.focus())}),Ht(()=>{document.removeEventListener("keydown",p)}),(f,g)=>(x(),E("div",{class:"backdrop",onClick:g[2]||(g[2]=Ze(w=>o("close"),["self"]))},[m("div",{class:"dialog",role:"dialog","aria-label":C(n)("sessions.title")},[m("div",Xne,[m("span",Zne,L(C(n)("sessions.title")),1),m("span",Jne,L(e.sessions.length),1),m("button",{class:"close-btn","aria-label":C(n)("sessions.close"),title:C(n)("sessions.close"),onClick:g[0]||(g[0]=w=>o("close"))},[...g[3]||(g[3]=[m("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[m("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),m("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,Qne)]),m("div",ese,[Ot(m("input",{ref_key:"searchRef",ref:l,"onUpdate:modelValue":g[1]||(g[1]=w=>r.value=w),class:"search-input",type:"text",placeholder:C(n)("sessions.searchPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,tse),[[An,r.value]])]),m("div",nse,[(x(!0),E(Ne,null,Qe(a.value,(w,S)=>(x(),E("div",{key:w.id,class:Ie(["session-row",{"is-active":w.id===e.activeId,"is-selected":S===c.value}]),role:"option","aria-selected":w.id===e.activeId,onClick:y=>u(w.id),onMouseenter:y=>c.value=S},[m("span",{class:Ie(["dot",h(w)])},null,2),m("div",ose,[m("span",ise,L(w.title),1),m("span",rse,[m("span",lse,L(i.value[w.id]??C(n)("sessions.noWorkspace")),1),g[4]||(g[4]=m("span",{class:"sep"},"·",-1)),m("span",ase,L(w.time),1)])]),d(w.id)>0?(x(),E("span",cse,L(d(w.id)),1)):le("",!0)],42,sse))),128)),a.value.length===0?(x(),E("div",use,L(e.sessions.length===0?C(n)("sessions.emptyNone"):C(n)("sessions.emptyNoMatch")),1)):le("",!0)]),m("div",dse,L(C(n)("sessions.footerHint")),1)],8,Yne)]))}}),hse=wt(fse,[["__scopeId","data-v-a55eac2e"]]),pse=["aria-label"],mse={class:"dh"},gse={class:"dtitle"},vse=["aria-label"],yse={class:"crumbbar"},kse=["disabled","title","aria-label"],bse={class:"crumbs"},_se={key:0,class:"crumb-sep"},wse=["onClick"],Sse={key:0,class:"filterbar"},Cse=["placeholder"],xse={key:0,class:"search-spin","aria-hidden":"true"},Tse={class:"folder-list"},Mse={key:0,class:"fl-loading"},Ase=["onClick"],Ese={class:"folder-name search-rel"},Ise={key:0,class:"git-tag"},$se={key:0,class:"git-branch"},Nse={key:0,class:"fl-empty"},Lse={key:1,class:"fl-loading"},Ose=["onClick"],Pse={class:"folder-name"},Rse={key:0,class:"git-tag"},Dse={key:0,class:"git-branch"},Bse={key:0,class:"fl-empty"},Fse={class:"paste-label",for:"aw-path"},Hse=["placeholder","onKeydown"],Wse=["disabled","title"],Use={class:"actions"},qse=["disabled","title"],jse={class:"footer-hint"},zse=600,Vse=6,Kw=150,Kse=Je({__name:"AddWorkspaceDialog",props:{browseFs:{type:Function},getFsHome:{type:Function},defaultPath:{}},emits:["add","close"],setup(e,{emit:t}){const{t:n}=St(),s=e,o=t,i=se(!1),r=se(!1),l=se(""),a=se(null),c=se([]),u=se(""),d=se(!1),h=se([]),p=H(()=>u.value.trim().length>0);let f=0,g=null;function w(O,P){const R=O.toLowerCase(),F=P.toLowerCase();let V=0;for(let K=0;K<F.length&&V<R.length;K++)F[K]===R[V]&&V++;return V===R.length}async function S(O){const P=l.value,R=O.trim();if(!P||R===""){h.value=[],d.value=!1;return}const F=++f;d.value=!0;const V=[],K=[{path:P,depth:0}];let Z=0;for(;K.length>0&&Z<zse&&V.length<Kw;){if(F!==f)return;const G=K.shift();Z++;let X;try{X=await s.browseFs(G.path)}catch{continue}if(F!==f)return;for(const pe of X.entries){if(!pe.isDir)continue;const oe=pe.path.startsWith(P)?pe.path.slice(P.length).replace(/^\/+/,""):pe.path;if(w(R,oe||pe.name)&&(V.push({path:pe.path,name:pe.name,rel:oe||pe.name,isGitRepo:pe.isGitRepo,branch:pe.branch}),V.length>=Kw))break;G.depth+1<Vse&&K.push({path:pe.path,depth:G.depth+1})}F===f&&(h.value=[...V])}F===f&&(d.value=!1)}Ge(u,O=>{if(g&&clearTimeout(g),O.trim()===""){f++,h.value=[],d.value=!1;return}g=setTimeout(()=>void S(O),220)});const y=se(!1),k=se(""),v=H(()=>k.value.trim()),_=H(()=>{const O=l.value;if(!O)return[];const P=O.split("/").filter(Boolean),R=[{label:"/",path:"/"}];let F="";for(const V of P)F+=`/${V}`,R.push({label:V,path:F});return R}),I=H(()=>l.value.length>0);async function A(O){i.value=!0;try{const P=await s.browseFs(O);if(!P.path){r.value=!0;return}l.value=P.path,a.value=P.parent,c.value=P.entries,u.value="",r.value=!1}catch{r.value=!0}finally{i.value=!1}}function b(O){O.isDir&&A(O.path)}function M(){a.value&&A(a.value)}function N(){I.value&&o("add",l.value)}function D(){v.value.length!==0&&o("add",v.value)}tn(async()=>{i.value=!0;try{if(s.defaultPath&&(await A(s.defaultPath),!r.value))return;const O=await s.getFsHome();O.home?await A(O.home):r.value=!0}catch{r.value=!0}finally{i.value=!1}});function $(O){O.key==="Escape"&&o("close")}return tn(()=>document.addEventListener("keydown",$)),Ht(()=>{document.removeEventListener("keydown",$),g&&clearTimeout(g)}),(O,P)=>(x(),E("div",{class:"backdrop",onClick:P[6]||(P[6]=Ze(R=>o("close"),["self"]))},[m("div",{class:"dialog",role:"dialog","aria-label":C(n)("workspace.addTitle")},[m("div",mse,[m("span",gse,L(C(n)("workspace.addTitle")),1),m("button",{class:"close-btn","aria-label":C(n)("workspace.cancel"),onClick:P[0]||(P[0]=R=>o("close"))},[...P[7]||(P[7]=[m("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[m("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),m("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,vse)]),r.value?le("",!0):(x(),E(Ne,{key:0},[m("div",yse,[m("button",{class:"up-btn",disabled:!a.value,title:C(n)("workspace.up"),"aria-label":C(n)("workspace.up"),onClick:M},[...P[8]||(P[8]=[m("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[m("path",{d:"M8 12V4M4 7l4-3 4 3"})],-1)])],8,kse),m("div",bse,[(x(!0),E(Ne,null,Qe(_.value,(R,F)=>(x(),E(Ne,{key:R.path},[F>1?(x(),E("span",_se,"/")):le("",!0),m("button",{class:Ie(["crumb",{last:F===_.value.length-1}]),onClick:V=>A(R.path)},L(R.label),11,wse)],64))),128))])]),i.value?le("",!0):(x(),E("div",Sse,[P[9]||(P[9]=m("svg",{class:"filter-icon",width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("circle",{cx:"7",cy:"7",r:"4.5"}),m("path",{d:"M11 11l3 3"})],-1)),Ot(m("input",{"onUpdate:modelValue":P[1]||(P[1]=R=>u.value=R),class:"filter-input",type:"text",placeholder:C(n)("workspace.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:P[2]||(P[2]=Ze(()=>{},["stop"]))},null,40,Cse),[[An,u.value]]),d.value?(x(),E("span",xse)):le("",!0)])),m("div",Tse,[i.value?(x(),E("div",Mse,L(C(n)("workspace.browsing")),1)):p.value?(x(),E(Ne,{key:1},[(x(!0),E(Ne,null,Qe(h.value,R=>(x(),E("button",{key:R.path,class:"folder-row",onClick:F=>A(R.path)},[P[10]||(P[10]=m("svg",{class:"dir-icon",width:"13",height:"13",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor","stroke-width":"1.2"},[m("rect",{x:"1",y:"3.5",width:"12",height:"8.5",rx:"1"}),m("path",{d:"M1 5V3.5A1 1 0 0 1 2 2.5h3.5l1.3 2"})],-1)),m("span",Ese,L(R.rel),1),R.isGitRepo?(x(),E("span",Ise,[yt(L(C(n)("workspace.gitTag")),1),R.branch?(x(),E("span",$se,L(R.branch),1)):le("",!0)])):le("",!0)],8,Ase))),128)),!d.value&&h.value.length===0?(x(),E("div",Nse,L(C(n)("workspace.noFilterMatch",{q:u.value.trim()})),1)):d.value&&h.value.length===0?(x(),E("div",Lse,L(C(n)("workspace.searching")),1)):le("",!0)],64)):(x(),E(Ne,{key:2},[(x(!0),E(Ne,null,Qe(c.value,R=>(x(),E("button",{key:R.path,class:"folder-row",onClick:F=>b(R)},[P[11]||(P[11]=m("svg",{class:"dir-icon",width:"13",height:"13",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor","stroke-width":"1.2"},[m("rect",{x:"1",y:"3.5",width:"12",height:"8.5",rx:"1"}),m("path",{d:"M1 5V3.5A1 1 0 0 1 2 2.5h3.5l1.3 2"})],-1)),m("span",Pse,L(R.name),1),R.isGitRepo?(x(),E("span",Rse,[yt(L(C(n)("workspace.gitTag")),1),R.branch?(x(),E("span",Dse,L(R.branch),1)):le("",!0)])):le("",!0)],8,Ose))),128)),c.value.length===0?(x(),E("div",Bse,L(C(n)("workspace.noSubfolders")),1)):le("",!0)],64))])],64)),m("div",{class:Ie(["paste-section",{"paste-only":r.value}])},[!r.value&&!y.value?(x(),E("button",{key:0,type:"button",class:"paste-toggle",onClick:P[3]||(P[3]=R=>y.value=!0)},L(C(n)("workspace.pasteToggle")),1)):(x(),E(Ne,{key:1},[m("label",Fse,L(C(n)("workspace.pathLabel")),1),Ot(m("input",{id:"aw-path","onUpdate:modelValue":P[4]||(P[4]=R=>k.value=R),class:"paste-input",type:"text",placeholder:C(n)("workspace.pathPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:Mo(Ze(D,["stop"]),["enter"])},null,40,Hse),[[An,k.value]]),m("button",{class:"paste-add",disabled:v.value.length===0,title:C(n)("workspace.add"),onClick:D},[...P[12]||(P[12]=[m("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("path",{d:"M8 3v10M3 8h10"})],-1)])],8,Wse)],64))],2),m("div",Use,[r.value?le("",!0):(x(),E("button",{key:0,class:"act-btn primary",disabled:!I.value,title:l.value,onClick:N},L(C(n)("workspace.openThisFolder")),9,qse)),m("button",{class:"act-btn",onClick:P[5]||(P[5]=R=>o("close"))},L(C(n)("workspace.cancel")),1)]),m("div",jse,L(C(n)("workspace.browseHint")),1)],8,pse)]))}}),Gse=wt(Kse,[["__scopeId","data-v-da51b020"]]),Yse=["aria-label"],Xse={class:"dh"},Zse={class:"dtitle"},Jse=["title"],Qse={class:"rows"},eoe={class:"row"},toe={class:"row"},noe={class:"row"},soe={class:"row"},ooe={class:"row"},ioe={class:"row"},roe={class:"ctx-text"},loe={key:0,class:"bar"},aoe={class:"row"},coe=Je({__name:"StatusPanel",props:{status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},costUsd:{}},emits:["close"],setup(e,{emit:t}){const{t:n}=St(),s=e,o=t,i=H(()=>s.status.ctxMax>0?Math.round(s.status.ctxUsed/s.status.ctxMax*100):0),r=H(()=>s.status.ctxMax>0?n("status.statusContextValue",{used:s.status.ctxUsed.toLocaleString(),max:s.status.ctxMax.toLocaleString(),pct:i.value}):n("status.statusNone"));function l(f){return n(f==="yolo"?"status.permissionYolo":f==="auto"?"status.permissionAuto":"status.permissionManual")}const a=H(()=>{const f=s.status.permission;return f==="yolo"?"var(--err)":f==="auto"?"var(--warn)":"var(--ink)"}),c=H(()=>s.planMode?n("status.planOn"):n("status.planOff")),u=H(()=>s.swarmMode?n("status.swarmOn"):n("status.swarmOff")),d=H(()=>typeof s.costUsd=="number"&&s.costUsd>0),h=H(()=>d.value?`$${s.costUsd.toFixed(4)}`:n("status.statusNone"));function p(f){f.key==="Escape"&&o("close")}return tn(()=>document.addEventListener("keydown",p)),Ht(()=>document.removeEventListener("keydown",p)),(f,g)=>(x(),E("div",{class:"backdrop",onClick:g[1]||(g[1]=Ze(w=>o("close"),["self"]))},[m("div",{class:"dialog",role:"dialog","aria-label":C(n)("status.statusPanelTitle")},[m("div",Xse,[m("span",Zse,L(C(n)("status.statusPanelTitle")),1),m("button",{class:"close-btn",title:C(n)("status.statusPanelClose"),onClick:g[0]||(g[0]=w=>o("close"))},"✕",8,Jse)]),m("dl",Qse,[m("div",eoe,[m("dt",null,L(C(n)("status.statusModel")),1),m("dd",null,L(e.status.model),1)]),m("div",toe,[m("dt",null,L(C(n)("status.statusThinking")),1),m("dd",null,L(e.thinking),1)]),m("div",noe,[m("dt",null,L(C(n)("status.statusPermission")),1),m("dd",{style:Ft({color:a.value})},L(l(e.status.permission)),5)]),m("div",soe,[m("dt",null,L(C(n)("status.statusPlanMode")),1),m("dd",{class:Ie({"plan-on":e.planMode})},L(c.value),3)]),m("div",ooe,[m("dt",null,L(C(n)("status.statusSwarmMode")),1),m("dd",{class:Ie({"swarm-on":e.swarmMode})},L(u.value),3)]),m("div",ioe,[m("dt",null,L(C(n)("status.statusContext")),1),m("dd",null,[m("span",roe,L(r.value),1),e.status.ctxMax>0?(x(),E("span",loe,[m("i",{style:Ft({width:i.value+"%"})},null,4)])):le("",!0)])]),m("div",aoe,[m("dt",null,L(C(n)("status.statusCost")),1),m("dd",null,L(h.value),1)])])],8,Yse)]))}}),uoe=wt(coe,[["__scopeId","data-v-230d4b38"]]),doe={key:0,class:"toasts",role:"status","aria-live":"polite"},foe=["onPointerenter","onPointerleave"],hoe={class:"body"},poe={class:"title"},moe={key:0,class:"msg"},goe={key:1,class:"actions"},voe=["onClick"],yoe=["onClick"],koe={key:2,class:"details"},boe=["aria-label","onClick"],_oe=Je({__name:"WarningToasts",props:{warnings:{}},emits:["dismiss"],setup(e,{emit:t}){const n=e,s=t,{t:o}=St();function i(b){return typeof b=="object"&&b!==null}function r(b){return i(b)?b.title:b}function l(b){return i(b)?b.message??"":""}function a(b){return i(b)?b.details:void 0}function c(b){return i(b)?b.severity==="error":b.startsWith(`${o("warnings.errorLabel")}:`)||/\b4\d\d\b|error|失败|failed/i.test(b)}function u(b){return i(b)?`notice:${b.severity}:${b.title}:${b.message??""}:${JSON.stringify(b.details??[])}`:`text:${b}`}function d(b){if(!i(b))return b;const M=[b.title];b.message&&M.push(b.message);const N=b.details??[];if(N.length>0){M.push("",`${o("warnings.diagnostics")}:`);for(const D of N)M.push(`${D.label}: ${D.value}`)}return M.join(`
|
|
253
|
-
`)}let h=1;const p=se([]),f=new Map,g=new Map;function w(b){const M=c(b)?12e3:6e3;return typeof window<"u"&&window.matchMedia?.("(hover: none)").matches===!0?M+5e3:M}function S(b,M){const N=f.get(b)??{handle:null,deadline:0,remaining:0};N.handle=setTimeout(()=>A(b),M),N.deadline=Date.now()+M,f.set(b,N)}function y(b){const M=f.get(b);M&&M.handle!==null&&clearTimeout(M.handle),f.delete(b)}function k(b){const M=f.get(b);!M||M.handle===null||(clearTimeout(M.handle),M.handle=null,M.remaining=Math.max(0,M.deadline-Date.now()))}function v(b){if(p.value.find(D=>D.id===b)?.detailsOpen)return;const N=f.get(b);!N||N.handle!==null||S(b,N.remaining)}function _(b){b.detailsOpen=!b.detailsOpen,b.detailsOpen?k(b.id):v(b.id)}async function I(b){if(!await xs(d(b.warning)))return;b.copied=!0;const N=g.get(b.id);N&&clearTimeout(N),g.set(b.id,setTimeout(()=>{b.copied=!1,g.delete(b.id)},1400))}function A(b){y(b);const M=g.get(b);M&&clearTimeout(M),g.delete(b);const N=p.value.findIndex(D=>D.id===b);N!==-1&&(p.value=p.value.filter(D=>D.id!==b),s("dismiss",N))}return Ge(()=>n.warnings,b=>{const M=[...p.value];p.value=b.map(N=>{const D=u(N),$=M.findIndex(R=>R.key===D),O=$===-1?void 0:M.splice($,1)[0];if(O)return O.warning=N,O;const P={id:h++,key:D,warning:N,detailsOpen:!1,copied:!1};return S(P.id,w(N)),P});for(const N of M){y(N.id);const D=g.get(N.id);D&&clearTimeout(D),g.delete(N.id)}},{immediate:!0,flush:"post"}),Ht(()=>{f.forEach(b=>{b.handle!==null&&clearTimeout(b.handle)}),f.clear(),g.forEach(b=>clearTimeout(b)),g.clear()}),(b,M)=>p.value.length?(x(),E("div",doe,[(x(!0),E(Ne,null,Qe(p.value,N=>(x(),E("div",{key:N.id,class:Ie(["toast",{err:c(N.warning)}]),onPointerenter:D=>k(N.id),onPointerleave:D=>v(N.id)},[M[1]||(M[1]=m("span",{class:"dot","aria-hidden":"true"},null,-1)),m("div",hoe,[m("div",poe,L(r(N.warning)),1),l(N.warning)?(x(),E("div",moe,L(l(N.warning)),1)):le("",!0),a(N.warning)?.length?(x(),E("div",goe,[m("button",{class:"link",type:"button",onClick:D=>_(N)},L(N.detailsOpen?C(o)("warnings.hideDetails"):C(o)("warnings.showDetails")),9,voe),m("button",{class:"link",type:"button",onClick:D=>I(N)},L(N.copied?C(o)("warnings.copied"):C(o)("warnings.copyDetails")),9,yoe)])):le("",!0),N.detailsOpen&&a(N.warning)?.length?(x(),E("dl",koe,[(x(!0),E(Ne,null,Qe(a(N.warning),D=>(x(),E("div",{key:`${D.label}:${D.value}`,class:"detail-row"},[m("dt",null,L(D.label),1),m("dd",null,L(D.value),1)]))),128))])):le("",!0)]),m("button",{class:"x",type:"button","aria-label":C(o)("warnings.dismiss"),onClick:D=>A(N.id)},[...M[0]||(M[0]=[m("svg",{viewBox:"0 0 16 16",width:"12",height:"12"},[m("path",{d:"M4 4l8 8M12 4l-8 8",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round"})],-1)])],8,boe)],42,foe))),128))])):le("",!0)}}),woe=wt(_oe,[["__scopeId","data-v-45432ab6"]]),Soe={class:"topbar"},Coe={class:"wsq"},xoe=["aria-label"],Toe={class:"tb-path"},Moe={class:"ws"},Aoe={class:"se"},Eoe={class:"tb-sub"},Ioe=["aria-label"],$oe=Je({__name:"MobileTopBar",props:{workspace:{default:null},sessionTitle:{default:""},running:{type:Boolean,default:!1},branch:{default:""},sessionCount:{default:0}},emits:["openSwitcher","openSettings"],setup(e,{emit:t}){const{t:n}=St(),s=e,o=t,i=H(()=>{const a=s.workspace,u=(a?.name||a?.root||"").trim().charAt(0);return u?u.toUpperCase():"K"}),r=H(()=>s.workspace?.name??n("workspace.noWorkspace")),l=H(()=>s.running?n("mobile.running"):n("mobile.idle"));return(a,c)=>(x(),E("div",Soe,[m("span",Coe,L(i.value),1),m("button",{type:"button",class:"tb-mid","aria-label":C(n)("mobile.openSwitcher"),onClick:c[0]||(c[0]=u=>o("openSwitcher"))},[m("span",Toe,[m("span",Moe,L(r.value),1),e.sessionTitle?(x(),E(Ne,{key:0},[c[2]||(c[2]=m("span",{class:"sl"},"/",-1)),m("span",Aoe,L(e.sessionTitle),1)],64)):le("",!0),c[3]||(c[3]=m("span",{class:"cv"},"⌄",-1))]),m("span",Eoe,[m("span",{class:Ie(["rd",{on:e.running}])},null,2),m("span",null,L(l.value),1),e.branch?(x(),E(Ne,{key:0},[yt(" · "+L(e.branch),1)],64)):le("",!0),e.sessionCount>0?(x(),E(Ne,{key:1},[yt(" · "+L(C(n)("mobile.sessionCount",{n:e.sessionCount})),1)],64)):le("",!0)])],8,xoe),m("button",{type:"button",class:"tb-set","aria-label":C(n)("mobile.openSettings"),onClick:c[1]||(c[1]=u=>o("openSettings"))},[...c[4]||(c[4]=[kr('<svg viewBox="0 0 24 24" width="21" height="21" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" aria-hidden="true" data-v-135bd6bf><line x1="4" y1="8" x2="20" y2="8" data-v-135bd6bf></line><circle cx="10" cy="8" r="2.5" fill="var(--bg)" data-v-135bd6bf></circle><line x1="4" y1="16" x2="20" y2="16" data-v-135bd6bf></line><circle cx="15" cy="16" r="2.5" fill="var(--bg)" data-v-135bd6bf></circle></svg>',1)])],8,Ioe)]))}}),Noe=wt($oe,[["__scopeId","data-v-135bd6bf"]]),Loe={key:0,class:"sheet-root"},Ooe=["aria-label"],Poe=["aria-label"],Roe={key:0,class:"sheet-head"},Doe={class:"sheet-title"},Boe={class:"sheet-body"},Foe=Je({__name:"BottomSheet",props:{modelValue:{type:Boolean},title:{default:""}},emits:["update:modelValue","close"],setup(e,{emit:t}){const{t:n}=St(),s=e,o=t;function i(){o("update:modelValue",!1),o("close")}function r(l){l.key==="Escape"&&i()}return Ge(()=>s.modelValue,l=>{typeof document>"u"||(l?document.addEventListener("keydown",r):document.removeEventListener("keydown",r))},{immediate:!0}),Ht(()=>{typeof document<"u"&&document.removeEventListener("keydown",r)}),(l,a)=>(x(),Ke(Pi,{name:"sheet"},{default:Mn(()=>[e.modelValue?(x(),E("div",Loe,[m("div",{class:"sheet-scrim",onClick:i}),m("div",{class:"sheet-panel",role:"dialog","aria-label":e.title||C(n)("mobile.sheetLabel")},[m("button",{type:"button",class:"sheet-grab","aria-label":C(n)("mobile.closeSheet"),onClick:i},null,8,Poe),e.title?(x(),E("div",Roe,[m("span",Doe,L(e.title),1)])):le("",!0),m("div",Boe,[Ql(l.$slots,"default",{},void 0,!0)])],8,Ooe)])):le("",!0)]),_:3}))}}),p3=wt(Foe,[["__scopeId","data-v-aa55810a"]]),Hoe={class:"mlist"},Woe={key:0,class:"mempty"},Uoe=["onClick"],qoe={class:"mgh-folder",width:"15",height:"15",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor","stroke-width":"1.2","aria-hidden":"true"},joe={class:"mgh-main"},zoe={class:"mgh-name"},Voe=["title"],Koe={key:0,class:"att"},Goe=["title","aria-label","onClick"],Yoe=["title","aria-label","onClick"],Xoe=["onClick"],Zoe=["onClick"],Joe={key:0,class:"mempty small"},Qoe=["onClick"],eie={class:"m"},tie={class:"s"},nie={key:0,class:"att"},sie=["title","onClick"],oie=["onClick"],iie=["onClick"],rie=["onClick"],Gw=5,lie=7200*60*1e3,aie=Je({__name:"MobileSwitcherSheet",props:{modelValue:{type:Boolean},groups:{},activeWorkspaceId:{default:null},activeId:{},attentionBySession:{default:()=>({})},attentionByWorkspace:{default:()=>({})}},emits:["update:modelValue","select","create","createInWorkspace","addWorkspace","rename","archive","deleteWorkspace"],setup(e,{emit:t}){const{t:n}=St(),s=e,o=t;function i(){o("update:modelValue",!1)}function r(P){o("select",P),i()}function l(P){o("createInWorkspace",P),i()}function a(){o("create"),i()}function c(){o("addWorkspace"),i()}const u=se(new Set);function d(P){return u.value.has(P)}function h(P){const R=new Set(u.value);if(R.has(P)){R.delete(P);const F=new Set(f.value);F.delete(P),f.value=F}else R.add(P);u.value=R,y.value=null,b.value=null}function p(P){return s.attentionByWorkspace[P]??0}const f=se(new Set);function g(P){return f.value.has(P)}function w(P){const R=new Set(f.value);R.has(P)?R.delete(P):R.add(P),f.value=R}function S(P,R,F){if(R||P.length<=Gw)return P;const K=Date.now()-lie,Z=P.slice(0,Gw),G=new Set(Z.map(oe=>oe.id)),X=P.filter(oe=>G.has(oe.id)?!1:(oe.updatedAt?Date.parse(oe.updatedAt):0)>K),pe=[...Z,...X];if(F&&!pe.some(oe=>oe.id===F)){const oe=P.find(ye=>ye.id===F);oe&&pe.push(oe)}return pe}const y=se(null),k=se(null);let v;function _(P){y.value=y.value===P?null:P,b.value=null,clearTimeout(v),k.value=null}function I(P){y.value=null;const F=(typeof window<"u"?window.prompt(n("sidebar.rename"),P.title):null)?.trim();F&&o("rename",P.id,F)}function A(P){if(k.value===P){clearTimeout(v),k.value=null,y.value=null,o("archive",P);return}clearTimeout(v),k.value=P,v=setTimeout(()=>{k.value=null},2500)}const b=se(null),M=se(null);let N;function D(P){b.value=b.value===P?null:P,y.value=null,clearTimeout(N),M.value=null}function $(P){xs(P.root),b.value=null}function O(P){if(M.value===P){clearTimeout(N),M.value=null,b.value=null,o("deleteWorkspace",P);return}clearTimeout(N),M.value=P,N=setTimeout(()=>{M.value=null},2500)}return Ht(()=>{clearTimeout(v),clearTimeout(N)}),(P,R)=>(x(),Ke(p3,{"model-value":e.modelValue,"onUpdate:modelValue":R[2]||(R[2]=F=>o("update:modelValue",F))},{default:Mn(()=>[m("button",{type:"button",class:"newrow",onClick:a},[R[3]||(R[3]=m("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("path",{d:"M4 2.5h8a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2H8.5l-2.5 2V11.5H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2z"})],-1)),yt(" "+L(C(n)("sidebar.newChat")),1)]),m("button",{type:"button",class:"newrow secondary",onClick:c},[R[4]||(R[4]=m("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","aria-hidden":"true"},[m("path",{d:"M1 3.5V2.5A1 1 0 0 1 2 1.5h3.5l1.3 2h5.2a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1z"}),m("path",{d:"M1 5.5h12"})],-1)),yt(" "+L(C(n)("sidebar.newWorkspace")),1)]),m("div",Hoe,[e.groups.length===0?(x(),E("div",Woe,L(C(n)("workspace.noWorkspace")),1)):le("",!0),(x(!0),E(Ne,null,Qe(e.groups,F=>(x(),E("div",{key:F.workspace.id,class:"mgroup"},[m("div",{class:Ie(["mgh",{on:F.workspace.id===e.activeWorkspaceId}]),onClick:V=>h(F.workspace.id)},[(x(),E("svg",qoe,[d(F.workspace.id)?(x(),E(Ne,{key:0},[R[5]||(R[5]=m("rect",{x:"1",y:"3.5",width:"12",height:"8.5",rx:"1"},null,-1)),R[6]||(R[6]=m("path",{d:"M1 5V3.5A1 1 0 0 1 2 2.5h3.5l1.3 2"},null,-1))],64)):(x(),E(Ne,{key:1},[R[7]||(R[7]=m("path",{d:"M1 3.5V2.5A1 1 0 0 1 2 1.5h3.5l1.3 2h5.2a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1z"},null,-1)),R[8]||(R[8]=m("path",{d:"M1 5.5h12"},null,-1))],64))])),m("div",joe,[m("span",zoe,L(F.workspace.name),1),m("span",{class:"mgh-path",title:F.workspace.root},L(F.workspace.branch||F.workspace.shortPath),9,Voe)]),d(F.workspace.id)&&p(F.workspace.id)>0?(x(),E("span",Koe,L(p(F.workspace.id)),1)):le("",!0),m("button",{type:"button",class:"mgh-more",title:C(n)("sidebar.options"),"aria-label":C(n)("sidebar.options"),onClick:Ze(V=>D(F.workspace.id),["stop"])},[...R[9]||(R[9]=[m("svg",{viewBox:"0 0 16 16",width:"16",height:"16",fill:"currentColor","aria-hidden":"true"},[m("circle",{cx:"8",cy:"3",r:"1.3"}),m("circle",{cx:"8",cy:"8",r:"1.3"}),m("circle",{cx:"8",cy:"13",r:"1.3"})],-1)])],8,Goe),m("button",{type:"button",class:"mgh-add",title:C(n)("workspace.newInGroup"),"aria-label":C(n)("workspace.newInGroup"),onClick:Ze(V=>l(F.workspace.id),["stop"])},"+",8,Yoe),b.value===F.workspace.id?(x(),E("div",{key:1,class:"kmenu wsmenu",onClick:R[0]||(R[0]=Ze(()=>{},["stop"]))},[m("button",{class:"kitem",onClick:Ze(V=>$(F.workspace),["stop"])},L(C(n)("sidebar.copyPath")),9,Xoe),m("button",{class:"kitem archive",onClick:Ze(V=>O(F.workspace.id),["stop"])},L(M.value===F.workspace.id?C(n)("sidebar.confirm"):C(n)("sidebar.delete")),9,Zoe)])):le("",!0)],10,Uoe),Ot(m("div",null,[F.sessions.length===0?(x(),E("div",Joe,L(C(n)("sidebar.noSessions")),1)):le("",!0),(x(!0),E(Ne,null,Qe(S(F.sessions,g(F.workspace.id),e.activeId),V=>(x(),E("div",{key:V.id,class:Ie(["srow",{cur:V.id===e.activeId}]),onClick:K=>r(V.id)},[m("div",eie,[m("div",{class:Ie(["t",{run:V.busy,aborted:V.status==="aborted"}])},L(V.title),3),m("div",tie,L(V.time),1)]),(e.attentionBySession[V.id]??0)>0?(x(),E("span",nie,L(e.attentionBySession[V.id]),1)):le("",!0),m("button",{type:"button",class:"kb",title:C(n)("sidebar.options"),onClick:Ze(K=>_(V.id),["stop"])},[...R[10]||(R[10]=[m("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[m("circle",{cx:"8",cy:"3",r:"1.3"}),m("circle",{cx:"8",cy:"8",r:"1.3"}),m("circle",{cx:"8",cy:"13",r:"1.3"})],-1)])],8,sie),y.value===V.id?(x(),E("div",{key:1,class:"kmenu",onClick:R[1]||(R[1]=Ze(()=>{},["stop"]))},[m("button",{class:"kitem",onClick:Ze(K=>I(V),["stop"])},L(C(n)("sidebar.rename")),9,oie),m("button",{class:"kitem archive",onClick:Ze(K=>A(V.id),["stop"])},L(k.value===V.id?C(n)("sidebar.archiveConfirm"):C(n)("sidebar.archive")),9,iie)])):le("",!0)],10,Qoe))),128)),!g(F.workspace.id)&&S(F.sessions,!1,e.activeId).length<F.sessions.length?(x(),E("button",{key:1,type:"button",class:"mshow-more",onClick:Ze(V=>w(F.workspace.id),["stop"])},L(C(n)("sidebar.showMore",{count:F.sessions.length-S(F.sessions,!1,e.activeId).length})),9,rie)):le("",!0)],512),[[Ho,!d(F.workspace.id)]])]))),128))])]),_:1},8,["model-value"]))}}),cie=wt(aie,[["__scopeId","data-v-cd656daf"]]),uie={class:"srow-main"},die={class:"srow-label"},fie={class:"srow-sub"},hie={class:"srow-main"},pie={class:"srow-label"},mie={class:"srow-val"},gie={class:"srow-main"},vie={class:"srow-label"},yie={class:"srow-sub"},kie=["aria-checked"],bie={class:"srow-main"},_ie={class:"srow-label"},wie={class:"srow-sub"},Sie=["aria-checked"],Cie={class:"srow-main"},xie={class:"srow-label"},Tie={class:"srow read-only"},Mie={class:"srow-main"},Aie={class:"srow-label"},Eie={class:"srow-sub"},Iie=["aria-label"],$ie={class:"srow read-only pref"},Nie={class:"srow-main"},Lie={class:"srow-label"},Oie=["aria-label"],Pie=["aria-pressed"],Rie=["aria-pressed"],Die={class:"srow read-only pref"},Bie={class:"srow-main"},Fie={class:"srow-label"},Hie=["aria-label"],Wie=["aria-pressed"],Uie=["aria-pressed"],qie=["aria-pressed"],jie={class:"srow read-only pref"},zie={class:"srow-main"},Vie={class:"srow-label"},Kie={class:"srow read-only pref"},Gie={class:"srow-main"},Yie={class:"srow-label"},Xie={class:"num-field"},Zie=["value","aria-label"],Jie={class:"srow-main"},Qie={class:"srow-label"},ere={class:"srow-sub"},tre=["aria-checked"],nre={class:"srow-main"},sre={class:"srow-label"},ore={class:"srow-main"},ire={class:"srow-label"},rre={key:2,class:"srow read-only"},lre={class:"srow-main"},are={class:"srow-label"},cre={class:"srow-val dim"},ure=Je({__name:"MobileSettingsSheet",props:{modelValue:{type:Boolean},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},theme:{default:"terminal"},colorScheme:{default:"system"},uiFontSize:{default:14},authReady:{type:Boolean,default:!1},betaToc:{type:Boolean},serverVersion:{default:""}},emits:["update:modelValue","pickModel","setThinking","togglePlan","toggleSwarm","setPermission","setTheme","setColorScheme","setUiFontSize","setBetaToc","login","logout"],setup(e,{emit:t}){const{t:n}=St(),s=e,o=t,i=["manual","auto","yolo"],r=H(()=>s.thinking??"high"),l=H(()=>s.planMode===!0),a=H(()=>s.swarmMode===!0),c=H(()=>{const k=s.status.permission;return k==="yolo"?"var(--err)":k==="auto"?"var(--warn)":"var(--faint)"}),u=H(()=>{const k=s.status.permission,v=n(k==="yolo"?"mobile.permYoloSub":k==="auto"?"mobile.permAutoSub":"mobile.permManualSub");return`${k} · ${v}`}),d=k=>`${Math.round(k/1e3)}k`,h=H(()=>s.status.ctxMax>0?Math.min(100,Math.max(0,Math.round(s.status.ctxUsed/s.status.ctxMax*100))):0),p=H(()=>s.status.ctxMax>0?`${d(s.status.ctxUsed)}/${d(s.status.ctxMax)}`:n("status.statusNone"));function f(){o("setThinking",r.value==="off"?"high":"off")}function g(){const k=i.indexOf(s.status.permission),v=i[(k+1)%i.length];o("setPermission",v)}function w(){o("pickModel"),o("update:modelValue",!1)}function S(){o("login"),o("update:modelValue",!1)}function y(){o("logout"),o("update:modelValue",!1)}return(k,v)=>(x(),Ke(p3,{"model-value":e.modelValue,title:C(n)("mobile.settingsTitle"),"onUpdate:modelValue":v[9]||(v[9]=_=>o("update:modelValue",_))},{default:Mn(()=>[m("button",{type:"button",class:"srow",onClick:w},[m("span",uie,[m("span",die,L(C(n)("status.statusModel")),1),m("span",fie,L(e.status.model),1)]),v[10]||(v[10]=m("span",{class:"chev"},"›",-1))]),m("button",{type:"button",class:"srow",onClick:f},[m("span",hie,[m("span",pie,L(C(n)("status.statusThinking")),1)]),m("span",mie,L(r.value==="off"?C(n)("status.planOff"):C(n)("status.planOn")),1),v[11]||(v[11]=m("span",{class:"chev"},"›",-1))]),m("button",{type:"button",class:"srow",onClick:v[0]||(v[0]=_=>o("togglePlan"))},[m("span",gie,[m("span",vie,L(C(n)("status.statusPlanMode")),1),m("span",yie,L(C(n)("mobile.planModeSub")),1)]),m("span",{class:Ie(["toggle",{on:l.value}]),role:"switch","aria-checked":l.value},null,10,kie)]),m("button",{type:"button",class:"srow",onClick:v[1]||(v[1]=_=>o("toggleSwarm"))},[m("span",bie,[m("span",_ie,L(C(n)("status.statusSwarmMode")),1),m("span",wie,L(C(n)("mobile.swarmModeSub")),1)]),m("span",{class:Ie(["toggle",{on:a.value}]),role:"switch","aria-checked":a.value},null,10,Sie)]),m("button",{type:"button",class:"srow",onClick:g},[m("span",Cie,[m("span",xie,L(C(n)("status.statusPermission")),1),m("span",{class:"srow-sub",style:Ft({color:c.value})},L(u.value),5)]),v[12]||(v[12]=m("span",{class:"chev"},"›",-1))]),m("div",Tie,[m("span",Mie,[m("span",Aie,L(C(n)("status.statusContext")),1),m("span",Eie,L(p.value),1)]),m("span",{class:"ctx-meter","aria-label":p.value},[m("i",{style:Ft({width:h.value+"%"})},null,4)],8,Iie)]),m("div",$ie,[m("span",Nie,[m("span",Lie,L(C(n)("theme.label")),1)]),m("div",{class:"seg",role:"group","aria-label":C(n)("theme.label")},[m("button",{type:"button",class:Ie(["seg-opt",{on:e.theme==="modern"}]),"aria-pressed":e.theme==="modern",onClick:v[2]||(v[2]=_=>o("setTheme","modern"))},L(C(n)("theme.modern")),11,Pie),m("button",{type:"button",class:Ie(["seg-opt",{on:e.theme==="kimi"}]),"aria-pressed":e.theme==="kimi",onClick:v[3]||(v[3]=_=>o("setTheme","kimi"))},L(C(n)("theme.kimi")),11,Rie)],8,Oie)]),m("div",Die,[m("span",Bie,[m("span",Fie,L(C(n)("theme.colorSchemeLabel")),1)]),m("div",{class:"seg",role:"group","aria-label":C(n)("theme.colorSchemeLabel")},[m("button",{type:"button",class:Ie(["seg-opt",{on:e.colorScheme==="light"}]),"aria-pressed":e.colorScheme==="light",onClick:v[4]||(v[4]=_=>o("setColorScheme","light"))},L(C(n)("theme.light")),11,Wie),m("button",{type:"button",class:Ie(["seg-opt",{on:e.colorScheme==="dark"}]),"aria-pressed":e.colorScheme==="dark",onClick:v[5]||(v[5]=_=>o("setColorScheme","dark"))},L(C(n)("theme.dark")),11,Uie),m("button",{type:"button",class:Ie(["seg-opt",{on:e.colorScheme==="system"}]),"aria-pressed":e.colorScheme==="system",onClick:v[6]||(v[6]=_=>o("setColorScheme","system"))},L(C(n)("theme.system")),11,qie)],8,Hie)]),m("div",jie,[m("span",zie,[m("span",Vie,L(C(n)("sidebar.language")),1)]),bt(f3)]),m("div",Kie,[m("span",Gie,[m("span",Yie,L(C(n)("settings.uiFontSize")),1)]),m("label",Xie,[m("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":C(n)("settings.uiFontSize"),onInput:v[7]||(v[7]=_=>o("setUiFontSize",Number(_.target.value)))},null,40,Zie),v[13]||(v[13]=m("span",{class:"num-unit"},"px",-1))])]),m("button",{type:"button",class:"srow",onClick:v[8]||(v[8]=_=>o("setBetaToc",!e.betaToc))},[m("span",Jie,[m("span",Qie,L(C(n)("settings.betaToc")),1),m("span",ere,L(C(n)("settings.betaTocHint")),1)]),m("span",{class:Ie(["toggle",{on:e.betaToc}]),role:"switch","aria-checked":e.betaToc},null,10,tre)]),e.authReady?(x(),E("button",{key:0,type:"button",class:"srow acct out",onClick:y},[m("span",nre,[m("span",sre,L(C(n)("sidebar.signOut")),1)])])):(x(),E("button",{key:1,type:"button",class:"srow acct in",onClick:S},[m("span",ore,[m("span",ire,L(C(n)("sidebar.signIn")),1)])])),e.serverVersion?(x(),E("div",rre,[m("span",lre,[m("span",are,L(C(n)("settings.serverVersion")),1)]),m("span",cre,L(e.serverVersion),1)])):le("",!0)]),_:1},8,["model-value","title"]))}}),dre=wt(ure,[["__scopeId","data-v-33721a82"]]),fre={class:"ob-backdrop"},hre=["aria-label"],pre=["aria-label"],mre={class:"ob-brand"},gre={class:"ob-title"},vre={class:"ob-sub"},yre={class:"ob-sec"},kre={class:"ob-label"},bre={class:"ob-seg",role:"group"},_re=["aria-pressed","onClick"],wre={class:"ob-sec"},Sre={class:"ob-label"},Cre={class:"ob-themes"},xre=["aria-pressed"],Tre={class:"ob-theme-name"},Mre={class:"ob-theme-desc"},Are=["aria-pressed"],Ere={class:"ob-theme-name"},Ire={class:"ob-theme-desc"},$re=Je({__name:"Onboarding",props:{theme:{}},emits:["setTheme","complete","skip"],setup(e,{emit:t}){const n=e,s=t,{t:o,locale:i}=St();function r(c){i.value!==c&&MC(c)}const l=se(n.theme);function a(){l.value!==n.theme&&s("setTheme",l.value),s("complete")}return(c,u)=>(x(),E("div",fre,[m("div",{class:"ob-card",role:"dialog","aria-modal":"true","aria-label":C(o)("onboarding.title")},[m("button",{type:"button",class:"ob-close","aria-label":C(o)("onboarding.skip"),onClick:u[0]||(u[0]=d=>s("skip"))},[...u[3]||(u[3]=[m("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","aria-hidden":"true"},[m("path",{d:"M4 4l8 8M12 4l-8 8"})],-1)])],8,pre),m("div",mre,[u[4]||(u[4]=m("svg",{class:"ob-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code"},[m("defs",null,[m("mask",{id:"obKimiEyes",maskUnits:"userSpaceOnUse"},[m("rect",{x:"0",y:"0",width:"32",height:"22",fill:"#fff"}),m("g",{class:"ob-eyes",fill:"#000"},[m("rect",{class:"ob-eye",x:"11.8",y:"7",width:"2.8",height:"8",rx:"1.4"}),m("rect",{class:"ob-eye",x:"17.4",y:"7",width:"2.8",height:"8",rx:"1.4"})])])]),m("rect",{x:"1",y:"1",width:"30",height:"20",rx:"6",fill:"var(--blue)",mask:"url(#obKimiEyes)"})],-1)),m("div",null,[m("div",gre,L(C(o)("onboarding.title")),1),m("div",vre,L(C(o)("onboarding.subtitle")),1)])]),m("section",yre,[m("div",kre,L(C(o)("onboarding.languageLabel")),1),m("div",bre,[(x(!0),E(Ne,null,Qe(C(TC),d=>(x(),E("button",{key:d.code,type:"button",class:Ie(["ob-seg-btn",{on:C(i)===d.code}]),"aria-pressed":C(i)===d.code,onClick:h=>r(d.code)},L(d.label),11,_re))),128))])]),m("section",wre,[m("div",Sre,L(C(o)("onboarding.themeLabel")),1),m("div",Cre,[m("button",{type:"button",class:Ie(["ob-theme",{on:l.value==="modern"}]),"aria-pressed":l.value==="modern",onClick:u[1]||(u[1]=d=>l.value="modern")},[u[5]||(u[5]=m("span",{class:"ob-theme-prev modern","aria-hidden":"true"},[m("span",{class:"bub u"}),m("span",{class:"bub a"})],-1)),m("span",Tre,L(C(o)("theme.modern")),1),m("span",Mre,L(C(o)("onboarding.modernDesc")),1)],10,xre),m("button",{type:"button",class:Ie(["ob-theme",{on:l.value==="kimi"}]),"aria-pressed":l.value==="kimi",onClick:u[2]||(u[2]=d=>l.value="kimi")},[u[6]||(u[6]=m("span",{class:"ob-theme-prev kimi","aria-hidden":"true"},[m("span",{class:"kb u"}),m("span",{class:"kb a"})],-1)),m("span",Ere,L(C(o)("theme.kimi")),1),m("span",Ire,L(C(o)("onboarding.kimiDesc")),1)],10,Are)])]),m("button",{type:"button",class:"ob-start",onClick:a},L(C(o)("onboarding.start")),1)],8,hre)]))}}),Nre=wt($re,[["__scopeId","data-v-0527a631"]]),Lre=["aria-label"],Ore={class:"gload-box"},Pre={class:"gload-text"},Rre=Je({__name:"GlobalLoading",setup(e){const{t}=St();return(n,s)=>(x(),E("div",{class:"gload",role:"status","aria-label":C(t)("app.connecting")},[m("div",Ore,[s[0]||(s[0]=kr('<svg class="gload-logo" viewBox="0 0 96 32" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" data-v-d8748888><path fill="currentColor" d="M35.767 31.329c0 .37.3.671.67.671h4.305c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.672-.671h-4.304c-.37 0-.671.3-.671.671z" data-v-d8748888></path><path fill="currentColor" d="M90.353 31.329c0 .37.3.671.67.671h4.305c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.672-.671h-4.304a.67.67 0 0 0-.671.671z" data-v-d8748888></path><path fill="currentColor" d="M73.256 0a.67.67 0 0 0-.652.512l-6.366 26.1c-.106.428-.607.428-.71 0L59.159.512A.67.67 0 0 0 58.511 0H47.725c-.37 0-.668.3-.668.671V31.33c0 .37.3.671.67.671h4.781c.37 0 .671-.292.671-.662V5.554c0-.515.604-.622.726-.127l6.358 26.06a.67.67 0 0 0 .653.513h9.931c.31 0 .58-.212.653-.512L77.855 5.43c.122-.495.726-.388.726.127v25.772c0 .37.3.671.671.671h4.78c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.671-.671z" data-v-d8748888></path><path fill="currentColor" d="M15.279 14.837 28.264 1.133A.671.671 0 0 0 27.777 0h-6.043a.67.67 0 0 0-.477.199L6.374 15.223c-.231.234-.573.025-.573-.35V.672c0-.37-.3-.671-.671-.671H.67a.67.67 0 0 0-.67.67V31.33c0 .37.3.671.671.671H5.13c.37 0 .671-.3.671-.671v-6.114a.5.5 0 0 1 .13-.35l4.594-4.69a.293.293 0 0 1 .386-.045l12.286 9.305c1.796 1.245 4.083 2.06 6.178 2.401a.645.645 0 0 0 .743-.648v-5.537a.7.7 0 0 0-.562-.677c-1.215-.262-2.565-.758-3.59-1.468L15.332 15.58c-.22-.152-.248-.544-.052-.744" data-v-d8748888></path></svg><div class="gload-bar" aria-hidden="true" data-v-d8748888><span class="gload-bar-fill" data-v-d8748888></span></div>',2)),m("div",Pre,L(C(t)("app.connecting")),1)])],8,Lre))}}),Dre=wt(Rre,[["__scopeId","data-v-d8748888"]]),Bre={class:"kap-root"},Fre={class:"kap-head"},Hre={class:"kap-count"},Wre={class:"kap-head-actions"},Ure={class:"kap-filters"},qre=["value"],jre={class:"kap-check"},zre={class:"kap-check"},Vre={class:"kap-view-toggle",role:"group"},Kre={key:0,class:"kap-empty"},Gre=["onClick"],Yre={class:"kap-ts"},Xre={class:"kap-label"},Zre={key:0,class:"kap-detail"},Jre={class:"kap-detail-actions"},Qre=["onClick"],ele={key:1,class:"kap-agg"},tle={class:"mono"},nle={class:"mono"},sle={class:"num"},ole={class:"num"},ile={key:0},rle={class:"mono"},lle={class:"num"},ale={class:"num"},cle={key:0},ule=Je({__name:"KapDebugView",emits:["close"],setup(e,{emit:t}){const n=t,s=se("all"),o=se(""),i=se(""),r=se(!1),l=se("timeline"),a=H(()=>(Bv.value,[...Vee()])),c=H(()=>{const M=new Set;for(const N of a.value)N.sessionId&&M.add(N.sessionId);return[...M].sort()});function u(M){return M.kind==="rest:error"||M.code!==void 0&&M.code!==0||M.eventType==="error"||M.eventType==="parse-error"}const d=H(()=>{const M=o.value.trim().toLowerCase();return a.value.filter(N=>!(s.value!=="all"&&N.source!==s.value||i.value&&N.sessionId!==i.value||r.value&&!u(N)||M&&!`${N.label} ${N.kind} ${N.eventType??""} ${N.sessionId??""} ${N.requestId??""}`.toLowerCase().includes(M)))}),h=H(()=>{const M=new Map;for(const N of d.value){if(N.kind!=="ws:in"&&N.kind!=="ws:out")continue;const D=N.kind==="ws:in"?"←":"→",$=`${D} ${N.eventType??"?"} @ ${N.sessionId??"-"}`,O=M.get($)??{key:$,sessionId:N.sessionId??"-",eventType:N.eventType??"?",dir:D,count:0};O.count++,N.seq!==void 0&&(O.lastSeq=N.seq),M.set($,O)}return[...M.values()].sort((N,D)=>D.count-N.count)}),p=H(()=>{const M=new Map;for(const N of d.value){if(N.source!=="rest"||N.kind==="rest:request")continue;const D=`${N.method??"?"} ${N.path??"?"}`,$=M.get(D)??{count:0,errors:0,totalMs:0,timed:0};$.count++,u(N)&&$.errors++,N.durationMs!==void 0&&($.totalMs+=N.durationMs,$.timed++),M.set(D,$)}return[...M.entries()].map(([N,D])=>({key:N,count:D.count,errors:D.errors,avgMs:D.timed>0?Math.round(D.totalMs/D.timed):0})).sort((N,D)=>D.count-N.count)}),f=se(null),g=se(!0),w=se(null),S=se(null);Ge(()=>d.value.length,async()=>{if(!g.value||l.value!=="timeline")return;await vt();const M=w.value;M&&(M.scrollTop=M.scrollHeight)});function y(M){f.value=f.value===M?null:M}function k(M){const N=new Date(M),D=($,O=2)=>String($).padStart(O,"0");return`${D(N.getHours())}:${D(N.getMinutes())}:${D(N.getSeconds())}.${D(N.getMilliseconds(),3)}`}function v(M){return JSON.stringify(M,null,2)}async function _(M){await xs(v(M))&&(S.value=M.id,setTimeout(()=>{S.value===M.id&&(S.value=null)},1500))}function I(){h3(d.value)}function A(M){return u(M)||M.source==="client"?"b-err":M.source==="rest"?"b-rest":M.kind==="ws:lifecycle"?"b-life":M.kind==="ws:out"?"b-out":"b-in"}function b(M){return M.source==="rest"?"REST":M.source==="client"?"APP":"WS"}return(M,N)=>(x(),E("section",Bre,[m("header",Fre,[N[11]||(N[11]=m("strong",null,"KAP debug",-1)),m("span",Hre,L(d.value.length)+"/"+L(a.value.length),1),m("div",Wre,[m("button",{type:"button",class:Ie({on:C(cc)}),onClick:N[0]||(N[0]=D=>cc.value=!C(cc))},L(C(cc)?"resume":"pause"),3),m("button",{type:"button",onClick:N[1]||(N[1]=D=>C(Kee)())},"clear"),m("button",{type:"button",onClick:N[2]||(N[2]=D=>I())},"export jsonl"),m("button",{type:"button",title:"Close window",onClick:N[3]||(N[3]=D=>n("close"))},"✕")])]),m("div",Ure,[Ot(m("select",{"onUpdate:modelValue":N[4]||(N[4]=D=>s.value=D),"aria-label":"Source filter"},[...N[12]||(N[12]=[m("option",{value:"all"},"rest + ws + app",-1),m("option",{value:"rest"},"rest",-1),m("option",{value:"ws"},"ws",-1),m("option",{value:"client"},"app errors",-1)])],512),[[nf,s.value]]),Ot(m("select",{"onUpdate:modelValue":N[5]||(N[5]=D=>i.value=D),"aria-label":"Session filter"},[N[13]||(N[13]=m("option",{value:""},"all sessions",-1)),(x(!0),E(Ne,null,Qe(c.value,D=>(x(),E("option",{key:D,value:D},L(D),9,qre))),128))],512),[[nf,i.value]]),Ot(m("input",{"onUpdate:modelValue":N[6]||(N[6]=D=>o.value=D),type:"text",placeholder:"filter (type / path / id)","aria-label":"Text filter"},null,512),[[An,o.value]]),m("label",jre,[Ot(m("input",{"onUpdate:modelValue":N[7]||(N[7]=D=>r.value=D),type:"checkbox"},null,512),[[tf,r.value]]),N[14]||(N[14]=yt(" errors",-1))]),m("label",zre,[Ot(m("input",{"onUpdate:modelValue":N[8]||(N[8]=D=>g.value=D),type:"checkbox"},null,512),[[tf,g.value]]),N[15]||(N[15]=yt(" follow",-1))]),m("div",Vre,[m("button",{type:"button",class:Ie({on:l.value==="timeline"}),onClick:N[9]||(N[9]=D=>l.value="timeline")},"timeline",2),m("button",{type:"button",class:Ie({on:l.value==="aggregate"}),onClick:N[10]||(N[10]=D=>l.value="aggregate")},"aggregate",2)])]),l.value==="timeline"?(x(),E("div",{key:0,ref_key:"listRef",ref:w,class:"kap-list"},[d.value.length===0?(x(),E("div",Kre," No trace entries yet. REST calls and WS frames will appear here. ")):le("",!0),(x(!0),E(Ne,null,Qe(d.value,D=>(x(),E("div",{key:D.id,class:"kap-row-wrap"},[m("button",{type:"button",class:Ie(["kap-row",{expanded:f.value===D.id}]),onClick:$=>y(D.id)},[m("span",Yre,L(k(D.ts)),1),m("span",{class:Ie(["kap-badge",A(D)])},L(b(D)),3),m("span",Xre,L(D.label),1)],10,Gre),f.value===D.id?(x(),E("div",Zre,[m("div",Jre,[m("button",{type:"button",onClick:$=>_(D)},L(S.value===D.id?"copied ✓":"copy json"),9,Qre)]),m("pre",null,L(v(D)),1)])):le("",!0)]))),128))],512)):(x(),E("div",ele,[N[20]||(N[20]=m("h4",null,"WS frames by session / type",-1)),m("table",null,[N[17]||(N[17]=m("thead",null,[m("tr",null,[m("th",null,"dir"),m("th",null,"type"),m("th",null,"session"),m("th",null,"count"),m("th",null,"last seq")])],-1)),m("tbody",null,[(x(!0),E(Ne,null,Qe(h.value,D=>(x(),E("tr",{key:D.key},[m("td",null,L(D.dir),1),m("td",tle,L(D.eventType),1),m("td",nle,L(D.sessionId),1),m("td",sle,L(D.count),1),m("td",ole,L(D.lastSeq??"—"),1)]))),128)),h.value.length===0?(x(),E("tr",ile,[...N[16]||(N[16]=[m("td",{colspan:"5",class:"kap-empty"},"no ws frames",-1)])])):le("",!0)])]),N[21]||(N[21]=m("h4",null,"REST by endpoint",-1)),m("table",null,[N[19]||(N[19]=m("thead",null,[m("tr",null,[m("th",null,"endpoint"),m("th",null,"count"),m("th",null,"errors"),m("th",null,"avg ms")])],-1)),m("tbody",null,[(x(!0),E(Ne,null,Qe(p.value,D=>(x(),E("tr",{key:D.key},[m("td",rle,L(D.key),1),m("td",lle,L(D.count),1),m("td",{class:Ie(["num",{err:D.errors>0}])},L(D.errors),3),m("td",ale,L(D.avgMs),1)]))),128)),p.value.length===0?(x(),E("tr",cle,[...N[18]||(N[18]=[m("td",{colspan:"4",class:"kap-empty"},"no rest calls",-1)])])):le("",!0)])])]))]))}}),dle=wt(ule,[["__scopeId","data-v-79eb55ae"]]),fle=["title"],hle=Je({__name:"DebugPanel",setup(e){const t=se(!1);let n=null,s=null,o=null;const i=["data-theme","data-color-scheme","data-accent"];function r(u){const d=document.documentElement,h=u.documentElement;for(const p of i){const f=d.getAttribute(p);f!==null?h.setAttribute(p,f):h.removeAttribute(p)}}function l(u){const d=u.document;d.title="KAP debug";const h=d.createElement("base");h.href=location.href,d.head.appendChild(h);for(const f of Array.from(document.querySelectorAll('style, link[rel="stylesheet"]')))d.head.appendChild(f.cloneNode(!0));r(d),d.body.style.margin="0";const p=d.createElement("div");return p.style.height="100vh",d.body.appendChild(p),p}function a(){o?.disconnect(),o=null;try{s?.unmount()}catch{}s=null,n=null,t.value=!1}function c(){if(n&&!n.closed){n.focus();return}const u=window.open("","kap-debug","popup=yes,width=1040,height=760");if(!u)return;n=u;const d=l(u),h=sf(dle,{onClose:()=>u.close()});h.mount(d),s=h,t.value=!0,o=new MutationObserver(()=>{n&&!n.closed&&r(n.document)}),o.observe(document.documentElement,{attributes:!0,attributeFilter:[...i]}),u.addEventListener("pagehide",a),u.addEventListener("beforeunload",a)}return tn(()=>{c()}),qs(()=>{n&&!n.closed&&n.close(),a()}),(u,d)=>(x(),E("button",{class:"kap-fab",type:"button",title:t.value?"Focus KAP debug window":"Open KAP debug window",onClick:c}," KAP ",8,fle))}}),ple=wt(hle,[["__scopeId","data-v-0a50ee88"]]);function m3(e){return{inputTokens:e.input_tokens,outputTokens:e.output_tokens,cacheReadTokens:e.cache_read_tokens,cacheCreationTokens:e.cache_creation_tokens,totalCostUsd:e.total_cost_usd,contextTokens:e.context_tokens,contextLimit:e.context_limit,turnCount:e.turn_count}}function u1(e){switch(e){case"idle":return"idle";case"running":return"running";case"awaiting_approval":return"awaitingApproval";case"awaiting_question":return"awaitingQuestion";case"aborted":return"aborted"}}function mle(e){switch(e){case"idle":return"idle";case"running":return"running";case"awaitingApproval":return"awaiting_approval";case"awaitingQuestion":return"awaiting_question";case"aborted":return"aborted"}}function ti(e){return{id:e.id,title:e.title,createdAt:e.created_at,updatedAt:e.updated_at,status:u1(e.status),archived:e.archived??!1,currentPromptId:e.current_prompt_id,lastPrompt:e.last_prompt,cwd:e.metadata.cwd,model:e.agent_config.model,usage:m3(e.usage),messageCount:e.message_count,lastSeq:e.last_seq,workspaceId:e.workspace_id,parentSessionId:typeof e.metadata.parent_session_id=="string"?e.metadata.parent_session_id:void 0}}function Of(e){return{id:e.id,root:e.root,name:e.name,isGitRepo:e.is_git_repo,branch:e.branch??void 0,lastOpenedAt:e.last_opened_at,sessionCount:e.session_count}}function Yw(e){return e.kind==="base64"?{kind:"base64",mediaType:e.media_type,data:e.data}:e.kind==="file"?{kind:"file",fileId:e.file_id}:{kind:"url",url:e.url}}function Fv(e){switch(e.type){case"text":return{type:"text",text:e.text};case"tool_use":return{type:"toolUse",toolCallId:e.tool_call_id,toolName:e.tool_name,input:e.input};case"tool_result":return{type:"toolResult",toolCallId:e.tool_call_id,output:e.output,isError:e.is_error};case"image":return{type:"image",source:Yw(e.source)};case"video":return{type:"video",source:Yw(e.source)};case"file":return{type:"file",fileId:e.file_id,name:e.name,mediaType:e.media_type,size:e.size};case"thinking":return{type:"thinking",thinking:e.thinking,signature:e.signature};default:return{type:"unknown",raw:e}}}function d1(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map(Fv),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function gle(e){switch(e.type){case"text":return{type:"text",text:e.text};case"toolUse":return{type:"tool_use",tool_call_id:e.toolCallId,tool_name:e.toolName,input:e.input};case"toolResult":return{type:"tool_result",tool_call_id:e.toolCallId,output:e.output,is_error:e.isError};case"image":case"video":{const t=e.source;let n;return t.kind==="base64"?n={kind:"base64",media_type:t.mediaType,data:t.data}:t.kind==="file"?n={kind:"file",file_id:t.fileId}:n={kind:"url",url:t.url},{type:e.type,source:n}}case"file":return{type:"file",file_id:e.fileId,name:e.name,media_type:e.mediaType,size:e.size};case"thinking":return{type:"thinking",thinking:e.thinking,signature:e.signature};case"unknown":return e.raw}}function vle(e){return{content:e.content.map(gle),metadata:e.metadata,agent_id:e.agentId,model:e.model,thinking:e.thinking,permission_mode:e.permissionMode,plan_mode:e.planMode,swarm_mode:e.swarmMode,goal_objective:e.goalObjective,goal_control:e.goalControl}}function yle(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function g3(e){return{approvalId:e.approval_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,toolName:e.tool_name,action:e.action,display:e.tool_input_display??e.display,expiresAt:e.expires_at,createdAt:e.created_at}}function kle(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function ble(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map(kle),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function v3(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(ble),expiresAt:e.expires_at,createdAt:e.created_at}}function _le(e){switch(e.kind){case"single":return{kind:"single",option_id:e.optionId};case"multi":return{kind:"multi",option_ids:e.optionIds};case"other":return{kind:"other",text:e.text};case"multiWithOther":return{kind:"multi_with_other",option_ids:e.optionIds,other_text:e.otherText};case"skipped":return{kind:"skipped"}}}function wle(e){const t={};for(const[n,s]of Object.entries(e.answers))t[n]=_le(s);return{answers:t,method:e.method,note:e.note}}function f1(e){return{id:e.id,sessionId:e.session_id,kind:e.kind,description:e.description,status:e.status,command:e.command,createdAt:e.created_at,startedAt:e.started_at,completedAt:e.completed_at,outputPreview:e.output_preview,outputBytes:e.output_bytes,subagentPhase:e.subagent_phase,subagentType:e.subagent_type,parentToolCallId:e.parent_tool_call_id,suspendedReason:e.suspended_reason,swarmIndex:e.swarm_index}}function Xw(e){return{path:e.path,name:e.name,kind:e.kind,size:e.size,modifiedAt:e.modified_at,etag:e.etag,mime:e.mime,languageId:e.language_id,isBinary:e.is_binary,isSymlinkTo:e.is_symlink_to,gitStatus:e.git_status,childCount:e.child_count}}function tr(e,t){const n=e[t];return typeof n=="string"?n:void 0}function Dl(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function ko(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function Sle(e){if(!e||typeof e!="object")return null;const t=e,n=tr(t,"status");if(n!=="active"&&n!=="paused"&&n!=="blocked"&&n!=="complete")return null;const s=t.budget,o=s&&typeof s=="object"?s:{};return{goalId:tr(t,"goalId")??tr(t,"goal_id")??"goal",objective:tr(t,"objective")??"",completionCriterion:tr(t,"completionCriterion")??tr(t,"completion_criterion"),status:n,turnsUsed:Dl(t,"turnsUsed")??Dl(t,"turns_used")??0,tokensUsed:Dl(t,"tokensUsed")??Dl(t,"tokens_used")??0,wallClockMs:Dl(t,"wallClockMs")??Dl(t,"wall_clock_ms")??0,terminalReason:tr(t,"terminalReason")??tr(t,"terminal_reason"),budget:{tokenBudget:ko(o,"tokenBudget")??ko(o,"token_budget"),remainingTokens:ko(o,"remainingTokens")??ko(o,"remaining_tokens"),turnBudget:ko(o,"turnBudget")??ko(o,"turn_budget"),remainingTurns:ko(o,"remainingTurns")??ko(o,"remaining_turns"),wallClockBudgetMs:ko(o,"wallClockBudgetMs")??ko(o,"wall_clock_budget_ms"),remainingWallClockMs:ko(o,"remainingWallClockMs")??ko(o,"remaining_wall_clock_ms"),overBudget:o.overBudget===!0||o.over_budget===!0}}}function Cle(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:ti(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:ti(t.payload.session),changedFields:t.payload.changed_fields};case"event.session.deleted":return{type:"sessionDeleted",sessionId:t.session_id};case"event.workspace.created":return{type:"workspaceCreated",workspace:Of(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:Of(t.payload.workspace)};case"event.workspace.deleted":return{type:"workspaceDeleted",workspaceId:t.payload.workspace_id,root:t.payload.root};case"event.session.status_changed":return{type:"sessionStatusChanged",sessionId:t.session_id,status:u1(t.payload.status),previousStatus:u1(t.payload.previous_status),currentPromptId:t.payload.current_prompt_id};case"event.session.usage_updated":return{type:"sessionUsageUpdated",sessionId:t.session_id,usage:m3(t.payload.usage)};case"event.session.history_compacted":return{type:"historyCompacted",sessionId:t.session_id,beforeSeq:t.payload.before_seq,reason:t.payload.reason,summaryMessageId:t.payload.summary_message_id};case"event.goal.updated":{const n=Sle(t.payload.snapshot??null);return{type:"goalUpdated",sessionId:t.session_id,goal:n?.status==="complete"?null:n}}case"event.message.created":return{type:"messageCreated",message:d1(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map(Fv),status:t.payload.status};case"event.assistant.delta":return{type:"assistantDelta",sessionId:t.session_id,messageId:t.payload.message_id,contentIndex:t.payload.content_index,delta:t.payload.delta};case"event.assistant.tool_use_started":case"event.assistant.tool_use_delta":case"event.assistant.tool_use_completed":case"event.assistant.completed":case"event.tool.started":return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.tool.output":return{type:"toolOutput",sessionId:t.session_id,toolCallId:t.payload.tool_call_id,outputChunk:t.payload.chunk,stream:t.payload.stream};case"event.tool.progress":return typeof t.payload.message=="string"&&t.payload.message.length>0?{type:"toolOutput",sessionId:t.session_id,toolCallId:t.payload.tool_call_id,outputChunk:t.payload.message,stream:"stdout"}:{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.tool.completed":return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.approval.requested":return{type:"approvalRequested",sessionId:t.session_id,approval:g3(t.payload)};case"event.approval.resolved":return{type:"approvalResolved",sessionId:t.session_id,approvalId:t.payload.approval_id,decision:t.payload.decision,resolvedAt:t.payload.resolved_at};case"event.approval.expired":return{type:"approvalExpired",sessionId:t.session_id,approvalId:t.payload.approval_id};case"event.question.requested":return{type:"questionRequested",sessionId:t.session_id,question:v3(t.payload)};case"event.question.answered":return{type:"questionAnswered",sessionId:t.session_id,questionId:t.payload.question_id,resolvedAt:t.payload.resolved_at};case"event.question.dismissed":return{type:"questionDismissed",sessionId:t.session_id,questionId:t.payload.question_id,dismissedAt:t.payload.dismissed_at};case"event.question.expired":return{type:"questionExpired",sessionId:t.session_id,questionId:t.payload.question_id};case"event.task.created":return{type:"taskCreated",sessionId:t.session_id,task:f1(t.payload.task)};case"event.task.progress":return{type:"taskProgress",sessionId:t.session_id,taskId:t.payload.task_id,outputChunk:t.payload.output_chunk,stream:t.payload.stream};case"event.task.completed":return{type:"taskCompleted",sessionId:t.session_id,taskId:t.payload.task_id,status:t.payload.status,outputPreview:t.payload.output_preview,outputBytes:t.payload.output_bytes};case"event.config.changed":return{type:"configChanged",changedFields:t.payload.changed_fields,config:h1(t.payload.config)};default:return{type:"unknown",raw:e}}}function xle(e){return{id:e.model,provider:e.provider,model:e.model,displayName:e.display_name,maxContextSize:e.max_context_size,capabilities:e.capabilities}}function Um(e){return{id:e.id,type:e.type,baseUrl:e.base_url,defaultModel:e.default_model,hasApiKey:e.has_api_key,status:e.status,models:e.models}}function h1(e){const t={};for(const[n,s]of Object.entries(e.providers))t[n]={type:s.type,baseUrl:s.base_url,defaultModel:s.default_model,hasApiKey:s.has_api_key};return{providers:t,defaultProvider:e.default_provider,defaultModel:e.default_model,models:e.models,thinking:e.thinking,planMode:e.plan_mode,yolo:e.yolo,defaultThinking:e.default_thinking,defaultPermissionMode:e.default_permission_mode,defaultPlanMode:e.default_plan_mode,permission:e.permission,hooks:e.hooks,services:e.services,mergeAllAvailableSkills:e.merge_all_available_skills,extraSkillDirs:e.extra_skill_dirs,loopControl:e.loop_control,background:e.background,experimental:e.experimental,telemetry:e.telemetry,raw:e.raw}}function Tle(e){return e.session_id}function Mle(e){return e.seq}const Ale="main",Ele=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.use","tool.call.started","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.completed"]);function rr(e="msg_"){const t=Date.now().toString(36).padStart(10,"0"),n=Math.random().toString(36).slice(2,12).padEnd(10,"0");return`${e}${t}${n}`}function Ile(e){if(!e||typeof e!="object")return{input:0,output:0,cacheRead:0,cacheCreate:0};const t=e;return{input:t.inputOther??t.input_tokens??0,output:t.output??t.output_tokens??0,cacheRead:t.inputCacheRead??t.cache_read_input_tokens??0,cacheCreate:t.inputCacheCreation??t.cache_creation_input_tokens??0}}function Zw(){return{turnPromptId:new Map,currentPromptId:void 0,currentAssistantMsgId:void 0,turnTextLen:0,turnThinkLen:0,toolStartTimes:new Map,totalInput:0,totalOutput:0,totalCacheRead:0,totalCacheCreate:0,contextTokens:0,contextLimit:0,turnCount:0,model:"",messages:[],subagentMeta:new Map}}function hs(e,t){const n=e[t];return typeof n=="string"?n:void 0}function Kr(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function bo(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function $le(e){if(!e||typeof e!="object")return null;const t=e,n=t.budget,s=n&&typeof n=="object"?n:{},o=hs(t,"status");if(o!=="active"&&o!=="paused"&&o!=="blocked"&&o!=="complete")return null;const i=hs(t,"goalId")??hs(t,"goal_id")??"goal",r=hs(t,"objective")??"";return{goalId:i,objective:r,completionCriterion:hs(t,"completionCriterion")??hs(t,"completion_criterion"),status:o,turnsUsed:Kr(t,"turnsUsed")??Kr(t,"turns_used")??0,tokensUsed:Kr(t,"tokensUsed")??Kr(t,"tokens_used")??0,wallClockMs:Kr(t,"wallClockMs")??Kr(t,"wall_clock_ms")??0,terminalReason:hs(t,"terminalReason")??hs(t,"terminal_reason"),budget:{tokenBudget:bo(s,"tokenBudget")??bo(s,"token_budget"),remainingTokens:bo(s,"remainingTokens")??bo(s,"remaining_tokens"),turnBudget:bo(s,"turnBudget")??bo(s,"turn_budget"),remainingTurns:bo(s,"remainingTurns")??bo(s,"remaining_turns"),wallClockBudgetMs:bo(s,"wallClockBudgetMs")??bo(s,"wall_clock_budget_ms"),remainingWallClockMs:bo(s,"remainingWallClockMs")??bo(s,"remaining_wall_clock_ms"),overBudget:s.overBudget===!0||s.over_budget===!0}}}function uc(e,t,n,s){if(typeof n!="string"||n.length===0)return null;const i={...e.subagentMeta.get(n)??{id:n,sessionId:t,kind:"subagent",description:"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued"},...s,id:n,sessionId:t,kind:"subagent"};return e.subagentMeta.set(n,i),i}function Nle(e){if(e==null)return"";try{const t=typeof e=="string"?e:JSON.stringify(e);return t.length>120?`${t.slice(0,117)}...`:t}catch{return""}}function Lle(e,t){if(e==="turn.step.started")return"Started a step";if(e==="tool.use"||e==="tool.call.started"){const n=hs(t,"name")??hs(t,"toolName")??"tool",s=Nle(t.args??t.input);return s?`Calling ${n}: ${s}`:`Calling ${n}`}if(e==="tool.progress"){const n=t.update;if(n&&typeof n=="object"){const o=hs(n,"text");if(o)return o;const i=hs(n,"message");if(i)return i}const s=hs(t,"message");if(s)return s}return e==="tool.result"?`Finished ${hs(t,"name")??hs(t,"toolName")??hs(t,"toolCallId")??"tool"}`:null}function Ole(e,t,n,s,o,i){if(i.has(n)&&s==="turn.step.started")return[];const r=Lle(s,o);if(r===null||r.length===0)return[];const l=e.subagentMeta.get(n),a=uc(e,t,n,{status:"running",subagentPhase:"working",startedAt:l?.startedAt??new Date().toISOString()}),c=[];return a&&c.push({type:"taskCreated",sessionId:t,task:a}),c.push({type:"taskProgress",sessionId:t,taskId:n,outputChunk:r,stream:"stdout"}),c}function md(e){return{...e,content:e.content.map(t=>({...t}))}}function Jw(e,t,n){const s={id:rr("msg_"),sessionId:t,role:"assistant",content:[],createdAt:new Date().toISOString(),promptId:n};return e.messages.push(s),s}function Ple(e,t,n,s,o,i){const r={id:s,sessionId:t,role:"user",content:o,createdAt:i,promptId:n};return e.messages.push(r),r}function Rle(e){return Array.isArray(e)?e.map(t=>Fv(t)):[]}function Qw(e,t,n,s){const o=e.messages.find(r=>r.id===t);if(!o)return-1;const i=o.content.at(-1);return i&&i.type===n?(n==="text"?i.text+=s:i.thinking+=s,o.content.length-1):(o.content.push(n==="text"?{type:"text",text:s}:{type:"thinking",thinking:s}),o.content.length-1)}function Dle(e,t,n,s,o,i){const r=e.messages.find(l=>l.id===t);r&&r.content.push({type:"toolUse",toolCallId:n,toolName:s,input:o,outputLines:i})}function Ble(e){const t=e.update,n=t&&typeof t=="object"?t:null,o=(n?.stream??n?.kind??e.stream)==="stderr"?"stderr":"stdout",i=typeof n?.text=="string"&&n.text||typeof n?.message=="string"&&n.message||typeof e.chunk=="string"&&e.chunk||typeof e.output=="string"&&e.output||typeof e.message=="string"&&e.message||"";return i.length>0?{outputChunk:i,stream:o}:null}function e2(e,t){e.messages.find(n=>n.id===t)}function Fle(e,t,n,s,o,i){const r={id:rr("msg_"),sessionId:t,role:"tool",content:[{type:"toolResult",toolCallId:n,output:s,isError:o}],createdAt:new Date().toISOString(),promptId:i};return e.messages.push(r),r}function qm(e,t){return e.messages.find(n=>n.id===t)}function t2(e){return{inputTokens:e.totalInput,outputTokens:e.totalOutput,cacheReadTokens:e.totalCacheRead,cacheCreationTokens:e.totalCacheCreate,totalCostUsd:0,contextTokens:e.contextTokens,contextLimit:e.contextLimit,turnCount:e.turnCount}}function Hle(){const e=new Map,t=new Set;function n(u){let d=e.get(u);return d||(d=Zw(),e.set(u,d)),d}function s(u){e.set(u,Zw())}function o(u){t.add(u)}function i(u,d){const h=n(u);h.currentPromptId=d}function r(u,d){s(u);const h=n(u),p=d.promptId??rr("pr_");h.currentPromptId=p,h.turnPromptId.set(d.turnId,p);const f=Jw(h,u,p);d.thinkingText.length>0&&f.content.push({type:"thinking",thinking:d.thinkingText}),d.assistantText.length>0&&f.content.push({type:"text",text:d.assistantText});for(const g of d.runningTools){const w=typeof g.lastProgress?.text=="string"&&g.lastProgress.text.length>0?[g.lastProgress.text]:void 0;f.content.push({type:"toolUse",toolCallId:g.toolCallId,toolName:g.name,input:g.args??{},outputLines:w}),h.toolStartTimes.set(g.toolCallId,Date.now())}return h.currentAssistantMsgId=f.id,h.turnTextLen=d.assistantText.length,h.turnThinkLen=d.thinkingText.length,[{type:"sessionStatusChanged",sessionId:u,status:"running",previousStatus:"idle",currentPromptId:p},{type:"messageCreated",message:md(f)}]}function l(u,d,h,p){try{return c(u,d,h,p)}catch(f){return console.error("[agentProjector] Error projecting event:",u,f instanceof Error?f.message:f),[]}}function a(u,d){return d===void 0?"append":d<u?"skip":d>u?"gap":"append"}function c(u,d,h,p){const f=n(h),g=d,w=[],S=g?.agentId;if(typeof S=="string"&&S!==Ale){const y=t.has(S);if(y&&(u==="thinking.delta"||u==="assistant.delta")){const k=g?.delta??"";return k?[{type:"agentDelta",sessionId:h,agentId:S,delta:{[u==="thinking.delta"?"thinking":"text"]:k}}]:[]}if(y&&u==="turn.ended")return[{type:"agentTurnEnded",sessionId:h,agentId:S,reason:g?.reason}];if(Ele.has(u))return Ole(f,h,S,u,g??{},t)}switch(u){case"session.meta.updated":{const y=g?.patch?.title??g?.title,k=g?.patch?.lastPrompt,v={};typeof y=="string"&&y.length>0&&(v.title=y),typeof k=="string"&&(v.lastPrompt=k),(v.title!==void 0||v.lastPrompt!==void 0)&&w.push({type:"sessionMetaUpdated",sessionId:h,...v});break}case"prompt.submitted":{const y=g?.promptId,k=g?.userMessageId;if(!y||!k)break;const v=Rle(g?.content);if(v.length===0)break;f.currentPromptId=y;const _=Ple(f,h,y,k,v,typeof g?.createdAt=="string"?g.createdAt:new Date().toISOString());w.push({type:"messageCreated",message:md(_)});break}case"turn.started":{const y=g?.turnId,k=f.currentPromptId??rr("pr_");f.currentPromptId=k,y!==void 0&&f.turnPromptId.set(y,k),f.turnTextLen=0,f.turnThinkLen=0,w.push({type:"sessionStatusChanged",sessionId:h,status:"running",previousStatus:"idle",currentPromptId:k});break}case"turn.step.started":{const y=g?.turnId;let k=f.turnPromptId.get(y)??f.currentPromptId;k||(k=rr("pr_"),f.currentPromptId=k,y!==void 0&&f.turnPromptId.set(y,k));const v=Jw(f,h,k);f.currentAssistantMsgId=v.id,w.push({type:"messageCreated",message:md(v)});break}case"thinking.delta":{const y=f.currentAssistantMsgId;if(!y)break;const k=g?.delta??"";if(!k)break;p?.offset===0&&f.turnThinkLen>0&&(f.turnThinkLen=0);const v=a(f.turnThinkLen,p?.offset);if(v==="skip")break;if(v==="gap"){w.push({type:"historyCompacted",sessionId:h,beforeSeq:0,reason:"delta_gap"});break}const _=Qw(f,y,"thinking",k);if(_<0)break;f.turnThinkLen+=k.length,w.push({type:"assistantDelta",sessionId:h,messageId:y,contentIndex:_,delta:{thinking:k}});break}case"assistant.delta":{const y=f.currentAssistantMsgId;if(!y)break;const k=g?.delta??"";if(!k)break;p?.offset===0&&f.turnTextLen>0&&(f.turnTextLen=0);const v=a(f.turnTextLen,p?.offset);if(v==="skip")break;if(v==="gap"){w.push({type:"historyCompacted",sessionId:h,beforeSeq:0,reason:"delta_gap"});break}const _=Qw(f,y,"text",k);if(_<0)break;f.turnTextLen+=k.length,w.push({type:"assistantDelta",sessionId:h,messageId:y,contentIndex:_,delta:{text:k}});break}case"tool.use":case"tool.call.started":{const y=f.currentAssistantMsgId,k=g?.turnId,v=f.turnPromptId.get(k)??f.currentPromptId;if(!y||!v)break;const _=g?.toolCallId,I=g?.name??g?.toolName??"",A=g?.args??g?.input??{};Dle(f,y,_,I,A);const b=qm(f,y);b&&b.content.length-1,f.toolStartTimes.set(_,Date.now()),b&&w.push({type:"messageUpdated",sessionId:h,messageId:y,content:b.content.map(M=>({...M})),status:"pending"});break}case"tool.call.delta":break;case"tool.progress":{const y=g?.toolCallId,k=Ble(g??{});y&&k&&w.push({type:"toolOutput",sessionId:h,toolCallId:y,outputChunk:k.outputChunk,stream:k.stream});break}case"tool.result":{const y=g?.turnId;let k=f.turnPromptId.get(y)??f.currentPromptId;k||(k=rr("pr_"),f.currentPromptId=k,y!==void 0&&f.turnPromptId.set(y,k));const v=g?.toolCallId,_=g?.output,I=g?.isError??!1;f.toolStartTimes.get(v)??Date.now(),f.toolStartTimes.delete(v);const A=Fle(f,h,v,_,I,k);w.push({type:"messageCreated",message:md(A)}),f.currentAssistantMsgId=void 0;break}case"turn.step.completed":{const y=f.currentAssistantMsgId,k=Ile(g?.usage);if(f.totalInput+=k.input,f.totalOutput+=k.output,f.totalCacheRead+=k.cacheRead,f.totalCacheCreate+=k.cacheCreate,y){e2(f,y);const v=qm(f,y);v&&w.push({type:"messageUpdated",sessionId:h,messageId:y,content:v.content.map(_=>({..._})),status:"completed"})}break}case"agent.status.updated":{g?.model&&(f.model=g.model),g?.contextTokens!==void 0&&(f.contextTokens=g.contextTokens),g?.maxContextTokens!==void 0&&(f.contextLimit=g.maxContextTokens),w.push({type:"sessionUsageUpdated",sessionId:h,usage:t2(f),model:f.model||void 0,swarmMode:g?.swarmMode===!0?!0:g?.swarmMode===!1?!1:void 0,planMode:g?.planMode===!0?!0:g?.planMode===!1?!1:void 0});break}case"turn.ended":{const y=f.currentAssistantMsgId,k=g?.reason??"completed",v=Kr(g??{},"durationMs");if(y){e2(f,y);const A=qm(f,y);A&&w.push({type:"messageUpdated",sessionId:h,messageId:y,content:A.content.map(b=>({...b})),status:k==="failed"||k==="filtered"?"error":"completed",durationMs:v})}f.turnCount++;const _=t2(f);w.push({type:"sessionUsageUpdated",sessionId:h,usage:_});const I=k==="cancelled"||k==="failed"||k==="filtered"?"aborted":"idle";w.push({type:"sessionStatusChanged",sessionId:h,status:I,previousStatus:"running"}),f.currentAssistantMsgId=void 0,f.currentPromptId=void 0,f.turnTextLen=0,f.turnThinkLen=0;break}case"prompt.completed":break;case"turn.step.retrying":case"turn.step.interrupted":{f.currentAssistantMsgId=void 0;break}case"subagent.spawned":{const k={id:typeof g?.subagentId=="string"&&g.subagentId.length>0?g.subagentId:rr("task_"),sessionId:h,kind:"subagent",description:typeof g?.description=="string"?g.description:g?.subagentName??"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued",subagentType:typeof g?.subagentName=="string"?g.subagentName:void 0,parentToolCallId:typeof g?.parentToolCallId=="string"?g.parentToolCallId:void 0,swarmIndex:typeof g?.swarmIndex=="number"?g.swarmIndex:void 0};f.subagentMeta.set(k.id,k),w.push({type:"taskCreated",sessionId:h,task:k});break}case"subagent.started":{const y=uc(f,h,g?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString()});y&&w.push({type:"taskCreated",sessionId:h,task:y});break}case"subagent.suspended":{const y=uc(f,h,g?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof g?.reason=="string"?g.reason:void 0});y&&w.push({type:"taskCreated",sessionId:h,task:y});break}case"subagent.completed":{const y=typeof g?.resultSummary=="string"?g.resultSummary:void 0,k=uc(f,h,g?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),outputPreview:y});k&&w.push({type:"taskCreated",sessionId:h,task:k}),w.push({type:"taskCompleted",sessionId:h,taskId:g?.subagentId??"",status:"completed",outputPreview:y});break}case"subagent.failed":{const y=typeof g?.error=="string"?g.error:void 0,k=uc(f,h,g?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),outputPreview:y});k&&w.push({type:"taskCreated",sessionId:h,task:k}),w.push({type:"taskCompleted",sessionId:h,taskId:g?.subagentId??"",status:"failed",outputPreview:y});break}case"error":{w.push({type:"unknown",raw:{_agentError:!0,code:g?.code,message:g?.message}});break}case"warning":{w.push({type:"unknown",raw:{_agentWarning:!0,message:g?.message}});break}case"background.task.started":{const y=g?.info??{},k=typeof y.startedAt=="number"?new Date(y.startedAt).toISOString():void 0,v=typeof y.taskId=="string"?y.taskId:typeof y.taskId=="number"?String(y.taskId):rr("task_"),_=typeof y.description=="string"?y.description:typeof y.command=="string"?y.command:$n.global.t("tasks.defaultDescription"),I=typeof y.command=="string"?y.command:void 0;w.push({type:"taskCreated",sessionId:h,task:{id:v,sessionId:h,kind:"bash",description:_,command:I,status:"running",createdAt:k??new Date().toISOString(),startedAt:k,outputPreview:I!==void 0?`$ ${I}`:void 0}});break}case"background.task.terminated":{const y=g?.info??{},k=y.status==="failed"||typeof y.exitCode=="number"&&y.exitCode!==0;w.push({type:"taskCompleted",sessionId:h,taskId:typeof y.taskId=="string"?y.taskId:typeof y.taskId=="number"?String(y.taskId):"",status:k?"failed":"completed"});break}case"compaction.completed":{const y=g?.result??{};w.push({type:"compactionCompleted",sessionId:h,tokensBefore:typeof y.tokensBefore=="number"?y.tokensBefore:void 0,tokensAfter:typeof y.tokensAfter=="number"?y.tokensAfter:void 0,summary:typeof y.summary=="string"?y.summary:void 0}),w.push({type:"historyCompacted",sessionId:h,beforeSeq:0,reason:"auto_compact"});break}case"compaction.started":{w.push({type:"compactionStarted",sessionId:h,trigger:g?.trigger==="manual"?"manual":"auto",instruction:typeof g?.instruction=="string"?g.instruction:void 0});break}case"compaction.cancelled":{w.push({type:"compactionCancelled",sessionId:h});break}case"goal.updated":{const y=$le(g?.snapshot??null);w.push({type:"goalUpdated",sessionId:h,goal:y?.status==="complete"?null:y});break}}return w}return{project:l,bindNextPromptId:i,seedInFlight:r,reset:s,markSideChannelAgent:o}}const Wle=new Set(["server_hello","ack","ping","resync_required","error","pong"]),n2=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.call.started","tool.use","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.submitted","prompt.completed","session.meta.updated","compaction.started","compaction.completed","compaction.cancelled","goal.updated","error","warning","subagent.spawned","subagent.started","subagent.suspended","subagent.completed","subagent.failed","background.task.started","background.task.terminated"]),Ule=new Set(["session.created","session.updated","session.deleted","session.status_changed","session.usage_updated","session.history_compacted","message.created","message.updated","approval.requested","approval.resolved","approval.expired","question.requested","question.answered","question.dismissed","question.expired","task.created","task.progress","task.completed","assistant.tool_use_started","assistant.tool_use_delta","assistant.tool_use_completed","assistant.completed","tool.started","tool.output","tool.completed"]),qle=new Set(["assistant.delta","thinking.delta"]);function jle(e,t){if(Wle.has(e))return{route:"ignore"};const n=e.startsWith("event."),s=n?e.slice(6):e;return qle.has(s)?zle(t)?{route:"agent",agentType:s}:{route:"protocol"}:n?Ule.has(s)?{route:"protocol"}:n2.has(s)?{route:"agent",agentType:s}:{route:"protocol"}:n2.has(s)?{route:"agent",agentType:s}:{route:"agent",agentType:s}}function zle(e){if(!e||typeof e!="object")return!1;const t=e;return"message_id"in t||"content_index"in t?!1:typeof t.delta=="string"}class p1 extends Error{code;requestId;details;constructor(t){super(t.msg),this.name="DaemonApiError",this.code=t.code,this.requestId=t.requestId,this.details=t.details}}class dc extends Error{cause;method;path;url;requestId;phase;timeoutMs;status;statusText;contentType;bodyPreview;constructor(t){super(t.message),this.name="DaemonNetworkError",this.cause=t.cause,this.method=t.method,this.path=t.path,this.url=t.url,this.requestId=t.requestId,this.phase=t.phase,this.timeoutMs=t.timeoutMs,this.status=t.status,this.statusText=t.statusText,this.contentType=t.contentType,this.bodyPreview=t.bodyPreview}}function du(e){return e instanceof p1||typeof e=="object"&&e!==null&&e.name==="DaemonApiError"&&typeof e.code=="number"}function y3(e){return e instanceof dc||typeof e=="object"&&e!==null&&e.name==="DaemonNetworkError"&&typeof e.method=="string"&&typeof e.path=="string"}const fc=3e4,k3="0123456789ABCDEFGHJKMNPQRSTVWXYZ",s2=500;function o2(){try{return AbortSignal.timeout(fc)}catch{return}}function Vle(e,t){let n="",s=e;for(let o=0;o<t;o++)n=k3[s%32]+n,s=Math.floor(s/32);return n}function Kle(e){const t=new Uint8Array(e);if(globalThis.crypto?.getRandomValues)globalThis.crypto.getRandomValues(t);else for(let n=0;n<t.length;n++)t[n]=Math.floor(Math.random()*256);return Array.from(t,n=>k3[n%32]).join("")}function i2(){return`${Vle(Date.now(),10)}${Kle(16)}`}function Gle(e){try{const t=[];return e.forEach((n,s)=>{typeof n=="string"?t.push({field:s,value:n}):t.push({field:s,file:n.name,size:n.size,type:n.type})}),{formData:t}}catch{return"[FormData]"}}async function r2(e){try{const t=await e.text();return t?t.length>s2?`${t.slice(0,s2)}...`:t:void 0}catch{return}}class Yle{constructor(t,n){this.origin=t,this.identity=n}async get(t,n){return this.request("GET",t,void 0,n)}async post(t,n,s){return this.request("POST",t,n,void 0,s?.allowCodes)}async postForm(t,n){const s=af(this.origin,t),o=i2(),i={"X-Request-Id":o};this.addClientHeaders(i);const r=Date.now();jw({method:"POST",path:t,url:s,requestId:o,body:Gle(n)});let l;try{l=await fetch(s,{method:"POST",headers:i,body:n,signal:o2()})}catch(u){throw pd({method:"POST",path:t,requestId:o,phase:"fetch",durationMs:Date.now()-r,error:u}),new dc({message:`Network error calling POST ${t}`,cause:u,method:"POST",path:t,url:s,requestId:o,phase:"fetch",timeoutMs:fc})}let a;const c=l.clone();try{a=await l.json()}catch(u){throw pd({method:"POST",path:t,requestId:o,phase:"parse",durationMs:Date.now()-r,status:l.status,error:u}),new dc({message:`Failed to parse JSON response from POST ${t}`,cause:u,method:"POST",path:t,url:s,requestId:o,phase:"parse",timeoutMs:fc,status:l.status,statusText:l.statusText,contentType:l.headers.get("content-type")??void 0,bodyPreview:await r2(c)})}if(zw({method:"POST",path:t,requestId:o,status:l.status,durationMs:Date.now()-r,code:a.code,msg:a.msg,envelopeRequestId:a.request_id,data:a.data}),a.code!==0)throw new p1({code:a.code,msg:a.msg,requestId:a.request_id,details:a.details});return a.data}async patch(t,n){return this.request("PATCH",t,n)}async delete(t){return this.request("DELETE",t)}async request(t,n,s,o,i=[]){let r=af(this.origin,n);if(o){const p=new URLSearchParams;for(const[g,w]of Object.entries(o))w!==void 0&&p.set(g,String(w));const f=p.toString();f&&(r=`${r}?${f}`)}const l=i2(),a={"X-Request-Id":l};this.addClientHeaders(a),s!==void 0&&(a["Content-Type"]="application/json; charset=utf-8");const c=Date.now();jw({method:t,path:n,url:r,requestId:l,body:s});let u;try{u=await fetch(r,{method:t,headers:a,body:s!==void 0?JSON.stringify(s):void 0,signal:o2()})}catch(p){throw pd({method:t,path:n,requestId:l,phase:"fetch",durationMs:Date.now()-c,error:p}),new dc({message:`Network error calling ${t} ${n}`,cause:p,method:t,path:n,url:r,requestId:l,phase:"fetch",timeoutMs:fc})}let d;const h=u.clone();try{d=await u.json()}catch(p){throw pd({method:t,path:n,requestId:l,phase:"parse",durationMs:Date.now()-c,status:u.status,error:p}),new dc({message:`Failed to parse JSON response from ${t} ${n}`,cause:p,method:t,path:n,url:r,requestId:l,phase:"parse",timeoutMs:fc,status:u.status,statusText:u.statusText,contentType:u.headers.get("content-type")??void 0,bodyPreview:await r2(h)})}if(zw({method:t,path:n,requestId:l,status:u.status,durationMs:Date.now()-c,code:d.code,msg:d.msg,envelopeRequestId:d.request_id,data:d.data}),d.code!==0&&!i.includes(d.code))throw new p1({code:d.code,msg:d.msg,requestId:d.request_id,details:d.details});return d.data}addClientHeaders(t){this.identity!==void 0&&(t["X-Kimi-Client-Id"]=this.identity.clientId,t["X-Kimi-Client-Name"]=this.identity.clientName,t["X-Kimi-Client-Version"]=this.identity.clientVersion,t["X-Kimi-Client-Ui-Mode"]=this.identity.clientUiMode)}}class Xle{constructor(t,n,s){this.wsUrl=t,this.clientId=n,this.handlers=s}ws=null;connected=!1;closed=!1;subscriptions=new Map;pendingSubscriptions=[];terminalAttachments=new Map;msgSeq=0;reconnectAttempts=0;reconnectTimer=null;connect(){if(this.ws!==null||this.closed)return;Rl("connect",{url:this.wsUrl,attempt:this.reconnectAttempts});const t=new WebSocket(this.wsUrl);this.ws=t,t.onopen=()=>{Rl("open")},t.onmessage=n=>{try{const s=JSON.parse(String(n.data));Yee(s),this.handleFrame(s)}catch(s){Rl("parse-error",{error:String(s)}),this.handlers.onError(0,`Failed to parse WS frame: ${String(s)}`,!1)}},t.onerror=()=>{Rl("error"),this.handlers.onError(0,"WebSocket error",!1)},t.onclose=n=>{Rl("close",n?{code:n.code,reason:n.reason,wasClean:n.wasClean}:void 0),this.connected=!1,this.ws=null,this.handlers.onConnectionState(!1),this.scheduleReconnect()}}scheduleReconnect(){if(this.closed||this.reconnectTimer!==null)return;const n=Math.min(3e4,1e3*2**this.reconnectAttempts)+Math.floor(Math.random()*250);this.reconnectAttempts+=1,Rl("reconnect-scheduled",{delayMs:n,attempt:this.reconnectAttempts}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},n)}subscribe(t,n={seq:0}){if(this.subscriptions.set(t,{...n}),this.connected)this.sendSubscribe([t],{[t]:n});else{const s=this.pendingSubscriptions.findIndex(o=>o.sessionId===t);s!==-1&&this.pendingSubscriptions.splice(s,1),this.pendingSubscriptions.push({sessionId:t,cursor:{...n}})}}unsubscribe(t){this.subscriptions.delete(t);const n=this.pendingSubscriptions.findIndex(s=>s.sessionId===t);n!==-1&&this.pendingSubscriptions.splice(n,1),this.connected&&this.ws&&this.send({type:"unsubscribe",id:this.nextId(),payload:{session_ids:[t]}})}abort(t,n){!this.connected||!this.ws||this.send({type:"abort",id:this.nextId(),payload:{session_id:t,prompt_id:n}})}terminalAttach(t,n,s){const o=gd(t,n),i=this.terminalAttachments.get(o),r=s??i?.lastSeq??0;this.terminalAttachments.set(o,{sessionId:t,terminalId:n,lastSeq:r}),!(!this.connected||!this.ws)&&this.sendTerminalAttach(t,n,r)}terminalInput(t,n,s){!this.connected||!this.ws||this.send({type:"terminal_input",id:this.nextId(),payload:{session_id:t,terminal_id:n,data:s}})}terminalResize(t,n,s,o){!this.connected||!this.ws||this.send({type:"terminal_resize",id:this.nextId(),payload:{session_id:t,terminal_id:n,cols:s,rows:o}})}terminalDetach(t,n){this.terminalAttachments.delete(gd(t,n)),!(!this.connected||!this.ws)&&this.send({type:"terminal_detach",id:this.nextId(),payload:{session_id:t,terminal_id:n}})}terminalClose(t,n){this.terminalAttachments.delete(gd(t,n)),!(!this.connected||!this.ws)&&this.send({type:"terminal_close",id:this.nextId(),payload:{session_id:t,terminal_id:n}})}close(){this.closed=!0,this.connected=!1,this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws&&(this.ws.close(1e3),this.ws=null)}handleFrame(t){const n=t;switch(t.type){case"server_hello":this.onServerHello();break;case"ping":this.send({type:"pong",payload:{nonce:n.payload.nonce}});break;case"resync_required":{const s=n.payload.session_id,o=n.payload.epoch;this.subscriptions.set(s,{seq:n.payload.current_seq,epoch:o}),this.handlers.onResync(s,n.payload.current_seq,o);break}case"error":{const s=n.session_id;typeof s=="string"&&this.handlers.onRawAgentEvent?this.handlers.onRawAgentEvent({type:"error",seq:n.seq,session_id:s,timestamp:n.timestamp,payload:n.payload}):this.handlers.onError(n.payload.code,n.payload.msg,n.payload.fatal);break}case"ack":break;case"terminal_output":{const s=n.session_id,o=n.terminal_id,i=n.seq,r=gd(s,o),l=this.terminalAttachments.get(r);l&&this.terminalAttachments.set(r,{...l,lastSeq:Math.max(l.lastSeq,i)});const a=typeof n.payload?.data=="string"?n.payload.data:"";this.handlers.onTerminalOutput?.(s,o,a,i);break}case"terminal_exit":{const s=n.session_id,o=n.terminal_id,i=n.payload?.exit_code,r=typeof i=="number"?i:null;this.handlers.onTerminalExit?.(s,o,r);break}default:{this.trackCursor(n);const s=n.type,o=jle(s,n.payload);if(o.route==="protocol"){this.handlers.onWireEvent(n);break}if(o.route==="agent"){if(this.handlers.onRawAgentEvent&&typeof n.session_id=="string"){const i=n,r=n;this.handlers.onRawAgentEvent({type:o.agentType,seq:i.seq,session_id:i.session_id,timestamp:i.timestamp,payload:i.payload,...r.volatile!==void 0?{volatile:r.volatile}:{},...r.offset!==void 0?{offset:r.offset}:{}})}break}break}}}onServerHello(){this.connected=!0,this.reconnectAttempts=0,this.handlers.onConnectionState(!0);const t=Array.from(this.subscriptions.keys());for(const s of this.pendingSubscriptions)this.subscriptions.set(s.sessionId,s.cursor),t.includes(s.sessionId)||t.push(s.sessionId);this.pendingSubscriptions.length=0;const n={};for(const[s,o]of this.subscriptions.entries())n[s]=o;this.send({type:"client_hello",id:this.nextId(),payload:{client_id:this.clientId,subscriptions:t,cursors:n}});for(const s of this.terminalAttachments.values())this.sendTerminalAttach(s.sessionId,s.terminalId,s.lastSeq)}sendSubscribe(t,n){this.send({type:"subscribe",id:this.nextId(),payload:{session_ids:t,cursors:n}})}sendTerminalAttach(t,n,s){this.send({type:"terminal_attach",id:this.nextId(),payload:{session_id:t,terminal_id:n,since_seq:s>0?s:void 0}})}trackCursor(t){if(t.volatile===!0)return;const n=t.session_id,s=t.seq;if(typeof n!="string"||typeof s!="number")return;const o=this.subscriptions.get(n);if(!o||s<=o.seq&&o.epoch!==void 0)return;const i=typeof t.epoch=="string"?t.epoch:o.epoch;this.subscriptions.set(n,{seq:Math.max(s,o.seq),epoch:i})}send(t){if(!(!this.ws||this.ws.readyState!==WebSocket.OPEN))try{this.ws.send(JSON.stringify(t)),Gee(t)}catch{}}nextId(){return`c_${++this.msgSeq}`}}function gd(e,t){return`${e}\0${t}`}function jm(e){return{id:e.id,sessionId:e.session_id,cwd:e.cwd,shell:e.shell,cols:e.cols,rows:e.rows,status:e.status,createdAt:e.created_at,exitedAt:e.exited_at,exitCode:e.exit_code}}function l2(e){return e==="auto_compact"||e==="manual_compact"}class Zle{http;config;constructor(t){this.config=t,this.http=new Yle(t.serverHttpUrl,{clientId:t.clientId,clientName:t.clientName,clientVersion:t.clientVersion,clientUiMode:t.clientUiMode})}async getHealth(){return{status:"ok",uptimeSec:(await this.http.get("/healthz")).uptime_sec??0}}async getMeta(){const t=await this.http.get("/meta");return{serverVersion:t.server_version,serverId:t.server_id,startedAt:t.started_at,capabilities:t.capabilities,openInApps:Array.isArray(t.open_in_apps)?t.open_in_apps:[]}}async listSessions(t){const n={before_id:t?.beforeId,after_id:t?.afterId,page_size:t?.pageSize,status:t?.status?mle(t.status):void 0,include_archive:t?.includeArchive,workspace_id:t?.workspaceId},s=await this.http.get("/sessions",n);return{items:s.items.map(ti),hasMore:s.has_more}}async createSession(t){const n={metadata:t.cwd!==void 0?{cwd:t.cwd}:{}};t.workspaceId!==void 0&&(n.workspace_id=t.workspaceId),t.title!==void 0&&(n.title=t.title),t.model!==void 0&&(n.agent_config={model:t.model});const s=await this.http.post("/sessions",n);return ti(s)}async getSession(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}`);return ti(n)}async updateSession(t,n){const s={};n.title!==void 0&&(s.title=n.title),n.cwd!==void 0&&(s.metadata={cwd:n.cwd});const o={};n.model!==void 0&&(o.model=n.model),n.permissionMode!==void 0&&(o.permission_mode=n.permissionMode),n.planMode!==void 0&&(o.plan_mode=n.planMode),n.swarmMode!==void 0&&(o.swarm_mode=n.swarmMode),n.goalObjective!==void 0&&(o.goal_objective=n.goalObjective),n.goalControl!==void 0&&(o.goal_control=n.goalControl),n.thinking!==void 0&&(o.thinking=n.thinking),Object.keys(o).length>0&&(s.agent_config=o);const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/profile`,s);return ti(i)}async getSessionStatus(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/status`);return{model:n.model&&n.model.length>0?n.model:null,thinkingLevel:n.thinking_level,permission:n.permission,planMode:n.plan_mode===!0,swarmMode:n.swarm_mode===!0,contextTokens:n.context_tokens??0,maxContextTokens:n.max_context_tokens??0,contextUsage:n.context_usage??0}}async archiveSession(t){return await this.http.post(`/sessions/${encodeURIComponent(t)}:archive`,{})}async listMessages(t,n){const s={before_id:n?.beforeId,after_id:n?.afterId,page_size:n?.pageSize,role:n?.role},o=await this.http.get(`/sessions/${encodeURIComponent(t)}/messages`,s);return{items:o.items.map(d1),hasMore:o.has_more}}async getSessionSnapshot(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/snapshot`);return{asOfSeq:n.as_of_seq,epoch:n.epoch,session:ti(n.session),messages:n.messages.items.map(d1),hasMoreMessages:n.messages.has_more,inFlightTurn:n.in_flight_turn===null?null:{turnId:n.in_flight_turn.turn_id,assistantText:n.in_flight_turn.assistant_text,thinkingText:n.in_flight_turn.thinking_text,runningTools:n.in_flight_turn.running_tools.map(s=>({toolCallId:s.tool_call_id,name:s.name,args:s.args,description:s.description,lastProgress:s.last_progress})),promptId:n.in_flight_turn.current_prompt_id},pendingApprovals:n.pending_approvals.map(g3),pendingQuestions:n.pending_questions.map(v3)}}async submitPrompt(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts`,vle(n));return{promptId:s.prompt_id,userMessageId:s.user_message_id,status:s.status}}async steerPrompts(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts:steer`,{prompt_ids:n});return{steered:s.steered,promptIds:s.prompt_ids}}async abortPrompt(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts/${encodeURIComponent(n)}:abort`,void 0,{allowCodes:[40903]});return{aborted:s.aborted,atSeq:s.at_seq}}async abortSession(t){return{aborted:(await this.http.post(`/sessions/${encodeURIComponent(t)}:abort`,{})).aborted}}async compactSession(t,n){await this.http.post(`/sessions/${encodeURIComponent(t)}:compact`,n?{instruction:n}:{})}async undoSession(t,n=1){await this.http.post(`/sessions/${encodeURIComponent(t)}:undo`,{count:n})}async forkSession(t,n){const s={};n?.title!==void 0&&(s.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}:fork`,s);return ti(o)}async createChildSession(t,n){const s={};n?.title!==void 0&&(s.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/children`,s);return ti(o)}async listChildSessions(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/children`)).items.map(ti)}async startBtw(t){return{agentId:(await this.http.post(`/sessions/${encodeURIComponent(t)}:btw`,{})).agent_id}}async respondApproval(t,n,s){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/approvals/${encodeURIComponent(n)}`,yle(s));return{resolved:o.resolved,resolvedAt:o.resolved_at}}async respondQuestion(t,n,s){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}`,wle(s));return{resolved:o.resolved,resolvedAt:o.resolved_at}}async dismissQuestion(t,n){return{dismissed:!0,dismissedAt:(await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}:dismiss`,void 0,{allowCodes:[40909]})).dismissed_at}}async listTasks(t,n){const s={status:n};return(await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks`,s)).items.map(f1)}async getTask(t,n,s){const o={with_output:s?.withOutput,output_bytes:s?.outputBytes},i=await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}`,o);return f1(i)}async cancelTask(t,n){return await this.http.post(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}:cancel`)}async listTerminals(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals`)).items.map(jm)}async createTerminal(t,n={}){const s={cwd:n.cwd,shell:n.shell,cols:n.cols,rows:n.rows},o=await this.http.post(`/sessions/${encodeURIComponent(t)}/terminals`,s);return jm(o)}async getTerminal(t,n){const s=await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}`);return jm(s)}async closeTerminal(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}:close`)}async listSkills(t){return((await this.http.get(`/sessions/${encodeURIComponent(t)}/skills`)).skills??[]).map(s=>({name:s.name,description:s.description,source:s.source}))}async activateSkill(t,n,s){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/skills/${encodeURIComponent(n)}:activate`,s!==void 0&&s.length>0?{args:s}:{});return{activated:o.activated,skillName:o.skill_name}}async listDirectory(t,n){const s={};n.path!==void 0&&(s.path=n.path),n.depth!==void 0&&(s.depth=n.depth),n.includeGitStatus!==void 0&&(s.include_git_status=n.includeGitStatus);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:list`,s),i=o.children_by_path?Object.fromEntries(Object.entries(o.children_by_path).map(([r,l])=>[r,l.map(Xw)])):void 0;return{items:o.items.map(Xw),childrenByPath:i,truncated:o.truncated}}async readFile(t,n){const s={path:n.path};n.offset!==void 0&&(s.offset=n.offset),n.length!==void 0&&(s.length=n.length);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:read`,s);return{path:o.path,content:o.content,encoding:o.encoding,size:o.size,truncated:o.truncated,etag:o.etag,mime:o.mime,languageId:o.language_id,lineCount:o.line_count,isBinary:o.is_binary}}async searchFiles(t,n){const s={query:n.query};n.limit!==void 0&&(s.limit=n.limit);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:search`,s);return{items:o.items.map(i=>({path:i.path,name:i.name,kind:i.kind,score:i.score,matchPositions:i.match_positions})),truncated:o.truncated}}async grepFiles(t,n){const s={pattern:n.pattern};n.regex!==void 0&&(s.regex=n.regex),n.caseSensitive!==void 0&&(s.case_sensitive=n.caseSensitive);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:grep`,s);return{files:o.files,filesScanned:o.files_scanned,truncated:o.truncated,elapsedMs:o.elapsed_ms}}async getGitStatus(t,n){const s={};n!==void 0&&(s.paths=n);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:git_status`,s);return{branch:o.branch,ahead:o.ahead,behind:o.behind,entries:o.entries,additions:o.additions,deletions:o.deletions,pullRequest:o.pullRequest??null}}async getFileDiff(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:diff`,{path:n});return{path:s.path,diff:s.diff}}getFileDownloadUrl(t,n){const s=n.split("/").map(o=>encodeURIComponent(o)).join("/");return af(this.config.serverHttpUrl,`/sessions/${encodeURIComponent(t)}/fs/${s}:download`)}async openFile(t,n){const s={path:n.path};return n.line!==void 0&&(s.line=n.line),this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open`,s)}async revealFile(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/fs:reveal`,{path:n.path})}async openInApp(t,n,s,o){const i={app_id:n,path:s};o!==void 0&&(i.line=o),await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open-in`,i)}async listWorkspaces(){try{return((await this.http.get("/workspaces")).items??[]).map(Of)}catch{return[]}}async addWorkspace(t){const n={root:t.root};t.name!==void 0&&(n.name=t.name);const s=await this.http.post("/workspaces",n);return Of(s)}async deleteWorkspace(t){await this.http.delete(`/workspaces/${encodeURIComponent(t)}`)}async browseFs(t){try{const n=await this.http.get("/fs:browse",{path:t});return{path:n.path,parent:n.parent,entries:(n.entries??[]).map(s=>({name:s.name,path:s.path,isDir:s.is_dir,isGitRepo:s.is_git_repo,branch:s.branch}))}}catch{return{path:"",parent:null,entries:[]}}}async getFsHome(){try{const t=await this.http.get("/fs:home");return{home:t.home,recentRoots:t.recent_roots??[]}}catch{return{home:"",recentRoots:[]}}}async listModels(){return(await this.http.get("/models")).items.map(xle)}async listProviders(){return(await this.http.get("/providers")).items.map(Um)}async addProvider(t){const n={type:t.type};t.apiKey!==void 0&&(n.api_key=t.apiKey),t.baseUrl!==void 0&&(n.base_url=t.baseUrl),t.defaultModel!==void 0&&(n.default_model=t.defaultModel);const s=await this.http.post("/providers",n);return Um(s)}async deleteProvider(t){return this.http.delete(`/providers/${encodeURIComponent(t)}`)}async refreshProvider(t){const n=await this.http.post(`/providers/${encodeURIComponent(t)}:refresh`);return Um(n)}async refreshOAuthProviderModels(){const t=await this.http.post("/providers:refresh_oauth");return{changed:t.changed.map(n=>({providerId:n.provider_id,providerName:n.provider_name,added:n.added,removed:n.removed})),unchanged:t.unchanged,failed:t.failed}}async getConfig(){const t=await this.http.get("/config");return h1(t)}async setConfig(t){const n={},s={providers:"providers",defaultProvider:"default_provider",defaultModel:"default_model",models:"models",thinking:"thinking",planMode:"plan_mode",yolo:"yolo",defaultThinking:"default_thinking",defaultPermissionMode:"default_permission_mode",defaultPlanMode:"default_plan_mode",permission:"permission",hooks:"hooks",services:"services",mergeAllAvailableSkills:"merge_all_available_skills",extraSkillDirs:"extra_skill_dirs",loopControl:"loop_control",background:"background",experimental:"experimental",telemetry:"telemetry",raw:"raw"};for(const[i,r]of Object.entries(t)){const l=s[i];l!==void 0&&(n[l]=r)}const o=await this.http.post("/config",n);return h1(o)}async getAuth(){const t=await this.http.get("/auth");return{ready:t.ready,providersCount:t.providers_count,defaultModel:t.default_model,managedProvider:t.managed_provider?{status:t.managed_provider.status}:null}}async startOAuthLogin(){const t=await this.http.post("/oauth/login",{});return{flowId:t.flow_id,provider:t.provider,verificationUri:t.verification_uri,verificationUriComplete:t.verification_uri_complete,userCode:t.user_code,expiresIn:t.expires_in,interval:t.interval,status:t.status,expiresAt:t.expires_at}}async pollOAuthLogin(){const t=await this.http.get("/oauth/login");return t?{flowId:t.flow_id,status:t.status,resolvedAt:t.resolved_at}:null}async cancelOAuthLogin(){const t=await this.http.delete("/oauth/login");return{cancelled:t.cancelled,status:t.status}}async logout(){return{loggedOut:(await this.http.post("/oauth/logout",{})).logged_out}}async uploadFile(t){const n=new FormData;n.append("file",t.file,t.name??(t.file instanceof File?t.file.name:"upload")),t.name!==void 0&&n.append("name",t.name);const s=await this.http.postForm("/files",n);return{id:s.id,name:s.name,mediaType:s.media_type,size:s.size}}getFileUrl(t){return af(this.config.serverHttpUrl,`/files/${encodeURIComponent(t)}`)}connectEvents(t){const n=a$(this.config.serverHttpUrl,this.config.clientId),s=Hle(),o=new Xle(n,this.config.clientId,{onWireEvent:i=>{const r=Tle(i),l=Mle(i),a=Cle(i);a.type==="historyCompacted"&&!l2(a.reason)&&t.onResync(a.sessionId,a.beforeSeq),t.onEvent(a,{sessionId:r,seq:l})},onRawAgentEvent:i=>{const{type:r,seq:l,session_id:a,payload:c,offset:u}=i,d=s.project(r,c,a,{offset:u});for(const h of d)h.type==="historyCompacted"&&!l2(h.reason)&&t.onResync(a,l),t.onEvent(h,{sessionId:a,seq:l})},onResync:(i,r,l)=>{s.reset(i),t.onResync(i,r,l)},onConnectionState:i=>{t.onConnectionChange(i)},onError:(i,r,l)=>{t.onError(i,r,l)},onTerminalOutput:(i,r,l,a)=>{t.onTerminalOutput?.(i,r,l,a)},onTerminalExit:(i,r,l)=>{t.onTerminalExit?.(i,r,l)}});return o.connect(),{subscribe(i,r){o.subscribe(i,r??{seq:0})},unsubscribe(i){o.unsubscribe(i)},seedSnapshot(i,r){if(r.inFlightTurn===null){s.reset(i);return}const l=s.seedInFlight(i,r.inFlightTurn);for(const a of l)t.onEvent(a,{sessionId:i,seq:r.asOfSeq})},bindNextPromptId(i,r){s.bindNextPromptId(i,r)},abort(i,r){o.abort(i,r)},terminalAttach(i,r,l){o.terminalAttach(i,r,l)},terminalInput(i,r,l){o.terminalInput(i,r,l)},terminalResize(i,r,l,a){o.terminalResize(i,r,l,a)},terminalDetach(i,r){o.terminalDetach(i,r)},terminalClose(i,r){o.terminalClose(i,r)},markSideChannelAgent(i){s.markSideChannelAgent(i)},close(){o.close()}}}}let a2;function ut(){return a2??=new Zle(s$()),a2}const b3=["blue","mono"],_3=["light","dark","system"],w3=15,Jle=12,Qle=20;function eae(){const e=_n(Et.accent);return e&&b3.includes(e)?e:"blue"}function tae(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.accent=e)}function nae(){const e=_n(Et.colorScheme);return e&&_3.includes(e)?e:"system"}function sae(e){if(typeof document>"u"||!document.documentElement)return;document.documentElement.dataset.colorScheme=e;const t=document.querySelectorAll('meta[name="theme-color"]');if(t.length===0)return;const n=e==="dark"?"#0d1117":e==="light"?"#ffffff":null;t.forEach(s=>{const i=(s.getAttribute("media")??"").includes("dark")?"#0d1117":"#ffffff";s.setAttribute("content",n??i)})}function oae(){const e=_n(Et.theme);return e==="terminal"||e==="modern"||e==="kimi"?e:"modern"}function iae(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.theme=e)}function Hv(e){return Number.isFinite(e)?Math.min(Qle,Math.max(Jle,Math.round(e))):w3}function rae(){const e=_n(Et.uiFontSize);return e===null?w3:Hv(Number(e))}function lae(e){typeof document>"u"||!document.documentElement||document.documentElement.style.setProperty("--ui-font-size",`${Hv(e)}px`)}const Ah=se(oae()),Wv=se(nae()),Uv=se(eae()),qv=se(rae());Ge(Ah,iae,{immediate:!0});Ge(Wv,sae,{immediate:!0});Ge(Uv,tae,{immediate:!0});Ge(qv,lae,{immediate:!0});function S3(e){e!=="terminal"&&e!=="modern"&&e!=="kimi"||(Ah.value=e,In(Et.theme,e))}function aae(){S3(Ah.value==="modern"?"terminal":"modern")}function cae(e){_3.includes(e)&&(Wv.value=e,In(Et.colorScheme,e))}function uae(e){b3.includes(e)&&(Uv.value=e,In(Et.accent,e))}function dae(e){const t=Hv(e);qv.value=t,In(Et.uiFontSize,String(t))}const fae=600,hae=250,Eh=250,pae=1e3,mae=160,Pf=se(!1);let Zr=[],el=null,Rf=-Eh;function gae(){Zr=[],Rf=-Eh,Pf.value=!1,el!==null&&(clearTimeout(el),el=null)}function vae(){Pf.value=!0,el!==null&&clearTimeout(el),el=setTimeout(()=>{el=null,Zr=[],Rf=-Eh,Pf.value=!1},pae)}function yae(e){if(e<=0)return;const t=Date.now();Zr.push({time:t,chars:e});const n=t-fae;if(Zr=Zr.filter(l=>l.time>=n),t-Rf<Eh)return;Rf=t;const s=Zr[0]?.time??t,o=Math.max(t-s,hae);Zr.reduce((l,a)=>l+a.chars,0)/o*1e3>=mae&&vae()}function kae(){return{theme:Ah,colorScheme:Wv,accent:Uv,uiFontSize:qv,fastMoon:Pf,setTheme:S3,toggleTheme:aae,setColorScheme:cae,setAccent:uae,setUiFontSize:dae,resetFastMoon:gae,recordMoonDelta:yae}}function bae(){const e=_n(Et.notifyOnComplete);return e===null?!0:e==="1"}const Df=se(bae()),jv=se(typeof Notification<"u"?Notification.permission:"denied");async function _ae(e){if(!e){Df.value=!1,In(Et.notifyOnComplete,"0");return}if(typeof Notification>"u")return;let t=Notification.permission;if(t==="default")try{t=await Notification.requestPermission()}catch{}jv.value=t,t==="granted"&&(Df.value=!0,In(Et.notifyOnComplete,"1"))}function wae(e,t){if(!Df.value||typeof Notification>"u")return;const n=Notification.permission;if(n!=="denied"){if(n==="default"){Notification.requestPermission().then(s=>{jv.value=s,s==="granted"&&c2(e,t)});return}c2(e,t)}}function c2(e,t){if(t.isActiveAndVisible)return;const n=t.sessionTitle.trim()||"Kimi Code";try{const s=new Notification(n,{body:$n.global.t("settings.notifyBody"),tag:`kimi-complete-${e}`});s.onclick=()=>{try{window.focus()}catch{}t.onClick(),s.close()}}catch{}}function Sae(){return{notifyOnComplete:Df,notifyPermission:jv,setNotifyOnComplete:_ae,maybeNotifyCompletion:wae}}function u2(e,t){const n=new Set(e.map(o=>o.id)),s=t.filter(o=>o.kind==="subagent"&&!n.has(o.id));return s.length===0?e:[...e,...s]}const Cae=1e3,xae=4096,d2=32*1024;function Tae(e,t){let n=null,s;const o=new Set;async function i(h){try{const f=await ut().listTasks(h);e.tasksBySession={...e.tasksBySession,[h]:u2(f,e.tasksBySession[h]??[])},await r(h,f)}catch{}}async function r(h,p){if(e.activeSessionId!==h)return;const f=p??e.tasksBySession[h]??[],g=ut(),w=new Map;if(await Promise.all(f.map(async y=>{if((y.status==="completed"||y.status==="failed"||y.status==="cancelled")&&!o.has(y.id)&&!((y.outputLines?.length??0)>0))try{const v=await g.getTask(h,y.id,{withOutput:!0,outputBytes:d2});v.outputPreview!==void 0&&w.set(y.id,{preview:v.outputPreview,bytes:v.outputBytes})}catch{}finally{o.add(y.id)}})),w.size===0)return;const S=e.tasksBySession[h]??[];e.tasksBySession={...e.tasksBySession,[h]:S.map(y=>{const k=w.get(y.id);return k?{...y,outputPreview:k.preview,outputBytes:k.bytes}:y})}}async function l(h){if(e.activeSessionId!==h)return;const p=ut();let f;try{f=await p.listTasks(h)}catch{return}const g=new Map;await Promise.all(f.map(async k=>{const v=k.status==="running",_=k.status==="completed"||k.status==="failed"||k.status==="cancelled";if(!(!v&&!_)&&!(_&&(o.has(k.id)||(k.outputLines?.length??0)>0)))try{const I=await p.getTask(h,k.id,{withOutput:!0,outputBytes:v?xae:d2});I.outputPreview!==void 0&&g.set(k.id,{preview:I.outputPreview,bytes:I.outputBytes})}catch{}finally{_&&o.add(k.id)}}));const w=e.tasksBySession[h]??[],S=new Map(w.map(k=>[k.id,k])),y=f.map(k=>{const v=S.get(k.id),_=g.get(k.id);return{...k,outputLines:v?.outputLines,outputPreview:_?.preview??v?.outputPreview,outputBytes:_?.bytes??v?.outputBytes}});e.tasksBySession={...e.tasksBySession,[h]:u2(y,w)}}function a(h){n!==null&&s===h||(c(),s=h,l(h),n=setInterval(()=>{typeof document<"u"&&document.visibilityState==="hidden"||(e.activeSessionId===h?l(h):c())},Cae))}function c(){n!==null&&(clearInterval(n),n=null),s=void 0,o.clear()}const u=se(0);let d=null;return Ge(()=>t.value.some(h=>h.status==="running"),h=>{h&&d===null?d=setInterval(()=>{u.value=(u.value+1)%Number.MAX_SAFE_INTEGER},1e3):!h&&d!==null&&(clearInterval(d),d=null)},{immediate:!0}),Ge(()=>{const h=e.activeSessionId;if(!h)return{sid:void 0,hasRunning:!1};const p=e.tasksBySession[h]??[];return{sid:h,hasRunning:p.some(f=>f.status==="running")}},({sid:h,hasRunning:p},f,g)=>{let w;p&&h!==void 0?a(h):h!==void 0?w=setTimeout(()=>{(e.tasksBySession[h]??[]).some(y=>y.status==="running")||c()},1500):c(),g(()=>{w!==void 0&&clearTimeout(w)})},{deep:!0,immediate:!0}),{taskClock:H(()=>u.value),loadTasksForSession:i}}const C3=Et.starredModels;function Mae(){try{const e=_n(C3);if(!e)return[];const t=JSON.parse(e);if(Array.isArray(t)&&t.every(n=>typeof n=="string"))return t}catch{}return[]}function Aae(e){try{In(C3,JSON.stringify(e))}catch{}}function Eae(e,t){const{pushOperationFailure:n,refreshSessionStatus:s,persistSessionProfile:o,activity:i,inFlightPromptSessions:r,saveThinkingToStorage:l,updateSession:a,updateSessionMessages:c}=t,u=se([]),d=se(Mae()),h=se({}),p=se([]),f=se(null);function g(F){if(!(F==null||F.length===0))return u.value.find(V=>V.id===F||V.model===F)}function w(){const F=e.activeSessionId?e.sessions.find(V=>V.id===e.activeSessionId):void 0;return g(F?.model??f.value??e.defaultModel)}function S(F){const V=Bw(w(),F);return e.thinking=V,l(V),V}async function y(F){try{const K=await ut().listSkills(F);h.value={...h.value,[F]:K}}catch{}}async function k(){try{const F=ut();u.value=await F.listModels(),S(e.thinking)}catch(F){n("loadModels",F)}}async function v(){try{const F=await ut().refreshOAuthProviderModels();for(const V of F.failed)n("refreshOAuthProviderModels",new Error(V.reason),{message:V.provider})}catch{}}async function _(){try{const F=ut();p.value=await F.listProviders()}catch(F){n("loadProviders",F)}}async function I(F){const V=e.activeSessionId,K=Bw(g(F),e.thinking),Z=e.thinking;if(!V){f.value=F,S(K);return}const G=e.sessions.find(X=>X.id===V)?.model;a(V,X=>({...X,model:F})),K!==Z&&(e.thinking=K,l(K));try{await ut().updateSession(V,{model:F,thinking:K!==Z?K:void 0})}catch(X){a(V,pe=>({...pe,model:G??pe.model})),K!==Z&&(e.thinking=Z,l(Z)),n("setModel",X,{sessionId:V});return}await s(V)}function A(F){const V=new Set(d.value);V.has(F)?V.delete(F):V.add(F),d.value=Array.from(V),Aae(d.value)}async function b(F,V){const K=e.activeSessionId;if(!K)return;const Z=i.value==="idle"&&!r.has(K),G=`msg_skill_opt_${Date.now().toString(36)}`;if(Z){r.add(K),e.sendingBySession={...e.sendingBySession,[K]:!0};const X={id:G,sessionId:K,role:"user",content:[{type:"text",text:`/${F}${V?` ${V}`:""}`}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0,origin:{kind:"skill_activation",trigger:"user-slash",skillName:F,skillArgs:V}}};c(K,pe=>[...pe,X])}try{await ut().activateSkill(K,F,V)}catch(X){Z&&(r.delete(K),e.sendingBySession={...e.sendingBySession,[K]:!1},c(K,pe=>pe.filter(oe=>oe.id!==G))),n("activateSkill",X,{sessionId:K})}}async function M(F){try{await ut().addProvider(F),await Promise.all([_(),k()])}catch(V){n("addProvider",V)}}async function N(F){try{await ut().deleteProvider(F),await Promise.all([_(),k()])}catch(V){n("deleteProvider",V)}}async function D(F){try{const K=await ut().refreshProvider(F);p.value=p.value.map(Z=>Z.id===F?K:Z)}catch(V){n("refreshProvider",V)}}async function $(){try{return await ut().startOAuthLogin()}catch{return null}}async function O(){try{return await ut().pollOAuthLogin()}catch{return null}}async function P(){try{await ut().cancelOAuthLogin()}catch{}}function R(F){const V=S(F);o({thinking:V})}return{models:u,starredModelIds:d,providers:p,draftModel:f,skillsBySession:h,loadSkillsForSession:y,loadModels:k,refreshOAuthProviderModels:v,loadProviders:_,setModel:I,toggleStarModel:A,activateSkill:b,addProvider:M,deleteProvider:N,refreshProvider:D,startOAuthLogin:$,pollOAuthLogin:O,cancelOAuthLogin:P,setThinking:R}}const x3="kimiWeb.compaction",Iae=/^read[_-]?media(?:file)?$/i,$ae=/^agent$/i,Nae=/^data:([^;]+);base64,(.*)$/s,Lae=/^<(image|video|audio)\s+path="([^"]+)">$/,Oae=/Mime type:\s*([^.\s]+)/i,Pae=/Size:\s*(\d+)\s*bytes/i,Rae=/Original dimensions:\s*(\d+)x(\d+)\s*pixels/i;function Dae(e){if(e.length===0)return 0;const t=e.endsWith("==")?2:e.endsWith("=")?1:0;return Math.floor(e.length*3/4)-t}function Bae(e){if(Array.isArray(e))return e;if(typeof e!="string")return null;try{const t=JSON.parse(e);return Array.isArray(t)?t:null}catch{return null}}function Fae(e){const t=e.type,n=t==="image_url"?"image":t==="video_url"?"video":t==="audio_url"?"audio":null;if(n===null)return null;const o=e[n==="image"?"imageUrl":n==="video"?"videoUrl":"audioUrl"];if(typeof o!="object"||o===null)return null;const i=o.url;return typeof i=="string"?{kind:n,url:i}:null}function Hae(e,t){if(!Iae.test(e))return;const n=Bae(t);if(n===null)return;let s,o,i,r,l,a=null;for(const u of n){if(typeof u!="object"||u===null)continue;const d=u;if(d.type==="text"&&typeof d.text=="string"){const p=d.text,f=Lae.exec(p);f&&(o=f[1],s=f[2]);const g=Oae.exec(p);g?.[1]&&(i=g[1]);const w=Pae.exec(p);w?.[1]&&(r=Number(w[1]));const S=Rae.exec(p);S?.[1]&&S[2]&&(l=`${S[1]}x${S[2]}`);continue}const h=Fae(d);h&&(a=h)}if(a===null)return;const c=Nae.exec(a.url);return c?.[1]&&(i=c[1]),c?.[2]&&(r=Dae(c[2])),{kind:a.kind??o??"image",url:a.url,path:s,mimeType:i,bytes:Number.isFinite(r)?r:void 0,dimensions:l}}function T3(e){if(e!=null){if(typeof e=="string")return e.split(`
|
|
254
|
-
`);if(Array.isArray(e)){const t=[];for(const n of e)if(typeof n=="string")t.push(...n.split(`
|
|
255
|
-
`));else if(n&&typeof n=="object"){const s=n;s.type==="text"&&typeof s.text=="string"?t.push(...s.text.split(`
|
|
256
|
-
`)):s.type==="think"&&typeof s.think=="string"?t.push(...s.think.split(`
|
|
257
|
-
`)):s.type==="image_url"||s.type==="image"?t.push("[image]"):typeof s.type=="string"?t.push(`[${s.type}]`):t.push(JSON.stringify(n))}return t.length>0?t:void 0}return[JSON.stringify(e)]}}function Wae(e){return{id:e.id,toolCallId:e.parentToolCallId,name:e.description,subagentType:e.subagentType,phase:e.subagentPhase??(e.status==="completed"?"completed":e.status==="failed"?"failed":"working"),status:e.status,summary:e.outputPreview,outputLines:e.outputLines,suspendedReason:e.suspendedReason,swarmIndex:e.swarmIndex}}function Uae(e){let t=null;if(typeof e=="string")try{const n=JSON.parse(e);n&&typeof n=="object"&&(t=n)}catch{t=null}else e&&typeof e=="object"&&(t=e);return t?{description:typeof t.description=="string"?t.description:void 0,subagentType:typeof t.subagent_type=="string"?t.subagent_type:void 0,prompt:typeof t.prompt=="string"?t.prompt:void 0}:{}}function qae(e,t,n,s){const o=Uae(t),i=n?n.isError?"failed":"completed":s?"working":"completed",r=n?T3(n.output):void 0;return{id:e,toolCallId:e,name:o.description&&o.description.length>0?o.description:"Sub Agent",subagentType:o.subagentType,prompt:o.prompt,phase:i,status:n?n.isError?"failed":"completed":s?"running":"completed",summary:r&&r.length>0?r.join(`
|
|
258
|
-
`):void 0}}function jae(e,t){const n=e.swarmIndex??Number.MAX_SAFE_INTEGER,s=t.swarmIndex??Number.MAX_SAFE_INTEGER;return n!==s?n-s:e.createdAt.localeCompare(t.createdAt)}function zae(e,t){const n=e.split(`
|
|
259
|
-
`),s=t.split(`
|
|
260
|
-
`),o=[];return n.forEach((i,r)=>{o.push({kind:"rem",gutter:String(r+1),text:`- ${i}`})}),s.forEach((i,r)=>{o.push({kind:"add",gutter:String(r+1),text:`+ ${i}`})}),o}function Vae(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const s=typeof t.path=="string"?t.path:"";return Array.isArray(t.diff)?{kind:"diff",path:s,diff:t.diff}:typeof t.old_text=="string"&&typeof t.new_text=="string"?{kind:"diff",path:s,diff:zae(t.old_text,t.new_text)}:{kind:"diff",path:s,diff:[]}}return n==="shell"||n==="command"?{kind:"shell",command:typeof t.command=="string"?t.command:e.action,cwd:typeof t.cwd=="string"?t.cwd:void 0,danger:typeof t.danger=="string"?t.danger:void 0}:n==="file_content"||n==="file"?{kind:"file",path:typeof t.path=="string"?t.path:"",content:typeof t.content=="string"?t.content:"",language:typeof t.language=="string"?t.language:void 0}:n==="file_op"||n==="fileop"?{kind:"fileop",op:typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,path:typeof t.path=="string"?t.path:"",detail:typeof t.detail=="string"?t.detail:void 0}:n==="url_fetch"||n==="url"?{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:typeof t.url=="string"?t.url:e.action}:n==="search"?{kind:"search",query:typeof t.query=="string"?t.query:e.action,scope:typeof t.scope=="string"?t.scope:void 0}:n==="invocation"||n==="agent_call"||n==="skill_call"?{kind:"invocation",kind2:typeof t.kind=="string"?t.kind:n,name:typeof t.name=="string"?t.name:e.toolName,description:typeof t.description=="string"?t.description:void 0}:n==="todo"||n==="todo_list"?{kind:"todo",items:(Array.isArray(t.items)?t.items:[]).map(i=>{const r=i??{};return{title:typeof r.title=="string"?r.title:"",status:typeof r.status=="string"?r.status:"pending"}})}:{kind:"generic",summary:e.action}}function Kae(e){const t=e.metadata?.origin,n=t?.kind;return n===void 0||n==="user"?!0:n==="skill_activation"?t?.trigger==="user-slash":!1}function Gae(e){return e.metadata?.origin?.kind==="compaction_summary"}function Yae(e,t){return e===null?!1:e.promptId===void 0||t===void 0||e.promptId===t}function M3(e,t,n,s=!0,o=[]){const i=[];let r=1;const l=new Map;for(const f of t)l.set(f.toolCallId,f);const a=new Map;for(const f of o){if(f.kind!=="subagent")continue;const g=[f.parentToolCallId,f.id].filter(w=>typeof w=="string"&&w.length>0);for(const w of g){const S=a.get(w)??[];S.push(f),a.set(w,S)}}for(const[f,g]of a.entries())a.set(f,g.toSorted(jae));const c=new Map;for(const f of e)for(const g of f.content)g.type==="toolResult"&&c.set(g.toolCallId,{output:g.output,isError:!!g.isError});let u=null;function d(f=!1){if(!u)return;const g=u;if(u=null,!f||!s)for(let w=0;w<g.tools.length;w++){const S=g.tools[w];if(S.status!=="running")continue;const y={...S,status:"ok"};g.tools[w]=y;const k=g.blocks.find(v=>v.kind==="tool"&&v.tool.id===y.id);k&&k.kind==="tool"&&(k.tool=y)}i.push({id:g.id,role:"assistant",no:r++,text:g.textParts.join(`
|
|
261
|
-
`),thinking:g.thinkingParts.length>0?g.thinkingParts.join(`
|
|
262
|
-
`):void 0,tools:g.tools.length>0?g.tools:void 0,blocks:g.blocks.length>0?g.blocks:void 0,approval:g.approval,approvalId:g.approvalId,durationMs:g.durationMs})}function h(f,g){for(const w of g)if(w.type==="text"){if(w.text){f.textParts.push(w.text);const S=f.blocks.at(-1);S&&S.kind==="text"?S.text+=`
|
|
263
|
-
`+w.text:f.blocks.push({kind:"text",text:w.text})}}else if(w.type==="thinking"){if(w.thinking){f.thinkingParts.push(w.thinking);const S=f.blocks.at(-1);S&&S.kind==="thinking"?S.thinking+=`
|
|
264
|
-
`+w.thinking:f.blocks.push({kind:"thinking",thinking:w.thinking})}}else if(w.type==="toolUse"){const S=a.get(w.toolCallId);if(S&&S.length>0){if(S.filter(I=>I.swarmIndex!==void 0).length>1)continue;const _=S.map(Wae);_.length===1?f.blocks.push({kind:"agent",member:_[0]}):f.blocks.push({kind:"agentGroup",members:_});continue}if($ae.test(w.toolName)){const v=qae(w.toolCallId,w.input,c.get(w.toolCallId),s);f.blocks.push({kind:"agent",member:v});continue}const y=l.get(w.toolCallId),k={id:w.toolCallId,name:w.toolName,arg:typeof w.input=="string"?w.input:JSON.stringify(w.input),status:"running",output:w.outputLines};f.tools.push(k),f.blocks.push({kind:"tool",tool:k}),y&&(f.approval=Vae(y),f.approvalId=y.approvalId)}else if(w.type==="toolResult"){const S=f.tools.findIndex(y=>y.id===w.toolCallId);if(S!==-1){const y=f.tools[S],k={...y,status:w.isError?"error":"ok",output:T3(w.output),media:w.isError?void 0:Hae(y.name,w.output)};f.tools[S]=k;const v=f.blocks.find(_=>_.kind==="tool"&&_.tool.id===w.toolCallId);v&&v.kind==="tool"&&(v.tool=k)}}}function p(f){if(f.type==="image"||f.type==="video"){const g=f.type,w=f.source;if(w.kind==="url")return{url:w.url,kind:g};if(w.kind==="base64")return{url:`data:${w.mediaType};base64,${w.data}`,kind:g};if(w.kind==="file"&&n)return{url:n(w.fileId),kind:g}}if(f.type==="file"&&n){if(f.mediaType.startsWith("image/"))return{url:n(f.fileId),kind:"image"};if(f.mediaType.startsWith("video/"))return{url:n(f.fileId),kind:"video"}}}for(const f of e){if(f.role==="system")continue;if(Gae(f)){d();const k=f.metadata?.[x3];i.push({id:f.id,role:"compaction",no:r,text:f.content.filter(v=>v.type==="text").map(v=>v.text).join(`
|
|
265
|
-
`),compaction:{trigger:k?.trigger,tokensBefore:k?.tokensBefore,tokensAfter:k?.tokensAfter}});continue}if(f.role==="user"){if(d(),!Kae(f))continue;const k=f.metadata?.origin,v=k?.kind==="skill_activation"&&k?.trigger==="user-slash",_=[],I=[];for(const A of f.content){A.type==="text"&&(v?_.push(k.skillArgs??""):_.push(A.text));const b=p(A);b&&I.push({url:b.url,kind:b.kind,alt:A.type==="file"?A.name:void 0})}i.push({id:f.id,role:"user",no:r++,text:_.join(`
|
|
266
|
-
`),images:I.length>0?I:void 0,skillActivation:v?{name:k.skillName,args:k.skillArgs}:void 0,createdAt:f.createdAt});continue}if(f.role==="tool"){u&&h(u,f.content);continue}const g=f.promptId;Yae(u,g)?u!==null&&u.promptId===void 0&&g!==void 0&&(u.promptId=g):(d(),u={id:f.id,promptId:g,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,durationMs:f.durationMs});const S=u;if(S===null)continue;const y=JSON.stringify(f.content);S.promptId!==void 0&&S.seenSigs.has(y)||(S.seenSigs.add(y),h(S,f.content))}return d(!0),i}function Xae(e,t){const{pushOperationFailure:n,nextOptimisticMsgId:s,connectEventsIfNeeded:o,getEventConn:i}=t,r=se({}),l=H(()=>{const A=e.activeSessionId;if(!A)return null;const b=r.value[A];return b?{parentId:A,agentId:b.agentId}:null}),a=H(()=>l.value?.parentId??null),c=H(()=>l.value!==null),u=H(()=>{const A=l.value;return A?!!e.sideChatSendingByAgent[A.agentId]:!1}),d=H(()=>{const A=l.value;return A?e.sideChatSendingByAgent[A.agentId]?!0:(e.tasksBySession[A.parentId]??[]).some(b=>b.id===A.agentId&&b.status==="running"):!1}),h=H(()=>{const A=l.value;if(!A)return[];const b=e.sideChatMessagesByAgent[A.agentId]??[];return M3(b,[],M=>ut().getFileUrl(M),d.value,[])});function p(A,b){e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[A]:b(e.sideChatMessagesByAgent[A]??[])}}function f(A,b){p(A,M=>[...M,b])}function g(A){p(A,b=>{const M=[...b].reverse().findIndex(D=>D.role==="user");if(M===-1)return b;const N=b.length-1-M;return b.filter((D,$)=>$!==N)})}function w(A,b){p(A,M=>{const N=[...M];for(let D=N.length-1;D>=0;D-=1){const $=N[D];if($.role==="user")return N[D]={...$,promptId:$.promptId??b},N}return M})}function S(A,b,M){M&&p(A,N=>{const D=N.at(-1);if(D?.role==="assistant"){const $=D.content[0],O=$?.type==="text"?$.text:"";return[...N.slice(0,-1),{...D,content:[{type:"text",text:`${O}${M}`}]}]}return[...N,{id:s(),sessionId:b,role:"assistant",content:[{type:"text",text:M}],createdAt:new Date().toISOString()}]})}function y(A,b,M){if(e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[A]:!1},!M)return;const D=(e.sideChatMessagesByAgent[A]??[]).at(-1);(D?.role==="assistant"&&D.content[0]?.type==="text"?D.content[0].text:"").trim().length>0||S(A,b,M)}async function k(A){const b=e.activeSessionId;if(b){if(!r.value[b]){let M;try{({agentId:M}=await ut().startBtw(b))}catch(N){n("openSideChat",N,{sessionId:b});return}e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[M]:e.sideChatMessagesByAgent[M]??[]},r.value={...r.value,[b]:{agentId:M}},o(),i()?.markSideChannelAgent(M)}A&&A.trim()&&await _(A.trim())}}function v(){const A=e.activeSessionId;if(!A)return;const{[A]:b,...M}=r.value;r.value=M}async function _(A){const b=l.value,M=A.trim();if(!b||!M)return;const N=b.parentId,D=b.agentId;e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[D]:!0};const $={id:s(),sessionId:N,role:"user",content:[{type:"text",text:M}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};f(D,$);try{const O=await ut().submitPrompt(N,{content:[{type:"text",text:M}],agentId:D});w(D,O.promptId),e.sideChatUserMessageIdsBySession={...e.sideChatUserMessageIdsBySession,[N]:[...e.sideChatUserMessageIdsBySession[N]??[],O.userMessageId]}}catch(O){n("sendSideChatPrompt",O,{sessionId:N}),g(D),e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[D]:!1}}}function I(A){if(!r.value[A])return;const{[A]:b,...M}=r.value;r.value=M}return{sideChatTargetBySession:r,sideChatSessionId:a,sideChatVisible:c,sideChatSending:u,sideChatRunning:d,sideChatTurns:h,appendSideChatAssistantText:S,finishSideChatAgent:y,openSideChat:k,closeSideChat:v,sendSideChatPrompt:_,clearSideChatForSession:I}}function Zae(e){return e.startsWith("diff --git")||e.startsWith("index ")||e.startsWith("--- ")||e.startsWith("+++ ")||e.startsWith("new file mode")||e.startsWith("deleted file mode")||e.startsWith("old mode")||e.startsWith("new mode")||e.startsWith("similarity index")||e.startsWith("dissimilarity index")||e.startsWith("rename from")||e.startsWith("rename to")||e.startsWith("copy from")||e.startsWith("copy to")||e.startsWith("Binary files")}function Jae(e){const t=[];if(!e)return t;let n=0,s=0,o=!1;for(const i of e.split(`
|
|
267
|
-
`)){if(i.startsWith("diff --git")){o=!1;continue}if(!o&&Zae(i))continue;if(i.startsWith("@@")){const a=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(i);a&&(n=Number.parseInt(a[1],10),s=Number.parseInt(a[2],10)),o=!0,t.push({type:"hunk",text:i});continue}if(!o||i.startsWith("\\"))continue;const r=i.charAt(0),l=i.slice(1);r==="+"?(t.push({type:"add",text:l,newNo:s}),s+=1):r==="-"?(t.push({type:"del",text:l,oldNo:n}),n+=1):r===" "&&(t.push({type:"context",text:l,oldNo:n,newNo:s}),n+=1,s+=1)}return t}const m1="/sessions/";function f2(e){const{pathname:t}=e;if(!t.startsWith(m1))return;const n=t.slice(m1.length);if(!(!n||n.includes("/")))try{const s=decodeURIComponent(n);return s.length>0?s:void 0}catch{return}}function Qae(e){return e===void 0||e.length===0?"/":`${m1}${encodeURIComponent(e)}`}const ece=50,tce=40402;function nce(e,t){const{taskPoller:n,sideChat:s,modelProvider:o,pushOperationFailure:i,activity:r,inFlightPromptSessions:l,sessionsKnownEmpty:a,setSessions:c,updateSession:u,upsertSessionFront:d,appendSession:h,forgetSession:p,setActiveSessionId:f,updateSessionMessages:g,nextOptimisticMsgId:w,getEventConn:S,syncSessionFromSnapshot:y,subscribeToSessionEvents:k,hasLoadedMessages:v,refreshSessionStatus:_,persistSessionProfile:I,mergedWorkspaces:A,workspacesView:b,status:M,workspaceIdForSession:N,savePermissionToStorage:D,savePlanModeToStorage:$,saveSwarmModeToStorage:O,saveGoalModeToStorage:P,saveUnread:R,saveActiveWorkspaceToStorage:F,saveHiddenWorkspacesToStorage:V,goalErrorMessage:K,basename:Z,resetFastMoon:G,initialized:X,selectedDiffPath:pe,fileDiffLines:oe,fileDiffLoading:ye}=t;async function _e(ne){if(e.messagesLoadingMoreBySession[ne])return;const q=e.messagesBySession[ne];if(!q||q.length===0)return;const te=q[0].id;e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[ne]:!0},e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[ne]:!1};try{const He=await ut().listMessages(ne,{beforeId:te,pageSize:ece}),lt=[...He.items].reverse();g(ne,it=>[...lt,...it]),e.messagesHasMoreBySession={...e.messagesHasMoreBySession,[ne]:He.hasMore}}catch(He){e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[ne]:!0},i("loadOlderMessages",He,{sessionId:ne})}finally{e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[ne]:!1}}}function de(ne){n.loadTasksForSession(ne),Le(ne),_(ne),Object.prototype.hasOwnProperty.call(o.skillsBySession.value,ne)||o.loadSkillsForSession(ne)}async function be(ne){const q=e.activeSessionId;if(q){pe.value=ne,oe.value=[],ye.value=!0;try{const He=await ut().getFileDiff(q,ne);if(pe.value!==ne)return;oe.value=Jae(He.diff)}catch(te){pe.value===ne&&(oe.value=[]),console.warn("[loadFileDiff] diff unavailable for",ne,te)}finally{pe.value===ne&&(ye.value=!1)}}}function xe(){pe.value=null,oe.value=[],ye.value=!1}async function Le(ne){try{const te=await ut().getGitStatus(ne);e.gitStatusBySession={...e.gitStatusBySession,[ne]:te}}catch{}}async function ee(){try{const q=await ut().getAuth();e.authReady=q.ready,e.defaultModel=q.defaultModel,e.managedProviderStatus=q.managedProvider?.status??null}catch{}}async function ke(){try{const ne=ut();e.config=await ne.getConfig()}catch{}}async function ge(ne){try{const te=await ut().setConfig(ne);return e.config=te,e.defaultModel=te.defaultModel??null,!0}catch(q){return i("setConfig",q),!1}}const W=100;async function J(){const ne=ut(),q=[];let te;for(;;){const He=await ne.listSessions({pageSize:W,beforeId:te});if(q.push(...He.items),!He.hasMore||He.items.length===0)break;te=He.items[He.items.length-1].id}return q}async function ue(){e.loading=!0;try{const ne=ut();await Promise.all([ne.getHealth().catch(()=>null),ne.getMeta().then(Rt=>{e.serverVersion=Rt.serverVersion,e.availableOpenInApps=Rt.openInApps}).catch(()=>null),o.loadModels()]),await ee(),await ke();const q=await J().catch(()=>[]);c(q),await ie();const te=q[0],He=e.activeWorkspaceId;!(He!==null&&A.value.some(Rt=>Rt.id===He))&&te&&ae(N(te)),et();const it=typeof window<"u"?f2(window.location):void 0;!e.activeSessionId&&it!==void 0&&(e.sessions.some(ts=>ts.id===it)||await Re(it))&&await mt(it,{urlMode:"replace"}),!e.activeSessionId&&q.length>0&&await mt(q[0].id,{urlMode:"replace"})}catch(ne){i("load",ne)}finally{e.loading=!1,X.value=!0}}async function ie(){try{const ne=ut(),[q,te]=await Promise.all([ne.listWorkspaces().catch(()=>[]),ne.getFsHome().catch(()=>({home:"",recentRoots:[]}))]);e.workspaces=q,e.fsHome=te.home||null,e.recentRoots=te.recentRoots}catch{}}function ae(ne){e.activeWorkspaceId=ne,F(ne)}function U(ne){ae(ne);const q=e.sessions.filter(te=>N(te)===ne);if(q.length>0){const te=q[0];te&&te.id!==e.activeSessionId&&mt(te.id)}else f(void 0),ct(void 0,"push")}function Y(ne){e.hiddenWorkspaceRoots.includes(ne.root)&&(e.hiddenWorkspaceRoots=e.hiddenWorkspaceRoots.filter(He=>He!==ne.root),V(e.hiddenWorkspaceRoots));const q=e.workspaces.findIndex(He=>He.id===ne.id||He.root===ne.root);if(q===-1){e.workspaces=[ne,...e.workspaces];return}const te=[...e.workspaces];te[q]=ne,e.workspaces=te}function ce(ne){if(ne.type==="workspaceCreated"||ne.type==="workspaceUpdated"){Y(ne.workspace);return}const q=e.workspaces.find(He=>He.id===ne.workspaceId)?.root??ne.root;if(q&&!e.hiddenWorkspaceRoots.includes(q)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,q],V(e.hiddenWorkspaceRoots)),e.workspaces=e.workspaces.filter(He=>He.id!==ne.workspaceId&&He.root!==q),e.activeWorkspaceId===ne.workspaceId||e.activeWorkspaceId===q){const He=b.value[0]?.id??null;if(e.activeWorkspaceId=He,He)F(He);else try{Uc(Et.activeWorkspace)}catch{}f(void 0),e.sessionLoading=!1,xe(),ct(void 0,"replace")}}function me(){f(void 0),ct(void 0,"push")}function Se(ne){ae(ne),me(),xe()}async function Ee(ne){const q=A.value.find(te=>te.id===ne);if(q)try{const te=ut();let He,lt=q.root;try{const Rt=await te.addWorkspace({root:q.root});He=Rt.id,lt=Rt.root,Y(Rt)}catch{}const it=await te.createSession({workspaceId:He,cwd:lt});return d(it),ae(it.workspaceId??He??ne),a.add(it.id),await mt(it.id),it}catch(te){i("createSessionInWorkspace",te);return}}async function re(ne,q,te){const He=A.value.find(lt=>lt.id===ne);if(He)try{const lt=ut();let it,Rt=He.root;try{const Dt=await lt.addWorkspace({root:He.root});it=Dt.id,Rt=Dt.root,Y(Dt)}catch{}const ts=o.draftModel.value??void 0,pn=await lt.createSession({workspaceId:it,cwd:Rt,model:ts});o.draftModel.value=null;const ho=ts!==void 0&&(!pn.model||pn.model.length===0)?{...pn,model:ts}:pn;d(ho),ae(pn.workspaceId??it??ne),await mt(pn.id),await wn(pn.id,q,te)}catch(lt){i("startSessionAndSendPrompt",lt)}}async function Te(ne){const q=ne.trim();if(!q)return;const te=ut();try{const He=await te.addWorkspace({root:q});Y(He),Se(He.id)}catch{e.workspaces.find(lt=>lt.root===q)||(e.workspaces=[{id:q,root:q,name:Z(q),isGitRepo:!1,sessionCount:0},...e.workspaces]),Se(q)}}async function Ue(ne){try{return await ut().browseFs(ne)}catch{return{path:"",parent:null,entries:[]}}}async function nt(){try{return await ut().getFsHome()}catch{return{home:"",recentRoots:[]}}}function ct(ne,q){if(q==="none"||typeof window>"u"||!window.history)return;const te=Qae(ne);if(window.location.pathname!==te)try{q==="push"?window.history.pushState(null,"",te):window.history.replaceState(null,"",te)}catch{}}async function Re(ne){try{const q=await ut().getSession(ne);return e.sessions.some(te=>te.id===q.id)||h(q),!0}catch{return!1}}function Pe(){const ne=f2(window.location);if(ne===void 0){f(void 0);return}if(ne!==e.activeSessionId){if(e.sessions.some(q=>q.id===ne)){mt(ne,{urlMode:"none"});return}(async()=>{if(await Re(ne)){await mt(ne,{urlMode:"none"});return}const q=e.sessions[0];q?await mt(q.id,{urlMode:"replace"}):(f(void 0),ct(void 0,"replace"))})()}}let st=!1;function et(){st||typeof window>"u"||(st=!0,window.addEventListener("popstate",Pe))}async function mt(ne,q){const te=v(ne),He=!te&&a.has(ne);a.delete(ne);try{ct(ne,q?.urlMode??"push"),e.sessionLoading=!te&&!He,f(ne),G(),e.unreadBySession[ne]&&(e.unreadBySession={...e.unreadBySession,[ne]:!1},R({[ne]:!1})),xe();const lt=e.sessions.find(it=>it.id===ne);if(lt){const it=N(lt);e.activeWorkspaceId!==it&&ae(it)}if(te)k(ne);else if(await y(ne)==="not-found")return;de(ne)}catch(lt){i("selectSession",lt,{sessionId:ne})}finally{e.activeSessionId===ne&&(e.sessionLoading=!1)}}async function dn(ne,q){try{const He=await ut().createSession({cwd:ne,title:q?.title,model:q?.model});d(He),a.add(He.id),await mt(He.id)}catch(te){i("createSession",te)}}async function wn(ne,q,te){l.add(ne),e.sendingBySession={...e.sendingBySession,[ne]:!0};const He=w();try{const lt=ut(),it=[];q&&it.push({type:"text",text:q});for(const Dt of te??[])Dt.kind==="video"?it.push({type:"video",source:{kind:"file",fileId:Dt.fileId}}):it.push({type:"image",source:{kind:"file",fileId:Dt.fileId}});if(it.length===0)return l.delete(ne),e.sendingBySession={...e.sendingBySession,[ne]:!1},!1;const Rt={id:He,sessionId:ne,role:"user",content:it,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};g(ne,Dt=>[...Dt,Rt]);const ts=e.sessions.find(Dt=>Dt.id===ne),pn=(ts?.model&&ts.model.length>0?ts.model:e.defaultModel)??void 0;if(e.goalMode&&q)try{await lt.updateSession(ne,{goalObjective:q.trim()})}catch(Dt){return i("createGoal",Dt,{sessionId:ne}),l.delete(ne),e.sendingBySession={...e.sendingBySession,[ne]:!1},g(ne,an=>an.some(qn=>qn.id===He)?an.filter(qn=>qn.id!==He):an),!1}const ho=await lt.submitPrompt(ne,{content:it,model:pn,thinking:e.thinking,permissionMode:e.permission,planMode:e.planMode,swarmMode:e.swarmMode});return e.goalMode&&(e.goalMode=!1,P(!1)),e.promptIdBySession={...e.promptIdBySession,[ne]:ho.promptId},g(ne,Dt=>{const an=Dt.findIndex(Po=>Po.id===He);if(an===-1)return Dt;const qn=[...Dt];return qn[an]={...qn[an],promptId:qn[an].promptId??ho.promptId},qn}),S()?.bindNextPromptId(ne,ho.promptId),!0}catch(lt){return l.delete(ne),e.sendingBySession={...e.sendingBySession,[ne]:!1},g(ne,it=>it.some(Rt=>Rt.id===He)?it.filter(Rt=>Rt.id!==He):it),i("sendPrompt",lt,{sessionId:ne}),!1}}async function xt(ne,q){const te=e.activeSessionId;if(te){if(r.value!=="idle"||l.has(te)){Xe(ne,q);return}await wn(te,ne,q)}}async function ln(ne,q){const te=e.activeSessionId;if(!te)return;const He=e.queuedBySession[te]??[],lt=[],it=[];for(const an of He){const qn=an.text.trim();qn&<.push(qn),an.attachments?.length&&it.push(...an.attachments)}const Rt=ne.trim();if(Rt&<.push(Rt),q?.length&&it.push(...q),lt.length===0&&it.length===0)return;He.length>0&&(e.queuedBySession={...e.queuedBySession,[te]:[]});const ts=lt.join(`
|
|
268
|
-
|
|
269
|
-
`);if(r.value==="idle"&&!l.has(te)){await wn(te,ts,it);return}const pn=[];ts&&pn.push({type:"text",text:ts});for(const an of it)an.kind==="video"?pn.push({type:"video",source:{kind:"file",fileId:an.fileId}}):pn.push({type:"image",source:{kind:"file",fileId:an.fileId}});const ho=w(),Dt={id:ho,sessionId:te,role:"user",content:pn,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};g(te,an=>[...an,Dt]);try{const an=ut(),qn=e.sessions.find(js=>js.id===te),Po=(qn?.model&&qn.model.length>0?qn.model:e.defaultModel)??void 0,jn=await an.submitPrompt(te,{content:pn,model:Po,thinking:e.thinking,permissionMode:e.permission,planMode:e.planMode,swarmMode:e.swarmMode});if(g(te,js=>{const Fi=js.findIndex(Hi=>Hi.id===ho);if(Fi===-1)return js;const zo=[...js];return zo[Fi]={...zo[Fi],promptId:zo[Fi].promptId??jn.promptId},zo}),jn.status!=="queued"){e.promptIdBySession={...e.promptIdBySession,[te]:jn.promptId},S()?.bindNextPromptId(te,jn.promptId);return}try{await an.steerPrompts(te,[jn.promptId])}catch{}}catch(an){g(te,qn=>qn.filter(Po=>Po.id!==ho)),i("steer",an,{sessionId:te})}}async function Sn(ne,q){try{const He=await ut().uploadFile({file:ne,name:q});return{fileId:He.id,name:He.name,mediaType:He.mediaType}}catch(te){return i("uploadImage",te),null}}function Xe(ne,q){const te=e.activeSessionId;if(!te)return;const He=e.queuedBySession[te]??[];e.queuedBySession={...e.queuedBySession,[te]:[...He,{text:ne,attachments:q}]}}async function Ln(){const ne=e.activeSessionId;if(!ne)return;const q=e.sessions.find(lt=>lt.id===ne);let te=e.promptIdBySession[ne];if(te===void 0){const lt=q?.currentPromptId;lt?.startsWith("prompt_")&&(te=lt)}const He=ut();if(te!==void 0)try{if((await He.abortPrompt(ne,te)).aborted)return;const it={...e.promptIdBySession};delete it[ne],e.promptIdBySession=it}catch(lt){if(du(lt)&<.code===tce){const it={...e.promptIdBySession};delete it[ne],e.promptIdBySession=it}else{i("abortCurrentPrompt",lt,{sessionId:ne});return}}try{await He.abortSession(ne)}catch(lt){i("abortCurrentPrompt",lt,{sessionId:ne})}}async function es(ne,q){const te=e.activeSessionId;if(te)try{const He=ut(),lt={decision:q.decision,scope:q.scope,feedback:q.feedback};await He.respondApproval(te,ne,lt);const it=e.approvalsBySession[te]??[];e.approvalsBySession={...e.approvalsBySession,[te]:it.filter(Rt=>Rt.approvalId!==ne)}}catch(He){i("respondApproval",He,{sessionId:te})}}async function $s(ne,q){const te=e.activeSessionId;if(te)try{await ut().respondQuestion(te,ne,q);const lt=e.questionsBySession[te]??[];e.questionsBySession={...e.questionsBySession,[te]:lt.filter(it=>it.questionId!==ne)}}catch(He){i("respondQuestion",He,{sessionId:te})}}async function Cn(ne){const q=e.activeSessionId;if(q)try{await ut().dismissQuestion(q,ne);const He=e.questionsBySession[q]??[];e.questionsBySession={...e.questionsBySession,[q]:He.filter(lt=>lt.questionId!==ne)}}catch(te){i("dismissQuestion",te,{sessionId:q})}}async function fn(ne){const q=e.activeSessionId;if(q)try{await ut().cancelTask(q,ne);const He=e.tasksBySession[q]??[];e.tasksBySession={...e.tasksBySession,[q]:He.map(lt=>lt.id===ne?{...lt,status:"cancelled"}:lt)}}catch(te){i("cancelTask",te,{sessionId:q})}}function Hn(ne){e.planMode=ne,$(ne),I({planMode:ne})}function Wn(){Hn(!e.planMode)}function Yn(ne){e.swarmMode=ne,O(ne),I({swarmMode:ne})}function ks(){const ne=!e.swarmMode;ne&&e.permission==="manual"&&!confirm("Enable swarm mode? The agent will run multiple sub agents in parallel.")||Yn(ne)}function Un(ne){e.goalMode=ne,P(ne)}function bs(){Un(!e.goalMode)}async function Ye(ne){const q=ne.trim();if(!q||e.permission==="manual"&&!confirm(`Start goal: "${q}"? The agent will run autonomously toward this objective.`))return;const te=e.activeSessionId;if(te){try{await ut().updateSession(te,{goalObjective:q})}catch(He){i("createGoal",He,{sessionId:te,message:K(He)});return}await xt(q)}}function je(ne){const q=e.activeSessionId;q&&Promise.resolve(ut().updateSession(q,{goalControl:ne})).catch(te=>{i("controlGoal",te,{sessionId:q,message:K(te)})})}function qe(ne){e.permission=ne,D(ne),I({permissionMode:ne})}function Tt(ne){const q=[...e.warnings];q.splice(ne,1),e.warnings=q}async function on(ne,q){try{await ut().updateSession(ne,{title:q}),u(ne,He=>({...He,title:q}))}catch(te){i("renameSession",te,{sessionId:ne})}}function ao(ne,q){e.workspaces=e.workspaces.map(te=>te.id===ne?{...te,name:q}:te)}async function Lo(ne){const q=e.workspaces.find(it=>it.id===ne)?.root??A.value.find(it=>it.id===ne)?.root??ne,te=e.activeSessionId?e.sessions.find(it=>it.id===e.activeSessionId):void 0,He=e.activeWorkspaceId===ne||e.activeWorkspaceId===q,lt=!!(te&&(te.cwd===q||te.workspaceId===ne||N(te)===ne));q&&!e.hiddenWorkspaceRoots.includes(q)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,q],V(e.hiddenWorkspaceRoots));try{await ut().deleteWorkspace(ne)}catch{}if(e.workspaces=e.workspaces.filter(it=>it.id!==ne&&it.root!==q),He||lt){const it=b.value[0]?.id??null;if(e.activeWorkspaceId=it,it)F(it);else try{Uc(Et.activeWorkspace)}catch{}}(He||lt)&&(f(void 0),e.sessionLoading=!1,xe(),ct(void 0,"replace"))}async function Er(ne){try{await ut().archiveSession(ne),p(ne),s.clearSideChatForSession(ne);const{[ne]:te,...He}=e.sideChatUserMessageIdsBySession;if(e.sideChatUserMessageIdsBySession=He,e.activeSessionId===ne){const lt=e.sessions[0];lt?await mt(lt.id,{urlMode:"replace"}):(f(void 0),ct(void 0,"replace"))}}catch(q){i("archiveSession",q,{sessionId:ne})}}async function Oo(){try{await ut().logout(),await ee(),await ue()}catch(ne){i("logout",ne)}}function ci(ne){const q=e.activeSessionId;q&&ut().compactSession(q,ne).catch(te=>{i("compact",te,{sessionId:q})})}async function $e(ne){const q=ne??e.activeSessionId;if(q)try{const te=await ut().forkSession(q);d(te),await mt(te.id)}catch(te){i("fork",te,{sessionId:q})}}async function he(ne=1){const q=e.activeSessionId;if(!q)return null;const te=(()=>{const He=e.messagesBySession[q]??[];for(let lt=He.length-1;lt>=0;lt--){const it=He[lt];if(it.role==="user"&&!(it.metadata?.origin&&it.metadata.origin.kind!=="user"))return it.content.filter(Rt=>Rt.type==="text").map(Rt=>Rt.text).join(`
|
|
270
|
-
`)}return null})();try{return await ut().undoSession(q,ne),await y(q),te}catch(He){return i("undo",He,{sessionId:q}),null}}function We(ne){const q=e.activeSessionId;if(!q)return;const te=e.queuedBySession[q]??[];if(ne<0||ne>=te.length)return;const He=[...te];He.splice(ne,1),e.queuedBySession={...e.queuedBySession,[q]:He}}async function jt(ne){const q=e.activeSessionId;if(!q)return[];try{return(await ut().listDirectory(q,{path:ne,includeGitStatus:!0})).items}catch{return[]}}async function Gt(ne){const q=e.activeSessionId;if(!q)return null;try{const He=await ut().readFile(q,{path:ne});return{path:He.path,content:He.content,encoding:He.encoding,mime:He.mime,languageId:He.languageId,isBinary:He.isBinary,size:He.size,lineCount:He.lineCount}}catch{return null}}const It=10485760;function Nt(ne){const q=e.activeSessionId;return q?ut().getFileDownloadUrl(q,ne):null}async function co(ne,q){const te=e.activeSessionId;if(!te)return!1;try{return await ut().openFile(te,{path:ne,line:q}),!0}catch(He){return i("openFile",He,{sessionId:te}),!1}}async function uo(ne){const q=e.activeSessionId;if(!q)return;const te=M.value.cwd||".";try{await ut().openInApp(q,ne,te)}catch(He){i("openInApp",He,{sessionId:q})}}async function ui(ne){const q=e.activeSessionId;if(!q)return!1;try{return await ut().revealFile(q,{path:ne}),!0}catch(te){return i("revealFile",te,{sessionId:q}),!1}}async function fo(ne){if(/^(https?:|data:|blob:)/i.test(ne))return ne;const q=e.activeSessionId;if(!q)return ne;let te=ne;if(te.startsWith("/")){const He=e.sessions.find(lt=>lt.id===q)?.cwd;if(He&&(te===He||te.startsWith(He.endsWith("/")?He:`${He}/`))){if(te=te.slice(He.length).replace(/^\//,""),!te)return ne}else return ne}try{const lt=await ut().readFile(q,{path:te,length:It});return!lt.isBinary||lt.encoding!=="base64"||lt.truncated?ne:`data:${lt.mime};base64,${lt.content}`}catch{return ne}}async function Bi(ne){const q=e.activeSessionId;if(!q)return[];try{return(await ut().searchFiles(q,{query:ne,limit:20})).items.map(lt=>({path:lt.path,name:lt.name}))}catch{return[]}}return{loadFileDiff:be,clearFileDiff:xe,loadGitStatus:Le,checkAuth:ee,loadConfig:ke,updateConfig:ge,listAllSessionsGlobal:J,load:ue,loadWorkspaces:ie,selectWorkspace:ae,openWorkspace:U,upsertWorkspacePreserveOrder:Y,applyWorkspaceEvent:ce,clearActiveSession:me,openWorkspaceDraft:Se,createSessionInWorkspace:Ee,startSessionAndSendPrompt:re,addWorkspaceByPath:Te,browseFs:Ue,getFsHome:nt,writeSessionUrl:ct,fetchSessionIntoList:Re,onSessionRoutePopState:Pe,bindSessionRoute:et,selectSession:mt,createSession:dn,submitPromptInternal:wn,sendPrompt:xt,steerPrompt:ln,uploadImage:Sn,enqueue:Xe,unqueue:We,abortCurrentPrompt:Ln,respondApproval:es,respondQuestion:$s,dismissQuestion:Cn,cancelTask:fn,setPlanMode:Hn,togglePlanMode:Wn,setSwarmMode:Yn,toggleSwarmMode:ks,setGoalMode:Un,toggleGoalMode:bs,createGoal:Ye,controlGoal:je,setPermission:qe,dismissWarning:Tt,renameSession:on,renameWorkspace:ao,deleteWorkspace:Lo,archiveSession:Er,logout:Oo,compact:ci,forkSession:$e,undo:he,listDir:jt,readFileContent:Gt,getFileDownloadUrl:Nt,openWorkspaceFile:co,openInApp:uo,revealWorkspaceFile:ui,resolveImageUrl:fo,searchFiles:Bi,loadOlderMessages:_e,refreshSessionSidecars:de}}const sce="kimiWeb.optimisticUserMessage";function oce(){return{sessions:[],activeSessionId:void 0,messagesBySession:{},approvalsBySession:{},questionsBySession:{},tasksBySession:{},goalBySession:{},lastSeqBySession:{},compactionBySession:{},warnings:[]}}function ice(e){return{...e,sessions:[...e.sessions],messagesBySession:{...e.messagesBySession},approvalsBySession:{...e.approvalsBySession},questionsBySession:{...e.questionsBySession},tasksBySession:{...e.tasksBySession},goalBySession:{...e.goalBySession},lastSeqBySession:{...e.lastSeqBySession},compactionBySession:{...e.compactionBySession},warnings:[...e.warnings]}}function rce(e,t,n){if(t!==void 0&&n!==void 0&&n>0){const s=e.lastSeqBySession[t]??0;n>s&&(e.lastSeqBySession[t]=n)}}function zm(e){return e.role==="user"&&e.metadata?.[sce]===!0}function lce(e,t){return JSON.stringify(e.content)===JSON.stringify(t.content)}function h2(e){let t="",n=0;for(const s of e.content)s.type==="text"?t+=s.text:(s.type==="image"||s.type==="file")&&(n+=1);return{text:t,media:n}}function ace(e,t){const n=h2(e),s=h2(t);return n.text===s.text&&n.media===s.media}function cce(e,t){const n=t.promptId;if(n!==void 0)for(let s=e.length-1;s>=0;s--){const o=e[s];if(zm(o)&&o.promptId===n)return s}for(let s=e.length-1;s>=0;s--){const o=e[s];if(zm(o)&&lce(o,t))return s}for(let s=e.length-1;s>=0;s--){const o=e[s];if(zm(o)&&ace(o,t))return s}return-1}function uce(e,t,n){let s=!1;const o=e.map(i=>{let r=!1;const l=i.content.map(a=>a.type!=="toolUse"||a.toolCallId!==t?a:(r=!0,{...a,outputLines:[...a.outputLines??[],n]}));return r?(s=!0,{...i,content:l}):i});return s?o:e}function dce(e,t,n){const s=ice(e);switch(rce(s,n.sessionId,n.seq),t.type){case"sessionCreated":{s.sessions.some(i=>i.id===t.session.id)||(s.sessions=[t.session,...s.sessions]);break}case"sessionUpdated":{s.sessions=s.sessions.map(o=>o.id===t.session.id?t.session:o);break}case"sessionDeleted":{const o=t.sessionId;s.sessions=s.sessions.filter(i=>i.id!==o),delete s.messagesBySession[o],delete s.tasksBySession[o],delete s.goalBySession[o],delete s.approvalsBySession[o],delete s.questionsBySession[o],delete s.lastSeqBySession[o],s.activeSessionId===o&&(s.activeSessionId=void 0);break}case"sessionStatusChanged":{s.sessions=s.sessions.map(o=>o.id!==t.sessionId?o:{...o,status:t.status,currentPromptId:t.currentPromptId});break}case"sessionMetaUpdated":{s.sessions=s.sessions.map(o=>o.id===t.sessionId?{...o,title:t.title??o.title,lastPrompt:t.lastPrompt??o.lastPrompt}:o);break}case"sessionUsageUpdated":{s.sessions=s.sessions.map(o=>{if(o.id!==t.sessionId)return o;const i=t.model&&t.model.length>0?t.model:o.model;return{...o,usage:t.usage,model:i}});break}case"historyCompacted":break;case"compactionStarted":{s.compactionBySession={...s.compactionBySession,[t.sessionId]:{status:"running",trigger:t.trigger}};break}case"compactionCompleted":{const o=t.sessionId,i=s.compactionBySession[o],{[o]:r,...l}=s.compactionBySession;if(s.compactionBySession=l,Object.prototype.hasOwnProperty.call(s.messagesBySession,o)){const a=s.messagesBySession[o]??[],c=`compaction_${o}_${n.seq}`;if(!a.some(u=>u.id===c)){const u={trigger:i?.trigger??"auto",tokensBefore:t.tokensBefore,tokensAfter:t.tokensAfter};s.messagesBySession[o]=[...a,{id:c,sessionId:o,role:"assistant",content:t.summary?[{type:"text",text:t.summary}]:[],createdAt:new Date().toISOString(),metadata:{origin:{kind:"compaction_summary"},[x3]:u}}]}}break}case"compactionCancelled":{const{[t.sessionId]:o,...i}=s.compactionBySession;s.compactionBySession=i;break}case"messageCreated":{const o=t.message.sessionId,i=t.message.createdAt;s.sessions=s.sessions.map(a=>a.id===o&&i>a.updatedAt?{...a,updatedAt:i}:a);const r=s.messagesBySession[o]??[];if(!r.some(a=>a.id===t.message.id)){if(t.message.role==="user"){const a=cce(r,t.message);if(a!==-1){const c=[...r],u=c[a];c[a]={...t.message,id:u.id,promptId:t.message.promptId??u.promptId,metadata:{...t.message.metadata,...u.metadata}},s.messagesBySession[o]=c;break}}s.messagesBySession[o]=[...r,t.message]}break}case"messageUpdated":{const o=t.sessionId,i=s.messagesBySession[o]??[];s.messagesBySession[o]=i.map(r=>r.id!==t.messageId?r:{...r,content:t.content,durationMs:t.durationMs??r.durationMs});break}case"assistantDelta":{const o=t.sessionId,i=s.messagesBySession[o]??[];s.messagesBySession[o]=i.map(r=>{if(r.id!==t.messageId)return r;const l=[...r.content],a=t.contentIndex;for(;l.length<=a;)l.push({type:"text",text:""});const c=l[a];let u;return t.delta.text!==void 0?c.type==="text"?u={type:"text",text:c.text+t.delta.text}:u={type:"text",text:t.delta.text}:t.delta.thinking!==void 0?c.type==="thinking"?u={type:"thinking",thinking:c.thinking+t.delta.thinking,signature:c.signature}:u={type:"thinking",thinking:t.delta.thinking}:u=c,l[a]=u,{...r,content:l}});break}case"toolOutput":{const o=t.sessionId,i=s.messagesBySession[o]??[];s.messagesBySession[o]=uce(i,t.toolCallId,t.outputChunk);break}case"approvalRequested":{const o=t.sessionId,i=s.approvalsBySession[o]??[];i.some(l=>l.approvalId===t.approval.approvalId)||(s.approvalsBySession[o]=[...i,t.approval]);break}case"approvalResolved":case"approvalExpired":{const o=t.sessionId,i=t.approvalId,r=s.approvalsBySession[o]??[];s.approvalsBySession[o]=r.filter(l=>l.approvalId!==i);break}case"questionRequested":{const o=t.sessionId,i=s.questionsBySession[o]??[];i.some(l=>l.questionId===t.question.questionId)||(s.questionsBySession[o]=[...i,t.question]);break}case"questionAnswered":case"questionDismissed":case"questionExpired":{const o=t.sessionId,i=t.questionId,r=s.questionsBySession[o]??[];s.questionsBySession[o]=r.filter(l=>l.questionId!==i);break}case"taskCreated":{const o=t.sessionId,i=s.tasksBySession[o]??[],r=i.findIndex(l=>l.id===t.task.id);if(r===-1)s.tasksBySession[o]=[...i,t.task];else{const l=[...i];l[r]=t.task,s.tasksBySession[o]=l}break}case"taskProgress":{const o=t.sessionId,i=s.tasksBySession[o]??[];s.tasksBySession[o]=i.map(r=>{if(r.id!==t.taskId)return r;const l=r.outputLines??[];return l.at(-1)===t.outputChunk?r:{...r,outputLines:[...l,t.outputChunk].slice(-40)}});break}case"taskCompleted":{const o=t.sessionId,i=s.tasksBySession[o]??[];s.tasksBySession[o]=i.map(r=>r.id!==t.taskId?r:{...r,status:t.status,outputPreview:t.outputPreview,outputBytes:t.outputBytes});break}case"goalUpdated":{const o=t.sessionId;t.goal===null||t.goal.status==="complete"?delete s.goalBySession[o]:s.goalBySession[o]=t.goal;break}case"configChanged":{s.config=t.config;break}case"agentDelta":case"agentTurnEnded":break;case"unknown":{const o=t.raw;if(!(o&&o._noop===!0))if(o&&(o._agentError||o._agentWarning)){const i=o._agentError?$n.global.t("warnings.errorLabel"):$n.global.t("warnings.noteLabel"),r=o.message??o.code??"agent error";s.warnings=[...s.warnings,`${i}: ${r}`]}else{const i=o?.type??"(unknown)";s.warnings=[...s.warnings,`Unhandled event: ${i}`]}break}}return s}function fce(e){return e==="in_progress"?"in_progress":e==="done"||e==="completed"?"done":"pending"}function hce(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.role==="assistant")for(let s=n.content.length-1;s>=0;s--){const o=n.content[s];if(o.type!=="toolUse"||ou(o.toolName)!=="todo")continue;let i=o.input;if(typeof i=="string")try{i=JSON.parse(i)}catch{continue}const r=i?.todos;if(Array.isArray(r))return r.flatMap(l=>{const a=l??{},c=typeof a.title=="string"?a.title:typeof a.content=="string"?a.content:"";return c?[{title:c,status:fce(a.status)}]:[]})}}return[]}const pce=["queued","working","suspended","completed","failed"];function mce(e){return e.subagentPhase?e.subagentPhase:e.status==="completed"?"completed":e.status==="failed"?"failed":"working"}function gce(){return{queued:0,working:0,suspended:0,completed:0,failed:0}}function vce(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||n.swarmIndex===void 0)continue;const s=n.parentToolCallId??"swarm",o=t.get(s)??[];o.push({id:n.id,name:n.description,subagentType:n.subagentType,phase:mce(n),summary:n.outputPreview,outputLines:n.outputLines,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex}),t.set(s,o)}return[...t.entries()].map(([n,s])=>{const o=s.toSorted((r,l)=>r.swarmIndex-l.swarmIndex||r.id.localeCompare(l.id)),i=gce();for(const r of o)i[r.phase]++;return{id:n,members:o,counts:i}}).filter(n=>n.members.length>1).toSorted((n,s)=>{const o=n.members.at(0)?.swarmIndex??0,i=s.members.at(0)?.swarmIndex??0;return o!==i?o-i:n.id.localeCompare(s.id)})}function yce(e){let t=0,n=0;for(const s of e){n+=s.members.length;for(const o of pce)(o==="completed"||o==="failed")&&(t+=s.counts[o])}return{done:t,total:n}}const Ys=kae(),Rd=Sae(),A3=Et.permission,E3=Et.activeWorkspace,I3=Et.thinking,$3=Et.planMode,N3=Et.swarmMode,L3=Et.goalMode,p2=40401,O3=Et.onboarded,kce=["off","low","medium","high","xhigh","max"];Uc(Et.codeFont);function bce(){try{const e=_n(A3);if(e==="auto"||e==="yolo"||e==="manual")return e}catch{}return"manual"}function _ce(e){try{In(A3,e)}catch{}}function wce(){try{const e=_n(I3);if(e&&kce.includes(e))return e}catch{}return"high"}function Sce(e){try{In(I3,e)}catch{}}function Cce(){try{return _n($3)==="true"}catch{return!1}}function xce(e){try{In($3,e?"true":"false")}catch{}}function Tce(){try{return _n(N3)==="true"}catch{return!1}}function Mce(e){try{In(N3,e?"true":"false")}catch{}}function Ace(){try{return _n(L3)==="true"}catch{return!1}}function Ece(e){try{In(L3,e?"true":"false")}catch{}}function Ice(){try{return _n(E3)}catch{return null}}const P3=Et.hiddenWorkspaces;function $ce(){try{const e=_n(P3);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function Nce(e){try{In(P3,JSON.stringify(e))}catch{}}function Lce(e){try{In(E3,e)}catch{}}function R3(e){const t=e.split("/").filter(Boolean);return t.length>0?t[t.length-1]:e}function Oce(e,t){if(t&&e.startsWith(t)){const s=e.slice(t.length);return s?`~${s}`:"~"}const n=e.match(/^\/(?:Users|home)\/[^/]+(\/.*)?$/);return n?`~${n[1]??""}`:e}const Ce=Js({...oce(),connected:!1,serverVersion:"",workspaceName:"kimi-web",connection:"disconnected",permission:bce(),thinking:wce(),planMode:Cce(),swarmMode:Tce(),goalMode:Ace(),loading:!1,sessionLoading:!1,queuedBySession:{},gitStatusBySession:{},promptIdBySession:{},sendingBySession:{},unreadBySession:Y1(),authReady:!1,defaultModel:null,managedProviderStatus:null,workspaces:[],activeWorkspaceId:Ice(),fsHome:null,recentRoots:[],hiddenWorkspaceRoots:$ce(),availableOpenInApps:[],config:null,sideChatMessagesByAgent:{},sideChatSendingByAgent:{},sideChatUserMessageIdsBySession:{},messagesLoadingMoreBySession:{},messagesHasMoreBySession:{},messagesLoadMoreErrorBySession:{}});function D3(e){Ce.sessions=e}function Ih(e,t){Ce.sessions=Ce.sessions.map(n=>n.id===e?t(n):n)}function Pce(e){Ce.sessions=[e,...Ce.sessions.filter(t=>t.id!==e.id)]}function Rce(e){Ce.sessions=[...Ce.sessions,e]}function Dce(e){Ce.sessions=Ce.sessions.filter(t=>t.id!==e)}function B3(){const e=Ce.activeSessionId;e&&Ce.unreadBySession[e]&&typeof document<"u"&&document.visibilityState==="visible"&&(Ce.unreadBySession={...Ce.unreadBySession,[e]:!1},X1({[e]:!1}))}typeof window<"u"&&window.addEventListener("storage",e=>{e.key===Et.unread&&(Ce.unreadBySession=Y1(),B3())});typeof document<"u"&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&B3()});function zv(e){Ce.activeSessionId=e}function Bce(e){Ce.messagesBySession=e}function Fce(e,t){Ce.messagesBySession={...Ce.messagesBySession,[e]:t}}function F3(e,t){Ce.messagesBySession={...Ce.messagesBySession,[e]:t(Ce.messagesBySession[e]??[])}}function Hce(e){const{[e]:t,...n}=Ce.messagesBySession;Ce.messagesBySession=n}function H3(e){ri?.unsubscribe(e),Dce(e),Hce(e),delete Ce.approvalsBySession[e],delete Ce.questionsBySession[e],delete Ce.tasksBySession[e],delete Ce.goalBySession[e],delete Ce.gitStatusBySession[e],delete Ce.lastSeqBySession[e],delete Ce.compactionBySession[e],delete Ce.messagesLoadingMoreBySession[e],delete Ce.messagesHasMoreBySession[e],delete Ce.messagesLoadMoreErrorBySession[e],delete Lh[e],X3.delete(e),Nh.delete(e),delete Ce.queuedBySession[e],delete Ce.promptIdBySession[e],delete Ce.sendingBySession[e]}const W3=se(null),U3=se([]),q3=se(!1),j3=se(!1);async function $h(e){let t;try{t=await ut().getSessionStatus(e)}catch{return}Ih(e,n=>({...n,model:t.model||n.model,usage:{...n.usage,contextTokens:t.contextTokens,contextLimit:t.maxContextTokens}})),Ce.swarmMode=t.swarmMode,Ce.planMode=t.planMode}function z3(e){const t=Ce.activeSessionId;t&&Promise.resolve(ut().updateSession(t,e)).then(()=>$h(t)).catch(()=>{})}const V3=Et.betaToc;function Wce(){try{return _n(V3)==="true"}catch{return!1}}function Uce(e){try{In(V3,e?"true":"false")}catch{}}const K3=se(Wce());function qce(e){K3.value=e,Uce(e)}function jce(e){try{return _n(e)??""}catch{return""}}const G3=se(jce(O3)==="1");function zce(e){G3.value=e;try{In(O3,e?"1":"0")}catch{}}let ri=null,m2=0;function Y3(){return m2+=1,`msg_opt_${Date.now().toString(36)}_${m2}`}const Nh=new Set;function Vce(e,t,n){const s={sessions:Ce.sessions,activeSessionId:Ce.activeSessionId,messagesBySession:Ce.messagesBySession,approvalsBySession:Ce.approvalsBySession,questionsBySession:Ce.questionsBySession,tasksBySession:Ce.tasksBySession,goalBySession:Ce.goalBySession,lastSeqBySession:Ce.lastSeqBySession,compactionBySession:Ce.compactionBySession,config:Ce.config,warnings:Ce.warnings},o=dce(s,e,{sessionId:t,seq:n});D3(o.sessions),zv(o.activeSessionId),Bce(o.messagesBySession),Ce.approvalsBySession=o.approvalsBySession,Ce.questionsBySession=o.questionsBySession,Ce.tasksBySession=o.tasksBySession,Ce.goalBySession=o.goalBySession,Ce.lastSeqBySession=o.lastSeqBySession,Ce.compactionBySession=o.compactionBySession,Ce.config=o.config??null,Ce.warnings=o.warnings,e.type==="configChanged"&&(Ce.defaultModel=e.config.defaultModel??null),e.type==="sessionUsageUpdated"&&e.sessionId===Ce.activeSessionId&&e.swarmMode!==void 0&&(Ce.swarmMode=e.swarmMode),e.type==="sessionUsageUpdated"&&e.sessionId===Ce.activeSessionId&&e.planMode!==void 0&&(Ce.planMode=e.planMode)}function Vv(){if(ri!==null||typeof WebSocket>"u")return;Ce.connection="connecting",ri=ut().connectEvents({onEvent(t,n){if(t.type==="workspaceCreated"||t.type==="workspaceUpdated"||t.type==="workspaceDeleted"){ft.applyWorkspaceEvent(t);return}Vce(t,n.sessionId,n.seq);const s=ps.sideChatTargetBySession.value[n.sessionId];if(s){const{agentId:o}=s,i=n.sessionId;t.type==="agentDelta"&&t.agentId===o?t.delta.text&&ps.appendSideChatAssistantText(o,i,t.delta.text):t.type==="agentTurnEnded"&&t.agentId===o?ps.finishSideChatAgent(o,i):t.type==="taskProgress"&&t.taskId===o?ps.appendSideChatAssistantText(o,i,t.outputChunk):t.type==="taskCompleted"&&t.taskId===o&&ps.finishSideChatAgent(o,i,t.outputPreview)}if(t.type==="messageCreated"&&t.message.role==="user"&&t.message.promptId!==void 0){const o=t.message.sessionId;Ce.promptIdBySession[o]!==t.message.promptId&&(Ce.promptIdBySession={...Ce.promptIdBySession,[o]:t.message.promptId})}t.type==="assistantDelta"&&n.sessionId===Ce.activeSessionId&&Ys.recordMoonDelta((t.delta.text?.length??0)+(t.delta.thinking?.length??0)),t.type==="sessionStatusChanged"&&(t.status==="idle"||t.status==="aborted")&&nde(t.sessionId,t.status)},onResync(t,n,s){s!==void 0&&(Lh[t]=s),Q3(t)},onError(t,n,s){J3({severity:"error",title:$n.global.t("warnings.wsTitle"),message:n,details:[Zn("message",n)].filter(o=>o!==void 0)})},onConnectionChange(t){Ce.connected=t,Ce.connection=t?"connected":"disconnected"}})}const Lh={},X3=new Set;function Kce(e){return du(e)&&e.code===p2?!0:typeof e=="object"&&e!==null&&e.code===p2}function Zn(e,t){if(!(t==null||t===""))return{label:$n.global.t(`warnings.details.${e}`),value:Z3(t)}}function Z3(e){if(e instanceof Error)return e.message?`${e.name}: ${e.message}`:e.name;if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean"||typeof e=="bigint")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function Gce(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.name=="string"?e.name:void 0}function Yce(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.message=="string"?e.message:void 0}function Xce(e,t,n){const s=[Zn("operation",e),Zn("sessionId",n)];return y3(t)?s.push(Zn("request",`${t.method} ${t.path}`),Zn("endpoint",t.url),Zn("requestId",t.requestId),Zn("phase",t.phase),Zn("timeout",`${t.timeoutMs}ms`),Zn("status",t.status===void 0?void 0:`${t.status} ${t.statusText??""}`.trim()),Zn("contentType",t.contentType),Zn("responsePreview",t.bodyPreview),Zn("cause",t.cause)):du(t)?s.push(Zn("code",t.code),Zn("requestId",t.requestId),Zn("message",t.message),Zn("details",t.details)):s.push(Zn("errorName",Gce(t)),Zn("message",Yce(t)??Z3(t))),s.filter(o=>o!==void 0)}function Zce(e,t,n={}){const s=y3(t),o=du(t),i=n.title??(s?$n.global.t("warnings.daemonNetworkTitle"):o?$n.global.t("warnings.daemonApiTitle"):$n.global.t("warnings.operationFailedTitle")),r=n.message??(s?$n.global.t("warnings.daemonNetworkMessage"):o?t.message:$n.global.t("warnings.operationFailedMessage"));return{severity:"error",title:i,message:r,details:Xce(e,t,n.sessionId)}}function J3(e){Ce.warnings=[...Ce.warnings,e]}function Oh(e,t,n){J3(Zce(e,t,n))}const Jce={40913:"warnings.goal.alreadyExists",40914:"warnings.goal.notFound",40915:"warnings.goal.statusInvalid",40916:"warnings.goal.notResumable",40918:"warnings.goal.objectiveTooLong"};function Qce(e){if(!du(e))return;const t=Jce[e.code];return t?$n.global.t(t):void 0}async function eue(e){if(H3(e),Ce.activeSessionId!==e)return;const t=Ce.sessions[0];t?await ft.selectSession(t.id,{urlMode:"replace"}):(zv(void 0),Ce.sessionLoading=!1,ft.writeSessionUrl(void 0,"replace"))}async function Q3(e){try{const n=await ut().getSessionSnapshot(e);return Ih(e,s=>({...n.session,model:n.session.model&&n.session.model.length>0?n.session.model:s.model})),Fce(e,n.messages),Ce.messagesHasMoreBySession={...Ce.messagesHasMoreBySession,[e]:n.hasMoreMessages},Ce.approvalsBySession={...Ce.approvalsBySession,[e]:n.pendingApprovals},Ce.questionsBySession={...Ce.questionsBySession,[e]:n.pendingQuestions},Ce.lastSeqBySession={...Ce.lastSeqBySession,[e]:n.asOfSeq},Lh[e]=n.epoch,Vv(),ri&&(ri.seedSnapshot(e,n),ri.subscribe(e,{seq:n.asOfSeq,epoch:n.epoch})),"ok"}catch(t){return Kce(t)?(await eue(e),"not-found"):(Oh("getSessionSnapshot",t,{title:$n.global.t("warnings.sessionSnapshotTitle"),message:$n.global.t("warnings.sessionSnapshotMessage"),sessionId:e}),"failed")}}function tue(e){return Object.prototype.hasOwnProperty.call(Ce.messagesBySession,e)}function nue(e){if(Vv(),ri){const t=Ce.lastSeqBySession[e]??0,n=Lh[e];ri.subscribe(e,{seq:t,epoch:n})}}function Ph(e){const t=Ce.sessions.find(i=>i.id===e);if(!t||t.status!=="running")return!1;const n=ps.sideChatTargetBySession.value[e]?.agentId,o=(Ce.tasksBySession[e]??[]).filter(i=>i.status==="running");return o.length===0?!(n&&Ce.sideChatSendingByAgent[n]):o.some(i=>i.id!==n)}function Kv(e,t){try{const n=new Date(e),o=Date.now()-n.getTime(),i=o/36e5;return o<6e4?$n.global.t("sessions.justNow"):i<1?`${Math.round(o/6e4)}m`:i<24?`${Math.round(i)}h`:n.toLocaleDateString($n.global.locale.value,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return e}}const sue=3e4,Zc=se(0);let Vm=null;function oue(){Vm===null&&(Vm=setInterval(()=>{Zc.value=(Zc.value+1)%Number.MAX_SAFE_INTEGER},sue),Vm.unref?.())}function iue(e,t){const n=e.split(`
|
|
271
|
-
`),s=t.split(`
|
|
272
|
-
`),o=[];return n.forEach((i,r)=>{o.push({kind:"rem",gutter:String(r+1),text:`- ${i}`})}),s.forEach((i,r)=>{o.push({kind:"add",gutter:String(r+1),text:`+ ${i}`})}),o}function rue(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const s=typeof t.path=="string"?t.path:"";return Array.isArray(t.diff)?{kind:"diff",path:s,diff:t.diff}:typeof t.old_text=="string"&&typeof t.new_text=="string"?{kind:"diff",path:s,diff:iue(t.old_text,t.new_text)}:{kind:"diff",path:s,diff:[]}}if(n==="shell"||n==="command"){const s=typeof t.command=="string"?t.command:e.action,o=typeof t.cwd=="string"?t.cwd:void 0,i=typeof t.danger=="string"?t.danger:void 0;return{kind:"shell",command:s,cwd:o,danger:i}}if(n==="file_content"||n==="file"){const s=typeof t.path=="string"?t.path:"",o=typeof t.content=="string"?t.content:"",i=typeof t.language=="string"?t.language:void 0;return{kind:"file",path:s,content:o,language:i}}if(n==="file_op"||n==="fileop"){const s=typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,o=typeof t.path=="string"?t.path:"",i=typeof t.detail=="string"?t.detail:void 0;return{kind:"fileop",op:s,path:o,detail:i}}if(n==="url_fetch"||n==="url"){const s=typeof t.url=="string"?t.url:e.action;return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:s}}if(n==="search"){const s=typeof t.query=="string"?t.query:e.action,o=typeof t.scope=="string"?t.scope:void 0;return{kind:"search",query:s,scope:o}}if(n==="invocation"||n==="agent_call"||n==="skill_call"){const s=typeof t.kind=="string"?t.kind:n,o=typeof t.name=="string"?t.name:e.toolName,i=typeof t.description=="string"?t.description:void 0;return{kind:"invocation",kind2:s,name:o,description:i}}return n==="todo"||n==="todo_list"?{kind:"todo",items:(Array.isArray(t.items)?t.items:[]).map(i=>{const r=i??{};return{title:typeof r.title=="string"?r.title:"",status:typeof r.status=="string"?r.status:"pending"}})}:{kind:"generic",summary:e.action}}function lue(e){return{questionId:e.questionId,sessionId:e.sessionId,questions:e.questions.map(t=>({id:t.id,question:t.question,header:t.header,body:t.body,options:t.options.map(n=>({id:n.id,label:n.label,description:n.description,recommended:n.recommended})),multiSelect:t.multiSelect,allowOther:t.allowOther,otherLabel:t.otherLabel}))}}function aue(e){const t=Ce.messagesBySession[e.sessionId];if(!t||t.length===0)return;const n=new Map;for(const o of t)if(o.role==="assistant")for(const i of o.content){if(i.type!=="toolUse"||i.toolName!=="Bash"&&i.toolName!=="bash")continue;const r=i.input,l=r&&typeof r.command=="string"?r.command:void 0;l&&n.set(i.toolCallId,l)}if(n.size===0)return;const s=`task_id: ${e.id}`;for(const o of t)if(o.role==="tool")for(const i of o.content){if(i.type!=="toolResult")continue;if((typeof i.output=="string"?i.output:i.output!==void 0?JSON.stringify(i.output):"").includes(s)){const l=n.get(i.toolCallId);if(l)return l}}}function cue(e){let t;e.status==="running"?t="run":e.status==="completed"?t="done":t="fail";let n="";if(e.status==="running"&&e.startedAt){const r=Math.round((Date.now()-new Date(e.startedAt).getTime())/1e3),l=Math.floor(r/60),a=r%60;n=$n.global.t("tasks.timingRunning",{time:`${l}:${String(a).padStart(2,"0")}`})}else if(e.completedAt&&e.startedAt){const r=Math.round((new Date(e.completedAt).getTime()-new Date(e.startedAt).getTime())/1e3);n=$n.global.t("tasks.timingDone",{sec:r})}else n=e.status;const s=e.outputLines&&e.outputLines.length>0?e.outputLines:e.outputPreview?e.outputPreview.split(/\r?\n/):void 0,o=e.command??aue(e),i=e.kind==="bash"&&o?`$ ${o}`:void 0;return{id:e.id,name:e.description,kind:e.kind,state:t,timing:n,meta:i,output:s}}const uue=H(()=>{const e=Ce.sessions.find(n=>n.id===Ce.activeSessionId),t=e?e.cwd.split("/").pop()??e.cwd:"main";return{name:Ce.workspaceName,branch:t}}),due=H(()=>(Zc.value,Ce.sessions.toSorted((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()).map(e=>({id:e.id,title:e.title,time:Kv(e.updatedAt,e.status),status:e.status,busy:Ph(e.id)})))),fue=H(()=>Ce.activeSessionId??""),hue=H(()=>{const e=Ce.activeSessionId;return e?On.skillsBySession.value[e]??[]:[]}),pue=H(()=>{const e=Ce.activeSessionId;return e?Ce.sendingBySession[e]??!1:!1}),ps=Xae(Ce,{pushOperationFailure:Oh,nextOptimisticMsgId:Y3,connectEventsIfNeeded:Vv,getEventConn:()=>ri}),Rh=H(()=>{const e=Ce.activeSessionId;if(!e)return[];const t=ps.sideChatTargetBySession.value[e]?.agentId;return(Ce.tasksBySession[e]??[]).filter(n=>n.id!==t)}),eM=Tae(Ce,Rh),mue=H(()=>{const e=Ce.activeSessionId;if(!e)return[];const t=new Set(Ce.sideChatUserMessageIdsBySession[e]??[]),n=(Ce.messagesBySession[e]??[]).filter(o=>!t.has(o.id)),s=Ce.approvalsBySession[e]??[];return M3(n,s,o=>ut().getFileUrl(o),Dh.value!=="idle",Rh.value)}),gue=H(()=>(eM.taskClock.value,Rh.value.map(cue))),tM=H(()=>vce(Rh.value)),Wl=H(()=>{const e=Ce.activeSessionId;return e?Ce.goalBySession[e]??null:null}),vue=H(()=>{const e=Ce.activeSessionId;return e?hce(Ce.messagesBySession[e]??[]):[]}),yue=H(()=>{const e=Ce.activeSessionId;return e?Ce.compactionBySession[e]??null:null}),kue=H(()=>Ce.connection),bue=H(()=>Ce.loading),_ue=H(()=>Ce.sessionLoading),wue=H(()=>{const e=Ce.activeSessionId;return e?Ce.messagesLoadingMoreBySession[e]??!1:!1}),Sue=H(()=>{const e=Ce.activeSessionId;return e?Ce.messagesHasMoreBySession[e]??!1:!1}),Cue=H(()=>{const e=Ce.activeSessionId;return e?Ce.messagesLoadMoreErrorBySession[e]??!1:!1}),xue=H(()=>Ce.serverVersion),Tue=H(()=>Ce.permission),Mue=H(()=>Ce.thinking),Aue=H(()=>Ce.planMode),Eue=H(()=>Ce.swarmMode),Iue=H(()=>Ce.goalMode),$ue=H(()=>{const e=yce(tM.value);return{plan:Ce.planMode,goal:Wl.value&&Wl.value.status!=="complete"?{status:Wl.value.status,turnsUsed:Wl.value.turnsUsed,elapsedMs:Wl.value.wallClockMs}:null,swarm:e.total>0?e:null}}),Nue=H(()=>{const e=Ce.activeSessionId;return e?(Ce.queuedBySession[e]??[]).map(t=>({text:t.text,attachmentCount:t.attachments?.length??0})):[]}),Lue=H(()=>Ce.warnings),Oue=H(()=>{const e=Ce.activeSessionId;return e?(Ce.questionsBySession[e]??[]).map(lue):[]}),Pue=H(()=>{const e=Ce.activeSessionId;return e?(Ce.approvalsBySession[e]??[]).map(t=>({approvalId:t.approvalId,block:rue(t),agentName:t.agentName})):[]}),Dh=H(()=>{const e=Ce.activeSessionId;return e?(Ce.approvalsBySession[e]??[]).length>0?"awaiting-approval":(Ce.questionsBySession[e]??[]).length>0?"awaiting-question":Ph(e)?"running":"idle":"idle"}),On=Eae(Ce,{pushOperationFailure:Oh,refreshSessionStatus:$h,persistSessionProfile:z3,activity:Dh,inFlightPromptSessions:Nh,saveThinkingToStorage:Sce,updateSession:Ih,updateSessionMessages:F3}),Bf=H(()=>{const e=Ce.activeSessionId;if(!e)return null;const t=Ce.gitStatusBySession[e];return t?{branch:t.branch,ahead:t.ahead,behind:t.behind}:null}),Rue=H(()=>{const e=Ce.activeSessionId;return e?Ce.gitStatusBySession[e]?.pullRequest??null:null}),Due=H(()=>{const e=Ce.activeSessionId;if(!e)return[];const t=Ce.gitStatusBySession[e];return t?Object.entries(t.entries).map(([n,s])=>({path:n,status:s})).sort((n,s)=>n.path.localeCompare(s.path)):[]}),Bue=H(()=>{const e=Ce.activeSessionId;if(!e)return null;const t=Ce.gitStatusBySession[e];return t?{totalAdditions:t.additions,totalDeletions:t.deletions}:null}),nM=H(()=>{const e=Ce.sessions.find(r=>r.id===Ce.activeSessionId),t=Bf.value?.branch??(e?e.cwd.split("/").pop()??e.cwd:"main"),n=e===void 0?On.draftModel.value:null,s=(e?.model&&e.model.length>0?e.model:n??Ce.defaultModel)??"—",o=On.models.value.find(r=>r.id===s||r.model===s);return{model:o?.displayName||o?.model||(s.includes("/")?s.split("/").pop():s),modelId:o?.id??s,ctxUsed:e?.usage.contextTokens??0,ctxMax:e?.usage.contextLimit??0,permission:Ce.permission,branch:t,cwd:e?.cwd??"",isGitRepo:Bf.value!==null}}),Fue=H(()=>U3.value),Hue=H(()=>Ce.sessions.find(t=>t.id===Ce.activeSessionId)?.usage.totalCostUsd??0),Wue=H(()=>Ce.authReady),Uue=H(()=>Ce.defaultModel),que=H(()=>Ce.managedProviderStatus),jue=H(()=>Ce.config),zue=H(()=>{const e=Ce.activeSessionId;if(!e)return{};const t=Ce.gitStatusBySession[e];return t?{...t.entries}:{}});function fu(e){return Ce.workspaces.find(t=>t.root===e.cwd)?.id??e.workspaceId??e.cwd}const Gv=H(()=>{const e=new Set(Ce.hiddenWorkspaceRoots),t=new Map;for(const a of Ce.workspaces)e.has(a.root)||t.set(a.root,{...a});for(const a of Ce.sessions){const c=a.cwd;c&&(e.has(c)||t.has(c)||t.set(c,{id:a.workspaceId??c,root:c,name:R3(c),isGitRepo:!1,sessionCount:0}))}const n=new Map;for(const a of Ce.sessions){const c=fu(a);n.set(c,(n.get(c)??0)+1)}const s=Bf.value,o=Ce.sessions.find(a=>a.id===Ce.activeSessionId)?.cwd,i=Ce.workspaces.map(a=>a.root),r=[...t.keys()].filter(a=>!i.includes(a));r.sort((a,c)=>a.localeCompare(c));const l=[];for(const a of[...i,...r]){const c=t.get(a),u=n.get(c.id)??n.get(c.root)??(Ce.loading?c.sessionCount:0);let d=c.branch;!d&&s&&o===c.root&&(d=s.branch),l.push({...c,sessionCount:u,branch:d})}return l}),Ff=se(e$());Ge(()=>[Gv.value.map(e=>e.id).join("\0"),Ce.loading],([e,t])=>{if(t)return;const n=e?e.split("\0"):[],s=f$(n,Ff.value);s!==null&&(Ff.value=s,CC(s))});const xa=H(()=>{const e=Gv.value.map(t=>({id:t.id,name:t.name,root:t.root,shortPath:Oce(t.root,Ce.fsHome),branch:t.branch,sessionCount:t.sessionCount}));return h$(e,Ff.value)}),sM=H(()=>{const e=Ce.activeWorkspaceId,t=xa.value;return e&&t.some(n=>n.id===e)?e:t[0]?.id??null}),Vue=H(()=>{const e=sM.value;return e?xa.value.find(t=>t.id===e)??null:null}),Kue=H(()=>{Zc.value;const e=new Set(xa.value.map(t=>t.id));return Ce.sessions.filter(t=>!t.parentSessionId&&e.has(fu(t))).map(t=>({id:t.id,title:t.title,time:Kv(t.updatedAt,t.status),status:t.status,busy:Ph(t.id),lastPrompt:t.lastPrompt}))}),Gue=H(()=>{Zc.value;const e=new Map;for(const t of Ce.sessions.toSorted((n,s)=>new Date(s.updatedAt).getTime()-new Date(n.updatedAt).getTime())){if(t.parentSessionId)continue;const n=fu(t),s={id:t.id,title:t.title,time:Kv(t.updatedAt,t.status),status:t.status,busy:Ph(t.id),updatedAt:t.updatedAt},o=e.get(n)??[];o.push(s),e.set(n,o)}return xa.value.map(t=>({workspace:t,sessions:e.get(t.id)??[]}))});function Yue(e){Ff.value=e,CC(e)}const oM=H(()=>{const e={};for(const[t,n]of Object.entries(Ce.approvalsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);for(const[t,n]of Object.entries(Ce.questionsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);return e}),Xue=H(()=>{const e={};for(const[t,n]of Object.entries(Ce.approvalsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).approvals=n.length);for(const[t,n]of Object.entries(Ce.questionsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).questions=n.length);return e}),Zue=H(()=>{const e={};for(const[t,n]of Object.entries(Ce.unreadBySession))n&&(e[t]=!0);return e}),Jue=H(()=>{const e={},t=oM.value;for(const n of Ce.sessions){const s=t[n.id]??0;if(s<=0)continue;const o=fu(n);e[o]=(e[o]??0)+s}return e}),Que=H(()=>Ce.recentRoots),ede=H(()=>{const e=new Set,t=[];for(const n of Ce.sessions){const s=n.cwd;if(s&&!e.has(s)&&(e.add(s),t.push(s),t.length>=8))break}return t}),tde=H(()=>Ce.availableOpenInApps),ft=nce(Ce,{taskPoller:eM,sideChat:ps,modelProvider:On,pushOperationFailure:Oh,activity:Dh,inFlightPromptSessions:Nh,sessionsKnownEmpty:X3,setSessions:D3,updateSession:Ih,upsertSessionFront:Pce,appendSession:Rce,forgetSession:H3,setActiveSessionId:zv,updateSessionMessages:F3,nextOptimisticMsgId:Y3,getEventConn:()=>ri,syncSessionFromSnapshot:Q3,subscribeToSessionEvents:nue,hasLoadedMessages:tue,refreshSessionStatus:$h,persistSessionProfile:z3,mergedWorkspaces:Gv,workspacesView:xa,status:nM,workspaceIdForSession:fu,savePermissionToStorage:_ce,savePlanModeToStorage:xce,saveSwarmModeToStorage:Mce,saveGoalModeToStorage:Ece,saveUnread:X1,saveActiveWorkspaceToStorage:Lce,saveHiddenWorkspacesToStorage:Nce,goalErrorMessage:Qce,basename:R3,resetFastMoon:Ys.resetFastMoon,initialized:j3,selectedDiffPath:W3,fileDiffLines:U3,fileDiffLoading:q3});function nde(e,t){if(Nh.delete(e),Ce.sendingBySession={...Ce.sendingBySession,[e]:!1},Ce.promptIdBySession[e]!==void 0){const i={...Ce.promptIdBySession};delete i[e],Ce.promptIdBySession=i}e===Ce.activeSessionId?(Ys.resetFastMoon(),ft.loadGitStatus(e),$h(e)):t==="idle"&&(Ce.unreadBySession={...Ce.unreadBySession,[e]:!0},X1({[e]:!0})),Rd.maybeNotifyCompletion(e,{isActiveAndVisible:e===Ce.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible",sessionTitle:Ce.sessions.find(i=>i.id===e)?.title??"",onClick:()=>{ft.selectSession(e)}});const n=Ce.queuedBySession[e]??[];if(n.length===0)return;const[s,...o]=n;Ce.queuedBySession={...Ce.queuedBySession,[e]:o},s!==void 0&&ft.submitPromptInternal(e,s.text,s.attachments).then(i=>{if(!i){const r=Ce.queuedBySession[e]??[];Ce.queuedBySession={...Ce.queuedBySession,[e]:[s,...r]}}})}function sde(){return oue(),{workspace:uue,sessions:due,activeSessionId:fue,workspacesView:xa,visibleWorkspace:Vue,activeWorkspaceId:sM,sessionsForView:Kue,workspaceGroups:Gue,attentionBySession:oM,pendingBySession:Xue,attentionByWorkspace:Jue,unreadBySession:Zue,recentRoots:Que,turns:mue,tasks:gue,todos:vue,goal:Wl,swarms:tM,activationBadges:$ue,compaction:yue,status:nM,sessionCost:Hue,fileDiff:Fue,selectedDiffPath:W3,fileDiffLoading:q3,changes:Due,gitInfo:Bf,gitDiffStats:Bue,activePullRequest:Rue,changesByPath:zue,pendingApprovals:Pue,recentCwds:ede,availableOpenInApps:tde,connection:kue,loading:bue,sessionLoading:_ue,loadingMoreMessages:wue,hasMoreMessages:Sue,loadMoreMessagesError:Cue,serverVersion:xue,initialized:j3,permission:Tue,thinking:Mue,planMode:Aue,swarmMode:Eue,goalMode:Iue,queued:Nue,warnings:Lue,questions:Oue,activity:Dh,isSending:pue,fastMoon:Ys.fastMoon,models:On.models,starredModelIds:On.starredModelIds,providers:On.providers,theme:Ys.theme,setTheme:Ys.setTheme,toggleTheme:Ys.toggleTheme,uiFontSize:Ys.uiFontSize,setUiFontSize:Ys.setUiFontSize,betaToc:K3,setBetaToc:qce,colorScheme:Ys.colorScheme,setColorScheme:Ys.setColorScheme,accent:Ys.accent,setAccent:Ys.setAccent,notifyOnComplete:Rd.notifyOnComplete,notifyPermission:Rd.notifyPermission,setNotifyOnComplete:Rd.setNotifyOnComplete,onboarded:G3,setOnboarded:zce,load:ft.load,selectSession:ft.selectSession,createSession:ft.createSession,loadOlderMessages:ft.loadOlderMessages,loadWorkspaces:ft.loadWorkspaces,selectWorkspace:ft.selectWorkspace,openWorkspace:ft.openWorkspace,openWorkspaceDraft:ft.openWorkspaceDraft,createSessionInWorkspace:ft.createSessionInWorkspace,startSessionAndSendPrompt:ft.startSessionAndSendPrompt,addWorkspaceByPath:ft.addWorkspaceByPath,browseFs:ft.browseFs,getFsHome:ft.getFsHome,sendPrompt:ft.sendPrompt,steerPrompt:ft.steerPrompt,sideChatVisible:ps.sideChatVisible,sideChatSessionId:ps.sideChatSessionId,sideChatTurns:ps.sideChatTurns,sideChatRunning:ps.sideChatRunning,sideChatSending:ps.sideChatSending,openSideChat:ps.openSideChat,closeSideChat:ps.closeSideChat,sendSideChatPrompt:ps.sendSideChatPrompt,uploadImage:ft.uploadImage,abortCurrentPrompt:ft.abortCurrentPrompt,respondApproval:ft.respondApproval,respondQuestion:ft.respondQuestion,dismissQuestion:ft.dismissQuestion,cancelTask:ft.cancelTask,setPermission:ft.setPermission,setThinking:On.setThinking,setPlanMode:ft.setPlanMode,togglePlanMode:ft.togglePlanMode,setSwarmMode:ft.setSwarmMode,toggleSwarmMode:ft.toggleSwarmMode,setGoalMode:ft.setGoalMode,toggleGoalMode:ft.toggleGoalMode,createGoal:ft.createGoal,controlGoal:ft.controlGoal,enqueue:ft.enqueue,dismissWarning:ft.dismissWarning,renameSession:ft.renameSession,renameWorkspace:ft.renameWorkspace,deleteWorkspace:ft.deleteWorkspace,reorderWorkspaces:Yue,archiveSession:ft.archiveSession,compact:ft.compact,forkSession:ft.forkSession,undo:ft.undo,unqueue:ft.unqueue,searchFiles:ft.searchFiles,loadGitStatus:ft.loadGitStatus,loadFileDiff:ft.loadFileDiff,clearFileDiff:ft.clearFileDiff,listDir:ft.listDir,readFileContent:ft.readFileContent,getFileDownloadUrl:ft.getFileDownloadUrl,openWorkspaceFile:ft.openWorkspaceFile,openInApp:ft.openInApp,revealWorkspaceFile:ft.revealWorkspaceFile,resolveImageUrl:ft.resolveImageUrl,refreshOAuthProviderModels:On.refreshOAuthProviderModels,loadModels:On.loadModels,loadProviders:On.loadProviders,skills:hue,activateSkill:On.activateSkill,setModel:On.setModel,toggleStarModel:On.toggleStarModel,addProvider:On.addProvider,deleteProvider:On.deleteProvider,refreshProvider:On.refreshProvider,authReady:Wue,defaultModel:Uue,managedProviderStatus:que,config:jue,updateConfig:ft.updateConfig,checkAuth:ft.checkAuth,startOAuthLogin:On.startOAuthLogin,pollOAuthLogin:On.pollOAuthLogin,cancelOAuthLogin:On.cancelOAuthLogin,logout:ft.logout}}function ode({client:e,authLogoRef:t}){const n=H(()=>e.authReady.value),s=H(()=>e.initialized.value&&!n.value),o="/login",i=se(null);let r=null;function l(){return typeof window>"u"?"/":`${window.location.pathname}${window.location.search}${window.location.hash}`}function a(u){typeof window>"u"||window.history.replaceState(window.history.state,"",u)}Ge(s,u=>{if(!(typeof window>"u")){if(u){window.location.pathname!==o&&(i.value=l(),a(o));return}window.location.pathname===o&&(a(i.value??"/"),i.value=null)}},{immediate:!0});function c(){const u=t.value;u&&(u.classList.remove("blink-now"),u.getBoundingClientRect(),u.classList.add("blink-now"),r!==null&&clearTimeout(r),r=setTimeout(()=>{r=null,u.classList.remove("blink-now")},300))}return Ht(()=>{r!==null&&clearTimeout(r)}),{showAuthGate:s,blinkAuthLogo:c}}function ide({running:e,showAuthGate:t}){const{t:n}=St(),s=["◐","◓","◑","◒"],o=se(0);let i=null;function r(){i===null&&(o.value=0,i=setInterval(()=>{o.value=(o.value+1)%s.length},250))}function l(){i!==null&&(clearInterval(i),i=null),o.value=0}Ge(e,c=>{c?r():l()},{immediate:!0});const a=H(()=>{const c=e.value?`${s[o.value]} `:"";return t.value?`${c}${n("app.authPageTitle")} - Kimi Code Web`:`${c}Kimi Code Web`});QA(()=>{typeof document<"u"&&(document.title=a.value)}),Ht(()=>{l()})}const iM=se(typeof window>"u"?0:window.innerWidth);let vd=0,Hf=!1;function g1(){iM.value=window.innerWidth}function rde(){Hf||typeof window>"u"||(window.addEventListener("resize",g1),Hf=!0,g1())}function lde(){!Hf||typeof window>"u"||(window.removeEventListener("resize",g1),Hf=!1)}function rM(e,t,n){return Math.max(t,e-n)}function v1(e,t,n){return Math.min(n,Math.max(t,e))}function lM(){return tn(()=>{vd+=1,rde()}),qs(()=>{vd=Math.max(0,vd-1),vd===0&&lde()}),{viewportWidth:iM}}const ade="kimi-web.file-preview-width",Ul=320;function cde({client:e,sideWidth:t,detailTarget:n,closeFilePreview:s}){const{viewportWidth:o}=lM(),i=H(()=>Math.max(0,o.value-t.value)),r=H(()=>rM(i.value,Ul,Ul));function l(oe){return v1(Math.round(oe),Ul,r.value)}function a(){return l(i.value/2)}const c=H(()=>a()),u=se(c.value),d=H(()=>v1(u.value,Ul,r.value)),h=se(null),p=H(()=>{const oe=h.value;if(!oe)return null;const _e=e.turns.value.find(de=>de.id===oe.turnId)?.blocks?.[oe.blockIndex];return _e?.kind==="thinking"?_e.thinking:null}),f=H(()=>p.value!==null);function g(oe){const ye=h.value;if(ye&&ye.turnId===oe.turnId&&ye.blockIndex===oe.blockIndex){h.value=null,n.value==="thinking"&&(n.value=null);return}n.value="thinking",h.value=oe}function w(){h.value=null,n.value==="thinking"&&(n.value=null)}const S=se(null),y=H(()=>{const oe=S.value;if(!oe)return null;const ye=e.turns.value.find(_e=>_e.id===oe.turnId);return ye?.role==="compaction"&&ye.text?ye.text:null}),k=H(()=>y.value!==null);function v(oe){if(S.value?.turnId===oe.turnId){S.value=null,n.value==="compaction"&&(n.value=null);return}n.value="compaction",S.value=oe}function _(){S.value=null,n.value==="compaction"&&(n.value=null)}const I=se(null),A=H(()=>{const oe=I.value;if(!oe)return null;const _e=e.turns.value.find(de=>de.id===oe.turnId)?.blocks?.[oe.blockIndex];return _e?_e.kind==="agent"?_e.member.id===oe.memberId?_e.member:null:_e.kind==="agentGroup"?_e.members.find(de=>de.id===oe.memberId)??null:null:null}),b=H(()=>A.value!==null);function M(oe){const ye=I.value;if(ye&&ye.turnId===oe.turnId&&ye.memberId===oe.memberId){I.value=null,n.value==="agent"&&(n.value=null);return}n.value="agent",I.value=oe}function N(){I.value=null,n.value==="agent"&&(n.value=null)}const D=se("list"),$=se(null);function O(){n.value="diff",D.value="list",$.value=null,e.loadGitStatus(e.activeSessionId.value)}function P(){n.value==="diff"&&(n.value=null),D.value="list",$.value=null,e.clearFileDiff()}async function R(oe){D.value="detail",$.value=oe,await e.loadFileDiff(oe)}async function F(oe){await e.openSideChat(oe),n.value="btw"}function V(){e.closeSideChat(),n.value==="btw"&&(n.value=null)}function K(){n.value==="btw"&&(n.value=null)}const Z=H(()=>e.sideChatVisible.value),G=H(()=>n.value!==null&&(n.value!=="thinking"||f.value)&&(n.value!=="compaction"||k.value)&&(n.value!=="agent"||b.value)&&(n.value!=="btw"||Z.value)),X=se(!1);function pe(){return n.value==="thinking"&&f.value?(w(),!0):n.value==="compaction"&&k.value?(_(),!0):n.value==="agent"&&b.value?(N(),!0):n.value==="file"?(s(),!0):n.value==="diff"?(P(),!0):n.value==="btw"?(V(),!0):!1}return Ge(e.activeSessionId,()=>{s(),w(),_(),N(),P(),K()}),{PREVIEW_WIDTH_KEY:ade,PREVIEW_MIN:Ul,previewDefaultWidth:c,previewMax:r,previewWidth:u,previewPanelWidth:d,thinkingPanelText:p,thinkingVisible:f,openThinkingPanel:g,closeThinkingPanel:w,compactionPanelText:y,compactionPanelVisible:k,openCompactionPanel:v,closeCompactionPanel:_,agentPanelMember:A,agentPanelVisible:b,openAgentPanel:M,closeAgentPanel:N,detailDiffMode:D,detailDiffPath:$,openDiffDetail:O,closeDiffDetail:P,selectDiffFile:R,btwVisible:Z,openSideChatTab:F,closeSideChat:V,hideSideChatPanel:K,sidePanelVisible:G,panelDragging:X,closeOpenSidePanel:pe}}const ude=Et.sidebarWidth,g2=Et.sidebarCollapsed,v2=270,Km=170,dde=36,fde=320;function hde(e={}){const{viewportWidth:t}=lM(),n=se(v2),s=se(!1),o=H(()=>{const c=fde+(W2(e.previewOpen)?Ul:0);return rM(t.value,Km,c)}),i=H(()=>s.value?dde:v1(n.value,Km,o.value));function r(){try{s.value=_n(g2)==="true"}catch{s.value=!1}}function l(){try{In(g2,String(s.value))}catch{}}function a(){s.value=!s.value,l()}return{SIDEBAR_WIDTH_KEY:ude,SIDEBAR_DEFAULT:v2,SIDEBAR_MIN:Km,sidebarMax:o,sessionColWidth:n,sidebarCollapsed:s,sideWidth:i,loadSidebarCollapsed:r,toggleSidebarCollapse:a}}function pde({client:e,detailTarget:t}){const{t:n}=St(),s=se(null),o=se(null),i=se(!1),r=se(null),l=se(null);let a=0;const c=H(()=>{const v=l.value;return v?e.getFileDownloadUrl(v):null}),u=H(()=>s.value!==null);function d(v){return v.length>1?v.replace(/\/+$/,""):v}function h(v){const _=[];for(const I of v.split(/[\\/]+/))if(!(!I||I===".")){if(I===".."){_.pop();continue}_.push(I)}return _.join("/")}function p(v){const _=v.trim();if(!_)return{error:n("filePreview.errors.emptyPath")};if(/^[a-z][a-z0-9+.-]*:\/\//i.test(_))return{error:n("filePreview.errors.unsupportedPath")};if(_.startsWith("~"))return{error:n("filePreview.errors.outsideWorkspace")};const I=d(e.status.value.cwd);if(_.startsWith("/")){if(!I||_!==I&&!_.startsWith(`${I}/`))return{error:n("filePreview.errors.outsideWorkspace")};const b=_===I?"":_.slice(I.length+1);if(b.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const M=h(b);return M?{path:M}:{error:n("filePreview.errors.isDirectory")}}if(_.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const A=h(_);return A?{path:A}:{error:n("filePreview.errors.emptyPath")}}async function f(v){const _=++a;t.value="file",o.value=null,r.value=null,i.value=!0,s.value=v,l.value=null;const I=p(v.path);if("error"in I){i.value=!1,r.value=I.error;return}l.value=I.path;try{const A=await e.readFileContent(I.path);if(_!==a)return;A?o.value={...A,path:A.path||I.path}:o.value={path:I.path,content:"",encoding:"utf-8",mime:"text/plain",isBinary:!1,size:0}}catch(A){if(_!==a)return;r.value=A instanceof Error?A.message:n("filePreview.errors.loadFailed")}finally{_===a&&(i.value=!1)}}function g(v){return/^data:([^;,]+)/i.exec(v)?.[1]}function w(v){v.kind==="image"&&(t.value="file",s.value=null,l.value=null,r.value=null,i.value=!1,o.value={path:v.path??"ReadMediaFile image",content:"",encoding:"utf-8",mime:v.mimeType??g(v.url)??"image/*",sourceUrl:v.url,isBinary:!0,size:v.bytes??0})}function S(){s.value=null,l.value=null,o.value=null,r.value=null,i.value=!1,t.value==="file"&&(t.value=null)}function y(){const v=o.value?.path??s.value?.path;v&&e.openWorkspaceFile(v,s.value?.line)}function k(){const v=o.value?.path??s.value?.path;v&&e.revealWorkspaceFile(v)}return{previewTarget:s,previewFile:o,previewLoading:i,previewError:r,previewDownloadUrl:c,previewExternalActions:u,openFilePreview:f,openMediaPreview:w,closeFilePreview:S,openPreviewInEditor:y,revealPreviewFile:k}}const mde=640,gde=`(max-width: ${mde}px)`;function vde(){const e=se(!1);if(typeof window>"u"||typeof window.matchMedia!="function")return e;const t=window.matchMedia(gde);e.value=t.matches;const n=s=>{e.value=s.matches};return typeof t.addEventListener=="function"?(t.addEventListener("change",n),Ht(()=>t.removeEventListener("change",n))):typeof t.addListener=="function"&&(t.addListener(n),Ht(()=>t.removeListener(n))),e}const yde={class:"app-shell"},kde={key:0,class:"auth-page"},bde={class:"auth-page-inner"},_de={class:"auth-page-copy"},wde={key:0,class:"sidebar-rail"},Sde=["title","aria-label"],Cde={key:3,class:"coming-soon"},xde={class:"cs-text"},Tde=["aria-label","aria-hidden"],Mde=Je({__name:"App",setup(e){const t=sde();gn("resolveImage",t.resolveImageUrl);const{t:n}=St(),s=ai(),o=vde(),i=se(!1),r=se(!1),l=H(()=>{const ne=t.activeSessionId.value;return t.sessions.value.find(q=>q.id===ne)?.title??""}),a=H(()=>t.visibleWorkspace.value?.sessionCount??0),c=H(()=>t.activity.value!=="idle"),u=se(null),{showAuthGate:d,blinkAuthLogo:h}=ode({client:t,authLogoRef:u});ide({running:c,showAuthGate:d});function p(ne){return ne==="off"?"high":"off"}const f=se(!t.onboarded.value);function g(){t.setOnboarded(!0),f.value=!1}function w(){f.value=!0}tn(()=>{t.load(),pe(),document.addEventListener("keydown",S,!0)}),Ht(()=>{document.removeEventListener("keydown",S,!0)});function S(ne){ne.key==="Escape"&&(Hn.value||st()&&(ne.stopPropagation(),ne.preventDefault()))}const y=se(null),{previewTarget:k,previewFile:v,previewLoading:_,previewError:I,previewDownloadUrl:A,previewExternalActions:b,openFilePreview:M,openMediaPreview:N,closeFilePreview:D,openPreviewInEditor:$,revealPreviewFile:O}=pde({client:t,detailTarget:y}),P=H(()=>y.value!==null),{SIDEBAR_WIDTH_KEY:R,SIDEBAR_DEFAULT:F,SIDEBAR_MIN:V,sidebarMax:K,sessionColWidth:Z,sidebarCollapsed:G,sideWidth:X,loadSidebarCollapsed:pe,toggleSidebarCollapse:oe}=hde({previewOpen:P}),{PREVIEW_WIDTH_KEY:ye,PREVIEW_MIN:_e,previewDefaultWidth:de,previewMax:be,previewWidth:xe,previewPanelWidth:Le,thinkingPanelText:ee,thinkingVisible:ke,openThinkingPanel:ge,closeThinkingPanel:W,compactionPanelText:J,compactionPanelVisible:ue,openCompactionPanel:ie,closeCompactionPanel:ae,agentPanelMember:U,openAgentPanel:Y,closeAgentPanel:ce,detailDiffMode:me,detailDiffPath:Se,openDiffDetail:Ee,closeDiffDetail:re,selectDiffFile:Te,btwVisible:Ue,openSideChatTab:nt,closeSideChat:ct,sidePanelVisible:Re,panelDragging:Pe,closeOpenSidePanel:st}=cde({client:t,sideWidth:X,detailTarget:y,closeFilePreview:D}),et=se(null),mt=se([]),dn=H(()=>mt.value.length>1);function wn(ne){mt.value=ne}const xt=se(!1),ln=se(!1),Sn=se(!1),Xe=se(!1),Ln=se(!1),es=se(!1),$s=se(!1),Cn=se(!1),fn=se(null),Hn=H(()=>xt.value||ln.value||Sn.value||Xe.value||Ln.value||es.value||$s.value||Cn.value||f.value||i.value||r.value),Wn=se(!1),Yn=se(!1),ks=se(!1),Un=se(!1),bs=se(!1);async function Ye(){Wn.value=!0,Yn.value=!1,xt.value=!0;try{await t.refreshOAuthProviderModels(),await t.loadModels()}catch{Yn.value=!0}finally{Wn.value=!1}}async function je(){ks.value=!0,Un.value=!1,ln.value=!0;try{await t.loadProviders()}catch{Un.value=!0}finally{ks.value=!1}}function qe(){Sn.value=!0}async function Tt(ne){xt.value=!1,await t.setModel(ne)}async function on(ne){await t.addProvider(ne)}async function ao(ne){await t.deleteProvider(ne)}async function Lo(ne){await t.refreshProvider(ne)}async function Er(ne){bs.value=!0;try{await t.updateConfig(ne)&&await t.checkAuth()}finally{bs.value=!1}}async function Oo(){return t.startOAuthLogin()}async function ci(){return t.pollOAuthLogin()}async function $e(){return t.cancelOAuthLogin()}async function he(){Sn.value=!1,await t.checkAuth(),await t.load()}async function We(ne){await t.undo(1),await vt(),et.value?.loadComposerForEdit(ne)}function jt(ne){if(ne==="/compact"||ne.startsWith("/compact ")){t.compact(ne.slice(8).trim()||void 0);return}if(ne==="/swarm"||ne.startsWith("/swarm ")){const q=ne.slice(6).trim();q==="on"?t.setSwarmMode(!0):q==="off"?t.setSwarmMode(!1):q?(t.setSwarmMode(!0),t.sendPrompt(q)):t.toggleSwarmMode();return}if(ne==="/goal"||ne.startsWith("/goal ")){const q=ne.slice(5).trim();q==="pause"||q==="resume"||q==="cancel"?t.controlGoal(q):q?t.createGoal(q):t.toggleGoalMode();return}if(ne==="/btw"||ne.startsWith("/btw ")){const q=ne.slice(4).trim();!q&&t.sideChatVisible.value?ct():nt(q||void 0);return}switch(ne){case"/new":case"/clear":Xe.value=!0;break;case"/sessions":Ln.value=!0;break;case"/fork":t.forkSession();break;case"/undo":t.undo();break;case"/permission":{const q=t.permission.value,te=q==="manual"?"auto":q==="auto"?"yolo":"manual";t.setPermission(te);break}case"/plan":t.togglePlanMode();break;case"/auto":t.setPermission("auto");break;case"/yolo":t.setPermission("yolo");break;case"/thinking":t.setThinking(p(t.thinking.value));break;case"/help":t.dismissWarning(-1);break;case"/status":$s.value=!0;break;case"/model":Ye();break;case"/provider":je();break;case"/login":qe();break;default:{const q=ne.indexOf(" "),te=(q===-1?ne:ne.slice(0,q)).slice(1),He=q===-1?void 0:ne.slice(q+1).trim()||void 0;te&&t.activateSkill(te,He);break}}}function Gt(ne){t.unqueue(ne)}function It(ne){t.unqueue(ne)}async function Nt(ne){const q=t.activeWorkspaceId.value;if(!t.activeSessionId.value&&q){await t.startSessionAndSendPrompt(q,ne.text,ne.attachments);return}if(!t.activeSessionId.value&&!q){fn.value=ne,es.value=!0;return}t.sendPrompt(ne.text,ne.attachments)}async function co(ne){es.value=!1,await t.addWorkspaceByPath(ne);const q=fn.value;fn.value=null;const te=t.activeWorkspaceId.value;q&&te&&await t.startSessionAndSendPrompt(te,q.text,q.attachments)}function uo(){fn.value=null,es.value=!1}function ui(){const ne=t.activeWorkspaceId.value;ne?t.openWorkspaceDraft(ne):Xe.value=!0}function fo(ne){t.openWorkspaceDraft(ne)}function Bi(ne){ne&&window.open(ne,"_blank","noopener")}return(ne,q)=>(x(),E("div",yde,[C(d)?(x(),E("section",kde,[m("div",bde,[(x(),E("svg",{ref_key:"authLogoRef",ref:u,class:"auth-page-logo ch-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onMousedown:q[0]||(q[0]=Ze(()=>{},["prevent"])),onClick:q[1]||(q[1]=(...te)=>C(h)&&C(h)(...te))},[...q[93]||(q[93]=[kr('<defs data-v-7424061b><mask id="authKimiEyes" maskUnits="userSpaceOnUse" data-v-7424061b><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-7424061b></rect><g class="ch-eyes" fill="#000" data-v-7424061b><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-7424061b></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-7424061b></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#authKimiEyes)" data-v-7424061b></rect>',2)])],544)),m("div",_de,[m("h1",null,L(C(n)("app.authPageTitle")),1),m("p",null,L(C(n)("app.authPageMessage")),1)]),m("button",{type:"button",class:"auth-page-btn",onClick:qe},[q[94]||(q[94]=m("svg",{viewBox:"0 0 16 16",width:"15",height:"15",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("path",{d:"M6 3h5a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H6"}),m("path",{d:"M9 8H2"}),m("path",{d:"M5 5l3 3-3 3"})],-1)),m("span",null,L(C(n)("app.authPageLogin")),1)])])])):(x(),E("div",{key:1,class:Ie(["app",{mobile:C(o),"sidebar-collapsed":C(G)&&!C(o)}]),style:Ft({"--side-w":C(X)+"px","--preview-w":C(Le)+"px"})},[C(o)?(x(),Ke(Noe,{key:1,workspace:C(t).visibleWorkspace.value,"session-title":l.value,running:c.value,branch:C(t).status.value.branch,"session-count":a.value,onOpenSwitcher:q[15]||(q[15]=te=>i.value=!0),onOpenSettings:q[16]||(q[16]=te=>r.value=!0)},null,8,["workspace","session-title","running","branch","session-count"])):(x(),E(Ne,{key:0},[Ot(bt(o5,{"col-width":C(X),"active-workspace":C(t).visibleWorkspace.value,"active-workspace-id":C(t).activeWorkspaceId.value,sessions:C(t).sessionsForView.value,groups:C(t).workspaceGroups.value,"active-id":C(t).activeSessionId.value,"attention-by-session":C(t).attentionBySession.value,"pending-by-session":C(t).pendingBySession.value,"unread-by-session":C(t).unreadBySession.value,onSelect:q[2]||(q[2]=te=>C(t).selectSession(te)),onCreate:ui,onCreateInWorkspace:q[3]||(q[3]=te=>fo(te)),onSelectWorkspace:q[4]||(q[4]=te=>C(t).openWorkspace(te)),onAddWorkspace:q[5]||(q[5]=te=>es.value=!0),onRename:q[6]||(q[6]=(te,He)=>C(t).renameSession(te,He)),onArchive:q[7]||(q[7]=te=>C(t).archiveSession(te)),onFork:q[8]||(q[8]=te=>C(t).forkSession(te)),onRenameWorkspace:q[9]||(q[9]=(te,He)=>C(t).renameWorkspace(te,He)),onDeleteWorkspace:q[10]||(q[10]=te=>C(t).deleteWorkspace(te)),onReorderWorkspaces:q[11]||(q[11]=te=>C(t).reorderWorkspaces(te)),onSelectWorkspaces:wn,onOpenSettings:q[12]||(q[12]=te=>Cn.value=!0),onCollapse:C(oe)},null,8,["col-width","active-workspace","active-workspace-id","sessions","groups","active-id","attention-by-session","pending-by-session","unread-by-session","onCollapse"]),[[Ho,!C(G)]]),Ot(bt(Fk,{"storage-key":C(R),"default-width":C(F),min:C(V),max:C(K),"onUpdate:width":q[13]||(q[13]=te=>Z.value=te)},null,8,["storage-key","default-width","min","max"]),[[Ho,!C(G)]]),C(G)?(x(),E("div",wde,[m("button",{type:"button",class:"sidebar-expand-btn",title:C(n)("sidebar.expandSidebar"),"aria-label":C(n)("sidebar.expandSidebar"),onClick:q[14]||(q[14]=(...te)=>C(oe)&&C(oe)(...te))},[...q[95]||(q[95]=[kr('<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-7424061b><path d="M4 6h9" data-v-7424061b></path><path d="M4 12h9" data-v-7424061b></path><path d="M4 18h9" data-v-7424061b></path><path d="M17 9l3 3-3 3" data-v-7424061b></path></svg>',1)])],8,Sde)])):le("",!0)],64)),dn.value?(x(),E("div",Cde,[q[96]||(q[96]=m("span",{class:"cs-icon"},"🚧",-1)),m("span",xde,L(C(n)("app.comingSoon")),1)])):(x(),Ke(WY,{key:2,ref_key:"conversationPaneRef",ref:et,mobile:C(o),modern:C(t).theme.value==="modern"||C(t).theme.value==="kimi",turns:C(t).turns.value,"session-id":C(t).activeSessionId.value,approvals:C(t).pendingApprovals.value,changes:C(t).changes.value,"git-info":C(t).gitInfo.value,tasks:C(t).tasks.value,todos:C(t).todos.value,goal:C(t).goal.value,swarms:C(t).swarms.value,"activation-badges":C(t).activationBadges.value,status:C(t).status.value,thinking:C(t).thinking.value,"plan-mode":C(t).planMode.value,"swarm-mode":C(t).swarmMode.value,"goal-mode":C(t).goalMode.value,models:C(t).models.value,"starred-ids":C(t).starredModelIds.value,skills:C(t).skills.value,questions:C(t).questions.value,running:c.value,queued:C(t).queued.value,"search-files":C(t).searchFiles,"upload-image":C(t).uploadImage,sending:C(t).isSending.value,"fast-moon":C(t).fastMoon.value,"file-reload-key":C(t).activeSessionId.value,"session-loading":C(t).sessionLoading.value,compaction:C(t).compaction.value,"has-more-messages":C(t).hasMoreMessages.value,"loading-more":C(t).loadingMoreMessages.value,"loading-more-error":C(t).loadMoreMessagesError.value,"load-older-messages":C(t).loadOlderMessages,"workspace-name":C(t).visibleWorkspace.value?.name,"workspace-root":C(t).visibleWorkspace.value?.root??C(t).status.value.cwd,"git-diff-stats":C(t).gitDiffStats.value,workspaces:C(t).workspacesView.value,"active-workspace-id":C(t).activeWorkspaceId.value,"session-title":l.value,pr:C(t).activePullRequest.value,"beta-toc":C(t).betaToc.value,onOpenChanges:q[17]||(q[17]=te=>C(Ee)()),onSelectWorkspace:q[18]||(q[18]=te=>fo(te)),onAddWorkspace:q[19]||(q[19]=te=>es.value=!0),onOpenPr:Bi,onSubmit:q[20]||(q[20]=te=>Nt(te)),onSteer:q[21]||(q[21]=te=>C(t).steerPrompt(te.text,te.attachments)),onApproval:q[22]||(q[22]=(te,He)=>C(t).respondApproval(te,He)),onCancelTask:q[23]||(q[23]=te=>C(t).cancelTask(te)),onAnswer:q[24]||(q[24]=(te,He)=>C(t).respondQuestion(te,He)),onDismiss:q[25]||(q[25]=te=>C(t).dismissQuestion(te)),onCommand:jt,onInterrupt:q[26]||(q[26]=te=>C(t).abortCurrentPrompt()),onUnqueue:Gt,onEditQueued:It,onSetPermission:q[27]||(q[27]=te=>C(t).setPermission(te)),onSetThinking:q[28]||(q[28]=te=>C(t).setThinking(te)),onTogglePlan:q[29]||(q[29]=te=>C(t).togglePlanMode()),onToggleSwarm:q[30]||(q[30]=te=>C(t).toggleSwarmMode()),onToggleGoal:q[31]||(q[31]=te=>C(t).toggleGoalMode()),onCreateGoal:q[32]||(q[32]=te=>C(t).createGoal(te)),onControlGoal:q[33]||(q[33]=te=>C(t).controlGoal(te)),onRefreshGitStatus:q[34]||(q[34]=te=>C(t).activeSessionId.value&&C(t).loadGitStatus(C(t).activeSessionId.value)),onRenameSession:q[35]||(q[35]=(te,He)=>C(t).renameSession(te,He)),onForkSession:q[36]||(q[36]=te=>C(t).forkSession(te)),onArchiveSession:q[37]||(q[37]=te=>C(t).archiveSession(te)),onCompact:q[38]||(q[38]=te=>C(t).compact()),onPickModel:q[39]||(q[39]=te=>Ye()),onSelectModel:q[40]||(q[40]=te=>C(t).setModel(te)),onOpenFile:q[41]||(q[41]=te=>C(M)(te)),onOpenMedia:q[42]||(q[42]=te=>C(N)(te)),onOpenThinking:q[43]||(q[43]=te=>C(ge)(te)),onOpenCompaction:q[44]||(q[44]=te=>C(ie)(te)),onOpenAgent:q[45]||(q[45]=te=>C(Y)(te)),onEditMessage:We},null,8,["mobile","modern","turns","session-id","approvals","changes","git-info","tasks","todos","goal","swarms","activation-badges","status","thinking","plan-mode","swarm-mode","goal-mode","models","starred-ids","skills","questions","running","queued","search-files","upload-image","sending","fast-moon","file-reload-key","session-loading","compaction","has-more-messages","loading-more","loading-more-error","load-older-messages","workspace-name","workspace-root","git-diff-stats","workspaces","active-workspace-id","session-title","pr","beta-toc"])),C(Re)&&!C(o)?(x(),Ke(Fk,{key:4,"storage-key":C(ye),"default-width":C(de),min:C(_e),max:C(be),reverse:"","aria-label":C(n)("layout.resizePreviewAria"),"onUpdate:width":q[46]||(q[46]=te=>xe.value=te),"onUpdate:dragging":q[47]||(q[47]=te=>Pe.value=te)},null,8,["storage-key","default-width","min","max","aria-label"])):le("",!0),!C(o)||C(Re)?(x(),E("aside",{key:5,class:Ie(["global-preview",{open:C(Re),mobile:C(o),"no-anim":C(Pe)}]),role:"complementary","aria-label":C(n)("layout.detailPanelAria"),"aria-hidden":!C(Re)},[y.value==="thinking"&&C(ke)?(x(),Ke(Uw,{key:0,text:C(ee)??"",onClose:C(W)},null,8,["text","onClose"])):y.value==="compaction"&&C(ue)?(x(),Ke(Uw,{key:1,text:C(J)??"",subtitle:C(n)("conversation.summaryTitle"),onClose:C(ae)},null,8,["text","subtitle","onClose"])):y.value==="agent"&&C(U)?(x(),Ke(kZ,{key:2,member:C(U),onClose:C(ce)},null,8,["member","onClose"])):y.value==="btw"&&C(Ue)?(x(),Ke($Z,{key:3,turns:C(t).sideChatTurns.value,running:C(t).sideChatRunning.value,sending:C(t).sideChatSending.value,onSend:q[48]||(q[48]=te=>C(t).sendSideChatPrompt(te)),onClose:C(ct)},null,8,["turns","running","sending","onClose"])):y.value==="diff"?(x(),Ke(wJ,{key:4,mode:C(me),changes:C(t).changes.value,"git-info":C(t).gitInfo.value,"file-diff":C(t).fileDiff.value,"selected-diff-path":C(t).selectedDiffPath.value,"file-diff-loading":C(t).fileDiffLoading.value,closable:"",onOpen:C(Te),onBack:q[49]||(q[49]=te=>{me.value="list",Se.value=null,C(t).clearFileDiff()}),onClose:C(re)},null,8,["mode","changes","git-info","file-diff","selected-diff-path","file-diff-loading","onOpen","onClose"])):y.value==="file"?(x(),Ke(JX,{key:5,file:C(v),loading:C(_),error:C(I),line:C(k)?.line,"download-url":C(A),closable:"","external-actions":C(b),"open-file":C(M),onClose:C(D),onOpenExternal:C($),onReveal:C(O)},null,8,["file","loading","error","line","download-url","external-actions","open-file","onClose","onOpenExternal","onReveal"])):le("",!0)],10,Tde)):le("",!0),xt.value?(x(),Ke(YJ,{key:6,models:C(t).models.value,current:C(t).status.value.modelId,"starred-ids":C(t).starredModelIds.value,loading:Wn.value,unavailable:Yn.value,onSelect:q[50]||(q[50]=te=>Tt(te)),onToggleStar:q[51]||(q[51]=te=>C(t).toggleStarModel(te)),onClose:q[52]||(q[52]=te=>xt.value=!1)},null,8,["models","current","starred-ids","loading","unavailable"])):le("",!0),Cn.value?(x(),Ke(Gne,{key:7,theme:C(t).theme.value,"color-scheme":C(t).colorScheme.value,"ui-font-size":C(t).uiFontSize.value,"auth-ready":C(t).authReady.value,"account-model":C(t).defaultModel.value,notify:C(t).notifyOnComplete.value,"notify-permission":C(t).notifyPermission.value,"beta-toc":C(t).betaToc.value,config:C(t).config.value,models:C(t).models.value,"config-saving":bs.value,"server-version":C(t).serverVersion.value,onSetTheme:q[53]||(q[53]=te=>C(t).setTheme(te)),onSetColorScheme:q[54]||(q[54]=te=>C(t).setColorScheme(te)),onSetUiFontSize:q[55]||(q[55]=te=>C(t).setUiFontSize(te)),onSetNotify:q[56]||(q[56]=te=>C(t).setNotifyOnComplete(te)),onSetBetaToc:q[57]||(q[57]=te=>C(t).setBetaToc(te)),onUpdateConfig:q[58]||(q[58]=te=>Er(te)),onLogin:q[59]||(q[59]=()=>{Cn.value=!1,qe()}),onLogout:C(t).logout,onOpenOnboarding:q[60]||(q[60]=()=>{Cn.value=!1,w()}),onClose:q[61]||(q[61]=te=>Cn.value=!1)},null,8,["theme","color-scheme","ui-font-size","auth-ready","account-model","notify","notify-permission","beta-toc","config","models","config-saving","server-version","onLogout"])):le("",!0),ln.value?(x(),Ke(BQ,{key:8,providers:C(t).providers.value,loading:ks.value,unavailable:Un.value,onAdd:q[62]||(q[62]=te=>on(te)),onRefresh:q[63]||(q[63]=te=>Lo(te)),onDelete:q[64]||(q[64]=te=>ao(te)),onOpenLogin:q[65]||(q[65]=()=>{ln.value=!1,qe()}),onClose:q[66]||(q[66]=te=>ln.value=!1)},null,8,["providers","loading","unavailable"])):le("",!0),Xe.value?(x(),Ke(Bee,{key:9,"recent-cwds":C(t).recentCwds.value,onCreate:q[67]||(q[67]=({cwd:te,title:He})=>{Xe.value=!1,C(t).createSession(te,{title:He})}),onClose:q[68]||(q[68]=te=>Xe.value=!1)},null,8,["recent-cwds"])):le("",!0),Ln.value?(x(),Ke(hse,{key:10,sessions:C(t).sessions.value,"workspace-groups":C(t).workspaceGroups.value,"attention-by-session":C(t).attentionBySession.value,"active-id":C(t).activeSessionId.value,onSelect:q[69]||(q[69]=te=>{C(t).selectSession(te),Ln.value=!1}),onClose:q[70]||(q[70]=te=>Ln.value=!1)},null,8,["sessions","workspace-groups","attention-by-session","active-id"])):le("",!0),$s.value?(x(),Ke(uoe,{key:11,status:C(t).status.value,thinking:C(t).thinking.value,"plan-mode":C(t).planMode.value,"swarm-mode":C(t).swarmMode.value,"cost-usd":C(t).sessionCost.value,onClose:q[71]||(q[71]=te=>$s.value=!1)},null,8,["status","thinking","plan-mode","swarm-mode","cost-usd"])):le("",!0),es.value?(x(),Ke(Gse,{key:12,"browse-fs":C(t).browseFs,"get-fs-home":C(t).getFsHome,"default-path":C(t).visibleWorkspace.value?.root??C(t).status.value.cwd,onAdd:q[72]||(q[72]=te=>co(te)),onClose:uo},null,8,["browse-fs","get-fs-home","default-path"])):le("",!0),bt(Pi,{name:"gload-fade"},{default:Mn(()=>[C(t).initialized.value?le("",!0):(x(),Ke(Dre,{key:0}))]),_:1}),f.value&&!C(d)?(x(),Ke(Nre,{key:13,theme:C(t).theme.value,onSetTheme:q[73]||(q[73]=te=>C(t).setTheme(te)),onComplete:g,onSkip:g},null,8,["theme"])):le("",!0),bt(woe,{warnings:C(t).warnings.value,onDismiss:C(t).dismissWarning},null,8,["warnings","onDismiss"]),C(s)?(x(),Ke(ple,{key:14})):le("",!0),C(o)?(x(),Ke(cie,{key:15,modelValue:i.value,"onUpdate:modelValue":q[74]||(q[74]=te=>i.value=te),groups:C(t).workspaceGroups.value,"active-workspace-id":C(t).activeWorkspaceId.value,"active-id":C(t).activeSessionId.value,"attention-by-session":C(t).attentionBySession.value,"attention-by-workspace":C(t).attentionByWorkspace.value,onSelect:q[75]||(q[75]=te=>C(t).selectSession(te)),onCreate:ui,onCreateInWorkspace:q[76]||(q[76]=te=>fo(te)),onAddWorkspace:q[77]||(q[77]=te=>es.value=!0),onRename:q[78]||(q[78]=(te,He)=>C(t).renameSession(te,He)),onArchive:q[79]||(q[79]=te=>C(t).archiveSession(te)),onDeleteWorkspace:q[80]||(q[80]=te=>C(t).deleteWorkspace(te))},null,8,["modelValue","groups","active-workspace-id","active-id","attention-by-session","attention-by-workspace"])):le("",!0),C(o)?(x(),Ke(dre,{key:16,modelValue:r.value,"onUpdate:modelValue":q[81]||(q[81]=te=>r.value=te),status:C(t).status.value,thinking:C(t).thinking.value,"plan-mode":C(t).planMode.value,"swarm-mode":C(t).swarmMode.value,theme:C(t).theme.value,"color-scheme":C(t).colorScheme.value,"ui-font-size":C(t).uiFontSize.value,"auth-ready":C(t).authReady.value,"beta-toc":C(t).betaToc.value,"server-version":C(t).serverVersion.value,onPickModel:q[82]||(q[82]=te=>Ye()),onSetThinking:q[83]||(q[83]=te=>C(t).setThinking(te)),onTogglePlan:q[84]||(q[84]=te=>C(t).togglePlanMode()),onToggleSwarm:q[85]||(q[85]=te=>C(t).toggleSwarmMode()),onSetPermission:q[86]||(q[86]=te=>C(t).setPermission(te)),onSetTheme:q[87]||(q[87]=te=>C(t).setTheme(te)),onSetColorScheme:q[88]||(q[88]=te=>C(t).setColorScheme(te)),onSetUiFontSize:q[89]||(q[89]=te=>C(t).setUiFontSize(te)),onSetBetaToc:q[90]||(q[90]=te=>C(t).setBetaToc(te)),onLogin:q[91]||(q[91]=()=>{r.value=!1,qe()}),onLogout:C(t).logout},null,8,["modelValue","status","thinking","plan-mode","swarm-mode","theme","color-scheme","ui-font-size","auth-ready","beta-toc","server-version","onLogout"])):le("",!0)],6)),Sn.value?(x(),Ke(vee,{key:2,"on-start-o-auth-login":Oo,"on-poll-o-auth-login":ci,"on-cancel-o-auth-login":$e,onSuccess:he,onClose:q[92]||(q[92]=te=>Sn.value=!1)})):le("",!0)]))}}),Ade=wt(Mde,[["__scopeId","data-v-7424061b"]]);Zee();sf(Ade).use($n).mount("#app");export{gA as $,tfe as A,r4 as B,Rn as C,Efe as D,C2 as E,Ne as F,kr as G,yt as H,bt as I,FA as J,Qde as K,oi as L,Je as M,NE as N,ofe as O,ife as P,afe as Q,Bd as R,ta as S,Vde as T,rfe as U,D1 as V,sfe as W,$fe as X,lfe as Y,Cfe as Z,Ide as _,Q2 as a,gs as a$,cs as a0,b1 as a1,Bde as a2,T1 as a3,nE as a4,Zt as a5,ka as a6,jde as a7,Pfe as a8,Yde as a9,oS as aA,v4 as aB,S4 as aC,tn as aD,w4 as aE,_4 as aF,_1 as aG,b4 as aH,Ht as aI,A1 as aJ,jA as aK,x as aL,EE as aM,Ude as aN,gn as aO,U2 as aP,Wde as aQ,qd as aR,Js as aS,Hd as aT,se as aU,yfe as aV,KE as aW,Qe as aX,Ql as aY,x4 as aZ,efe as a_,Jde as aa,Zde as ab,Xde as ac,bfe as ad,Rfe as ae,Pt as af,aE as ag,eh as ah,fr as ai,Li as aj,Nn as ak,kfe as al,eo as am,yr as an,cr as ao,dfe as ap,ffe as aq,Qt as ar,vt as as,hE as at,Ie as au,Ede as av,Ft as aw,g4 as ax,k4 as ay,qs as az,Hde as b,sH as b$,Mfe as b0,Lc as b1,Yd as b2,xfe as b3,vr as b4,PA as b5,Nde as b6,ul as b7,ZA as b8,Tfe as b9,An as bA,Ho as bB,cE as bC,wfe as bD,Ge as bE,QA as bF,zde as bG,e4 as bH,pfe as bI,Mn as bJ,cfe as bK,Ot as bL,Mo as bM,_fe as bN,Ze as bO,qde as bP,Jt as bQ,Qs as bR,zfe as bS,VH as bT,PT as bU,Kfe as bV,LF as bW,Ev as bX,Vfe as bY,Bg as bZ,Yfe as b_,$de as ba,L as bb,yd as bc,nfe as bd,Bt as be,Pde as bf,Ode as bg,W2 as bh,vfe as bi,Lde as bj,C as bk,nu as bl,Lfe as bm,Ife as bn,OE as bo,Kde as bp,mfe as bq,JA as br,Nfe as bs,ufe as bt,Gde as bu,J2 as bv,tf as bw,UE as bx,jS as by,nf as bz,Sfe as c,nH as c0,Tv as c1,tH as c2,Ufe as c3,EF as c4,Wfe as c5,Mf as c6,eH as c7,Bfe as c8,Gfe as c9,AT as ca,Ffe as cb,Zfe as cc,jg as cd,Kl as ce,Ug as cf,Jfe as cg,Xfe as ch,jfe as ci,Xs as cj,Hfe as ck,qfe as cl,PF as cm,qg as cn,Wg as co,Dfe as cp,gfe as d,hr as e,Rde as f,Pi as g,Ofe as h,Dde as i,Fde as j,$o as k,Qc as l,Gn as m,Vf as n,Oi as o,Afe as p,H as q,sf as r,Ke as s,le as t,E as u,m as v,K4 as w,hfe as x,V4 as y,GE as z};
|