@dimi-agent/cli 0.4.4 → 0.5.1
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 +6648 -10909
- package/dist-web/assets/{CodeBlockNode-BL_lWHk1.js → CodeBlockNode-BaWzfCy0.js} +1 -1
- package/dist-web/assets/{DesignSystemView-Gp4T3sr4.js → DesignSystemView-Bb01YcYk.js} +1 -1
- package/dist-web/assets/{Tooltip-DsL7mF2H.js → Tooltip-S8S-9806.js} +1 -1
- package/dist-web/assets/{arc-CWKkAytd.js → arc-CJvKR1oC.js} +1 -1
- package/dist-web/assets/{architectureDiagram-3BPJPVTR-BxQA87W8.js → architectureDiagram-3BPJPVTR-D0r4NgJY.js} +1 -1
- package/dist-web/assets/{blockDiagram-GPEHLZMM-Bv-uKykJ.js → blockDiagram-GPEHLZMM-CcVFv_et.js} +1 -1
- package/dist-web/assets/{c4Diagram-AAUBKEIU-BNwMmBwW.js → c4Diagram-AAUBKEIU-gMmJTN7c.js} +1 -1
- package/dist-web/assets/channel-DlP6phL9.js +1 -0
- package/dist-web/assets/{chunk-2J33WTMH-D0o9LNEb.js → chunk-2J33WTMH-BZpxh0T1.js} +1 -1
- package/dist-web/assets/{chunk-4BX2VUAB-C9DEPDT4.js → chunk-4BX2VUAB-NJfuQ9IP.js} +1 -1
- package/dist-web/assets/{chunk-55IACEB6-DM4XnM9f.js → chunk-55IACEB6-BKgkJoe-.js} +1 -1
- package/dist-web/assets/{chunk-727SXJPM-Dky6n2gf.js → chunk-727SXJPM-DA5_3QvA.js} +1 -1
- package/dist-web/assets/{chunk-AQP2D5EJ-DjmnKhuo.js → chunk-AQP2D5EJ-DbJPlxYa.js} +1 -1
- package/dist-web/assets/{chunk-FMBD7UC4-wkNtOdUv.js → chunk-FMBD7UC4-DDzZo5dG.js} +1 -1
- package/dist-web/assets/{chunk-ND2GUHAM-Byh5s8MO.js → chunk-ND2GUHAM-BuOldrpx.js} +1 -1
- package/dist-web/assets/{chunk-QZHKN3VN-C596rHAe.js → chunk-QZHKN3VN-B4kJPKe8.js} +1 -1
- package/dist-web/assets/classDiagram-4FO5ZUOK-BsZqzmeE.js +1 -0
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-BsZqzmeE.js +1 -0
- package/dist-web/assets/{cose-bilkent-S5V4N54A-B5CIST3j.js → cose-bilkent-S5V4N54A-DWk2qZTK.js} +1 -1
- package/dist-web/assets/{dagre-BM42HDAG-DQ2h_HWV.js → dagre-BM42HDAG-BfzrP96D.js} +1 -1
- package/dist-web/assets/{diagram-2AECGRRQ-DcJgQFHi.js → diagram-2AECGRRQ-TGkTAtM-.js} +1 -1
- package/dist-web/assets/{diagram-5GNKFQAL-CHeEjhiL.js → diagram-5GNKFQAL-T2-djOqO.js} +1 -1
- package/dist-web/assets/{diagram-KO2AKTUF-CCF3txiw.js → diagram-KO2AKTUF--TEvFK3o.js} +1 -1
- package/dist-web/assets/{diagram-LMA3HP47-B5_nRmtD.js → diagram-LMA3HP47-Bp3C9QTX.js} +1 -1
- package/dist-web/assets/{diagram-OG6HWLK6-BdSBNBYS.js → diagram-OG6HWLK6-B9Jf7Zjz.js} +1 -1
- package/dist-web/assets/{erDiagram-TEJ5UH35-CZ1Ubm9Y.js → erDiagram-TEJ5UH35-DofEbbkJ.js} +1 -1
- package/dist-web/assets/{flowDiagram-I6XJVG4X-C6eXPlWY.js → flowDiagram-I6XJVG4X-Bzb-pXgl.js} +1 -1
- package/dist-web/assets/{ganttDiagram-6RSMTGT7-LvGiqVrM.js → ganttDiagram-6RSMTGT7-CZH_FJYt.js} +1 -1
- package/dist-web/assets/{gitGraphDiagram-PVQCEYII-D1ktH7c_.js → gitGraphDiagram-PVQCEYII-BflQ8SBJ.js} +1 -1
- package/dist-web/assets/{index-CXz8XYk1.css → index-HKPwTfaa.css} +1 -1
- package/dist-web/assets/index-Ia-ZUO2Z.js +337 -0
- package/dist-web/assets/{index10-ePz6DAnA.js → index10-cnUP9s6C.js} +1 -1
- package/dist-web/assets/{index11-wd1P4PGw.js → index11-Bndq68af.js} +1 -1
- package/dist-web/assets/{index5-D_56m6HR.js → index5-B1-fjW_m.js} +1 -1
- package/dist-web/assets/{index6-BiWLUsB3.js → index6-xetF8e8c.js} +1 -1
- package/dist-web/assets/{index7-DSRe_h5d.js → index7-CtaXn3W4.js} +1 -1
- package/dist-web/assets/{index8-C0MfrVDC.js → index8-d5uRV0AF.js} +1 -1
- package/dist-web/assets/{infoDiagram-5YYISTIA-C0KiosmZ.js → infoDiagram-5YYISTIA-B0gQEyYk.js} +1 -1
- package/dist-web/assets/{ishikawaDiagram-YF4QCWOH-CGUCgDXm.js → ishikawaDiagram-YF4QCWOH-DA51LQsg.js} +1 -1
- package/dist-web/assets/{journeyDiagram-JHISSGLW-K-24gGZU.js → journeyDiagram-JHISSGLW-C0hOvJE-.js} +1 -1
- package/dist-web/assets/{kanban-definition-UN3LZRKU-DDKuz_xA.js → kanban-definition-UN3LZRKU-fQck3D0t.js} +1 -1
- package/dist-web/assets/{linear-DYKn_u2q.js → linear-ICCSqDsp.js} +1 -1
- package/dist-web/assets/{mermaid.core-oS_owI3c.js → mermaid.core-B_k0q1Z5.js} +4 -4
- package/dist-web/assets/{mindmap-definition-RKZ34NQL-C0lJUdai.js → mindmap-definition-RKZ34NQL-DMytkbGB.js} +1 -1
- package/dist-web/assets/{pieDiagram-4H26LBE5-DGCPaNkB.js → pieDiagram-4H26LBE5-Df6_JDYe.js} +1 -1
- package/dist-web/assets/{quadrantDiagram-W4KKPZXB-B3op7xS9.js → quadrantDiagram-W4KKPZXB-DNnSVq1-.js} +1 -1
- package/dist-web/assets/{requirementDiagram-4Y6WPE33-xbfEgwL_.js → requirementDiagram-4Y6WPE33-B9O3pyZ5.js} +1 -1
- package/dist-web/assets/{sankeyDiagram-5OEKKPKP-3ff_V2pD.js → sankeyDiagram-5OEKKPKP-BfJ-To-P.js} +1 -1
- package/dist-web/assets/{sequenceDiagram-3UESZ5HK-C5YRTKoy.js → sequenceDiagram-3UESZ5HK-zK8EZ0hV.js} +1 -1
- package/dist-web/assets/{stateDiagram-AJRCARHV-ltBPYPwO.js → stateDiagram-AJRCARHV-D8kyVPrY.js} +1 -1
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU-CnQhCLSR.js +1 -0
- package/dist-web/assets/{timeline-definition-PNZ67QCA-BT-5Wtvy.js → timeline-definition-PNZ67QCA-nE5-ttgA.js} +1 -1
- package/dist-web/assets/{vennDiagram-CIIHVFJN-Tif-M9Km.js → vennDiagram-CIIHVFJN-bfmUW0Li.js} +1 -1
- package/dist-web/assets/{vue.runtime.esm-bundler-BMrzHc_f.js → vue.runtime.esm-bundler-CNUOXmj4.js} +1 -1
- package/dist-web/assets/{wardley-L42UT6IY-CqiBaH6C.js → wardley-L42UT6IY-CBG17PJg.js} +1 -1
- package/dist-web/assets/{wardleyDiagram-YWT4CUSO-DfgCjyaL.js → wardleyDiagram-YWT4CUSO-djjE-wCw.js} +1 -1
- package/dist-web/assets/{xychartDiagram-2RQKCTM6-DTwp2FCG.js → xychartDiagram-2RQKCTM6-CTGSlEc6.js} +1 -1
- package/dist-web/index.html +2 -2
- package/package.json +6 -6
- package/dist-web/assets/channel-B2QvGyDT.js +0 -1
- package/dist-web/assets/classDiagram-4FO5ZUOK-Cc_V2QfH.js +0 -1
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-Cc_V2QfH.js +0 -1
- package/dist-web/assets/index-DKIJmNQn.js +0 -337
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU-Dl6LC5u9.js +0 -1
|
@@ -1,337 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DesignSystemView-Gp4T3sr4.js","assets/DesignSystemView-VV_44Ep3.css","assets/mhchem-DtR62fUK.js","assets/katex-DnlPpQZa.js","assets/CodeBlockNode-BL_lWHk1.js","assets/safeRaf-DGuzXxDK.js","assets/index5-D_56m6HR.js","assets/index11-wd1P4PGw.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))o(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const r of i.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&o(r)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function o(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();/**
|
|
3
|
-
* @vue/shared v3.5.35
|
|
4
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
5
|
-
* @license MIT
|
|
6
|
-
**/function n1(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const sn={},Zc=[],Ci=()=>{},Q3=()=>!1,Af=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),o1=e=>e.startsWith("onUpdate:"),Nn=Object.assign,bk=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},YN=Object.prototype.hasOwnProperty,kn=(e,t)=>YN.call(e,t),Mt=Array.isArray,Xc=e=>wu(e)==="[object Map]",Qa=e=>wu(e)==="[object Set]",Qx=e=>wu(e)==="[object Date]",ZN=e=>wu(e)==="[object RegExp]",Pt=e=>typeof e=="function",On=e=>typeof e=="string",ii=e=>typeof e=="symbol",xn=e=>e!==null&&typeof e=="object",xk=e=>(xn(e)||Pt(e))&&Pt(e.then)&&Pt(e.catch),J3=Object.prototype.toString,wu=e=>J3.call(e),XN=e=>wu(e).slice(8,-1),s1=e=>wu(e)==="[object Object]",i1=e=>On(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,$a=n1(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),r1=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},QN=/-\w/g,Mo=r1(e=>e.replace(QN,t=>t.slice(1).toUpperCase())),JN=/\B([A-Z])/g,$s=r1(e=>e.replace(JN,"-$1").toLowerCase()),l1=r1(e=>e.charAt(0).toUpperCase()+e.slice(1)),mp=r1(e=>e?`on${l1(e)}`:""),Go=(e,t)=>!Object.is(e,t),Qc=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},eA=(e,t,n,o=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:o,value:n})},a1=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Hp=e=>{const t=On(e)?Number(e):NaN;return isNaN(t)?e:t};let Jx;const c1=()=>Jx||(Jx=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),e9="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",t9=n1(e9);function tn(e){if(Mt(e)){const t={};for(let n=0;n<e.length;n++){const o=e[n],s=On(o)?i9(o):tn(o);if(s)for(const i in s)t[i]=s[i]}return t}else if(On(e)||xn(e))return e}const n9=/;(?![^(]*\))/g,o9=/:([^]+)/,s9=/\/\*[^]*?\*\//g;function i9(e){const t={};return e.replace(s9,"").split(n9).forEach(n=>{if(n){const o=n.split(o9);o.length>1&&(t[o[0].trim()]=o[1].trim())}}),t}function We(e){let t="";if(On(e))t=e;else if(Mt(e))for(let n=0;n<e.length;n++){const o=We(e[n]);o&&(t+=o+" ")}else if(xn(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function r9(e){if(!e)return null;let{class:t,style:n}=e;return t&&!On(t)&&(e.class=We(t)),n&&(e.style=tn(n)),e}const l9="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",a9=n1(l9);function tA(e){return!!e||e===""}function c9(e,t){if(e.length!==t.length)return!1;let n=!0;for(let o=0;n&&o<e.length;o++)n=jr(e[o],t[o]);return n}function jr(e,t){if(e===t)return!0;let n=Qx(e),o=Qx(t);if(n||o)return n&&o?e.getTime()===t.getTime():!1;if(n=ii(e),o=ii(t),n||o)return e===t;if(n=Mt(e),o=Mt(t),n||o)return n&&o?c9(e,t):!1;if(n=xn(e),o=xn(t),n||o){if(!n||!o)return!1;const s=Object.keys(e).length,i=Object.keys(t).length;if(s!==i)return!1;for(const r in e){const l=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(l&&!a||!l&&a||!jr(e[r],t[r]))return!1}}return String(e)===String(t)}function u1(e,t){return e.findIndex(n=>jr(n,t))}const nA=e=>!!(e&&e.__v_isRef===!0),R=e=>On(e)?e:e==null?"":Mt(e)||xn(e)&&(e.toString===J3||!Pt(e.toString))?nA(e)?R(e.value):JSON.stringify(e,oA,2):String(e),oA=(e,t)=>nA(t)?oA(e,t.value):Xc(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[o,s],i)=>(n[sg(o,i)+" =>"]=s,n),{})}:Qa(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>sg(n))}:ii(t)?sg(t):xn(t)&&!Mt(t)&&!s1(t)?String(t):t,sg=(e,t="")=>{var n;return ii(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};function u9(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 Ao;class sA{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&&Ao&&(Ao.active?(this.parent=Ao,this.index=(Ao.scopes||(Ao.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=Ao;try{return Ao=this,t()}finally{Ao=n}}}on(){++this._on===1&&(this.prevScope=Ao,Ao=this)}off(){if(this._on>0&&--this._on===0){if(Ao===this)Ao=this.prevScope;else{let t=Ao;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,o;for(n=0,o=this.effects.length;n<o;n++)this.effects[n].stop();for(this.effects.length=0,n=0,o=this.cleanups.length;n<o;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,o=this.scopes.length;n<o;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const s=this.parent.scopes.pop();s&&s!==this&&(this.parent.scopes[this.index]=s,s.index=this.index)}this.parent=void 0}}}function d9(e){return new sA(e)}function wk(){return Ao}function Mf(e,t=!1){Ao&&Ao.cleanups.push(e)}let jn;const ig=new WeakSet;class Wp{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,Ao&&(Ao.active?Ao.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,ig.has(this)&&(ig.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||rA(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,ew(this),lA(this);const t=jn,n=Ui;jn=this,Ui=!0;try{return this.fn()}finally{aA(this),jn=t,Ui=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Ck(t);this.deps=this.depsTail=void 0,ew(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?ig.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Wv(this)&&this.run()}get dirty(){return Wv(this)}}let iA=0,Td,Nd;function rA(e,t=!1){if(e.flags|=8,t){e.next=Nd,Nd=e;return}e.next=Td,Td=e}function _k(){iA++}function Sk(){if(--iA>0)return;if(Nd){let t=Nd;for(Nd=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Td;){let t=Td;for(Td=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(o){e||(e=o)}t=n}}if(e)throw e}function lA(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function aA(e){let t,n=e.depsTail,o=n;for(;o;){const s=o.prevDep;o.version===-1?(o===n&&(n=s),Ck(o),f9(o)):t=o,o.dep.activeLink=o.prevActiveLink,o.prevActiveLink=void 0,o=s}e.deps=t,e.depsTail=n}function Wv(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(cA(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function cA(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Xd)||(e.globalVersion=Xd,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Wv(e))))return;e.flags|=2;const t=e.dep,n=jn,o=Ui;jn=e,Ui=!0;try{lA(e);const s=e.fn(e._value);(t.version===0||Go(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{jn=n,Ui=o,aA(e),e.flags&=-3}}function Ck(e,t=!1){const{dep:n,prevSub:o,nextSub:s}=e;if(o&&(o.nextSub=s,e.prevSub=void 0),s&&(s.prevSub=o,e.nextSub=void 0),n.subs===e&&(n.subs=o,!o&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)Ck(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function f9(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function TCe(e,t){e.effect instanceof Wp&&(e=e.effect.fn);const n=new Wp(e);t&&Nn(n,t);try{n.run()}catch(s){throw n.stop(),s}const o=n.run.bind(n);return o.effect=n,o}function NCe(e){e.effect.stop()}let Ui=!0;const uA=[];function Vr(){uA.push(Ui),Ui=!1}function Kr(){const e=uA.pop();Ui=e===void 0?!0:e}function ew(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=jn;jn=void 0;try{t()}finally{jn=n}}}let Xd=0;class h9{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 d1{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(!jn||!Ui||jn===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==jn)n=this.activeLink=new h9(jn,this),jn.deps?(n.prevDep=jn.depsTail,jn.depsTail.nextDep=n,jn.depsTail=n):jn.deps=jn.depsTail=n,dA(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const o=n.nextDep;o.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=o),n.prevDep=jn.depsTail,n.nextDep=void 0,jn.depsTail.nextDep=n,jn.depsTail=n,jn.deps===n&&(jn.deps=o)}return n}trigger(t){this.version++,Xd++,this.notify(t)}notify(t){_k();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Sk()}}}function dA(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let o=t.deps;o;o=o.nextDep)dA(o)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const zp=new WeakMap,Fa=Symbol(""),zv=Symbol(""),Qd=Symbol("");function ss(e,t,n){if(Ui&&jn){let o=zp.get(e);o||zp.set(e,o=new Map);let s=o.get(n);s||(o.set(n,s=new d1),s.map=o,s.key=n),s.track()}}function Dr(e,t,n,o,s,i){const r=zp.get(e);if(!r){Xd++;return}const l=a=>{a&&a.trigger()};if(_k(),t==="clear")r.forEach(l);else{const a=Mt(e),c=a&&i1(n);if(a&&n==="length"){const u=Number(o);r.forEach((d,f)=>{(f==="length"||f===Qd||!ii(f)&&f>=u)&&l(d)})}else switch((n!==void 0||r.has(void 0))&&l(r.get(n)),c&&l(r.get(Qd)),t){case"add":a?c&&l(r.get("length")):(l(r.get(Fa)),Xc(e)&&l(r.get(zv)));break;case"delete":a||(l(r.get(Fa)),Xc(e)&&l(r.get(zv)));break;case"set":Xc(e)&&l(r.get(Fa));break}}Sk()}function p9(e,t){const n=zp.get(e);return n&&n.get(t)}function wc(e){const t=hn(e);return t===e?t:(ss(t,"iterate",Qd),ei(e)?t:t.map(Vi))}function f1(e){return ss(e=hn(e),"iterate",Qd),e}function ar(e,t){return Gr(e)?pu(Nl(e)?Vi(t):t):Vi(t)}const m9={__proto__:null,[Symbol.iterator](){return rg(this,Symbol.iterator,e=>ar(this,e))},concat(...e){return wc(this).concat(...e.map(t=>Mt(t)?wc(t):t))},entries(){return rg(this,"entries",e=>(e[1]=ar(this,e[1]),e))},every(e,t){return Cr(this,"every",e,t,void 0,arguments)},filter(e,t){return Cr(this,"filter",e,t,n=>n.map(o=>ar(this,o)),arguments)},find(e,t){return Cr(this,"find",e,t,n=>ar(this,n),arguments)},findIndex(e,t){return Cr(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Cr(this,"findLast",e,t,n=>ar(this,n),arguments)},findLastIndex(e,t){return Cr(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Cr(this,"forEach",e,t,void 0,arguments)},includes(...e){return lg(this,"includes",e)},indexOf(...e){return lg(this,"indexOf",e)},join(e){return wc(this).join(e)},lastIndexOf(...e){return lg(this,"lastIndexOf",e)},map(e,t){return Cr(this,"map",e,t,void 0,arguments)},pop(){return ed(this,"pop")},push(...e){return ed(this,"push",e)},reduce(e,...t){return tw(this,"reduce",e,t)},reduceRight(e,...t){return tw(this,"reduceRight",e,t)},shift(){return ed(this,"shift")},some(e,t){return Cr(this,"some",e,t,void 0,arguments)},splice(...e){return ed(this,"splice",e)},toReversed(){return wc(this).toReversed()},toSorted(e){return wc(this).toSorted(e)},toSpliced(...e){return wc(this).toSpliced(...e)},unshift(...e){return ed(this,"unshift",e)},values(){return rg(this,"values",e=>ar(this,e))}};function rg(e,t,n){const o=f1(e),s=o[t]();return o!==e&&!ei(e)&&(s._next=s.next,s.next=()=>{const i=s._next();return i.done||(i.value=n(i.value)),i}),s}const g9=Array.prototype;function Cr(e,t,n,o,s,i){const r=f1(e),l=r!==e&&!ei(e),a=r[t];if(a!==g9[t]){const d=a.apply(e,i);return l?Vi(d):d}let c=n;r!==e&&(l?c=function(d,f){return n.call(this,ar(e,d),f,e)}:n.length>2&&(c=function(d,f){return n.call(this,d,f,e)}));const u=a.call(r,c,o);return l&&s?s(u):u}function tw(e,t,n,o){const s=f1(e),i=s!==e&&!ei(e);let r=n,l=!1;s!==e&&(i?(l=o.length===0,r=function(c,u,d){return l&&(l=!1,c=ar(e,c)),n.call(this,c,ar(e,u),d,e)}):n.length>3&&(r=function(c,u,d){return n.call(this,c,u,d,e)}));const a=s[t](r,...o);return l?ar(e,a):a}function lg(e,t,n){const o=hn(e);ss(o,"iterate",Qd);const s=o[t](...n);return(s===-1||s===!1)&&m1(n[0])?(n[0]=hn(n[0]),o[t](...n)):s}function ed(e,t,n=[]){Vr(),_k();const o=hn(e)[t].apply(e,n);return Sk(),Kr(),o}const v9=n1("__proto__,__v_isRef,__isVue"),fA=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(ii));function y9(e){ii(e)||(e=String(e));const t=hn(this);return ss(t,"has",e),t.hasOwnProperty(e)}class hA{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,o){if(n==="__v_skip")return t.__v_skip;const s=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!s;if(n==="__v_isReadonly")return s;if(n==="__v_isShallow")return i;if(n==="__v_raw")return o===(s?i?kA:yA:i?vA:gA).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(o)?t:void 0;const r=Mt(t);if(!s){let a;if(r&&(a=m9[n]))return a;if(n==="hasOwnProperty")return y9}const l=Reflect.get(t,n,co(t)?t:o);if((ii(n)?fA.has(n):v9(n))||(s||ss(t,"get",n),i))return l;if(co(l)){const a=r&&i1(n)?l:l.value;return s&&xn(a)?qv(a):a}return xn(l)?s?qv(l):Do(l):l}}class pA extends hA{constructor(t=!1){super(!1,t)}set(t,n,o,s){let i=t[n];const r=Mt(t)&&i1(n);if(!this._isShallow){const c=Gr(i);if(!ei(o)&&!Gr(o)&&(i=hn(i),o=hn(o)),!r&&co(i)&&!co(o))return c||(i.value=o),!0}const l=r?Number(n)<t.length:kn(t,n),a=Reflect.set(t,n,o,co(t)?t:s);return t===hn(s)&&(l?Go(o,i)&&Dr(t,"set",n,o):Dr(t,"add",n,o)),a}deleteProperty(t,n){const o=kn(t,n);t[n];const s=Reflect.deleteProperty(t,n);return s&&o&&Dr(t,"delete",n,void 0),s}has(t,n){const o=Reflect.has(t,n);return(!ii(n)||!fA.has(n))&&ss(t,"has",n),o}ownKeys(t){return ss(t,"iterate",Mt(t)?"length":Fa),Reflect.ownKeys(t)}}class mA extends hA{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const k9=new pA,b9=new mA,x9=new pA(!0),w9=new mA(!0),Uv=e=>e,_h=e=>Reflect.getPrototypeOf(e);function _9(e,t,n){return function(...o){const s=this.__v_raw,i=hn(s),r=Xc(i),l=e==="entries"||e===Symbol.iterator&&r,a=e==="keys"&&r,c=s[e](...o),u=n?Uv:t?pu:Vi;return!t&&ss(i,"iterate",a?zv:Fa),Nn(Object.create(c),{next(){const{value:d,done:f}=c.next();return f?{value:d,done:f}:{value:l?[u(d[0]),u(d[1])]:u(d),done:f}}})}}function Sh(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function S9(e,t){const n={get(s){const i=this.__v_raw,r=hn(i),l=hn(s);e||(Go(s,l)&&ss(r,"get",s),ss(r,"get",l));const{has:a}=_h(r),c=t?Uv:e?pu:Vi;if(a.call(r,s))return c(i.get(s));if(a.call(r,l))return c(i.get(l));i!==r&&i.get(s)},get size(){const s=this.__v_raw;return!e&&ss(hn(s),"iterate",Fa),s.size},has(s){const i=this.__v_raw,r=hn(i),l=hn(s);return e||(Go(s,l)&&ss(r,"has",s),ss(r,"has",l)),s===l?i.has(s):i.has(s)||i.has(l)},forEach(s,i){const r=this,l=r.__v_raw,a=hn(l),c=t?Uv:e?pu:Vi;return!e&&ss(a,"iterate",Fa),l.forEach((u,d)=>s.call(i,c(u),c(d),r))}};return Nn(n,e?{add:Sh("add"),set:Sh("set"),delete:Sh("delete"),clear:Sh("clear")}:{add(s){const i=hn(this),r=_h(i),l=hn(s),a=!t&&!ei(s)&&!Gr(s)?l:s;return r.has.call(i,a)||Go(s,a)&&r.has.call(i,s)||Go(l,a)&&r.has.call(i,l)||(i.add(a),Dr(i,"add",a,a)),this},set(s,i){!t&&!ei(i)&&!Gr(i)&&(i=hn(i));const r=hn(this),{has:l,get:a}=_h(r);let c=l.call(r,s);c||(s=hn(s),c=l.call(r,s));const u=a.call(r,s);return r.set(s,i),c?Go(i,u)&&Dr(r,"set",s,i):Dr(r,"add",s,i),this},delete(s){const i=hn(this),{has:r,get:l}=_h(i);let a=r.call(i,s);a||(s=hn(s),a=r.call(i,s)),l&&l.call(i,s);const c=i.delete(s);return a&&Dr(i,"delete",s,void 0),c},clear(){const s=hn(this),i=s.size!==0,r=s.clear();return i&&Dr(s,"clear",void 0,void 0),r}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=_9(s,e,t)}),n}function h1(e,t){const n=S9(e,t);return(o,s,i)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?o:Reflect.get(kn(n,s)&&s in o?n:o,s,i)}const C9={get:h1(!1,!1)},A9={get:h1(!1,!0)},M9={get:h1(!0,!1)},E9={get:h1(!0,!0)},gA=new WeakMap,vA=new WeakMap,yA=new WeakMap,kA=new WeakMap;function T9(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Do(e){return Gr(e)?e:p1(e,!1,k9,C9,gA)}function N9(e){return p1(e,!1,x9,A9,vA)}function qv(e){return p1(e,!0,b9,M9,yA)}function ICe(e){return p1(e,!0,w9,E9,kA)}function p1(e,t,n,o,s){if(!xn(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const i=s.get(e);if(i)return i;const r=T9(XN(e));if(r===0)return e;const l=new Proxy(e,r===2?o:n);return s.set(e,l),l}function Nl(e){return Gr(e)?Nl(e.__v_raw):!!(e&&e.__v_isReactive)}function Gr(e){return!!(e&&e.__v_isReadonly)}function ei(e){return!!(e&&e.__v_isShallow)}function m1(e){return e?!!e.__v_raw:!1}function hn(e){const t=e&&e.__v_raw;return t?hn(t):e}function yt(e){return!kn(e,"__v_skip")&&Object.isExtensible(e)&&eA(e,"__v_skip",!0),e}const Vi=e=>xn(e)?Do(e):e,pu=e=>xn(e)?qv(e):e;function co(e){return e?e.__v_isRef===!0:!1}function ne(e){return bA(e,!1)}function gr(e){return bA(e,!0)}function bA(e,t){return co(e)?e:new I9(e,t)}class I9{constructor(t,n){this.dep=new d1,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:hn(t),this._value=n?t:Vi(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,o=this.__v_isShallow||ei(t)||Gr(t);t=o?t:hn(t),Go(t,n)&&(this._rawValue=t,this._value=o?t:Vi(t),this.dep.trigger())}}function L9(e){e.dep&&e.dep.trigger()}function C(e){return co(e)?e.value:e}function xA(e){return Pt(e)?e():C(e)}const $9={get:(e,t,n)=>t==="__v_raw"?e:C(Reflect.get(e,t,n)),set:(e,t,n,o)=>{const s=e[t];return co(s)&&!co(n)?(s.value=n,!0):Reflect.set(e,t,n,o)}};function wA(e){return Nl(e)?e:new Proxy(e,$9)}class F9{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new d1,{get:o,set:s}=t(n.track.bind(n),n.trigger.bind(n));this._get=o,this._set=s}get value(){return this._value=this._get()}set value(t){this._set(t)}}function O9(e){return new F9(e)}function LCe(e){const t=Mt(e)?new Array(e.length):{};for(const n in e)t[n]=_A(e,n);return t}class R9{constructor(t,n,o){this._object=t,this._defaultValue=o,this.__v_isRef=!0,this._value=void 0,this._key=ii(n)?n:String(n),this._raw=hn(t);let s=!0,i=t;if(!Mt(t)||ii(this._key)||!i1(this._key))do s=!m1(i)||ei(i);while(s&&(i=i.__v_raw));this._shallow=s}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&&co(this._raw[this._key])){const n=this._object[this._key];if(co(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return p9(this._raw,this._key)}}class B9{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 $Ce(e,t,n){return co(e)?e:Pt(e)?new B9(e):xn(e)&&arguments.length>1?_A(e,t,n):ne(e)}function _A(e,t,n){return new R9(e,t,n)}class D9{constructor(t,n,o){this.fn=t,this.setter=n,this._value=void 0,this.dep=new d1(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Xd-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=o}notify(){if(this.flags|=16,!(this.flags&8)&&jn!==this)return rA(this,!0),!0}get value(){const t=this.dep.track();return cA(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function P9(e,t,n=!1){let o,s;return Pt(e)?o=e:(o=e.get,s=e.set),new D9(o,s,n)}const FCe={GET:"get",HAS:"has",ITERATE:"iterate"},OCe={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},Ch={},Up=new WeakMap;let bl;function RCe(){return bl}function H9(e,t=!1,n=bl){if(n){let o=Up.get(n);o||Up.set(n,o=[]),o.push(e)}}function W9(e,t,n=sn){const{immediate:o,deep:s,once:i,scheduler:r,augmentJob:l,call:a}=n,c=b=>s?b:ei(b)||s===!1||s===0?Pr(b,1):Pr(b);let u,d,f,h,p=!1,m=!1;if(co(e)?(d=()=>e.value,p=ei(e)):Nl(e)?(d=()=>c(e),p=!0):Mt(e)?(m=!0,p=e.some(b=>Nl(b)||ei(b)),d=()=>e.map(b=>{if(co(b))return b.value;if(Nl(b))return c(b);if(Pt(b))return a?a(b,2):b()})):Pt(e)?t?d=a?()=>a(e,2):e:d=()=>{if(f){Vr();try{f()}finally{Kr()}}const b=bl;bl=u;try{return a?a(e,3,[h]):e(h)}finally{bl=b}}:d=Ci,t&&s){const b=d,A=s===!0?1/0:s;d=()=>Pr(b(),A)}const y=wk(),k=()=>{u.stop(),y&&y.active&&bk(y.effects,u)};if(i&&t){const b=t;t=(...A)=>{b(...A),k()}}let g=m?new Array(e.length).fill(Ch):Ch;const v=b=>{if(!(!(u.flags&1)||!u.dirty&&!b))if(t){const A=u.run();if(s||p||(m?A.some((I,T)=>Go(I,g[T])):Go(A,g))){f&&f();const I=bl;bl=u;try{const T=[A,g===Ch?void 0:m&&g[0]===Ch?[]:g,h];g=A,a?a(t,3,T):t(...T)}finally{bl=I}}}else u.run()};return l&&l(v),u=new Wp(d),u.scheduler=r?()=>r(v,!1):v,h=b=>H9(b,!1,u),f=u.onStop=()=>{const b=Up.get(u);if(b){if(a)a(b,4);else for(const A of b)A();Up.delete(u)}},t?o?v(!0):g=u.run():r?r(v.bind(null,!0),!0):u.run(),k.pause=u.pause.bind(u),k.resume=u.resume.bind(u),k.stop=k,k}function Pr(e,t=1/0,n){if(t<=0||!xn(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,co(e))Pr(e.value,t,n);else if(Mt(e))for(let o=0;o<e.length;o++)Pr(e[o],t,n);else if(Qa(e)||Xc(e))e.forEach(o=>{Pr(o,t,n)});else if(s1(e)){for(const o in e)Pr(e[o],t,n);for(const o of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,o)&&Pr(e[o],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 SA=[];function z9(e){SA.push(e)}function U9(){SA.pop()}function BCe(e,t){}const DCe={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"},q9={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 Ef(e,t,n,o){try{return o?e(...o):e()}catch(s){_u(s,t,n)}}function Ei(e,t,n,o){if(Pt(e)){const s=Ef(e,t,n,o);return s&&xk(s)&&s.catch(i=>{_u(i,t,n)}),s}if(Mt(e)){const s=[];for(let i=0;i<e.length;i++)s.push(Ei(e[i],t,n,o));return s}}function _u(e,t,n,o=!0){const s=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:r}=t&&t.appContext.config||sn;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){Vr(),Ef(i,null,10,[e,a,c]),Kr();return}}j9(e,n,s,o,r)}function j9(e,t,n,o=!0,s=!1){if(s)throw e;console.error(e)}const fs=[];let ir=-1;const Jc=[];let xl=null,$c=0;const CA=Promise.resolve();let qp=null;function kt(e){const t=qp||CA;return e?t.then(this?e.bind(this):e):t}function V9(e){let t=ir+1,n=fs.length;for(;t<n;){const o=t+n>>>1,s=fs[o],i=Jd(s);i<e||i===e&&s.flags&2?t=o+1:n=o}return t}function Ak(e){if(!(e.flags&1)){const t=Jd(e),n=fs[fs.length-1];!n||!(e.flags&2)&&t>=Jd(n)?fs.push(e):fs.splice(V9(t),0,e),e.flags|=1,AA()}}function AA(){qp||(qp=CA.then(MA))}function jp(e){Mt(e)?Jc.push(...e):xl&&e.id===-1?xl.splice($c+1,0,e):e.flags&1||(Jc.push(e),e.flags|=1),AA()}function nw(e,t,n=ir+1){for(;n<fs.length;n++){const o=fs[n];if(o&&o.flags&2){if(e&&o.id!==e.uid)continue;fs.splice(n,1),n--,o.flags&4&&(o.flags&=-2),o(),o.flags&4||(o.flags&=-2)}}}function Vp(e){if(Jc.length){const t=[...new Set(Jc)].sort((n,o)=>Jd(n)-Jd(o));if(Jc.length=0,xl){xl.push(...t);return}for(xl=t,$c=0;$c<xl.length;$c++){const n=xl[$c];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}xl=null,$c=0}}const Jd=e=>e.id==null?e.flags&2?-1:1/0:e.id;function MA(e){try{for(ir=0;ir<fs.length;ir++){const t=fs[ir];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Ef(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;ir<fs.length;ir++){const t=fs[ir];t&&(t.flags&=-2)}ir=-1,fs.length=0,Vp(),qp=null,(fs.length||Jc.length)&&MA()}}let Fc,Ah=[];function EA(e,t){var n,o;Fc=e,Fc?(Fc.enabled=!0,Ah.forEach(({event:s,args:i})=>Fc.emit(s,...i)),Ah=[]):typeof window<"u"&&window.HTMLElement&&!((o=(n=window.navigator)==null?void 0:n.userAgent)!=null&&o.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(i=>{EA(i,t)}),setTimeout(()=>{Fc||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Ah=[])},3e3)):Ah=[]}let Zo=null,g1=null;function ef(e){const t=Zo;return Zo=e,g1=e&&e.type.__scopeId||null,t}function PCe(e){g1=e}function HCe(){g1=null}const WCe=e=>Le;function Le(e,t=Zo,n){if(!t||e._n)return e;const o=(...s)=>{o._d&&Xp(-1);const i=ef(t);let r;try{r=e(...s)}finally{ef(i),o._d&&Xp(1)}return r};return o._n=!0,o._c=!0,o._d=!0,o}function Wn(e,t){if(Zo===null)return e;const n=Lf(Zo),o=e.dirs||(e.dirs=[]);for(let s=0;s<t.length;s++){let[i,r,l,a=sn]=t[s];i&&(Pt(i)&&(i={mounted:i,updated:i}),i.deep&&Pr(r),o.push({dir:i,instance:n,value:r,oldValue:void 0,arg:l,modifiers:a}))}return e}function rr(e,t,n,o){const s=e.dirs,i=t&&t.dirs;for(let r=0;r<s.length;r++){const l=s[r];i&&(l.oldValue=i[r].value);let a=l.dir[o];a&&(Vr(),Ei(a,n,8,[e.el,l,e,t]),Kr())}}function En(e,t){if(Yo){let n=Yo.provides;const o=Yo.parent&&Yo.parent.provides;o===n&&(n=Yo.provides=Object.create(o)),n[e]=t}}function Jt(e,t,n=!1){const o=bo();if(o||Oa){let s=Oa?Oa._context.provides:o?o.parent==null||o.ce?o.vnode.appContext&&o.vnode.appContext.provides:o.parent.provides:void 0;if(s&&e in s)return s[e];if(arguments.length>1)return n&&Pt(t)?t.call(o&&o.proxy):t}}function zCe(){return!!(bo()||Oa)}const K9=Symbol.for("v-scx"),G9=()=>Jt(K9);function TA(e,t){return Tf(e,null,t)}function UCe(e,t){return Tf(e,null,{flush:"post"})}function Y9(e,t){return Tf(e,null,{flush:"sync"})}function et(e,t,n){return Tf(e,t,n)}function Tf(e,t,n=sn){const{immediate:o,deep:s,flush:i,once:r}=n,l=Nn({},n),a=t&&o||!t&&i!=="post";let c;if(za){if(i==="sync"){const h=G9();c=h.__watcherHandles||(h.__watcherHandles=[])}else if(!a){const h=()=>{};return h.stop=Ci,h.resume=Ci,h.pause=Ci,h}}const u=Yo;l.call=(h,p,m)=>Ei(h,u,p,m);let d=!1;i==="post"?l.scheduler=h=>{ho(h,u&&u.suspense)}:i!=="sync"&&(d=!0,l.scheduler=(h,p)=>{p?h():Ak(h)}),l.augmentJob=h=>{t&&(h.flags|=4),d&&(h.flags|=2,u&&(h.id=u.uid,h.i=u))};const f=W9(e,t,l);return za&&(c?c.push(f):a&&f()),f}function Z9(e,t,n){const o=this.proxy,s=On(e)?e.includes(".")?NA(o,e):()=>o[e]:e.bind(o,o);let i;Pt(t)?i=t:(i=t.handler,n=t);const r=Su(this),l=Tf(s,i.bind(o),n);return r(),l}function NA(e,t){const n=t.split(".");return()=>{let o=e;for(let s=0;s<n.length&&o;s++)o=o[n[s]];return o}}const gl=new WeakMap,IA=Symbol("_vte"),LA=e=>e.__isTeleport,xa=e=>e&&(e.disabled||e.disabled===""),X9=e=>e&&(e.defer||e.defer===""),ow=e=>typeof SVGElement<"u"&&e instanceof SVGElement,sw=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,jv=(e,t)=>{const n=e&&e.to;return On(n)?t?t(n):null:n},Q9={name:"Teleport",__isTeleport:!0,process(e,t,n,o,s,i,r,l,a,c){const{mc:u,pc:d,pbc:f,o:{insert:h,querySelector:p,createText:m,createComment:y,parentNode:k}}=c,g=xa(t.props);let{dynamicChildren:v}=t;const b=(T,M,$)=>{T.shapeFlag&16&&u(T.children,M,$,s,i,r,l,a)},A=(T=t)=>{const M=xa(T.props),$=T.target=jv(T.props,p),N=Vv($,T,m,h);$&&(r!=="svg"&&ow($)?r="svg":r!=="mathml"&&sw($)&&(r="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add($),M||(b(T,$,N),pd(T,!1)))},I=T=>{const M=()=>{if(gl.get(T)===M){if(gl.delete(T),xa(T.props)){const $=k(T.el)||n;b(T,$,T.anchor),pd(T,!0)}A(T)}};gl.set(T,M),ho(M,i)};if(e==null){const T=t.el=m(""),M=t.anchor=m("");if(h(T,n,o),h(M,n,o),X9(t.props)||i&&i.pendingBranch){I(t);return}g&&(b(t,n,M),pd(t,!0)),A()}else{t.el=e.el;const T=t.anchor=e.anchor,M=gl.get(e);if(M){M.flags|=8,gl.delete(e),I(t);return}t.targetStart=e.targetStart;const $=t.target=e.target,N=t.targetAnchor=e.targetAnchor,F=xa(e.props),S=F?n:$,B=F?T:N;if(r==="svg"||ow($)?r="svg":(r==="mathml"||sw($))&&(r="mathml"),v?(f(e.dynamicChildren,v,S,s,i,r,l),Rk(e,t,!0)):a||d(e,t,S,B,s,i,r,l,!1),g)F?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Mh(t,n,T,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const W=t.target=jv(t.props,p);W&&Mh(t,W,null,c,0)}else F&&Mh(t,$,N,c,1);pd(t,g)}},remove(e,t,n,{um:o,o:{remove:s}},i){const{shapeFlag:r,children:l,anchor:a,targetStart:c,targetAnchor:u,target:d,props:f}=e,h=i||!xa(f),p=gl.get(e);if(p&&(p.flags|=8,gl.delete(e)),d&&(s(c),s(u)),i&&s(a),!p&&r&16)for(let m=0;m<l.length;m++){const y=l[m];o(y,t,n,h,!!y.dynamicChildren)}},move:Mh,hydrate:J9};function Mh(e,t,n,{o:{insert:o},m:s},i=2){i===0&&o(e.targetAnchor,t,n);const{el:r,anchor:l,shapeFlag:a,children:c,props:u}=e,d=i===2;if(d&&o(r,t,n),!gl.has(e)&&(!d||xa(u))&&a&16)for(let f=0;f<c.length;f++)s(c[f],t,n,2);d&&o(l,t,n)}function J9(e,t,n,o,s,i,{o:{nextSibling:r,parentNode:l,querySelector:a,insert:c,createText:u}},d){function f(y,k){let g=k;for(;g;){if(g&&g.nodeType===8){if(g.data==="teleport start anchor")t.targetStart=g;else if(g.data==="teleport anchor"){t.targetAnchor=g,y._lpa=t.targetAnchor&&r(t.targetAnchor);break}}g=r(g)}}function h(y,k){k.anchor=d(r(y),k,l(y),n,o,s,i)}const p=t.target=jv(t.props,a),m=xa(t.props);if(p){const y=p._lpa||p.firstChild;t.shapeFlag&16&&(m?(h(e,t),f(p,y),t.targetAnchor||Vv(p,t,u,c,l(e)===p?e:null)):(t.anchor=r(e),f(p,y),t.targetAnchor||Vv(p,t,u,c),d(y&&r(y),t,p,n,o,s,i))),pd(t,m)}else m&&t.shapeFlag&16&&(h(e,t),t.targetStart=e,t.targetAnchor=r(e));return t.anchor&&r(t.anchor)}const v1=Q9;function pd(e,t){const n=e.ctx;if(n&&n.ut){let o,s;for(t?(o=e.el,s=e.anchor):(o=e.targetStart,s=e.targetAnchor);o&&o!==s;)o.nodeType===1&&o.setAttribute("data-v-owner",n.uid),o=o.nextSibling;n.ut()}}function Vv(e,t,n,o,s=null){const i=t.targetStart=n(""),r=t.targetAnchor=n("");return i[IA]=r,e&&(o(i,e,s),o(r,e,s)),r}const bi=Symbol("_leaveCb"),td=Symbol("_enterCb");function $A(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return wn(()=>{e.isMounted=!0}),so(()=>{e.isUnmounting=!0}),e}const mi=[Function,Array],FA={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:mi,onEnter:mi,onAfterEnter:mi,onEnterCancelled:mi,onBeforeLeave:mi,onLeave:mi,onAfterLeave:mi,onLeaveCancelled:mi,onBeforeAppear:mi,onAppear:mi,onAfterAppear:mi,onAppearCancelled:mi},OA=e=>{const t=e.subTree;return t.component?OA(t.component):t},eI={name:"BaseTransition",props:FA,setup(e,{slots:t}){const n=bo(),o=$A();return()=>{const s=t.default&&Mk(t.default(),!0),i=s&&s.length?RA(s):n.subTree?ue():void 0;if(!i)return;const r=hn(e),{mode:l}=r;if(o.isLeaving)return ag(i);const a=iw(i);if(!a)return ag(i);let c=tf(a,r,o,n,d=>c=d);a.type!==go&&Rl(a,c);let u=n.subTree&&iw(n.subTree);if(u&&u.type!==go&&!Pi(u,a)&&OA(n).type!==go){let d=tf(u,r,o,n);if(Rl(u,d),l==="out-in"&&a.type!==go)return o.isLeaving=!0,d.afterLeave=()=>{o.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},ag(i);l==="in-out"&&a.type!==go?d.delayLeave=(f,h,p)=>{const m=BA(o,u);m[String(u.key)]=u,f[bi]=()=>{h(),f[bi]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{p(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return i}}};function RA(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==go){t=n;break}}return t}const tI=eI;function BA(e,t){const{leavingVNodes:n}=e;let o=n.get(t.type);return o||(o=Object.create(null),n.set(t.type,o)),o}function tf(e,t,n,o,s){const{appear:i,mode:r,persisted:l=!1,onBeforeEnter:a,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:f,onLeave:h,onAfterLeave:p,onLeaveCancelled:m,onBeforeAppear:y,onAppear:k,onAfterAppear:g,onAppearCancelled:v}=t,b=String(e.key),A=BA(n,e),I=($,N)=>{$&&Ei($,o,9,N)},T=($,N)=>{const F=N[1];I($,N),Mt($)?$.every(S=>S.length<=1)&&F():$.length<=1&&F()},M={mode:r,persisted:l,beforeEnter($){let N=a;if(!n.isMounted)if(i)N=y||a;else return;$[bi]&&$[bi](!0);const F=A[b];F&&Pi(e,F)&&F.el[bi]&&F.el[bi](),I(N,[$])},enter($){if(A[b]===e)return;let N=c,F=u,S=d;if(!n.isMounted)if(i)N=k||c,F=g||u,S=v||d;else return;let B=!1;$[td]=z=>{B||(B=!0,z?I(S,[$]):I(F,[$]),M.delayedLeave&&M.delayedLeave(),$[td]=void 0)};const W=$[td].bind(null,!1);N?T(N,[$,W]):W()},leave($,N){const F=String(e.key);if($[td]&&$[td](!0),n.isUnmounting)return N();I(f,[$]);let S=!1;$[bi]=W=>{S||(S=!0,N(),W?I(m,[$]):I(p,[$]),$[bi]=void 0,A[F]===e&&delete A[F])};const B=$[bi].bind(null,!1);A[F]=e,h?T(h,[$,B]):B()},clone($){const N=tf($,t,n,o,s);return s&&s(N),N}};return M}function ag(e){if(Nf(e))return e=Yr(e),e.children=null,e}function iw(e){if(!Nf(e))return LA(e.type)&&e.children?RA(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&&Pt(n.default))return n.default()}}function Rl(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Rl(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 Mk(e,t=!1,n){let o=[],s=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===Pe?(r.patchFlag&128&&s++,o=o.concat(Mk(r.children,t,l))):(t||r.type!==go)&&o.push(l!=null?Yr(r,{key:l}):r)}if(s>1)for(let i=0;i<o.length;i++)o[i].patchFlag=-2;return o}function Qe(e,t){return Pt(e)?Nn({name:e.name},t,{setup:e}):e}function qCe(){const e=bo();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""}function Ek(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function jCe(e){const t=bo(),n=gr(null);if(t){const s=t.refs===sn?t.refs={}:t.refs;Object.defineProperty(s,e,{enumerable:!0,get:()=>n.value,set:i=>n.value=i})}return n}function rw(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Kp=new WeakMap;function eu(e,t,n,o,s=!1){if(Mt(e)){e.forEach((m,y)=>eu(m,t&&(Mt(t)?t[y]:t),n,o,s));return}if(qr(o)&&!s){o.shapeFlag&512&&o.type.__asyncResolved&&o.component.subTree.component&&eu(e,t,n,o.component.subTree);return}const i=o.shapeFlag&4?Lf(o.component):o.el,r=s?null:i,{i:l,r:a}=e,c=t&&t.r,u=l.refs===sn?l.refs={}:l.refs,d=l.setupState,f=hn(d),h=d===sn?Q3:m=>rw(u,m)?!1:kn(f,m),p=(m,y)=>!(y&&rw(u,y));if(c!=null&&c!==a){if(lw(t),On(c))u[c]=null,h(c)&&(d[c]=null);else if(co(c)){const m=t;p(c,m.k)&&(c.value=null),m.k&&(u[m.k]=null)}}if(Pt(a))Ef(a,l,12,[r,u]);else{const m=On(a),y=co(a);if(m||y){const k=()=>{if(e.f){const g=m?h(a)?d[a]:u[a]:p()||!e.k?a.value:u[e.k];if(s)Mt(g)&&bk(g,i);else if(Mt(g))g.includes(i)||g.push(i);else if(m)u[a]=[i],h(a)&&(d[a]=u[a]);else{const v=[i];p(a,e.k)&&(a.value=v),e.k&&(u[e.k]=v)}}else m?(u[a]=r,h(a)&&(d[a]=r)):y&&(p(a,e.k)&&(a.value=r),e.k&&(u[e.k]=r))};if(r){const g=()=>{k(),Kp.delete(e)};g.id=-1,Kp.set(e,g),ho(g,n)}else lw(e),k()}}}function lw(e){const t=Kp.get(e);t&&(t.flags|=8,Kp.delete(e))}let aw=!1;const _c=()=>{aw||(console.error("Hydration completed but contains mismatches."),aw=!0)},nI=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",oI=e=>e.namespaceURI.includes("MathML"),Eh=e=>{if(e.nodeType===1){if(nI(e))return"svg";if(oI(e))return"mathml"}},zc=e=>e.nodeType===8;function sI(e){const{mt:t,p:n,o:{patchProp:o,createText:s,nextSibling:i,parentNode:r,remove:l,insert:a,createComment:c}}=e,u=(v,b)=>{if(!b.hasChildNodes()){n(null,v,b),Vp(),b._vnode=v;return}d(b.firstChild,v,null,null,null),Vp(),b._vnode=v},d=(v,b,A,I,T,M=!1)=>{M=M||!!b.dynamicChildren;const $=zc(v)&&v.data==="[",N=()=>m(v,b,A,I,T,$),{type:F,ref:S,shapeFlag:B,patchFlag:W}=b;let z=v.nodeType;b.el=v,W===-2&&(M=!1,b.dynamicChildren=null);let L=null;switch(F){case Il:z!==3?b.children===""?(a(b.el=s(""),r(v),v),L=v):L=N():(v.data!==b.children&&(_c(),v.data=b.children),L=i(v));break;case go:g(v)?(L=i(v),k(b.el=v.content.firstChild,v,A)):z!==8||$?L=N():L=i(v);break;case nu:if($&&(v=i(v),z=v.nodeType),z===1||z===3){L=v;const O=!b.children.length;for(let j=0;j<b.staticCount;j++)O&&(b.children+=L.nodeType===1?L.outerHTML:L.data),j===b.staticCount-1&&(b.anchor=L),L=i(L);return $?i(L):L}else N();break;case Pe:$?L=p(v,b,A,I,T,M):L=N();break;default:if(B&1)(z!==1||b.type.toLowerCase()!==v.tagName.toLowerCase())&&!g(v)?L=N():L=f(v,b,A,I,T,M);else if(B&6){b.slotScopeIds=T;const O=r(v);if($?L=y(v):zc(v)&&v.data==="teleport start"?L=y(v,v.data,"teleport end"):L=i(v),t(b,O,null,A,I,Eh(O),M),qr(b)&&!b.type.__asyncResolved){let j;$?(j=fe(Pe),j.anchor=L?L.previousSibling:O.lastChild):j=v.nodeType===3?nt(""):fe("div"),j.el=v,b.component.subTree=j}}else B&64?z!==8?L=N():L=b.type.hydrate(v,b,A,I,T,M,e,h):B&128&&(L=b.type.hydrate(v,b,A,I,Eh(r(v)),T,M,e,d))}return S!=null&&eu(S,null,I,b),L},f=(v,b,A,I,T,M)=>{M=M||!!b.dynamicChildren;const{type:$,props:N,patchFlag:F,shapeFlag:S,dirs:B,transition:W}=b,z=$==="input"||$==="option";if(z||F!==-1){B&&rr(b,null,A,"created");let L=!1;if(g(v)){L=oM(null,W)&&A&&A.vnode.props&&A.vnode.props.appear;const j=v.content.firstChild;if(L){const Z=j.getAttribute("class");Z&&(j.$cls=Z),W.beforeEnter(j)}k(j,v,A),b.el=v=j}if(S&16&&!(N&&(N.innerHTML||N.textContent))){let j=h(v.firstChild,b,v,A,I,T,M);for(j&&!Th(v,1)&&_c();j;){const Z=j;j=j.nextSibling,l(Z)}}else if(S&8){let j=b.children;j[0]===`
|
|
15
|
-
`&&(v.tagName==="PRE"||v.tagName==="TEXTAREA")&&(j=j.slice(1));const{textContent:Z}=v;Z!==j&&Z!==j.replace(/\r\n|\r/g,`
|
|
16
|
-
`)&&(Th(v,0)||_c(),v.textContent=b.children)}if(N){if(z||!M||F&48){const j=v.tagName.includes("-");for(const Z in N)(z&&(Z.endsWith("value")||Z==="indeterminate")||Af(Z)&&!$a(Z)||Z[0]==="."||j&&!$a(Z))&&o(v,Z,null,N[Z],void 0,A)}else if(N.onClick)o(v,"onClick",null,N.onClick,void 0,A);else if(F&4&&Nl(N.style))for(const j in N.style)N.style[j]}let O;(O=N&&N.onVnodeBeforeMount)&&Es(O,A,b),B&&rr(b,null,A,"beforeMount"),((O=N&&N.onVnodeMounted)||B||L)&&lM(()=>{O&&Es(O,A,b),L&&W.enter(v),B&&rr(b,null,A,"mounted")},I)}return v.nextSibling},h=(v,b,A,I,T,M,$)=>{$=$||!!b.dynamicChildren;const N=b.children,F=N.length;let S=!1;for(let B=0;B<F;B++){const W=$?N[B]:N[B]=Ls(N[B]),z=W.type===Il;v?(z&&!$&&B+1<F&&Ls(N[B+1]).type===Il&&(a(s(v.data.slice(W.children.length)),A,i(v)),v.data=W.children),v=d(v,W,I,T,M,$)):z&&!W.children?a(W.el=s(""),A):(S||(S=!0,Th(A,1)||_c()),n(null,W,A,null,I,T,Eh(A),M))}return v},p=(v,b,A,I,T,M)=>{const{slotScopeIds:$}=b;$&&(T=T?T.concat($):$);const N=r(v),F=h(i(v),b,N,A,I,T,M);return F&&zc(F)&&F.data==="]"?i(b.anchor=F):(_c(),a(b.anchor=c("]"),N,F),F)},m=(v,b,A,I,T,M)=>{if(Th(v.parentElement,1)||_c(),b.el=null,M){const F=y(v);for(;;){const S=i(v);if(S&&S!==F)l(S);else break}}const $=i(v),N=r(v);return l(v),n(null,b,N,$,A,I,Eh(N),T),A&&(A.vnode.el=b.el,b1(A,b.el)),$},y=(v,b="[",A="]")=>{let I=0;for(;v;)if(v=i(v),v&&zc(v)&&(v.data===b&&I++,v.data===A)){if(I===0)return i(v);I--}return v},k=(v,b,A)=>{const I=b.parentNode;I&&I.replaceChild(v,b);let T=A;for(;T;)T.vnode.el===b&&(T.vnode.el=T.subTree.el=v),T=T.parent},g=v=>v.nodeType===1&&v.tagName==="TEMPLATE";return[u,d]}const cw="data-allow-mismatch",iI={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function Th(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(cw);)e=e.parentElement;const n=e&&e.getAttribute(cw);if(n==null)return!1;if(n==="")return!0;{const o=n.split(",");return t===0&&o.includes("children")?!0:o.includes(iI[t])}}const rI=c1().requestIdleCallback||(e=>setTimeout(e,1)),lI=c1().cancelIdleCallback||(e=>clearTimeout(e)),VCe=(e=1e4)=>t=>{const n=rI(t,{timeout:e});return()=>lI(n)};function aI(e){const{top:t,left:n,bottom:o,right:s}=e.getBoundingClientRect(),{innerHeight:i,innerWidth:r}=window;return(t>0&&t<i||o>0&&o<i)&&(n>0&&n<r||s>0&&s<r)}const KCe=e=>(t,n)=>{const o=new IntersectionObserver(s=>{for(const i of s)if(i.isIntersecting){o.disconnect(),t();break}},e);return n(s=>{if(s instanceof Element){if(aI(s))return t(),o.disconnect(),!1;o.observe(s)}}),()=>o.disconnect()},GCe=e=>t=>{if(e){const n=matchMedia(e);if(n.matches)t();else return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t)}},YCe=(e=[])=>(t,n)=>{On(e)&&(e=[e]);let o=!1;const s=r=>{o||(o=!0,i(),t(),r.target.dispatchEvent(new r.constructor(r.type,r)))},i=()=>{n(r=>{for(const l of e)r.removeEventListener(l,s)})};return n(r=>{for(const l of e)r.addEventListener(l,s,{once:!0})}),i};function cI(e,t){if(zc(e)&&e.data==="["){let n=1,o=e.nextSibling;for(;o;){if(o.nodeType===1){if(t(o)===!1)break}else if(zc(o))if(o.data==="]"){if(--n===0)break}else o.data==="["&&n++;o=o.nextSibling}}else t(e)}const qr=e=>!!e.type.__asyncLoader;function Hi(e){Pt(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:o,delay:s=200,hydrate:i,timeout:r,suspensible:l=!0,onError:a}=e;let c=null,u,d=0;const f=()=>(d++,c=null,h()),h=()=>{let p;return c||(p=c=t().catch(m=>{if(m=m instanceof Error?m:new Error(String(m)),a)return new Promise((y,k)=>{a(m,()=>y(f()),()=>k(m),d+1)});throw m}).then(m=>p!==c&&c?c:(m&&(m.__esModule||m[Symbol.toStringTag]==="Module")&&(m=m.default),u=m,m)))};return Qe({name:"AsyncComponentWrapper",__asyncLoader:h,__asyncHydrate(p,m,y){let k=!1;(m.bu||(m.bu=[])).push(()=>k=!0);const g=()=>{k||y()},v=i?()=>{const b=i(g,A=>cI(p,A));b&&(m.bum||(m.bum=[])).push(b)}:g;u?v():h().then(()=>!m.isUnmounted&&v())},get __asyncResolved(){return u},setup(){const p=Yo;if(Ek(p),u)return()=>Nh(u,p);const m=v=>{c=null,_u(v,p,13,!o)};if(l&&p.suspense||za)return h().then(v=>()=>Nh(v,p)).catch(v=>(m(v),()=>o?fe(o,{error:v}):null));const y=ne(!1),k=ne(),g=ne(!!s);return s&&setTimeout(()=>{g.value=!1},s),r!=null&&setTimeout(()=>{if(!y.value&&!k.value){const v=new Error(`Async component timed out after ${r}ms.`);m(v),k.value=v}},r),h().then(()=>{y.value=!0,p.parent&&Nf(p.parent.vnode)&&p.parent.update()}).catch(v=>{m(v),k.value=v}),()=>{if(y.value&&u)return Nh(u,p);if(k.value&&o)return fe(o,{error:k.value});if(n&&!g.value)return Nh(n,p)}}})}function Nh(e,t){const{ref:n,props:o,children:s,ce:i}=t.vnode,r=fe(e,o,s);return r.ref=n,r.ce=i,delete t.vnode.ce,r}const Nf=e=>e.type.__isKeepAlive,uI={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=bo(),o=n.ctx;if(!o.renderer)return()=>{const g=t.default&&t.default();return g&&g.length===1?g[0]:g};const s=new Map,i=new Set;let r=null;const l=n.suspense,{renderer:{p:a,m:c,um:u,o:{createElement:d}}}=o,f=d("div");o.activate=(g,v,b,A,I)=>{const T=g.component;c(g,v,b,0,l),a(T.vnode,g,v,b,T,l,A,g.slotScopeIds,I),ho(()=>{T.isDeactivated=!1,T.a&&Qc(T.a);const M=g.props&&g.props.onVnodeMounted;M&&Es(M,T.parent,g)},l)},o.deactivate=g=>{const v=g.component;Yp(v.m),Yp(v.a),c(g,f,null,1,l),ho(()=>{v.da&&Qc(v.da);const b=g.props&&g.props.onVnodeUnmounted;b&&Es(b,v.parent,g),v.isDeactivated=!0},l)};function h(g){cg(g),u(g,n,l,!0)}function p(g){s.forEach((v,b)=>{const A=ty(qr(v)?v.type.__asyncResolved||{}:v.type);A&&!g(A)&&m(b)})}function m(g){const v=s.get(g);v&&(!r||!Pi(v,r))?h(v):r&&cg(r),s.delete(g),i.delete(g)}et(()=>[e.include,e.exclude],([g,v])=>{g&&p(b=>md(g,b)),v&&p(b=>!md(v,b))},{flush:"post",deep:!0});let y=null;const k=()=>{y!=null&&(Zp(n.subTree.type)?ho(()=>{s.set(y,Ih(n.subTree))},n.subTree.suspense):s.set(y,Ih(n.subTree)))};return wn(k),Tk(k),so(()=>{s.forEach(g=>{const{subTree:v,suspense:b}=n,A=Ih(v);if(g.type===A.type&&g.key===A.key){cg(A);const I=A.component.da;I&&ho(I,b);return}h(g)})}),()=>{if(y=null,!t.default)return r=null;const g=t.default(),v=g[0];if(g.length>1)return r=null,g;if(!Bl(v)||!(v.shapeFlag&4)&&!(v.shapeFlag&128))return r=null,v;let b=Ih(v);if(b.type===go)return r=null,b;const A=b.type,I=ty(qr(b)?b.type.__asyncResolved||{}:A),{include:T,exclude:M,max:$}=e;if(T&&(!I||!md(T,I))||M&&I&&md(M,I))return b.shapeFlag&=-257,r=b,v;const N=b.key==null?A:b.key,F=s.get(N);return b.el&&(b=Yr(b),v.shapeFlag&128&&(v.ssContent=b)),y=N,F?(b.el=F.el,b.component=F.component,b.transition&&Rl(b,b.transition),b.shapeFlag|=512,i.delete(N),i.add(N)):(i.add(N),$&&i.size>parseInt($,10)&&m(i.values().next().value)),b.shapeFlag|=256,r=b,Zp(v.type)?v:b}}},ZCe=uI;function md(e,t){return Mt(e)?e.some(n=>md(n,t)):On(e)?e.split(",").includes(t):ZN(e)?(e.lastIndex=0,e.test(t)):!1}function dI(e,t){DA(e,"a",t)}function fI(e,t){DA(e,"da",t)}function DA(e,t,n=Yo){const o=e.__wdc||(e.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(y1(t,o,n),n){let s=n.parent;for(;s&&s.parent;)Nf(s.parent.vnode)&&hI(o,t,n,s),s=s.parent}}function hI(e,t,n,o){const s=y1(t,e,o,!0);In(()=>{bk(o[t],s)},n)}function cg(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function Ih(e){return e.shapeFlag&128?e.ssContent:e}function y1(e,t,n=Yo,o=!1){if(n){const s=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...r)=>{Vr();const l=Su(n),a=Ei(t,n,e,r);return l(),Kr(),a});return o?s.unshift(i):s.push(i),i}}const Xr=e=>(t,n=Yo)=>{(!za||e==="sp")&&y1(e,(...o)=>t(...o),n)},pI=Xr("bm"),wn=Xr("m"),PA=Xr("bu"),Tk=Xr("u"),so=Xr("bum"),In=Xr("um"),mI=Xr("sp"),gI=Xr("rtg"),vI=Xr("rtc");function yI(e,t=Yo){y1("ec",e,t)}const Nk="components",kI="directives";function bI(e,t){return Ik(Nk,e,!0,t)||e}const HA=Symbol.for("v-ndc");function Ro(e){return On(e)?Ik(Nk,e,!1)||e:e||HA}function XCe(e){return Ik(kI,e)}function Ik(e,t,n=!0,o=!1){const s=Zo||Yo;if(s){const i=s.type;if(e===Nk){const l=ty(i,!1);if(l&&(l===t||l===Mo(t)||l===l1(Mo(t))))return i}const r=uw(s[e]||i[e],t)||uw(s.appContext[e],t);return!r&&o?i:r}}function uw(e,t){return e&&(e[t]||e[Mo(t)]||e[l1(Mo(t))])}function lt(e,t,n,o){let s;const i=n&&n[o],r=Mt(e);if(r||On(e)){const l=r&&Nl(e);let a=!1,c=!1;l&&(a=!ei(e),c=Gr(e),e=f1(e)),s=new Array(e.length);for(let u=0,d=e.length;u<d;u++)s[u]=t(a?c?pu(Vi(e[u])):Vi(e[u]):e[u],u,void 0,i&&i[u])}else if(typeof e=="number"){s=new Array(e);for(let l=0;l<e;l++)s[l]=t(l+1,l,void 0,i&&i[l])}else if(xn(e))if(e[Symbol.iterator])s=Array.from(e,(l,a)=>t(l,a,void 0,i&&i[a]));else{const l=Object.keys(e);s=new Array(l.length);for(let a=0,c=l.length;a<c;a++){const u=l[a];s[a]=t(e[u],u,a,i&&i[a])}}else s=[];return n&&(n[o]=s),s}function WA(e,t){for(let n=0;n<t.length;n++){const o=t[n];if(Mt(o))for(let s=0;s<o.length;s++)e[o[s].name]=o[s].fn;else o&&(e[o.name]=o.key?(...s)=>{const i=o.fn(...s);return i&&(i.key=o.key),i}:o.fn)}return e}function zn(e,t,n={},o,s){if(Zo.ce||Zo.parent&&qr(Zo.parent)&&Zo.parent.ce){const c=Object.keys(n).length>0;return t!=="default"&&(n.name=t),x(),Ae(Pe,null,[fe("slot",n,o&&o())],c?-2:64)}let i=e[t];i&&i._c&&(i._d=!1),x();const r=i&&Lk(i(n)),l=n.key||r&&r.key,a=Ae(Pe,{key:(l&&!ii(l)?l:`_${t}`)+(!r&&o?"_fb":"")},r||(o?o():[]),r&&e._===1?64:-2);return!s&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),i&&i._c&&(i._d=!0),a}function Lk(e){return e.some(t=>Bl(t)?!(t.type===go||t.type===Pe&&!Lk(t.children)):!0)?e:null}function QCe(e,t){const n={};for(const o in e)n[t&&/[A-Z]/.test(o)?`on:${o}`:mp(o)]=e[o];return n}const Kv=e=>e?hM(e)?Lf(e):Kv(e.parent):null,Id=Nn(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=>Kv(e.parent),$root:e=>Kv(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>$k(e),$forceUpdate:e=>e.f||(e.f=()=>{Ak(e.update)}),$nextTick:e=>e.n||(e.n=kt.bind(e.proxy)),$watch:e=>Z9.bind(e)}),ug=(e,t)=>e!==sn&&!e.__isScriptSetup&&kn(e,t),Gv={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:o,data:s,props:i,accessCache:r,type:l,appContext:a}=e;if(t[0]!=="$"){const f=r[t];if(f!==void 0)switch(f){case 1:return o[t];case 2:return s[t];case 4:return n[t];case 3:return i[t]}else{if(ug(o,t))return r[t]=1,o[t];if(s!==sn&&kn(s,t))return r[t]=2,s[t];if(kn(i,t))return r[t]=3,i[t];if(n!==sn&&kn(n,t))return r[t]=4,n[t];Yv&&(r[t]=0)}}const c=Id[t];let u,d;if(c)return t==="$attrs"&&ss(e.attrs,"get",""),c(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(n!==sn&&kn(n,t))return r[t]=4,n[t];if(d=a.config.globalProperties,kn(d,t))return d[t]},set({_:e},t,n){const{data:o,setupState:s,ctx:i}=e;return ug(s,t)?(s[t]=n,!0):o!==sn&&kn(o,t)?(o[t]=n,!0):kn(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:o,appContext:s,props:i,type:r}},l){let a;return!!(n[l]||e!==sn&&l[0]!=="$"&&kn(e,l)||ug(t,l)||kn(i,l)||kn(o,l)||kn(Id,l)||kn(s.config.globalProperties,l)||(a=r.__cssModules)&&a[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:kn(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},xI=Nn({},Gv,{get(e,t){if(t!==Symbol.unscopables)return Gv.get(e,t,e)},has(e,t){return t[0]!=="_"&&!t9(t)}});function JCe(){return null}function e4e(){return null}function t4e(e){}function n4e(e){}function o4e(){return null}function s4e(){}function i4e(e,t){return null}function r4e(){return zA().slots}function If(){return zA().attrs}function zA(e){const t=bo();return t.setupContext||(t.setupContext=gM(t))}function nf(e){return Mt(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function l4e(e,t){const n=nf(e);for(const o in t){if(o.startsWith("__skip"))continue;let s=n[o];s?Mt(s)||Pt(s)?s=n[o]={type:s,default:t[o]}:s.default=t[o]:s===null&&(s=n[o]={default:t[o]}),s&&t[`__skip_${o}`]&&(s.skipFactory=!0)}return n}function a4e(e,t){return!e||!t?e||t:Mt(e)&&Mt(t)?e.concat(t):Nn({},nf(e),nf(t))}function c4e(e,t){const n={};for(const o in e)t.includes(o)||Object.defineProperty(n,o,{enumerable:!0,get:()=>e[o]});return n}function u4e(e){const t=bo(),n=za;let o=e();sf(),n&&ou(!1);const s=()=>{Su(t),n&&ou(!0)},i=()=>{bo()!==t&&t.scope.off(),sf(),n&&ou(!1)};return xk(o)&&(o=o.catch(r=>{throw s(),Promise.resolve().then(()=>Promise.resolve().then(i)),r})),[o,()=>{s(),Promise.resolve().then(i)}]}let Yv=!0;function wI(e){const t=$k(e),n=e.proxy,o=e.ctx;Yv=!1,t.beforeCreate&&dw(t.beforeCreate,e,"bc");const{data:s,computed:i,methods:r,watch:l,provide:a,inject:c,created:u,beforeMount:d,mounted:f,beforeUpdate:h,updated:p,activated:m,deactivated:y,beforeDestroy:k,beforeUnmount:g,destroyed:v,unmounted:b,render:A,renderTracked:I,renderTriggered:T,errorCaptured:M,serverPrefetch:$,expose:N,inheritAttrs:F,components:S,directives:B,filters:W}=t;if(c&&_I(c,o,null),r)for(const O in r){const j=r[O];Pt(j)&&(o[O]=j.bind(n))}if(s){const O=s.call(n,n);xn(O)&&(e.data=Do(O))}if(Yv=!0,i)for(const O in i){const j=i[O],Z=Pt(j)?j.bind(n,n):Pt(j.get)?j.get.bind(n,n):Ci,ie=!Pt(j)&&Pt(j.set)?j.set.bind(n):Ci,U=D({get:Z,set:ie});Object.defineProperty(o,O,{enumerable:!0,configurable:!0,get:()=>U.value,set:q=>U.value=q})}if(l)for(const O in l)UA(l[O],o,n,O);if(a){const O=Pt(a)?a.call(n):a;Reflect.ownKeys(O).forEach(j=>{En(j,O[j])})}u&&dw(u,e,"c");function L(O,j){Mt(j)?j.forEach(Z=>O(Z.bind(n))):j&&O(j.bind(n))}if(L(pI,d),L(wn,f),L(PA,h),L(Tk,p),L(dI,m),L(fI,y),L(yI,M),L(vI,I),L(gI,T),L(so,g),L(In,b),L(mI,$),Mt(N))if(N.length){const O=e.exposed||(e.exposed={});N.forEach(j=>{Object.defineProperty(O,j,{get:()=>n[j],set:Z=>n[j]=Z,enumerable:!0})})}else e.exposed||(e.exposed={});A&&e.render===Ci&&(e.render=A),F!=null&&(e.inheritAttrs=F),S&&(e.components=S),B&&(e.directives=B),$&&Ek(e)}function _I(e,t,n=Ci){Mt(e)&&(e=Zv(e));for(const o in e){const s=e[o];let i;xn(s)?"default"in s?i=Jt(s.from||o,s.default,!0):i=Jt(s.from||o):i=Jt(s),co(i)?Object.defineProperty(t,o,{enumerable:!0,configurable:!0,get:()=>i.value,set:r=>i.value=r}):t[o]=i}}function dw(e,t,n){Ei(Mt(e)?e.map(o=>o.bind(t.proxy)):e.bind(t.proxy),t,n)}function UA(e,t,n,o){let s=o.includes(".")?NA(n,o):()=>n[o];if(On(e)){const i=t[e];Pt(i)&&et(s,i)}else if(Pt(e))et(s,e.bind(n));else if(xn(e))if(Mt(e))e.forEach(i=>UA(i,t,n,o));else{const i=Pt(e.handler)?e.handler.bind(n):t[e.handler];Pt(i)&&et(s,i,e)}}function $k(e){const t=e.type,{mixins:n,extends:o}=t,{mixins:s,optionsCache:i,config:{optionMergeStrategies:r}}=e.appContext,l=i.get(t);let a;return l?a=l:!s.length&&!n&&!o?a=t:(a={},s.length&&s.forEach(c=>Gp(a,c,r,!0)),Gp(a,t,r)),xn(t)&&i.set(t,a),a}function Gp(e,t,n,o=!1){const{mixins:s,extends:i}=t;i&&Gp(e,i,n,!0),s&&s.forEach(r=>Gp(e,r,n,!0));for(const r in t)if(!(o&&r==="expose")){const l=SI[r]||n&&n[r];e[r]=l?l(e[r],t[r]):t[r]}return e}const SI={data:fw,props:hw,emits:hw,methods:gd,computed:gd,beforeCreate:as,created:as,beforeMount:as,mounted:as,beforeUpdate:as,updated:as,beforeDestroy:as,beforeUnmount:as,destroyed:as,unmounted:as,activated:as,deactivated:as,errorCaptured:as,serverPrefetch:as,components:gd,directives:gd,watch:AI,provide:fw,inject:CI};function fw(e,t){return t?e?function(){return Nn(Pt(e)?e.call(this,this):e,Pt(t)?t.call(this,this):t)}:t:e}function CI(e,t){return gd(Zv(e),Zv(t))}function Zv(e){if(Mt(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function as(e,t){return e?[...new Set([].concat(e,t))]:t}function gd(e,t){return e?Nn(Object.create(null),e,t):t}function hw(e,t){return e?Mt(e)&&Mt(t)?[...new Set([...e,...t])]:Nn(Object.create(null),nf(e),nf(t??{})):t}function AI(e,t){if(!e)return t;if(!t)return e;const n=Nn(Object.create(null),e);for(const o in t)n[o]=as(e[o],t[o]);return n}function qA(){return{app:null,config:{isNativeTag:Q3,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 MI=0;function EI(e,t){return function(o,s=null){Pt(o)||(o=Nn({},o)),s!=null&&!xn(s)&&(s=null);const i=qA(),r=new WeakSet,l=[];let a=!1;const c=i.app={_uid:MI++,_component:o,_props:s,_container:null,_context:i,_instance:null,version:o7,get config(){return i.config},set config(u){},use(u,...d){return r.has(u)||(u&&Pt(u.install)?(r.add(u),u.install(c,...d)):Pt(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,f){if(!a){const h=c._ceVNode||fe(o,s);return h.appContext=i,f===!0?f="svg":f===!1&&(f=void 0),d&&t?t(h,u):e(h,u,f),a=!0,c._container=u,u.__vue_app__=c,Lf(h.component)}},onUnmount(u){l.push(u)},unmount(){a&&(Ei(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=Oa;Oa=c;try{return u()}finally{Oa=d}}};return c}}let Oa=null;function d4e(e,t,n=sn){const o=bo(),s=Mo(t),i=$s(t),r=jA(e,s),l=O9((a,c)=>{let u,d=sn,f;return Y9(()=>{const h=e[s];Go(u,h)&&(u=h,c())}),{get(){return a(),n.get?n.get(u):u},set(h){const p=n.set?n.set(h):h;if(!Go(p,u)&&!(d!==sn&&Go(h,d)))return;const m=o.vnode.props;m&&(t in m||s in m||i in m)&&(`onUpdate:${t}`in m||`onUpdate:${s}`in m||`onUpdate:${i}`in m)||(u=h,c()),o.emit(`update:${t}`,p),Go(h,p)&&Go(h,d)&&!Go(p,f)&&c(),d=h,f=p}}});return l[Symbol.iterator]=()=>{let a=0;return{next(){return a<2?{value:a++?r||sn:l,done:!1}:{done:!0}}}},l}const jA=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Mo(t)}Modifiers`]||e[`${$s(t)}Modifiers`];function TI(e,t,...n){if(e.isUnmounted)return;const o=e.vnode.props||sn;let s=n;const i=t.startsWith("update:"),r=i&&jA(o,t.slice(7));r&&(r.trim&&(s=n.map(u=>On(u)?u.trim():u)),r.number&&(s=n.map(a1)));let l,a=o[l=mp(t)]||o[l=mp(Mo(t))];!a&&i&&(a=o[l=mp($s(t))]),a&&Ei(a,e,6,s);const c=o[l+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,Ei(c,e,6,s)}}const NI=new WeakMap;function VA(e,t,n=!1){const o=n?NI:t.emitsCache,s=o.get(e);if(s!==void 0)return s;const i=e.emits;let r={},l=!1;if(!Pt(e)){const a=c=>{const u=VA(c,t,!0);u&&(l=!0,Nn(r,u))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!i&&!l?(xn(e)&&o.set(e,null),null):(Mt(i)?i.forEach(a=>r[a]=null):Nn(r,i),xn(e)&&o.set(e,r),r)}function k1(e,t){return!e||!Af(t)?!1:(t=t.slice(2).replace(/Once$/,""),kn(e,t[0].toLowerCase()+t.slice(1))||kn(e,$s(t))||kn(e,t))}function gp(e){const{type:t,vnode:n,proxy:o,withProxy:s,propsOptions:[i],slots:r,attrs:l,emit:a,render:c,renderCache:u,props:d,data:f,setupState:h,ctx:p,inheritAttrs:m}=e,y=ef(e);let k,g;try{if(n.shapeFlag&4){const b=s||o,A=b;k=Ls(c.call(A,b,u,d,h,f,p)),g=l}else{const b=t;k=Ls(b.length>1?b(d,{attrs:l,slots:r,emit:a}):b(d,null)),g=t.props?l:LI(l)}}catch(b){Ld.length=0,_u(b,e,1),k=fe(go)}let v=k;if(g&&m!==!1){const b=Object.keys(g),{shapeFlag:A}=v;b.length&&A&7&&(i&&b.some(o1)&&(g=$I(g,i)),v=Yr(v,g,!1,!0))}return n.dirs&&(v=Yr(v,null,!1,!0),v.dirs=v.dirs?v.dirs.concat(n.dirs):n.dirs),n.transition&&Rl(v,n.transition),k=v,ef(y),k}function II(e,t=!0){let n;for(let o=0;o<e.length;o++){const s=e[o];if(Bl(s)){if(s.type!==go||s.children==="v-if"){if(n)return;n=s}}else return}return n}const LI=e=>{let t;for(const n in e)(n==="class"||n==="style"||Af(n))&&((t||(t={}))[n]=e[n]);return t},$I=(e,t)=>{const n={};for(const o in e)(!o1(o)||!(o.slice(9)in t))&&(n[o]=e[o]);return n};function FI(e,t,n){const{props:o,children:s,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 o?pw(o,r,c):!!r;if(a&8){const u=t.dynamicProps;for(let d=0;d<u.length;d++){const f=u[d];if(KA(r,o,f)&&!k1(c,f))return!0}}}else return(s||l)&&(!l||!l.$stable)?!0:o===r?!1:o?r?pw(o,r,c):!0:!!r;return!1}function pw(e,t,n){const o=Object.keys(t);if(o.length!==Object.keys(e).length)return!0;for(let s=0;s<o.length;s++){const i=o[s];if(KA(t,e,i)&&!k1(n,i))return!0}return!1}function KA(e,t,n){const o=e[n],s=t[n];return n==="style"&&xn(o)&&xn(s)?!jr(o,s):o!==s}function b1({vnode:e,parent:t,suspense:n},o){for(;t;){const s=t.subTree;if(s.suspense&&s.suspense.activeBranch===e&&(s.suspense.vnode.el=s.el=o,e=s),s===e)(e=t.vnode).el=o,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=o)}const GA={},YA=()=>Object.create(GA),ZA=e=>Object.getPrototypeOf(e)===GA;function OI(e,t,n,o=!1){const s={},i=YA();e.propsDefaults=Object.create(null),XA(e,t,s,i);for(const r in e.propsOptions[0])r in s||(s[r]=void 0);n?e.props=o?s:N9(s):e.type.props?e.props=s:e.props=i,e.attrs=i}function RI(e,t,n,o){const{props:s,attrs:i,vnode:{patchFlag:r}}=e,l=hn(s),[a]=e.propsOptions;let c=!1;if((o||r>0)&&!(r&16)){if(r&8){const u=e.vnode.dynamicProps;for(let d=0;d<u.length;d++){let f=u[d];if(k1(e.emitsOptions,f))continue;const h=t[f];if(a)if(kn(i,f))h!==i[f]&&(i[f]=h,c=!0);else{const p=Mo(f);s[p]=Xv(a,l,p,h,e,!1)}else h!==i[f]&&(i[f]=h,c=!0)}}}else{XA(e,t,s,i)&&(c=!0);let u;for(const d in l)(!t||!kn(t,d)&&((u=$s(d))===d||!kn(t,u)))&&(a?n&&(n[d]!==void 0||n[u]!==void 0)&&(s[d]=Xv(a,l,d,void 0,e,!0)):delete s[d]);if(i!==l)for(const d in i)(!t||!kn(t,d))&&(delete i[d],c=!0)}c&&Dr(e.attrs,"set","")}function XA(e,t,n,o){const[s,i]=e.propsOptions;let r=!1,l;if(t)for(let a in t){if($a(a))continue;const c=t[a];let u;s&&kn(s,u=Mo(a))?!i||!i.includes(u)?n[u]=c:(l||(l={}))[u]=c:k1(e.emitsOptions,a)||(!(a in o)||c!==o[a])&&(o[a]=c,r=!0)}if(i){const a=hn(n),c=l||sn;for(let u=0;u<i.length;u++){const d=i[u];n[d]=Xv(s,a,d,c[d],e,!kn(c,d))}}return r}function Xv(e,t,n,o,s,i){const r=e[n];if(r!=null){const l=kn(r,"default");if(l&&o===void 0){const a=r.default;if(r.type!==Function&&!r.skipFactory&&Pt(a)){const{propsDefaults:c}=s;if(n in c)o=c[n];else{const u=Su(s);o=c[n]=a.call(null,t),u()}}else o=a;s.ce&&s.ce._setProp(n,o)}r[0]&&(i&&!l?o=!1:r[1]&&(o===""||o===$s(n))&&(o=!0))}return o}const BI=new WeakMap;function QA(e,t,n=!1){const o=n?BI:t.propsCache,s=o.get(e);if(s)return s;const i=e.props,r={},l=[];let a=!1;if(!Pt(e)){const u=d=>{a=!0;const[f,h]=QA(d,t,!0);Nn(r,f),h&&l.push(...h)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!i&&!a)return xn(e)&&o.set(e,Zc),Zc;if(Mt(i))for(let u=0;u<i.length;u++){const d=Mo(i[u]);mw(d)&&(r[d]=sn)}else if(i)for(const u in i){const d=Mo(u);if(mw(d)){const f=i[u],h=r[d]=Mt(f)||Pt(f)?{type:f}:Nn({},f),p=h.type;let m=!1,y=!0;if(Mt(p))for(let k=0;k<p.length;++k){const g=p[k],v=Pt(g)&&g.name;if(v==="Boolean"){m=!0;break}else v==="String"&&(y=!1)}else m=Pt(p)&&p.name==="Boolean";h[0]=m,h[1]=y,(m||kn(h,"default"))&&l.push(d)}}const c=[r,l];return xn(e)&&o.set(e,c),c}function mw(e){return e[0]!=="$"&&!$a(e)}const Fk=e=>e==="_"||e==="_ctx"||e==="$stable",Ok=e=>Mt(e)?e.map(Ls):[Ls(e)],DI=(e,t,n)=>{if(t._n)return t;const o=Le((...s)=>Ok(t(...s)),n);return o._c=!1,o},JA=(e,t,n)=>{const o=e._ctx;for(const s in e){if(Fk(s))continue;const i=e[s];if(Pt(i))t[s]=DI(s,i,o);else if(i!=null){const r=Ok(i);t[s]=()=>r}}},eM=(e,t)=>{const n=Ok(t);e.slots.default=()=>n},tM=(e,t,n)=>{for(const o in t)(n||!Fk(o))&&(e[o]=t[o])},PI=(e,t,n)=>{const o=e.slots=YA();if(e.vnode.shapeFlag&32){const s=t._;s?(tM(o,t,n),n&&eA(o,"_",s,!0)):JA(t,o)}else t&&eM(e,t)},HI=(e,t,n)=>{const{vnode:o,slots:s}=e;let i=!0,r=sn;if(o.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:tM(s,t,n):(i=!t.$stable,JA(t,s)),r=t}else t&&(eM(e,t),r={default:1});if(i)for(const l in s)!Fk(l)&&r[l]==null&&delete s[l]},ho=lM;function WI(e){return nM(e)}function zI(e){return nM(e,sI)}function nM(e,t){const n=c1();n.__VUE__=!0;const{insert:o,remove:s,patchProp:i,createElement:r,createText:l,createComment:a,setText:c,setElementText:u,parentNode:d,nextSibling:f,setScopeId:h=Ci,insertStaticContent:p}=e,m=(P,G,pe,ve=null,de=null,V=null,se=void 0,he=null,ke=!!G.dynamicChildren)=>{if(P===G)return;P&&!Pi(P,G)&&(ve=we(P),q(P,de,V,!0),P=null),G.patchFlag===-2&&(ke=!1,G.dynamicChildren=null);const{type:Te,ref:ze,shapeFlag:ye}=G;switch(Te){case Il:y(P,G,pe,ve);break;case go:k(P,G,pe,ve);break;case nu:P==null&&g(G,pe,ve,se);break;case Pe:S(P,G,pe,ve,de,V,se,he,ke);break;default:ye&1?A(P,G,pe,ve,de,V,se,he,ke):ye&6?B(P,G,pe,ve,de,V,se,he,ke):(ye&64||ye&128)&&Te.process(P,G,pe,ve,de,V,se,he,ke,ae)}ze!=null&&de?eu(ze,P&&P.ref,V,G||P,!G):ze==null&&P&&P.ref!=null&&eu(P.ref,null,V,P,!0)},y=(P,G,pe,ve)=>{if(P==null)o(G.el=l(G.children),pe,ve);else{const de=G.el=P.el;G.children!==P.children&&c(de,G.children)}},k=(P,G,pe,ve)=>{P==null?o(G.el=a(G.children||""),pe,ve):G.el=P.el},g=(P,G,pe,ve)=>{[P.el,P.anchor]=p(P.children,G,pe,ve,P.el,P.anchor)},v=({el:P,anchor:G},pe,ve)=>{let de;for(;P&&P!==G;)de=f(P),o(P,pe,ve),P=de;o(G,pe,ve)},b=({el:P,anchor:G})=>{let pe;for(;P&&P!==G;)pe=f(P),s(P),P=pe;s(G)},A=(P,G,pe,ve,de,V,se,he,ke)=>{if(G.type==="svg"?se="svg":G.type==="math"&&(se="mathml"),P==null)I(G,pe,ve,de,V,se,he,ke);else{const Te=P.el&&P.el._isVueCE?P.el:null;try{Te&&Te._beginPatch(),$(P,G,de,V,se,he,ke)}finally{Te&&Te._endPatch()}}},I=(P,G,pe,ve,de,V,se,he)=>{let ke,Te;const{props:ze,shapeFlag:ye,transition:be,dirs:Ge}=P;if(ke=P.el=r(P.type,V,ze&&ze.is,ze),ye&8?u(ke,P.children):ye&16&&M(P.children,ke,null,ve,de,dg(P,V),se,he),Ge&&rr(P,null,ve,"created"),T(ke,P,P.scopeId,se,ve),ze){for(const rt in ze)rt!=="value"&&!$a(rt)&&i(ke,rt,null,ze[rt],V,ve);"value"in ze&&i(ke,"value",null,ze.value,V),(Te=ze.onVnodeBeforeMount)&&Es(Te,ve,P)}Ge&&rr(P,null,ve,"beforeMount");const tt=oM(de,be);tt&&be.beforeEnter(ke),o(ke,G,pe),((Te=ze&&ze.onVnodeMounted)||tt||Ge)&&ho(()=>{try{Te&&Es(Te,ve,P),tt&&be.enter(ke),Ge&&rr(P,null,ve,"mounted")}finally{}},de)},T=(P,G,pe,ve,de)=>{if(pe&&h(P,pe),ve)for(let V=0;V<ve.length;V++)h(P,ve[V]);if(de){let V=de.subTree;if(G===V||Zp(V.type)&&(V.ssContent===G||V.ssFallback===G)){const se=de.vnode;T(P,se,se.scopeId,se.slotScopeIds,de.parent)}}},M=(P,G,pe,ve,de,V,se,he,ke=0)=>{for(let Te=ke;Te<P.length;Te++){const ze=P[Te]=he?Rr(P[Te]):Ls(P[Te]);m(null,ze,G,pe,ve,de,V,se,he)}},$=(P,G,pe,ve,de,V,se)=>{const he=G.el=P.el;let{patchFlag:ke,dynamicChildren:Te,dirs:ze}=G;ke|=P.patchFlag&16;const ye=P.props||sn,be=G.props||sn;let Ge;if(pe&&aa(pe,!1),(Ge=be.onVnodeBeforeUpdate)&&Es(Ge,pe,G,P),ze&&rr(G,P,pe,"beforeUpdate"),pe&&aa(pe,!0),(ye.innerHTML&&be.innerHTML==null||ye.textContent&&be.textContent==null)&&u(he,""),Te?N(P.dynamicChildren,Te,he,pe,ve,dg(G,de),V):se||j(P,G,he,null,pe,ve,dg(G,de),V,!1),ke>0){if(ke&16)F(he,ye,be,pe,de);else if(ke&2&&ye.class!==be.class&&i(he,"class",null,be.class,de),ke&4&&i(he,"style",ye.style,be.style,de),ke&8){const tt=G.dynamicProps;for(let rt=0;rt<tt.length;rt++){const ut=tt[rt],vt=ye[ut],Nt=be[ut];(Nt!==vt||ut==="value")&&i(he,ut,vt,Nt,de,pe)}}ke&1&&P.children!==G.children&&u(he,G.children)}else!se&&Te==null&&F(he,ye,be,pe,de);((Ge=be.onVnodeUpdated)||ze)&&ho(()=>{Ge&&Es(Ge,pe,G,P),ze&&rr(G,P,pe,"updated")},ve)},N=(P,G,pe,ve,de,V,se)=>{for(let he=0;he<G.length;he++){const ke=P[he],Te=G[he],ze=ke.el&&(ke.type===Pe||!Pi(ke,Te)||ke.shapeFlag&198)?d(ke.el):pe;m(ke,Te,ze,null,ve,de,V,se,!0)}},F=(P,G,pe,ve,de)=>{if(G!==pe){if(G!==sn)for(const V in G)!$a(V)&&!(V in pe)&&i(P,V,G[V],null,de,ve);for(const V in pe){if($a(V))continue;const se=pe[V],he=G[V];se!==he&&V!=="value"&&i(P,V,he,se,de,ve)}"value"in pe&&i(P,"value",G.value,pe.value,de)}},S=(P,G,pe,ve,de,V,se,he,ke)=>{const Te=G.el=P?P.el:l(""),ze=G.anchor=P?P.anchor:l("");let{patchFlag:ye,dynamicChildren:be,slotScopeIds:Ge}=G;Ge&&(he=he?he.concat(Ge):Ge),P==null?(o(Te,pe,ve),o(ze,pe,ve),M(G.children||[],pe,ze,de,V,se,he,ke)):ye>0&&ye&64&&be&&P.dynamicChildren&&P.dynamicChildren.length===be.length?(N(P.dynamicChildren,be,pe,de,V,se,he),(G.key!=null||de&&G===de.subTree)&&Rk(P,G,!0)):j(P,G,pe,ze,de,V,se,he,ke)},B=(P,G,pe,ve,de,V,se,he,ke)=>{G.slotScopeIds=he,P==null?G.shapeFlag&512?de.ctx.activate(G,pe,ve,se,ke):W(G,pe,ve,de,V,se,ke):z(P,G,ke)},W=(P,G,pe,ve,de,V,se)=>{const he=P.component=fM(P,ve,de);if(Nf(P)&&(he.ctx.renderer=ae),pM(he,!1,se),he.asyncDep){if(de&&de.registerDep(he,L,se),!P.el){const ke=he.subTree=fe(go);k(null,ke,G,pe),P.placeholder=ke.el}}else L(he,P,G,pe,de,V,se)},z=(P,G,pe)=>{const ve=G.component=P.component;if(FI(P,G,pe))if(ve.asyncDep&&!ve.asyncResolved){O(ve,G,pe);return}else ve.next=G,ve.update();else G.el=P.el,ve.vnode=G},L=(P,G,pe,ve,de,V,se)=>{const he=()=>{if(P.isMounted){let{next:ye,bu:be,u:Ge,parent:tt,vnode:rt}=P;{const Rt=sM(P);if(Rt){ye&&(ye.el=rt.el,O(P,ye,se)),Rt.asyncDep.then(()=>{ho(()=>{P.isUnmounted||Te()},de)});return}}let ut=ye,vt;aa(P,!1),ye?(ye.el=rt.el,O(P,ye,se)):ye=rt,be&&Qc(be),(vt=ye.props&&ye.props.onVnodeBeforeUpdate)&&Es(vt,tt,ye,rt),aa(P,!0);const Nt=gp(P),_t=P.subTree;P.subTree=Nt,m(_t,Nt,d(_t.el),we(_t),P,de,V),ye.el=Nt.el,ut===null&&b1(P,Nt.el),Ge&&ho(Ge,de),(vt=ye.props&&ye.props.onVnodeUpdated)&&ho(()=>Es(vt,tt,ye,rt),de)}else{let ye;const{el:be,props:Ge}=G,{bm:tt,m:rt,parent:ut,root:vt,type:Nt}=P,_t=qr(G);if(aa(P,!1),tt&&Qc(tt),!_t&&(ye=Ge&&Ge.onVnodeBeforeMount)&&Es(ye,ut,G),aa(P,!0),be&&Q){const Rt=()=>{P.subTree=gp(P),Q(be,P.subTree,P,de,null)};_t&&Nt.__asyncHydrate?Nt.__asyncHydrate(be,P,Rt):Rt()}else{vt.ce&&vt.ce._hasShadowRoot()&&vt.ce._injectChildStyle(Nt,P.parent?P.parent.type:void 0);const Rt=P.subTree=gp(P);m(null,Rt,pe,ve,P,de,V),G.el=Rt.el}if(rt&&ho(rt,de),!_t&&(ye=Ge&&Ge.onVnodeMounted)){const Rt=G;ho(()=>Es(ye,ut,Rt),de)}(G.shapeFlag&256||ut&&qr(ut.vnode)&&ut.vnode.shapeFlag&256)&&P.a&&ho(P.a,de),P.isMounted=!0,G=pe=ve=null}};P.scope.on();const ke=P.effect=new Wp(he);P.scope.off();const Te=P.update=ke.run.bind(ke),ze=P.job=ke.runIfDirty.bind(ke);ze.i=P,ze.id=P.uid,ke.scheduler=()=>Ak(ze),aa(P,!0),Te()},O=(P,G,pe)=>{G.component=P;const ve=P.vnode.props;P.vnode=G,P.next=null,RI(P,G.props,ve,pe),HI(P,G.children,pe),Vr(),nw(P),Kr()},j=(P,G,pe,ve,de,V,se,he,ke=!1)=>{const Te=P&&P.children,ze=P?P.shapeFlag:0,ye=G.children,{patchFlag:be,shapeFlag:Ge}=G;if(be>0){if(be&128){ie(Te,ye,pe,ve,de,V,se,he,ke);return}else if(be&256){Z(Te,ye,pe,ve,de,V,se,he,ke);return}}Ge&8?(ze&16&&re(Te,de,V),ye!==Te&&u(pe,ye)):ze&16?Ge&16?ie(Te,ye,pe,ve,de,V,se,he,ke):re(Te,de,V,!0):(ze&8&&u(pe,""),Ge&16&&M(ye,pe,ve,de,V,se,he,ke))},Z=(P,G,pe,ve,de,V,se,he,ke)=>{P=P||Zc,G=G||Zc;const Te=P.length,ze=G.length,ye=Math.min(Te,ze);let be;for(be=0;be<ye;be++){const Ge=G[be]=ke?Rr(G[be]):Ls(G[be]);m(P[be],Ge,pe,null,de,V,se,he,ke)}Te>ze?re(P,de,V,!0,!1,ye):M(G,pe,ve,de,V,se,he,ke,ye)},ie=(P,G,pe,ve,de,V,se,he,ke)=>{let Te=0;const ze=G.length;let ye=P.length-1,be=ze-1;for(;Te<=ye&&Te<=be;){const Ge=P[Te],tt=G[Te]=ke?Rr(G[Te]):Ls(G[Te]);if(Pi(Ge,tt))m(Ge,tt,pe,null,de,V,se,he,ke);else break;Te++}for(;Te<=ye&&Te<=be;){const Ge=P[ye],tt=G[be]=ke?Rr(G[be]):Ls(G[be]);if(Pi(Ge,tt))m(Ge,tt,pe,null,de,V,se,he,ke);else break;ye--,be--}if(Te>ye){if(Te<=be){const Ge=be+1,tt=Ge<ze?G[Ge].el:ve;for(;Te<=be;)m(null,G[Te]=ke?Rr(G[Te]):Ls(G[Te]),pe,tt,de,V,se,he,ke),Te++}}else if(Te>be)for(;Te<=ye;)q(P[Te],de,V,!0),Te++;else{const Ge=Te,tt=Te,rt=new Map;for(Te=tt;Te<=be;Te++){const Wt=G[Te]=ke?Rr(G[Te]):Ls(G[Te]);Wt.key!=null&&rt.set(Wt.key,Te)}let ut,vt=0;const Nt=be-tt+1;let _t=!1,Rt=0;const ln=new Array(Nt);for(Te=0;Te<Nt;Te++)ln[Te]=0;for(Te=Ge;Te<=ye;Te++){const Wt=P[Te];if(vt>=Nt){q(Wt,de,V,!0);continue}let un;if(Wt.key!=null)un=rt.get(Wt.key);else for(ut=tt;ut<=be;ut++)if(ln[ut-tt]===0&&Pi(Wt,G[ut])){un=ut;break}un===void 0?q(Wt,de,V,!0):(ln[un-tt]=Te+1,un>=Rt?Rt=un:_t=!0,m(Wt,G[un],pe,null,de,V,se,he,ke),vt++)}const Ln=_t?UI(ln):Zc;for(ut=Ln.length-1,Te=Nt-1;Te>=0;Te--){const Wt=tt+Te,un=G[Wt],vn=G[Wt+1],Xt=Wt+1<ze?vn.el||iM(vn):ve;ln[Te]===0?m(null,un,pe,Xt,de,V,se,he,ke):_t&&(ut<0||Te!==Ln[ut]?U(un,pe,Xt,2):ut--)}}},U=(P,G,pe,ve,de=null)=>{const{el:V,type:se,transition:he,children:ke,shapeFlag:Te}=P;if(Te&6){U(P.component.subTree,G,pe,ve);return}if(Te&128){P.suspense.move(G,pe,ve);return}if(Te&64){se.move(P,G,pe,ae);return}if(se===Pe){o(V,G,pe);for(let ye=0;ye<ke.length;ye++)U(ke[ye],G,pe,ve);o(P.anchor,G,pe);return}if(se===nu){v(P,G,pe);return}if(ve!==2&&Te&1&&he)if(ve===0)he.persisted&&!V[bi]?o(V,G,pe):(he.beforeEnter(V),o(V,G,pe),ho(()=>he.enter(V),de));else{const{leave:ye,delayLeave:be,afterLeave:Ge}=he,tt=()=>{P.ctx.isUnmounted?s(V):o(V,G,pe)},rt=()=>{const ut=V._isLeaving||!!V[bi];V._isLeaving&&V[bi](!0),he.persisted&&!ut?tt():ye(V,()=>{tt(),Ge&&Ge()})};be?be(V,tt,rt):rt()}else o(V,G,pe)},q=(P,G,pe,ve=!1,de=!1)=>{const{type:V,props:se,ref:he,children:ke,dynamicChildren:Te,shapeFlag:ze,patchFlag:ye,dirs:be,cacheIndex:Ge,memo:tt}=P;if(ye===-2&&(de=!1),he!=null&&(Vr(),eu(he,null,pe,P,!0),Kr()),Ge!=null&&(G.renderCache[Ge]=void 0),ze&256){G.ctx.deactivate(P);return}const rt=ze&1&&be,ut=!qr(P);let vt;if(ut&&(vt=se&&se.onVnodeBeforeUnmount)&&Es(vt,G,P),ze&6)oe(P.component,pe,ve);else{if(ze&128){P.suspense.unmount(pe,ve);return}rt&&rr(P,null,G,"beforeUnmount"),ze&64?P.type.remove(P,G,pe,ae,ve):Te&&!Te.hasOnce&&(V!==Pe||ye>0&&ye&64)?re(Te,G,pe,!1,!0):(V===Pe&&ye&384||!de&&ze&16)&&re(ke,G,pe),ve&&ee(P)}const Nt=tt!=null&&Ge==null;(ut&&(vt=se&&se.onVnodeUnmounted)||rt||Nt)&&ho(()=>{vt&&Es(vt,G,P),rt&&rr(P,null,G,"unmounted"),Nt&&(P.el=null)},pe)},ee=P=>{const{type:G,el:pe,anchor:ve,transition:de}=P;if(G===Pe){le(pe,ve);return}if(G===nu){b(P);return}const V=()=>{s(pe),de&&!de.persisted&&de.afterLeave&&de.afterLeave()};if(P.shapeFlag&1&&de&&!de.persisted){const{leave:se,delayLeave:he}=de,ke=()=>se(pe,V);he?he(P.el,V,ke):ke()}else V()},le=(P,G)=>{let pe;for(;P!==G;)pe=f(P),s(P),P=pe;s(G)},oe=(P,G,pe)=>{const{bum:ve,scope:de,job:V,subTree:se,um:he,m:ke,a:Te}=P;Yp(ke),Yp(Te),ve&&Qc(ve),de.stop(),V&&(V.flags|=8,q(se,P,G,pe)),he&&ho(he,G),ho(()=>{P.isUnmounted=!0},G)},re=(P,G,pe,ve=!1,de=!1,V=0)=>{for(let se=V;se<P.length;se++)q(P[se],G,pe,ve,de)},we=P=>{if(P.shapeFlag&6)return we(P.component.subTree);if(P.shapeFlag&128)return P.suspense.next();const G=f(P.anchor||P.el),pe=G&&G[IA];return pe?f(pe):G};let me=!1;const Ee=(P,G,pe)=>{let ve;P==null?G._vnode&&(q(G._vnode,null,null,!0),ve=G._vnode.component):m(G._vnode||null,P,G,null,null,null,pe),G._vnode=P,me||(me=!0,nw(ve),Vp(),me=!1)},ae={p:m,um:q,m:U,r:ee,mt:W,mc:M,pc:j,pbc:N,n:we,o:e};let Y,Q;return t&&([Y,Q]=t(ae)),{render:Ee,hydrate:Y,createApp:EI(Ee,Y)}}function dg({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 aa({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function oM(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Rk(e,t,n=!1){const o=e.children,s=t.children;if(Mt(o)&&Mt(s))for(let i=0;i<o.length;i++){const r=o[i];let l=s[i];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=s[i]=Rr(s[i]),l.el=r.el),!n&&l.patchFlag!==-2&&Rk(r,l)),l.type===Il&&(l.patchFlag===-1&&(l=s[i]=Rr(l)),l.el=r.el),l.type===go&&!l.el&&(l.el=r.el)}}function UI(e){const t=e.slice(),n=[0];let o,s,i,r,l;const a=e.length;for(o=0;o<a;o++){const c=e[o];if(c!==0){if(s=n[n.length-1],e[s]<c){t[o]=s,n.push(o);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[o]=n[i-1]),n[i]=o)}}for(i=n.length,r=n[i-1];i-- >0;)n[i]=r,r=t[r];return n}function sM(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:sM(t)}function Yp(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function iM(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?iM(t.subTree):null}const Zp=e=>e.__isSuspense;let Qv=0;const qI={name:"Suspense",__isSuspense:!0,process(e,t,n,o,s,i,r,l,a,c){if(e==null)jI(t,n,o,s,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}VI(e,t,n,o,s,r,l,a,c)}},hydrate:KI,normalize:GI},f4e=qI;function of(e,t){const n=e.props&&e.props[t];Pt(n)&&n()}function jI(e,t,n,o,s,i,r,l,a){const{p:c,o:{createElement:u}}=a,d=u("div"),f=e.suspense=rM(e,s,o,t,d,n,i,r,l,a);c(null,f.pendingBranch=e.ssContent,d,null,o,f,i,r),f.deps>0?(of(e,"onPending"),of(e,"onFallback"),c(null,e.ssFallback,t,n,o,null,i,r),tu(f,e.ssFallback)):f.resolve(!1,!0)}function VI(e,t,n,o,s,i,r,l,{p:a,um:c,o:{createElement:u}}){const d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;const f=t.ssContent,h=t.ssFallback,{activeBranch:p,pendingBranch:m,isInFallback:y,isHydrating:k}=d;if(m)d.pendingBranch=f,Pi(m,f)?(a(m,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0?d.resolve():y&&(k||(a(p,h,n,o,s,null,i,r,l),tu(d,h)))):(d.pendingId=Qv++,k?(d.isHydrating=!1,d.activeBranch=m):c(m,s,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u("div"),y?(a(null,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0?d.resolve():(a(p,h,n,o,s,null,i,r,l),tu(d,h))):p&&Pi(p,f)?(a(p,f,n,o,s,d,i,r,l),d.resolve(!0)):(a(null,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0&&d.resolve()));else if(p&&Pi(p,f))a(p,f,n,o,s,d,i,r,l),tu(d,f);else if(of(t,"onPending"),d.pendingBranch=f,f.shapeFlag&512?d.pendingId=f.component.suspenseId:d.pendingId=Qv++,a(null,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0)d.resolve();else{const{timeout:g,pendingId:v}=d;g>0?setTimeout(()=>{d.pendingId===v&&d.fallback(h)},g):g===0&&d.fallback(h)}}function rM(e,t,n,o,s,i,r,l,a,c,u=!1){const{p:d,m:f,um:h,n:p,o:{parentNode:m,remove:y}}=c;let k;const g=YI(e);g&&t&&t.pendingBranch&&(k=t.pendingId,t.deps++);const v=e.props?Hp(e.props.timeout):void 0,b=i,A={vnode:e,parent:t,parentComponent:n,namespace:r,container:o,hiddenContainer:s,deps:0,pendingId:Qv++,timeout:typeof v=="number"?v:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve(I=!1,T=!1){const{vnode:M,activeBranch:$,pendingBranch:N,pendingId:F,effects:S,parentComponent:B,container:W,isInFallback:z}=A;let L=!1;if(A.isHydrating)A.isHydrating=!1;else if(!I){L=$&&N.transition&&N.transition.mode==="out-in";let Z=!1;L&&($.transition.afterLeave=()=>{F===A.pendingId&&(f(N,W,i===b&&!Z?p($):i,0),jp(S),z&&M.ssFallback&&(M.ssFallback.el=null))}),$&&!A.isFallbackMountPending&&(m($.el)===W&&(i=p($),Z=!0),h($,B,A,!0),!L&&z&&M.ssFallback&&ho(()=>M.ssFallback.el=null,A)),L||f(N,W,i,0)}A.isFallbackMountPending=!1,tu(A,N),A.pendingBranch=null,A.isInFallback=!1;let O=A.parent,j=!1;for(;O;){if(O.pendingBranch){O.effects.push(...S),j=!0;break}O=O.parent}!j&&!L&&jp(S),A.effects=[],g&&t&&t.pendingBranch&&k===t.pendingId&&(t.deps--,t.deps===0&&!T&&t.resolve()),of(M,"onResolve")},fallback(I){if(!A.pendingBranch)return;const{vnode:T,activeBranch:M,parentComponent:$,container:N,namespace:F}=A;of(T,"onFallback");const S=p(M),B=()=>{A.isFallbackMountPending=!1,A.isInFallback&&(d(null,I,N,S,$,null,F,l,a),tu(A,I))},W=I.transition&&I.transition.mode==="out-in";W&&(A.isFallbackMountPending=!0,M.transition.afterLeave=B),A.isInFallback=!0,h(M,$,null,!0),W||B()},move(I,T,M){A.activeBranch&&f(A.activeBranch,I,T,M),A.container=I},next(){return A.activeBranch&&p(A.activeBranch)},registerDep(I,T,M){const $=!!A.pendingBranch;$&&A.deps++;const N=I.vnode.el;I.asyncDep.catch(F=>{_u(F,I,0)}).then(F=>{if(I.isUnmounted||A.isUnmounted||A.pendingId!==I.suspenseId)return;sf(),I.asyncResolved=!0;const{vnode:S}=I;Jv(I,F,!1),N&&(S.el=N);const B=!N&&I.subTree.el;T(I,S,m(N||I.subTree.el),N?null:p(I.subTree),A,r,M),B&&(S.placeholder=null,y(B)),b1(I,S.el),$&&--A.deps===0&&A.resolve()})},unmount(I,T){A.isUnmounted=!0,A.activeBranch&&h(A.activeBranch,n,I,T),A.pendingBranch&&h(A.pendingBranch,n,I,T)}};return A}function KI(e,t,n,o,s,i,r,l,a){const c=t.suspense=rM(t,o,n,e.parentNode,document.createElement("div"),null,s,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 GI(e){const{shapeFlag:t,children:n}=e,o=t&32;e.ssContent=gw(o?n.default:n),e.ssFallback=o?gw(n.fallback):fe(go)}function gw(e){let t;if(Pt(e)){const n=Wa&&e._c;n&&(e._d=!1,x()),e=e(),n&&(e._d=!0,t=is,aM())}return Mt(e)&&(e=II(e)),e=Ls(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(n=>n!==e)),e}function lM(e,t){t&&t.pendingBranch?Mt(e)?t.effects.push(...e):t.effects.push(e):jp(e)}function tu(e,t){e.activeBranch=t;const{vnode:n,parentComponent:o}=e;let s=t.el;for(;!s&&t.component;)t=t.component.subTree,s=t.el;n.el=s,o&&o.subTree===n&&(o.vnode.el=s,b1(o,s))}function YI(e){const t=e.props&&e.props.suspensible;return t!=null&&t!==!1}const Pe=Symbol.for("v-fgt"),Il=Symbol.for("v-txt"),go=Symbol.for("v-cmt"),nu=Symbol.for("v-stc"),Ld=[];let is=null;function x(e=!1){Ld.push(is=e?null:[])}function aM(){Ld.pop(),is=Ld[Ld.length-1]||null}let Wa=1;function Xp(e,t=!1){Wa+=e,e<0&&is&&t&&(is.hasOnce=!0)}function cM(e){return e.dynamicChildren=Wa>0?is||Zc:null,aM(),Wa>0&&is&&is.push(e),e}function E(e,t,n,o,s,i){return cM(_(e,t,n,o,s,i,!0))}function Ae(e,t,n,o,s){return cM(fe(e,t,n,o,s,!0))}function Bl(e){return e?e.__v_isVNode===!0:!1}function Pi(e,t){return e.type===t.type&&e.key===t.key}function h4e(e){}const uM=({key:e})=>e??null,vp=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?On(e)||co(e)||Pt(e)?{i:Zo,r:e,k:t,f:!!n}:e:null);function _(e,t=null,n=null,o=0,s=null,i=e===Pe?0:1,r=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&uM(t),ref:t&&vp(t),scopeId:g1,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:o,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:Zo};return l?(Dk(a,n),i&128&&e.normalize(a)):n&&(a.shapeFlag|=On(n)?8:16),Wa>0&&!r&&is&&(a.patchFlag>0||i&6)&&a.patchFlag!==32&&is.push(a),a}const fe=ZI;function ZI(e,t=null,n=null,o=0,s=null,i=!1){if((!e||e===HA)&&(e=go),Bl(e)){const l=Yr(e,t,!0);return n&&Dk(l,n),Wa>0&&!i&&is&&(l.shapeFlag&6?is[is.indexOf(e)]=l:is.push(l)),l.patchFlag=-2,l}if(t7(e)&&(e=e.__vccOpts),t){t=dM(t);let{class:l,style:a}=t;l&&!On(l)&&(t.class=We(l)),xn(a)&&(m1(a)&&!Mt(a)&&(a=Nn({},a)),t.style=tn(a))}const r=On(e)?1:Zp(e)?128:LA(e)?64:xn(e)?4:Pt(e)?2:0;return _(e,t,n,o,s,r,i,!0)}function dM(e){return e?m1(e)||ZA(e)?Nn({},e):e:null}function Yr(e,t,n=!1,o=!1){const{props:s,ref:i,patchFlag:r,children:l,transition:a}=e,c=t?bn(s||{},t):s,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&uM(c),ref:t&&t.ref?n&&i?Mt(i)?i.concat(vp(t)):[i,vp(t)]:vp(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!==Pe?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&&Yr(e.ssContent),ssFallback:e.ssFallback&&Yr(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&o&&Rl(u,a.clone(u)),u}function nt(e=" ",t=0){return fe(Il,null,e,t)}function Bk(e,t){const n=fe(nu,null,e);return n.staticCount=t,n}function ue(e="",t=!1){return t?(x(),Ae(go,null,e)):fe(go,null,e)}function Ls(e){return e==null||typeof e=="boolean"?fe(go):Mt(e)?fe(Pe,null,e.slice()):Bl(e)?Rr(e):fe(Il,null,String(e))}function Rr(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Yr(e)}function Dk(e,t){let n=0;const{shapeFlag:o}=e;if(t==null)t=null;else if(Mt(t))n=16;else if(typeof t=="object")if(o&65){const s=t.default;s&&(s._c&&(s._d=!1),Dk(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!ZA(t)?t._ctx=Zo:s===3&&Zo&&(Zo.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Pt(t)?(t={default:t,_ctx:Zo},n=32):(t=String(t),o&64?(n=16,t=[nt(t)]):n=8);e.children=t,e.shapeFlag|=n}function bn(...e){const t={};for(let n=0;n<e.length;n++){const o=e[n];for(const s in o)if(s==="class")t.class!==o.class&&(t.class=We([t.class,o.class]));else if(s==="style")t.style=tn([t.style,o.style]);else if(Af(s)){const i=t[s],r=o[s];r&&i!==r&&!(Mt(i)&&i.includes(r))?t[s]=i?[].concat(i,r):r:r==null&&i==null&&!o1(s)&&(t[s]=r)}else s!==""&&(t[s]=o[s])}return t}function Es(e,t,n,o=null){Ei(e,t,7,[n,o])}const XI=qA();let QI=0;function fM(e,t,n){const o=e.type,s=(t?t.appContext:e.appContext)||XI,i={uid:QI++,vnode:e,type:o,parent:t,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new sA(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(s.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:QA(o,s),emitsOptions:VA(o,s),emit:null,emitted:null,propsDefaults:sn,inheritAttrs:o.inheritAttrs,ctx:sn,data:sn,props:sn,attrs:sn,slots:sn,refs:sn,setupState:sn,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=TI.bind(null,i),e.ce&&e.ce(i),i}let Yo=null;const bo=()=>Yo||Zo;let Qp,ou;{const e=c1(),t=(n,o)=>{let s;return(s=e[n])||(s=e[n]=[]),s.push(o),i=>{s.length>1?s.forEach(r=>r(i)):s[0](i)}};Qp=t("__VUE_INSTANCE_SETTERS__",n=>Yo=n),ou=t("__VUE_SSR_SETTERS__",n=>za=n)}const Su=e=>{const t=Yo;return Qp(e),e.scope.on(),()=>{e.scope.off(),Qp(t)}},sf=()=>{Yo&&Yo.scope.off(),Qp(null)};function hM(e){return e.vnode.shapeFlag&4}let za=!1;function pM(e,t=!1,n=!1){t&&ou(t);const{props:o,children:s}=e.vnode,i=hM(e);OI(e,o,i,t),PI(e,s,n||t);const r=i?JI(e,t):void 0;return t&&ou(!1),r}function JI(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Gv);const{setup:o}=n;if(o){Vr();const s=e.setupContext=o.length>1?gM(e):null,i=Su(e),r=Ef(o,e,0,[e.props,s]),l=xk(r);if(Kr(),i(),(l||e.sp)&&!qr(e)&&Ek(e),l){if(r.then(sf,sf),t)return r.then(a=>{Jv(e,a,t)}).catch(a=>{_u(a,e,0)});e.asyncDep=r}else Jv(e,r,t)}else mM(e,t)}function Jv(e,t,n){Pt(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:xn(t)&&(e.setupState=wA(t)),mM(e,n)}let Jp,ey;function p4e(e){Jp=e,ey=t=>{t.render._rc&&(t.withProxy=new Proxy(t.ctx,xI))}}const m4e=()=>!Jp;function mM(e,t,n){const o=e.type;if(!e.render){if(!t&&Jp&&!o.render){const s=o.template||$k(e).template;if(s){const{isCustomElement:i,compilerOptions:r}=e.appContext.config,{delimiters:l,compilerOptions:a}=o,c=Nn(Nn({isCustomElement:i,delimiters:l},r),a);o.render=Jp(s,c)}}e.render=o.render||Ci,ey&&ey(e)}{const s=Su(e);Vr();try{wI(e)}finally{Kr(),s()}}}const e7={get(e,t){return ss(e,"get",""),e[t]}};function gM(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,e7),slots:e.slots,emit:e.emit,expose:t}}function Lf(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(wA(yt(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Id)return Id[n](e)},has(t,n){return n in t||n in Id}})):e.proxy}function ty(e,t=!0){return Pt(e)?e.displayName||e.name:e.name||t&&e.__name}function t7(e){return Pt(e)&&"__vccOpts"in e}const D=(e,t)=>P9(e,t,za);function Ft(e,t,n){try{Xp(-1);const o=arguments.length;return o===2?xn(t)&&!Mt(t)?Bl(t)?fe(e,null,[t]):fe(e,t):fe(e,null,t):(o>3?n=Array.prototype.slice.call(arguments,2):o===3&&Bl(n)&&(n=[n]),fe(e,t,n))}finally{Xp(1)}}function g4e(){}function v4e(e,t,n,o){const s=n[o];if(s&&n7(s,e))return s;const i=t();return i.memo=e.slice(),i.cacheIndex=o,n[o]=i}function n7(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let o=0;o<n.length;o++)if(Go(n[o],t[o]))return!1;return Wa>0&&is&&is.push(e),!0}const o7="3.5.35",y4e=Ci,k4e=q9,b4e=Fc,x4e=EA,s7={createComponentInstance:fM,setupComponent:pM,renderComponentRoot:gp,setCurrentRenderingInstance:ef,isVNode:Bl,normalizeVNode:Ls,getComponentPublicInstance:Lf,ensureValidVNode:Lk,pushWarningContext:z9,popWarningContext:U9},w4e=s7,_4e=null,S4e=null,C4e=null;/**
|
|
17
|
-
* @vue/runtime-dom v3.5.35
|
|
18
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
19
|
-
* @license MIT
|
|
20
|
-
**/let ny;const vw=typeof window<"u"&&window.trustedTypes;if(vw)try{ny=vw.createPolicy("vue",{createHTML:e=>e})}catch{}const vM=ny?e=>ny.createHTML(e):e=>e,i7="http://www.w3.org/2000/svg",r7="http://www.w3.org/1998/Math/MathML",Ir=typeof document<"u"?document:null,yw=Ir&&Ir.createElement("template"),l7={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,o)=>{const s=t==="svg"?Ir.createElementNS(i7,e):t==="mathml"?Ir.createElementNS(r7,e):n?Ir.createElement(e,{is:n}):Ir.createElement(e);return e==="select"&&o&&o.multiple!=null&&s.setAttribute("multiple",o.multiple),s},createText:e=>Ir.createTextNode(e),createComment:e=>Ir.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Ir.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,o,s,i){const r=n?n.previousSibling:t.lastChild;if(s&&(s===i||s.nextSibling))for(;t.insertBefore(s.cloneNode(!0),n),!(s===i||!(s=s.nextSibling)););else{yw.innerHTML=vM(o==="svg"?`<svg>${e}</svg>`:o==="mathml"?`<math>${e}</math>`:e);const l=yw.content;if(o==="svg"||o==="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]}},ll="transition",nd="animation",mu=Symbol("_vtc"),yM={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},kM=Nn({},FA,yM),a7=e=>(e.displayName="Transition",e.props=kM,e),Ua=a7((e,{slots:t})=>Ft(tI,bM(e),t)),ca=(e,t=[])=>{Mt(e)?e.forEach(n=>n(...t)):e&&e(...t)},kw=e=>e?Mt(e)?e.some(t=>t.length>1):e.length>1:!1;function bM(e){const t={};for(const S in e)S in yM||(t[S]=e[S]);if(e.css===!1)return t;const{name:n="v",type:o,duration:s,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:f=`${n}-leave-active`,leaveToClass:h=`${n}-leave-to`}=e,p=c7(s),m=p&&p[0],y=p&&p[1],{onBeforeEnter:k,onEnter:g,onEnterCancelled:v,onLeave:b,onLeaveCancelled:A,onBeforeAppear:I=k,onAppear:T=g,onAppearCancelled:M=v}=t,$=(S,B,W,z)=>{S._enterCancelled=z,vl(S,B?u:l),vl(S,B?c:r),W&&W()},N=(S,B)=>{S._isLeaving=!1,vl(S,d),vl(S,h),vl(S,f),B&&B()},F=S=>(B,W)=>{const z=S?T:g,L=()=>$(B,S,W);ca(z,[B,L]),bw(()=>{vl(B,S?a:i),sr(B,S?u:l),kw(z)||xw(B,o,m,L)})};return Nn(t,{onBeforeEnter(S){ca(k,[S]),sr(S,i),sr(S,r)},onBeforeAppear(S){ca(I,[S]),sr(S,a),sr(S,c)},onEnter:F(!1),onAppear:F(!0),onLeave(S,B){S._isLeaving=!0;const W=()=>N(S,B);sr(S,d),S._enterCancelled?(sr(S,f),oy(S)):(oy(S),sr(S,f)),bw(()=>{S._isLeaving&&(vl(S,d),sr(S,h),kw(b)||xw(S,o,y,W))}),ca(b,[S,W])},onEnterCancelled(S){$(S,!1,void 0,!0),ca(v,[S])},onAppearCancelled(S){$(S,!0,void 0,!0),ca(M,[S])},onLeaveCancelled(S){N(S),ca(A,[S])}})}function c7(e){if(e==null)return null;if(xn(e))return[fg(e.enter),fg(e.leave)];{const t=fg(e);return[t,t]}}function fg(e){return Hp(e)}function sr(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[mu]||(e[mu]=new Set)).add(t)}function vl(e,t){t.split(/\s+/).forEach(o=>o&&e.classList.remove(o));const n=e[mu];n&&(n.delete(t),n.size||(e[mu]=void 0))}function bw(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let u7=0;function xw(e,t,n,o){const s=e._endId=++u7,i=()=>{s===e._endId&&o()};if(n!=null)return setTimeout(i,n);const{type:r,timeout:l,propCount:a}=xM(e,t);if(!r)return o();const c=r+"end";let u=0;const d=()=>{e.removeEventListener(c,f),i()},f=h=>{h.target===e&&++u>=a&&d()};setTimeout(()=>{u<a&&d()},l+1),e.addEventListener(c,f)}function xM(e,t){const n=window.getComputedStyle(e),o=p=>(n[p]||"").split(", "),s=o(`${ll}Delay`),i=o(`${ll}Duration`),r=ww(s,i),l=o(`${nd}Delay`),a=o(`${nd}Duration`),c=ww(l,a);let u=null,d=0,f=0;t===ll?r>0&&(u=ll,d=r,f=i.length):t===nd?c>0&&(u=nd,d=c,f=a.length):(d=Math.max(r,c),u=d>0?r>c?ll:nd:null,f=u?u===ll?i.length:a.length:0);const h=u===ll&&/\b(?:transform|all)(?:,|$)/.test(o(`${ll}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:h}}function ww(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,o)=>_w(n)+_w(e[o])))}function _w(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function oy(e){return(e?e.ownerDocument:document).body.offsetHeight}function d7(e,t,n){const o=e[mu];o&&(t=(t?[t,...o]:[...o]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const em=Symbol("_vod"),wM=Symbol("_vsh"),wi={name:"show",beforeMount(e,{value:t},{transition:n}){e[em]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):od(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:o}){!t!=!n&&(o?t?(o.beforeEnter(e),od(e,!0),o.enter(e)):o.leave(e,()=>{od(e,!1)}):od(e,t))},beforeUnmount(e,{value:t}){od(e,t)}};function od(e,t){e.style.display=t?e[em]:"none",e[wM]=!t}function f7(){wi.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}}}const _M=Symbol("");function A4e(e){const t=bo();if(!t)return;const n=t.ut=(s=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(i=>tm(i,s))},o=()=>{const s=e(t.proxy);t.ce?tm(t.ce,s):sy(t.subTree,s),n(s)};PA(()=>{jp(o)}),wn(()=>{et(o,Ci,{flush:"post"});const s=new MutationObserver(o);s.observe(t.subTree.el.parentNode,{childList:!0}),In(()=>s.disconnect())})}function sy(e,t){if(e.shapeFlag&128){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{sy(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)tm(e.el,t);else if(e.type===Pe)e.children.forEach(n=>sy(n,t));else if(e.type===nu){let{el:n,anchor:o}=e;for(;n&&(tm(n,t),n!==o);)n=n.nextSibling}}function tm(e,t){if(e.nodeType===1){const n=e.style;let o="";for(const s in t){const i=u9(t[s]);n.setProperty(`--${s}`,i),o+=`--${s}: ${i};`}n[_M]=o}}const h7=/(?:^|;)\s*display\s*:/;function p7(e,t,n){const o=e.style,s=On(n);let i=!1;if(n&&!s){if(t)if(On(t))for(const r of t.split(";")){const l=r.slice(0,r.indexOf(":")).trim();n[l]==null&&vd(o,l,"")}else for(const r in t)n[r]==null&&vd(o,r,"");for(const r in n){r==="display"&&(i=!0);const l=n[r];l!=null?g7(e,r,!On(t)&&t?t[r]:void 0,l)||vd(o,r,l):vd(o,r,"")}}else if(s){if(t!==n){const r=o[_M];r&&(n+=";"+r),o.cssText=n,i=h7.test(n)}}else t&&e.removeAttribute("style");em in e&&(e[em]=i?o.display:"",e[wM]&&(o.display="none"))}const Sw=/\s*!important$/;function vd(e,t,n){if(Mt(n))n.forEach(o=>vd(e,t,o));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const o=m7(e,t);Sw.test(n)?e.setProperty($s(o),n.replace(Sw,""),"important"):e[o]=n}}const Cw=["Webkit","Moz","ms"],hg={};function m7(e,t){const n=hg[t];if(n)return n;let o=Mo(t);if(o!=="filter"&&o in e)return hg[t]=o;o=l1(o);for(let s=0;s<Cw.length;s++){const i=Cw[s]+o;if(i in e)return hg[t]=i}return t}function g7(e,t,n,o){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&On(o)&&n===o}const Aw="http://www.w3.org/1999/xlink";function Mw(e,t,n,o,s,i=a9(t)){o&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Aw,t.slice(6,t.length)):e.setAttributeNS(Aw,t,n):n==null||i&&!tA(n)?e.removeAttribute(t):e.setAttribute(t,i?"":ii(n)?String(n):n)}function Ew(e,t,n,o,s){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?vM(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=tA(n):n==null&&l==="string"?(n="",r=!0):l==="number"&&(n=0,r=!0)}try{e[t]=n}catch{}r&&e.removeAttribute(s||t)}function Hr(e,t,n,o){e.addEventListener(t,n,o)}function v7(e,t,n,o){e.removeEventListener(t,n,o)}const Tw=Symbol("_vei");function y7(e,t,n,o,s=null){const i=e[Tw]||(e[Tw]={}),r=i[t];if(o&&r)r.value=o;else{const[l,a]=k7(t);if(o){const c=i[t]=w7(o,s);Hr(e,l,c,a)}else r&&(v7(e,l,r,a),i[t]=void 0)}}const Nw=/(?:Once|Passive|Capture)$/;function k7(e){let t;if(Nw.test(e)){t={};let o;for(;o=e.match(Nw);)e=e.slice(0,e.length-o[0].length),t[o[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):$s(e.slice(2)),t]}let pg=0;const b7=Promise.resolve(),x7=()=>pg||(b7.then(()=>pg=0),pg=Date.now());function w7(e,t){const n=o=>{if(!o._vts)o._vts=Date.now();else if(o._vts<=n.attached)return;const s=n.value;if(Mt(s)){const i=o.stopImmediatePropagation;o.stopImmediatePropagation=()=>{i.call(o),o._stopped=!0};const r=s.slice(),l=[o];for(let a=0;a<r.length&&!o._stopped;a++){const c=r[a];c&&Ei(c,t,5,l)}}else Ei(s,t,5,[o])};return n.value=e,n.attached=x7(),n}const Iw=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,_7=(e,t,n,o,s,i)=>{const r=s==="svg";t==="class"?d7(e,o,r):t==="style"?p7(e,n,o):Af(t)?o1(t)||y7(e,t,n,o,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):S7(e,t,o,r))?(Ew(e,t,o),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Mw(e,t,o,r,i,t!=="value")):e._isVueCE&&(C7(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!On(o)))?Ew(e,Mo(t),o,i,t):(t==="true-value"?e._trueValue=o:t==="false-value"&&(e._falseValue=o),Mw(e,t,o,r))};function S7(e,t,n,o){if(o)return!!(t==="innerHTML"||t==="textContent"||t in e&&Iw(t)&&Pt(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 s=e.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return Iw(t)&&On(n)?!1:t in e}function C7(e,t){const n=e._def.props;if(!n)return!1;const o=Mo(t);return Array.isArray(n)?n.some(s=>Mo(s)===o):Object.keys(n).some(s=>Mo(s)===o)}const Lw={};function A7(e,t,n){let o=Qe(e,t);s1(o)&&(o=Nn({},o,t));class s extends Pk{constructor(r){super(o,r,n)}}return s.def=o,s}const M4e=((e,t)=>A7(e,t,U7)),M7=typeof HTMLElement<"u"?HTMLElement:class{};class Pk extends M7{constructor(t,n={},o=sm){super(),this._def=t,this._props=n,this._createApp=o,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&&o!==sm?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(Nn({},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 Pk){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,kt(()=>{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 o=0;o<this.attributes.length;o++)this._setAttr(this.attributes[o].name);this._ob=new MutationObserver(this._processMutations.bind(this)),this._ob.observe(this,{attributes:!0});const t=(o,s=!1)=>{this._resolved=!0,this._pendingResolve=void 0;const{props:i,styles:r}=o;let l;if(i&&!Mt(i))for(const a in i){const c=i[a];(c===Number||c&&c.type===Number)&&(a in this._props&&(this._props[a]=Hp(this._props[a])),(l||(l=Object.create(null)))[Mo(a)]=!0)}this._numberProps=l,this._resolveProps(o),this.shadowRoot&&this._applyStyles(r),this._mount(o)},n=this._def.__asyncLoader;n?this._pendingResolve=n().then(o=>{o.configureApp=this._def.configureApp,t(this._def=o,!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 o in n)kn(this,o)||Object.defineProperty(this,o,{get:()=>C(n[o])})}_resolveProps(t){const{props:n}=t,o=Mt(n)?n:Object.keys(n||{});for(const s of Object.keys(this))s[0]!=="_"&&o.includes(s)&&this._setProp(s,this[s]);for(const s of o.map(Mo))Object.defineProperty(this,s,{get(){return this._getProp(s)},set(i){this._setProp(s,i,!0,!this._patching)}})}_setAttr(t){if(t.startsWith("data-v-"))return;const n=this.hasAttribute(t);let o=n?this.getAttribute(t):Lw;const s=Mo(t);n&&this._numberProps&&this._numberProps[s]&&(o=Hp(o)),this._setProp(s,o,!1,!0)}_getProp(t){return this._props[t]}_setProp(t,n,o=!0,s=!1){if(n!==this._props[t]&&(this._dirty=!0,n===Lw?delete this._props[t]:(this._props[t]=n,t==="key"&&this._app&&(this._app._ceVNode.key=n)),s&&this._instance&&this._update(),o)){const i=this._ob;i&&(this._processMutations(i.takeRecords()),i.disconnect()),n===!0?this.setAttribute($s(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute($s(t),n+""):n||this.removeAttribute($s(t)),i&&i.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),z7(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const n=fe(this._def,Nn(t,this._props));return this._instance||(n.ce=o=>{this._instance=o,o.ce=this,o.isCE=!0;const s=(i,r)=>{this.dispatchEvent(new CustomEvent(i,s1(r[0])?Nn({detail:r},r[0]):{detail:r}))};o.emit=(i,...r)=>{s(i,r),$s(i)!==i&&s($s(i),r)},this._setParent()}),n}_applyStyles(t,n,o){if(!t)return;if(n){if(n===this._def||this._styleChildren.has(n))return;this._styleChildren.add(n)}const s=this._nonce,i=this.shadowRoot,r=o?this._getStyleAnchor(o)||this._getStyleAnchor(this._def):this._getRootStyleInsertionAnchor(i);let l=null;for(let a=t.length-1;a>=0;a--){const c=document.createElement("style");s&&c.setAttribute("nonce",s),c.textContent=t[a],i.insertBefore(c,l||r),l=c,a===0&&(o||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 o=t.childNodes[n];if(!(o instanceof HTMLStyleElement))return o}return null}_parseSlots(){const t=this._slots={};let n;for(;n=this.firstChild;){const o=n.nodeType===1&&n.getAttribute("slot")||"default";(t[o]||(t[o]=[])).push(n),this.removeChild(n)}}_renderSlots(){const t=this._getSlots(),n=this._instance.type.__scopeId;for(let o=0;o<t.length;o++){const s=t[o],i=s.getAttribute("name")||"default",r=this._slots[i],l=s.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,s)}else for(;s.firstChild;)l.insertBefore(s.firstChild,s);l.removeChild(s)}}_getSlots(){const t=[this];this._teleportTargets&&t.push(...this._teleportTargets);const n=new Set;for(const o of t){const s=o.querySelectorAll("slot");for(let i=0;i<s.length;i++)n.add(s[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 E7(e){const t=bo(),n=t&&t.ce;return n||null}function E4e(){const e=E7();return e&&e.shadowRoot}function T4e(e="$style"){{const t=bo();if(!t)return sn;const n=t.type.__cssModules;if(!n)return sn;const o=n[e];return o||sn}}const SM=new WeakMap,CM=new WeakMap,nm=Symbol("_moveCb"),$w=Symbol("_enterCb"),T7=e=>(delete e.props.mode,e),N7=T7({name:"TransitionGroup",props:Nn({},kM,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=bo(),o=$A();let s,i;return Tk(()=>{if(!s.length)return;const r=e.moveClass||`${e.name||"v"}-move`;if(!O7(s[0].el,n.vnode.el,r)){s=[];return}s.forEach(L7),s.forEach($7);const l=s.filter(F7);oy(n.vnode.el),l.forEach(a=>{const c=a.el,u=c.style;sr(c,r),u.transform=u.webkitTransform=u.transitionDuration="";const d=c[nm]=f=>{f&&f.target!==c||(!f||f.propertyName.endsWith("transform"))&&(c.removeEventListener("transitionend",d),c[nm]=null,vl(c,r))};c.addEventListener("transitionend",d)}),s=[]}),()=>{const r=hn(e),l=bM(r);let a=r.tag||Pe;if(s=[],i)for(let c=0;c<i.length;c++){const u=i[c];u.el&&u.el instanceof Element&&(s.push(u),Rl(u,tf(u,l,o,n)),SM.set(u,AM(u.el)))}i=t.default?Mk(t.default()):[];for(let c=0;c<i.length;c++){const u=i[c];u.key!=null&&Rl(u,tf(u,l,o,n))}return fe(a,null,i)}}}),I7=N7;function L7(e){const t=e.el;t[nm]&&t[nm](),t[$w]&&t[$w]()}function $7(e){CM.set(e,AM(e.el))}function F7(e){const t=SM.get(e),n=CM.get(e),o=t.left-n.left,s=t.top-n.top;if(o||s){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(${o/a}px,${s/c}px)`,r.transitionDuration="0s",e}}function AM(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function O7(e,t,n){const o=e.cloneNode(),s=e[mu];s&&s.forEach(l=>{l.split(/\s+/).forEach(a=>a&&o.classList.remove(a))}),n.split(/\s+/).forEach(l=>l&&o.classList.add(l)),o.style.display="none";const i=t.nodeType===1?t:t.parentNode;i.appendChild(o);const{hasTransform:r}=xM(o);return i.removeChild(o),r}const Dl=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Mt(t)?n=>Qc(t,n):t};function R7(e){e.target.composing=!0}function Fw(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Ai=Symbol("_assign");function Ow(e,t,n){return t&&(e=e.trim()),n&&(e=a1(e)),e}const ws={created(e,{modifiers:{lazy:t,trim:n,number:o}},s){e[Ai]=Dl(s);const i=o||s.props&&s.props.type==="number";Hr(e,t?"change":"input",r=>{r.target.composing||e[Ai](Ow(e.value,n,i))}),(n||i)&&Hr(e,"change",()=>{e.value=Ow(e.value,n,i)}),t||(Hr(e,"compositionstart",R7),Hr(e,"compositionend",Fw),Hr(e,"change",Fw))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:o,trim:s,number:i}},r){if(e[Ai]=Dl(r),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?a1(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"&&(o&&t===n||s&&e.value.trim()===a)||(e.value=a)}},om={deep:!0,created(e,t,n){e[Ai]=Dl(n),Hr(e,"change",()=>{const o=e._modelValue,s=gu(e),i=e.checked,r=e[Ai];if(Mt(o)){const l=u1(o,s),a=l!==-1;if(i&&!a)r(o.concat(s));else if(!i&&a){const c=[...o];c.splice(l,1),r(c)}}else if(Qa(o)){const l=new Set(o);i?l.add(s):l.delete(s),r(l)}else r(EM(e,i))})},mounted:Rw,beforeUpdate(e,t,n){e[Ai]=Dl(n),Rw(e,t,n)}};function Rw(e,{value:t,oldValue:n},o){e._modelValue=t;let s;if(Mt(t))s=u1(t,o.props.value)>-1;else if(Qa(t))s=t.has(o.props.value);else{if(t===n)return;s=jr(t,EM(e,!0))}e.checked!==s&&(e.checked=s)}const MM={created(e,{value:t},n){e.checked=jr(t,n.props.value),e[Ai]=Dl(n),Hr(e,"change",()=>{e[Ai](gu(e))})},beforeUpdate(e,{value:t,oldValue:n},o){e[Ai]=Dl(o),t!==n&&(e.checked=jr(t,o.props.value))}},iy={deep:!0,created(e,{value:t,modifiers:{number:n}},o){const s=Qa(t);Hr(e,"change",()=>{const i=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?a1(gu(r)):gu(r));e[Ai](e.multiple?s?new Set(i):i:i[0]),e._assigning=!0,kt(()=>{e._assigning=!1})}),e[Ai]=Dl(o)},mounted(e,{value:t}){Bw(e,t)},beforeUpdate(e,t,n){e[Ai]=Dl(n)},updated(e,{value:t}){e._assigning||Bw(e,t)}};function Bw(e,t){const n=e.multiple,o=Mt(t);if(!(n&&!o&&!Qa(t))){for(let s=0,i=e.options.length;s<i;s++){const r=e.options[s],l=gu(r);if(n)if(o){const a=typeof l;a==="string"||a==="number"?r.selected=t.some(c=>String(c)===String(l)):r.selected=u1(t,l)>-1}else r.selected=t.has(l);else if(jr(gu(r),t)){e.selectedIndex!==s&&(e.selectedIndex=s);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function gu(e){return"_value"in e?e._value:e.value}function EM(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const B7={created(e,t,n){Lh(e,t,n,null,"created")},mounted(e,t,n){Lh(e,t,n,null,"mounted")},beforeUpdate(e,t,n,o){Lh(e,t,n,o,"beforeUpdate")},updated(e,t,n,o){Lh(e,t,n,o,"updated")}};function TM(e,t){switch(e){case"SELECT":return iy;case"TEXTAREA":return ws;default:switch(t){case"checkbox":return om;case"radio":return MM;default:return ws}}}function Lh(e,t,n,o,s){const r=TM(e.tagName,n.props&&n.props.type)[s];r&&r(e,t,n,o)}function D7(){ws.getSSRProps=({value:e})=>({value:e}),MM.getSSRProps=({value:e},t)=>{if(t.props&&jr(t.props.value,e))return{checked:!0}},om.getSSRProps=({value:e},t)=>{if(Mt(e)){if(t.props&&u1(e,t.props.value)>-1)return{checked:!0}}else if(Qa(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},B7.getSSRProps=(e,t)=>{if(typeof t.type!="string")return;const n=TM(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}const P7=["ctrl","shift","alt","meta"],H7={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)=>P7.some(n=>e[`${n}Key`]&&!t.includes(n))},Ct=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),o=t.join(".");return n[o]||(n[o]=((s,...i)=>{for(let r=0;r<t.length;r++){const l=H7[t[r]];if(l&&l(s,t))return}return e(s,...i)}))},W7={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},ur=(e,t)=>{const n=e._withKeys||(e._withKeys={}),o=t.join(".");return n[o]||(n[o]=(s=>{if(!("key"in s))return;const i=$s(s.key);if(t.some(r=>r===i||W7[r]===i))return e(s)}))},NM=Nn({patchProp:_7},l7);let $d,Dw=!1;function IM(){return $d||($d=WI(NM))}function LM(){return $d=Dw?$d:zI(NM),Dw=!0,$d}const z7=((...e)=>{IM().render(...e)}),N4e=((...e)=>{LM().hydrate(...e)}),sm=((...e)=>{const t=IM().createApp(...e),{mount:n}=t;return t.mount=o=>{const s=FM(o);if(!s)return;const i=t._component;!Pt(i)&&!i.render&&!i.template&&(i.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const r=n(s,!1,$M(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),r},t}),U7=((...e)=>{const t=LM().createApp(...e),{mount:n}=t;return t.mount=o=>{const s=FM(o);if(s)return n(s,!0,$M(s))},t});function $M(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function FM(e){return On(e)?document.querySelector(e):e}let Pw=!1;const I4e=()=>{Pw||(Pw=!0,D7(),f7())};/*!
|
|
21
|
-
* shared v11.4.5
|
|
22
|
-
* (c) 2026 kazuya kawaguchi
|
|
23
|
-
* Released under the MIT License.
|
|
24
|
-
*/function q7(e,t){typeof console<"u"&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const im=typeof window<"u",jl=(e,t=!1)=>t?Symbol.for(e):Symbol(e),j7=(e,t,n)=>V7({l:e,k:t,s:n}),V7=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),yo=e=>typeof e=="number"&&isFinite(e),OM=e=>Wk(e)==="[object Date]",vu=e=>Wk(e)==="[object RegExp]",x1=e=>cn(e)&&Object.keys(e).length===0,ko=Object.assign,K7=Object.create,Fn=(e=null)=>K7(e);let Hw;const Ma=()=>Hw||(Hw=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:Fn());function Ww(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/").replace(/=/g,"=")}function G7(e){return e.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}const Y7=/^\s*javascript\s*(?::|�*58;?|�*3a;?|:?)/i,Z7=/^(?:href|src|action|formaction)$/i;function Hk(e){return Y7.test(e)}function X7(e){const t=/url\s*\(/gi;let n="",o=0,s;for(;(s=t.exec(e))!==null;){const i=s.index,r=t.lastIndex-1;let l=r+1,a=1,c=null;for(;l<e.length;l++){const f=e[l];if(c){f===c&&(c=null);continue}if(f==='"'||f==="'")c=f;else if(f==="(")a++;else if(f===")"&&(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(o,i),n+=Hk(d)?"url(about:blank)":e.slice(i,l+1),o=l+1}return n+e.slice(o)}function zw(e,t){if(Z7.test(e)&&Hk(t))return"about:blank";const n=e.toLowerCase()==="style"?X7(t):t;return G7(n)}function Q7(e){return e=e.replace(/([\w:-]+)\s*=\s*"([^"]*)"/g,(n,o,s)=>`${o}="${zw(o,s)}"`),e=e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g,(n,o,s)=>`${o}='${zw(o,s)}'`),/\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,o,s)=>Hk(s)?`${o}about:blank`:n),e}const J7=Object.prototype.hasOwnProperty;function Si(e,t){return J7.call(e,t)}const oo=Array.isArray,Zn=e=>typeof e=="function",wt=e=>typeof e=="string",mn=e=>typeof e=="boolean",gn=e=>e!==null&&typeof e=="object",eL=e=>gn(e)&&Zn(e.then)&&Zn(e.catch),RM=Object.prototype.toString,Wk=e=>RM.call(e),cn=e=>Wk(e)==="[object Object]",tL=e=>e==null?"":oo(e)||cn(e)&&e.toString===RM?JSON.stringify(e,null,2):String(e);function zk(e,t=""){return e.reduce((n,o,s)=>s===0?n+o:n+t+o,"")}const $h=e=>!gn(e)||oo(e);function yp(e,t){if($h(e)||$h(t))throw new Error("Invalid value");const n=[{src:e,des:t}];for(;n.length;){const{src:o,des:s}=n.pop();Object.keys(o).forEach(i=>{i!=="__proto__"&&(gn(o[i])&&!gn(s[i])&&(s[i]=Array.isArray(o[i])?[]:Fn()),$h(s[i])||$h(o[i])?s[i]=o[i]:n.push({src:o[i],des:s[i]}))})}}/*!
|
|
25
|
-
* message-compiler v11.4.5
|
|
26
|
-
* (c) 2026 kazuya kawaguchi
|
|
27
|
-
* Released under the MIT License.
|
|
28
|
-
*/function nL(e,t,n){return{line:e,column:t,offset:n}}function ry(e,t,n){return{start:e,end:t}}const Cn={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},oL=17;function w1(e,t,n={}){const{domain:o,messages:s,args:i}=n,r=e,l=new SyntaxError(String(r));return l.code=e,t&&(l.location=t),l.domain=o,l}function sL(e){throw e}const er=" ",iL="\r",ns=`
|
|
29
|
-
`,rL="\u2028",lL="\u2029";function aL(e){const t=e;let n=0,o=1,s=1,i=0;const r=T=>t[T]===iL&&t[T+1]===ns,l=T=>t[T]===ns,a=T=>t[T]===lL,c=T=>t[T]===rL,u=T=>r(T)||l(T)||a(T)||c(T),d=()=>n,f=()=>o,h=()=>s,p=()=>i,m=T=>r(T)||a(T)||c(T)?ns:t[T],y=()=>m(n),k=()=>m(n+i);function g(){return i=0,u(n)&&(o++,s=0),r(n)&&n++,n++,s++,t[n]}function v(){return r(n+i)&&i++,i++,t[n+i]}function b(){n=0,o=1,s=1,i=0}function A(T=0){i=T}function I(){const T=n+i;for(;T!==n;)g();i=0}return{index:d,line:f,column:h,peekOffset:p,charAt:m,currentChar:y,currentPeek:k,next:g,peek:v,reset:b,resetPeek:A,skipToPeek:I}}const Ar=void 0,cL=".",Uw="'",uL="tokenizer";function dL(e,t={}){const n=t.location!==!1,o=aL(e),s=()=>o.index(),i=()=>nL(o.line(),o.column(),o.index()),r=i(),l=s(),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(V,se,he,...ke){const Te=c();if(se.column+=he,se.offset+=he,u){const ze=n?ry(Te.startLoc,se):null,ye=w1(V,ze,{domain:uL,args:ke});u(ye)}}function f(V,se,he){V.endLoc=i(),V.currentType=se;const ke={type:se};return n&&(ke.loc=ry(V.startLoc,V.endLoc)),he!=null&&(ke.value=he),ke}const h=V=>f(V,13);function p(V,se){return V.currentChar()===se?(V.next(),se):(d(Cn.EXPECTED_TOKEN,i(),0,se),"")}function m(V){let se="";for(;V.currentPeek()===er||V.currentPeek()===ns;)se+=V.currentPeek(),V.peek();return se}function y(V){const se=m(V);return V.skipToPeek(),se}function k(V){if(V===Ar)return!1;const se=V.charCodeAt(0);return se>=97&&se<=122||se>=65&&se<=90||se===95}function g(V){if(V===Ar)return!1;const se=V.charCodeAt(0);return se>=48&&se<=57}function v(V,se){const{currentType:he}=se;if(he!==2)return!1;m(V);const ke=k(V.currentPeek());return V.resetPeek(),ke}function b(V,se){const{currentType:he}=se;if(he!==2)return!1;m(V);const ke=V.currentPeek()==="-"?V.peek():V.currentPeek(),Te=g(ke);return V.resetPeek(),Te}function A(V,se){const{currentType:he}=se;if(he!==2)return!1;m(V);const ke=V.currentPeek()===Uw;return V.resetPeek(),ke}function I(V,se){const{currentType:he}=se;if(he!==7)return!1;m(V);const ke=V.currentPeek()===".";return V.resetPeek(),ke}function T(V,se){const{currentType:he}=se;if(he!==8)return!1;m(V);const ke=k(V.currentPeek());return V.resetPeek(),ke}function M(V,se){const{currentType:he}=se;if(!(he===7||he===11))return!1;m(V);const ke=V.currentPeek()===":";return V.resetPeek(),ke}function $(V,se){const{currentType:he}=se;if(he!==9)return!1;const ke=()=>{const ze=V.currentPeek();return ze==="{"?k(V.peek()):ze==="@"||ze==="|"||ze===":"||ze==="."||ze===er||!ze?!1:ze===ns?(V.peek(),ke()):F(V,!1)},Te=ke();return V.resetPeek(),Te}function N(V){m(V);const se=V.currentPeek()==="|";return V.resetPeek(),se}function F(V,se=!0){const he=(Te=!1,ze="")=>{const ye=V.currentPeek();return ye==="{"||ye==="@"||!ye?Te:ye==="|"?!(ze===er||ze===ns):ye===er?(V.peek(),he(!0,er)):ye===ns?(V.peek(),he(!0,ns)):!0},ke=he();return se&&V.resetPeek(),ke}function S(V,se){const he=V.currentChar();return he===Ar?Ar:se(he)?(V.next(),he):null}function B(V){const se=V.charCodeAt(0);return se>=97&&se<=122||se>=65&&se<=90||se>=48&&se<=57||se===95||se===36}function W(V){return S(V,B)}function z(V){const se=V.charCodeAt(0);return se>=97&&se<=122||se>=65&&se<=90||se>=48&&se<=57||se===95||se===36||se===45}function L(V){return S(V,z)}function O(V){const se=V.charCodeAt(0);return se>=48&&se<=57}function j(V){return S(V,O)}function Z(V){const se=V.charCodeAt(0);return se>=48&&se<=57||se>=65&&se<=70||se>=97&&se<=102}function ie(V){return S(V,Z)}function U(V){let se="",he="";for(;se=j(V);)he+=se;return he}function q(V){let se="";for(;;){const he=V.currentChar();if(he==="\\"){const ke=V.peek();ke==="{"||ke==="}"||ke==="@"||ke==="|"||ke==="\\"?(se+=he+ke,V.next(),V.next()):(V.resetPeek(),se+=he,V.next())}else{if(he==="{"||he==="}"||he==="@"||he==="|"||!he)break;if(he===er||he===ns)if(F(V))se+=he,V.next();else{if(N(V))break;se+=he,V.next()}else se+=he,V.next()}}return se}function ee(V){y(V);let se="",he="";for(;se=L(V);)he+=se;const ke=V.currentChar();if(ke&&ke!=="}"&&ke!==Ar&&ke!==er&&ke!==ns&&ke!==" "){const Te=ae(V);return d(Cn.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,he+Te),he+Te}return V.currentChar()===Ar&&d(Cn.UNTERMINATED_CLOSING_BRACE,i(),0),he}function le(V){y(V);let se="";return V.currentChar()==="-"?(V.next(),se+=`-${U(V)}`):se+=U(V),V.currentChar()===Ar&&d(Cn.UNTERMINATED_CLOSING_BRACE,i(),0),se}function oe(V){return V!==Uw&&V!==ns}function re(V){y(V),p(V,"'");let se="",he="";for(;se=S(V,oe);)se==="\\"?he+=we(V):he+=se;const ke=V.currentChar();return ke===ns||ke===Ar?(d(Cn.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,i(),0),ke===ns&&(V.next(),p(V,"'")),he):(p(V,"'"),he)}function we(V){const se=V.currentChar();switch(se){case"\\":case"'":return V.next(),`\\${se}`;case"u":return me(V,se,4);case"U":return me(V,se,6);default:return d(Cn.UNKNOWN_ESCAPE_SEQUENCE,i(),0,se),""}}function me(V,se,he){p(V,se);let ke="";for(let Te=0;Te<he;Te++){const ze=ie(V);if(!ze){d(Cn.INVALID_UNICODE_ESCAPE_SEQUENCE,i(),0,`\\${se}${ke}${V.currentChar()}`);break}ke+=ze}return`\\${se}${ke}`}function Ee(V){return V!=="{"&&V!=="}"&&V!==er&&V!==ns}function ae(V){y(V);let se="",he="";for(;se=S(V,Ee);)he+=se;return he}function Y(V){let se="",he="";for(;se=W(V);)he+=se;return he}function Q(V){const se=he=>{const ke=V.currentChar();return ke==="{"||ke==="@"||ke==="|"||ke==="("||ke===")"||!ke||ke===er?he:(he+=ke,V.next(),se(he))};return se("")}function P(V){y(V);const se=p(V,"|");return y(V),se}function G(V,se){let he=null;switch(V.currentChar()){case"{":return se.braceNest>=1&&d(Cn.NOT_ALLOW_NEST_PLACEHOLDER,i(),0),V.next(),he=f(se,2,"{"),y(V),se.braceNest++,he;case"}":return se.braceNest>0&&se.currentType===2&&d(Cn.EMPTY_PLACEHOLDER,i(),0),V.next(),he=f(se,3,"}"),se.braceNest--,se.braceNest>0&&y(V),se.inLinked&&se.braceNest===0&&(se.inLinked=!1),he;case"@":return se.braceNest>0&&d(Cn.UNTERMINATED_CLOSING_BRACE,i(),0),he=pe(V,se)||h(se),se.braceNest=0,he;default:{let Te=!0,ze=!0,ye=!0;if(N(V))return se.braceNest>0&&d(Cn.UNTERMINATED_CLOSING_BRACE,i(),0),he=f(se,1,P(V)),se.braceNest=0,se.inLinked=!1,he;if(se.braceNest>0&&(se.currentType===4||se.currentType===5||se.currentType===6))return d(Cn.UNTERMINATED_CLOSING_BRACE,i(),0),se.braceNest=0,ve(V,se);if(Te=v(V,se))return he=f(se,4,ee(V)),y(V),he;if(ze=b(V,se))return he=f(se,5,le(V)),y(V),he;if(ye=A(V,se))return he=f(se,6,re(V)),y(V),he;if(!Te&&!ze&&!ye)return he=f(se,12,ae(V)),d(Cn.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,he.value),y(V),he;break}}return he}function pe(V,se){const{currentType:he}=se;let ke=null;const Te=V.currentChar();switch((he===7||he===8||he===11||he===9)&&(Te===ns||Te===er)&&d(Cn.INVALID_LINKED_FORMAT,i(),0),Te){case"@":return V.next(),ke=f(se,7,"@"),se.inLinked=!0,ke;case".":return y(V),V.next(),f(se,8,".");case":":return y(V),V.next(),f(se,9,":");default:return N(V)?(ke=f(se,1,P(V)),se.braceNest=0,se.inLinked=!1,ke):I(V,se)||M(V,se)?(y(V),pe(V,se)):T(V,se)?(y(V),f(se,11,Y(V))):$(V,se)?(y(V),Te==="{"?G(V,se)||ke:f(se,10,Q(V))):(he===7&&d(Cn.INVALID_LINKED_FORMAT,i(),0),se.braceNest=0,se.inLinked=!1,ve(V,se))}}function ve(V,se){let he={type:13};if(se.braceNest>0)return G(V,se)||h(se);if(se.inLinked)return pe(V,se)||h(se);switch(V.currentChar()){case"{":return G(V,se)||h(se);case"}":return d(Cn.UNBALANCED_CLOSING_BRACE,i(),0),V.next(),f(se,3,"}");case"@":return pe(V,se)||h(se);default:{if(N(V))return he=f(se,1,P(V)),se.braceNest=0,se.inLinked=!1,he;if(F(V))return f(se,0,q(V));break}}return he}function de(){const{currentType:V,offset:se,startLoc:he,endLoc:ke}=a;return a.lastType=V,a.lastOffset=se,a.lastStartLoc=he,a.lastEndLoc=ke,a.offset=s(),a.startLoc=i(),o.currentChar()===Ar?f(a,13):ve(o,a)}return{nextToken:de,currentOffset:s,currentPosition:i,context:c}}const fL="parser",hL=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,pL=/\\([\\@{}|])/g;function mL(e,t){return t}function gL(e,t,n){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const o=parseInt(t||n,16);return o<=55295||o>=57344?String.fromCodePoint(o):"�"}}}function vL(e={}){const t=e.location!==!1,{onError:n}=e;function o(k,g,v,b,...A){const I=k.currentPosition();if(I.offset+=b,I.column+=b,n){const T=t?ry(v,I):null,M=w1(g,T,{domain:fL,args:A});n(M)}}function s(k,g,v){const b={type:k};return t&&(b.start=g,b.end=g,b.loc={start:v,end:v}),b}function i(k,g,v,b){t&&(k.end=g,k.loc&&(k.loc.end=v))}function r(k,g){const v=k.context(),b=s(3,v.offset,v.startLoc);return b.value=g.replace(pL,mL),i(b,k.currentOffset(),k.currentPosition()),b}function l(k,g){const v=k.context(),{lastOffset:b,lastStartLoc:A}=v,I=s(5,b,A);return I.index=parseInt(g,10),k.nextToken(),i(I,k.currentOffset(),k.currentPosition()),I}function a(k,g){const v=k.context(),{lastOffset:b,lastStartLoc:A}=v,I=s(4,b,A);return I.key=g,k.nextToken(),i(I,k.currentOffset(),k.currentPosition()),I}function c(k,g){const v=k.context(),{lastOffset:b,lastStartLoc:A}=v,I=s(9,b,A);return I.value=g.replace(hL,gL),k.nextToken(),i(I,k.currentOffset(),k.currentPosition()),I}function u(k){const g=k.nextToken(),v=k.context(),{lastOffset:b,lastStartLoc:A}=v,I=s(8,b,A);return g.type!==11?(o(k,Cn.UNEXPECTED_EMPTY_LINKED_MODIFIER,v.lastStartLoc,0),I.value="",i(I,b,A),{nextConsumeToken:g,node:I}):(g.value==null&&o(k,Cn.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,tr(g)),I.value=g.value||"",i(I,k.currentOffset(),k.currentPosition()),{node:I})}function d(k,g){const v=k.context(),b=s(7,v.offset,v.startLoc);return b.value=g,i(b,k.currentOffset(),k.currentPosition()),b}function f(k){const g=k.context(),v=s(6,g.offset,g.startLoc);let b=k.nextToken();if(b.type===8){const A=u(k);v.modifier=A.node,b=A.nextConsumeToken||k.nextToken()}switch(b.type!==9&&o(k,Cn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,tr(b)),b=k.nextToken(),b.type===2&&(b=k.nextToken()),b.type){case 10:b.value==null&&o(k,Cn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,tr(b)),v.key=d(k,b.value||"");break;case 4:b.value==null&&o(k,Cn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,tr(b)),v.key=a(k,b.value||"");break;case 5:b.value==null&&o(k,Cn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,tr(b)),v.key=l(k,b.value||"");break;case 6:b.value==null&&o(k,Cn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,tr(b)),v.key=c(k,b.value||"");break;default:{o(k,Cn.UNEXPECTED_EMPTY_LINKED_KEY,g.lastStartLoc,0);const A=k.context(),I=s(7,A.offset,A.startLoc);return I.value="",i(I,A.offset,A.startLoc),v.key=I,i(v,A.offset,A.startLoc),{nextConsumeToken:b,node:v}}}return i(v,k.currentOffset(),k.currentPosition()),{node:v}}function h(k){const g=k.context(),v=g.currentType===1?k.currentOffset():g.offset,b=g.currentType===1?g.endLoc:g.startLoc,A=s(2,v,b);A.items=[];let I=null;do{const $=I||k.nextToken();switch(I=null,$.type){case 0:$.value==null&&o(k,Cn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,tr($)),A.items.push(r(k,$.value||""));break;case 5:$.value==null&&o(k,Cn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,tr($)),A.items.push(l(k,$.value||""));break;case 4:$.value==null&&o(k,Cn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,tr($)),A.items.push(a(k,$.value||""));break;case 6:$.value==null&&o(k,Cn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,tr($)),A.items.push(c(k,$.value||""));break;case 7:{const N=f(k);A.items.push(N.node),I=N.nextConsumeToken||null;break}}}while(g.currentType!==13&&g.currentType!==1);const T=g.currentType===1?g.lastOffset:k.currentOffset(),M=g.currentType===1?g.lastEndLoc:k.currentPosition();return i(A,T,M),A}function p(k,g,v,b){const A=k.context();let I=b.items.length===0;const T=s(1,g,v);T.cases=[],T.cases.push(b);do{const M=h(k);I||(I=M.items.length===0),T.cases.push(M)}while(A.currentType!==13);return I&&o(k,Cn.MUST_HAVE_MESSAGES_IN_PLURAL,v,0),i(T,k.currentOffset(),k.currentPosition()),T}function m(k){const g=k.context(),{offset:v,startLoc:b}=g,A=h(k);return g.currentType===13?A:p(k,v,b,A)}function y(k){const g=dL(k,ko({},e)),v=g.context(),b=s(0,v.offset,v.startLoc);return t&&b.loc&&(b.loc.source=k),b.body=m(g),e.onCacheKey&&(b.cacheKey=e.onCacheKey(k)),v.currentType!==13&&o(g,Cn.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,k[v.offset]||""),i(b,g.currentOffset(),g.currentPosition()),b}return{parse:y}}function tr(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 yL(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:i=>(n.helpers.add(i),i)}}function qw(e,t){for(let n=0;n<e.length;n++)Uk(e[n],t)}function Uk(e,t){switch(e.type){case 1:qw(e.cases,t),t.helper("plural");break;case 2:qw(e.items,t);break;case 6:{Uk(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 kL(e,t={}){const n=yL(e);n.helper("normalize"),e.body&&Uk(e.body,n);const o=n.context();e.helpers=Array.from(o.helpers)}function bL(e){const t=e.body;return t.type===2?jw(t):t.cases.forEach(n=>jw(n)),e}function jw(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 o=e.items[n];if(!(o.type===3||o.type===9)||o.value==null)break;t.push(o.value)}if(t.length===e.items.length){e.static=zk(t);for(let n=0;n<e.items.length;n++){const o=e.items[n];(o.type===3||o.type===9)&&delete o.value}}}}function Oc(e){switch(e.t=e.type,e.type){case 0:{const t=e;Oc(t.body),t.b=t.body,delete t.body;break}case 1:{const t=e,n=t.cases;for(let o=0;o<n.length;o++)Oc(n[o]);t.c=n,delete t.cases;break}case 2:{const t=e,n=t.items;for(let o=0;o<n.length;o++)Oc(n[o]);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;Oc(t.key),t.k=t.key,delete t.key,t.modifier&&(Oc(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 xL(e,t){const{filename:n,breakLineCode:o,needIndent:s}=t,i=t.location!==!1,r={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:o,needIndent:s,indentLevel:0};i&&e.loc&&(r.source=e.loc.source);const l=()=>r;function a(m,y){r.code+=m}function c(m,y=!0){const k=y?o:"";a(s?k+" ".repeat(m):k)}function u(m=!0){const y=++r.indentLevel;m&&c(y)}function d(m=!0){const y=--r.indentLevel;m&&c(y)}function f(){c(r.indentLevel)}return{context:l,push:a,indent:u,deindent:d,newline:f,helper:m=>`_${m}`,needIndent:()=>r.needIndent}}function wL(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),yu(e,t.key),t.modifier?(e.push(", "),yu(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function _L(e,t){const{helper:n,needIndent:o}=e;e.push(`${n("normalize")}([`),e.indent(o());const s=t.items.length;for(let i=0;i<s&&(yu(e,t.items[i]),i!==s-1);i++)e.push(", ");e.deindent(o()),e.push("])")}function SL(e,t){const{helper:n,needIndent:o}=e;if(t.cases.length>1){e.push(`${n("plural")}([`),e.indent(o());const s=t.cases.length;for(let i=0;i<s&&(yu(e,t.cases[i]),i!==s-1);i++)e.push(", ");e.deindent(o()),e.push("])")}}function CL(e,t){t.body?yu(e,t.body):e.push("null")}function yu(e,t){const{helper:n}=e;switch(t.type){case 0:CL(e,t);break;case 1:SL(e,t);break;case 2:_L(e,t);break;case 6:wL(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 AL=(e,t={})=>{const n=wt(t.mode)?t.mode:"normal",o=wt(t.filename)?t.filename:"message.intl";t.sourceMap;const s=t.breakLineCode!=null?t.breakLineCode:n==="arrow"?";":`
|
|
30
|
-
`,i=t.needIndent?t.needIndent:n!=="arrow",r=e.helpers||[],l=xL(e,{filename:o,breakLineCode:s,needIndent:i});l.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(i),r.length>0&&(l.push(`const { ${zk(r.map(u=>`${u}: _${u}`),", ")} } = ctx`),l.newline()),l.push("return "),yu(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 ML(e,t={}){const n=ko({},t),o=!!n.jit,s=!!n.minify,i=n.optimize==null?!0:n.optimize,l=vL(n).parse(e);return o?(i&&bL(l),s&&Oc(l),{ast:l,code:""}):(kL(l,n),AL(l,n))}/*!
|
|
31
|
-
* core-base v11.4.5
|
|
32
|
-
* (c) 2026 kazuya kawaguchi
|
|
33
|
-
* Released under the MIT License.
|
|
34
|
-
*/function EL(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Ma().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Ma().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function hr(e){return gn(e)&&qk(e)===0&&(Si(e,"b")||Si(e,"body"))}const BM=["b","body"];function TL(e){return Vl(e,BM)}const DM=["c","cases"];function NL(e){return Vl(e,DM,[])}const PM=["s","static"];function IL(e){return Vl(e,PM)}const HM=["i","items"];function LL(e){return Vl(e,HM,[])}const WM=["t","type"];function qk(e){return Vl(e,WM)}const zM=["v","value"];function Fh(e,t){const n=Vl(e,zM);if(n!=null)return n;throw rf(t)}const UM=["m","modifier"];function $L(e){return Vl(e,UM)}const qM=["k","key"];function FL(e){const t=Vl(e,qM);if(t)return t;throw rf(6)}function Vl(e,t,n){for(let o=0;o<t.length;o++){const s=t[o];if(Si(e,s)&&e[s]!=null)return e[s]}return n}const jM=[...BM,...DM,...PM,...HM,...qM,...UM,...zM,...WM];function rf(e){return new Error(`unhandled node type: ${e}`)}function mg(e){return n=>OL(n,e)}function OL(e,t){const n=TL(t);if(n==null)throw rf(0);if(qk(n)===1){const i=NL(n);return e.plural(i.reduce((r,l)=>[...r,Vw(e,l)],[]))}else return Vw(e,n)}function Vw(e,t){const n=IL(t);if(n!=null)return e.type==="text"?n:e.normalize([n]);{const o=LL(t).reduce((s,i)=>[...s,ly(e,i)],[]);return e.normalize(o)}}function ly(e,t){const n=qk(t);switch(n){case 3:return Fh(t,n);case 9:return Fh(t,n);case 4:{const o=t;if(Si(o,"k")&&o.k)return e.interpolate(e.named(o.k));if(Si(o,"key")&&o.key)return e.interpolate(e.named(o.key));throw rf(n)}case 5:{const o=t;if(Si(o,"i")&&yo(o.i))return e.interpolate(e.list(o.i));if(Si(o,"index")&&yo(o.index))return e.interpolate(e.list(o.index));throw rf(n)}case 6:{const o=t,s=$L(o),i=FL(o);return e.linked(ly(e,i),s?ly(e,s):void 0,e.type)}case 7:return Fh(t,n);case 8:return Fh(t,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const RL=e=>e;let Oh=Fn();function BL(e,t={}){let n=!1;const o=t.onError||sL;return t.onError=s=>{n=!0,o(s)},{...ML(e,t),detectError:n}}function DL(e,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&wt(e)){mn(t.warnHtmlMessage)&&t.warnHtmlMessage;const o=(t.onCacheKey||RL)(e),s=Oh[o];if(s)return s;const{ast:i,detectError:r}=BL(e,{...t,location:!1,jit:!0}),l=mg(i);return r?l:Oh[o]=l}else{const n=e.cacheKey;if(n){const o=Oh[n];return o||(Oh[n]=mg(e))}else return mg(e)}}let lf=null;function PL(e){lf=e}function HL(e,t,n){lf&&lf.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const WL=zL("function:translate");function zL(e){return t=>lf&&lf.emit(e,t)}const Wr={INVALID_ARGUMENT:oL,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},UL=24;function zr(e){return w1(e,null,void 0)}function jk(e,t){return t.locale!=null?Kw(t.locale):Kw(e.locale)}let gg;function Kw(e){if(wt(e))return e;if(Zn(e)){if(e.resolvedOnce&&gg!=null)return gg;if(e.constructor.name==="Function"){const t=e();if(eL(t))throw zr(Wr.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return gg=t}else throw zr(Wr.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw zr(Wr.NOT_SUPPORT_LOCALE_TYPE)}function qL(e,t,n){return[...new Set([n,...oo(t)?t:gn(t)?Object.keys(t):wt(t)?[t]:[n]])]}function ay(e,t,n){const o=wt(n)?n:af,s=e;s.__localeChainCache||(s.__localeChainCache=new Map);let i=s.__localeChainCache.get(o);if(!i){i=[];let r=[n];for(;oo(r);)r=Gw(i,r,t);const l=oo(t)||!cn(t)?t:t.default?t.default:null;r=wt(l)?[l]:l,oo(r)&&Gw(i,r,!1),s.__localeChainCache.set(o,i)}return i}function Gw(e,t,n){let o=!0;for(let s=0;s<t.length&&mn(o);s++){const i=t[s];wt(i)&&(o=jL(e,t[s],n))}return o}function jL(e,t,n){let o;const s=t.split("-");do{const i=s.join("-");o=VL(e,i,n),s.splice(-1,1)}while(s.length&&o===!0);return o}function VL(e,t,n){let o=!1;if(!e.includes(t)&&(o=!0,t)){o=t[t.length-1]!=="!";const s=t.replace(/!/g,"");e.push(s),(oo(n)||cn(n))&&n[s]&&(o=n[s])}return o}const Kl=[];Kl[0]={w:[0],i:[3,0],"[":[4],o:[7]};Kl[1]={w:[1],".":[2],"[":[4],o:[7]};Kl[2]={w:[2],i:[3,0],0:[3,0]};Kl[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};Kl[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};Kl[5]={"'":[4,0],o:8,l:[5,0]};Kl[6]={'"':[4,0],o:8,l:[6,0]};const KL=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function GL(e){return KL.test(e)}function YL(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 ZL(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 XL(e){const t=e.trim();return e.charAt(0)==="0"&&isNaN(parseInt(e))?!1:GL(t)?YL(t):"*"+t}function QL(e){const t=[];let n=-1,o=0,s=0,i,r,l,a,c,u,d;const f=[];f[0]=()=>{r===void 0?r=l:r+=l},f[1]=()=>{r!==void 0&&(t.push(r),r=void 0)},f[2]=()=>{f[0](),s++},f[3]=()=>{if(s>0)s--,o=4,f[0]();else{if(s=0,r===void 0||(r=XL(r),r===!1))return!1;f[1]()}};function h(){const p=e[n+1];if(o===5&&p==="'"||o===6&&p==='"')return n++,l="\\"+p,f[0](),!0}for(;o!==null;)if(n++,i=e[n],!(i==="\\"&&h())){if(a=ZL(i),d=Kl[o],c=d[a]||d.l||8,c===8||(o=c[0],c[1]!==void 0&&(u=f[c[1]],u&&(l=i,u()===!1))))return;if(o===7)return t}}const Yw=new Map;function JL(e,t){return gn(e)?e[t]:null}function e$(e,t){if(!gn(e))return null;let n=Yw.get(t);if(n||(n=QL(t),n&&Yw.set(t,n)),!n)return null;const o=n.length;let s=e,i=0;for(;i<o;){const r=n[i];if(jM.includes(r)&&hr(s)||!gn(s)||!Si(s,r))return null;const l=s[r];if(l===void 0||Zn(s))return null;s=l,i++}return s}const t$="11.4.5",_1=-1,af="en-US",rm="",Zw=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function n$(){return{upper:(e,t)=>t==="text"&&wt(e)?e.toUpperCase():t==="vnode"&&gn(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&&wt(e)?e.toLowerCase():t==="vnode"&&gn(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&&wt(e)?Zw(e):t==="vnode"&&gn(e)&&"__v_isVNode"in e?Zw(e.children):e}}let VM;function o$(e){VM=e}let KM;function s$(e){KM=e}let GM;function i$(e){GM=e}let YM=null;const r$=e=>{YM=e},l$=()=>YM;let ZM=null;const Xw=e=>{ZM=e},a$=()=>ZM;let Qw=0;function c$(e={}){const t=Zn(e.onWarn)?e.onWarn:q7,n=wt(e.version)?e.version:t$,o=wt(e.locale)||Zn(e.locale)?e.locale:af,s=Zn(o)?af:o,i=oo(e.fallbackLocale)||cn(e.fallbackLocale)||wt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:s,r=cn(e.messages)?e.messages:vg(s),l=cn(e.datetimeFormats)?e.datetimeFormats:vg(s),a=cn(e.numberFormats)?e.numberFormats:vg(s),c=ko(Fn(),e.modifiers,n$()),u=e.pluralRules||Fn(),d=Zn(e.missing)?e.missing:null,f=mn(e.missingWarn)||vu(e.missingWarn)?e.missingWarn:!0,h=mn(e.fallbackWarn)||vu(e.fallbackWarn)?e.fallbackWarn:!0,p=!!e.fallbackFormat,m=!!e.unresolving,y=Zn(e.postTranslation)?e.postTranslation:null,k=cn(e.processor)?e.processor:null,g=mn(e.warnHtmlMessage)?e.warnHtmlMessage:!0,v=!!e.escapeParameter,b=Zn(e.messageCompiler)?e.messageCompiler:VM,A=Zn(e.messageResolver)?e.messageResolver:KM||JL,I=Zn(e.localeFallbacker)?e.localeFallbacker:GM||qL,T=gn(e.fallbackContext)?e.fallbackContext:void 0,M=e,$=gn(M.__datetimeFormatters)?M.__datetimeFormatters:new Map,N=gn(M.__numberFormatters)?M.__numberFormatters:new Map,F=gn(M.__meta)?M.__meta:{};Qw++;const S={version:n,cid:Qw,locale:o,fallbackLocale:i,messages:r,modifiers:c,pluralRules:u,missing:d,missingWarn:f,fallbackWarn:h,fallbackFormat:p,unresolving:m,postTranslation:y,processor:k,warnHtmlMessage:g,escapeParameter:v,messageCompiler:b,messageResolver:A,localeFallbacker:I,fallbackContext:T,onWarn:t,__meta:F};return S.datetimeFormats=l,S.numberFormats=a,S.__datetimeFormatters=$,S.__numberFormatters=N,__INTLIFY_PROD_DEVTOOLS__&&HL(S,n,F),S}const vg=e=>({[e]:Fn()});function Vk(e,t,n,o,s){const{missing:i,onWarn:r}=e;if(i!==null){const l=i(e,n,t,s);return wt(l)?l:t}else return t}function sd(e,t,n){const o=e;o.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function u$(e,t){return e===t?!1:e.split("-")[0]===t.split("-")[0]}function d$(e,t){const n=t.indexOf(e);if(n===-1)return!1;for(let o=n+1;o<t.length;o++)if(u$(e,t[o]))return!0;return!1}function Jw(e,...t){const{datetimeFormats:n,unresolving:o,fallbackLocale:s,onWarn:i,localeFallbacker:r}=e,{__datetimeFormatters:l}=e;if(!wt(t[0])&&!OM(t[0])&&!yo(t[0]))return rm;const[a,c,u,d]=cy(...t),f=mn(u.missingWarn)?u.missingWarn:e.missingWarn;mn(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const h=!!u.part,p=jk(e,u),m=r(e,s,p);if(!wt(a)||a===""){const I=new Intl.DateTimeFormat(p.replace(/!/g,""),d);return h?I.formatToParts(c):I.format(c)}let y={},k,g=null;const v="datetime format";for(let I=0;I<m.length&&(k=m[I],y=n[k]||{},g=y[a],!cn(g));I++)Vk(e,a,k,f,v);if(!cn(g)||!wt(k))return o?_1:a;let b=`${k}__${a}`;x1(d)||(b=`${b}__${JSON.stringify(d)}`);let A=l.get(b);return A||(A=new Intl.DateTimeFormat(k,ko({},g,d)),l.set(b,A)),h?A.formatToParts(c):A.format(c)}const XM=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function cy(...e){const[t,n,o,s]=e,i=Fn();let r=Fn(),l;if(wt(t)){const a=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!a)throw zr(Wr.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 zr(Wr.INVALID_ISO_DATE_ARGUMENT)}}else if(OM(t)){if(isNaN(t.getTime()))throw zr(Wr.INVALID_DATE_ARGUMENT);l=t}else if(yo(t))l=t;else throw zr(Wr.INVALID_ARGUMENT);return wt(n)?i.key=n:cn(n)&&Object.keys(n).forEach(a=>{XM.includes(a)?r[a]=n[a]:i[a]=n[a]}),wt(o)?i.locale=o:cn(o)&&(r=o),cn(s)&&(r=s),[i.key||"",l,i,r]}function e_(e,t,n){const o=e;for(const s in n){const i=`${t}__${s}`;o.__datetimeFormatters.has(i)&&o.__datetimeFormatters.delete(i)}}function t_(e,...t){const{numberFormats:n,unresolving:o,fallbackLocale:s,onWarn:i,localeFallbacker:r}=e,{__numberFormatters:l}=e;if(!yo(t[0]))return rm;const[a,c,u,d]=uy(...t),f=mn(u.missingWarn)?u.missingWarn:e.missingWarn;mn(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const h=!!u.part,p=jk(e,u),m=r(e,s,p);if(!wt(a)||a===""){const I=new Intl.NumberFormat(p.replace(/!/g,""),d);return h?I.formatToParts(c):I.format(c)}let y={},k,g=null;const v="number format";for(let I=0;I<m.length&&(k=m[I],y=n[k]||{},g=y[a],!cn(g));I++)Vk(e,a,k,f,v);if(!cn(g)||!wt(k))return o?_1:a;let b=`${k}__${a}`;x1(d)||(b=`${b}__${JSON.stringify(d)}`);let A=l.get(b);return A||(A=new Intl.NumberFormat(k,ko({},g,d)),l.set(b,A)),h?A.formatToParts(c):A.format(c)}const QM=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function uy(...e){const[t,n,o,s]=e,i=Fn();let r=Fn();if(!yo(t))throw zr(Wr.INVALID_ARGUMENT);const l=t;return wt(n)?i.key=n:cn(n)&&Object.keys(n).forEach(a=>{QM.includes(a)?r[a]=n[a]:i[a]=n[a]}),wt(o)?i.locale=o:cn(o)&&(r=o),cn(s)&&(r=s),[i.key||"",l,i,r]}function n_(e,t,n){const o=e;for(const s in n){const i=`${t}__${s}`;o.__numberFormatters.has(i)&&o.__numberFormatters.delete(i)}}const f$=e=>e,h$=e=>"",p$="text",m$=e=>e.length===0?"":zk(e),g$=tL;function yg(e,t){return e=Math.abs(e),t===2?e===1?0:1:Math.min(e,2)}function v$(e){const t=yo(e.pluralIndex)?e.pluralIndex:-1;return yo(e.named?.count)?e.named.count:yo(e.named?.n)?e.named.n:t}function y$(e={}){const t=e.locale,n=v$(e),o=wt(t)&&Zn(e.pluralRules?.[t])?e.pluralRules[t]:yg,s=o===yg?void 0:yg,i=k=>k[o(n,k.length,s)],r=e.list||[],l=k=>r[k],a=e.named||Fn();yo(e.pluralIndex)&&(a.count||=e.pluralIndex,a.n||=e.pluralIndex);const c=k=>a[k];function u(k,g){const v=Zn(e.messages)?e.messages(k,!!g):gn(e.messages)?e.messages[k]:!1;return v||(e.parent?e.parent.message(k):h$)}const d=k=>e.modifiers?e.modifiers[k]:f$,f=Zn(e.processor?.normalize)?e.processor.normalize:m$,h=Zn(e.processor?.interpolate)?e.processor.interpolate:g$,p=wt(e.processor?.type)?e.processor.type:p$,y={list:l,named:c,plural:i,linked:(k,...g)=>{const[v,b]=g;let A="text",I="";g.length===1?gn(v)?(I=v.modifier||I,A=v.type||A):wt(v)&&(I=v||I):g.length===2&&(wt(v)&&(I=v||I),wt(b)&&(A=b||A));const T=u(k,!0)(y),M=T===""||T===void 0?k:T,$=A==="vnode"&&oo(M)&&I?M[0]:M;return I?d(I)($,A):$},message:u,type:p,interpolate:h,normalize:f,values:ko(Fn(),r,a)};return y}const o_=()=>"",xi=e=>Zn(e);function s_(e,...t){const{fallbackFormat:n,postTranslation:o,unresolving:s,messageCompiler:i,fallbackLocale:r,messages:l}=e,[a,c]=dy(...t),u=mn(c.missingWarn)?c.missingWarn:e.missingWarn,d=mn(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn,f=mn(c.escapeParameter)?c.escapeParameter:e.escapeParameter,h=!!c.resolvedMessage,p=wt(c.default)||mn(c.default)?mn(c.default)?i?a:()=>a:c.default:n?i?a:()=>a:null,m=n||p!=null&&(wt(p)||Zn(p)),y=jk(e,c);f&&k$(c);let[k,g,v]=h?[a,y,l[y]||Fn()]:JM(e,a,y,r,d,u),b=k,A=a;if(!h&&!(wt(b)||hr(b)||xi(b))&&m&&(b=p,A=b),!h&&(!(wt(b)||hr(b)||xi(b))||!wt(g)))return s?_1:a;let I=!1;const T=()=>{I=!0},M=xi(b)?b:e6(e,a,g,b,A,T);if(I)return b;const $=w$(e,g,v,c),N=y$($),F=b$(e,M,N);let S=o?o(F,a):F;if(f&&wt(S)&&(S=Q7(S)),__INTLIFY_PROD_DEVTOOLS__){const B={timestamp:Date.now(),key:wt(a)?a:xi(b)?b.key:"",locale:g||(xi(b)?b.locale:""),format:wt(b)?b:xi(b)?b.source:"",message:S};B.meta=ko({},e.__meta,l$()||{}),WL(B)}return S}function k$(e){oo(e.list)?e.list=e.list.map(t=>wt(t)?Ww(t):t):gn(e.named)&&Object.keys(e.named).forEach(t=>{wt(e.named[t])&&(e.named[t]=Ww(e.named[t]))})}function JM(e,t,n,o,s,i){const{messages:r,onWarn:l,messageResolver:a,localeFallbacker:c}=e,u=c(e,o,n);let d=Fn(),f,h=null;const p="translate";for(let m=0;m<u.length&&(f=u[m],d=r[f]||Fn(),(h=a(d,t))===null&&(h=d[t]),!(wt(h)||hr(h)||xi(h)));m++)if(!d$(f,u)){const y=Vk(e,t,f,i,p);y!==t&&(h=y)}return[h,f,d]}function e6(e,t,n,o,s,i){const{messageCompiler:r,warnHtmlMessage:l}=e;if(xi(o)){const c=o;return c.locale=c.locale||n,c.key=c.key||t,c}if(r==null){const c=(()=>o);return c.locale=n,c.key=t,c}const a=r(o,x$(e,n,s,o,l,i));return a.locale=n,a.key=t,a.source=o,a}function b$(e,t,n){return t(n)}function dy(...e){const[t,n,o]=e,s=Fn();if(!wt(t)&&!yo(t)&&!xi(t)&&!hr(t))throw zr(Wr.INVALID_ARGUMENT);const i=yo(t)?String(t):(xi(t),t);return yo(n)?s.plural=n:wt(n)?s.default=n:cn(n)&&!x1(n)?s.named=n:oo(n)&&(s.list=n),yo(o)?s.plural=o:wt(o)?s.default=o:cn(o)&&ko(s,o),[i,s]}function x$(e,t,n,o,s,i){return{locale:t,key:n,warnHtmlMessage:s,onError:r=>{throw i&&i(r),r},onCacheKey:r=>j7(t,n,r)}}function w$(e,t,n,o){const{modifiers:s,pluralRules:i,messageResolver:r,fallbackLocale:l,fallbackWarn:a,missingWarn:c,fallbackContext:u}=e,f={locale:t,modifiers:s,pluralRules:i,messages:(h,p)=>{let m=r(n,h);if(m==null&&(u||p)){const[y,,k]=JM(u||e,h,t,l,a,c);m=y??r(k,h)}if(wt(m)||hr(m)){let y=!1;const g=e6(e,h,t,m,h,()=>{y=!0});return y?o_:g}else return xi(m)?m:o_}};return e.processor&&(f.processor=e.processor),o.list&&(f.list=o.list),o.named&&(f.named=o.named),yo(o.plural)&&(f.pluralIndex=o.plural),f}EL();/*!
|
|
35
|
-
* vue-i18n v11.4.5
|
|
36
|
-
* (c) 2026 kazuya kawaguchi
|
|
37
|
-
* Released under the MIT License.
|
|
38
|
-
*/const _$="11.4.5";function S$(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(Ma().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(Ma().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Ma().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Ma().__INTLIFY_PROD_DEVTOOLS__=!1)}const gs={UNEXPECTED_RETURN_TYPE:UL,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 Fs(e,...t){return w1(e,null,void 0)}const fy=jl("__translateVNode"),hy=jl("__datetimeParts"),py=jl("__numberParts"),t6=jl("__setPluralRules"),n6=jl("__injectWithOption"),Uc=jl("__dispose");function cf(e){if(!gn(e)||hr(e))return e;for(const t in e)if(Si(e,t))if(!t.includes("."))gn(e[t])&&cf(e[t]);else{const n=t.split("."),o=n.length-1;let s=e,i=!1;for(let r=0;r<o;r++){if(n[r]==="__proto__")throw new Error(`unsafe key: ${n[r]}`);if(n[r]in s||(s[n[r]]=Fn()),!gn(s[n[r]])){i=!0;break}s=s[n[r]]}if(i||(hr(s)?jM.includes(n[o])||delete e[t]:(s[n[o]]=e[t],delete e[t])),!hr(s)){const r=s[n[o]];gn(r)&&cf(r)}}return e}function Kk(e,t){const{messages:n,__i18n:o,messageResolver:s,flatJson:i}=t,r=cn(n)?n:oo(o)?Fn():{[e]:Fn()};if(oo(o)&&o.forEach(l=>{if("locale"in l&&"resource"in l){const{locale:a,resource:c}=l;a?(r[a]=r[a]||Fn(),yp(c,r[a])):yp(c,r)}else wt(l)&&yp(JSON.parse(l),r)}),s==null&&i)for(const l in r)Si(r,l)&&cf(r[l]);return r}function o6(e){return e.type}function s6(e,t,n){let o=gn(t.messages)?t.messages:Fn();"__i18nGlobal"in n&&(o=Kk(e.locale.value,{messages:o,__i18n:n.__i18nGlobal}));const s=Object.keys(o);s.length&&s.forEach(i=>{e.mergeLocaleMessage(i,o[i])});{if(gn(t.datetimeFormats)){const i=Object.keys(t.datetimeFormats);i.length&&i.forEach(r=>{e.mergeDateTimeFormat(r,t.datetimeFormats[r])})}if(gn(t.numberFormats)){const i=Object.keys(t.numberFormats);i.length&&i.forEach(r=>{e.mergeNumberFormat(r,t.numberFormats[r])})}}}function i_(e){return fe(Il,null,e,0)}function uf(){return bo()}const r_="__INTLIFY_META__",l_=()=>[],C$=()=>!1;let a_=0;function c_(e){return((t,n,o,s)=>e(n,o,uf()||void 0,s))}const A$=()=>{const e=uf();let t=null;return e&&(t=o6(e)[r_])?{[r_]:t}:null};function lm(e={}){const{__root:t,__injectWithOption:n}=e,o=t===void 0,s=e.flatJson,i=im?ne:gr;let r=mn(e.inheritLocale)?e.inheritLocale:!0;const l=i(t&&r?t.locale.value:wt(e.locale)?e.locale:af),a=i(t&&r?t.fallbackLocale.value:wt(e.fallbackLocale)||oo(e.fallbackLocale)||cn(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:l.value),c=i(Kk(l.value,e)),u=i(cn(e.datetimeFormats)?e.datetimeFormats:{[l.value]:{}}),d=i(cn(e.numberFormats)?e.numberFormats:{[l.value]:{}});let f=t?t.missingWarn:mn(e.missingWarn)||vu(e.missingWarn)?e.missingWarn:!0,h=t?t.fallbackWarn:mn(e.fallbackWarn)||vu(e.fallbackWarn)?e.fallbackWarn:!0,p=t?t.fallbackRoot:mn(e.fallbackRoot)?e.fallbackRoot:!0,m=!!e.fallbackFormat,y=Zn(e.missing)?e.missing:null,k=Zn(e.missing)?c_(e.missing):null,g=Zn(e.postTranslation)?e.postTranslation:null,v=t?t.warnHtmlMessage:mn(e.warnHtmlMessage)?e.warnHtmlMessage:!0,b=!!e.escapeParameter;const A=t?t.modifiers:cn(e.modifiers)?e.modifiers:{};let I=e.pluralRules||t&&t.pluralRules,T;T=(()=>{o&&Xw(null);const ye={version:_$,locale:l.value,fallbackLocale:a.value,messages:c.value,modifiers:A,pluralRules:I,missing:k===null?void 0:k,missingWarn:f,fallbackWarn:h,fallbackFormat:m,unresolving:!0,postTranslation:g===null?void 0:g,warnHtmlMessage:v,escapeParameter:b,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};ye.datetimeFormats=u.value,ye.numberFormats=d.value,ye.__datetimeFormatters=cn(T)?T.__datetimeFormatters:void 0,ye.__numberFormatters=cn(T)?T.__numberFormatters:void 0;const be=c$(ye);return o&&Xw(be),be})(),sd(T,l.value,a.value);function $(){return[l.value,a.value,c.value,u.value,d.value]}const N=D({get:()=>l.value,set:ye=>{T.locale=ye,l.value=ye}}),F=D({get:()=>a.value,set:ye=>{T.fallbackLocale=ye,a.value=ye,sd(T,l.value,ye)}}),S=D(()=>c.value),B=D(()=>u.value),W=D(()=>d.value);function z(){return Zn(g)?g:null}function L(ye){g=ye,T.postTranslation=ye}function O(){return y}function j(ye){ye!==null&&(k=c_(ye)),y=ye,T.missing=k}const Z=(ye,be,Ge,tt,rt,ut)=>{$();let vt;try{__INTLIFY_PROD_DEVTOOLS__,o||(T.fallbackContext=t?a$():void 0),vt=ye(T)}finally{__INTLIFY_PROD_DEVTOOLS__,o||(T.fallbackContext=void 0)}if(Ge!=="translate exists"&&yo(vt)&&vt===_1||Ge==="translate exists"&&!vt){const[Nt,_t]=be();return t&&p?tt(t):rt(Nt)}else{if(ut(vt))return vt;throw Fs(gs.UNEXPECTED_RETURN_TYPE)}};function ie(...ye){return Z(be=>Reflect.apply(s_,null,[be,...ye]),()=>dy(...ye),"translate",be=>Reflect.apply(be.t,be,[...ye]),be=>be,be=>wt(be))}function U(...ye){const[be,Ge,tt]=ye;if(tt&&!gn(tt))throw Fs(gs.INVALID_ARGUMENT);return ie(be,Ge,ko({resolvedMessage:!0},tt||{}))}function q(...ye){return Z(be=>Reflect.apply(Jw,null,[be,...ye]),()=>cy(...ye),"datetime format",be=>Reflect.apply(be.d,be,[...ye]),()=>rm,be=>wt(be)||oo(be))}function ee(...ye){return Z(be=>Reflect.apply(t_,null,[be,...ye]),()=>uy(...ye),"number format",be=>Reflect.apply(be.n,be,[...ye]),()=>rm,be=>wt(be)||oo(be))}function le(ye){return ye.map(be=>wt(be)||yo(be)||mn(be)?i_(String(be)):be)}const re={normalize:le,interpolate:ye=>ye,type:"vnode"};function we(...ye){return Z(be=>{let Ge;const tt=be;try{tt.processor=re,Ge=Reflect.apply(s_,null,[tt,...ye])}finally{tt.processor=null}return Ge},()=>dy(...ye),"translate",be=>be[fy](...ye),be=>[i_(be)],be=>oo(be))}function me(...ye){return Z(be=>Reflect.apply(t_,null,[be,...ye]),()=>uy(...ye),"number format",be=>be[py](...ye),l_,be=>wt(be)||oo(be))}function Ee(...ye){return Z(be=>Reflect.apply(Jw,null,[be,...ye]),()=>cy(...ye),"datetime format",be=>be[hy](...ye),l_,be=>wt(be)||oo(be))}function ae(ye){I=ye,T.pluralRules=I}function Y(ye,be){return Z(()=>{if(!ye)return!1;const Ge=wt(be)?be:l.value,tt=wt(be)?[Ge]:ay(T,a.value,Ge);for(let rt=0;rt<tt.length;rt++){const ut=G(tt[rt]);let vt=T.messageResolver(ut,ye);if(vt===null&&(vt=ut[ye]),hr(vt)||xi(vt)||wt(vt))return!0}return!1},()=>[ye],"translate exists",Ge=>Reflect.apply(Ge.te,Ge,[ye,be]),C$,Ge=>mn(Ge))}function Q(ye){let be=null;const Ge=ay(T,a.value,l.value);for(let tt=0;tt<Ge.length;tt++){const rt=c.value[Ge[tt]]||{},ut=T.messageResolver(rt,ye);if(ut!=null){be=ut;break}}return be}function P(ye){const be=Q(ye);return be??(t?t.tm(ye)||{}:{})}function G(ye){return c.value[ye]||{}}function pe(ye,be){if(s){const Ge={[ye]:be};for(const tt in Ge)Si(Ge,tt)&&cf(Ge[tt]);be=Ge[ye]}c.value[ye]=be,T.messages=c.value}function ve(ye,be){c.value[ye]=c.value[ye]||{};const Ge={[ye]:be};if(s)for(const tt in Ge)Si(Ge,tt)&&cf(Ge[tt]);be=Ge[ye],yp(be,c.value[ye]),T.messages=c.value}function de(ye){return u.value[ye]||{}}function V(ye,be){u.value[ye]=be,T.datetimeFormats=u.value,e_(T,ye,be)}function se(ye,be){u.value[ye]=ko(u.value[ye]||{},be),T.datetimeFormats=u.value,e_(T,ye,be)}function he(ye){return d.value[ye]||{}}function ke(ye,be){d.value[ye]=be,T.numberFormats=d.value,n_(T,ye,be)}function Te(ye,be){d.value[ye]=ko(d.value[ye]||{},be),T.numberFormats=d.value,n_(T,ye,be)}a_++,t&&im&&(et(t.locale,ye=>{r&&(l.value=ye,T.locale=ye,sd(T,l.value,a.value))}),et(t.fallbackLocale,ye=>{r&&(a.value=ye,T.fallbackLocale=ye,sd(T,l.value,a.value))}));const ze={id:a_,locale:N,fallbackLocale:F,get inheritLocale(){return r},set inheritLocale(ye){r=ye,ye&&t&&(l.value=t.locale.value,a.value=t.fallbackLocale.value,sd(T,l.value,a.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:S,get modifiers(){return A},get pluralRules(){return I||{}},get isGlobal(){return o},get missingWarn(){return f},set missingWarn(ye){f=ye,T.missingWarn=f},get fallbackWarn(){return h},set fallbackWarn(ye){h=ye,T.fallbackWarn=h},get fallbackRoot(){return p},set fallbackRoot(ye){p=ye},get fallbackFormat(){return m},set fallbackFormat(ye){m=ye,T.fallbackFormat=m},get warnHtmlMessage(){return v},set warnHtmlMessage(ye){v=ye,T.warnHtmlMessage=ye},get escapeParameter(){return b},set escapeParameter(ye){b=ye,T.escapeParameter=ye},t:ie,getLocaleMessage:G,setLocaleMessage:pe,mergeLocaleMessage:ve,getPostTranslationHandler:z,setPostTranslationHandler:L,getMissingHandler:O,setMissingHandler:j,[t6]:ae};return ze.datetimeFormats=B,ze.numberFormats=W,ze.rt=U,ze.te=Y,ze.tm=P,ze.d=q,ze.n=ee,ze.getDateTimeFormat=de,ze.setDateTimeFormat=V,ze.mergeDateTimeFormat=se,ze.getNumberFormat=he,ze.setNumberFormat=ke,ze.mergeNumberFormat=Te,ze[n6]=n,ze[fy]=we,ze[hy]=Ee,ze[py]=me,ze}function M$(e){const t=wt(e.locale)?e.locale:af,n=wt(e.fallbackLocale)||oo(e.fallbackLocale)||cn(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,o=Zn(e.missing)?e.missing:void 0,s=mn(e.silentTranslationWarn)||vu(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,i=mn(e.silentFallbackWarn)||vu(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,r=mn(e.fallbackRoot)?e.fallbackRoot:!0,l=!!e.formatFallbackMessages,a=cn(e.modifiers)?e.modifiers:{},c=e.pluralizationRules,u=Zn(e.postTranslation)?e.postTranslation:void 0,d=wt(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,f=!!e.escapeParameterHtml,h=mn(e.sync)?e.sync:!0;let p=e.messages;if(cn(e.sharedMessages)){const A=e.sharedMessages;p=Object.keys(A).reduce((T,M)=>{const $=T[M]||(T[M]={});return ko($,A[M]),T},p||{})}const{__i18n:m,__root:y,__injectWithOption:k}=e,g=e.datetimeFormats,v=e.numberFormats,b=e.flatJson;return{locale:t,fallbackLocale:n,messages:p,flatJson:b,datetimeFormats:g,numberFormats:v,missing:o,missingWarn:s,fallbackWarn:i,fallbackRoot:r,fallbackFormat:l,modifiers:a,pluralRules:c,postTranslation:u,warnHtmlMessage:d,escapeParameter:f,messageResolver:e.messageResolver,inheritLocale:h,__i18n:m,__root:y,__injectWithOption:k}}function my(e={}){const t=lm(M$(e)),{__extender:n}=e,o={id:t.id,get locale(){return t.locale.value},set locale(s){t.locale.value=s},get fallbackLocale(){return t.fallbackLocale.value},set fallbackLocale(s){t.fallbackLocale.value=s},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(s){t.setMissingHandler(s)},get silentTranslationWarn(){return mn(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(s){t.missingWarn=mn(s)?!s:s},get silentFallbackWarn(){return mn(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(s){t.fallbackWarn=mn(s)?!s:s},get modifiers(){return t.modifiers},get formatFallbackMessages(){return t.fallbackFormat},set formatFallbackMessages(s){t.fallbackFormat=s},get postTranslation(){return t.getPostTranslationHandler()},set postTranslation(s){t.setPostTranslationHandler(s)},get sync(){return t.inheritLocale},set sync(s){t.inheritLocale=s},get warnHtmlInMessage(){return t.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(s){t.warnHtmlMessage=s!=="off"},get escapeParameterHtml(){return t.escapeParameter},set escapeParameterHtml(s){t.escapeParameter=s},get pluralizationRules(){return t.pluralRules||{}},__composer:t,t(...s){return Reflect.apply(t.t,t,[...s])},rt(...s){return Reflect.apply(t.rt,t,[...s])},te(s,i){return t.te(s,i)},tm(s){return t.tm(s)},getLocaleMessage(s){return t.getLocaleMessage(s)},setLocaleMessage(s,i){t.setLocaleMessage(s,i)},mergeLocaleMessage(s,i){t.mergeLocaleMessage(s,i)},d(...s){return Reflect.apply(t.d,t,[...s])},getDateTimeFormat(s){return t.getDateTimeFormat(s)},setDateTimeFormat(s,i){t.setDateTimeFormat(s,i)},mergeDateTimeFormat(s,i){t.mergeDateTimeFormat(s,i)},n(...s){return Reflect.apply(t.n,t,[...s])},getNumberFormat(s){return t.getNumberFormat(s)},setNumberFormat(s,i){t.setNumberFormat(s,i)},mergeNumberFormat(s,i){t.mergeNumberFormat(s,i)}};return o.__extender=n,o}function E$(e,t,n){return{beforeCreate(){const o=uf();if(!o)throw Fs(gs.UNEXPECTED_ERROR);const s=this.$options;if(s.i18n){const i=s.i18n;if(s.__i18n&&(i.__i18n=s.__i18n),i.__root=t,this===this.$root)this.$i18n=u_(e,i);else{i.__injectWithOption=!0,i.__extender=n.__vueI18nExtend,this.$i18n=my(i);const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}}else if(s.__i18n)if(this===this.$root)this.$i18n=u_(e,s);else{this.$i18n=my({__i18n:s.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:t});const i=this.$i18n;i.__extender&&(i.__disposer=i.__extender(this.$i18n))}else this.$i18n=e;s.__i18nGlobal&&s6(t,s,s),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(o,this.$i18n)},mounted(){},unmounted(){const o=uf();if(!o)throw Fs(gs.UNEXPECTED_ERROR);const s=this.$i18n;delete this.$t,delete this.$rt,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,s.__disposer&&(s.__disposer(),delete s.__disposer,delete s.__extender),n.__deleteInstance(o),delete this.$i18n}}}function u_(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[t6](t.pluralizationRules||e.pluralizationRules);const n=Kk(e.locale,{messages:t.messages,__i18n:t.__i18n});return Object.keys(n).forEach(o=>e.mergeLocaleMessage(o,n[o])),t.datetimeFormats&&Object.keys(t.datetimeFormats).forEach(o=>e.mergeDateTimeFormat(o,t.datetimeFormats[o])),t.numberFormats&&Object.keys(t.numberFormats).forEach(o=>e.mergeNumberFormat(o,t.numberFormats[o])),e}const Gk={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function T$({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((o,s)=>[...o,...s.type===Pe?s.children:[s]],[]):t.reduce((n,o)=>{const s=e[o];return s&&(n[o]=s()),n},Fn())}function i6(){return Pe}const N$=Qe({name:"i18n-t",props:ko({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>yo(e)||!isNaN(e)}},Gk),setup(e,t){const{slots:n,attrs:o}=t,s=e.i18n||Ot({useScope:e.scope,__useComponent:!0});return()=>{const i=()=>{const a=Object.keys(n).filter(d=>d[0]!=="_"),c=Fn();e.locale&&(c.locale=e.locale),e.plural!==void 0&&(c.plural=wt(e.plural)?+e.plural:e.plural);const u=T$(t,a);return s[fy](e.keypath,u,c)},r=ko(Fn(),o),l=wt(e.tag)||gn(e.tag)?e.tag:i6();return gn(l)?Ft(l,r,{default:i}):Ft(l,r,i())}}}),d_=N$;function I$(e){return oo(e)&&!wt(e[0])}function r6(e,t,n,o){const{slots:s,attrs:i}=t;return()=>{const r=()=>{const c={part:!0};let u=Fn();e.locale&&(c.locale=e.locale),wt(e.format)?c.key=e.format:gn(e.format)&&(wt(e.format.key)&&(c.key=e.format.key),u=Object.keys(e.format).reduce((h,p)=>n.includes(p)?ko(Fn(),h,{[p]:e.format[p]}):h,Fn()));const d=o(e.value,c,u);let f=[c.key];return oo(d)?f=d.map((h,p)=>{const m=s[h.type],y=m?m({[h.type]:h.value,index:p,parts:d}):[h.value];return I$(y)&&(y[0].key=`${h.type}-${p}`),y}):wt(d)&&(f=[d]),f},l=ko(Fn(),i),a=wt(e.tag)||gn(e.tag)?e.tag:i6();return gn(a)?Ft(a,l,{default:r}):Ft(a,l,r())}}const L$=Qe({name:"i18n-n",props:ko({value:{type:Number,required:!0},format:{type:[String,Object]}},Gk),setup(e,t){const n=e.i18n||Ot({useScope:e.scope,__useComponent:!0});return r6(e,t,QM,(...o)=>n[py](...o))}}),f_=L$;function $$(e,t){const n=e;if(e.mode==="composition")return n.__getInstance(t)||e.global;{const o=n.__getInstance(t);return o!=null?o.__composer:e.global.__composer}}function F$(e){const t=r=>{const{instance:l,value:a}=r;if(!l||!l.$)throw Fs(gs.UNEXPECTED_ERROR);const c=$$(e,l.$),u=h_(a);return[Reflect.apply(c.t,c,[...p_(u)]),c]};return{created:(r,l)=>{const[a,c]=t(l);im&&(r.__i18nWatcher=et(c.locale,()=>{l.instance&&l.instance.$forceUpdate()})),r.__composer=c,r.textContent=a},unmounted:r=>{im&&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=h_(l);r.textContent=Reflect.apply(a.t,a,[...p_(c)])}},getSSRProps:r=>{const[l]=t(r);return{textContent:l}}}}function h_(e){if(wt(e))return{path:e};if(cn(e)){if(!("path"in e))throw Fs(gs.REQUIRED_VALUE,"path");return e}else throw Fs(gs.INVALID_VALUE)}function p_(e){const{path:t,locale:n,args:o,choice:s,plural:i}=e,r={},l=o||{};return wt(n)&&(r.locale=n),yo(s)&&(r.plural=s),yo(i)&&(r.plural=i),[t,l,r]}function O$(e,t,...n){const o=cn(n[0])?n[0]:{};(mn(o.globalInstall)?o.globalInstall:!0)&&([d_.name,"I18nT"].forEach(i=>e.component(i,d_)),[f_.name,"I18nN"].forEach(i=>e.component(i,f_)),[v_.name,"I18nD"].forEach(i=>e.component(i,v_))),e.directive("t",F$(t))}const R$=jl("global-vue-i18n");function B$(e={}){const t=__VUE_I18N_LEGACY_API__&&mn(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,n=mn(e.globalInjection)?e.globalInjection:!0,o=new Map,[s,i]=D$(e,t),r=jl("");function l(d){return o.get(d)||null}function a(d,f){o.set(d,f)}function c(d){o.delete(d)}const u={get mode(){return __VUE_I18N_LEGACY_API__&&t?"legacy":"composition"},async install(d,...f){if(d.__VUE_I18N_SYMBOL__=r,d.provide(d.__VUE_I18N_SYMBOL__,u),cn(f[0])){const m=f[0];u.__composerExtend=m.__composerExtend,u.__vueI18nExtend=m.__vueI18nExtend}let h=null;!t&&n&&(h=j$(d,u.global)),__VUE_I18N_FULL_INSTALL__&&O$(d,u,...f),__VUE_I18N_LEGACY_API__&&t&&d.mixin(E$(i,i.__composer,u));const p=d.unmount;d.unmount=()=>{h&&h(),u.dispose(),p()}},get global(){return i},dispose(){s.stop()},__instances:o,__getInstance:l,__setInstance:a,__deleteInstance:c};return u}function Ot(e={}){const t=uf();if(t==null)throw Fs(gs.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw Fs(gs.NOT_INSTALLED);const n=P$(t),o=W$(n),s=o6(t),i=H$(e,s);if(i==="global")return s6(o,e,s),o;if(i==="parent"){let a=m_(n,t,e.__useComponent);return a==null&&(a=o),a}if(i==="isolated"){if(n.mode!=="composition")throw Fs(gs.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const a=n,c=ko({},e),u=m_(n,t);c.__root=u||o;const d=lm(c);return a.__composerExtend&&(d[Uc]=a.__composerExtend(d)),wk()&&Mf(()=>{const h=d[Uc];h&&(h(),delete d[Uc])}),d}const r=n;let l=r.__getInstance(t);if(l==null){const a=ko({},e);"__i18n"in s&&(a.__i18n=s.__i18n),o&&(a.__root=o),l=lm(a),r.__composerExtend&&(l[Uc]=r.__composerExtend(l)),U$(r,t,l),r.__setInstance(t,l)}return l}function D$(e,t){const n=d9(),o=__VUE_I18N_LEGACY_API__&&t?n.run(()=>my(e)):n.run(()=>lm(e));if(o==null)throw Fs(gs.UNEXPECTED_ERROR);return[n,o]}function P$(e){const t=Jt(e.isCE?R$:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw Fs(e.isCE?gs.NOT_INSTALLED_WITH_PROVIDE:gs.UNEXPECTED_ERROR);return t}function H$(e,t){return x1(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function W$(e){return e.mode==="composition"?e.global:e.global.__composer}function m_(e,t,n=!1){let o=null;const s=t.root;let i=z$(t,n);for(;i!=null;){const r=e;if(e.mode==="composition")o=r.__getInstance(i);else if(__VUE_I18N_LEGACY_API__){const l=r.__getInstance(i);l!=null&&(o=l.__composer,n&&o&&!o[n6]&&(o=null))}if(o!=null||s===i)break;i=i.parent}return o}function z$(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function U$(e,t,n){wn(()=>{},t),In(()=>{const o=n;e.__deleteInstance(t);const s=o[Uc];s&&(s(),delete o[Uc])},t)}const q$=["locale","fallbackLocale","availableLocales"],g_=["t","rt","d","n","tm","te"];function j$(e,t){const n=Object.create(null);return q$.forEach(s=>{const i=Object.getOwnPropertyDescriptor(t,s);if(!i)throw Fs(gs.UNEXPECTED_ERROR);const r=co(i.value)?{get(){return i.value.value},set(l){i.value.value=l}}:{get(){return i.get&&i.get()}};Object.defineProperty(n,s,r)}),e.config.globalProperties.$i18n=n,g_.forEach(s=>{const i=Object.getOwnPropertyDescriptor(t,s);if(!i||!i.value)throw Fs(gs.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${s}`,i)}),()=>{delete e.config.globalProperties.$i18n,g_.forEach(s=>{delete e.config.globalProperties[`$${s}`]})}}const V$=Qe({name:"i18n-d",props:ko({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},Gk),setup(e,t){const n=e.i18n||Ot({useScope:e.scope,__useComponent:!0});return r6(e,t,XM,(...o)=>n[hy](...o))}}),v_=V$;S$();o$(DL);s$(e$);i$(ay);if(__INTLIFY_PROD_DEVTOOLS__){const e=Ma();e.__INTLIFY__=!0,PL(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const K$="modulepreload",G$=function(e){return"/"+e},y_={},ps=function(t,n,o){let s=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");s=r(n.map(c=>{if(c=G$(c),c in y_)return;y_[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":K$,u||(f.as="script"),f.crossOrigin="",f.href=c,a&&f.setAttribute("nonce",a),document.head.appendChild(f),u)return new Promise((h,p)=>{f.addEventListener("load",h),f.addEventListener("error",()=>p(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 s.then(r=>{for(const l of r||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})};async function Xo(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 Z$(e)}function Y$(e){if(typeof e!="string")return;const t=typeof navigator<"u"?navigator.clipboard:void 0;t&&typeof t.writeText=="function"||Xo(e)}function Z$(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}const Ht={permission:"dimi-web.permission",activeWorkspace:"dimi-active-workspace",planMode:"dimi-web.plan-mode",swarmMode:"dimi-web.swarm-mode",goalMode:"dimi-web.goal-mode",uiFontSize:"dimi-web.ui-font-size",starredModels:"dimi-web.starred-models",unread:"dimi-web.unread",onboarded:"dimi-web.onboarded",accent:"dimi-web.accent",colorScheme:"dimi-web.color-scheme",hiddenWorkspaces:"dimi-web.hidden-workspaces",collapsedWorkspaces:"dimi-web.collapsed-workspaces",workspaceOrder:"dimi-web.workspace-order",workspaceNameOverrides:"dimi-web.workspace-name-overrides",workspaceSort:"dimi-web.workspace-sort",conversationToc:"dimi-web.beta-toc",notifyOnComplete:"dimi-web.notify-on-complete",notifyOnQuestion:"dimi-web.notify-on-question",notifyOnApproval:"dimi-web.notify-on-approval",soundOnComplete:"dimi-web.sound-on-complete",inputHistory:"dimi-web.input-history",locale:"dimi-locale",clientId:"dimi-web.client-id",debug:"dimi-web.debug",openInLastTarget:"dimi-web.open-in.last-target",sidebarCollapsed:"dimi-web.sidebar-collapsed",sidebarWidth:"dimi-web.sidebar-width",codeFont:"dimi-web.code-font",contentAlign:"dimi-web.content-align",theme:"dimi-web.theme",thinking:"dimi-web.thinking"};function k_(e){return`dimi-web.draft.${e&&e.length>0?e:"__new__"}`}function uo(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function xo(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function qa(e){try{globalThis.localStorage.removeItem(e)}catch{}}function S1(e){const t=uo(e);if(t===null)return null;try{return JSON.parse(t)}catch{return null}}function $f(e,t){try{globalThis.localStorage.setItem(e,JSON.stringify(t))}catch{}}function Yk(){const e=uo(Ht.unread);if(!e)return{};try{const t=JSON.parse(e);if(!t||typeof t!="object")return{};const n={};for(const[o,s]of Object.entries(t))s===!0&&(n[o]=!0);return n}catch{return{}}}function Zk(e){const n={...Yk()};for(const[o,s]of Object.entries(e))s?n[o]=!0:delete n[o];xo(Ht.unread,JSON.stringify(n))}function X$(){const e=S1(Ht.collapsedWorkspaces);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function kg(e){$f(Ht.collapsedWorkspaces,Array.from(e))}function Q$(){const e=S1(Ht.workspaceOrder);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function l6(e){$f(Ht.workspaceOrder,Array.from(e))}function Rh(){const e=S1(Ht.workspaceNameOverrides);if(!e||typeof e!="object")return{};const t={};for(const[n,o]of Object.entries(e))typeof o=="string"&&(t[n]=o);return t}function b_(e){$f(Ht.workspaceNameOverrides,e)}function J$(){return uo(Ht.workspaceSort)}function a6(e){xo(Ht.workspaceSort,e)}function eF(e,t){if(e.length===0)return null;const n=new Set(e),o=t.filter(i=>n.has(i)),s=e.filter(i=>!t.includes(i));return s.length===0&&o.length===t.length?null:[...s,...o]}function tF(e,t){const n=new Map(t.map((o,s)=>[o,s]));return e.toSorted((o,s)=>(n.get(o.id)??-1)-(n.get(s.id)??-1))}function nF(e,t,n,o="before"){const s=e.indexOf(t),i=e.indexOf(n);if(s===-1||i===-1||s===i)return e;const r=[...e];r.splice(s,1);const l=s<i?i-1:i,a=o==="before"?l:l+1;return r.splice(a,0,t),r}function oF(e,t){return e.toSorted((n,o)=>(t.get(o.id)??Number.NEGATIVE_INFINITY)-(t.get(n.id)??Number.NEGATIVE_INFINITY))}const sF={"&":"&","<":"<",">":">",'"':""","'":"'"};function x_(e){return e.replace(/[&<>"']/g,t=>sF[t]??t)}function iF(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function rF(e,t,n=40){const o=e.replace(/\s+/g," ").trim();if(o.length===0)return"";const s=t.trim();if(s.length===0)return w_(o,n*2);const i=o.toLowerCase().indexOf(s.toLowerCase());if(i<0)return w_(o,n*2);const r=Math.max(0,i-n),l=Math.min(o.length,i+s.length+n),a=r>0,c=l<o.length;return`${a?"…":""}${o.slice(r,l)}${c?"…":""}`}function w_(e,t){return e.length<=t?e:`${e.slice(0,t)}…`}function bg(e,t){const n=x_(e),o=t.trim();if(o.length===0)return n;const s=new RegExp(iF(x_(o)),"gi");return n.replace(s,i=>`<mark>${i}</mark>`)}const Rc=ne(0),lF=["type","disabled","aria-label"],aF=Qe({__name:"IconButton",props:{size:{default:"md"},disabled:{type:Boolean},label:{},type:{default:"button"}},setup(e,{expose:t}){const n=ne();return t({el:n}),(o,s)=>(x(),E("button",{ref_key:"el",ref:n,class:We(["ui-icon-button",`ui-icon-button--${e.size}`]),type:e.type,disabled:e.disabled,"aria-label":e.label},[zn(o.$slots,"default",{},void 0,!0)],10,lF))}}),ft=(e,t)=>{const n=e.__vccOpts||e;for(const[o,s]of t)n[o]=s;return n},Kn=ft(aF,[["__scopeId","data-v-cf3e49cd"]]),cF={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function uF(e,t){return x(),E("svg",cF,[...t[0]||(t[0]=[_("path",{d:"M11.1 12.9001V15.0909C11.1 15.593 11.5029 16 12 16C12.4971 16 12.9 15.593 12.9 15.0909V12.9001H15.0909C15.593 12.9001 16 12.4972 16 12.0001C16 11.5031 15.593 11.1001 15.0909 11.1001H12.9V8.90909C12.9 8.40701 12.4971 8 12 8C11.5029 8 11.1 8.40701 11.1 8.90909V11.1001H8.90909C8.40701 11.1001 8 11.5031 8 12.0001C8 12.4972 8.40701 12.9001 8.90909 12.9001H11.1Z",fill:"currentColor"},null,-1),_("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.9996 2.1001C6.53199 2.1001 2.09961 6.53248 2.09961 12.0001C2.09961 13.9226 2.64847 15.7192 3.59804 17.2391L2.517 19.8207C2.10313 20.8091 2.82908 21.9001 3.90059 21.9001H11.9996C17.4672 21.9001 21.8996 17.4677 21.8996 12.0001C21.8996 6.53248 17.4672 2.1001 11.9996 2.1001ZM3.89961 12.0001C3.89961 7.52659 7.5261 3.9001 11.9996 3.9001C16.4731 3.9001 20.0996 7.52659 20.0996 12.0001C20.0996 16.4736 16.4724 20.1001 11.9989 20.1001H4.35146L5.63494 17.0351L5.35165 16.6291C4.43632 15.3172 3.89961 13.7227 3.89961 12.0001Z",fill:"currentColor"},null,-1)])])}const dF=yt({name:"dimi-add-conversation",render:uF}),fF={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function hF(e,t){return x(),E("svg",fF,[...t[0]||(t[0]=[_("path",{d:"M9.2373 3.7002C10.4169 3.7002 11.5297 4.24779 12.249 5.18262L12.4424 5.43359H18C20.0987 5.43359 21.7998 7.13472 21.7998 9.2334V16.5C21.7998 18.5987 20.0987 20.2998 18 20.2998H6C3.90132 20.2998 2.2002 18.5987 2.2002 16.5V7.5C2.2002 5.40132 3.90132 3.7002 6 3.7002H9.2373ZM6 5.5C4.89543 5.5 4 6.39543 4 7.5V16.5C4 17.6046 4.89543 18.5 6 18.5H18C19.0357 18.5 19.887 17.7128 19.9893 16.7041L20 16.5V9.2334C20 8.19775 19.2128 7.34641 18.2041 7.24414L18 7.2334H12.0479L11.9326 7.22656C11.666 7.19561 11.4205 7.05812 11.2549 6.84277L10.8223 6.28027C10.4437 5.78834 9.85808 5.5 9.2373 5.5H6ZM16 9.59961C16.4971 9.59961 16.9004 10.0029 16.9004 10.5C16.9004 10.9971 16.4971 11.4004 16 11.4004H8C7.50294 11.4004 7.09961 10.9971 7.09961 10.5C7.09961 10.0029 7.50294 9.59961 8 9.59961H16Z",fill:"currentColor"},null,-1)])])}const pF=yt({name:"dimi-folder",render:hF}),mF={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},gF=["clip-path"],vF=["id"];function yF(e,t){return x(),E("svg",mF,[_("g",{"clip-path":"url(#"+e.idMap.clip0_4626_2033+")"},[...t[0]||(t[0]=[_("path",{d:"M18.3623 9.99976L18.209 8.48999C18.2031 8.43161 18.2004 8.37289 18.2002 8.31421C18.1988 8.31196 18.1956 8.30842 18.1904 8.30347C18.1718 8.28559 18.1302 8.26245 18.0713 8.26245H11C10.261 8.26245 9.59753 7.81016 9.32617 7.1228L8.9082 6.06421C8.88101 5.9953 8.85737 5.92501 8.83887 5.85327C8.83778 5.85099 8.833 5.84268 8.81836 5.83179C8.79454 5.81475 8.7549 5.79939 8.70605 5.80054H3.92871C3.86986 5.80054 3.82825 5.82368 3.80957 5.84155C3.80816 5.8429 3.80675 5.84428 3.80566 5.84546L4.47559 14.0955L3.62109 17.5154L5.12109 11.5154C5.34367 10.6251 6.1438 9.99977 7.06152 9.99976H18.3623ZM7.06152 11.7996C6.96976 11.7996 6.88944 11.8629 6.86719 11.9519L5.36719 17.9519C5.33598 18.078 5.43158 18.1999 5.56152 18.2H19.4385C19.5302 18.1999 19.6106 18.1376 19.6328 18.0486L21.1328 12.0486C21.1644 11.9224 21.0686 11.7996 20.9385 11.7996H7.06152ZM20.9385 9.99976C22.2396 9.99977 23.1945 11.2228 22.8789 12.4851L21.3789 18.4851C21.1563 19.3754 20.3562 19.9997 19.4385 19.9998H4.92871C4.41722 19.9998 3.92613 19.8059 3.56445 19.4597C3.20281 19.1135 3.00004 18.6436 3 18.1541L2 5.84644C2.00006 5.35711 2.20311 4.88786 2.56445 4.54175C2.92613 4.19554 3.41722 4.00073 3.92871 4.00073H8.66406C9.10133 3.99051 9.5296 4.1225 9.87793 4.37573C10.2285 4.63118 10.4767 4.99457 10.582 5.40405L11 6.46167H18.0713C18.5828 6.46167 19.0739 6.65648 19.4355 7.00269C19.7971 7.34888 20 7.81883 20 8.30835L20.1719 9.99976H20.9385Z",fill:"currentColor"},null,-1)])],8,gF),_("defs",null,[_("clipPath",{id:e.idMap.clip0_4626_2033},[...t[1]||(t[1]=[_("rect",{width:"24",height:"24",fill:"white"},null,-1)])],8,vF)])])}const kF=yt({name:"dimi-folder-open",render:yF,setup(){return{idMap:{clip0_4626_2033:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),bF={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function xF(e,t){return x(),E("svg",bF,[...t[0]||(t[0]=[_("path",{d:"M6 12C6 12.8283 5.32834 13.5 4.5 13.5C3.67166 13.5 3 12.8283 3 12C3 11.1717 3.67166 10.5 4.5 10.5C5.32834 10.5 6 11.1717 6 12Z",fill:"currentColor"},null,-1),_("path",{d:"M13.5 12C13.5 12.8283 12.8283 13.5 12 13.5C11.1717 13.5 10.5 12.8283 10.5 12C10.5 11.1717 11.1717 10.5 12 10.5C12.8283 10.5 13.5 11.1717 13.5 12Z",fill:"currentColor"},null,-1),_("path",{d:"M19.5002 13.5C20.3287 13.5 21 12.8287 21 12.0002C21 11.1718 20.3287 10.5 19.5002 10.5C18.6718 10.5 18 11.1718 18 12.0002C18 12.8287 18.6718 13.5 19.5002 13.5Z",fill:"currentColor"},null,-1)])])}const wF=yt({name:"dimi-more",render:xF}),_F={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function SF(e,t){return x(),E("svg",_F,[...t[0]||(t[0]=[_("path",{d:"M11.5 3C16.1944 3 20 6.80558 20 11.5C20 13.523 19.2933 15.381 18.1132 16.8404L21.1364 19.8636C21.4879 20.2151 21.4879 20.7849 21.1364 21.1364C20.7849 21.4879 20.2151 21.4879 19.8636 21.1364L16.8404 18.1132C15.381 19.2933 13.523 20 11.5 20C6.80558 20 3 16.1944 3 11.5C3 6.80558 6.80558 3 11.5 3ZM11.5 18.2C15.2003 18.2 18.2 15.2003 18.2 11.5C18.2 7.79969 15.2003 4.8 11.5 4.8C7.79969 4.8 4.8 7.79969 4.8 11.5C4.8 15.2003 7.79969 18.2 11.5 18.2Z",fill:"currentColor"},null,-1)])])}const CF=yt({name:"dimi-search",render:SF}),AF={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function MF(e,t){return x(),E("svg",AF,[...t[0]||(t[0]=[_("path",{d:"M16.0404 12C16.0404 9.76874 14.2313 7.9596 12.0001 7.9596C9.76883 7.9596 7.95972 9.76874 7.95972 12C7.95972 14.2313 9.76883 16.0404 12.0001 16.0404C14.2313 16.0404 16.0404 14.2313 16.0404 12ZM14.2222 12C14.2222 13.2271 13.2271 14.2222 12 14.2222C10.7729 14.2222 9.77783 13.2271 9.77783 12C9.77783 10.7729 10.7729 9.77778 12 9.77778C13.2271 9.77778 14.2222 10.7729 14.2222 12Z",fill:"currentColor"},null,-1),_("path",{d:"M9.91145 21.8009C9.29001 21.6797 8.76914 21.2612 8.50632 20.6922L8.07372 19.7556C7.88838 19.3544 7.43553 19.1048 6.95371 19.1549L5.89572 19.2647C5.2733 19.3293 4.64823 19.114 4.22298 18.6611C3.74343 18.1504 3.32454 17.6037 2.97033 17.0181C2.61571 16.4318 2.32839 15.8106 2.10407 15.1566C1.89769 14.5549 2.02148 13.8954 2.4089 13.3902L3.0376 12.5704C3.30043 12.2277 3.30042 11.7722 3.03758 11.4295L2.40413 10.6035C2.01474 10.0958 1.891 9.43198 2.10208 8.82826C2.55037 7.54612 3.27017 6.35997 4.22 5.34259C4.64518 4.8872 5.27275 4.67067 5.89701 4.73544L6.95383 4.84514C7.43561 4.89515 7.88844 4.6456 8.07377 4.24441L8.50266 3.31593C8.76494 2.74818 9.28448 2.33019 9.90423 2.20761C11.2916 1.9332 12.7148 1.93127 14.0885 2.19913C14.7099 2.32029 15.2308 2.73881 15.4937 3.3078L15.9263 4.24441C16.1116 4.6456 16.5644 4.89514 17.0462 4.84514L18.1043 4.73532C18.7267 4.67072 19.3518 4.88603 19.777 5.33886C20.2566 5.84953 20.6755 6.3963 21.0297 6.98193C21.3843 7.56823 21.6716 8.18942 21.8959 8.84339C22.1023 9.44509 21.9785 10.1046 21.5911 10.6098L20.9624 11.4295C20.6996 11.7722 20.6996 12.2278 20.9624 12.5705L21.5959 13.3964C21.9853 13.9042 22.109 14.568 21.8979 15.1717C21.4497 16.4538 20.7299 17.6399 19.7801 18.6573C19.3549 19.1128 18.7273 19.3294 18.103 19.2646L17.0462 19.1549C16.5645 19.1049 16.1116 19.3544 15.9263 19.7556L15.4974 20.6841C15.2351 21.2518 14.7156 21.6698 14.0958 21.7924C12.7083 22.0668 11.2852 22.0687 9.91145 21.8009ZM13.7432 20.0088C13.7844 20.0006 13.8259 19.9673 13.847 19.9216L14.2758 18.9931C14.7915 17.8768 15.9886 17.2171 17.2341 17.3464L18.2909 17.4561C18.3649 17.4638 18.4272 17.4423 18.4512 17.4166C19.2296 16.5828 19.8171 15.6146 20.1817 14.5716C20.1845 14.5636 20.1796 14.5373 20.1532 14.5029L19.5198 13.677C18.7564 12.6815 18.7564 11.3185 19.5198 10.323L20.1485 9.5033C20.1746 9.46927 20.1795 9.4429 20.1762 9.43327C19.9932 8.89965 19.7603 8.39623 19.4741 7.92293C19.1873 7.4489 18.846 7.00333 18.4517 6.58351C18.4272 6.55739 18.3656 6.53616 18.2921 6.54378L17.234 6.65361C15.9886 6.78287 14.7915 6.12317 14.2758 5.00689L13.8432 4.07027C13.822 4.02448 13.7811 3.9916 13.7406 3.98371C12.5983 3.76097 11.4132 3.76258 10.2571 3.99124C10.2158 3.99941 10.1744 4.03271 10.1533 4.07842L9.72441 5.00689C9.20875 6.12317 8.01164 6.7829 6.76619 6.6536L5.70942 6.54391C5.63535 6.53623 5.573 6.55774 5.54905 6.5834C4.77067 7.41713 4.18312 8.38534 3.81845 9.42835C3.81564 9.43637 3.82054 9.46265 3.84693 9.49706L4.48038 10.323C5.24381 11.3185 5.24383 12.6815 4.48041 13.6769L3.85171 14.4967C3.82561 14.5307 3.82066 14.5571 3.82396 14.5667C4.00701 15.1004 4.23986 15.6038 4.52613 16.0771C4.81284 16.5511 5.15421 16.9967 5.54845 17.4165C5.57298 17.4426 5.63461 17.4638 5.70811 17.4562L6.76608 17.3464C8.01157 17.2171 9.20871 17.8768 9.72438 18.9932L10.157 19.9297C10.1781 19.9755 10.2191 20.0084 10.2595 20.0163C11.4018 20.239 12.587 20.2374 13.7432 20.0088Z",fill:"currentColor"},null,-1)])])}const EF=yt({name:"dimi-setting",render:MF}),TF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function NF(e,t){return x(),E("svg",TF,[...t[0]||(t[0]=[_("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[_("path",{d:"M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm5-2v16"}),_("path",{d:"m15 10l-2 2l2 2"})],-1)])])}const IF=yt({name:"tabler-layout-sidebar-left-collapse",render:NF}),LF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function $F(e,t){return x(),E("svg",LF,[...t[0]||(t[0]=[_("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[_("path",{d:"M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm5-2v16"}),_("path",{d:"m14 10l2 2l-2 2"})],-1)])])}const FF=yt({name:"tabler-layout-sidebar-left-expand",render:$F}),OF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function RF(e,t){return x(),E("svg",OF,[...t[0]||(t[0]=[_("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m15 7l-6.5 6.5a1.5 1.5 0 0 0 3 3L18 10a3 3 0 0 0-6-6l-6.5 6.5a4.5 4.5 0 0 0 9 9L21 13"},null,-1)])])}const BF=yt({name:"tabler-paperclip",render:RF}),DF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function PF(e,t){return x(),E("svg",DF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"},null,-1)])])}const HF=yt({name:"ri-add-line",render:PF}),WF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function zF(e,t){return x(),E("svg",WF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m12.866 3l9.526 16.5a1 1 0 0 1-.866 1.5H2.474a1 1 0 0 1-.866-1.5L11.134 3a1 1 0 0 1 1.732 0m-8.66 16h15.588L12 5.5zM11 16h2v2h-2zm0-7h2v5h-2z"},null,-1)])])}const UF=yt({name:"ri-alert-line",render:zF}),qF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function jF(e,t){return x(),E("svg",qF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M3 10H2V4.003C2 3.449 2.455 3 2.992 3h18.016A.99.99 0 0 1 22 4.003V10h-1v10.002a.996.996 0 0 1-.993.998H3.993A.996.996 0 0 1 3 20.002zm16 0H5v9h14zM4 5v3h16V5zm5 7h6v2H9z"},null,-1)])])}const VF=yt({name:"ri-archive-line",render:jF}),KF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function GF(e,t){return x(),E("svg",KF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m13 16.172l5.364-5.364l1.414 1.414L12 20l-7.778-7.778l1.414-1.414L11 16.172V4h2z"},null,-1)])])}const YF=yt({name:"ri-arrow-down-line",render:GF}),ZF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function XF(e,t){return x(),E("svg",ZF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m12 13.171l4.95-4.95l1.414 1.415L12 16L5.636 9.636L7.05 8.222z"},null,-1)])])}const QF=yt({name:"ri-arrow-down-s-line",render:XF}),JF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function eO(e,t){return x(),E("svg",JF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m5.828 7l2.536 2.535L6.95 10.95L2 6l4.95-4.95l1.414 1.415L5.828 5H13a8 8 0 1 1 0 16H4v-2h9a6 6 0 0 0 0-12z"},null,-1)])])}const tO=yt({name:"ri-arrow-go-back-line",render:eO}),nO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function oO(e,t){return x(),E("svg",nO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m16.172 11l-5.364-5.364l1.414-1.414L20 12l-7.778 7.778l-1.414-1.414L16.172 13H4v-2z"},null,-1)])])}const sO=yt({name:"ri-arrow-right-line",render:oO}),iO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function rO(e,t){return x(),E("svg",iO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m13.172 12l-4.95-4.95l1.414-1.413L16 12l-6.364 6.364l-1.414-1.415z"},null,-1)])])}const lO=yt({name:"ri-arrow-right-s-line",render:rO}),aO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function cO(e,t){return x(),E("svg",aO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M13 7.828V20h-2V7.828l-5.364 5.364l-1.414-1.414L12 4l7.778 7.778l-1.414 1.414z"},null,-1)])])}const __=yt({name:"ri-arrow-up-line",render:cO}),uO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function dO(e,t){return x(),E("svg",uO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m12 10.828l-4.95 4.95l-1.414-1.414L12 8l6.364 6.364l-1.414 1.414z"},null,-1)])])}const fO=yt({name:"ri-arrow-up-s-line",render:dO}),hO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function pO(e,t){return x(),E("svg",hO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M4 18v-3.7a1.5 1.5 0 0 0-1.5-1.5H2v-1.6h.5A1.5 1.5 0 0 0 4 9.7V6a3 3 0 0 1 3-3h1v2H7a1 1 0 0 0-1 1v4.1A2 2 0 0 1 4.626 12A2 2 0 0 1 6 13.9V18a1 1 0 0 0 1 1h1v2H7a3 3 0 0 1-3-3m16-3.7V18a3 3 0 0 1-3 3h-1v-2h1a1 1 0 0 0 1-1v-4.1a2 2 0 0 1 1.374-1.9A2 2 0 0 1 18 10.1V6a1 1 0 0 0-1-1h-1V3h1a3 3 0 0 1 3 3v3.7a1.5 1.5 0 0 0 1.5 1.5h.5v1.6h-.5a1.5 1.5 0 0 0-1.5 1.5"},null,-1)])])}const mO=yt({name:"ri-braces-line",render:pO}),gO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function vO(e,t){return x(),E("svg",gO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M9 3V1H7v2H3a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h18a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1h-4V1h-2v2zm-5 7h16v9H4zm0-5h3v1h2V5h6v1h2V5h3v3H4zm5.879 5.964L12 13.086l2.121-2.122l1.415 1.415l-2.122 2.121l2.121 2.121l-1.414 1.414L12 15.915l-2.121 2.12l-1.415-1.414l2.122-2.12l-2.122-2.122z"},null,-1)])])}const yO=yt({name:"ri-calendar-close-line",render:vO}),kO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function bO(e,t){return x(),E("svg",kO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M7 3V1h2v2h6V1h2v2h4a1 1 0 0 1 1 1v5h-2V5h-3v2h-2V5H9v2H7V5H4v14h6v2H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm10 9a4 4 0 1 0 0 8a4 4 0 0 0 0-8m-6 4a6 6 0 1 1 12 0a6 6 0 0 1-12 0m5-3v3.414l2.293 2.293l1.414-1.414L18 15.586V13z"},null,-1)])])}const xO=yt({name:"ri-calendar-schedule-line",render:bO}),wO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function _O(e,t){return x(),E("svg",wO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M9 1v2h6V1h2v2h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h4V1zm11 10H4v8h16zM8 14v2H6v-2zm10 0v2h-8v-2zM7 5H4v4h16V5h-3v2h-2V5H9v2H7z"},null,-1)])])}const SO=yt({name:"ri-calendar-todo-line",render:_O}),CO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function AO(e,t){return x(),E("svg",CO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m10 15.17l9.192-9.191l1.414 1.414L10 17.999l-6.364-6.364l1.414-1.414z"},null,-1)])])}const MO=yt({name:"ri-check-line",render:AO}),EO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function TO(e,t){return x(),E("svg",EO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m12 10.587l4.95-4.95l1.414 1.414l-4.95 4.95l4.95 4.95l-1.415 1.414l-4.95-4.95l-4.949 4.95l-1.414-1.415l4.95-4.95l-4.95-4.95L7.05 5.638z"},null,-1)])])}const NO=yt({name:"ri-close-line",render:TO}),IO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function LO(e,t){return x(),E("svg",IO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m23 12l-7.071 7.071l-1.414-1.414L20.172 12l-5.657-5.657l1.414-1.414zM3.828 12l5.657 5.657l-1.414 1.414L1 12l7.071-7.071l1.414 1.414z"},null,-1)])])}const $O=yt({name:"ri-code-line",render:LO}),FO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function OO(e,t){return x(),E("svg",FO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M15 4h-2v7h7V9h-3.586l4.293-4.293l-1.414-1.414L15 7.586zM4 15h3.586l-4.293 4.293l1.414 1.414L9 16.414V20h2v-7H4z"},null,-1)])])}const RO=yt({name:"ri-collapse-diagonal-line",render:OO}),BO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function DO(e,t){return x(),E("svg",BO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M3 19h18v2H3zm10-5.828L19.071 7.1l1.414 1.414L12 17L3.515 8.515L4.929 7.1L11 13.173V2h2z"},null,-1)])])}const PO=yt({name:"ri-download-line",render:DO}),HO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function WO(e,t){return x(),E("svg",HO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M8.5 7a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m0 6.5a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0M15.5 7a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0m-1.5 8a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3"},null,-1)])])}const zO=yt({name:"ri-draggable",render:WO}),UO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function qO(e,t){return x(),E("svg",UO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M6.17 18a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2v-2zm6-7a3.001 3.001 0 0 1 5.66 0H22v2h-4.17a3.001 3.001 0 0 1-5.66 0H2v-2zm-6-7a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2V4zM9 6a1 1 0 1 0 0-2a1 1 0 0 0 0 2m6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m-6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2"},null,-1)])])}const jO=yt({name:"ri-equalizer-line",render:qO}),VO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function KO(e,t){return x(),E("svg",VO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M17.586 5H14V3h7v7h-2V6.414l-4.293 4.293l-1.414-1.414zM3 14h2v3.586l4.293-4.293l1.414 1.414L6.414 19H10v2H3z"},null,-1)])])}const GO=yt({name:"ri-expand-diagonal-line",render:KO}),YO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ZO(e,t){return x(),E("svg",YO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm11-3v8h-2V6.413l-7.793 7.794l-1.414-1.414L17.585 5H13V3z"},null,-1)])])}const XO=yt({name:"ri-external-link-line",render:ZO}),QO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function JO(e,t){return x(),E("svg",QO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M15 4H5v16h14V8h-4zM3 2.992C3 2.444 3.447 2 3.999 2H16l5 5v13.993A1 1 0 0 1 20.007 22H3.993A1 1 0 0 1 3 21.008zM11 11V8h2v3h3v2h-3v3h-2v-3H8v-2z"},null,-1)])])}const eR=yt({name:"ri-file-add-line",render:JO}),tR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function nR(e,t){return x(),E("svg",tR,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M7 6V3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-3v3c0 .552-.45 1-1.007 1H4.007A1 1 0 0 1 3 21l.003-14c0-.552.45-1 1.006-1zM5.002 8L5 20h10V8zM9 6h8v10h2V4H9z"},null,-1)])])}const oR=yt({name:"ri-file-copy-line",render:nR}),sR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function iR(e,t){return x(),E("svg",sR,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m21 6.757l-2 2V4h-9v5H5v11h14v-2.757l2-2v5.765a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8l6.003-6h10.995C20.55 2 21 2.455 21 2.992zm.778 2.05l1.414 1.415L15.414 18l-1.416-.002l.002-1.412z"},null,-1)])])}const rR=yt({name:"ri-file-edit-line",render:iR}),lR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function aR(e,t){return x(),E("svg",lR,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M9 2.003V2h10.998C20.55 2 21 2.455 21 2.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8zM5.83 8H9V4.83zM11 4v5a1 1 0 0 1-1 1H5v10h14V4z"},null,-1)])])}const S_=yt({name:"ri-file-line",render:aR}),cR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function uR(e,t){return x(),E("svg",cR,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M21 8v12.993A1 1 0 0 1 20.007 22H3.993A.993.993 0 0 1 3 21.008V2.992C3 2.455 3.449 2 4.002 2h10.995zm-2 1h-5V4H5v16h14zM8 7h3v2H8zm0 4h8v2H8zm0 4h8v2H8z"},null,-1)])])}const dR=yt({name:"ri-file-text-line",render:uR}),fR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function hR(e,t){return x(),E("svg",fR,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M13 9h8L11 24v-9H4l9-15zm-2 2V7.22L7.532 13H13v4.394L17.263 11z"},null,-1)])])}const pR=yt({name:"ri-flashlight-line",render:hR}),mR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function gR(e,t){return x(),E("svg",mR,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414zM4 5v14h16V7h-8.414l-2-2zm7 7V9h2v3h3v2h-3v3h-2v-3H8v-2z"},null,-1)])])}const vR=yt({name:"ri-folder-add-line",render:gR}),yR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function kR(e,t){return x(),E("svg",yR,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414z"},null,-1)])])}const bR=yt({name:"ri-folder-fill",render:kR}),xR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function wR(e,t){return x(),E("svg",xR,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M6 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2M3 6a3 3 0 1 1 4 2.83V9a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2v-.17a3.001 3.001 0 1 1 2 0V9a4 4 0 0 1-4 4h-2v2.17a3.001 3.001 0 1 1-2 0V13H9a4 4 0 0 1-4-4v-.17A3 3 0 0 1 3 6m15-1a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-6 12a1 1 0 1 0 0 2a1 1 0 0 0 0-2"},null,-1)])])}const _R=yt({name:"ri-git-fork-line",render:wR}),SR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function CR(e,t){return x(),E("svg",SR,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M15 5h2a2 2 0 0 1 2 2v8.17a3.001 3.001 0 1 1-2 0V7h-2v3l-4.5-4L15 2zM5 8.83a3.001 3.001 0 1 1 2 0v6.34a3.001 3.001 0 1 1-2 0zM6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m0 12a1 1 0 1 0 0-2a1 1 0 0 0 0 2m12 0a1 1 0 1 0 0-2a1 1 0 0 0 0 2"},null,-1)])])}const AR=yt({name:"ri-git-pull-request-line",render:CR}),MR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ER(e,t){return x(),E("svg",MR,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m-2.29-2.333A17.9 17.9 0 0 1 8.027 13H4.062a8.01 8.01 0 0 0 5.648 6.667M10.03 13c.151 2.439.848 4.73 1.97 6.752A15.9 15.9 0 0 0 13.97 13zm9.908 0h-3.965a17.9 17.9 0 0 1-1.683 6.667A8.01 8.01 0 0 0 19.938 13M4.062 11h3.965A17.9 17.9 0 0 1 9.71 4.333A8.01 8.01 0 0 0 4.062 11m5.969 0h3.938A15.9 15.9 0 0 0 12 4.248A15.9 15.9 0 0 0 10.03 11m4.259-6.667A17.9 17.9 0 0 1 15.973 11h3.965a8.01 8.01 0 0 0-5.648-6.667"},null,-1)])])}const TR=yt({name:"ri-global-line",render:ER}),NR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function IR(e,t){return x(),E("svg",NR,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M2.992 21A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993zM20 15V5H4v14L14 9zm0 2.828l-6-6L6.828 19H20zM8 11a2 2 0 1 1 0-4a2 2 0 0 1 0 4"},null,-1)])])}const C_=yt({name:"ri-image-line",render:IR}),LR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function $R(e,t){return x(),E("svg",LR,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16M11 7h2v2h-2zm0 4h2v6h-2z"},null,-1)])])}const FR=yt({name:"ri-information-line",render:$R}),OR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function RR(e,t){return x(),E("svg",OR,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m13.06 8.111l1.415 1.414a7 7 0 0 1 0 9.9l-.354.353a7 7 0 1 1-9.9-9.9l1.415 1.415a5 5 0 1 0 7.071 7.071l.354-.354a5 5 0 0 0 0-7.07l-1.415-1.415zm6.718 6.01l-1.414-1.414a5 5 0 0 0-7.071-7.07l-.354.353a5 5 0 0 0 0 7.07l1.415 1.415l-1.415 1.414l-1.414-1.414a7 7 0 0 1 0-9.9l.354-.353a7 7 0 1 1 9.9 9.9"},null,-1)])])}const BR=yt({name:"ri-links-line",render:RR}),DR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function PR(e,t){return x(),E("svg",DR,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M8 4h13v2H8zm-5-.5h3v3H3zm0 7h3v3H3zm0 7h3v3H3zM8 11h13v2H8zm0 7h13v2H8z"},null,-1)])])}const HR=yt({name:"ri-list-check",render:PR}),WR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function zR(e,t){return x(),E("svg",WR,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M8 4h13v2H8zM4.5 6.5a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 7a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 6.9a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3M8 11h13v2H8zm0 7h13v2H8z"},null,-1)])])}const UR=yt({name:"ri-list-unordered",render:zR}),qR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function jR(e,t){return x(),E("svg",qR,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M4 15h2v5h12V4H6v5H4V3a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm6-4V8l5 4l-5 4v-3H2v-2z"},null,-1)])])}const VR=yt({name:"ri-login-box-line",render:jR}),KR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function GR(e,t){return x(),E("svg",KR,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m17 4.238l-7.928 7.1L4 7.216V19h16zM4.511 5l7.55 6.662L19.502 5z"},null,-1)])])}const YR=yt({name:"ri-mail-line",render:GR}),ZR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function XR(e,t){return x(),E("svg",ZR,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M6.455 19L2 22.5V4a1 1 0 0 1 1-1h18a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1zm-.692-2H20V5H4v13.385zM8 10h8v2H8z"},null,-1)])])}const QR=yt({name:"ri-message-line",render:XR}),JR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function eB(e,t){return x(),E("svg",JR,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M6 5h2v14H6zm10 0h2v14h-2z"},null,-1)])])}const tB=yt({name:"ri-pause-fill",render:eB}),nB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function oB(e,t){return x(),E("svg",nB,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m15.728 9.576l-1.414-1.414L5 17.476v1.414h1.414zm1.414-1.414l1.414-1.414l-1.414-1.414l-1.414 1.414zm-9.9 12.728H3v-4.243L16.435 3.212a1 1 0 0 1 1.414 0l2.829 2.829a1 1 0 0 1 0 1.414z"},null,-1)])])}const sB=yt({name:"ri-pencil-line",render:oB}),iB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function rB(e,t){return x(),E("svg",iB,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M19.376 12.416L8.777 19.482A.5.5 0 0 1 8 19.066V4.934a.5.5 0 0 1 .777-.416l10.599 7.066a.5.5 0 0 1 0 .832"},null,-1)])])}const lB=yt({name:"ri-play-fill",render:rB}),aB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function cB(e,t){return x(),E("svg",aB,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m-1-5h2v2h-2zm2-1.645V14h-2v-1.5a1 1 0 0 1 1-1a1.5 1.5 0 1 0-1.471-1.794l-1.962-.393A3.501 3.501 0 1 1 13 13.355"},null,-1)])])}const uB=yt({name:"ri-question-line",render:cB}),dB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function fB(e,t){return x(),E("svg",dB,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M20 4v12h3l-4 5l-4-5h3V4zm-8 14v2H3v-2zm2-7v2H3v-2zm0-7v2H3V4z"},null,-1)])])}const hB=yt({name:"ri-sort-desc",render:fB}),pB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function mB(e,t){return x(),E("svg",pB,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M14 4.438A2.437 2.437 0 0 0 16.438 2h1.125A2.437 2.437 0 0 0 20 4.438v1.125A2.437 2.437 0 0 0 17.563 8h-1.125A2.437 2.437 0 0 0 14 5.563zM1 11a6 6 0 0 0 6-6h2a6 6 0 0 0 6 6v2a6 6 0 0 0-6 6H7a6 6 0 0 0-6-6zm3.876 1A8.04 8.04 0 0 1 8 15.124A8.04 8.04 0 0 1 11.124 12A8.04 8.04 0 0 1 8 8.876A8.04 8.04 0 0 1 4.876 12m12.374 2A3.25 3.25 0 0 1 14 17.25v1.5A3.25 3.25 0 0 1 17.25 22h1.5A3.25 3.25 0 0 1 22 18.75v-1.5A3.25 3.25 0 0 1 18.75 14z"},null,-1)])])}const gB=yt({name:"ri-sparkling-line",render:mB}),vB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function yB(e,t){return x(),E("svg",vB,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928z"},null,-1)])])}const kB=yt({name:"ri-star-fill",render:yB}),bB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function xB(e,t){return x(),E("svg",bB,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928zm0-2.292l4.247 2.377l-.948-4.773l3.573-3.305l-4.833-.573l-2.038-4.419l-2.039 4.42l-4.833.572l3.573 3.305l-.948 4.773z"},null,-1)])])}const wB=yt({name:"ri-star-line",render:xB}),_B={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function SB(e,t){return x(),E("svg",_B,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M6 5h12a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1"},null,-1)])])}const CB=yt({name:"ri-stop-fill",render:SB}),AB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function MB(e,t){return x(),E("svg",AB,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M5 11v2h14v-2z"},null,-1)])])}const EB=yt({name:"ri-subtract-line",render:MB}),TB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function NB(e,t){return x(),E("svg",TB,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M12 2a1 1 0 1 1 0 2a8 8 0 1 0 8 8a1 1 0 1 1 2 0c0 5.523-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2m0 4a1 1 0 1 1 0 2a4 4 0 1 0 4 4a1 1 0 1 1 2 0a6 6 0 1 1-6-6m5.656-3.9a1.001 1.001 0 0 1 1.415 1.415l-.708.706h.001a1 1 0 1 0 1.414 1.415l.707-.707A1 1 0 0 1 21.9 6.343l-2.12 2.122a1 1 0 0 1-.708.292h-2.414l-3.95 3.95a1 1 0 0 1-1.414-1.414l3.95-3.95V4.93a1 1 0 0 1 .292-.707z"},null,-1)])])}const IB=yt({name:"ri-target-line",render:NB}),LB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function $B(e,t){return x(),E("svg",LB,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m1 2v14h16V5zm8 10h6v2h-6zm-3.333-3L5.838 9.172l1.415-1.415L11.495 12l-4.242 4.243l-1.415-1.415z"},null,-1)])])}const FB=yt({name:"ri-terminal-box-line",render:$B}),OB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function RB(e,t){return x(),E("svg",OB,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m1-8h4v2h-6V7h2z"},null,-1)])])}const BB=yt({name:"ri-time-line",render:RB}),DB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function PB(e,t){return x(),E("svg",DB,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M5.33 3.272a3.5 3.5 0 0 1 4.254 4.962l10.709 10.71l-1.414 1.414l-10.71-10.71a3.502 3.502 0 0 1-4.962-4.255L5.444 7.63a1.5 1.5 0 0 0 2.121-2.121zm10.367 1.883l3.182-1.768l1.414 1.415l-1.768 3.182l-1.768.353l-2.12 2.121l-1.415-1.414l2.121-2.121zm-6.718 8.132l1.415 1.414l-5.304 5.303a1 1 0 0 1-1.492-1.327l.078-.087z"},null,-1)])])}const HB=yt({name:"ri-tools-line",render:PB}),WB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function zB(e,t){return x(),E("svg",WB,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M4 22a8 8 0 1 1 16 0h-2a6 6 0 0 0-12 0zm8-9c-3.315 0-6-2.685-6-6s2.685-6 6-6s6 2.685 6 6s-2.685 6-6 6m0-2c2.21 0 4-1.79 4-4s-1.79-4-4-4s-4 1.79-4 4s1.79 4 4 4"},null,-1)])])}const UB=yt({name:"ri-user-line",render:zB}),qB=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
39
|
-
<path d="M11.1 12.9001V15.0909C11.1 15.593 11.5029 16 12 16C12.4971 16 12.9 15.593 12.9 15.0909V12.9001H15.0909C15.593 12.9001 16 12.4972 16 12.0001C16 11.5031 15.593 11.1001 15.0909 11.1001H12.9V8.90909C12.9 8.40701 12.4971 8 12 8C11.5029 8 11.1 8.40701 11.1 8.90909V11.1001H8.90909C8.40701 11.1001 8 11.5031 8 12.0001C8 12.4972 8.40701 12.9001 8.90909 12.9001H11.1Z" fill="currentColor"/>
|
|
40
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.9996 2.1001C6.53199 2.1001 2.09961 6.53248 2.09961 12.0001C2.09961 13.9226 2.64847 15.7192 3.59804 17.2391L2.517 19.8207C2.10313 20.8091 2.82908 21.9001 3.90059 21.9001H11.9996C17.4672 21.9001 21.8996 17.4677 21.8996 12.0001C21.8996 6.53248 17.4672 2.1001 11.9996 2.1001ZM3.89961 12.0001C3.89961 7.52659 7.5261 3.9001 11.9996 3.9001C16.4731 3.9001 20.0996 7.52659 20.0996 12.0001C20.0996 16.4736 16.4724 20.1001 11.9989 20.1001H4.35146L5.63494 17.0351L5.35165 16.6291C4.43632 15.3172 3.89961 13.7227 3.89961 12.0001Z" fill="currentColor"/>
|
|
41
|
-
</svg>
|
|
42
|
-
`,jB=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
43
|
-
<path d="M9.2373 3.7002C10.4169 3.7002 11.5297 4.24779 12.249 5.18262L12.4424 5.43359H18C20.0987 5.43359 21.7998 7.13472 21.7998 9.2334V16.5C21.7998 18.5987 20.0987 20.2998 18 20.2998H6C3.90132 20.2998 2.2002 18.5987 2.2002 16.5V7.5C2.2002 5.40132 3.90132 3.7002 6 3.7002H9.2373ZM6 5.5C4.89543 5.5 4 6.39543 4 7.5V16.5C4 17.6046 4.89543 18.5 6 18.5H18C19.0357 18.5 19.887 17.7128 19.9893 16.7041L20 16.5V9.2334C20 8.19775 19.2128 7.34641 18.2041 7.24414L18 7.2334H12.0479L11.9326 7.22656C11.666 7.19561 11.4205 7.05812 11.2549 6.84277L10.8223 6.28027C10.4437 5.78834 9.85808 5.5 9.2373 5.5H6ZM16 9.59961C16.4971 9.59961 16.9004 10.0029 16.9004 10.5C16.9004 10.9971 16.4971 11.4004 16 11.4004H8C7.50294 11.4004 7.09961 10.9971 7.09961 10.5C7.09961 10.0029 7.50294 9.59961 8 9.59961H16Z" fill="currentColor"/>
|
|
44
|
-
</svg>
|
|
45
|
-
`,VB=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
46
|
-
<g clip-path="url(#clip0_4626_2033)">
|
|
47
|
-
<path d="M18.3623 9.99976L18.209 8.48999C18.2031 8.43161 18.2004 8.37289 18.2002 8.31421C18.1988 8.31196 18.1956 8.30842 18.1904 8.30347C18.1718 8.28559 18.1302 8.26245 18.0713 8.26245H11C10.261 8.26245 9.59753 7.81016 9.32617 7.1228L8.9082 6.06421C8.88101 5.9953 8.85737 5.92501 8.83887 5.85327C8.83778 5.85099 8.833 5.84268 8.81836 5.83179C8.79454 5.81475 8.7549 5.79939 8.70605 5.80054H3.92871C3.86986 5.80054 3.82825 5.82368 3.80957 5.84155C3.80816 5.8429 3.80675 5.84428 3.80566 5.84546L4.47559 14.0955L3.62109 17.5154L5.12109 11.5154C5.34367 10.6251 6.1438 9.99977 7.06152 9.99976H18.3623ZM7.06152 11.7996C6.96976 11.7996 6.88944 11.8629 6.86719 11.9519L5.36719 17.9519C5.33598 18.078 5.43158 18.1999 5.56152 18.2H19.4385C19.5302 18.1999 19.6106 18.1376 19.6328 18.0486L21.1328 12.0486C21.1644 11.9224 21.0686 11.7996 20.9385 11.7996H7.06152ZM20.9385 9.99976C22.2396 9.99977 23.1945 11.2228 22.8789 12.4851L21.3789 18.4851C21.1563 19.3754 20.3562 19.9997 19.4385 19.9998H4.92871C4.41722 19.9998 3.92613 19.8059 3.56445 19.4597C3.20281 19.1135 3.00004 18.6436 3 18.1541L2 5.84644C2.00006 5.35711 2.20311 4.88786 2.56445 4.54175C2.92613 4.19554 3.41722 4.00073 3.92871 4.00073H8.66406C9.10133 3.99051 9.5296 4.1225 9.87793 4.37573C10.2285 4.63118 10.4767 4.99457 10.582 5.40405L11 6.46167H18.0713C18.5828 6.46167 19.0739 6.65648 19.4355 7.00269C19.7971 7.34888 20 7.81883 20 8.30835L20.1719 9.99976H20.9385Z" fill="currentColor"/>
|
|
48
|
-
</g>
|
|
49
|
-
<defs>
|
|
50
|
-
<clipPath id="clip0_4626_2033">
|
|
51
|
-
<rect width="24" height="24" fill="white"/>
|
|
52
|
-
</clipPath>
|
|
53
|
-
</defs>
|
|
54
|
-
</svg>
|
|
55
|
-
`,KB=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
56
|
-
<path d="M6 12C6 12.8283 5.32834 13.5 4.5 13.5C3.67166 13.5 3 12.8283 3 12C3 11.1717 3.67166 10.5 4.5 10.5C5.32834 10.5 6 11.1717 6 12Z" fill="currentColor"/>
|
|
57
|
-
<path d="M13.5 12C13.5 12.8283 12.8283 13.5 12 13.5C11.1717 13.5 10.5 12.8283 10.5 12C10.5 11.1717 11.1717 10.5 12 10.5C12.8283 10.5 13.5 11.1717 13.5 12Z" fill="currentColor"/>
|
|
58
|
-
<path d="M19.5002 13.5C20.3287 13.5 21 12.8287 21 12.0002C21 11.1718 20.3287 10.5 19.5002 10.5C18.6718 10.5 18 11.1718 18 12.0002C18 12.8287 18.6718 13.5 19.5002 13.5Z" fill="currentColor"/>
|
|
59
|
-
</svg>
|
|
60
|
-
`,GB=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
61
|
-
<path d="M11.5 3C16.1944 3 20 6.80558 20 11.5C20 13.523 19.2933 15.381 18.1132 16.8404L21.1364 19.8636C21.4879 20.2151 21.4879 20.7849 21.1364 21.1364C20.7849 21.4879 20.2151 21.4879 19.8636 21.1364L16.8404 18.1132C15.381 19.2933 13.523 20 11.5 20C6.80558 20 3 16.1944 3 11.5C3 6.80558 6.80558 3 11.5 3ZM11.5 18.2C15.2003 18.2 18.2 15.2003 18.2 11.5C18.2 7.79969 15.2003 4.8 11.5 4.8C7.79969 4.8 4.8 7.79969 4.8 11.5C4.8 15.2003 7.79969 18.2 11.5 18.2Z" fill="currentColor"/>
|
|
62
|
-
</svg>
|
|
63
|
-
`,YB=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
64
|
-
<path d="M16.0404 12C16.0404 9.76874 14.2313 7.9596 12.0001 7.9596C9.76883 7.9596 7.95972 9.76874 7.95972 12C7.95972 14.2313 9.76883 16.0404 12.0001 16.0404C14.2313 16.0404 16.0404 14.2313 16.0404 12ZM14.2222 12C14.2222 13.2271 13.2271 14.2222 12 14.2222C10.7729 14.2222 9.77783 13.2271 9.77783 12C9.77783 10.7729 10.7729 9.77778 12 9.77778C13.2271 9.77778 14.2222 10.7729 14.2222 12Z" fill="currentColor"/>
|
|
65
|
-
<path d="M9.91145 21.8009C9.29001 21.6797 8.76914 21.2612 8.50632 20.6922L8.07372 19.7556C7.88838 19.3544 7.43553 19.1048 6.95371 19.1549L5.89572 19.2647C5.2733 19.3293 4.64823 19.114 4.22298 18.6611C3.74343 18.1504 3.32454 17.6037 2.97033 17.0181C2.61571 16.4318 2.32839 15.8106 2.10407 15.1566C1.89769 14.5549 2.02148 13.8954 2.4089 13.3902L3.0376 12.5704C3.30043 12.2277 3.30042 11.7722 3.03758 11.4295L2.40413 10.6035C2.01474 10.0958 1.891 9.43198 2.10208 8.82826C2.55037 7.54612 3.27017 6.35997 4.22 5.34259C4.64518 4.8872 5.27275 4.67067 5.89701 4.73544L6.95383 4.84514C7.43561 4.89515 7.88844 4.6456 8.07377 4.24441L8.50266 3.31593C8.76494 2.74818 9.28448 2.33019 9.90423 2.20761C11.2916 1.9332 12.7148 1.93127 14.0885 2.19913C14.7099 2.32029 15.2308 2.73881 15.4937 3.3078L15.9263 4.24441C16.1116 4.6456 16.5644 4.89514 17.0462 4.84514L18.1043 4.73532C18.7267 4.67072 19.3518 4.88603 19.777 5.33886C20.2566 5.84953 20.6755 6.3963 21.0297 6.98193C21.3843 7.56823 21.6716 8.18942 21.8959 8.84339C22.1023 9.44509 21.9785 10.1046 21.5911 10.6098L20.9624 11.4295C20.6996 11.7722 20.6996 12.2278 20.9624 12.5705L21.5959 13.3964C21.9853 13.9042 22.109 14.568 21.8979 15.1717C21.4497 16.4538 20.7299 17.6399 19.7801 18.6573C19.3549 19.1128 18.7273 19.3294 18.103 19.2646L17.0462 19.1549C16.5645 19.1049 16.1116 19.3544 15.9263 19.7556L15.4974 20.6841C15.2351 21.2518 14.7156 21.6698 14.0958 21.7924C12.7083 22.0668 11.2852 22.0687 9.91145 21.8009ZM13.7432 20.0088C13.7844 20.0006 13.8259 19.9673 13.847 19.9216L14.2758 18.9931C14.7915 17.8768 15.9886 17.2171 17.2341 17.3464L18.2909 17.4561C18.3649 17.4638 18.4272 17.4423 18.4512 17.4166C19.2296 16.5828 19.8171 15.6146 20.1817 14.5716C20.1845 14.5636 20.1796 14.5373 20.1532 14.5029L19.5198 13.677C18.7564 12.6815 18.7564 11.3185 19.5198 10.323L20.1485 9.5033C20.1746 9.46927 20.1795 9.4429 20.1762 9.43327C19.9932 8.89965 19.7603 8.39623 19.4741 7.92293C19.1873 7.4489 18.846 7.00333 18.4517 6.58351C18.4272 6.55739 18.3656 6.53616 18.2921 6.54378L17.234 6.65361C15.9886 6.78287 14.7915 6.12317 14.2758 5.00689L13.8432 4.07027C13.822 4.02448 13.7811 3.9916 13.7406 3.98371C12.5983 3.76097 11.4132 3.76258 10.2571 3.99124C10.2158 3.99941 10.1744 4.03271 10.1533 4.07842L9.72441 5.00689C9.20875 6.12317 8.01164 6.7829 6.76619 6.6536L5.70942 6.54391C5.63535 6.53623 5.573 6.55774 5.54905 6.5834C4.77067 7.41713 4.18312 8.38534 3.81845 9.42835C3.81564 9.43637 3.82054 9.46265 3.84693 9.49706L4.48038 10.323C5.24381 11.3185 5.24383 12.6815 4.48041 13.6769L3.85171 14.4967C3.82561 14.5307 3.82066 14.5571 3.82396 14.5667C4.00701 15.1004 4.23986 15.6038 4.52613 16.0771C4.81284 16.5511 5.15421 16.9967 5.54845 17.4165C5.57298 17.4426 5.63461 17.4638 5.70811 17.4562L6.76608 17.3464C8.01157 17.2171 9.20871 17.8768 9.72438 18.9932L10.157 19.9297C10.1781 19.9755 10.2191 20.0084 10.2595 20.0163C11.4018 20.239 12.587 20.2374 13.7432 20.0088Z" fill="currentColor"/>
|
|
66
|
-
</svg>
|
|
67
|
-
`,ZB='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm5-2v16"/><path d="m15 10l-2 2l2 2"/></g></svg>',XB='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm5-2v16"/><path d="m14 10l2 2l-2 2"/></g></svg>',QB='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m15 7l-6.5 6.5a1.5 1.5 0 0 0 3 3L18 10a3 3 0 0 0-6-6l-6.5 6.5a4.5 4.5 0 0 0 9 9L21 13"/></svg>',JB='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"/></svg>',eD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12.866 3l9.526 16.5a1 1 0 0 1-.866 1.5H2.474a1 1 0 0 1-.866-1.5L11.134 3a1 1 0 0 1 1.732 0m-8.66 16h15.588L12 5.5zM11 16h2v2h-2zm0-7h2v5h-2z"/></svg>',tD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M3 10H2V4.003C2 3.449 2.455 3 2.992 3h18.016A.99.99 0 0 1 22 4.003V10h-1v10.002a.996.996 0 0 1-.993.998H3.993A.996.996 0 0 1 3 20.002zm16 0H5v9h14zM4 5v3h16V5zm5 7h6v2H9z"/></svg>',nD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m13 16.172l5.364-5.364l1.414 1.414L12 20l-7.778-7.778l1.414-1.414L11 16.172V4h2z"/></svg>',oD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 13.171l4.95-4.95l1.414 1.415L12 16L5.636 9.636L7.05 8.222z"/></svg>',sD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m5.828 7l2.536 2.535L6.95 10.95L2 6l4.95-4.95l1.414 1.415L5.828 5H13a8 8 0 1 1 0 16H4v-2h9a6 6 0 0 0 0-12z"/></svg>',iD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m16.172 11l-5.364-5.364l1.414-1.414L20 12l-7.778 7.778l-1.414-1.414L16.172 13H4v-2z"/></svg>',rD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m13.172 12l-4.95-4.95l1.414-1.413L16 12l-6.364 6.364l-1.414-1.415z"/></svg>',A_='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M13 7.828V20h-2V7.828l-5.364 5.364l-1.414-1.414L12 4l7.778 7.778l-1.414 1.414z"/></svg>',lD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 10.828l-4.95 4.95l-1.414-1.414L12 8l6.364 6.364l-1.414 1.414z"/></svg>',aD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M4 18v-3.7a1.5 1.5 0 0 0-1.5-1.5H2v-1.6h.5A1.5 1.5 0 0 0 4 9.7V6a3 3 0 0 1 3-3h1v2H7a1 1 0 0 0-1 1v4.1A2 2 0 0 1 4.626 12A2 2 0 0 1 6 13.9V18a1 1 0 0 0 1 1h1v2H7a3 3 0 0 1-3-3m16-3.7V18a3 3 0 0 1-3 3h-1v-2h1a1 1 0 0 0 1-1v-4.1a2 2 0 0 1 1.374-1.9A2 2 0 0 1 18 10.1V6a1 1 0 0 0-1-1h-1V3h1a3 3 0 0 1 3 3v3.7a1.5 1.5 0 0 0 1.5 1.5h.5v1.6h-.5a1.5 1.5 0 0 0-1.5 1.5"/></svg>',cD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M9 3V1H7v2H3a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h18a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1h-4V1h-2v2zm-5 7h16v9H4zm0-5h3v1h2V5h6v1h2V5h3v3H4zm5.879 5.964L12 13.086l2.121-2.122l1.415 1.415l-2.122 2.121l2.121 2.121l-1.414 1.414L12 15.915l-2.121 2.12l-1.415-1.414l2.122-2.12l-2.122-2.122z"/></svg>',uD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M7 3V1h2v2h6V1h2v2h4a1 1 0 0 1 1 1v5h-2V5h-3v2h-2V5H9v2H7V5H4v14h6v2H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm10 9a4 4 0 1 0 0 8a4 4 0 0 0 0-8m-6 4a6 6 0 1 1 12 0a6 6 0 0 1-12 0m5-3v3.414l2.293 2.293l1.414-1.414L18 15.586V13z"/></svg>',dD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M9 1v2h6V1h2v2h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h4V1zm11 10H4v8h16zM8 14v2H6v-2zm10 0v2h-8v-2zM7 5H4v4h16V5h-3v2h-2V5H9v2H7z"/></svg>',fD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m10 15.17l9.192-9.191l1.414 1.414L10 17.999l-6.364-6.364l1.414-1.414z"/></svg>',hD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 10.587l4.95-4.95l1.414 1.414l-4.95 4.95l4.95 4.95l-1.415 1.414l-4.95-4.95l-4.949 4.95l-1.414-1.415l4.95-4.95l-4.95-4.95L7.05 5.638z"/></svg>',pD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m23 12l-7.071 7.071l-1.414-1.414L20.172 12l-5.657-5.657l1.414-1.414zM3.828 12l5.657 5.657l-1.414 1.414L1 12l7.071-7.071l1.414 1.414z"/></svg>',mD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M15 4h-2v7h7V9h-3.586l4.293-4.293l-1.414-1.414L15 7.586zM4 15h3.586l-4.293 4.293l1.414 1.414L9 16.414V20h2v-7H4z"/></svg>',gD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M3 19h18v2H3zm10-5.828L19.071 7.1l1.414 1.414L12 17L3.515 8.515L4.929 7.1L11 13.173V2h2z"/></svg>',vD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M8.5 7a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m0 6.5a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0M15.5 7a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0m-1.5 8a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3"/></svg>',yD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6.17 18a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2v-2zm6-7a3.001 3.001 0 0 1 5.66 0H22v2h-4.17a3.001 3.001 0 0 1-5.66 0H2v-2zm-6-7a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2V4zM9 6a1 1 0 1 0 0-2a1 1 0 0 0 0 2m6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m-6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2"/></svg>',kD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M17.586 5H14V3h7v7h-2V6.414l-4.293 4.293l-1.414-1.414zM3 14h2v3.586l4.293-4.293l1.414 1.414L6.414 19H10v2H3z"/></svg>',bD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm11-3v8h-2V6.413l-7.793 7.794l-1.414-1.414L17.585 5H13V3z"/></svg>',xD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M15 4H5v16h14V8h-4zM3 2.992C3 2.444 3.447 2 3.999 2H16l5 5v13.993A1 1 0 0 1 20.007 22H3.993A1 1 0 0 1 3 21.008zM11 11V8h2v3h3v2h-3v3h-2v-3H8v-2z"/></svg>',wD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M7 6V3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-3v3c0 .552-.45 1-1.007 1H4.007A1 1 0 0 1 3 21l.003-14c0-.552.45-1 1.006-1zM5.002 8L5 20h10V8zM9 6h8v10h2V4H9z"/></svg>',_D='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m21 6.757l-2 2V4h-9v5H5v11h14v-2.757l2-2v5.765a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8l6.003-6h10.995C20.55 2 21 2.455 21 2.992zm.778 2.05l1.414 1.415L15.414 18l-1.416-.002l.002-1.412z"/></svg>',M_='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M9 2.003V2h10.998C20.55 2 21 2.455 21 2.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8zM5.83 8H9V4.83zM11 4v5a1 1 0 0 1-1 1H5v10h14V4z"/></svg>',SD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M21 8v12.993A1 1 0 0 1 20.007 22H3.993A.993.993 0 0 1 3 21.008V2.992C3 2.455 3.449 2 4.002 2h10.995zm-2 1h-5V4H5v16h14zM8 7h3v2H8zm0 4h8v2H8zm0 4h8v2H8z"/></svg>',CD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M13 9h8L11 24v-9H4l9-15zm-2 2V7.22L7.532 13H13v4.394L17.263 11z"/></svg>',AD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414zM4 5v14h16V7h-8.414l-2-2zm7 7V9h2v3h3v2h-3v3h-2v-3H8v-2z"/></svg>',MD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414z"/></svg>',ED='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2M3 6a3 3 0 1 1 4 2.83V9a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2v-.17a3.001 3.001 0 1 1 2 0V9a4 4 0 0 1-4 4h-2v2.17a3.001 3.001 0 1 1-2 0V13H9a4 4 0 0 1-4-4v-.17A3 3 0 0 1 3 6m15-1a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-6 12a1 1 0 1 0 0 2a1 1 0 0 0 0-2"/></svg>',TD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M15 5h2a2 2 0 0 1 2 2v8.17a3.001 3.001 0 1 1-2 0V7h-2v3l-4.5-4L15 2zM5 8.83a3.001 3.001 0 1 1 2 0v6.34a3.001 3.001 0 1 1-2 0zM6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m0 12a1 1 0 1 0 0-2a1 1 0 0 0 0 2m12 0a1 1 0 1 0 0-2a1 1 0 0 0 0 2"/></svg>',ND='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m-2.29-2.333A17.9 17.9 0 0 1 8.027 13H4.062a8.01 8.01 0 0 0 5.648 6.667M10.03 13c.151 2.439.848 4.73 1.97 6.752A15.9 15.9 0 0 0 13.97 13zm9.908 0h-3.965a17.9 17.9 0 0 1-1.683 6.667A8.01 8.01 0 0 0 19.938 13M4.062 11h3.965A17.9 17.9 0 0 1 9.71 4.333A8.01 8.01 0 0 0 4.062 11m5.969 0h3.938A15.9 15.9 0 0 0 12 4.248A15.9 15.9 0 0 0 10.03 11m4.259-6.667A17.9 17.9 0 0 1 15.973 11h3.965a8.01 8.01 0 0 0-5.648-6.667"/></svg>',E_='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M2.992 21A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993zM20 15V5H4v14L14 9zm0 2.828l-6-6L6.828 19H20zM8 11a2 2 0 1 1 0-4a2 2 0 0 1 0 4"/></svg>',ID='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16M11 7h2v2h-2zm0 4h2v6h-2z"/></svg>',LD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m13.06 8.111l1.415 1.414a7 7 0 0 1 0 9.9l-.354.353a7 7 0 1 1-9.9-9.9l1.415 1.415a5 5 0 1 0 7.071 7.071l.354-.354a5 5 0 0 0 0-7.07l-1.415-1.415zm6.718 6.01l-1.414-1.414a5 5 0 0 0-7.071-7.07l-.354.353a5 5 0 0 0 0 7.07l1.415 1.415l-1.415 1.414l-1.414-1.414a7 7 0 0 1 0-9.9l.354-.353a7 7 0 1 1 9.9 9.9"/></svg>',$D='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M8 4h13v2H8zm-5-.5h3v3H3zm0 7h3v3H3zm0 7h3v3H3zM8 11h13v2H8zm0 7h13v2H8z"/></svg>',FD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M8 4h13v2H8zM4.5 6.5a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 7a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 6.9a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3M8 11h13v2H8zm0 7h13v2H8z"/></svg>',OD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M4 15h2v5h12V4H6v5H4V3a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm6-4V8l5 4l-5 4v-3H2v-2z"/></svg>',RD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m17 4.238l-7.928 7.1L4 7.216V19h16zM4.511 5l7.55 6.662L19.502 5z"/></svg>',BD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6.455 19L2 22.5V4a1 1 0 0 1 1-1h18a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1zm-.692-2H20V5H4v13.385zM8 10h8v2H8z"/></svg>',DD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6 5h2v14H6zm10 0h2v14h-2z"/></svg>',PD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m15.728 9.576l-1.414-1.414L5 17.476v1.414h1.414zm1.414-1.414l1.414-1.414l-1.414-1.414l-1.414 1.414zm-9.9 12.728H3v-4.243L16.435 3.212a1 1 0 0 1 1.414 0l2.829 2.829a1 1 0 0 1 0 1.414z"/></svg>',HD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M19.376 12.416L8.777 19.482A.5.5 0 0 1 8 19.066V4.934a.5.5 0 0 1 .777-.416l10.599 7.066a.5.5 0 0 1 0 .832"/></svg>',WD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m-1-5h2v2h-2zm2-1.645V14h-2v-1.5a1 1 0 0 1 1-1a1.5 1.5 0 1 0-1.471-1.794l-1.962-.393A3.501 3.501 0 1 1 13 13.355"/></svg>',zD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M20 4v12h3l-4 5l-4-5h3V4zm-8 14v2H3v-2zm2-7v2H3v-2zm0-7v2H3V4z"/></svg>',UD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M14 4.438A2.437 2.437 0 0 0 16.438 2h1.125A2.437 2.437 0 0 0 20 4.438v1.125A2.437 2.437 0 0 0 17.563 8h-1.125A2.437 2.437 0 0 0 14 5.563zM1 11a6 6 0 0 0 6-6h2a6 6 0 0 0 6 6v2a6 6 0 0 0-6 6H7a6 6 0 0 0-6-6zm3.876 1A8.04 8.04 0 0 1 8 15.124A8.04 8.04 0 0 1 11.124 12A8.04 8.04 0 0 1 8 8.876A8.04 8.04 0 0 1 4.876 12m12.374 2A3.25 3.25 0 0 1 14 17.25v1.5A3.25 3.25 0 0 1 17.25 22h1.5A3.25 3.25 0 0 1 22 18.75v-1.5A3.25 3.25 0 0 1 18.75 14z"/></svg>',qD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928z"/></svg>',jD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928zm0-2.292l4.247 2.377l-.948-4.773l3.573-3.305l-4.833-.573l-2.038-4.419l-2.039 4.42l-4.833.572l3.573 3.305l-.948 4.773z"/></svg>',VD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6 5h12a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1"/></svg>',KD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M5 11v2h14v-2z"/></svg>',GD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 2a1 1 0 1 1 0 2a8 8 0 1 0 8 8a1 1 0 1 1 2 0c0 5.523-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2m0 4a1 1 0 1 1 0 2a4 4 0 1 0 4 4a1 1 0 1 1 2 0a6 6 0 1 1-6-6m5.656-3.9a1.001 1.001 0 0 1 1.415 1.415l-.708.706h.001a1 1 0 1 0 1.414 1.415l.707-.707A1 1 0 0 1 21.9 6.343l-2.12 2.122a1 1 0 0 1-.708.292h-2.414l-3.95 3.95a1 1 0 0 1-1.414-1.414l3.95-3.95V4.93a1 1 0 0 1 .292-.707z"/></svg>',YD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m1 2v14h16V5zm8 10h6v2h-6zm-3.333-3L5.838 9.172l1.415-1.415L11.495 12l-4.242 4.243l-1.415-1.415z"/></svg>',ZD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m1-8h4v2h-6V7h2z"/></svg>',XD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M5.33 3.272a3.5 3.5 0 0 1 4.254 4.962l10.709 10.71l-1.414 1.414l-10.71-10.71a3.502 3.502 0 0 1-4.962-4.255L5.444 7.63a1.5 1.5 0 0 0 2.121-2.121zm10.367 1.883l3.182-1.768l1.414 1.415l-1.768 3.182l-1.768.353l-2.12 2.121l-1.415-1.414l2.121-2.121zm-6.718 8.132l1.415 1.414l-5.304 5.303a1 1 0 0 1-1.492-1.327l.078-.087z"/></svg>',QD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M4 22a8 8 0 1 1 16 0h-2a6 6 0 0 0-12 0zm8-9c-3.315 0-6-2.685-6-6s2.685-6 6-6s6 2.685 6 6s-2.685 6-6 6m0-2c2.21 0 4-1.79 4-4s-1.79-4-4-4s-4 1.79-4 4s1.79 4 4 4"/></svg>',c6={sm:14,md:16,lg:20};function xt(e,t){return{component:e,svg:t}}const u6={plus:xt(HF,JB),"chat-new":xt(dF,qB),"calendar-close":xt(yO,cD),"calendar-schedule":xt(xO,uD),"calendar-todo":xt(SO,dD),close:xt(NO,hD),check:xt(MO,fD),archive:xt(VF,tD),search:xt(CF,GB),copy:xt(oR,wD),link:xt(BR,LD),"external-link":xt(XO,bD),download:xt(PO,gD),undo:xt(tO,sD),send:xt(__,A_),image:xt(C_,E_),settings:xt(EF,YB),sliders:xt(jO,yD),"log-in":xt(VR,OD),"chevron-down":xt(QF,oD),"chevron-right":xt(lO,rD),"chevron-up":xt(fO,lD),"arrow-up":xt(__,A_),"arrow-down":xt(YF,nD),"arrow-right":xt(sO,iD),minus:xt(EB,KD),"panel-collapse":xt(IF,ZB),"panel-expand":xt(FF,XB),expand:xt(GO,kD),collapse:xt(RO,mD),list:xt(UR,FD),sort:xt(hB,zD),grip:xt(zO,vD),folder:xt(kF,VB),"folder-closed":xt(pF,jB),"folder-plus":xt(vR,AD),"folder-solid":xt(bR,MD),file:xt(S_,M_),"file-text":xt(dR,SD),"file-edit":xt(rR,_D),"file-plus":xt(eR,xD),"file-off":xt(S_,M_),attachment:xt(BF,QB),"image-off":xt(C_,E_),code:xt($O,pD),terminal:xt(FB,YD),pencil:xt(sB,PD),tool:xt(HB,XD),glob:xt(mO,aD),globe:xt(TR,ND),"check-list":xt(HR,$D),bolt:xt(pR,CD),"git-fork":xt(_R,ED),"git-pull-request":xt(AR,TD),message:xt(QR,BD),mail:xt(YR,RD),user:xt(UB,QD),info:xt(FR,ID),"help-circle":xt(uB,WD),"alert-triangle":xt(UF,eD),clock:xt(BB,ZD),sparkles:xt(gB,UD),target:xt(IB,GD),pause:xt(tB,DD),play:xt(lB,HD),stop:xt(CB,VD),star:xt(kB,qD),"star-outline":xt(wB,jD),"dots-horizontal":xt(wF,KB)};function JD(e){return u6[e]}function eP(e,t){return e.replace(/\s(?:width|height)="[^"]*"/g,"").replace(/^<svg\b/,`<svg class="kw-icon" width="${t}" height="${t}" aria-hidden="true"`)}function Bc(e,t="md"){const n=u6[e];return n?eP(n.svg,c6[t]):""}const L4e=[["Actions",["plus","attachment","chat-new","close","check","search","copy","link","external-link","download","undo","send","image","settings","sliders","log-in"]],["Navigation & layout",["chevron-down","chevron-right","chevron-up","arrow-up","arrow-down","arrow-right","minus","panel-collapse","panel-expand","expand","collapse","list","sort","grip"]],["Files & tools",["folder","folder-closed","folder-plus","folder-solid","file","file-text","file-edit","file-plus","file-off","image-off","code","terminal","pencil","tool","glob","globe","check-list","bolt","git-fork","git-pull-request","archive","target","calendar-schedule","calendar-todo","calendar-close"]],["Communication",["message","mail","user"]],["Status & media",["info","help-circle","alert-triangle","clock","sparkles","pause","play","stop","star","star-outline","dots-horizontal"]]],Ye=Qe({__name:"Icon",props:{name:{},size:{default:"md"},label:{}},setup(e){const t=e,n=D(()=>JD(t.name)),o=D(()=>c6[t.size]);return(s,i)=>n.value?(x(),Ae(Ro(n.value.component),{key:0,class:"kw-icon",width:o.value,height:o.value,"aria-label":e.label,"aria-hidden":e.label?void 0:!0},null,8,["width","height","aria-label","aria-hidden"])):ue("",!0)}}),tP={key:0,class:"ui-dialog__head"},nP={class:"ui-dialog__titles"},oP={key:0,class:"ui-dialog__title"},sP={key:1,class:"ui-dialog__desc"},iP={class:"ui-dialog__body"},rP={key:1,class:"ui-dialog__foot"},lP='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])',aP=Qe({__name:"Dialog",props:{open:{type:Boolean},title:{},description:{},closeOnOverlay:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0},size:{default:"md"},height:{default:"auto"},padded:{type:Boolean,default:!0},initialFocus:{}},emits:["update:open","close"],setup(e,{emit:t}){const n=e,o=t,s=ne(null);let i=null;function r(){o("update:open",!1),o("close")}function l(){return s.value?Array.from(s.value.querySelectorAll(lP)):[]}function a(){const{initialFocus:d}=n;return d?typeof d=="function"?d()??null:typeof d=="string"?s.value?.querySelector(d)??null:s.value?.contains(d)?d:null:null}function c(d){if(!n.open)return;if(d.key==="Escape"&&n.closeOnEsc){d.preventDefault(),r();return}if(d.key!=="Tab")return;const f=l(),h=f[0],p=f[f.length-1];if(!h||!p){d.preventDefault(),s.value?.focus();return}const m=document.activeElement;d.shiftKey&&m===h?(d.preventDefault(),p.focus()):!d.shiftKey&&m===p&&(d.preventDefault(),h.focus())}function u(d){n.closeOnOverlay&&d.target===d.currentTarget&&r()}return et(()=>n.open,async d=>{if(d){Rc.value+=1,i=document.activeElement,await kt();const f=a(),h=l();(f??h[0]??s.value)?.focus()}else Rc.value=Math.max(0,Rc.value-1),i instanceof HTMLElement&&(i.focus(),i=null)},{immediate:!0}),typeof window<"u"&&window.addEventListener("keydown",c),so(()=>{typeof window<"u"&&window.removeEventListener("keydown",c),n.open&&(Rc.value=Math.max(0,Rc.value-1))}),(d,f)=>(x(),Ae(v1,{to:"body"},[e.open?(x(),E("div",{key:0,class:"ui-dialog__overlay",onMousedown:u},[_("div",{ref_key:"panel",ref:s,class:We(["ui-dialog",[`ui-dialog--${e.size}`,{"ui-dialog--flush":!e.padded,"ui-dialog--fixed-height":e.height==="fixed"}]]),role:"dialog","aria-modal":"true",tabindex:"-1"},[e.title||d.$slots.head?(x(),E("div",tP,[zn(d.$slots,"head",{},()=>[_("div",nP,[e.title?(x(),E("div",oP,R(e.title),1)):ue("",!0),e.description?(x(),E("div",sP,R(e.description),1)):ue("",!0)])],!0),fe(Kn,{class:"ui-dialog__close",size:"sm",label:"Close",onClick:r},{default:Le(()=>[fe(Ye,{name:"close",size:"md"})]),_:1})])):ue("",!0),_("div",iP,[zn(d.$slots,"default",{},void 0,!0)]),d.$slots.foot?(x(),E("div",rP,[zn(d.$slots,"foot",{},void 0,!0)])):ue("",!0)],2)],32)):ue("",!0)]))}}),Qr=ft(aP,[["__scopeId","data-v-5ae91c30"]]),cP={class:"sd-head"},uP=["placeholder","aria-label"],dP=["aria-selected","onClick","onMousemove"],fP={class:"sd-meta"},hP=["innerHTML"],pP={class:"sd-time"},mP=["innerHTML"],gP=["innerHTML"],vP={key:1,class:"sd-empty"},yP={class:"sd-hint"},kP=200,bP=Qe({__name:"SearchSessionsDialog",props:{sessions:{},activeId:{}},emits:["select","close"],setup(e,{emit:t}){const{t:n}=Ot(),o=e,s=t,i=ne(!0),r=ne(""),l=ne(null),a=ne(null),c=D(()=>{const k=r.value.trim().toLowerCase(),g=[];for(const v of o.sessions){const b=v.title??"",A=v.lastPrompt??"",I=v.workspaceName??"",T=k.length>0&&b.toLowerCase().includes(k),M=k.length>0&&A.toLowerCase().includes(k),$=k.length>0&&I.toLowerCase().includes(k);if(!(k.length>0&&!T&&!M&&!$)&&(g.push({session:v,inTitle:T,inWorkspace:$,snippetText:A?rF(A,r.value):""}),g.length>=kP))break}return g}),u=ne(0);et(r,()=>{u.value=0});function d(k){const g=c.value.length;return g===0?0:Math.max(0,Math.min(g-1,k))}async function f(){await kt(),a.value?.querySelector('[aria-selected="true"]')?.scrollIntoView({block:"nearest"})}function h(k){u.value=d(u.value+k),f()}function p(k){s("select",k),s("close")}function m(){const k=c.value[u.value];k&&p(k.session.id)}function y(k){k.key==="ArrowDown"?(k.preventDefault(),h(1)):k.key==="ArrowUp"?(k.preventDefault(),h(-1)):k.key==="Enter"&&(k.preventDefault(),m())}return wn(()=>{l.value?.focus()}),(k,g)=>(x(),Ae(Qr,{open:i.value,"onUpdate:open":g[1]||(g[1]=v=>i.value=v),size:"lg",height:"fixed",padded:!1,onClose:g[2]||(g[2]=v=>s("close"))},{head:Le(()=>[_("div",cP,[fe(Ye,{class:"sd-search-icon",name:"search",size:"md"}),Wn(_("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":g[0]||(g[0]=v=>r.value=v),class:"sd-input",type:"text",placeholder:C(n)("sidebar.searchPlaceholder"),"aria-label":C(n)("sidebar.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:y},null,40,uP),[[ws,r.value]])])]),foot:Le(()=>[_("span",yP,R(C(n)("sidebar.searchHint")),1)]),default:Le(()=>[_("div",{ref_key:"listRef",ref:a,class:"sd-list",role:"listbox"},[c.value.length>0?(x(!0),E(Pe,{key:0},lt(c.value,(v,b)=>(x(),E("button",{key:v.session.id,class:We(["sd-row",{on:b===u.value,active:v.session.id===e.activeId}]),role:"option","aria-selected":b===u.value,onClick:A=>p(v.session.id),onMousemove:A=>u.value=b},[_("span",fP,[fe(Ye,{class:"sd-folder",name:"folder-closed",size:"sm"}),_("span",{class:"sd-ws",innerHTML:C(bg)(v.session.workspaceName??v.session.workspaceId??"",v.inWorkspace?r.value:"")},null,8,hP),_("span",pP,R(v.session.time),1)]),_("span",{class:"sd-title",innerHTML:C(bg)(v.session.title,v.inTitle?r.value:"")},null,8,mP),v.snippetText?(x(),E("span",{key:0,class:"sd-snippet",innerHTML:C(bg)(v.snippetText,r.value)},null,8,gP)):ue("",!0)],42,dP))),128)):(x(),E("div",vP,R(C(n)("sidebar.searchNoResults")),1))],512)]),_:1},8,["open"]))}}),xP=ft(bP,[["__scopeId","data-v-546f6e6f"]]),wP=["aria-label"],_P=Qe({__name:"Spinner",props:{size:{default:"md"},label:{default:"Loading"}},setup(e){return(t,n)=>(x(),E("span",{class:We(["ui-spinner",`ui-spinner--${e.size}`]),role:"status","aria-label":e.label},[...n[0]||(n[0]=[_("svg",{class:"ui-spinner__svg",viewBox:"0 0 24 24","aria-hidden":"true"},[_("circle",{class:"ui-spinner__track",cx:"12",cy:"12",r:"9"}),_("circle",{class:"ui-spinner__arc",cx:"12",cy:"12",r:"9"})],-1)])],10,wP))}}),Hs=ft(_P,[["__scopeId","data-v-abb00d1e"]]),SP={key:0,class:"ui-badge__dot","aria-hidden":"true"},CP=Qe({__name:"Badge",props:{variant:{default:"neutral"},size:{default:"md"},dot:{type:Boolean}},setup(e){return(t,n)=>(x(),E("span",{class:We(["ui-badge",[`ui-badge--${e.variant}`,`ui-badge--${e.size}`]])},[e.dot?(x(),E("span",SP)):ue("",!0),zn(t.$slots,"default",{},void 0,!0)],2))}}),qi=ft(CP,[["__scopeId","data-v-44fb1da1"]]),AP=Qe({__name:"Menu",setup(e,{expose:t}){const n=ne();return t({el:n}),(o,s)=>(x(),E("div",{ref_key:"el",ref:n,class:"ui-menu",role:"menu"},[zn(o.$slots,"default",{},void 0,!0)],512))}}),Ra=ft(AP,[["__scopeId","data-v-3366462d"]]),MP={key:0,class:"ui-menu-sep",role:"separator"},EP=["disabled"],TP=Qe({__name:"MenuItem",props:{active:{type:Boolean},danger:{type:Boolean},disabled:{type:Boolean},separator:{type:Boolean},size:{default:"md"}},emits:["click"],setup(e){return(t,n)=>e.separator?(x(),E("div",MP)):(x(),E("button",{key:1,class:We(["ui-menu-item",[`ui-menu-item--${e.size}`,{"is-active":e.active,"is-danger":e.danger}]]),type:"button",role:"menuitem",disabled:e.disabled,onClick:n[0]||(n[0]=o=>t.$emit("click",o))},[zn(t.$slots,"default",{},void 0,!0)],10,EP))}}),Tn=ft(TP,[["__scopeId","data-v-da8fb1fa"]]),al=6,cl=8,NP=150,IP=Qe({__name:"Tooltip",props:{text:{},placement:{default:"top"},maxWidth:{default:280},maxLines:{default:6}},setup(e){const t=e,n=ne(),o=ne(),s=ne(!1),i=ne(!1),r=ne({maxWidth:`${t.maxWidth}px`});let l,a=null,c;function u(){const m=o.value;if(!a||!m)return;const y=a.getBoundingClientRect(),k=m.offsetWidth,g=m.offsetHeight,v=window.innerWidth,b=window.innerHeight;let A=t.placement;A==="top"&&y.top-al-g<cl?A="bottom":A==="bottom"&&y.bottom+al+g>b-cl?A="top":A==="left"&&y.left-al-k<cl?A="right":A==="right"&&y.right+al+k>v-cl&&(A="left");let I=0,T=0;A==="top"?(I=y.top-al-g,T=y.left+y.width/2-k/2):A==="bottom"?(I=y.bottom+al,T=y.left+y.width/2-k/2):A==="left"?(I=y.top+y.height/2-g/2,T=y.left-al-k):(I=y.top+y.height/2-g/2,T=y.right+al),T=Math.min(Math.max(T,cl),v-cl-k),I=Math.min(Math.max(I,cl),b-cl-g),r.value={maxWidth:`${t.maxWidth}px`,top:`${Math.round(I)}px`,left:`${Math.round(T)}px`}}function d(){t.text&&(window.clearTimeout(l),l=window.setTimeout(()=>{s.value=!0,i.value=!1,kt(()=>{u(),i.value=!0})},NP))}function f(){window.clearTimeout(l),s.value=!1,i.value=!1}function h(){s.value&&f()}function p(m){m!==a&&(a&&(a.removeEventListener("mouseenter",d),a.removeEventListener("mouseleave",f),a.removeEventListener("focusin",d),a.removeEventListener("focusout",f)),a=m,a&&(a.addEventListener("mouseenter",d),a.addEventListener("mouseleave",f),a.addEventListener("focusin",d),a.addEventListener("focusout",f)))}return wn(()=>{const m=n.value??null;p(m?.firstElementChild??m),m&&(c=new MutationObserver(()=>{const y=m.firstElementChild??null;y!==a&&(f(),p(y??m))}),c.observe(m,{childList:!0})),window.addEventListener("scroll",h,!0),window.addEventListener("resize",h)}),so(()=>{window.clearTimeout(l),c?.disconnect(),p(null),window.removeEventListener("scroll",h,!0),window.removeEventListener("resize",h)}),(m,y)=>(x(),E(Pe,null,[_("span",{ref_key:"trigger",ref:n,class:"ui-tip"},[zn(m.$slots,"default",{},void 0,!0)],512),(x(),Ae(v1,{to:"body"},[Wn(_("div",{ref_key:"bubble",ref:o,class:We(["ui-tip__bubble",{positioned:i.value}]),style:tn([r.value,{"--tip-lines":e.maxLines}]),role:"tooltip"},R(e.text),7),[[wi,s.value]])]))],64))}}),rn=ft(IP,[["__scopeId","data-v-3884c2bc"]]),LP={class:"row"},$P={class:"lead","aria-hidden":"true"},FP={key:1,class:"unread-dot"},OP={class:"left"},RP=["onKeydown"],BP={class:"act"},DP={class:"ts"},PP={class:"menu-time"},HP=Qe({__name:"SessionRow",props:{session:{},active:{type:Boolean},approvalCount:{default:0},questionCount:{default:0},unread:{type:Boolean,default:!1}},emits:["select","rename","archive","fork","export"],setup(e,{expose:t,emit:n}){const{t:o}=Ot(),s=e,i=n;function r(S){const B=new Date(S);if(Number.isNaN(B.getTime()))return S;const W=z=>String(z).padStart(2,"0");return`${B.getFullYear()}-${W(B.getMonth()+1)}-${W(B.getDate())} ${W(B.getHours())}:${W(B.getMinutes())}`}const l=D(()=>s.session.updatedAt?r(s.session.updatedAt):s.session.time),a=ne(!1),c=ne(null),u=ne(null),d=ne({});function f(S){const B=S.target;u.value?.el?.contains(B)||c.value?.el?.contains(B)||m()}function h(){const S=c.value?.el;if(!S)return;const B=u.value?.el,W=S.getBoundingClientRect(),z=4,L=8,O=B?.offsetHeight??0,j=B?.offsetWidth??0;let Z=W.bottom+z;Z+O>window.innerHeight-L&&(Z=Math.max(L,W.top-O-z));let ie=W.right-j;ie<L&&(ie=L),d.value={top:`${Math.round(Z)}px`,left:`${Math.round(ie)}px`}}async function p(S){if(S.stopPropagation(),a.value){m();return}a.value=!0,setTimeout(()=>document.addEventListener("mousedown",f),0),window.addEventListener("resize",m),await kt(),h()}function m(){a.value=!1,document.removeEventListener("mousedown",f),window.removeEventListener("resize",m)}In(()=>{document.removeEventListener("mousedown",f),window.removeEventListener("resize",m)});const y=ne(!1),k=ne(""),g=ne(null);async function v(){m(),y.value=!0,k.value=s.session.title,await kt();try{g.value?.focus(),g.value?.select()}catch{}}function b(){const S=k.value.trim();S&&i("rename",s.session.id,S),y.value=!1}function A(){y.value=!1}const I=ne(!1),T=ne(!1);async function M(){const S=await Xo(s.session.id);I.value=S,T.value=!S,setTimeout(()=>{I.value=!1,T.value=!1,m()},1500)}function $(){m(),i("fork",s.session.id)}function N(){m(),i("export",s.session.id)}function F(){m(),i("archive",s.session.id)}return t({closeMenu:m}),(S,B)=>(x(),E("div",{class:We(["se",{on:e.active}]),onClick:B[4]||(B[4]=W=>i("select",e.session.id))},[_("div",LP,[_("span",$P,[e.session.busy?(x(),Ae(Hs,{key:0,size:"sm"})):e.unread?(x(),E("span",FP)):ue("",!0)]),_("div",OP,[y.value?Wn((x(),E("input",{key:0,ref_key:"renameInputRef",ref:g,"onUpdate:modelValue":B[0]||(B[0]=W=>k.value=W),class:"rename-input",onClick:B[1]||(B[1]=Ct(()=>{},["stop"])),onKeydown:[ur(Ct(b,["stop"]),["enter"]),ur(Ct(A,["stop"]),["esc"])],onBlur:b},null,40,RP)),[[ws,k.value]]):(x(),E("span",{key:1,class:"t",onDblclick:Ct(v,["stop"])},R(e.session.title),33))]),fe(rn,{text:C(o)("workspace.awaitingAnswerTitle")},{default:Le(()=>[!y.value&&(e.questionCount>0||e.session.pendingInteraction==="question")?(x(),Ae(qi,{key:0,variant:"info",size:"sm"},{default:Le(()=>[nt(R(C(o)("workspace.awaitingAnswer")),1)]),_:1})):ue("",!0)]),_:1},8,["text"]),fe(rn,{text:C(o)("workspace.awaitingPermissionTitle")},{default:Le(()=>[!y.value&&(e.approvalCount>0||e.session.pendingInteraction==="approval")?(x(),Ae(qi,{key:0,variant:"warning",size:"sm"},{default:Le(()=>[nt(R(C(o)("workspace.awaitingPermission")),1)]),_:1})):ue("",!0)]),_:1},8,["text"]),fe(rn,{text:C(o)("workspace.abortedTitle")},{default:Le(()=>[!y.value&&!e.session.busy&&e.session.pendingInteraction!=="question"&&e.session.pendingInteraction!=="approval"&&e.questionCount===0&&e.approvalCount===0&&(e.session.lastTurnReason==="cancelled"||e.session.lastTurnReason==="failed")?(x(),Ae(qi,{key:0,variant:"danger",size:"sm"},{default:Le(()=>[nt(R(C(o)("workspace.aborted")),1)]),_:1})):ue("",!0)]),_:1},8,["text"]),_("span",BP,[_("span",DP,R(e.session.time),1),y.value?ue("",!0):(x(),Ae(Kn,{key:0,ref_key:"kebabRef",ref:c,class:We(["kebab",{open:a.value}]),size:"sm",label:C(o)("sidebar.options"),onClick:B[2]||(B[2]=Ct(W=>p(W),["stop"]))},{default:Le(()=>[fe(Ye,{name:"dots-horizontal"})]),_:1},8,["class","label"]))])]),(x(),Ae(v1,{to:"body"},[a.value?(x(),Ae(Ra,{key:0,ref_key:"menuRef",ref:u,class:"menu",style:tn(d.value),onClick:B[3]||(B[3]=Ct(()=>{},["stop"]))},{default:Le(()=>[fe(Tn,{danger:T.value,onClick:M},{default:Le(()=>[fe(Ye,{name:I.value?"check":"copy",size:"sm"},null,8,["name"]),nt(" "+R(T.value?C(o)("sidebar.copyFailed"):I.value?C(o)("sidebar.copied"):C(o)("sidebar.copySessionId")),1)]),_:1},8,["danger"]),fe(Tn,{separator:""}),fe(Tn,{onClick:v},{default:Le(()=>[fe(Ye,{name:"pencil",size:"sm"}),nt(" "+R(C(o)("sidebar.rename")),1)]),_:1}),fe(Tn,{onClick:$},{default:Le(()=>[fe(Ye,{name:"git-fork",size:"sm"}),nt(" "+R(C(o)("sidebar.fork")),1)]),_:1}),fe(Tn,{onClick:N},{default:Le(()=>[fe(Ye,{name:"download",size:"sm"}),nt(" "+R(C(o)("sidebar.export")),1)]),_:1}),fe(Tn,{danger:"",onClick:F},{default:Le(()=>[fe(Ye,{name:"archive",size:"sm"}),nt(" "+R(C(o)("sidebar.archive")),1)]),_:1}),fe(Tn,{separator:""}),_("div",PP,R(l.value),1)]),_:1},8,["style"])):ue("",!0)]))],2))}}),WP=ft(HP,[["__scopeId","data-v-b8e37ad9"]]),zP={class:"gh-top"},UP={class:"gh-name"},qP=["inert"],jP=["disabled"],VP={class:"show-more-label"},KP={class:"show-more-label"},GP={key:2,class:"group-empty"},YP=Qe({__name:"WorkspaceGroup",props:{group:{},activeWorkspaceId:{},activeId:{},renamingId:{},renameValue:{},renameInputRef:{},pendingBySession:{},unreadBySession:{},wsMenuOpenId:{},dragging:{type:Boolean},isCollapsed:{type:Function},isExpanded:{type:Function}},emits:["groupClick","groupContextmenu","toggleWsMenu","createInWorkspace","selectSession","renameSession","archiveSession","forkSession","exportSession","loadMore","toggleExpand","confirmRename","cancelRename","updateRenameValue","wsDragstart","wsDragend"],setup(e,{emit:t}){const{t:n}=Ot(),o=e,s=t,i=D({get:()=>o.renameValue,set:f=>s("updateRenameValue",f)}),r=D(()=>{if(o.isExpanded(o.group.workspace.id))return o.group.sessions;const f=o.group.sessions.slice(0,o.group.initialCount);if(o.activeId&&!f.some(h=>h.id===o.activeId)){const h=o.group.sessions.find(p=>p.id===o.activeId);if(h)return[...f,h]}return f}),l=D(()=>o.group.sessions.length>o.group.initialCount);function a(){return Math.max(0,o.group.workspace.sessionCount-o.group.sessions.length)}function c(){return o.group.sessions.length-o.group.initialCount}function u(f){o.renameInputRef.value=f instanceof HTMLInputElement?f:null}function d(f){f.dataTransfer&&(f.dataTransfer.effectAllowed="move",f.dataTransfer.setData("text/plain",o.group.workspace.id),s("wsDragstart",o.group.workspace.id))}return(f,h)=>(x(),E("div",{class:We(["group",{dragging:e.dragging}])},[_("div",{class:We(["gh",{on:e.group.workspace.id===e.activeWorkspaceId,collapsed:e.isCollapsed(e.group.workspace.id)}]),draggable:"true",onClick:h[7]||(h[7]=Ct(p=>s("groupClick",e.group.workspace.id,p),["stop"])),onContextmenu:h[8]||(h[8]=p=>s("groupContextmenu",e.group.workspace,p)),onDragstart:d,onDragend:h[9]||(h[9]=p=>s("wsDragend"))},[_("div",zP,[e.isCollapsed(e.group.workspace.id)?(x(),Ae(Ye,{key:0,class:"gh-folder",name:"folder-closed"})):(x(),Ae(Ye,{key:1,class:"gh-folder",name:"folder"})),e.renamingId!==e.group.workspace.id?(x(),Ae(rn,{key:2,text:e.group.workspace.root},{default:Le(()=>[_("span",UP,R(e.group.workspace.name),1)]),_:1},8,["text"])):Wn((x(),E("input",{key:3,ref:u,"onUpdate:modelValue":h[0]||(h[0]=p=>i.value=p),class:"gh-rename",type:"text",onKeydown:[h[1]||(h[1]=ur(p=>s("confirmRename"),["enter"])),h[2]||(h[2]=ur(p=>s("cancelRename"),["esc"]))],onBlur:h[3]||(h[3]=p=>s("cancelRename")),onClick:h[4]||(h[4]=Ct(()=>{},["stop"]))},null,544)),[[ws,i.value]]),e.renamingId!==e.group.workspace.id?(x(),E("div",{key:4,class:We(["gh-actions",{open:e.wsMenuOpenId===e.group.workspace.id}])},[fe(Kn,{class:We(["gh-more",{open:e.wsMenuOpenId===e.group.workspace.id}]),size:"sm",label:C(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":e.wsMenuOpenId===e.group.workspace.id,onClick:h[5]||(h[5]=Ct(p=>s("toggleWsMenu",e.group.workspace,p),["stop"]))},{default:Le(()=>[fe(Ye,{name:"dots-horizontal"})]),_:1},8,["class","label","aria-expanded"]),fe(Kn,{class:"gh-add",size:"sm",label:C(n)("workspace.newInGroup"),onClick:h[6]||(h[6]=Ct(p=>s("createInWorkspace",e.group.workspace.id),["stop"]))},{default:Le(()=>[fe(Ye,{name:"chat-new"})]),_:1},8,["label"])],2)):ue("",!0)])],34),_("div",{class:We(["group-sessions",{collapsed:e.isCollapsed(e.group.workspace.id)}]),inert:e.isCollapsed(e.group.workspace.id)},[(x(!0),E(Pe,null,lt(r.value,p=>(x(),Ae(WP,{key:p.id,session:p,active:p.id===e.activeId,"approval-count":e.pendingBySession[p.id]?.approvals??0,"question-count":e.pendingBySession[p.id]?.questions??0,unread:e.unreadBySession[p.id]??!1,onSelect:h[10]||(h[10]=m=>s("selectSession",m)),onRename:h[11]||(h[11]=(m,y)=>s("renameSession",m,y)),onArchive:h[12]||(h[12]=m=>s("archiveSession",m)),onFork:h[13]||(h[13]=m=>s("forkSession",m)),onExport:h[14]||(h[14]=m=>s("exportSession",m))},null,8,["session","active","approval-count","question-count","unread"]))),128)),e.group.hasMore||e.group.loadingMore?(x(),E("button",{key:0,class:"show-more",disabled:e.group.loadingMore,onClick:h[15]||(h[15]=Ct(p=>s("loadMore",e.group.workspace.id),["stop"]))},[h[17]||(h[17]=_("span",{class:"show-more-lead","aria-hidden":"true"},null,-1)),_("span",VP,R(e.group.loadingMore?C(n)("sidebar.loadingMore"):C(n)("sidebar.showMore",{count:a()})),1)],8,jP)):ue("",!0),l.value?(x(),E("button",{key:1,class:"show-more",onClick:h[16]||(h[16]=Ct(p=>s("toggleExpand",e.group.workspace.id),["stop"]))},[h[18]||(h[18]=_("span",{class:"show-more-lead","aria-hidden":"true"},null,-1)),_("span",KP,R(e.isExpanded(e.group.workspace.id)?C(n)("sidebar.showLess"):C(n)("sidebar.showAll",{count:c()})),1)])):ue("",!0),e.group.sessions.length===0?(x(),E("div",GP,R(C(n)("sidebar.noSessions")),1)):ue("",!0)],10,qP)],2))}}),ZP=ft(YP,[["__scopeId","data-v-775de356"]]),XP="kimi_desktop",QP="platform",T_="dimi-desktop",N_="dimi-desktop-platform";function JP(){let e=!1,t=null;try{const n=new URLSearchParams(window.location.search);n.has(XP)?(sessionStorage.setItem(T_,"1"),e=!0):e=e||sessionStorage.getItem(T_)==="1";const o=n.get(QP);o?(sessionStorage.setItem(N_,o),t=o):t=sessionStorage.getItem(N_)}catch{}return{isDesktop:e,platform:t}}const gy=JP(),eH=gy.isDesktop,su=gy.isDesktop&&gy.platform==="darwin",tH={class:"ui-kbd"},nH=Qe({__name:"Kbd",props:{keys:{}},setup(e){return(t,n)=>(x(),E("span",tH,[(x(!0),E(Pe,null,lt(e.keys,o=>(x(),E("kbd",{key:o,class:"ui-kbd__key"},R(o),1))),128))]))}}),Er=ft(nH,[["__scopeId","data-v-f7d12d7c"]]),oH={class:"ch"},sH={class:"ch-brand"},iH={class:"btn-wrap"},rH={class:"search-input"},lH={key:0,class:"empty"},aH={class:"side-section-label"},cH={class:"side-section-title"},uH={class:"side-section-actions"},dH=["onDragover","onDrop"],fH={class:"side-footer"},hH={class:"section-menu-check"},pH={class:"section-menu-check"},mH=1e3,gH=Qe({__name:"Sidebar",props:{activeWorkspace:{default:null},activeWorkspaceId:{default:null},sessions:{},groups:{},activeId:{},workspaceSortMode:{},attentionBySession:{default:()=>({})},pendingBySession:{default:()=>({})},unreadBySession:{default:()=>({})},colWidth:{default:220},collapsed:{type:Boolean,default:!1},dragging:{type:Boolean,default:!1}},emits:["select","create","createInWorkspace","selectWorkspace","addWorkspace","rename","archive","fork","export","renameWorkspace","deleteWorkspace","reorderWorkspaces","setWorkspaceSortMode","loadMoreSessions","loadAllSessions","openSettings","collapse"],setup(e,{emit:t}){const{t:n}=Ot(),o=!1,s=e,i=t,r=ne(!1),l=u()?["⌘","K"]:["Ctrl","K"];function a(){i("loadAllSessions"),r.value=!0}function c(Je){(Je.metaKey||Je.ctrlKey)&&Je.key.toLowerCase()==="k"&&(Je.preventDefault(),a())}wn(()=>window.addEventListener("keydown",c)),so(()=>window.removeEventListener("keydown",c));function u(){if(typeof navigator>"u")return!1;if(/Mac|iPod|iPhone|iPad/.test(navigator.platform))return!0;const Je=navigator.userAgentData;return Je?.platform==="macOS"||Je?.platform==="iOS"}const d=ne(!1);function f(Je){d.value=Je.target.scrollTop>0}const h=ne(new Set(X$()));function p(Je){return h.value.has(Je)}function m(Je){const Ve=new Set(h.value);Ve.has(Je)?Ve.delete(Je):Ve.add(Je),h.value=Ve,kg(Ve)}function y(){const Je=new Set(s.groups.map(Ve=>Ve.workspace.id));h.value=Je,kg(Je)}function k(){const Je=new Set;h.value=Je,kg(Je)}const g=D(()=>s.groups.length>0&&s.groups.every(Je=>h.value.has(Je.workspace.id))),v=ne(new Set);function b(Je){return v.value.has(Je)}function A(Je){const Ve=new Set(v.value);Ve.has(Je)?Ve.delete(Je):Ve.add(Je),v.value=Ve}function I(Je){if(!v.value.has(Je)){const Ve=new Set(v.value);Ve.add(Je),v.value=Ve}i("loadMoreSessions",Je)}const T=ne(null),M=ne(null);function $(Je){T.value=Je}function N(){T.value=null,M.value=null}function F(Je){const Ve=Je.currentTarget.getBoundingClientRect();return Je.clientY<Ve.top+Ve.height/2?"before":"after"}function S(Je,Ve){T.value===null||T.value===Ve||(Je.preventDefault(),Je.dataTransfer&&(Je.dataTransfer.dropEffect="move"),M.value={id:Ve,position:F(Je)})}function B(Je){const Ve=T.value,It=M.value?.id===Je?M.value.position:"before";if(M.value=null,T.value=null,!Ve||Ve===Je)return;const Kt=nF(s.groups.map(Gt=>Gt.workspace.id),Ve,Je,It);i("reorderWorkspaces",Kt)}function W(Je,Ve){Ve.target.closest(".gh-more, .gh-add")||m(Je)}function z(Je){i("select",Je)}const L=ne(null),O=ne(""),j=ne(null);function Z(){return j}function ie(Je,Ve){L.value=Je,O.value=Ve,kt().then(()=>j.value?.focus())}function U(){const Je=L.value,Ve=O.value.trim();Je&&Ve&&i("renameWorkspace",Je,Ve),L.value=null}function q(){L.value=null}function ee(Je){O.value=Je}const le=ne(!1),oe=ne(null),re=ne({}),we=ne(null);function me(Je){we.value?.el&&!we.value.el.contains(Je.target)&&ae()}function Ee(Je,Ve){Ve.preventDefault(),Ve.stopPropagation(),oe.value=Je,re.value={top:`${Ve.clientY}px`,left:`${Ve.clientX}px`},le.value=!0,document.addEventListener("mousedown",me,!0)}function ae(){le.value=!1,document.removeEventListener("mousedown",me,!0),oe.value=null}function Y(){oe.value&&Xo(oe.value.root),ae()}function Q(){oe.value&&ie(oe.value.id,oe.value.name),ae()}function P(){const Je=oe.value;Je&&(ae(),i("deleteWorkspace",Je.id))}const G=ne(null),pe=ne(null),ve=ne({}),de=ne(null);function V(Je){const Ve=Je.target;Ve.closest(".gh-more")||Ve.closest(".ws-menu")||he()}async function se(Je,Ve){if(G.value===Je.id){he();return}const It=Ve.currentTarget;pe.value=Je,G.value=Je.id,document.addEventListener("mousedown",V),window.addEventListener("resize",he),await kt();const Kt=de.value?.el,Gt=It.getBoundingClientRect(),Sn=4,mt=8,Rn=Kt?.offsetHeight??0,dn=Kt?.offsetWidth??0;let nn=Gt.bottom+Sn;nn+Rn>window.innerHeight-mt&&(nn=Math.max(mt,Gt.top-Rn-Sn));let fn=Gt.right-dn;fn<mt&&(fn=mt),ve.value={top:`${Math.round(nn)}px`,left:`${Math.round(fn)}px`}}function he(){G.value=null,pe.value=null,document.removeEventListener("mousedown",V),window.removeEventListener("resize",he)}function ke(Je){Xo(Je.root),he()}function Te(Je){ie(Je.id,Je.name),he()}function ze(Je){he(),i("deleteWorkspace",Je.id)}const ye=ne(!1),be=ne({}),Ge=ne(null);function tt(Je){const Ve=Je.target;Ve.closest(".side-section-kebab")||Ve.closest(".section-menu")||ut()}async function rt(Je){if(ye.value){ut();return}const Ve=Je.currentTarget;ye.value=!0,document.addEventListener("mousedown",tt),window.addEventListener("resize",ut),await kt();const It=Ge.value?.el,Kt=Ve.getBoundingClientRect(),Gt=4,Sn=8,mt=It?.offsetHeight??0,Rn=It?.offsetWidth??0;let dn=Kt.bottom+Gt;dn+mt>window.innerHeight-Sn&&(dn=Math.max(Sn,Kt.top-mt-Gt));let nn=Kt.right-Rn;nn<Sn&&(nn=Sn),be.value={top:`${Math.round(dn)}px`,left:`${Math.round(nn)}px`}}function ut(){ye.value=!1,document.removeEventListener("mousedown",tt),window.removeEventListener("resize",ut)}function vt(Je){i("setWorkspaceSortMode",Je),ut()}so(()=>{document.removeEventListener("mousedown",me,!0),document.removeEventListener("mousedown",V),document.removeEventListener("mousedown",tt),window.removeEventListener("resize",he),window.removeEventListener("resize",ut)});const Nt=ne(null);let _t;function Rt(){const Je=Nt.value;Je&&(Je.classList.remove("blink-now"),Je.getBoundingClientRect(),Je.classList.add("blink-now"),clearTimeout(_t),_t=setTimeout(()=>Je.classList.remove("blink-now"),300))}const ln=Hi(()=>ps(()=>import("./DesignSystemView-Gp4T3sr4.js"),__vite__mapDeps([0,1]))),Ln=ne(!1);let Wt,un=!1;function vn(Je){un=!1,clearTimeout(Wt),Je.currentTarget.setPointerCapture?.(Je.pointerId),Wt=setTimeout(()=>{un=!0,Ln.value=!0},mH)}function Xt(Je){clearTimeout(Wt);const Ve=Je.currentTarget;Ve.hasPointerCapture?.(Je.pointerId)&&Ve.releasePointerCapture(Je.pointerId)}function An(){if(un){un=!1;return}Rt()}return so(()=>{clearTimeout(Wt)}),(Je,Ve)=>(x(),E("aside",{class:We(["side",{"macos-desktop":C(su),collapsed:e.collapsed,"no-anim":e.dragging}]),style:tn({width:e.collapsed?"0px":e.colWidth+"px"})},[_("div",{class:"col",style:tn({width:e.colWidth+"px"})},[_("div",oH,[_("div",sH,[C(su)?ue("",!0):(x(),E(Pe,{key:0},[(x(),E("svg",{ref_key:"logoRef",ref:Nt,class:We(["ch-logo",{"is-dev":C(o)}]),viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Dimi",onClick:An,onPointerdown:vn,onPointerup:Xt,onPointercancel:Xt},[...Ve[21]||(Ve[21]=[Bk('<defs data-v-2504adf9><mask id="dimiEyes" maskUnits="userSpaceOnUse" data-v-2504adf9><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-2504adf9></rect><g class="ch-eyes" fill="#000" data-v-2504adf9><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-2504adf9></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-2504adf9></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#dimiEyes)" data-v-2504adf9></rect>',2)])],34)),Ve[22]||(Ve[22]=_("span",{class:"ch-name"},"Dimi",-1))],64))]),C(su)?ue("",!0):(x(),Ae(Kn,{key:0,class:"ch-collapse",size:"sm",label:C(n)("sidebar.collapseSidebar"),onClick:Ve[0]||(Ve[0]=Ct(It=>i("collapse"),["stop"]))},{default:Le(()=>[fe(Ye,{name:"panel-collapse"})]),_:1},8,["label"]))]),_("div",iH,[_("button",{class:"btn-new-chat",type:"button",onClick:Ve[1]||(Ve[1]=Ct(It=>i("create"),["stop"]))},[fe(Ye,{name:"chat-new"}),_("span",null,R(C(n)("sidebar.newChat")),1)]),ue("",!0)]),_("div",{class:We(["search-wrap",{"search-wrap--scrolled":d.value}])},[_("button",{class:"search",type:"button",onClick:a},[fe(Ye,{class:"search-icon",name:"search"}),_("span",rH,R(C(n)("sidebar.search")),1),fe(Er,{keys:C(l)},null,8,["keys"])])],2),_("div",{class:"sessions",onScroll:f},[e.groups.length===0?(x(),E("div",lH,R(C(n)("workspace.noWorkspace")),1)):(x(),E(Pe,{key:1},[_("div",aH,[_("span",cH,R(C(n)("sidebar.workspaces")),1),_("div",uH,[fe(Kn,{class:"side-section-toggle",size:"sm",label:g.value?C(n)("sidebar.expandAll"):C(n)("sidebar.collapseAll"),onClick:Ve[3]||(Ve[3]=Ct(It=>g.value?k():y(),["stop"]))},{default:Le(()=>[g.value?(x(),Ae(Ye,{key:0,name:"expand"})):(x(),Ae(Ye,{key:1,name:"collapse"}))]),_:1},8,["label"]),fe(Kn,{class:"side-section-toggle side-section-kebab",size:"sm",label:C(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":ye.value,onClick:Ve[4]||(Ve[4]=Ct(It=>rt(It),["stop"]))},{default:Le(()=>[fe(Ye,{name:"dots-horizontal"})]),_:1},8,["label","aria-expanded"])])]),(x(!0),E(Pe,null,lt(e.groups,It=>(x(),E("div",{key:It.workspace.id,class:We(["ws-drop-target",{"drop-before":M.value?.id===It.workspace.id&&M.value.position==="before","drop-after":M.value?.id===It.workspace.id&&M.value.position==="after"}]),onDragover:Kt=>S(Kt,It.workspace.id),onDrop:Kt=>B(It.workspace.id)},[fe(ZP,{group:It,"active-workspace-id":e.activeWorkspaceId,"active-id":e.activeId,"renaming-id":L.value,"rename-value":O.value,"rename-input-ref":Z(),"pending-by-session":e.pendingBySession,"unread-by-session":e.unreadBySession,"ws-menu-open-id":G.value,dragging:T.value===It.workspace.id,"is-collapsed":p,"is-expanded":b,onGroupClick:W,onGroupContextmenu:Ee,onToggleWsMenu:se,onCreateInWorkspace:Ve[5]||(Ve[5]=Kt=>i("createInWorkspace",Kt)),onSelectSession:z,onRenameSession:Ve[6]||(Ve[6]=(Kt,Gt)=>i("rename",Kt,Gt)),onArchiveSession:Ve[7]||(Ve[7]=Kt=>i("archive",Kt)),onForkSession:Ve[8]||(Ve[8]=Kt=>i("fork",Kt)),onExportSession:Ve[9]||(Ve[9]=Kt=>i("export",Kt)),onLoadMore:I,onToggleExpand:A,onConfirmRename:U,onCancelRename:q,onUpdateRenameValue:ee,onWsDragstart:$,onWsDragend:N},null,8,["group","active-workspace-id","active-id","renaming-id","rename-value","rename-input-ref","pending-by-session","unread-by-session","ws-menu-open-id","dragging"])],42,dH))),128))],64))],32),_("div",fH,[_("button",{class:"btn-settings",type:"button",onClick:Ve[10]||(Ve[10]=Ct(It=>i("openSettings"),["stop"]))},[fe(Ye,{name:"settings"}),_("span",null,R(C(n)("settings.title")),1)])])],4),le.value?(x(),Ae(Ra,{key:0,ref_key:"ghMenuRef",ref:we,class:"gh-menu",style:tn(re.value),onClick:Ve[11]||(Ve[11]=Ct(()=>{},["stop"]))},{default:Le(()=>[fe(Tn,{onClick:Y},{default:Le(()=>[nt(R(C(n)("sidebar.copyPath")),1)]),_:1}),fe(Tn,{onClick:Q},{default:Le(()=>[nt(R(C(n)("sidebar.rename")),1)]),_:1}),fe(Tn,{danger:"",onClick:P},{default:Le(()=>[nt(R(C(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):ue("",!0),G.value!==null&&pe.value?(x(),Ae(Ra,{key:1,ref_key:"wsMenuRef",ref:de,class:"ws-menu",style:tn(ve.value),onClick:Ve[15]||(Ve[15]=Ct(()=>{},["stop"]))},{default:Le(()=>[fe(Tn,{onClick:Ve[12]||(Ve[12]=It=>ke(pe.value))},{default:Le(()=>[nt(R(C(n)("sidebar.copyPath")),1)]),_:1}),fe(Tn,{separator:""}),fe(Tn,{onClick:Ve[13]||(Ve[13]=It=>Te(pe.value))},{default:Le(()=>[nt(R(C(n)("sidebar.rename")),1)]),_:1}),fe(Tn,{separator:""}),fe(Tn,{danger:"",onClick:Ve[14]||(Ve[14]=It=>ze(pe.value))},{default:Le(()=>[nt(R(C(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):ue("",!0),ye.value?(x(),Ae(Ra,{key:2,ref_key:"sectionMenuRef",ref:Ge,class:"section-menu",style:tn(be.value),onClick:Ve[18]||(Ve[18]=Ct(()=>{},["stop"]))},{default:Le(()=>[fe(Tn,{onClick:Ve[16]||(Ve[16]=It=>vt("manual"))},{default:Le(()=>[_("span",hH,[e.workspaceSortMode==="manual"?(x(),Ae(Ye,{key:0,name:"check",size:"sm"})):ue("",!0)]),nt(" "+R(C(n)("sidebar.sortManual")),1)]),_:1}),fe(Tn,{onClick:Ve[17]||(Ve[17]=It=>vt("recent"))},{default:Le(()=>[_("span",pH,[e.workspaceSortMode==="recent"?(x(),Ae(Ye,{key:0,name:"check",size:"sm"})):ue("",!0)]),nt(" "+R(C(n)("sidebar.sortRecent")),1)]),_:1})]),_:1},8,["style"])):ue("",!0),r.value?(x(),Ae(xP,{key:3,sessions:e.sessions,"active-id":e.activeId,onSelect:z,onClose:Ve[19]||(Ve[19]=It=>r.value=!1)},null,8,["sessions","active-id"])):ue("",!0),(x(),Ae(v1,{to:"body"},[Ln.value?(x(),Ae(C(ln),{key:0,onClose:Ve[20]||(Ve[20]=It=>Ln.value=!1)})):ue("",!0)]))],6))}}),vH=ft(gH,[["__scopeId","data-v-2504adf9"]]);function yH(e){try{const t=uo(e);if(t===null)return null;const n=Number(t);return Number.isFinite(n)?n:null}catch{return null}}function kH(e,t){try{xo(e,String(t))}catch{}}function bH(e){const{storageKey:t,defaultWidth:n,min:o,max:s,reverse:i=!1}=e;function r(k){return Number.isFinite(k)?Math.min(xA(s),Math.max(o,Math.round(k))):n}const l=ne(r(yH(t)??n)),a=ne(!1);function c(k){const g=r(k);l.value=g,kH(t,g)}let u=0,d=0,f=null,h=-1;function p(k){if(!a.value)return;const g=k.clientX-u;c(d+(i?-g:g))}function m(){if(a.value){if(a.value=!1,typeof document<"u"&&(document.body.style.userSelect="",document.body.style.cursor=""),f){try{f.releasePointerCapture(h)}catch{}f.removeEventListener("pointermove",p),f.removeEventListener("pointerup",m),f.removeEventListener("pointercancel",m)}f=null,h=-1}}function y(k){k.preventDefault(),a.value=!0,u=k.clientX,d=r(l.value),f=k.currentTarget,h=k.pointerId,typeof document<"u"&&(document.body.style.userSelect="none",document.body.style.cursor="col-resize");try{f.setPointerCapture(h)}catch{}f.addEventListener("pointermove",p),f.addEventListener("pointerup",m),f.addEventListener("pointercancel",m)}return so(m),{width:l,dragging:a,clamp:r,setWidth:c,onPointerDown:y}}const xH=["aria-label"],wH=Qe({__name:"ResizeHandle",props:{storageKey:{},defaultWidth:{},min:{},max:{},reverse:{type:Boolean},ariaLabel:{}},emits:["update:width","update:dragging"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Ot(),{width:i,dragging:r,onPointerDown:l}=bH({storageKey:n.storageKey,defaultWidth:n.defaultWidth,min:n.min,max:()=>n.max,reverse:n.reverse});return o("update:width",i.value),et(i,a=>o("update:width",a)),et(r,a=>o("update:dragging",a)),(a,c)=>(x(),E("div",{class:We(["rh",{dragging:C(r)}]),role:"separator","aria-orientation":"vertical","aria-label":e.ariaLabel??C(s)("layout.resizeHandleAria"),onPointerdown:c[0]||(c[0]=(...u)=>C(l)&&C(l)(...u))},[...c[1]||(c[1]=[_("span",{class:"rh-bar","aria-hidden":"true"},null,-1)])],42,xH))}}),I_=ft(wH,[["__scopeId","data-v-877faec4"]]),_H={preview:"Preview",confirm:"Confirm",cancel:"Cancel"},SH={authBannerMessage:"Not signed in · Sign in to Dimi to start a conversation",authBannerLogin:"Sign in",authPageTitle:"Connect a model provider",authPageMessage:"Sign in with a supported account or enter an API key to start a conversation.",authPageLogin:"Choose provider",connecting:"Connecting…",connectRetrying:"Cannot reach the server — retrying…",internalBuildBanner:"Internal testing only"},CH={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",workspaces:"Workspaces",sortWorkspaces:"Sort workspaces",sortManual:"Manual",sortRecent:"Last edited",collapseAll:"Collapse all workspaces",expandAll:"Expand all workspaces",newSession:"New Session",newChat:"New Chat",newWorkspace:"New Workspace",emptyState:"No sessions yet · click New Session to start",archiveConfirm:"Archive this session? You can restore it later from Settings.",options:"Options",rename:"Rename",copyPath:"Copy path",copySessionId:"Copy session ID",copied:"Copied ✓",copyFailed:"Copy failed",archive:"Archive",fork:"Fork session",export:"Export session",delete:"Delete",removeWorkspace:"Remove workspace",brand:"Dimi",signedIn:"Signed in",signOut:"Sign out",notSignedIn:"Not signed in",signIn:"Sign in",language:"Language",daemon:"Daemon",noSessions:"No conversations yet",showMore:"Load {count} more conversations",showLess:"Show less",showAll:"Show {count} more conversations",loadingMore:"Loading…",collapseSidebar:"Collapse sidebar",expandSidebar:"Expand sidebar",searchPlaceholder:"Search sessions",search:"Search",searchHint:"↑↓ navigate · ↵ open · Esc close",searchNoResults:"No matching sessions"},AH={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",removeWorkspaceConfirm:'Remove workspace "{name}"?',swarmEnableConfirm:"Enable swarm mode? The agent will run multiple sub-agents in parallel.",goalStartConfirm:'Start goal: "{objective}"? The agent will run autonomously toward it.',scopeCurrent:"this workspace",scopeAll:"all workspaces",newInGroup:"New session in this workspace",addTitle:"Add workspace",recentLabel:"Recent folders",cancel:"Cancel",addFailed:"Couldn't open this folder. Check the path and try again.",openThisFolder:"Open this folder",up:"Up",browsing:"Browsing…",filterPlaceholder:"Filter subfolders…",searchPlaceholder:"Fuzzy-search subfolders, or paste an absolute path…",searching:"Searching…",noFilterMatch:"No subfolders match “{q}”",noSubfolders:"No subfolders here",browseHint:'Click a folder to enter it, then "Open this folder" to add it as a workspace.',checkingPath:"Checking path…",pathPickHint:"Path not found — did you mean:",noPathMatch:"Path not found — no matching folders under {parent}",badParent:"Parent directory does not exist: {parent}",pathFollowHint:'Folder located — press Enter or "Open this folder" to add it.',degradedPlaceholder:"Type an absolute path, press Enter to add…",degradedHint:"File browsing is unavailable — type an absolute path and press Enter to add.",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"},MH={jumpToLatestAria:"Jump to latest message",toc:"Conversation outline",newMessages:"Latest messages",loading:"Loading…",starting:"Starting conversation…",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?",yesterday:"Yesterday",loadOlder:"Load earlier messages",loadingOlder:"Loading earlier messages…",cron:{fired:"Scheduled reminder fired",missed:"Missed scheduled reminders",job:"job {id}",oneShot:"one-shot",coalesced:"{n} fires coalesced",missedCount:"{n} missed",finalDelivery:"final delivery",everyMinute:"Every minute",everyNMinutes:"Every {n} minutes",everyHour:"Every hour",everyNHours:"Every {n} hours",dailyAt:"Daily at {time}",weekdaysAt:"Weekdays at {time}",expand:"Show more",collapse:"Show less"}},EH={connectionConnected:"Connected",connectionConnecting:"Connecting…",connectionDisconnected:"Disconnected",ctxTooltip:"Used {used} / {max} tokens ({pct}%)",modelLabel:"Model",permissionManual:"Manual",permissionAuto:"Auto",permissionYolo:"YOLO",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",planDesc:"Have the agent make a plan before changing files",planOn:"on",planOff:"off",planTooltip:"Toggle plan mode (research before editing)",modesLabel:"Mode",goalLabel:"Goal",goalDesc:"Track one objective until it is complete",swarmLabel:"Swarm",swarmDesc:"Run parallel agents for broader exploration",modeOff:"Off",goalPlaceholder:"What should the agent achieve?",goalStart:"Start",goalPause:"Pause",goalResume:"Resume",goalCancel:"Cancel",goalCancelConfirm:"Cancel this goal? It cannot be resumed afterwards.",goalCancelConfirmYes:"Yes",goalCancelConfirmNo:"No",goalStatusActive:"Active",goalStatusPaused:"Paused",goalStatusBlocked:"Blocked",goalStatusComplete:"Complete",modeNotSupported:"Not supported",thinkingLabel:"thinking",thinkingTooltip:"Toggle thinking mode",thinkingOn:"On",thinkingOff:"Off",cacheNote:"Note: Switching models or thinking effort invalidates the existing prompt cache. Start a new chat to avoid extra token costs.",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"},TH={placeholder:"Type a message…",send:"Send ↵",queueLabel:"Queue",placeholderRunning:"Press Enter to queue · Ctrl+S to inject into the running turn",starting:"Sending…",queueAutoDrain:"sends automatically when the current turn ends",queueNext:"Up next",queueDragTitle:"Drag to reorder",editQueued:"Edit (load back into the input)",queuedAttachments:"attachment ×{n}",queuedHasImage:"Contains {n} image(s) — remove only, not editable",attachmentImage:"Image",attachmentVideo:"Video",attachmentFile:"File",attachmentOpenUnsupported:"Can’t open {name} — this file type isn’t supported",dropToAttach:"Drop files to attach",remove:"Remove",removeNamed:"Remove {name}",uploading:"Uploading",uploadFailed:"Upload failed",attachFile:"Attach file",previewAttachment:"Preview {name}",interrupt:"Interrupt",interruptTitle:"Interrupt current operation",expandTitle:"Expand input for multi-line editing",collapseTitle:"Collapse input",emptyConversationTitle:"Dimi",emptyConversation:"No messages yet — type below to start the conversation",quickStartPlaceholder:"Type a message to start a new conversation…",thinkingSuffix:" · thinking",thinkingSuffixEffort:" · {level}"},NH={title:"Sign in with {provider}",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 dimi and try again",pollErrorTitle:"Lost connection to the daemon",pollErrorHint:"Authorization polling failed repeatedly. Check the dimi process and try again."},IH={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"},notConnected:"not connected",modelCount:"{count} models",refresh:"Refresh",signIn:"Sign in",connect:"Connect",logout:"Disconnect",refreshTitle:"Refresh {type}",logoutTitle:"Disconnect {type}",enterApiKey:"Enter API Key",fieldApiKey:"API Key",apiKeyRequired:"API Key cannot be empty",escClose:"Esc to close"},LH={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} 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"},$H={justNow:"just now"},FH={title:{shell:"Run command?",diff:"Apply changes?",file:"Write file?",fileop:"File operation?",url:"Fetch URL?",search:"Search?",invocation:"Invoke?",todo:"Update todo?",plan_review:"Ready to build with this plan?",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",approvePlan:"Approve plan",revise:"Revise",rejectAndExit:"Reject and Exit"},OH={title:"Question",step:"Q{current}/{total}",back:"‹ Back",nextQuestion:"Next question ›",otherDefault:"Other…",submit:"Submit",dismiss:"Dismiss",minimize:"Minimize",expand:"Expand"},RH={tag:"tasks",summary:"{run} running · {done} done",stop:"stop",defaultDescription:"Background task",dockTasks:"Background tasks",dockBash:"Bash",dockSubagent:"Sub Agent",dockTodos:"Todos",running:"running",closePanel:"Close panel",timingRunning:"Running · {time}",timingDone:"Done · {sec}s",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",openDetail:"Open",collapse:"Collapse",expand:"Expand"},BH={panelTitle:"Thinking",close:"Close"},DH={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"},PH={},HH={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",videoNoPreview:"Video file · {mime} · {size} · preview unavailable",binaryNoPreview:"Binary file · {mime} · {size} bytes · preview unavailable",unknownType:"unknown type",copyCode:"Copy code",enlargeImage:"Enlarge image",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"}},WH={searching:"Searching…",noMatch:"No matches"},zH={dismiss:"Close",errorLabel:"Error",noteLabel:"Note",agentError:{title:"Model request failed",connection:"Cannot connect to the model service",auth:"Model authentication failed",rateLimit:"Model rate limit reached",overloaded:"Model overloaded",filtered:"Response filtered by the provider",api:"Model API error",contextOverflow:"Context size exceeded"},details:{cause:"Cause",code:"Error code",connection:"Connection",contentType:"Content type",details:"Server details",duration:"Duration",endpoint:"Endpoint",errorName:"Error type",message:"Message",operation:"Operation",phase:"Failure phase",request:"Request",requestId:"Request ID",responsePreview:"Response preview",sessionId:"Session ID",stack:"Stack",status:"HTTP status",timeout:"Timeout",timestamp:"Time"},daemonApiTitle:"Dimi daemon returned an error",daemonNetworkMessage:"Web did not receive a response from the local service. Check that Dimi daemon is still running, or refresh the page.",daemonNetworkTitle:"Cannot connect to Dimi 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 Dimi 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."}},UH={new:{desc:"Create a new session"},clear:{desc:"Clear and start a new session"},login:{desc:"Sign in to Dimi in the browser"},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 tool actions; the agent may still ask questions"},auto:{desc:"Fully autonomous — the agent never asks questions"},thinking:{desc:"Set the thinking level"},compact:{desc:"Compact the conversation history"},fork:{desc:"Fork this session into a new one"},export:{desc:"Download this session and troubleshooting logs as a ZIP",noSession:"Open a session before exporting it."},status:{desc:"View session status"},undo:{desc:"Undo the last message"}},qH={label:{read:"Read",bash:"Run",edit:"Edit",write:"Write",grep:"Search",glob:"Find",ls:"List",web_fetch:"Fetch",search:"Search",todo:"Todo",task:"Task",swarm:"Swarm",ask_user:"Question",goal_create:"Start Goal",goal_get:"Read Goal",goal_budget:"Set Goal Budget",goal_update:"Update Goal"},swarm:{progress:"{done} / {total}",runningSub:"{count} in progress",doneSub:"{completed} completed · {failed} failed",phaseQueued:"Queued",phaseWorking:"Working",phaseSuspended:"Suspended",phaseCompleted:"Completed",phaseFailed:"Failed",waiting:"Waiting for subagents…"},chip:{lines:"{count} lines",results:"{count} results",edited:"edited",created:"created",todos:"{count} items"},goal:{objectiveWithCriterion:"{objective} · {criterion}",status:"Status: {status}",budget:"{value} {unit}",turns:"{value} turns",tokens:"{value} tokens",milliseconds:"{value} ms",seconds:"{value} sec",minutes:"{value} min",hours:"{value} hr"},group:{title:"{count} tool call | {count} tool calls",running:"running",error:"failed",done:"done"},ask:{dismissed:"Dismissed",answer:"{count} answer",answers:"{count} answers",answered:"Answered",more:"(+{count} more)"}},jH={resizeHandleAria:"Resize sidebar width",resizePreviewAria:"Resize preview panel width",detailPanelAria:"Detail panel"},VH={openSwitcher:"Switch session / workspace",openSettings:"Session settings",settingsTitle:"Session settings",groupSession:"Current session",groupApp:"App preferences",sheetLabel:"Sheet",closeSheet:"Close",tapToCycle:"tap to cycle",running:"running",idle:"idle",sessionCount:"{n} sessions",newSession:"New session",permManualSub:"confirm every tool",permAutoSub:"fully autonomous, never asks",permYoloSub:"auto-approve tools, may still ask",planModeSub:"Plan mode",swarmModeSub:"Swarm mode",archivedSessions:"Archived sessions",archivedSessionsSub:"Browse and restore archived sessions",archivedBack:"Back"},KH={colorSchemeLabel:"Light/Dark",light:"Moon Bright",dark:"Moon Dark",system:"System",accentLabel:"Accent",accentBlue:"Blue",accentBlack:"Black"},GH={preview:"预览",confirm:"确认",cancel:"取消"},YH={authBannerMessage:"未登录 · 需要登录 Dimi 才能开始对话",authBannerLogin:"登录",authPageTitle:"连接模型提供商",authPageMessage:"登录支持的账号或填写 API Key,然后开始对话。",authPageLogin:"选择提供商",connecting:"连接中…",connectRetrying:"无法连接服务器,正在重试…",internalBuildBanner:"仅供内部测试"},ZH={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",workspaces:"工作区",sortWorkspaces:"工作区排序",sortManual:"手动排序",sortRecent:"按最后编辑时间",collapseAll:"折叠全部工作区",expandAll:"展开全部工作区",newSession:"新建会话",newChat:"新建对话",newWorkspace:"新建工作区",emptyState:"还没有会话 · 点击 新建会话 开始",archiveConfirm:"确认归档会话?归档后可以从「设置」中恢复",options:"选项",rename:"重命名",copyPath:"复制路径",copySessionId:"复制 Session ID",copied:"已复制 ✓",copyFailed:"复制失败",archive:"归档",fork:"分叉会话",export:"导出会话",delete:"删除",removeWorkspace:"移除工作区",brand:"Dimi",signedIn:"已登录",signOut:"退出登录",notSignedIn:"未登录",signIn:"登录",language:"语言",daemon:"后台",noSessions:"暂无对话",showMore:"加载更多 {count} 个对话",showLess:"收起",showAll:"展开剩余 {count} 个对话",loadingMore:"加载中…",collapseSidebar:"收起侧边栏",expandSidebar:"展开侧边栏",searchPlaceholder:"搜索会话",search:"搜索",searchHint:"↑↓ 选择 · ↵ 打开 · Esc 关闭",searchNoResults:"没有匹配的会话"},XH={switcherTitle:"切换工作区",switchTooltip:"切换工作区",eyebrow:"工作区",branchLabel:"分支: {branch}",noBranch:"无分支",sessionCount:"{count} 个会话",allWorkspaces:"全部工作区",currentWorkspace:"仅当前工作区",addWorkspace:"添加工作区…",noWorkspace:"暂无工作区",deleteHasSessions:"工作区内还有会话,请先归档这些会话再删除",removeWorkspaceConfirm:"移除工作区「{name}」?",swarmEnableConfirm:"启用 swarm 模式?Agent 将并行运行多个子 agent。",goalStartConfirm:"启动 goal:「{objective}」?Agent 将自主执行。",scopeCurrent:"当前工作区",scopeAll:"全部工作区",newInGroup:"在此工作区新建会话",addTitle:"添加工作区",recentLabel:"最近的文件夹",cancel:"取消",addFailed:"无法打开此文件夹,请检查路径后重试。",openThisFolder:"打开此文件夹",up:"上一级",browsing:"加载中…",filterPlaceholder:"过滤子文件夹…",searchPlaceholder:"模糊搜索子文件夹,或粘贴绝对路径…",searching:"搜索中…",noFilterMatch:"没有匹配「{q}」的子文件夹",noSubfolders:"此处没有子文件夹",browseHint:'点击文件夹进入,再点"打开此文件夹"将其添加为工作区。',checkingPath:"检查路径…",pathPickHint:"此路径不存在,你是不是想找:",noPathMatch:"此路径不存在,「{parent}」下没有匹配的文件夹",badParent:"上级目录不存在:{parent}",pathFollowHint:'已定位到目标文件夹,按回车或点击"打开此文件夹"完成添加。',degradedPlaceholder:"输入绝对路径,回车添加…",degradedHint:"守护进程无法浏览文件系统,请直接输入绝对路径后回车添加。",attentionTitle:"{count} 项待处理",awaitingAnswer:"待回答",awaitingAnswerTitle:"有提问等待你回答",awaitingPermission:"待授权",awaitingPermissionTitle:"有操作等待你授权",aborted:"已中断",abortedTitle:"此会话在完成前被中断"},QH={jumpToLatestAria:"跳到最新消息",toc:"对话目录",newMessages:"最新消息",loading:"加载中…",starting:"正在创建对话…",emptyWorkspaceHint:"在 {name} 中发送",switchWorkspace:"切换工作区",addWorkspace:"添加工作区",moreWorkspaces:"更多工作区 ({count})",compacting:"正在压缩上下文…",compactedPlain:"上下文已压缩",compactedAuto:"已自动压缩上下文",compactedTokens:"({before} → {after} tokens)",viewSummary:"查看摘要",summaryTitle:"压缩摘要",manuallyAborted:"您已手动终止",activatedSkill:"已激活技能: {name}",undo:"撤销",undoTooltip:"撤销对话不会回滚代码",undoConfirm:"撤销上一条消息?",yesterday:"昨天",loadOlder:"加载更早的消息",loadingOlder:"正在加载更早的消息…",cron:{fired:"定时任务已触发",missed:"错过的定时提醒",job:"任务 {id}",oneShot:"单次",coalesced:"已合并 {n} 次触发",missedCount:"错过 {n} 次",finalDelivery:"最后一次投递",everyMinute:"每分钟",everyNMinutes:"每 {n} 分钟",everyHour:"每小时",everyNHours:"每 {n} 小时",dailyAt:"每天 {time}",weekdaysAt:"工作日 {time}",expand:"展开",collapse:"收起"}},JH={connectionConnected:"已连接",connectionConnecting:"连接中…",connectionDisconnected:"未连接",ctxTooltip:"使用 {used} / {max} tokens ({pct}%)",modelLabel:"模型",permissionManual:"逐条确认",permissionAuto:"完全自主",permissionYolo:"自动通过",permissionManualDesc:"每个工具操作都需要你手动确认",permissionAutoDesc:"完全自主运行,智能体自己做决定,不再询问",permissionYoloDesc:"自动批准工具操作,但遇到关键问题仍会询问",planLabel:"计划",planDesc:"先让智能体梳理计划,再修改文件",planOn:"开",planOff:"关",planTooltip:"切换计划模式(先调研再修改)",modesLabel:"模式",goalLabel:"目标",goalDesc:"持续跟踪一个目标,直到任务完成",swarmLabel:"Swarm",swarmDesc:"并行运行多个智能体,适合大范围探索",modeOff:"未启用",goalPlaceholder:"让智能体完成什么目标?",goalStart:"开始",goalPause:"暂停",goalResume:"继续",goalCancel:"取消",goalCancelConfirm:"是否需要取消当前目标?取消后将无法恢复。",goalCancelConfirmYes:"是",goalCancelConfirmNo:"否",goalStatusActive:"进行中",goalStatusPaused:"已暂停",goalStatusBlocked:"已阻塞",goalStatusComplete:"已完成",modeNotSupported:"暂不支持",thinkingLabel:"思考",thinkingTooltip:"切换思考模式",thinkingOn:"开",thinkingOff:"关",cacheNote:"提示:切换模型或思考程度会使已有的提示词缓存失效。建议新建对话,避免额外的 token 消耗。",starredModels:"收藏",moreModels:"更多模型…",statusPanelTitle:"会话状态",statusPanelClose:"关闭",statusModel:"模型",statusThinking:"思考强度",statusPermission:"权限",statusPlanMode:"计划模式",statusSwarmMode:"Swarm 模式",swarmOn:"开",swarmOff:"关",statusContext:"上下文",statusCost:"花费",statusContextValue:"{used} / {max} ({pct}%)",statusNone:"—",activityRunning:"运行中…",activityAwaitingApproval:"等待批准",activityAwaitingQuestion:"等待回答",interrupt:"中断",runningShort:"进行中"},eW={placeholder:"输入消息…",send:"发送 ↵",queueLabel:"队列",placeholderRunning:"输入会加入队列 · Ctrl+S 立即插入运行中的回合",starting:"正在发送…",queueAutoDrain:"当前回合结束后自动逐条发送",queueNext:"下一条",queueDragTitle:"拖拽排序",editQueued:"编辑(载入到输入框)",queuedAttachments:"附件 ×{n}",queuedHasImage:"包含 {n} 张图片 — 只能移除,不能编辑",attachmentImage:"图片",attachmentVideo:"视频",attachmentFile:"文件",attachmentOpenUnsupported:"无法打开 {name}:暂不支持此文件类型",dropToAttach:"松开鼠标添加附件",remove:"移除",removeNamed:"移除 {name}",uploading:"上传中",uploadFailed:"上传失败",attachFile:"添加附件",previewAttachment:"预览 {name}",interrupt:"中断",interruptTitle:"中断当前操作",expandTitle:"展开输入框进行多行编辑",collapseTitle:"收起输入框",emptyConversationTitle:"Dimi",emptyConversation:"还没有消息 —— 在下方输入开始对话",quickStartPlaceholder:"输入消息开始新对话…",thinkingSuffix:" · 思考",thinkingSuffixEffort:" · {level}"},tW={title:"登录 {provider}",close:"关闭 (Esc)",starting:"正在启动授权流程…",lead:"点击下方按钮,在新标签页中完成授权。",authorizeInBrowser:"在浏览器中授权",orDivider:"或者",fallbackPrefix:"换个设备?在浏览器打开 ",fallbackSuffix:" 输入设备码:",copy:"复制",copied:"已复制",waitingAuth:"等待授权",waitingAutoClose:"等待授权,完成后自动登录…",success:"已授权",successHint:"正在加载,稍后自动关闭…",expiredTitle:"授权码已过期",expiredHint:"请重新开始授权流程",retry:"重试",closeBtn:"关闭",errorTitle:"当前 daemon 暂不支持登录",errorHint:"请升级 dimi 后重试",pollErrorTitle:"与 daemon 的连接已断开",pollErrorHint:"授权轮询连续失败,请检查 dimi 进程后重试"},nW={dialogLabel:"管理提供商",title:"提供商管理",close:"关闭 (Esc)",loading:"加载提供商中…",unavailable:"daemon 暂不支持提供商管理",empty:"暂无提供商",status:{connected:"已连接",error:"错误",unconfigured:"未配置"},notConnected:"未连接",modelCount:"{count} 个模型",refresh:"刷新",signIn:"登录",connect:"连接",logout:"断开连接",refreshTitle:"刷新 {type}",logoutTitle:"断开 {type}",enterApiKey:"填写 API Key",fieldApiKey:"API Key",apiKeyRequired:"API Key 不能为空",escClose:"Esc 关闭"},oW={dialogLabel:"切换模型",title:"切换模型",close:"关闭 (Esc)",allTab:"全部",providerTabs:"模型提供商",searchPlaceholder:"搜索模型或提供商…",loading:"加载模型中…",unavailable:"daemon 暂不支持模型列表",contextSuffix:"{size} ctx",emptyNoModels:"daemon 未提供可选模型",emptyNoMatch:"无匹配模型",starTitle:"添加到收藏",unstarTitle:"取消收藏",footerHint:"↑↓ 导航 · Enter 选择 · Esc 关闭"},sW={justNow:"刚刚"},iW={title:{shell:"运行命令?",diff:"应用修改?",file:"写入文件?",fileop:"文件操作?",url:"抓取 URL?",search:"搜索?",invocation:"调用?",todo:"更新 todo?",plan_review:"按这份 plan 开始实现?",generic:"批准操作?"},subagentBadge:"子 agent · {name}",required:"APPROVAL REQUIRED",danger:"危险: {detail}",searchQueryLabel:"查询",searchScope:"范围:{scope}",feedbackPlaceholder:"说明拒绝原因… (Enter 提交, Esc 取消)",feedbackHint:"Enter 提交 · Esc 取消",approve:"批准",approveSession:"本会话内批准",reject:"拒绝",feedback:"+反馈",approvePlan:"批准 plan",revise:"修改",rejectAndExit:"拒绝并退出"},rW={title:"提问",step:"Q{current}/{total}",back:"‹ 返回",nextQuestion:"下一题 ›",otherDefault:"其他…",submit:"提交",dismiss:"放弃",minimize:"最小化",expand:"展开"},lW={tag:"任务",summary:"{run} 运行中 · {done} 完成",stop:"stop",defaultDescription:"后台任务",dockTasks:"后台任务",dockBash:"后台 Bash",dockSubagent:"子 Agent",dockTodos:"待办",running:"运行中",closePanel:"关闭面板",timingRunning:"运行中 · {time}",timingDone:"完成 · {sec}s",emptyTasks:"暂无后台任务",emptyBash:"暂无后台 Bash 任务",emptySubagent:"暂无子 Agent 任务",emptyTodo:"暂无待办事项",openTab:"查看全部后台任务",openDetail:"查看",collapse:"折叠",expand:"展开"},aW={panelTitle:"思考过程",close:"关闭"},cW={title:"改动",branch:"分支",aheadTitle:"领先远程",behindTitle:"落后远程",changeCount:"{count} 改动",empty:"无 git 改动 / daemon 未提供",clean:"工作区干净,无改动",back:"返回",loading:"正在加载 diff…",noDiff:"该文件没有行级改动",list:"列表",tree:"树形",close:"关闭"},uW={},dW={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} · 暂不预览",videoNoPreview:"视频文件 · {mime} · {size} · 暂不预览",binaryNoPreview:"二进制文件 · {mime} · {size} 字节 · 暂不预览",unknownType:"未知类型",copyCode:"复制代码",enlargeImage:"放大图片",errors:{emptyPath:"文件路径为空",unsupportedPath:"不支持预览 URL 或远程路径",outsideWorkspace:"只能预览当前 workspace 内的文件",isDirectory:"请选择具体文件,而不是目录",loadFailed:"无法读取这个文件"}},fW={searching:"搜索中…",noMatch:"无匹配"},hW={dismiss:"关闭",errorLabel:"错误",noteLabel:"提示",agentError:{title:"模型请求失败",connection:"无法连接模型服务",auth:"模型认证失败",rateLimit:"模型请求被限流",overloaded:"模型服务过载",filtered:"响应被提供方过滤",api:"模型接口返回错误",contextOverflow:"上下文超出模型限制"},details:{cause:"底层原因",code:"错误码",connection:"连接状态",contentType:"响应类型",details:"服务端详情",duration:"耗时",endpoint:"请求地址",errorName:"错误类型",message:"错误信息",operation:"操作",phase:"失败阶段",request:"请求",requestId:"Request ID",responsePreview:"响应预览",sessionId:"Session ID",stack:"堆栈",status:"HTTP 状态",timeout:"超时设置",timestamp:"时间"},daemonApiTitle:"Dimi daemon 返回错误",daemonNetworkMessage:"Web 没有拿到本地服务的响应。请确认 Dimi daemon 仍在运行,或刷新页面重试。",daemonNetworkTitle:"无法连接到 Dimi daemon",diagnostics:"诊断信息",hideDetails:"收起详情",operationFailedMessage:"刚才的操作没有完成,请稍后重试。",operationFailedTitle:"操作失败",sessionSnapshotMessage:"Web 没能加载当前会话内容。请确认 Dimi daemon 仍在运行,或刷新页面重试。",sessionSnapshotTitle:"无法加载当前会话内容",showDetails:"查看详情",copyDetails:"复制诊断信息",copied:"已复制",wsTitle:"实时连接出错",goal:{alreadyExists:"当前会话已有一个进行中的目标,请先取消它再创建新目标。",notFound:"没有找到可操作的目标,可能它已经结束或被取消。",statusInvalid:"当前目标状态不支持这个操作。",notResumable:"这个目标无法恢复(可能已取消或已完成)。",objectiveTooLong:"目标描述太长了,请精简后重试。"}},pW={new:{desc:"创建新会话"},clear:{desc:"清空并新建会话"},login:{desc:"在浏览器中登录 Dimi"},plan:{desc:"切换计划模式 开/关"},swarm:{desc:"切换 swarm 模式;/swarm <任务> 直接在 swarm 下执行"},goal:{desc:"创建/控制目标:/goal <目标>、/goal pause|resume|cancel"},btw:{desc:"侧边聊天:/btw <问题> 向 fork 的侧边会话提问"},yolo:{desc:"自动批准工具操作,Agent 仍可能提问"},auto:{desc:"完全自主,Agent 不再提问"},thinking:{desc:"设置思考强度"},compact:{desc:"压缩会话历史"},fork:{desc:"把当前会话 fork 出一个新会话"},export:{desc:"将当前会话和排障日志下载为 ZIP 压缩包",noSession:"请先打开一个会话再导出。"},status:{desc:"查看会话状态"},undo:{desc:"撤销上一条消息"}},mW={label:{read:"读取",bash:"运行",edit:"编辑",write:"写入",grep:"搜索",glob:"查找",ls:"列目录",web_fetch:"抓取",search:"搜索",todo:"待办",task:"任务",swarm:"Swarm",ask_user:"提问",goal_create:"启动目标",goal_get:"读取目标",goal_budget:"设置目标预算",goal_update:"更新目标"},swarm:{progress:"{done} / {total}",runningSub:"{count} 个进行中",doneSub:"完成 {completed} · 失败 {failed}",phaseQueued:"排队",phaseWorking:"运行中",phaseSuspended:"暂停",phaseCompleted:"完成",phaseFailed:"失败",waiting:"等待子任务加入…"},chip:{lines:"{count} 行",results:"{count} 结果",edited:"已编辑",created:"已创建",todos:"{count} 项"},goal:{objectiveWithCriterion:"{objective} · {criterion}",status:"状态:{status}",budget:"{value} {unit}",turns:"{value} 轮",tokens:"{value} token",milliseconds:"{value} 毫秒",seconds:"{value} 秒",minutes:"{value} 分钟",hours:"{value} 小时"},group:{title:"{count} 个工具调用",running:"运行中",error:"有失败",done:"已完成"},ask:{dismissed:"已忽略",answer:"{count} 个回答",answers:"{count} 个回答",answered:"已回答",more:"(还有 {count} 个)"}},gW={resizeHandleAria:"调整侧栏宽度",resizePreviewAria:"调整预览面板宽度",detailPanelAria:"详情面板"},vW={openSwitcher:"切换会话 / 工作区",openSettings:"会话设置",settingsTitle:"会话设置",groupSession:"当前会话",groupApp:"应用偏好",sheetLabel:"面板",closeSheet:"关闭",tapToCycle:"点击切换",running:"运行中",idle:"空闲",sessionCount:"{n} 个会话",newSession:"新建会话",permManualSub:"每个工具都确认",permAutoSub:"完全自主,不再提问",permYoloSub:"自动批准工具,仍可能提问",planModeSub:"计划模式",swarmModeSub:"Swarm 模式",archivedSessions:"已归档会话",archivedSessionsSub:"查看并恢复已归档会话",archivedBack:"返回"},yW={colorSchemeLabel:"明暗",light:"月之亮面",dark:"月之暗面",system:"跟随系统",accentLabel:"主题色",accentBlue:"蓝色",accentBlack:"黑色"},kW={title:"Welcome to Dimi Web",subtitle:"Pick a few preferences — you can change them anytime in Settings.",languageLabel:"Language",start:"Get started",skip:"Skip",reopen:"Preferences / onboarding"},bW={title:"欢迎来使用 Dimi Web",subtitle:"来选择一些你的偏好 —— 之后也可以在设置里随时修改。",languageLabel:"语言",start:"开始使用",skip:"跳过",reopen:"偏好 / 引导"},xW={title:"Settings",close:"Close (Esc)",tabs:{general:"General",agent:"Agent",account:"Account",advanced:"Advanced",archived:"Archived"},appearance:"Appearance",notifications:"Notifications",notifyOnComplete:"Notify when a turn completes",notifyOnQuestion:"Notify when a question needs an answer",notifyOnApproval:"Notify when a tool needs approval",soundOnComplete:"Play a sound when a turn completes, needs an answer, or needs approval",notifyDenied:"Blocked in browser settings",notifyTitle:"Dimi · Turn finished",notifyQuestionTitle:"Dimi · Needs answer",notifyApprovalTitle:"Dimi · Approval required",notifyFallback:"View result",notifyQuestionFallback:"A question is waiting for your answer",notifyApprovalFallback:"A tool needs your approval",account:"Account",uiFontSize:"Font size",agentDefaults:"Agent defaults",providers:"Providers",providersHint:"Add, remove, or refresh providers",manageProviders:"Manage",saving:"Saving",defaultModel:"Default model",defaultModelHint:"New sessions prefer this model",noDefaultModel:"No default model",defaultPermission:"Default permission",defaultPermissionHint:"Only affects newly-created sessions",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:"Improve product with usage data",telemetryHint:"When on, we collect anonymous interaction data (such as clicks, interruptions, and feature usage) to improve the product experience. You can turn it off at any time.",telemetryRestartHint:"Takes effect after restarting the service.",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",conversationToc:"Show conversation outline",conversationTocHint:"Show a clickable outline in the right margin to jump between messages",archivedTitle:"Archived sessions",archivedDesc:"Browse archived sessions, see their workspace path, name, and archive time, and restore them to the session list.",archivedSearch:"Search archived sessions",archivedAllWorkspaces:"All workspaces",archivedSortLabel:"Sort by",archivedSortArchived:"Archive time",archivedSortCreated:"Created time",archivedSortName:"Name",archivedRestore:"Restore",archivedEmpty:"No archived sessions yet",archivedNoMatch:"No matching archived sessions",archivedSessionsCount:"{count} sessions",archivedAt:"Archived {time}",archivedLoadMore:"Load more",archivedLoading:"Loading…",archivedLoadingAll:"Loading all archived sessions…"},wW={title:"设置",close:"关闭 (Esc)",tabs:{general:"通用",agent:"Agent",account:"账户",advanced:"高级",archived:"已归档"},appearance:"外观",notifications:"通知",notifyOnComplete:"会话完成时通知",notifyOnQuestion:"待回答时通知",notifyOnApproval:"待审批时通知",soundOnComplete:"会话完成、待回答或待审批时播放提示音",notifyDenied:"已在浏览器设置中被阻止",notifyTitle:"Dimi · 回合完成",notifyQuestionTitle:"Dimi · 待回答",notifyApprovalTitle:"Dimi · 等待审批",notifyFallback:"点击查看结果",notifyQuestionFallback:"有提问等待你回答",notifyApprovalFallback:"有工具等待你审批",account:"账户",uiFontSize:"字体大小",agentDefaults:"Agent 默认值",providers:"提供商",providersHint:"添加、删除或刷新提供商",manageProviders:"管理",saving:"保存中",defaultModel:"默认模型",defaultModelHint:"新会话会优先使用这个模型",noDefaultModel:"未设置默认模型",defaultPermission:"默认权限",defaultPermissionHint:"只影响之后新建的会话",defaultThinking:"默认开启思考",defaultThinkingHint:"新会话默认是否开启 thinking",defaultPlanMode:"默认计划模式",defaultPlanModeHint:"新会话默认进入 plan mode",mergeSkills:"合并所有可用 Skills",mergeSkillsHint:"让项目、插件和用户 Skills 一起出现在可用列表中",telemetry:"使用数据改进产品",telemetryHint:"开启后,我们会收集您的匿名交互数据(如点击、打断、功能使用等),用于改进产品体验。您可以随时关闭。",telemetryRestartHint:"更改后需重启服务生效。",credentialReady:"凭据已配置",credentialMissing:"缺少凭据",configUnavailable:"当前服务端没有返回 config,设置项暂不可用。",advanced:"高级",build:"构建",serverVersion:"服务端版本",exportLog:"故障排查日志",logHint:"加 ?debug=1 开启采集",exportLogBtn:"导出日志",conversationToc:"显示对话目录",conversationTocHint:"在右侧显示可点击跳转的对话目录",archivedTitle:"已归档会话",archivedDesc:"查看已归档会话,确认其所属工作区路径、会话名称和归档时间,并可恢复到会话列表。",archivedSearch:"搜索已归档会话",archivedAllWorkspaces:"所有工作区",archivedSortLabel:"排序方式",archivedSortArchived:"归档时间",archivedSortCreated:"创建时间",archivedSortName:"按字母顺序",archivedRestore:"恢复",archivedEmpty:"还没有归档的会话",archivedNoMatch:"没有匹配的已归档会话",archivedSessionsCount:"{count} 个会话",archivedAt:"归档于 {time}",archivedLoadMore:"加载更多",archivedLoading:"加载中…",archivedLoadingAll:"正在加载全部归档会话…"},_W={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",prStatusOpen:"open",prStatusClosed:"closed",prStatusMerged:"merged",prStatusDraft:"draft",prStatusUnknown:"unknown",options:"Options",copySessionId:"Copy Session ID",renameSession:"Rename",forkSession:"Fork session",archiveSession:"Archive",exportSession:"Export session"},SW={openInEditor:"在编辑器中打开",openInEditorShort:"打开",chooseOpenApp:"选择应用",copyAll:"复制全部对话为 Markdown",copyFinalSummary:"仅复制最终总结",copied:"已复制",copyPath:"复制路径",changed:"{n} 处改动",gitTooltip:"打开「文件 > 改动」",detached:"游离",openPr:"打开 Pull Request",prStatusOpen:"已打开",prStatusClosed:"已关闭",prStatusMerged:"已合并",prStatusDraft:"草稿",prStatusUnknown:"未知",options:"选项",copySessionId:"复制 Session ID",renameSession:"重命名",forkSession:"分叉会话",archiveSession:"归档",exportSession:"导出会话"},CW={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"},AW={title:"侧边聊天",subtitle:"从当前会话 fork",empty:"在侧边随手问一句 —— 它共享当前会话的上下文。",placeholder:"问问侧边聊天…",send:"发送"},MW={en:{common:_H,app:SH,sidebar:CH,workspace:AH,conversation:MH,status:EH,composer:TH,login:NH,providers:IH,model:LH,sessions:$H,approval:FH,question:OH,tasks:RH,thinking:BH,diff:DH,fileTree:PH,filePreview:HH,mention:WH,warnings:zH,commands:UH,tools:qH,layout:jH,mobile:VH,theme:KH,onboarding:kW,settings:xW,header:_W,sideChat:CW},zh:{common:GH,app:YH,sidebar:ZH,workspace:XH,conversation:QH,status:JH,composer:eW,login:tW,providers:nW,model:oW,sessions:sW,approval:iW,question:rW,tasks:lW,thinking:aW,diff:cW,fileTree:uW,filePreview:dW,mention:fW,warnings:hW,commands:pW,tools:mW,layout:gW,mobile:vW,theme:yW,onboarding:bW,settings:wW,header:SW,sideChat:AW}},d6=[{code:"en",label:"English"},{code:"zh",label:"中文"}];function EW(){const e=uo(Ht.locale);return e==="en"||e==="zh"?e:globalThis.navigator?.language?.toLowerCase().startsWith("zh")?"zh":"en"}const $n=B$({legacy:!1,locale:EW(),fallbackLocale:"en",messages:MW});function f6(e){$n.global.locale.value=e,xo(Ht.locale,e)}const os=$n.global.t,TW={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",agentswarm:"tools.label.swarm",askuserquestion:"tools.label.ask_user",creategoal:"tools.label.goal_create",getgoal:"tools.label.goal_get",setgoalbudget:"tools.label.goal_budget",updategoal:"tools.label.goal_update"},NW={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",create_goal:"creategoal",get_goal:"getgoal",set_goal_budget:"setgoalbudget",update_goal:"updategoal"};function Ja(e){const t=(e??"").trim().toLowerCase().replace(/[\s-]+/g,"_");return NW[t]??t}function ec(e){const t=TW[Ja(e)];return t?os(t):e}const IW={read:"file-text",bash:"terminal",edit:"pencil",multi_edit:"pencil",write:"file-plus",grep:"search",search:"search",glob:"glob",ls:"folder",web_fetch:"globe",todo:"check-list",task:"sparkles",agentswarm:"git-pull-request",askuserquestion:"help-circle",creategoal:"target",getgoal:"target",setgoalbudget:"target",updategoal:"target",croncreate:"calendar-schedule",cronlist:"calendar-todo",crondelete:"calendar-close"};function C1(e){const t=Ja(e);let n=IW[t];return!n&&(e??"").trim().toLowerCase().includes("skill")&&(n="bolt"),n||(n="tool"),Bc(n,"sm")}const h6=80;function LW(e,t=h6){const n=e.trim();return n.length>t?n.slice(0,t-1)+"…":n}function $W(e,t){const n=e.trim();return!!(n===""||n==="{}"||n==="[]"||n==="null"||t&&Object.keys(t).length===0)}function FW(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 on(e){return typeof e=="string"&&e.length>0?e:void 0}function yl(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function OW(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 xg(e){return on(e.path)??on(e.file_path)??on(e.filePath)??on(e.filename)}const RW={active:"status.goalStatusActive",blocked:"status.goalStatusBlocked",complete:"status.goalStatusComplete"};function BW(e){const t=on(e);if(!t)return;const n=RW[t];return n?os(n):t}function DW(e){const t=yl(e.value),n=on(e.unit);if(!(t===void 0||!n))switch(n){case"turns":return os("tools.goal.turns",{value:t});case"tokens":return os("tools.goal.tokens",{value:t});case"milliseconds":return os("tools.goal.milliseconds",{value:t});case"seconds":return os("tools.goal.seconds",{value:t});case"minutes":return os("tools.goal.minutes",{value:t});case"hours":return os("tools.goal.hours",{value:t});default:return os("tools.goal.budget",{value:t,unit:n})}}const PW=64;function df(e,t,n=!1){const o=(s,i=h6)=>n?s.trim():LW(s,i);try{const s=FW(t);if(!n&&$W(t,s))return"";const i=()=>o(t.replace(/^·\s*/,""));if(!s)return i();switch(Ja(e)){case"read":{const r=xg(s);if(!r)return i();const l=yl(s.offset)??yl(s.line_start)??yl(s.start_line),a=yl(s.limit)??yl(s.length),c=yl(s.line_end)??yl(s.end_line)??(l!==void 0&&a!==void 0?l+a:void 0);return o(l!==void 0&&c!==void 0?`${r}:${l}-${c}`:l!==void 0?`${r}:${l}`:r)}case"write":{const r=xg(s);return r?o(`${r} ${os("tools.chip.created")}`):i()}case"edit":case"multi_edit":{const r=xg(s);return r?o(r):i()}case"bash":{const r=on(s.command)??on(s.cmd)??on(s.script);return r?o(r,PW):i()}case"grep":case"search":{const r=on(s.pattern)??on(s.query)??on(s.regex),l=on(s.path)??on(s.glob)??on(s.include);return r&&l?o(`${r} in ${l}`):r?o(r):i()}case"glob":{const r=on(s.pattern)??on(s.glob)??on(s.query),l=on(s.path)??on(s.cwd);return r&&l?o(`${r} in ${l}`):r?o(r):on(s.path)?o(on(s.path)):i()}case"ls":{const r=on(s.path)??on(s.dir)??on(s.directory)??on(s.cwd);return r?o(r):i()}case"web_fetch":{const r=on(s.url)??on(s.uri);return r?o(OW(r)):i()}case"todo":case"task":{const r=on(s.description)??on(s.title)??on(s.prompt)??on(s.name)??on(s.subagent_type);if(r)return o(r);const l=Array.isArray(s.todos)?s.todos:Array.isArray(s.items)?s.items:void 0;return l?o(os("tools.chip.todos",{count:l.length})):i()}case"creategoal":{if(n)return i();const r=on(s.objective),l=on(s.completionCriterion);return r&&l?o(os("tools.goal.objectiveWithCriterion",{objective:r,criterion:l})):r?o(r):i()}case"getgoal":return n?i():"";case"setgoalbudget":{if(n)return i();const r=DW(s);return r?o(r):i()}case"updategoal":{if(n)return i();const r=BW(s.status);return r?o(os("tools.goal.status",{status:r})):i()}default:return i()}}catch{return t}}function HW(e){try{switch(Ja(e.name)){case"bash":return e.timing?e.timing:"";case"read":{if(e.output&&e.output.length>0){const t=e.output.length;return os("tools.chip.lines",{count:t})}return""}case"edit":case"multi_edit":case"write":{if(e.output){for(const n of e.output){const o=n.match(/\+(\d+).*[-−](\d+)/);if(o)return`+${o[1]} −${o[2]}`}const t=e.output.find(n=>/\d+/.test(n));if(t){const n=t.match(/\+(\d+)/),o=t.match(/[-−](\d+)/);if(n||o)return`${n?`+${n[1]}`:""} ${o?`−${o[1]}`:""}`.trim()}if(e.status!=="error")return os("tools.chip.edited")}return""}case"grep":case"search":return e.output&&e.output.length>0?os("tools.chip.results",{count:e.output.length}):"";default:return""}}catch{return""}}const WW=Qe({__name:"StatusDot",props:{status:{}},setup(e){const t=e;function n(s){switch(s){case"ok":case"done":case"completed":case"success":return"ok";case"error":case"failed":case"danger":return"error";case"running":case"working":case"in_progress":case"active":return"running";case"suspended":return"suspended";default:return"idle"}}const o=D(()=>n(t.status));return(s,i)=>(x(),E("span",{class:We(["kw-dot",`kw-dot--${o.value}`]),"aria-hidden":"true"},null,2))}}),ff=ft(WW,[["__scopeId","data-v-1936f8c5"]]),zW=["innerHTML"],UW={class:"bh-text"},qW={class:"a"},jW={key:0,class:"p"},VW={class:"rt"},KW=["aria-label"],GW={key:0,class:"tm"},YW=["inert"],ZW={class:"bb-pad"},XW=Qe({__name:"ToolRow",props:{status:{},icon:{default:""},name:{},arg:{default:""},time:{default:""},open:{type:Boolean,default:!1},expandable:{type:Boolean,default:!1},stacked:{type:Boolean,default:!1},stackPosition:{default:"single"}},emits:["toggle"],setup(e,{emit:t}){const n=t,o=Jt("pinScroll",()=>{}),s=ne(null);function i(){n("toggle");const r=s.value;r&&kt(()=>o(r))}return(r,l)=>(x(),E("div",{class:We(["box",{open:e.open,stacked:e.stacked,err:e.status==="error","stack-first":e.stackPosition==="first","stack-middle":e.stackPosition==="middle","stack-last":e.stackPosition==="last"}])},[_("div",{class:"bh",ref_key:"bhEl",ref:s,onClick:i},[e.icon?(x(),E("span",{key:0,class:"gl",innerHTML:e.icon,"aria-hidden":"true"},null,8,zW)):ue("",!0),_("span",UW,[_("span",qW,R(e.name),1),fe(rn,{text:e.arg},{default:Le(()=>[e.arg?(x(),E("span",jW,R(e.arg),1)):ue("",!0)]),_:1},8,["text"])]),_("span",VW,[_("span",{class:We(["status",e.status]),role:"status","aria-label":e.status},[e.status==="ok"?(x(),Ae(Ye,{key:0,name:"check",size:"sm"})):e.status==="error"?(x(),Ae(Ye,{key:1,name:"close",size:"sm"})):e.status==="suspended"?(x(),Ae(ff,{key:2,status:"suspended"})):(x(),Ae(ff,{key:3,status:"running"}))],10,KW),zn(r.$slots,"trailing"),e.time?(x(),E("span",GW,R(e.time),1)):ue("",!0)]),e.expandable?(x(),Ae(Ye,{key:1,class:"car",name:e.open?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])):ue("",!0)],512),_("div",{class:We(["bb",{open:e.open}]),inert:!e.open},[_("div",ZW,[zn(r.$slots,"default")])],10,YW)],2))}}),A1=ft(XW,[["__scopeId","data-v-3b97a58a"]]),QW={key:0,class:"at-type"},JW={key:1,class:"at-task"},ez={key:2,class:"bb-code"},tz=Qe({__name:"AgentTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e,{emit:t}){const{t:n}=Ot(),o=e,s=t;function i(k){if(!k)return{};try{const g=JSON.parse(k);return{description:typeof g.description=="string"?g.description:void 0,subagentType:typeof g.subagent_type=="string"?g.subagent_type:void 0,prompt:typeof g.prompt=="string"?g.prompt:void 0}}catch{return{}}}const r=D(()=>i(o.tool.arg)),l=D(()=>!!o.tool.output&&o.tool.output.length>0),a=D(()=>!!r.value.prompt||!!r.value.subagentType||l.value),c=ne(o.tool.defaultExpanded===!0&&a.value),u=D(()=>o.tool.status),d=D(()=>ec(o.tool.name)),f=D(()=>C1(o.tool.name)),h=D(()=>r.value.description||r.value.subagentType||""),p=Jt("resolveAgentTaskId"),m=D(()=>p?p(o.tool.id)!==void 0:!0);function y(){a.value&&(c.value=!c.value)}return et(()=>[o.tool.defaultExpanded,o.tool.output?.length,o.tool.status],()=>{o.tool.defaultExpanded===!0&&a.value&&(c.value=!0)}),(k,g)=>(x(),Ae(A1,{status:u.value,icon:f.value,name:d.value,arg:c.value?"":h.value,time:e.tool.timing,open:c.value,expandable:a.value,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:y},{trailing:Le(()=>[m.value?(x(),E("button",{key:0,type:"button",class:"at-open",onClick:g[0]||(g[0]=Ct(v=>s("openAgent",e.tool.id),["stop"]))},R(C(n)("tasks.openDetail")),1)):ue("",!0)]),default:Le(()=>[r.value.subagentType?(x(),E("div",QW,R(r.value.subagentType),1)):ue("",!0),r.value.prompt?(x(),E("div",JW,R(r.value.prompt),1)):ue("",!0),l.value?(x(),E("div",ez,[(x(!0),E(Pe,null,lt(e.tool.output??[],(v,b)=>(x(),E("div",{key:b},R(v),1))),128))])):ue("",!0)]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),nz=ft(tz,[["__scopeId","data-v-ead824db"]]);function oz(e){if(!e)return[];try{const n=JSON.parse(e).questions;if(!Array.isArray(n))return[];const o=[];for(const s of n){if(!s||typeof s!="object")continue;const i=s,r=Array.isArray(i.options)?i.options.map(l=>{const a=l&&typeof l=="object"?l:{};return{label:typeof a.label=="string"?a.label:"",description:typeof a.description=="string"?a.description:""}}):[];o.push({question:typeof i.question=="string"?i.question:"",header:typeof i.header=="string"?i.header:"",options:r,multiSelect:i.multi_select===!0})}return o}catch{return[]}}const Bh={recognized:!1,answers:{},note:""};function sz(e){const t=e?.[0];if(!t)return Bh;let n;try{n=JSON.parse(t)}catch{return Bh}if(!n||typeof n!="object"||Array.isArray(n))return Bh;const o=n.answers;if(!o||typeof o!="object"||Array.isArray(o))return Bh;const s={};for(const[i,r]of Object.entries(o))typeof r=="string"?s[i]=r:r===!0&&(s[i]=!0);return{recognized:!0,answers:s,note:typeof n.note=="string"?n.note:""}}function iz(e,t,n){return e[t]??e[`q_${n}`]}const rz=/^opt_\d+_(\d+)$/;function lz(e,t=[]){if(e===void 0)return{selected:new Set,otherText:"",indeterminate:!1};if(e===!0)return{selected:new Set,otherText:"",indeterminate:!0};const n=new Map;t.forEach((r,l)=>{r.label.length>0&&!n.has(r.label)&&n.set(r.label,l)});const o=n.get(e);if(o!==void 0)return{selected:new Set([o]),otherText:"",indeterminate:!1};const s=new Set,i=[];for(const r of e.split(",")){const l=r.trim(),a=n.get(l);if(a!==void 0){s.add(a);continue}const c=rz.exec(l);c?s.add(Number(c[1])):l.length>0&&i.push(l)}return{selected:s,otherText:i.join(", "),indeterminate:!1}}const az={key:0,class:"chip"},cz={key:0,class:"au-dismissed"},uz={key:1,class:"au-list"},dz={class:"au-q"},fz={key:0,class:"au-hdr"},hz={class:"au-qtext"},pz={class:"au-opts"},mz={class:"au-glyph"},gz={class:"au-label"},vz={key:0,class:"au-desc"},yz={key:0,class:"au-opt sel"},kz={class:"au-glyph"},bz={class:"au-label"},xz={key:1,class:"au-opt sel"},wz={class:"au-label"},_z={key:2,class:"au-raw"},Sz=80,Cz=Qe({__name:"AskUserTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff"],setup(e){const t=e,{t:n}=Ot();function o(T,M=Sz){const $=T.trim();return $.length>M?$.slice(0,M-1)+"…":$}const s=D(()=>oz(t.tool.arg)),i=D(()=>sz(t.tool.output)),r=D(()=>i.value.recognized),l=D(()=>r.value&&Object.keys(i.value.answers).length===0&&i.value.note.length>0),a=D(()=>s.value.map((T,M)=>lz(iz(i.value.answers,T.question,M),T.options))),c=D(()=>Object.keys(i.value.answers).length);function u(T,M){return a.value[T]?.selected.has(M)??!1}function d(T){return a.value[T]?.otherText??""}function f(T){return a.value[T]?.indeterminate??!1}function h(T,M){return T?M?"■":"□":M?"●":"○"}const p=D(()=>{if(!r.value)return o(t.tool.output?.[0]??"");if(l.value)return n("tools.ask.dismissed");const T=s.value[0]?.question??"",M=o(T);return s.value.length<=1?M:`${M} ${n("tools.ask.more",{count:s.value.length-1})}`}),m=D(()=>r.value?l.value?n("tools.ask.dismissed"):c.value===0?"":c.value===1?n("tools.ask.answer",{count:1}):n("tools.ask.answers",{count:c.value}):""),y=D(()=>!!t.tool.output&&t.tool.output.length>0),k=D(()=>r.value&&(s.value.length>0||l.value)||y.value),g=ne(t.tool.defaultExpanded===!0&&k.value),v=D(()=>t.tool.status),b=D(()=>ec(t.tool.name)),A=D(()=>C1(t.tool.name));function I(){k.value&&(g.value=!g.value)}return et(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status],()=>{t.tool.defaultExpanded===!0&&k.value&&(g.value=!0)}),(T,M)=>(x(),Ae(A1,{status:v.value,icon:A.value,name:b.value,arg:g.value?"":p.value,time:e.tool.timing,open:g.value,expandable:k.value,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:I},{trailing:Le(()=>[m.value?(x(),E("span",az,R(m.value),1)):ue("",!0)]),default:Le(()=>[l.value?(x(),E("div",cz,R(i.value.note),1)):r.value?(x(),E("div",uz,[(x(!0),E(Pe,null,lt(s.value,($,N)=>(x(),E("div",{key:N,class:"au-block"},[_("div",dz,[$.header?(x(),E("span",fz,R($.header),1)):ue("",!0),_("span",hz,R($.question),1)]),_("div",pz,[(x(!0),E(Pe,null,lt($.options,(F,S)=>(x(),E("div",{key:S,class:We(["au-opt",{sel:u(N,S)}])},[_("span",mz,R(h($.multiSelect,u(N,S))),1),_("span",gz,R(F.label),1),F.description?(x(),E("span",vz,R(F.description),1)):ue("",!0)],2))),128)),d(N)?(x(),E("div",yz,[_("span",kz,R(h($.multiSelect,!0)),1),_("span",bz,R(d(N)),1)])):ue("",!0),f(N)?(x(),E("div",xz,[M[0]||(M[0]=_("span",{class:"au-glyph"},"●",-1)),_("span",wz,R(C(n)("tools.ask.answered")),1)])):ue("",!0)])]))),128))])):(x(),E("div",_z,[(x(!0),E(Pe,null,lt(e.tool.output??[],($,N)=>(x(),E("div",{key:N},R($),1))),128))]))]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),Az=ft(Cz,[["__scopeId","data-v-a0418f5f"]]),Mz=1e6,L_=5e3;function $_(e){if(e==="")return[];const t=e.split(`
|
|
68
|
-
`);return t.at(-1)===""&&t.pop(),t}function Ez(e,t){const n=$_(e),o=$_(t),s=n.length,i=o.length;if(s===0&&i===0)return[];if(s>L_||i>L_||(s+1)*(i+1)>Mz)return null;const r=Array.from({length:s+1},()=>Array.from({length:i+1},()=>0));for(let h=1;h<=s;h++)for(let p=1;p<=i;p++)r[h][p]=n[h-1]===o[p-1]?r[h-1][p-1]+1:Math.max(r[h-1][p],r[h][p-1]);const l=[];let a=s,c=i;for(;a>0||c>0;)a>0&&c>0&&n[a-1]===o[c-1]?(l.push({type:"context",text:n[a-1]}),a--,c--):c>0&&(a===0||r[a][c-1]>=r[a-1][c])?(l.push({type:"add",text:o[c-1]}),c--):(l.push({type:"del",text:n[a-1]}),a--);l.reverse();const u=[];let d=1,f=1;for(const h of l)h.type==="context"?(u.push({type:"context",text:h.text,oldNo:d,newNo:f}),d++,f++):h.type==="add"?(u.push({type:"add",text:h.text,newNo:f}),f++):(u.push({type:"del",text:h.text,oldNo:d}),d++);return u}function Tz(e){let t=0,n=0;for(const o of e)o.type==="add"?t++:o.type==="del"&&n++;return{added:t,removed:n}}function p6(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 m6(e){const t=Ja(e.name);if(t!=="edit"&&t!=="write")return null;const n=p6(e.arg);if(!n)return null;if(t==="edit"){if(n.replace_all===!0)return null;const o=typeof n.old_string=="string"?n.old_string:void 0,s=typeof n.new_string=="string"?n.new_string:void 0;return o===void 0||s===void 0?null:Ez(o,s)}return null}function Nz(e){const t=p6(e);return t&&typeof t.path=="string"?t.path:void 0}function Iz(e,t){for(const n of e){const o=n.tools?.find(s=>s.id===t);if(o)return o}}const Lz={key:0,class:"bb-empty"},F_=50,$z=Qe({__name:"ToolOutputBlock",props:{lines:{},emptyText:{}},setup(e){const t=e,n=D(()=>t.lines??[]),o=D(()=>n.value.length>F_),s={"--tool-output-visible-lines":String(F_)};return(i,r)=>(x(),E("div",{class:We(["bb-code tool-output-block",{scroll:o.value}]),style:s},[n.value.length===0&&e.emptyText?(x(),E("div",Lz,R(e.emptyText),1)):ue("",!0),(x(!0),E(Pe,null,lt(n.value,(l,a)=>(x(),E("div",{key:a},R(l),1))),128))],2))}}),g6=ft($z,[["__scopeId","data-v-262bbea0"]]),Fz={key:0,class:"chip"},Oz={key:0,class:"bb-summary"},Rz=Qe({__name:"EditTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff"],setup(e,{emit:t}){const n=e,o=t,s=D(()=>n.tool.status),i=D(()=>ec(n.tool.name)),r=D(()=>C1(n.tool.name)),l=D(()=>df(n.tool.name,n.tool.arg)),a=D(()=>df(n.tool.name,n.tool.arg,!0)),c=D(()=>m6(n.tool)),u=D(()=>{const m=c.value;if(m&&n.tool.status!=="error"){const{added:y,removed:k}=Tz(m);if(y||k)return`+${y} −${k}`}return""}),d=D(()=>!!n.tool.output&&n.tool.output.length>0),f=ne(!1),h=D(()=>d.value&&!n.toolDiffPanel);function p(){if(n.toolDiffPanel){o("openToolDiff",n.tool.id);return}d.value&&(f.value=!f.value)}return(m,y)=>(x(),Ae(A1,{status:s.value,icon:r.value,name:i.value,arg:f.value?"":l.value,time:e.tool.timing,open:f.value,expandable:h.value||e.toolDiffPanel,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:p},{trailing:Le(()=>[u.value?(x(),E("span",Fz,R(u.value),1)):ue("",!0)]),default:Le(()=>[a.value?(x(),E("div",Oz,R(a.value),1)):ue("",!0),fe(g6,{lines:e.tool.output,"empty-text":"Waiting for output…"},null,8,["lines"])]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),Bz=ft(Rz,[["__scopeId","data-v-bca2d09d"]]),Dz={key:0,class:"chip"},Pz={key:0,class:"bb-summary"},Hz=Qe({__name:"GenericTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff"],setup(e){const t=e,n=D(()=>t.tool.status==="running"&&/^bash$/i.test(t.tool.name)),o=D(()=>!!t.tool.output&&t.tool.output.length>0),s=D(()=>o.value||n.value),i=ne(t.tool.defaultExpanded===!0&&s.value),r=D(()=>t.tool.status),l=D(()=>ec(t.tool.name)),a=D(()=>C1(t.tool.name)),c=D(()=>df(t.tool.name,t.tool.arg)),u=D(()=>df(t.tool.name,t.tool.arg,!0)),d=D(()=>HW({name:t.tool.name,arg:t.tool.arg,output:t.tool.output,timing:t.tool.timing,status:t.tool.status}));function f(){s.value&&(i.value=!i.value)}return et(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status,t.tool.name],()=>{t.tool.defaultExpanded===!0&&s.value&&(i.value=!0)}),(h,p)=>(x(),Ae(A1,{status:r.value,icon:a.value,name:l.value,arg:i.value?"":c.value,time:e.tool.name!=="bash"?e.tool.timing:"",open:i.value,expandable:s.value,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:f},{trailing:Le(()=>[d.value?(x(),E("span",Dz,R(d.value),1)):ue("",!0)]),default:Le(()=>[u.value?(x(),E("div",Pz,R(u.value),1)):ue("",!0),fe(g6,{lines:e.tool.output,"empty-text":"Waiting for output…"},null,8,["lines"])]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),Wz=ft(Hz,[["__scopeId","data-v-140db1a0"]]),zz={class:"media-title"},Uz=["src","alt"],qz=["src"],jz=["src"],Vz=Qe({__name:"MediaTool",props:{tool:{},mobile:{type:Boolean,default:!1}},emits:["openMedia"],setup(e,{emit:t}){const n=e,o=t,s=D(()=>n.tool.status==="ok"?n.tool.media:void 0);function i(c){return c.split(/[\\/]+/).pop()||c}function r(c){return c<1024?`${c} B`:c<1024*1024?`${(c/1024).toFixed(1)} KB`:`${(c/1024/1024).toFixed(1)} MB`}const l=D(()=>{const c=s.value;if(!c)return"";const u=[c.path?i(c.path):n.tool.name];return c.mimeType&&u.push(c.mimeType),c.bytes!==void 0&&u.push(r(c.bytes)),c.dimensions&&u.push(c.dimensions),u.join(" · ")});function a(){const c=s.value;c?.kind==="image"&&o("openMedia",c)}return(c,u)=>s.value?(x(),E("div",{key:0,class:We(["media-tool",{mob:e.mobile}])},[fe(rn,{text:s.value.path||l.value},{default:Le(()=>[_("div",zz,R(l.value),1)]),_:1},8,["text"]),s.value.kind==="image"?(x(),Ae(rn,{key:0,text:s.value.path||l.value},{default:Le(()=>[_("button",{type:"button",class:"media-image-button",onClick:a},[_("img",{class:"media-image",src:s.value.url,alt:s.value.path?i(s.value.path):l.value,loading:"lazy"},null,8,Uz)])]),_:1},8,["text"])):s.value.kind==="video"?(x(),E("video",{key:1,class:"media-video",src:s.value.url,controls:"",preload:"metadata"},null,8,qz)):(x(),E("audio",{key:2,class:"media-audio",src:s.value.url,controls:""},null,8,jz))],2)):ue("",!0)}}),Kz=ft(Vz,[["__scopeId","data-v-d7ab177d"]]),Gz=/<summary>([\s\S]*?)<\/summary>/,Yz=/<resume_hint>([\s\S]*?)<\/resume_hint>/,wg=/<subagent\b([^>]*)>|<\/subagent>/g,Zz="</subagent>",O_=/(completed|failed|aborted):\s*(\d+)/g,R_=/([a-z_]+)="([^"]*)"/g;function Xz(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function Qz(e){const t={};R_.lastIndex=0;let n;for(;(n=R_.exec(e))!==null;)t[n[1]]=Xz(n[2]);return t}function Jz(e){const t={completed:0,failed:0,aborted:0};O_.lastIndex=0;let n;for(;(n=O_.exec(e))!==null;){const o=n[1];t[o]=Number(n[2])}return t}function eU(e,t){const n=Qz(e);return{outcome:n.outcome??"completed",item:n.item,agentId:n.agent_id,mode:n.mode,state:n.state,body:t.trim()}}function tU(e){const t=[],n=[];wg.lastIndex=0;let o;for(;(o=wg.exec(e))!==null;)if(o[0]===Zz){if(n.length===0)continue;const s=n.pop();s&&n.length===0&&t.push(eU(s.attrs,e.slice(s.bodyStart,o.index)))}else n.length===0?n.push({attrs:o[1]??"",bodyStart:wg.lastIndex}):n.push(null);return t}function nU(e){if(e==null)return null;const t=Array.isArray(e)?e.join(`
|
|
69
|
-
`):e;if(!t.includes("<agent_swarm_result>"))return null;const n=Gz.exec(t)?.[1]?.trim()??"",{completed:o,failed:s,aborted:i}=Jz(n),r=Yz.exec(t)?.[1]?.trim(),l=tU(t),a=o+s+i;return{summary:n,completed:o,failed:s,aborted:i,total:a>0?a:l.length,subagents:l,resumeHint:r}}function B_(e){return e?e.split(`
|
|
70
|
-
`).map(t=>t.trimEnd()).filter(Boolean).at(-1)??"":""}function oU(e){return e.suspendedReason||B_(e.text)||B_(e.outputLines?.join(`
|
|
71
|
-
`))||e.summary||""}function sU(e){return e.suspendedReason?e.suspendedReason:e.text?e.text:e.outputLines&&e.outputLines.length>0?e.outputLines.join(`
|
|
72
|
-
`):e.summary??""}function iU(e){return e==="completed"?"completed":e==="failed"||e==="aborted"?"failed":"working"}function D_(e,t){return{id:e.agentId??e.item??`result-${t}`,name:e.item??`subagent ${t+1}`,activity:e.body.split(`
|
|
73
|
-
`)[0]??"",phase:iU(e.outcome),body:e.body}}function rU(e,t){return!!(t.agentId&&e.id===t.agentId||t.item&&e.name.includes(t.item))}function lU(e,t){const n=e.map(s=>({id:s.id,name:s.name,activity:oU(s),phase:s.phase,body:sU(s)}));if(!t)return n;const o=t.subagents.filter(s=>(s.outcome==="aborted"||s.state==="not_started")&&!e.some(i=>rU(i,s))).map((s,i)=>D_(s,i));return n.length>0?[...n,...o]:t.subagents.map((s,i)=>D_(s,i))}const aU=["aria-expanded"],cU={class:"title"},uU={key:0,class:"meta"},dU={key:1,class:"sum-txt"},fU={class:"rt"},hU={class:"status"},pU={key:0,class:"chip"},mU={key:1,class:"tm"},gU={class:"body"},vU={class:"overview"},yU={class:"overview-line"},kU={class:"big"},bU={key:0,class:"lbl"},xU={key:1,class:"lbl"},wU={key:2,class:"lbl"},_U={key:0,class:"seg","aria-hidden":"true"},SU={key:1,class:"legend"},CU=["aria-expanded","onClick"],AU={class:"mname"},MU={class:"mact"},EU={class:"mphase"},TU={key:1,class:"fallback-output"},NU={key:2,class:"waiting"},IU=Qe({__name:"SwarmTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e){const{t}=Ot(),n=e;function o(N){if(!N)return{};try{const F=JSON.parse(N),S=Array.isArray(F.items)?F.items:void 0;return{description:typeof F.description=="string"?F.description:void 0,itemCount:S?.length}}catch{return{}}}const s=Jt("resolveSwarmMembers"),i=D(()=>o(n.tool.arg)),r=D(()=>ec(n.tool.name)),l=D(()=>i.value.description??""),a=D(()=>s?.(n.tool.id)??[]),c=D(()=>nU(n.tool.output)),u=D(()=>n.tool.status),d=D(()=>u.value==="running"?"running":u.value==="error"||(c.value?.failed??0)>0||(c.value?.aborted??0)>0?"error":"ok"),f=D(()=>lU(a.value,c.value)),h=D(()=>{const N={completed:0,working:0,suspended:0,queued:0,failed:0};for(const F of f.value)N[F.phase]++;return N}),p=D(()=>f.value.length||i.value.itemCount||0),m=D(()=>h.value.completed+h.value.failed),y=D(()=>h.value.working+h.value.suspended+h.value.queued),k=[{phase:"completed",cls:"s-ok"},{phase:"working",cls:"s-run"},{phase:"suspended",cls:"s-warn"},{phase:"failed",cls:"s-fail"},{phase:"queued",cls:"s-queue"}],g=D(()=>k.map(({phase:N,cls:F})=>({phase:N,count:h.value[N],cls:F})).filter(N=>N.count>0)),v=ne(u.value==="running"||y.value>0);function b(){v.value=!v.value}const A=D(()=>f.value.length>0||c.value||u.value==="running"?"":(n.tool.output??[]).join(`
|
|
74
|
-
`).trim()),I=ne(new Set);function T(N){const F=new Set(I.value);F.has(N)?F.delete(N):F.add(N),I.value=F}function M(N){return I.value.has(N)}function $(N){return t(`tools.swarm.phase${N[0].toUpperCase()}${N.slice(1)}`)}return(N,F)=>(x(),E("div",{class:We(["swarm-card",{open:v.value,err:d.value==="error",stacked:e.stackPosition!=="single"}])},[_("button",{class:"head",type:"button","aria-expanded":v.value,onClick:b},[fe(Ye,{class:"ic",name:"git-pull-request",size:"sm"}),_("span",cU,R(r.value),1),l.value?(x(),E("span",uU,"·")):ue("",!0),l.value?(x(),E("span",dU,R(l.value),1)):ue("",!0),_("span",fU,[_("span",hU,[d.value==="ok"?(x(),Ae(Ye,{key:0,name:"check",size:"sm"})):d.value==="error"?(x(),Ae(Ye,{key:1,name:"close",size:"sm"})):(x(),Ae(ff,{key:2,status:"running"}))]),m.value>0||p.value>0?(x(),E("span",pU,R(m.value)+" / "+R(p.value),1)):ue("",!0),e.tool.timing?(x(),E("span",mU,R(e.tool.timing),1)):ue("",!0)]),fe(Ye,{class:"car",name:v.value?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])],8,aU),Wn(_("div",gU,[_("div",vU,[_("div",yU,[_("span",kU,R(C(t)("tools.swarm.progress",{done:m.value,total:p.value})),1),d.value==="running"&&p.value>0?(x(),E("span",bU,R(C(t)("tools.swarm.runningSub",{count:y.value})),1)):c.value?(x(),E("span",xU,R(C(t)("tools.swarm.doneSub",{completed:c.value.completed,failed:c.value.failed+c.value.aborted})),1)):(x(),E("span",wU,R(C(t)("tools.swarm.waiting")),1))]),p.value>0&&g.value.length>0?(x(),E("div",_U,[(x(!0),E(Pe,null,lt(g.value,S=>(x(),E("span",{key:S.phase,class:We(S.cls),style:tn({flex:S.count})},null,6))),128))])):ue("",!0),g.value.length>1?(x(),E("div",SU,[(x(!0),E(Pe,null,lt(g.value,S=>(x(),E("span",{key:S.phase},[_("i",{class:We(["lg-dot",S.cls])},null,2),nt(R($(S.phase))+" "+R(S.count),1)]))),128))])):ue("",!0)]),f.value.length>0?(x(!0),E(Pe,{key:0},lt(f.value,S=>(x(),E("div",{key:S.id,class:We(["member",[`phase-${S.phase}`,{open:M(S.id)}]])},[_("button",{class:"member-head",type:"button","aria-expanded":M(S.id),onClick:B=>T(S.id)},[fe(ff,{class:"row-dot",status:S.phase},null,8,["status"]),fe(rn,{text:S.name},{default:Le(()=>[_("span",AU,R(S.name),1)]),_:2},1032,["text"]),S.activity?(x(),Ae(rn,{key:0,text:S.activity},{default:Le(()=>[_("span",MU,R(S.activity),1)]),_:2},1032,["text"])):ue("",!0),_("span",EU,R($(S.phase)),1),fe(Ye,{class:"mcar",name:M(S.id)?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])],8,CU),Wn(_("div",{class:"member-body"},R(S.body),513),[[wi,M(S.id)]])],2))),128)):A.value?(x(),E("div",TU,R(A.value),1)):(x(),E("div",NU,R(C(t)("tools.swarm.waiting")),1))],512),[[wi,v.value]])],2))}}),LU=ft(IU,[["__scopeId","data-v-e7e15c56"]]);function $U(e){if(e.media&&e.status==="ok")return Kz;const t=Ja(e.name);return t==="edit"||t==="write"||t==="multi_edit"?Bz:t==="task"?nz:t==="agentswarm"?LU:t==="askuserquestion"?Az:Wz}const v6=Qe({__name:"ToolCall",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e,{emit:t}){const n=e,o=t,s=D(()=>$U(n.tool));return(i,r)=>(x(),Ae(Ro(s.value),{tool:e.tool,mobile:e.mobile,"stack-position":e.stackPosition,"tool-diff-panel":e.toolDiffPanel,"data-scroll-anchor-id":e.tool.id,onOpenMedia:r[0]||(r[0]=l=>o("openMedia",l)),onOpenFile:r[1]||(r[1]=l=>o("openFile",l)),onOpenToolDiff:r[2]||(r[2]=l=>o("openToolDiff",l)),onOpenAgent:r[3]||(r[3]=l=>o("openAgent",l))},null,40,["tool","mobile","stack-position","tool-diff-panel","data-scroll-anchor-id"]))}});function pr(e){if(e>=1024*1024)return`${P_(e/(1024*1024))}M`;if(e>=1024){const t=e/1024;return`${t>=100?Math.round(t):P_(t)}k`}return String(e)}function P_(e){const t=e.toFixed(1);return t.endsWith(".0")?t.slice(0,-2):t}function FU(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 M1(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 OU(e){return!(e.tool.status==="ok"&&e.tool.media)}function RU(e,t){return t<=1?"single":e===0?"first":e===t-1?"last":"middle"}function BU(e){const t=M1(e),n=[];let o=[];const s=()=>{if(o.length===1){const[i]=o;i&&n.push({kind:"tool",tool:i.tool,sourceIndex:i.sourceIndex})}else o.length>1&&n.push({kind:"tool-stack",tools:o});o=[]};return t.forEach((i,r)=>{if(i.kind==="tool"){if(OU(i)){o.push({tool:i.tool,sourceIndex:r});return}s(),n.push({kind:"tool",tool:i.tool,sourceIndex:r});return}s(),i.kind==="thinking"?n.push({kind:"thinking",thinking:i.thinking,sourceIndex:r}):i.kind==="text"&&n.push({kind:"text",text:i.text,sourceIndex:r})}),s(),n}function DU(e){return M1(e).flatMap(t=>t.kind==="text"&&t.text?[t.text]:[]).join(`
|
|
75
|
-
|
|
76
|
-
`)}function PU(e){const t=[];for(const n of M1(e))if(n.kind==="thinking"&&n.thinking)t.push(`> **Thinking**
|
|
77
|
-
> ${n.thinking.split(`
|
|
78
|
-
`).join(`
|
|
79
|
-
> `)}`);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 o=n.tool.output.join(`
|
|
80
|
-
`);t.push(`\`\`\`
|
|
81
|
-
[${n.tool.name}]
|
|
82
|
-
${o}
|
|
83
|
-
\`\`\``)}return t.join(`
|
|
84
|
-
|
|
85
|
-
`)}function y6(e){return e.tool.id||`tool-${e.sourceIndex}`}function HU(e,t){return e.kind==="tool-stack"?`tool-stack-${e.tools[0]?.sourceIndex??t}`:e.kind==="tool"?y6({tool:e.tool,sourceIndex:e.sourceIndex}):`${e.kind}-${e.sourceIndex}`}const WU=["aria-expanded"],zU={class:"tg-title"},UU={class:"tg-meta"},qU=["inert"],jU={class:"tool-group-body-inner"},VU=Qe({__name:"ToolGroup",props:{tools:{},mobile:{type:Boolean,default:!1},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e,{emit:t}){const n=e,o=t,s=ne(!0),i=D(()=>n.tools.length),r=D(()=>n.tools.some(h=>h.tool.status==="running")?"running":n.tools.some(h=>h.tool.status==="error")?"error":"done"),{t:l}=Ot(),a=D(()=>{switch(r.value){case"running":return l("tools.group.running");case"error":return l("tools.group.error");default:return l("tools.group.done")}});function c(){s.value=!s.value}const u=Jt("pinScroll",()=>{}),d=ne(null);function f(){c();const h=d.value;h&&kt(()=>u(h))}return(h,p)=>(x(),E("div",{class:We(["tool-group",{open:s.value}])},[_("button",{class:"tool-group-head",ref_key:"headEl",ref:d,type:"button","aria-expanded":s.value,onClick:f},[fe(ff,{status:r.value},null,8,["status"]),fe(Ye,{class:"tg-ic",name:"list",size:"sm"}),_("span",zU,R(C(l)("tools.group.title",i.value)),1),_("span",UU,"· "+R(a.value),1),fe(Ye,{class:"tg-car",name:"chevron-right",size:"sm"})],8,WU),_("div",{class:We(["tool-group-body",{open:s.value}]),inert:!s.value},[_("div",jU,[(x(!0),E(Pe,null,lt(e.tools,(m,y)=>(x(),Ae(v6,{key:C(y6)(m),tool:m.tool,mobile:e.mobile,"stack-position":C(RU)(y,e.tools.length),"tool-diff-panel":e.toolDiffPanel,onOpenMedia:p[0]||(p[0]=k=>o("openMedia",k)),onOpenFile:p[1]||(p[1]=k=>o("openFile",k)),onOpenToolDiff:p[2]||(p[2]=k=>o("openToolDiff",k)),onOpenAgent:p[3]||(p[3]=k=>o("openAgent",k))},null,8,["tool","mobile","stack-position","tool-diff-panel"]))),128))])],10,qU)],2))}}),KU=ft(VU,[["__scopeId","data-v-1735685f"]]);var GU=Object.create,Xk=Object.defineProperty,YU=Object.getOwnPropertyDescriptor,k6=Object.getOwnPropertyNames,ZU=Object.getPrototypeOf,XU=Object.prototype.hasOwnProperty,b6=(e,t)=>function(){return t||(0,e[k6(e)[0]])((t={exports:{}}).exports,t),t.exports},x6=e=>{let t={};for(var n in e)Xk(t,n,{get:e[n],enumerable:!0});return t},QU=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(var s=k6(t),i=0,r=s.length,l;i<r;i++)l=s[i],!XU.call(e,l)&&l!==n&&Xk(e,l,{get:(a=>t[a]).bind(null,l),enumerable:!(o=YU(t,l))||o.enumerable});return e},w6=(e,t,n)=>(n=e!=null?GU(ZU(e)):{},QU(Xk(n,"default",{value:e,enumerable:!0}),e));function JU(e,t,n,o){const s=Number(e[t].meta.id+1).toString();let i="";return typeof o.docId=="string"&&(i=`-${o.docId}-`),i+s}function eq(e,t){let n=Number(e[t].meta.id+1).toString();return e[t].meta.subId>0&&(n+=`:${e[t].meta.subId}`),`[${n}]`}function tq(e,t,n,o,s){const i=s.rules.footnote_anchor_name(e,t,n,o,s),r=s.rules.footnote_caption(e,t,n,o,s);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 nq(e,t,n){return(n.xhtmlOut?`<hr class="footnotes-sep" />
|
|
86
|
-
`:`<hr class="footnotes-sep">
|
|
87
|
-
`)+`<section class="footnotes">
|
|
88
|
-
<ol class="footnotes-list">
|
|
89
|
-
`}function oq(){return`</ol>
|
|
90
|
-
</section>
|
|
91
|
-
`}function sq(e,t,n,o,s){let i=s.rules.footnote_anchor_name(e,t,n,o,s);return e[t].meta.subId>0&&(i+=`:${e[t].meta.subId}`),`<li id="fn${i}" class="footnote-item">`}function iq(){return`</li>
|
|
92
|
-
`}function rq(e,t,n,o,s){let i=s.rules.footnote_anchor_name(e,t,n,o,s);return e[t].meta.subId>0&&(i+=`:${e[t].meta.subId}`),` <a href="#fnref${i}" class="footnote-backref">↩︎</a>`}function lq(e){const t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=tq,e.renderer.rules.footnote_block_open=nq,e.renderer.rules.footnote_block_close=oq,e.renderer.rules.footnote_open=sq,e.renderer.rules.footnote_close=iq,e.renderer.rules.footnote_anchor=rq,e.renderer.rules.footnote_caption=eq,e.renderer.rules.footnote_anchor_name=JU;function o(l,a,c,u){const d=l.bMarks[a]+l.tShift[a],f=l.eMarks[a];if(d+4>f||l.src.charCodeAt(d)!==91||l.src.charCodeAt(d+1)!==94)return!1;let h;for(h=d+2;h<f;h++){if(l.src.charCodeAt(h)===32)return!1;if(l.src.charCodeAt(h)===93)break}if(h===d+2||h+1>=f||l.src.charCodeAt(++h)!==58)return!1;if(u)return!0;h++,l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.refs||(l.env.footnotes.refs={});const p=l.src.slice(d+2,h-2);l.env.footnotes.refs[`:${p}`]=-1;const m=new l.Token("footnote_reference_open","",1);m.meta={label:p},m.level=l.level++,l.tokens.push(m);const y=l.bMarks[a],k=l.tShift[a],g=l.sCount[a],v=l.parentType,b=h,A=l.sCount[a]+h-(l.bMarks[a]+l.tShift[a]);let I=A;for(;h<f;){const M=l.src.charCodeAt(h);if(n(M))M===9?I+=4-I%4:I++;else break;h++}l.tShift[a]=h-b,l.sCount[a]=I-A,l.bMarks[a]=b,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=v,l.blkIndent-=4,l.tShift[a]=k,l.sCount[a]=g,l.bMarks[a]=y;const T=new l.Token("footnote_reference_close","",-1);return T.level=--l.level,l.tokens.push(T),!0}function s(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,f=t(l,u+1);if(f<0)return!1;if(!a){l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.list||(l.env.footnotes.list=[]);const h=l.env.footnotes.list.length,p=[];l.md.inline.parse(l.src.slice(d,f),l.md,l.env,p);const m=l.push("footnote_ref","",0);m.meta={id:h},l.env.footnotes.list[h]={content:l.src.slice(d,f),tokens:p}}return l.pos=f+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 f=l.src.slice(u+2,d-1);if(typeof l.env.footnotes.refs[`:${f}`]>"u")return!1;if(!a){l.env.footnotes.list||(l.env.footnotes.list=[]);let h;l.env.footnotes.refs[`:${f}`]<0?(h=l.env.footnotes.list.length,l.env.footnotes.list[h]={label:f,count:0},l.env.footnotes.refs[`:${f}`]=h):h=l.env.footnotes.refs[`:${f}`];const p=l.env.footnotes.list[h].count;l.env.footnotes.list[h].count++;const m=l.push("footnote_ref","",0);m.meta={id:h,subId:p,label:f}}return l.pos=d,l.posMax=c,!0}function r(l){let a,c,u,d=!1;const f={};if(!l.env.footnotes||(l.tokens=l.tokens.filter(function(p){return p.type==="footnote_reference_open"?(d=!0,c=[],u=p.meta.label,!1):p.type==="footnote_reference_close"?(d=!1,f[":"+u]=c,!1):(d&&c.push(p),!d)}),!l.env.footnotes.list))return;const h=l.env.footnotes.list;l.tokens.push(new l.Token("footnote_block_open","",1));for(let p=0,m=h.length;p<m;p++){const y=new l.Token("footnote_open","",1);if(y.meta={id:p,label:h[p].label},l.tokens.push(y),h[p].tokens){a=[];const v=new l.Token("paragraph_open","p",1);v.block=!0,a.push(v);const b=new l.Token("inline","",0);b.children=h[p].tokens,b.content=h[p].content,a.push(b);const A=new l.Token("paragraph_close","p",-1);A.block=!0,a.push(A)}else h[p].label&&(a=f[`:${h[p].label}`]);a&&(l.tokens=l.tokens.concat(a));let k;l.tokens[l.tokens.length-1].type==="paragraph_close"?k=l.tokens.pop():k=null;const g=h[p].count>0?h[p].count:1;for(let v=0;v<g;v++){const b=new l.Token("footnote_anchor","",0);b.meta={id:p,subId:v,label:h[p].label},l.tokens.push(b)}k&&l.tokens.push(k),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",o,{alt:["paragraph","reference"]}),e.inline.ruler.after("image","footnote_inline",s),e.inline.ruler.after("footnote_inline","footnote_ref",i),e.core.ruler.after("inline","footnote_tail",r)}function aq(e){function t(o,s){const i=o.pos,r=o.src.charCodeAt(i);if(s||r!==43)return!1;const l=o.scanDelims(o.pos,!0);let a=l.length;const c=String.fromCharCode(r);if(a<2)return!1;if(a%2){const u=o.push("text","",0);u.content=c,a--}for(let u=0;u<a;u+=2){const d=o.push("text","",0);d.content=c+c,!(!l.can_open&&!l.can_close)&&o.delimiters.push({marker:r,length:0,jump:u/2,token:o.tokens.length-1,end:-1,open:l.can_open,close:l.can_close})}return o.pos+=l.length,!0}function n(o,s){let i;const r=[],l=s.length;for(let a=0;a<l;a++){const c=s[a];if(c.marker!==43||c.end===-1)continue;const u=s[c.end];i=o.tokens[c.token],i.type="ins_open",i.tag="ins",i.nesting=1,i.markup="++",i.content="",i=o.tokens[u.token],i.type="ins_close",i.tag="ins",i.nesting=-1,i.markup="++",i.content="",o.tokens[u.token-1].type==="text"&&o.tokens[u.token-1].content==="+"&&r.push(u.token-1)}for(;r.length;){const a=r.pop();let c=a+1;for(;c<o.tokens.length&&o.tokens[c].type==="ins_close";)c++;c--,a!==c&&(i=o.tokens[c],o.tokens[c]=o.tokens[a],o.tokens[a]=i)}}e.inline.ruler.before("emphasis","ins",t),e.inline.ruler2.before("emphasis","ins",function(o){const s=o.tokens_meta,i=(o.tokens_meta||[]).length;n(o,o.delimiters);for(let r=0;r<i;r++)s[r]&&s[r].delimiters&&n(o,s[r].delimiters)})}function cq(e){function t(o,s){const i=o.pos,r=o.src.charCodeAt(i);if(s||r!==61)return!1;const l=o.scanDelims(o.pos,!0);let a=l.length;const c=String.fromCharCode(r);if(a<2)return!1;if(a%2){const u=o.push("text","",0);u.content=c,a--}for(let u=0;u<a;u+=2){const d=o.push("text","",0);d.content=c+c,!(!l.can_open&&!l.can_close)&&o.delimiters.push({marker:r,length:0,jump:u/2,token:o.tokens.length-1,end:-1,open:l.can_open,close:l.can_close})}return o.pos+=l.length,!0}function n(o,s){const i=[],r=s.length;for(let l=0;l<r;l++){const a=s[l];if(a.marker!==61||a.end===-1)continue;const c=s[a.end],u=o.tokens[a.token];u.type="mark_open",u.tag="mark",u.nesting=1,u.markup="==",u.content="";const d=o.tokens[c.token];d.type="mark_close",d.tag="mark",d.nesting=-1,d.markup="==",d.content="",o.tokens[c.token-1].type==="text"&&o.tokens[c.token-1].content==="="&&i.push(c.token-1)}for(;i.length;){const l=i.pop();let a=l+1;for(;a<o.tokens.length&&o.tokens[a].type==="mark_close";)a++;if(a--,l!==a){const c=o.tokens[a];o.tokens[a]=o.tokens[l],o.tokens[l]=c}}}e.inline.ruler.before("emphasis","mark",t),e.inline.ruler2.before("emphasis","mark",function(o){let s;const i=o.tokens_meta,r=(o.tokens_meta||[]).length;for(n(o,o.delimiters),s=0;s<r;s++)i[s]&&i[s].delimiters&&n(o,i[s].delimiters)})}const uq=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function dq(e,t){const n=e.posMax,o=e.pos;if(e.src.charCodeAt(o)!==126||t||o+2>=n)return!1;e.pos=o+1;let s=!1;for(;e.pos<n;){if(e.src.charCodeAt(e.pos)===126){s=!0;break}e.md.inline.skipToken(e)}if(!s||o+1===e.pos)return e.pos=o,!1;const i=e.src.slice(o+1,e.pos);if(i.match(/(^|[^\\])(\\\\)*\s/))return e.pos=o,!1;e.posMax=e.pos,e.pos=o+1;const r=e.push("sub_open","sub",1);r.markup="~";const l=e.push("text","",0);l.content=i.replace(uq,"$1");const a=e.push("sub_close","sub",-1);return a.markup="~",e.pos=e.posMax+1,e.posMax=n,!0}function fq(e){e.inline.ruler.after("emphasis","sub",dq)}const hq=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function pq(e,t){const n=e.posMax,o=e.pos;if(e.src.charCodeAt(o)!==94||t||o+2>=n)return!1;e.pos=o+1;let s=!1;for(;e.pos<n;){if(e.src.charCodeAt(e.pos)===94){s=!0;break}e.md.inline.skipToken(e)}if(!s||o+1===e.pos)return e.pos=o,!1;const i=e.src.slice(o+1,e.pos);if(i.match(/(^|[^\\])(\\\\)*\s/))return e.pos=o,!1;e.posMax=e.pos,e.pos=o+1;const r=e.push("sup_open","sup",1);r.markup="^";const l=e.push("text","",0);l.content=i.replace(hq,"$1");const a=e.push("sup_close","sup",-1);return a.markup="^",e.pos=e.posMax+1,e.posMax=n,!0}function mq(e){e.inline.ruler.after("emphasis","sup",pq)}var gq=b6({"../../node_modules/.pnpm/markdown-it-task-checkbox@1.0.6/node_modules/markdown-it-task-checkbox/index.js":((e,t)=>{t.exports=function(m,y){y=Object.assign({},{disabled:!0,divWrap:!1,divClass:"checkbox",idPrefix:"cbx_",ulClass:"task-list",liClass:"task-list-item"},y),m.core.ruler.after("inline","github-task-lists",function(k){for(var g=k.tokens,v=0,b=2;b<g.length;b++)s(g,b)&&(i(g[b],v,y,k.Token),v+=1,n(g[b-2],"class",y.liClass),n(g[o(g,b-2)],"class",y.ulClass))})};function n(m,y,k){var g=m.attrIndex(y),v=[y,k];g<0?m.attrPush(v):m.attrs[g]=v}function o(m,y){for(var k=m[y].level-1,g=y-1;g>=0;g--)if(m[g].level===k)return g;return-1}function s(m,y){return d(m[y])&&f(m[y-1])&&h(m[y-2])&&p(m[y])}function i(m,y,k,g){var v=k.idPrefix+y;m.children[0].content=m.children[0].content.slice(3),m.children.unshift(l(v,g)),m.children.push(a(g)),m.children.unshift(r(m,v,k,g)),k.divWrap&&(m.children.unshift(c(k,g)),m.children.push(u(g)))}function r(m,y,k,g){var v=new g("checkbox_input","input",0);return v.attrs=[["type","checkbox"],["id",y]],/^\[[xX]\][ \u00A0]/.test(m.content)===!0&&v.attrs.push(["checked","true"]),k.disabled===!0&&v.attrs.push(["disabled","true"]),v}function l(m,y){var k=new y("label_open","label",1);return k.attrs=[["for",m]],k}function a(m){return new m("label_close","label",-1)}function c(m,y){var k=new y("checkbox_open","div",0);return k.attrs=[["class",m.divClass]],k}function u(m){return new m("checkbox_close","div",-1)}function d(m){return m.type==="inline"}function f(m){return m.type==="paragraph_open"}function h(m){return m.type==="list_item_open"}function p(m){return/^\[[xX \u00A0]\][ \u00A0]/.test(m.content)}})}),vq=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))),yq=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0))),_g;const kq=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]]),bq=(_g=String.fromCodePoint)!==null&&_g!==void 0?_g: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 xq(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=kq.get(e))!==null&&t!==void 0?t:e}var Bo;(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"})(Bo||(Bo={}));const wq=32;var Ml;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Ml||(Ml={}));function vy(e){return e>=Bo.ZERO&&e<=Bo.NINE}function _q(e){return e>=Bo.UPPER_A&&e<=Bo.UPPER_F||e>=Bo.LOWER_A&&e<=Bo.LOWER_F}function Sq(e){return e>=Bo.UPPER_A&&e<=Bo.UPPER_Z||e>=Bo.LOWER_A&&e<=Bo.LOWER_Z||vy(e)}function Cq(e){return e===Bo.EQUALS||Sq(e)}var Oo;(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"})(Oo||(Oo={}));var Sl;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Sl||(Sl={}));var Aq=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=Oo.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Sl.Strict}startEntity(e){this.decodeMode=e,this.state=Oo.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case Oo.EntityStart:return e.charCodeAt(t)===Bo.NUM?(this.state=Oo.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=Oo.NamedEntity,this.stateNamedEntity(e,t));case Oo.NumericStart:return this.stateNumericStart(e,t);case Oo.NumericDecimal:return this.stateNumericDecimal(e,t);case Oo.NumericHex:return this.stateNumericHex(e,t);case Oo.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|wq)===Bo.LOWER_X?(this.state=Oo.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=Oo.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,o){if(t!==n){const s=n-t;this.result=this.result*Math.pow(o,s)+parseInt(e.substr(t,s),o),this.consumed+=s}}stateNumericHex(e,t){const n=t;for(;t<e.length;){const o=e.charCodeAt(t);if(vy(o)||_q(o))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(o,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){const n=t;for(;t<e.length;){const o=e.charCodeAt(t);if(vy(o))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(o,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===Bo.SEMI)this.consumed+=1;else if(this.decodeMode===Sl.Strict)return 0;return this.emitCodePoint(xq(this.result),this.consumed),this.errors&&(e!==Bo.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){const{decodeTree:n}=this;let o=n[this.treeIndex],s=(o&Ml.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){const i=e.charCodeAt(t);if(this.treeIndex=Mq(n,o,this.treeIndex+Math.max(1,s),i),this.treeIndex<0)return this.result===0||this.decodeMode===Sl.Attribute&&(s===0||Cq(i))?0:this.emitNotTerminatedNamedEntity();if(o=n[this.treeIndex],s=(o&Ml.VALUE_LENGTH)>>14,s!==0){if(i===Bo.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==Sl.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:t,decodeTree:n}=this,o=(n[t]&Ml.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,o,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){const{decodeTree:o}=this;return this.emitCodePoint(t===1?o[e]&~Ml.VALUE_LENGTH:o[e+1],n),t===3&&this.emitCodePoint(o[e+2],n),n}end(){var e;switch(this.state){case Oo.NamedEntity:return this.result!==0&&(this.decodeMode!==Sl.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Oo.NumericDecimal:return this.emitNumericEntity(0,2);case Oo.NumericHex:return this.emitNumericEntity(0,3);case Oo.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Oo.EntityStart:return 0}}};function _6(e){let t="";const n=new Aq(e,o=>t+=bq(o));return function(s,i){let r=0,l=0;for(;(l=s.indexOf("&",l))>=0;){t+=s.slice(r,l),n.startEntity(i);const c=n.write(s,l+1);if(c<0){r=l+n.end();break}r=l+c,l=c===0?r+1:r}const a=t+s.slice(r);return t="",a}}function Mq(e,t,n,o){const s=(t&Ml.BRANCH_LENGTH)>>7,i=t&Ml.JUMP_TABLE;if(s===0)return i!==0&&o===i?n:-1;if(i){const a=o-i;return a<0||a>=s?-1:e[n+a]-1}let r=n,l=r+s-1;for(;r<=l;){const a=r+l>>>1,c=e[a];if(c<o)r=a+1;else if(c>o)l=a-1;else return e[a+s]}return-1}const Eq=_6(vq);_6(yq);function Qk(e,t=Sl.Legacy){return Eq(e,t)}var Tq=w6(gq());const H_={};function Nq(e){let t=H_[e];if(t)return t;t=H_[e]=[];for(let n=0;n<128;n++){const o=String.fromCharCode(n);t.push(o)}for(let n=0;n<e.length;n++){const o=e.charCodeAt(n);t[o]="%"+("0"+o.toString(16).toUpperCase()).slice(-2)}return t}function E1(e,t){typeof t!="string"&&(t=E1.defaultChars);const n=Nq(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(o){let s="";for(let i=0,r=o.length;i<r;i+=3){const l=parseInt(o.slice(i+1,i+3),16);if(l<128){s+=n[l];continue}if((l&224)===192&&i+3<r){const a=parseInt(o.slice(i+4,i+6),16);if((a&192)===128){const c=l<<6&1984|a&63;c<128?s+="��":s+=String.fromCharCode(c),i+=3;continue}}if((l&240)===224&&i+6<r){const a=parseInt(o.slice(i+4,i+6),16),c=parseInt(o.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?s+="���":s+=String.fromCharCode(u),i+=6;continue}}if((l&248)===240&&i+9<r){const a=parseInt(o.slice(i+4,i+6),16),c=parseInt(o.slice(i+7,i+9),16),u=parseInt(o.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?s+="����":(d-=65536,s+=String.fromCharCode(55296+(d>>10),56320+(d&1023))),i+=9;continue}}s+="�"}return s})}E1.defaultChars=";/?:@&=+$,#";E1.componentChars="";var yy=E1;const W_={};function Iq(e){let t=W_[e];if(t)return t;t=W_[e]=[];for(let n=0;n<128;n++){const o=String.fromCharCode(n);/^[0-9a-z]$/i.test(o)?t.push(o):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 T1(e,t,n){typeof t!="string"&&(n=t,t=T1.defaultChars),typeof n>"u"&&(n=!0);const o=Iq(t);let s="";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))){s+=e.slice(i,i+3),i+=2;continue}if(l<128){s+=o[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){s+=encodeURIComponent(e[i]+e[i+1]),i++;continue}}s+="%EF%BF%BD";continue}s+=encodeURIComponent(e[i])}return s}T1.defaultChars=";/?:@&=+$,-_.!~*'()#";T1.componentChars="-_.!~*'()";var S6=T1;function Jk(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 am(){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 Lq=/^([a-z0-9.+-]+:)/i,$q=/:[0-9]*$/,Fq=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Oq=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
|
|
93
|
-
`," "]),Rq=["'"].concat(Oq),z_=["%","/","?",";","#"].concat(Rq),U_=["/","?","#"],Bq=255,q_=/^[+a-z0-9A-Z_-]{0,63}$/,Dq=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,j_={javascript:!0,"javascript:":!0},V_={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Pq(e,t){if(e&&e instanceof am)return e;const n=new am;return n.parse(e,t),n}am.prototype.parse=function(e,t){let n,o,s,i=e;if(i=i.trim(),!t&&e.split("#").length===1){const c=Fq.exec(i);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}let r=Lq.exec(i);if(r&&(r=r[0],n=r.toLowerCase(),this.protocol=r,i=i.substr(r.length)),(t||r||i.match(/^\/\/[^@\/]+@[^@\/]+/))&&(s=i.substr(0,2)==="//",s&&!(r&&j_[r])&&(i=i.substr(2),this.slashes=!0)),!j_[r]&&(s||r&&!V_[r])){let c=-1;for(let p=0;p<U_.length;p++)o=i.indexOf(U_[p]),o!==-1&&(c===-1||o<c)&&(c=o);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 p=0;p<z_.length;p++)o=i.indexOf(z_[p]),o!==-1&&(c===-1||o<c)&&(c=o);c===-1&&(c=i.length),i[c-1]===":"&&c--;const f=i.slice(0,c);i=i.slice(c),this.parseHost(f),this.hostname=this.hostname||"";const h=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!h){const p=this.hostname.split(/\./);for(let m=0,y=p.length;m<y;m++){const k=p[m];if(k&&!k.match(q_)){let g="";for(let v=0,b=k.length;v<b;v++)k.charCodeAt(v)>127?g+="x":g+=k[v];if(!g.match(q_)){const v=p.slice(0,m),b=p.slice(m+1),A=k.match(Dq);A&&(v.push(A[1]),b.unshift(A[2])),b.length&&(i=b.join(".")+i),this.hostname=v.join(".");break}}}}this.hostname.length>Bq&&(this.hostname=""),h&&(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),V_[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};am.prototype.parseHost=function(e){let t=$q.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 e2=Pq,C6=x6({decode:()=>yy,encode:()=>S6,format:()=>Jk,parse:()=>e2}),A6=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,M6=/[\0-\x1F\x7F-\x9F]/,Hq=/[\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]/,E6=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/,Wq=/[\$\+<->\^`\|~\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]/,T6=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,zq=x6({Any:()=>A6,Cc:()=>M6,Cf:()=>Hq,P:()=>E6,S:()=>Wq,Z:()=>T6}),Uq=Object.defineProperty,N6=e=>{let t={};for(var n in e)Uq(t,n,{get:e[n],enumerable:!0});return t},vo=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,o=t.length;n<o;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),o=[e,t];n<0?this.attrPush(o):this.attrs[n]=o}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}`}},qq=N6({arrayReplaceAt:()=>Xq,assign:()=>Yq,countLines:()=>no,escapeHtml:()=>rj,escapeRE:()=>aj,fromCodePoint:()=>pf,has:()=>Gq,isMdAsciiPunct:()=>dm,isPunctChar:()=>um,isPunctCode:()=>ky,isSpace:()=>Zq,isString:()=>Vq,isValidEntityCode:()=>I1,isWhiteSpace:()=>hf,lib:()=>cj,mdurl:()=>C6,normalizeReference:()=>N1,ucmicro:()=>cm,unescapeAll:()=>mf,unescapeMd:()=>tj});const cm=zq;function jq(e){return Object.prototype.toString.call(e)}function Vq(e){return jq(e)==="[object String]"}const Kq=Object.prototype.hasOwnProperty;function Gq(e,t){return Kq.call(e,t)}function Yq(e,...t){return t.forEach(n=>{if(n){if(typeof n!="object")throw new TypeError(`${String(n)}must be object`);Object.keys(n).forEach(o=>{e[o]=n[o]})}}),e}function Zq(e){return e===9||e===32}function hf(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 um(e){return cm.P.test(e)||cm.S.test(e)}const K_=new Map;function ky(e){if(dm(e))return!0;const t=K_.get(e);if(t!==void 0)return t;const n=um(String.fromCharCode(e));return K_.set(e,n),n}function dm(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 N1(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function Xq(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function I1(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 pf(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 I6=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,Qq=new RegExp(`${I6.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),Jq=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function ej(e,t){if(t.charCodeAt(0)===35&&Jq.test(t)){const o=t[1].toLowerCase()==="x"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return I1(o)?pf(o):e}const n=Qk(e);return n!==e?n:e}function tj(e){return e.includes("\\")?e.replace(I6,"$1"):e}function mf(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(Qq,(t,n,o)=>n||ej(t,o))}const nj=/[&<>"]/,oj=/[&<>"]/g,sj={"&":"&","<":"<",">":">",'"':"""};function ij(e){return sj[e]}function rj(e){return nj.test(e)?e.replace(oj,ij):e}const lj=/[.?*+^$[\]\\(){}|-]/g;function aj(e){return e.replace(lj,"\\$&")}const cj={mdurl:C6,ucmicro:cm};function no(e){if(e.length===0)return 0;let t=0,n=-1;for(;(n=e.indexOf(`
|
|
94
|
-
`,n+1))!==-1;)t++;return t}const uj=/(?:^|\n)[ \t]{0,3}\[\^[^\]\n]+\]:/m,dj=/(?:^|\n)[ \t]{0,3}\*\[[^\]\n]+\]:/m,fj=/(?:^|\n)[ \t]{0,3}\[(?!\^)(?:\\[\s\S]|[^\]\\[])+\][ \t]*:/m,t2=["references","footnotes","abbreviations","abbr","abbrs"],n2=Symbol.for("markdown-it-ts.global-state"),o2=Object.prototype.hasOwnProperty;function G_(e){return e==="reference-definition"||e==="footnote-definition"||e==="abbreviation-definition"}function Wi(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Ll(e){if(Array.isArray(e))return e.map(t=>Ll(t));if(Wi(e)){const t={};for(const n of Object.keys(e))t[n]=Ll(e[n]);return t}return e}function fm(e){return Array.isArray(e)?e.map((t,n)=>String(n)):Wi(e)?Object.keys(e):[]}function by(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(!by(e[n],t[n]))return!1;return!0}if(Wi(e)||Wi(t)){if(!Wi(e)||!Wi(t))return!1;const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(const s of n)if(!o2.call(t,s)||!by(e[s],t[s]))return!1;return!0}return Object.is(e,t)}function L6(e,t){if(Array.isArray(e))return e[Number(t)];if(Wi(e))return e[t]}function hj(e,t){if(Array.isArray(e)&&Array.isArray(t)){e.length=t.length;for(let n=0;n<t.length;n++)e[n]=Ll(t[n]);return e}if(Wi(e)&&Wi(t)){for(const n of Object.keys(e))o2.call(t,n)||delete e[n];for(const n of Object.keys(t))e[n]=Ll(t[n]);return e}return Ll(t)}function pj(e,t,n){const o=n.ownedKeys??[],s=e[t];if(Wi(s)||Array.isArray(s)){const i=new Set(fm(n.value));for(const r of o)n.existed&&i.has(r)?s[r]=Ll(L6(n.value,r)):delete s[r];!n.existed&&fm(s).length===0&&delete e[t];return}n.existed?e[t]=Ll(n.value):delete e[t]}function s2(e){const t=e[n2];return G_(t)?{reason:t,snapshot:{}}:t&&typeof t=="object"&&G_(t.reason)&&t.snapshot&&typeof t.snapshot=="object"?t:null}function mj(e,t){Object.defineProperty(e,n2,{value:t,enumerable:!1,configurable:!0,writable:!0})}function Ts(e){return!e||!e.includes("]:")&&!e.includes("*[")?null:uj.test(e)?"footnote-definition":dj.test(e)?"abbreviation-definition":fj.test(e)?"reference-definition":null}function Ff(e){return s2(e)?.reason??null}function iu(e,t,n){if(Ff(e)&&Zr(e),!t)return n();i2(e,t);try{const o=n();return r2(e),o}catch(o){throw Zr(e),o}}function i2(e,t){try{Zr(e);const n={};for(const o of t2)n[o]=o2.call(e,o)?{existed:!0,value:Ll(e[o])}:{existed:!1};mj(e,{reason:t,snapshot:n})}catch{}}function r2(e){const t=s2(e);if(t)for(const n of t2){const o=t.snapshot[n];if(!o)continue;o.ownedKeys=[];const s=e[n];if(!Wi(s)&&!Array.isArray(s))continue;const i=new Set(fm(o.existed?o.value:void 0));o.ownedKeys=fm(s).filter(r=>i.has(r)?!by(s[r],L6(o.value,r)):!0)}}function Zr(e){const t=s2(e);if(t){for(const n of t2){const o=t.snapshot[n];if(!o){delete e[n];continue}if(o.ownedKeys){pj(e,n,o);continue}o.existed?e[n]=hj(e[n],o.value):delete e[n]}delete e[n2]}}const xy=Symbol.for("markdown-it-ts.diagnostics");function L1(e,t){if(e)try{const n=e[xy];if(n&&typeof n=="object")return n;if(!t)return;const o={};return e[xy]=o,o}catch{return}}function Lr(e){return L1(e,!1)}function gj(e){if(e)try{const t=e[xy];t&&typeof t=="object"&&(delete t.strategy,delete t.chunk,delete t.unbounded,delete t.editable)}catch{}}function cs(e){gj(e)}function po(e,t){const n=L1(e,!0);n&&(n.strategy=t)}function Sg(e,t){const n=L1(e,!0);n&&(n.chunk=t)}function $6(e,t){const n=L1(e,!0);n&&(n.unbounded=t)}function vj(e){const t={};e=e||{},t.src_Any=A6.source,t.src_Cc=M6.source,t.src_Z=T6.source,t.src_P=E6.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 wy(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function $1(e){return Object.prototype.toString.call(e)}function yj(e){return $1(e)==="[object String]"}function kj(e){return $1(e)==="[object Object]"}function bj(e){return $1(e)==="[object RegExp]"}function Y_(e){return $1(e)==="[object Function]"}function xj(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const F6={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function wj(e){return Object.keys(e||{}).reduce(function(t,n){return t||F6.hasOwnProperty(n)},!1)}const _j={"http:":{validate:function(e,t,n){const o=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(o)?o.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){const o=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(o)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:o.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const o=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(o)?o.match(n.re.mailto)[0].length:0}}},Sj="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]",Cj="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function Aj(e){return function(t,n){const o=t.slice(n);return e.test(o)?o.match(e)[0].length:0}}function Z_(){return function(e,t){t.normalize(e)}}function hm(e){const t=e.re=vj(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(Sj),n.push(t.src_xn),t.src_tlds=n.join("|");function o(l){return l.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(o(t.tpl_email_fuzzy),"i"),t.email_fuzzy_global=RegExp(o(t.tpl_email_fuzzy),"ig"),t.link_fuzzy=RegExp(o(t.tpl_link_fuzzy),"i"),t.link_fuzzy_global=RegExp(o(t.tpl_link_fuzzy),"ig"),t.link_no_ip_fuzzy=RegExp(o(t.tpl_link_no_ip_fuzzy),"i"),t.link_no_ip_fuzzy_global=RegExp(o(t.tpl_link_no_ip_fuzzy),"ig"),t.host_fuzzy_test=RegExp(o(t.tpl_host_fuzzy_test),"i");const s=[];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,kj(a)){bj(a.validate)?c.validate=Aj(a.validate):Y_(a.validate)?c.validate=a.validate:i(l,a),Y_(a.normalize)?c.normalize=a.normalize:a.normalize?i(l,a):c.normalize=Z_();return}if(yj(a)){s.push(l);return}i(l,a)}),s.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:Z_()};const r=Object.keys(e.__compiled__).filter(function(l){return l.length>0&&e.__compiled__[l]}).map(xj).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")}function O6(e,t,n,o){const s=e.slice(n,o);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=o,this.raw=s,this.text=s,this.url=s}function ri(e,t){if(!(this instanceof ri))return new ri(e,t);t||wj(e)&&(t=e,e={}),this.__opts__=wy({},F6,t),this.__schemas__=wy({},_j,e),this.__compiled__={},this.__tlds__=Cj,this.__tlds_replaced__=!1,this.re={},hm(this)}ri.prototype.add=function(t,n){return this.__schemas__[t]=n,hm(this),this};ri.prototype.set=function(t){return this.__opts__=wy(this.__opts__,t),this};ri.prototype.test=function(t){if(!t.length)return!1;let n,o;if(this.re.schema_test.test(t)){for(o=this.re.schema_search,o.lastIndex=0;(n=o.exec(t))!==null;)if(this.testSchemaAt(t,n[2],o.lastIndex))return!0}return!!(this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&t.search(this.re.host_fuzzy_test)>=0&&t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)!==null||this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&t.indexOf("@")>=0&&t.match(this.re.email_fuzzy)!==null)};ri.prototype.pretest=function(t){return this.re.pretest.test(t)};ri.prototype.testSchemaAt=function(t,n,o){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,o,this):0};ri.prototype.match=function(t){const n=[],o=[],s=[],i=[];let r,l,a;function c(f,h){return f?h?f.index!==h.index?f.index<h.index?f:h:f.lastIndex>=h.lastIndex?f:h:f:h}if(!t.length)return null;if(this.re.schema_test.test(t))for(a=this.re.schema_search,a.lastIndex=0;(r=a.exec(t))!==null;)l=this.testSchemaAt(t,r[2],a.lastIndex),l&&o.push({schema:r[2],index:r.index+r[1].length,lastIndex:r.index+r[0].length+l});if(this.__opts__.fuzzyLink&&this.__compiled__["http:"])for(a=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,a.lastIndex=0;(r=a.exec(t))!==null;)s.push({schema:"",index:r.index+r[1].length,lastIndex:r.index+r[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"])for(a=this.re.email_fuzzy_global,a.lastIndex=0;(r=a.exec(t))!==null;)i.push({schema:"mailto:",index:r.index+r[1].length,lastIndex:r.index+r[0].length});const u=[0,0,0];let d=0;for(;;){const f=[o[u[0]],i[u[1]],s[u[2]]],h=c(c(f[0],f[1]),f[2]);if(!h)break;if(h===f[0]?u[0]++:h===f[1]?u[1]++:u[2]++,h.index<d)continue;const p=new O6(t,h.schema,h.index,h.lastIndex);this.__compiled__[p.schema].normalize(p,this),n.push(p),d=h.lastIndex}return n.length?n:null};ri.prototype.matchAtStart=function(t){if(!t.length)return null;const n=this.re.schema_at_start.exec(t);if(!n)return null;const o=this.testSchemaAt(t,n[2],n[0].length);if(!o)return null;const s=new O6(t,n[2],n.index+n[1].length,n.index+n[0].length+o);return this.__compiled__[s.schema].normalize(s,this),s};ri.prototype.tlds=function(t,n){return t=Array.isArray(t)?t:[t],n?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(o,s,i){return o!==i[s-1]}).reverse(),hm(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,hm(this),this)};ri.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};ri.prototype.onCompile=function(){};var R6=ri,Mj=b6({"../../node_modules/.pnpm/punycode.js@2.3.1/node_modules/punycode.js/punycode.js":((e,t)=>{const d=/^xn--/,f=/[^\0-\x7F]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=35,y=Math.floor,k=String.fromCharCode;function g(z){throw new RangeError(p[z])}function v(z,L){const O=[];let j=z.length;for(;j--;)O[j]=L(z[j]);return O}function b(z,L){const O=z.split("@");let j="";O.length>1&&(j=O[0]+"@",z=O[1]),z=z.replace(h,".");const Z=v(z.split("."),L).join(".");return j+Z}function A(z){const L=[];let O=0;const j=z.length;for(;O<j;){const Z=z.charCodeAt(O++);if(Z>=55296&&Z<=56319&&O<j){const ie=z.charCodeAt(O++);(ie&64512)==56320?L.push(((Z&1023)<<10)+(ie&1023)+65536):(L.push(Z),O--)}else L.push(Z)}return L}const I=z=>String.fromCodePoint(...z),T=function(z){return z>=48&&z<58?26+(z-48):z>=65&&z<91?z-65:z>=97&&z<123?z-97:36},M=function(z,L){return z+22+75*(z<26)-((L!=0)<<5)},$=function(z,L,O){let j=0;for(z=O?y(z/700):z>>1,z+=y(z/L);z>m*26>>1;j+=36)z=y(z/m);return y(j+(m+1)*z/(z+38))},N=function(z){const L=[],O=z.length;let j=0,Z=128,ie=72,U=z.lastIndexOf("-");U<0&&(U=0);for(let q=0;q<U;++q)z.charCodeAt(q)>=128&&g("not-basic"),L.push(z.charCodeAt(q));for(let q=U>0?U+1:0;q<O;){const ee=j;for(let oe=1,re=36;;re+=36){q>=O&&g("invalid-input");const we=T(z.charCodeAt(q++));we>=36&&g("invalid-input"),we>y((2147483647-j)/oe)&&g("overflow"),j+=we*oe;const me=re<=ie?1:re>=ie+26?26:re-ie;if(we<me)break;const Ee=36-me;oe>y(2147483647/Ee)&&g("overflow"),oe*=Ee}const le=L.length+1;ie=$(j-ee,le,ee==0),y(j/le)>2147483647-Z&&g("overflow"),Z+=y(j/le),j%=le,L.splice(j++,0,Z)}return String.fromCodePoint(...L)},F=function(z){const L=[];z=A(z);const O=z.length;let j=128,Z=0,ie=72;for(const ee of z)ee<128&&L.push(k(ee));const U=L.length;let q=U;for(U&&L.push("-");q<O;){let ee=2147483647;for(const oe of z)oe>=j&&oe<ee&&(ee=oe);const le=q+1;ee-j>y((2147483647-Z)/le)&&g("overflow"),Z+=(ee-j)*le,j=ee;for(const oe of z)if(oe<j&&++Z>2147483647&&g("overflow"),oe===j){let re=Z;for(let we=36;;we+=36){const me=we<=ie?1:we>=ie+26?26:we-ie;if(re<me)break;const Ee=re-me,ae=36-me;L.push(k(M(me+Ee%ae,0))),re=y(Ee/ae)}L.push(k(M(re,0))),ie=$(Z,le,q===U),Z=0,++q}++Z,++j}return L.join("")},W={version:"2.3.1",ucs2:{decode:A,encode:I},decode:N,encode:F,toASCII:function(z){return b(z,function(L){return f.test(L)?"xn--"+F(L):L})},toUnicode:function(z){return b(z,function(L){return d.test(L)?N(L.slice(4).toLowerCase()):L})}};t.exports=W})}),B6=w6(Mj());function l2(e,t,n){let o,s=t;const i={ok:!1,pos:0,str:""};if(e.charCodeAt(s)===60){for(s++;s<n;){if(o=e.charCodeAt(s),o===10||o===60)return i;if(o===62)return i.pos=s+1,i.str=mf(e.slice(t+1,s)),i.ok=!0,i;if(o===92&&s+1<n){s+=2;continue}s++}return i}let r=0;for(;s<n&&(o=e.charCodeAt(s),!(o===32||o<32||o===127));){if(o===92&&s+1<n){if(e.charCodeAt(s+1)===32)break;s+=2;continue}if(o===40&&(r++,r>32))return i;if(o===41){if(r===0)break;r--}s++}return t===s||r!==0||(i.str=mf(e.slice(t,s)),i.pos=s,i.ok=!0),i}var D6=l2;const kp=-2;function Ej(e,t,n,o){let s=1,i=t+1;for(;i<n;){const r=e.charCodeAt(i);if(r===93){if(s--,s===0)return i;if(o){const l=i+1<n?e.charCodeAt(i+1):0;if(l===40||l===91)return kp}i++;continue}if(r===92){i+=2;continue}if(r===96||r===60||r===33&&i+1<n&&e.charCodeAt(i+1)===91)return kp;if(r===91){s++,i++;continue}i++}return-1}function a2(e,t,n){let o=1,s=!1,i,r;const l=e.src,a=e.posMax,c=e.pos,u=e.linkLabelNoCloseFrom;if(u>=0&&t+1>=u)return-1;const d=l.indexOf("]",t+1);if(d<0||d>=a)return e.linkLabelNoCloseFrom=t+1,-1;const f=Ej(l,t,a,n);if(f!==kp)return f;for(e.pos=t+1;e.pos<a;){if(i=l.charCodeAt(e.pos),i===93&&(o--,o===0)){s=!0;break}if(r=e.pos,e.md.inline.skipToken(e),i===91){if(r===e.pos-1)o++;else if(n)return e.pos=c,-1}}let h=-1;return s&&(h=e.pos),e.pos=c,h}var pm=a2;function c2(e,t,n,o){let s,i=t;const r={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(o)r.str=o.str,r.marker=o.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(s=e.charCodeAt(i),s===r.marker)return r.pos=i+1,r.str+=mf(e.slice(t,i)),r.ok=!0,r;if(s===40&&r.marker===41)return r;s===92&&i+1<n&&i++,i++}return r.can_continue=!0,r.str+=mf(e.slice(t,i)),r}var P6=c2;function F1(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 u2(e,t){e.attrs||(e.attrs=[]),e.attrs.push(t)}function Tj(e,t,n){const o=F1(e,t),s=[t,n];o<0?u2(e,s):e.attrs[o]=s}function Nj(e,t){const n=F1(e,t);return n>=0?e.attrs[n][1]:null}function Ij(e,t,n){const o=F1(e,t);o<0?u2(e,[t,n]):e.attrs[o][1]=`${e.attrs[o][1]} ${n}`}var Lj=N6({attrGet:()=>Nj,attrIndex:()=>F1,attrJoin:()=>Ij,attrPush:()=>u2,attrSet:()=>Tj,parseLinkDestination:()=>l2,parseLinkLabel:()=>a2,parseLinkTitle:()=>c2});function $j(e){return e.includes("\r")||e.includes("\0")}function H6(e){return typeof e=="string"?e:e.toString()}function Fj(e){if(e.inlineMode){const t=new vo("inline","",0);t.content=H6(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 Oj=/^([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])?)*)$/,Rj=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function Bj(e,t){let n=e.pos;const o=e.src;if(o.charCodeAt(n)!==60)return!1;const s=n,i=e.posMax;for(;;){if(++n>=i)return!1;const l=o.charCodeAt(n);if(l===60)return!1;if(l===62)break}const r=o.slice(s+1,n);if(Rj.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(Oj.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 Dj=Bj;function Pj(e,t){const n=e.src;let o=e.pos;if(n.charCodeAt(o)!==96)return!1;const s=o;o++;const i=e.posMax;for(;o<i&&n.charCodeAt(o)===96;)o++;const r=n.slice(s,o),l=r.length;if(e.backticksScanned&&(e.backticks[l]||0)<=s)return t||(e.pending+=r),e.pos+=l,!0;let a=o,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 f=n.slice(o,c);f.includes(`
|
|
95
|
-
`)&&(f=f.replace(/\n/g," ")),f.length>2&&f.charCodeAt(0)===32&&f.charCodeAt(f.length-1)===32&&(f=f.slice(1,-1)),d.content=f}return e.pos=a,!0}e.backticks[u]=c}return e.backticksScanned=!0,t||(e.pending+=r),e.pos+=l,!0}var Hj=Pj;function X_(e){const t={},n=e.length;if(!n)return;let o=0,s=-2;const i=[];for(let r=0;r<n;r++){const l=e[r];if(i.push(0),(e[o].marker!==l.marker||s!==l.token-1)&&(o=r),s=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=o-i[o]-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 f=!1;if((d.close||l.open)&&(d.length+l.length)%3===0&&(d.length%3!==0||l.length%3!==0)&&(f=!0),!f){const h=c>0&&!e[c-1].open?i[c-1]+1:0;i[r]=r-c+h,i[c]=h,l.open=!1,d.end=r,d.close=!1,u=-1,s=-2;break}}}u!==-1&&(t[l.marker][(l.open?3:0)+(l.length||0)%3]=u)}}function Wj(e){const t=e.tokens_meta,n=e.tokens_meta.length;X_(e.delimiters);for(let o=0;o<n;o++)t[o]&&t[o].delimiters&&X_(t[o].delimiters)}var zj=Wj;const W6="*",z6="_";function Uj(e,t){if(t)return!1;const n=e.src.charCodeAt(e.pos);if(n!==95&&n!==42)return!1;const o=e.scanDelims(e.pos,n===42);if(!o||o.length===0)return!1;const s=n===42?W6:z6,i=o.length,r=o.can_open,l=o.can_close,a=e.tokens,c=e.delimiters;for(let u=0;u<i;u++){const d=e.push("text","",0);d.content=s,c.push({marker:n,length:i,token:a.length-1,end:-1,open:r,close:l})}return e.pos+=i,!0}function Q_(e,t){const n=t.length,o=e.tokens;for(let s=n-1;s>=0;s--){const i=t[s],r=i.marker;if(r!==95&&r!==42||i.end===-1)continue;const l=t[i.end],a=i.token,c=l.token,u=s>0&&t[s-1].end===i.end+1&&t[s-1].marker===r&&t[s-1].token===a-1&&t[i.end+1].token===c+1,d=r===42?W6:z6,f=o[a];u?(f.type="strong_open",f.tag="strong",f.nesting=1,f.markup=d+d,f.content=""):(f.type="em_open",f.tag="em",f.nesting=1,f.markup=d,f.content="");const h=o[c];u?(h.type="strong_close",h.tag="strong",h.nesting=-1,h.markup=d+d,h.content=""):(h.type="em_close",h.tag="em",h.nesting=-1,h.markup=d,h.content=""),u&&(o[t[s-1].token].content="",o[t[i.end+1].token].content="",s--)}}function qj(e){const t=e.tokens_meta,n=e.tokens_meta.length;Q_(e,e.delimiters);for(let o=0;o<n;o++)t[o]&&t[o].delimiters&&Q_(e,t[o].delimiters)}const J_={tokenize:Uj,postProcess:qj};function U6(e){return Qk(e)}function d2(e){return e>=48&&e<=57}function jj(e){const t=e|32;return d2(e)||t>=97&&t<=102}function q6(e){const t=e|32;return t>=97&&t<=122}function Vj(e){return q6(e)||d2(e)}function Kj(e,t,n){let o=t+2;if(o>=n)return null;let s=!1,i=7,r=o;for((e.charCodeAt(o)|32)===120&&(s=!0,i=6,o++,r=o);o<n&&o-r<i;){const l=e.charCodeAt(o);if(!(s?jj(l):d2(l)))break;o++}return o===r||o>=n||e.charCodeAt(o)!==59?null:e.slice(t,o+1)}function Gj(e,t,n){let o=t+1;if(o>=n||!q6(e.charCodeAt(o)))return null;for(o++;o<n&&o-t-1<32&&Vj(e.charCodeAt(o));)o++;if(o-t-1<2||o>=n||e.charCodeAt(o)!==59)return null;const s=e.slice(t,o+1);return U6(s)!==s?s:null}function Yj(e,t){const n=e.pos,o=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=o)return!1;if(e.src.charCodeAt(n+1)===35){const s=Kj(e.src,n,o);if(s){if(!t){const i=(s.charCodeAt(2)|32)===120?Number.parseInt(s.slice(3,-1),16):Number.parseInt(s.slice(2,-1),10),r=e.push("text_special","",0);r.content=I1(i)?pf(i):pf(65533),r.markup=s,r.info="entity"}return e.pos+=s.length,!0}}else{const s=Gj(e.src,n,o);if(s){const i=U6(s);if(!t){const r=e.push("text_special","",0);r.content=i,r.markup=s,r.info="entity"}return e.pos+=s.length,!0}}return!1}var Zj=Yj;const j6=(()=>{const e=new Array(256).fill(0),t="\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-";for(let n=0;n<32;n++)e[t.charCodeAt(n)]=1;return e})(),_y=new Array(128),V6=new Array(128);for(let e=0;e<128;e++){const t=String.fromCharCode(e);_y[e]=`\\${t}`,V6[e]=j6[e]?t:_y[e]}function eS(e,t,n){e.pending&&e.pushPending();const o=new vo("text_special","",0);o.level=e.level,o.content=t,o.markup=n,o.info="escape",e.pendingLevel=e.level,e.tokens.push(o),e.tokens_meta.push(null)}function Xj(e,t){let n=e.pos;const o=e.posMax,s=e.src;if(s.charCodeAt(n)!==92||(n++,n>=o))return!1;let i=s.charCodeAt(n);if(i===10){for(t||e.push("hardbreak","br",0),n++;n<o&&(i=s.charCodeAt(n),!(i!==9&&i!==32));)n++;return e.pos=n,!0}if(i<128)return t?(e.pos=n+1,!0):(eS(e,V6[i],_y[i]),e.pos=n+1,!0);if(t){if(i>=55296&&i<=56319&&n+1<o){const a=s.charCodeAt(n+1);a>=56320&&a<=57343&&n++}return e.pos=n+1,!0}let r=s.charAt(n);if(i>=55296&&i<=56319&&n+1<o){const a=s.charCodeAt(n+1);a>=56320&&a<=57343&&(r+=s.charAt(n+1),n++)}const l=`\\${r}`;return eS(e,i<256&&j6[i]?r:l,l),e.pos=n+1,!0}var Qj=Xj;function Jj(e){let t,n,o=0;const s=e.tokens,i=e.tokens.length;for(t=n=0;t<i;t++){const r=s[t];r&&(r.nesting&&r.nesting<0&&o--,r.level=o,r.nesting&&r.nesting>0&&o++,r.type==="text"&&t+1<i&&s[t+1]?.type==="text"?s[t+1].content=r.content+s[t+1].content:(t!==n&&(s[n]=r),n++))}t!==n&&(s.length=n)}var eV=Jj;const K6=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,G6="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",tV=new RegExp(`^(?:${K6}|${G6}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<\\?[\\s\\S]*?\\?>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),nV=new RegExp(`^(?:${K6}|${G6})`);function Y6(e){return e===32||e===9||e===10||e===12||e===13}function oV(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!==97)return!1;const t=e.charCodeAt(2);return t===62||Y6(t)}function sV(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(!Y6(n))return!1}return!1}function iV(e){const t=e|32;return t>=97&&t<=122}function rV(e,t){if(!e.md.options.html)return!1;const n=e.posMax,o=e.pos,s=e.src;if(s.charCodeAt(o)!==60||o+2>=n)return!1;const i=s.charCodeAt(o+1);if(i!==33&&i!==63&&i!==47&&!iV(i))return!1;const r=s.slice(o).match(tV);if(!r)return!1;const l=r[0];if(!t){const a=e.pushSimple("html_inline","");a.content=l,oV(l)&&e.linkLevel++,sV(l)&&e.linkLevel--}return e.pos+=l.length,!0}var lV=rV;function aV(e,t){let n,o,s,i,r,l,a,c,u="";const d=e.pos,f=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const h=e.pos+2,p=pm(e,e.pos+1,!1);if(p<0)return!1;if(i=p+1,i<f&&e.src.charCodeAt(i)===40){for(i++;i<f&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);if(i>=f)return!1;if(l=D6(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<f&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);if(l=P6(e.src,i,e.posMax),i<f&&c!==i&&l.ok)for(a=l.str,i=l.pos;i<f&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);else a=""}if(i>=f||e.src.charCodeAt(i)!==41)return e.pos=d,!1;i++}else{if(typeof e.env.references>"u")return!1;if(i<f&&e.src.charCodeAt(i)===91?(c=i+1,i=pm(e,i),i>=0?s=e.src.slice(c,i++):i=p+1):i=p+1,s||(s=e.src.slice(h,p)),r=e.env.references[N1(s)],!r)return e.pos=d,!1;u=r.href,a=r.title}if(!t){o=e.src.slice(h,p);const m=[];e.md.inline.parse(o,e.md,e.env,m);const y=e.push("image","img",0);y.attrs=[["src",u],["alt",""]],y.children=m,y.content=o,a&&y.attrs.push(["title",a])}return e.pos=i,e.posMax=f,!0}var cV=aV;function Cg(e,t,n){for(;t<n;){const o=e.charCodeAt(t);if(o!==32&&o!==10)break;t++}return t}function uV(e,t){if(e.src.charCodeAt(e.pos)!==91)return!1;const n=e.src,o=e.pos,s=e.posMax,i=e.pos+1,r=pm(e,e.pos,!0);if(r<0)return!1;let l=r+1,a="",c="",u=!0;if(l<s&&n.charCodeAt(l)===40){l=Cg(n,l+1,s);const d=D6(n,l,s);if(d.ok){const f=e.md.normalizeLink(d.str);e.md.validateLink(f)&&(a=f,l=d.pos,u=!1)}else l<s&&n.charCodeAt(l)===41&&(a="",u=!1);if(!u){if(l=Cg(n,l,s),l<s&&n.charCodeAt(l)!==41){const f=P6(n,l,s);f.ok&&(c=f.str,l=Cg(n,f.pos,s))}l<s&&n.charCodeAt(l)===41?l++:u=!0}}if(u){if(typeof e.env.references>"u")return!1;let d;if(l=r+1,l<s&&n.charCodeAt(l)===91){const h=l+1,p=pm(e,l);p>=0?(d=n.slice(h,p),d||(d=n.slice(i,r)),l=p+1):d=n.slice(i,r)}else d=n.slice(i,r);const f=e.env.references[N1(d)];if(!f)return e.pos=o,!1;a=f.href,c=f.title}if(!t){e.pos=i,e.posMax=r;const d=e.push("link_open","a",1);d.attrs=c?[["href",a],["title",c]]:[["href",a]],e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=l,e.posMax=s,!0}var dV=uV;function Z6(e){const t=e|32;return t>=97&&t<=122}function fV(e){return e>=48&&e<=57}function hV(e){return Z6(e)||fV(e)||e===43||e===45||e===46}function pV(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&hV(e.charCodeAt(t));)t--;return t++,t>=e.length||!Z6(e.charCodeAt(t))?null:e.slice(t)}function mV(e,t,n){let o=t;for(;o<n;){const s=e.charCodeAt(o);if(s<=32||s===127||s===60)break;o++}return e.slice(t,o)}function gV(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const n=e.pos,o=e.posMax;if(n+3>o||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const s=pV(e.pending);if(!s)return!1;const i=mV(e.src,n-s.length,o),r=e.md.linkify.matchAtStart(i);if(!r)return!1;let l=r.url;if(l.length<=s.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,-s.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 f=e.push("link_close","a",-1);f.markup="linkify",f.info="auto"}return e.pos+=l.length-s.length,!0}function vV(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const o=e.pending.length-1,s=e.posMax;if(!t)if(o>=0&&e.pending.charCodeAt(o)===32)if(o>=1&&e.pending.charCodeAt(o-1)===32){let i=o-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<s;){const i=e.src.charCodeAt(n);if(i!==9&&i!==32)break;n++}return e.pos=n,!0}var yV=vV;function kV(e,t){const n=e.pos,o=e.src.charCodeAt(n);if(t||o!==126)return!1;const s=e.scanDelims(e.pos,!0);if(!s)return!1;let i=s.length;const r=String.fromCharCode(o);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:o,length:0,token:e.tokens.length-1,end:-1,open:s.can_open,close:s.can_close});return e.pos+=s.length,!0}function tS(e,t){let n;const o=[],s=t.length;for(let i=0;i<s;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==="~"&&o.push(l.token-1)}for(;o.length;){const i=o.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 bV(e){const t=e.delimiters;tS(e,t);const n=e.tokens_meta;if(n)for(let o=0;o<n.length;o++)n[o]&&n[o].delimiters&&tS(e,n[o].delimiters)}const nS={tokenize:kV,postProcess:bV};function oS(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 xV(e,t){const n=e.src,o=e.pos,s=e.posMax;if(o>=s||oS(n.charCodeAt(o)))return!1;let i=o+1;for(;i<s&&!oS(n.charCodeAt(i));)i++;return t||(e.pending+=i===o+1?n.charAt(o):n.slice(o,i)),e.pos=i,!0}var wV=xV;function f2(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function _V(e){if(e.length===0)return 0;const t=e.slice().sort((o,s)=>o-s),n=Math.floor(t.length/2);return t.length%2===0?(t[n-1]+t[n])/2:t[n]}function SV(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 X6(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,o={enabled:!0,fixture:n.fixture,mode:n.mode,startedAt:f2(),records:Object.create(null)};return t.__mdtsRuleProfile=o,o}function ru(e,t,n,o,s,i){const r=X6(e);if(!r)return;const l=`${t}:${n}`,a=r.records[l]??(r.records[l]=SV(t,n));a.calls++,a.inclusiveMs+=o,o>a.maxMs&&(a.maxMs=o),a.samples.push(o),i?(a.silentCalls++,s&&a.silentHits++):(a.normalCalls++,s&&a.normalHits++),s&&a.hits++,r.completedAt=f2()}function CV(e){const t=X6(e);if(!t)return null;const n=Object.keys(t.records);for(let o=0;o<n.length;o++){const s=t.records[n[o]];s.medianMs=_V(s.samples)}return t.completedAt=f2(),t}var sS=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t,n){const o=this.rules.findIndex(s=>s.name===e);o>=0&&this.rules.splice(o,1),this.rules.push({name:e,fn:t,alt:n?.alt||[],enabled:!0}),this.invalidateCache()}at(e,t,n){const o=this.rules.findIndex(s=>s.name===e);if(t===void 0){if(o<0)return;const s=this.rules[o];return Object.freeze({name:s.name,fn:s.fn,alt:s.alt?Object.freeze(s.alt.slice()):void 0,enabled:s.enabled})}if(o<0)throw new Error(`Parser rule not found: ${e}`);this.rules[o].fn=t,n?.alt!==void 0&&(this.rules[o].alt=n.alt),this.invalidateCache()}before(e,t,n,o){const s=this.rules.findIndex(r=>r.name===e);if(s<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(s,0,{name:t,fn:n,alt:o?.alt||[],enabled:!0}),this.invalidateCache()}after(e,t,n,o){const s=this.rules.findIndex(r=>r.name===e);if(s<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(s+1,0,{name:t,fn:n,alt:o?.alt||[],enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!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}o.push(i),this.rules[r].enabled||(this.rules[r].enabled=!0,s=!0)}return s&&this.invalidateCache(),o}disable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!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}o.push(i),this.rules[r].enabled&&(this.rules[r].enabled=!1,s=!0)}return s&&this.invalidateCache(),o}enableOnly(e){const t=new Set(e);let n=!1;for(const o of this.rules){const s=t.has(o.name);o.enabled!==s&&(o.enabled=s,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 o of this.rules)if(o.enabled&&o.alt)for(const s of o.alt)e.add(s);const t=new Map,n=new Map;for(const o of e){const s=[],i=[];for(const r of this.rules)r.enabled&&(o!==""&&!r.alt?.includes(o)||(s.push(r.fn),i.push({name:r.name,fn:r.fn})));t.set(o,s),n.set(o,i)}this.cache=t,this.namedCache=n}},Q6=class{src;md;env;tokens;tokens_meta;pos;posMax;level;pending;pendingLevel;cache;delimiters;_prev_delimiters;backticks;backticksScanned;linkLevel;linkLabelNoCloseFrom;maxNesting;constructor(e,t,n,o){this.src=e,this.md=t,this.env=n,this.tokens=o,this.tokens_meta=new Array(o.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.linkLabelNoCloseFrom=-1,this.maxNesting=t.options.maxNesting}pushPending(){const e=new vo("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 vo(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 o=new vo(e,t,n);let s=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),o.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],s={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(o),this.tokens_meta.push(s),o}scanDelims(e,t){const{src:n,posMax:o}=this,s=n.charCodeAt(e);let i=e;for(;i<o&&n.charCodeAt(i)===s;)i++;const r=i-e,l=e>0?n.charCodeAt(e-1):32,a=i<o?n.charCodeAt(i):32,c=hf(l),u=hf(a),d=ky(l),f=ky(a),h=!u&&(!f||c||d),p=!c&&(!d||u||f);return{can_open:h&&(t||!p||d),can_close:p&&(t||!h||f),length:r}}};Q6.prototype.Token=vo;const AV=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function J6(e){return!AV.test(e)}var MV=class{ruler;ruler2;cachedRulesVersion=-1;cachedRules=[];cachedRules2Version=-1;cachedRules2=[];defaultRulerVersion;defaultRuler2Version;constructor(){this.ruler=new sS,this.ruler2=new sS,this.ruler.push("text",wV),this.ruler.push("linkify",gV),this.ruler.push("newline",yV),this.ruler.push("escape",Qj),this.ruler.push("backticks",Hj),this.ruler.push("strikethrough",nS.tokenize),this.ruler.push("emphasis",J_.tokenize),this.ruler.push("link",dV),this.ruler.push("image",cV),this.ruler.push("autolink",Dj),this.ruler.push("html_inline",lV),this.ruler.push("entity",Zj),this.ruler2.push("balance_pairs",zj),this.ruler2.push("strikethrough",nS.postProcess),this.ruler2.push("emphasis",J_.postProcess),this.ruler2.push("fragments_join",eV),this.defaultRulerVersion=this.ruler.version,this.defaultRuler2Version=this.ruler2.version}skipToken(e){const t=e.pos,n=this.getRules(),o=n.length,s=e.cache,i=s[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<o;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(ru(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<o;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++,s[t]=e.pos}tokenize(e){const t=this.getRules(),n=t.length,o=e.posMax;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){for(;e.pos<o;){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>=o)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending();return}const s=this.ruler.getNamedRules("");for(;e.pos<o;){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=s[l].fn(e,!1);const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(ru(e.env,"inline",s[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>=o)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,o){if(typeof e=="string"&&e.length>0&&this.isDefaultRuleset()&&J6(e)){const a=new vo("text","",0);a.content=e,o.push(a);return}const s=new Q6(e,t,n,o);this.tokenize(s);const i=this.getRules2(),r=i.length;if(!(s.env&&(Object.prototype.hasOwnProperty.call(s.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(s.env,"__mdtsProfileRules")))){for(let a=0;a<r;a++)i[a](s,!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(s,!1);const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();ru(s.env,"inline2",l[a].name,u-c,!0,!1)}}parse(e,t,n,o){this.parseSource(e,t,n,o)}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 EV(e){const t=e.tokens,n=!!e.md?.inline?.isDefaultRuleset?.();for(let o=0,s=t.length;o<s;o++){const i=t[o];if(i.type==="inline"&&e.md){if(i.children||(i.children=[]),n&&i.content.length>0&&J6(i.content)){const r=new vo("text","",0);r.content=i.content,i.children.push(r);continue}e.md.inline.parse(i.content,e.md,e.env,i.children)}}}const TV=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,NV=/[0-9a-z]/i;function IV(e){return/^<a[>\s]/i.test(e)}function LV(e){return/^<\/a\s*>/i.test(e)}function $V(e,t){if(t.schema||t.index!==0||!t.raw)return t;for(let n=1;n<t.raw.length;n++){const o=t.raw[n-1],s=t.raw[n];if(!TV.test(o)||!NV.test(s))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 FV(e){const t=e.tokens;if(e.md?.options?.linkify)for(let n=0;n<t.length;n++){const o=t[n];if(o.type!=="inline"||!e.md.linkify.pretest(o.content))continue;let s=o.children;s||(s=[],o.children=s);let i=0;for(let r=s.length-1;r>=0;r--){const l=s[r];if(l.type==="link_close"){for(r--;r>=0&&s[r].level!==l.level&&s[r].type!=="link_open";)r--;continue}if(l.type==="html_inline"&&(IV(l.content)&&i>0&&i--,LV(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(h=>$V(e.md.linkify,h));if(c.length===0)continue;const u=[];let d=l.level,f=0;c.length>0&&c[0].index===0&&r>0&&s[r-1].type==="text_special"&&(c=c.slice(1));for(let h=0;h<c.length;h++){const p=c[h],m=e.md.normalizeLink(p.url);if(!e.md.validateLink(m))continue;let y=p.text;p.schema?p.schema==="mailto:"&&!/^mailto:/i.test(y)?y=e.md.normalizeLinkText(`mailto:${y}`).replace(/^mailto:/,""):y=e.md.normalizeLinkText(y):y=e.md.normalizeLinkText(`http://${y}`).replace(/^http:\/\//,"");const k=p.index;if(k>f){const A=new vo("text","",0);A.content=a.slice(f,k),A.level=d,u.push(A)}const g=new vo("link_open","a",1);g.attrs=[["href",m]],g.level=d++,g.markup="linkify",g.info="auto",u.push(g);const v=new vo("text","",0);v.content=y,v.level=d,u.push(v);const b=new vo("link_close","a",-1);b.level=--d,b.markup="linkify",b.info="auto",u.push(b),f=p.lastIndex}if(f!==0){if(f<a.length){const h=new vo("text","",0);h.content=a.slice(f),h.level=d,u.push(h)}s.splice(r,1,...u)}}}}const OV=/\r\n?|\n/g,RV=/\0/g;function BV(e){if(!e||typeof e.src!="string")return;const t=e.src,n=t.includes("\r"),o=t.includes("\0");if(!n&&!o)return;let s=t;n&&(s=s.replace(OV,`
|
|
96
|
-
`)),o&&(s=s.replace(RV,"�")),e.src=s}const e5=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,DV=/\((?:c|tm|r)\)/i,PV=/\((c|tm|r)\)/gi,HV={c:"©",r:"®",tm:"™"};function WV(e,t){return HV[t.toLowerCase()]}function zV(e){let t=0;for(let n=e.length-1;n>=0;n--){const o=e[n];o.type==="text"&&!t&&(o.content=o.content.replace(PV,WV)),o.type==="link_open"&&o.info==="auto"&&t--,o.type==="link_close"&&o.info==="auto"&&t++}}function UV(e){let t=0;for(let n=e.length-1;n>=0;n--){const o=e[n];o.type==="text"&&!t&&e5.test(o.content)&&(o.content=o.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–")),o.type==="link_open"&&o.info==="auto"&&t--,o.type==="link_close"&&o.info==="auto"&&t++}}function qV(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 o=n.content||(Array.isArray(n.children)?n.children.map(s=>s.type==="text"?s.content:"").join(""):"");DV.test(o)&&zV(n.children||[]),e5.test(o)&&UV(n.children||[])}}var jV=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(o=>o.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(o=>o.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 o=this.rules.findIndex(i=>i.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this.rules.findIndex(i=>i.name===t);s>=0&&this.rules.splice(s,1),this.rules.splice(o,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}after(e,t,n){const o=this.rules.findIndex(i=>i.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this.rules.findIndex(i=>i.name===t);s>=0&&this.rules.splice(s,1),this.rules.splice(o+1,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!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}o.push(i),this.rules[r].enabled||(this.rules[r].enabled=!0,s=!0)}return s&&this.invalidateCache(),o}disable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!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}o.push(i),this.rules[r].enabled&&(this.rules[r].enabled=!1,s=!0)}return s&&this.invalidateCache(),o}enableOnly(e){const t=new Set(e);let n=!1;for(const o of this.rules){const s=t.has(o.name);o.enabled!==s&&(o.enabled=s,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 VV=/['"]/,iS=/['"]/g,rS="’";function Dh(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function KV(e,t){let n;const o=[],s=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=o.length-1;n>=0&&!(o[n].level<=l);n--);if(o.length=n+1,r.type!=="text")continue;let a=r.content,c=0,u=a.length;e:for(;c<u;){iS.lastIndex=c;const d=iS.exec(a);if(!d)break;let f=!0,h=!0;c=d.index+1;const p=d[0]==="'";let m=32;if(d.index-1>=0)m=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){m=e[n].content.charCodeAt(e[n].content.length-1);break}let y=32;if(c<u)y=a.charCodeAt(c);else for(n=i+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){y=e[n].content.charCodeAt(0);break}const k=dm(m)||um(String.fromCharCode(m)),g=dm(y)||um(String.fromCharCode(y)),v=hf(m),b=hf(y);if(b?f=!1:g&&(v||k||(f=!1)),v?h=!1:k&&(b||g||(h=!1)),y===34&&d[0]==='"'&&m>=48&&m<=57&&(h=f=!1),f&&h&&(f=k,h=g),!f&&!h){p&&(r.content=Dh(r.content,d.index,rS));continue}if(h)for(n=o.length-1;n>=0;n--){let A=o[n];if(o[n].level<l)break;if(A.single===p&&o[n].level===l){A=o[n];let I,T;p?(I=s[2]||"‘",T=s[3]||"’"):(I=s[0]||"“",T=s[1]||"”"),r.content=Dh(r.content,d.index,T),e[A.token].content=Dh(e[A.token].content,A.pos,I),c+=T.length-1,A.token===i&&(c+=I.length-1),a=r.content,u=a.length,o.length=n;continue e}}f?o.push({token:i,pos:d.index,single:p,level:l}):h&&p&&(r.content=Dh(r.content,d.index,rS))}}}function GV(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 o=typeof n.content=="string"?n.content:(n.children||[]).map(s=>s.content||"").join("");!VV.test(o)||!n.children||KV(n.children,e)}}function YV(e){const t=e.tokens||[],n=t.length;for(let o=0;o<n;o++){const s=t[o];if(s.type!=="inline"||!Array.isArray(s.children))continue;const i=s.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 ZV=/^(?:vbscript|javascript|file|data):/,XV=/^data:image\/(?:gif|png|jpeg|webp);/,t5=["http:","https:","mailto:"];function n5(e){const t=e.trim().toLowerCase();return ZV.test(t)?XV.test(t):!0}function o5(e){const t=e2(e,!0);if(t.hostname&&(!t.protocol||t5.includes(t.protocol)))try{t.hostname=B6.default.toASCII(t.hostname)}catch{}return S6(Jk(t))}function s5(e){const t=e2(e,!0);if(t.hostname&&(!t.protocol||t5.includes(t.protocol)))try{t.hostname=B6.default.toUnicode(t.hostname)}catch{}return yy(Jk(t),`${yy.defaultChars}%`)}function QV(e){switch(e){case 9:case 32:return!0}return!1}function JV(e,t,n,o){const s=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 f=e.lineMax;if(a[t]-e.blkIndent>=4||s.charCodeAt(u)!==62)return!1;if(o)return!0;const h=[],p=[],m=[],y=[],k=e.md.block.ruler.getRulesForState(e,"blockquote"),g=e.parentType;e.parentType="blockquote";let v=!1,b;for(b=t;b<n;b++){const $=a[b]<e.blkIndent;if(u=i[b]+l[b],d=r[b],u>=d)break;if(s.charCodeAt(u++)===62&&!$){let F=a[b]+1,S,B;s.charCodeAt(u)===32?(u++,F++,B=!1,S=!0):s.charCodeAt(u)===9?(S=!0,(c[b]+F)%4===3?(u++,F++,B=!1):B=!0):S=!1;let W=F;for(h.push(i[b]),i[b]=u;u<d;){const z=s.charCodeAt(u);if(QV(z))z===9?W+=4-(W+c[b]+(B?1:0))%4:W++;else break;u++}v=u>=d,p.push(c[b]),c[b]=a[b]+1+(S?1:0),m.push(a[b]),a[b]=W-F,y.push(l[b]),l[b]=u-i[b];continue}if(v)break;let N=!1;for(let F=0,S=k.length;F<S;F++)if(k[F](e,b,n,!0)){N=!0;break}if(N){e.lineMax=b,e.blkIndent!==0&&(h.push(i[b]),p.push(c[b]),y.push(l[b]),m.push(a[b]),a[b]-=e.blkIndent);break}h.push(i[b]),p.push(c[b]),y.push(l[b]),m.push(a[b]),a[b]=-1}const A=e.blkIndent;e.blkIndent=0;const I=e.push("blockquote_open","blockquote",1);I.markup=">";const T=[t,0];I.map=T,e.md.block.tokenize(e,t,b);const M=e.push("blockquote_close","blockquote",-1);M.markup=">",e.lineMax=f,e.parentType=g,T[1]=e.line;for(let $=0;$<y.length;$++)i[$+t]=h[$],l[$+t]=y[$],a[$+t]=m[$],c[$+t]=p[$];return e.blkIndent=A,!0}function eK(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let o=t+1,s=o;for(;o<n;){if(e.isEmpty(o)){o++;continue}if(e.sCount[o]-e.blkIndent>=4){o++,s=o;continue}break}e.line=s;const i=e.push("code_block","code",0);return i.content=`${e.getLines(t,s,4+e.blkIndent,!1)}
|
|
97
|
-
`,i.map=[t,e.line],!0}function tK(e,t,n,o){let s=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||s+3>i)return!1;const r=e.src.charCodeAt(s);if(r!==126&&r!==96)return!1;let l=s;s=e.skipChars(s,r);let a=s-l;if(a<3)return!1;const c=e.src.slice(l,s),u=e.src.slice(s,i);if(r===96&&u.includes(String.fromCharCode(r)))return!1;if(o)return!0;let d=t,f=!1;for(;d++,!(d>=n||(s=l=e.bMarks[d]+e.tShift[d],i=e.eMarks[d],s<i&&e.sCount[d]<e.blkIndent));)if(e.src.charCodeAt(s)===r&&!(e.sCount[d]-e.blkIndent>=4)&&(s=e.skipChars(s,r),!(s-l<a)&&(s=e.skipSpaces(s),!(s<i)))){f=!0;break}a=e.sCount[t],e.line=d+(f?1:0);const h=e.push("fence","code",0);return h.info=u,h.content=e.getLines(t+1,d,a,!0),h.markup=c,h.map=[t,e.line],!0}const lS=["","h1","h2","h3","h4","h5","h6"],aS=["","#","##","###","####","#####","######"];function cS(e){switch(e){case 9:case 32:return!0}return!1}function nK(e,t,n,o){const s=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=s.charCodeAt(a);if(u!==35||a>=c)return!1;let d=1;for(u=s.charCodeAt(++a);u===35&&a<c&&d<=6;)d++,u=s.charCodeAt(++a);if(d>6||a<c&&!cS(u))return!1;if(o)return!0;c=e.skipSpacesBack(c,a);const f=e.skipCharsBack(c,35,a);f>a&&cS(s.charCodeAt(f-1))&&(c=f),e.line=t+1;const h=e.push("heading_open",lS[d],1);h.markup=aS[d],h.map=[t,e.line];const p=e.push("inline","",0);p.content=s.slice(a,c).trim(),p.map=[t,e.line],p.children=[];const m=e.push("heading_close",lS[d],-1);return m.markup=aS[d],!0}function oK(e){switch(e){case 9:case 32:return!0}return!1}function sK(e,t,n,o){const s=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<s;){const c=e.src.charCodeAt(i++);if(c!==r&&!oK(c))return!1;c===r&&l++}if(l<3)return!1;if(o)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 Sc=[[/^<(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(`${nV.source}\\s*$`),/^$/,!1]];function iK(e,t,n,o){let s=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(s)!==60)return!1;let r=e.src.slice(s,i),l=0;for(;l<Sc.length&&!Sc[l][0].test(r);l++);if(l===Sc.length)return!1;if(o)return Sc[l][2];let a=t+1;if(!Sc[l][1].test(r)){for(;a<n&&!(e.sCount[a]<e.blkIndent);a++)if(s=e.bMarks[a]+e.tShift[a],i=e.eMarks[a],r=e.src.slice(s,i),Sc[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 uS(e){switch(e){case 9:case 32:return!0}return!1}const Fd={Pipe:1,ParagraphTerminator:2};function rK(e){switch(e){case 35:case 42:case 43:case 45:case 60:case 62:case 95:case 96:case 124:case 126:return!0}return e>=48&&e<=57}var i5=class{src;md;env;tokens;bMarks=[];eMarks=[];tShift=[];sCount=[];bsCount=[];lineFlags=[];blkIndent=0;line=0;lineMax=0;tight=!1;ddIndent=-1;listIndent=-1;parentType="root";level=0;constructor(e,t,n,o){this.src=e,this.md=t,this.env=n,this.tokens=o;const s=this.src;let i=0,r=0,l=0,a=!1,c=0;for(let u=0,d=s.length;u<d;u++){const f=s.charCodeAt(u);if(f===124&&(c|=Fd.Pipe|Fd.ParagraphTerminator),!a)if(uS(f)){i++,f===9?r+=4-r%4:r++;continue}else a=!0,rK(f)&&(c|=Fd.ParagraphTerminator);(f===10||u===d-1)&&(f!==10&&u++,this.bMarks.push(l),this.eMarks.push(u),this.tShift.push(i),this.sCount.push(r),this.bsCount.push(0),this.lineFlags.push(c),a=!1,i=0,r=0,c=0,l=u+1)}this.bMarks.push(s.length),this.eMarks.push(s.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineFlags.push(0),this.lineMax=this.bMarks.length-1}push(e,t,n){if(n===0){const s=new vo(e,t,0);return s.block=!0,s.level=this.level,this.tokens.push(s),s}const o=new vo(e,t,n);return o.block=!0,n<0&&this.level--,o.level=this.level,n>0&&this.level++,this.tokens.push(o),o}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){const t=this.bMarks,n=this.tShift,o=this.eMarks;for(let s=this.lineMax;e<s&&!(t[e]+n[e]<o[e]);e++);return e}skipSpaces(e){const t=this.src;for(let n=t.length;e<n;e++){const o=t.charCodeAt(e);if(o!==9&&o!==32)break}return e}skipSpacesBack(e,t){if(e<=t)return e;const n=this.src;for(;e>t;){const o=n.charCodeAt(--e);if(o!==9&&o!==32)return e+1}return e}skipChars(e,t){const n=this.src;for(let o=n.length;e<o&&n.charCodeAt(e)===t;e++);return e}skipCharsBack(e,t,n){if(e<=n)return e;const o=this.src;for(;e>n;)if(t!==o.charCodeAt(--e))return e+1;return e}getLines(e,t,n,o){if(e>=t)return"";if(e+1===t){const u=e,d=this.bMarks[u];let f=d;const h=o?this.eMarks[u]+1:this.eMarks[u];let p=0;const m=this.src,y=this.bsCount,k=this.tShift;for(;f<h&&p<n;){const g=m.charCodeAt(f);if(g===9||g===32)g===9?p+=4-(p+y[u])%4:p++;else if(f-d<k[u])p++;else break;f++}return p>n?new Array(p-n+1).join(" ")+m.slice(f,h):m.slice(f,h)}const s=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 f=0;const h=r[d];let p=h,m;for(d+1<t||o?m=l[d]+1:m=l[d];p<m&&f<n;){const y=i.charCodeAt(p);if(uS(y))y===9?f+=4-(f+a[d])%4:f++;else if(p-h<c[d])f++;else break;p++}f>n?s[u]=new Array(f-n+1).join(" ")+i.slice(p,m):s[u]=i.slice(p,m)}return s.join("")}};i5.prototype.Token=vo;function lK(e,t,n){for(let o=t;o<n;o++)if(e.charCodeAt(o)===124)return!0;return!1}function r5(e){const t=e?.md?.block?.ruler;return t?t.version===t.__mdtsDefaultVersion:!1}function l5(e,t,n,o,s){if(e.lineFlags&&(e.lineFlags[t]&Fd.ParagraphTerminator)===0||o>=s)return!1;const i=n.charCodeAt(o);switch(i){case 35:case 42:case 43:case 45:case 60:case 62:case 95:case 96:case 126:return!0}return i>=48&&i<=57?!0:lK(n,o,s)}const dS=["","h1","h2"];function aK(e,t,n){const o=e.md.block.ruler.getRulesForState(e,"paragraph"),s=e.src,i=e.bMarks,r=e.tShift,l=e.eMarks,a=e.sCount,c=e.blkIndent,u=r5(e);if(a[t]-c>=4)return!1;const d=e.parentType;e.parentType="paragraph";let f=0,h,p=t+1;for(;p<n;p++){const b=i[p]+r[p],A=l[p];if(b>=A)break;if(a[p]-c>3)continue;if(a[p]>=c&&(h=s.charCodeAt(b),h===45||h===61)){let T=b+1,M=T;for(;T<A&&s.charCodeAt(T)===h;)T++;for(M=T;T<A;){const $=s.charCodeAt(T);if($!==9&&$!==32)break;T++}if(T>=A){f=h===61?1:2;break}if(M-b>1)continue}if(a[p]<0||u&&!l5(e,p,s,b,A))continue;let I=!1;for(let T=0,M=o.length;T<M;T++)if(o[T](e,p,n,!0)){I=!0;break}if(I)break}if(!f)return!1;let m;if(p===t+1){const b=i[t]+r[t];let A=l[t];for(;A>b;){const I=s.charCodeAt(A-1);if(I!==9&&I!==32)break;A--}m=s.slice(b,A)}else m=e.getLines(t,p,c,!1).trim();e.line=p+1;const y=h===61?"=":"-",k=e.push("heading_open",dS[f],1);k.markup=y,k.map=[t,e.line];const g=e.push("inline","",0);g.content=m,g.map=[t,e.line-1],g.children=[];const v=e.push("heading_close",dS[f],-1);return v.markup=y,e.parentType=d,!0}function a5(e){switch(e){case 9:case 32:return!0}return!1}function fS(e,t){const n=e.eMarks,o=e.bMarks,s=e.tShift,i=e.src,r=n[t];let l=o[t]+s[t];const a=i.charCodeAt(l++);return a!==42&&a!==45&&a!==43||l<r&&!a5(i.charCodeAt(l))?-1:l}function hS(e,t){const n=e.bMarks,o=e.tShift,s=e.eMarks,i=e.src,r=n[t]+o[t],l=s[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),!a5(c))?-1:a}function cK(e,t,n){const o=e.bMarks,s=e.tShift,i=e.src,r=o[t]+s[t];let l=0;for(let a=r;a<n-1;a++)l=l*10+i.charCodeAt(a)-48;return l}const uK=["0","1","2","3","4","5","6","7","8","9"];function dK(e,t){const n=e.level+2,o=e.tokens;for(let s=t+2,i=o.length-2;s<i;s++){const r=o[s];if(r.level===n){if(r.type==="paragraph_open"){r.hidden=!0,o[s+2].hidden=!0,s+=2;continue}if(r.nesting===1){let l=1;for(;l>0&&++s<i;)l+=o[s].nesting}}}}function fK(e,t,n,o){let s,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;o&&e.parentType==="paragraph"&&e.sCount[l]>=e.blkIndent&&(c=!0);let u,d,f;const h=e.src,p=e.bMarks,m=e.tShift,y=e.eMarks,k=e.sCount,g=e.bsCount,v=p[l]+m[l];if(v>=y[l])return!1;const b=h.charCodeAt(v);if(b>=48&&b<=57){if(f=hS(e,l),f<0||(u=!0,r=v,d=cK(e,l,f),c&&d!==1))return!1}else if(b===42||b===45||b===43){if(f=fS(e,l),f<0)return!1;u=!1}else return!1;if(c&&e.skipSpaces(f)>=y[l])return!1;if(o)return!0;const A=h.charCodeAt(f-1),I=String.fromCharCode(A);if(u){const S=e.push("ordered_list_open","ol",1);d!==void 0&&d!==1&&(S.attrs=[["start",String(d)]])}else e.push("bullet_list_open","ul",1);const T=[l,0];e.tokens[e.tokens.length-1].map=T,e.tokens[e.tokens.length-1].markup=I;let M=!1;const $=e.tokens.length-1,N=e.md.block.ruler.getRulesForState(e,"list"),F=e.parentType;for(e.parentType="list";l<n;){i=f,s=y[l];const S=k[l]+f-(p[l]+m[l]);let B=S;for(;i<s;){const le=h.charCodeAt(i);if(le===9)B+=4-(B+g[l])%4;else if(le===32)B++;else break;i++}const W=i;let z;W>=s?z=1:z=B-S,z>4&&(z=1);const L=S+z,O=e.push("list_item_open","li",1);O.markup=I;const j=[l,0];O.map=j,u&&(O.info=f-r-1===1?uK[h.charCodeAt(r)-48]:h.slice(r,f-1));const Z=e.tight,ie=e.tShift[l],U=e.sCount[l],q=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=L,e.tight=!0,e.tShift[l]=W-p[l],e.sCount[l]=B,W>=s&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),(!e.tight||M)&&(a=!1),M=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=q,e.tShift[l]=ie,e.sCount[l]=U,e.tight=Z,e.push("list_item_close","li",-1).markup=I,l=e.line,j[1]=l,l>=n||e.sCount[l]<e.blkIndent||e.sCount[l]-e.blkIndent>=4)break;let ee=!1;for(let le=0,oe=N.length;le<oe;le++)if(N[le](e,l,n,!0)){ee=!0;break}if(ee)break;if(u){if(f=hS(e,l),f<0)break;r=p[l]+m[l]}else if(f=fS(e,l),f<0)break;if(A!==h.charCodeAt(f-1))break}return u?e.push("ordered_list_close","ol",-1).markup=I:e.push("bullet_list_close","ul",-1).markup=I,T[1]=l,e.line=l,e.parentType=F,a&&dK(e,$),!0}function pS(e){return e===9||e===32}function hK(e,t,n){const o=e.md.block.ruler.getRulesForState(e,"paragraph"),s=e.parentType,i=e.src,r=e.bMarks,l=e.tShift,a=e.eMarks,c=e.sCount,u=e.blkIndent,d=r5(e);let f=t+1;for(e.parentType="paragraph";f<n&&!e.isEmpty(f);f++){if(c[f]-u>3||c[f]<0)continue;if(s==="list"&&c[f]>=u){const v=r[f]+l[f],b=a[f];if(v<b){const A=i.charCodeAt(v);if(A===42||A===45||A===43){if(v+1>=b||pS(i.charCodeAt(v+1)))break}else if(A>=48&&A<=57&&v+1<b){let I=v+1;for(;;){if(I>=b){I=-1;break}const T=i.charCodeAt(I++);if(T>=48&&T<=57){if(I-v>=10){I=-1;break}continue}if((T===41||T===46)&&(I>=b||pS(i.charCodeAt(I))))break;I=-1;break}if(I>=0)break}}}const y=r[f]+l[f],k=a[f];if(d&&!l5(e,f,i,y,k))continue;let g=!1;for(let v=0,b=o.length;v<b;v++)if(o[v](e,f,n,!0)){g=!0;break}if(g)break}const h=e.getLines(t,f,u,!1).trim();e.line=f;const p=e.push("paragraph_open","p",1);p.map=[t,e.line];const m=e.push("inline","",0);return m.content=h,m.map=[t,e.line],m.children=[],e.push("paragraph_close","p",-1),e.parentType=s,!0}function Ph(e){switch(e){case 9:case 32:return!0}return!1}function pK(e,t,n,o){let s=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(s)!==91)return!1;function a(v){const b=e.lineMax;if(v>=b||e.isEmpty(v))return null;let A=!1;if(e.sCount[v]-e.blkIndent>3&&(A=!0),e.sCount[v]<0&&(A=!0),!A){const M=e.parentType;e.parentType="reference";let $=!1;for(let N=0,F=l.length;N<F;N++)if(l[N](e,v,b,!0)){$=!0;break}if(e.parentType=M,$)return null}const I=e.bMarks[v]+e.tShift[v],T=e.eMarks[v];return e.src.slice(I,T+1)}let c=e.src.slice(s,i+1);i=c.length;let u=-1;for(s=1;s<i;s++){const v=c.charCodeAt(s);if(v===91)return!1;if(v===93){u=s;break}else if(v===10){const b=a(r);b!==null&&(c+=b,i=c.length,r++)}else if(v===92&&(s++,s<i&&c.charCodeAt(s)===10)){const b=a(r);b!==null&&(c+=b,i=c.length,r++)}}if(u<0||c.charCodeAt(u+1)!==58)return!1;for(s=u+2;s<i;s++){const v=c.charCodeAt(s);if(v===10){const b=a(r);b!==null&&(c+=b,i=c.length,r++)}else if(!Ph(v))break}const d=e.md.helpers.parseLinkDestination(c,s,i);if(!d.ok)return!1;const f=e.md.normalizeLink(d.str);if(!e.md.validateLink(f))return!1;s=d.pos;const h=s,p=r,m=s;for(;s<i;s++){const v=c.charCodeAt(s);if(v===10){const b=a(r);b!==null&&(c+=b,i=c.length,r++)}else if(!Ph(v))break}let y=e.md.helpers.parseLinkTitle(c,s,i);for(;y.can_continue;){const v=a(r);if(v===null)break;c+=v,s=i,i=c.length,r++,y=e.md.helpers.parseLinkTitle(c,s,i,y)}let k;for(s<i&&m!==s&&y.ok?(k=y.str,s=y.pos):(k="",s=h,r=p);s<i&&Ph(c.charCodeAt(s));)s++;if(s<i&&c.charCodeAt(s)!==10&&k)for(k="",s=h,r=p;s<i&&Ph(c.charCodeAt(s));)s++;if(s<i&&c.charCodeAt(s)!==10)return!1;const g=N1(c.slice(1,u));return g?(o||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[g]>"u"&&(e.env.references[g]={title:k,href:f}),e.line=r),!0):!1}function Ag(e){switch(e){case 9:case 32:return!0}return!1}const mK=65536;function Mg(e,t){const n=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];return e.src.slice(n,o)}function gK(e,t){if(e.lineFlags)return(e.lineFlags[t]&Fd.Pipe)!==0;for(let n=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];n<o;n++)if(e.src.charCodeAt(n)===124)return!0;return!1}function mS(e){const t=[],n=e.length;let o=0,s=e.charCodeAt(o),i=!1,r=0,l="";for(;o<n;)s===124&&(i?(l+=e.substring(r,o-1),r=o):(t.push(l+e.substring(r,o)),l="",r=o+1)),i=s===92,o++,s=e.charCodeAt(o);return t.push(l+e.substring(r)),t}function vK(e,t,n,o){if(t+2>n)return!1;let s=t+1;if(e.sCount[s]<e.blkIndent||e.sCount[s]-e.blkIndent>=4)return!1;let i=e.bMarks[s]+e.tShift[s];if(i>=e.eMarks[s])return!1;const r=e.src.charCodeAt(i++);if(r!==124&&r!==45&&r!==58||i>=e.eMarks[s])return!1;const l=e.src.charCodeAt(i++);if(l!==124&&l!==45&&l!==58&&!Ag(l)||r===45&&Ag(l)||!gK(e,t))return!1;for(;i<e.eMarks[s];){const b=e.src.charCodeAt(i);if(b!==124&&b!==45&&b!==58&&!Ag(b))return!1;i++}let a=Mg(e,t+1),c=a.split("|");const u=[];for(let b=0;b<c.length;b++){const A=c[b].trim();if(!A){if(b===0||b===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(A))return!1;A.charCodeAt(A.length-1)===58?u.push(A.charCodeAt(0)===58?"center":"right"):A.charCodeAt(0)===58?u.push("left"):u.push("")}if(a=Mg(e,t).trim(),e.sCount[t]-e.blkIndent>=4)return!1;c=mS(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(o)return!0;const f=e.parentType;e.parentType="table";const h=e.md.block.ruler.getRulesForState(e,"blockquote"),p=e.push("table_open","table",1),m=[t,0];p.map=m;const y=e.push("thead_open","thead",1);y.map=[t,t+1];const k=e.push("tr_open","tr",1);k.map=[t,t+1];for(let b=0;b<c.length;b++){const A=e.push("th_open","th",1);u[b]&&(A.attrs=[["style",`text-align:${u[b]}`]]);const I=e.push("inline","",0);I.content=c[b].trim(),I.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let g,v=0;for(s=t+2;s<n&&!(e.sCount[s]<e.blkIndent);s++){let b=!1;for(let I=0,T=h.length;I<T;I++)if(h[I](e,s,n,!0)){b=!0;break}if(b||(a=Mg(e,s).trim(),!a)||e.sCount[s]-e.blkIndent>=4||(c=mS(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop(),v+=d-c.length,v>mK))break;if(s===t+2){const I=e.push("tbody_open","tbody",1);I.map=g=[t+2,0]}const A=e.push("tr_open","tr",1);A.map=[s,s+1];for(let I=0;I<d;I++){const T=e.push("td_open","td",1);u[I]&&(T.attrs=[["style",`text-align:${u[I]}`]]);const M=e.push("inline","",0);M.content=c[I]?c[I].trim():"",M.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return g&&(e.push("tbody_close","tbody",-1),g[1]=s),e.push("table_close","table",-1),m[1]=s,e.parentType=f,e.line=s,!0}var yK=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,o){const s=this._rules.findIndex(r=>r.name===e);if(s<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(s,0,{name:t,enabled:!0,fn:n,alt:o?.alt||[]}),this.invalidateCache()}after(e,t,n,o){const s=this._rules.findIndex(r=>r.name===e);if(s<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(s+1,0,{name:t,enabled:!0,fn:n,alt:o?.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:o,fn:s})=>(i,r,l,a)=>{const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now(),u=s(i,r,l,a),d=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();return ru(i?.env,"block",o,d-c,u,!!a),u}):this.getRules(t)}at(e,t,n){const o=this._rules.findIndex(s=>s.name===e);if(o===-1)throw new Error(`Parser rule not found: ${e}`);this._rules[o].fn=t,n?.alt&&(this._rules[o].alt=n.alt),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!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}`)}o.push(i),this._rules[r].enabled||(this._rules[r].enabled=!0,s=!0)}),s&&this.invalidateCache(),o}disable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!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}`)}o.push(i),this._rules[r].enabled&&(this._rules[r].enabled=!1,s=!0)}),s&&this.invalidateCache(),o}enableOnly(e){const t=new Set(e);let n=!1;for(const o of this._rules){const s=t.has(o.name);o.enabled!==s&&(o.enabled=s,n=!0)}n&&this.invalidateCache()}compileCache(){const e=new Set([""]);for(const o of this._rules)if(o.enabled)for(const s of o.alt)e.add(s);const t=Object.create(null),n=Object.create(null);for(const o of e){const s=[],i=[];for(const r of this._rules)r.enabled&&(o!==""&&!r.alt.includes(o)||(s.push(r.fn),i.push({name:r.name,fn:r.fn})));t[o]=s,n[o]=i}this.cache=t,this.namedCache=n}};const Hh=[["table",vK,["paragraph","reference"]],["code",eK],["fence",tK,["paragraph","reference","blockquote","list"]],["blockquote",JV,["paragraph","reference","blockquote","list"]],["hr",sK,["paragraph","reference","blockquote","list"]],["list",fK,["paragraph","reference","blockquote"]],["reference",pK],["html_block",iK,["paragraph","reference","blockquote"]],["heading",nK,["paragraph","reference","blockquote"]],["lheading",aK],["paragraph",hK]];var kK=class{ruler;cachedRulesVersion=-1;cachedRules=[];constructor(){this.ruler=new yK;for(let e=0;e<Hh.length;e++)this.ruler.push(Hh[e][0],Hh[e][1],{alt:(Hh[e][2]||[]).slice()});this.ruler.__mdtsDefaultVersion=this.ruler.version}tokenize(e,t,n){const o=this.getRules(),s=o.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 h=e.line;let p=!1;for(let m=0;m<s;m++)if(p=o[m](e,u,n,!1),p){if(h>=e.line)throw new Error("block rule didn't increment state.line");break}if(!p)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 f=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 h=e.line;let p=!1;for(let m=0;m<s;m++){const y=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();p=f[m].fn(e,u,n,!1);const k=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(ru(e.env,"block",f[m].name,k-y,p,!1),p){if(h>=e.line)throw new Error("block rule didn't increment state.line");break}}if(!p)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,o){if(!e||e.length===0)return;const s=new i5(e,t,n,o);this.tokenize(s,s.line,s.lineMax)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}},c5=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}};c5.prototype.Token=vo;const gS=[["normalize",BV],["block",Fj],["inline",EV],["linkify",FV],["replacements",qV],["smartquotes",GV],["text_join",YV]],bK={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:100},xK={parseLinkLabel:a2,parseLinkDestination:l2,parseLinkTitle:c2};function wK(){return{...bK}}function _K(){return{...xK}}var SK=class{fallbackParser;lastState=null;block;inline;ruler;linkifyInstance=null;cachedCoreRulesVersion=-1;cachedCoreRules=[];cachedCoreNamedRulesVersion=-1;cachedCoreNamedRules=[];constructor(){this.block=new kK,this.inline=new MV,this.ruler=new jV;for(let e=0;e<gS.length;e++){const[t,n]=gS[e];this.ruler.push(t,n)}this.fallbackParser={block:this.block,inline:this.inline,core:this,options:wK(),helpers:_K(),normalizeLink:o5,normalizeLinkText:s5,validateLink:n5,linkify:null}}resolveParser(e){return e||(this.linkifyInstance||(this.linkifyInstance=new R6),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 c5(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 o=0;o<n.length;o++)n[o](e);return}const t=this.getCoreNamedRules();for(let n=0;n<t.length;n++){const o=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();t[n].fn(e);const s=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();ru(e.env,"core",t[n].name,s-o,!0,!1)}CV(e.env)}parseSource(e,t={},n){if(typeof e!="string"&&$j(e))return this.parse(H6(e),t,n);const o=this.createState(e,t,n);return this.process(o),this.lastState=o,o}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 CK=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function mm(e){return!CK.test(e)}function yd(e,t){const n=e.indexOf(`
|
|
98
|
-
`,t);return n===-1?e.length:n}function bp(e,t,n){for(let o=t;o<n;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9)return!1}return!0}function vS(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function Eg(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function AK(e){if(e.length>3)return mm(e);for(let t=0;t<e.length;t++)switch(e.charCodeAt(t)){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!1}return!0}const MK=["","h1","h2","h3","h4","h5","h6"],EK=["","#","##","###","####","#####","######"],yS=0,Tg=1,Ng=2;function Js(e,t,n,o){const s=new vo(e,t,n);return s.level=o,s.block=!0,s}function u5(e,t,n){const o=Js("inline","",0,n);o.map=[t,t+1],o.content=e;const s=new vo("text","",0);return s.content=e,o.children=[s],o}function TK(e,t,n,o,s){let i=0,r=n;for(;r<o&&t.charCodeAt(r)===35&&i<6;)r++,i++;if(i===0||r>=o||t.charCodeAt(r)!==32)return!1;let l=r+1;for(;l<o&&t.charCodeAt(l)===32;)l++;let a=o;for(;a>l&&t.charCodeAt(a-1)===32;)a--;let c=a;for(;c>l&&t.charCodeAt(c-1)===35;)c--;if(c>l&&t.charCodeAt(c-1)===32)for(a=c-1;a>l&&t.charCodeAt(a-1)===32;)a--;const u=t.slice(l,a);if(!mm(u))return!1;const d=MK[i],f=EK[i],h=Js("heading_open",d,1,0);h.map=[s,s+1],h.markup=f,e.push(h),e.push(u5(u,s,1));const p=Js("heading_close",d,-1,0);return p.markup=f,e.push(p),!0}function NK(e,t,n){const o=Js("paragraph_open","p",1,0);o.map=[n,n+1],e.push(o),e.push(u5(t,n,1)),e.push(Js("paragraph_close","p",-1,0))}function IK(e,t,n){const o=e.charCodeAt(n-1);return o===32||o===9?e.slice(t,n).trim():e.slice(t,n)}function Ig(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function LK(e,t){const n=Js("bullet_list_open","ul",1,0);return n.map=[t,t],n.markup="-",e.push(n),n}function $K(e,t,n){const o=Js("list_item_open","li",1,1);o.map=[n,n+1],o.markup="-",e.push(o);const s=Js("paragraph_open","p",1,2);s.map=[n,n+1],s.hidden=!0,e.push(s);const i=Js("inline","",0,3);i.map=[n,n+1],i.content=t;const r=new vo("text","",0);r.content=t,i.children=[r],e.push(i);const l=Js("paragraph_close","p",-1,2);l.hidden=!0,e.push(l);const a=Js("list_item_close","li",-1,1);return a.markup="-",e.push(a),o}function FK(e){const t=Js("bullet_list_close","ul",-1,0);t.markup="-",e.push(t)}function OK(e,t,n,o){if(!vS(e,t,n))return null;const s=e.slice(t+3,n);if(s.includes("`"))return null;const i=n<e.length?n+1:n;let r=i,l=i,a=o+1;for(;l<e.length;){const c=yd(e,l);if(vS(e,l,c)&&bp(e,l+3,c)){const u=Js("fence","code",0,0);return u.map=[o,a+1],u.markup="```",u.info=s,u.content=e.slice(i,r),{token:u,nextPos:c<e.length?c+1:c,nextLine:a+1}}l=c<e.length?c+1:c,r=l,a++}return null}function RK(e){if(e.length===0)return[];if(e.includes("\r")||e.includes("\0"))return null;const t=[];let n=e.length>=1e5?yS:Ng,o="",s=!1,i=!1,r=0,l=0;for(;r<e.length;){const a=yd(e,r);if(r===a){r=a<e.length?a+1:a,l++;continue}const c=e.charCodeAt(r);if(c===32||c===9){if(!bp(e,r,a))return null;r=a<e.length?a+1:a,l++;continue}if(c===35){if(!TK(t,e,r,a,l))return null;const h=a<e.length?a+1:a;r=Ig(e,h),l+=1+r-h;continue}if(c===45){if(!Eg(e,r,a))return null;const h=l;let p=r,m=l,y=null,k=null;for(;p<e.length;){const b=yd(e,p);if(!Eg(e,p,b))break;const A=p+2,I=b===A+1?e[A]:e.slice(A,b);if(!AK(I))return null;y===null&&(y=LK(t,h)),k=$K(t,I,m),p=b<e.length?b+1:b,m++}if(y===null||k===null)return null;let g=p,v=m;for(;g<e.length;){if(e.charCodeAt(g)===10){g++,v++;continue}const b=yd(e,g);if(!bp(e,g,b)){if(Eg(e,g,b))return null;break}g=b<e.length?b+1:b,v++}y.map[1]=v,k.map[1]=v,FK(t),r=g,l=v;continue}if(c===96){const h=OK(e,r,a,l);if(!h)return null;t.push(h.token),r=Ig(e,h.nextPos),l=h.nextLine+r-h.nextPos;continue}const u=IK(e,r,a);let d;if(n===Ng?d=mm(u):n===Tg&&u===o?d=s:(d=mm(u),n===yS?(i&&(n=u===o?Tg:Ng),o=u,s=d,i=!0):n===Tg&&(o=u,s=d)),!d)return null;const f=a<e.length?a+1:a;if(f<e.length&&e.charCodeAt(f)!==10&&!bp(e,f,yd(e,f)))return null;NK(t,u,l),r=Ig(e,f),l+=1+r-f}return t}const BK=/[&<>"]/,kS=/[&<>"]/g,DK=/&/g,PK=/[<>"]/g,HK={"&":"&","<":"<",">":">",'"':"""};function Lg(e){return HK[e]||e}function Hn(e){if(e.length===0)return"";if(e.length<32)return BK.test(e)?e.replace(kS,Lg):e;const t=e.includes("&"),n=e.includes("<"),o=e.includes(">"),s=e.includes('"');return!t&&!n&&!o&&!s?e:t&&!n&&!o&&!s?e.replace(DK,"&"):t?e.replace(kS,Lg):e.replace(PK,Lg)}const WK=new RegExp(`${/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),zK=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function d5(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(WK,(t,n,o)=>{if(n)return n;if(zK.test(o)){const i=o[1].toLowerCase()==="x"?Number.parseInt(o.slice(2),16):Number.parseInt(o.slice(1),10);return I1(i)?pf(i):"�"}const s=Qk(t);return s!==t?s:t})}const UK=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/,qK=/[\n!"#$%&*+\-:<=>@[\]\\^_`{}~]/,jK=/"/g;function qc(e,t){const n=e.indexOf(`
|
|
99
|
-
`,t);return n===-1?e.length:n}function gm(e,t,n){for(let o=t;o<n;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9)return!1}return!0}function Wh(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function VK(e,t){return t>=e.length||e.charCodeAt(t)===10?!1:!gm(e,t,qc(e,t))}function bS(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function KK(e,t,n){const o=e.charCodeAt(n-1);return o===32||o===9?e.slice(t,n).trim():e.slice(t,n)}function h2(e){return qK.test(e)?UK.test(e)?null:e.replace(jK,"""):e}function GK(e,t,n){let o=0,s=t;for(;s<n&&e.charCodeAt(s)===35&&o<6;)s++,o++;if(o===0||s>=n||e.charCodeAt(s)!==32)return null;let i=s+1;for(;i<n&&e.charCodeAt(i)===32;)i++;let r=n;for(;r>i&&e.charCodeAt(r-1)===32;)r--;let l=r;for(;l>i&&e.charCodeAt(l-1)===35;)l--;if(l>i&&e.charCodeAt(l-1)===32)for(r=l-1;r>i&&e.charCodeAt(r-1)===32;)r--;const a=h2(e.slice(i,r));return a===null?null:`<h${o}>${a}</h${o}>
|
|
100
|
-
`}function xS(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function YK(e,t){switch(e.charCodeAt(t)){case 34:return`<li>"</li>
|
|
101
|
-
`;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 null}return`<li>${e[t]}</li>
|
|
102
|
-
`}function ZK(e,t,n){const o=t+2;if(n===o+1)return YK(e,o);const s=h2(e.slice(t+2,n));return s===null?null:`<li>${s}</li>
|
|
103
|
-
`}function XK(e,t,n){for(;t<n;){const s=e.charCodeAt(t);if(s!==32&&s!==9)break;t++}for(;n>t;){const s=e.charCodeAt(n-1);if(s!==32&&s!==9)break;n--}let o=n;for(let s=t;s<n;s++){const i=e.charCodeAt(s);if(i===96)return null;if(i===32||i===9){o=s;break}}return e.slice(t,o)}function QK(e,t,n,o){if(!bS(e,t,n))return null;const s=XK(e,t+3,n);if(s===null)return null;const i=n<e.length?n+1:n;let r=i,l=i;for(;l<e.length;){const a=qc(e,l);if(bS(e,l,a)&&gm(e,l+3,a)){const c=e.slice(i,r);let u;return s===o.lang?u=o.open:(u=s?`<pre><code class="language-${Hn(s)}">`:"<pre><code>",o.lang=s,o.open=u),{html:`${u}${Hn(c)}</code></pre>
|
|
104
|
-
`,nextPos:a<e.length?a+1:a}}l=a<e.length?a+1:a,r=l}return null}function wS(e){if(e.length===0)return"";if(e.includes("\r")||e.includes("\0"))return null;let t=0,n="";const o=e.length>=25e4,s=[],i={lang:"",open:"<pre><code>"};let r="",l="",a="",c="";for(;t<e.length;){const u=qc(e,t);if(t===u){t=u<e.length?u+1:u;continue}const d=e.charCodeAt(t);if(d===32||d===9){if(!gm(e,t,u))return null;t=u<e.length?u+1:u;continue}if(d===35){const m=GK(e,t,u);if(m===null)return null;o?s.push(m):n+=m,t=Wh(e,u<e.length?u+1:u);continue}if(d===45){let m=t;for(;m<e.length;){const v=qc(e,m);if(!xS(e,m,v))break;m=v<e.length?v+1:v}if(m===t)return null;const y=e.slice(t,m);let k;if(y===r)k=l;else{let v=t;for(k=`<ul>
|
|
105
|
-
`;v<m;){const b=qc(e,v),A=ZK(e,v,b);if(A===null)return null;k+=A,v=b<e.length?b+1:b}k+=`</ul>
|
|
106
|
-
`,r=y,l=k}let g=Wh(e,m);for(;g<e.length;){if(e.charCodeAt(g)===10){g++;continue}const v=qc(e,g);if(!gm(e,g,v)){if(xS(e,g,v))return null;break}g=v<e.length?v+1:v}o?s.push(k):n+=k,t=g;continue}if(d===96){const m=QK(e,t,u,i);if(!m)return null;o?s.push(m.html):n+=m.html,t=Wh(e,m.nextPos);continue}const f=KK(e,t,u);let h;if(f===a)h=c;else{const m=h2(f);if(m===null)return null;h=`<p>${m}</p>
|
|
107
|
-
`,a=f,c=h}const p=u<e.length?u+1:u;if(p<e.length&&e.charCodeAt(p)!==10&&VK(e,p))return null;o?s.push(h):n+=h,t=Wh(e,p)}return o?s.join(""):n}const JK={maxChunkChars:1e4,maxChunkLines:200,fenceAware:!0,maxChunks:void 0,fallbackOnGlobalState:!0};function vm(e,t,n={},o){cs(n);const s={...JK,...o||{}},i=Ts(t);if(s.fallbackOnGlobalState!==!1&&i)return Sg(n,{count:1,fallback:!0,fallbackReason:i,globalStateDetected:i,maxChunkChars:s.maxChunkChars,maxChunkLines:s.maxChunkLines}),iu(n,i,()=>e.core.parse(t,n,e).tokens);let r=xp(t,s);if(s.maxChunks&&r.length>s.maxChunks&&(r=oG(r,s.maxChunks)),wp(t,r))return Sg(n,{count:1,fallback:!0,fallbackReason:"unsafe-chunk-boundary",maxChunkChars:s.maxChunkChars,maxChunkLines:s.maxChunkLines}),iu(n,i,()=>e.core.parse(t,n,e).tokens);let l=0;const a=[];return Sg(n,{count:r.length,maxChunkChars:s.maxChunkChars,maxChunkLines:s.maxChunkLines,globalStateDetected:i||void 0,globalStateFallbackDisabled:s.fallbackOnGlobalState===!1&&!!i}),iu(n,i,()=>{for(let c=0;c<r.length;c++){const u=r[c],d=t.slice(u.start,u.end),f=e.core.parse(d,n,e).tokens;l!==0&&f.length&&tG(f,l),nG(a,f),l+=u.lineCount}return a})}function xp(e,t,n=!0){const o=[];let s=0,i=0,r=0,l=0,a=0,c=0,u=null;function d(f){f<=r||(o.push({start:r,end:f,lineCount:l}),r=f,s=0,i=0,l=0)}for(let f=0;f<e.length;){let h=e.indexOf(`
|
|
108
|
-
`,f),p=h;h===-1?(h=e.length,p=e.length):p=h+1;const m=sG(e,f,h);if(t.fenceAware){let g=f;for(;g<h;){const b=e.charCodeAt(g);if(b===32||b===9)g++;else break}const v=e[g];if(v==="`"||v==="~"){let b=g;for(;b<h&&e[b]===v;)b++;const A=b-g;A>=3&&(u?u.marker===v&&A>=u.length&&(u=null):u={marker:v,length:A})}}const y=p-f;s+=y,i+=1,l+=1,m?(a=0,c=0):(a+=1,c+=y);const k=m;if((s>=t.maxChunkChars||i>=t.maxChunkLines)&&!u)if(k)d(p);else{const g=Math.max(10,Math.floor(t.maxChunkLines*.5)),v=Math.max(t.maxChunkChars,8e3);(a>=g||c>=v)&&d(p)}f=p}return n&&d(e.length),o}function wp(e,t,n={rangesCoverWholeSource:!0}){const o=n.rangesCoverWholeSource?t.length-1:t.length;for(let s=0;s<o;s++)if(!eG(e,t[s].end))return!0;return!1}function eG(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 o=n+1;o<t-1;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9&&s!==13)return!1}return!0}function tG(e,t){if(t===0)return;const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);for(;n.length;){const o=n.pop();if(o.map&&(o.map[0]+=t,o.map[1]+=t),o.children)for(let s=o.children.length-1;s>=0;s--)n.push(o.children[s])}}function nG(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function oG(e,t){if(e.length<=t)return e;const n=[];let o=0;for(let s=0;s<t;s++){const i=t-s,r=e.length-o,l=Math.ceil(r/i),a=e.slice(o,o+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}),o+=l}return n}function sG(e,t,n){for(let o=t;o<n;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9&&s!==13)return!1}return!0}const f5=4e6,h5=8e4,iG=1e4,rG=200,lG=1e4,aG=200;function p5(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function cG(e,t){if(t===0)return;const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);for(;n.length;){const o=n.pop();if(o.map&&(o.map[0]+=t,o.map[1]+=t),o.children)for(let s=o.children.length-1;s>=0;s--)n.push(o.children[s])}}function ul(e){return e.length===0?0:no(e)+(e.charCodeAt(e.length-1)===10?0:1)}function uG(e,t,n){for(let o=t;o<n;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9&&s!==13)return!1}return!0}function dG(e,t){if(!t||e.length===0)return!1;let n=null;for(let o=0;o<e.length;){let s=e.indexOf(`
|
|
109
|
-
`,o);s===-1&&(s=e.length);let i=o;for(;i<s;){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<s&&e[l]===r;)l++;const a=l-i;a>=3&&(n?n.marker===r&&a>=n.length&&(n=null):n={marker:r,length:a})}o=s===e.length?e.length:s+1}return n!==null}function fG(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 uG(e,n+1,e.length-1)?!dG(e,t):!1}function hG(e,t,n,o={}){const s=o.mode??"full",i=o.fenceAware??(s==="stream"?e.options.streamChunkFenceAware??!0:e.options.fullChunkFenceAware??!0);if(o.maxChunkChars!==void 0||o.maxChunkLines!==void 0||o.autoTune===!1){const r=o.maxChunkChars??(s==="stream"?e.options.streamChunkSizeChars??lG:e.options.fullChunkSizeChars??iG),l=o.maxChunkLines??(s==="stream"?e.options.streamChunkSizeLines??aG:e.options.fullChunkSizeLines??rG);return{maxChunkChars:r,maxChunkLines:l,holdBelowChars:r,holdBelowLines:l,fenceAware:i}}return s==="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 Of=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=ul(this.pending);if(this.pending.length<t.holdBelowChars&&n<t.holdBelowLines)return this.updateEnvDiagnostics(e,t,n),null;const o=xp(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!1);if(!o.length)return this.updateEnvDiagnostics(e,t,n),null;if(wp(this.pending,o,{rangesCoverWholeSource:!1}))return this.updateEnvDiagnostics(e,t,n),null;const s=this.commitRanges(o,e);return this.pending=this.pending.slice(s),this.updateEnvDiagnostics(e,t,ul(this.pending)),this.tokens}flushIfBoundary(e={}){if(!this.pending)return null;const t=this.resolveWindow();if(!fG(this.pending,t.fenceAware))return this.updateEnvDiagnostics(e,t,ul(this.pending)),null;const n=xp(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(!n.length)return this.updateEnvDiagnostics(e,t,ul(this.pending)),null;const o=wp(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:ul(this.pending)}]:n;return this.commitRanges(o,e),this.pending="",this.updateEnvDiagnostics(e,t,0),this.tokens}flushForce(e={}){if(!this.pending){this.prepareGlobalStateEnv(e,"");const o=this.resolveWindow();return this.updateEnvDiagnostics(e,o,0),this.tokens}const t=this.resolveWindow(),n=xp(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(n.length){const o=wp(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:ul(this.pending)}]:n;this.commitRanges(o,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:ul(this.pending),retainedTokens:this.options.retainTokens!==!1}}resolveWindow(){const e=this.committedChars+this.pending.length,t=this.committedLines+ul(this.pending);return hG(this.md,e,t,this.options)}prepareGlobalStateEnv(e,t){if(this.globalStateEnv!==e&&(Ff(e)&&Zr(e),this.globalStateEnv=e,this.markedGlobalStateReason=null),this.markedGlobalStateReason)return;const n=Ts(t);n&&(i2(e,n),this.markedGlobalStateReason=n)}commitRanges(e,t){if(!e.length)return 0;this.prepareGlobalStateEnv(t,this.pending);let n=0;try{for(let o=0;o<e.length;o++){const s=e[o],i=this.pending.slice(s.start,s.end),r=this.md.core.parse(i,t,this.md).tokens,l=this.committedChars,a=this.committedLines;a!==0&&r.length&&cG(r,a),this.options.retainTokens!==!1&&p5(this.tokens,r),this.committedChars+=i.length,this.committedLines+=s.lineCount,this.parsedChunks+=1,this.options.onChunkTokens&&this.options.onChunkTokens(r,{chunkIndex:this.parsedChunks,chunkChars:i.length,chunkLines:s.lineCount,tokenCount:r.length,startOffset:l,endOffset:this.committedChars,startLine:a,endLine:this.committedLines}),n=s.end}return this.markedGlobalStateReason&&r2(t),n}catch(o){throw this.markedGlobalStateReason&&(Zr(t),this.globalStateEnv=null,this.markedGlobalStateReason=null),o}}updateEnvDiagnostics(e,t,n){$6(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 pG(e,t,n={},o={}){cs(n);const s=new Of(e,{mode:"full",...o});for(const i of t)s.feed(i),s.flushAvailable(n);return s.flushForce(n)}async function mG(e,t,n={},o={}){cs(n);const s=new Of(e,{mode:"full",...o});for await(const i of t)s.feed(i),s.flushAvailable(n);return s.flushForce(n)}function gG(e,t,n,o={},s={}){cs(o);const i=new Of(e,{mode:"full",...s,retainTokens:!1,onChunkTokens:n});for(const r of t)i.feed(r),i.flushAvailable(o);return i.flushForce(o),i.stats()}async function vG(e,t,n,o={},s={}){cs(o);const i=new Of(e,{mode:"full",...s,retainTokens:!1,onChunkTokens:n});for await(const r of t)i.feed(r),i.flushAvailable(o);return i.flushForce(o),i.stats()}function m5(e,t,n){if(e.options.autoUnbounded===!1)return!1;const o=e.options.autoUnboundedThresholdChars??f5,s=e.options.autoUnboundedThresholdLines??h5;return t>=o||n>=s}function g5(e,t,n){if(e.options.autoUnbounded===!1)return"no";if(t>=(e.options.autoUnboundedThresholdChars??f5))return"yes";const o=e.options.autoUnboundedThresholdLines??h5;return n!==void 0?n>=o?"yes":"no":t+1<o?"no":"need-lines"}function Od(e,t,n={},o={}){cs(n);const s=Ts(t);if(Ff(n)&&Zr(n),o.fallbackOnGlobalState!==!1&&s)return $6(n,{mode:"full",fallback:!0,fallbackReason:s,committedChars:t.length,committedLines:no(t),pendingChars:0,pendingLines:0,fedChunks:1,parsedChunks:1,globalStateDetected:s}),iu(n,s,()=>e.core.parse(t,n,e).tokens);const i=[],r=new Of(e,{mode:"full",...o,retainTokens:!1,onChunkTokens(l){p5(i,l)}});if(s&&i2(n,s),r.feed(t),r.flushForce(n),s&&(r2(n),o.fallbackOnGlobalState===!1)){const l=Lr(n)?.unbounded;l&&(l.globalStateDetected=s,l.globalStateFallbackDisabled=!0)}return i}const lu=(e,t,n)=>e<t?t:e>n?n:e;function v5(e){return e.experimental?{...e,...e.experimental}:e}const _S=[{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"}],SS=[{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 y5(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function yG(e,t=Math.max(0,e/40|0),n={}){const o=v5(n),s=o.fullChunkFenceAware??!0,i=o.fullChunkTargetChunks??8,r=o.fullChunkAdaptive!==!1;for(let l=0;l<_S.length;l++){const a=_S[l];if(e<=a.max){if(a.strategy!=="adaptive")return y5(s,a);break}}return e>5e6?{strategy:"plain",fenceAware:s,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:lu(Math.ceil(e/i),8e3,64e3),maxChunkLines:lu(Math.ceil(t/i),150,700),maxChunks:lu(Math.ceil(e/64e3),i,16),fenceAware:s,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:o.fullChunkSizeChars??1e4,maxChunkLines:o.fullChunkSizeLines??200,fenceAware:s,maxChunks:o.fullChunkMaxChunks}}function CS(e,t=Math.max(0,e/40|0),n={}){const o=v5(n),s=o.streamChunkFenceAware??!0,i=o.streamChunkTargetChunks??8,r=o.streamChunkAdaptive!==!1;for(let l=0;l<SS.length;l++){const a=SS[l];if(e<=a.max){if(a.strategy!=="adaptive")return y5(s,a);break}}return e>5e6?{strategy:"plain",fenceAware:s,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:lu(Math.ceil(e/i),8e3,64e3),maxChunkLines:lu(Math.ceil(t/i),150,700),maxChunks:lu(Math.ceil(e/64e3),i,32),fenceAware:s,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:o.streamChunkSizeChars??1e4,maxChunkLines:o.streamChunkSizeLines??200,maxChunks:o.streamChunkMaxChunks,fenceAware:s}}var kG={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"]}}},bG={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},xG={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"]}}};function O1(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function _p(e,t){if(O1(e))throw new TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}const AS=e=>O1(e)?e:Promise.resolve(e);function Rd(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 Pl(e){if(!e||e.length===0)return"";const t=e[0];let n=` ${Rd(t[0])}="${Hn(t[1])}"`;for(let o=1;o<e.length;o++){const s=e[o];n+=` ${Rd(s[0])}="${Hn(s[1])}"`}return n}function k5(e){if(!e)return{langName:"",langAttrs:""};let t=0;for(;t<e.length;){const o=e.charCodeAt(t);if(o===32||o===9||o===10)break;t++}if(t>=e.length)return{langName:e,langAttrs:""};let n=t;for(;n<e.length;){const o=e.charCodeAt(n);if(o!==32&&o!==9&&o!==10)break;n++}return{langName:e.slice(0,t),langAttrs:n<e.length?e.slice(n):""}}function Bd(e,t,n,o,s){if(t.indexOf("<pre")===0)return`${t}
|
|
110
|
-
`;if(n){if(!e.attrs||e.attrs.length===0)return`<pre><code class="${Hn(`${s.langPrefix??"language-"}${o}`)}">${t}</code></pre>
|
|
111
|
-
`;const i=e.attrIndex("class"),r=e.attrs?e.attrs.slice():[],l=`${s.langPrefix??"language-"}${o}`;return i<0?r.push(["class",l]):(r[i]=r[i].slice(),r[i][1]+=` ${l}`),`<pre><code${Pl(r)}>${t}</code></pre>
|
|
112
|
-
`}return`<pre><code${Pl(e.attrs)}>${t}</code></pre>
|
|
113
|
-
`}function ym(e){return!e.attrs||e.attrs.length===0?`<code>${Hn(e.content)}</code>`:`<code${Pl(e.attrs)}>${Hn(e.content)}</code>`}function Sy(e){const t=Hn(e.content);return e.attrs?`<pre${Pl(e.attrs)}><code>${t}</code></pre>
|
|
114
|
-
`:`<pre><code>${t}</code></pre>
|
|
115
|
-
`}function wG(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 MS(e){const t=e.attrs;return!t||t.length===0?"<a>":t.length===1?`<a ${Rd(t[0][0])}="${Hn(t[0][1])}">`:t.length===2?`<a ${Rd(t[0][0])}="${Hn(t[0][1])}" ${Rd(t[1][0])}="${Hn(t[1][1])}">`:`<a${Pl(t)}>`}function _G(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 ES(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 km(e,t){if(e.hidden)return"";const n=e.attrs,o=e.nesting,s=e.tag;if(!n||n.length===0)return o===0?t?`<${s} />`:`<${s}>`:o===-1?`</${s}>`:`<${s}>`;let i=(o===-1?"</":"<")+s+Pl(n);return o===0&&t&&(i+=" /"),`${i}>`}const SG={langPrefix:"language-",xhtmlOut:!1,breaks:!1},zh=Object.prototype.hasOwnProperty,Dn={code_inline(e,t){return ym(e[t])},code_block(e,t){return Sy(e[t])},fence(e,t,n,o,s){const i=e[t],r=i.info?d5(i.info).trim():"",{langName:l,langAttrs:a}=k5(r),c=n.highlight,u=Hn(i.content);if(!c)return Bd(i,u,r,l,n);const d=c(i.content,l,a);return O1(d)?d.then(f=>Bd(i,f||u,r,l,n)):Bd(i,d||u,r,l,n)},image(e,t,n,o,s){const i=e[t],r=s.renderInlineAsText(i.children||[],n,o),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]],km(i,n.xhtmlOut===!0)},hardbreak(e,t,n){return n.xhtmlOut?`<br />
|
|
116
|
-
`:`<br>
|
|
117
|
-
`},softbreak(e,t,n){return n.breaks?n.xhtmlOut?`<br />
|
|
118
|
-
`:`<br>
|
|
119
|
-
`:`
|
|
120
|
-
`},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 TS(e,t,n){const o=e.info?d5(e.info).trim():"",{langName:s,langAttrs:i}=k5(o),r=t.highlight,l=Hn(e.content);if(!r)return Bd(e,l,o,s,t);const a=r(e.content,s,i);if(O1(a))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return Bd(e,a||l,o,s,t)}function Uh(e,t,n,o,s,i,r){const l=e[0];switch(l.type){case"text":if(s.text===Dn.text)return l.content.length===0?"":Hn(l.content);break;case"text_special":if(s.text_special===Dn.text_special)return l.content.length===0?"":Hn(l.content);break;case"softbreak":if(s.softbreak===Dn.softbreak)return r;break;case"hardbreak":if(s.hardbreak===Dn.hardbreak)return i;break;case"html_inline":if(s.html_inline===Dn.html_inline)return l.content;break;case"code_inline":if(s.code_inline===Dn.code_inline)return ym(l);break}const a=s[l.type];if(!a)return km(l,t.xhtmlOut===!0);const c=a(e,0,t,n,o);return typeof c=="string"?c:_p(c,l.type)}var CG=class{rules;baseOptions;normalizedBase;constructor(e={}){this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={...Dn}}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 o=this.mergeOptions(t),s=n??{},i=this.rules,r=o.xhtmlOut===!0;let l,a,c,u,d,f,h="",p="",m=!1,y="";for(let k=0;k<e.length;k++){const g=e[k],v=g.type,b=k>0&&e[k-1].hidden?`
|
|
121
|
-
`:"";if(v==="list_item_open"&&(!g.attrs||g.attrs.length===0)&&k+3<e.length){const T=e[k+1],M=e[k+2],$=e[k+3];if(T.type==="paragraph_open"&&T.hidden&&M.type==="inline"&&$.type==="paragraph_close"&&$.hidden){y+=`${b}<li>${this.renderInlineTokens(M.children||[],o,s)}`,k+=3;continue}}if(k+2<e.length){const T=e[k+1],M=e[k+2];if(T.type==="inline"&&M.nesting===-1&&M.tag===g.tag&&!M.hidden){const $=wG(g,b);if($!==null){y+=`${$+this.renderInlineTokens(T.children||[],o,s)}</${g.tag}>
|
|
122
|
-
`,k+=2;continue}}}if(v==="inline"){const T=g.children||[];if(T.length===1){m||(l=i.text,a=i.text_special,c=i.softbreak,u=i.hardbreak,d=i.html_inline,f=i.code_inline,h=o.xhtmlOut?`<br />
|
|
123
|
-
`:`<br>
|
|
124
|
-
`,p=o.breaks?h:`
|
|
125
|
-
`,m=!0);const M=T[0];switch(M.type){case"text":if(l===Dn.text){y+=Hn(M.content);continue}break;case"text_special":if(a===Dn.text_special){y+=Hn(M.content);continue}break;case"softbreak":if(c===Dn.softbreak){y+=p;continue}break;case"hardbreak":if(u===Dn.hardbreak){y+=h;continue}break;case"html_inline":if(d===Dn.html_inline){y+=M.content;continue}break;case"code_inline":if(f===Dn.code_inline){y+=ym(M);continue}break}}y+=this.renderInlineTokens(T,o,s);continue}const A=i[v];if(!A){const T=g.attrs;if(!g.hidden){if(!T||T.length===0)switch(v){case"hr":y+=r?`<hr />
|
|
126
|
-
`:`<hr>
|
|
127
|
-
`;continue;case"heading_open":y+=`<${g.tag}>`;continue;case"heading_close":y+=`</${g.tag}>
|
|
128
|
-
`;continue;case"paragraph_open":y+=`${b}<p>`;continue;case"paragraph_close":y+=`</p>
|
|
129
|
-
`;continue;case"list_item_open":{const M=e[k+1];y+=b+(M&&(M.type==="inline"||M.hidden||M.nesting===-1&&M.tag==="li")?"<li>":`<li>
|
|
130
|
-
`);continue}case"list_item_close":y+=`</li>
|
|
131
|
-
`;continue;case"bullet_list_open":y+=`${b}<ul>
|
|
132
|
-
`;continue;case"bullet_list_close":y+=`</ul>
|
|
133
|
-
`;continue;case"blockquote_open":y+=b+(e[k+1]&&e[k+1].nesting===-1&&e[k+1].tag==="blockquote"?"<blockquote>":`<blockquote>
|
|
134
|
-
`);continue;case"blockquote_close":y+=`</blockquote>
|
|
135
|
-
`;continue;case"ordered_list_open":y+=`${b}<ol>
|
|
136
|
-
`;continue;case"ordered_list_close":y+=`</ol>
|
|
137
|
-
`;continue;case"table_open":y+=`${b}<table>
|
|
138
|
-
`;continue;case"table_close":y+=`</table>
|
|
139
|
-
`;continue;case"thead_open":y+=`${b}<thead>
|
|
140
|
-
`;continue;case"thead_close":y+=`</thead>
|
|
141
|
-
`;continue;case"tbody_open":y+=`${b}<tbody>
|
|
142
|
-
`;continue;case"tbody_close":y+=`</tbody>
|
|
143
|
-
`;continue;case"tr_open":y+=`${b}<tr>
|
|
144
|
-
`;continue;case"tr_close":y+=`</tr>
|
|
145
|
-
`;continue;case"td_open":y+=`${b}<td>`;continue;case"td_close":y+=`</td>
|
|
146
|
-
`;continue;case"th_open":y+=`${b}<th>`;continue;case"th_close":y+=`</th>
|
|
147
|
-
`;continue}else if(T.length===1){const M=T[0];if(v==="ordered_list_open"&&M[0]==="start"){y+=`${b}<ol start="${Hn(M[1])}">
|
|
148
|
-
`;continue}if(v==="td_open"&&M[0]==="style"){y+=`${b}<td style="${Hn(M[1])}">`;continue}if(v==="th_open"&&M[0]==="style"){y+=`${b}<th style="${Hn(M[1])}">`;continue}}}y+=this.renderToken(e,k,o);continue}if(v==="code_block"&&A===Dn.code_block){y+=Sy(g);continue}if(v==="fence"&&A===Dn.fence){y+=TS(g,o);continue}if(v==="html_block"&&A===Dn.html_block){y+=g.content;continue}const I=A(e,k,o,s,this);typeof I=="string"?y+=I:y+=_p(I,g.type)}return y}async renderAsync(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");const o=this.mergeOptions(t),s=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||[],o,s);continue}const c=i[a.type];c?r+=await AS(c(e,l,o,s,this)):r+=this.renderToken(e,l,o)}return r}renderInline(e,t,n){const o=this.mergeOptions(t),s=n??{};return this.renderInlineTokens(e,o,s)}async renderInlineAsync(e,t,n){const o=this.mergeOptions(t),s=n??{};return this.renderInlineTokensAsync(e,o,s)}renderInlineAsText(e,t,n){const o=this.mergeOptions(t),s=n??{};return this.renderInlineAsTextInternal(e,o,s)}renderAttrs(e){return Pl(e.attrs)}renderToken(e,t,n){const o=e[t];if(o.hidden)return"";const s=o.block,i=o.nesting,r=o.tag,l=o.attrs;let a=!1;if(s&&(a=!0,i===1&&t+1<e.length)){const f=e[t+1];(f.type==="inline"||f.hidden||f.nesting===-1&&f.tag===r)&&(a=!1)}const c=s&&i!==-1&&t>0&&e[t-1].hidden?`
|
|
149
|
-
`:"",u=a?`>
|
|
150
|
-
`:">";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+Pl(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 o=()=>(n||(n={...t}),n);if(zh.call(e,"highlight")&&e.highlight!==t.highlight&&(o().highlight=e.highlight),zh.call(e,"langPrefix")){const s=e.langPrefix;s!==t.langPrefix&&(o().langPrefix=s)}if(zh.call(e,"xhtmlOut")){const s=e.xhtmlOut;s!==t.xhtmlOut&&(o().xhtmlOut=s)}if(zh.call(e,"breaks")){const s=e.breaks;s!==t.breaks&&(o().breaks=s)}return n||t}buildNormalizedBase(){return Object.freeze({...SG,...this.baseOptions})}renderSingleToken(e,t,n,o){const s=this.rules,i=t.type;if(i==="code_block"&&s.code_block===Dn.code_block)return Sy(t);if(i==="html_block"&&s.html_block===Dn.html_block)return t.content;const r=this.mergeOptions(n),l=o??{};if(i==="inline")return this.renderInlineTokens(t.children||[],r,l);const a=s[i];if(!a)return t.block?this.renderToken(e,0,r):km(t,r.xhtmlOut===!0);if(i==="fence"&&a===Dn.fence)return TS(t,r);const c=a(e,0,r,l,this);return typeof c=="string"?c:_p(c,i)}renderInlineTokens(e,t,n){if(!e||e.length===0)return"";const o=this.rules,s=o.text,i=o.text_special,r=o.softbreak,l=o.hardbreak,a=o.html_inline,c=o.code_inline,u=o.link_open,d=o.link_close,f=o.em_open,h=o.em_close,p=o.strong_open,m=o.strong_close,y=t.xhtmlOut===!0,k=y?`<br />
|
|
151
|
-
`:`<br>
|
|
152
|
-
`,g=t.breaks?k:`
|
|
153
|
-
`;if(e.length===1)return Uh(e,t,n,this,o,k,g);let v="";for(let b=0;b<e.length;b++){const A=e[b];if(A.type==="link_open"&&!u&&!d&&b+2<e.length){const M=e[b+1];if(e[b+2].type==="link_close"&&_G(M)){const $=`${MS(A)+Uh([M],t,n,this,o,k,g)}</a>`;if(r===Dn.softbreak&&b+3<e.length&&e[b+3].type==="softbreak"){v+=$+g,b+=3;continue}v+=$,b+=2;continue}}if(A.type==="link_open"&&!u&&!d&&b+1<e.length&&e[b+1].type==="link_close"){v+=`${MS(A)}</a>`,b+=1;continue}if(A.type==="em_open"&&!f&&!h&&b+2<e.length){const M=e[b+1];if(e[b+2].type==="em_close"&&ES(M)){v+=`<em>${Uh([M],t,n,this,o,k,g)}</em>`,b+=2;continue}}if(A.type==="strong_open"&&!p&&!m&&b+2<e.length){const M=e[b+1];if(e[b+2].type==="strong_close"&&ES(M)){v+=`<strong>${Uh([M],t,n,this,o,k,g)}</strong>`,b+=2;continue}}switch(A.type){case"text":if(s===Dn.text){const M=A.content.length===0?"":Hn(A.content);if(a===Dn.html_inline&&b+1<e.length&&e[b+1].type==="html_inline"){for(v+=M+e[++b].content;b+1<e.length&&e[b+1].type==="html_inline";)v+=e[++b].content;continue}v+=M;continue}break;case"text_special":if(i===Dn.text_special){A.content.length!==0&&(v+=Hn(A.content));continue}break;case"softbreak":if(r===Dn.softbreak){v+=g;continue}break;case"hardbreak":if(l===Dn.hardbreak){v+=k;continue}break;case"html_inline":if(a===Dn.html_inline){for(v+=A.content;b+1<e.length&&e[b+1].type==="html_inline";)v+=e[++b].content;continue}break;case"code_inline":if(c===Dn.code_inline){v+=ym(A);continue}break}const I=o[A.type];if(!I){v+=A.block?this.renderToken(e,b,t):km(A,y);continue}const T=I(e,b,t,n,this);typeof T=="string"?v+=T:v+=_p(T,A.type)}return v}async renderInlineTokensAsync(e,t,n){if(!e||e.length===0)return"";const o=this.rules;let s="";for(let i=0;i<e.length;i++){const r=o[e[i].type];r?s+=await AS(r(e,i,t,n,this)):s+=this.renderToken(e,i,t)}return s}renderInlineAsTextInternal(e,t,n){if(!e||e.length===0)return"";let o="";for(let s=0;s<e.length;s++){const i=e[s];switch(i.type){case"text":case"text_special":o+=i.content;break;case"image":o+=this.renderInlineAsTextInternal(i.children||[],t,n);break;case"html_inline":case"html_block":o+=i.content;break;case"softbreak":case"hardbreak":o+=`
|
|
154
|
-
`;break}}return o}},AG=CG;const MG=[],$g=4096;function EG(e){const t=e.length;let n=0;for(;n<=t;){let o=e.indexOf(`
|
|
155
|
-
`,n);o===-1&&(o=t);const s=o<t;let i=n,r=0;for(;i<o;){const l=e.charCodeAt(i);if(l===32){if(r++,i++,r>=4)return!0;continue}if(l===9){if(r+=4-r%4,i++,r>=4)return!0;continue}break}if(i<o){const l=e.charCodeAt(i);switch(l){case 35:{let a=i;for(;a<o&&e.charCodeAt(a)===35;)a++;const c=a-i;if(c>0&&c<=6){if(a<o){const u=e.charCodeAt(a);if(u===32||u===9||u===13)return!0}else if(a===o&&s)return!0}break}case 62:{const a=i+1;if(a<o){const c=e.charCodeAt(a);if(c===32||c===9||c===13)return!0}else if(a===o&&s)return!0;break}case 45:case 42:case 43:{const a=i+1;if(a<o){const c=e.charCodeAt(a);if(c===32||c===9||c===13)return!0}else if(a===o&&s)return!0;break}case 96:case 126:{let a=i;for(;a<o&&e.charCodeAt(a)===l;)a++;if(a-i>=3)return!0;break}default:if(l>=48&&l<=57){let a=i+1;for(;a<o;){const c=e.charCodeAt(a);if(c<48||c>57)break;a++}if(a<o&&e.charCodeAt(a)===46){const c=a+1;if(c<o){const u=e.charCodeAt(c);if(u===32||u===9||u===13)return!0}else if(c===o&&s)return!0}}break}}if(o===t)break;n=o+1}return!1}function TG(e,t){if(!e&&!t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n][0]!==t[n][0]||e[n][1]!==t[n][1])return!1;return!0}function NG(e,t){if(!e&&!t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!b5(e[n],t[n]))return!1;return!0}function b5(e,t){if(!e||!t||e.type!==t.type)return!1;const n=e.map,o=t.map;return!!n!=!!o||n&&o&&(n[0]!==o[0]||n[1]!==o[1])||e.tag!==t.tag||e.nesting!==t.nesting||e.markup!==t.markup||e.info!==t.info||e.block!==t.block||e.hidden!==t.hidden||!TG(e.attrs,t.attrs)||!NG(e.children,t.children)?!1:(e.content||"")===(t.content||"")}function NS(){return{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}}var IG=class{core;cache=null;stats=NS();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=NS(),this.stats.resets=e}parse(e,t,n){const o=t,s=this.cache;if(cs(o??s?.env),!s||o&&o!==s.env){const B=o??{},W=!!n.__explicitStreamChunkFallbackSetting,z=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,L=!!n.options?.streamChunkedFallback,O=!W&&z,j=L||O,Z=n.options?.streamChunkAdaptive!==!1,ie=n.options?.streamChunkTargetChunks??8,U=n.options?.streamChunkSizeChars,q=n.options?.streamChunkSizeLines,ee=n.options?.streamChunkMaxChunks,le=!!n.__explicitStreamChunkConfig,oe=n.options?.autoTuneChunks!==!1,re=n.options?.streamChunkFenceAware??!0,we=n.options?.streamLargeCachePolicy??"retain",me=n.options?.streamSkipCacheAboveChars??this.DEFAULT_SKIP_CACHE_CHARS,Ee=n.options?.streamSkipCacheAboveLines??this.DEFAULT_SKIP_CACHE_LINES;let ae,Y=!1;if(we==="skip"&&(Y=e.length>=me,!Y&&Ee!==void 0&&(ae=no(e),Y=ae>=Ee)),Y){const P=this.parseFullDocument(e,B,n,ae,!1);return this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",po(B,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!Lr(B)?.unbounded}),P.tokens}else if(j){const P=(he,ke,Te)=>he<ke?ke:he>Te?Te:he;ae===void 0&&(ae=no(e));const G=oe&&!le?CS(e.length,ae,n.options):null,pe=G?.maxChunkChars??(Z?P(Math.ceil(e.length/ie),8e3,64e3):U??1e4),ve=G?.maxChunkLines??(Z?P(Math.ceil(ae/ie),150,700):q??200),de=G?.maxChunks??(Z?P(Math.ceil(e.length/64e3),ie,32):ee),V=e.length>0&&e.charCodeAt(e.length-1)===10,se=O&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&G?.strategy!=="plain";if((L||se)&&(e.length>=pe*2||ae>=ve*2)&&V){const he=vm(n,e,B,{maxChunkChars:pe,maxChunkLines:ve,fenceAware:G?.fenceAware??re,maxChunks:de});return this.cache={src:e,tokens:he,env:B,lineCount:ae,lastSegment:void 0,globalStateReason:Ts(e)},this.updateCacheLineCount(this.cache,ae),this.recordChunkedParseResult(B,L?"explicit-initial-large-doc":"default-initial-large-doc"),he}}const Q=this.parseFullDocument(e,B,n,ae);return ae=Q.lineCount,this.cache={src:e,tokens:Q.tokens,env:B,lineCount:ae,lastSegment:void 0,globalStateReason:Ts(e)},this.updateCacheLineCount(this.cache,ae),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",po(B,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!Lr(B)?.unbounded}),Q.tokens}if(e===s.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode="cache",po(s.env,{area:"stream",path:"stream-cache",reason:"same-source"}),s.tokens;const i=e.startsWith(s.src)?e.slice(s.src.length):null;let r=s.globalStateReason;r===void 0&&(r=Ts(s.src),s.globalStateReason=r);const l=r?null:i!==null?this.detectGlobalStateForAppend(s,i):Ts(e),a=r||l;if(a){const B=o??s.env;Zr(B);const W=Ts(e),z=this.parseFullDocument(e,B,n),L=z.tokens,O=z.lineCount;return this.cache={src:e,tokens:L,env:B,lineCount:O,lastSegment:void 0,globalStateReason:W},this.updateCacheLineCount(this.cache,O),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",po(B,{area:"stream",path:"stream-full",reason:`global-state:${a}`,unbounded:!!Lr(B)?.unbounded}),L}const c=n.options?.streamOptimizationMinSize??this.MIN_SIZE_FOR_OPTIMIZATION;if(s.src.length<c&&e.length<c*1.5&&!e.startsWith(s.src)){const B=o??s.env,W=this.parseFullDocument(e,B,n),z=W.tokens,L=W.lineCount;return this.cache={src:e,tokens:z,env:B,lineCount:L,lastSegment:void 0,globalStateReason:Ts(e)},this.updateCacheLineCount(this.cache,L),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",po(B,{area:"stream",path:"stream-full",reason:"small-non-append",unbounded:!!Lr(B)?.unbounded}),z}const u=this.getAppendedSegment(s.src,e,i);if(u&&!this.shouldPreferTailReparseForAppend(s)){const B=s.lineCount??no(s.src);let W=3;u.length>5e3?W=8:u.length>1e3?W=6:u.length>200&&(W=4),W=Math.min(W,B);let z=null;const L=n.options?.streamContextParseStrategy??"chars",O=n.options?.streamContextParseMinChars??200,j=n.options?.streamContextParseMinLines??2;let Z;const ie=()=>(Z===void 0&&(Z=no(u)),Z),U=this.canDirectlyParseAppend(s),q=U&&this.shouldUseUnboundedAppend(e,s,u);let ee=!1;if(!U)switch(L){case"lines":ee=ie()>=j;break;case"constructs":if(u.length>=O){ee=!0;break}if(EG(u)){ee=!0;break}ee=ie()>=j;break;case"chars":default:ee=u.length>=O}if(W>0&&ee){const re=this.getTailLines(s.src,W)+u;try{const we=this.core.parse(re,s.env,n).tokens,me=we.findIndex(Ee=>Ee.map&&typeof Ee.map[1]=="number"&&Ee.map[1]>W);if(me!==-1){const Ee=we.slice(me),ae=B-W;ae!==0&&this.shiftTokenLines(Ee,ae),z={tokens:Ee}}}catch{z=null}}else z=null;if(!z){const re=B;if(q)z={tokens:Od(n,u,s.env,{mode:"stream"})},re>0&&this.shiftTokenLines(z.tokens,re);else{const we=this.core.parse(u,s.env,n);re>0&&this.shiftTokenLines(we.tokens,re),z=we}}let le=0;if(s.tokens.length>0&&z.tokens.length>0){const re=s.tokens[s.tokens.length-1],we=z.tokens[0];try{re.type==="inline"&&we.type==="inline"&&(we.children&&we.children.length>0&&(re.children||(re.children=[]),this.appendTokens(re.children,we.children)),re.content=(re.content||"")+(we.content||""),le=1)}catch{le=0}}const oe=s.tokens.length;if(z.tokens.length>le){const re=s.tokens,we=z.tokens,me=Math.min(re.length,we.length-le);let Ee=0;for(let ae=me;ae>0;ae--){let Y=!0;for(let Q=0;Q<ae;Q++){const P=re[re.length-ae+Q],G=we[le+Q];if(!b5(P,G)){Y=!1;break}}if(Y){Ee=ae;break}}Ee>0&&(le+=Ee),we.length>le&&this.appendTokens(s.tokens,we,le)}if(s.src=e,s.globalStateReason=null,s.lineCount=B+(Z??ie()),s.tokens.length>oe){const re=this.getLastSegment(s.tokens,e,oe,s.tokens.length,e.length-u.length,B);re?s.lastSegment=re:s.lastSegment=void 0}else s.lastSegment=void 0;return this.stats.total+=1,this.stats.appendHits+=1,q&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode="append",po(s.env,{area:"stream",path:q?"stream-unbounded-append":"stream-append",reason:q?"large-delta":"safe-append",unbounded:q}),s.tokens}const d=o??s.env,f=this.tryTailSegmentReparse(e,s,d,n);if(f)return this.stats.total+=1,this.stats.tailHits+=1,this.stats.lastMode="tail",po(d,{area:"stream",path:"stream-tail",reason:"tail-reparse"}),f;const h=!!n.__explicitStreamChunkFallbackSetting,p=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,m=!!n.options?.streamChunkedFallback,y=!h&&!u&&p,k=m||y,g=n.options?.streamChunkAdaptive!==!1,v=n.options?.streamChunkTargetChunks??8,b=n.options?.streamChunkSizeChars,A=n.options?.streamChunkSizeLines,I=n.options?.streamChunkMaxChunks,T=!!n.__explicitStreamChunkConfig,M=n.options?.autoTuneChunks!==!1,$=n.options?.streamChunkFenceAware??!0;let N=u&&s.lineCount!==void 0?s.lineCount+no(u):void 0;if(k){N===void 0&&(N=no(e));const B=(ie,U,q)=>ie<U?U:ie>q?q:ie,W=M&&!T?CS(e.length,N,n.options):null,z=W?.maxChunkChars??(g?B(Math.ceil(e.length/v),8e3,64e3):b??1e4),L=W?.maxChunkLines??(g?B(Math.ceil(N/v),150,700):A??200),O=W?.maxChunks??(g?B(Math.ceil(e.length/64e3),v,32):I),j=e.length>0&&e.charCodeAt(e.length-1)===10,Z=y&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&W?.strategy!=="plain";if((m||Z)&&(e.length>=z*2||N>=L*2)&&j){const ie=vm(n,e,d,{maxChunkChars:z,maxChunkLines:L,fenceAware:W?.fenceAware??$,maxChunks:O});return this.cache={src:e,tokens:ie,env:d,lineCount:N,lastSegment:void 0,globalStateReason:Ts(e)},this.updateCacheLineCount(this.cache,N),this.recordChunkedParseResult(d,m?"explicit-fallback-large-doc":"default-fallback-large-doc"),ie}}const F=this.parseFullDocument(e,d,n,N),S=F.tokens;return N=F.lineCount,this.cache={src:e,tokens:S,env:d,lineCount:N,lastSegment:void 0,globalStateReason:Ts(e)},this.updateCacheLineCount(this.cache,N),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",po(d,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!Lr(d)?.unbounded}),S}recordChunkedParseResult(e,t){const n=Lr(e)?.chunk,o=n?.fallback?String(n.fallbackReason||"global-state"):null;if(this.stats.total+=1,o){this.stats.fullParses+=1,this.stats.lastMode="full",po(e,{area:"stream",path:"stream-full",reason:`global-state:${o}`,unbounded:!!Lr(e)?.unbounded});return}this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode="chunked",po(e,{area:"stream",path:"stream-chunked",chunked:!0,reason:t})}parseFullDocument(e,t,n,o,s=!0){const i=Ts(e);Ff(t)&&Zr(t);const r=typeof n.__canUseImplicitLargeInputStrategy!="function"||n.__canUseImplicitLargeInputStrategy()?g5(n,e.length,o):"no";if(r==="yes"){const a=Od(n,e,t);return po(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-char-threshold",unbounded:!0}),{tokens:a,lineCount:o??(s?no(e):0)}}let l=o;if(r==="need-lines"&&(l=no(e),m5(n,e.length,l))){const a=Od(n,e,t);return po(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-line-threshold",unbounded:!0}),{tokens:a,lineCount:l}}return l===void 0&&(l=s?no(e):0),{tokens:iu(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:no(n)>=this.MIN_UNBOUNDED_APPEND_LINES}getAppendedSegment(e,t,n){if(n===null||n===void 0&&!t.startsWith(e)||!e.endsWith(`
|
|
156
|
-
`))return null;const o=n??t.slice(e.length);if(!o)return null;const s=o.length;if(o.charCodeAt(s-1)!==10)return null;let i=0,r=-1;for(let a=0;a<s&&!(o.charCodeAt(a)===10&&(r===-1&&(r=a),i++,i>=2));a++);if(i<2)return null;const l=(r===-1?o:o.slice(0,r)).trim();if(l.length===0)return null;if(/^[-=]+$/.test(l)){const a=e.slice(0,-1),c=a.lastIndexOf(`
|
|
157
|
-
`);if(a.slice(c+1).trim().length>0)return null}return this.endsInsideOpenFence(e)||this.mayContainReferenceDefinition(o)?null:o}tryTailSegmentReparse(e,t,n,o){const s=this.ensureLastSegment(t);if(!s||s.srcOffset<=0&&s.tokenStart<=0)return null;const i=t.src.slice(0,s.srcOffset);if(!e.startsWith(i))return null;const r=t.src.slice(s.srcOffset),l=e.slice(s.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,o,s,a);if(c)return c}if(this.mayContainReferenceDefinition(r)||this.mayContainReferenceDefinition(l))return null;try{const c=this.core.parse(l,n,o),u=this.getLastSegment(c.tokens,l);return s.lineStart>0&&this.shiftTokenLines(c.tokens,s.lineStart),t.src=e,t.env=n,t.globalStateReason=null,t.globalStateCarry=void 0,t.tokens.length=s.tokenStart,this.appendTokens(t.tokens,c.tokens),t.lineCount=s.lineStart+no(l),u?t.lastSegment={tokenStart:s.tokenStart+u.tokenStart,tokenEnd:s.tokenStart+u.tokenEnd,lineStart:s.lineStart+u.lineStart,lineEnd:s.lineStart+u.lineEnd,srcOffset:s.srcOffset+u.srcOffset}:t.lastSegment=null,t.tokens}catch{return null}}getTailLines(e,t){if(t<=0)return"";let n=t;for(let o=e.length-1;o>=0;o--)if(e.charCodeAt(o)===10&&(n--,n===0))return e.slice(o+1);return e}endsInsideOpenFence(e){const n=e.length>4e3?e.length-4e3:0,o=e.slice(n),s=o.length;let i=null,r=0;for(;r<=s;){let l=o.indexOf(`
|
|
158
|
-
`,r);l===-1&&(l=s);let a=r;for(;a<l;){const c=o.charCodeAt(a);if(c===32||c===9)a++;else break}if(a<l){const c=o.charCodeAt(a);if(c===96||c===126){let u=a;for(;u<l&&o.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===s)break;r=l+1}return i!==null}peek(){return this.cache?.tokens??MG}getStats(){return{...this.stats}}appendTokens(e,t,n=0,o=t.length){for(let s=n;s<o;s++)e.push(t[s])}updateCacheLineCount(e,t){e.lineCount=t??no(e.src),e.lastSegment=void 0,e.globalStateCarry=void 0}detectGlobalStateForAppend(e,t){if(e.globalStateReason)return e.globalStateReason;const n=(e.globalStateCarry??e.src.slice(-$g))+t,o=Ts(n);return e.globalStateCarry=n.length>$g?n.slice(n.length-$g):n,o&&(e.globalStateReason=o),o}ensureLastSegment(e){return e.lastSegment!==void 0||(e.lastSegment=this.getLastSegment(e.tokens,e.src)),e.lastSegment}getLastSegment(e,t,n=0,o=e.length,s,i){if(o<=n)return null;let r=Number.POSITIVE_INFINITY,l=-1,a=0;for(let c=o-1;c>=n;c--){const u=e[c];if(u.map&&(u.map[0]<r&&(r=u.map[0]),u.map[1]>l&&(l=u.map[1])),u.nesting<0){a+=-u.nesting;continue}if(u.nesting>0){if(a-=u.nesting,u.level===0&&a<=0){const d=Number.isFinite(r)?r:u.map?.[0]??0,f=l>=d?l:u.map?.[1]??d;return{tokenStart:c,tokenEnd:o,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,s,i)}}continue}if(u.level===0&&a===0){const d=Number.isFinite(r)?r:u.map?.[0]??0,f=l>=d?l:u.map?.[1]??d;return{tokenStart:c,tokenEnd:o,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,s,i)}}}return null}getLineStartOffset(e,t,n,o){if(n!==void 0&&o!==void 0&&t>=o)return this.getLineStartOffsetFrom(e,n,t-o);if(t<=0)return 0;let s=t,i=-1;for(;s>0;){if(i=e.indexOf(`
|
|
159
|
-
`,i+1),i===-1)return e.length;s--}return i+1}getLineStartOffsetFrom(e,t,n){if(n<=0)return t;let o=n,s=t-1;for(;o>0;){if(s=e.indexOf(`
|
|
160
|
-
`,s+1),s===-1)return e.length;o--}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,o,s,i){if(!i||this.mayContainReferenceDefinition(i))return null;const r=t.tokens[s.tokenStart];switch(r?.type){case"bullet_list_open":case"ordered_list_open":return this.tryListTailAppendMerge(e,t,n,o,s,i,r);case"table_open":return this.tryTableTailAppendMerge(e,t,n,o,s,i,r);default:return null}}tryListTailAppendMerge(e,t,n,o,s,i,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10)return null;const l=s.lineEnd-s.lineStart,a=t.src.length-s.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,o).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 f=t.lineCount??no(t.src);f>0&&this.shiftTokenLines(d,f);const h=this.getListParagraphMode(t.tokens,s.tokenStart,t.tokens.length,r.level),p=this.getListParagraphMode(u,0,u.length,0);(h==="loose"||p==="loose"||this.endsWithBlankLine(t.src)||(u[0]?.map?.[0]??0)>0)&&(this.setListParagraphVisibility(t.tokens,s.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=null;const m=f+no(i);t.lineCount=m;const y=this.getDocLineCount(e,m);return r.map&&(r.map[1]=y),t.lastSegment={tokenStart:s.tokenStart,tokenEnd:t.tokens.length,lineStart:s.lineStart,lineEnd:y,srcOffset:s.srcOffset},t.tokens}tryTableTailAppendMerge(e,t,n,o,s,i,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10||/(?:^|\n)[ \t]*\n/.test(i))return null;const l=s.lineEnd-s.lineStart,a=t.src.length-s.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(s.srcOffset));if(!c)return null;const u=`${c}${i}`;let d;try{d=this.core.parse(u,n,o).tokens}catch{return null}if(!this.isSingleTopLevelContainer(d,"table_open","table_close")||(d[0]?.map?.[1]??-1)!==this.getDocLineCount(u))return null;const f=this.getTableBodySection(d,0,d.length,0),h=this.getTableBodySection(t.tokens,s.tokenStart,t.tokens.length,r.level);if(!f||!h||f.tbodyOpenIndex<0||f.tbodyCloseIndex<0)return null;const p=h.tbodyOpenIndex>=0?d.slice(f.tbodyOpenIndex+1,f.tbodyCloseIndex):d.slice(f.tbodyOpenIndex,f.tbodyCloseIndex+1);if(p.length===0)return null;const m=s.lineEnd-2;m!==0&&this.shiftTokenLines(p,m);const y=h.tbodyCloseIndex>=0?h.tbodyCloseIndex:h.tableCloseIndex,k=t.lineCount??no(t.src);t.tokens.splice(y,0,...p),t.src=e,t.env=n,t.globalStateReason=null;const g=k+no(i);t.lineCount=g;const v=this.getDocLineCount(e,g);if(r.map&&(r.map[1]=v),h.tbodyOpenIndex>=0){const b=t.tokens[h.tbodyOpenIndex];b?.map&&(b.map[1]=v)}return t.lastSegment={tokenStart:s.tokenStart,tokenEnd:t.tokens.length,lineStart:s.lineStart,lineEnd:v,srcOffset:s.srcOffset},t.tokens}getTableHeaderContext(e){const t=e.indexOf(`
|
|
161
|
-
`);if(t<0)return null;const n=e.indexOf(`
|
|
162
|
-
`,t+1);return n<0?null:e.slice(0,n+1)}getTableBodySection(e,t,n,o){if(t<0||t>=n||e[t]?.type!=="table_open")return null;let s=-1;for(let l=n-1;l>t;l--){const a=e[l];if(a.type==="table_close"&&a.level===o){s=l;break}}if(s<0)return null;let i=-1,r=-1;for(let l=t+1;l<s;l++){const a=e[l];if(a.type==="tbody_open"&&a.level===o+1){i=l;break}}if(i>=0){for(let l=s-1;l>i;l--){const a=e[l];if(a.type==="tbody_close"&&a.level===o+1){r=l;break}}if(r<0)return null}return{tableCloseIndex:s,tbodyOpenIndex:i,tbodyCloseIndex:r}}isSingleTopLevelContainer(e,t,n,o){if(e.length<2)return!1;const s=e[0],i=e[e.length-1];if(s.type!==t||i.type!==n||s.level!==0||i.level!==0||o!==void 0&&s.markup!==o)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,o){let s=!1,i=!1;const r=o+2;for(let l=t;l<n;l++){const a=e[l];if(!(a.type!=="paragraph_open"||a.level!==r)&&(a.hidden?s=!0:i=!0,s&&i))return"loose"}return i?"loose":s?"tight":"none"}setListParagraphVisibility(e,t,n,o,s){const i=o+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=s)}}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 o=e.charCodeAt(n);if(o===32||o===9){n--;continue}return o===10}return!0}getDocLineCount(e,t=no(e)){return e.length===0?0:e.charCodeAt(e.length-1)===10?t:t+1}shiftTokenLines(e,t){if(t===0)return;let n=null;for(let o=0;o<e.length;o++){const s=e[o];if(s.map&&(s.map[0]+=t,s.map[1]+=t),s.children){n??=[];for(let i=s.children.length-1;i>=0;i--)n.push(s.children[i]);for(;n.length>0;){const i=n.pop();if(i.map&&(i.map[0]+=t,i.map[1]+=t),i.children)for(let r=i.children.length-1;r>=0;r--)n.push(i.children[r])}}}}};const IS={default:bG,zero:xG,commonmark:kG};function LG(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version}}function $G(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 LS(e){return e.experimental?{...e,...e.experimental}:e}function ki(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 $S(e,t,n){for(let o=0;o<n.length;o++){const s=n[o];if(ki(t,s)||ki(e,s))return!0}return!1}function FS(e,t,n){return ki(t,n)||ki(e,n)}function OS(e,t){const n=Lr(e)?.chunk;if(n?.fallback){po(e,{area:"parse",path:"plain",reason:`global-state:${n.fallbackReason||"unknown"}`});return}po(e,{area:"parse",path:"full-chunk",chunked:!0,reason:t})}function FG(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,streamLargeCachePolicy:"retain",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},o="default",s;!t&&typeof e!="string"?(s=e,o="default"):typeof e=="string"&&(o=e,s=t);const i=IS[o];if(!i)throw new Error(`Wrong \`markdown-it\` preset "${o}", check name`);if(i?.options&&(n={...n,...i.options}),s&&(n={...n,...s}),n=LS(n),typeof n.quotes=="string"){const M=n.quotes;M.length>=4?n.quotes=[M[0],M[1],M[2],M[3]]:n.quotes=["“","”","‘","’"]}let r=$S(i?.options,s,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),l=$S(i?.options,s,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),a=FS(i?.options,s,"fullChunkedFallback"),c=FS(i?.options,s,"streamChunkedFallback"),u=!1,d=null,f=null;const h=new SK;let p=null;const m=()=>(p||(p=new AG(n)),p);let y=null;const k=()=>(y||(y=new IG(h)),y);let g=null;const v=()=>(g||(g=new R6),g),b=M=>!u&&!!d&&!$G(M,d),A=(M,$)=>o==="default"&&!u&&p===null&&f!==null&&M.parse===f&&b(M)&&!M.stream.enabled&&$<(M.options.autoUnboundedThresholdChars??4e6)&&M.options.html===!1&&M.options.xhtmlOut===!1&&M.options.breaks===!1&&M.options.langPrefix==="language-"&&M.options.linkify===!1&&M.options.typographer===!1&&M.options.highlight===null,I=(M,$)=>o==="default"&&!u&&b(M)&&!M.stream.enabled&&!M.options.fullChunkedFallback&&$<(M.options.autoUnboundedThresholdChars??4e6)&&M.options.html===!1&&M.options.linkify===!1&&M.options.typographer===!1,T={core:h,block:h.block,inline:h.inline,get linkify(){const M=v();return Object.defineProperty(this,"linkify",{value:M,writable:!0,configurable:!0}),M},get renderer(){const M=m();return Object.defineProperty(this,"renderer",{value:M,writable:!0,configurable:!0}),M},options:n,__explicitFullChunkConfig:r,__explicitStreamChunkConfig:l,__explicitFullChunkFallbackSetting:a,__explicitStreamChunkFallbackSetting:c,__canUseImplicitLargeInputStrategy(){return b(this)},set(M){const $=LS(M);return this.options={...this.options,...$},(ki(M,"fullChunkSizeChars")||ki(M,"fullChunkSizeLines")||ki(M,"fullChunkMaxChunks"))&&(r=!0,this.__explicitFullChunkConfig=!0),(ki(M,"streamChunkSizeChars")||ki(M,"streamChunkSizeLines")||ki(M,"streamChunkMaxChunks"))&&(l=!0,this.__explicitStreamChunkConfig=!0),ki(M,"fullChunkedFallback")&&(a=!0,this.__explicitFullChunkFallbackSetting=!0),ki(M,"streamChunkedFallback")&&(c=!0,this.__explicitStreamChunkFallbackSetting=!0),p&&p.set($),typeof $.stream=="boolean"&&(this.stream.enabled=$.stream,y&&(y.reset(),y.resetStats())),this},configure(M){const $=typeof M=="string"?IS[M]:M;if(!$)throw new Error("Wrong `markdown-it` preset, can't be empty");if($.options&&this.set($.options),$.components){const N=$.components;N.core?.rules&&this.core.ruler.enableOnly(N.core.rules),N.block?.rules&&this.block.ruler.enableOnly(N.block.rules),N.inline?.rules&&this.inline.ruler.enableOnly(N.inline.rules),N.inline2?.rules&&this.inline.ruler2.enableOnly(N.inline2.rules)}return this},enable(M,$){const N=Array.isArray(M)?M:[M],F=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],S=new Set;for(const B of F){if(!B)continue;const W=B.enable(N,!0);for(let z=0;z<W.length;z++)S.add(W[z])}if(!$){const B=N.filter(W=>!S.has(W));if(B.length)throw new Error(`Rules manager: invalid rule name ${B.join(", ")}`)}return this},disable(M,$){const N=Array.isArray(M)?M:[M],F=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],S=new Set;for(const B of F){if(!B)continue;const W=B.disable(N,!0);for(let z=0;z<W.length;z++)S.add(W[z])}if(!$){const B=N.filter(W=>!S.has(W));if(B.length)throw new Error(`Rules manager: invalid rule name ${B.join(", ")}`)}return this},use(M,...$){const N=typeof M=="function"?M:M&&typeof M.default=="function"?M.default:void 0;if(!N)throw new TypeError("MarkdownIt.use: plugin must be a function");const F=[this,...$],S=M;return u=!0,N.apply(S,F),this},render(M,$){if(A(this,M.length)){$!==void 0&&cs($);const S=wS(M);if(S!==null)return $!==void 0&&po($,{area:"render",path:"stock-fast",reason:"stock-subset"}),S}const N=$??{},F=this.parse(M,N);return m().render(F,this.options,N)},async renderAsync(M,$){if(A(this,M.length)){$!==void 0&&cs($);const S=wS(M);if(S!==null)return $!==void 0&&po($,{area:"render",path:"stock-fast",reason:"stock-subset"}),S}const N=$??{},F=this.parse(M,N);return m().renderAsync(F,this.options,N)},renderIterable(M,$={}){const N=this.parseIterable(M,$);return m().render(N,this.options,$)},async renderAsyncIterable(M,$={}){const N=await this.parseAsyncIterable(M,$);return m().renderAsync(N,this.options,$)},renderInline(M,$={}){const N=this.parseInline(M,$);return m().render(N,this.options,$)},validateLink:n5,normalizeLink:o5,normalizeLinkText:s5,utils:qq,helpers:{...Lj},parse(M,$){if(typeof M!="string")throw new TypeError("Input data should be a String");if($!==void 0&&cs($),I(this,M.length)){const B=RK(M);if(B!==null)return $!==void 0&&po($,{area:"parse",path:"stock-fast",reason:"stock-subset"}),B}const N=$??{};let F;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&b(this)){const B=g5(this,M.length);if(B==="yes"){const W=Od(this,M,N);return po($,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),W}B==="need-lines"&&(F=no(M))}if(!this.stream.enabled){const B=M.length,W=this.options.autoTuneChunks!==!1,z=r,L=!a&&b(this),O=!!this.options.fullChunkedFallback,j=L&&B>=2e5;let Z;(O||j||F!==void 0)&&(Z=F??no(M));const ie=(O||j)&&W&&!z?yG(B,Z,this.options):null;if(O||j){const U=Z??0;if(O?B>=(this.options.fullChunkThresholdChars??2e4)||U>=(this.options.fullChunkThresholdLines??400):j){if(ie&&ie.strategy!=="plain"){const q=vm(this,M,N,{maxChunkChars:ie.maxChunkChars,maxChunkLines:ie.maxChunkLines,fenceAware:ie.fenceAware,maxChunks:ie.maxChunks});return $&&OS($,O?"explicit-full-chunk":"default-large-string"),q}if(O){const q=(Y,Q,P)=>Y<Q?Q:Y>P?P:Y,ee=this.options.fullChunkAdaptive!==!1,le=this.options.fullChunkTargetChunks??8,oe=q(Math.ceil(B/le),8e3,64e3),re=q(Math.ceil(U/le),150,700),we=ee?oe:this.options.fullChunkSizeChars??1e4,me=ee?re:this.options.fullChunkSizeLines??200,Ee=ee?q(Math.ceil(B/64e3),le,32):this.options.fullChunkMaxChunks,ae=vm(this,M,N,{maxChunkChars:we,maxChunkLines:me,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:Ee});return $&&OS($,"explicit-full-chunk"),ae}}}if(F!==void 0&&b(this)&&m5(this,B,Z??F)){const U=Od(this,M,N);return po($,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),U}}const S=Ts(M);return po($,{area:"parse",path:"plain",reason:"default-plain"}),iu(N,S,()=>h.parse(M,N,this).tokens)},parseIterable(M,$={}){return cs($),pG(this,M,$)},parseAsyncIterable(M,$={}){return cs($),mG(this,M,$)},parseIterableToSink(M,$,N={}){return cs(N),gG(this,M,$,N)},parseAsyncIterableToSink(M,$,N={}){return cs(N),vG(this,M,$,N)},parseInline(M,$={}){if(typeof M!="string")throw new TypeError("Input data should be a String");cs($),Ff($)&&Zr($);const N=h.createState(M,$,this);return N.inlineMode=!0,h.process(N),N.tokens}};if(T.stream={enabled:!!n.stream,parse(M,$){return T.stream.enabled?k().parse(M,$,T):T.parse(M,$??{})},reset(){k().reset()},peek(){return y?y.peek():[]},stats(){return y?y.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}},resetStats(){y&&y.resetStats()}},i?.components){const M=i.components;M.core?.rules&&T.core.ruler.enableOnly(M.core.rules),M.block?.rules&&T.block.ruler.enableOnly(M.block.rules),M.inline?.rules&&T.inline.ruler.enableOnly(M.inline.rules),M.inline2?.rules&&T.inline.ruler2.enableOnly(M.inline2.rules)}return d=LG(T),f=T.parse,T}var OG=FG;const x5=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],RG=["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"],w5=["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"],BG=["svg","g","path"],DG=["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"],PG=["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","innerhtml","outerhtml","textcontent","innertext","srcdoc","ping"],HG=["action","data","href","src","srcset","poster","xlink:href","formaction"],WG=["script"],zG=["pre","iframe","picture","script","style","table","tbody","td","tfoot","th","thead","textarea","tr","title","video"],Hl=new Set(x5),_5=new Set(w5),gf=new Set([...x5,...RG,...w5,...BG]),S5=new Set([...gf,...DG]),UG=new Set(PG),qG=new Set(HG),Rf=new Set(WG),C5=new Set(zG);function A5(e){let t="";for(const n of e){const o=n.charCodeAt(0);o<=31||o>=127&&o<=159||/\s/u.test(n)||(t+=n)}return t}const jG={amp:"&",bsol:"\\",colon:":",newline:`
|
|
163
|
-
`,sol:"/",tab:" "};function M5(e){return e.replace(/&(?:#(\d+)|#x([0-9a-f]+)|([a-z][a-z0-9]+));?/gi,(t,n,o,s)=>{const i=n??o;if(i){const r=Number.parseInt(i,n?10:16);try{return Number.isFinite(r)?String.fromCodePoint(r):""}catch{return""}}return jG[String(s??"").toLowerCase()]??t})}const qh=new Set(["http","https","mailto","tel"]),VG=new Set(["javascript","vbscript","data","file","ftp","blob","filesystem","intent","chrome","chrome-extension","moz-extension","ms-browser-extension","view-source"]),ua=new Set(["http","https"]);function E5(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??""}const KG=/^https?:\/\//i;function GG(e){if(!KG.test(e))return!1;for(const t of e){const n=t.charCodeAt(0);if(t==="&"||n<=32||n>=127&&n<=159||n>127&&/\s/u.test(t))return!1}return!0}function YG(e,t,n){if(!Dd(t,n)||!e.startsWith("file:///"))return!1;const o=e.charAt(8);return o!=="/"&&o!=="\\"}function Dd(e,t){return e?(e==="a"||e==="area")&&(!t||t==="href"||t==="xlink:href"):!t||t==="href"}function ZG(e,t){return t==="href"||t==="xlink:href"?Dd(e,t)?qh:ua:t==="src"||t==="srcset"||t==="poster"||t==="action"||t==="formaction"||t==="data"?ua:(Dd(e,t),qh)}function Ba(e,t={}){if(GG(e))return!1;const n=A5(M5(e)).toLowerCase(),o=String(t.tagName??"").toLowerCase(),s=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 o==="img"&&s==="src"?!r:!0}if(/^[\\/]{2}/.test(n))return!0;if(n.startsWith("/")||n.startsWith("./")||n.startsWith("../")||n.startsWith("#")||n.startsWith("?"))return!1;const i=E5(n);return i?i==="file"?!YG(n,o,s):Dd(o,s)?VG.has(i):!ZG(o,s).has(i):!1}function XG(e){const t=M5(String(e??"")).trim();if(!t||t.startsWith("#")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("?"))return!1;const n=E5(A5(t).toLowerCase());return n==="http"||n==="https"}function QG(e,t={}){const n=String(e??"").trim();return n?Ba(n,t)?"":n:""}function RS(e){return QG(e,{tagName:"img",attrName:"src"})}function JG(e,t,n){function o(f){return f.trim().split(" ",2)[0]===t}function s(f,h,p,m,y){return f[h].nesting===1&&f[h].attrJoin("class",t),y.renderToken(f,h,p,m,y)}n=n||{};const i=3,r=n.marker||":",l=r.charCodeAt(0),a=r.length,c=n.validate||o,u=n.render||s;function d(f,h,p,m){let y,k=!1,g=f.bMarks[h]+f.tShift[h],v=f.eMarks[h];if(l!==f.src.charCodeAt(g))return!1;for(y=g+1;y<=v&&r[(y-g)%a]===f.src[y];y++);const b=Math.floor((y-g)/a);if(b<i)return!1;y-=(y-g)%a;const A=f.src.slice(g,y),I=f.src.slice(y,v);if(!c(I,A))return!1;if(m)return!0;let T=h;for(;T++,!(T>=p||(g=f.bMarks[T]+f.tShift[T],v=f.eMarks[T],g<v&&f.sCount[T]<f.blkIndent));)if(l===f.src.charCodeAt(g)&&!(f.sCount[T]-f.blkIndent>=4)){for(y=g+1;y<=v&&r[(y-g)%a]===f.src[y];y++);if(!(Math.floor((y-g)/a)<b)&&(y-=(y-g)%a,y=f.skipSpaces(y),!(y<v))){k=!0;break}}const M=f.parentType,$=f.lineMax;f.parentType="container",f.lineMax=T;const N=f.push("container_"+t+"_open","div",1);N.markup=A,N.block=!0,N.info=I,N.map=[h,T],f.md.block.tokenize(f,h+1,T);const F=f.push("container_"+t+"_close","div",-1);return F.markup=f.src.slice(g,y),F.block=!0,f.parentType=M,f.lineMax=$,f.line=T+(k?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 eY(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 o=[];let s="",i=!1,r=!1;for(let a=0;a<n.length;a++){const c=n[a];if(c==="\\"){s+=c,a+1<n.length&&(s+=n[a+1],a++);continue}if(!r&&c==="'"){i=!i,s+=c;continue}if(!i&&c==='"'){r=!r,s+=c;continue}if(!i&&!r&&c===","){o.push(s.trim()),s="";continue}s+=c}s.trim()&&o.push(s.trim());const l={};for(const a of o){if(!a)continue;let c=!1,u=!1,d=-1;for(let y=0;y<a.length;y++){const k=a[y];if(k==="\\"){y++;continue}if(!u&&k==="'"){c=!c;continue}if(!c&&k==='"'){u=!u;continue}if(!c&&!u&&k===":"){d=y;break}}if(d===-1)return null;const f=a.slice(0,d).trim(),h=a.slice(d+1).trim();if(!f)return null;let p=f;if(p.startsWith('"')&&p.endsWith('"')||p.startsWith("'")&&p.endsWith("'"))try{p=JSON.parse(p.replace(/^'/,'"').replace(/'$/,'"'))}catch{return null}if(!/^[_$A-Z][\w$-]*$/i.test(p))return null;let m;if(!h)m="";else if(h.startsWith('"')&&h.endsWith('"')||h.startsWith("'")&&h.endsWith("'"))try{m=JSON.parse(h.replace(/^'/,'"').replace(/'$/,'"'))}catch{m=h}else/^-?\d+(?:\.\d+)?$/.test(h)?m=Number(h):h==="true"||h==="false"?m=h==="true":h==="null"?m=null:m=h;l[p]=m}return l}function T5(e,t,n){for(const o of e){const s=o,i=s.map;if(Array.isArray(i)&&i.length>=2){const r=Number(i[0]),l=Number(i[1]);Number.isFinite(r)&&Number.isFinite(l)&&(s.map=[r+t,Math.min(l+t,n)])}Array.isArray(s.children)&&T5(s.children,t,n)}}function tY(e){["admonition","info","warning","error","tip","danger","note","caution"].forEach(t=>{e.use(JG,t,{render(n,o){return n[o].nesting===1?`<div class="vmr-container vmr-container-${t}">`:`</div>
|
|
164
|
-
`}})}),e.block.ruler.before("fence","vmr_container_fallback",(t,n,o,s)=>{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 f,h;const p=d.indexOf("{"),m=p>=0?d.slice(p).trimStart():void 0;if(p===-1)f=d||void 0;else{if(f=d.slice(0,p).trim()||void 0,m?.startsWith("{")){let I=0,T=-1;for(let M=0;M<m.length;M++)if(m[M]==="{"?I++:m[M]==="}"&&I--,I===0){T=M+1;break}T>0&&(h=m.slice(0,T))}h||(f=d||void 0)}if(s)return!0;const y=!!i.env.__markstreamFinal;let k=n+1,g=!1;for(;k<=o;){const I=i.bMarks[k]+i.tShift[k],T=i.eMarks[k];if(i.src.slice(I,T).trim()===":::"){g=!0;break}k++}g||(k=o);const v=i.push("vmr_container_open","div",1);if(v.attrSet("class",`vmr-container vmr-container-${u}`),v.map=[n,g?k:o],v.meta={...v.meta??{},unclosed:!g&&!y},f&&v.attrSet("data-args",f),h)try{const I=JSON.parse(h);for(const[T,M]of Object.entries(I)){const $=M!=null&&typeof M=="object";v.attrSet(`data-${T}`,$?JSON.stringify(M):String(M))}}catch{const I=eY(h);if(I)for(const[T,M]of Object.entries(I)){const $=M!=null&&typeof M=="object";v.attrSet(`data-${T}`,$?JSON.stringify(M):String(M))}else v.attrSet("data-attrs",h)}const b=[];for(let I=n+1;I<k;I++){const T=i.bMarks[I]+i.tShift[I],M=i.eMarks[I];b.push(i.src.slice(T,M))}if(b.some(I=>I.trim().length>0)){let I=b.join(`
|
|
165
|
-
`);I.endsWith(`
|
|
166
|
-
`)||(I+=`
|
|
167
|
-
`),I.endsWith(`
|
|
168
|
-
|
|
169
|
-
`)||(I+=`
|
|
170
|
-
`);const T=i.tokens[i.tokens.length-1];T&&(T.raw=I);const M=[];i.md.block.parse(I,i.md,i.env,M),T5(M,n+1,n+1+b.length),i.tokens.push(...M)}const A=i.push("vmr_container_close","div",-1);return g||(A.hidden=!0,A.map=[o,o]),i.line=g?k+1:k,!0},{alt:["paragraph","reference","blockquote","list"]})}function Ki(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function io(e){let t=!1,n=!1;for(let o=0;o<e.length;o++){const s=e[o];if(s==="\\"){o++;continue}if(!n&&s==="'"){t=!t;continue}if(!t&&s==='"'){n=!n;continue}if(!t&&!n&&s===">")return o}return-1}function R1(e){const t=[],n=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let o;for(;(o=n.exec(e))!==null;){const s=o[1];if(!s)continue;const i=o[2]||o[3]||o[4]||"";t.push([s,i])}return t}const nY=/^[a-z][a-z0-9_-]*$/;function BS(e){return nY.test(String(e??"").trim().toLowerCase())}function Ti(e){const t=String(e??"").trim();if(!t)return"";if(!t.startsWith("<"))return BS(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 o=n;for(;n<t.length&&/[\w-]/.test(t[n]);)n++;const s=t.slice(o,n).toLowerCase(),i=t[n]??"";return i&&!/[\s/>]/.test(i)?"":BS(s)?s:""}function tc(e){if(!e||e.length===0)return[];const t=new Set,n=[];for(const o of e){const s=Ti(o);!s||t.has(s)||(t.add(s),n.push(s))}return n}function oY(...e){const t=new Set,n=[];for(const o of e)for(const s of tc(o))t.has(s)||(t.add(s),n.push(s));return n}function sY(e){const t=tc(e);return{key:t.join(","),tags:t}}function N5(e){return Ti(e)}function iY(e,t){const n=String(e??""),o=Ti(t);if(!o)return!1;const s=Ki(o),i=n.match(new RegExp(String.raw`^\s*<\s*${s}(?:\s[^>]*)?(\s*\/)?>`,"i"));return i?i[1]?!0:new RegExp(String.raw`<\s*\/\s*${s}\s*>`,"i").test(n):!1}function I5(e,t){const n=Ti(t);return!!n&&!gf.has(n)&&!iY(e,n)}function rY(e,t){const n=String(e??""),o=Ti(t);if(!o)return n;const s=Ki(o),i=new RegExp(String.raw`^\s*<\s*${s}(?:\s[^>]*)?>\s*`,"i"),r=new RegExp(String.raw`\s*<\s*\/\s*${s}\s*>\s*$`,"i");return n.replace(i,"").replace(r,"")}const L5=Hl,lY=gf,$5=new Set(_5);$5.delete("details");const aY=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,cY=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,Cy=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,uY=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function bm(e){return(e.match(Cy)?.[1]??"").toLowerCase()}function p2(e){return/^\s*<\s*\//.test(e)}function m2(e,t){return L5.has(t)||/\/\s*>\s*$/.test(e)}function dY(e,t){let n=0;for(let o=0;o<e.length;o++){const s=e[o];if(!s||s.type!=="html_inline")continue;const i=String(s.content??""),r=bm(i);if(r===t){if(p2(i)){if(n===0)return o;n--;continue}m2(i,r)||n++}}return-1}function fY(e,t){let n=0;for(const o of e){if(!o||o.type!=="html_inline")continue;const s=String(o.content??""),i=bm(s);if(i===t){if(p2(s)){n>0&&n--;continue}m2(s,i)||n++}}return n}function DS(e,t,n=0){const o=new RegExp(String.raw`<\s*(\/?)\s*${Ki(t)}(?=[\s>/])[^>]*>`,"gi");o.lastIndex=Math.max(0,n);let s=0,i;for(;(i=o.exec(e))!==null;){const r=i[0]??"",l=!!i[1],a=!l&&/\/\s*>$/.test(r);if(l){if(s===0)return{start:i.index,end:i.index+r.length};s--;continue}a||s++}return null}function hY(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${Ki(t)}(?=[\s>/])[^>]*>`,"gi");let o=0,s;for(;(s=n.exec(e))!==null;){const i=s[0]??"",r=!!s[1],l=!r&&/\/\s*>$/.test(i);if(r){o>0&&o--;continue}l||o++}return o}function xm(e){const t=e;return String(t.raw??t.content??t.markup??"")}function pY(e){const t=e;return t.meta||(t.meta={}),t.meta}function Fg(e,t,n){const o=pY(e);o.markstreamCustomHtmlRaw=t,o.markstreamCustomHtmlInner=n}function mY(e,t){if(!t.size)return;const n=Array.from(t,h=>new RegExp(String.raw`<\s*${Ki(h)}(?=[\s>/])`,"i")),o=[];let s=!1;const i=h=>h?n.some(p=>p.test(h)):!1,r=h=>{if(!(!h||!o.length))for(const p of o)p.raw+=h,p.inner+=h},l=()=>{!o.length||!s||(r(`
|
|
171
|
-
`),s=!1)},a=h=>{r(h)},c=h=>{for(let m=0;m<o.length;m++)o[m].raw+=h,m<o.length-1&&(o[m].inner+=h);const p=o.pop();Fg(p.token,p.raw,p.inner)},u=h=>{const p=o[o.length-1]?.tag;if(!p)return null;const m=new RegExp(String.raw`^\s*<\s*\/\s*${Ki(p)}\s*>`,"i");return h.match(m)?.[0]??null},d=h=>!!u(h),f=(h,p,m)=>{const y=m??(h.type==="html_inline"?bm(p):"");if(!(y&&t.has(y))){r(p);return}const k=p2(p),g=!k&&m2(p,y);if(k){if(!o.length||o[o.length-1].tag!==y){r(p);return}c(p);return}if(r(p),g){Fg(h,p,"");return}o.push({tag:y,token:h,raw:p,inner:""})};for(const h of e){if(h.type==="inline"&&Array.isArray(h.children)){const p=String(h.content??"");if(d(p)?s=!1:l(),!o.length&&!i(p)){s=!1;continue}let m=0,y=!0;for(const k of h.children){const g=xm(k),v=k.type==="html_inline"?bm(g):"",b=v&&t.has(v);let A=g;if(y&&p&&g&&(o.length||b)){const I=p.indexOf(g,m);if(I!==-1)a(p.slice(m,I)),A=p.slice(I,I+g.length),m=I+g.length;else{if(o.length&&!b)continue;y=!1}}f(k,A,v)}y&&p&&m<p.length&&o.length&&a(p.slice(m)),s=o.length>0;continue}if(o.length&&typeof h.content=="string"){const p=xm(h),m=h.type==="html_block"?u(p):null;if(m){c(`${s?`
|
|
172
|
-
`:""}${m}`),s=o.length>0;continue}if(!h.content)continue;l(),r(h.content),s=!0}}for(const h of o)Fg(h.token,h.raw,h.inner)}function gY(e){return/^\s*<\s*[!?]/.test(e)}function vY(e){const t=new Set(lY);if(e&&Array.isArray(e))for(const n of e){const o=String(n??"").trim();if(!o)continue;const s=o.match(/^[<\s/]*([A-Z][\w-]*)/i);s&&t.add(s[1].toLowerCase())}return t}function PS(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function yY(e,t){let n=null;for(const i of e.matchAll(aY)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();PS(l,t)&&io(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!1})}for(const i of e.matchAll(cY)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();PS(l,t)&&io(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!0})}const o=/<\/\s*$/.exec(e);if(o&&typeof o.index=="number"){const i=o.index;!e.slice(i).includes(">")&&(!n||i<n.index)&&(n={index:i,tag:"",closing:!0})}const s=/<\s*$/.exec(e);if(s&&typeof s.index=="number"){const i=s.index,r=e.slice(i);!r.startsWith("</")&&!r.includes(">")&&(!n||i<n.index)&&(n={index:i,tag:"",closing:!1})}return n}function kY(e,t){const n=e;return Object.assign(Object.create(Object.getPrototypeOf(n)),n,{type:"text",content:t,raw:t})}function bY(e,t){if(!e.length)return{children:e};const n=[];let o=null,s=null;function i(a,c){a&&(c?n.push(kY(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 f=a.slice(d),h=f.match(Cy);if(!h){i("<",c),u=d+1;continue}const p=io(f);if(p===-1){i("<",c),u=d+1;continue}const m=f.slice(0,p+1),y=(h[1]??"").toLowerCase();t.has(y)?n.push({type:"html_inline",tag:"",content:m,raw:m}):i(m,c),u=d+m.length}}function l(a,c){if(!a)return;const u=yY(a,t);if(!u){r(a,c);return}const d=a.slice(0,u.index);d&&r(d,c),o={tag:u.tag,buffer:a.slice(u.index),closing:u.closing},s=o.buffer}for(const a of e){if(o){o.buffer+=xm(a),s=o.buffer;const c=io(o.buffer);if(c===-1)continue;const u=o.buffer.slice(0,c+1),d=o.buffer.slice(c+1);n.push({type:"html_inline",tag:"",content:u,raw:u}),o=null,s=null,d&&l(d);continue}if(a.type==="html_inline"){const c=xm(a),u=(c.match(Cy)?.[1]??"").toLowerCase();if(u&&t.has(u)&&io(c)===-1){o={tag:u,buffer:c,closing:/^<\s*\//.test(c)},s=o.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:s??void 0}}const xY=["a","span","strong","em","b","i","u"];function wY(e,t={}){const n=new Set;if(t.customHtmlTags?.length)for(const f of t.customHtmlTags){const h=Ti(f);h&&n.add(h)}const o=f=>{const h=f,p=new Set(n),m=Array.isArray(h.env?.__markstreamCustomHtmlTags)?h.env.__markstreamCustomHtmlTags:[];for(const v of m){const b=Ti(String(v??""));b&&p.add(b)}const y=vY(Array.from(p)),k=new Set(xY);for(const v of p)k.add(v);return{autoCloseInlineTagSet:k,commonHtmlTags:y,customTagSet:p,shouldMergeHtmlBlockTag:v=>p.has(v)||!y.has(v)||$5.has(v)}},s=f=>{if(f.type==="html_block")return String(f.content??"");if(f.type!=="inline"||!Array.isArray(f.children)||f.children.length!==1)return"";const h=f.children[0];return h?.type!=="html_block"?"":String(f.content??h.content??"")},i=(f,h)=>{f.type="html_block",f.content=h,f.raw=h,f.children=[]},r=f=>f.replace(/^(?:\r?\n)+/,""),l=f=>/^(?: {4}|\t)/.test(f),a=f=>f.replace(/^(?: {4}|\t)/gm,""),c=(f,h)=>{const p=r(f);if(!/\S/.test(p))return[];if(l(p))return[{type:"code_block",content:a(p),raw:p}];const m=p.replace(/^[\t ]+/,"");if(!m)return[];if(m.startsWith("<"))return[{type:"html_block",content:m}];const y={type:"inline",tag:"",nesting:0,content:m,children:[{type:"text",content:m,raw:m}]};return h==="paragraph"?[{type:"paragraph_open",tag:"p",nesting:1},y,{type:"paragraph_close",tag:"p",nesting:-1}]:h==="text"?[{type:"text",content:m,raw:m}]:[y]},u=(f,h,p)=>f[h-1]?.type==="paragraph_open"&&f[h+1]?.type==="paragraph_close"?"inline":p,d=(f,h)=>{const p=r(h);return!/\S/.test(p)||f.type!=="inline"||!Array.isArray(f.children)?!1:(f.content=`${String(f.content??"")}${p}`,f.children.push({type:"text",content:p,raw:p}),!0)};e.core.ruler.after("inline","fix_html_inline_streaming",f=>{const h=f.tokens??[],{commonHtmlTags:p,customTagSet:m}=o(f);for(const y of h){const k=y;if(k.type!=="inline"||!Array.isArray(k.children))continue;const g=String(k.content??""),v=k.children.length?k.children:g.includes("<")?[{type:"text",content:g,raw:g}]:null;if(v)try{const b=bY(v,p);if(k.children=b.children,b.pendingBuffer){const A=g.lastIndexOf(b.pendingBuffer);if(A!==-1){const I=g.slice(0,A);k.content=I,typeof k.raw=="string"&&(k.raw=I)}}}catch(b){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",b)}}mY(h,m)}),e.core.ruler.push("fix_html_inline_tokens",f=>{const h=f.tokens??[],{autoCloseInlineTagSet:p,customTagSet:m,shouldMergeHtmlBlockTag:y}=o(f),k=[];for(let g=0;g<h.length;g++){const v=h[g];if(k.length>0){const[A,I]=k[k.length-1];if(g!==I){if(v.type==="paragraph_open"||v.type==="paragraph_close"){h.splice(g,1),g--;continue}const T=String(v.content??v.raw??"");if(T){const M=h[I],$=`${String(M.content||"")}
|
|
173
|
-
${T}`,N=io($),F=N===-1?null:DS($,A,N+1);if(F){const S=$.slice(0,F.end),B=$.slice(F.end);M.content=S,M.loading=!1,h.splice(g,1),k.pop();const W=d(M,B)?[]:c(B,u(h,g,"paragraph"));W.length&&h.splice(g,0,...W),g--;continue}M.content=$,M.loading!==!1&&(M.loading=!0)}h.splice(g,1),g--;continue}}const b=s(v);if(b){if(gY(b))continue;const A=(b.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??"").toLowerCase(),I=/^\s*<\s*\//.test(b);if(!A||!y(A))continue;if(i(v,b),!I)A&&!new RegExp(`^\\s*<\\s*${A}\\b[^>]*\\/\\s*>`,"i").test(b)&&hY(b,A)>0&&k.push([A,g]);else if(k.length>0&&A&&k[k.length-1][0]===A){const[,T]=k[k.length-1],M=h[T];M.content=`${String(M.content||"")}
|
|
174
|
-
${b}`,M.loading=!1,k.pop(),h.splice(g,1),g--}continue}else if(k.length>0){if(v.type==="paragraph_open"||v.type==="paragraph_close"){h.splice(g,1),g--;continue}const A=v.content||"",I=new RegExp(`<\\s*\\/\\s*${k[k.length-1][0]}\\s*>`,"i").test(A);if(A){const[,T]=k[k.length-1],M=h[T];M.content=`${M.content||""}
|
|
175
|
-
${A}`,M.loading!==!1&&(M.loading=!I)}I&&k.pop(),h.splice(g,1),g--}else continue}if(m.size>0){const g=new Map,v=new Map,b=T=>{let M=g.get(T);return M||(M=new RegExp(`<\\s*${T}\\b`,"i"),g.set(T,M)),M},A=T=>{let M=v.get(T);return M||(M=new RegExp(`<\\s*\\/\\s*${T}\\s*>`,"i"),v.set(T,M)),M},I=[];for(let T=0;T<h.length;T++){const M=h[T],$=String(M.content??"");if(I.length>0){const F=I[I.length-1],S=h[F.index],B=M.type==="html_block"?A(F.tag).exec($):null;if(B){const L=B.index+B[0].length,O=$.slice(0,L),j=$.slice(L);S.content=`${String(S.content??"")}
|
|
176
|
-
${O}`,Array.isArray(S.children)&&S.children.push({type:"html_inline",content:`</${F.tag}>`,raw:`</${F.tag}>`}),I.pop();const Z=d(S,j)?[]:c(j,u(h,T,"paragraph"));Z.length?h.splice(T,1,...Z):(h.splice(T,1),T--);continue}if(M.type!=="inline")continue;const W=Array.isArray(M.children)?M.children:[],z=dY(W,F.tag);if(z!==-1){const L=W.slice(0,z+1),O=W.slice(z+1),j=L.map(Z=>String(Z?.content??Z?.raw??"")).join("");if(S.content=`${String(S.content??"")}
|
|
177
|
-
${j}`,Array.isArray(S.children)&&S.children.push(...L),O.length){const Z=O.map(ie=>String(ie.content??ie.raw??"")).join("");if(Z.trim()){const ie=Z.replace(/^\s+/,"");if(d(S,Z))h.splice(T,1),T--;else if(ie.startsWith("<"))h.splice(T,1,{type:"html_block",content:ie});else{const U=c(Z,u(h,T,"paragraph"));h.splice(T,1,...U)}}else h.splice(T,1),T--}else h.splice(T,1),T--;I.pop();continue}S.content=`${String(S.content??"")}
|
|
178
|
-
${$}`,Array.isArray(S.children)&&S.children.push(...W),h.splice(T,1),T--;continue}if(M.type!=="inline")continue;const N=Array.isArray(M.children)?M.children:[];for(const F of m)if((N.length?fY(N,F):b(F).test($)&&!A(F).test($)?1:0)>0){I.push({tag:F,index:T});break}}}{let g=0;for(let v=0;v<h.length;v++){const b=h[v];if(b.type==="paragraph_open"){g++;continue}b.type==="paragraph_close"&&(g>0?g--:(h.splice(v,1),v--))}}for(let g=0;g<h.length;g++){const v=h[g];if(v.type==="html_block"){const M=(v.content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(M.startsWith("!")||M.startsWith("?")){v.loading=!1;continue}if(m.has(M)){const z=String(v.content??""),L=io(z),O=L===-1?null:DS(z,M,L+1);v.loading=O?!1:v.loading!==void 0?v.loading:!0;const j=O?.start??-1,Z=O?O.end-O.start:0;if(j!==-1){const ie=z.slice(0,j+Z);let U="";L!==-1&&L<j&&(U=z.slice(L+1,j)),v.children=[{type:M,content:U,raw:ie,attrs:[],tag:M,loading:!1}],v.content=ie,v.raw=ie;const q=c(z.slice(j+Z)||"","text");q.length&&h.splice(g+1,0,...q)}else v.children=[{type:M,content:"",raw:z,attrs:[],tag:M,loading:!0}];continue}if(["br","hr","img","input","link","meta","div","p","ul","li"].includes(M))continue;v.type="inline";const $=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let N;for(;(N=$.exec(v.content||""))!==null;)N[1],N[2]||N[3]||N[4];const F=String(v.content??""),S=new RegExp(`<\\/\\s*${M}\\s*>`,"i").exec(F),B=S?S.index:-1,W=S?S[0].length:0;if(B!==-1){const z=F.slice(0,B+W),L=(F.slice(B+W)||"").replace(/^\s+/,"");v.children=[{type:"html_block",content:z,tag:M,loading:!1}],v.content=z,v.raw=z,L&&h.splice(g+1,0,L.startsWith("<")?{type:"html_block",content:L}:{type:"text",content:L,raw:L})}else v.children=[{type:"html_block",content:v.content,tag:M,loading:!0}];continue}if(!v||v.type!=="inline")continue;if(v.children.length===2&&v.children[0].type==="html_inline"){const M=(v.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase(),$=v.children[1],N=String($?.content??"").match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??"";if($?.type==="html_inline"&&N===M)continue;p.has(M)?(v.children[0].loading=!0,v.children[0].tag=M,v.children.push({type:"html_inline",tag:M,loading:!0,content:`</${M}>`})):v.children=[{type:"html_block",loading:!0,tag:M,content:String(v.children[0]?.content??"")+String(v.children[1]?.content??"")}];continue}else if(v.children.length===3&&v.children[0].type==="html_inline"&&v.children[2].type==="html_inline"){const M=(v.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(p.has(M))continue;v.children=[{type:"html_block",loading:!1,tag:M,content:v.children.map($=>$.content).join("")}];continue}if(!v.content?.startsWith("<")||v.children?.length!==1)continue;const b=String(v.content),A=v,I=A.children[0];if(I?.type!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(b)&&(A.children.length=0);continue}const T=String(I.content??b).match(uY)?.[1]?.toLowerCase()??"";if(T){if(/\/\s*>\s*$/.test(b)||L5.has(T)){A.children=[{type:"html_inline",content:b}];continue}A.children.length=0}}})}function _Y(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 SY(e,t={}){t.enabled!==!1&&e.core.ruler.after("inline","fix_indented_code_block",n=>{const o=n.tokens??[];for(let s=0;s<o.length;s++){const i=o[s];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&&!_Y(l[0]??"")){const a=l[0]??"",c=i.level??0;o.splice(s,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}),s+=2}}})}const F5=/\.([a-z0-9]{1,15})$/i,CY=/[_()[\]{}<>]/u,AY=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,MY=/[?#@]/u,EY=/[\\/]/u,TY=/^[\p{L}\p{N}./\\-]+$/u,NY=/^[A-Za-z0-9-]{1,63}$/u,IY=/^xn--[a-z0-9-]{2,59}$/i,LY=/^(?:[A-Z]{1,6}|\d{1,8})$/u,$Y=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,FY=/文件名\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,OY=/文件名\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,RY=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,BY=2e3,DY=512,PY={},HY=new Set(["ai","md","py","rs","sh","zip"]),O5=new Set(["as","bj","de","hk","l","ln","ny","pa","sh","ss","sz","t","us"]),WY=new Set([...O5,"at","ax","cn","co","it","jp","ks","mc","mx","nz","pl","sa","si","to","tw"]),zY=new Set(["com","dev","io","page","site"]),UY=new Set(["app","apk","dmg","exe","ipa","lock","log","markdown","webmanifest"]),qY=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"]),Ea=new Map;function HS(e,t){if(!e||e.length>DY)return t;for(Ea.set(e,t);Ea.size>BY;){const n=Ea.keys().next().value;if(!n)break;Ea.delete(n)}return t}function vf(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function Og(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return vf(n)?n:void 0}function WS(e,t){if(!vf(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 zS(e){const t=Bf(e);return vf(t)?t:void 0}function jY(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,"").replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,"")}function US(e,t){if(!vf(t))return;const n=String(e??"").trim().split(/\s+/u).map(jY).filter(Boolean);if(n.length===0)return;const o={};return t?.filename&&n.every(s=>wm(s,{filename:!0,explicitFilename:t.explicitFilename}))&&(o.filename=!0),t?.explicitFilename&&o.filename&&(o.explicitFilename=!0),t?.marketTicker&&n.every(s=>wm(s,{marketTicker:!0}))&&(o.marketTicker=!0),vf(o)?o:void 0}function Gl(e,t=!1){let n;return{options(o){return t||o==null?WS(e,n):WS(e,Og(zS(o),US(o,n)))},remember(o){const s=zS(o);n=t?Og(n,s):Og(s,US(o,n))},reset(){n=void 0}}}function qS(e){return NY.test(e)&&!e.startsWith("-")&&!e.endsWith("-")}function VY(e){const t=e.split(".");if(t.length<2)return!1;const n=t[t.length-1]?.toLowerCase()??"";return qS(n)||IY.test(n)?t.every(qS):!1}function R5(e){return Array.from(e).some(t=>t.charCodeAt(0)>127)}function KY(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??""}function GY(e){return e.split(".").some(t=>t.toLowerCase().startsWith("xn--"))}function B5(e,t,n){const o=KY(t);return R5(e)&&GY(o)&&String(n??"").toLowerCase().includes(o.toLowerCase())}function YY(e){if(!e)return!1;if(e.includes("文件")||e.includes("附件")||e.includes("路径")||e.includes("路徑")||e.includes("文档")||e.includes("文檔")||e.includes("档案")||e.includes("檔案")||e.includes("资料")||e.includes("資料")||e.includes("股票")||e.includes("证券")||e.includes("證券")||e.includes("代码")||e.includes("代碼")||e.includes("交易所")||e.includes("后缀")||e.includes("後綴")||e.includes("市场")||e.includes("市場"))return!0;const t=e.toLowerCase();return t.includes("file")||t.includes("attachment")||t.includes("document")||t.includes("doc")||t.includes("path")||t.includes("ticker")||t.includes("symbol")||t.includes("exchange")}function Bf(e){const t=String(e??""),n=Ea.get(t);return n?(Ea.delete(t),Ea.set(t,n),n):YY(t)?HS(t,{explicitFilename:FY.test(t),filename:OY.test(t),marketTicker:RY.test(t)}):HS(t,PY)}function ZY(e){return VY(e.split(/[\\/]/)[0]??"")}function XY(e){const t=e.replace(/[^a-z]/gi,"");return t.length>=2&&t===t.toUpperCase()}function QY(e){if(CY.test(e)||!TY.test(e))return!0;if(EY.test(e))return!ZY(e);const t=e.replace(F5,"");return R5(t)?!0:t.split(".").filter(Boolean).some(XY)}function JY(e,t,n){if(!(n?WY:O5).has(t))return!1;const o=e.slice(0,-(t.length+1));return o===""?e.startsWith("."):(n?$Y:LY).test(o)}function wm(e,t={}){if(!e||AY.test(e)||MY.test(e))return!1;const n=e.match(F5);if(!n)return!1;const o=String(n[1]??"").toLowerCase();return JY(e,o,t.marketTicker===!0)?!0:qY.has(o)?!HY.has(o)||t.filename?!0:QY(e):!!(t.explicitFilename&&zY.has(o)||t.filename&&UY.has(o))}const jS=["!"];function Ms(e){return{type:"text",content:e,raw:e}}function da(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 fa(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 dl(e,t,n){let o="";if(t.includes('"')){const s=t.split('"');t=s[0].trim(),o=s[1].trim()}return{type:"link",loading:n,href:t,title:o,text:e,children:[{type:"text",content:e,raw:e}],raw:`[${e}](${t})`}}function eZ(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(Ms(t))}}function VS(e,t){let n=-1;for(const o of t){const s=e.indexOf(o);s!==-1&&(n===-1||s<n)&&(n=s)}return n}function tZ(e){const t=e.attrs?.find(n=>n?.[0]==="href")?.[1];return typeof t=="string"?t:""}function nZ(e,t){if(!e)return;e.attrs=Array.isArray(e.attrs)?e.attrs:[];const n=e.attrs.findIndex(o=>o?.[0]==="href");n>=0?e.attrs[n][1]=t:e.attrs.push(["href",t])}function oZ(e,t,n){let o="";for(let s=t+1;s<n;s++){const i=e[s];if(i?.type!=="text"||typeof i.content!="string")return null;o+=i.content}return o||null}function sZ(e){e.core.ruler.after("inline","fix_link_tokens",t=>{const n=t.tokens??[];for(let o=0;o<n.length;o++){const s=n[o];if(s&&s.type==="inline"&&Array.isArray(s.children))try{s.children=iZ(s.children,typeof s.content=="string"?s.content:void 0)}catch(i){console.error("[applyFixLinkTokens] failed to fix inline children",i)}}})}function iZ(e,t){if(e.length<3||e.some(o=>o.type==="code_inline"))return e;const n=Bf(t);for(let o=0;o<=e.length-1;o++){o<0&&(o=0);const s=e[o];if(!s)break;if(s.type==="link_open"&&(s.markup==="linkify"||s.markup==="autolink")){let i=-1;for(let r=o+1;r<e.length;r++)if(e[r]?.type==="link_close"){i=r;break}if(i!==-1){const r=oZ(e,o,i),l=tZ(s);if(s.markup==="linkify"&&r&&!B5(r,l,t)&&wm(r,n)){e.splice(o,i-o+1,Ms(r));continue}const a=VS(l,jS);for(let c=o+1;c<i;c++){const u=e[c];if(u?.type!=="text"||typeof u.content!="string")continue;const d=VS(u.content,jS);if(d===-1)continue;const f=u.content[d],h=u.content.slice(0,d);let p=u.content.slice(d);for(let k=c+1;k<i;k++){const g=e[k];g?.type==="text"&&typeof g.content=="string"&&(p+=g.content)}u.content=h,u.raw=h;const m=i-(c+1);m>0&&(e.splice(c+1,m),i=c+1);let y=l;if(a!==-1)y=l.slice(0,a);else if(p){const k=encodeURI(p);if(k&&l.endsWith(k))y=l.slice(0,l.length-k.length);else{const g=f?encodeURI(f):"",v=g?l.indexOf(g):-1;v!==-1&&(y=l.slice(0,v))}}y!==l&&nZ(s,y),p&&e.splice(i+1,0,Ms(p));break}}}if(s?.type==="em_open"&&e[o-1]?.type==="text"&&e[o-1].content?.endsWith("*")){const i=e[o-1].content?.replace(/(\*+)$/,"")||"";e[o-1].content=i,s.type="strong_open",s.tag="strong",s.markup="**";for(let r=o+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(s?.type==="text"&&s.content?.endsWith("(")&&e[o+1]?.type==="link_open"){const i=s.content.match(/\[([^\]]+)\]/);if(i){let r=s.content.slice(0,i.index);const l=r.match(/(\*+)$/),a=[];if(l){r=r.slice(0,l.index),r&&a.push(Ms(r));const c=i[1],u=l[1].length;da(a,u);let d=e[o+2]?.content||"";if(e[o+4]?.type==="text"&&!e[o+4].content?.startsWith(")")&&(d+=e[o+4]?.content||"",e[o+4].content=""),a.push(dl(c,d,!e[o+4]?.content?.startsWith(")"))),fa(a,u),e[o+4]?.type==="text"){const f=e[o+4].content?.replace(/^\)\**/,"");f&&a.push(Ms(f)),e.splice(o,5,...a)}else e.splice(o,4,...a)}else{r&&a.push(Ms(r));let c=i[1];const u=c.match(/^\*+/);if(u){const f=u[0].length;c=c.replace(/^\*+/,"").replace(/\*+$/,"");let h=e[o+2]?.content||"";if(e[o+4]?.type==="text"&&!e[o+4].content?.startsWith(")")&&(h+=e[o+4]?.content||"",e[o+4].content=""),da(a,f),a.push(dl(c,h,!e[o+4]?.content?.startsWith(")"))),fa(a,f),e[o+4]?.type==="text"){const p=e[o+4].content?.replace(/^\)/,"");p&&a.push(Ms(p)),e.splice(o,5,...a)}else e.splice(o,4,...a);o===0?o=a.length-1:o-=a.length+1;continue}let d=e[o+2]?.content||"";if(e[o+4]?.type==="text"&&!e[o+4].content?.startsWith(")")&&(d+=e[o+4]?.content||"",e[o+4].content=""),a.push(dl(c,d,!e[o+4]?.content?.startsWith(")"))),e[o+4]?.type==="text"){const f=e[o+4].content?.replace(/^\)/,"");f&&a.push(Ms(f)),e.splice(o,5,...a)}else e.splice(o,4,...a)}o-=a.length+1;continue}}else if(s.type==="link_open"&&s.markup==="linkify"&&e[o-1]?.type==="text"&&e[o-1].content?.endsWith("(")){if(e[o-2]?.type==="link_close"){const i=[],r=e[o-3].content||"";let l=s.attrs?.find(a=>a[0]==="href")?.[1]||"";if(e[o+3]?.type==="text"){const a=(e[o+3]?.content??"").indexOf(")"),c=a===-1;a===-1&&(l+=e[o+3]?.content?.slice(0,a)||"",e[o+3].content=""),i.push(dl(r,l,c));const u=e[o+3].content?.replace(/^\)\**/,"");u&&i.push(Ms(u)),e.splice(o-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(o-4,7,...i);continue}else if(e[o-1].content==="]("&&e[o-3]?.type==="text"&&e[o-3].content?.endsWith(")"))if(e[o-2]?.type==="strong_open"){const[i,r]=e[o-3].content?.split("[**")||[];e[o+1].content=r||"",e[o-3].content=i||"",e[o-1].content=""}else if(e[o-2]?.type==="em_open"){const[i,r]=e[o-3].content?.split("[*")||[];e[o+1].content=r||"",e[o-3].content=i||"",e[o-1].content=""}else{const[i,r]=e[o-3].content?.split("[")||[];e[o+1].content=r||"",e[o-3].content=i||"",e[o-1].content=""}}if(s.type==="link_close"&&s.nesting===-1&&e[o-2]?.type==="link_open"&&e[o+1]?.type==="text"&&e[o-1]?.type==="text"){const i=e[o-1].content||"",r=e[o-2].attrs||[],l=r.find(p=>p[0]==="href")?.[1]||"",a=r.find(p=>p[0]==="title")?.[1]||"";let c=3,u=2;const d=(e[o-3]?.content||"").match(/^(\*+)$/),f=[];if(d){u+=1;const p=d[1].length;da(f,p)}if(s.markup!=="linkify"&&e[o+1].type==="text"&&e[o+1]?.content?.startsWith("](")){c+=1;for(let p=o+1;p<e.length;p++){const m=d?d[1].length:e[o-3].markup.length,y=e[p];if(m===1&&y.type==="em_close")break;if(m===2&&y.type==="strong_close")break;if(m===3&&(y.type==="em_close"||y.type==="strong_close"))break;c+=1}}const h={type:"link",loading:!1,href:l,title:a,text:i,children:[{type:"text",content:i,raw:i}],raw:`[${i}](${l})`};if(f.push(h),d){const p=d[1].length;fa(f,p)}e.splice(o-u,c,...f),o-=f.length+1;continue}else if(s.content?.startsWith("](")&&e[o-1].markup?.includes("*")&&e[o-4]?.type==="text"&&e[o-4].content?.endsWith("[")){const i=e[o-1].markup.length,r=[],l=e[o-4].content.slice(0,e[o-4].content.length-i);l&&r.push(Ms(l)),da(r,i);const a=e[o-2].content||"";let c=s.content.slice(2),u=!0;if(e[o+1]?.type==="text"){const d=(e[o+1]?.content??"").indexOf(")");u=d===-1,d===-1&&(c+=e[o+1]?.content?.slice(0,d)||"",e[o+1].content="")}if(r.push(dl(a,c,u)),fa(r,i),e[o+1]?.type==="text"){const d=e[o+1].content?.replace(/^\)\**/,"");d&&r.push(Ms(d)),e.splice(o-4,8,...r)}else e[o+1]?.type==="link_open"?e.splice(o-4,10,...r):e.splice(o-4,7,...r);o-=r.length+1;continue}else if(s.content?.startsWith("](")&&e[o-1].type==="strong_close"&&e[o-4]?.type==="text"&&e[o-4]?.content?.includes("**[")){const i=[],r=e[o-4].content.split("**[")[0];r&&i.push(Ms(r)),da(i,2);const l=e[o-2].content||"";let a=s.content.slice(2),c=!0;if(e[o+1]?.type==="text"){const u=(e[o+1]?.content??"").indexOf(")");c=u===-1,u===-1&&(a+=e[o+1]?.content?.slice(0,u)||"",e[o+1].content="")}if(i.push(dl(l,a,c)),fa(i,2),e[o+1]?.type==="text"){const u=e[o+1].content?.replace(/^\)\**/,"");u&&i.push(Ms(u)),e.splice(o-4,8,...i)}else e[o+1]?.type==="link_open"?e.splice(o-4,10,...i):e.splice(o-4,7,...i);o-=i.length+1;continue}else if(s.type==="strong_close"&&e[o+1]?.type==="text"&&e[o+1].content?.includes("](")&&e[o-1].type==="text"&&/\[.*$/.test(e[o-1].content||"")){const i=[],[r,l]=e[o-1].content?.split("[")||["",""];r&&i.push(Ms(r)),da(i,2);let[a,c]=e[o+1].content.split("](");a=l+a;let u=4;if(e[o+2]?.type==="link_open"){const f=e[o+2].attrs?.find(h=>h[0]==="href")?.[1];e[o+5]?.type==="text"&&e[o+5].content==="."?(c=(f||c)+e[o+5].content,e[o+5].content=""):c=f||c,u+=3}let d=!0;if(s.nesting===-1&&(a=a.replace(/\*+$/,"")),e[o+2]?.type==="text"){const f=(e[o+2]?.content??"").indexOf(")");d=f===-1,f===-1&&(c+=e[o+2]?.content?.slice(0,f)||"",e[o+2].content="")}i.push(dl(a,c,d)),fa(i,2),e.splice(o-2,u,...i)}if(s.type==="text"&&/\*+\[[^\]]*$/.test(s.content||"")&&e[o+1]?.type==="strong_open"&&e[o+2]?.type==="text"&&e[o+2].content==="]("&&e[o+3]?.type==="link_open"&&e[o+5]?.type==="link_close"&&e[o+6]?.type==="text"&&e[o+6].content===")"&&e[o+7]?.type==="strong_close"){const i=(s.content||"").match(/^(\*+)\[(.*)$/);if(i){const r=(i[2]||"")+i[1];let l=e[o+3]?.attrs?.find(c=>c[0]==="href")?.[1]||"";!l&&e[o+4]?.type==="text"&&(l=e[o+4].content||"");const a=[];da(a,2),a.push(dl(r,l,!1)),fa(a,2),e.splice(o,9,...a),o-=a.length-1;continue}}}for(let o=0;o<e.length-1;o++){const s=e[o],i=e[o+1];if(s?.type!=="link"||i?.type!=="text"||typeof i.content!="string"||!i.content.startsWith("!"))continue;const r=String(s.href??"");if(String(s.text??"")!==r||!r.endsWith("=")&&!r.endsWith("#"))continue;eZ(s,"!");const l=i.content.slice(1);l?(i.content=l,i.raw=l):e.splice(o+1,1)}return e}function rZ(e){e.core.ruler.after("inline","fix_list_item_tokens",t=>{const n=t.tokens??[];for(let o=0;o<n.length;o++){const s=n[o];if(s&&s.type==="inline"&&Array.isArray(s.children))try{s.children=lZ(s.children)}catch(i){console.error("[applyFixListItem] failed to fix inline children",i)}}})}function lZ(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 aZ(e){e.core.ruler.after("inline","fix_strong_tokens",t=>{const n=t.tokens??[];for(let o=0;o<n.length;o++){const s=n[o];if(s&&s.type==="inline"&&Array.isArray(s.children))try{s.children=cZ(s.children)}catch(i){console.error("[applyFixStrongTokens] failed to fix inline children",i)}}})}function cZ(e){let t=0;const n=new Set,o=new Set;let s=0;for(let u=0;u<e.length;u++){const d=e[u],f=d.type;if(f==="strong_open"){t++;const h=String(d.markup??"");let p=u-1;for(;p>=0&&e[p].type==="text"&&e[p].content==="";)p--;const m=e[p];let y=u+1;for(;y<e.length&&e[y].type==="text"&&e[y].content==="";)y++;const k=e[y];h==="__"&&(m?.content?.endsWith("_")||k?.content?.startsWith("_")||k?.markup?.includes("_"))&&(d.type="text",d.tag="",d.content=h,d.raw=h,d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null,n.add(t))}else if(f==="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(f==="em_open"){s++;const h=String(d.markup??"");let p=u-1;for(;p>=0&&e[p].type==="text"&&e[p].content==="";)p--;const m=e[p];let y=u+1;for(;y<e.length&&e[y].type==="text"&&e[y].content==="";)y++;const k=e[y];h==="_"&&(m?.content?.endsWith("_")||k?.content?.startsWith("_")||k?.markup?.includes("_"))&&(d.type="text",d.tag="",d.content=h,d.raw=h,d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null,o.add(s))}else f==="em_close"&&(o.has(s)&&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),s--,s<0&&(s=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,f=[{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:""}],h=c.slice(0,-1);h&&f.unshift({type:"text",content:h,raw:h}),l.splice(i,d,...f)}return l=uZ(l),l}function uZ(e){if(e.length<7)return e;const t=[];for(let n=0;n<e.length;n++){const o=e[n],s=e[n+1],i=e[n+2],r=e[n+3],l=e[n+4],a=e[n+5],c=e[n+6];if(o?.type==="strong_open"&&s?.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 f=u.slice(0,d),h=u.slice(d+2);t.push(o),t.push(s),t.push(l),f&&t.push({...c,type:"text",content:f,raw:f}),t.push(a),h&&t.push({...c,type:"text",content:h,raw:h}),n+=6;continue}}if(o?.type==="strong_open"&&s?.type==="text"&&i?.type==="strong_close"&&r?.type==="strong_open"&&l?.type==="math_inline"&&a?.type==="strong_close"){const u=dZ(e,n+6);if(u){t.push(o),t.push(s),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(o)}return t}function dZ(e,t){for(let n=t;n<e.length;n++){const o=e[n];if(o?.type==="strong_open")return null;if(o?.type!=="text")continue;const s=String(o.content??""),i=s.indexOf("**");if(i!==-1)return{index:n,beforeClose:s.slice(0,i),afterClose:s.slice(i+2)}}return null}function fZ(e){e.core.ruler.after("block","fix_table_tokens",t=>{const n=t;try{const o=yZ(n.tokens??[],!!n.env?.__markstreamFinal,n.src??"");Array.isArray(o)&&(n.tokens=o)}catch(o){console.error("[applyFixTableTokens] failed to fix table tokens",o)}})}function KS(){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 GS(){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 YS(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 D5(e,t){if(!e.startsWith("|")||e.includes(`
|
|
179
|
-
`)||!e.endsWith("|"))return null;const n=e.slice(1).split("|");return n.at(-1)===""&&n.pop(),n.length>0&&n.every(o=>o.trim().length>0)?n:null}function Rg(e){return D5(e)!==null}function P5(e){return/^:?-+:?$/.test(e.trim())}function hZ(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(P5)}function pZ(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function mZ(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(P5)&&pZ(n)}function gZ(e){return e==="|"||e==="|:"}function vZ(e){const t=D5(e);return t!==null&&t.every(n=>!n.includes(":"))}function yZ(e,t=!1,n=""){const o=[...e];if(e.length<3)return o;const s=e.length-2,i=e[s];if(i.type==="inline"){const r=String(i.content??""),l=r.split(`
|
|
180
|
-
`)[0]??"",[a="",c="",...u]=r.split(`
|
|
181
|
-
`),d=!t&&!r.includes(`
|
|
182
|
-
`)&&/\r?\n$/.test(n)&&Rg(r);if(!t&&(r.includes(`
|
|
183
|
-
`)&&u.length===0&&Rg(a)&&mZ(c)||d)){const f=l.slice(1,-1).split("|").map(p=>p.trim()).flatMap(p=>YS(p)),h=[...KS(),...f,...GS()];o.splice(s-1,3,...h)}else if(r.includes(`
|
|
184
|
-
`)&&u.length===0&&Rg(a)&&hZ(c)){const f=l.slice(1,-1).split("|").map(p=>p.trim()).flatMap(p=>YS(p)),h=[...KS(),...f,...GS()];o.splice(s-1,3,...h)}else r.includes(`
|
|
185
|
-
`)&&u.length===0&&vZ(a)&&gZ(c)&&(i.content=r.slice(0,-2),i.children.splice(2,1))}return o}function kZ(e,t,n,o){const s=e.length;if(n==="$$"&&o==="$$"){let c=t;for(;c<s-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=o;let l=0,a=t;for(;a<s;){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 bZ=kZ;const xZ=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],_m=xZ.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),wZ=/\\[a-z]+/i,H5="(?:\\\\|\\u0008)",_Z=new RegExp(String.raw`${H5}(?:${_m})\s*\{[^}]+\}`,"i"),SZ=new RegExp(String.raw`(?:${H5})?(?:${_m})\s*\{`,"i"),CZ=/\\(?:text|frac|left|right|times)/,AZ=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,MZ=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,EZ=/[A-Z]+\s*\([^)]+\)/i,TZ=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,NZ=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,IZ=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,LZ={"\b":"\\b","\v":"\\v","\f":"\\f"};function $Z(e){let t="";for(const n of e)t+=LZ[n]??n;return t}function Cl(e){if(!e)return!1;const t=$Z(e),n=t.trim();if(IZ.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const o=wZ.test(t),s=_Z.test(t),i=SZ.test(t),r=CZ.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=AZ.test(t)&&!MZ.test(t),c=EZ.test(t),u=TZ.test(n),d=NZ.test(t),f=/^\([a-z]\)$/i.test(n)||/^(?:[a-z]|pi)$/i.test(n),h=/^(?:[A-Z][a-z]?(?:_\{?\d+\}?|\^\{?\d+\}?)?)+$/.test(n);return o||s||i||r||l||a||c||u||d||f||h}const W5="__markstreamMathPluginApplied",Ay=80,z5=2e4,ZS=z5+4096;function g2(e){return!!e[W5]}function FZ(e){e[W5]=!0}const U5=["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"],OZ=["cdot","mathbf{","partial","mu_{"],q5=U5.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),j5="[ \r\b\f\v]",RZ=new RegExp(`([^\\\\])(${OZ.map(e=>e).join("|")})+`,"g"),BZ=/span\{([^}]+)\}/,DZ=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,PZ=/(^|[^\\])\\\r?\n/g,HZ=/(^|[^\\])\\$/g,WZ=/[\p{L}\p{M}\p{N}\p{Pe}\p{Pf}'′″‴|‖]/u,zZ=new RegExp(`(${j5})|(${q5})\\b`,"g"),XS=new Map,QS=new Map;function UZ(e){if(!e)return zZ;const t=[...e];t.sort((r,l)=>l.length-r.length);const n=t.join(""),o=XS.get(n);if(o)return o;const s=`(?:${t.map(r=>r.replace(/[.*+?^${}()|[\\]\\"\]/g,"\\$&")).join("|")})`,i=new RegExp(`(${j5})|(${s})\\b`,"g");return XS.set(n,i),i}function qZ(e,t){const n=e?[]:[...t??[]];e||n.sort((l,a)=>a.length-l.length);const o=e?"__default__":n.join(""),s=QS.get(o);if(s)return s;const i=e?[_m,q5].filter(Boolean).join("|"):[n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),_m].filter(Boolean).join("|"),r=new RegExp(`(^|[^\\\\\\w])(${i})\\s*\\{`,"g");return QS.set(o,r),r}const JS={" ":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function eC(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function jZ(e){return e.replace(/(^|[^\\])!+/gu,(t,n)=>{if(n&&WZ.test(n))return t;const o=n?t.slice(n.length):t;return`${n}${"\\!".repeat(o.length)}`})}function tC(e){const t=/(^|[^\\])(__|\*\*)/g;let n,o=null;for(;(n=t.exec(e))!==null;)o={marker:n[2],index:n.index+(n[1]?.length??0)};return o}function fl(e,t){const n=t?.commands??U5,o=t?.escapeExclamation??!0,s=t?.commands==null,i=UZ(s?void 0:n);let r=e.replace(i,(c,u,d,f,h)=>{if(u!==void 0&&JS[u]!==void 0)return`\\${JS[u]}`;if(d&&n.includes(d)){const p=h&&typeof f=="number"?h[f-1]:void 0;return p==="\\"||p&&/\w/.test(p)?c:`\\${d}`}return c});o&&(r=jZ(r));let l=r;const a=qZ(s,s?void 0:n);return l=l.replace(a,(c,u,d)=>`${u}\\${d}{`),l=l.replace(BZ,"span\\{$1\\}").replace(DZ,"\\operatorname{span}\\{$1\\}"),l=l.replace(PZ,`$1\\\\
|
|
186
|
-
`),l=l.replace(HZ,"$1\\\\"),l=l.replace(RZ,"$1\\$2"),l}function nC(e){const t=e.trim();return!(!Cl(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 V5(e){const t=[];let n=0;for(;n<e.length;){if(e[n]!=="`"){n++;continue}const o=n;let s=1;for(;o+s<e.length&&e[o+s]==="`";)s++;let i=o+s,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===s){r=i;break}i+=l}if(r!==-1){t.push([o,r+s]),n=r+s;continue}n=o+s}return t}function Sm(e,t){for(const n of e)if(t>=n[0]&&t<n[1])return n;return null}function VZ(e,t=!1){const n=[];let o=0;for(;o<e.length-1;){if(e[o]==="!"&&e[o+1]==="["){const s=o;let i=o+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([s,l]),o=l;continue}if(t){n.push([s,e.length]),o=e.length;continue}}}o++}return n}function Df(e,t){let n=t-1,o=0;for(;n>=0&&e[n]==="\\";)o++,n--;return o%2===1}function My(e,t){let n=t;for(;n<e.length;){const o=e.indexOf("$",n);if(o===-1)return-1;if(Df(e,o)){n=o+1;continue}return o}return-1}function Bg(e,t){let n=t;for(;n<e.length;){const o=My(e,n);if(o===-1)return-1;if(o>0&&e[o-1]==="$"||o+1<e.length&&e[o+1]==="$"){n=o+1;continue}return o}return-1}function Dc(e,t,n=0){let o=Math.max(0,n);for(;o<e.length;){const s=e.indexOf(t,o);if(s===-1)return-1;if(!Df(e,s))return s;o=s+Math.max(1,t.length)}return-1}function oC(e,t,n=0,o=e.length,s=[]){let i=0,r=Math.max(0,n);const l=Math.min(e.length,Math.max(0,o));for(;r<l;){const a=e.indexOf(t,r);if(a===-1||a>=l)break;const c=Sm(s,a);if(c){r=Math.max(a+Math.max(1,t.length),c[1]);continue}Df(e,a)||i++,r=a+Math.max(1,t.length)}return i}function v2(e,t,n){const o=kf(String(e??""));if(!o.endsWith(t))return-1;const s=o.length-t.length;if(s<=0||!kf(o.slice(0,s)).trim()||Df(o,s))return-1;const i=V5(o);if(Sm(i,s))return-1;const r=oC(o,t,0,s,i);if(t==="$$"){if(r%2===1)return-1}else if(r>oC(o,n,0,s,i))return-1;return s}function yf(e){return e===" "||e===" "}function kf(e){let t=e.length;for(;t>0&&yf(e[t-1]);)t--;return e.slice(0,t)}function sC(e){let t=0;for(let n=0;n<e.length;n++)e[n]===`
|
|
187
|
-
`&&t++;return t}function iC(e){if(!e)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}function KZ(e){if(e.length<3)return!1;const t=e[0];if(t!=="-"&&t!=="*"&&t!=="_"&&t!=="=")return!1;let n=0;for(let o=0;o<e.length;o++){const s=e[o];if(s===t){n++;continue}if(!yf(s))return!1}return n>=3}function GZ(e){const t=e.trim();if(!t)return!1;let n=0;t[n]===":"&&n++;let o=0;for(;t[n]==="-";)o++,n++;return o<3?!1:(t[n]===":"&&n++,n===t.length)}function YZ(e){if(!e.includes("|"))return!1;const t=e[0]==="|"?e.slice(1):e;return(t.endsWith("|")?t.slice(0,-1):t).split("|").every(GZ)}function ZZ(e){let t=0;if(!iC(e[t]))return!1;for(;iC(e[t]);)t++;return e[t]!=="."&&e[t]!==")"?!1:yf(e[t+1])}function K5(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&&yf(t[n]))return!0}return!!((t[0]==="-"||t[0]==="+"||t[0]==="*")&&yf(t[1])||ZZ(t)||KZ(t)||YZ(t))}function rC(e,t){return e?t?`${e}
|
|
188
|
-
${t}`:e:t}function Ey(e){const t=String(e??"").trim();return t?Cl(t):!1}function lC(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return t.toString(36)}function G5(e){if(e.length<=ZS)return{source:e,lineOffset:0};let t=e.length-ZS;const n=e.indexOf(`
|
|
189
|
-
`,t);return n===-1?{source:"",lineOffset:sC(e)}:(t=n+1,{source:e.slice(t),lineOffset:sC(e.slice(0,t))})}function Y5(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return!1;const{source:n}=G5(t);if(!n)return!1;const o=n.split(/\r?\n/),s=Math.max(0,o.length-Ay-2),i=[["$$","$$"],["\\[","\\]"]];for(let r=s;r<o.length;r++){const l=kf(o[r]);if(l&&!K5(l)){for(const[a,c]of i)if(v2(l,a,c)!==-1)return!0}}return!1}function XZ(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return null;const{source:n,lineOffset:o}=G5(t);if(!n)return null;const s=n.split(/\r?\n/),i=Math.max(0,s.length-Ay-2),r=[["$$","$$"],["\\[","\\]"]];for(let l=i;l<s.length-1;l++){const a=kf(s[l]);for(const[c,u]of r){const d=v2(a,c,u);if(d===-1)continue;let f="",h=!1;for(let p=l+1;p<s.length;p++){if(p-l>Ay){h=!0;break}const m=s[p],y=Dc(m,u);if(y!==-1){const k=rC(f,m.slice(0,y));if(!Ey(k)){h=!0;break}const g=m.slice(y+u.length),v=g.trim()?`suffix:${lC(g)}`:"nosuffix";return["closed",c,o+l,d,o+p,y,lC(k),v].join(":")}if(K5(m)){h=!0;break}if(f=rC(f,m),f.length>z5){h=!0;break}}if(!h&&Ey(f))return["pending",c,o+l,d].join(":")}}return null}function Dg(e,t){const n=String(e??"").trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??""))}function QZ(e){const t=String(e??"").trimStart(),n=t.match(/^\d+(?:,\d{3})*(?:\.\d+)?/);if(!n)return!1;const o=t.slice(n[0].length);return/^\s*(?:[+\-*/^_=<>]|\\[a-z]+)/i.test(o)?!1:o===""||/^[)\s,.!?;:]/.test(o)}function Pg(e){const t=String(e??"").trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function JZ(e,t){FZ(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)},o=(r,l)=>{const a=r,c=!!t?.strictDelimiters,u=!a?.env?.__markstreamFinal,d=(g,v)=>{let b=v;for(;b<g.length&&(g[b]===" "||g[b]===" ");)b++;if(b===v||!(g[b]===`
|
|
190
|
-
`||g[b]==="\r"&&g[b+1]===`
|
|
191
|
-
`))return v;const A=g.slice(v,b),I=a.push("text","",0);return I.content=A,b};if(/^\*[^*]+/.test(a.src))return!1;if(a.src[a.pos]==="$"){let g=a.pos+1;for(;a.src[g]==="$";)g++;const v=g-a.pos,b=a.src[g];if(v>=3&&(!b||/\s/.test(b))){const A=a.push("text","",0);return A.content=a.src.slice(a.pos,g),a.pos=g,!0}}const f=[["$$","$$"],["$","$"],["\\(","\\)"]],h=String(a.pending??""),p=Math.max(0,a.pos-h.length);let m=p,y=p;const k=p;for(const[g,v]of f){const b=a.src,A=V5(b),I=VZ(b,u);let T=!1;g==="$$"&&m!==k&&(m=k);let M=-1,$=-1,N=0;const F=S=>{if((S==="undefined"||S==null)&&(S=""),S==="\\"){a.pos=a.pos+S.length,m=a.pos;return}if(S==="\\)"||S==="\\("){const z=a.push("text_special","",0);z.content=S==="\\)"?")":"(",z.markup=S,a.pos=a.pos+S.length,m=a.pos;return}if(!S)return;if(g==="$$"&&S.includes("$")){let z=0;for(;z<S.length;){const L=My(S,z);if(L===-1){const re=S.slice(z);if(re){const we=a.push("text","",0);we.content=re,a.pos=a.pos+re.length,m=a.pos}break}if(L>0&&S[L-1]==="$"||L+1<S.length&&S[L+1]==="$"){const re=S.slice(z,L+1);if(re){const we=a.push("text","",0);we.content=re,a.pos=a.pos+re.length,m=a.pos}z=L+1;continue}const O=S.slice(z,L);if(O){const re=a.push("text","",0);re.content=O,a.pos=a.pos+O.length,m=a.pos}const j=Bg(S,L+1);if(j===-1){const re=S.slice(L),we=a.push("text","",0);we.content=re,a.pos=a.pos+re.length,m=a.pos;break}const Z=S.slice(L+1,j),ie=Z.includes("`"),U=!Z||!Z.trim(),q=S[j+1],ee=Dg(Z,q),le=Pg(Z);if(!ie&&!U&&!ee&&!le){const re=a.push("math_inline","math",0);re.content=fl(Z,t),re.markup="$",re.raw=`$${Z}$`,re.loading=!1,a.pos=a.pos+(j-L+1),m=a.pos,z=j+1;continue}const oe=a.push("text","",0);oe.content="$",a.pos=a.pos+1,m=a.pos,z=L+1}return}const B=S.indexOf("![");if(B!==-1){if(B>0){const O=S.slice(0,B),j=a.push("text","",0);j.content=O,a.pos=a.pos+O.length,m=a.pos}const z=S.slice(B).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(z){const[,O,j]=z,Z=j.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),ie=Z?Z[1]:j,U=Z&&Z[2]?Z[2]:null,q=a.push("image","img",0);q.attrs=[["src",ie],["alt",O]],U&&q.attrs.push(["title",U]),q.content=O,q.children=[{type:"text",content:O,tag:""}],a.pos=a.pos+z[0].length,m=a.pos;const ee=S.slice(B+z[0].length);ee&&F(ee);return}const L=a.push("text","",0);L.content=S,a.pos=a.pos+S.length,m=a.pos;return}const W=a.push("text","",0);W.content=S,a.pos=a.pos+S.length,m=a.pos};for(;!(m>=b.length);){const S=b.indexOf(g,m);if(S===-1)break;if(Df(b,S)){m=S+Math.max(1,g.length);continue}const B=Sm(A,S);if(B){m=B[1];continue}const W=Sm(I,S);if(W){m=W[1];continue}if(S===M&&m===$){if(N++,N>2){m=S+Math.max(1,g.length);continue}}else N=0,M=S,$=m;if(g==="("&&S>0){let ee=S-1;for(;ee>=0&&b[ee]===" ";)ee--;if(ee>=0&&b[ee]==="]"){m=S+g.length;continue}}if(g==="$"&&S>0&&b[S-1]==="$"){m=S+1;continue}if(g==="$"&&S<b.length-1&&b[S+1]==="$"){m=S+2;continue}const z=g==="$"?Bg(b,S+g.length):bZ(b,S+g.length,g,v);if(z===-1){const ee=b.slice(S+g.length);if(ee.includes(g)){m=b.indexOf(g,S+g.length);continue}if(z===-1){const le=g==="$"&&QZ(ee);if(u&&!c&&!le&&Cl(ee)&&!ee.includes("`")){if(m=S+g.length,T=!0,!l){a.pending="";const oe=y?b.slice(y,m):b.slice(0,m),re=eC(oe)%2===1;if(y)F(b.slice(y,m));else{let we=b.slice(0,m);we.endsWith(g)&&(we=we.slice(0,we.length-g.length)),F(we)}if(re){const we=tC(oe)?.marker??"**",me=a.push("strong_open","",0);me.markup=we;const Ee=a.push("math_inline","math",0);Ee.content=fl(ee,t),Ee.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",Ee.raw=`${g}${ee}${v}`,Ee.loading=!0,me.content=ee,a.push("strong_close","",0)}else{const we=a.push("math_inline","math",0);we.content=fl(ee,t),we.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",we.raw=`${g}${ee}${v}`,we.loading=!0}a.pos=b.length}m=b.length,y=m}break}}const L=b.slice(S+g.length,z),O=L.includes("`"),j=!L||!L.trim(),Z=g==="$",ie=b[z+v.length],U=Z&&Dg(L,ie),q=Z&&Pg(L);if(c?O||j||U||q:O||j||U||q||!Z&&!Cl(L)){m=z+v.length;const ee=b.slice(a.pos,m);a.pending||(F(ee),y=m);continue}if(T=!0,!l){const ee=b.slice(a.pos-(a.pending??"").length,S);let le=b.slice(0,m)?b.slice(y,S):ee;const oe=eC(le)%2===1;S!==a.pos&&oe&&(le=a.pending+b.slice(a.pos,S));const re=oe?tC(le):null,we=re?.marker??"**";if(a.pending!==le)if(a.pending="",oe)if(re){const me=le.slice(re.index+we.length);F(le.slice(0,re.index));const Ee=a.push("strong_open","",0);Ee.markup=we;const ae=a.push("text","",0);ae.content=me,a.push("strong_close","",0)}else F(le);else F(le);if(oe){const me=a.push("strong_open","",0);me.markup=we;const Ee=a.push("math_inline","math",0);Ee.content=fl(L,t),Ee.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",Ee.raw=`${g}${L}${v}`,Ee.loading=!1;const ae=b.slice(z+v.length).startsWith(we);return ae&&a.push("strong_close","",0),a.pos=d(b,z+v.length),m=a.pos,y=m,ae||a.push("strong_close","",0),!0}else{const me=a.push("math_inline","math",0);me.content=fl(L,t),me.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",me.raw=`${g}${L}${v}`,me.loading=!1}}return m=d(b,z+v.length),y=m,a.pos=m,!0}if(T){if(l)a.pos=m;else{if(g==="$$"&&m<b.length&&b.slice(m).includes("$")){let S=m;for(;!(S>=b.length);){const B=My(b,S);if(B===-1)break;if(B+1<b.length&&b[B+1]==="$"){S=B+2;continue}if(B>0&&b[B-1]==="$"){S=B+1;continue}const W=Bg(b,B+1);if(W===-1)break;const z=b.slice(B+1,W),L=z.includes("`"),O=!z||!z.trim(),j=b[W+1],Z=Dg(z,j),ie=Pg(z);if(!L&&!O&&!Z&&!ie){const U=b.slice(m,B);U&&F(U);const q=a.push("math_inline","math",0);q.content=fl(z,t),q.markup="$",q.raw=`$${z}$`,q.loading=!1,m=W+1,S=W+1}else F("$"),S=B+1}S<b.length&&F(b.slice(S))}else m<b.length&&F(b.slice(m));a.pos=b.length}return!0}}return!1},s=(r,l,a,c)=>{const u=r,d=!u?.env?.__markstreamFinal,f=t?.strictDelimiters,h=f?[["\\[","\\]"],["$$","$$"]]:[["\\[","\\]"],["[","]"],["$$","$$"]],p=u.bMarks[l]+u.tShift[l];let m=u.src.slice(p,u.eMarks[l]).trim(),y=!1,k="",g="",v=!1,b="",A=!1;for(const[U,q]of h)if(m.startsWith(U))if(U.includes("[")){const ee=U==="\\["?m.slice(U.length):"";if(U==="\\["&&Dc(ee,q)===-1&&!/^\s*!\[/.test(ee)&&!ee.includes("`")&&Cl(ee)){y=!0,k=U,g=q;break}if(t?.strictDelimiters){if(m.replace("\\","")==="["){if(l+1<a){y=!0,k=U,g=q;break}continue}}else if(m.replace("\\","")==="["){if(l+1<a){y=!0,k=U,g=q;break}continue}else{const le=u.tokens[u.tokens.length-1];if(le&&le.type==="list_item_open"&&le.mark==="-"&&m.slice(U.length,m.indexOf("]")).trim()==="x")continue;if(m.replace("\\","").startsWith("[")&&!m.includes("](")){const oe=m.indexOf("]");if(m.slice(oe).trim()!=="]")continue;const re=m.slice(U.length,oe);if(U==="["?nC(re):Cl(re)){y=!0,k=U,g=q;break}continue}}}else{y=!0,k=U,g=q;break}else if((U==="$$"||U==="\\[")&&m.endsWith(U)&&l+1<a){const ee=v2(m,U,q);if(ee===-1)continue;b=kf(m.slice(0,ee)),A=!0;const le=u.bMarks[l+1]+u.tShift[l+1];m=u.src.slice(le,u.eMarks[l+1]).trim(),v=!0,y=!0,k=U,g=q;break}if(!y)return!1;if(c&&!A)return!0;const I=m.indexOf(k),T=I+k.length,M=!f&&k==="["?m.indexOf("\\]",T):-1,$=M>=0?"\\]":g,N=M>=0?M:Dc(m,g,T);if(!v&&N>k.length){const U=m.slice(I+k.length,N),q=u.push("math_block","math",0);q.content=fl(U),q.markup=k==="$$"?"$$":k==="["?"[]":"\\[\\]",q.map=[l,l+1],q.raw=`${k}${U}${$}`,q.block=!0,q.loading=!1,u.line=l+1;const ee=m.slice(N+$.length);return ee.trim()&&n(u,ee,l),!0}let F=l,S="",B=!1,W="",z=l;const L=v?m:m===k?"":m.slice(k.length),O=!f&&k==="\\["?"]":"",j=Dc(L,g);if(j!==-1){const U=j;S=L.slice(0,U),W=L.slice(U+g.length),z=v?l+1:l,B=!0,F=z}else for(L&&!v&&(S=L),F=l+1;F<a;F++){const U=u.bMarks[F]+u.tShift[F],q=u.eMarks[F],ee=u.src.slice(U,q),le=ee.trim();if(!f&&k==="["&&le==="\\]"){g="\\]",B=!0;break}if(O&&ee.trim()===O){g=O,B=!0;break}if(le===g){B=!0;break}else if(!f&&k==="["&&ee.includes("\\]")){B=!0;const oe=ee.indexOf("\\]");g="\\]";const re=ee.slice(0,oe);re&&(S+=(S?`
|
|
192
|
-
`:"")+re),W=ee.slice(oe+g.length),z=F;break}else if(Dc(ee,g)!==-1){B=!0;const oe=Dc(ee,g),re=ee.slice(0,oe);re&&(S+=(S?`
|
|
193
|
-
`:"")+re),W=ee.slice(oe+g.length),z=F;break}S+=(S?`
|
|
194
|
-
`:"")+ee}if((!d||f)&&!B)return!1;const Z=/^\s*!\[/.test(S);if(!(A?!Z&&Ey(S):k==="$$"?!Z:k==="["?nC(S):Cl(S)))return!1;if(c)return!0;b&&n(u,b,l);const ie=u.push("math_block","math",0);return ie.content=fl(S),ie.markup=k==="$$"?"$$":k==="["?"[]":"\\[\\]",ie.raw=`${k}${S}${S.startsWith(`
|
|
195
|
-
`)?`
|
|
196
|
-
`:""}${g}`,ie.map=[l,F+1],ie.block=!0,ie.loading=!B,u.line=F+1,W.trim()&&n(u,W,z),!0},i=(r,l,a,c)=>{const u=r,d=u.bMarks[l]+u.tShift[l],f=u.src.slice(d,u.eMarks[l]).trim();return!f.startsWith("$$")&&!f.startsWith("\\[")?!1:s(r,l,a,c)};e.inline.ruler.before("escape","math",o),e.block.ruler.before("lheading","explicit_math_block",i,{alt:["paragraph","reference","blockquote","list"]}),e.block.ruler.before("paragraph","math_block",s,{alt:["paragraph","reference","blockquote","list"]})}function eX(e){const t=e.renderer.rules.image||function(n,o,s,i,r){const l=n,a=r;return a.renderToken?a.renderToken(l,o,s):""};e.renderer.rules.image=(n,o,s,i,r)=>{const l=n;return l[o].attrSet?.("loading","lazy"),t(l,o,s,i,r)},e.renderer.rules.fence=e.renderer.rules.fence||((n,o)=>{const s=n[o],i=String(s.info??"").trim();return`<pre class="${i?`language-${e.utils.escapeHtml(i.split(/\s+/g)[0])}`:""}"><code>${e.utils.escapeHtml(String(s.content??""))}</code></pre>`})}const tX=/^<a[>\s]/i,nX=/^<\/a\s*>/i;function oX(e,t){if(e?.type!=="inline")return!1;const n=e.children;if(!Array.isArray(n)||n.length===0)return t.pretest(String(e.content??""));let o=0;for(let s=n.length-1;s>=0;s--){const i=n[s];if(i?.type==="link_close"){for(s--;s>=0&&n[s]?.level!==i.level&&n[s]?.type!=="link_open";)s--;continue}if(i?.type==="html_inline"){const r=String(i.content??"");tX.test(r)&&o>0&&o--,nX.test(r)&&o++}if(!(o>0)&&i?.type==="text"&&t.pretest(String(i.content??"")))return!0}return!1}function sX(e){const t=e.core?.ruler,n=t.getNamedRules?.().find(o=>o.name==="linkify")?.fn;typeof n=="function"&&t.at("linkify",o=>{if(!o.md?.options?.linkify)return;const s=Array.isArray(o.tokens)?o.tokens:[],i=o.md.linkify;if(!i)return;const r=s.filter(l=>oX(l,i));if(r.length)return n(Object.assign(Object.create(Object.getPrototypeOf(o)),o,{tokens:r}))})}function iX(e){const t=e.inline.ruler,n=t.getNamedRules?.(),o=n?.find(l=>l.name==="link")?.fn,s=n?.find(l=>l.name==="image")?.fn;if(typeof o!="function"||typeof s!="function")return;const i=e.validateLink,r=e;r.__markstreamOriginalValidateLink=i,t.at("link",(...l)=>{const a=l[0].md,c=a?.validateLink===i?a.options?.validateLink:a?.validateLink;if(!a||typeof c!="function")return o(...l);const u=a.validateLink;a.validateLink=c;try{return o(...l)}finally{a.validateLink=u}}),t.at("image",(...l)=>{const a=l[0].md;if(!a)return s(...l);const c=a.validateLink;a.validateLink=i;try{return s(...l)}finally{a.validateLink=c}})}function rX(e={}){const t=e.markdownItOptions??{},n=typeof t.experimental=="object"&&t.experimental!==null?t.experimental:{},o=Object.prototype.hasOwnProperty.call(t,"stream")?!!t.stream:!0,s=Object.prototype.hasOwnProperty.call(t,"validateLink"),i=new OG({html:!0,linkify:!0,typographer:!0,...t,experimental:{stream:o,...n}});return s||i.set({validateLink:r=>!Ba(r,{tagName:"a",attrName:"href"})}),iX(i),sX(i),(e.enableMath??!0)&&JZ(i,{...e.mathOptions??{}}),(e.enableContainers??!0)&&tY(i),e.enableFixIndentedCodeBlock!==!1&&SY(i),sZ(i),aZ(i),rZ(i),fZ(i),eX(i),wY(i,{customHtmlTags:e.customHtmlTags}),i}function Da(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=>Da(n))),t}function lX(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function aX(e){const t=e,n=t.attrGet?t.attrGet("checked"):void 0,o=n===""||n==="true";return{type:"checkbox_input",checked:o,raw:o?"[x]":"[ ]"}}function cX(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function jh(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="em_close";){const l=e[i];s+=String(e[i].content??l.text??""),r.push(e[i]),i++}return o.push(...eo(r,void 0,void 0,n)),{node:{type:"emphasis",children:o,raw:`*${s}*`},nextIndex:i<e.length?i+1:e.length}}const aC=/\r?\n[ \t]*`+\s*$/,Z5=["diff ","index ","--- ","+++ ","@@ "],uX=/\r?\n/;function dX(e){const t=String(e??"");return t?Z5.some(n=>n.startsWith(t)||t.startsWith(n)):!1}function cC(e,t,n,o){n.length>0&&e.push(...n),o.length>0&&t.push(...o),n.length=0,o.length=0}function uC(e,t){return!t&&e.startsWith(" ")&&!e.startsWith(" ")?` ${e}`:e}function fX(e,t){const n=[],o=[],s=[],i=[],r=e.split(uX),l=/\r?\n$/.test(e),a=r.some(h=>h.startsWith("diff ")||h.startsWith("--- ")||h.startsWith("+++ ")||h.startsWith("@@ ")),c=h=>{const p=h;if(!Z5.some(m=>p.startsWith(m)))if(p.startsWith("-")){const m=p.slice(1);s.push(uC(m,a))}else if(p.startsWith("+")){const m=p.slice(1);i.push(uC(m,a))}else{cC(n,o,s,i);const m=a&&p.startsWith(" ")?p.slice(1):p;n.push(m),o.push(m)}},u=l?Math.max(0,r.length-1):r.length;for(let h=0;h<u;h++){const p=r[h]??"";!t&&!l&&h===u-1&&dX(p)||c(p)}(t||s.length>0||i.length>0)&&cC(n,o,s,i);const d=n.join(`
|
|
197
|
-
`),f=o.join(`
|
|
198
|
-
`);return{original:t&&l&&d?`${d}
|
|
199
|
-
`:d,updated:t&&l&&f?`${f}
|
|
200
|
-
`:f}}function y2(e){const t=Array.isArray(e.map)&&e.map.length===2,n=e.meta??{},o=typeof n.closed=="boolean"?n.closed:void 0,s=o===!0||o!==!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(aC.test(a)&&(a=a.replace(aC,"")),r){const{original:c,updated:u}=fX(a,s===!0);return{type:"code_block",language:l,code:String(u??""),raw:String(a??""),diff:r,loading:o===!0?!1:o===!1?!0:!t,originalCode:c,updatedCode:u}}return{type:"code_block",language:l,code:String(a??""),raw:String(a??""),diff:r,loading:o===!0?!1:o===!1?!0:!t}}function hX(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function pX(){return{type:"hardbreak",raw:`\\
|
|
201
|
-
`}}function mX(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="mark_close";)s+=String(e[i].content??""),r.push(e[i]),i++;return o.push(...eo(r,void 0,void 0,n)),{node:{type:"highlight",children:o,raw:`==${s}==`},nextIndex:i<e.length?i+1:e.length}}let Hg=null;const Wg=new WeakMap;function dC(){return Hg||(Hg={customTagSet:null,allowedTagSet:W1()}),Hg}function X5(e){const t=e.match(/^<\s*(?:\/\s*)?([\w-]+)/);return t?t[1].toLowerCase():""}function Q5(e){return/^<\s*\//.test(e)}function J5(e,t){return/\/\s*>\s*$/.test(t)||Hl.has(e)}function gX(e){if(!e||e.length===0)return dC();const t=Wg.get(e);if(t)return t;const n=e.map(Ti).filter(Boolean);if(!n.length){const s=dC();return Wg.set(e,s),s}const o={customTagSet:new Set(n),allowedTagSet:W1({customHtmlTags:e})};return Wg.set(e,o),o}function e8(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function vX(e){const t=e.meta,n=t?.markstreamCustomHtmlRaw,o=t?.markstreamCustomHtmlInner;return typeof n=="string"&&typeof o=="string"?{raw:n,inner:o}:null}function Cm(e,t){const n=t.toLowerCase();for(let o=e.length-1;o>=0;o--){const[s,i]=e[o];if(String(s).toLowerCase()===n)return i}}function yX(e,t,n){const o=e.slice();return Cm(o,"href")||o.push(["href",t]),n!=null&&!Cm(o,"title")&&o.push(["title",n]),o}function Ty(e){return e.map(e8).join("")}function Sp(e){const t=[],n=o=>{const s=String(o??"");if(!s)return;const i=t[t.length-1];if(i?.type==="text"){i.content=`${i.content}${s}`,i.raw=`${i.raw}${s}`;return}t.push({type:"text",content:s,raw:s})};for(const o of e)if(o){if(o.type==="reference"||o.type==="footnote_reference"){n(String(o.raw??""));continue}if("children"in o&&Array.isArray(o.children)){t.push({...o,children:Sp(o.children)});continue}t.push(o)}return t}function kX(e,t,n){let o=0;for(let s=t;s<e.length;s++){const i=e[s];if(i.type!=="html_inline")continue;const r=String(i.content??""),l=X5(r),a=Q5(r),c=J5(l,r);if(!a&&!c&&l===n){o++;continue}if(a&&l===n){if(o===0)return s;o--}}return-1}function zg(e,t,n){const o=[e[t]];let s=[],i=t+1,r=!1;const l=n?kX(e,t+1,n):-1;return l!==-1?(s=e.slice(t+1,l),o.push(...s,e[l]),i=l+1,r=!0):(s=e.slice(t+1),s.length&&o.push(...s),i=e.length),{closed:r,html:Ty(o),innerTokens:s,nextIndex:i}}function bX(e,t,n,o,s,i,r){const l=String(e.content??""),a=X5(l),{customTagSet:c,allowedTagSet:u}=gX(r?.customHtmlTags);if(!a)return[{type:"inline_code",code:l,raw:l},n+1];if(!u.has(a)&&!zg(t,n,a).closed){const A=e8(e);return[{type:"text",content:A,raw:A},n+1]}if(a==="br")return[{type:"hardbreak",raw:l},n+1];const d=Q5(l),f=J5(a,l);if(d)return[{type:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];if(a==="a"){const A=zg(t,n,a),I=R1(l),T=A.innerTokens,M=String(Cm(I,"href")??""),$=Cm(I,"title"),N=$==null?null:String($),F=yX(I,M,N),S=Sp(T.length?o(T,s,i,r):[]),B=T.length?Ty(T):M||"";return!S.length&&B&&S.push({type:"text",content:B,raw:B}),[{type:"link",href:M,title:N,text:B,attrs:F,children:S,loading:!A.closed,raw:A.html||l},A.nextIndex]}if(f)return[{type:c?.has(a)?a:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];const h=zg(t,n,a);if(a==="p"||a==="div")return[{type:"paragraph",children:Sp(h.innerTokens.length?o(h.innerTokens,s,i,r):[]),raw:h.html},h.nextIndex];const p=Sp(h.innerTokens.length?o(h.innerTokens,s,i,r):[]);let m=h.html||l,y=!h.closed,k=!1;if(!h.closed){const A=`</${a}>`;m.toLowerCase().includes(A.toLowerCase())||(m+=A),k=!0,y=!0}const g=[],v=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let b;for(;(b=v.exec(l))!==null;){const A=b[1],I=b[2]||b[3]||b[4]||"";g.push([A,I])}if(c?.has(a)){const A=vX(e);return[{type:a,tag:a,attrs:g,content:A?A.inner:h.innerTokens.length?Ty(h.innerTokens):"",children:h.innerTokens.length?o(h.innerTokens,s,i,r):[],raw:A?.raw??m,loading:e.loading||y,autoClosed:k},h.nextIndex]}return[{type:"html_inline",tag:a,attrs:g,content:m,children:p,raw:m,loading:y,autoClosed:k},h.nextIndex]}function t8(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=>t8(t)).join(""):String(e.content??"")}function xX(e){return!e||!Array.isArray(e.children)||e.children.length===0?"":e.children.map(t=>t8(t)).join("")}function fC(e,t=!1){let n=e.attrs??[],o=null;if((!n||n.length===0)&&Array.isArray(e.children))for(const d of e.children){const f=d.attrs;if(Array.isArray(f)&&f.length>0){n=f,o=d;break}}const s=String(n.find(d=>d[0]==="src")?.[1]??""),i=n.find(d=>d[0]==="alt")?.[1],r=xX(o??e);let l="";r?l=r:i!=null&&String(i).length>0?l=String(i):o?.content!=null&&String(o.content).length>0?l=String(o.content):Array.isArray(o?.children)&&o.children[0]?.content?l=String(o.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:s,alt:l,title:c,raw:u,loading:t}}function wX(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function _X(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="ins_close";)s+=String(e[i].content??""),r.push(e[i]),i++;return o.push(...eo(r,void 0,void 0,n)),{node:{type:"insert",children:o,raw:`++${String(s)}++`},nextIndex:i<e.length?i+1:e.length}}function SX(e){const t=[];if(!Array.isArray(e))return t;for(const n of e){const o=n?.[0];o&&t.push([String(o),String(n?.[1]??"")])}return t}function Am(e,t){const n=t.toLowerCase();for(let o=e.length-1;o>=0;o--){const[s,i]=e[o];if(String(s).toLowerCase()===n)return i}}function CX(e,t,n){const o=e.slice();return Am(o,"href")||o.push(["href",t]),n!=null&&!Am(o,"title")&&o.push(["title",n]),o}function Vh(e,t,n){const o=e[t],s=SX(o.attrs),i=String(Am(s,"href")??""),r=Am(s,"title"),l=r==null?null:String(r),a=CX(s,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 f=u;const h=u[u.length-1];if(n?.__insideStrong&&h?.type==="text"&&String(h.content??"").endsWith("**")&&!u.some(y=>y.type==="strong_open")){const y=String(h.content??""),k=String(h.raw??y),g=Da(h);g.content=y.slice(0,-2),g.raw=k.replace(/\*\*$/,""),f=u.slice(),f[f.length-1]=g}const p=eo(f,void 0,void 0,n),m=p.map(y=>{const k=y;return"content"in y?String(k.content??""):String(k.raw??"")}).join("");return{node:{type:"link",href:i,title:l,text:m,children:p,raw:`[${m}](${i}${l?` "${l}"`:""})`,loading:d,attrs:a},nextIndex:c<e.length?c+1:e.length}}function hC(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 AX(e){return{type:"reference",id:String(e.content??""),raw:String(e.markup??`[${e.content??""}]`)}}function pC(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="s_close";)s+=String(e[i].content??""),r.push(e[i]),i++;return o.push(...eo(r,void 0,void 0,n)),{node:{type:"strikethrough",children:o,raw:`~~${s}~~`},nextIndex:i<e.length?i+1:e.length}}const MX=/\\([\\()[\]`$|*_\-!])/g;function EX(e,t){if(!e)return;const n=String(e);if(n&&(n===t||n.replace(MX,"$1")===t))return n}function id(e,t,n,o){const s=[];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={...o,__insideStrong:!0};return s.push(...eo(l,EX(n,i),void 0,c)),{node:{type:"strong",children:s,raw:`**${String(i)}**`},nextIndex:r<e.length?r+1:e.length}}function TX(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="sub_close";)s+=String(e[i].content??""),r.push(e[i]),i++;o.push(...eo(r,void 0,void 0,n));const l=String(e[t].content??""),a=s||l;return{node:{type:"subscript",children:o.length>0?o:[{type:"text",content:a,raw:a}],raw:`~${a}~`},nextIndex:i<e.length?i+1:e.length}}function NX(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="sup_close";)s+=String(e[i].content??""),r.push(e[i]),i++;return o.push(...eo(r,void 0,void 0,n)),{node:{type:"superscript",children:o.length>0?o:[{type:"text",content:s||String(e[t].content??""),raw:s||String(e[t].content??"")}],raw:`^${s||String(e[t].content??"")}^`},nextIndex:i<e.length?i+1:e.length}}function IX(e){const t=String(e.content??"");return{type:"text",content:t,raw:t}}const LX=/[^~]*~{2,}[^~]+/,$X=/\*\*/,FX=/[[_*^~]/,OX=/\\([\\()[\]`$|*_\-!])/g,k2=new Set(["\\","(",")","[","]","`","$","|","*","_","-","!"]),RX=/\s/u,BX=/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/,DX=/\p{P}/u,PX=/^[《「『【〔〖〘〚〈([{“‘﹁﹃﹙﹛﹝]$/u,HX=/^[》」』】〕〗〙〛〉)]}”’﹂﹄﹚﹜﹞]$/u,WX=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,zX=/:\/\//,Ny=1,n8=2,UX=4,qX=8,o8=16,kl=32,Cp=64,kd=128,s8=256,jX=512,bd=1024,VX=1982;function Kh(e){let t=0;for(let n=0;n<e.length;n++)switch(e.charCodeAt(n)){case 33:t|=kd;break;case 36:t|=s8;break;case 40:t|=bd;break;case 42:t|=n8;break;case 91:t|=kl;break;case 92:t|=Ny;break;case 93:t|=Cp;break;case 95:t|=UX;break;case 96:t|=o8;break;case 124:t|=jX;break;case 126:t|=qX;break}return t}function KX(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 i8(e,t=0){if(!e)return-1;let n=0;for(let o=0;o<e.length;o++){const s=e[o],i=e[o+1];if(s==="\\"&&i&&k2.has(i)){if(i==="*"&&n>=t){n++,o++;continue}n++,o++;continue}if(s==="*"&&n>=t)return n;n++}return-1}function Wl(e){return!!e&&RX.test(e)}function zl(e){return!!e&&(BX.test(e)||DX.test(e))}function r8(e,t){return!!e&&!!t&&/^\p{Script=Han}$/u.test(t)&&PX.test(e)}function l8(e,t){return!!e&&!!t&&/^\p{Script=Han}$/u.test(t)&&HX.test(e)}function GX(e,t){const n=t>0?e[t-1]:void 0,o=e[t+1];return!o||Wl(o)?!1:!(zl(o)&&!r8(o,n)&&n&&!Wl(n)&&!zl(n))}function YX(e,t){const n=t>0?e[t-1]:void 0,o=e[t+1];return!n||Wl(n)?!1:!(zl(n)&&!l8(n,o)&&o&&!Wl(o)&&!zl(o))}function ZX(e,t,n=0){let o=n,s=!1;for(;o<t.length;){const i=e?i8(e,o):t.indexOf("*",o);if(i===-1)break;if(YX(t,i))return{index:i,sawInvalidClose:s};s=!0,o=i+1}return{index:-1,sawInvalidClose:s}}function XX(e,t){const n=t>0?e[t-1]:void 0,o=e[t+2];return!o||Wl(o)?!1:!(zl(o)&&!r8(o,n)&&n&&!Wl(n)&&!zl(n))}function QX(e,t){const n=t>0?e[t-1]:void 0,o=e[t+2];return!n||Wl(n)?!1:!(zl(n)&&!l8(n,o)&&o&&!Wl(o)&&!zl(o))}function JX(e,t=0){let n=t,o=!1;for(;n<e.length;){const s=e.indexOf("**",n);if(s===-1)break;if(QX(e,s))return{index:s,sawInvalidClose:o};o=!0,n=s+2}return{index:-1,sawInvalidClose:o}}function eQ(e){let t="",n=0;for(;n<e.length;){if(e[n]!=="\\"){t+=e[n],n++;continue}let o=0;for(;n+o<e.length&&e[n+o]==="\\";)o++;const s=e[n+o];if(t+="\\".repeat(Math.floor(o/2)),o%2===1){if(s&&k2.has(s)){t+=s,n+=o+1;continue}t+="\\"}n+=o}return t}function tQ(e,t){let n=0;for(let o=0;o<e.length;o++){const s=e[o],i=e[o+1];if(s==="\\"&&i&&k2.has(i)){if(n===t)return o+1;n++,o++;continue}if(n===t)return o;n++}return-1}function nQ(e,t,n){const o=tQ(e,t);if(o===-1||e[o]!==n)return!1;let s=0;for(let i=o-1;i>=0&&e[i]==="\\";i--)s++;return s%2===1}const oQ=/[\p{L}\p{N}]/u,sQ=/^[\p{L}\p{N}]+$/u;function Iy(e){return e?oQ.test(e):!1}function a8(e){return e?sQ.test(e):!1}function Pd(e,t){let n=t;for(;n<e.length&&e[n]==="*";)n++;const o=t>0?e[t-1]:void 0,s=n<e.length?e[n]:void 0;return{len:n-t,prev:o,next:s,intraword:Iy(o)&&Iy(s)}}function iQ(e){const t=[];for(let n=0;n<e.length;){if(e[n]!=="*"){n++;continue}const o=Pd(e,n),s=n+o.len;o.len>=2&&o.intraword&&t.push({start:n,end:s}),n=s}for(let n=0;n<t.length-1;n++){const o=t[n],s=t[n+1];if(!a8(e.slice(o.end,s.start)))return s.end}return-1}function rQ(e){return!!e&&e.trim()===e&&/^[\p{L}\p{N}\s]+$/u.test(e)}function lQ(e,t){let n=t;for(;n<e.length;){const o=e.indexOf("***",n);if(o===-1)return-1;const s=Pd(e,o);if(s.len>=3)return o;n=o+s.len}return-1}function aQ(e){return e?WX.test(e)||zX.test(e):!1}function cQ(e,t){if(!e||!t)return null;const n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function eo(e,t,n,o){if(!e||e.length===0)return[];const s=o?.__linkifyDemotionContext,i=Bf(t),r={filename:s?.filename||i.filename,explicitFilename:s?.explicitFilename||i.explicitFilename,marketTicker:s?.marketTicker||i.marketTicker};(r.filename||r.explicitFilename||r.marketTicker)&&(o={...o,__linkifyDemotionContext:r});const l=o,a=[];let c=null,u=0;const d=o?.requireClosingStrong,f=e;function h(){return e===f&&(e=e.slice()),e}function p(){c=null}function m(Y,Q){const P=e.length===1?t:String(Q.content??""),G=[],pe=iQ(Y);if(pe!==-1){A(Y.slice(0,pe),Y.slice(0,pe));const de=Y.slice(pe);return de&&(F({type:"text",content:de,raw:de}),u--),u++,!0}if(LX.test(Y)){const de=Y.indexOf("~~");de!==-1&&G.push({type:"strikethrough",index:de})}if($X.test(Y)){const de=Y.indexOf("**");de!==-1&&G.push({type:"strong",index:de})}if(/[^*]*\*[^*]+/.test(Y)){const de=P?i8(P,0):Y.indexOf("*");if(P&&de===-1)return!1;de!==-1&&G.push({type:"emphasis",index:de})}G.sort((de,V)=>de.index!==V.index?de.index-V.index:de.type===V.type?0:de.type==="strong"?-1:V.type==="strong"?1:0);const ve=G[0];if(!ve)return!1;if(ve.type==="strikethrough"){const de=ve.index,V=de>-1?Y.slice(0,de):"";if(V&&A(V,V),de===-1)return u++,!0;const se=Y.indexOf("~~",de+2),he=se===-1?Y.slice(de+2):Y.slice(de+2,se),ke=se===-1?"":Y.slice(se+2),{node:Te}=pC([{type:"s_open",tag:"s",content:"",markup:"~~",info:"",meta:null},{type:"text",tag:"",content:he,markup:"",info:"",meta:null},{type:"s_close",tag:"s",content:"",markup:"~~",info:"",meta:null}],0,o);return p(),b(Te),ke&&(F({type:"text",content:ke,raw:ke}),u--),u++,!0}if(ve.type==="strong"){const de=ve.index,V=de>-1?Y.slice(0,de):"";if(V&&A(V,V),de===-1)return u++,!0;if(t&&de===0){let ye=!1,be=0;for(;be<Y.length&&Y[be]==="*";)be++;if(t.startsWith("\\*")&&(ye=!0),ye){let Ge=0,tt=0;for(;tt<t.length&&Ge<be;)if(t[tt]==="\\"&&tt+1<t.length&&t[tt+1]==="*")Ge+=1,tt+=2;else{if(t[tt]==="*")break;tt++}if(Ge>=2)return A(Y,Y),u++,!0}}if(t&&(Y.match(/\*/g)||[]).length>KX(t))return A(Y.slice(V.length),Y.slice(V.length)),u++,!0;const se=Pd(Y,de);if(se.len>=3){const ye=lQ(Y,de+se.len);if(ye!==-1){const be=Y.slice(de+se.len,ye);if(rQ(be)){const{node:Ge}=id([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:be,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,o);p(),b(Ge);const tt=Y.slice(ye+3);return tt&&(F({type:"text",content:tt,raw:tt}),u--),u++,!0}}}if(!XX(Y,de)){const ye=Y.slice(de,de+se.len);A(ye,ye);const be=Y.slice(de+se.len);return be&&(F({type:"text",content:be,raw:be}),u--),u++,!0}const he=JX(Y,de+2);let ke="",Te="";if(he.index!==-1){ke=Y.slice(de+2,he.index),Te=Y.slice(he.index+2);const ye=he.index,be=Pd(Y,ye);if(se.intraword&&be.intraword&&!a8(ke)||!ke&&se.len>=4&&se.intraword)return A(Y.slice(V.length),Y.slice(V.length)),u++,!0}else{if(d||he.sawInvalidClose||se.intraword)return A(Y.slice(V.length),Y.slice(V.length)),u++,!0;ke=Y.slice(de+2),Te=""}if(!ke&&/^\*+$/.test(Te))return A(Y,Y),u++,!0;const{node:ze}=id([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"text",tag:"",content:ke,markup:"",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,o);return p(),b(ze),Te&&(F({type:"text",content:Te,raw:Te}),u--),u++,!0}if(ve.type==="emphasis"){let de=ve.index;de===-1&&(de=0);const V=Y.slice(0,de);if(V&&A(V,V),!GX(Y,de)){A(Y[de],Y[de]);const ye=Y.slice(de+1);return ye&&(F({type:"text",content:ye,raw:ye}),u--),u++,!0}const se=Pd(Y,de),he=ZX(P,Y,de+1),ke=he.index,Te=e[u+1];if(o?.final&&Te?.type==="em_open"&&ke!==-1&&Y.slice(de+1,ke).trim()!==Y.slice(de+1,ke)||ke===-1&&(he.sawInvalidClose||o?.final||se.intraword||!Iy(Y[de+1])))return A(Y.slice(de),Y.slice(de)),u++,!0;const{node:ze}=jh([{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:ke>-1?Y.slice(de+1,ke):Y.slice(de+1),markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null}],0,o);if(p(),b(ze),ke!==-1&&ke<Y.length-1){const ye=Y.slice(ke+1);ye&&(F({type:"text",content:ye,raw:ye}),u--)}return u++,!0}return!1}function y(Y,Q){if(!Y.includes("`"))return!1;const G=(Te=>{for(let ze=0;ze<Te.length;ze++){if(Te[ze]!=="`")continue;let ye=0;for(let be=ze-1;be>=0&&Te[be]==="\\";be--)ye++;if(ye%2===0)return ze}return-1})(Y);if(G===-1)return!1;let pe=1;for(let Te=G+1;Te<Y.length&&Y[Te]==="`";Te++)pe++;const ve="`".repeat(pe),de=G+pe,V=Y.indexOf(ve,de);if(V===-1){if(pe===1){const ze=Y.slice(0,G),ye=Y.slice(G+1);return ze&&(m(ze,Q)?u--:A(ze,ze)),g({type:"inline_code",code:ye,raw:String(ye)}),u++,!0}let Te=Y;for(let ze=u+1;ze<e.length;ze++)Te+=String((e[ze].content??"")+(e[ze].markup??""));return u=e.length-1,A(Te,Te),u++,!0}p();const se=Y.slice(0,G),he=Y.slice(G+pe,V),ke=Y.slice(V+pe);return se&&(m(se,Q)?u--:A(se,se)),g({type:"inline_code",code:he,raw:String(he??"")}),ke&&(F({type:"text",content:ke,raw:ke}),u--),u++,!0}function k(Y){const Q=l?.__markdownIt;if(!Q||e.length<=1||!e.some(ve=>ve?.type==="math_inline")||!FX.test(Y))return null;const P=Q.parseInline(Y,{__markstreamFinal:!!o?.final});if(!Array.isArray(P)||P.length===0)return null;const G=(P.find(ve=>ve?.type==="inline")?.children??[]).filter(ve=>!(ve?.type==="text"&&String(ve.content??"")===""));if(!G.length||!G.some(ve=>ve?.type!=="text")||G.length===1&&G[0]?.type==="text"&&String(G[0].content??"")===Y)return null;const pe=eo(G,Y,n,o);return pe.length?pe:null}function g(Y){p(),a.push(Y)}function v(Y){p();const Q=Da(Y);a.push(Q)}function b(Y){g(Y)}function A(Y,Q){c?(c.content+=Y,c.raw+=Q??Y):(c={type:"text",content:String(Y??""),raw:String(Q??Y??"")},a.push(c))}function I(Y,Q){if(!Y)return;const P=eo([{...Q,type:"text",content:Y,raw:Y}],Y,n,o);if(P.length===1&&P[0]?.type==="text"){const G=P[0];A(String(G.content??""),String(G.raw??G.content??""));return}for(const G of P)b(G)}function T(Y,Q){return String(Y.markup??"").startsWith(Q)}function M(Y){if(!c||Y.loading!==!0||Y.markup!=="\\(\\)")return;const Q=e[u-1];!Q||Q.type!=="text"||!T(Q,"\\(")||c.content.endsWith("(")&&(c.content=c.content.slice(0,-1),c.raw.endsWith("(")&&(c.raw=c.raw.slice(0,-1)),!c.content&&a[a.length-1]===c&&(a.pop(),c=null))}function $(Y){return Y.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 N(Y,Q,P=Kh(Y)){let G=Y;const pe=String(Q.content??"");return(P&Ny)!==0&&G.endsWith("\\")&&!T(Q,"\\\\")&&!pe.endsWith("\\\\")&&(G=G.slice(0,-1)),(P&bd)!==0&&G.endsWith("(")&&!T(Q,"\\(")&&!pe.endsWith("\\(")&&(G=G.slice(0,-1)),(P&n8)!==0&&/\*+$/.test(G)&&!T(Q,"\\*")&&!pe.endsWith("\\*")&&(G=G.replace(/\*+$/,"")),G}for(;u<e.length;){const Y=e[u];F(Y)}function F(Y){switch(Y.type){case"text":B(Y);break;case"softbreak":c?(c.content+=`
|
|
202
|
-
`,c.raw+=`
|
|
203
|
-
`):(c={type:"text",content:`
|
|
204
|
-
`,raw:`
|
|
205
|
-
`},a.push(c)),u++;break;case"code_inline":b(wX(Y)),u++;break;case"html_inline":{const[Q,P]=bX(Y,e,u,eo,t,n,o);b(Q),u=P;break}case"link_open":W(Y);break;case"image":le(Y)||(p(),b(fC(Y)),u++);break;case"strong_open":{p();const{node:Q,nextIndex:P}=id(e,u,Y.content,o);b(Q),u=P;break}case"em_open":{p();const{node:Q,nextIndex:P}=jh(e,u,o);b(Q),u=P;break}case"s_open":{p();const{node:Q,nextIndex:P}=pC(e,u,o);b(Q),u=P;break}case"mark_open":{p();const{node:Q,nextIndex:P}=mX(e,u,o);b(Q),u=P;break}case"ins_open":{p();const{node:Q,nextIndex:P}=_X(e,u,o);b(Q),u=P;break}case"sub_open":{p();const{node:Q,nextIndex:P}=TX(e,u,o);b(Q),u=P;break}case"sup_open":{p();const{node:Q,nextIndex:P}=NX(e,u,o);b(Q),u=P;break}case"sub":p(),b({type:"subscript",children:[{type:"text",content:String(Y.content??""),raw:String(Y.content??"")}],raw:`~${String(Y.content??"")}~`}),u++;break;case"sup":p(),b({type:"superscript",children:[{type:"text",content:String(Y.content??""),raw:String(Y.content??"")}],raw:`^${String(Y.content??"")}^`}),u++;break;case"emoji":{p();const Q=e[u-1];Q?.type==="text"&&/\|:-+/.test(String(Q.content??""))?A("",""):b(cX(Y)),u++;break}case"checkbox":p(),b(lX(Y)),u++;break;case"checkbox_input":p(),b(aX(Y)),u++;break;case"footnote_ref":p(),b(hX(Y)),u++;break;case"footnote_anchor":{p();const Q=Y.meta??{};g({type:"footnote_anchor",id:String(Q.label??Y.content??""),raw:String(Y.content??"")}),u++;break}case"hardbreak":p(),b(pX()),u++;break;case"fence":p(),b(y2(e[u])),u++;break;case"math_inline":M(Y),p(),!Y.content&&Y.markup==="$"&&e[u+1]?.type==="text"&&e[u+2]?.type==="math_inline"?(b(hC({...Y,content:e[u+1].content})),u+=2):b(hC(Y)),u++;break;case"reference":L(Y);break;case"text_special":A(String(Y.content??""),String(Y.content??"")),u++;break;default:{const Q=Y;if(Y.type==="link"&&Q.href!=null&&o?.validateLink&&!o.validateLink(String(Q.href))){p();const P=String(Q.text??"");A(P,P),u++}else oe(Y)||j(Y)||ie(Y)||O(Y)||v(Y),u++;break}}}function S(Y,Q,P,G,pe=Kh(Y)){const ve=IX({...Q,content:Y});if(c){c.content+=N(ve.content,Q,pe),c.raw+=ve.raw;return}const de=P?.tag==="br"&&e[u-2]?.content==="[";G||(ve.content=N(ve.content,Q,pe)),c=ve,c.center=de,a.push(c)}function B(Y){const Q=String(Y.content??""),P=Kh(Q),G=(P&Ny)!==0,pe=e.length===1&&G&&typeof t=="string"?String(t):"";let ve=pe?eQ(pe):G?Q.replace(OX,"$1"):Q;const de=ve===Q?P:Kh(ve);if(Y.content==="<"||ve==="1"&&e[u-1]?.tag==="br"){u++;return}const V=(de&s8)!==0?ve.indexOf("$"):-1;V!==-1&&V===ve.lastIndexOf("$")&&ve.endsWith("$")&&(ve=ve.slice(0,-1)),ve.endsWith("undefined")&&!t?.endsWith("undefined")&&(ve=ve.slice(0,-9));let se=a.length,he="";for(let ye=a.length-1;ye>=0;ye--){const be=a[ye];if(be.type!=="text")break;se=ye,he=String(be.content??"")+he}se<a.length&&(ve.startsWith(he)?(c=null,a.length=se):c=a[a.length-1]);const ke=e[u+1];if((ve==="`"||ve==="|"||ve==="$")&&!T(Y,`\\${ve}`)||/^\*+$/.test(ve)&&!T(Y,"\\*")){u++;return}if(!ke&&(de&bd)!==0&&/[^\]]\s*\(\s*$/.test(ve)&&(ve=ve.replace(/\(\s*$/,"")),!ve){u++;return}if((de&(kl|kd))===(kl|kd)&&ee(ve)||(de&(Cp|bd))===(Cp|bd)&&re(ve))return;if((de&VX)===0){S(ve,Y,e[u-1],ke,de),u++;return}if((de&kl)!==0&&ae(ve))return;const Te=e[u-1];if((de&kl)!==0&&ve==="["&&!ke?.markup?.includes("*")&&!T(Y,"\\[")||(de&Cp)!==0&&ve==="]"&&!Te?.markup?.includes("*")&&!T(Y,"\\]")){u++;return}if((de&o8)!==0&&y(Q,Y)||(de&(kd|kl))===(kd|kl)&&Ee(ve)||(de&kl)!==0&&(e[u+1]?.type!=="link_open"||$(ve))&&me(ve,Y))return;const ze=k(Q);if(ze){p();for(const ye of ze)b(ye);u++;return}m(ve,Y)||(S(ve,Y,Te,ke,de),u++)}function W(Y){if(z(Y))return;if(we()){const{node:V,nextIndex:se}=Vh(e,u,o),he=String(V.text||V.href||"");A(he,he),u=se;return}p();const{node:Q,nextIndex:P}=Vh(e,u,o);u=P;const G=Q.text||Q.href||"";if(Y.markup==="linkify"&&!B5(G,Q.href,t)&&wm(G,l?.__linkifyDemotionContext)){A(G,G);return}const pe=Q.children.length===1&&Q.children[0]?.type==="text";if(Q.loading&&t&&Q.text===Q.href&&pe){const V=cQ(t,Q.href);V&&(Q.text=V,Q.children=[{type:"text",content:V,raw:V}],Q.raw=`[${V}](${Q.href}${Q.title?` "${Q.title}"`:""})`)}if(o?.validateLink&&!o.validateLink(Q.href)){A(Q.text,Q.text);return}const ve=Y.attrs?.find(([V])=>V==="href")?.[1],de=String(ve??"");if(t&&de){const V=t.indexOf("](");if(V!==-1){const se=t.indexOf(")",V+2);se===-1?Q.loading=!0:Q.loading&&t.slice(V+2,se).includes(de)&&(Q.loading=!1)}}O(Q)||g(Q)}function z(Y){if(Y.markup!=="linkify")return!1;const{node:Q,nextIndex:P}=Vh(e,u,o);return Z(Q,P)?(u=P,!0):!1}function L(Y){p(),b(AX(Y)),u++}function O(Y){if(Y.type!=="link")return!1;const Q=a[a.length-1];if(!Q||Q.type!=="text")return!1;const P=String(Q.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!P)return!1;const G=Y,pe=String(G.href??""),ve=String(G.text??""),de=String(P[2]??""),V=pe.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!pe||!(ve===pe||ve===V||aQ(ve)))return!1;const se=String(P[1]??"");return se?(Q.content=se,Q.raw=se):a.pop(),g({...Y,text:de,children:[{type:"text",content:de,raw:de}],raw:`[${de}](${pe}${G.title?` "${G.title}"`:""})`}),!0}function j(Y){if(Y.type!=="link")return!1;const Q=Y,P=String(Q.href??"");return P?Z({href:P,title:Q.title==null||Q.title===""?null:String(Q.title),loading:!!Q.loading},u+1):!1}function Z(Y,Q){const P=a[a.length-1];if(P?.type!=="image"||P.src||!P.loading||!String(P.raw??"").endsWith("]("))return!1;const G=e[Q],pe=String(G?.content??"");if(G?.type!=="text"||!pe.startsWith(")"))return!1;a.pop(),c=null;const ve=String(P.alt??"");g({type:"image",src:Y.href,alt:ve,title:Y.title,raw:``,loading:!!Y.loading});const de=pe.slice(1),V=Da(G);return V.content=de,V.raw=de,h()[Q]=V,!0}function ie(Y){if(Y.type!=="link")return!1;const Q=a[a.length-1],P=e[u-1];if(!Q||Q.type!=="text"||P?.type!=="text")return!1;const G=String(Q.content??""),pe=String(P.content??"");if(!G.endsWith("!")||!pe.endsWith("!")||T(P,"\\!"))return!1;const ve=G.slice(0,-1);ve?(Q.content=ve,Q.raw=ve,c=Q):(a.pop(),c=null);const de=Y,V=String(de.text??de.children?.map(ke=>String(ke?.content??ke?.raw??"")).join("")??""),se=String(de.href??""),he=de.title==null||de.title===""?null:String(de.title);return g({type:"image",src:se,alt:V,title:he,raw:``,loading:!!de.loading}),!0}function U(Y,Q="",P=null){const G=String(Y.alt??Y.raw??"");return{type:"link",href:Q,title:P,text:G,children:[Y],raw:`[${G}](${Q}${P?` "${P}"`:""})`,loading:!0}}function q(Y){const Q=Y.startsWith(";return{type:"image",src:"",alt:G===-1?P.replace(/\]$/,""):P.slice(0,G),title:null,raw:Q,loading:!0}}function ee(Y){const Q=Y.indexOf("[![");if(Q===-1||typeof t=="string"&&e.length===1&&nQ(t,Q,"["))return!1;const P=Y.slice(0,Q);return P&&A(P,P),g(U(q(Y.slice(Q+1)))),u++,!0}function le(Y){if(o?.final)return!1;const Q=e[u-1];if(Q?.type!=="text"||!String(Q.content??"").endsWith("[")||T(Q,"\\["))return!1;const P=a[a.length-1];if(P?.type==="text"&&P.content.endsWith("[")){const G=P.content.slice(0,-1);G?(P.content=G,P.raw=G,c=P):(a.pop(),c=null)}return g(U(fC(Y))),u++,!0}function oe(Y){if(Y.type!=="link")return!1;const Q=Y,P=String(Q.raw??""),G=String(Q.text??"");if(!P.startsWith("[![")&&!G.startsWith("!["))return!1;const pe=Q.title==null||Q.title===""?null:String(Q.title);return g(U({type:"image",src:String(Q.href??""),alt:G.replace(/^!\[/,"").replace(/\]$/,""),title:pe,raw:P.startsWith("[)return!1;const Q=e[u-2];if(Q?.type==="text"&&String(Q.content??"").endsWith("[")&&T(Q,"\\["))return!1;const P=a[a.length-1];if(P?.type!=="image"&&P?.type!=="link")return!1;const G=P,pe=P?.type==="link"&&Array.isArray(G.children)&&G.children.length===1&&G.children[0]?.type==="image"?a.pop():null,ve=pe?pe.children[0]:a.pop();if(!ve||ve.type!=="image")return!1;const de=e[u+1];let V=String(pe?.href??""),se=pe?.title==null?null:String(pe.title),he=!0;if(de?.type==="link_open"){const{node:Te,nextIndex:ze}=Vh(e,u+1,o);V=Te.href,se=Te.title,he=!0,u=ze}else{if(V=Y.slice(2),V.includes('"')){const Te=V.split('"');V=String(Te[0]??"").trim(),se=Te[1]==null?null:String(Te[1]).trim()}u++}const ke=U(ve,V,se);return ke.loading=he,g(ke),!0}function we(){const Y=e[u-3];return e[u-2]?.type==="image"&&e[u-1]?.type==="text"&&String(e[u-1].content??"")==="]("&&Y?.type==="text"&&String(Y.content??"").endsWith("[")&&T(Y,"\\[")}function me(Y,Q){const P=Y.indexOf("[");if(P===-1)return!1;let G=Y.slice(0,P);const pe=Y.indexOf("](",P);if(pe!==-1){const ve=e[u+2];let de=Y.slice(P+1,pe);if(de.includes("[")){const ye=de.indexOf("[");G+=Y.slice(0,P+ye+1);const be=P+ye+1;de=Y.slice(be+1,pe)}const V=e[u+1];if(Y.endsWith("](")&&V?.type==="link_open"&&ve){const ye=e[u+4];let be=4,Ge=!0;if(ye?.type==="text"){const rt=String(ye.content??"");if(rt.startsWith(")")){Ge=!1;const ut=rt.slice(1);if(ut){const vt=Da(ye);vt.content=ut,vt.raw=ut,h()[u+4]=vt}else be++}else rt==="."&&be++}I(G,Q);const tt=String(ve.content??"");return o?.validateLink&&!o.validateLink(tt)?A(de,de):g({type:"link",href:tt,title:null,text:de,children:[{type:"text",content:de,raw:de}],loading:Ge}),u+=be,!0}const se=Y.indexOf(")",pe),he=se!==-1?Y.slice(pe+2,se):"",ke=se===-1;let Te=G.match(/\*+$/);if(Te&&(G=G.replace(/\*+$/,"")),I(G,Q),Te||(Te=de.match(/^\*+/)),!d&&Te){const ye=Te[0].length;de=de.replace(/^\*+/,"").replace(/\*+$/,"");const be=[];if(ye===1?be.push({type:"em_open",tag:"em",nesting:1}):ye===2?be.push({type:"strong_open",tag:"strong",nesting:1}):ye===3&&(be.push({type:"strong_open",tag:"strong",nesting:1}),be.push({type:"em_open",tag:"em",nesting:1})),be.push({type:"link",href:he,title:null,text:de,children:[{type:"text",content:de,raw:de}],loading:ke}),ye===1){be.push({type:"em_close",tag:"em",nesting:-1});const{node:Ge}=jh(be,0,o);b(Ge)}else if(ye===2){be.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Ge}=id(be,0,void 0,o);b(Ge)}else if(ye===3){be.push({type:"em_close",tag:"em",nesting:-1}),be.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Ge}=id(be,0,void 0,o);b(Ge)}else{const{node:Ge}=jh(be,0,o);b(Ge)}}else o?.validateLink&&!o.validateLink(he)?A(de,de):g({type:"link",href:he,title:null,text:de,children:[{type:"text",content:de,raw:de}],loading:ke});const ze=se!==-1?Y.slice(se+1):"";return ze&&(F({type:"text",content:ze,raw:ze}),u--),u++,!0}return!1}function Ee(Y){const Q=Y.indexOf("![");if(Q===-1)return!1;const P=Y.slice(0,Q);return P&&!c?c={type:"text",content:P,raw:P}:P&&c&&(c.content+=P),c&&(a.push(c),c=null),g(q(Y.slice(Q))),u++,!0}function ae(Y){if(!(Y?.startsWith("[")&&n?.type==="list_item_open"))return!1;const Q=Y.slice(1).match(/[^\s\]]/);if(Q===null)return u++,!0;if(Q&&/x/i.test(Q[0])){const P=Q[0]==="x"||Q[0]==="X";return g({type:"checkbox_input",checked:P,raw:P?"[x]":"[ ]"}),u++,!0}return!1}return a}function b2(e,t,n){const o=n?.__sourceLineMapper;if(!o)return{startLine:e,endLine:t};const s=o(e),i=t>e?o(t-1).endLine:o(t).startLine;return{startLine:s.startLine,endLine:Math.max(s.startLine,i)}}function mC(e,t){const n=Math.max(0,Math.min(e.length,Math.trunc(t)));let o=0;for(let s=0;s<n;s++)e[s]===`
|
|
206
|
-
`&&o++;return o}function uQ(e,t,n){const o=Math.max(0,Math.min(e.length,Math.trunc(t))),s=Math.max(o,Math.min(e.length,Math.trunc(n))),i=mC(e,o);let r=mC(e,s);return s>o&&e[s-1]!==`
|
|
207
|
-
`&&r++,{startLine:i,endLine:r}}function B1(e,t,n,o){const s=uQ(e,t,n);return b2(s.startLine,s.endLine,o)}function dQ(e,t){const n=e?.map;if(!Array.isArray(n)||n.length<2)return null;const o=Number(n[0]),s=Number(n[1]);return!Number.isFinite(o)||!Number.isFinite(s)?null:b2(o,s,t)}function pn(e,t,n){if(!n?.includeSourceMap)return e;const o=dQ(t,n);if(!o)return e;if(e.sourceMap=o,e.type==="code_block"){const s=e;s.startLine=o.startLine,s.endLine=o.endLine}return e}function fQ(e,t,n,o){if(!o?.includeSourceMap)return e;const s=t?.map;if(!Array.isArray(s)||s.length<2)return e;const i=Number(s[0]),r=Number(s[1]),l=Number(n);return!Number.isFinite(i)||!Number.isFinite(r)||!Number.isFinite(l)||(e.sourceMap=b2(i,Math.max(r,l),o)),e}function hQ(e){const t=String(e.content??""),n=t.replace(/[ \t\r\n]+$/g,"");if(n===t)return;e.content=n;const o=e.children;if(!(!Array.isArray(o)||o.length===0))for(;o.length;){const s=o[o.length-1];if(!s){o.pop();continue}if(s.type==="softbreak"||s.type==="hardbreak"){o.pop();continue}if(s.type==="text"){const i=String(s.content??""),r=i.replace(/[ \t\r\n]+$/g,"");if(r===i)break;if(r){s.content=r;break}o.pop();continue}break}}function pQ(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 o=e.children;if(!(!Array.isArray(o)||o.length===0))for(;o.length;){const s=o[o.length-1];if(!s){o.pop();continue}if(s.type==="softbreak"||s.type==="hardbreak"){o.pop();continue}if(s.type==="text"){const i=String(s.content??"");if(/^[ \t\r\n\d.)]*$/.test(i)){o.pop();continue}const r=i.replace(/[ \t\r\n\d.)]+$/g,"");r!==i&&(r?s.content=r:o.pop())}break}}function mQ(e){const t=String(e.content??"");return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function Cu(e,t,n){const o=e[t],s=[],i=Gl(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 a=[];let c=r+1;for(;c<e.length&&e[c].type!=="list_item_close";)if(e[c].type==="paragraph_open"){const d=e[c+1],f=mQ(d)?Da(d):d,h=e[c-1];f!==d&&(pQ(f),hQ(f));const p=String(f.content??""),m={type:"paragraph",children:eo(f.children||[],p,h,i.options()),raw:p};n?.includeSourceMap&&pn(m,e[c],n),a.push(m),i.remember(p),c+=3}else if(e[c].type==="blockquote_open"){const[d,f]=Au(e,c,i.options());a.push(d),i.remember(d.raw),c=f}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[d,f]=Cu(e,c,i.options());a.push(d),i.remember(d.raw),c=f}else{const d=w2(e,c,i.options(),x2);d?(a.push(d[0]),i.remember(d[0].raw),c=d[1]):c+=1}const u={type:"list_item",children:a,raw:a.map(d=>d.raw).join("")};n?.includeSourceMap&&pn(u,e[r],n),s.push(u),r=c+1}else r+=1;const l={type:"list",ordered:o.type==="ordered_list_open",start:(()=>{if(o.attrs&&o.attrs.length){const a=o.attrs.find(c=>c[0]==="start");if(a){const c=Number(a[1]);return Number.isFinite(c)&&c!==0?c:1}}})(),items:s,raw:s.map(a=>a.raw).join(`
|
|
208
|
-
`)};return n?.includeSourceMap&&pn(l,o,n),[l,r+1]}function gQ(e,t,n,o){const s=String(n[1]??"note"),i=String(n[2]??s.charAt(0).toUpperCase()+s.slice(1)),r=[],l=Gl(o,!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:eo(c.children||[],String(c.content??""),void 0,l.options()),raw:String(c.content??"")};o?.includeSourceMap&&pn(u,e[a],o),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]=Cu(e,a,l.options());o?.includeSourceMap&&pn(c,e[a],o),r.push(c),l.remember(c.raw),a=u}else if(e[a].type==="blockquote_open"){const[c,u]=Au(e,a,l.options());o?.includeSourceMap&&pn(c,e[a],o),r.push(c),l.remember(c.raw),a=u}else{const c=D1(e,a,l.options());c?(r.push(c[0]),l.remember(c[0].raw),a=c[1]):a++}return[{type:"admonition",kind:s,title:i,children:r,raw:`:::${s} ${i}
|
|
209
|
-
${r.map(c=>c.raw).join(`
|
|
210
|
-
`)}
|
|
211
|
-
:::`},a+1]}const vQ=new Set(["warning","info","note","tip","danger","caution"]);function yQ(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 o=n.search(/\s/),s=(o===-1?n:n.slice(0,o)).toLowerCase();return vQ.has(s)?{kind:s,title:o===-1?"":n.slice(o).trim()}:null}function kQ(e,t,n){const o=e[t];let s="note",i="";const r=o.type.match(/^container_(\w+)_open$/);if(r){s=r[1];const d=String(o.info??"").trim();if(d&&!d.startsWith(":::")&&d.toLowerCase().startsWith(s)){const f=d.slice(s.length).trim();f&&(i=f)}}else{const d=yQ(String(o.info??"").trim());d&&(s=d.kind,i=d.title)}i||(i=s.charAt(0).toUpperCase()+s.slice(1));const l=[],a=Gl(n,!0);let c=t+1;const u=new RegExp(`^container_${s}_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 f=d.children||[];let h=-1;for(let m=f.length-1;m>=0;m--){const y=f[m];if(y.type==="text"&&/:+/.test(y.content)){h=m;break}}const p={type:"paragraph",children:eo((h!==-1?f.slice(0,h):f)||[],void 0,void 0,a.options()),raw:String(d.content??"").replace(/\n:+$/,"").replace(/\n\s*:::\s*$/,"")};n?.includeSourceMap&&pn(p,e[c],n),l.push(p),a.remember(p.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[d,f]=Cu(e,c,a.options());n?.includeSourceMap&&pn(d,e[c],n),l.push(d),a.remember(d.raw),c=f}else if(e[c].type==="blockquote_open"){const[d,f]=Au(e,c,a.options());n?.includeSourceMap&&pn(d,e[c],n),l.push(d),a.remember(d.raw),c=f}else{const d=D1(e,c,a.options());d?(l.push(d[0]),a.remember(d[0].raw),c=d[1]):c++}return[{type:"admonition",kind:s,title:i,children:l,raw:`:::${s} ${i}
|
|
212
|
-
${l.map(d=>d.raw).join(`
|
|
213
|
-
`)}
|
|
214
|
-
:::`},c+1]}const bQ=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function xQ(e,t,n){const o=e[t];if(o.type!=="container_open")return null;const s=bQ.exec(String(o.info??""));return s?gQ(e,t,s,n):null}const x2={parseContainer:(e,t,n)=>kQ(e,t,n),matchAdmonition:xQ};function Au(e,t,n){const o=[],s=Gl(n,!0);let i=t+1;for(;i<e.length&&e[i].type!=="blockquote_close";){const l=e[i];switch(l.type){case"paragraph_open":{const a=e[i+1],c={type:"paragraph",children:eo(a.children||[],String(a.content??""),void 0,s.options()),raw:String(a.content??"")};n?.includeSourceMap&&pn(c,l,n),o.push(c),s.remember(c.raw),i+=3;break}case"bullet_list_open":case"ordered_list_open":{const[a,c]=Cu(e,i,s.options());o.push(a),s.remember(a.raw),i=c;break}case"blockquote_open":{const[a,c]=Au(e,i,s.options());o.push(a),s.remember(a.raw),i=c;break}default:{const a=w2(e,i,s.options(),x2);a?(o.push(a[0]),s.remember(a[0].raw),i=a[1]):i++;break}}}const r={type:"blockquote",children:o,raw:o.map(l=>l.raw).join(`
|
|
215
|
-
`)};return n?.includeSourceMap&&pn(r,e[t],n),[r,i+1]}function wQ(e){if(e.info?.startsWith("diff"))return y2(e);const t=String(e.content??""),n=t.match(/ type="application\/vnd\.ant\.([^"]+)"/);let o=t;n?.[1]&&(o=t.replace(/<antArtifact[^>]*>/g,"").replace(/<\/antArtifact>/g,""));const s=Array.isArray(e.map)&&e.map.length===2;return{type:"code_block",language:n?n[1]:String(e.info??""),code:o,raw:o,loading:!s}}function _Q(e,t,n){const o=[];let s=t+1,i=[],r=[];const l=Gl(n,!0);for(;s<e.length&&e[s].type!=="dl_close";)if(e[s].type==="dt_open"){const a=e[s+1];i=eo(a.children||[],void 0,void 0,l.options()),l.remember(i.map(c=>c.raw).join("")),s+=3}else if(e[s].type==="dd_open"){let a=s+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:eo(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&&(o.push({type:"definition_item",term:i,definition:r,raw:`${i.map(c=>c.raw).join("")}: ${r.map(c=>c.raw).join(`
|
|
216
|
-
`)}`}),i=[]),s=a+1}else s++;return[{type:"definition_list",items:o,raw:o.map(a=>a.raw).join(`
|
|
217
|
-
`)},s+1]}function SQ(e,t,n){const o=e[t].meta??{},s=String(o?.label??"0"),i=[],r=Gl(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:eo(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:s,children:i,raw:`[^${s}]: ${i.map(a=>a.raw).join(`
|
|
218
|
-
`)}`},l+1]}function CQ(e,t,n){const o=e[t],s=o.attrs,i=Array.isArray(s)&&s.length?Object.fromEntries(s.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(o.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:eo(a.children||[],c,void 0,n),raw:c}}function AQ(e,t,n){const o=t.toLowerCase(),s=new RegExp(String.raw`^<\s*${o}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${o}(?=\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=io(c);if(u===-1)return-1;if(r===0)return a+u+1;r--,l=a+u+1;continue}if(s.test(c)){const u=io(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 c8(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 o=io(t),s=o===-1?t:t.slice(0,o+1),i=o!==-1&&/\/\s*>$/.test(s),r=Hl.has(n),l=R1(s),a=(o===-1?-1:AQ(t,n,o+1))!==-1,c=!(r||i||a);return{type:"html_block",content:c?`${t.replace(/<[^>]*$/,"")}
|
|
219
|
-
</${n}>`:t,raw:t,tag:n,attrs:l.length?l:void 0,loading:c}}function MQ(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 EQ(e){if(!e)return"left";for(const t of e){if(!t)continue;const[n,o]=t;if(!o)continue;const s=String(o).trim().toLowerCase();if(n==="style"){const i=/text-align\s*:\s*(left|right|center)/i.exec(s);if(i)return i[1].toLowerCase()}}return"left"}function u8(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function d8(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return u8(n)?n:void 0}function TQ(e,t,n){const o=d8(Bf(t),n);if(!u8(o))return e;const s=e?.__linkifyDemotionContext;return{...e,__linkifyDemotionContext:{filename:s?.filename||o?.filename,explicitFilename:s?.explicitFilename||o?.explicitFilename,marketTicker:s?.marketTicker||o?.marketTicker}}}function NQ(e,t,n){let o=t+1,s=null;const i=[];let r=!1;for(;o<e.length&&e[o].type!=="table_close";)if(e[o].type==="thead_open")r=!0,o++;else if(e[o].type==="thead_close")r=!1,o++;else if(e[o].type==="tbody_open"||e[o].type==="tbody_close")o++;else if(e[o].type==="tr_open"){const a=[];let c=o+1,u;for(;c<e.length&&e[c].type!=="tr_close";)if(e[c].type==="th_open"||e[c].type==="td_open"){const f=e[c].type==="th_open",h=e[c+1],p=String(h.content??""),m=EQ(e[c].attrs),y=a.length,k=!f&&!r,g=k?s?.cells[y]?.raw:void 0;a.push({type:"table_cell",header:f||r,children:eo(h.children||[],p,void 0,TQ(n,g,k?u:void 0)),raw:p,align:m}),k&&(u=d8(u,Bf(p))),c+=3}else c++;const d={type:"table_row",cells:a,raw:a.map(f=>f.raw).join("|")};r?s=d:i.push(d),o=c+1}else o++;s||(s={type:"table_row",cells:[],raw:""});const l=e[t].loading===!0;return[{type:"table",header:s,rows:i,loading:l&&!n?.final&&i.length===0,raw:[s,...i].map(a=>a.raw).join(`
|
|
220
|
-
`)},o+1]}function IQ(){return{type:"thematic_break",raw:"---"}}let Ug=null;const qg=new WeakMap;function gC(){return Ug||(Ug={allowedTagSet:W1(),customTagSet:null}),Ug}function LQ(e){if(!e||e.length===0)return gC();const t=qg.get(e);if(t)return t;const n=e.map(Ti).filter(Boolean);if(!n.length){const s=gC();return qg.set(e,s),s}const o={allowedTagSet:W1({customHtmlTags:e}),customTagSet:new Set(n)};return qg.set(e,o),o}function $Q(e,t,n){const o=e[t],s=o.attrs;let i="";const r={};if(s){for(const[h,p]of s)if(h==="class"){const m=p.match(/(?:\s|^)vmr-container-(\S+)/);m&&(i=m[1])}else if(h.startsWith("data-")){const m=h.slice(5);try{r[m]=JSON.parse(p)}catch{r[m]=p}}}const l=[],a=Gl(n,!0);let c=t+1;for(;c<e.length&&e[c].type!=="vmr_container_close";)if(e[c].type==="paragraph_open"){const h=e[c+1];if(h){const p={type:"paragraph",children:eo(h.children||[],void 0,void 0,a.options()),raw:String(h.content??"")};n?.includeSourceMap&&pn(p,e[c],n),l.push(p),a.remember(p.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[h,p]=Cu(e,c,a.options());n?.includeSourceMap&&pn(h,e[c],n),l.push(h),a.remember(h.raw),c=p}else if(e[c].type==="blockquote_open"){const[h,p]=Au(e,c,a.options());n?.includeSourceMap&&pn(h,e[c],n),l.push(h),a.remember(h.raw),c=p}else{const h=D1(e,c,a.options());h?(l.push(h[0]),a.remember(h[0].raw),c=h[1]):c++}const u=c<e.length&&e[c].type==="vmr_container_close",d=u&&o.meta?.unclosed!==!0||!!n?.final;let f=`::: ${i}`;return Object.keys(r).length>0&&(f+=` ${JSON.stringify(r)}`),f+=`
|
|
221
|
-
`,l.length>0&&(f+=o.raw??l.map(h=>h.raw).join(`
|
|
222
|
-
`),f+=`
|
|
223
|
-
`),f+=":::",[{type:"vmr_container",name:i,loading:!d,attrs:Object.keys(r).length>0?r:void 0,children:l,raw:f},u?c+1:c]}function jg(e,t,n,o){if(n?.type.endsWith("_close")){let s=Array.isArray(n.map)?Number(n.map[1]):NaN;return Number.isFinite(s)||(s=Array.isArray(t.map)?Number(t.map[1])+1:NaN),fQ(e,t,s,o)}return pn(e,t,o)}function FQ(e){return e.replace(/^\r?\n/,"").replace(/\r?\n$/,"")}function OQ(e,t){if(!e||!t)return e;const n=new RegExp(String.raw`[\t ]*<\s*\/\s*${t}[^>]*$`,"i");return e.replace(n,"")}function RQ(e,t,n){if(!e||!t)return null;const o=t.toLowerCase(),s=new RegExp(String.raw`^<\s*${Ki(o)}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${Ki(o)}(?=\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=io(c);if(u===-1)return null;if(r===0)return{start:a,end:a+u+1};r--,l=a+u+1;continue}if(s.test(c)){const u=io(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 BQ(e,t,n){if(!e||!t)return null;const o=t.toLowerCase(),s=new RegExp(String.raw`<\s*${o}(?=\s|>|/)`,"gi");s.lastIndex=Math.max(0,n||0);const i=s.exec(e);if(!i||i.index==null)return null;const r=i.index,l=e.slice(r),a=io(l);if(a===-1)return null;const c=r+a;if(/\/\s*>\s*$/.test(l.slice(0,a+1))){const p=c+1;return{raw:e.slice(r,p),start:r,end:p}}let u=1,d=c+1;const f=p=>{const m=e.slice(p);return new RegExp(String.raw`^<\s*${o}(?=\s|>|/)`,"i").test(m)},h=p=>{const m=e.slice(p);return new RegExp(String.raw`^<\s*\/\s*${o}(?=\s|>)`,"i").test(m)};for(;d<e.length;){const p=e.indexOf("<",d);if(p===-1)return{raw:e.slice(r),start:r,end:e.length};if(h(p)){const m=e.indexOf(">",p);if(m===-1)return null;if(u--,u===0){const y=m+1;return{raw:e.slice(r,y),start:r,end:y}}d=m+1;continue}if(f(p)){const m=io(e.slice(p));if(m===-1)return null;u++,d=p+m+1;continue}d=p+1}return{raw:e.slice(r),start:r,end:e.length}}function Ly(e){return Number.isFinite(e)&&e>0?e:0}function DQ(e,t){const n=Ly(t);if(!e||n<=0)return 0;let o=0;for(let s=0;s<e.length;s++)if(e[s]===`
|
|
224
|
-
`&&(o++,o===n))return s+1;return e.length}function D1(e,t,n){const o=e[t],s=n?.includeSourceMap===!0;switch(o.type){case"heading_open":{const i=CQ(e,t,n);return s&&pn(i,o,n),[i,t+3]}case"code_block":{const i=wQ(o);return s&&pn(i,o,n),[i,t+1]}case"fence":{const i=y2(o);return s&&pn(i,o,n),[i,t+1]}case"math_block":{const i=MQ(o);return s&&pn(i,o,n),[i,t+1]}case"html_block":{const i=c8(o),r=i.tag?LQ(n?.customHtmlTags):null;if(i.tag&&i.loading&&r&&!r.allowedTagSet.has(i.tag)){const l=String(o.content??"").replace(/\n+$/,""),a={type:"paragraph",children:l?[{type:"text",content:l,raw:l}]:[],raw:l};return s&&pn(a,o,n),[a,t+1]}if(i.tag&&r?.customTagSet?.has(i.tag)){const l=i.tag,a=String(n?.__sourceMarkdown??""),c=Number(n?.__customHtmlBlockCursor??0),u=Array.isArray(o.map)?DQ(a,Number(o.map?.[0]??0)):0,d=BQ(a,l,Math.max(Ly(c),Ly(u)));d&&n&&(n.__customHtmlBlockCursor=d.end);const f=String(d?.raw??i.raw??""),h=io(f),p=h!==-1?f.slice(0,h+1):f,m=h!==-1&&/\/\s*>\s*$/.test(p),y=h===-1?null:RQ(f,l,h+1),k=y?.start??-1;let g="";h!==-1&&(k!==-1&&h<k?g=f.slice(h+1,k):g=f.slice(h+1)),k===-1&&(g=OQ(g,l));const v=[],b=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let A;for(;(A=b.exec(p))!==null;){const M=A[1];if(!M||M.toLowerCase()===l)continue;const $=A[2]||A[3]||A[4]||"";v.push([M,$])}const I=!n?.final&&!m&&y==null,T={type:l,tag:l,content:FQ(g),raw:String(d?.raw??i.raw??f),loading:I,attrs:v.length?v:void 0};return s&&(d?T.sourceMap=B1(a,d.start,d.end,n):pn(T,o,n)),[T,t+1]}return s&&pn(i,o,n),[i,t+1]}case"table_open":{const[i,r]=NQ(e,t,n);return s&&pn(i,o,n),[i,r]}case"dl_open":{const[i,r]=_Q(e,t,n);return s&&pn(i,o,n),[i,r]}case"footnote_open":{const[i,r]=SQ(e,t,n);return s&&pn(i,o,n),[i,r]}case"hr":{const i=IQ();return s&&pn(i,o,n),[i,t+1]}}return null}function w2(e,t,n,o){const s=D1(e,t,n);if(s)return s;const i=e[t],r=n?.includeSourceMap===!0;switch(i.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(o?.parseContainer){const l=o.parseContainer(e,t,n);return r&&jg(l[0],i,e[l[1]-1],n),l}break;case"container_open":if(o?.matchAdmonition){const l=o.matchAdmonition(e,t,n);if(l)return r&&jg(l[0],i,e[l[1]-1],n),l}break;case"vmr_container_open":{const l=$Q(e,t,n);return r&&jg(l[0],i,e[l[1]-1],n),l}}return null}function PQ(){return{type:"hardbreak",raw:`\\
|
|
225
|
-
`}}function HQ(e,t,n){const o=e[t+1],s=String(o.content??"");return{type:"paragraph",children:eo(o.children||[],s,void 0,n),raw:s}}const vC=new WeakMap,f8=new WeakMap,yC=new WeakMap,kC=new WeakMap;function nr(e,t,n){const o=t?.map,s=n?.__sourceMarkdown;if(!Array.isArray(o)||o.length<2||typeof s!="string"||!n)return;const i=Number(o[0]),r=Number(o[1]);if(!Number.isFinite(i)||!Number.isFinite(r))return;let l=yC.get(n);if(!l){l=[0];for(let a=0;a<s.length;a++)s[a]===`
|
|
226
|
-
`&&l.push(a+1);yC.set(n,l)}f8.set(e,{start:l[Math.max(0,Math.trunc(i))]??s.length,end:l[Math.max(0,Math.trunc(r))]??s.length})}const P1=new WeakMap,bC=new WeakMap,WQ=["$$","\\["],zQ=/(^|\r?\n)[\t ]*:::[\t ]*(?:warning|info|note|tip|danger|caution|error)(?=[\t ]|\r?\n|$)[^\r\n]*(?:\r?\n[\t ]*)*$/,Mm=new WeakMap,xd=new WeakMap,UQ=new Set(["code_inline","em_close","em_open","emoji","hardbreak","ins_close","ins_open","mark_close","mark_open","s_close","s_open","softbreak","strong_close","strong_open","sub","sup","text"]),qQ=new Map([["paragraph_open","paragraph_close"],["heading_open","heading_close"],["bullet_list_open","bullet_list_close"],["ordered_list_open","ordered_list_close"],["blockquote_open","blockquote_close"],["table_open","table_close"]]),jQ=new Set(["code_block","fence","hr","math_block"]);function ku(){return typeof performance<"u"?performance.now():Date.now()}function bf(e,t,n){e&&(e[t]=(e[t]??0)+n)}function h8(e){return e.__timing}function p8(e,t,n){return t&&bf(t,"parseMarkdownToStructureTotalMs",ku()-n),e}function m8(e,t){const n=t.postTransformNodes;if(typeof n!="function")return e;const o=n(e);return Array.isArray(o)?o:e}function xC(e,t,n,o){return p8(m8(e,t),n,o)}function Ap(e,t,n){if(!n)return $C(e,t);bf(n,"processTokensInputTokens",e.length);const o=ku(),s=$C(e,t);return bf(n,"processTokensMs",ku()-o),s}function g8(e){return e.every(t=>{if(!UQ.has(t.type))return!1;const n=t.children;return!Array.isArray(n)||g8(n)})}function VQ(e){const t=[];let n=!1,o=0;for(;o<e.length;){const s=e[o];if(!s||s.level!==0)return null;const i=qQ.get(s.type);let r=o+1;if(i){if(s.nesting!==1)return null;for(;r<e.length;){const l=e[r];if(l.level===0){if(l.type!==i||l.nesting!==-1)return null;r++;break}r++}if(e[r-1]?.type!==i)return null;if(s.type==="paragraph_open"||s.type==="heading_open"){if(r!==o+3||e[o+1]?.type!=="inline")return null}else n=!0}else if(jQ.has(s.type)){if(s.nesting!==0)return null;n=!0}else return null;for(let l=o;l<r;l++){const a=e[l];if(a.type!=="inline")continue;const c=a.children;if(!Array.isArray(c)||!g8(c))return null}t.push(o),o=r}return{mixed:n,starts:t}}function KQ(e){return/\r?\n[\t ]*\r?\n[\t ]*$/.test(e)}function GQ(e){return e.__reuseStableTopLevelNodes===!0&&e.final!==!0&&!e.preTransformTokens&&!e.postTransformTokens&&!e.postTransformNodes&&!e.customHtmlTags?.length&&e.includeSourceMap!==!0}function wC(e,t,n,o,s,i){const r=o.starts;if(r.length===0||s.length!==r.length){Mm.delete(e);return}const l=r.map((a,c)=>{const u=r[c+1]??n.length;return{firstToken:n[a],lastToken:n[u-1],tokenCount:u-a}});Mm.set(e,{groupBoundaries:l,source:t,nodes:s,stableGroupCount:o.mixed?Math.max(0,r.length-1):KQ(t)?r.length:Math.max(0,r.length-1),requireClosingStrong:i.requireClosingStrong})}function YQ(e,t,n,o){for(let s=0;s<o;s++){const i=n[s],r=n[s+1]??t.length,l=e.groupBoundaries[s];if(!l||l.firstToken!==t[i]||l.lastToken!==t[r-1]||l.tokenCount!==r-i)return!1}return!0}function ZQ(e,t,n,o,s){const i=e,r=VQ(n);if(!(_2(e,o)&&GQ(o)&&r!==null))return Mm.delete(i),Ap(n,o,s);const l=r.starts,a=Mm.get(i),c=xd.get(i),u=a&&r.mixed?Math.min(a.stableGroupCount,Math.max(0,a.groupBoundaries.length-1)):a?.stableGroupCount??0;if(a&&u>0&&a.requireClosingStrong===o.requireClosingStrong&&t.startsWith(a.source)&&l.length>=u&&(c==="append"||c==="tail")&&YQ(a,n,l,u)){const f=l[u]??n.length,h=Ap(n.slice(f),o,s),p=l.length-u;if(h.length===p){const m=a.nodes.slice(0,u).concat(h);return bf(s,"processTokensReusedTopLevelNodes",u),wC(e,t,n,r,m,o),m}}const d=Ap(n,o,s);return wC(e,t,n,r,d,o),d}function XQ(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return null;const n=tc(t);return n.length?new Set(n):null}function QQ(e,t){const n=e;let o=vC.get(n);o||(o=new Map,vC.set(n,o));const s=t.__markstreamFinal===!0?"final":"streaming";let i=o.get(s);i||(i={},o.set(s,i));for(const r of Object.keys(i))Object.prototype.hasOwnProperty.call(t,r)||delete i[r];return Object.assign(i,t),i}function JQ(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Gh(e,t,n){for(const o of Reflect.ownKeys(e)){const s=Object.getOwnPropertyDescriptor(e,o);if(!s||!("value"in s))continue;const i=Object.getOwnPropertyDescriptor(t,o);i&&(!("value"in i)||i.writable===!1)||(t[o]=wa(s.value,n))}}function wa(e,t=new WeakMap){if(!e||typeof e!="object")return e;const n=e,o=t.get(n);if(o)return o;if(Array.isArray(e)){const r=[];t.set(n,r);for(const l of e)r.push(wa(l,t));return r}if(e instanceof Map){const r=new Map;t.set(n,r);for(const[l,a]of e)r.set(wa(l,t),wa(a,t));return r}if(e instanceof Set){const r=new Set;t.set(n,r);for(const l of e)r.add(wa(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),Gh(n,r,t),r}if(typeof URLSearchParams<"u"&&e instanceof URLSearchParams){const r=new URLSearchParams(e.toString());return t.set(n,r),Gh(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),Gh(n,r,t),r}if(typeof Promise<"u"&&e instanceof Promise||typeof Node<"u"&&e instanceof Node)return t.set(n,e),e;if(!JQ(e)){const r=Object.create(Object.getPrototypeOf(e));return t.set(n,r),Gh(n,r,t),r}const s={};t.set(n,s);const i=e;for(const r of Object.keys(i))s[r]=wa(i[r],t);return s}function v8(e,t=!0){if(!t)return Da(e);const n=Object.create(Object.getPrototypeOf(e)),o=new WeakMap;for(const s of Reflect.ownKeys(e)){const i=Object.getOwnPropertyDescriptor(e,s);if(!i)continue;if(!("value"in i)){Object.defineProperty(n,s,i);continue}const r=i.value;let l=r;s==="attrs"&&Array.isArray(r)?l=r.map(a=>[...a]):s==="map"&&Array.isArray(r)?l=[...r]:s==="children"&&Array.isArray(r)?l=r.map(a=>v8(a,t)):t&&r&&typeof r=="object"&&(l=wa(r,o)),Object.defineProperty(n,s,{...i,value:l})}return n}function _C(e,t=!0){return e.map(n=>v8(n,t))}function _2(e,t){const n=t,o=e.stream,s=t.streamParse??"auto";return n.__disableStreamParse!==!0&&e.__markstreamHasCustomParserExtensions!==!0&&(s===!0||s==="auto"&&t.final!==!0)&&o?.enabled===!0&&typeof o.parse=="function"}function eJ(e,t){const n=t,o=t.streamParse??"auto",s=e.stream;return t.final===!0&&o==="auto"&&n.__disableStreamParse!==!0&&e.__markstreamHasCustomParserExtensions!==!0&&s?.enabled===!0&&typeof s.reset=="function"}function tJ(e){P1.delete(e)}function nJ(){return{fenceChar:"",fenceInBlockquote:!1,fenceInList:!1,fenceLen:0,fenceListIndent:0,inDollarMath:!1,inFence:!1,inMath:!1,listContentIndent:null,dollarMathOpenOffset:null,mathOpenOffset:null}}function Hd(e){return{...e}}function oJ(e,t,n,o=H1(t).state){P1.set(e,{explicitBracketMath:o,source:t,key:n,pendingCandidate:n===null&&Y5(t)})}function sJ(e){return e.endsWith("$")||e.endsWith("\\")}function iJ(e){const t=Math.max(e.lastIndexOf(`
|
|
227
|
-
`)+1,0),n=e.slice(t).replace(/[\t ]+$/,"");return WQ.some(o=>n.endsWith(o))}function rJ(e,t){return t?!!(t.includes("$$")||t.includes("\\[")||e.endsWith("$")&&t[0]==="$"||e.endsWith("\\")&&t[0]==="["||iJ(e)&&/[\r\n]/.test(t)):!1}function rd(e,t){let n=t-1,o=0;for(;n>=0&&e[n]==="\\";)o++,n--;return o%2===1}function $y(e){return e===" "||e===" "}function y8(e,t){return t===" "?e+1:e+4-e%4}function S2(e){let t=0,n=0;for(;t<e.length&&$y(e[t]);)n=y8(n,e[t]),t++;return{index:t,column:n}}function Mu(e){const t=S2(e);return t.column>3?null:t}function Vg(e){const t=Mu(e);if(!t)return null;const n=t.index,o=e[n];if(o!=="`"&&o!=="~")return null;let s=n;for(;s<e.length&&e[s]===o;)s++;const i=s-n;if(i<3)return null;const r=e.slice(s);return o==="`"&&r.includes("`")?null:{markerChar:o,markerLen:i,rest:r}}function C2(e){const t=Mu(e);if(!t)return null;const n=e.slice(t.index),o=/^(?:[-+*]|\d{1,9}[.)])(?=[\t ]|$)/.exec(n)?.[0];if(!o)return null;let s=t.index+o.length,i=t.column+o.length;if(!$y(e[s]))return null;for(;s<e.length&&$y(e[s]);)i=y8(i,e[s]),s++;return{content:e.slice(s),contentIndent:i}}function A2(e){let t=e,n=!1;for(;;){const o=Mu(t);if(!o)return n?t:null;let s=o.index;if(t[s]!==">")return n?t:null;n=!0,s++,(t[s]===" "||t[s]===" ")&&s++,t=t.slice(s)}}function k8(e){const t=Vg(e);if(t)return{...t,inBlockquote:!1,inList:!1,listIndent:0};const n=A2(e),o=n==null?null:Vg(n);if(o)return{...o,inBlockquote:!0,inList:!1,listIndent:0};const s=C2(e);if(!s)return null;const i=Vg(s.content);return i==null?null:{...i,inBlockquote:!1,inList:!0,listIndent:s.contentIndent}}function lJ(e,t){let n=!1,o="",s=0,i=!1,r=!1,l=0,a=null,c=0;for(;c<t;){const u=e.indexOf(`
|
|
228
|
-
`,c),d=u===-1||u>=t?t:u,f=e.slice(c,d),h=f.endsWith("\r")?f.slice(0,-1):f,p=S2(h),m=C2(h);n&&i&&h.trim()&&A2(h)==null&&(n=!1,o="",s=0,i=!1,r=!1,l=0),n&&r&&h.trim()&&p.column<l&&!m&&(n=!1,o="",s=0,i=!1,r=!1,l=0),m?a=m.contentIndent:h.trim()&&a!=null&&p.column<a&&!n&&(a=null);const y=k8(h);if(y&&(n?y.markerChar===o&&y.markerLen>=s&&/^\s*$/.test(y.rest)&&(n=!1,o="",s=0,i=!1,r=!1,l=0):(n=!0,o=y.markerChar,s=y.markerLen,i=y.inBlockquote,r=y.inList||a!=null&&!y.inBlockquote&&p.column>=a,l=y.listIndent||a||0)),u===-1||u>=t)break;c=u+1}return n}function aJ(e,t){const n=d=>d===" "||d===" ",o=d=>{const f=d.charCodeAt(0);return f>=65&&f<=90||f>=97&&f<=122||f>=48&&f<=57||d==="_"||d==="-"||d===":"},s=d=>{if(d[0]!=="<")return null;let f=1;for(;f<d.length&&n(d[f]);)f++;const h=d[f]==="/";if(h)for(f++;f<d.length&&n(d[f]);)f++;const p=f;for(;f<d.length&&o(d[f]);)f++;if(f===p)return null;const m=d.slice(p,f).toLowerCase();if(!_5.has(m))return null;const y=d[f];if(y&&y!==" "&&y!==" "&&y!==">"&&y!=="/")return null;const k=io(d);if(k===-1)return null;let g=k-1;for(;g>=0&&n(d[g]);)g--;return{closing:h,tag:m,selfClosing:!h&&d[g]==="/",after:d.slice(k+1)}},i=(d,f)=>{const h=d.toLowerCase();let p=0;for(;p<h.length;){const m=h.indexOf("</",p);if(m===-1)return!1;for(p=m+2;p<h.length&&n(h[p]);)p++;if(h.startsWith(f,p)){const y=h[p+f.length];if(!y||y===" "||y===" "||y===">")return!0}}return!1},r=[];let l=!1,a=!1,c=!1,u=0;for(;u<t;){const d=e.indexOf(`
|
|
229
|
-
`,u),f=d===-1||d>=t?t:d,h=e.slice(u,f),p=h.endsWith("\r")?h.slice(0,-1):h,m=Mu(p);if(m){const y=p.slice(m.index);if(l)l=!y.includes("-->");else if(a)a=!y.includes(">");else if(c)c=!y.includes("?>");else if(y.startsWith("<!--"))l=!y.includes("-->");else if(y.startsWith("<?"))c=!y.includes("?>");else if(y.startsWith("<!"))a=!y.includes(">");else{const k=s(y);if(k)if(k.closing){for(let g=r.length-1;g>=0;g--)if(r[g]===k.tag){r.length=g;break}}else k.selfClosing||i(k.after,k.tag)||r.push(k.tag)}}if(d===-1||d>=t)break;u=d+1}return l||a||c||r.length>0}function cJ(e,t,n){if(!n?.length)return!1;const o=new Set(tc(n));if(!o.size)return!1;const s=u=>{const d=u.charCodeAt(0);return d>=65&&d<=90||d>=97&&d<=122||d>=48&&d<=57||u==="_"||u==="-"||u===":"},i=u=>u===" "||u===" ",r=u=>{if(u[0]!=="<")return null;let d=1;for(;d<u.length&&i(u[d]);)d++;const f=u[d]==="/";if(f)for(d++;d<u.length&&i(u[d]);)d++;const h=d;for(;d<u.length&&s(u[d]);)d++;if(d===h)return null;const p=u.slice(h,d).toLowerCase();if(!o.has(p))return null;const m=u[d];if(m&&m!==" "&&m!==" "&&m!==">"&&m!=="/")return null;const y=u.indexOf(">",d);if(y===-1)return null;let k=y-1;for(;k>=0&&i(u[k]);)k--;return{closing:f,tag:p,selfClosing:!f&&u[k]==="/",after:u.slice(y+1)}},l=(u,d)=>{const f=u.toLowerCase();let h=0;for(;h<f.length;){const p=f.indexOf("</",h);if(p===-1)return!1;for(h=p+2;h<f.length&&i(f[h]);)h++;if(f.startsWith(d,h)){const m=f[h+d.length];if(!m||m===" "||m===" "||m===">")return!0}}return!1},a=[];let c=0;for(;c<t;){const u=e.indexOf(`
|
|
230
|
-
`,c),d=u===-1||u>=t?t:u,f=e.slice(c,d),h=f.endsWith("\r")?f.slice(0,-1):f,p=Mu(h);if(p){const m=r(h.slice(p.index));if(m)if(m.closing){for(let y=a.length-1;y>=0;y--)if(a[y]===m.tag){a.length=y;break}}else m.selfClosing||l(m.after,m.tag)||a.push(m.tag)}if(u===-1||u>=t)break;c=u+1}return a.length>0}function uJ(e,t){const n=zQ.exec(e);if(!n)return null;const o=n[1]??"",s=n.index+o.length,i=e.indexOf(`
|
|
231
|
-
`,s),r=e.slice(s,i===-1?e.length:i);return!Mu(r.endsWith("\r")?r.slice(0,-1):r)||lJ(e,s)||aJ(e,s)||cJ(e,s,t)?null:`${e.slice(0,n.index)}${o}`}function b8(e,t,n){let o=t;for(;o<e.length&&e[o]===n;)o++;return o-t}function dJ(e,t,n){let o=t;for(;o<e.length;){const s=e.indexOf("`",o);if(s===-1)return-1;const i=b8(e,s,"`");if(i===n)return s;o=s+i}return-1}function Kg(e){e.inFence=!1,e.fenceChar="",e.fenceLen=0,e.fenceInBlockquote=!1,e.fenceInList=!1,e.fenceListIndent=0}function SC(e,t,n,o,s){let i=0,r=!1;for(;i<e.length;){const l=i;if(t.inMath){if(e.startsWith("\\]",i)&&!rd(e,l)){o!=null&&s&&n+i+2>o&&(r=!0),t.inMath=!1,t.mathOpenOffset=null,i+=2;continue}i++;continue}if(t.inDollarMath){if(e.startsWith("$$",i)&&!rd(e,l)){o!=null&&s&&n+i+2>o&&(r=!0),t.inDollarMath=!1,t.dollarMathOpenOffset=null,i+=2;continue}i++;continue}if(e[i]==="`"&&!rd(e,l)){const a=b8(e,i,"`"),c=dJ(e,i+a,a);if(c===-1)break;i=c+a;continue}if(e.startsWith("\\[",i)&&!rd(e,l)){t.inMath=!0,t.mathOpenOffset=n+i,i+=2;continue}if(e.startsWith("$$",i)&&!rd(e,l)){t.inDollarMath=!0,t.dollarMathOpenOffset=n+i,i+=2;continue}i++}return r}function fJ(e,t){if(!g2(t))return e;const n=t,o=bC.get(n),s=o?.source===e?o.state:o&&e.startsWith(o.source)?x8(o.state,e.slice(o.source.length),o.source.length-o.state.lineBuffer.length).state:H1(e).state;bC.set(n,{source:e,state:s});const{context:i}=s,r=i.inMath?i.mathOpenOffset:i.inDollarMath?i.dollarMathOpenOffset:null;if(r==null)return e;const l=e.slice(r+2),a=e.lastIndexOf(`
|
|
232
|
-
`,r-1)+1;if(e.slice(a,r).trim()!==""&&!/^\r?\n/.test(l)||/^\s*!\[/.test(l))return e;const c=l.trim(),u=/^(?:[a-z]|pi)$/i.test(c);return Cl(l)&&!u?e:e.slice(0,r)}function hJ(e,t,n,o,s){const i=S2(e),r=C2(e);if(t.inFence&&t.fenceInBlockquote&&e.trim()&&A2(e)==null&&Kg(t),t.inFence&&t.fenceInList&&e.trim()&&i.column<t.fenceListIndent&&!r&&Kg(t),r?t.listContentIndent=r.contentIndent:e.trim()&&t.listContentIndent!=null&&i.column<t.listContentIndent&&!t.inFence&&(t.listContentIndent=null),!t.inMath&&!t.inDollarMath){const l=k8(e);if(l)t.inFence?l.markerChar===t.fenceChar&&l.markerLen>=t.fenceLen&&/^\s*$/.test(l.rest)&&Kg(t):(t.inFence=!0,t.fenceChar=l.markerChar,t.fenceLen=l.markerLen,t.fenceInBlockquote=l.inBlockquote,t.fenceInList=l.inList||t.listContentIndent!=null&&!l.inBlockquote&&i.column>=t.listContentIndent,t.fenceListIndent=l.listIndent||t.listContentIndent||0);else if(!t.inFence)return SC(e,t,n,o,s)}else return SC(e,t,n,o,s);return!1}function H1(e,t=nJ(),n=null,o=!1,s=0){const i=Hd(t);let r=Hd(t),l="",a=!1,c=0;for(;c<e.length;){const u=e.indexOf(`
|
|
233
|
-
`,c),d=u!==-1,f=d&&u>c&&e[u-1]==="\r"?u-1:d?u:e.length,h=e.slice(c,f);hJ(h,i,s+c,n,o)&&(a=!0),d?(r=Hd(i),l=""):l=h,c=d?u+1:e.length}return{closedOpenMath:a,state:{committedContext:r,context:i,lineBuffer:l}}}function x8(e,t,n=0){return t&&!e.context.inMath&&!e.context.inDollarMath&&!e.context.inFence&&!e.committedContext.inFence&&!/[\\$`~\r\n]/.test(t)&&!(e.lineBuffer.endsWith("\\")&&(t[0]==="["||t[0]==="]"))?{closedOpenMath:!1,state:{committedContext:Hd(e.committedContext),context:Hd(e.context),lineBuffer:e.lineBuffer+t}}:H1(e.lineBuffer+t,e.committedContext,n+e.lineBuffer.length,e.context.inMath||e.context.inDollarMath,n)}function pJ(e,t){if(!g2(e))return;const n=e.stream;if(typeof n?.reset!="function")return;const o=e,s=P1.get(o);if(s?.source===t)return;const i=s?t.startsWith(s.source):!1,r=i&&s?t.slice(s.source.length):"",l=i&&s?x8(s.explicitBracketMath,r,s.source.length-s.explicitBracketMath.lineBuffer.length):H1(t),a=l.state,c=i&&s?l.closedOpenMath:!1;if(s&&i&&s.key===null&&s.pendingCandidate===!1&&!c&&!rJ(s.source,r)&&!sJ(t)){s.source=t,s.explicitBracketMath=a;return}const u=XZ(t);(s&&(s&&!i||s.key!==u||c)||!s&&u)&&n.reset(),oJ(e,t,u,a)}function mJ(e){return typeof e.preTransformTokens=="function"||typeof e.postTransformTokens=="function"}function gJ(e,t){const n=e?.map,o=t?.map;return n===o?!0:!Array.isArray(n)||!Array.isArray(o)?!1:n.length===o.length&&n.every((s,i)=>s===o[i])}function Gg(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&&gJ(e,t)}function CC(e,t){return e[t]?.type==="paragraph_open"&&e[t+1]?.type==="inline"&&e[t+2]?.type==="paragraph_close"}function vJ(e){for(let t=0;t+5<e.length;t++)if(CC(e,t)&&CC(e,t+3)&&Gg(e[t],e[t+3])&&Gg(e[t+1],e[t+4])&&Gg(e[t+2],e[t+5]))return!0;return!1}function yJ(e,t,n){return g2(e)&&Y5(t)&&vJ(n)}function kJ(e){const t=P1.get(e);return typeof t?.key=="string"&&t.key.startsWith("pending:")}function AC(e,t,n,o){const s=e;if(o.customHtmlTags?.length&&(n.__markstreamCustomHtmlTags=o.customHtmlTags),!_2(e,o)||(pJ(e,t),kJ(e)))return xd.set(s,"sync"),e.parse(t,n);const i=e.stream.parse(t,QQ(e,n));if(yJ(e,t,i))return e.stream?.reset?.(),xd.set(s,"sync"),e.parse(t,n);const r=e.stream?.stats?.();if(xd.set(s,r?.lastMode??"stream"),!mJ(o))return i;const l=h8(o);if(!l)return _C(i,!0);const a=ku(),c=_C(i,!0);return bf(l,"tokenCloneMs",ku()-a),c}function W1(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return gf;const n=new Set(gf);for(const o of tc(t))o&&n.add(o);return n}function bJ(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 MC(e){return{type:"paragraph",children:e,raw:e.map(bJ).join("")}}function EC(e,t){if(t.sourceMap)for(const n of e)n.sourceMap||(n.sourceMap=t.sourceMap)}function TC(e,t){if(e.type!=="paragraph")return null;const n=e.children,o=Array.isArray(n)?n:[];if(o.length===0)return null;const s=XQ(t);if(!s?.size)return null;let i=-1;for(let u=0;u<o.length;u++){const d=o[u];if(!s.has(String(d?.type??"").toLowerCase()))continue;const f=o.slice(0,u);if(String(d.content??"").trim()&&f.some(h=>h?.type==="hardbreak")){i=u;break}}if(i===-1)return null;const r=o.slice(0,i),l=o[i];if(!l)return null;const a=[];r.length&&a.push(MC(r)),a.push(l);const c=o.slice(i+1);return c.length&&a.push(MC(c)),a}function xJ(e){const t=e.trim();if(!t)return null;const n=/^(?:<!doctype\s+html[^>]*>\s*)?<html(?:\s[^>]*)?>/i.test(t),o=/<\/html>\s*$/i.test(t);return!n||!o?null:[{type:"html_block",tag:"html",raw:e,content:e,loading:!1}]}function Wd(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:""}function wJ(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*${Ki(t)}\s*>\s*$`,"i").test(n)}const Yg=new Set(["iframe","script","style","textarea","title"]);function Pf(e,t,n){if(!e||!t)return null;const o=t.toLowerCase(),s=f=>{if(e.startsWith("<!--",f)){const v=e.indexOf("-->",f+4);return{closing:!1,end:v===-1?e.length:v+3,selfClosing:!1,tag:""}}if(e.startsWith("<![CDATA[",f)){const v=e.indexOf("]]>",f+9);return{closing:!1,end:v===-1?e.length:v+3,selfClosing:!1,tag:""}}const h=io(e.slice(f));if(h===-1)return null;const p=f+h+1,m=e.slice(f,p);if(/^<\s*[!?]/.test(m))return{closing:!1,end:p,selfClosing:!1,tag:""};let y=m.slice(1).trimStart();const k=y.startsWith("/");k&&(y=y.slice(1).trimStart());const g=y.match(/^([A-Z][\w:-]*)/i);return g?.[1]?{closing:k,end:p,selfClosing:/\/\s*>$/.test(m),tag:g[1].toLowerCase()}:{closing:!1,end:f+1,selfClosing:!1,tag:""}},i=(f,h)=>{const p=new RegExp(String.raw`<\s*\/\s*${Ki(f)}(?=\s|>)`,"gi");p.lastIndex=h;const m=p.exec(e);if(!m||m.index==null)return null;const y=s(m.index);return y?{start:m.index,end:y.end}:null};let r=-1,l=-1,a=Math.max(0,n);for(;a<e.length;){const f=e.indexOf("<",a);if(f===-1)return null;const h=s(f);if(!h)return null;if(!h.closing&&h.tag===o){r=f,l=h.end-1;break}if(!h.closing&&Yg.has(h.tag)){a=i(h.tag,h.end)?.end??e.length;continue}a=h.end}if(r===-1||l===-1)return null;const c=e.slice(r,l+1);if(Hl.has(o)||/\/\s*>$/.test(c))return{raw:c,start:r,end:l+1,closed:!0};if(Yg.has(o)){const f=i(o,l+1);return f?{raw:e.slice(r,f.end),start:r,end:f.end,closeStart:f.start,closed:!0}:{raw:e.slice(r),start:r,end:e.length,closed:!1}}let u=1,d=l+1;for(;d<e.length;){const f=e.indexOf("<",d);if(f===-1)return{raw:e.slice(r),start:r,end:e.length,closed:!1};const h=s(f);if(!h)return null;if(h.closing&&h.tag===o){u--;const p=h.end;if(u===0)return{raw:e.slice(r,p),start:r,end:p,closeStart:f,closed:!0};d=p;continue}if(!h.closing&&h.tag===o){!h.selfClosing&&!Hl.has(h.tag)&&u++,d=h.end;continue}if(!h.closing&&Yg.has(h.tag)){d=i(h.tag,h.end)?.end??e.length;continue}d=h.end}return{raw:e.slice(r),start:r,end:e.length,closed:!1}}function _J(e,t){if(!t)return 0;let n=0,o=0;for(;n<e.length&&o<t.length;){if(e[n]===t[o]){n++,o++;continue}if(e[n]==="\r"||e[n]===`
|
|
234
|
-
`){n++;continue}return-1}return o===t.length?n:-1}function SJ(e,t,n){return n?e:`${e.replace(/<[^>]*$/,"")}
|
|
235
|
-
</${t}>`}function NC(e){return e.replace(/\r\n/g,`
|
|
236
|
-
`).replace(/(^|\n)[ \t]{1,4}/g,"$1")}function CJ(e,t,n){return n?e.includes(n,t)?!0:NC(e.slice(Math.max(0,t))).includes(NC(n)):!1}function AJ(e,t){let n=Math.max(0,t);for(;n<e.length&&(e[n]===" "||e[n]===" ");)n++;return e[n]==="\r"?(n++,e[n]===`
|
|
237
|
-
`&&n++,n):e[n]===`
|
|
238
|
-
`?n+1:t}function IC(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 MJ(e){if(e.type!=="html_block")return!1;const t=String(e.raw??e.content??"");return/^\s*<\/details\b/i.test(t)}function w8(e,t){const n=new RegExp(String.raw`<\s*\/\s*${Ki(t)}(?=\s|>)`,"gi");let o=-1,s;for(;(s=n.exec(e))!==null;)o=s.index;return o}function _8(e,t){return{final:t,__disableStreamParse:!0,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink}}const EJ=new Set(["admonition","blockquote","code_block","definition_list","footnote","heading","list","math_block","table","thematic_break"]),TJ=/(?:^|\n)\s{0,3}(?:#{1,6}\s+\S|[-+*]\s+\S|\d+[.)]\s+\S|>\s*\S|`{3,}|~{3,}|(?:\*{3,}|-{3,}|_{3,})(?:\s|$)|\|.*\|)/m;function NJ(e){return/\n\s*\n/.test(e)||TJ.test(e)}function IJ(e,t){if(!e.trim()||t.length===0)return!1;if(t.some(o=>EJ.has(String(o?.type??"").toLowerCase()))||t.some(o=>{if(o?.type!=="html_block")return!1;const s=o;return Array.isArray(s.children)&&s.children.length>0}))return!0;if(!NJ(e))return!1;if(t.length>1)return!0;const[n]=t;return!!(n&&n.type==="paragraph")}function LJ(e){const t=[];let n=0;for(;n<e.length;){for(;/\s/.test(e[n]??"");)n++;if(n>=e.length)break;const o=e.slice(n).match(/^<([A-Z][\w:-]*)/i);if(!o?.[1])return null;const s=Pf(e,o[1],n);if(!s||s.start!==n)return null;t.push(s.raw),n=s.end}return t.length>1?t:null}function $J(e,t,n,o){const s=n.customHtmlTags?.join("\0")??"",i=t,r=kC.get(i),l=r&&r.final===o&&r.customHtmlTags===s&&r.requireClosingStrong===n.requireClosingStrong&&r.validateLink===n.validateLink,a=e.map((c,u)=>l&&r.blocks[u]===c?r.children[u]:au(c,t,n));return kC.set(i,{blocks:e,children:a,customHtmlTags:s,final:o,requireClosingStrong:n.requireClosingStrong,validateLink:n.validateLink}),a.flat()}function FJ(e,t,n,o){return e.map(s=>{if(s?.type!=="html_block")return s;const i=s,r=String(i.tag??"").toLowerCase();if(!r||r==="details"||C5.has(r)||Array.isArray(i.children))return s;const l=String(s.raw??i.content??"");if(!l)return s;const a=io(l);if(a===-1)return s;const c=Pf(l,r,0),u=c?.closeStart??-1,d=c?.closed===!0&&u>=a+1,f=d?l.slice(a+1,u):l.slice(a+1);if(!f.trim())return s;const h=_8(n,o),p=d?null:LJ(f),m=p?$J(p,t,h,o):au(f,t,h);return IJ(f,m)?{...s,children:m}:s})}function OJ(e){for(const t of e)if(t?.type==="html_block")return!0;return!1}function au(e,t,n){return e.trim()?C8(e,t,{...n,__disableStreamParse:!0}):[]}function RJ(e,t,n){const o=au(e,t,n),s=o[0];return o.length===1&&s?.type==="paragraph"&&Array.isArray(s.children)?s.children:o}function BJ(e,t,n){const o=c8({content:e}),s=io(e),i=w8(e,"summary");if(s!==-1&&i!==-1&&i>=s+1){const r=RJ(e.slice(s+1,i),t,n);r.length>0&&(o.children=r)}return o.raw=e,o}function DJ(e,t,n){const o=io(e);if(o===-1)return[];const s=e.slice(o+1);if(!s.trim())return[];const i=Pf(s,"summary",0);if(!i)return au(s,t,n);const r=s.slice(0,i.start),l=s.slice(i.end);return[...au(r,t,n),BJ(i.raw,t,n),...au(l,t,n)]}function S8(e,t,n,o,s,i=0){const r=[];let l=i;for(let a=0;a<e.length;a++){const c=e[a],u=Wd(c);let d=-1;if(u&&(d=t.indexOf(u,l),d!==-1&&(l=d+u.length)),!IC(c)){r.push(c);continue}const f=String(c.raw??Wd(c)??""),h=d!==-1?d:t.indexOf(f,Math.max(0,l-f.length));if(h===-1){r.push(c);continue}let p=1,m=-1;for(let ie=a+1;ie<e.length;ie++){const U=e[ie];if(IC(U)){p++;continue}if(MJ(U)&&(p--,p===0)){m=ie;break}}const y=Pf(t,"details",h),k=m===-1&&y?.closed===!0,g=k?(()=>{const ie=w8(f,"details");return ie!==-1?f.slice(0,ie):f})():f,[v]=S8(k?[]:m===-1?e.slice(a+1):e.slice(a+1,m),t,n,o,s,h+f.length),b=DJ(g,n,_8(o,s)),A=m===-1?"</details>":String(e[m].raw??Wd(e[m])??"</details>"),I=k||m!==-1&&y?.closed===!0,T=A.replace(/[\t\r\n ]+$/,""),M=I?(()=>{const ie=(y?.raw??"").lastIndexOf(T);return ie===-1?t.length:h+ie})():t.length,$=io(f),N=k&&$!==-1?h+$+1:h+f.length,F=t.slice(N,M===-1?t.length:M),S=n.parse(F,{__markstreamFinal:s}),B=n.renderer.render(S,n.options,{__markstreamFinal:s}),W=M+T.length,z=I?Math.max(M+A.length,AJ(t,W)):t.length,L=I?t.slice(M,z):A,O=I?t.slice(h,z):t.slice(h),j=k&&$!==-1?f.slice(0,$+1):f,Z={...c,tag:"details",attrs:R1(f.slice(0,$+1)),raw:O,content:`${j}${B}${L}`,children:[...b,...v],loading:!s&&!I};if(o.includeSourceMap&&(Z.sourceMap=B1(t,h,I?z:t.length,o)),r.push(Z),l=I?z:t.length,m===-1&&!k)break;m!==-1&&(a=m)}return[r,l]}function PJ(e,t,n,o){if(!n)return e;const s=e.slice();let i=0;for(let r=0;r<s.length;r++){const l=s[r],a=Wd(l),c=a?n.indexOf(a,i):-1;if(l?.type!=="html_block"){c!==-1&&(i=c+a.length);continue}const u=String(l.tag??"").toLowerCase();if(!u)continue;if(u==="details"){c!==-1&&(i=c+a.length);continue}const d=Pf(n,u,c!==-1?c:i);if(!d)continue;i=d.end;const f=String(l.content??a),h=String(l.raw??f),p=SJ(d.raw,u,d.closed),m=!t&&!d.closed,y=f!==p||h!==d.raw||!!l.loading!==m,k=io(d.raw),g=k===-1?"":d.raw.slice(0,k+1),v=g?R1(g):[];if(l.content=p,l.raw=d.raw,l.loading=m,l.attrs=v.length?v:void 0,o?.includeSourceMap&&(l.sourceMap=B1(n,d.start,d.end,o)),!y)continue;let b=_J(d.raw,h);b===-1&&(b=0);const A=r+1;for(;A<s.length;){if(d.closed&&wJ(s[A],u)){s.splice(A,1);continue}const I=Wd(s[A]);if(!I)break;const T=d.raw.indexOf(I,b);if(T===-1){if(CJ(n,d.end,I))break;const M=f8.get(s[A]);if(!M)break;if(M.start>=d.start&&M.end<=d.end){s.splice(A,1);continue}break}b=T+I.length,s.splice(A,1)}}return s}function HJ(e){const t=l=>l===" "||l===" "||l===`
|
|
239
|
-
`||l==="\r",n=l=>{if(!l||l[0]!=="<"||l.includes(">"))return!1;let a=1;if(a<l.length&&t(l[a])||l.startsWith("<!--")||l.startsWith("<?")||l.startsWith("<!")||l[a]==="/"&&(a++,a<l.length&&t(l[a])))return!1;const c=m=>{const y=m.charCodeAt(0);return y>=65&&y<=90||y>=97&&y<=122},u=m=>{const y=m.charCodeAt(0);return y>=48&&y<=57},d=m=>m==="!"||c(m),f=m=>c(m)||u(m)||m===":"||m==="-",h=m=>c(m)||u(m)||m==="_"||m==="."||m===":"||m==="-",p=h;if(a>=l.length||!d(l[a]))return!1;for(a++;a<l.length&&f(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(!h(l[a]))return!1;for(a++;a<l.length&&p(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 m=l[a];if(m==='"'||m==="'"){for(a++;a<l.length&&l[a]!==m;)a++;if(a>=l.length)return!0;a++}else{for(;a<l.length;){const y=l[a];if(t(y)||y==="<"||y===">"||y==='"'||y==="'"||y==="`")break;a++}if(a>=l.length)return!0}}}return!0},o=(l,a)=>{let c=!1,u="",d=0;const f=g=>g===" "||g===" ",h=g=>{let v=0;for(;v<g.length&&f(g[v]);)v++;const b=g[v];if(b!=="`"&&b!=="~")return null;let A=v;for(;A<g.length&&g[A]===b;)A++;const I=A-v;return I<3?null:{markerChar:b,markerLen:I,rest:g.slice(A)}},p=g=>{let v=0;for(;v<g.length&&f(g[v]);)v++;let b=!1;for(;v<g.length&&g[v]===">";)for(b=!0,v++;v<g.length&&f(g[v]);)v++;return b?g.slice(v):null},m=g=>{const v=h(g);if(v)return v;const b=p(g);return b==null?null:h(b)};let y=0;const k=l.split(/\r?\n/);for(const g of k){const v=y,b=y+g.length;if(a<v)break;const A=m(g);if(A){const I=A.markerChar,T=A.markerLen;c?I===u&&T>=d&&/^\s*$/.test(A.rest)&&(c=!1,u="",d=0):(c=!0,u=I,d=T)}if(a<=b)break;y=b+1}return c},s=String(e??""),i=s.lastIndexOf("<");if(i===-1||o(s,i))return s;if(i>0){const l=s[i-1],a=l===" "||l===" "||l===`
|
|
240
|
-
`||l==="\r",c=s[i-2];if(!a&&!((l==="n"||l==="r")&&c==="\\"))return s}const r=s.slice(i);return r.includes(">")||r.length>1&&(r[1]===" "||r[1]===" "||r[1]===`
|
|
241
|
-
`||r[1]==="\r")||!n(r)?s:s.slice(0,i)}function LC(e,t){if(e===t)return;const n=e.split(/\r?\n/),o=t.split(/\r?\n/),s=[];let i=0;for(let r=0;r<o.length;r++){const l=o[r]??"";if(n[i]===l){s[r]={startLine:i,endLine:i+1},i++;continue}const a=n[i]??"";if(l!==""&&a!==l&&a.startsWith(l)){let h=l,p=-1;for(let m=r+1;m<o.length;m++){if(h+=o[m]??"",h===a){p=m;break}if(!a.startsWith(h))break}if(p!==-1){for(let m=r;m<=p;m++)s[m]={startLine:i,endLine:i+1};i++,r=p;continue}s[r]={startLine:i,endLine:i+1};continue}let c=n[i]??"",u=-1;for(let h=i+1;h<n.length;h++){if(c+=`\\n${n[h]??""}`,c===l){u=h+1;break}if(!l.startsWith(c))break}if(u!==-1){s[r]={startLine:i,endLine:u},i=u;continue}let d=-1;if(l!==""){const h=Math.min(n.length,i+80);for(let p=i;p<h;p++)if(n[p]===l){d=p;break}}if(d!==-1){s[r]={startLine:d,endLine:d+1},i=d+1;continue}const f=Math.min(Math.max(0,n.length-1),Math.max(0,i-1));s[r]={startLine:f,endLine:f+1}}return r=>{const l=Number.isFinite(r)?Math.max(0,Math.trunc(r)):0;if(l<s.length)return s[l]??{startLine:0,endLine:0};const a=s[s.length-1]??{startLine:Math.max(0,n.length-1),endLine:n.length},c=Math.min(n.length,a.endLine+l-s.length);return{startLine:c,endLine:Math.min(n.length,c+1)}}}function WJ(e,t){if(!e||!t.length)return e;const n=new Set(t.map(p=>String(p??"").toLowerCase()).filter(Boolean));if(!n.size)return e;const o=p=>p===" "||p===" ",s=p=>{const m=p.charCodeAt(0);return m>=65&&m<=90||m>=97&&m<=122||m>=48&&m<=57||p==="_"||p==="-"||p===":"},i=p=>{if(!p)return!1;if(p[0]===" ")return!0;let m=0;for(let y=0;y<p.length;y++){const k=p[y];if(k===" "){if(m++,m>=4)return!0;continue}if(k===" ")return!0;break}return!1},r=p=>{let m=!1,y=!1;for(let k=0;k<p.length;k++){const g=p[k];if(g==="\\"){k++;continue}if(!y&&g==="'"){m=!m;continue}if(!m&&g==='"'){y=!y;continue}if(!m&&!y&&g===">")return k}return-1},l=p=>{let m=0;for(;m<p.length&&o(p[m]);)m++;const y=p[m];if(y!=="`"&&y!=="~")return null;let k=m;for(;k<p.length&&p[k]===y;)k++;const g=k-m;return g<3?null:{markerChar:y,markerLen:g,rest:p.slice(k)}},a=(p,m)=>{if(i(p))return-1;const y=p.replace(/^[ \t]+/,"");if(!y||y.startsWith(">")||y.startsWith("|")||/^(?:[*+-]|\d+[.)])[\t ]+/.test(y))return-1;let k=!1,g=0;for(;g<p.length;){const v=p[g];if(v!=="<"){o(v)||(k=!0),g++;continue}const b=r(p.slice(g));if(b===-1){k=!0,g++;continue}const A=p.slice(g,g+b+1);let I=1;for(;I<A.length&&o(A[I]);)I++;if(I>=A.length){k=!0,g++;continue}const T=A[I];if(T==="!"||T==="?"){k=!0,g+=b+1;continue}if(T==="/"){k=!0,g+=b+1;continue}const M=I;for(;I<A.length&&s(A[I]);)I++;if(I===M){k=!0,g++;continue}const $=A.slice(M,I).toLowerCase(),N=A[I];if(N&&N!==" "&&N!==" "&&N!==">"&&N!=="/"){k=!0,g++;continue}const F=new RegExp(String.raw`<\s*\/\s*${$}\s*>`,"i"),S=/\/\s*>$/.test(A),B=F.test(p.slice(g+b+1)),W=F.test(e.slice(m+g+b+1)),z=/[\r\n]/.test(e.slice(m+g+b+1));if(k&&n.has($)&&!S&&!B&&(W||z))return g;k=!0,g+=b+1}return-1};let c=!1,u="",d=0,f="",h=0;for(;h<e.length;){const p=e.indexOf(`
|
|
242
|
-
`,h),m=p!==-1,y=m&&p>h&&e[p-1]==="\r",k=m?y?p-1:p:e.length,g=e.slice(h,k),v=m?y?`\r
|
|
243
|
-
`:`
|
|
244
|
-
`:"",b=l(g);let A=g;if(!c&&!b){const I=a(g,h);if(I!==-1){const T=v||`
|
|
245
|
-
`;A=`${g.slice(0,I).replace(/[ \t]+$/,"")}${T}${T}${g.slice(I).replace(/^[ \t]+/,"")}`}}f+=A,f+=v,b&&(c?b.markerChar===u&&b.markerLen>=d&&/^\s*$/.test(b.rest)&&(c=!1,u="",d=0):(c=!0,u=b.markerChar,d=b.markerLen)),h=m?p+1:e.length}return f}function zJ(e,t){if(!e||!t.length)return e;const n=new Set(t.map(d=>String(d??"").toLowerCase()));if(!n.size)return e;const o=d=>d===" "||d===" ",s=d=>{const f=d.charCodeAt(0);return f>=65&&f<=90||f>=97&&f<=122||f>=48&&f<=57||d==="_"||d==="-"},i=d=>{let f=0;for(;f<d.length&&o(d[f]);)f++;return d.slice(f)},r=d=>{let f=!1,h=!1;for(let p=0;p<d.length;p++){const m=d[p];if(m==="\\"){p++;continue}if(!h&&m==="'"){f=!f;continue}if(!f&&m==='"'){h=!h;continue}if(!f&&!h&&m===">")return p}return-1},l=(d,f,h)=>{const p=h.toLowerCase();let m=d.indexOf("<",f);for(;m!==-1;){let y=m+1;for(;y<d.length&&o(d[y]);)y++;if(y>=d.length||d[y]!=="/"){m=d.indexOf("<",m+1);continue}for(y++;y<d.length&&o(d[y]);)y++;if(y+p.length>d.length){m=d.indexOf("<",m+1);continue}let k=!0;for(let v=0;v<p.length;v++){const b=d[y+v];if((b>="A"&&b<="Z"?String.fromCharCode(b.charCodeAt(0)+32):b)!==p[v]){k=!1;break}}if(!k){m=d.indexOf("<",m+1);continue}let g=y+p.length;if(g<d.length&&s(d[g])){m=d.indexOf("<",m+1);continue}for(;g<d.length&&o(d[g]);)g++;if(g<d.length&&d[g]===">")return!0;m=d.indexOf("<",m+1)}return!1},a=d=>{let f=0;for(;f<d.length&&o(d[f]);)f++;if(f>=d.length||d[f]!=="<")return d;for(f++;f<d.length&&o(d[f]);)f++;if(f>=d.length||d[f]==="/")return d;const h=f;for(;f<d.length&&s(d[f]);)f++;if(f===h)return d;const p=d.slice(h,f).toLowerCase();if(!n.has(p))return d;const m=r(d.slice(f));if(m===-1)return d;const y=f+m;if(l(d,y+1,p))return d;const k=i(d.slice(y+1));return k?`${d.slice(0,y+1)}
|
|
246
|
-
${k}`:d};let c="",u=0;for(;u<e.length;){const d=e.indexOf(`
|
|
247
|
-
`,u);if(d===-1){c+=a(e.slice(u));break}const f=d>u&&e[d-1]==="\r",h=f?d-1:d,p=e.slice(u,h);c+=a(p),c+=f?`\r
|
|
248
|
-
`:`
|
|
249
|
-
`,u=d+1}return c}function UJ(e,t){if(!e||!t.length)return e;const n=new Set(t.map(f=>String(f??"").toLowerCase()));if(!n.size)return e;const o=f=>f===" "||f===" ",s=f=>{let h=0,p=!1,m=0;for(;h<f.length;){for(;h<f.length&&o(f[h]);)h++;if(h>=f.length||f[h]!==">")break;for(p=!0,h++;h<f.length&&o(f[h]);)h++;m=h}return p?{prefix:f.slice(0,m),content:f.slice(m)}:null},i=f=>{let h=0;for(;h<f.length&&o(f[h]);)h++;const p=f[h];if(p!=="`"&&p!=="~")return null;let m=h;for(;m<f.length&&f[m]===p;)m++;const y=m-h;return y<3?null:{markerChar:p,markerLen:y,rest:f.slice(m)}},r=Array.from(n).map(f=>new RegExp(String.raw`(<\s*\/\s*${f}\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 f=e.indexOf(`
|
|
250
|
-
`,d),h=f!==-1,p=h&&f>d&&e[f-1]==="\r",m=h?p?f-1:f:e.length,y=e.slice(d,m),k=h?p?`\r
|
|
251
|
-
`:`
|
|
252
|
-
`:"",g=s(y),v=g?.prefix??"",b=g?.content??y,A=i(b);A&&(l?A.markerChar===a&&A.markerLen>=c&&/^\s*$/.test(A.rest)&&(l=!1,a="",c=0):(l=!0,a=A.markerChar,c=A.markerLen));let I=b;if(!l&&I.includes("</"))for(const T of r)I=I.replace(T,(M,$,N,F)=>{if(F.replace(/^[\t ]+/,"").startsWith("|"))return M;const S=F.slice(0,N).replace(/^[\t ]+/,"");if(S.length>0){const B=$.match(/^<\s*\/\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"",W=S.match(/^<\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"";if(!B||!W||B!==W)return M}return`${$}
|
|
253
|
-
|
|
254
|
-
`});if(v){const T=v+I.split(`
|
|
255
|
-
`).join(`
|
|
256
|
-
${v}`);u+=T}else u+=I;u+=k,d=h?f+1:e.length}return u}function qJ(e,t){if(!e||!t.length)return e;const n=new Set(t.map(S=>String(S??"").toLowerCase()));if(!n.size)return e;const o=S=>S===" "||S===" ",s=S=>{if(!S)return!1;if(S[0]===" ")return!0;let B=0;for(let W=0;W<S.length;W++){const z=S[W];if(z===" "){if(B++,B>=4)return!0;continue}if(z===" ")return!0;break}return!1},i=S=>{const B=S.charCodeAt(0);return B>=65&&B<=90||B>=97&&B<=122||B>=48&&B<=57||S==="_"||S==="-"||S===":"},r=S=>{let B=0;for(;B<S.length&&o(S[B]);)B++;return S.slice(B)},l=S=>{let B=0,W=!1,z=0;for(;B<S.length;){for(;B<S.length&&o(S[B]);)B++;if(B>=S.length||S[B]!==">")break;for(W=!0,B++;B<S.length&&o(S[B]);)B++;z=B}if(!W)return null;const L=S.slice(0,z);return{prefix:L,key:L.replace(/[ \t]+$/,""),content:S.slice(z)}},a=S=>r(S).startsWith("<"),c=S=>{for(let B=0;B<S.length;B++){const W=S[B];if(W!==" "&&W!==" ")return!1}return!0},u=S=>{if(s(S))return"";const B=r(S);if(!B.startsWith("<"))return"";let W=1;for(;W<B.length&&o(B[W]);)W++;if(W>=B.length||B[W]==="/"||B[W]==="!"||B[W]==="?")return"";const z=W;for(;W<B.length&&i(B[W]);)W++;if(W===z)return"";const L=B.slice(z,W).toLowerCase();if(!n.has(L))return"";const O=B[W];return O&&O!==" "&&O!==" "&&O!==">"&&O!=="/"?"":L},d=S=>{if(s(S))return null;const B=r(S);if(!B.startsWith("<"))return null;let W=1;for(;W<B.length&&o(B[W]);)W++;if(W>=B.length)return null;const z=B[W]==="/";if(z)for(W++;W<B.length&&o(B[W]);)W++;const L=B[W];if(!L||L==="!"||L==="?")return null;const O=W;for(;W<B.length&&i(B[W]);)W++;if(W===O)return null;const j=B.slice(O,W).toLowerCase();if(!n.has(j))return null;const Z=B[W];if(Z&&Z!==" "&&Z!==" "&&Z!==">"&&Z!=="/")return null;if(z)return{type:"close",name:j};if(/\/\s*>\s*$/.test(B))return{type:"open",name:j,complete:!0};const ie=B.indexOf(">",W);if(ie!==-1){const U=B.slice(ie+1);if(new RegExp(`<\\s*\\/\\s*${j}\\s*>`,"i").test(U))return{type:"open",name:j,complete:!0}}return{type:"open",name:j,complete:!1}},f=S=>{if(s(S))return null;const B=r(S).replace(/[ \t]+$/,"");if(!B.startsWith("<")||/^<\s*(?:!--|!doctype\b|\?)/i.test(B))return null;const W=B.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(W?.[1])return W[1].toLowerCase();const z=B.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!z?.[1]||!z[2])return null;const L=z[1].toLowerCase();return L===z[2].toLowerCase()?L:null};let h=!1,p="",m=0;const y=S=>{let B=0;for(;B<S.length&&o(S[B]);)B++;const W=S[B];if(W!=="`"&&W!=="~")return null;let z=B;for(;z<S.length&&S[z]===W;)z++;const L=z-B;return L<3?null:{markerChar:W,markerLen:L,rest:S.slice(z)}},k=S=>y(S),g=S=>{const B=r(S);return B?s(S)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test(B):!1},v=(S,B,W)=>{let z=S,L=0;for(;z<e.length;){const O=e.indexOf(`
|
|
257
|
-
`,z),j=O!==-1,Z=j&&O>z&&e[O-1]==="\r",ie=j?Z?O-1:O:e.length,U=e.slice(z,ie),q=l(U),ee=q?.key??"";if(L>0&&B&&ee!==B)break;const le=q?.content??U,oe=d(le);if(oe?.name===W){if(oe.type==="open")oe.complete||L++;else if(L>0&&(L--,L===0))return!1}else if(L>0&&(c(le)||g(le)))return!0;if(j)z=O+1;else break}return!1};let b="",A=0,I=!0,T=!1,M=!1,$=`
|
|
258
|
-
`;const N=[];let F="";for(;A<e.length;){const S=e.indexOf(`
|
|
259
|
-
`,A),B=S!==-1,W=B&&S>A&&e[S-1]==="\r",z=B?W?S-1:S:e.length,L=e.slice(A,z),O=B?W?`\r
|
|
260
|
-
`:`
|
|
261
|
-
`:"",j=l(L),Z=j?.key??"",ie=j?.content??L,U=k(ie);U&&(h?U.markerChar===p&&U.markerLen>=m&&/^\s*$/.test(U.rest)&&(h=!1,p="",m=0):(h=!0,p=U.markerChar,m=U.markerLen));const q=N.length>0;if(!h&&!q){const le=u(ie),oe=!!le&&!I&&T&&M&&v(A,Z,le);le&&!I&&(!T||oe)&&(Z&&F&&Z===F?b+=`${Z}${$}`:Z||(b+=$))}if(b+=L,b+=O,O&&($=O),!h){const le=d(ie);if(le){if(le.type==="open")le.complete||N.push(le.name);else for(let oe=N.length-1;oe>=0;oe--)if(N[oe]===le.name){N.length=oe;break}}}const ee=c(ie);I=ee,T=!ee&&a(ie),M=!ee&&!!f(ie),F=Z,A=B?S+1:e.length}return b}function C8(e,t,n={}){const o=h8(n),s=o?ku():0,i=!!n.final,r=(e??"").toString();let l=r.replace(/([^\\])\r(ight|ho)/g,"$1\\r$2").replace(/([^\\])\r?\n(abla|eq|ot|exists)/g,"$1\\n$2");if(eJ(t,n)&&(t.stream.reset(),tJ(t)),i||(l.endsWith("- *")&&(l=l.replace(/- \*$/,"- \\*")),/(?:^|\n)\s*-\s*$/.test(l)?l=l.replace(/(?:^|\n)\s*-\s*$/,g=>g.startsWith(`
|
|
262
|
-
`)?`
|
|
263
|
-
`:""):/(?:^|\n)\s*--\s*$/.test(l)?l=l.replace(/(?:^|\n)\s*--\s*$/,g=>g.startsWith(`
|
|
264
|
-
`)?`
|
|
265
|
-
`:""):/(?:^|\n)\s*>\s*$/.test(l)?l=l.replace(/(?:^|\n)\s*>\s*$/,g=>g.startsWith(`
|
|
266
|
-
`)?`
|
|
267
|
-
`:""):/\n\s*[*+]\s*$/.test(l)?l=l.replace(/\n\s*[*+]\s*$/,`
|
|
268
|
-
`):/(?:^|\n)\s*\d+\s*$/.test(l)?/^\d+$/.test(l.trim())||(l=l.replace(/(?:^|\n)\s*\d+\s*$/,g=>g.startsWith(`
|
|
269
|
-
`)?`
|
|
270
|
-
`:"")):/(?:^|\n)\s*\d+[.)]\s+\*{1,3}\s*$/.test(l)?l=l.replace(/((?:^|\n)\s*\d+[.)]\s+)(\*{1,3})\s*$/,(g,v,b)=>`${v}${b.split("").map(()=>"\\*").join("")}`):/(?:^|\n)\s*\d+[.)]\s*$/.test(l)?l=l.replace(/(?:^|\n)\s*\d+[.)]\s*$/,g=>g.startsWith(`
|
|
271
|
-
`)?`
|
|
272
|
-
`:""):/\n[[(]\n*$/.test(l)&&(l=l.replace(/(\n\[|\n\()+\n*$/g,`
|
|
273
|
-
`)),l=fJ(l,t),l=uJ(l,n.customHtmlTags)??l),n.customHtmlTags?.length&&l.includes("<")){const g=tc(n.customHtmlTags);if(g.length&&(l=WJ(l,g),l=zJ(l,g),l=qJ(l,g),l=UJ(l,g),l.includes("</")))for(const v of g){const b=new RegExp(String.raw`(^[\t ]*<\s*\/\s*${v}\s*>[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,"gim");l=l.replace(b,"$1$2$2")}}i||(l=HJ(l));const a=xJ(l);if(a){if(n.includeSourceMap){const b={...n,__sourceLineMapper:LC(r,l)};a[0].sourceMap=B1(l,0,l.length,b)}const g=n.preTransformTokens,v=n.postTransformTokens;if(_2(t,n)||typeof g=="function"||typeof v=="function"){const b=AC(t,l,{__markstreamFinal:i},n),A=typeof g=="function"&&g(b)||b;typeof v=="function"&&v(A)}return xC(a,n,o,s)}const c=AC(t,l,{__markstreamFinal:i},n);if(!c||!Array.isArray(c))return xC([],n,o,s);const u=n.preTransformTokens,d=n.postTransformTokens;let f=c;u&&typeof u=="function"&&(f=u(f)||f);const h=t,p=typeof h.validateLink=="function"&&h.__markstreamOriginalValidateLink&&h.validateLink!==h.__markstreamOriginalValidateLink?h.validateLink:void 0,m=n.validateLink??p??h.options?.validateLink??(typeof h.validateLink=="function"?h.validateLink:void 0),y={...n,validateLink:m,__markdownIt:t,__sourceLineMapper:n.includeSourceMap===!0?LC(r,l):void 0,__sourceMarkdown:l,__customHtmlBlockCursor:0};let k=ZQ(t,l,f,y,o);if(d&&typeof d=="function"){const g=d(f);if(Array.isArray(g)){const v=g[0],b=v?.type;v&&typeof b=="string"?k=Ap(g,{...y,__customHtmlBlockCursor:0},o):k=g}}if(OJ(k)&&(k=PJ(k,i,l,y),k=S8(k,l,t,y,i)[0],k=FJ(k,t,y,i)),i){const g=new WeakSet,v=b=>{if(!b||typeof b!="object"||g.has(b))return;if(g.add(b),Array.isArray(b)){for(const I of b)v(I);return}const A=b;A.type==="html_block"&&A.loading===!0&&(A.loading=!1);for(const I of Object.values(A))v(I)};v(k)}return k=m8(k,n),n.debug&&console.log("Parsed Markdown Tree Structure:",k),p8(k,o,s)}function $C(e,t){if(!e||!Array.isArray(e))return[];const n=[],o=Gl(t),s=t?.includeSourceMap===!0;let i=0;for(;i<e.length;){const r=w2(e,i,o.options(),x2);if(r){nr(r[0],e[i],t),n.push(r[0]),o.remember(r[0].raw),i=r[1];continue}const l=e[i];switch(l.type){case"paragraph_open":{const a=String(e[i+1]?.content??""),c=HQ(e,i,o.options(a));s&&pn(c,l,t);const u=TC(c,t);if(u){s&&EC(u,c);for(const d of u)nr(d,l,t);n.push(...u)}else nr(c,l,t),n.push(c);o.remember(c.raw),i+=3;break}case"bullet_list_open":case"ordered_list_open":{const[a,c]=Cu(e,i,o.options());s&&pn(a,l,t),nr(a,l,t),n.push(a),o.remember(a.raw),i=c;break}case"blockquote_open":{const[a,c]=Au(e,i,o.options());s&&pn(a,l,t),nr(a,l,t),n.push(a),o.remember(a.raw),i=c;break}case"footnote_anchor":{const a=l.meta??{},c={type:"footnote_anchor",id:String(a.label??l.content??""),raw:String(l.content??"")};s&&pn(c,l,t),nr(c,l,t),n.push(c),o.remember(String(l.content??"")),i++;break}case"hardbreak":n.push(PQ()),o.reset(),i++;break;case"text":{const a=String(l.content??""),c={type:"paragraph",raw:a,children:a?[{type:"text",content:a,raw:a}]:[]};s&&pn(c,l,t),nr(c,l,t),n.push(c),o.remember(a),i++;break}case"inline":{const a=String(l.content??""),c=eo(l.children||[],a,void 0,o.options(a));if(c.length!==0)if(c.every(u=>u.type==="html_block")){if(s)for(const u of c)pn(u,l,t);for(const u of c)nr(u,l,t);n.push(...c)}else{const u={type:"paragraph",raw:a,children:c};s&&pn(u,l,t);const d=TC(u,t);if(d){s&&EC(d,u);for(const f of d)nr(f,l,t);n.push(...d)}else nr(u,l,t),n.push(u)}o.remember(a)}i+=1;break;default:i+=1;break}}return n}const jJ=/^([a-z][\w-]*)(?=[\t\n\f\r />]|$)/i,VJ=new Set([...Rf,"base","button","datalist","dialog","embed","fieldset","form","iframe","input","legend","link","meta","object","optgroup","option","output","param","select","style","template","textarea","title"]),KJ=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","picture","pre","s","small","source","span","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","ul"]);function FC(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function GJ(e){return typeof e=="string"?e:e==null?"":String(e)}function A8(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function Al(e){return GJ(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function M8(e){return Al(e).replace(/`/g,"`")}function z1(e){return String(e??"").trim().toLowerCase()}function M2(e,t="safe"){const n=z1(e);return n?t==="escape"?!0:t==="trusted"?Rf.has(n):!KJ.has(n):!1}function E8(e,t="safe"){const n=z1(e);return n?t==="escape"?!0:t==="trusted"?Rf.has(n):VJ.has(n):!1}function OC(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,o])=>o===""?` ${n}`:` ${n}="${M8(o)}"`).join("")}function T8(e){const t=e.startsWith("/"),n=t?e.slice(1):e,o=n.match(jJ);return o?{attrsStr:t?"":n.slice(o[0].length).trimStart(),isClosing:t,isSelfClosing:!t&&e.trimEnd().endsWith("/"),tagName:o[1]}:null}function YJ(e,t){const n=e.split(",").map(o=>o.trim()).filter(Boolean);return n.length===0?!1:n.some(o=>{const s=o.split(/\s+/,1)[0]??"";return!s||Ba(s,{tagName:t,attrName:"srcset"})})}function N8(e,t,n,o){return UG.has(e)||n==="safe"&&e==="style"?!0:e==="srcset"?YJ(t,o):!!(qG.has(e)&&t&&Ba(t,{tagName:o,attrName:e}))}function _a(e,t){const n=t.toLowerCase();return Object.keys(e).find(o=>o.toLowerCase()===n)}function I8(e,t,n,o=!1){if(t!=="safe"||z1(n)!=="a")return e;const s=_a(e,"href");if(o&&(!s||!e[s])){const a=_a(e,"target"),c=_a(e,"rel");return a&&delete e[a],c&&delete e[c],e}const i=_a(e,"target");if((i?String(e[i]).trim():"").toLowerCase()!=="_blank")return e;const r=_a(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 RC(e,t="safe",n){const o={};for(const[s,i]of Object.entries(e)){const r=s.trim(),l=r.toLowerCase();!r||!A8(r)||N8(l,i,t,n)||(o[r]=i)}return I8(o,t,n,!!_a(e,"href"))}function L8(e,t){const n=e.toLowerCase();return S5.has(n)?!1:FC(t,n)||FC(t,e)}function E2(e,t="safe",n){const o={};for(const[s,i]of Object.entries(e)){const r=s.trim(),l=r.toLowerCase();!r||!A8(r)||N8(l,i,t,n)||(o[r]=i)}return I8(o,t,n,!!_a(e,"href"))}function zd(e){const t={};if(!Array.isArray(e)||e.length===0)return t;for(const[n,o]of e)n&&(t[String(n)]=o==null?"":String(o));return t}function Mp(e,t="safe",n){const o=E2(zd(e),t,n),s=Object.entries(o).map(([i,r])=>[i,r]);return s.length>0?s:void 0}function ZJ(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 o=Number(e);if(e!==""&&!Number.isNaN(o))return o}return e}function XJ(e){const t={};for(const[n,o]of Object.entries(e))t[n]=ZJ(o,n);return t}function Zg(e){return e.trim().length>0}function $8(e){const t=[];let n=0;for(;n<e.length;){if(e.startsWith("<!--",n)){const r=e.indexOf("-->",n);if(r!==-1){n=r+3;continue}break}const o=e.indexOf("<",n);if(o===-1){if(n<e.length){const r=e.slice(n);Zg(r)&&t.push({type:"text",content:r})}break}if(o>n){const r=e.slice(n,o);Zg(r)&&t.push({type:"text",content:r})}if(e.startsWith("![CDATA[",o+1)){const r=e.indexOf("]]>",o);if(r!==-1){t.push({type:"text",content:e.slice(o,r+3)}),n=r+3;continue}break}if(e.startsWith("!",o+1)){const r=e.indexOf(">",o);if(r!==-1){n=r+1;continue}break}const s=e.indexOf(">",o);if(s===-1)break;const i=T8(e.slice(o+1,s));if(!i){const r=e.slice(o,s+1);Zg(r)&&t.push({type:"text",content:r}),n=s+1;continue}if(i.isClosing)t.push({type:"tag_close",tagName:i.tagName});else{const r={};if(i.attrsStr){const l=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let a;for(;(a=l.exec(i.attrsStr))!==null;){const c=a[1],u=a[2]??a[3]??a[4]??"";c&&!c.endsWith("/")&&(r[c]=u)}}t.push({type:i.isSelfClosing||Hl.has(i.tagName.toLowerCase())?"self_closing":"tag_open",tagName:i.tagName,attrs:r})}n=s+1}return t}function QJ(e){const t=[];let n=0;for(;n<e.length;){if(e.startsWith("<!--",n)){const l=e.indexOf("-->",n);if(l!==-1){n=l+3;continue}break}const o=e.indexOf("<",n);if(o===-1){n<e.length&&t.push({type:"text",content:e.slice(n)});break}if(o>n&&t.push({type:"text",content:e.slice(n,o)}),e.startsWith("![CDATA[",o+1)){const l=e.indexOf("]]>",o);if(l!==-1){t.push({type:"text",content:e.slice(o,l+3)}),n=l+3;continue}break}if(e.startsWith("!",o+1)){const l=e.indexOf(">",o);if(l!==-1){n=l+1;continue}break}const s=e.indexOf(">",o);if(s===-1)break;const i=T8(e.slice(o+1,s));if(!i){t.push({type:"text",content:e.slice(o,s+1)}),n=s+1;continue}if(i.isClosing){t.push({type:"tag_close",tagName:i.tagName}),n=s+1;continue}const r={};if(i.attrsStr){const l=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let a;for(;(a=l.exec(i.attrsStr))!==null;){const c=a[1],u=a[2]??a[3]??a[4]??"";c&&!c.endsWith("/")&&(r[c]=u)}}t.push({type:i.isSelfClosing||Hl.has(i.tagName.toLowerCase())?"self_closing":"tag_open",tagName:i.tagName,attrs:r}),n=s+1}return t}function JJ(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`</${Al(t)}>`;const n=Object.entries(e.attrs??{}).map(([o,s])=>s===""?` ${Al(o)}`:` ${Al(o)}="${M8(s)}"`).join("");return e.type==="self_closing"?`<${Al(t)}${n} />`:`<${Al(t)}${n}>`}function eee(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;for(const n of $8(e))if((n.type==="tag_open"||n.type==="self_closing")&&L8(n.tagName??"",t))return!0;return!1}function cu(e,t="safe"){if(!e)return"";if(t==="escape")return Al(e);const n=QJ(e),o=[],s=[],i=[];for(const r of n){if(r.type==="text"){i.length===0&&s.push(Al(r.content??""));continue}const l=z1(r.tagName);if(!l)continue;if(E8(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"&&M2(l,t)){s.push(JJ(r));continue}if(r.type==="self_closing"){s.push(`<${l}${OC(RC(r.attrs??{},t,l))}>`);continue}if(r.type==="tag_open"){s.push(`<${l}${OC(RC(r.attrs??{},t,l))}>`),Hl.has(l)||o.push(l);continue}const a=o.lastIndexOf(l);if(a===-1)continue;for(;o.length>a+1;){const u=o.pop();u&&s.push(`</${u}>`)}const c=o.pop();c&&s.push(`</${c}>`)}for(;o.length>0;){const r=o.pop();r&&s.push(`</${r}>`)}return s.join("")}const tee=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],BC="http://www.w3.org/2000/svg",nee=new Set(["script","style","iframe","object","embed","link","meta"]),oee=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"]),see=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),iee=new Set(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),ree=new Set(["circle","ellipse","image","line","path","polygon","polyline","rect","text","tspan","use"]);function lee(e){return(e.getAttribute("href")||e.getAttribute("xlink:href"))?.startsWith("#")===!0}function aee(e){return!!(e.getAttribute("href")||e.getAttribute("xlink:href")||e.getAttribute("src"))}function cee(e){const t=e.nodeName.toLowerCase();return t==="use"?lee(e):t==="image"?aee(e):t==="text"||t==="tspan"?!!e.textContent?.trim():ree.has(t)}function uee(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 dee(e,t,n){const o=e.toLowerCase(),s=t.toLowerCase(),i=String(n??"").trim();return i?(o==="use"||o==="marker"||o==="clippath"||o==="mask")&&(s==="href"||s==="xlink:href")?i.startsWith("#")?i:"":o==="a"&&(s==="href"||s==="xlink:href")?Ba(i,{tagName:"a",attrName:"href"})?"":i:o==="image"&&(s==="href"||s==="xlink:href"||s==="src")?Ba(i,{tagName:"img",attrName:"src"})?"":i:s==="href"||s==="xlink:href"?i.startsWith("#")?i:"":Ba(i,{tagName:o,attrName:s})?"":i:""}function fee(e,t){let n=t+4;for(;n<e.length&&/\s/.test(e[n]??"");)n++;const o=e[n];if(o==='"'||o==="'"){const i=n+1,r=e.indexOf(o,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 s=n;for(;n<e.length&&e[n]!==")";)n++;return{next:n<e.length?n+1:n,url:e.slice(s,n)}}function F8(e){return e.replace(/\\([0-9a-f]{1,6}\s?|.)/gi,(t,n)=>{const o=n.trim();if(/^[0-9a-f]+$/i.test(o)){const s=Number.parseInt(o,16);try{return Number.isFinite(s)?String.fromCodePoint(s):""}catch{return""}}return String(n).trim()})}function O8(e){const t=F8(e),n=t.toLowerCase();let o=0;for(;o<n.length;){const s=n.indexOf("url(",o);if(s===-1)return!1;const i=fee(t,s);if(o=Math.max(i.next,s+4),!i.url.trim().startsWith("#"))return!0}return!1}function DC(e){const t=F8(e);return tee.some(n=>n.test(t))||O8(t)}function hee(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 Yh(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function R8(e,t){if(e.nodeType===Node.TEXT_NODE){const s=e.textContent??"";s&&t.push(s);return}if(e.nodeType!==Node.ELEMENT_NODE)return;const n=e,o=n.tagName.toLowerCase();if(!nee.has(o)){if(o==="br"){t.push(`
|
|
274
|
-
`);return}for(const s of Array.from(n.childNodes))R8(s,t)}}function pee(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];R8(t,n);const o=n.join("").split(/\r?\n/).map(u=>u.trim()).filter(Boolean);if(!o.length){t.remove();continue}const s=Yh(t.getAttribute("width")),i=Yh(t.getAttribute("height")),r=Yh(t.getAttribute("x")),l=Yh(t.getAttribute("y")),a=e.ownerDocument.createElementNS(BC,"text");a.setAttribute("x",String(r+s/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")),o.length===1)a.textContent=o[0];else{const u=-.6*(o.length-1);for(const[d,f]of o.entries()){const h=e.ownerDocument.createElementNS(BC,"tspan");h.setAttribute("x",String(r+s/2)),h.setAttribute("dy",d===0?`${u}em`:"1.2em"),h.textContent=f,a.appendChild(h)}}t.parentNode?.replaceChild(a,t)}}function mee(e){pee(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const o=n.tagName.toLowerCase();if(!oee.has(o)){n.remove();continue}if(o==="style"&&DC(n.textContent??"")){n.remove();continue}const s=Array.from(n.attributes);for(const i of s){const r=i.name.toLowerCase();if(/^on/i.test(r)){n.removeAttribute(i.name);continue}if(r==="style"&&i.value&&DC(i.value)){n.removeAttribute(i.name);continue}if(r==="srcdoc"){n.removeAttribute(i.name);continue}if(see.has(r)&&i.value){const l=dee(o,r,i.value);if(!l){n.removeAttribute(i.name);continue}l!==i.value&&n.setAttribute(i.name,l);continue}if(iee.has(r)&&i.value&&O8(i.value)){n.removeAttribute(i.name);continue}if(i.value){const l=uee(i.value);l!==i.value&&n.setAttribute(i.name,l)}}hee(n)}}function $4e(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 mee(n),gee(n)?null:n}catch{return null}}function gee(e){const t=e.getAttribute("viewBox");if(t){const s=t.trim().split(/[\s,]+/);if(s.length===4){const i=Number.parseFloat(s[2]||""),r=Number.parseFloat(s[3]||"");if(!Number.isFinite(i)||!Number.isFinite(r)||i<=0||r<=0)return!0}}const n=[e,...Array.from(e.querySelectorAll("*"))];let o=!1;for(const s of n){cee(s)&&(o=!0);for(const i of Array.from(s.attributes))if(/\bNaN\b/i.test(i.value)||i.name==="style"&&/max-width:\s*0(?:px)?/i.test(i.value))return!0}return!o}const Zh=[];function Xg(e){return String(e??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function vee(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function yee(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function PC(e=`editor-${Date.now()}`,t={}){const n=rX(t),o=n;o.__markstreamRegisteredPluginCount=Zh.length,o.__markstreamHasCustomParserExtensions=!!(t.plugin?.length||t.apply?.length||Zh.length);const s={"common.copy":"Copy"};let i;if(typeof t.i18n=="function")i=t.i18n;else if(t.i18n&&typeof t.i18n=="object"){const p=t.i18n;i=m=>p[m]??s[m]??m}else i=p=>s[p]??p;if(Array.isArray(t.plugin))for(const p of t.plugin){const m=p;if(Array.isArray(m)){const[y,...k]=m;typeof y=="function"&&n.use(y,...k)}else typeof m=="function"&&n.use(m)}if(Array.isArray(t.apply))for(const p of t.apply)try{p(n)}catch(m){console.error("[getMarkdown] apply function threw an error",m)}if(Zh.length)for(const p of Zh)if(Array.isArray(p)){const[m,...y]=p;typeof m=="function"&&n.use(m,...y)}else typeof p=="function"&&n.use(p);n.use(fq),n.use(mq),n.use(cq);const r=Tq,l=r.default??r;n.use(l),n.use(aq),n.use(lq),n.core.ruler.after("block","mark_fence_closed",p=>{const m=p,y=m.src,k=!!m.env?.__markstreamFinal,g=y.split(/\r?\n/);for(const v of m.tokens){if(v.type!=="fence"||!v.map||!v.markup)continue;const b=v.map[0],A=v.map[1],I=v.markup,T=I[0],M=I.length,$=g[Math.max(0,A-1)]??"";let N=0;for(;N<$.length&&($[N]===" "||$[N]===" ");)N++;let F=0;for(;N+F<$.length&&$[N+F]===T;)F++;let S=N+F;for(;S<$.length&&($[S]===" "||$[S]===" ");)S++;const B=k?!0:A>b+1&&F>=M&&S===$.length,W=v;W.meta=W.meta??{},W.meta.unclosed=!B,W.meta.closed=!!B}});const a=(p,m)=>{const y=p,k=y.pos;if(y.src[k]!=="~")return!1;const g=y.src[k-1],v=y.src[k+1];if(/\d/.test(g)&&/\d/.test(v)){if(!m){const b=y.push("text","",0);b.content="~"}return y.pos+=1,!0}return!1};n.inline.ruler.before("sub","wave",a),n.renderer.rules.fence=(p,m)=>{const y=p[m],k=String(y.info??"").trim(),g=String(y.content??""),v=btoa(unescape(encodeURIComponent(g))),b=vee(k),A=Xg(b),I=yee(`editor-${e}-${m}-${b}`),T=Xg(i("common.copy"));return`<div class="code-block" data-code="${v}" data-lang="${A}" id="${I}">
|
|
275
|
-
<div class="code-header">
|
|
276
|
-
<span class="code-lang">${Xg(b.toUpperCase())}</span>
|
|
277
|
-
<button class="copy-button" data-code="${v}">${T}</button>
|
|
278
|
-
</div>
|
|
279
|
-
<div class="code-editor"></div>
|
|
280
|
-
</div>`};const c=/^\[(\d+)\]/,u=/^\[([^\]\n]+)\]/,d=p=>{if(!p.startsWith("["))return!1;const m=u.exec(p);if(!m)return p!=="["&&!/^\[\d+$/.test(p);const y=String(m[1]??"");return p.slice(m[0].length).startsWith("(")?!1:!/^\d+$/.test(y)},f=(p,m)=>{const y=p;if(y.src[y.pos]!=="[")return!1;const k=c.exec(y.src.slice(y.pos));if(!k)return!1;const g=y.src.slice(Math.max(0,y.pos-120),y.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(g))return!1;const v=y.src.slice(y.pos+k[0].length);if(v.startsWith("](")||v.startsWith("(")||d(v))return!1;if(!m){const b=k[1],A=y.push("reference","span",0);A.content=b,A.markup=k[0],A.raw=k[0]}return y.pos+=k[0].length,!0};n.inline.ruler.before("escape","reference",f),n.renderer.rules.reference=(p,m)=>{const k=String(p[m].content??"");return`<span class="reference-link" data-reference-id="${k}" role="button" tabindex="0" title="Click to view reference">${k}</span>`};const h=n.use.bind(n);return n.use=((...p)=>(o.__markstreamHasCustomParserExtensions=!0,h(...p))),n}function kee({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 B8({nextContent:e,persistedContent:t,currentState:n,typewriterEnabled:o,streamRenderVersionChanged:s=!1}){const i=`${n.settledContent}${n.streamedDelta}`;return o?n.streamedDelta&&i===e?s?{settledContent:i,streamedDelta:"",appended:!1}:{settledContent:n.settledContent,streamedDelta:n.streamedDelta,appended:!1}:kee({nextContent:e,previousContent:t??i,typewriterEnabled:o}):{settledContent:e,streamedDelta:"",appended:!1}}const bee={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 xee(e){const t=String(e??"").trim();if(!t)return"";const[n=""]=t.split(/\s+/);return n.split(":")[0]?.trim().toLowerCase()??""}function D8(e){const t=xee(e);return bee[t]??t}function wee(e){if(!Array.isArray(e))return;const t=e.filter(o=>typeof o=="string").map(o=>D8(o)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function _ee(e){if(!Array.isArray(e))return;const t=[],n=new Set;for(const o of e){if(typeof o!="string")continue;const s=o.trim();!s||n.has(s)||(n.add(s),t.push(s))}return t.length>0?t:void 0}function See(e){return _ee(e)?.join("\0")??""}function Cee(e,t){return`${See(e)}\0\0${wee(t)?.join("\0")??""}`}function Cc(e,t,n=1){const o=Number(e);return Number.isFinite(o)?Math.max(n,o):t}function HC(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var Aee=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 f=this.source.length>0,h=this.pendingChars<=0;if(this.source+=d,h){const p=WC();this.startedAt=f&&this.hasStarted?p-this.normalizedStartDelayMs:p,this.lastTick=p,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=WC();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 f=1e3/Math.max(1,this.maxCommitFps),h=Math.min(100,Math.max(0,d-this.lastTick));if(h<f){this.rafId=requestAnimationFrame(this.tick);return}this.lastTick=d;const p=this.pendingChars,m=p>this.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,y=Nee(p/Math.max(.001,m/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(y-this.currentCps)*.2,this.charBudget+=this.currentCps*(h/1e3),this.charBudget<1){this.ensureLoop();return}const k=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),g=Tee(this.source.slice(this.visible.length),k,this.segmenter);g.text&&(this.visible+=g.text,this.charBudget=Math.max(0,this.charBudget-g.graphemeCount),this.emit()),this.ensureLoop()};const{minCharsPerSecond:n=40,maxCharsPerSecond:o=1e3,targetLatencyMs:s=900,catchUpLatencyMs:i=350,catchUpThreshold:r=600,maxCommitFps:l=30,startDelayMs:a=80,maxCharsPerCommit:c=80,flushOnFinish:u=!1}=e;this.minCharsPerSecond=Cc(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,Cc(o,1e3,1)),this.normalizedTargetLatencyMs=Cc(s,900,1),this.normalizedCatchUpLatencyMs=Cc(i,350,1),this.normalizedCatchUpThreshold=HC(r,600),this.normalizedStartDelayMs=HC(a,80),this.maxCommitFps=Math.trunc(Cc(l,30,1)),this.maxCharsPerCommit=Math.trunc(Cc(c,80,1)),this.flushOnFinish=u,this.segmenter=Eee(),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 Mee(e={},t){const n=new Aee(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 Eee(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function Tee(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 o="",s=0;for(const i of n.segment(e)){if(s>=t)break;o+=i.segment,s++}return{text:o,graphemeCount:s}}function WC(){return typeof performance<"u"?performance.now():Date.now()}function Nee(e,t,n){return Math.min(n,Math.max(t,e))}var Iee=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(c){s(c)}},r=a=>{try{l(n.throw(a))}catch(c){s(c)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const Fy=Symbol.for("markstream-vue:node-lifecycle");function F4e(){}const T2=new Map;let P8="material";const jc=new Map,zC=new Map;let Oy=null;function Lee(e){T2.set(e.id,e)}function $ee(e){const t=T2.get(P8);if(!t)return;const n=t.core[e];if(n)return n;const o=jc.get(t.id);if(o){const s=o[e];if(s)return s}t.loadExtended&&!jc.has(t.id)&&Oee(t)}function Fee(){var e,t;return(t=(e=T2.get(P8))==null?void 0:e.fallback)!=null?t:""}function Oee(e){return Iee(this,null,function*(){var t,n,o;if(jc.has(e.id))return(t=jc.get(e.id))!=null?t:null;let s=zC.get(e.id);return s||(s=((o=(n=e.loadExtended)==null?void 0:n.call(e))!=null?o:Promise.resolve(null)).then(i=>(jc.set(e.id,i),Oy?.(),i)).catch(()=>(jc.set(e.id,null),null)),zC.set(e.id,s)),s})}const UC='<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>',qC='<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>',Ree={id:"material",core:{"":qC,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:qC,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:UC,csharp:UC,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:()=>ps(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},Bee=gr(0);Oy=()=>{Bee.value++},Lee(Ree);const Dee={"":"",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 U1(e){var t;const n=(function(o){if(!o)return"";const s=o.trim();if(!s)return"";const[i]=s.split(/\s+/),[r]=i.split(":");return r.toLowerCase()})(e);return(t=Dee[n])!=null?t:n}function O4e(e){const t=U1(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";case"objectivec":return"objective-c";case"objectivecpp":return"objective-cpp";default:return t}}function R4e(e){return $ee(U1(e))||Fee()}const jC={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"};var q1=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(c){s(c)}},r=a=>{try{l(n.throw(a))}catch(c){s(c)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});let hs=null,Ta=!1,Na=null,j1=I2;function Hf(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function N2(){try{const e=globalThis;return Hf(e?.katex)}catch{return null}}function I2(){return q1(null,null,function*(){const e=N2();if(e)return e;const t=yield ps(()=>import("./katex-DnlPpQZa.js"),[]);try{yield ps(()=>import("./mhchem-DtR62fUK.js"),__vite__mapDeps([2,3]))}catch{}return Hf(t)})}function H8(e){const t=Promise.resolve(e).then(n=>{var o;return Na===t&&n?(hs=(o=Hf(n))!=null?o:n,hs):null}).catch(()=>null).finally(()=>{Na===t&&(Na=null)});return Na=t,Ta=!0,t}function Pee(e){j1=e,hs=null,Ta=!1,Na=null}function Hee(e){Pee(I2)}function W8(){return typeof j1=="function"}function B4e(){var e;const t=j1;if(!t||t===I2)return null;if(hs)return hs;const n=N2();if(n)return hs=n,hs;if(Ta)return null;try{const o=t();return o?typeof o?.then=="function"?(H8(o),null):(hs=(e=Hf(o))!=null?e:o,hs):null}catch{return null}}function z8(){return q1(this,null,function*(){var e;const t=N2();if(t)return hs=t,hs;if(hs)return hs;if(Na)return Na;if(Ta)return null;const n=j1;if(!n)return Ta=!0,null;try{const o=n();if(typeof o?.then=="function")return H8(o);if(o)return hs=(e=Hf(o))!=null?e:o,Ta=!0,hs}catch{}return Ta=!0,null})}function U8(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let El=null,wl=null;const Ko=new Map,Ur=new Map;let xf=5;const Pa=new Set;function Ud(){if(Ko.size<xf&&Pa.size){let e=xf-Ko.size;for(const t of Array.from(Pa)){if(e<=0)break;Pa.delete(t),e--;try{t()}catch{}}}}function q8(){for(const e of Array.from(Pa)){Pa.delete(e);try{e()}catch{}}}function Wee(e){El=e,wl=null,El.onmessage=t=>{const{id:n,html:o,error:s}=t.data,i=Ko.get(n);if(i)if(Ko.delete(n),clearTimeout(i.timeoutId),i.cleanup(),Ud(),s)i.aborted||i.reject(new Error(s));else{const{content:r,displayMode:l}=t.data;if(r){const a=`${l?"d":"i"}:${r}`;if(Ur.set(a,o),Ur.size>200){const c=Ur.keys().next().value;Ur.delete(c)}}i.aborted||i.resolve(o)}},El.onerror=t=>{console.error("[katexWorkerClient] Worker error:",t);for(const[n,o]of Ko.entries())clearTimeout(o.timeoutId),o.cleanup(),o.aborted||o.reject(new Error(`Worker error: ${t.message}`));Ko.clear(),q8()}}function zee(){var e;for(const t of Ko.values())clearTimeout(t.timeoutId),t.cleanup(),t.aborted||t.reject(new Error("Worker cleared"));Ko.clear(),q8(),El&&((e=El.terminate)==null||e.call(El)),El=null,wl=null}function Uee(e,t=!0,n=2e3,o){return q1(this,null,function*(){performance.now();const s=U8(e);if(!W8()){const a=new Error("KaTeX rendering disabled");return a.name="KaTeXDisabled",a.code="KATEX_DISABLED",Promise.reject(a)}if(wl)return Promise.reject(wl);const i=`${t?"d":"i"}:${s}`,r=Ur.get(i);if(r)return Ud(),Promise.resolve(r);const l=El||(wl=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),wl.name="WorkerInitError",wl.code="WORKER_INIT_ERROR",null);if(!l)return Promise.reject(wl);if(Ko.size>=xf){const a=new Error("Worker busy");return a.name="WorkerBusy",a.code="WORKER_BUSY",a.busy=!0,a.inFlight=Ko.size,a.max=xf,Promise.reject(a)}return new Promise((a,c)=>{if(o?.aborted){const m=new Error("Aborted");return m.name="AbortError",void c(m)}const u=Math.random().toString(36).slice(2);let d=null;const f=globalThis.setTimeout(()=>{const m=Ko.get(u);if(!m)return;Ko.delete(u),m.cleanup();const y=new Error("Worker render timed out");y.name="WorkerTimeout",y.code="WORKER_TIMEOUT",m.aborted||m.reject(y),Ud()},n);d=()=>{const m=Ko.get(u);if(!m||m.aborted)return;m.aborted=!0,m.cleanup();const y=new Error("Aborted");y.name="AbortError",c(y)},o&&o.addEventListener("abort",d,{once:!0});const h=a,p=c;Ko.set(u,{resolve:m=>{h(m)},reject:m=>{p(m)},timeoutId:f,aborted:!1,cleanup:()=>{o&&d&&o.removeEventListener("abort",d),d=null}});try{l.postMessage({id:u,content:s,displayMode:t})}catch(m){const y=Ko.get(u);Ko.delete(u),clearTimeout(f),y?.cleanup(),y?.reject(m),Ud()}})})}function D4e(e,t=!0,n){const o=`${t?"d":"i"}:${U8(e)}`;if(Ur.set(o,n),Ur.size>200){const s=Ur.keys().next().value;Ur.delete(s)}}const qee="WORKER_BUSY";function jee(e=2e3,t){return Ko.size<xf?Promise.resolve():new Promise((n,o)=>{let s,i=!1,r=null,l=()=>{};const a=()=>{s&&globalThis.clearTimeout(s),Pa.delete(l),t&&r&&t.removeEventListener("abort",r),r=null};l=()=>{i||(i=!0,a(),n())},Pa.add(l),s=globalThis.setTimeout(()=>{if(i)return;i=!0,a();const c=new Error("Wait for worker slot timed out");c.name="WorkerBusyTimeout",c.code="WORKER_BUSY_TIMEOUT",o(c)},e),queueMicrotask(()=>Ud()),t&&(r=()=>{if(i)return;i=!0,a();const c=new Error("Aborted");c.name="AbortError",o(c)},t.aborted?r():t.addEventListener("abort",r,{once:!0}))})}const ld={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function P4e(e){return q1(this,arguments,function*(t,n=!0,o={}){var s,i,r,l;if(!W8()){const m=new Error("KaTeX rendering disabled");throw m.name="KaTeXDisabled",m.code="KATEX_DISABLED",m}const a=(s=o.timeout)!=null?s:ld.timeout,c=(i=o.waitTimeout)!=null?i:ld.waitTimeout,u=(r=o.backoffMs)!=null?r:ld.backoffMs,d=(l=o.maxRetries)!=null?l:ld.maxRetries,f=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):ld.maxRetries,h=o.signal;let p=0;for(;;){if(h?.aborted){const m=new Error("Aborted");throw m.name="AbortError",m}try{return yield Uee(t,n,a,h)}catch(m){if(m?.code!==qee||p>=f)throw m;if(p++,yield jee(c,h).catch(()=>{}),h?.aborted){const y=new Error("Aborted");throw y.name="AbortError",y}u>0&&(yield new Promise(y=>globalThis.setTimeout(y,u*p)))}}})}function Vc(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function Vee(e){var t;for(const n of e.split(/\r?\n/)){const o=n.trim();if(!o||o.startsWith("%%"))continue;const s=o.match(/^([A-Z][\w-]*)\b/i);return((t=s?.[1])==null?void 0:t.toLowerCase())||""}return""}function Em(e){const t=e.split(/\r?\n/).map(s=>s.trim()).filter(s=>s&&!s.startsWith("%%")),n=Math.max(1,t.length),o=Vee(e);return o==="gantt"?220+28*n:o==="sequencediagram"?180+26*n:o==="classdiagram"||o==="statediagram"||o==="erdiagram"?180+24*n:o==="flowchart"||o==="graph"?170+28*n:200+22*n}function Tm(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 j8(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function Nm(e,t=360,n=500){return j8(e,t,n)}function Im(e,t=360,n=500){return j8(e,t,n)}var Kee=Object.defineProperty,Gee=Object.defineProperties,Yee=Object.getOwnPropertyDescriptors,VC=Object.getOwnPropertySymbols,Zee=Object.prototype.hasOwnProperty,Xee=Object.prototype.propertyIsEnumerable,KC=(e,t,n)=>t in e?Kee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,V8=(e,t)=>{for(var n in t||(t={}))Zee.call(t,n)&&KC(e,n,t[n]);if(VC)for(var n of VC(t))Xee.call(t,n)&&KC(e,n,t[n]);return e},GC=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(c){s(c)}},r=a=>{try{l(n.throw(a))}catch(c){s(c)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const Lm=()=>ps(()=>import("./mermaid.core-oS_owI3c.js").then(e=>e.bn),[]);let Tr=null,Kc=Lm,wd=null,Ry=!1,By=!1,_d=0;function Qee(e){Kc=e,_d++,Tr=null,wd=null,Ry=!1,By=!1}function Jee(e){Qee(Lm)}function YC(){return typeof Kc=="function"}function ZC(e){if(!e)return e;const t=e&&e.default?e.default:e;if(t&&(typeof t.render=="function"||typeof t.parse=="function"||typeof t.initialize=="function"))return t;if(t&&t.mermaidAPI&&(typeof t.mermaidAPI.render=="function"||typeof t.mermaidAPI.parse=="function")){const s=t.mermaidAPI;return n=V8({},t),o={render:s.render.bind(s),parse:s.parse?s.parse.bind(s):void 0,initialize:i=>typeof t.initialize=="function"?t.initialize(i):s.initialize?s.initialize(i):void 0},Gee(n,Yee(o))}var n,o;return e.mermaid&&typeof e.mermaid.render=="function"?e.mermaid:t}function XC(e){if(e)try{const t=e?.initialize;e.initialize=n=>{const o=V8({suppressErrorRendering:!0},n||{});return typeof t=="function"?t.call(e,o):e?.mermaidAPI&&typeof e.mermaidAPI.initialize=="function"?e.mermaidAPI.initialize(o):void 0}}catch{}}function H4e(){return GC(this,null,function*(){if(Tr)return Tr;const e=(function(){try{const o=globalThis;return ZC(o?.mermaid)}catch{return null}})();if(e)return Tr=e,XC(Tr),Tr;const t=Kc,n=_d;return t?t===Lm&&Ry?null:wd||(wd=GC(null,null,function*(){let o;try{o=yield t()}catch(s){if(t===Lm)return n===_d&&t===Kc&&(Ry=!0,(function(i){By||(By=!0,console.warn('[markstream-vue] Optional dependency "mermaid" is not installed. Mermaid blocks will render as source.',i))})(s)),null;throw s}finally{n===_d&&t===Kc&&(wd=null)}return n!==_d||t!==Kc?null:o?(Tr=ZC(o),XC(Tr),Tr):null}),wd):null})}let Ns=null,_l=null;const Di=new Map,ya=new Map;function Ep(e){for(const t of Di.values())t.reject(e);Di.clear(),ya.clear()}let QC=5,JC=!1;const ete="WORKER_BUSY",e4="MERMAID_DISABLED";function tte(e){if(Ns&&Ns!==e){const n=new Error("Worker replaced");n.code="WORKER_REPLACED",Ep(n)}Ns=e,_l=null;const t=e;Ns.onmessage=n=>{if(Ns!==t)return;const{id:o,ok:s,result:i,error:r}=n.data,l=Di.get(o);l&&(s===!1||r?l.reject(new Error(r||"Unknown error")):l.resolve(i))},Ns.onerror=n=>{var o,s;if(Ns===t)if(Di.size!==0){try{JC?console.error("[mermaidWorkerClient] Worker error:",n?.message||n):(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker error:",n?.message||n)}catch{}Ep(new Error(`Worker error: ${n.message}`))}else(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker error (no pending):",n?.message||n)},Ns.onmessageerror=n=>{var o,s;if(Ns===t)if(Di.size!==0){try{JC?console.error("[mermaidWorkerClient] Worker messageerror:",n):(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker messageerror:",n)}catch{}Ep(new Error("Worker messageerror"))}else(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",n)}}function nte(){var e;if(Ns)try{Ep(new Error("Worker cleared")),(e=Ns.terminate)==null||e.call(Ns)}catch{}Ns=null,_l=null}function K8(e,t,n,o){if(!YC()){const r=new Error("Mermaid rendering disabled");return r.name="MermaidDisabled",r.code=e4,Promise.reject(r)}const s=`${e}\0${t.theme}\0${n}\0${t.code}`;let i=ya.get(s);return i||(i=(function(r,l,a=1400){if(!YC()){const u=new Error("Mermaid rendering disabled");return u.name="MermaidDisabled",u.code=e4,Promise.reject(u)}if(_l)return Promise.reject(_l);const c=Ns||(_l=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),_l.name="WorkerInitError",_l.code="WORKER_INIT_ERROR",null);if(!c)return Promise.reject(_l);if(Di.size>=QC){const u=new Error("Worker busy");return u.name="WorkerBusy",u.code=ete,u.inFlight=Di.size,u.max=QC,Promise.reject(u)}return new Promise((u,d)=>{const f=Math.random().toString(36).slice(2);let h,p=!1;const m=()=>{p||(p=!0,h!=null&&globalThis.clearTimeout(h),Di.delete(f))},y={resolve:k=>{m(),u(k)},reject:k=>{m(),d(k)}};Di.set(f,y);try{c.postMessage({id:f,action:r,payload:l})}catch(k){return Di.delete(f),void d(k)}h=globalThis.setTimeout(()=>{const k=new Error("Worker call timed out");k.name="WorkerTimeout",k.code="WORKER_TIMEOUT";const g=Di.get(f);g&&g.reject(k)},a)})})(e,t,n),ya.set(s,i),i.then(()=>{ya.get(s)===i&&ya.delete(s)},()=>{ya.get(s)===i&&ya.delete(s)})),(function(r,l){if(!l)return r;if(l.aborted){const a=new Error("Aborted");return a.name="AbortError",Promise.reject(a)}return new Promise((a,c)=>{let u=()=>{};const d=()=>l.removeEventListener("abort",u);u=()=>{d();const f=new Error("Aborted");f.name="AbortError",c(f)},l.addEventListener("abort",u,{once:!0}),r.then(f=>{d(),a(f)},f=>{d(),c(f)})})})(i,o)}function W4e(e,t,n=1400,o){return K8("canParse",{code:e,theme:t},n,o)}function z4e(e,t,n=1400,o){return K8("findPrefix",{code:e,theme:t},n,o)}var ote=Object.defineProperty,ste=Object.defineProperties,ite=Object.getOwnPropertyDescriptors,t4=Object.getOwnPropertySymbols,rte=Object.prototype.hasOwnProperty,lte=Object.prototype.propertyIsEnumerable,n4=(e,t,n)=>t in e?ote(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,st=(e,t)=>{for(var n in t||(t={}))rte.call(t,n)&&n4(e,n,t[n]);if(t4)for(var n of t4(t))lte.call(t,n)&&n4(e,n,t[n]);return e},Bt=(e,t)=>ste(e,ite(t)),Vn=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(c){s(c)}},r=a=>{try{l(n.throw(a))}catch(c){s(c)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const ate="__global__",Qg="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",Dy=(()=>{const e=globalThis;if(e[Qg])return e[Qg];const t={scopedCustomComponents:{},revision:gr(0)};return e[Qg]=t,t})(),o4=Dy.revision,cte=Symbol("markstreamCustomComponents"),ute=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 Wf(e){return ute.has(String(e).trim().toLowerCase())}function dte(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function Jg(e={}){const t={};for(const[n,o]of Object.entries(e))if(o!=null){t[n]=o;for(const s of new Set([Ti(n),Ti(dte(n))]))!s||Wf(s)||Object.prototype.hasOwnProperty.call(t,s)||(t[s]=o)}return t}function wo(e){const t=Jt(cte,null);return D(()=>{var n;return o4.value,(function(o,s={}){return o4.value,st(st(st({},Jg(Dy.scopedCustomComponents[ate]||{})),Jg(s)),Jg((function(i){return i&&Dy.scopedCustomComponents[i]||{}})(o)))})(e?.(),(n=t?.value)!=null?n:{})})}const fte=["aria-label"],hte={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"},pte={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"},_n=(e,t)=>{const n=e.__vccOpts||e;for(const[o,s]of t)n[o]=s;return n},ti=_n(Qe({__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",pte,[...n[1]||(n[1]=[_("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),_("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",hte,[...n[0]||(n[0]=[_("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,fte))}),[["__scopeId","data-v-be21ab83"]]);ti.install=e=>{e.component(ti.__name,ti)};const mte={class:"emoji-node"},Os=_n(Qe({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(x(),E("span",mte,R(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);Os.install=e=>{e.component(Os.__name,Os)};const gte=["id"],vte=["title"],ni=_n(Qe({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const t=`#fnref--${e.node.id}`;function n(){if(typeof document>"u")return;const o=document.querySelector(t);o?o.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${t} not found`)}return(o,s)=>(x(),E("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[_("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+R(e.node.id)+"]",9,vte)],8,gte))}}),[["__scopeId","data-v-c1463a29"]]);ni.install=e=>{e.component(ni.__name,ni)};const G8=(()=>{try{return!1}catch{}return!1})();function ev(e){G8&&console.warn(e)}function s4(e,t="safe",n){return E2(e,t,n)}function Y8(e){return XJ(e)}function tv(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function L2(e,t="safe"){const n=String(e.tag||e.type||"").trim(),o=Mp((s=e.attrs)?Array.isArray(s)?s.every(Array.isArray)?s.map(([r,l])=>[String(r),tv(l)]):s.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),tv(r.value)]):Object.entries(s).map(([r,l])=>[r,tv(l)]):null,t,n);var s;if(!o)return;const i=Y8(zd(o));return Object.keys(i).length>0?i:void 0}function i4(e,t,n=!1){const o=Object.entries(t??{}),s=o.length>0?o.map(([i,r])=>r===""?` ${i}`:` ${i}="${r}"`).join(""):"";return n?`<${e}${s} />`:`<${e}${s}>`}function ad(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function nv(e,t,n,o,s,i,r=!1){const l=(function(d,f){return L8(d,f)})(e,o);if(Rf.has(e.toLowerCase())||!l&&E8(e,i))return null;if(!l&&M2(e,i))return r?[i4(e,t,!0)]:[i4(e,t),...n,`</${e}>`];const a=E2(t,i,e),c=a.key,u=c!=null&&c!==""?c:s;if(l){const d=o[e]||o[e.toLowerCase()],f=Y8(a);return Ft(d,Bt(st({},f),{key:u}),n.length>0?n:void 0)}return Ft(e,Bt(st({},a),{innerHTML:void 0,key:u}),n.length>0?n:void 0)}function Z8(e,t){return eee(e,t)}function $m(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 f=nv(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);ad(c.length>0?c[c.length-1].children:u,f)}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 f=d.tagName.toLowerCase();let h=-1;for(let p=c.length-1;p>=0;p--)if(c[p].tagName.toLowerCase()===f){h=p;break}if(h!==-1)for(;c.length>h;){const p=c.pop(),m=nv(p.tagName,p.attrs||{},p.children,r,p.autoKey,l);c.length>0?ad(c[c.length-1].children,m):ad(u,m),p.tagName.toLowerCase()!==f&&c.length>h&&ev(`Auto-closing unclosed tag: <${p.tagName}>`)}else ev(`Ignoring closing tag with no matching opening tag: </${d.tagName}>`)}for(;c.length>0;){const d=c.pop(),f=nv(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);c.length>0?ad(c[c.length-1].children,f):ad(u,f),ev(`Auto-closing unclosed tag: <${d.tagName}>`)}return u})($8(e),t,n)}catch(s){return o=s,G8&&console.error("Failed to parse HTML to VNodes:",o),null}var o}const yte=["innerHTML"],oi=_n(Qe({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Jt("markstreamHtmlPolicy",void 0),o=D(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),s=wo(()=>t.customId),i=Qe({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=D(()=>{const l=t.node.content;if(!l)return{mode:"html",content:""};if(o.value==="escape")return{mode:"html",content:cu(l,o.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const c=$m(l,s.value,o.value);if(c!==null)return{mode:"dynamic",nodes:c}}if(!Z8(l,s.value))return{mode:"html",content:cu(l,o.value)};const a=$m(l,s.value,o.value);return a===null?{mode:"html",content:cu(l,o.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(x(),E("span",{key:0,class:We(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[fe(C(i),{nodes:r.value.nodes},null,8,["nodes"])],2)):r.value.mode==="text"?(x(),E("span",{key:1,class:We(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},R(r.value.content),3)):(x(),E("span",{key:2,class:We(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,yte))}}),[["__scopeId","data-v-d17f12b0"]]);oi.install=e=>{e.component(oi.__name,oi)};const kte={class:"inline-code"},bte={key:0},rs=_n(Qe({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=If(),o=Jt("markstreamFade",void 0),s=Jt("markstreamTextStreamState",void 0),i=Jt("markstreamStreamVersion",void 0),r=D(()=>{const g=n.fade;return g===""||g===!0||g==="true"||g!==!1&&g!=="false"&&void 0}),l=D(()=>typeof r.value=="boolean"?r.value:typeof o?.value!="boolean"||o.value),a=D(()=>{var g;return String((g=t.node.code)!=null?g:"")}),c=D(()=>!l.value),u=D(()=>{var g;const v=(g=n["index-key"])!=null?g:n.indexKey;return v==null||v===""?"":String(v)}),d=ne(t.node.code),f=ne(""),h=ne(0);let p;function m(){p?.(),p=void 0}function y(){m(),f.value&&(d.value=d.value+f.value,f.value="")}et([()=>t.node.code,u,l],([g])=>{const v=String(g??""),b=u.value,A=B8({nextContent:v,persistedContent:b?s?.get(b):void 0,currentState:{settledContent:d.value,streamedDelta:f.value},typewriterEnabled:l.value});d.value=A.settledContent,f.value=A.streamedDelta,A.appended?(h.value+=1,(function(){if(!f.value||p||!i)return;const I=i.value;p=et(()=>i.value,T=>{T!==I&&y()},{flush:"sync"})})()):f.value||m(),b&&s?.set(b,v)},{immediate:!0}),Mf(m);const k=D(()=>h.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(g,v)=>(x(),E("code",kte,[c.value?(x(),E(Pe,{key:0},[nt(R(a.value),1)],64)):(x(),E(Pe,{key:1},[d.value?(x(),E("span",bte,R(d.value),1)):ue("",!0),f.value?(x(),E("span",{key:1,class:We(["inline-code-stream-delta",[k.value]]),onAnimationend:y},R(f.value),35)):ue("",!0)],64))]))}}),[["__scopeId","data-v-4e331c97"]]);rs.install=e=>{e.component(rs.__name,rs)};const Py=ne(!1),r4=ne(""),l4=ne("top"),qd=ne(null),jd=ne(null),Hy=ne(null),Wy=ne(null),a4=ne(null);let Tp=null,Np=null,zy=0;function X8(){Tp&&(clearTimeout(Tp),Tp=null),Np&&(clearTimeout(Np),Np=null)}let Xh=!1,Qh=null,c4=!1;function xte(e,t,n="top",o=!1,s,i){if(!e)return;const r=++zy;X8();const l=()=>Vn(null,null,function*(){var a,c;if(yield(function(){return Vn(this,null,function*(){if(!Xh&&!c4&&typeof document<"u"){Qh!=null||(Qh=Vn(null,null,function*(){const[{createApp:u,h:d},{default:f}]=yield Promise.all([ps(()=>import("./vue.runtime.esm-bundler-BMrzHc_f.js"),[]),ps(()=>import("./Tooltip-DsL7mF2H.js"),[])]),h=document.createElement("div");h.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(h),u({setup:()=>()=>{var p;return d(f,{visible:Py.value,"anchor-el":qd.value,content:r4.value,placement:l4.value,id:jd.value,originX:Hy.value,originY:Wy.value,isDark:(p=a4.value)!=null?p:void 0})}}).mount(h),Xh=!0}));try{yield Qh}catch(u){Xh=!1,Qh=null,c4=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",u)}}})})(),Xh&&r===zy){jd.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,qd.value=e,r4.value=t,l4.value=n,Hy.value=(a=s?.x)!=null?a:null,Wy.value=(c=s?.y)!=null?c:null,a4.value=typeof i=="boolean"?i:null,Py.value=!0;try{e.setAttribute("aria-describedby",jd.value)}catch{}}});o?l():Tp=setTimeout(l,80)}function wte(e=!1){zy+=1,X8();const t=()=>{if(qd.value&&jd.value)try{qd.value.removeAttribute("aria-describedby")}catch{}Py.value=!1,qd.value=null,jd.value=null,Hy.value=null,Wy.value=null};e?t():Np=setTimeout(t,120)}const _te={"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..."},Ste=Symbol("markstreamI18nFallback");function Q8(e,t){var n;return(n=t?.[e])!=null?n:_te[e]}const Uy=(e,t)=>{var n;return(n=Q8(e,t))!=null?n:(function(o){return(o.split(".").pop()||o).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,s=>s.toUpperCase()).trim()})(e)};function u4(e,t){return{t(n){const o=Q8(n,t);if(e.te&&o!=null&&!e.te(n))return Uy(n,t);const s=e.t(n);return s===n&&o!=null?Uy(n,t):s}}}function Cte(){const e=(function(){var n,o,s;try{const i=bo(),r=Ste,l=i?.provides,a=(n=i?.appContext)==null?void 0:n.provides;return(s=(o=l?.[r])!=null?o:a?.[r])!=null?s:null}catch{}return null})(),t=(function(){var n,o;try{const s=bo(),i=s?.proxy,r=i?.$t;if(typeof r=="function"){const c=i?.$te;return{t:r.bind(i),te:typeof c=="function"?c.bind(i):void 0}}const l=(o=(n=s?.appContext)==null?void 0:n.config)==null?void 0:o.globalProperties,a=l?.$t;if(typeof a=="function"){const c=l?.$te;return{t:a.bind(l),te:typeof c=="function"?c.bind(l):void 0}}}catch{}return null})();if(t)return u4(t,e);try{const n=globalThis.$vueI18nUse||null;if(n&&typeof n=="function")try{const o=n();if(o&&typeof o.t=="function")return u4({t:o.t.bind(o),te:typeof o.te=="function"?o.te.bind(o):void 0},e)}catch{}}catch{}return{t:n=>Uy(n,e)}}const J8=Symbol("ViewportPriority"),eE=Symbol("ViewportPriorityOptions"),tE=Symbol("OffscreenHeavyNodeDeferral"),Ate=D(()=>!1),ja="400px";function $2(){return Jt(eE,void 0)}function F2(){return Jt(tE,Ate)}function Mte(e,t){var n,o;const s=typeof window<"u"&&typeof document<"u",i=typeof t=="boolean"?ne(t):t,r=s?(n=window.requestIdleCallback)!=null?n:T=>window.setTimeout(()=>T({didTimeout:!0,timeRemaining:()=>0}),16):null,l=s?(o=window.cancelIdleCallback)!=null?o:T=>window.clearTimeout(T):null,a=new WeakMap;let c=1;const u=new Map,d=new Map,f=new Set;let h=null,p=null;function m(T){if(!T)return"viewport";let M=a.get(T);return M||(M=c++,a.set(T,M)),String(M)}function y(){if(h!=null){try{l?.(h)}catch{}h=null}}function k(T){if(T){const M=u.get(T);if(M&&!M.targets.size){try{M.io.disconnect()}catch{}u.delete(T)}}d.size||f.size||y()}function g(T){const M=d.get(T);if(!M)return;const $=u.get(M.bucketKey);if(!M.visible.value){M.visible.value=!0;try{M.resolve()}catch{}}try{$?.io.unobserve(T)}catch{}$?.targets.delete(T),d.delete(T),f.delete(T),k(M.bucketKey)}function v(){window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&r&&h==null&&f.size&&(h=r(()=>{h=null;const T=f.values().next().value;T&&(f.delete(T),g(T),f.size&&v())},{timeout:1200}))}function b(T,M){if(!s||typeof IntersectionObserver>"u")return null;const $=(function(z,L){var O,j,Z;return{root:(O=e?.(z??null))!=null?O:null,rootMargin:(j=L?.rootMargin)!=null?j:ja,threshold:(Z=L?.threshold)!=null?Z:0}})(T,M),N=[m((F=$).root),F.rootMargin,F.threshold].join("\0");var F;const S=u.get(N);if(S)return{key:N,bucket:S};let B;try{B=new IntersectionObserver(z=>{for(const L of z)(L.isIntersecting||L.intersectionRatio>0)&&g(L.target)},{root:$.root,rootMargin:$.rootMargin,threshold:$.threshold})}catch{return null}const W={io:B,targets:new Map};return u.set(N,W),{key:N,bucket:W}}function A(){if(s&&i.value)for(const[T,M]of Array.from(d.entries())){const $=b(T,M.opts);if(!$){g(T);continue}if($.key===M.bucketKey)continue;const N=M.bucketKey,F=u.get(N);try{F?.io.unobserve(T)}catch{}F?.targets.delete(T),M.bucketKey=$.key,$.bucket.targets.set(T,M),$.bucket.io.observe(T),k(N)}}et(i,T=>{if(!T){for(const M of Array.from(d.keys()))g(M);y()}},{flush:"sync"});const I=(T,M)=>{const $=ne(!1);let N,F=!1;const S=new Promise(L=>{N=()=>{F||(F=!0,L())}}),B=()=>{const L=d.get(T);if(!L)return f.delete(T),void k();const O=u.get(L.bucketKey);try{O?.io.unobserve(T)}catch{}O?.targets.delete(T),d.delete(T),f.delete(T),k(L.bucketKey)};if(!s||!i.value)return $.value=!0,N(),{isVisible:$,whenVisible:S,destroy:B};const W=b(T,M);if(!W)return $.value=!0,N(),{isVisible:$,whenVisible:S,destroy:B};const z={resolve:N,visible:$,bucketKey:W.key,opts:M};return d.set(T,z),W.bucket.targets.set(T,z),W.bucket.io.observe(T),s&&p==null&&(p=window.requestAnimationFrame(()=>{p=null,A()})),M?.allowIdle!==!1&&(f.add(T),v()),{isVisible:$,whenVisible:S,destroy:B}};return I.refresh=A,En(J8,I),I}function O2(){var e,t;const n=Jt(J8,void 0);if(n)return n;const o=new WeakMap,s=new Map,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=>{if(!h)return;const p=s.get(h);if(p&&!p.targets.size){try{p.io.disconnect()}catch{}s.delete(h)}},d=h=>{const p=o.get(h);if(!p)return;const m=s.get(p.bucketKey);if(!p.visible.value){p.visible.value=!0;try{p.resolve()}catch{}}try{m?.io.unobserve(h)}catch{}o.delete(h),m?.targets.delete(h),i.delete(h),u(p.bucketKey),i.size||c()},f=()=>{window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&l&&r==null&&i.size&&(r=l(()=>{r=null;const h=i.values().next().value;h&&(i.delete(h),d(h),i.size&&f())},{timeout:1200}))};return(h,p)=>{const m=ne(!1);let y,k=!1;const g=new Promise(A=>{y=()=>{k||(k=!0,A())}}),v=()=>{const A=o.get(h);if(!A)return i.delete(h),void(i.size||c());const I=s.get(A.bucketKey);try{I?.io.unobserve(h)}catch{}o.delete(h),I?.targets.delete(h),i.delete(h),u(A.bucketKey),i.size||c()},b=(A=>{var I,T;if(typeof window>"u"||typeof IntersectionObserver>"u")return null;const M=(B=>{var W,z;return[(W=B?.rootMargin)!=null?W:ja,(z=B?.threshold)!=null?z:0].join("\0")})(A),$=s.get(M);if($)return{key:M,bucket:$};const N=(I=A?.rootMargin)!=null?I:ja;let F;try{F=new IntersectionObserver(B=>{for(const W of B)(W.isIntersecting||W.intersectionRatio>0)&&d(W.target)},{root:null,rootMargin:N,threshold:(T=A?.threshold)!=null?T:0})}catch{return null}const S={io:F,targets:new Set};return s.set(M,S),{key:M,bucket:S}})(p);return b?(o.set(h,{resolve:y,visible:m,bucketKey:b.key}),b.bucket.targets.add(h),b.bucket.io.observe(h),p?.allowIdle!==!1&&(i.add(h),f()),{isVisible:m,whenVisible:g,destroy:v}):(m.value=!0,y(),{isVisible:m,whenVisible:g,destroy:v})}}function Ete(e,t){var n,o;const s=(o=(n=e.indexKey)!=null?n:t["index-key"])!=null?o:t.indexKey;return s==null||s===""?"":String(s)}const Tte=["data-markstream-viewport-pending"],Nte=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],Ite={key:1,class:"image-placeholder"},Lte={key:1,class:"image-node__raw-text"},$te={key:2,class:"image-shimmer-overlay"},Fte={key:1,class:"image-node__raw-text"},Ote={key:3,class:"image-error"},$l=_n(Qe({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},lazy:{type:Boolean,default:!1},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){var n,o,s;const i=e,r=t,l=ne(!1),a=ne(!1),c=ne(""),u=ne("primary"),d=ne(null),f=If(),h=Jt(Fy,null),p=O2(),m=$2(),y=F2(),k=D(()=>RS(i.node.src)),g=D(()=>RS(i.fallbackSrc)),v=(s=(o=(n=bo())==null?void 0:n.vnode.el)==null?void 0:o.querySelector)==null?void 0:s.call(o,"img"),b=typeof window<"u"&&v?.getAttribute("src")===(k.value||g.value),A=ne(typeof window>"u"||b||!y.value),I=gr(null);let T="",M=null;const $=D(()=>c.value),N=D(()=>!i.lazy),F=D(()=>typeof window<"u"&&y.value&&!b),S=D(()=>!F.value||A.value),B=D(()=>S.value?$.value:""),W=D(()=>{var me,Ee;return(Ee=(me=m?.value.heavyBlockMargin)!=null?me:m?.value.rootMargin)!=null?Ee:ja}),z=D(()=>!i.node.loading&&u.value!=="failed"&&c.value.length>0),L=D(()=>u.value==="failed"),O=D(()=>(!N.value||F.value&&!A.value)&&!l.value&&!a.value&&u.value!=="failed"&&c.value.length>0),j=D(()=>Ete(i,f));function Z(me=j.value){me&&d.value&&h?.reportHeight(me,d.value.offsetHeight)}function ie(me=j.value){me&&kt(()=>{Z(me)})}function U(){M&&(clearTimeout(M),M=null)}function q(){const me=j.value;me&&T!==me&&(T&&h?.markSettled(T),U(),T=me,h?.markPending(me),typeof window<"u"&&(M=window.setTimeout(()=>{T===me&&(ie(me),ee())},8e3)))}function ee(){return Vn(this,null,function*(){const me=T;me&&(U(),T="",yield kt(),Z(me),h?.markSettled(me))})}function le(){if(u.value==="primary"&&g.value&&g.value!==c.value)return u.value="fallback",c.value=g.value,l.value=!1,a.value=!1,void ie();u.value="failed",a.value=!0,r("error",c.value),ie()}function oe(){l.value=!0,a.value=!1,r("load",$.value),ie()}function re(me){me.preventDefault(),l.value&&!a.value&&r("click",[me,$.value])}const{t:we}=Cte();return et([k,g,()=>i.node.loading],()=>(l.value=!1,a.value=!1,i.node.loading||k.value?(c.value=k.value,void(u.value="primary")):g.value?(c.value=g.value,void(u.value="fallback")):(c.value="",u.value="failed",void(a.value=!0))),{immediate:!0}),typeof window<"u"&&et([d,F],([me,Ee],ae,Y)=>{var Q;if((Q=I.value)==null||Q.destroy(),I.value=null,!Ee||A.value)return void(A.value=!0);if(!me)return void(A.value=!1);let P=!0;const G=p(me,{rootMargin:W.value,allowIdle:!1});I.value=G,A.value=G.isVisible.value,G.whenVisible.then(()=>{P&&I.value===G&&(A.value=!0)}),Y(()=>{P=!1,G.destroy(),I.value===G&&(I.value=null)})},{immediate:!0}),et([z,l,a,$,()=>i.lazy,S],([me,Ee,ae,Y,Q,P])=>me&&Y&&!ae&&P?Ee?(ee(),void ie()):Q?(q(),void ie()):void(Ee||ae||q()):(ee(),void ie()),{flush:"post",immediate:!0}),so(()=>{var me;(me=I.value)==null||me.destroy(),I.value=null,(function(){const Ee=T;Ee&&(U(),T="",h?.markSettled(Ee))})()}),(me,Ee)=>{var ae,Y,Q,P,G;return x(),E("span",{ref_key:"rootRef",ref:d,class:"image-node-container","data-markstream-viewport-pending":F.value&&!A.value?"true":void 0},[z.value?(x(),E("img",{key:0,src:B.value||void 0,alt:String((Y=(ae=i.node.alt)!=null?ae:i.node.title)!=null?Y:""),title:String((P=(Q=i.node.title)!=null?Q:i.node.alt)!=null?P:""),class:We(["image-node__img",{"is-loading":!N.value&&!l.value,"is-loaded":N.value||l.value,"has-natural-size":l.value,"cursor-pointer":l.value}]),loading:i.lazy?"lazy":void 0,fetchpriority:N.value?"high":void 0,decoding:N.value?"sync":"async",tabindex:l.value?0:-1,"aria-label":(G=i.node.alt)!=null?G:C(we)("image.preview"),onError:le,onLoad:oe,onClick:re},null,42,Nte)):ue("",!0),e.node.loading&&!a.value?(x(),E("span",Ite,[i.usePlaceholder?zn(me.$slots,"placeholder",{key:0,node:i.node,displaySrc:$.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:i.fallbackSrc,lazy:i.lazy},()=>[Ee[0]||(Ee[0]=_("span",{class:"image-shimmer"},null,-1))],!0):(x(),E("span",Lte,R(e.node.raw),1))])):ue("",!0),O.value&&!e.node.loading?(x(),E("span",$te,[i.usePlaceholder?zn(me.$slots,"placeholder",{key:0,node:i.node,displaySrc:$.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:i.fallbackSrc,lazy:i.lazy},()=>[Ee[1]||(Ee[1]=_("span",{class:"image-shimmer"},null,-1))],!0):(x(),E("span",Fte,R(e.node.raw),1))])):ue("",!0),L.value?(x(),E("span",Ote,[zn(me.$slots,"error",{node:i.node,displaySrc:$.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:i.fallbackSrc,lazy:i.lazy},()=>[Ee[2]||(Ee[2]=_("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[_("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)),_("span",null,R(C(we)("image.loadError")),1)],!0)])):ue("",!0)],8,Tte)}}}),[["__scopeId","data-v-046e82ac"]]);$l.install=e=>{e.component($l.__name,$l)};const Rte={key:2},vr=Qe({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=wo(()=>t.customId),o=Jt("markstreamHtmlPolicy",void 0),s=Jt("markstreamNestedRendererProps",void 0),i=D(()=>{var p;return(p=o?.value)!=null?p:"safe"}),r=D(()=>{var p,m;const y=(p=s?.value)!=null?p:{};return Bt(st({},y),{customId:(m=t.customId)!=null?m:y.customId,htmlPolicy:i.value})}),l=Hi({loader:()=>Promise.resolve().then(()=>V2),suspensible:!1}),a=D(()=>t.components[String(t.node.type)]),c=D(()=>!!(a.value&&n.value[t.node.type]&&!Wf(String(t.node.type)))),u=D(()=>c.value?L2(t.node,i.value):void 0),d=D(()=>Array.isArray(t.node.children)&&t.node.children.length>0),f=D(()=>{var p;return String((p=t.node.content)!=null?p:"")}),h=D(()=>{var p,m;return String((m=(p=t.node.content)!=null?p:t.node.raw)!=null?m:"")});return(p,m)=>a.value&&c.value?(x(),Ae(Ro(a.value),bn({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:Le(()=>[d.value?(x(),Ae(C(l),bn({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"])):f.value?(x(),Ae(C(l),bn({key:1},r.value,{content:f.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"])):ue("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(x(),Ae(Ro(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",Rte,R(h.value),1)):ue("",!0)}}),d4=Object.freeze({enabled:!0,contextLineCount:2,minimumLineCount:4,revealLineCount:5});function Bte(e){var t;if(typeof e=="boolean")return e;if(e&&typeof e=="object"){const n=e;return Bt(st(st({},d4),n),{enabled:(t=n.enabled)==null||t})}return st({},d4)}function R2(e,t){if(e.renderSideBySide===!1)return!0;if(e.useInlineViewWhenSpaceIsLimited!==!0)return!1;const n=e.renderSideBySideInlineBreakpoint,o=typeof n=="number"&&Number.isFinite(n)?n:900;return t>0&&t<=o}function nE(e){var t,n;const o=(n=(t=String(e??"").split(/\r?\n/,1)[0])==null?void 0:t.trim())!=null?n:"";if(o.length<3)return"";const s=o[0];if(s!=="`"&&s!=="~"||o[1]!==s||o[2]!==s)return"";let i=3;for(;o[i]===s;)i+=1;return o.slice(i).trim()}function f4(e){var t;return((t=String(e??"").trim().split(/\s+/,1)[0])!=null?t:"")==="diff"}function Dte(e){var t;return e.diff===!0||f4(e.language)||f4(nE(String((t=e.raw)!=null?t:"")))}function Pte(e,t,n){const o=(function(s){const i=nE(s);if(!i)return"";const r=i.split(/\s+/).filter(Boolean);if(!r.length)return"";const l=r[0]==="diff"?r.slice(1):r;for(const a of l){const c=a.includes(":")?a.slice(a.indexOf(":")+1):a;if(c&&/[./\\-]/.test(c))return c}return""})(e);return{title:o||t,caption:o?n?`Diff / ${t}`:t:""}}const Hte=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],Wte={key:0,translate:"no",class:"markstream-pre__diff-code"},zte={class:"markstream-pre__diff-pane-content"},Ute={class:"markstream-pre__diff-number","aria-hidden":"true"},qte={class:"markstream-pre__diff-content"},jte={class:"markstream-pre__diff-content-inner"},Vte={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},Kte=["textContent"],Gte=["textContent"],Is=Qe({__name:"PreCodeNode",props:{node:{},loading:{type:Boolean},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},diffHideUnchangedRegions:{type:[Boolean,Object]},reservedHeightPx:{}},setup(e){const t=e;function n(oe,re){const we=String(oe??"");return re?we:we.replace(/\r\n$|\n$|\r$/,"")}const o=D(()=>{var oe,re,we;const me=String((re=(oe=t.node)==null?void 0:oe.language)!=null?re:"");return String((we=String(me).split(/\s+/g)[0])!=null?we:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),s=D(()=>`language-${o.value}`),i=D(()=>{var oe;return t.loading===!0||((oe=t.node)==null?void 0:oe.loading)===!0}),r=D(()=>{var oe;return n((oe=t.node)==null?void 0:oe.code,i.value)});let l="",a=1;const c=D(()=>(function(oe){let re=0,we=1;oe.startsWith(l)&&(re=l.length,we=a,re>0&&oe[re-1]==="\r"&&oe[re]===`
|
|
281
|
-
`&&re++);for(let me=re;me<oe.length;me++)oe[me]===`
|
|
282
|
-
`?we++:oe[me]==="\r"&&(we++,oe[me+1]===`
|
|
283
|
-
`&&me++);return l=oe,a=we,we})(r.value)),u=D(()=>r.value.split(/\r\n|\n|\r/));let d=0,f="";const h=D(()=>{const oe=c.value;oe<d&&(d=0,f="");for(let re=d+1;re<=oe;re++)f+=`${f?`
|
|
284
|
-
`:""}${re}`;return d=oe,f}),p=D(()=>{var oe;return t.showLineNumbers===!0&&((oe=t.node)==null?void 0:oe.diff)===!0}),m=D(()=>p.value&&t.diffInline===!0),y=D(()=>{const oe=Number(t.reservedHeightPx);if(!Number.isFinite(oe)||oe<=0)return;const re=`${Math.ceil(oe)}px`;return i.value?{maxHeight:re,overflow:"auto"}:{height:re,minHeight:re,maxHeight:re,overflow:"auto"}}),k=["diff ","index ","--- ","+++ ","@@ "];function g(oe){return String(oe??"").trim().length===0}function v(oe,re="context",we={}){const me=g(oe);return{code:oe,kind:me&&re!=="hunk"&&re!=="spacer"&&!we.preserveBlankKind?"context":re,empty:me}}function b(oe){const re=n(oe,i.value);return re?re.split(/\r\n|\n|\r/):[]}function A(oe,re){return!g(oe[re])||re<oe.length-1}function I(oe){return oe.startsWith("-")&&!oe.startsWith("---")}function T(oe){return oe.startsWith("+")&&!oe.startsWith("+++")}function M(oe){return oe.some(re=>k.some(we=>re.startsWith(we)))}function $(oe,re){return re||!oe.startsWith(" ")||oe.startsWith(" ")?oe:` ${oe}`}function N(oe,re){const we=oe.length,me=re.length,Ee=[];let ae=0;for(;ae<we&&ae<me&&oe[ae]===re[ae];)Ee.push({originalIndex:ae,modifiedIndex:ae}),ae++;const Y=[];let Q=we-1,P=me-1;for(;Q>=ae&&P>=ae&&oe[Q]===re[P];)Y.unshift({originalIndex:Q,modifiedIndex:P}),Q--,P--;const G=Q-ae+1,pe=P-ae+1;if(G<=0||pe<=0||i.value||(G+1)*(pe+1)>15e5)return Ee.concat(Y);const ve=pe+1,de=new Uint32Array((G+1)*(pe+1));for(let ke=G-1;ke>=0;ke--)for(let Te=pe-1;Te>=0;Te--){const ze=ke*ve+Te;if(oe[ae+ke]===re[ae+Te])de[ze]=de[(ke+1)*ve+Te+1]+1;else{const ye=de[(ke+1)*ve+Te],be=de[ke*ve+Te+1];de[ze]=ye>=be?ye:be}}const V=[];let se=0,he=0;for(;se<G&&he<pe;)oe[ae+se]===re[ae+he]?(V.push({originalIndex:ae+se,modifiedIndex:ae+he}),se++,he++):de[(se+1)*ve+he]>=de[se*ve+he+1]?se++:he++;return Ee.concat(V,Y)}function F(oe){var re;const we=(function(){var P,G;const pe=t.diffHideUnchangedRegions;if(pe==null||pe===!1)return null;const ve=pe===!0?{}:pe;return ve.enabled===!1?null:{contextLineCount:Math.max(0,Math.floor((P=ve.contextLineCount)!=null?P:2)),minimumLineCount:Math.max(1,Math.floor((G=ve.minimumLineCount)!=null?G:4))}})();if(!we||oe.length<1||oe.length>2||oe.length===2&&oe[0].lines.length!==oe[1].lines.length)return oe;const me=oe[0].lines,Ee=(re=oe[1])==null?void 0:re.lines,ae=P=>me[P].kind==="context"&&(Ee===void 0||Ee[P].kind==="context"&&me[P].code===Ee[P].code),Y=[];let Q=0;for(;Q<me.length;){const P=Q;for(;Q<me.length&&ae(Q);)Q++;const G=Q;if(G-P>=we.minimumLineCount){const pe=P+(P===0?0:we.contextLineCount),ve=G-(G===me.length?0:we.contextLineCount);ve-pe>=we.minimumLineCount&&Y.push({start:pe,end:ve})}Q===P&&Q++}return Y.length?oe.map((P,G)=>{const pe=[];let ve=0;for(const de of Y)pe.push(...P.lines.slice(ve,de.start)),pe.push({code:G===0?"Unmodified lines":"",kind:"collapsed",empty:!1,key:`${P.key}-collapsed-${de.start}-${de.end}`,number:""}),ve=de.end;return pe.push(...P.lines.slice(ve)),Bt(st({},P),{lines:pe})}):oe}const S=D(()=>{var oe,re,we,me;if(!p.value)return[];const Ee=(function(G){const pe=G.some(de=>I(de)),ve=G.some(de=>T(de));return pe&&ve||(function(){var de,V,se,he;if(o.value==="diff")return!0;const ke=(he=(se=String((V=(de=t.node)==null?void 0:de.raw)!=null?V:"").split(/\r?\n/,1)[0])==null?void 0:se.trim())!=null?he:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(ke)})()&&(pe||ve)})(u.value),ae=(function(){var G,pe;return((G=t.node)==null?void 0:G.originalCode)!=null||((pe=t.node)==null?void 0:pe.updatedCode)!=null})();if(m.value){const G=ae?(function(pe,ve){const de=b(pe),V=b(ve),se=N(de,V);if(se.length>0){const be=[];let Ge=0,tt=0;for(const rt of se){for(;Ge<rt.originalIndex;)be.push(Bt(st({},v(de[Ge],"removed",{preserveBlankKind:A(de,Ge)})),{key:`inline-removed-source-${Ge}`,number:Ge+1})),Ge++;for(;tt<rt.modifiedIndex;)be.push(Bt(st({},v(V[tt],"added",{preserveBlankKind:A(V,tt)})),{key:`inline-added-source-${tt}`,number:tt+1})),tt++;be.push(Bt(st({},v(V[rt.modifiedIndex])),{key:`inline-context-source-${rt.originalIndex}-${rt.modifiedIndex}`,number:rt.modifiedIndex+1})),Ge=rt.originalIndex+1,tt=rt.modifiedIndex+1}for(;Ge<de.length;)be.push(Bt(st({},v(de[Ge],"removed",{preserveBlankKind:A(de,Ge)})),{key:`inline-removed-source-${Ge}`,number:Ge+1})),Ge++;for(;tt<V.length;)be.push(Bt(st({},v(V[tt],"added",{preserveBlankKind:A(V,tt)})),{key:`inline-added-source-${tt}`,number:tt+1})),tt++;return be}const he=[];let ke=0,Te=de.length-1,ze=V.length-1;for(;ke<=Te&&ke<=ze&&de[ke]===V[ke];)he.push(Bt(st({},v(V[ke])),{key:`inline-prefix-${ke}`,number:ke+1})),ke++;const ye=[];for(;Te>=ke&&ze>=ke&&de[Te]===V[ze];)ye.unshift(Bt(st({},v(V[ze])),{key:`inline-suffix-${ze}`,number:ze+1})),Te--,ze--;for(let be=ke;be<=Te;be++)he.push(Bt(st({},v(de[be],"removed",{preserveBlankKind:A(de,be)})),{key:`inline-removed-source-${be}`,number:be+1}));for(let be=ke;be<=ze;be++)he.push(Bt(st({},v(V[be],"added",{preserveBlankKind:A(V,be)})),{key:`inline-added-source-${be}`,number:be+1}));return he.concat(ye)})((oe=t.node)==null?void 0:oe.originalCode,(re=t.node)==null?void 0:re.updatedCode):(function(pe){const ve=[];let de=1,V=1;const se=M(pe);for(const[he,ke]of pe.entries())if(ke.startsWith("@@")){const Te=ke.match(/^@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/);Te&&(de=Number(Te[1]),V=Number(Te[2])),ve.push(Bt(st({},v(ke,"hunk")),{key:`inline-hunk-${he}`,number:""}))}else if(I(ke))ve.push(Bt(st({},v($(ke.slice(1),se),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${he}`,number:de++}));else if(T(ke))ve.push(Bt(st({},v($(ke.slice(1),se),"added",{preserveBlankKind:!0})),{key:`inline-added-${he}`,number:V++}));else{const Te=se&&ke.startsWith(" ")?ke.slice(1):ke;ve.push(Bt(st({},v(Te)),{key:`inline-context-${he}`,number:V})),de++,V++}return ve})(u.value);return F([{key:"inline",className:"markstream-pre__diff-pane--inline",lines:G}])}if(!Ee&&ae)return(function(G,pe){const ve=b(G),de=b(pe),V=N(ve,de),se=[],he=[];let ke=0,Te=0,ze=0;const ye=(be,Ge)=>{const tt=Math.max(be-ke,Ge-Te);for(let rt=0;rt<tt;rt++){const ut=ke+rt,vt=Te+rt;se.push(ut<be?Bt(st({},v(ve[ut],"removed",{preserveBlankKind:A(ve,ut)})),{key:`original-changed-${ze}-${ut}`,number:ut+1}):Bt(st({},v("","spacer")),{key:`original-spacer-${ze}-${rt}`,number:""})),he.push(vt<Ge?Bt(st({},v(de[vt],"added",{preserveBlankKind:A(de,vt)})),{key:`modified-changed-${ze}-${vt}`,number:vt+1}):Bt(st({},v("","spacer")),{key:`modified-spacer-${ze}-${rt}`,number:""}))}ke=be,Te=Ge,ze++};for(const be of V)ye(be.originalIndex,be.modifiedIndex),se.push(Bt(st({},v(ve[be.originalIndex])),{key:`original-context-${be.originalIndex}-${be.modifiedIndex}`,number:be.originalIndex+1})),he.push(Bt(st({},v(de[be.modifiedIndex])),{key:`modified-context-${be.originalIndex}-${be.modifiedIndex}`,number:be.modifiedIndex+1})),ke=be.originalIndex+1,Te=be.modifiedIndex+1;return ye(ve.length,de.length),F([{key:"original",className:"markstream-pre__diff-pane--original",lines:se},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:he}])})((we=t.node)==null?void 0:we.originalCode,(me=t.node)==null?void 0:me.updatedCode);const Y=[],Q=[],P=M(u.value);for(const G of u.value)if(G.startsWith("@@"))Y.push(v(G,"hunk")),Q.push(v(G,"hunk"));else if(G.startsWith("-")&&!G.startsWith("---"))Y.push(v($(G.slice(1),P),"removed",{preserveBlankKind:!0}));else if(G.startsWith("+")&&!G.startsWith("+++"))Q.push(v($(G.slice(1),P),"added",{preserveBlankKind:!0}));else{const pe=P&&G.startsWith(" ")?G.slice(1):G;Y.push(v(pe)),Q.push(v(pe))}return F([{key:"original",className:"markstream-pre__diff-pane--original",lines:Y.map((G,pe)=>Bt(st({},G),{key:`original-${pe}`,number:pe+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:Q.map((G,pe)=>Bt(st({},G),{key:`modified-${pe}`,number:pe+1}))}])}),B=D(()=>S.value.some(oe=>oe.lines.some(re=>re.kind==="collapsed"))),W=D(()=>{const oe=o.value;return oe?`Code block: ${oe}`:"Code block"}),z=ne(null),L=ne([]);let O=null,j=!1,Z=null;function ie(oe){const re=Number.parseFloat(String(oe??""));return Number.isFinite(re)&&re>0?re:0}function U(oe,re){var we;if(!oe)return re;if(oe.classList.contains("markstream-pre__diff-line--collapsed"))return 32;const me=oe.querySelector(".markstream-pre__diff-content"),Ee=me?.getBoundingClientRect(),ae=(we=Ee?.height)!=null?we:0;return Math.max(re,Math.ceil(ae))}function q(){j||typeof window>"u"||(O!=null&&window.cancelAnimationFrame(O),O=window.requestAnimationFrame(()=>{O=null,j||(function(){var oe,re;O=null;const we=z.value;if(!we||!p.value||m.value||!we.classList.contains("is-wrap"))return void(L.value.length&&(L.value=[]));const me=(function(pe){const ve=window.getComputedStyle(pe),de=ie(ve.getPropertyValue("--markstream-pre-diff-line-height"));if(de>0)return de;const V=ie(ve.lineHeight);return V>0?V:18})(we),Ee=Array.from(we.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),ae=Array.from(we.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),Y=Math.max(Ee.length,ae.length),Q=[];for(let pe=0;pe<Y;pe++){const ve=U((oe=Ee[pe])!=null?oe:null,me),de=U((re=ae[pe])!=null?re:null,me),V=Math.max(me,ve,de);Q.push({rowHeight:V,originalHeight:ve,modifiedHeight:de})}var P,G;P=L.value,G=Q,P.length===G.length&&P.every((pe,ve)=>{const de=G[ve];return de&&Math.abs(pe.rowHeight-de.rowHeight)<=.5&&Math.abs(pe.originalHeight-de.originalHeight)<=.5&&Math.abs(pe.modifiedHeight-de.modifiedHeight)<=.5})||(L.value=Q)})()}))}function ee(oe){Z?.disconnect(),Z=null,oe&&p.value&&!m.value&&typeof ResizeObserver<"u"&&(Z=new ResizeObserver(()=>{q()}),Z.observe(oe))}function le(oe,re){const we=L.value[oe];if(!we)return;const me=re==="original"?we.originalHeight:we.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(we.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(me)}px`}}return et(z,oe=>{ee(oe),kt(()=>q())},{flush:"post"}),et([p,m,S],()=>{ee(z.value),kt(()=>q())},{flush:"post",immediate:!0}),so(()=>{j=!0,O!=null&&(window.cancelAnimationFrame(O),O=null),Z?.disconnect(),Z=null}),(oe,re)=>(x(),E("pre",{ref_key:"preRef",ref:z,style:tn(y.value),class:We([s.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":p.value,"markstream-pre--diff-inline":m.value,"markstream-pre--diff-collapsed":B.value}]),"aria-busy":i.value,"aria-label":W.value,"data-language":o.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[p.value?(x(),E("code",Wte,[(x(!0),E(Pe,null,lt(S.value,we=>(x(),E("span",{key:we.key,class:We(["markstream-pre__diff-pane",we.className])},[_("span",zte,[(x(!0),E(Pe,null,lt(we.lines,(me,Ee)=>(x(),E("span",{key:me.key,class:We(["markstream-pre__diff-line",[`markstream-pre__diff-line--${me.kind}`,{"markstream-pre__diff-line--empty":me.empty}]]),style:tn(le(Ee,we.key))},[re[0]||(re[0]=_("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),_("span",Ute,R(me.number),1),_("span",qte,[_("span",jte,R(me.code),1)])],6))),128))])],2))),128))])):(x(),E(Pe,{key:1},[t.showLineNumbers?(x(),E("span",Vte,[_("span",{class:"markstream-pre__line-numbers-text",textContent:R(h.value)},null,8,Kte)])):ue("",!0),_("code",{translate:"no",class:"markstream-pre__code",textContent:R(r.value)},null,8,Gte)],64))],14,Hte))}});Is.install=e=>{e.component(Is.__name,Is)};const Yte={key:0},ro=_n(Qe({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=If(),o=Jt("markstreamFade",void 0),s=Jt("markstreamTextStreamState",void 0),i=Jt("markstreamStreamVersion",void 0),r=D(()=>{const y=n.fade;return y===""||y===!0||y==="true"||y!==!1&&y!=="false"&&void 0}),l=D(()=>typeof r.value=="boolean"?r.value:typeof o?.value!="boolean"||o.value),a=D(()=>{var y;const k=(y=n["index-key"])!=null?y:n.indexKey;return k==null||k===""?"":String(k)}),c=ne(t.node.content),u=ne(""),d=ne(0);let f;function h(){f?.(),f=void 0}function p(){h(),u.value&&(c.value=c.value+u.value,u.value="")}et([()=>t.node.content,a,l],([y])=>{const k=String(y??""),g=a.value,v=B8({nextContent:k,persistedContent:g?s?.get(g):void 0,currentState:{settledContent:c.value,streamedDelta:u.value},typewriterEnabled:l.value});c.value=v.settledContent,u.value=v.streamedDelta,v.appended?(d.value+=1,(function(){if(!u.value||f||!i)return;const b=i.value;f=et(()=>i.value,A=>{A!==b&&p()},{flush:"sync"})})()):u.value||h(),g&&s?.set(g,k)},{immediate:!0}),Mf(h);const m=D(()=>d.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(y,k)=>(x(),E("span",{class:We([[e.node.center?"text-node-center":""],"text-node"])},[c.value?(x(),E("span",Yte,R(c.value),1)):ue("",!0),u.value?(x(),E("span",{key:1,class:We(["text-node-stream-delta",[m.value]]),onAnimationend:p},R(u.value),35)):ue("",!0)],2))}}),[["__scopeId","data-v-a7e90764"]]);function Sd(e,t,n){return Qe({name:e,inheritAttrs:!1,setup(o,{attrs:s,slots:i}){var r,l;const a=O2(),c=$2(),u=F2(),d=typeof window<"u"&&((l=(r=bo())==null?void 0:r.vnode.el)==null?void 0:l.nodeType)===1,f=ne(typeof window>"u"||d||!u.value),h=gr(null);let p=null;function m(y){const k=y&&"$el"in y?y.$el:y;h.value=k instanceof HTMLElement?k:null}return typeof window<"u"&&et([h,u],([y,k],g,v)=>{if(p?.destroy(),p=null,!k||f.value)return void(f.value=!0);if(!y)return;let b=!0;const A=a(y,{rootMargin:c?.value.heavyBlockMargin,allowIdle:!1});p=A,f.value=A.isVisible.value,A.whenVisible.then(()=>{b&&p===A&&(f.value=!0)}),v(()=>{b=!1,A.destroy(),p===A&&(p=null)})},{immediate:!0}),so(()=>{p?.destroy(),p=null}),()=>Ft(f.value?t:n,Bt(st({},s),{ref:m}),i)}})}ro.install=e=>{e.component(ro.__name,ro)};const Fm=Qe({name:"CodeBlockNodeLoading",inheritAttrs:!1,props:["node","isDark","loading","stream","theme","darkTheme","lightTheme","isShowPreview","monacoOptions","enableFontSizeControl","minWidth","maxWidth","themes","showHeader","showCopyButton","showExpandButton","showPreviewButton","showCollapseButton","showFontSizeButtons","showTooltips","htmlPreviewAllowScripts","htmlPreviewSandbox","customId","estimatedHeightPx","estimatedContentHeightPx","estimatedDiffInline"],emits:["previewCode","copy"],setup(e,{attrs:t}){const n=e;return()=>{var o,s,i,r,l,a,c;const u=U1(String((s=(o=n.node)==null?void 0:o.language)!=null?s:"")),d=jC[u]||(u?u.charAt(0).toUpperCase()+u.slice(1):jC[""]),f=Dte(n.node),h=Pte(String((r=(i=n.node)==null?void 0:i.raw)!=null?r:""),d,f),p=n.monacoOptions,m=f&&((l=n.estimatedDiffInline)!=null?l:R2(p??{},typeof window>"u"?0:window.innerWidth)),y=p?.diffAppearance,k=y==="dark"||y!=="light"&&n.isDark===!0,g=typeof p?.fontSize=="number"&&Number.isFinite(p.fontSize)&&p.fontSize>0?p.fontSize:12,v=typeof p?.lineHeight=="number"&&Number.isFinite(p.lineHeight)&&p.lineHeight>0?p.lineHeight:g===12?18:Math.max(12,Math.round(1.5*g)),b=typeof p?.tabSize=="number"&&Number.isFinite(p.tabSize)&&p.tabSize>0?p.tabSize:4,A=f?0:8,I=typeof((a=p?.padding)==null?void 0:a.top)=="number"&&Number.isFinite(p.padding.top)&&p.padding.top>=0?p.padding.top:A,T=typeof((c=p?.padding)==null?void 0:c.bottom)=="number"&&Number.isFinite(p.padding.bottom)&&p.padding.bottom>=0?p.padding.bottom:A,M=typeof p?.fontFamily=="string"?p.fontFamily.trim():"",$=st(st({fontSize:`${g}px`,lineHeight:`${v}px`,tabSize:b,paddingTop:`${I}px`,paddingBottom:`${T}px`,"--markstream-pre-line-number-top":`${I}px`},f?{"--markstream-pre-diff-line-height":`${v}px`}:{}),M?{"--markstream-code-font-family":M}:{}),N=()=>Ft("button",{class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0","aria-hidden":"true",disabled:!0,tabindex:-1,type:"button"},[Ft("svg",{class:"action-icon"})]),F=n.isShowPreview!==!1&&(u==="html"||u==="svg"),S=n.showFontSizeButtons!==!1&&n.enableFontSizeControl!==!1||n.showExpandButton!==!1||F&&n.showPreviewButton!==!1,B=z=>{if(z!=null)return typeof z=="number"?`${z}px`:String(z)},W=st(st(st({"--markstream-code-layout-character-width":"1ch"},B(n.minWidth)?{minWidth:B(n.minWidth)}:{}),B(n.maxWidth)?{maxWidth:B(n.maxWidth)}:{}),f?{}:{color:"var(--vscode-editor-foreground, var(--markstream-code-fallback-fg, var(--code-fg)))",backgroundColor:"var(--vscode-editor-background, var(--markstream-code-fallback-bg, var(--code-bg)))",borderColor:"var(--markstream-code-border-color, var(--code-border))"});return Ft("div",Bt(st({},t),{class:["code-block-container","rounded-lg","border",{dark:n.isDark===!0,"is-rendering":n.loading!==!1,"is-dark":k,"is-diff":f,"is-plain-text":u===""||u==="plaintext"||u==="text"},t.class],style:[W,t.style],"data-markstream-code-block":"1","data-markstream-enhanced":"false","data-markstream-code-block-state":n.loading?"streaming":"settled","data-markstream-code-loading":"1"}),[n.showHeader===!1?null:Ft("div",{class:"code-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)] border-[var(--code-border)] bg-[var(--code-header-bg)] text-[var(--code-fg)]"},[Ft("div",{class:"code-header-main"},[Ft("span",{class:"icon-slot h-4 w-4 flex-shrink-0"}),Ft("div",{class:"code-header-copy"},[Ft("div",{class:"code-header-title"},h.title),h.caption?Ft("div",{class:"code-header-caption"},h.caption):null])]),Ft("div",{class:"flex items-center gap-0.5",style:{visibility:"hidden"}},[f?Ft("div",{class:"code-diff-stats","aria-hidden":"true"},[Ft("span",{class:"code-diff-stat removed"},"-0"),Ft("span",{class:"code-diff-stat added"},"+0")]):null,n.showCopyButton===!1?null:N(),n.showCollapseButton===!1?null:N(),S?Ft("div",{class:"relative"},[N()]):null])]),Ft("div",{class:"code-block-shell-content",style:n.stream!==!1||n.loading===!1?void 0:{display:"none"}},[Ft(Is,{node:n.node,loading:n.loading,showLineNumbers:!0,reservedHeightPx:f?void 0:n.estimatedContentHeightPx,diffInline:m,diffHideUnchangedRegions:f?Bte(p?.diffHideUnchangedRegions):void 0,class:"code-pre-fallback",style:$,"data-markstream-code-loading":"1"})]),Ft("div",{class:"code-loading-placeholder",style:n.stream===!1&&n.loading!==!1?void 0:{display:"none"}},[Ft("div",{class:"loading-skeleton"},[Ft("div",{class:"skeleton-line"}),Ft("div",{class:"skeleton-line"}),Ft("div",{class:"skeleton-line short"})])]),Ft("span",{class:"sr-only","aria-live":"polite",role:"status"})])}}}),ov=Sd("ViewportDeferredCodeBlockNode",Hi({loader:()=>Vn(null,null,function*(){try{return(yield ps(()=>import("./CodeBlockNode-BL_lWHk1.js"),__vite__mapDeps([4,5]))).default}catch(e){return console.warn('[markstream-vue] Optional peer dependency stream-diffs is missing. Falling back to preformatted code rendering. To enable enhanced code block features, please install "stream-diffs".',e),Is}}),loadingComponent:Fm,delay:0,suspensible:!1}),Fm),Gi=Hi(()=>Vn(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,o,s,i;return Ft(ro,Bt(st({},t),{node:{type:"text",content:(o=t.node.raw)!=null?o:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(s=t.node.content)!=null?s:""}$`}}))};try{return yield z8(),(yield ps(()=>import("./index7-DSRe_h5d.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,o,s,i;return Ft(ro,Bt(st({},t),{node:{type:"text",content:(o=t.node.raw)!=null?o:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(s=t.node.content)!=null?s:""}$`}}))}})),oE=Hi(()=>Vn(null,null,function*(){try{return yield z8(),(yield ps(()=>import("./index6-BiWLUsB3.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,o,s;return Ft(ro,Bt(st({},e),{node:{type:"text",content:(n=e.node.raw)!=null?n:`$$${(t=e.node.content)!=null?t:""}$$`,raw:(s=e.node.raw)!=null?s:`$$${(o=e.node.content)!=null?o:""}$$`}}))}})),vs=_n(Qe({__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]=o=>t.$emit("click",o,e.node.id,e.messageId,e.threadId)),onMouseenter:n[1]||(n[1]=o=>t.$emit("mouseEnter",o,e.node.id,e.messageId,e.threadId)),onMouseleave:n[2]||(n[2]=o=>t.$emit("mouseLeave",o,e.node.id,e.messageId,e.threadId))},R(e.node.id),33))}),[["__scopeId","data-v-775c65e4"]]);vs.install=e=>{e.component(vs.__name,vs)};const Zte={class:"superscript-node"},Rs=_n(Qe({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=wo(()=>t.customId),o=D(()=>st({text:ro,inline_code:rs,link:bs,html_inline:oi,strong:ys,emphasis:xs,footnote_reference:ni,strikethrough:ks,highlight:si,insert:Ds,subscript:Bs,emoji:Os,math_inline:Gi,reference:vs},n.value));return(s,i)=>(x(),E("sup",Zte,[(x(!0),E(Pe,null,lt(e.node.children,(r,l)=>(x(),Ae(C(vr),{key:`${e.indexKey||"superscript"}-${l}`,components:o.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"]]);Rs.install=e=>{e.component(Rs.__name,Rs)};const Xte={class:"subscript-node"},Bs=_n(Qe({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=wo(()=>t.customId),o=D(()=>st({text:ro,inline_code:rs,link:bs,html_inline:oi,strong:ys,emphasis:xs,footnote_reference:ni,strikethrough:ks,highlight:si,insert:Ds,superscript:Rs,emoji:Os,math_inline:Gi,reference:vs},n.value));return(s,i)=>(x(),E("sub",Xte,[(x(!0),E(Pe,null,lt(e.node.children,(r,l)=>(x(),Ae(C(vr),{key:`${e.indexKey||"subscript"}-${l}`,components:o.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"]]);Bs.install=e=>{e.component(Bs.__name,Bs)};const Qte={class:"strong-node"},ys=_n(Qe({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=wo(()=>t.customId),o=D(()=>st({text:ro,inline_code:rs,link:bs,html_inline:oi,emphasis:xs,strikethrough:ks,highlight:si,insert:Ds,subscript:Bs,superscript:Rs,emoji:Os,footnote_reference:ni,math_inline:Gi,reference:vs},n.value));return(s,i)=>(x(),E("strong",Qte,[(x(!0),E(Pe,null,lt(e.node.children,(r,l)=>(x(),Ae(C(vr),{key:`${e.indexKey||"strong"}-${l}`,components:o.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"]]);ys.install=e=>{e.component(ys.__name,ys)};const Jte={class:"strikethrough-node"},ks=_n(Qe({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=wo(()=>t.customId),o=D(()=>st({text:ro,inline_code:rs,link:bs,html_inline:oi,strong:ys,emphasis:xs,highlight:si,insert:Ds,subscript:Bs,superscript:Rs,emoji:Os,footnote_reference:ni,math_inline:Gi,reference:vs},n.value));return(s,i)=>(x(),E("del",Jte,[(x(!0),E(Pe,null,lt(e.node.children,(r,l)=>(x(),Ae(C(vr),{key:`${e.indexKey||"strikethrough"}-${l}`,components:o.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"]]);ks.install=e=>{e.component(ks.__name,ks)};const ene=["href","title","aria-label","aria-hidden","target","rel"],tne=["aria-hidden"],nne={class:"link-text-wrapper relative inline-flex"},one={class:"leading-[normal] link-text"},bs=_n(Qe({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=Jt("markstreamShowTooltips",void 0),o=D(()=>{const k=n?.value;return typeof k=="boolean"?k:t.showTooltip}),s=D(()=>{var k,g,v,b,A;const I=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",T=(k=t.animationOpacity)!=null?k:.35,M=Math.max(.12,Math.min(.5*T,T)),$={"--underline-height":`${(g=t.underlineHeight)!=null?g:2}px`,"--underline-bottom":I,"--underline-opacity":String(T),"--underline-rest-opacity":String(M),"--underline-duration":`${(v=t.animationDuration)!=null?v:1.6}s`,"--underline-timing":(b=t.animationTiming)!=null?b:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(A=t.animationIteration)!=null?A:"infinite"};return t.color&&($["--link-color"]=t.color),$}),i=wo(()=>t.customId),r=D(()=>st({text:ro,strong:ys,strikethrough:ks,emphasis:xs,image:$l,html_inline:oi,inline_code:rs},i.value)),l=If(),a=D(()=>{var k,g;const v=(k=t.node)==null?void 0:k.attrs;if(!v||typeof v!="object")return{};const b={};if(Array.isArray(v))for(const A of v)Array.isArray(A)&&A[0]&&(b[String(A[0])]=String((g=A[1])!=null?g:""));else for(const[A,I]of Object.entries(v))A&&I!=null&&I!==!1&&(b[A]=I===!0?"":String(I));return s4(b,"safe","a")}),c=D(()=>st(st({},l),a.value)),u=D(()=>{var k,g;return s4({href:String((g=(k=t.node)==null?void 0:k.href)!=null?g:"")},"safe","a").href}),d=D(()=>{if(!u.value)return;const k=c.value.target;return(typeof k=="string"?k.trim():String(k??"").trim())||(XG(u.value)?"_blank":void 0)}),f=D(()=>{var k;return String((k=d.value)!=null?k:"").trim().toLowerCase()==="_blank"}),h=D(()=>{if(!u.value)return;const k=c.value.rel,g=new Set((typeof k=="string"?k:String(k??"")).split(/\s+/).filter(Boolean)),v=new Set(Array.from(g).filter(b=>b.toLowerCase()!=="opener"));return f.value&&(v.add("noopener"),v.add("noreferrer")),v.size>0?Array.from(v).join(" "):void 0}),p=D(()=>{const k=st({},c.value);return delete k.title,delete k.href,delete k.target,delete k.rel,k});function m(){o.value&&wte()}const y=D(()=>{var k,g;const v=(k=t.node)==null?void 0:k.title;return typeof v=="string"&&v.trim().length>0?v:String((g=u.value)!=null?g:"")});return(k,g)=>{var v,b;return e.node.loading?(x(),E("span",bn({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},C(l),{style:s.value}),[_("span",nne,[_("span",one,[fe(C(ro),{class:"leading-[normal] link-text",node:{type:"text",content:String((v=e.node.text)!=null?v:""),raw:String((b=e.node.text)!=null?b:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),g[1]||(g[1]=_("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,tne)):(x(),E("a",bn({key:0,class:"link-node",href:u.value,title:o.value?"":y.value,"aria-label":`Link: ${y.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:h.value},p.value,{style:s.value,onMouseenter:g[0]||(g[0]=A=>(function(I){var T,M,$,N;if(!o.value)return;const F=I,S=F?.clientX!=null&&F?.clientY!=null?{x:F.clientX,y:F.clientY}:void 0,B=((T=t.node)==null?void 0:T.title)||((M=u.value)!=null&&M.includes("xn--")&&((N=($=t.node)==null?void 0:$.text)!=null&&N.includes("://"))?t.node.text:u.value)||"";xte(I.currentTarget,B,"top",!1,S)})(A)),onMouseleave:m}),[(x(!0),E(Pe,null,lt(e.node.children,(A,I)=>(x(),Ae(C(vr),{key:`${e.indexKey||"emphasis"}-${I}`,components:r.value,node:A,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${I}`},null,8,["components","node","custom-id","index-key"]))),128))],16,ene))}}}),[["__scopeId","data-v-367e6ca4"]]);bs.install=e=>{e.component(bs.__name,bs)};const sne={class:"insert-node"},Ds=_n(Qe({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=wo(()=>t.customId),o=D(()=>st({text:ro,inline_code:rs,link:bs,html_inline:oi,strong:ys,emphasis:xs,strikethrough:ks,highlight:si,subscript:Bs,superscript:Rs,emoji:Os,footnote_reference:ni,math_inline:Gi,reference:vs},n.value));return(s,i)=>(x(),E("ins",sne,[(x(!0),E(Pe,null,lt(e.node.children,(r,l)=>(x(),Ae(C(vr),{key:`${e.indexKey||"insert"}-${l}`,components:o.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"]]);Ds.install=e=>{e.component(Ds.__name,Ds)};const ine={class:"highlight-node"},si=_n(Qe({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=wo(()=>t.customId),o=D(()=>st({text:ro,inline_code:rs,link:bs,html_inline:oi,strong:ys,emphasis:xs,strikethrough:ks,insert:Ds,subscript:Bs,superscript:Rs,emoji:Os,footnote_reference:ni,math_inline:Gi,reference:vs},n.value));return(s,i)=>(x(),E("mark",ine,[(x(!0),E(Pe,null,lt(e.node.children,(r,l)=>(x(),Ae(C(vr),{key:`${e.indexKey||"highlight"}-${l}`,components:o.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"]]);si.install=e=>{e.component(si.__name,si)};const rne={class:"emphasis-node"},xs=_n(Qe({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=wo(()=>t.customId),o=D(()=>st({text:ro,inline_code:rs,link:bs,html_inline:oi,strong:ys,strikethrough:ks,highlight:si,insert:Ds,subscript:Bs,superscript:Rs,emoji:Os,footnote_reference:ni,math_inline:Gi,reference:vs},n.value));return(s,i)=>(x(),E("em",rne,[(x(!0),E(Pe,null,lt(e.node.children,(r,l)=>(x(),Ae(C(vr),{key:`${e.indexKey||"emphasis"}-${l}`,components:o.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"]]);xs.install=e=>{e.component(xs.__name,xs)};const lne={class:"hard-break"},Fl=_n(Qe({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(x(),E("br",lne))}),[["__scopeId","data-v-50c58f70"]]);Fl.install=e=>{e.component(Fl.__name,Fl)};const wf=Qe({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=yt({checkbox:ti,checkbox_input:ti,emoji:Os,emphasis:xs,hardbreak:Fl,highlight:si,inline_code:rs,insert:Ds,link:bs,reference:vs,strikethrough:ks,strong:ys,subscript:Bs,superscript:Rs,text:ro}),o=wo(()=>t.customId),s=D(()=>{const i=o.value;return Object.keys(i).length>0?st(st({},n),i):n});return(i,r)=>(x(!0),E(Pe,null,lt(e.nodes,(l,a)=>(x(),Ae(C(vr),{key:a,components:s.value,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"inline"}-${a}`},null,8,["components","node","custom-id","index-key"]))),128))}});function qy(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(qy)}function Om(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(qy))return e;if(!t||e.length!==1)return null;const o=e[0];if(o?.type!=="paragraph"||!Array.isArray(o.children))return null;const s=o.children;return(n||s.length>0)&&s.every(qy)?s:null}function Va(e){var t,n;if(!e?.length)return null;let o="";for(const s of e){if(s?.type!=="text"||s.center===!0)return null;o+=String((n=(t=s.content)!=null?t:s.raw)!=null?n:"")}return o}const ane=["cite"],cne={key:0,dir:"auto",class:"paragraph-node"},une=["custom-id"],Ip=_n(Qe({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=wo(()=>t.customId),o=D(()=>!!n.value.paragraph),s=D(()=>!!n.value.text),i=D(()=>Om(t.node.children,!o.value)),r=D(()=>t.fade!==!1||s.value?null:Va(i.value));return En("markstreamShowTooltips",D(()=>t.showTooltips)),En("markstreamFade",D(()=>t.fade)),(l,a)=>(x(),E("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[i.value?(x(),E("p",cne,[r.value!==null?(x(),E("span",{key:0,class:"text-node","custom-id":t.customId},R(r.value),9,une)):(x(),Ae(C(wf),{key:1,nodes:i.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(x(),Ae(C(Ps),{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,ane))}}),[["__scopeId","data-v-abfecebc"]]);Ip.install=e=>{e.component(Ip.__name,Ip)};const dne={class:"definition-list"},fne={class:"definition-term"},hne={class:"definition-desc"},Lp=_n(Qe({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,o)=>(x(),E("dl",dne,[(x(!0),E(Pe,null,lt(t.node.items,(s,i)=>(x(),E(Pe,{key:i},[_("dt",fne,[fe(C(Ps),{"index-key":`definition-term-${t.indexKey}-${i}`,nodes:s.term,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:o[0]||(o[0]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])]),_("dd",hne,[fe(C(Ps),{"index-key":`definition-desc-${t.indexKey}-${i}`,nodes:s.definition,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:o[1]||(o[1]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],64))),128))]))}}),[["__scopeId","data-v-4e103b30"]]);Lp.install=e=>{e.component(Lp.__name,Lp)};const pne=["href","title"],Vd=_n(Qe({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const t=e;function n(o){var s;if(o.preventDefault(),typeof document>"u")return;const i=`fnref-${String((s=t.node.id)!=null?s:"")}`,r=document.getElementById(i);r&&r.scrollIntoView({behavior:"smooth",block:"center"})}return(o,s)=>(x(),E("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,pne))}}),[["__scopeId","data-v-e1eb37b6"]]);Vd.install=e=>{e.component(Vd.__name,Vd)};const mne=["id"],gne={class:"flex-1"},$p=Qe({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,o)=>(x(),E("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[_("div",gne,[fe(C(Ps),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:o[0]||(o[0]=s=>n.$emit("copy",s))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],8,mne))}});$p.install=e=>{e.component($p.__name,$p)};const vne=["custom-id"],jy=_n(Qe({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=wo(()=>t.customId),o=Jt("markstreamFade",void 0),s=D(()=>o?.value!==!1||n.value.text?null:Va(t.node.children)),i=D(()=>st({text:ro,inline_code:rs,link:bs,image:$l,strong:ys,emphasis:xs,strikethrough:ks,highlight:si,insert:Ds,subscript:Bs,superscript:Rs,emoji:Os,checkbox:ti,checkbox_input:ti,footnote_reference:ni,hardbreak:Fl,math_inline:Gi,reference:vs},n.value));return(r,l)=>(x(),Ae(Ro(`h${e.node.level}`),bn({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:Le(()=>[s.value!==null?(x(),E("span",{key:0,class:"text-node","custom-id":t.customId},R(s.value),9,vne)):(x(!0),E(Pe,{key:1},lt(e.node.children,(a,c)=>(x(),Ae(C(vr),{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"]]),V1=jy;V1.install=e=>{e.component(jy.__name,jy)};const yne={key:0,dir:"auto",class:"paragraph-node"},kne=["custom-id"],bne={dir:"auto",class:"paragraph-node"},xne=["custom-id"],uu=_n(Qe({__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=D(()=>{var h;return(h=t.node)!=null?h:t.item}),o=wo(()=>t.customId),s=D(()=>!!o.value.paragraph),i=D(()=>!!o.value.text),r=D(()=>{var h;return Om((h=n.value)==null?void 0:h.children,!s.value)}),l=D(()=>{var h;if(s.value)return null;const p=(h=n.value)==null?void 0:h.children;if(!Array.isArray(p)||p.length<2)return null;const m=p[0];if(m?.type!=="paragraph"||!Array.isArray(m.children))return null;const y=p.slice(1);if(!y.every(g=>g?.type==="list"))return null;const k=Om([m]);return k?{paragraphChildren:k,nestedLists:y}:null});function a(){return t.fade===!1&&!i.value}const c=D(()=>a()?Va(r.value):null),u=D(()=>{var h;return a()?Va((h=l.value)==null?void 0:h.paragraphChildren):null}),d=Object.freeze({}),f=D(()=>{const{value:h}=t;return typeof h=="number"&&Number.isFinite(h)?{value:h}:d});return En("markstreamShowTooltips",D(()=>t.showTooltips)),En("markstreamFade",D(()=>t.fade)),(h,p)=>{var m,y;return x(),E("li",bn({class:"list-item",dir:"auto"},f.value),[r.value?(x(),E("p",yne,[c.value!==null?(x(),E("span",{key:0,class:"text-node","custom-id":t.customId},R(c.value),9,kne)):(x(),Ae(C(wf),{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(Pe,{key:1},[_("p",bne,[u.value!==null?(x(),E("span",{key:0,class:"text-node","custom-id":t.customId},R(u.value),9,xne)):(x(),Ae(C(wf),{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(Pe,null,lt(l.value.nestedLists,(k,g)=>(x(),Ae(C(Ps),{key:g,nodes:[k],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${g}`,"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:p[0]||(p[0]=v=>h.$emit("copy",v))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade","is-dark"]))),128))],64)):(x(),Ae(C(Ps),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(y=(m=n.value)==null?void 0:m.children)!=null?y:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,onCopy:p[1]||(p[1]=k=>h.$emit("copy",k))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade","is-dark"]))],16)}}}),[["__scopeId","data-v-617214f9"]]);uu.install=e=>{e.component(uu.__name,uu)};const du=_n(Qe({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=wo(()=>e.customId),n=D(()=>t.value.list_item||uu);return(o,s)=>(x(),Ae(Ro(e.node.ordered?"ol":"ul"),{class:We(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:Le(()=>[(x(!0),E(Pe,null,lt(e.node.items,(i,r)=>{var l;return x(),Ae(Ro(n.value),bn({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:s[0]||(s[0]=a=>o.$emit("copy",a))}),null,16,["node","custom-id","index-key","typewriter","fade","is-dark","value"])}),128))]),_:1},8,["class"]))}}),[["__scopeId","data-v-99cb95e0"]]);du.install=e=>{e.component(du.__name,du)};const wne={key:2,class:"html-block-node__raw"},_ne=["innerHTML"],Sne={key:1,class:"html-block-node__placeholder"},Kd=_n(Qe({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Jt("markstreamHtmlPolicy",void 0),o=Jt("markstreamNestedRendererProps",void 0),s=D(()=>{var S,B;return(B=(S=t.htmlPolicy)!=null?S:n?.value)!=null?B:"safe"}),i=D(()=>{var S,B;const W=(S=o?.value)!=null?S:{};return Bt(st({},W),{customId:(B=t.customId)!=null?B:W.customId,htmlPolicy:s.value})}),r=Hi({loader:()=>Promise.resolve().then(()=>V2),suspensible:!1}),l=D(()=>{const S=Mp(t.node.attrs,s.value);if(!S)return;const B=zd(S);return Object.keys(B).length>0?B:void 0}),a=D(()=>{const S=String(t.node.tag||"").trim(),B=Mp(t.node.attrs,s.value,S);if(!B)return;const W=zd(B);return Object.keys(W).length>0?W:void 0}),c=wo(()=>t.customId),u=Qe({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=ne(null),f=ne(typeof window>"u"),h=ne(t.node.content),p=D(()=>Array.isArray(t.node.children)?t.node.children:[]),m=D(()=>String(t.node.tag||"div")),y=D(()=>{var S;if(m.value.trim().toLowerCase()!=="details"||(S=t.node.attrs)!=null&&S.some(([W])=>String(W).toLowerCase()==="open"))return null;const B=p.value[0];return B?.type==="html_block"&&String(B.tag||"").toLowerCase()==="summary"?B:null}),k=D(()=>{var S;return Va((S=y.value)==null?void 0:S.children)}),g=D(()=>{const S=y.value;if(!S)return;const B=Mp(S.attrs,s.value,"summary");if(!B)return;const W=zd(B);return Object.keys(W).length>0?W:void 0}),v=D(()=>k.value==null?p.value:p.value.slice(1)),b=D(()=>{const S=m.value.trim().toLowerCase();return C5.has(S)||M2(S,s.value)}),A=D(()=>p.value.length>0&&!!t.node.tag&&!b.value),I=D(()=>{var S,B,W;if(A.value)return{mode:"structured"};if(!f.value)return{mode:"html",content:(S=h.value)!=null?S:""};const z=(B=h.value)!=null?B:t.node.content;if(!z)return{mode:"html",content:""};if(s.value==="escape")return{mode:"html",content:cu(z,s.value)};if(t.node.loading){const O=$m(z,c.value,s.value);return O===null?{mode:"text",content:(W=t.node.raw)!=null?W:z}:{mode:"dynamic",nodes:O}}if(!Z8(z,c.value))return{mode:"html",content:cu(z,s.value)};const L=$m(z,c.value,s.value);return L===null?{mode:"html",content:cu(z,s.value)}:{mode:"dynamic",nodes:L}}),T=O2(),M=$2(),$=F2(),N=gr(null),F=!!t.node.loading;return typeof window<"u"?(et([()=>d.value,()=>M?.value.heavyBlockMargin,()=>M?.value.rootMargin],([S],B,W)=>{var z,L,O,j;if((L=(z=N.value)==null?void 0:z.destroy)==null||L.call(z),N.value=null,!F)return f.value=!0,void(h.value=t.node.content);if(!S)return void(f.value=!1);let Z=!0;const ie=(j=(O=M?.value.heavyBlockMargin)!=null?O:M?.value.rootMargin)!=null?j:ja,U=T(S,{rootMargin:ie,allowIdle:!$.value});N.value=U,f.value=f.value||U.isVisible.value,U.whenVisible.then(()=>{Z&&N.value===U&&(f.value=!0)}),W(()=>{Z=!1,U.destroy(),N.value===U&&(N.value=null)})},{immediate:!0}),et(()=>t.node.content,S=>{F&&!f.value||(h.value=S)})):f.value=!0,so(()=>{var S,B;(B=(S=N.value)==null?void 0:S.destroy)==null||B.call(S),N.value=null}),(S,B)=>(x(),Ae(Ro(A.value?m.value:"div"),bn({ref_key:"htmlRef",ref:d,class:"html-block-node","data-markstream-viewport-pending":C($)&&!f.value?"true":void 0},A.value?a.value:void 0),{default:Le(()=>[f.value?(x(),E(Pe,{key:0},[I.value.mode==="structured"?(x(),E(Pe,{key:0},[k.value!==null?(x(),E(Pe,{key:0},[_("summary",r9(dM(g.value)),R(k.value),17),v.value.length?(x(),Ae(C(r),bn({key:0},i.value,{nodes:v.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):ue("",!0)],64)):(x(),Ae(C(r),bn({key:1},i.value,{nodes:p.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"]))],64)):I.value.mode==="dynamic"?(x(),Ae(C(u),{key:1,nodes:I.value.nodes},null,8,["nodes"])):I.value.mode==="text"?(x(),E("pre",wne,R(I.value.content),1)):(x(),E("div",bn({key:3},l.value,{innerHTML:I.value.content}),null,16,_ne))],64)):(x(),E("div",Sne,[zn(S.$slots,"placeholder",{node:e.node},()=>[B[0]||(B[0]=_("span",{class:"html-block-node__placeholder-bar"},null,-1)),B[1]||(B[1]=_("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),B[2]||(B[2]=_("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16,["data-markstream-viewport-pending"]))}}),[["__scopeId","data-v-e140a874"]]);Kd.install=e=>{e.component(Kd.__name,Kd)};const Cne={dir:"auto",class:"paragraph-node"},Ane=["custom-id"],Ha=_n(Qe({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=wo(()=>t.customId),o=Jt("markstreamHtmlPolicy",void 0),s=Jt("markstreamFade",void 0),i=Jt("markstreamParseOptions",void 0),r=Jt("markstreamCustomMarkdownIt",void 0),l=Jt("markstreamNestedRendererProps",void 0),a=D(()=>{var M;return(M=o?.value)!=null?M:"safe"}),c=D(()=>{var M;return(M=t.parseOptions)!=null?M:i?.value}),u=D(()=>{var M;return(M=t.customMarkdownIt)!=null?M:r?.value}),d=D(()=>{var M,$;return($=t.customHtmlTags)!=null?$:(M=l?.value)==null?void 0:M.customHtmlTags}),f=D(()=>{var M,$;const N=(M=l?.value)!=null?M:{};return Bt(st({},N),{customId:($=t.customId)!=null?$:N.customId,customHtmlTags:d.value,parseOptions:c.value,customMarkdownIt:u.value,htmlPolicy:a.value})}),h=Hi({loader:()=>Promise.resolve().then(()=>V2),suspensible:!1});function p(M){var $;return M.type==="text"&&String(($=M.content)!=null?$:"").trim()===""}const m=D(()=>t.node.children.filter(M=>!p(M))),y=D(()=>m.value.length>0&&m.value.every(M=>M.type==="image"||(function($){var N;const F=(function(S){return S.type==="link"&&Array.isArray(S.children)?S.children.filter(B=>!p(B)):[]})($);return F.length===1&&((N=F[0])==null?void 0:N.type)==="image"})(M))),k=D(()=>new Set(tc(d.value))),g=D(()=>{if(!y.value||m.value.length<=1)return t.node.children;const M=[];for(let $=0;$<t.node.children.length;$++){const N=t.node.children[$];if(!p(N)){M.push(N);continue}const F=M.length>0,S=t.node.children.slice($+1).some(B=>!p(B));F&&S&&M.push(Bt(st({},N),{content:" ",raw:" "}))}return M}),v=D(()=>s?.value===!1&&!n.value.text),b=D(()=>v.value?Va(g.value):null);function A(M,$){return{node:M,"index-key":`${t.indexKey}-${$}`,"custom-id":t.customId,"custom-html-tags":d.value}}const I=D(()=>st({inline_code:rs,image:$l,link:bs,hardbreak:Fl,emphasis:xs,strong:ys,strikethrough:ks,highlight:si,insert:Ds,subscript:Bs,superscript:Rs,html_inline:oi,html_block:Kd,emoji:Os,checkbox:ti,math_inline:Gi,checkbox_input:ti,reference:vs,footnote_anchor:Vd,footnote_reference:ni,text:ro},n.value)),T=D(()=>g.value.map((M,$)=>{var N;const F=(function(S){var B,W,z,L;if(S.type==="html_block"||S.type==="html_inline"){const O=String((B=S.tag)!=null?B:"").trim().toLowerCase()||N5(S.content);if(O&&!k.value.has(O)&&I5((W=S.content)!=null?W:S.raw,O)){const j=String((L=(z=S.content)!=null?z:S.raw)!=null?L:"");return{child:{type:"text",content:j,raw:j},component:ro,isCustomComponent:!1}}}return{child:S,component:I.value[S.type],isCustomComponent:!!(n.value[S.type]&&!Wf(String(S.type)))}})(M);return Bt(st({},F),{index:$,key:`${t.indexKey||"paragraph"}-${$}`,customAttrs:F.isCustomComponent?L2(F.child,a.value):void 0,hasSlotChildren:Array.isArray(F.child.children)&&F.child.children.length>0,slotContent:String((N=F.child.content)!=null?N:""),originalChild:M})}));return(M,$)=>(x(),E("p",Cne,[b.value!==null?(x(),E("span",{key:0,class:"text-node","custom-id":t.customId},R(b.value),9,Ane)):(x(!0),E(Pe,{key:1},lt(T.value,N=>{return x(),E(Pe,{key:N.key},[y.value&&p(N.originalChild)?(x(),E(Pe,{key:0},[nt(R((F=N.originalChild,String((S=F.content)!=null?S:""))),1)],64)):N.isCustomComponent?(x(),Ae(Ro(N.component),bn({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":f.value.isDark}),{default:Le(()=>[N.hasSlotChildren?(x(),Ae(C(h),bn({key:0,ref_for:!0},f.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(),Ae(C(h),bn({key:1,ref_for:!0},f.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"])):ue("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(x(),Ae(Ro(N.component),bn({key:2,ref_for:!0},A(N.child,N.index)),null,16))],64);var F,S}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);Ha.install=e=>{e.component(Ha.__name,Ha)};const Mne={class:"table-node-wrapper"},Ene=["aria-busy"],Tne={key:0},Nne=["custom-id"],Ine=["aria-label","onPointerdown"],Lne=["custom-id"],$ne={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},Gd=_n(Qe({__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=D(()=>{var k;return(k=t.node.loading)!=null&&k}),o=D(()=>{var k;return(k=t.node.rows)!=null?k:[]}),s=ne(null),i=ne([]);let r=null;const l=D(()=>t.node.header.cells.length),a=D(()=>i.value.some(k=>Number.isFinite(k)&&k>0)),c=D(()=>a.value?i.value.map(k=>k>0?{width:`${k}px`}:void 0):[]);En("markstreamShowTooltips",D(()=>t.showTooltips)),En("markstreamFade",D(()=>t.fade));const u=wo(()=>t.customId),d=D(()=>!!u.value.text),f=D(()=>!!u.value.paragraph),h=new WeakMap;function p(k){const g=t.fade===!1&&!d.value,v=!f.value,b=h.get(k);if(b?.children===k.children&&b.textFastPath===g&&b.paragraphFastPath===v)return b.info;const A=Om(k.children,v,!0),I={simpleChildren:A,plainText:A&&g?Va(A):null};return h.set(k,{children:k.children,textFastPath:g,paragraphFastPath:v,info:I}),I}function m(k){if(!r)return;k.preventDefault();const g=r.startWidth+r.nextStartWidth,v=Math.min(48,Math.floor(g/2)),b=Math.max(v,Math.min(g-v,Math.round(r.startWidth+k.clientX-r.startX))),A=[...r.widths];A[r.index]=b,A[r.index+1]=g-b,i.value=A}function y(){r&&(window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",y),r=null)}return et(l,()=>{y(),i.value=[]}),so(y),(k,g)=>(x(),E("div",Mne,[_("table",{ref_key:"tableRef",ref:s,class:We(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(x(),E("colgroup",Tne,[(x(!0),E(Pe,null,lt(e.node.header.cells,(v,b)=>(x(),E("col",{key:b,style:tn(c.value[b])},null,4))),128))])):ue("",!0),_("thead",null,[_("tr",null,[(x(!0),E(Pe,null,lt(e.node.header.cells,(v,b)=>(x(),E("th",{key:b,dir:"auto",class:We([v.align==="right"?"text-right":v.align==="center"?"text-center":"text-left"])},[p(v).plainText!==null?(x(),E("span",{key:0,class:"text-node","custom-id":t.customId},R(p(v).plainText),9,Nne)):p(v).simpleChildren?(x(),Ae(C(wf),{key:1,nodes:p(v).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${b}`},null,8,["nodes","custom-id","index-key"])):(x(),Ae(C(Ps),{key:2,nodes:v.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:g[0]||(g[0]=A=>k.$emit("copy",A))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),b<e.node.header.cells.length-1?(x(),E("button",{key:3,type:"button",class:"table-node__resize-handle","aria-label":`Resize columns ${b+1} and ${b+2}`,onPointerdown:A=>(function(I,T){if(T.button!==0)return;const M=(function(){var F;const S=(F=s.value)==null?void 0:F.querySelectorAll("thead th");return Array.from(S??[],B=>Math.round(B.getBoundingClientRect().width))})(),$=M[I],N=M[I+1];$&&N&&(T.preventDefault(),r={index:I,startX:T.clientX,startWidth:$,nextStartWidth:N,widths:M},i.value=M,window.addEventListener("pointermove",m),window.addEventListener("pointerup",y),window.addEventListener("pointercancel",y))})(b,A)},null,40,Ine)):ue("",!0)],2))),128))])]),_("tbody",null,[(x(!0),E(Pe,null,lt(o.value,(v,b)=>(x(),E("tr",{key:b},[(x(!0),E(Pe,null,lt(v.cells,(A,I)=>(x(),E("td",{key:I,class:We([A.align==="right"?"text-right":A.align==="center"?"text-center":"text-left"]),dir:"auto"},[p(A).plainText!==null?(x(),E("span",{key:0,class:"text-node","custom-id":t.customId},R(p(A).plainText),9,Lne)):p(A).simpleChildren?(x(),Ae(C(wf),{key:1,nodes:p(A).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${b}-${I}`},null,8,["nodes","custom-id","index-key"])):(x(),Ae(C(Ps),{key:2,nodes:A.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:g[1]||(g[1]=T=>k.$emit("copy",T))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,Ene),fe(Ua,{name:"table-node-fade"},{default:Le(()=>[n.value?(x(),E("div",$ne,[zn(k.$slots,"loading",{isLoading:n.value},()=>[g[2]||(g[2]=_("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),g[3]||(g[3]=_("span",{class:"sr-only"},"Loading",-1))],!0)])):ue("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);Gd.install=e=>{e.component(Gd.__name,Gd)};const Fne={class:"hr-node"},Fp=_n({},[["render",function(e,t){return x(),E("hr",Fne)}],["__scopeId","data-v-39b2349c"]]);Fp.install=e=>{e.component(Fp.__name,Fp)};const One={class:"unknown-node"},Vy=Qe({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(x(),E("div",One,R(e.node.raw),1))}),Op=_n(Qe({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){const t=e,n=D(()=>`vmr-container vmr-container-${t.node.name}`),o=wo(()=>t.customId),s=D(()=>st({text:ro,paragraph:Ha,heading:V1,inline_code:rs,link:bs,image:$l,strong:ys,emphasis:xs,strikethrough:ks,insert:Ds,subscript:Bs,superscript:Rs,checkbox:ti,checkbox_input:ti,hardbreak:Fl,math_inline:Gi,reference:vs,list:du,math_block:oE,table:Gd},o.value));return(i,r)=>(x(),E("div",bn({class:n.value},e.node.attrs),[(x(!0),E(Pe,null,lt(e.node.children,(l,a)=>{return x(),Ae(Ro((c=l.type,s.value[c]||Vy)),{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"]]);Op.install=e=>{e.component(Op.__name,Op)};const Rne=["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"],h4=[[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 Bne(e){if(e<=255)return Rne[e];let t=0,n=h4.length-1;for(;t<=n;){const o=t+n>>1,s=h4[o];if(e<s[0])n=o-1;else{if(!(e>s[1]))return s[2];t=o+1}}return"L"}const Dne=/[ \t\n\r\f]+/g,Pne=/[\t\n\r\f]| {2,}|^ | $/;let sv=null;const Hne=new RegExp("\\p{Script=Arabic}","u"),Ul=new RegExp("\\p{M}","u"),B2=new RegExp("\\p{Nd}","u");function p4(e){return Hne.test(e)}function m4(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>=12592&&e<=12687||e>=44032&&e<=55215||e>=65280&&e<=65519}function dr(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 o=e.charCodeAt(t+1);if(o>=56320&&o<=57343){if(m4(o-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(m4(n))return!0}}return!1}const Wne=new Set([" "," ","","\uFEFF"]),zne=new Set(["-","‐","–","—"]);function sE(e,t){return!((function(n){const o=Yd(n);return o!==null&&Wne.has(o)})(e)||t&&((function(n){const o=Yd(n);return o!==null&&(D2.has(o)||Ka.has(o))})(e)||(function(n){const o=Yd(n);return o!==null&&zne.has(o)})(e)))}const D2=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),K1=new Set(['"',"(","[","{","¡","¿","“","‘","‚","„","«","‹","⸘","(","〔","〈","《","「","『","【","〖","〘","〚"]),P2=new Set(["'","’"]),Ka=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),Une=new Set([":",".","،","؛"]),qne=new Set(["၏"]),jne=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function Vne(e){if(H2(e))return!0;let t=!1;for(const n of e)if(Ka.has(n)||Bm(n))t=!0;else if(!t||!Ul.test(n))return!1;return t}function Kne(e){for(const t of e)if(!D2.has(t)&&!Ka.has(t))return!1;return e.length>0}function Gne(e){if(H2(e))return!0;for(const t of e)if(!(K1.has(t)||P2.has(t)||Ul.test(t)||Bm(t)))return!1;return e.length>0}function H2(e){let t=!1;for(const n of e)if(n!=="\\"&&!Ul.test(n)){if(!(K1.has(n)||Ka.has(n)||P2.has(n)))return!1;t=!0}return t}function Rm(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const o=e.charCodeAt(n);if(o<56320||o>57343)return n;const s=n-1;if(s<0)return n;const i=e.charCodeAt(s);return i>=55296&&i<=56319?s:n}function Yd(e){if(e.length===0)return null;const t=Rm(e,e.length);return e.slice(t)}const Yne=[36,37,43,43,92,92,162,165,176,177,1423,1423,1545,1547,1642,1642,2046,2047,2546,2547,2553,2555,2801,2801,3065,3065,3449,3449,3647,3647,6107,6107,8240,8247,8279,8279,8352,8399,8451,8451,8457,8457,8470,8470,8722,8723,43064,43064,65020,65020,65129,65130,65284,65285,65504,65505,65509,65510,73693,73696,123647,123647,126124,126124,126128,126128];function Bm(e){const t=e.codePointAt(0);return t!==void 0&&(function(n,o){for(let s=0;s<o.length;s+=2)if(n>=o[s]&&n<=o[s+1])return!0;return!1})(t,Yne)}function Zne(e){const t=(function(n){for(const o of n)if(!Ul.test(o))return o;return null})(e);return t!==null&&B2.test(t)}function Xne(e){const t=Array.from(e);let n=t.length;for(;n>0;){const o=t[n-1];if(Ul.test(o))n--;else{if(!K1.has(o)&&!P2.has(o))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function Qne(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function g4(e,t,n,o){const s=t[o],i=e[o];if(s==null)return i;const r=n[o];if(i.length===r)return i;const l=s.repeat(r);return e[o]=l,l}function v4(e,t){return e&&t!==null&&Une.has(t)}function Jne(e){const t=Yd(e);return t!==null&&qne.has(t)}function eoe(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 Ky(e){let t=e.length;for(;t>0;){const n=Rm(e,t),o=e.slice(n,t);if(jne.has(o))return!0;if(!Ka.has(o))return!1;t=n}return!1}function toe(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
|
|
285
|
-
`)return"hard-break"}return e===" "?"space":e===" "||e===" "||e===""||e==="\uFEFF"?"glue":e===""?"zero-width-break":e===""?"soft-hyphen":"text"}const noe=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Bi(e){return e.length===1?e[0]:e.join("")}function ooe(e,t){const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);return n.push(t),Bi(n)}function soe(e,t,n,o){if(!noe.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const s=[];let i=null,r=[],l=n,a=!1,c=0;for(const u of e){const d=toe(u,o),f=d==="text"&&t;i===null||d!==i||f!==a?(i!==null&&s.push({text:Bi(r),isWordLike:a,kind:i,start:l}),i=d,r=[u],l=n+c,a=f,c+=u.length):(r.push(u),c+=u.length)}return i!==null&&s.push({text:Bi(r),isWordLike:a,kind:i,start:l}),s}function iv(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const ioe=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function roe(e,t){const n=e.texts[t];return!!n.startsWith("www.")||ioe.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function loe(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}const aoe=new Set([":","-","/","×",",",".","+","–","—"]),coe=/[\p{P}\p{S}\p{Co}]/u,uoe=new RegExp("\\p{Emoji_Presentation}","u"),doe=new Set(["?","֊","-","‐","‒","–","—","…","‼","‽","⁉"]);function iE(e){const t=e.charCodeAt(0);return t<128?(function(n){return n>=33&&n<=47&&n!==45||n>=58&&n<=64&&n!==63||n>=91&&n<=96||n>=123&&n<=126})(t):!doe.has(e)&&!uoe.test(e)&&coe.test(e)}function y4(e){let t=!1;for(const n of e)if(!Ul.test(n)){if(!iE(n))return!1;t=!0}return t}function foe(e,t,n,o){const s=!t&&y4(e),i=!o&&y4(n),r=(function(a){const c=(function(u){for(let d=u.length;d>0;){const f=Rm(u,d),h=u.slice(f,d);if(!Ul.test(h))return h;d=f}return null})(a);return c!==null&&Bm(c)})(e),l=(t||r)&&(function(a){for(let c=a.length;c>0;){const u=Rm(a,c),d=a.slice(u,c);if(!Ul.test(d))return iE(d)||Bm(d);c=u}return!1})(e);return!!(s||i||l)&&!dr(e)&&!dr(n)&&(t||s||r)&&(o||i)}function k4(e){for(const t of e)if(B2.test(t))return!0;return!1}function Rp(e){if(e.length===0)return!1;for(const t of e)if(!B2.test(t)&&!aoe.has(t))return!1;return!0}function hoe(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let o=0;for(let s=0;s<e.len;s++)e.kinds[s]==="hard-break"&&(n.push({startSegmentIndex:o,endSegmentIndex:s,consumedEndSegmentIndex:s+1}),o=s+1);return o<e.len&&n.push({startSegmentIndex:o,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}function poe(e,t,n="normal",o="normal"){const s=(function(a){const c=a??"normal";return c==="pre-wrap"?{mode:c,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:c,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}})(n),i=s.mode==="pre-wrap"?(function(a){return/[\r\f]/.test(a)?a.replace(/\r\n/g,`
|
|
286
|
-
`).replace(/[\r\f]/g,`
|
|
287
|
-
`):a})(e):(function(a){if(!Pne.test(a))return a;let c=a.replace(Dne," ");return c.charCodeAt(0)===32&&(c=c.slice(1)),c.length>0&&c.charCodeAt(c.length-1)===32&&(c=c.slice(0,-1)),c})(e);if(i.length===0)return{normalized:i,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const r=(function(a,c,u){var d,f,h;const p=(sv===null&&(sv=new Intl.Segmenter(void 0,{granularity:"word"})),sv);let m=0;const y=[],k=[],g=[],v=[],b=[],A=[],I=[],T=[],M=[],$=[],N=[],F=[];for(const L of p.segment(a))for(const O of soe(L.segment,(d=L.isWordLike)!=null&&d,L.index,u)){let j=function(){A[re]!==null&&(k[re]=[g4(y,A,I,re)],A[re]=null),k[re].push(O.text),g[re]=g[re]||O.isWordLike,T[re]=T[re]||U,M[re]=M[re]||q,$[re]=le,N[re]=oe,F[re]=v4(M[re],ee)};const Z=O.kind==="text",ie=Qne(O.text,O.isWordLike,O.kind),U=dr(O.text),q=p4(O.text),ee=Yd(O.text),le=Ky(O.text),oe=Jne(O.text),re=m-1;c.carryCJKAfterClosingQuote&&Z&&m>0&&v[re]==="text"&&U&&T[re]&&$[re]||Z&&m>0&&v[re]==="text"&&Kne(O.text)&&T[re]||Z&&m>0&&v[re]==="text"&&N[re]?j():Z&&m>0&&v[re]==="text"&&O.isWordLike&&q&&F[re]?(j(),g[re]=!0):ie!==null&&m>0&&v[re]==="text"&&A[re]===ie?I[re]=((f=I[re])!=null?f:1)+1:Z&&!O.isWordLike&&m>0&&v[re]==="text"&&!T[re]&&(Vne(O.text)||O.text==="-"&&g[re])?j():(y[m]=O.text,k[m]=[O.text],g[m]=O.isWordLike,v[m]=O.kind,b[m]=O.start,A[m]=ie,I[m]=ie===null?0:1,T[m]=U,M[m]=q,$[m]=le,N[m]=oe,F[m]=v4(q,ee),m++)}for(let L=0;L<m;L++)A[L]===null?y[L]=Bi(k[L]):y[L]=g4(y,A,I,L);for(let L=1;L<m;L++)v[L]!=="text"||g[L]||!H2(y[L])||v[L-1]!=="text"||T[L-1]||(y[L-1]+=y[L],g[L-1]=g[L-1]||g[L],y[L]="");const S=Array.from({length:m},()=>null);let B=-1;for(let L=m-1;L>=0;L--){const O=y[L];if(O.length!==0){if(v[L]==="text"&&!g[L]&&B>=0&&v[B]==="text"&&(Gne(O)||O==="-"&&Zne(y[B]))){const j=(h=S[B])!=null?h:[];j.push(O),S[B]=j,b[B]=b[L],y[L]="";continue}B=L}}for(let L=0;L<m;L++){const O=S[L];O!=null&&(y[L]=ooe(O,y[L]))}let W=0;for(let L=0;L<m;L++){const O=y[L];O.length!==0&&(W!==L&&(y[W]=O,g[W]=g[L],v[W]=v[L],b[W]=b[L]),W++)}y.length=W,g.length=W,v.length=W,b.length=W;const z=(function(L){const O=L.texts.slice(),j=L.isWordLike.slice(),Z=L.kinds.slice(),ie=L.starts.slice();for(let U=0;U<O.length-1;U++){if(Z[U]!=="text"||Z[U+1]!=="text"||!dr(O[U])||!dr(O[U+1]))continue;const q=Xne(O[U]);q!==null&&(O[U]=q.head,O[U+1]=q.tail+O[U+1],ie[U+1]=ie[U]+q.head.length)}return{len:O.length,texts:O,isWordLike:j,kinds:Z,starts:ie}})((function(L){const O=[],j=[],Z=[],ie=[];let U=0;for(;U<L.len;){const q=L.texts[U],ee=L.kinds[U],le=L.isWordLike[U];if(ee==="text"){const oe=[q];let re=U+1,we=le;for(;re<L.len&&L.kinds[re]==="text"&&foe(L.texts[re-1],L.isWordLike[re-1],L.texts[re],L.isWordLike[re]);){const me=L.texts[re];oe.push(me),we=we||L.isWordLike[re],re++}if(re>U+1){O.push(Bi(oe)),j.push(we),Z.push("text"),ie.push(L.starts[U]),U=re;continue}}O.push(q),j.push(le),Z.push(ee),ie.push(L.starts[U]),U++}return{len:O.length,texts:O,isWordLike:j,kinds:Z,starts:ie}})((function(L){const O=[],j=[],Z=[],ie=[];for(let U=0;U<L.len;U++){const q=L.texts[U];if(L.kinds[U]==="text"&&q.includes("-")){const ee=q.split("-");let le=ee.length>1;for(let oe=0;oe<ee.length;oe++){const re=ee[oe];if(!le)break;re.length!==0&&k4(re)&&Rp(re)||(le=!1)}if(le){let oe=0;for(let re=0;re<ee.length;re++){const we=ee[re],me=re<ee.length-1?`${we}-`:we;O.push(me),j.push(!0),Z.push("text"),ie.push(L.starts[U]+oe),oe+=me.length}continue}}O.push(q),j.push(L.isWordLike[U]),Z.push(L.kinds[U]),ie.push(L.starts[U])}return{len:O.length,texts:O,isWordLike:j,kinds:Z,starts:ie}})((function(L){const O=[],j=[],Z=[],ie=[];for(let U=0;U<L.len;U++){const q=L.texts[U],ee=L.kinds[U];if(ee==="text"&&Rp(q)&&k4(q)){const le=[q];let oe=U+1;for(;oe<L.len&&L.kinds[oe]==="text"&&Rp(L.texts[oe]);)le.push(L.texts[oe]),oe++;O.push(Bi(le)),j.push(!0),Z.push("text"),ie.push(L.starts[U]),U=oe-1;continue}O.push(q),j.push(L.isWordLike[U]),Z.push(ee),ie.push(L.starts[U])}return{len:O.length,texts:O,isWordLike:j,kinds:Z,starts:ie}})((function(L){const O=[],j=[],Z=[],ie=[];for(let U=0;U<L.len;U++){const q=L.texts[U];if(O.push(q),j.push(L.isWordLike[U]),Z.push(L.kinds[U]),ie.push(L.starts[U]),!loe(q))continue;const ee=U+1;if(ee>=L.len||iv(L.kinds[ee]))continue;const le=[],oe=L.starts[ee];let re=ee;for(;re<L.len&&!iv(L.kinds[re]);)le.push(L.texts[re]),re++;le.length>0&&(O.push(Bi(le)),j.push(!0),Z.push("text"),ie.push(oe),U=re-1)}return{len:O.length,texts:O,isWordLike:j,kinds:Z,starts:ie}})((function(L){const O=L.texts.slice(),j=L.isWordLike.slice(),Z=L.kinds.slice(),ie=L.starts.slice();for(let q=0;q<L.len;q++){if(Z[q]!=="text"||!roe(L,q))continue;const ee=[O[q]];let le=q+1;for(;le<L.len&&!iv(Z[le]);){ee.push(O[le]),j[q]=!0;const oe=O[le].includes("?");if(Z[le]="text",O[le]="",le++,oe)break}O[q]=Bi(ee)}let U=0;for(let q=0;q<O.length;q++){const ee=O[q];ee.length!==0&&(U!==q&&(O[U]=ee,j[U]=j[q],Z[U]=Z[q],ie[U]=ie[q]),U++)}return O.length=U,j.length=U,Z.length=U,ie.length=U,{len:U,texts:O,isWordLike:j,kinds:Z,starts:ie}})((function(L){const O=[],j=[],Z=[],ie=[];let U=0;for(;U<L.len;){const q=[L.texts[U]];let ee=L.isWordLike[U],le=L.kinds[U],oe=L.starts[U];if(le==="glue"){const re=[q[0]],we=oe;for(U++;U<L.len&&L.kinds[U]==="glue";)re.push(L.texts[U]),U++;const me=Bi(re);if(!(U<L.len&&L.kinds[U]==="text")){O.push(me),j.push(!1),Z.push("glue"),ie.push(we);continue}q[0]=me,q.push(L.texts[U]),ee=L.isWordLike[U],le="text",oe=we,U++}else U++;if(le==="text")for(;U<L.len&&L.kinds[U]==="glue";){const re=[];for(;U<L.len&&L.kinds[U]==="glue";)re.push(L.texts[U]),U++;const we=Bi(re);U<L.len&&L.kinds[U]==="text"?(q.push(we,L.texts[U]),ee=ee||L.isWordLike[U],U++):q.push(we)}O.push(Bi(q)),j.push(ee),Z.push(le),ie.push(oe)}return{len:O.length,texts:O,isWordLike:j,kinds:Z,starts:ie}})({len:W,texts:y,isWordLike:g,kinds:v,starts:b})))))));for(let L=0;L<z.len-1;L++){const O=eoe(z.texts[L]);O!==null&&(z.kinds[L]!=="space"&&z.kinds[L]!=="preserved-space"||z.kinds[L+1]!=="text"||!p4(z.texts[L+1])||(z.texts[L]=O.space,z.isWordLike[L]=!1,z.kinds[L]=z.kinds[L]==="preserved-space"?"preserved-space":"space",z.texts[L+1]=O.marks+z.texts[L+1],z.starts[L+1]=z.starts[L]+O.space.length))}return z})(i,t,s),l=o==="keep-all"?(function(a,c,u){if(c.len<=1)return c;const d=[],f=[],h=[],p=[];let m=-1,y=!1;function k(v){d.push(c.texts[v]),f.push(c.isWordLike[v]),h.push("text"),p.push(c.starts[v])}function g(v){if(!(m<0)){if(y)m+1===v?k(m):(function(b,A){let I=!1;for(let $=b;$<A;$++)I=I||c.isWordLike[$];const T=c.starts[b],M=A<c.len?c.starts[A]:a.length;d.push(a.slice(T,M)),f.push(I),h.push("text"),p.push(T)})(m,v);else for(let b=m;b<v;b++)k(b);m=-1,y=!1}}for(let v=0;v<c.len;v++){const b=c.texts[v],A=c.kinds[v];A!=="text"?(g(v),d.push(b),f.push(c.isWordLike[v]),h.push(A),p.push(c.starts[v])):(m>=0&&!sE(c.texts[v-1],u)&&g(v),m<0&&(m=v),y=y||dr(b))}return g(c.len),{len:d.length,texts:d,isWordLike:f,kinds:h,starts:p}})(i,r,t.breakKeepAllAfterPunctuation):r;return st({normalized:i,chunks:hoe(l,s)},l)}let Ac=null;const b4=new Map;let Mc=null;const moe=new RegExp("\\p{Emoji_Presentation}","u"),goe=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let rv=null;const x4=new Map;function Gy(){if(Ac!==null)return Ac;if(typeof OffscreenCanvas<"u")return Ac=new OffscreenCanvas(1,1).getContext("2d"),Ac;if(typeof document<"u")return Ac=document.createElement("canvas").getContext("2d"),Ac;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function hl(e,t){let n=t.get(e);return n===void 0&&(n={width:Gy().measureText(e).width,containsCJK:dr(e)},t.set(e,n)),n}function Dm(){if(Mc!==null)return Mc;if(typeof navigator>"u")return Mc={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,breakKeepAllAfterPunctuation:!0,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},Mc;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 Mc={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,breakKeepAllAfterPunctuation:!t,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},Mc}function rE(){return rv===null&&(rv=new Intl.Segmenter(void 0,{granularity:"grapheme"})),rv}function voe(e){return moe.test(e)||e.includes("️")}function ha(e,t,n){return n===0?t.width:t.width-(function(o,s){return s.emojiCount===void 0&&(s.emojiCount=(function(i){let r=0;const l=rE();for(const a of l.segment(i))voe(a.segment)&&r++;return r})(o)),s.emojiCount})(e,t)*n}function yoe(e){return e==="space"||e==="zero-width-break"||e==="soft-hyphen"}function w4(e){return e==="space"||e==="preserved-space"||e==="tab"||e==="zero-width-break"||e==="soft-hyphen"}function _4(e,t,n=e.widths.length){for(;t<n&&yoe(e.kinds[t]);)t++;return t}function koe(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function boe(e,t,n){return e.letterSpacing!==0&&t&&e.spacingGraphemeCounts[n]>0?e.letterSpacing:0}function W2(e,t){return t===0?0:e+t}function xoe(e,t,n,o,s){return W2(o,t==="tab"?s+(function(i,r){return i.letterSpacing!==0&&i.spacingGraphemeCounts[r]>0?i.letterSpacing:0})(e,n):e.lineEndFitAdvances[n])}function S4(e,t,n,o){return W2(o,t==="tab"?0:e.lineEndFitAdvances[n])}function C4(e,t,n,o,s){return W2(o,t==="tab"?s:e.lineEndPaintAdvances[n])}function woe(e,t,n){return e.letterSpacing!==0&&t?n+e.letterSpacing:n}function _oe(e,t){return e.letterSpacing===0?t:t+e.letterSpacing}function Jh(e,t,n){let o=t;for(;o<e.length&&e[o]<n;)o++;return o}function Soe(e,t){return(function(n,o){if(n.simpleLineWalkFastPath)return(function(S,B){const{widths:W,kinds:z,breakableFitAdvances:L,breakablePreferredBreaks:O}=S;if(W.length===0)return 0;const j=B+Dm().lineFitEpsilon;let Z=0,ie=0,U=!1,q=0,ee=0,le=-1,oe=0;function re(Q=q,P=ee,G=ie){Z++,ie=0,U=!1,le=-1,oe=0}function we(Q,P){U=!0,q=Q+1,ee=0,ie=P}function me(Q,P,G){U=!0,q=Q,ee=P+1,ie=G}function Ee(Q,P){U?(ie+=P,q=Q+1,ee=0):we(Q,P)}function ae(Q,P){var G;const pe=L[Q],ve=(G=O[Q])!=null?G:null;let de=ve===null?-1:Jh(ve,0,P+1),V=-1,se=0,he=P;for(;he<pe.length;){const ke=pe[he];if(U)if(ie+ke>j){if(ve!==null&&V>P){re(Q,V,se),he=V,de=Jh(ve,de,he+1),V=-1,se=0;continue}re(),me(Q,he,ke)}else ie+=ke,q=Q,ee=he+1;else me(Q,he,ke);const Te=he+1;ve!==null&&ve[de]===Te&&(V=Te,se=ie,de++),he++}U&&q===Q&&ee===pe.length&&(q=Q+1,ee=0)}let Y=0;for(;Y<W.length&&(U||(Y=_4(S,Y),!(Y>=W.length)));){const Q=W[Y],P=w4(z[Y]);if(U)if(ie+Q>j){if(P){Ee(Y,Q),re(Y+1,0,ie-Q),Y++;continue}if(le>=0){if(q>le||q===le&&ee>0){re();continue}re(le,0,oe);continue}if(Q>j&&L[Y]!==null){re(),ae(Y,0),Y++;continue}re()}else Ee(Y,Q),P&&(le=Y+1,oe=ie-Q),Y++;else Q>j&&L[Y]!==null?ae(Y,0):we(Y,Q),P&&(le=Y+1,oe=ie-Q),Y++}return U&&re(),Z})(n,o);const{widths:s,kinds:i,breakableFitAdvances:r,breakablePreferredBreaks:l,discretionaryHyphenWidth:a,chunks:c}=n;if(s.length===0||c.length===0)return 0;const u=Dm(),d=o+u.lineFitEpsilon;let f=0,h=0,p=!1,m=0,y=0,k=-1,g=0,v=null;function b(){k=-1,g=0,v=null}function A(S=m,B=y,W){f++,h=0,p=!1,b()}function I(S,B){p=!0,m=S+1,y=0,h=B}function T(S,B,W){p=!0,m=S,y=B+1,h=W}function M(S,B){p?(h+=B,m=S+1,y=0):I(S,B)}function $(S,B,W,z,L,O){if(!B)return;const j=S4(n,S,W,L);C4(n,S,W,L,z),k=W+1,g=h-O+j,v=S}function N(S,B){var W;const z=r[S],L=(W=l[S])!=null?W:null;let O=L===null?-1:Jh(L,0,B+1),j=-1,Z=B;for(;Z<z.length;){const ie=z[Z];if(p){const q=woe(n,!0,ie),ee=h+q;if(_oe(n,ee)>d){if(L!==null&&j>B){A(S,j),Z=j,O=Jh(L,O,Z+1),j=-1;continue}A(),T(S,Z,ie)}else h=ee,m=S,y=Z+1}else T(S,Z,ie);const U=Z+1;L!==null&&L[O]===U&&(j=U,O++),Z++}p&&m===S&&y===z.length&&(m=S+1,y=0)}function F(S){f++,b()}for(let S=0;S<c.length;S++){const B=c[S];if(B.startSegmentIndex===B.endSegmentIndex){F();continue}p=!1,h=0,B.startSegmentIndex,m=B.startSegmentIndex,y=0,b();let W=B.startSegmentIndex;for(;W<B.endSegmentIndex&&(p||(W=_4(n,W,B.endSegmentIndex),!(W>=B.endSegmentIndex)));){const z=i[W],L=w4(z),O=boe(n,p,W),j=z==="tab"?koe(h+O,n.tabStopAdvance):s[W],Z=O+j,ie=xoe(n,z,W,O,j);if(z!=="soft-hyphen")if(p){if(h+ie>d){const U=h+S4(n,z,W,O);if(C4(n,z,W,O,j),v==="soft-hyphen"&&u.preferEarlySoftHyphenBreak&&g<=d){A(k,0);continue}if(L&&U<=d){M(W,Z),A(W+1,0),W++;continue}if(k>=0&&g<=d){if(m>k||m===k&&y>0){A();continue}const q=k;A(q,0),W=q;continue}if(ie>d&&r[W]!==null){A(),N(W,0),W++;continue}A();continue}M(W,Z),$(z,L,W,j,O,Z),W++}else ie>d&&r[W]!==null?N(W,0):I(W,j),$(z,L,W,j,O,Z),W++;else p&&(m=W+1,y=0,k=W+1,g=h+a,v=z),W++}p&&(B.consumedEndSegmentIndex,A(B.consumedEndSegmentIndex,0))}return f})(e,t)}let lv=null;function z2(){return lv===null&&(lv=new Intl.Segmenter(void 0,{granularity:"grapheme"})),lv}function Coe(e,t){const n=[];let o=[],s=0,i=!1,r=!1,l=!1;function a(){o.length!==0&&(n.push({text:o.length===1?o[0]:o.join(""),start:s}),o=[],i=!1,r=!1,l=!1)}function c(d,f,h){o=[d],s=f,i=h,r=Ky(d),l=K1.has(d)}function u(d,f){o.push(d),i=i||f;const h=Ky(d);r=d.length===1&&Ka.has(d)&&r||h,l=!1}for(const d of z2().segment(e)){const f=d.segment,h=dr(f);o.length!==0?l||D2.has(f)||Ka.has(f)||t.carryCJKAfterClosingQuote&&h&&r?u(f,h):i||h?(a(),c(f,d.index,h)):u(f,h):c(f,d.index,h)}return a(),n}function Aoe(e,t,n){if(t.length<=1)return t;const o=[];let s=-1,i=!1;function r(l){if(!(s<0)){if(i)s+1===l?o.push(t[s]):(function(a,c){const u=t[a].start,d=c<t.length?t[c].start:e.length;o.push({text:e.slice(u,d),start:u})})(s,l);else for(let a=s;a<l;a++)o.push(t[a]);s=-1,i=!1}}for(let l=0;l<t.length;l++){const a=t[l];s>=0&&!sE(t[l-1].text,n)&&r(l),s<0&&(s=l),i=i||dr(a.text)}return r(t.length),o}function A4(e,t){if(t==="zero-width-break"||t==="soft-hyphen"||t==="hard-break")return 0;if(t==="tab")return 1;let n=0;const o=z2();for(const s of o.segment(e))n++;return n}function Moe(e){return e==="-"||e==="֊"||e==="‐"||e==="‒"||e==="–"||e==="—"}function Eoe(e,t,n,o,s){const i=Dm(),{cache:r,emojiCorrection:l}=(function(F,S){Gy().font=F;const B=(function(L){let O=b4.get(L);return O||(O=new Map,b4.set(L,O)),O})(F),W=(function(L){const O=L.match(/(\d+(?:\.\d+)?)\s*px/);return O?parseFloat(O[1]):16})(F),z=S?(function(L,O){let j=x4.get(L);if(j!==void 0)return j;const Z=Gy();Z.font=L;const ie=Z.measureText("😀").width;if(j=0,ie>O+.5&&typeof document<"u"&&document.body!==null){const U=document.createElement("span");U.style.font=L,U.style.display="inline-block",U.style.visibility="hidden",U.style.position="absolute",U.textContent="😀",document.body.appendChild(U);const q=U.getBoundingClientRect().width;document.body.removeChild(U),ie-q>.5&&(j=ie-q)}return x4.set(L,j),j})(F,W):0;return{cache:B,fontSize:W,emojiCorrection:z}})(t,(a=e.normalized,goe.test(a)));var a;const c=ha("-",hl("-",r),l)+(s===0?0:2*s),u=8*ha(" ",hl(" ",r),l),d=s!==0;if(e.len===0)return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],breakablePreferredBreaks:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]};const f=[],h=[],p=[],m=[];let y=e.chunks.length<=1&&!d;const k=null,g=[],v=[],b=[],A=null,I=Array.from({length:e.len});function T(F,S,B,W,z,L,O,j,Z){z!=="text"&&z!=="space"&&z!=="zero-width-break"&&(y=!1),f.push(S),h.push(B),p.push(W),m.push(z),g.push(O),v.push(j),d&&b.push(Z)}function M(F,S,B,W,z){const L=hl(F,r),O=d?A4(F,S):0,j=(function(q,ee,le){return ee>1?q+(ee-1)*le:q})(ha(F,L,l),O,s),Z=S==="space"||S==="preserved-space"||S==="zero-width-break"?0:j,ie=Z===0?0:Z+(O>0?s:0),U=S==="space"||S==="zero-width-break"?0:j;if(z&&W&&F.length>1){let q="sum-graphemes";s!==0?q="segment-prefixes":Rp(F)?q="pair-context":i.preferPrefixWidthsForBreakableRuns&&(q="segment-prefixes");const ee=(function(oe,re,we,me,Ee){if(re.breakableFitAdvances!==void 0&&re.breakableFitMode===Ee)return re.breakableFitAdvances;re.breakableFitMode=Ee;const ae=rE(),Y=[];for(const pe of ae.segment(oe))Y.push(pe.segment);if(Y.length<=1)return re.breakableFitAdvances=null,re.breakableFitAdvances;if(Ee==="sum-graphemes"){const pe=[];for(const ve of Y){const de=hl(ve,we);pe.push(ha(ve,de,me))}return re.breakableFitAdvances=pe,re.breakableFitAdvances}if(Ee==="pair-context"||Y.length>96){const pe=[];let ve=null,de=0;for(const V of Y){const se=ha(V,hl(V,we),me);if(ve===null)pe.push(se);else{const he=ve+V,ke=hl(he,we);pe.push(ha(he,ke,me)-de)}ve=V,de=se}return re.breakableFitAdvances=pe,re.breakableFitAdvances}const Q=[];let P="",G=0;for(const pe of Y){P+=pe;const ve=ha(P,hl(P,we),me);Q.push(ve-G),G=ve}return re.breakableFitAdvances=Q,re.breakableFitAdvances})(F,L,r,l,q),le=ee===null||o==="keep-all"?null:(function(oe){if(!/[-\u058A\u2010\u2012\u2013\u2014]/u.test(oe))return null;const re=[];let we=0;for(const me of z2().segment(oe))we++,Moe(me.segment)&&re.push(we);return re.length===0?null:re})(F);return void T(F,j,ie,U,S,B,ee,le,O)}T(F,j,ie,U,S,B,null,null,O)}for(let F=0;F<e.len;F++){I[F]=f.length;const S=e.texts[F],B=e.isWordLike[F],W=e.kinds[F],z=e.starts[F];if(W==="soft-hyphen"){T(S,0,c,c,W,z,null,null,0);continue}if(W==="hard-break"){T(S,0,0,0,W,z,null,null,0);continue}if(W==="tab"){T(S,0,0,0,W,z,null,null,d?A4(S,W):0);continue}const L=hl(S,r);if(W==="text"&&L.containsCJK){const O=Coe(S,i),j=o==="keep-all"?Aoe(S,O,i.breakKeepAllAfterPunctuation):O;for(let Z=0;Z<j.length;Z++){const ie=j[Z];M(ie.text,"text",z+ie.start,B,o==="keep-all"||!dr(ie.text))}continue}M(S,W,z,B,!0)}const $=(function(F,S,B){const W=[];for(let z=0;z<F.length;z++){const L=F[z],O=L.startSegmentIndex<S.length?S[L.startSegmentIndex]:B,j=L.endSegmentIndex<S.length?S[L.endSegmentIndex]:B,Z=L.consumedEndSegmentIndex<S.length?S[L.consumedEndSegmentIndex]:B;W.push({startSegmentIndex:O,endSegmentIndex:j,consumedEndSegmentIndex:Z})}return W})(e.chunks,I,f.length),N=k===null?null:(function(F,S){const B=(function(z){const L=z.length;if(L===0)return null;const O=new Array(L);let j=!1;for(let le=0;le<L;){const oe=z.charCodeAt(le);let re=oe,we=1;if(oe>=55296&&oe<=56319&&le+1<L){const Ee=z.charCodeAt(le+1);Ee>=56320&&Ee<=57343&&(re=Ee-56320+(oe-55296<<10)+65536,we=2)}const me=Bne(re);me!=="R"&&me!=="AL"&&me!=="AN"||(j=!0);for(let Ee=0;Ee<we;Ee++)O[le+Ee]=me;le+=we}if(!j)return null;let Z=0;for(let le=0;le<L;le++){const oe=O[le];if(oe==="L"){Z=0;break}if(oe==="R"||oe==="AL"){Z=1;break}}const ie=new Int8Array(L);for(let le=0;le<L;le++)ie[le]=Z;const U=1&Z?"R":"L",q=U;let ee=q;for(let le=0;le<L;le++)O[le]==="NSM"?O[le]=ee:ee=O[le];ee=q;for(let le=0;le<L;le++){const oe=O[le];oe==="EN"?O[le]=ee==="AL"?"AN":"EN":oe!=="R"&&oe!=="L"&&oe!=="AL"||(ee=oe)}for(let le=0;le<L;le++)O[le]==="AL"&&(O[le]="R");for(let le=1;le<L-1;le++)O[le]==="ES"&&O[le-1]==="EN"&&O[le+1]==="EN"&&(O[le]="EN"),O[le]!=="CS"||O[le-1]!=="EN"&&O[le-1]!=="AN"||O[le+1]!==O[le-1]||(O[le]=O[le-1]);for(let le=0;le<L;le++){if(O[le]!=="EN")continue;let oe;for(oe=le-1;oe>=0&&O[oe]==="ET";oe--)O[oe]="EN";for(oe=le+1;oe<L&&O[oe]==="ET";oe++)O[oe]="EN"}for(let le=0;le<L;le++){const oe=O[le];oe!=="WS"&&oe!=="ES"&&oe!=="ET"&&oe!=="CS"||(O[le]="ON")}ee=q;for(let le=0;le<L;le++){const oe=O[le];oe==="EN"?O[le]=ee==="L"?"L":"EN":oe!=="R"&&oe!=="L"||(ee=oe)}for(let le=0;le<L;le++){if(O[le]!=="ON")continue;let oe=le+1;for(;oe<L&&O[oe]==="ON";)oe++;const re=(le>0?O[le-1]:q)!=="L"?"R":"L";if(re===((oe<L?O[oe]:q)!=="L"?"R":"L"))for(let we=le;we<oe;we++)O[we]=re;le=oe-1}for(let le=0;le<L;le++)O[le]==="ON"&&(O[le]=U);for(let le=0;le<L;le++){const oe=O[le];1&ie[le]?oe!=="L"&&oe!=="AN"&&oe!=="EN"||ie[le]++:oe==="R"?ie[le]++:oe!=="AN"&&oe!=="EN"||(ie[le]+=2)}return ie})(F);if(B===null)return null;const W=new Int8Array(S.length);for(let z=0;z<S.length;z++)W[z]=B[S[z]];return W})(e.normalized,k);return A!==null?{widths:f,lineEndFitAdvances:h,lineEndPaintAdvances:p,kinds:m,simpleLineWalkFastPath:y,segLevels:N,breakableFitAdvances:g,breakablePreferredBreaks:v,letterSpacing:s,spacingGraphemeCounts:b,discretionaryHyphenWidth:c,tabStopAdvance:u,chunks:$,segments:A}:{widths:f,lineEndFitAdvances:h,lineEndPaintAdvances:p,kinds:m,simpleLineWalkFastPath:y,segLevels:N,breakableFitAdvances:g,breakablePreferredBreaks:v,letterSpacing:s,spacingGraphemeCounts:b,discretionaryHyphenWidth:c,tabStopAdvance:u,chunks:$}}const av="__MARKSTREAM_VUE_HEIGHT_ESTIMATION_EXPERIMENT__",Toe=["diff ","index ","--- ","+++ ","@@ "],Co=(()=>{const e=globalThis;if(e[av])return e[av];const t={configs:{},controllers:{},revision:gr(0),preparedCache:new Map,blockEstimateCache:new Map};return e[av]=t,t})();let cd=null;const cv=Co.revision;function M4(e){var t;return e&&(t=Co.configs[e])!=null?t:null}function E4(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function Noe(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function uv(e){var t,n,o;if(!Array.isArray(e)||e.length===0)return null;let s="";for(const i of e){if(!Noe(i))return null;i.type==="text"?s+=String((t=i.content)!=null?t:""):i.type==="emoji"?s+=String((o=(n=i.name)!=null?n:i.raw)!=null?o:""):i.type==="hardbreak"&&(s+=`
|
|
288
|
-
`)}return s.length>0?s:null}function dv(e,t,n){var o,s;if(!e||!Number.isFinite(t)||t<=0||!(function(){var i;if(cd!=null)return cd;if(typeof document>"u")return!1;try{const r=document.createElement("canvas");return cd=!!((i=r.getContext)!=null&&i.call(r,"2d")),cd}catch{return cd=!1,!1}})())return null;try{const i=Math.round(100*t)/100,r=[(o=n.whiteSpace)!=null?o:"pre-wrap",n.font,n.lineHeight,n.wrapperOverhead,n.widthAdjustment,i,e].join("\0"),l=Co.blockEstimateCache.get(r);if(l)return Co.blockEstimateCache.delete(r),Co.blockEstimateCache.set(r,l),{kind:"simple-text",height:l.height,contentHeight:l.contentHeight};const a=(s=n.whiteSpace)!=null?s:"pre-wrap",c=(function(h,p,m){const y=`${m}\0${p}\0${h}`,k=Co.preparedCache.get(y);if(k)return Co.preparedCache.delete(y),Co.preparedCache.set(y,k),k.prepared;const g=(function(v,b,A){return(function(I,T,M,$){var N,F;const S=(N=$?.wordBreak)!=null?N:"normal",B=(F=$?.letterSpacing)!=null?F:0;return Eoe(poe(I,Dm(),$?.whiteSpace,S),T,!1,S,B)})(v,b,0,A)})(h,p,{whiteSpace:m});for(Co.preparedCache.set(y,{prepared:g});Co.preparedCache.size>240;){const v=Co.preparedCache.keys().next().value;if(!v)break;Co.preparedCache.delete(v)}return g})(e,n.font,a),u=(function(h,p,m){const y=Soe(h,p);return{lineCount:y,height:y*m}})(c,Math.max(24,i-n.widthAdjustment),n.lineHeight),d=Math.max(n.lineHeight,u.height),f=Math.max(n.lineHeight,Math.round(d+n.wrapperOverhead));for(Co.blockEstimateCache.set(r,{height:f,contentHeight:Math.round(d)});Co.blockEstimateCache.size>4e3;){const h=Co.blockEstimateCache.keys().next().value;if(!h)break;Co.blockEstimateCache.delete(h)}return{kind:"simple-text",height:f,contentHeight:Math.round(d)}}catch{return null}}function lE(e,t,n){var o,s;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const i=uv(e.children);return i&&n.paragraph?dv(i,t,n.paragraph):null}if(e.type==="heading"){const i=Number(e.level||0),r=uv(e.children),l=n.headings[i];return r&&l?dv(r,t,l):null}if(e.type==="list_item"){const i=Array.isArray(e.children)?e.children:[];if(i.length!==1||((o=i[0])==null?void 0:o.type)!=="paragraph"||!n.listItem)return null;const r=uv((s=i[0])==null?void 0:s.children);return r?dv(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=lE(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 pa(e,t){const n=String(e??"");return t?n:n.replace(/\r\n$|\n$|\r$/,"")}function fv(e,t,n=0){return e.diff?R2(t??{},n)?(function(o){const s=pa(o.raw);if(s){const i=s.split(/\r?\n/);return o.originalCode!=null||o.updatedCode!=null?Math.max(1,i.filter(r=>!Toe.some(l=>r.startsWith(l))).length):Math.max(1,i.length)}return ud(pa(o.originalCode))+ud(pa(o.updatedCode))})(e):(function(o){const s=o.originalCode,i=o.updatedCode;if(s!=null||i!=null)return Math.max(ud(pa(s)),ud(pa(i)));const r=pa(o.code).split(/\r?\n/);let l=0,a=0;for(const c of r)c.startsWith("+")&&!c.startsWith("+++")?a++:c.startsWith("-")&&!c.startsWith("---")?l++:(l++,a++);return Math.max(1,l,a)})(e):ud(pa(e.code,e.loading===!0))}function Ioe(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function hv(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const o=window.getComputedStyle(t),s=e.offsetHeight,i=E4(o.lineHeight,1.5*E4(o.fontSize,16)),r=e.getBoundingClientRect().width,l=t.getBoundingClientRect().width;return{font:Ioe(o),lineHeight:i,wrapperOverhead:Math.max(0,s-i),widthAdjustment:Math.max(0,r-l),whiteSpace:n}}const Loe=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function T4(e,t={}){var n;const o={},s=new Set((n=t.omit)!=null?n:[]);if(!e||typeof e!="object")return o;const i=Object.getOwnPropertyDescriptors(e);for(const[r,l]of Object.entries(i))Loe.has(r)||s.has(r)||l.enumerable&&"value"in l&&(o[r]=l.value);return o}function N4(e,t,n,o){var s;const i=(function(f){return Math.max(0,Math.ceil(f.scrollHeight||0)-Math.ceil(f.clientHeight||0))})(e),r=(function(f,h){return Number.isFinite(f)?Math.min(Math.max(0,f),h):0})(n,i);if(!o.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 f of a){e.scrollTop=f;const h=o.getNormalizedScrollTop(e,t,!1),p=Math.abs(h-r);p<u&&(u=p,c=f)}e.scrollTop=c;const d=(s=o.epsilonPx)!=null?s:2;Math.abs(o.getNormalizedScrollTop(e,t,!1)-r)>d&&(e.scrollTop=c)}function I4(e,t){let n=0,o=null,s=null;const i=()=>{const r=s;s=null,o=null,r&&(n=Date.now(),e(...r))};return function(...r){const l=Date.now(),a=t-(l-n);s=r,a<=0?(o&&(clearTimeout(o),o=null),n=l,s=null,e(...r)):o||(o=setTimeout(i,a))}}function L4(e){return e==="simple"?"simple":e===!0||e==="true"||e==="precise"?"precise":"off"}const aE=Symbol("MarkstreamMathBlockMinHeightCache");function U4e(){return Jt(aE,null)}const $oe=new Set(["text","inline_code","emoji","footnote_reference"]),Foe=new Set(["strong","emphasis","strikethrough","highlight","insert","subscript","superscript","link"]);function dd(e){const t=Number(e);return!Number.isFinite(t)||t<=0?-1:Math.round(t/32)}function ma(e,t,n,o=22){const s=String(e??"");if(!s)return n;const i=Math.max(18,Math.floor(Math.max(320,t)/8)),r=s.split(/\r?\n/).length,l=Math.ceil(s.length/i),a=Math.max(1,r,l);return Math.max(n,Math.ceil(a*o+12))}function cE(e){var t;if(!e||typeof e!="object")return!1;const n=e,o=String((t=n.type)!=null?t:"");if($oe.has(o))return!0;if(!Foe.has(o))return!1;const s=n.children;return!Array.isArray(s)||!s.length||s.every(cE)}function Yy(e){var t,n,o,s,i,r,l,a;if(!e||typeof e!="object")return"";const c=e,u=String((t=c.type)!=null?t:"");if(u==="text")return String((o=(n=c.content)!=null?n:c.raw)!=null?o:"");if(u==="inline_code")return String((r=(i=(s=c.code)!=null?s:c.content)!=null?i:c.raw)!=null?r:"");if(u==="emoji")return String((a=(l=c.name)!=null?l:c.raw)!=null?a:"");if(typeof c.text=="string")return c.text;const d=[];for(const f of["children","items","cells","rows"]){const h=c[f];if(Array.isArray(h)){const p=h.map(Yy).filter(Boolean).join(" ");p&&d.push(p)}}return d.join(" ").replace(/\s+/g," ").trim()}function uE(e){if(!e||typeof e!="object")return!1;const t=e;return t.type==="inline_code"||["children","items","cells","rows"].some(n=>{const o=t[n];return Array.isArray(o)&&o.some(uE)})}function Ooe(e,t){if(!e)return 30;const n=Math.max(18,Math.floor(Math.max(320,t)/8)),o=e.split(/\r?\n/).length,s=Math.ceil(e.length/n),i=Math.max(1,o,s);return 30+26*Math.max(0,i-1)}function Roe(e,t){var n,o,s,i,r,l,a,c,u,d,f,h,p,m;if(!e||typeof e!="object")return 32;const y=e,k=String((n=y.type)!=null?n:""),g=Number.isFinite(t)&&t>0?t:640;switch(k){case"heading":return(function(v){var b;const A=Number((b=v.level)!=null?b:v.depth);return A>=4?20:A===3?30:A===2?32:44})(y);case"paragraph":return(function(v,b){const A=String(v??"");if(!A)return 28;const I=Math.max(18,Math.floor(Math.max(320,b)/8)),T=A.split(/\r?\n/).length,M=Math.ceil(A.length/I);return Math.max(1,T,M)<=1?28:ma(A,b,34)})(String((s=(o=y.raw)!=null?o:y.content)!=null?s:""),g);case"list":return(function(v,b){var A;const I=Array.isArray(v.items)?v.items:[];if(!I.length)return 48;const T=Math.max(48,30*I.length+12);let M=12;for(const F of I)M+=Ooe(Yy(F)||String((A=F.raw)!=null?A:""),b);const $=Math.max(0,M-T);if(I.length>20){const F=Math.round(2.4*I.length);return Math.round(T+Math.max(F,Math.min($,3*I.length)))}if($<=0)return T;const N=I.length>8?8*I.length:$;return Math.round(T+Math.min($,N))})(y,g);case"list_item":return ma(String((r=(i=y.raw)!=null?i:y.content)!=null?r:""),g,34);case"blockquote":return ma(String((a=(l=y.raw)!=null?l:y.content)!=null?a:""),g,56);case"table":return(function(v,b){const A=[...v.header?[v.header]:[],...Array.isArray(v.rows)?v.rows:[]];if(!A.length){const I=Array.isArray(v.children)?v.children.length:3;return Math.max(120,38*I+48)}return Math.max(120,Math.round(4+A.reduce((I,T)=>I+(function(M,$){const N=Math.max(1,M.length),F=Math.max(80,($-32)/N),S=Math.max(10,Math.floor(F/8)),B=Math.max(1,...M.map(W=>{var z;const L=Yy(W)||String((z=W?.raw)!=null?z:"");return Math.ceil(L.length/S)||1}));return 54+34*Math.max(0,B-1)+(N<=3&&M.some(uE)?14:0)})((function(M){var $;return Array.isArray(M?.cells)&&($=M.cells)!=null?$:[]})(T),b),0)))})(y,g);case"code_block":{const v=String((c=y.language)!=null?c:"").trim().toLowerCase(),b=String((d=(u=y.code)!=null?u:y.raw)!=null?d:"");return v==="mermaid"?Nm(Em(b)):v==="infographic"?Im(Tm(b)):ma(b,g,96,20)}case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return(function(v,b){var A,I,T;const M=v.match(/^\s*<details\b([^>]*)>/i);return M&&!/(?:^|\s)open(?:\s|=|$)/i.test((A=M[1])!=null?A:"")?ma(((T=(I=v.match(/<summary\b[^>]*>([\s\S]*?)<\/summary>/i))==null?void 0:I[1])==null?void 0:T.replace(/<[^>]*>/g,"").trim())||"Details",b,28,28):ma(v,b,96)})(String((h=(f=y.raw)!=null?f:y.content)!=null?h:""),g);case"thematic_break":return 24;default:return ma(String((m=(p=y.raw)!=null?p:y.content)!=null?m:""),g,40)}}function $4(e,t,n){return Math.min(Math.max(e,t),n)}const Boe=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],Doe=["tokenCloneMs","processTokensInputTokens","processTokensReusedTopLevelNodes","processTokensMs","parseMarkdownToStructureTotalMs"],Poe=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition","sourceMap"]),dE=["raw","content","code","originalCode","updatedCode"],F4=new WeakMap,O4=new WeakMap;let Hoe=1;function Oi(){return typeof performance<"u"?performance.now():Date.now()}function R4(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function Qs(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=F4.get(t);return n||(n=Hoe++,F4.set(t,n)),String(n)}function B4(e,t,n,o={}){var s,i;const r=o.includeFinal!==!1,l={md:Qs(t),customMarkdownIt:Qs(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(s=e.customHtmlTags)!=null?s:[],includeSourceMap:e.includeSourceMap===!0,streamParse:(i=e.streamParse)!=null?i:"auto",validateLink:Qs(e.validateLink),preTransformTokens:Qs(e.preTransformTokens),postTransformTokens:Qs(e.postTransformTokens),postTransformNodes:Qs(e.postTransformNodes)};return r&&(l.final=e.final===!0),JSON.stringify(l)}function D4(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===10;)t-=1;const n=e.lastIndexOf(`
|
|
289
|
-
`,t-1)+1;return e.slice(n,t).trim()}function P4(e){const t=fE(e);return t.length>=2&&t.every(n=>{const o=n.trim();return o.length>=1&&o.replace(/^:/,"").replace(/:$/,"").split("").every(s=>s==="-")})}function fE(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function hE(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 U2(e){const t=String(e??"");return`${t.length}:${hE(t)}`}function Zy(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?U2(r):`${r.length}:${hE(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${Qs(e)}`;if(typeof e!="object")return typeof e;const o=e,s=t.get(o);if(s)return`cycle:${s}`;if(n>=6)return`object:${Qs(o)}`;const i=Qs(o);if(t.set(o,i),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(l=>Zy(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}:${Zy(r[c],t,n+1)}`).join(";")}`}return typeof e}function Pm(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function pE(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(o=>Pm(o)?ql(o,t,n+1):pE(o,t,n+1)).join(",")}`:Pm(e)?ql(e,t,n):Zy(e,t,n)}function Woe(e,t,n){return Object.keys(e).sort().filter(o=>o!=="children"&&!dE.includes(o)).map(o=>{const s=e[o];return typeof s=="string"?`${o}=s:${U2(s)}`:typeof s=="number"||typeof s=="boolean"||s==null?`${o}=${String(s)}`:typeof s=="function"?`${o}=fn:${Qs(s)}`:Poe.has(o)&&(Array.isArray(s)||typeof s=="object")?`${o}=${pE(s,t,n+1)}`:s&&typeof s=="object"?`${o}=object:${Qs(s)}`:""}).filter(Boolean).join(";")}function zoe(e){return dE.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${U2(n)}`:""}).filter(Boolean).join(";")}function ql(e,t=new WeakMap,n=0){const o=O4.get(e);if(o)return o;const s=e,i=t.get(s);if(i)return`node-cycle:${i}`;if(n>=6)return`node:${e.type}:${Qs(s)}`;const r=Qs(s);t.set(s,r);const l=(function(a,c,u){const d=a,f=Array.isArray(d.children)?d.children:[],h=f.length?f.slice(0,200).map(p=>ql(p,c,u+1)).join("|"):"";return[a.type,zoe(d),Woe(d,c,u),f.length,h].join(":")})(e,t,n);return O4.set(s,l),l}function mE(e,t){return ql(e)===ql(t)}function q2(e,t,n){const o=Oi(),s=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=Oi()-o,e[s]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function H4(e,t,n){return q2(t,n,()=>ql(e))}function gE(e,t,n){return H4(e,n,"stabilizeSignatureMs")===H4(t,n,"stabilizeSignatureMs")}function ep(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function W4(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function z4(e){return e.__markstreamHasCustomParserExtensions===!0||(function(t){var n;return Number((n=t.__markstreamRegisteredPluginCount)!=null?n:0)>0})(e)}function Uoe(e,t){return e.length===t.length&&e===t}function j2(e,t,n=0){if(n>=4)return null;if(e.type!==t.type)return!1;const o=e,s=t,i=Object.keys(o).filter(u=>u!=="type"&&u!=="children").sort(),r=Object.keys(s).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 f=o[d],h=s[d];if(typeof f!=typeof h)return!1;if(typeof f!="string"){if(typeof f!="number"&&typeof f!="boolean"&&f!=null)return null;if(!Object.is(f,h))return!1}else if(typeof h!="string"||!Uoe(f,h))return!1}const l=Object.prototype.hasOwnProperty.call(o,"children");if(l!==Object.prototype.hasOwnProperty.call(s,"children"))return!1;if(!l)return!0;const a=o.children,c=s.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],f=c[u];if(!Pm(d)||!Pm(f))return null;const h=j2(d,f,n+1);if(h==null)return null;if(!h)return!1}return!0}function qoe(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;const n=j2(e,t);return n??mE(e,t)}function joe(e,t,n){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;let o=null;return q2(n,"stabilizeSignatureMs",()=>{o=j2(e,t)}),o??gE(e,t,n)}function Voe(e,t){const n={};for(const o of Boe){const s=e[o],i=t?.[o];typeof s=="number"&&(n[o]=s-(typeof i=="number"?i:0))}return n}function Koe(e,t){var n;const o=PC(t.instanceMsgId),s=new Map,i=(n=t.smoothStreamingEnabled)!=null?n:D(()=>!1),r=ne(t.renderContent.value);let l=[],a="",c="",u="",d=!1;const f=(function(){let W="",z=0,L=!1,O=!1,j=!1,Z=!1;function ie(){W="",z=0,L=!1,O=!1,j=!1,Z=!1}function U(q){let ee=!1;for(let le=0;le<q.length;le++){const oe=q.charCodeAt(le);if(oe===10||oe===13){const we=oe===10&&Z;Z=oe===13,L=!1,we||(j||(O=!1,z=0),j=!1);continue}Z=!1;const re=oe===9||oe===32;if(re||(j=!0,O&&(ee=!0)),z)if(z!==1)re||(oe!==58?z=oe===91?1:0:(ee=!0,O=!0));else{if(L){L=!1;continue}if(oe===92){L=!0;continue}oe===93&&(z=2)}else oe===91&&(z=1)}return ee}return(q,ee)=>{if(!q||!ee.startsWith(q)||ee.length<=q.length)return ie(),[!0,0];let le=0;W!==q&&(ie(),U(q),le=q.length);const oe=ee.slice(q.length),re=U(oe);return W=ee,[re,le+oe.length]}})();let h,p=0,m=0,y=Oi(),k=-1,g=0;function v(W){k=Number.isInteger(W)?W:0,g+=1}function b(){h&&(clearTimeout(h),h=void 0)}function A(){b();const W=t.renderContent.value;r.value!==W&&(r.value=W),y=Oi()}et([t.renderContent,t.effectiveFinal,i],([W,z,L])=>{r.value!==W&&(!L||z||(function(O,j){if(!O&&j||j.length<=80||j.length<O.length||!j.startsWith(O))return!0;const Z=j.slice(O.length);return!!Z&&(!!P4(D4(j))||!(!Z.includes(`
|
|
290
|
-
|
|
291
|
-
`)&&!/(?:^|\n)(?:#{1,6}\s|[-+*]\s+|\d+[.)]\s+|>\s*|`{3,}|~{3,})/.test(Z))||Z.endsWith(`
|
|
292
|
-
`)&&!(function(ie){const U=D4(ie);if(P4(U))return!1;const q=fE(U);return q.length>=2&&q.some(ee=>ee.trim())})(j))})(r.value,W)?A():(function(){if(m+=1,h)return;const O=Math.max(0,(function(j){const Z=j.parseCoalesceMs;return typeof Z=="number"&&Number.isFinite(Z)&&Z>=0?Z:80})(e)-(Oi()-y));O<=0?A():h=setTimeout(A,O)})())},{flush:"sync",immediate:!0}),Mf(b);const I=D(()=>{var W,z,L,O;return oY(e.customHtmlTags,(W=e.parseOptions)==null?void 0:W.customHtmlTags,(O=(L=(z=t.customComponentsMap)==null?void 0:z.value)!=null?L:{},Object.entries(O).map(([j,Z])=>{const ie=Ti(j);return Z==null||!ie||Wf(ie)||S5.has(ie)||Rf.has(ie)?"":ie}).filter(Boolean)))}),T=D(()=>{const{key:W,tags:z}=sY(I.value);if(!W)return o;const L=s.get(W);if(L)return L;const O=PC(t.instanceMsgId,{customHtmlTags:z});return s.set(W,O),O}),M=D(()=>{const W=T.value;if(!e.customMarkdownIt)return W;const z=e.customMarkdownIt(W);return W.__markstreamHasCustomParserExtensions=!0,z.__markstreamHasCustomParserExtensions=!0,z}),$=D(()=>{var W,z;const L=(W=e.parseOptions)!=null?W:{},O=t.effectiveFinal.value,j=I.value,Z=O!=null,ie=j.length>0;return Z||ie||L.streamParse==null?st(st(Bt(st({},L),{streamParse:(z=L.streamParse)==null||z}),Z?{final:O}:{}),ie?{customHtmlTags:j}:{}):L}),N=D(()=>{var W;return new Set(((W=$.value.customHtmlTags)!=null?W:[]).map(z=>String(z).trim().toLowerCase()).filter(Boolean))}),F=D(()=>B4($.value,M.value,e.customMarkdownIt,{includeFinal:!0})),S=D(()=>B4($.value,M.value,e.customMarkdownIt,{includeFinal:!1}));et([F,S],([W,z],[L,O])=>{L&&(W===L&&z===O||(A(),z!==O&&(l=[],u="")))},{flush:"sync"});const B=D(()=>{var W,z,L,O,j,Z,ie,U,q,ee,le;if((W=e.nodes)!=null&&W.length)return l=[],u="",v(0),yt(e.nodes.slice());const oe=r.value;if(!oe)return l=[],u="",v(-1),[];const re=t.debugPerformanceEnabled.value,we=re?Oi():0,me=M.value,Ee=F.value,ae=S.value;a&&Ee!==a&&(function(tt){var rt,ut;(ut=(rt=tt.stream)==null?void 0:rt.reset)==null||ut.call(rt)})(me),c&&ae!==c&&(l=[],u="");const Y=Object.keys((L=(z=t.customComponentsMap)==null?void 0:z.value)!=null?L:{}).length>0||typeof $.value.postTransformNodes=="function";Y!==d&&(l=[],u="");const Q=!Y&&l.length>0&&oe.startsWith(u)&&ae===c,P=re?R4(me):null,G=re?{}:void 0,pe=z4(me),ve=!pe&&!Y,de=st(st(Bt(st({},$.value),{__reuseStableTopLevelNodes:ve}),pe?{__disableStreamParse:!0}:{}),G?{__timing:G}:{}),V=C8(oe,me,de),se=re?Oi():0,he=re?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let ke,Te=re?ep(V.length):void 0,ze=0,ye=0,be=0;if(Q){const tt=re?Oi():0,[rt,ut]=(function(Nt){var _t,Rt;const[ln,Ln]=Nt.scanGlobalReferenceAppend(Nt.previousContent,Nt.content),Wt=Nt.parseOptions;return[Nt.previousDirtyStartIndex>0&&Wt.final!==!0&&!Nt.customMarkdownIt&&!z4(Nt.md)&&!ln&&typeof Wt.preTransformTokens!="function"&&typeof Wt.postTransformTokens!="function"&&typeof Wt.postTransformNodes!="function"&&((Rt=(_t=Wt.customHtmlTags)==null?void 0:_t.length)!=null?Rt:0)===0?Nt.previousDirtyStartIndex:0,Ln]})({content:oe,previousContent:u,previousDirtyStartIndex:k,parseOptions:$.value,customMarkdownIt:e.customMarkdownIt,md:me,scanGlobalReferenceAppend:f});be=ut;const vt=rt<=0;if(he){const Nt=(function(_t,Rt,ln,Ln={}){var Wt;if(!Rt.length)return{nodes:_t,metrics:ep(_t.length)};const un=(Wt=Ln.scanStartIndex)!=null?Wt:0,vn=Ln.reuseDirtyTail!==!1,Xt=(function(Ve,It,Kt,Gt=0){const Sn=Math.min(Ve.length,It.length);for(let mt=Math.min(Sn,Math.max(0,Gt));mt<Sn;mt++)if(!joe(It[mt],Ve[mt],Kt))return mt;return Ve.length===It.length?-1:Sn})(_t,Rt,ln,un);if(Xt<0)return{nodes:Rt,metrics:{reusedNodeCount:_t.length,dirtyStartIndex:Xt,stablePrefixNodeCount:_t.length,dirtyTailNodeCount:0}};const An=_t.slice();let Je=Xt;for(let Ve=0;Ve<Xt;Ve++)An[Ve]=Rt[Ve];if(vn)for(let Ve=Xt;Ve<_t.length;Ve++){const It=Rt[Ve],Kt=_t[Ve];It&&gE(It,Kt,ln)&&(An[Ve]=It,Je+=1)}return{nodes:An,metrics:{reusedNodeCount:Je,dirtyStartIndex:Xt,stablePrefixNodeCount:Xt,dirtyTailNodeCount:W4(Xt,_t,Rt)}}})(V,l,he,{reuseDirtyTail:vt,scanStartIndex:rt});ke=Nt.nodes,Te=Nt.metrics}else{const Nt=(function(_t,Rt,ln={}){var Ln;if(!Rt.length)return{nodes:_t,metrics:ep(_t.length)};const Wt=(Ln=ln.scanStartIndex)!=null?Ln:0,un=ln.reuseDirtyTail!==!1,vn=(function(Je,Ve,It=0){const Kt=Math.min(Je.length,Ve.length);for(let Gt=Math.min(Kt,Math.max(0,It));Gt<Kt;Gt++)if(!qoe(Ve[Gt],Je[Gt]))return Gt;return Je.length===Ve.length?-1:Kt})(_t,Rt,Wt);if(vn<0)return{nodes:Rt,metrics:{reusedNodeCount:_t.length,dirtyStartIndex:vn,stablePrefixNodeCount:_t.length,dirtyTailNodeCount:0}};const Xt=_t.slice();let An=vn;for(let Je=0;Je<vn;Je++)Xt[Je]=Rt[Je];if(un)for(let Je=vn;Je<_t.length;Je++){const Ve=Rt[Je],It=_t[Je];Ve&&mE(Ve,It)&&(Xt[Je]=Ve,An+=1)}return{nodes:Xt,metrics:{reusedNodeCount:An,dirtyStartIndex:vn,stablePrefixNodeCount:vn,dirtyTailNodeCount:W4(vn,_t,Rt)}}})(V,l,{reuseDirtyTail:vt,scanStartIndex:rt});ke=Nt.nodes,Te=Nt.metrics}ze=re?Oi()-tt:0,ye=vt?Te?.dirtyStartIndex==null||Te.dirtyStartIndex<0?ke.length:Te.dirtyStartIndex:ke.length}else ke=V,Te=ep(ke.length);t.effectiveFinal.value!==!0&&(he?(function(tt,rt,ut=0){for(let vt=Math.max(0,ut);vt<tt.length;vt++)q2(rt,"primeSignatureMs",()=>ql(tt[vt]))})(ke,he,ye):(function(tt,rt=0){for(let ut=Math.max(0,rt);ut<tt.length;ut++)ql(tt[ut])})(ke,ye));const Ge=re?Oi()-se:0;if(p+=1,u=oe,a=Ee,c=ae,d=Y,l=ke,v((O=Te?.dirtyStartIndex)!=null?O:0),re){const tt=R4(me),rt=typeof tt?.total=="number"&&tt.total>((j=P?.total)!=null?j:0);t.logPerf(rt?"parse(stream)":"parse(sync)",st(st(st({rendererId:t.instanceMsgId,ms:Math.round(Oi()-we),nodes:ke.length,contentLength:oe.length,parseCommitCount:p,parseCoalescedCount:m,nodeReuseMs:Ge,referenceDefinitionScanChars:be,signatureMs:(Z=he?.signatureMs)!=null?Z:0,stabilizeSignatureMs:(ie=he?.stabilizeSignatureMs)!=null?ie:0,primeSignatureMs:(U=he?.primeSignatureMs)!=null?U:0,signatureCallCount:(q=he?.signatureCallCount)!=null?q:0,stabilizeSignatureCallCount:(ee=he?.stabilizeSignatureCallCount)!=null?ee:0,primeSignatureCallCount:(le=he?.primeSignatureCallCount)!=null?le:0,stabilizeMs:ze},Te??{}),G?Object.fromEntries(Doe.map(ut=>{var vt;return[ut,(vt=G[ut])!=null?vt:0]})):{}),tt?{streamMode:tt.lastMode,streamDelta:Voe(tt,P),streamStats:tt}:{}))}return yt(ke)});return{effectiveCustomHtmlTags:I,effectiveCustomHtmlTagsSet:N,mdBase:T,mdInstance:M,mergedParseOptions:$,getParsedNodesDirtyStartIndex:()=>k,getParsedNodesRevision:()=>g,parsedNodes:B}}function Goe(e){const{isClient:t}=e,n=ne(new Set),o=new Map,s=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:o,nodeVisibilityWatchStops:s,nodeVisibilityFallbackTimers:i,clearVisibilityFallback:r,clearAllVisibilityFallbacks:l,markNodeVisible:function(c,u=!0){var d;u&&r(c),(function(f,h){if((m=(p=e.shouldTrackVisibleNodeIndices)==null?void 0:p.call(e))!=null&&!m)return;var p,m;const y=n.value,k=y.has(f);if(h){if(k)return;const v=new Set(y);return v.add(f),void(n.value=v)}if(!k)return;const g=new Set(y);g.delete(f),n.value=g})(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[f,h]of s.entries())f<c||(h(),s.delete(f));for(const[f,h]of o.entries())f<c||(h.destroy(),o.delete(f),r(f),(u=e.onNodeVisibilityCleaned)==null||u.call(e,f));for(const f of Array.from(i.keys()))f<c||r(f);if(!n.value.size)return;const d=new Set;for(const f of n.value)f<c&&d.add(f);n.value=d},destroyNodeVisibilityState:function(){a();for(const c of s.values())c();s.clear();for(const c of o.values())c.destroy();o.clear(),l()}}}function Yoe(e={}){const t=ne(""),n=ne(""),o=ne(!1),s=Mee(e),i=()=>{const u=s.getSnapshot();t.value=u.source,n.value=u.visible,o.value=u.done},r=s.subscribe(i);i();const l=D(()=>Math.max(0,t.value.length-n.value.length)),a=D(()=>l.value===0),c=D(()=>o.value&&a.value);return wk()&&Mf(()=>{r(),s.destroy()}),{source:t,visible:n,done:o,final:c,caughtUp:a,pendingChars:l,enqueue:u=>s.enqueue(u),finish:u=>s.finish(u),flush:()=>s.flush(),reset:u=>s.reset(u),pause:()=>s.pause(),resume:()=>s.resume()}}const Zoe={maxCharsPerSecond:3e3,maxCommitFps:20,maxCharsPerCommit:160,catchUpLatencyMs:220,catchUpThreshold:400},U4=/auto|scroll|overlay/i;function Xoe(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return U4.test(t)||U4.test(n)}function Qoe(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 Joe={class:"m-0 p-0"},ese=["data-probe"],tse=_n(Qe(Bt(st({},{name:"HeightEstimationProbes"}),{__name:"HeightEstimationProbes",props:{width:{},flowRoot:{type:Boolean},paragraphNode:{},listItemNode:{},listNode:{},headingNodes:{},setParagraphWrapper:{type:Function},setListItemWrapper:{type:Function},setListWrapper:{type:Function},setHeadingWrapper:{type:Function}},setup(e){const t=e;function n(o){var s,i;return(i=(s=t.headingNodes)==null?void 0:s[o])!=null?i:null}return(o,s)=>(x(),E("div",{class:"height-estimation-probes",style:tn({width:`${e.width}px`}),"aria-hidden":"true"},[_("div",{ref:i=>e.setParagraphWrapper(i),class:We(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"paragraph"},[fe(C(Ha),{node:e.paragraphNode,"index-key":"probe-paragraph"},null,8,["node"])],2),_("div",{ref:i=>e.setListItemWrapper(i),class:We(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"list-item"},[_("ul",Joe,[fe(C(uu),{node:e.listItemNode,"index-key":"probe-list-item"},null,8,["node"])])],2),_("div",{ref:i=>e.setListWrapper(i),class:We(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"list"},[fe(C(du),{node:e.listNode,"index-key":"probe-list"},null,8,["node"])],2),(x(),E(Pe,null,lt(6,i=>_("div",{key:`probe-heading-${i}`,ref_for:!0,ref:r=>e.setHeadingWrapper(i,r),class:We(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":`heading-${i}`},[fe(C(V1),{node:n(i),"index-key":`probe-heading-${i}`},null,8,["node","index-key"])],10,ese)),64))],4))}})),[["__scopeId","data-v-3e0766e2"]]),q4=Qe({name:"InfographicBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=D(()=>{var n,o;return Im((o=Vc(e.estimatedPreviewHeightPx))!=null?o:Tm(String((n=e.node.code)!=null?n:"")))});return()=>{var n;return Ft("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?Ft("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)"}},[Ft("div",{class:"flex items-center gap-x-2 overflow-hidden"},[Ft("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),Ft("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),Ft("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},()=>Ft("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,Ft("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[Ft("pre",{class:"infographic-pending-source text-sm font-mono whitespace-pre-wrap",style:{position:"absolute",inset:"0",zIndex:"1",margin:"0",padding:"var(--ms-inset-panel-body)",overflow:"auto",textAlign:"left"}},String((n=e.node.code)!=null?n:"")),Ft("div",{class:"absolute inset-0"},[Ft("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}}),j4=Qe({name:"MermaidBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=D(()=>{var n,o;return Nm((o=Vc(e.estimatedPreviewHeightPx))!=null?o:Em(String((n=e.node.code)!=null?n:"")))});return()=>{var n;return Ft("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?Ft("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)"}},[Ft("div",{class:"flex items-center gap-x-2 overflow-hidden"},[Ft("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),Ft("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},()=>Ft("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[Ft("span",{class:"action-icon block"})])))]):null,Ft("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)"}},[Ft("pre",{class:"mermaid-source-code text-sm font-mono whitespace-pre-wrap",style:{position:"absolute",inset:"0",margin:"0",padding:"var(--ms-inset-panel-body)",overflow:"auto",textAlign:"left"}},String((n=e.node.code)!=null?n:"")),Ft("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"}})])])}}}),nse={docs:{showTooltips:!0,fade:!0,batchRendering:!0,initialRenderBatchSize:40,renderBatchSize:80,renderBatchDelay:16,renderBatchBudgetMs:6,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:220,liveNodeBuffer:60,nodeVirtual:"auto"},chat:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:32,renderBatchSize:48,renderBatchDelay:6,renderBatchBudgetMs:8,renderBatchIdleTimeoutMs:60,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"},minimal:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:32,renderBatchSize:48,renderBatchDelay:6,renderBatchBudgetMs:8,renderBatchIdleTimeoutMs:60,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"}};function Fo(e){if(e==null)return"";if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}const ose=["data-custom-id"],sse=["data-node-index","data-node-type"],V4="typewriter-simple-cursor-target",vE=_n(Qe(Bt(st({},{name:"NodeRenderer"}),{__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},mode:{},domMode:{},htmlPolicy:{},viewportPriority:{type:Boolean,default:void 0},viewportPriorityOptions:{},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,String],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","copy-code","handleArtifactClick","click","mouseover","mouseout","virtual-state-change","height-change","render-settled","render-final","anchor-change"],setup(e,{expose:t,emit:n}){const o=e,s=n;function i(w){if(!(typeof Event<"u"&&w instanceof Event))return typeof w=="string"&&s("copy-code",w),void s("copy",w)}const r=bo(),l=Jt("markstreamNestedRendererProps",void 0);function a(w){const H=r?.vnode.props;return!!H&&(Object.prototype.hasOwnProperty.call(H,w)||Object.prototype.hasOwnProperty.call(H,String(w).replace(/[A-Z]/g,X=>`-${X.toLowerCase()}`)))}function c(w){var H,X;const J=o[w];return a(w)?J:(X=(H=l?.value)==null?void 0:H[w])!=null?X:J}const u=D(()=>{return(w=c("mode"))==="chat"||w==="minimal"||w==="docs"?w:"docs";var w}),d=D(()=>L4(c("typewriter"))),f=D(()=>d.value!=="off"),h=D(()=>c("domMode")==="minimal"?"minimal":"full"),p=D(()=>{return(w={mode:u.value,codeRenderer:c("codeRenderer"),renderCodeBlocksAsPre:c("renderCodeBlocksAsPre")}).renderCodeBlocksAsPre===!0?"pre":w.codeRenderer==="pre"||w.codeRenderer==="shiki"||w.codeRenderer==="monaco"?w.codeRenderer:w.renderCodeBlocksAsPre===!1||w.mode==="docs"?"monaco":"pre";var w}),m=D(()=>nse[u.value]),y=D(()=>{var w;return(w=c("showTooltips"))!=null?w:m.value.showTooltips}),k=D(()=>{var w;return(w=c("fade"))!=null?w:m.value.fade}),g=D(()=>{var w;return(w=c("batchRendering"))!=null?w:m.value.batchRendering}),v=D(()=>{var w;return(w=c("initialRenderBatchSize"))!=null?w:m.value.initialRenderBatchSize}),b=D(()=>{var w;return(w=c("renderBatchSize"))!=null?w:m.value.renderBatchSize}),A=D(()=>{var w;return(w=c("renderBatchDelay"))!=null?w:m.value.renderBatchDelay}),I=D(()=>{var w;return(w=c("renderBatchBudgetMs"))!=null?w:m.value.renderBatchBudgetMs}),T=D(()=>{var w;return(w=c("renderBatchIdleTimeoutMs"))!=null?w:m.value.renderBatchIdleTimeoutMs}),M=D(()=>{var w;return(w=c("deferNodesUntilVisible"))!=null?w:m.value.deferNodesUntilVisible}),$=D(()=>{var w;return(w=c("maxLiveNodes"))!=null?w:m.value.maxLiveNodes}),N=D(()=>{var w;return(w=c("liveNodeBuffer"))!=null?w:m.value.liveNodeBuffer}),F=D(()=>{var w;return(w=c("nodeVirtual"))!=null?w:m.value.nodeVirtual}),S={get content(){return o.content},get nodes(){return o.nodes},get final(){return o.final},get parseOptions(){return c("parseOptions")},get customMarkdownIt(){return c("customMarkdownIt")},get debugPerformance(){return o.debugPerformance},get customHtmlTags(){return c("customHtmlTags")},get mode(){return c("mode")},get domMode(){return h.value},get htmlPolicy(){return c("htmlPolicy")},get viewportPriority(){return c("viewportPriority")},get viewportPriorityOptions(){return c("viewportPriorityOptions")},get codeBlockStream(){return c("codeBlockStream")},get codeBlockDarkTheme(){return c("codeBlockDarkTheme")},get codeBlockLightTheme(){return c("codeBlockLightTheme")},get codeBlockMonacoOptions(){return c("codeBlockMonacoOptions")},get codeRenderer(){return c("codeRenderer")},get renderCodeBlocksAsPre(){return c("renderCodeBlocksAsPre")},get codeBlockMinWidth(){return c("codeBlockMinWidth")},get codeBlockMaxWidth(){return c("codeBlockMaxWidth")},get codeBlockProps(){return c("codeBlockProps")},get mermaidProps(){return c("mermaidProps")},get d2Props(){return c("d2Props")},get infographicProps(){return c("infographicProps")},get showTooltips(){return y.value},get themes(){return c("themes")},get langs(){return c("langs")},get isDark(){return c("isDark")},get customId(){return c("customId")},get indexKey(){return o.indexKey},get typewriter(){return c("typewriter")},get smoothStreaming(){return o.smoothStreaming},get smoothStreamingOptions(){return c("smoothStreamingOptions")},get parseCoalesceMs(){return c("parseCoalesceMs")},get fade(){return k.value},get batchRendering(){return g.value},get initialRenderBatchSize(){return v.value},get renderBatchSize(){return b.value},get renderBatchDelay(){return A.value},get renderBatchBudgetMs(){return I.value},get renderBatchIdleTimeoutMs(){return T.value},get deferNodesUntilVisible(){return M.value},get maxLiveNodes(){return $.value},get liveNodeBuffer(){return N.value},get nodeVirtual(){return F.value},get virtualScroll(){return o.virtualScroll},get renderAsFragment(){return o.renderAsFragment}};function B(w){s("height-change",w)}function W(w){s("virtual-state-change",w)}function z(w){s("anchor-change",w)}const L=ne(),O=ne(null),j=ne(null),Z=ne(null),ie=Do({1:null,2:null,3:null,4:null,5:null,6:null}),U=ne(!1),q=new Map,ee=ne(0),le=ne(0),oe=ne({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function re(w,H){return typeof w!="string"?H:w.trim()||H}function we(w){const H=Number(w);return Number.isFinite(H)&&H>0?Math.max(1,Math.trunc(H)):640}const me=D(()=>{var w;const H=(w=S.viewportPriorityOptions)!=null?w:{},X=re(H.rootMargin,ja);return{rootMargin:X,heavyBlockMargin:re(H.heavyBlockMargin,X),maxTargets:we(H.maxTargets)}}),Ee=D(()=>{var w;return(w=me.value.rootMargin)!=null?w:ja}),ae=D(()=>{var w;return(w=me.value.maxTargets)!=null?w:640});function Y(){var w,H;if(((w=o.virtualScroll)==null?void 0:w.enabled)!==!0)return null;const X=(H=o.virtualScroll)==null?void 0:H.scrollRoot;return Q(typeof X=="function"?X():X)}function Q(w){return w?typeof HTMLElement<"u"&&w instanceof HTMLElement?w:typeof w=="object"&&"value"in w?Q(w.value):typeof w=="object"&&"$el"in w?Q(w.$el):null:null}En(eE,me);const{isClient:P,renderAsFragment:G,debugPerformanceEnabled:pe,resolvedShowTooltips:ve,resolvedHtmlPolicy:de,inheritedSmoothStreaming:V,ownsTypewriterCursor:se}=(function(w){const H=typeof window<"u",X=If(),J=Jt("markstreamHtmlPolicy",void 0),ce=Jt("markstreamTypewriterCursor",void 0),Se=Jt("markstreamSmoothStreaming",void 0),Ne=D(()=>w.renderAsFragment===!0),$e=D(()=>!!(w.debugPerformance&&H&&typeof console<"u")),qe=D(()=>{var Ue;if(typeof w.showTooltips=="boolean")return w.showTooltips;const Ie=(Ue=X.showTooltips)!=null?Ue:X["show-tooltips"];return Ie===""||Ie===!0||Ie==="true"||Ie!==!1&&Ie!=="false"&&void 0}),Fe=D(()=>{var Ue,Ie;return(Ie=(Ue=w.htmlPolicy)!=null?Ue:J?.value)!=null?Ie:"safe"}),Re=D(()=>ce?.value!==!0);return{isClient:H,renderAsFragment:Ne,debugPerformanceEnabled:$e,resolvedShowTooltips:qe,resolvedHtmlPolicy:Fe,inheritedSmoothStreaming:Se,inheritedTypewriterCursor:ce,ownsTypewriterCursor:Re}})(S),{resolveViewportRoot:he,resolveScrollContainer:ke,isReverseFlexScrollRoot:Te,getNormalizedScrollTop:ze,getOffsetTopWithinRoot:ye}=(function(w,H){function X(){var $e,qe;return(qe=($e=H.scrollRoot)==null?void 0:$e.call(H))!=null?qe:null}function J($e){if(typeof window>"u")return null;const qe=X();if(qe)return qe;const Fe=$e??w.value;if(!Fe)return null;const Re=Fe.ownerDocument||document,Ue=Re.scrollingElement||Re.documentElement;let Ie=Fe;for(;Ie&&Ie!==Re.body&&Ie!==Ue;){if(Xoe(window.getComputedStyle(Ie))&&Qoe(Ie))return Ie;Ie=Ie.parentElement}return null}function ce($e){if(!H.isClient)return!1;try{const qe=window.getComputedStyle($e);return!!(qe.display||"").toLowerCase().includes("flex")&&(qe.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function Se($e,qe,Fe){var Re,Ue;if(Fe)return Ne(qe);const Ie=$e.scrollTop;if(!ce($e))return Ie;const Be=Ie<0?-Ie:Ie;return Math.max(0,((Re=$e.scrollHeight)!=null?Re:0)-((Ue=$e.clientHeight)!=null?Ue:0))-Be}function Ne($e){var qe,Fe,Re,Ue,Ie;const Be=Number((qe=$e.scrollingElement)==null?void 0:qe.scrollTop),Xe=Number((Re=(Fe=$e.documentElement)==null?void 0:Fe.scrollTop)!=null?Re:0),Ke=Number((Ie=(Ue=$e.body)==null?void 0:Ue.scrollTop)!=null?Ie:0);return Math.max(0,Number.isFinite(Be)?Be:0,Number.isFinite(Xe)?Xe:0,Number.isFinite(Ke)?Ke:0)}return{resolveViewportRoot:J,resolveScrollContainer:function($e){var qe,Fe,Re,Ue;const Ie=X();if(Ie)return Ie;const Be=J((qe=$e??w.value)!=null?qe:null);if(Be)return Be;const Xe=(Ue=(Re=$e?.ownerDocument)!=null?Re:(Fe=w.value)==null?void 0:Fe.ownerDocument)!=null?Ue:typeof document<"u"?document:null;return Xe?.scrollingElement||Xe?.documentElement||null},isReverseFlexScrollRoot:ce,getNormalizedScrollTop:Se,getOffsetTopWithinRoot:function($e,qe){const Fe=qe.ownerDocument||$e.ownerDocument||document;if((function(Be,Xe){return Be===Xe.documentElement||Be===Xe.body||Be===Xe.scrollingElement})(qe,Fe))return $e.getBoundingClientRect().top+Ne(Fe);const Re=qe.getBoundingClientRect(),Ue=$e.getBoundingClientRect(),Ie=Se(qe,Fe,!1);return Ue.top-Re.top+Ie}}})(L,{isClient:P,scrollRoot:Y});En("markstreamShowTooltips",ve),En("markstreamHtmlPolicy",de),En("markstreamTypewriter",f),En("markstreamFade",D(()=>S.fade!==!1)),En("markstreamTypewriterCursor",D(()=>!0)),En("markstreamTextStreamState",q),En("markstreamStreamVersion",ee),En("markstreamParseOptions",D(()=>S.parseOptions)),En("markstreamCustomMarkdownIt",D(()=>S.customMarkdownIt));const{smoothStreamingEnabled:be,renderContent:Ge,requestedFinal:tt,effectiveFinal:rt}=(function(w,H){const X=Yoe(st(st({},Zoe),w.smoothStreamingOptions)),J=D(()=>{var Ie,Be,Xe;return w.smoothStreaming!==!1&&!((Ie=w.nodes)!=null&&Ie.length)&&(w.smoothStreaming===!0||!((Be=H.inheritedSmoothStreaming)!=null&&Be.value))&&(w.smoothStreaming===!0||L4(w.typewriter)!=="off"||((Xe=w.maxLiveNodes)!=null?Xe:0)<=0)}),ce=ne(!H.isClient||w.smoothStreaming===!0);wn(()=>{ce.value=!0});const Se=D(()=>ce.value&&J.value),Ne=D(()=>{var Ie;return Se.value?X.visible.value:(Ie=w.content)!=null?Ie:""}),$e=D(()=>{var Ie,Be;const Xe=(Ie=w.parseOptions)!=null?Ie:{};return(Be=w.final)!=null?Be:Xe.final}),qe=D(()=>{const Ie=$e.value;return Se.value&&Ie!=null?!!Ie&&X.caughtUp.value:Ie});let Fe=0,Re=!1;function Ue(){Fe=0,Re=!1}return et([()=>w.content,()=>w.nodes,Se,$e],([Ie,Be,Xe,Ke])=>{if(Be?.length)return Ue(),void X.reset("");const ct=Ie??"";if(!Xe)return Ue(),X.reset(ct),void(Ke&&X.finish({flush:!0}));const ot=X.source.value;if(ct){if(ct!==ot)if(ct.startsWith(ot)){const gt=ct.slice(ot.length),bt=X.pendingChars.value;gt.length<=8?(Fe++,Re||Fe>=2&&bt<=8?(Re=!0,X.reset(ct)):X.enqueue(gt)):(Ue(),X.enqueue(gt))}else Ue(),X.reset(ct)}else Ue(),X.reset("");Ke&&X.finish()},{immediate:!0}),{smoothStream:X,smoothStreamingEligible:J,smoothStreamingEnabled:Se,renderContent:Ne,requestedFinal:$e,effectiveFinal:qe}})(S,{isClient:P,inheritedSmoothStreaming:V}),ut=tt.value===!0;En("markstreamSmoothStreaming",be);const vt=ne(!1),Nt=ne(!1),_t=ne(!1);let Rt="",ln=!1,Ln=null;function Wt(){P&&Ln!=null&&(window.clearTimeout(Ln),Ln=null)}function un(){vt.value=!1,Wt()}function vn(w,H){if(!pe.value)return;const X=(function(){if(!pe.value)return null;const J=It(Xt),ce=It(An),Se=Math.max(Ve,ce);if(J<=0&&Se<=0)return null;const Ne={total:J,maxPerFrame:Se,byLabel:($e=Xt,Object.fromEntries(Array.from($e.entries()).sort((qe,Fe)=>Fe[1]-qe[1]||qe[0].localeCompare(Fe[0]))))};var $e;return Xt.clear(),An.clear(),Ve=0,Ne})();console.info(`[markstream-vue][perf] ${w}`,X?Bt(st({},H),{layoutReads:X}):H)}et([()=>S.indexKey,()=>S.customId],()=>{var w,H;un(),Nt.value=!1,_t.value=!((w=o.nodes)!=null&&w.length)&&tt.value!==!0&&!!o.content,Rt=(H=Ge.value)!=null?H:"",ln=Rt.length>0},{flush:"sync"}),et([()=>o.content,()=>o.nodes,tt],([w,H,X])=>{!H?.length&&X!==!0&&w&&(_t.value=!0)},{flush:"sync",immediate:!0}),et([Ge,()=>o.nodes,tt],([w,H,X])=>{const J=w??"";return H?.length||X===!0?(un(),Nt.value=!1,Rt=J,void(ln=!0)):(J.length>0&&(_t.value=!0),ln?(Rt&&J.length>Rt.length&&J.startsWith(Rt)?(vt.value=!0,Nt.value=!0,P&&(Wt(),Ln=window.setTimeout(()=>{var ce;Ln=null,rt.value===!0||(ce=o.nodes)!=null&&ce.length||(gc(),vt.value=!1,xr())},1200))):(J.length<Rt.length||!J.startsWith(Rt))&&(un(),Nt.value=!1),void(Rt=J)):(Rt=J,void(ln=!0)))},{flush:"sync",immediate:!0});const Xt=new Map,An=new Map;let Je=!1,Ve=0;function It(w){let H=0;for(const X of w.values())H+=X;return H}function Kt(){Ve=Math.max(Ve,It(An)),An.clear(),Je=!1}function Gt(w){w.maxPerFrame=Math.max(Number(w.maxPerFrame||0),Number(w.currentFrameTotal||0)),w.currentFrameTotal=0,w.frameScheduled=!1}function Sn(w){var H,X;pe.value&&(Xt.set(w,((H=Xt.get(w))!=null?H:0)+1),An.set(w,((X=An.get(w))!=null?X:0)+1),(function(J){const ce=(function(){if(!P||typeof window>"u")return null;const Se=window;if(Se.__markstreamLayoutReadPerformance)return Se.__markstreamLayoutReadPerformance;const Ne={total:0,maxPerFrame:0,byLabel:{}};return Se.__markstreamLayoutReadPerformance=Ne,Ne})();ce&&(ce.total=Number(ce.total||0)+1,ce.byLabel[J]=Number(ce.byLabel[J]||0)+1,ce.currentFrameTotal=Number(ce.currentFrameTotal||0)+1,ce.frameScheduled||(ce.frameScheduled=!0,typeof window.requestAnimationFrame!="function"?typeof queueMicrotask!="function"?setTimeout(()=>Gt(ce),0):queueMicrotask(()=>Gt(ce)):window.requestAnimationFrame(()=>Gt(ce))))})(w),Je||(Je=!0,P&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(Kt):typeof queueMicrotask!="function"?setTimeout(Kt,0):queueMicrotask(Kt)))}function mt(w,H){return Sn(w),H()}const Rn=S.customId?`renderer-${S.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,dn=(function(w){const H=new Map;return{scope:w,cache:H,clear:()=>H.clear()}})(Rn),nn=Rn;En(aE,dn);const fn=wo(()=>S.customId),{effectiveCustomHtmlTagsSet:Po,mergedParseOptions:Ho,parsedNodes:dt,getParsedNodesDirtyStartIndex:li,getParsedNodesRevision:_s}=Koe(S,{instanceMsgId:Rn,renderContent:Ge,effectiveFinal:rt,smoothStreamingEnabled:be,debugPerformanceEnabled:pe,customComponentsMap:fn,logPerf:vn});et(dt,()=>{vt.value||dn.clear(),ee.value+=1},{immediate:!0});const Eo=D(()=>({customId:S.customId,customHtmlTags:Ho.value.customHtmlTags,parseOptions:S.parseOptions,customMarkdownIt:S.customMarkdownIt,htmlPolicy:de.value,viewportPriority:S.viewportPriority,viewportPriorityOptions:me.value,mode:u.value,domMode:S.domMode,codeRenderer:p.value,codeBlockStream:S.codeBlockStream,codeBlockDarkTheme:S.codeBlockDarkTheme,codeBlockLightTheme:S.codeBlockLightTheme,codeBlockMonacoOptions:S.codeBlockMonacoOptions,renderCodeBlocksAsPre:S.renderCodeBlocksAsPre,codeBlockMinWidth:S.codeBlockMinWidth,codeBlockMaxWidth:S.codeBlockMaxWidth,codeBlockProps:S.codeBlockProps,mermaidProps:S.mermaidProps,d2Props:S.d2Props,infographicProps:S.infographicProps,showTooltips:ve.value,themes:S.themes,langs:S.langs,isDark:S.isDark,typewriter:f.value,smoothStreamingOptions:S.smoothStreamingOptions,parseCoalesceMs:S.parseCoalesceMs,fade:S.fade}));En("markstreamNestedRendererProps",Eo);const _o=D(()=>dt.value),Un=D(()=>dt.value.length),To=ne(null),lo=ne(null),Wo=ne(null),Ss=ne(null),So=o.indexKey!=null&&String(o.indexKey).startsWith("list-item-"),Ws=!So&&S.customId?M4(S.customId):null,zo=D(()=>Ws?(cv.value,M4(S.customId)):null),ai=D(()=>{var w;return!!(!G.value&&S.customId&&!So&&((w=zo.value)!=null&&w.enabled))}),Qo=D(()=>!!(P&&ai.value)),No=D(()=>{var w;return!!(!G.value&&((w=o.virtualScroll)!=null&&w.enabled))}),Io=D(()=>No.value),ci=ne(!1);wn(()=>{ci.value=!0});const en=D(()=>!!(P&&No.value));En("markstreamHostScrollManaged",en);const zs=D(()=>!!(ci.value&&en.value)),Xn=D(()=>Qo.value||en.value),Us=D(()=>Qo.value||zs.value),ui=D(()=>{var w;return Xn.value&&((w=zo.value)==null?void 0:w.textEstimation)!==!1});function Ni(){const w=le.value||mt("getMeasuredContainerWidth.clientWidth",()=>{var H;return((H=L.value)==null?void 0:H.clientWidth)||0});return Number.isFinite(w)&&w>0?w:0}const di=D(()=>{const w=Ni();return w>0?Math.max(1,Math.round(w)):640}),qs=D(()=>{var w,H;return!(rt.value!==!0||No.value||u.value!=="chat"&&u.value!=="minimal"||a("maxLiveNodes")||a("liveNodeBuffer")||(w=o.nodes)!=null&&w.length||_t.value||!(((H=S.maxLiveNodes)!=null?H:0)<=0))}),Jo=D(()=>{var w;return qs.value?50:Math.max(1,(w=S.maxLiveNodes)!=null?w:320)}),es=D(()=>{var w;return qs.value?16:Math.max(0,(w=S.liveNodeBuffer)!=null?w:60)}),zt=D(()=>{var w;return!G.value&&S.nodeVirtual!==!1&&!(((w=S.maxLiveNodes)!=null?w:0)<=0&&!qs.value)&&(S.nodeVirtual===!0?dt.value.length>0:dt.value.length>Jo.value)}),js=D(()=>zt.value||Qo.value||en.value),Lo=D(()=>S.viewportPriority!==!1),fi=D(()=>!!Lo.value&&!U.value);var je;je=D(()=>Lo.value),En(tE,je);const it=D(()=>{var w;return!(G.value||S.deferNodesUntilVisible===!1||((w=S.maxLiveNodes)!=null?w:0)<=0||zt.value||dt.value.length>900||S.viewportPriority===!1)}),De=Mte(w=>{var H;return he((H=w??L.value)!=null?H:null)},Lo),{requestFrame:ge,cancelFrame:K,hasIdleCallback:xe,isTestEnv:He}=(function(w){const H=w.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,X=w.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,J=w.isClient&&typeof window.requestIdleCallback=="function",ce=(function(){var Se;if(typeof globalThis>"u"||!("process"in globalThis))return;const Ne=(Se=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:Se.value;return Ne?.env})();return{requestFrame:H,cancelFrame:X,hasIdleCallback:J,isTestEnv:ce?.NODE_ENV==="test"}})({isClient:P}),Dt=D(()=>rt.value===!0&&!No.value),{resolvedBatchSize:Ut,resolvedInitialBatch:yn,batchingEnabled:ao,incrementalRenderingActive:ls,renderedCount:te,previousRenderContext:_e,adaptiveBatchSize:Me,previousBatchConfig:Oe}=(function(w,H){var X;const J=D(()=>{var Ue;const Ie=Math.trunc((Ue=w.renderBatchSize)!=null?Ue:80);return Number.isFinite(Ie)?Math.max(0,Ie):0}),ce=D(()=>{var Ue;const Ie=Math.trunc((Ue=w.initialRenderBatchSize)!=null?Ue:J.value);return Number.isFinite(Ie)?Math.max(0,Ie):J.value}),Se=D(()=>!H.renderAsFragment.value&&w.batchRendering!==!1&&J.value>0&&H.isClient&&!H.isTestEnv),Ne=ne(0),$e=ne({key:w.indexKey,total:0}),qe=ne(Math.max(1,J.value||1)),Fe=D(()=>{var Ue,Ie,Be;return Se.value&&!((Ue=H.continuousStreaming)!=null&&Ue.value)&&!((Ie=H.forceFullRenderFinalContent)!=null&&Ie.value)&&((Be=w.maxLiveNodes)!=null?Be:0)<=0}),Re=ne({batchSize:J.value,initial:ce.value,delay:(X=w.renderBatchDelay)!=null?X:16,enabled:Fe.value});return{resolvedBatchSize:J,resolvedInitialBatch:ce,batchingEnabled:Se,incrementalRenderingActive:Fe,renderedCount:Ne,previousRenderContext:$e,adaptiveBatchSize:qe,previousBatchConfig:Re}})(S,{isClient:P,isTestEnv:He,renderAsFragment:G,forceFullRenderFinalContent:Dt,continuousStreaming:D(()=>Nt.value&&rt.value!==!0)}),Ze=D(()=>{var w;return!G.value&&S.batchRendering!==!1&&Ut.value>0&&!He&&((w=S.maxLiveNodes)!=null?w:0)<=0&&!Dt.value}),at=D(()=>Ze.value),$t=D(()=>Xn.value||at.value),Qt=D(()=>{var w;return $t.value&&((w=zo.value)==null?void 0:w.codeBlockEstimation)!==!1}),an=new Map,Vt=new Map,Bn=new WeakMap;let to=null;const Lt=new WeakMap,St=new Map,Yt=[];let Gn=[],Qn=[],Vs=-1;const Ii=gr(Yt),Ks=new Set,Kf=ne(0);let Gf=0;const Lb=ne(0),qT=D(()=>(Lb.value,Array.from(an.entries()).sort((w,H)=>w[0]-H[0]))),Tu=ne(null),Gs=ne(null);let el,Xl=null,a0=0,Nu=null;function hi(){el.markFallbackHeightPrefixDirty()}function c0(w){return el.getFallbackNodeHeight(w)}function nc(w,H){return el.estimateHeightRange(w,H)}function u0(w){return el.estimateIndexForOffset(w)}const{activeRestoreAnchor:oc,getRelativeScrollTopWithinContainer:jT,setRelativeScrollTopWithinContainer:VT,resolveAnchorOffset:KT,clearRestoreReconcile:Yf,scheduleRestoreReconcile:Iu,captureRestoreAnchor:$b,restoreAnchor:Fb,getAnchorDrift:GT}=(function(w){const{isClient:H,containerRef:X,parsedNodeCount:J,requestFrame:ce,cancelFrame:Se,resolveScrollContainer:Ne,getNormalizedScrollTop:$e,getOffsetTopWithinRoot:qe,isReverseFlexScrollRoot:Fe,estimateIndexForOffset:Re,estimateHeightRange:Ue,getFallbackNodeHeight:Ie,clamp:Be}=w,Xe=ne(null);let Ke=null,ct=[];function ot(){const Tt=Ne(),qt=X.value;if(!Tt||!qt)return null;const Zt=Tt.ownerDocument||qt.ownerDocument||document;if(Tt===Zt.documentElement||Tt===Zt.body||Tt===Zt.scrollingElement){const Mn=qt.getBoundingClientRect();return Math.max(0,-Mn.top)}return Math.max(0,$e(Tt,Zt,!1)-qe(qt,Tt))}function gt(Tt){var qt;const Zt=Ne(),Mn=X.value;if(!Zt||!Mn)return;const jo=Math.max(0,Tt),$o=Zt.ownerDocument||Mn.ownerDocument||document,$i=$o.defaultView||(typeof window<"u"?window:null);if(Zt===$o.documentElement||Zt===$o.body||Zt===$o.scrollingElement){const Ji=$e(Zt,$o,!0)+Mn.getBoundingClientRect().top;return void((qt=$i?.scrollTo)==null||qt.call($i,0,Math.max(0,Ji+jo)))}N4(Zt,$o,qe(Mn,Zt)+jo,{isReverseFlexScrollRoot:Ji=>{var Qu;return(Qu=Fe?.(Ji))!=null&&Qu},getNormalizedScrollTop:$e})}function bt(Tt){const qt=J.value,Zt=Be(Tt.nodeIndex,0,Math.max(0,qt-1));return Ue(0,Zt)+Math.max(0,Tt.offsetWithinNodePx)}function Et(){if(Ke!=null&&(Se?.(Ke),Ke=null),H)for(const Tt of ct)window.clearTimeout(Tt);ct=[]}function At(Tt){const qt=bt(Tt),Zt=ot();Zt!=null&&Math.abs(Zt-qt)<=.5||gt(qt)}return{activeRestoreAnchor:Xe,getRelativeScrollTopWithinContainer:ot,setRelativeScrollTopWithinContainer:gt,resolveAnchorOffset:bt,clearRestoreReconcile:Et,applyRestoreAnchor:At,scheduleRestoreReconcile:function(){Xe.value&&H&&Ke==null&&(Ke=ce?ce(()=>{Ke=null,Xe.value&&At(Xe.value)}):null,Ke==null&&Xe.value&&At(Xe.value))},captureRestoreAnchor:function(){const Tt=ot(),qt=J.value;if(Tt==null||qt<=0)return null;const Zt=Be(Re(Tt+1),0,qt-1),Mn=Ue(0,Zt),jo=Ie(Zt);return{nodeIndex:Zt,offsetWithinNodePx:Be(Tt-Mn,0,Math.max(0,jo-1))}},restoreAnchor:function(Tt){const qt=J.value;if(Xe.value={nodeIndex:Be(Tt.nodeIndex,0,Math.max(0,qt-1)),offsetWithinNodePx:Math.max(0,Tt.offsetWithinNodePx)},Et(),At(Xe.value),H)for(const Zt of[0,120,280,480])ct.push(window.setTimeout(()=>{Xe.value&&At(Xe.value)},Zt))},getAnchorDrift:function(Tt){const qt=ot();return qt==null?null:qt-bt(Tt)}}})({isClient:P,containerRef:L,parsedNodeCount:Un,requestFrame:ge,cancelFrame:K,resolveScrollContainer:()=>Tu.value||ke(),getNormalizedScrollTop:ze,getOffsetTopWithinRoot:ye,isReverseFlexScrollRoot:Te,estimateIndexForOffset:u0,estimateHeightRange:nc,getFallbackNodeHeight:c0,clamp:qo}),{nodeHeights:sc,heightStats:pi,heightTreeSize:d0,heightSumTree:YT,heightKnownTree:ZT,averageNodeHeight:Ob,resetHeightMeasurements:XT,pruneHeightMeasurements:QT,rebuildHeightTrees:Zf,recordNodeHeight:JT,removeNodeHeights:eN,exportHeightCache:tN,importHeightCache:nN,fenwickRangeSum:oN}=(function(w={}){const H=Do({}),X=Do({total:0,count:0}),J=ne(0),ce=ne([]),Se=ne([]);function Ne(){for(const Ie of Object.keys(H))delete H[Number(Ie)];X.total=0,X.count=0,J.value=0,ce.value=[],Se.value=[]}function $e(Ie,Be,Xe){for(let Ke=Be+1;Ke<Ie.length;Ke+=Ke&-Ke)Ie[Ke]+=Xe}function qe(Ie,Be){let Xe=0;for(let Ke=Be+1;Ke>0;Ke-=Ke&-Ke)Xe+=Ie[Ke];return Xe}function Fe(Ie){J.value=Ie;const Be=new Array(Ie+1).fill(0),Xe=new Array(Ie+1).fill(0);for(const[Ke,ct]of Object.entries(H)){const ot=Number(Ke),gt=Number(ct);!Number.isFinite(ot)||ot<0||ot>=Ie||!Number.isFinite(gt)||gt<=0||($e(Be,ot,gt),$e(Xe,ot,1))}ce.value=Be,Se.value=Xe}function Re(Ie){if(!Number.isInteger(Ie)||Ie<0)return!1;const Be=H[Ie];if(!Number.isFinite(Be)||Be<=0)return!1;if(delete H[Ie],X.total=Math.max(0,X.total-Be),X.count=Math.max(0,X.count-1),J.value>Ie){const Xe=ce.value,Ke=Se.value;Xe.length&&Ke.length&&($e(Xe,Ie,-Be),$e(Ke,Ie,-1))}return!0}const Ue=D(()=>X.count>0?Math.max(12,X.total/X.count):32);return{nodeHeights:H,heightStats:X,heightTreeSize:J,heightSumTree:ce,heightKnownTree:Se,averageNodeHeight:Ue,resetHeightMeasurements:Ne,pruneHeightMeasurements:function(Ie){if(Ie<=0)return void Ne();let Be=0,Xe=0;for(const[Ke,ct]of Object.entries(H)){const ot=Number(Ke),gt=Number(ct);!Number.isFinite(ot)||ot<0||ot>=Ie||!Number.isFinite(gt)||gt<=0?delete H[ot]:(Be+=gt,Xe++)}X.total=Be,X.count=Xe},rebuildHeightTrees:Fe,recordNodeHeight:function(Ie,Be,Xe={}){(function(Ke,ct,ot={}){var gt;if(!Number.isFinite(ct)||ct<=0)return!1;const bt=H[Ke];if(bt&&(ot.allowShrink===!1&&ct<bt||Math.abs(ct-bt)<=1))return!1;if(H[Ke]=ct,bt?X.total+=ct-bt:(X.total+=ct,X.count++),J.value>Ke){const Et=ce.value,At=Se.value;if(Et.length&&At.length)if(bt){const Tt=ct-bt;Tt!==0&&$e(Et,Ke,Tt)}else $e(Et,Ke,ct),$e(At,Ke,1)}ot.notify!==!1&&((gt=w.onHeightRecorded)==null||gt.call(w))})(Ie,Be,Bt(st({},Xe),{notify:!0}))},removeNodeHeight:function(Ie,Be={}){var Xe;const Ke=Re(Ie);return Ke&&Be.notify!==!1&&((Xe=w.onHeightRecorded)==null||Xe.call(w)),Ke},removeNodeHeights:function(Ie,Be={}){var Xe;let Ke=0;for(const ct of Ie)Re(Number(ct))&&Ke++;return Ke>0&&Be.notify!==!1&&((Xe=w.onHeightRecorded)==null||Xe.call(w)),Ke},exportHeightCache:function(){return Object.entries(H).map(([Ie,Be])=>({index:Number(Ie),height:Number(Be)})).filter(Ie=>Number.isFinite(Ie.index)&&Ie.index>=0&&Number.isFinite(Ie.height)&&Ie.height>0).sort((Ie,Be)=>Ie.index-Be.index)},importHeightCache:function(Ie,Be={}){var Xe;if(!Array.isArray(Ie))return;const Ke=J.value;let ct=!1;if(Be.mode!=="merge"){const ot=Object.keys(H);if(ot.length>0){for(const gt of ot)delete H[Number(gt)];ct=!0}}for(const ot of Ie){const gt=Number(ot.index),bt=Number(ot.height);if(!Number.isInteger(gt)||gt<0||Ke>0&>>=Ke||!Number.isFinite(bt)||bt<=0)continue;const Et=H[gt];Et&&Math.abs(Et-bt)<=1||(H[gt]=bt,ct=!0)}ct&&((function(){let ot=0,gt=0;const bt=J.value;for(const[Et,At]of Object.entries(H)){const Tt=Number(Et),qt=Number(At);!Number.isFinite(Tt)||Tt<0||bt>0&&Tt>=bt||!Number.isFinite(qt)||qt<=0?delete H[Tt]:(ot+=qt,gt++)}X.total=ot,X.count=gt})(),Ke>0&&Fe(Ke),(Xe=w.onHeightRecorded)==null||Xe.call(w))},fenwickRangeSum:function(Ie,Be,Xe){if(Xe<=Be)return 0;const Ke=qe(Ie,Xe-1);return Be<=0?Ke:Ke-qe(Ie,Be-1)}}})({onHeightRecorded:()=>{hi(),en.value&&Vu(),oc.value&&Iu(),Gs.value&&hc(),qn("node-resize")}});function Rb(w){Number.isInteger(w)&&w>=0&&Ks.add(w)}function Bb(w){for(const H of w)Rb(Number(H))}function ic(w){Gf++;let H=!0;try{const X=w();return H=X!==!1,X}finally{Gf--,Gf===0&&H&&Kf.value++}}function f0(){Gn=[],Qn=[],Vs=-1,Ks.clear(),Ii.value=Yt}function Xf(){f0(),ic(()=>XT()),St.clear()}function Db(w){!Number.isInteger(w)||w<0||w>=dt.value.length||St.set(w,Ou(w))}function Pb(w,H,X={}){const J=sc[w];Rb(w),JT(w,H,X);const ce=sc[w];return Object.is(J,ce)?(Ks.delete(w),!1):(ce&&ce>0?Db(w):J&&St.delete(w),!0)}function Hb(w,H){const X=mt("getNodeLayoutHeight.slot.offsetHeight",()=>{var J,ce;return(ce=(J=an.get(w))==null?void 0:J.offsetHeight)!=null?ce:0});return X>0?X:mt("getNodeLayoutHeight.content.offsetHeight",()=>H.offsetHeight)}function Wb(w,H={}){H.mode!=="merge"?f0():Bb(w.map(X=>X.index)),ic(()=>nN(w,H)),H0()}const Zi=D(()=>it.value&&fi.value),sN=D(()=>{var w;return!G.value&&S.batchRendering!==!1&&Ut.value>0&&((w=S.maxLiveNodes)!=null?w:0)<=0}),iN=D(()=>!G.value&&ut&&rt.value===!0&&!zt.value&&!No.value&&!ai.value&&!Zi.value&&!sN.value),zb=D(()=>!!De&&Zi.value),Ub=D(()=>zt.value||en.value),{focusIndex:yr,liveRange:Uo,updateLiveRange:Lu}=(function(w,H){const{parsedNodeCount:X,virtualizationEnabled:J,maxLiveNodesResolved:ce,liveNodeBufferResolved:Se,clamp:Ne}=H,$e=Se??D(()=>{var Re;return Math.max(0,(Re=w.liveNodeBuffer)!=null?Re:60)}),qe=ne(0),Fe=Do({start:0,end:0});return{liveNodeBufferResolved:$e,focusIndex:qe,liveRange:Fe,updateLiveRange:function(){const Re=X.value;if(!J.value||Re===0)return Fe.start=0,void(Fe.end=Re);const Ue=Math.min(ce.value,Re),Ie=$e.value,Be=Ne(qe.value-Ie,0,Math.max(0,Re-Ue));Fe.start=Be,Fe.end=Math.min(Re,Be+Ue)}}})(S,{parsedNodeCount:Un,virtualizationEnabled:zt,maxLiveNodesResolved:Jo,liveNodeBufferResolved:es,clamp:qo}),Xi=new Map,Ql=new Map,tl=new Map,Qf=[],kr=new Map,nl=new Set,qb=ne(0);let h0=!1;const jb=D(()=>(qb.value,nl.size)),Ys=new Map,Qi=new Map,Vb=ne(0),p0=D(()=>{Vb.value;let w=0;for(const H of Ys.values())w+=Math.max(0,H);return w});let Zs=null;const Jf=D(()=>{if(!zt.value)return dt.value.length;const w=es.value,H=Math.max(Uo.end+w,yn.value),X=Math.min(dt.value.length,H);return Math.max(te.value,X)});function eh(){h0||(h0=!0,queueMicrotask(()=>{h0=!1,qb.value+=1}))}function Kb(w,H,X="node-resize"){if(!P||typeof window>"u")return null;const J=window.setTimeout(()=>{nl.delete(J)&&eh();try{H()}finally{qn(X)}},Math.max(0,w));return nl.add(J),eh(),J}function th(w){P&&w!=null&&(nl.delete(w)&&eh(),window.clearTimeout(w))}function Gb(){if(P&&typeof window<"u")for(const w of nl)window.clearTimeout(w);nl.size&&(nl.clear(),eh()),Qf.length=0,tl.clear()}function rN(w){O.value=w}function lN(w){j.value=w}function aN(w){Z.value=w}const{cancelScheduledFocusSync:m0,scheduleFocusSync:Li}=(function(w){const{isClient:H,containerRef:X,virtualizationEnabled:J,requestFrame:ce,cancelFrame:Se,syncFocusToScroll:Ne}=w;let $e=null;function qe(){var Re,Ue,Ie;return(Ie=(Ue=(Re=X.value)==null?void 0:Re.ownerDocument)==null?void 0:Ue.defaultView)!=null?Ie:typeof window<"u"?window:null}function Fe(){if(!$e)return;const Re=qe();$e.viaTimeout?Re?Re.clearTimeout($e.id):clearTimeout($e.id):Se?.($e.id),$e=null}return{cancelScheduledFocusSync:Fe,scheduleFocusSync:function(Re={}){if(!J.value)return;if(!H)return void Ne(!0);if(Re.immediate)return Fe(),void Ne(!0);if($e)return;const Ue=()=>{$e=null,Ne()};if(ce)return void($e={id:ce(Ue),viaTimeout:!1});const Ie=qe();$e={id:Ie?Ie.setTimeout(Ue,16):setTimeout(Ue,16),viaTimeout:!0}}}})({isClient:P,containerRef:L,virtualizationEnabled:zt,requestFrame:ge,cancelFrame:K,syncFocusToScroll:function(w=!1){var H;if(!zt.value)return;const X=Tu.value||ke();if(!X)return;const J=X.ownerDocument||((H=L.value)==null?void 0:H.ownerDocument)||document,ce=J?.defaultView||(typeof window<"u"?window:null),Se=X===J?.documentElement||X===J?.body,Ne=dt.value.length;if(Ne<=0)return;if(!Se&&Ne>0&&Te(X)){const Ke=mt("syncFocusToScroll.clientHeight",()=>X.clientHeight||0),ct=mt("syncFocusToScroll.scrollTop",()=>X.scrollTop),ot=ct<0?-ct:ct;return void sh(qo(($e=Math.max(0,ot)+.5*Math.max(0,Ke),el.estimateIndexForOffsetFromEnd($e)),0,Math.max(0,Ne-1)),w)}var $e;const qe=(function(Ke,ct,ot,gt){const bt=L.value;if(!bt)return null;const Et=gt?0:mt("syncFocusToScroll.model.root.getBoundingClientRect",()=>Ke.getBoundingClientRect().top),At=mt("syncFocusToScroll.model.container.getBoundingClientRect",()=>bt.getBoundingClientRect().top),Tt=Math.max(0,Et-At),qt=gt?mt("syncFocusToScroll.model.viewport.clientHeight",()=>{var Zt,Mn,jo,$o;return($o=(jo=(Mn=ot?.innerHeight)!=null?Mn:(Zt=ct.documentElement)==null?void 0:Zt.clientHeight)!=null?jo:Ke.clientHeight)!=null?$o:0}):mt("syncFocusToScroll.model.root.clientHeight",()=>Ke.clientHeight);return qo(u0(Tt+.5*Math.max(0,qt)),0,Math.max(0,dt.value.length-1))})(X,J,ce,Se);if(qe!=null)return void sh(qe,w);const Fe=Se?null:mt("syncFocusToScroll.root.getBoundingClientRect",()=>X.getBoundingClientRect()),Re=Se?0:Fe.top,Ue=Se?mt("syncFocusToScroll.viewport.clientHeight",()=>{var Ke,ct;return(ct=(Ke=ce?.innerHeight)!=null?Ke:X.clientHeight)!=null?ct:0}):Fe.bottom,Ie=qT.value;let Be=null,Xe=null;for(const[Ke,ct]of Ie){if(!ct)continue;const ot=mt("syncFocusToScroll.slot.getBoundingClientRect",()=>ct.getBoundingClientRect());ot.bottom<=Re||ot.top>=Ue||(Be==null&&(Be=Ke),Xe=Ke)}if(Be==null||Xe==null){const Ke=L.value;if(!Ke)return;const ct=Se?{top:0}:mt("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>X.getBoundingClientRect()),ot=mt("syncFocusToScroll.fallback.scrollTop",()=>ze(X,J,Se)),gt=Se?(()=>{const Et=mt("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>Ke.getBoundingClientRect()),At=(Se?0:ct.top)-Et.top;return Math.max(0,At)})():(()=>{const Et=ye(Ke,X);return Math.max(0,ot-Et)})(),bt=Se?mt("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var Et,At,Tt,qt;return(qt=(Tt=(At=ce?.innerHeight)!=null?At:(Et=J?.documentElement)==null?void 0:Et.clientHeight)!=null?Tt:X.clientHeight)!=null?qt:0}):mt("syncFocusToScroll.fallback.root.clientHeight",()=>X.clientHeight);return void sh(qo(u0(gt+.5*Math.max(0,bt)),0,Math.max(0,dt.value.length-1)),!0)}sh(Math.round((Be+Xe)/2),w)}}),{visibleNodeIndices:g0,nodeVisibilityHandles:rc,nodeVisibilityWatchStops:nh,nodeVisibilityFallbackTimers:Yb,clearVisibilityFallback:oh,markNodeVisible:ol,cleanupNodeVisibility:cN,destroyNodeVisibilityState:v0}=Goe({isClient:P,shouldTrackVisibleNodeIndices:()=>Zi.value,shouldCleanupNodeVisibility:()=>zt.value,onNodeMarkedVisible:w=>{zt.value?Li():yr.value=qo(w,0,Math.max(0,dt.value.length-1))},onNodeVisibilityCleaned:w=>{an.delete(w)&&_x()}}),{cleanupScrollListener:Zb,setupScrollListener:uN}=(function(w){const{isClient:H,virtualizationEnabled:X,listenerEnabled:J,scrollRootElement:ce,resolveScrollContainer:Se,scheduleFocusSync:Ne,onScroll:$e}=w;let qe=null,Fe=null;function Re(){qe&&(qe(),qe=null),Fe=null,ce.value=null}function Ue(Ie){const Be=w.getScrollTop?w.getScrollTop(Ie):Ie.scrollTop;return Math.max(0,Number.isFinite(Be)?Math.abs(Be):0)}return{cleanupScrollListener:Re,setupScrollListener:function(){if(!H)return;if(!((Ie=J?.value)!=null?Ie:X.value))return void Re();var Ie;const Be=Se();if(!Be)return void Re();if(ce.value===Be&&qe)return;Re(),Fe=Ue(Be);const Xe=()=>{if($e?.(),X.value){const Ke=(function(ct){const ot=Ue(ct),gt=Fe;Fe=ot;const bt=Math.max(480,.75*(ct.clientHeight||0));return gt==null?ot>bt?{immediate:!0}:void 0:Math.abs(ot-gt)>bt?{immediate:!0}:void 0})(Be);Ke?Ne(Ke):Ne()}};Be.addEventListener("scroll",Xe,{passive:!0}),ce.value=Be,qe=()=>{Be.removeEventListener("scroll",Xe)}}}})({isClient:P,virtualizationEnabled:zt,listenerEnabled:Ub,scrollRootElement:Tu,resolveScrollContainer:ke,scheduleFocusSync:Li,onScroll:function(){const w=Gs.value;if(!w)return;const H=Fu();if(!H||(function(J){if(Hu()>=a0)return Nu=null,!1;const ce=Nu;if(ce==null)return!0;const Se=Math.abs(J.scrollTop-ce)<=2;return Se||(Nu=null),Se})(H))return;const X=dx(H);X!=null?(X<-32||Math.abs(Math.max(0,X)-Math.max(0,w.distanceFromBottomPx))>32)&&fc("restore"):fc("restore")},getScrollTop:w=>{var H;const X=w.ownerDocument||((H=L.value)==null?void 0:H.ownerDocument)||document,J=w===X.documentElement||w===X.body||w===X.scrollingElement;return mt("scrollListener.getScrollTop",()=>ze(w,X,J))}});function sh(w,H=!1){const X=qo(w,0,Math.max(0,dt.value.length-1));!H&&Math.abs(X-yr.value)<=1||(yr.value=X,Lu())}function qo(w,H,X){return Math.min(Math.max(w,H),X)}function y0(w=dt.value.length){const H=li();return!Number.isInteger(H)||H<0?w:qo(H,0,w)}function k0(w){return w?.firstElementChild}function Xb(w,H){var X;return w?(X=w.matches)!=null&&X.call(w,H)?w:w.querySelector(H):null}function dN(w,H){w<1||w>6||(ie[w]=H)}function Qb(){if(!Xn.value)return void(le.value=0);const w=mt("updateExperimentContainerWidth.clientWidth",()=>{var H,X;return(X=(H=L.value)==null?void 0:H.clientWidth)!=null?X:0});le.value=w>0?w:0}let $u=null;function b0(){$u?.disconnect(),$u=null}const Jb=Sd("ViewportDeferredMarkdownCodeBlockNode",Hi({loader:()=>Vn(null,null,function*(){return(yield ps(()=>import("./index5-D_56m6HR.js"),__vite__mapDeps([6,4,5]))).default}),loadingComponent:Fm,delay:0,suspensible:!1}),Fm);function ex(w){return w===Jb}const tx=D(()=>p.value==="pre"?Is:p.value==="shiki"?Jb:ov);function nx(){var w;return((w=S.codeBlockProps)==null?void 0:w.showHeader)!==!1}function ox(w,H,X){const J=sc[H],ce=typeof J=="number"&&J>0;if(ui.value&&!ce&&!(function(Se){return!!fn.value.paragraph&&(Se.type==="paragraph"||Se.type==="list_item"||Se.type==="list")})(w)){const Se=lE(w,X,oe.value);if(Se)return Se}if(Qt.value&&w.type==="code_block"){const Se=(function(Ne){if(Ne.type!=="code_block")return null;const $e=Ox(Ne,ph(Ne));return ex($e)?"markdown":$e===Is?"pre":$e===tx.value||$e===ov?"monaco":null})(w);if(Se==="monaco"||Se==="markdown"||Se==="pre")return(function(Ne,$e){var qe,Fe,Re;if(!Ne||Ne.type!=="code_block")return null;const Ue=$e.rendererKind,Ie=Ue!=="pre"&&$e.showHeader!==!1,Be=!!Ne.diff;let Xe=0,Ke=500;if(Ue==="monaco"){const ot=(qe=$e.monacoOptions)!=null?qe:{},gt=fv(Ne,ot,$e.width),bt=(function(At){const Tt=typeof At?.fontSize=="number"&&At.fontSize>0?At.fontSize:12;return typeof At?.lineHeight=="number"&&At.lineHeight>0?At.lineHeight:Math.round(1.5*Tt)})(ot),Et=(function(At,Tt){var qt,Zt;const Mn=typeof((qt=At?.padding)==null?void 0:qt.top)=="number"?At.padding.top:Tt?0:8,jo=typeof((Zt=At?.padding)==null?void 0:Zt.bottom)=="number"?At.padding.bottom:Tt?0:8;return Math.max(0,Mn)+Math.max(0,jo)})(ot,Be);Ke=typeof ot.MAX_HEIGHT=="number"&&ot.MAX_HEIGHT>0?ot.MAX_HEIGHT:500,Xe=Math.round(gt*bt+Et)}else if(Ue==="markdown"){const ot=fv(Ne);Xe=Math.round(21*ot+32)}else{const ot=fv(Ne);Xe=Math.round(28*ot),Ke=Number.POSITIVE_INFINITY}const ct=Math.max(1,Math.min(Xe,Ke));return st({kind:"code-block",height:Math.round(ct+(Ie?40:0)),contentHeight:ct,rendererKind:Ue},Be&&Ue==="monaco"?{diffInline:R2((Fe=$e.monacoOptions)!=null?Fe:{},(Re=$e.width)!=null?Re:0)}:{})})(w,{rendererKind:Se,monacoOptions:S.codeBlockMonacoOptions,showHeader:nx(),width:X})}return null}TA(()=>{if(Kf.value,Gf>0)return;const w=dt.value,H=_s();if(!w.length||!$t.value)return Gn=[],Qn=[],Vs=-1,Ks.clear(),void(Ii.value=Yt);const X=le.value||mt("estimatedNodeHeights.clientWidth",()=>{var Fe;return((Fe=L.value)==null?void 0:Fe.clientWidth)||0});if(!Number.isFinite(X)||X<=0)return Gn=[],Qn=[],Vs=-1,Ks.clear(),void(Ii.value=Yt);const J=(function(Fe){return[Math.round(Fe),ui.value,Qt.value,oe.value,S.codeBlockMonacoOptions,nx(),p.value,fn.value,cv.value]})(X),ce=Gn.length<=w.length&&(Ne=J,(Se=Qn).length===Ne.length&&Se.every((Fe,Re)=>Object.is(Fe,Ne[Re])));var Se,Ne;const $e=ce&&Vs===H?w.length:ce?y0(w.length):0,qe=ce?Array.from(Ks):[];Gn.length=w.length;for(let Fe=$e;Fe<w.length;Fe++)Gn[Fe]=ox(w[Fe],Fe,X);for(const Fe of qe)Fe>=0&&Fe<w.length&&Fe<$e&&(Gn[Fe]=ox(w[Fe],Fe,X));Ks.clear(),Qn=J,Vs=H,Ii.value=Gn,L9(Ii)},{flush:"sync"});const lc=D(()=>Ii.value);el=(function(w){let H=!0,X=[0],J="";function ce(Re){var Ue;const Ie=w.nodeHeights[Re];if(Number.isFinite(Ie)&&Ie>0)return Ie;const Be=w.parsedNodes.value[Re],Xe=Be?.type,Ke=!!((Ue=w.hasCustomParagraphComponent)!=null&&Ue.call(w)),ct=w.estimatedNodeHeights.value[Re],ot=ct?.height;if(!(function(bt,Et,At){return!!(At&&Et?.kind==="simple-text"&&(bt==="paragraph"||bt==="list_item"||bt==="list"))})(Xe,ct,Ke)&&Number.isFinite(ot)&&ot>0)return ot;const gt=Roe(Be,w.getContainerWidth()||640);return Xe==="heading"||Xe==="paragraph"&><=28&&(function(bt,Et){if(Et)return!1;const At=bt.children;return!Array.isArray(At)||!At.length||At.every(cE)})(Be,Ke)?gt:Math.max(w.averageNodeHeight.value,gt)}function Se(){var Re;const Ue=w.parsedNodes.value.length,Ie=w.getPrefixCacheKeyParts().join(":");if(!H&&J===Ie)return X;const Be=new Array(Ue+1);Be[0]=0;for(let Xe=0;Xe<Ue;Xe++)Be[Xe+1]=Be[Xe]+(w.heightEstimationActive.value?ce(Xe):(Re=w.nodeHeights[Xe])!=null?Re:w.averageNodeHeight.value);return X=Be,J=Ie,H=!1,Be}function Ne(Re){var Ue,Ie;const Be=w.parsedNodes.value.length;if(Be<=0||Re<=0)return 0;const Xe=Se();if(Re>=((Ue=Xe[Be])!=null?Ue:0))return Be-1;let Ke=0,ct=Be-1,ot=Be-1;for(;Ke<=ct;){const gt=Ke+ct>>1;((Ie=Xe[gt+1])!=null?Ie:0)>=Re?(ot=gt,ct=gt-1):Ke=gt+1}return ot}function $e(Re,Ue){var Ie,Be;if(Re>=Ue)return 0;if(w.heightEstimationActive.value)return(function(ct,ot){var gt,bt;const Et=w.parsedNodes.value.length,At=$4(Math.trunc(ct),0,Et),Tt=$4(Math.trunc(ot),At,Et);if(At>=Tt)return 0;const qt=Se();return((gt=qt[Tt])!=null?gt:0)-((bt=qt[At])!=null?bt:0)})(Re,Ue);if(w.heightTreeSize.value!==w.parsedNodes.value.length){let ct=0;for(let ot=Re;ot<Ue;ot++)ct+=(Ie=w.nodeHeights[ot])!=null?Ie:w.averageNodeHeight.value;return ct}const Xe=w.heightSumTree.value,Ke=w.heightKnownTree.value;if(!Xe.length||!Ke.length){let ct=0;for(let ot=Re;ot<Ue;ot++)ct+=(Be=w.nodeHeights[ot])!=null?Be:w.averageNodeHeight.value;return ct}return w.fenwickRangeSum(Xe,Re,Ue)+(Ue-Re-w.fenwickRangeSum(Ke,Re,Ue))*w.averageNodeHeight.value}function qe(Re){var Ue;if(Re<=0)return 0;const Ie=w.parsedNodes.value;if(w.heightEstimationActive.value)return Ne(Re);if(w.heightTreeSize.value===Ie.length&&w.heightSumTree.value.length&&w.heightKnownTree.value.length){const Xe=w.averageNodeHeight.value,Ke=w.heightSumTree.value,ct=w.heightKnownTree.value,ot=At=>At<=0?0:w.fenwickRangeSum(Ke,0,At)+(At-w.fenwickRangeSum(ct,0,At))*Xe;let gt=0,bt=Ie.length-1,Et=Ie.length-1;for(;gt<=bt;){const At=gt+bt>>1;ot(At+1)>=Re?(Et=At,bt=At-1):gt=At+1}return Et}let Be=Re;for(let Xe=0;Xe<Ie.length;Xe++){const Ke=(Ue=w.nodeHeights[Xe])!=null?Ue:w.averageNodeHeight.value;if(Be<=Ke)return Xe;Be-=Ke}return Math.max(0,Ie.length-1)}function Fe(){if(!w.heightEstimationActive.value)return 0;let Re=0;const Ue=w.estimatedNodeHeights.value;for(let Ie=0;Ie<Ue.length;Ie++){if(!Ue[Ie])continue;const Be=w.nodeHeights[Ie];Number.isFinite(Be)&&Be>0||Re++}return Re}return{markFallbackHeightPrefixDirty:function(){H=!0},getFallbackNodeHeight:ce,estimateHeightRange:$e,estimateIndexForOffset:qe,estimateIndexForOffsetFromEnd:function(Re){var Ue,Ie;const Be=w.parsedNodes.value;if(!Be.length)return 0;if(Re<=0)return Math.max(0,Be.length-1);if(w.heightEstimationActive.value){const Ke=(Ue=Se()[Be.length])!=null?Ue:0;return Ne(Math.max(0,Ke-Re))}if(w.heightTreeSize.value===Be.length){const Ke=$e(0,Be.length);return qe(Math.max(0,Ke-Re))}let Xe=Re;for(let Ke=Be.length-1;Ke>=0;Ke--){const ct=(Ie=w.nodeHeights[Ke])!=null?Ie:w.averageNodeHeight.value;if(Xe<=ct)return Ke;Xe-=ct}return 0},getEstimatedNodeHeightCount:Fe,buildVirtualHeightSummary:function(Re){var Ue;const Ie=w.parsedNodes.value.length;return{totalNodes:Ie,measuredCount:w.heightStats.count,estimatedCount:Fe(),averageNodeHeight:w.averageNodeHeight.value,topSpacerHeight:Re.topSpacerHeight,bottomSpacerHeight:Re.bottomSpacerHeight,estimatedTotalHeight:$e(0,Ie),width:(Ue=Re.width)!=null?Ue:w.getContainerWidth()}}}})({parsedNodes:dt,nodeHeights:sc,heightStats:pi,heightTreeSize:d0,heightSumTree:YT,heightKnownTree:ZT,averageNodeHeight:Ob,heightEstimationActive:Xn,estimatedNodeHeights:lc,getContainerWidth:Ni,hasCustomParagraphComponent:()=>!!fn.value.paragraph,getPrefixCacheKeyParts:()=>{var w;const H=dd(le.value||mt("getFallbackHeightPrefix.clientWidth",()=>{var J;return((J=L.value)==null?void 0:J.clientWidth)||0})),X=((w=o.virtualScroll)==null?void 0:w.measurementKey)==null?"":String(o.virtualScroll.measurementKey);return[dt.value.length,pi.count,Math.round(pi.total),Math.round(100*Ob.value),X,H,Xn.value?1:0,cv.value,ee.value,fn.value.paragraph?1:0]},fenwickRangeSum:oN}),et(()=>dt.value.length,w=>{var H;hi(),w<=0?Xf():(w<d0.value&&(H=w,f0(),ic(()=>QT(H))),w!==d0.value&&Zf(w))},{immediate:!0});const fN=D(()=>{if(!zt.value)return dt.value.map((J,ce)=>({node:J,index:ce}));const w=dt.value.length,H=qo(Uo.start,0,w),X=qo(Uo.end,H,w);return dt.value.slice(H,X).map((J,ce)=>({node:J,index:H+ce}))}),x0=D(()=>zt.value?nc(0,Math.min(Uo.start,dt.value.length)):0),w0=D(()=>{if(!zt.value)return 0;const w=dt.value.length;return nc(Math.min(Uo.end,w),w)});function sx(){return el.buildVirtualHeightSummary({topSpacerHeight:x0.value,bottomSpacerHeight:w0.value,width:Jl()})}function hN(){const w=dt.value,H=sx();return Bt(st({},H),{probe:{paragraphReady:!!oe.value.paragraph,listItemReady:!!oe.value.listItem,listWrapperOverhead:oe.value.listWrapperOverhead,headingReadyLevels:Object.entries(oe.value.headings).filter(([,X])=>!!X).map(([X])=>Number(X))},nodes:w.map((X,J)=>{var ce,Se,Ne,$e,qe,Fe,Re,Ue,Ie;return{index:J,type:X.type,estimateKind:(Se=(ce=lc.value[J])==null?void 0:ce.kind)!=null?Se:null,rendererKind:($e=(Ne=lc.value[J])==null?void 0:Ne.rendererKind)!=null?$e:null,estimatedHeight:(Fe=(qe=lc.value[J])==null?void 0:qe.height)!=null?Fe:null,estimatedContentHeight:(Ue=(Re=lc.value[J])==null?void 0:Re.contentHeight)!=null?Ue:null,measuredHeight:(Ie=sc[J])!=null?Ie:null}})})}function _0(){return o.indexKey!=null?String(o.indexKey):No.value?`virtual-${Yn()}`:"markdown-renderer"}function ix(w){const H=String(w),X=`${_0()}-`;if(!H.startsWith(X))return null;const J=H.slice(X.length).match(/^(\d+)(?:$|-)/);if(!J)return null;const ce=Number(J[1]);return!Number.isInteger(ce)||ce<0||ce>=dt.value.length?null:ce}function Yn(){var w,H,X;const J=(w=o.virtualScroll)==null?void 0:w.sessionKey;return String(J!=null&&J!==""?J:(X=(H=o.indexKey)!=null?H:S.customId)!=null?X:Rn)}function fo(){var w;const H=(w=o.virtualScroll)==null?void 0:w.threadKey;return H==null||H===""?void 0:String(H)}const pN=D(()=>{var w,H,X;return(X=fo())!=null?X:String((H=(w=o.indexKey)!=null?w:S.customId)!=null?H:Rn)});function S0(w){var H;return(w??"")===((H=fo())!=null?H:"")}function br(){var w,H,X;return H=(w=o.virtualScroll)==null?void 0:w.measurementKey,X=(function(){const J=p.value;return(function(ce){var Se,Ne;const $e=ce.renderer,qe=$e==="monaco"?ce.codeBlockMonacoOptions:void 0,Fe=ce.codeBlockProps,Re=$e==="shiki";return[ce.isDark?"dark":"light",$e==="monaco"?"code-rich":$e==="pre"?"code-pre":"code-shiki",ce.codeBlockStream===!1?"code-static":"code-stream",Fo(ce.codeBlockMinWidth),Fo(ce.codeBlockMaxWidth),...Re?[Cee((Se=Fe?.themes)!=null?Se:ce.themes,(Ne=Fe?.langs)!=null?Ne:ce.langs)]:[],Fo(qe?.fontSize),Fo(qe?.lineHeight),Fo(qe?.fontFamily),Fo(qe?.tabSize),Fo(qe?.MAX_HEIGHT),Fo(qe?.wordWrap),Fo(qe?.wrappingIndent),Fo(qe?.padding),Fo(Fe?.showHeader),Fo(Fe?.showCopyButton),Fo(Fe?.showExpandButton),Fo(Fe?.showPreviewButton),Fo(Fe?.showCollapseButton),Fo(Fe?.showFontSizeButtons)].join("\0")})({renderer:J,isDark:S.isDark,codeBlockStream:S.codeBlockStream,codeBlockMinWidth:S.codeBlockMinWidth,codeBlockMaxWidth:S.codeBlockMaxWidth,codeBlockMonacoOptions:J==="monaco"?S.codeBlockMonacoOptions:void 0,codeBlockProps:S.codeBlockProps,themes:J==="shiki"?S.themes:void 0,langs:J==="shiki"?S.langs:void 0})})(),[H==null?"":String(H),X].join("\0")}function Jl(){return Ni()}const ih=D(()=>dd(Jl())),Xs=D(()=>[br(),ih.value].join("\0")),mN=D(()=>{var w;return No.value?["virtual",(w=fo())!=null?w:"",Yn(),Xs.value].join("\0"):o.indexKey});function ac(){Vb.value+=1}function C0(w){return!(!w||!Number.isInteger(w.index)||w.index<0||w.index>=dt.value.length||w.sessionKey!==Yn()||w.threadKey!==fo()||w.layoutEpochKey!==Xs.value)}function rx(w){const H=String(w),X=Qi.get(H);return X?C0(X)?X.index:null:ix(H)}function lx(w="async-node"){(Ys.size||Qi.size)&&(Ys.clear(),Qi.clear(),ac(),qn(w))}const cc=Jt(Fy,null),A0={reportHeight(w,H){if(!en.value)return;const X=rx(w);if(X==null)return;const J=Xi.get(X);if(!J)return;const ce=Number(H),Se=Hb(X,J);(function(Ne,$e,qe={}){ic(()=>Pb(Ne,$e,qe))})(X,Number.isFinite(ce)&&ce>0?Math.max(ce,Se||0):Se)},markPending(w){if(!en.value)return;const H=ix(w);H!=null&&(function(X,J){var ce;const Se=Qi.get(X);if(Se&&C0(Se))return Ys.set(X,Math.max(0,(ce=Ys.get(X))!=null?ce:0)+1),ac(),void qn("async-node");Ys.set(X,1),Qi.set(X,(function(Ne){return{index:Ne,sessionKey:Yn(),threadKey:fo(),layoutEpochKey:Xs.value}})(J)),ac(),qn("async-node")})(String(w),H)},markSettled(w){if(!en.value)return;const H=String(w),X=rx(w);(X!=null||(function(J){return Ys.has(String(J))})(H))&&(function(J){var ce;const Se=(ce=Ys.get(J))!=null?ce:0;return!(Se<=0||(Se<=1?(Ys.delete(J),Qi.delete(J)):Ys.set(J,Se-1),ac(),Se===1&&qn("async-node"),0))})(H)&&X!=null&&xr()}};function gN(){let w=0;for(const H of Xi.values())w+=mt("getVisibleDomHeight.offsetHeight",()=>{var X;return(X=H?.offsetHeight)!=null?X:0});return Math.ceil(Math.max(0,w))}En(Fy,{reportHeight(w,H){A0.reportHeight(w,H),cc?.reportHeight(w,H)},markPending(w){A0.markPending(w),cc?.markPending(w)},markSettled(w){A0.markSettled(w),cc?.markSettled(w)}});let M0,E0=null,uc=null;function rh(w){return w!==!1&&w!=null&&w!==""}function ax(){return zt.value?(function(){if(!zt.value)return!0;const w=dt.value.length,H=qo(Uo.start,0,w),X=qo(Uo.end,H,w);if(H>=X)return!0;for(let J=H;J<X;J++)if(!an.has(J)||uh(J)&&!Xi.has(J))return!1;return!0})():te.value>=Jf.value}function T0(){return rt.value===!0&&!vt.value&&p0.value===0&&nl.size===0&&kr.size===0&&Zs==null&&ax()}function cx(){var w,H;if(((w=o.virtualScroll)==null?void 0:w.settleMode)!=="manual"||E0===Yn()&&M0===fo())return!0;const X=(H=o.virtualScroll)==null?void 0:H.settledToken;return!!rh(X)&&uc===Ku(X)}function N0(){return T0()&&cx()}function vN(w,H){return H.totalNodes<=0?w==="final"?"final":"estimate":H.measuredCount>=H.totalNodes?w==="final"?"final":"measured":H.measuredCount>0||H.estimatedCount>0?"mixed":"estimate"}function ea(w="manual",H){const X=sx(),J=(function(ce){return ce||(rt.value!==!0?dt.value.length>0?"streaming":"estimating":!ax()||kr.size>0||Zs!=null?"measuring":N0()?"settled":"settling")})(H);return{sessionKey:Yn(),threadKey:fo(),phase:J,nodeCount:X.totalNodes,liveRange:{start:Uo.start,end:Uo.end},renderedCount:te.value,measuredCount:X.measuredCount,estimatedCount:X.estimatedCount,averageNodeHeight:X.averageNodeHeight,topSpacerHeight:X.topSpacerHeight,bottomSpacerHeight:X.bottomSpacerHeight,visibleDomHeight:gN(),totalHeight:ux(),width:X.width,final:rt.value===!0,stable:N0(),confidence:vN(J,X),reason:w}}function Fu(){const w=Tu.value||ke(),H=L.value;if(!w||!H)return null;const X=w.ownerDocument||H.ownerDocument||document,J=w===X.documentElement||w===X.body||w===X.scrollingElement,ce=mt("getScrollBox.scrollTop",()=>ze(w,X,J)),Se=mt("getScrollBox.scrollHeight",()=>{var $e,qe,Fe,Re,Ue;return J?Math.max((qe=($e=X.documentElement)==null?void 0:$e.scrollHeight)!=null?qe:0,(Re=(Fe=X.body)==null?void 0:Fe.scrollHeight)!=null?Re:0,(Ue=w.scrollHeight)!=null?Ue:0):w.scrollHeight}),Ne=mt("getScrollBox.clientHeight",()=>{var $e;return J?(($e=X.documentElement)==null?void 0:$e.clientHeight)||w.clientHeight||0:w.clientHeight});return{root:w,doc:X,isViewportRoot:J,scrollTop:ce,scrollHeight:Se,clientHeight:Ne}}function ux(){const w=dt.value.length,H=Math.max(0,nc(0,w)),X=mt("getRendererLogicalHeight.offsetHeight",()=>{var ce,Se;return(Se=(ce=L.value)==null?void 0:ce.offsetHeight)!=null?Se:0}),J=Math.max(0,X>0?X:mt("getRendererLogicalHeight.scrollHeight",()=>{var ce,Se;return(Se=(ce=L.value)==null?void 0:ce.scrollHeight)!=null?Se:0}));return w<=0?Math.ceil(X):zt.value?H>0?Math.max(1,Math.ceil(H),(function(){let ce=x0.value+w0.value;for(const Se of an.values())Se&&(ce+=Math.max(0,mt("getVirtualizedDomLogicalHeight.offsetHeight",()=>Se.offsetHeight||0)));return Math.ceil(Math.max(0,ce))})(),(function(ce,Se){return ce<=0||Se<=0?0:Se<=ce+Math.max(512,.05*ce)?Math.ceil(Se):0})(H,J)):Math.max(1,Math.ceil(J)):en.value?H>0||pi.count>0||el.getEstimatedNodeHeightCount()>0?(ls.value&&te.value,Math.max(1,Math.ceil(J),Math.ceil(H))):Math.ceil(J):Math.max(1,Math.ceil(J),Math.ceil(H))}function dx(w){const H=L.value;if(!H)return null;const X=mt("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>H.getBoundingClientRect());return(function(ce){return ce.isViewportRoot?ce.clientHeight:mt("getViewportBottomInRoot.getBoundingClientRect",()=>ce.root.getBoundingClientRect().bottom)})(w)-X.bottom}function yN(w={}){const H=w.requireViewport!==!1,X=(function(Se=64){const Ne=Fu(),$e=L.value;if(!Ne||!$e)return!1;const qe=(function(Re){if(Re.isViewportRoot)return{top:0,bottom:Re.clientHeight};const Ue=mt("getVirtualViewportRect.getBoundingClientRect",()=>Re.root.getBoundingClientRect());return{top:Ue.top,bottom:Ue.bottom}})(Ne),Fe=mt("isRendererNearVirtualViewport.getBoundingClientRect",()=>$e.getBoundingClientRect());return Fe.bottom>=qe.top-Se&&Fe.top<=qe.bottom+Se})();if(H&&!X)return null;const J=(function(){const Se=Fu(),Ne=L.value;if(!Se||!Ne||Math.max(0,Se.scrollHeight-Se.scrollTop-Se.clientHeight)>64)return null;const $e=dx(Se);return $e==null?null:$e>=-8&&$e<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,$e)}:null})();if(J)return{anchor:J,captured:!0};const ce=$b();if(ce)return{anchor:{type:"node",nodeIndex:ce.nodeIndex,offsetWithinNodePx:ce.offsetWithinNodePx},captured:X};if(w.allowFallback===!0){const Se=(function(){const Ne=dt.value.length;return Ne<=0?null:{type:"node",nodeIndex:qo(yr.value,0,Math.max(0,Ne-1)),offsetWithinNodePx:0}})();return Se?{anchor:Se,captured:!1}:null}return null}function I0(w){let H=2166136261;for(let X=0;X<w.length;X++)H^=w.charCodeAt(X),H=Math.imul(H,16777619);return(H>>>0).toString(36)}function kN(w,H){let X=w;for(let J=0;J<H.length;J++)X^=H.charCodeAt(J),X=Math.imul(X,16777619);return X^=31,X=Math.imul(X,16777619),X}const bN=new Set(["children","items","header","rows","cells","attrs","data","term","definition"]);function lh(w,H=new WeakSet,X=0){if(w==null||typeof w=="number"||typeof w=="boolean")return String(w);if(typeof w=="string")return`s:${(function(J){const ce=J.length>8192?`${J.slice(0,8192)}...${J.length}`:J;return`${J.length}:${I0(ce)}`})(w)}`;if(typeof w=="function")return"fn";if(typeof w!="object")return typeof w;if(H.has(w))return"cycle";if(X>=6)return"max-depth";H.add(w);try{if(Array.isArray(w)){if(w.length<=160){const Fe=[];for(let Re=0;Re<w.length;Re++)Fe.push(lh(w[Re],H,X+1));return`a:${w.length}:${Fe.join(",")}`}const Se=[],Ne=[],$e=Math.max(0,w.length-32);let qe=2166136261;for(let Fe=0;Fe<w.length;Fe++){const Re=lh(w[Fe],H,X+1);qe=kN(qe,Re),Fe<32&&Se.push(Re),Fe>=$e&&Ne.push(Re)}return[`a:${w.length}`,`h=${Se.join(",")}`,`t=${Ne.join(",")}`,`all=${(qe>>>0).toString(36)}`].join(":")}const J=w,ce=Object.keys(J).filter(Se=>{const Ne=J[Se];return Se!=="parent"&&Se!=="el"&&Se!=="component"&&(Ne==null||typeof Ne=="string"||typeof Ne=="number"||typeof Ne=="boolean"||bN.has(Se))}).sort();return`o:${ce.length}:${ce.map(Se=>`${Se}=${lh(J[Se],H,X+1)}`).join(";")}`}finally{H.delete(w)}}let L0=-1,$0="",ta=[2166136261];function Ou(w){const H=dt.value[w];return H?I0(lh(H)):""}function xN(w,H){let X=w;for(let J=0;J<H.length;J++)X^=H.charCodeAt(J),X=Math.imul(X,16777619);return X>>>0}function F0(){var w,H;const X=ee.value;if(L0===X)return $0;const J=dt.value.length;let ce=y0(J);(L0!==X-1||ce>J||ta.length<ce+1)&&(ce=0),ce===0?ta=[2166136261]:ta.length=ce+1;for(let Se=ce;Se<J;Se++){const Ne=Ou(Se);ta[Se+1]=xN((w=ta[Se])!=null?w:2166136261,Ne)}return ta.length=J+1,$0=(((H=ta[J])!=null?H:2166136261)>>>0).toString(36),L0=X,$0}function dc(w,H={}){var X;const J=H.includeHeightCache===!0,ce=(X=H.includeContentHash)!=null?X:J,Se=J?(function($e){const qe=(function(){var Ke,ct;const ot=Number((ct=(Ke=o.virtualScroll)==null?void 0:Ke.heightCacheLimit)!=null?ct:5e3);return!Number.isFinite(ot)||ot<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(ot))})();if(!Number.isFinite(qe)||$e.length<=qe)return $e;const Fe=new Map,Re=Ke=>{!Ke||Fe.size>=qe||Fe.set(Ke.index,Ke)},Ue=dt.value.length,Ie=qo(Uo.start-2*es.value,0,Ue),Be=qo(Uo.end+2*es.value,Ie,Ue);for(const Ke of $e)Ke.index>=Ie&&Ke.index<Be&&Re(Ke);const Xe=Math.max(1,Math.ceil($e.length/qe));for(let Ke=0;Ke<$e.length&&Fe.size<qe;Ke+=Xe)Re($e[Ke]);for(let Ke=$e.length-1;Ke>=0&&Fe.size<qe;Ke-=Xe)Re($e[Ke]);return Array.from(Fe.values()).sort((Ke,ct)=>Ke.index-ct.index).slice(0,qe)})(tN().map($e=>{var qe;const Fe=dt.value[$e.index];return Fe?Bt(st({},$e),{nodeType:String((qe=Fe.type)!=null?qe:""),signature:Ou($e.index)}):null}).filter($e=>!!$e)):[],Ne=yN({allowFallback:H.allowAnchorFallback===!0,requireViewport:H.requireViewport});return Ne||Se.length||H.includeEmptyState===!0?Bt(st({sessionKey:w.sessionKey,threadKey:w.threadKey},Ne?{anchor:Ne.anchor,anchorCaptured:Ne.captured}:{anchorCaptured:!1}),{metrics:w,width:w.width,contentHash:ce?F0():void 0,measurementKey:br()||void 0,heightCache:Se.length?Se:void 0}):null}function O0(w){var H,X;const J=Fu();if(!J)return;const ce=(function($e){const qe=L.value;if(!qe)return null;const Fe=ye(qe,$e.root),Re=dt.value.length,Ue=mt("getRendererBottomOffsetWithinRoot.offsetHeight",()=>qe.offsetHeight||0),Ie=Math.max(0,Ue>0?Ue:Re>0?mt("getRendererBottomOffsetWithinRoot.scrollHeight",()=>qe.scrollHeight||0):0),Be=ux();return Fe+Math.max(Ie,Be)})(J);if(ce==null)return;const Se=Math.max(0,w.distanceFromBottomPx),Ne=Math.max(0,ce-J.clientHeight-Se);(function($e){a0=Hu()+120,Nu=$e})(Ne),J.isViewportRoot?(X=(H=J.doc.defaultView)==null?void 0:H.scrollTo)==null||X.call(H,0,Ne):N4(J.root,J.doc,Ne,{isReverseFlexScrollRoot:Te,getNormalizedScrollTop:ze})}const R0=[];function fx(){if(P)for(Xl!=null&&(K?.(Xl),Xl=null);R0.length;){const w=R0.pop();w!=null&&window.clearTimeout(w)}}function fc(w){const H=!!Gs.value;Gs.value=null,a0=0,Nu=null,fx(),H&&w&&qn(w)}function hc(){if(!Gs.value||!P||Xl!=null)return;const w=()=>{Xl=null;const H=Gs.value;H&&O0(H)};Xl=ge?ge(w):null,Xl==null&&w()}function hx(w,H={}){const X=dt.value.length;return X<=0?[]:w.filter(J=>!(!Number.isInteger(J.index)||J.index<0||J.index>=X)&&!(!Number.isFinite(J.height)||J.height<=0)&&!(H.requireSignature&&!J.signature)&&!(H.requireCompatibilityMetadata&&!J.nodeType&&!J.signature)&&(function(ce){var Se;const Ne=dt.value[ce.index];return!(!Ne||ce.nodeType&&ce.nodeType!==String((Se=Ne.type)!=null?Se:"")||ce.signature&&ce.signature!==Ou(ce.index))})(J))}function px(w){const H=dd(Jl()),X=dd(w);return H!==-1&&X!==-1&&H===X}function B0(w){var H;const X=Number(w?.width);if(Number.isFinite(X)&&X>0)return X;const J=Number((H=w?.metrics)==null?void 0:H.width);return Number.isFinite(J)&&J>0?J:null}function mx(w){var H;return w.sessionKey===Yn()&&!!S0(w.threadKey)&&((H=w.measurementKey)!=null?H:"")===br()&&!!px(B0(w))&&!!(function(X){const J=X.heightCache;return!!J?.length&&(gx(X)?J.some(ce=>!!(ce.nodeType||ce.signature)):J.some(ce=>!!ce.signature))})(w)}function gx(w){return!!(w.contentHash&&w.contentHash===F0())}function wN(w){return!gx(w)}let na=null,oa=null,ah=null,Ru=null,Bu=null;function D0(w){var H;const X=w.map(ce=>{var Se,Ne;return[ce.index,Math.round(10*ce.height),(Se=ce.nodeType)!=null?Se:"",(Ne=ce.signature)!=null?Ne:""].join("")}).join(""),J=dd(Jl());return[(H=fo())!=null?H:"",Yn(),br(),dt.value.length,J,w.length,I0(X)].join(":")}function vx(w=(H=>(H=o.virtualScroll)==null?void 0:H.heightCache)()){if(!en.value||!w?.length||dt.value.length<=0||!px((H=o.virtualScroll)==null?void 0:H.heightCacheWidth))return!1;var H;const X=hx(w,{requireSignature:!0});if(!X.length)return!1;const J=D0(X);return J===na?(oa="standalone",!0):(Wb(X,{mode:"merge"}),hi(),na=J,oa="standalone",zu(),qn("restore"),!0)}function P0(w,H={}){var X,J,ce;if(!en.value||!w||w.sessionKey!==Yn()||!S0(w.threadKey)||dt.value.length<=0)return!1;const Se=!!((X=w.heightCache)!=null&&X.length)&&!ch(),Ne=!w.anchor||w.anchorCaptured===!1&&H.allowUncapturedAnchor!==!0?null:w.anchor,$e=H.restoreAnchor===!0&&!!Ne&&!ch()&&Number(B0(w))>0;let qe=!1;if((J=w.heightCache)!=null&&J.length&&mx(w)){const Re=hx(w.heightCache,{requireCompatibilityMetadata:!w.contentHash,requireSignature:wN(w)});Re.length&&(Wb(Re,{mode:"merge"}),hi(),na=D0(Re),oa="restore",zu(),qe=!0)}if(Se||$e)return!1;if(!H.restoreAnchor||!Ne)return qe&&qn("restore"),!0;const Fe=(function(Re,Ue){var Ie;const Be=Re.anchor,Xe=Be?Be.type==="bottom"?`bottom:${Math.round(Be.distanceFromBottomPx)}`:`node:${Be.nodeIndex}:${Math.round(Be.offsetWithinNodePx)}`:"none";return[(Ie=fo())!=null?Ie:"",Yn(),br(),ih.value,Ue,Xe].join(":")})(w,(ce=H.restoreToken)!=null?ce:"imperative");return ah===Fe?(qe&&qn("restore"),!0):(ah=Fe,(function(Re){const Ue=()=>{if(Re.type==="node")return fc(),void Fb({nodeIndex:Re.nodeIndex,offsetWithinNodePx:Re.offsetWithinNodePx});if(Yf(),oc.value=null,Gs.value=Re,fx(),O0(Re),P)for(const Ie of[0,120,280,480])R0.push(window.setTimeout(()=>{const Be=Gs.value;Be&&O0(Be)},Ie))};(function(Ie){if(!zt.value)return!1;const Be=dt.value.length;return!(Be<=0||(yr.value=Ie.type==="node"?qo(Ie.nodeIndex,0,Be-1):Be-1,Lu(),0))})(Re)?kt(Ue):Ue()})(Ne),qn("restore"),!0)}function ch(){const w=Jl();return Number.isFinite(w)&&w>0}function yx(w){var H;return w.sessionKey===Yn()&&!!S0(w.threadKey)&&(dt.value.length<=0||!(!((H=w.heightCache)!=null&&H.length)||ch())||!(!(w.anchor&&Number(B0(w))>0)||ch()))}function H0(){St.clear();for(const w of Object.keys(sc)){const H=Number(w);Number.isInteger(H)&&H>=0&&H<dt.value.length&&Db(H)}}function Du(){Zs!=null&&(K?.(Zs),Zs=null),Y0()}function kx(){return!P||He?Promise.resolve():new Promise(w=>{let H=!1,X=null;const J=()=>{H||(H=!0,X!=null&&window.clearTimeout(X),w())};if(ge)return ge(J),void(X=window.setTimeout(J,50));X=window.setTimeout(J,0)})}function W0(w,H=fo(),X=Xs.value){return Yn()===w&&fo()===H&&Xs.value===X}function z0(){return Vn(this,arguments,function*(w={}){var H,X,J,ce,Se;const Ne=Yn(),$e=fo(),qe=Xs.value,Fe=(H=w.frames)!=null?H:2,Re=(X=w.timeoutMs)!=null?X:120,Ue=(J=w.reason)!=null?J:"manual",Ie=w.expectedSettledTokenKey,Be=w.flushPendingTimers===!0,Xe=ea(Ue),Ke=()=>Bt(st({},Xe),{phase:Xe.final?"settling":Xe.phase,stable:!1,confidence:Xe.confidence==="final"?"mixed":Xe.confidence,reason:Ue}),ct=()=>W0(Ne,$e,qe)&&(Ie==null||Wu()===Ie);for(let Et=0;Et<Fe;Et++){if(yield kt(),!ct()||(yield kx(),!ct()))return Ke();xr(),Du()}if(yield(function(Et){return!P||Et<=0?Promise.resolve():new Promise(At=>window.setTimeout(At,Et))})(Re),!ct()||(Be&&Gb(),xr(),Du(),!ct()))return Ke();const ot=T0();ot&&(E0=Ne,M0=$e,((ce=o.virtualScroll)==null?void 0:ce.settleMode)==="manual"&&Ie!=null&&rh((Se=o.virtualScroll)==null?void 0:Se.settledToken)&&Wu()===Ie&&(uc=Ku(o.virtualScroll.settledToken)));const gt=ct()&&ot&&cx(),bt=ea(Ue,gt?"final":void 0);return K0(bt,!0),bt})}let U0="content",sa=null,ia=null,q0=0,Pu=null,pc=null,j0=null,V0=null;function Hu(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function bx(w){var H,X;const J=Pu;if(!J)return!0;const ce=(X=(H=o.virtualScroll)==null?void 0:H.heightDiffThresholdPx)!=null?X:1;return Math.abs(w.totalHeight-J.totalHeight)>ce||w.sessionKey!==J.sessionKey||w.phase!==J.phase||w.stable!==J.stable||w.final!==J.final||w.threadKey!==J.threadKey||w.nodeCount!==J.nodeCount||w.measuredCount!==J.measuredCount||w.width!==J.width}function Wu(w=(H=>(H=o.virtualScroll)==null?void 0:H.settledToken)()){return Fo(w)}function xx(w,H){var X,J;return[w,H.sessionKey,(X=H.threadKey)!=null?X:"",br(),F0(),Fo((J=o.virtualScroll)==null?void 0:J.settledToken),Math.round(H.totalHeight),Math.round(H.width)].join("\0")}function zu(){j0=null,V0=null,pc=null}function _N(w){const H=w.heightCache;return H?.length?D0(H):""}function Uu(w){var H,X,J;const ce=w.metrics,Se=w.anchor?(Ne=w.anchor).type==="bottom"?`bottom:${Math.round(Ne.distanceFromBottomPx)}`:`node:${Ne.nodeIndex}:${Math.round(Ne.offsetWithinNodePx)}`:"none";var Ne;return[w.sessionKey,(H=w.threadKey)!=null?H:"",(X=w.measurementKey)!=null?X:br(),(J=w.contentHash)!=null?J:"",_N(w),Se,w.anchorCaptured?1:0,ce.liveRange.start,ce.liveRange.end,ce.renderedCount,ce.nodeCount,Math.round(ce.totalHeight),Math.round(ce.width),ce.phase,ce.stable?1:0].join("\0")}function K0(w,H=!1){if(!en.value||(function(Ne=!1){return!Ne&&No.value&&!zs.value})(H))return;const X=H||bx(w),J=(function(Ne,$e=!1){return $e||Ne.stable||Ne.phase==="final"?{state:dc(Ne,{includeHeightCache:!0})}:{state:dc(Ne)}})(w,H),ce=J.state,Se=!!(ce&&(X||(function(Ne,$e=!1){return!!$e||Uu(Ne)!==pc})(ce,H)));if(X&&(B(w),Pu=w,q0=Hu()),ce&&Se&&(W(ce),ce.anchor&&z(ce.anchor),pc=Uu(ce)),w.stable){const Ne=xx("settled",w);if(Ne!==j0){j0=Ne;const $e=dc(w,{includeHeightCache:!0});$e&&(W($e),pc=Uu($e)),(function(qe){s("render-settled",qe)})(w)}}if(w.phase==="final"){const Ne=xx("final",w);if(Ne!==V0){V0=Ne;const $e=dc(w,{includeHeightCache:!0});$e&&(W($e),pc=Uu($e)),(function(qe){s("render-final",qe)})(w)}}}function G0(){sa!=null&&(K?.(sa),sa=null),ia!=null&&P&&(window.clearTimeout(ia),ia=null)}function wx(){sa=null,ia=null,(function(w){if(kr.size>0||Zs!=null)return!0;switch(w){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(U0)&&(xr(),Du()),K0(ea(U0))}function qn(w){var H,X;if(!en.value||(U0=w,sa!=null||ia!=null))return;const J=Math.max(0,(X=(H=o.virtualScroll)==null?void 0:H.emitIntervalMs)!=null?X:32),ce=Math.max(0,J-(Hu()-q0)),Se=()=>{ia=null,sa=ge?ge(wx):null,sa==null&&wx()};P&&ce>0?ia=window.setTimeout(Se,ce):Se()}function _x(){Lb.value+=1}function uh(w){if(ls.value&&w>=te.value){const H=dt.value[w],X=tt.value===!0&&rt.value!==!0&&w>=dt.value.length-2,J=H?.type==="code_block"||H?.type==="image"||H?.type==="mermaid"||H?.type==="infographic";if(!X||J)return!1}return!Zi.value||w<yn.value||g0.value.has(w)}function mc(w){const H=nh.get(w);H&&(H(),nh.delete(w));const X=rc.get(w);X&&(X.destroy(),rc.delete(w)),oh(w)}function dh(w,H){let X=!1;if(H){const Se=an.get(w);an.set(w,H),Se!==H&&(X=!0)}else an.delete(w)&&(X=!0);if(X&&_x(),H||oh(w),!zb.value||!De)return mc(w),void(H&&Zi.value&&ol(w,!0));if(!zt.value&&Zi.value&&!U.value&&rc.size>=ae.value&&(U.value||(U.value=!0,v0()),!zb.value||!De))return mc(w),void(H&&ol(w,!0));if(w<yn.value&&!zt.value||g0.value.has(w))return mc(w),void ol(w,!0);if(!H)return void mc(w);mc(w);const J=De(H,{rootMargin:Ee.value});if(!J)return;rc.set(w,J),ol(w,J.isVisible.value),Zi.value&&(function(Se){if(!P||!Zi.value)return;oh(Se);const Ne=Se%17*23,$e=window.setTimeout(()=>{if(Yb.delete(Se),!Zi.value||g0.value.has(Se))return;const qe=an.get(Se);if(!qe)return;const Fe=ke(qe),Re=qe.ownerDocument||document,Ue=Re.defaultView||window,Ie=!Fe||Fe===Re.documentElement||Fe===Re.body,Be=!Ie&&Fe?mt("nodeVisibilityFallback.root.getBoundingClientRect",()=>Fe.getBoundingClientRect()):null,Xe=Ie?0:Be.top,Ke=Ie?mt("nodeVisibilityFallback.clientHeight",()=>{var ot,gt;return(gt=(ot=Ue.innerHeight)!=null?ot:Fe?.clientHeight)!=null?gt:0}):Be.bottom,ct=mt("nodeVisibilityFallback.node.getBoundingClientRect",()=>qe.getBoundingClientRect());ct.bottom>=Xe-500&&ct.top<=Ke+500&&ol(Se,!0)},1800+Ne);Yb.set(Se,$e)})(w);let ce=null;ce=et(()=>J.isVisible.value,Se=>{if(Se){oh(w),ol(w,!0),ce?.(),nh.delete(w),rc.get(w)===J&&rc.delete(w);try{J.destroy()}catch{}}},{immediate:!0}),nh.set(w,ce),zt.value&&Li()}function Y0(){Zs=null,ic(()=>{let w=!1;for(const[H,X]of kr)kr.delete(H),Xi.get(H)===X.el&&Ql.get(H)===X.version&&(w=Pb(H,X.height,{allowShrink:X.allowShrink})||w);return w})}function gc(){Zs!=null&&(K?.(Zs),Zs=null),kr.clear()}function fh(w,H){(function(X,J,ce){var Se;if(!Number.isFinite(ce)||ce<=0||Xi.get(X)!==J)return;const Ne=Ql.get(X);if(Ne==null)return;const $e=dt.value[X],qe=vt.value&&rt.value!==!0&&!((Se=o.nodes)!=null&&Se.length)&&X>=dt.value.length-2,Fe=!($e?.loading===!0||qe),Re=kr.get(X),Ue=Re?Re.allowShrink&&Fe:Fe,Ie=Re&&!Ue?Math.max(Re.height,ce):ce;kr.set(X,{height:Ie,allowShrink:Ue,version:Ne,el:J}),Zs==null&&(Zs=ge?ge(Y0):null,Zs==null&&Y0())})(w,H,Hb(w,H))}function xr(){for(const[w,H]of Xi)H&&fh(w,H)}function Sx(){to?.disconnect(),to=null,Vt.clear()}function Z0(){for(;Qf.length;)th(Qf.pop())}et(zs,w=>{w&&qn("content")},{flush:"post"}),t({getVirtualMetrics:ea,captureVirtualState:function(w={}){var H;return dc(ea("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:w.allowFallbackAnchor===!0,requireViewport:w.requireViewport===!0,includeEmptyState:(H=w.includeEmptyState)==null||H})},restoreVirtualState:function(w,H={}){const X=H.restoreAnchor===!0,J=H.restoreToken==null?"imperative":String(H.restoreToken);Ru=w,Bu={restoreAnchor:X,restoreToken:J,allowUncapturedAnchor:H.allowUncapturedAnchor===!0},!P0(w,{restoreAnchor:X,restoreToken:J,allowUncapturedAnchor:H.allowUncapturedAnchor===!0})&&yx(w)||(Ru=null,Bu=null)},forceMeasure:function(w="manual"){return Vn(this,null,function*(){yield kt(),yield kx(),xr(),Du(),yield kt();const H=ea(w);return K0(H,!0),H})},settle:z0,scrollToNode:function(w,H="start"){fc(),Yf();const X=dt.value.length;if(X<=0)return;const J=qo(w,0,X-1),ce=()=>{var Se;const Ne=KT({nodeIndex:J,offsetWithinNodePx:0}),$e=c0(J),qe=Fu(),Fe=(Se=qe?.clientHeight)!=null?Se:0,Re=jT();let Ue=Ne;if(H==="center")Ue=Ne-Fe/2+$e/2;else if(H==="end")Ue=Ne-Fe+$e;else if(H==="nearest"&&Re!=null){if(Ne>=Re&&Ne+$e<=Re+Fe)return;Ue=Ne<Re?Ne:Ne-Fe+$e}VT(Math.max(0,Ue)),Li({immediate:!0}),zt.value&&(yr.value=J,Lu())};if(zt.value)return yr.value=J,Lu(),void kt(ce);ce()}}),et(()=>js.value,w=>{if(!w){Sx();for(const H of tl.values())for(const X of H)th(X);tl.clear(),Ql.clear(),Z0(),gc()}},{immediate:!0}),et(rt,w=>{w&&(function(){if(P&&rt.value&&Xi.size){Z0();for(const H of[80,240,640]){const X=Kb(H,()=>{for(const[J,ce]of Xi)ce&&fh(J,ce)},"final");X!=null&&Qf.push(X)}}})(),qn(w?"final":"content")});const SN=I4(()=>qn("content"),16),CN=I4(()=>qn("batch"),16);et([()=>dt.value.length,()=>te.value],()=>{Gs.value&&hc(),SN()},{flush:"post",immediate:!0}),et([()=>Uo.start,()=>Uo.end],()=>{CN()},{flush:"post"});const{cleanupBatchScheduler:AN}=(function(w){const{props:H,isClient:X,isTestEnv:J,parsedNodesIdentity:ce,parsedNodeCount:Se,desiredRenderedCount:Ne,datasetKey:$e,batchingEnabled:qe,incrementalRenderingActive:Fe,resolvedBatchSize:Re,resolvedInitialBatch:Ue,renderedCount:Ie,adaptiveBatchSize:Be,previousRenderContext:Xe,previousBatchConfig:Ke,requestFrame:ct,cancelFrame:ot,hasIdleCallback:gt,cleanupNodeVisibility:bt,onDatasetKeyChanged:Et,onDatasetChanged:At}=w;let Tt=null,qt="raf",Zt=null,Mn=0,jo=!1,$o=!1;const $i=new Set,Ji=new Set;function Qu(){if(X){Tt!=null&&(qt==="raf"&&ot?ot(Tt):qt==="idle"&&typeof window.cancelIdleCallback=="function"?window.cancelIdleCallback(Tt):qt==="timeout"&&window.clearTimeout(Tt),Tt=null),Mn+=1;for(const ts of $i)ot&&ot(ts);for(const ts of Ji)window.clearTimeout(ts);$i.clear(),Ji.clear(),Zt=null,jo=!1,$o=!1}}function xh(){return typeof performance<"u"?performance.now():Date.now()}function zx(ts){(function(wr){var il;if(!Fe.value)return;const _r=Math.max(2,(il=H.renderBatchBudgetMs)!=null?il:6),Sr=Math.max(1,Re.value||1),Fi=Math.max(1,Math.floor(Sr/4));wr>1.5*_r?Be.value=Math.max(Fi,Math.floor(.8*Be.value)):wr<.6*_r&&Be.value<Sr&&(Be.value=Math.min(Sr,Math.ceil(1.2*Be.value)))})(ts),jo=!1;const As=$o||Ie.value<Ne.value;$o=!1,As&&jx()}function Ux(ts,As={}){var wr,il;if(!Fe.value)return;const _r=Ne.value;if(Ie.value>=_r)return;const Sr=Math.max(1,ts),Fi=()=>{const kc=xh();Tt=null;const Ju=Zt??Sr;Zt=null;const bc=xh();Ie.value=Math.min(_r,Ie.value+Ju),bt(Ie.value),(function(og,wh){if(!X)return void zx(wh);jo=!0;const Vx=++Mn;kt().then(()=>{var Kx;if(Vx!==Mn)return;const KN=xh(),GN=Math.max(wh,KN-og),Gx=()=>{Vx===Mn&&zx(GN)};if(ct){let la=null,xc=null,Zx=!1;const Xx=()=>{Zx||(Zx=!0,la!==null&&($i.delete(la),la=null),xc!==null&&(Ji.delete(xc),window.clearTimeout(xc),xc=null),Gx())};return la=ct(()=>{Xx()}),$i.add(la),xc=window.setTimeout(()=>{la!==null&&ot&&ot(la),Xx()},Math.max(32,(Kx=H.renderBatchIdleTimeoutMs)!=null?Kx:120)),void Ji.add(xc)}const Yx=window.setTimeout(()=>{Ji.delete(Yx),Gx()},0);Ji.add(Yx)})})(kc,xh()-bc)};if(!X||As.immediate)return void Fi();const rl=Math.max(0,(wr=H.renderBatchDelay)!=null?wr:16);if(Zt=Zt!=null?Math.max(Zt,Sr):Sr,Tt==null){if(!J&>&&window.requestIdleCallback){const kc=Math.max(0,(il=H.renderBatchIdleTimeoutMs)!=null?il:120);return qt="idle",void(Tt=window.requestIdleCallback(()=>Fi(),{timeout:kc}))}if(ct&&!J)return qt="raf",void(Tt=ct(()=>{rl===0?Fi():(qt="timeout",Tt=window.setTimeout(()=>Fi(),rl))}));qt="timeout",Tt=window.setTimeout(()=>Fi(),rl)}}function qx(ts,As={}){jo?$o=!0:ts==null?jx():Ux(ts,As)}function jx(){Fe.value&&Ux(qe.value?Math.max(1,Math.round(Be.value)):Math.max(1,Re.value))}return et([ce,Se,$e,Fe,Re,Ue,()=>H.renderBatchDelay],()=>{var ts;const As=Se.value,wr=Xe.value,il=$e.value,_r=!Object.is(il,wr.key),Sr=As!==wr.total,Fi=_r||Sr;Xe.value={key:il,total:As};const rl=Ke.value,kc=(ts=H.renderBatchDelay)!=null?ts:16,Ju=rl.batchSize!==Re.value||rl.initial!==Ue.value||rl.delay!==kc||rl.enabled!==Fe.value;Ke.value={batchSize:Re.value,initial:Ue.value,delay:kc,enabled:Fe.value},_r&&Et(As),(Fi||Ju||!Fe.value)&&Qu(),(Fi||Ju)&&(Be.value=Math.max(1,Re.value||1)),Fi&&At();const bc=Ne.value;if(!As)return Ie.value=0,void bt(0);if(!Fe.value)return Ie.value=bc,void bt(Ie.value);const og=_r||wr.total===0;Ie.value=og||Ju?Math.min(bc,Ue.value):Math.min(Ie.value,bc);const wh=Math.max(1,Ue.value||Re.value||As);Ie.value<bc?qx(wh,{immediate:!X}):bt(Ie.value)},{immediate:!0}),et(Ne,(ts,As)=>{Fe.value&&(typeof As=="number"&&ts<=As||ts>Ie.value&&qx())}),{cleanupBatchScheduler:Qu}})({props:S,isClient:P,isTestEnv:He,parsedNodesIdentity:_o,parsedNodeCount:Un,desiredRenderedCount:Jf,datasetKey:mN,batchingEnabled:ao,incrementalRenderingActive:ls,resolvedBatchSize:Ut,resolvedInitialBatch:yn,renderedCount:te,adaptiveBatchSize:Me,previousRenderContext:_e,previousBatchConfig:Oe,requestFrame:ge,cancelFrame:K,hasIdleCallback:xe,cleanupNodeVisibility:cN,onDatasetKeyChanged:w=>{gc(),Xf(),hi(),zu(),w>0&&Zf(w)},onDatasetChanged:()=>{zt.value&&Li({immediate:!0})}});et([Ub,zt,()=>L.value,()=>Y()],([w,H])=>{if(!w)return Zb(),void m0();uN(),H?Li({immediate:!0}):m0()},{flush:"post",immediate:!0}),et([()=>dt.value.length,()=>zt.value],w=>Vn(null,[w],function*([H,X]){X&&H&&P&&(yield kt(),Li({immediate:!0}))}),{flush:"post"}),et(Xn,w=>{w&&(function(){var H;if(To.value&&lo.value&&Wo.value&&((H=Ss.value)!=null&&H[1]))return;const X=yt({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),J=yt({type:"list_item",children:[X],raw:"- Probe paragraph text"}),ce=yt({type:"list",ordered:!1,items:[J],raw:"- Probe paragraph text"});To.value=X,lo.value=J,Wo.value=ce;const Se={1:null,2:null,3:null,4:null,5:null,6:null};for(let Ne=1;Ne<=6;Ne++)Se[Ne]=yt({type:"heading",level:Ne,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(Ne)} Probe heading`});Ss.value=Se})()},{immediate:!0}),et([()=>L.value,Xn],()=>{if(!Xn.value)return b0(),void(le.value=0);Qb(),b0(),Xn.value&&L.value&&typeof ResizeObserver<"u"&&($u=new ResizeObserver(()=>{Qb(),oc.value&&Iu(),Gs.value&&hc(),qn("resize")}),$u.observe(L.value))},{immediate:!0}),et([Xn,di,Xs],()=>Vn(null,null,function*(){if(!Xn.value)return oe.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void hi();yield kt(),(function(){if(!Xn.value||typeof window>"u")return oe.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void hi();const w={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},H=Xb(k0(O.value),".paragraph-node");w.paragraph=hv(O.value,H,"pre-wrap");const X=k0(j.value),J=X?.querySelector(".paragraph-node");w.listItem=hv(j.value,J,"pre-wrap");const ce=mt("readSimpleTextProbeProfile.list.offsetHeight",()=>{var Ne,$e;return($e=(Ne=Z.value)==null?void 0:Ne.offsetHeight)!=null?$e:0}),Se=mt("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var Ne,$e;return($e=(Ne=j.value)==null?void 0:Ne.offsetHeight)!=null?$e:0});w.listWrapperOverhead=Math.max(0,ce-Se);for(let Ne=1;Ne<=6;Ne++){const $e=Xb(k0(ie[Ne]),`h${Ne}`);w.headings[Ne]=hv(ie[Ne],$e,"pre-wrap")}oe.value=w,hi()})()}),{flush:"post",immediate:!0}),et(()=>dt.value.length,()=>{zt.value&&Li({immediate:!0})}),et([Xn,le],()=>{hi(),zt.value&&Li({immediate:!0}),oc.value&&Iu(),Gs.value&&hc(),qn("resize")},{immediate:!1}),et(()=>Zi.value,w=>{if(w)for(const[H,X]of an)dh(H,X);else if(v0(),zt.value)Li({immediate:!0});else for(const[H,X]of an)X&&ol(H,!0)},{immediate:!1}),et([Ee,ae,()=>Y()],()=>{var w;(w=De.refresh)==null||w.call(De);for(const[H,X]of an)dh(H,X)},{immediate:!1}),et([()=>S.viewportPriority,()=>dt.value.length,ae],([w,H,X])=>{if(w!==!1){if(U.value&&(H<=200||H<=X)){U.value=!1;for(const[J,ce]of an)dh(J,ce)}}else U.value=!1}),et(()=>te.value,()=>{zt.value&&Li({immediate:!0})}),et([yr,Jo,es,()=>dt.value.length,zt],()=>{Lu()},{immediate:!0});let qu=null,ju=!1,vc=null;function Vu(){qu=null,E0=null,M0=void 0,uc=null,zu()}function X0(){gc(),Xf(),hi(),St.clear();const w=dt.value.length;w>0&&Zf(w),H0()}function Q0(){G0(),Gb(),Pu=null,na=null,oa=null,ah=null,Ru=null,Bu=null,ju=!1,Vu(),lx("restore"),Yf(),fc()}function Ku(w){var H;return[(H=fo())!=null?H:"",Yn(),br(),ih.value,Wu(w),dt.value.length,Math.round(nc(0,dt.value.length)),Math.round(Jl()),pi.count,Math.round(pi.total)].join(":")}function Cx(){return Vn(this,null,function*(){var w,H,X,J;const ce=(w=o.virtualScroll)==null?void 0:w.settledToken,Se=Wu(ce),Ne=Yn(),$e=fo(),qe=Xs.value;if(en.value&&((H=o.virtualScroll)==null?void 0:H.settleMode)==="manual"&&rh(ce))if(T0()){if(Ku(ce)!==uc&&!ju){ju=!0;try{const Fe=yield z0({reason:"manual",expectedSettledTokenKey:Se}),Re=Wu()===Se;W0(Ne,$e,qe)&&Fe.sessionKey===Ne&&Fe.threadKey===$e&&Re&&Fe.stable&&Fe.phase==="final"&&(uc=Ku((X=o.virtualScroll)==null?void 0:X.settledToken))}finally{ju=!1,yield kt();const Fe=(J=o.virtualScroll)==null?void 0:J.settledToken,Re=rh(Fe)?Ku(Fe):"";W0(Ne,$e,qe)&&Re&&uc!==Re&&Cx()}}}else qn("manual")})}et(en,(w,H)=>{if(w!==H){if(!w)return Q0(),void G0();Q0(),X0(),vc=Xs.value,qn("content")}},{flush:"post"}),et([en,Xs],([w,H])=>{w?vc!=null?vc!==H&&(vc=H,(function(X="resize"){gc(),Xf(),hi(),St.clear();const J=dt.value.length;J>0&&Zf(J),H0(),na=null,oa=null,ah=null,Pu=null,ju=!1,Vu(),vx(),kt(()=>{xr(),oc.value&&Iu(),Gs.value&&hc(),qn(X)})})("resize")):vc=H:vc=null},{flush:"post",immediate:!0}),et([en,()=>Yn(),()=>fo()],([w])=>{w&&(Q0(),X0(),lx("content"),qn("content"))}),et([en,()=>Yn(),()=>fo(),Xs,()=>dt.value.length],([w])=>{w&&(function(H="async-node"){let X=!1;for(const[J,ce]of Array.from(Qi.entries()))C0(ce)||(Qi.delete(J),Ys.delete(J),X=!0);X&&(ac(),qn(H))})("async-node")},{flush:"post"}),et([en,()=>{var w;return(w=o.virtualScroll)==null?void 0:w.sessionKey},()=>{var w;return(w=o.virtualScroll)==null?void 0:w.measurementKey},()=>o.indexKey,()=>ee.value],([w])=>{w&&(zu(),(function(H="content"){if(!en.value)return;const X=[],J=dt.value.length,ce=y0(J);for(const Se of Array.from(St.keys())){if(Se>=J){X.push(Se);continue}if(Se<ce)continue;const Ne=Ou(Se),$e=St.get(Se);$e!=null&&$e!==Ne&&X.push(Se),St.set(Se,Ne)}for(const Se of Array.from(St.keys()))Se>=J&&St.delete(Se);X.length&&((function(Se,Ne={}){const $e=Array.from(Se,Number);Bb($e);let qe=0;if(ic(()=>(qe=eN($e,Ne),qe>0)),qe>0)(function(Fe){for(const Re of Fe)St.delete(Re)})($e);else for(const Fe of $e)Ks.delete(Fe)})(X,{notify:!1}),hi(),Vu(),oc.value&&Iu(),Gs.value&&hc(),qn(H))})("content"))},{flush:"post",immediate:!0}),et([en,()=>dt.value.length,()=>Yn(),()=>fo()],([w,H,X,J],[ce,Se,Ne,$e])=>{w&&ce&&X===Ne&&J===$e&&H!==Se&&Vu()},{flush:"post"}),et([en,()=>{var w;return(w=o.virtualScroll)==null?void 0:w.heightCache},()=>{var w;return(w=o.virtualScroll)==null?void 0:w.heightCacheWidth},()=>{var w;return(w=o.virtualScroll)==null?void 0:w.restoreState},()=>{var w;return(w=o.virtualScroll)==null?void 0:w.measurementKey},()=>dt.value.length,()=>Yn(),le],()=>{vx()},{flush:"post",immediate:!0}),et([en,()=>{var w;return(w=o.virtualScroll)==null?void 0:w.restoreState},()=>{var w;return(w=o.virtualScroll)==null?void 0:w.restoreAnchor},()=>{var w;return(w=o.virtualScroll)==null?void 0:w.measurementKey},()=>dt.value.length,()=>Yn(),le],w=>Vn(null,[w],function*([H,X]){if(!H||!X)return;yield kt();const J=(function(){var ce;const Se=(ce=o.virtualScroll)==null?void 0:ce.restoreAnchor;return Se==null||Se===!1?null:Se===!0?"true":String(Se)})();P0(X,{restoreAnchor:J!=null,restoreToken:J??void 0})}),{flush:"post",immediate:!0}),et([en,le,()=>{var w;return(w=o.virtualScroll)==null?void 0:w.restoreState},()=>{var w;return(w=o.virtualScroll)==null?void 0:w.measurementKey}],([w])=>{var H;if(!w)return;const X=(H=o.virtualScroll)==null?void 0:H.restoreState;X&&na&&oa==="restore"&&(mx(X)||(X0(),na=null,oa=null,qn("resize")))},{flush:"post"}),et([en,()=>dt.value.length,()=>Yn(),le],w=>Vn(null,[w],function*([H]){var X;const J=Ru,ce=Bu;H&&J&&(yield kt(),!P0(J,{restoreAnchor:ce?.restoreAnchor===!0,restoreToken:(X=ce?.restoreToken)!=null?X:"imperative",allowUncapturedAnchor:ce?.allowUncapturedAnchor===!0})&&yx(J)||(Ru=null,Bu=null))}),{flush:"post",immediate:!0}),et([en,rt,()=>{var w;return(w=o.virtualScroll)==null?void 0:w.settleMode},()=>Yn(),()=>fo(),Xs,p0,jb,()=>te.value,Jf,()=>pi.count,()=>pi.total],([w,H,X])=>{if(!w||H!==!0||X==="manual"||!N0())return;const J=(function(){var ce;const Se=dt.value.length;return[(ce=fo())!=null?ce:"",Yn(),br(),ih.value,Se,Math.round(nc(0,Se)),Math.round(Jl()),pi.count,Math.round(pi.total)].join(":")})();qu!==J&&(qu=J,z0({reason:"final"}).then(ce=>{ce.stable||qu!==J||(qu=null)}))},{flush:"post",immediate:!0}),et([en,rt,()=>{var w;return(w=o.virtualScroll)==null?void 0:w.settleMode},()=>{var w;return(w=o.virtualScroll)==null?void 0:w.settledToken},()=>Yn(),()=>fo(),Xs,p0,jb,()=>te.value,Jf,()=>dt.value.length,()=>pi.count,()=>pi.total],()=>{Cx()},{flush:"post",immediate:!0}),et([()=>dt.value.length,zt,Jo,es,()=>Uo.start,()=>Uo.end],([w,H,X,J,ce,Se])=>{pe.value&&vn("virtualization",{nodes:w,virtualization:H,maxLiveNodes:X,buffer:J,focusIndex:yr.value,scroll:H?(()=>{const Ne=Tu.value||ke();return Ne?{reverse:Te(Ne),scrollTop:Math.round(Ne.scrollTop),scrollTopAbs:Math.round(Math.abs(Ne.scrollTop)),scrollHeight:Math.round(Ne.scrollHeight),clientHeight:Math.round(Ne.clientHeight)}:null})():null,liveRange:{start:ce,end:Se},rendered:te.value})}),et([()=>S.customId],([w],H,X)=>{if(!w||So)return;const J=(function(ce,Se){return ce?(Co.controllers[ce]=Se,()=>{Co.controllers[ce]===Se&&delete Co.controllers[ce]}):()=>{}})(w,{captureRestoreAnchor:$b,restoreAnchor:Fb,getAnchorDrift:GT,getReport:hN});X(()=>{J()})},{immediate:!0}),so(()=>{(function(){if(en.value)try{xr(),Du();const w=ea("manual");bx(w)&&(B(w),Pu=w,q0=Hu());const H=dc(w,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});H&&(W(H),H.anchor&&z(H.anchor),pc=Uu(H))}catch{}})(),AN(),v0(),Wt(),Sx();for(const w of tl.values())for(const H of w)th(H);tl.clear(),Ql.clear(),St.clear(),Z0(),gc(),b0(),Yf(),fc(),G0(),Zb(),m0()});const MN=Sd("ViewportDeferredMermaidBlockNode",Hi({loader:()=>Vn(null,null,function*(){try{return(yield ps(()=>import("./index11-wd1P4PGw.js"),__vite__mapDeps([7,5]))).default}catch(w){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".',w),Is}}),loadingComponent:j4,delay:0}),j4),EN=Sd("ViewportDeferredInfographicBlockNode",Hi({loader:()=>Vn(null,null,function*(){try{return(yield ps(()=>import("./index10-ePz6DAnA.js"),[])).default}catch(w){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.',w),Is}}),loadingComponent:q4,delay:0}),q4),TN=Sd("ViewportDeferredD2BlockNode",Hi(()=>Vn(null,null,function*(){try{return(yield ps(()=>import("./index8-C0MfrVDC.js"),[])).default}catch(w){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".',w),Is}})),Is),Ax={text:ro,paragraph:Ha,heading:V1,code_block:ov,list:du,list_item:uu,blockquote:Ip,table:Gd,definition_list:Lp,footnote:$p,footnote_reference:ni,footnote_anchor:Vd,admonition:Bp,vmr_container:Op,hardbreak:Fl,link:bs,image:$l,thematic_break:Fp,math_inline:Gi,math_block:oE,strong:ys,emphasis:xs,strikethrough:ks,highlight:si,insert:Ds,subscript:Bs,superscript:Rs,emoji:Os,checkbox:ti,checkbox_input:ti,inline_code:rs,html_inline:oi,reference:vs,html_block:Kd},NN=D(()=>_0()),Mx=D(()=>T4(S.codeBlockProps)),IN=D(()=>T4(S.codeBlockProps,{omit:["langs"]})),Ex=D(()=>st(st({stream:S.codeBlockStream,darkTheme:S.codeBlockDarkTheme,lightTheme:S.codeBlockLightTheme,monacoOptions:S.codeBlockMonacoOptions,themes:S.themes,langs:p.value==="shiki"?S.langs:void 0,minWidth:S.codeBlockMinWidth,maxWidth:S.codeBlockMaxWidth},typeof ve.value=="boolean"?{showTooltips:ve.value}:{}),IN.value)),Tx=D(()=>st(Bt(st({},Ex.value),{langs:S.langs}),Mx.value));function Nx(w){return typeof w=="boolean"?w:void 0}const LN=D(()=>{const w=S.codeBlockProps||{},H={},X=Nx(w.showLineNumbers);X!==void 0&&(H.showLineNumbers=X);const J=Nx(w.diffInline);J!==void 0&&(H.diffInline=J);const ce=(function(Se){const Ne=Number(Se);return Number.isFinite(Ne)&&Ne>0?Ne:void 0})(w.reservedHeightPx);return ce!==void 0&&(H.reservedHeightPx=ce),H}),$N=D(()=>st(st({stream:S.codeBlockStream,darkTheme:S.codeBlockDarkTheme,lightTheme:S.codeBlockLightTheme,themes:S.themes,langs:S.langs,minWidth:S.codeBlockMinWidth,maxWidth:S.codeBlockMaxWidth},typeof ve.value=="boolean"?{showTooltips:ve.value}:{}),Mx.value)),FN=D(()=>st({},S.mermaidProps||{})),Ix=D(()=>st({},S.d2Props||{})),ON=D(()=>st({},S.infographicProps||{})),Gu=D(()=>({typewriter:f.value,fade:S.fade,customHtmlTags:Ho.value.customHtmlTags})),RN=D(()=>st(st({},Gu.value),typeof ve.value=="boolean"?{showTooltip:ve.value}:{})),BN=D(()=>st(st({},Gu.value),typeof ve.value=="boolean"?{showTooltips:ve.value}:{})),DN=D(()=>st(st({},Gu.value),typeof ve.value=="boolean"?{showTooltips:ve.value}:{})),PN=D(()=>st(st({},Gu.value),typeof ve.value=="boolean"?{showTooltips:ve.value}:{}));function HN(w){return Array.isArray(w.children)&&w.children.length>0}const hh=D(()=>fN.value.map(w=>{var H,X,J,ce,Se,Ne,$e,qe;let Fe=(function(ot){var gt,bt,Et,At,Tt,qt,Zt;if(ot.type!=="code_block")return ot;const Mn=ot,jo=[String((gt=Mn.language)!=null?gt:""),String((bt=Mn.loading)!=null?bt:""),String((Et=Mn.diff)!=null?Et:""),String((At=Mn.code)!=null?At:""),String((Tt=Mn.originalCode)!=null?Tt:""),String((qt=Mn.updatedCode)!=null?qt:""),String((Zt=Mn.raw)!=null?Zt:"")].join("\0"),$o=Lt.get(Mn);if($o&&$o.signature===jo)return $o.node;const $i=st({},Mn);return Lt.set(Mn,{signature:jo,node:$i}),$i})(w.node);const Re=ph(Fe);let Ue=Ox(Fe,Re);if((Fe.type==="html_block"||Fe.type==="html_inline")&&Ue===Ax[Fe.type]){const ot=Fe,gt=String((H=ot.tag)!=null?H:"").trim().toLowerCase()||N5(ot.content);if(gt){const bt=fn.value[gt];if(Po.value.has(gt)&&bt)Ue=bt,Fe=Bt(st({},ot),{type:gt,tag:gt,content:rY(ot.content,gt)});else if(I5((X=ot.content)!=null?X:ot.raw,gt)){const Et=String((ce=(J=ot.content)!=null?J:ot.raw)!=null?ce:"");Fe.type==="html_inline"?(Ue=ro,Fe={type:"text",content:Et,raw:Et}):(Ue=Ha,Fe={type:"paragraph",children:[{type:"text",content:Et,raw:Et}],raw:Et})}}}const Ie=Fe.type==="code_block"&&p.value==="pre"&&Ue===Is&&!J0(fn.value,Re);let Be=st({},(function(ot,gt,bt){const Et=gt??ph(ot);if(ot.type==="code_block"){const At=Et?J0(fn.value,Et):void 0;if(bt&&p.value==="pre"&&!At&&bt===Is)return LN.value;if(bt&&Et&&bt===At)return Et==="mermaid"?$x(ot):Et==="infographic"?Fx(ot):Et==="d2"||Et==="d2lang"?Ix.value:Tx.value;if(bt&&bt===fn.value.code_block)return Tx.value;if(ex(bt))return $N.value}return Et==="mermaid"?$x(ot):Et==="infographic"?Fx(ot):Et==="d2"||Et==="d2lang"?Ix.value:ot.type==="link"?RN.value:ot.type==="list"?BN.value:ot.type==="blockquote"?DN.value:ot.type==="table"?PN.value:ot.type==="code_block"?Ex.value:Gu.value})(Fe,Re,Ue));const Xe=Xn.value?lc.value[w.index]:null;Fe.type==="code_block"&&Xe?.kind==="code-block"&&(Be=Bt(st({},Be),Ie?{reservedHeightPx:(Se=Xe.height)!=null?Se:Xe.contentHeight}:{estimatedHeightPx:Xe.height,estimatedContentHeightPx:Xe.contentHeight,estimatedDiffInline:Xe.diffInline})),Ie||Fe.type!=="code_block"||Re!=="mermaid"||Vc(Be.estimatedPreviewHeightPx)!=null||(Be=Bt(st({},Be),{estimatedPreviewHeightPx:Nm(Em(String((Ne=Fe.code)!=null?Ne:"")))})),Ie||Fe.type!=="code_block"||Re!=="infographic"||Vc(Be.estimatedPreviewHeightPx)!=null||(Be=Bt(st({},Be),{estimatedPreviewHeightPx:Im(Tm(String(($e=Fe.code)!=null?$e:"")))})),Fe.type==="math_block"&&(Be=Bt(st({},Be),{cacheScope:nn}));const Ke=(function(ot,gt){const bt=String(ot.type);return!Wf(bt)&&fn.value[bt]===gt})(Fe,Ue),ct=Ke?L2(Fe,de.value):void 0;return Bt(st({},w),{node:Fe,component:Ue,bindings:Be,customBindings:st(st({},ct??{}),Be),rendersCustomNode:Ke,hasSlotChildren:HN(Fe),slotContent:String((qe=Fe.content)!=null?qe:""),isCodeBlock:Fe.type==="code_block",indexKey:`${NN.value}-${w.index}`,vnodeKey:`${pN.value}\0${w.index}\0${Fe.type}`})}));function ph(w){var H;return w?.type==="code_block"?String((H=w.language)!=null?H:"").trim().toLowerCase():""}function J0(w,H){const X=H.trim().toLowerCase();if(X)for(const J of[X,U1(X),D8(X)]){const ce=J&&w[J];if(ce)return ce}}function Lx(w,H,X,J){var ce,Se;const Ne=st({},w.value);return Vc(Ne.estimatedPreviewHeightPx)==null&&(Ne.estimatedPreviewHeightPx=J(X(String((ce=H?.code)!=null?ce:"")),void 0,Ne.maxHeight==="none"?null:(Se=Vc(Ne.maxHeight))!=null?Se:void 0)),Ne}function $x(w){return Lx(FN,w,Em,Nm)}function Fx(w){return Lx(ON,w,Tm,Im)}function Ox(w,H){if(!w)return Vy;const X=fn.value,J=X[String(w.type)];if(w.type==="code_block"){const ce=H??ph(w),Se=ce?J0(X,ce):void 0;return Se||(p.value==="pre"?X.code_block||Is:ce==="mermaid"?X.mermaid||MN:ce==="infographic"?X.infographic||EN:ce==="d2"||ce==="d2lang"?X.d2||TN:J||X.code_block||tx.value)}return J||Ax[String(w.type)]||Vy}function eg(w){s("click",w)}function WN(w){var H;(H=w.target)!=null&&H.closest("[data-node-index]")&&s("mouseover",w)}function zN(w){var H;(H=w.target)!=null&&H.closest("[data-node-index]")&&s("mouseout",w)}function Rx(w){s("mouseover",w)}function Bx(w){s("mouseout",w)}const ra=ne(null),Cs=ne(!1),Yu=ne(null),UN=D(()=>!(S.domMode!=="minimal"||G.value||S.fade!==!1||f.value||Cs.value||Ze.value||zt.value||Io.value||ai.value||it.value||Object.keys(fn.value).length!==0));let Zu,yc=null,tg=0,mh=0,gh=0;const Dx=["code_block","admonition","table","math_block","html_block","image","thematic_break"],qN=new Set(Dx),Px=[".typewriter-cursor",".height-estimation-probes",...Dx.map(w=>`[data-node-type="${w}"]`),"script","style"].join(",");function Hx(w){if(!w||typeof w!="object")return!1;const H=w.type;return typeof H=="string"&&qN.has(H)}function vh(w){var H,X;if(!w||typeof w!="object")return 0;const J=w,ce=(X=(H=J.raw)!=null?H:J.content)!=null?X:J.code;if(typeof ce=="string")return ce.length;const Se=J.children;if(Array.isArray(Se))return Se.reduce(($e,qe)=>$e+vh(qe),0);const Ne=J.items;return Array.isArray(Ne)?Ne.reduce(($e,qe)=>$e+vh(qe),0):0}function yh(){Zu&&(clearTimeout(Zu),Zu=void 0)}function ng(){tg+=1,yc!=null&&(K?.(yc),yc=null)}function Xu(){ng(),sl(),ra.value&&(ra.value.style.visibility="hidden")}function jN(w){var H;if(w.nodeType!==Node.TEXT_NODE||!((H=w.textContent)!=null?H:"").trim())return!1;const X=w.parentElement;return!!X&&!X.closest(Px)}function VN(w){let H=w.lastChild;for(;H;){if(jN(H))return H;if(H.nodeType===Node.ELEMENT_NODE){const X=H;if(!X.matches(Px)&&X.lastChild){H=X.lastChild;continue}}for(;H&&H!==w&&!H.previousSibling;)H=H.parentNode;if(!H||H===w)break;H=H.previousSibling}return null}function Wx(){const w=hh.value;for(let H=w.length-1;H>=0;H--){const X=w[H];if(!X||Hx(X.node)||!uh(X.index))continue;const J=an.get(X.index);if(!J)continue;const ce=VN(J);if(ce)return ce}return null}function sl(){Yu.value&&(Yu.value.classList.remove(V4),Yu.value=null)}function kh(){if(d.value!=="simple"||!P||!Cs.value||!L.value)return void sl();const w=Wx(),H=w?(function(X){var J;const ce=(J=X.parentElement)==null?void 0:J.closest(".text-node");return ce instanceof HTMLElement?ce:X.parentElement})(w):null;H!==Yu.value&&(sl(),H&&(H.classList.add(V4),Yu.value=H))}function bh(){if(d.value!=="precise"||!P||!Cs.value||yc!=null)return;const w=tg,H=()=>{yc=null,w===tg&&(function(){var X,J;if(d.value!=="precise"||!(P&&Cs.value&&L.value&&ra.value))return;const ce=L.value,Se=ra.value;Se.style.visibility="hidden";const Ne=Wx();if(!Ne)return;let $e=0,qe=0,Fe=20,Re=!1;if(Ne?.textContent){const Ue=Ne.textContent.length,Ie=document.createRange();Ie.setStart(Ne,Math.max(0,Ue-1)),Ie.setEnd(Ne,Ue);const Be=typeof Ie.getClientRects=="function"?Ie.getClientRects():void 0,Xe=(J=Be?.[Be.length-1])!=null?J:(X=Ne.parentElement)==null?void 0:X.getBoundingClientRect();if(Xe){const Ke=mt("typewriterCursor.root.getBoundingClientRect",()=>ce.getBoundingClientRect());$e=Xe.right-Ke.left+ce.scrollLeft,qe=Xe.top-Ke.top+ce.scrollTop,Fe=Xe.height||Fe,Re=!0}Ie.detach()}Re&&(Se.style.transform=`translate(${Math.max(0,$e)}px, ${Math.max(0,qe)}px)`,Se.style.height=`${Fe}px`,Se.style.visibility="visible")})()};ge?yc=ge(H):H()}return et([Ge,()=>o.content,()=>o.nodes,()=>S.typewriter,rt],()=>Vn(null,null,function*(){var w,H;if(!P||G.value||!se.value)return;if(rt.value)return Cs.value=!1,yh(),void Xu();if((w=o.nodes)!=null&&w.length)return Cs.value=!1,yh(),Xu(),mh=((H=o.content)!=null?H:"").length,void(gh=Ge.value.length);const X=(function(){var $e,qe;return($e=o.nodes)!=null&&$e.length?o.nodes.reduce((Fe,Re)=>Fe+vh(Re),0):((qe=o.content)!=null?qe:"").length})(),J=(function(){var $e;return($e=o.nodes)!=null&&$e.length?o.nodes.reduce((qe,Fe)=>qe+vh(Fe),0):Ge.value.length})(),ce=!Hx(dt.value[dt.value.length-1]),Se=X>mh,Ne=J>gh;if(!f.value||!ce||!Se&&!Ne)return f.value&&ce||(Cs.value=!1,Xu()),mh=X,void(gh=J);mh=X,gh=J,Cs.value=!0,d.value==="precise"&&ra.value&&(ra.value.style.visibility="hidden"),yh(),yield kt(),d.value==="simple"?kh():(sl(),bh()),Zu=setTimeout(()=>{Zu=void 0,Cs.value=!1},3e3)}),{flush:"post",immediate:!0}),et(Cs,w=>Vn(null,null,function*(){w?(yield kt(),d.value!=="simple"?(sl(),d.value==="precise"&&bh()):kh()):Xu()}),{flush:"post"}),et(d,()=>Vn(null,null,function*(){if(P&&!G.value&&se.value&&Cs.value){if(yield kt(),d.value==="simple")return ng(),void kh();sl(),d.value!=="precise"?Xu():bh()}}),{flush:"post"}),et([()=>te.value,()=>Uo.start,()=>Uo.end],()=>Vn(null,null,function*(){P&&!G.value&&se.value&&Cs.value&&(yield kt(),d.value!=="simple"?(sl(),d.value==="precise"&&bh()):kh())}),{flush:"post"}),so(()=>{yh(),ng(),sl(),dn.clear()}),(w,H)=>{const X=bI("NodeRenderer",!0);return C(G)?(x(!0),E(Pe,{key:0},lt(hh.value,J=>(x(),E(Pe,{key:J.vnodeKey},[J.rendersCustomNode?(x(),Ae(Ro(J.component),bn({key:0,ref_for:!0},J.customBindings,{node:J.node,loading:J.node.loading,"index-key":J.indexKey,"custom-id":S.customId,"is-dark":S.isDark,onClick:eg,onMouseover:Rx,onMouseout:Bx,onCopy:H[0]||(H[0]=ce=>i(ce)),onHandleArtifactClick:H[1]||(H[1]=ce=>s("handleArtifactClick",ce))}),{default:Le(()=>[J.hasSlotChildren?(x(),Ae(X,bn({key:0,ref_for:!0},Eo.value,{nodes:J.node.children,"index-key":J.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):J.slotContent?(x(),Ae(X,bn({key:1,ref_for:!0},Eo.value,{content:J.slotContent,final:!J.node.loading,"index-key":`${J.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ue("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(x(),Ae(Ro(J.component),bn({key:1,node:J.node,loading:J.node.loading,"index-key":J.indexKey},{ref_for:!0},J.bindings,{"custom-id":S.customId,"is-dark":S.isDark,onClick:eg,onMouseover:Rx,onMouseout:Bx,onCopy:H[2]||(H[2]=ce=>i(ce)),onHandleArtifactClick:H[3]||(H[3]=ce=>s("handleArtifactClick",ce))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(x(),E("div",{key:1,ref_key:"containerRef",ref:L,class:We(["markstream-vue markdown-renderer",[{dark:S.isDark},{virtualized:zt.value},{"virtual-scroll-coordinated":zs.value},{"stable-layout":iN.value},{"typewriter-simple-cursor":Cs.value&&d.value==="simple"}]]),"data-custom-id":S.customId,onClick:eg,onMouseover:WN,onMouseout:zN},[Us.value||zt.value?(x(),E(Pe,{key:0},[Us.value?(x(),Ae(tse,{key:0,width:di.value,"flow-root":zt.value||zs.value,"paragraph-node":To.value,"list-item-node":lo.value,"list-node":Wo.value,"heading-nodes":Ss.value,"set-paragraph-wrapper":rN,"set-list-item-wrapper":lN,"set-list-wrapper":aN,"set-heading-wrapper":dN},null,8,["width","flow-root","paragraph-node","list-item-node","list-node","heading-nodes"])):ue("",!0),zt.value?(x(),E("div",{key:1,class:"node-spacer",style:tn({height:`${x0.value}px`}),"aria-hidden":"true"},null,4)):ue("",!0)],64)):ue("",!0),UN.value?(x(!0),E(Pe,{key:1},lt(hh.value,J=>(x(),E(Pe,{key:J.vnodeKey},[uh(J.index)?(x(),Ae(Ro(J.component),bn({key:0,node:J.node,loading:J.node.loading,"index-key":J.indexKey},{ref_for:!0},J.bindings,{"custom-id":S.customId,"is-dark":S.isDark,onMouseover:H[4]||(H[4]=ce=>s("mouseover",ce)),onMouseout:H[5]||(H[5]=ce=>s("mouseout",ce)),onCopy:H[6]||(H[6]=ce=>i(ce)),onHandleArtifactClick:H[7]||(H[7]=ce=>s("handleArtifactClick",ce))}),null,16,["node","loading","index-key","custom-id","is-dark"])):ue("",!0)],64))),128)):(x(!0),E(Pe,{key:2},lt(hh.value,J=>(x(),E("div",{key:J.vnodeKey,ref_for:!0,ref:ce=>dh(J.index,ce),class:"node-slot","data-node-index":J.index,"data-node-type":J.node.type},[uh(J.index)?(x(),E("div",{key:0,ref_for:!0,ref:ce=>(function(Se,Ne){var $e;Ne||(function(Ue){const Ie=`${_0()}-${Ue}`;let Be=!1;for(const Xe of Array.from(Ys.keys())){const Ke=Qi.get(Xe);(Ke?.index===Ue||Xe===Ie||Xe.startsWith(`${Ie}-`))&&(Ys.delete(Xe),Qi.delete(Xe),Be=!0)}Be&&(ac(),qn("async-node"))})(Se),kr.delete(Se),(function(Ue){var Ie;const Be=((Ie=Ql.get(Ue))!=null?Ie:0)+1;Ql.set(Ue,Be)})(Se);const qe=tl.get(Se);if(qe){for(const Ue of qe)th(Ue);tl.delete(Se)}if((function(Ue){const Ie=Vt.get(Ue);Ie&&(to?.unobserve(Ie),Bn.delete(Ie),Vt.delete(Ue))})(Se),!Ne||!js.value)return Xi.delete(Se),void Ql.delete(Se);Xi.set(Se,Ne);const Fe=()=>{fh(Se,Ne)};queueMicrotask(Fe);const Re=(to||typeof ResizeObserver>"u"||(to=new ResizeObserver(Ue=>{if(Ue.length)for(const Ie of Ue){const Be=Bn.get(Ie.target),Xe=Vt.get(Be??-1);Be!=null&&Xe&&fh(Be,Xe)}else xr()})),to);if(Re&&(Vt.set(Se,Ne),Bn.set(Ne,Se),Re.observe(Ne)),typeof window<"u"){const Ue=(($e=dt.value[Se])==null?void 0:$e.type)==="code_block"?[16,80,240,800]:rt.value?[80]:[];if(Ue.length){const Ie=Ue.map(Be=>Kb(Be,Fe,"node-resize")).filter(Be=>Be!=null);Ie.length&&tl.set(Se,Ie)}}})(J.index,ce),class:"node-content"},[J.isCodeBlock?J.rendersCustomNode?(x(),Ae(Ro(J.component),bn({key:1,ref_for:!0},J.customBindings,{node:J.node,loading:J.node.loading,"index-key":J.indexKey,"custom-id":S.customId,"is-dark":S.isDark,onCopy:H[12]||(H[12]=ce=>i(ce)),onHandleArtifactClick:H[13]||(H[13]=ce=>s("handleArtifactClick",ce))}),{default:Le(()=>[J.hasSlotChildren?(x(),Ae(X,bn({key:0,ref_for:!0},Eo.value,{nodes:J.node.children,"index-key":J.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):J.slotContent?(x(),Ae(X,bn({key:1,ref_for:!0},Eo.value,{content:J.slotContent,final:!J.node.loading,"index-key":`${J.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ue("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(x(),Ae(Ro(J.component),bn({key:2,node:J.node,loading:J.node.loading,"index-key":J.indexKey},{ref_for:!0},J.bindings,{"custom-id":S.customId,"is-dark":S.isDark,onCopy:H[14]||(H[14]=ce=>i(ce)),onHandleArtifactClick:H[15]||(H[15]=ce=>s("handleArtifactClick",ce))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(x(),Ae(Ua,{key:0,name:"fade",css:S.fade!==!1,appear:S.fade!==!1},{default:Le(()=>[J.rendersCustomNode?(x(),Ae(Ro(J.component),bn({key:0,ref_for:!0},J.customBindings,{node:J.node,loading:J.node.loading,"index-key":J.indexKey,"custom-id":S.customId,"is-dark":S.isDark,onCopy:H[8]||(H[8]=ce=>i(ce)),onHandleArtifactClick:H[9]||(H[9]=ce=>s("handleArtifactClick",ce))}),{default:Le(()=>[J.hasSlotChildren?(x(),Ae(X,bn({key:0,ref_for:!0},Eo.value,{nodes:J.node.children,"index-key":J.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):J.slotContent?(x(),Ae(X,bn({key:1,ref_for:!0},Eo.value,{content:J.slotContent,final:!J.node.loading,"index-key":`${J.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ue("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(x(),Ae(Ro(J.component),bn({key:1,node:J.node,loading:J.node.loading,"index-key":J.indexKey},{ref_for:!0},J.bindings,{"custom-id":S.customId,"is-dark":S.isDark,onCopy:H[10]||(H[10]=ce=>i(ce)),onHandleArtifactClick:H[11]||(H[11]=ce=>s("handleArtifactClick",ce))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(x(),E("div",{key:1,class:"node-placeholder",style:tn({height:`${c0(J.index)}px`})},null,4))],8,sse))),128)),Cs.value&&d.value==="precise"?(x(),E("span",{key:3,ref_key:"typewriterCursorRef",ref:ra,class:"typewriter-cursor","aria-hidden":"true"},null,512)):ue("",!0),zt.value?(x(),E("div",{key:4,class:"node-spacer",style:tn({height:`${w0.value}px`}),"aria-hidden":"true"},null,4)):ue("",!0)],42,ose))}}})),[["__scopeId","data-v-a9489508"]]),Ps=vE;Ps.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",Ps.__name,Ps.name].filter(n=>!!n));for(const n of t)e.component(n,vE)};const V2=Object.freeze(Object.defineProperty({__proto__:null,default:Ps},Symbol.toStringTag,{value:"Module"})),ise={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"},rse={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"},lse={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"},ase={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"},cse={class:"admonition-title"},use=["aria-expanded","aria-controls"],dse=["id"],Bp=_n(Qe({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:t}){var n;const o=e,s=t,i=D(()=>{if(o.node.title&&o.node.title.trim().length)return o.node.title;const c=o.node.kind||"note";return c.charAt(0).toUpperCase()+c.slice(1)}),r=ne(!!o.node.collapsible&&!((n=o.node.open)==null||n));function l(){o.node.collapsible&&(r.value=!r.value)}const a=`admonition-${Math.random().toString(36).slice(2,9)}`;return(c,u)=>(x(),E("div",{class:We(["admonition",[`admonition-${o.node.kind}`]])},[_("div",{id:a,class:"admonition-legend"},[o.node.kind==="note"||o.node.kind==="info"?(x(),E("svg",ise,[...u[1]||(u[1]=[_("circle",{cx:"12",cy:"12",r:"10"},null,-1),_("path",{d:"M12 16v-4"},null,-1),_("path",{d:"M12 8h.01"},null,-1)])])):o.node.kind==="tip"?(x(),E("svg",rse,[...u[2]||(u[2]=[_("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),_("path",{d:"M9 18h6"},null,-1),_("path",{d:"M10 22h4"},null,-1)])])):o.node.kind==="warning"||o.node.kind==="caution"?(x(),E("svg",lse,[...u[3]||(u[3]=[_("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),_("path",{d:"M12 9v4"},null,-1),_("path",{d:"M12 17h.01"},null,-1)])])):o.node.kind==="danger"||o.node.kind==="error"?(x(),E("svg",ase,[...u[4]||(u[4]=[_("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),_("path",{d:"M12 8v4"},null,-1),_("path",{d:"M12 16h.01"},null,-1)])])):ue("",!0),_("span",cse,R(i.value),1),o.node.collapsible?(x(),E("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(x(),E("svg",{style:tn({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]=[_("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,use)):ue("",!0)]),Wn(_("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[fe(C(Ps),{"index-key":`admonition-${e.indexKey}`,nodes:o.node.children,"custom-id":o.customId,typewriter:o.typewriter,fade:o.fade,onCopy:u[0]||(u[0]=d=>s("copy",d))},null,8,["index-key","nodes","custom-id","typewriter","fade"])],8,dse),[[wi,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);Bp.install=e=>{e.component(Bp.__name,Bp)};const Xy=()=>ps(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let tp=null,np=Xy,op=null,K4=!1,G4=!1;function q4e(){return Vn(this,null,function*(){if(tp)return tp;const e=np;return e?e===Xy&&K4?null:op||(op=Vn(null,null,function*(){let t;try{t=yield e()}catch(n){if(e===Xy)return e===np&&(K4=!0,(function(o){G4||(G4=!0,console.warn('[markstream-vue] Optional dependency "@terrastruct/d2" is not installed. D2 blocks will render as source.',o))})(n)),null;throw n}finally{e===np&&(op=null)}return e!==np?null:t?(tp=(function(n){var o;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 s=(o=n.default)!=null?o:n;return typeof s=="function"?s:s?.D2&&typeof s.D2=="function"?s.D2:s})(t),tp):null}),op):null})}let sp=null,yE=null,ip=null;function j4e(){return typeof yE=="function"}function V4e(){return Vn(this,null,function*(){if(sp)return sp;const e=yE;return e?ip||(ip=Vn(null,null,function*(){const t=yield e(),n=(function(o){var s,i,r;if(!o)return null;const l=(s=o.default)!=null?s:o,a=typeof l=="function"&&typeof((i=l.prototype)==null?void 0:i.render)=="function"?l:(r=o.Infographic)!=null?r:l?.Infographic;return typeof a=="function"?a:null})(t);return n?(sp=n,sp):null}).finally(()=>{ip=null}),ip):null})}const K4e=Symbol("markstreamLanguageIconResolver"),rp=ne(!1);let Y4=!1;function pv(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function fse(){return!Y4&&typeof window<"u"&&typeof document<"u"&&(Y4=!0,rp.value=pv(),new MutationObserver(()=>{rp.value=pv()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{rp.value=pv()})),rp}const kE=["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"],hse=new Set(["AGENTS.md","CHANGELOG.md","Dockerfile","LICENSE","Makefile","README.md","package.json","pnpm-lock.yaml","pnpm-workspace.yaml","tsconfig.json","vite.config.ts"]),Qy=[...kE].sort((e,t)=>t.length-e.length).join("|"),mv=new RegExp([String.raw`(?:^|[\s([{"'`+"`"+String.raw`])`,String.raw`(`,String.raw`(?:~|\.{1,2}|/)?(?:[A-Za-z0-9_.@+()[\]-]+/)+[A-Za-z0-9_.@+()[\]-]+(?:\.(?:${Qy}))?`,String.raw`|`,String.raw`[A-Za-z0-9_.@+()[\]-]+\.(?:${Qy})`,String.raw`)`,String.raw`(?:#L?(\d+)|:(\d+))?`,String.raw`(?=$|[\s)"'\]}>.,;!?,。;!?)])`].join(""),"gi"),bE=/[),.;!?,。;!?)]+$/;function pse(e){const t=e.toLowerCase();return kE.some(n=>t.endsWith(`.${n}`))}function mse(e){const t=new Map,n=new RegExp(String.raw`\b(?:path|src)=["'](\/[^"']+\.(?:${Qy}))["']`,"gi");let o;for(;(o=n.exec(e))!==null;){const s=o[1];if(!s)continue;const i=s.split("/").pop();i&&t.set(i,s)}return t}function gse(e,t={}){const n=e.trim();if(!n||/^[a-z][a-z0-9+.-]*:\/\//i.test(n))return null;const o=n.match(/^(.*?)(?:#L?(\d+)|:(\d+))?$/i);if(!o)return null;let s=(o[1]??"").replace(bE,"");if(!s)return null;const i=s.split("/").pop()??s,r=s.includes("/"),l=hse.has(i),a=pse(i);if(r&&!l&&!a)return null;if(!r&&!l){const d=t.aliases?.get(i);if(!d)return null;s=d}const c=o[2]??o[3],u=c?Number(c):void 0;return{path:s,line:u!==void 0&&Number.isFinite(u)&&u>0?u:void 0}}function vse(e,t={}){const n=[];mv.lastIndex=0;let o;for(;(o=mv.exec(e))!==null;){const s=o[0]??"",i=o[1]??"",r=s.indexOf(i);if(r<0)continue;const l=o[2]??o[3];let a=i+(l?s.slice(r+i.length):"");const c=a.replace(bE,""),u=a.length-c.length;a=c;const d=gse(a,t);if(!d)continue;const f=o.index+r,h=f+a.length;n.push({...d,start:f,end:h,text:a}),u>0&&(mv.lastIndex-=u)}return n}const yse=12e4,kse=6e4,bse=32,xse=3e4,Z4=/(^|\n)(`{3,}|~{3,})[^\n]*\n([\s\S]*?)(?:\n)?\2(?=\n|$)/g;function wse(e){let t=0,n=0,o=0;Z4.lastIndex=0;let s;for(;(s=Z4.exec(e))!==null;){const r=s[3]??"";t+=1,n+=r.length,o=Math.max(o,r.length)}return{codeRenderer:e.length>=yse||n>=kse||t>=bse||o>=xse?"pre":"shiki",codeFenceCount:t,codeChars:n}}function _se(e){return new Worker("/assets/katexRenderer.worker-CO_gEm4q.js",{type:"module",name:e?.name})}function Sse(e){return new Worker("/assets/mermaidParser.worker-Dx4jPi9z.js",{type:"module",name:e?.name})}const Cse={key:1,class:"diff-wrap"},Ase={class:"diff-bar"},Mse=["aria-label","onClick"],Ese={class:"diff-pre"},Tse={key:0,class:"diff-sign"},Nse={class:"diff-text"},Ise="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",X4="github-light",Q4="github-dark",Lse=Qe({__name:"Markdown",props:{text:{},openFile:{},streaming:{type:Boolean,default:!1}},setup(e){Hee(),Jee(),zee(),nte(),Wee(new _se),tte(new Sse);function t(W){return W.inline.ruler.disable("math"),W}const{t:n}=Ot(),o=Jt("resolveImage"),s=ne(null),i=e,r=D(()=>!i.streaming),l=D(()=>mse(i.text??"")),a=D(()=>i.streaming?{codeRenderer:"shiki",codeFenceCount:0,codeChars:0}:wse(i.text??"")),c=fse(),u=D(()=>!i.streaming),d=Do(new Map),f=new Set,h=/(!\[[^\]]*\]\()\s*([^)\s]+)([^)]*\))/g,p=/(<img\b[^>]*?\bsrc=")([^"]+)(")/gi;function m(W){return!/^(https?:|data:|blob:)/i.test(W)}function y(W){if(!o)return;const z=[];for(const L of[h,p]){L.lastIndex=0;let O;for(;(O=L.exec(W))!==null;)z.push(O[2]??"")}for(const L of z)!L||!m(L)||d.has(L)||f.has(L)||(f.add(L),o(L).then(O=>{d.set(L,O!==L?O:"")}).catch(()=>{d.set(L,"")}).finally(()=>{f.delete(L)}))}function k(W){if(!o)return W;const z=L=>{if(!m(L))return null;const O=d.get(L);return O===void 0?Ise:O===""?null:O};return W.replace(h,(L,O,j,Z)=>{const ie=z(j);return ie===null?L:`${O}${ie}${Z}`}).replace(p,(L,O,j,Z)=>{const ie=z(j);return ie===null?L:`${O}${ie}${Z}`})}et(()=>i.text,W=>y(W??""),{immediate:!0});function g(){if(!s.value||!i.openFile||i.streaming)return;const W=document.createTreeWalker(s.value,NodeFilter.SHOW_TEXT),z=[];let L=W.nextNode();for(;L;){const O=L,j=O.parentElement;j&&!j.closest("a, pre, .md-file-link, svg")&&O.data.trim().length>0&&z.push(O),L=W.nextNode()}for(const O of z){const j=vse(O.data,{aliases:l.value});if(j.length===0||!O.parentNode)continue;const Z=document.createDocumentFragment();let ie=0;for(const U of j){U.start>ie&&Z.append(document.createTextNode(O.data.slice(ie,U.start)));const q=document.createElement("button");q.type="button",q.className="md-file-link",q.textContent=U.text,q.title=U.line?`${U.path}:${U.line}`:U.path,q.addEventListener("click",ee=>{ee.preventDefault(),ee.stopPropagation(),i.openFile?.({path:U.path,line:U.line})}),Z.append(q),ie=U.end}ie<O.data.length&&Z.append(document.createTextNode(O.data.slice(ie))),O.parentNode.replaceChild(Z,O)}}function v(W){return!(!W||/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(W))}function b(W){let z=W.length;for(const L of["#","?"]){const O=W.indexOf(L);O!==-1&&O<z&&(z=O)}return W.slice(0,z)}function A(){if(!s.value||!i.openFile||i.streaming)return;const W=s.value.querySelectorAll("a[href]");for(const z of W){if(z.dataset.mdLinkHandled==="true"||z.closest("svg"))continue;const L=z.getAttribute("href")??"";v(L)&&(z.dataset.mdLinkHandled="true",z.addEventListener("click",O=>{O.preventDefault(),O.stopPropagation(),i.openFile?.({path:b(L)})}))}}function I(){kt().then(()=>{g(),A()})}et(()=>i.text,I),et(()=>i.streaming,I);let T=null;wn(()=>{I(),s.value&&(T=new MutationObserver(I),T.observe(s.value,{childList:!0,subtree:!0}))}),In(()=>{T?.disconnect()});const M={showHeader:!0,showCopyButton:!0,showExpandButton:!1,showPreviewButton:!1,showCollapseButton:!1,showFontSizeButtons:!1,loading:!1},$=/(^|\n)(?:```|~~~)diff\b[^\n]*\n([\s\S]*?)(?:\n)?(?:```|~~~)(?=\n|$)/g,N=D(()=>{const W=k(i.text??""),z=[];let L=0;$.lastIndex=0;let O;for(;(O=$.exec(W))!==null;){const Z=O[1]??"",ie=W.slice(L,O.index)+(Z||"");ie.trim()&&z.push({kind:"md",text:ie}),z.push({kind:"diff",code:O[2]??""}),L=$.lastIndex}const j=W.slice(L);return(j.trim()||z.length===0)&&z.push({kind:"md",text:j}),z});function F(W){return W.split(`
|
|
293
|
-
`).map(z=>z.startsWith("@@")?{type:"hunk",sign:"",text:z}:/^\+(?!\+\+)/.test(z)?{type:"add",sign:"+",text:z.slice(1)}:/^-(?!--)/.test(z)?{type:"del",sign:"-",text:z.slice(1)}:z.startsWith(" ")?{type:"ctx",sign:"",text:z.slice(1)}:{type:"ctx",sign:"",text:z})}const S=ne(null);function B(W,z){Xo(W).then(L=>{L&&(S.value=z,setTimeout(()=>{S.value=null},1400))})}return(W,z)=>(x(),E("div",{ref_key:"mdRef",ref:s,class:"md"},[(x(!0),E(Pe,null,lt(N.value,(L,O)=>(x(),E(Pe,{key:O},[L.kind==="md"?(x(),Ae(C(Ps),{key:0,content:L.text,"custom-markdown-it":t,mode:"chat","code-renderer":a.value.codeRenderer,"is-dark":C(c),"code-block-light-theme":X4,"code-block-dark-theme":Q4,themes:[X4,Q4],"code-block-props":M,final:r.value,"smooth-streaming":e.streaming,"batch-rendering":u.value,"defer-nodes-until-visible":!1,onCopy:C(Y$)},null,8,["content","code-renderer","is-dark","themes","final","smooth-streaming","batch-rendering","onCopy"])):(x(),E("div",Cse,[_("div",Ase,[z[0]||(z[0]=_("span",{class:"diff-lang"},"diff",-1)),fe(rn,{text:C(n)("filePreview.copyCode")},{default:Le(()=>[_("button",{class:"diff-copy","aria-label":C(n)("filePreview.copyCode"),onClick:j=>B(L.code,O)},[fe(Ye,{name:S.value===O?"check":"copy",size:"sm"},null,8,["name"])],8,Mse)]),_:2},1032,["text"])]),_("pre",Ese,[_("code",null,[(x(!0),E(Pe,null,lt(F(L.code),(j,Z)=>(x(),E("span",{key:Z,class:We(["diff-line",`diff-${j.type}`])},[j.type!=="hunk"?(x(),E("span",Tse,R(j.sign),1)):ue("",!0),_("span",Nse,R(j.text),1)],2))),128))])])]))],64))),128))],512))}}),G1=ft(Lse,[["__scopeId","data-v-f76b9522"]]),$se={class:"tc-anim"},Fse={class:"prev-anim"},Ose={class:"prev"},Rse=Qe({__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,o=t,s=D(()=>n.text.split(/\n{2,}/).filter(c=>c.trim().length>0)),i=D(()=>n.foldable&&s.value.length>1),r=D(()=>n.streaming||!i.value),l=D(()=>s.value.at(-1)??""),a=ne(null);return wn(()=>{if(!n.streaming)return;const c=a.value;c&&(c.scrollTop=c.scrollHeight)}),et(()=>n.text,()=>{const c=a.value;!c||!(c.scrollHeight-c.scrollTop-c.clientHeight<24)||kt(()=>{a.value&&(a.value.scrollTop=a.value.scrollHeight)})},{immediate:!0}),(c,u)=>(x(),E("div",{class:We(["think",{mob:e.mobile}])},[i.value?(x(),E("div",{key:0,class:We(["tc-wrap",{"is-collapsed":!r.value}]),onClick:u[0]||(u[0]=d=>o("open"))},[_("div",$se,[_("pre",{ref_key:"bodyEl",ref:a,class:"tc"},R(e.text),513)]),_("div",Fse,[_("span",Ose,R(l.value),1)])],2)):(x(),E("pre",{key:1,ref_key:"bodyEl",ref:a,class:"tc"},R(e.text),513))],2))}}),Bse=ft(Rse,[["__scopeId","data-v-334a29b0"]]),Dse={class:"activity-notice",role:"status"},Pse={"aria-hidden":"true"},Hse={class:"an-label"},Wse=Qe({__name:"ActivityNotice",props:{label:{}},setup(e){return(t,n)=>(x(),E("div",Dse,[_("span",Pse,[fe(Hs,{size:"sm"})]),_("span",Hse,R(e.label),1)]))}}),zse=ft(Wse,[["__scopeId","data-v-8f0cdbe4"]]);function Use(e,t="昨天"){try{const n=new Date(e);if(Number.isNaN(n.getTime()))return e;const o=new Date,s=u=>String(u).padStart(2,"0"),i=`${s(n.getHours())}:${s(n.getMinutes())}`,r=n.getFullYear()===o.getFullYear(),l=n.getMonth()===o.getMonth(),a=n.getDate()===o.getDate();if(r&&l&&a)return i;const c=new Date(o);return c.setDate(o.getDate()-1),n.getFullYear()===c.getFullYear()&&n.getMonth()===c.getMonth()&&n.getDate()===c.getDate()?`${t} ${i}`:r?`${s(n.getMonth()+1)}-${s(n.getDate())} ${i}`:`${n.getFullYear()}-${s(n.getMonth()+1)}-${s(n.getDate())} ${i}`}catch{return e}}const qse=Qe({__name:"MessageTime",props:{time:{}},setup(e){const t=e,{t:n}=Ot(),o=ne(!1),s=D(()=>{const l=new Date(t.time);if(Number.isNaN(l.getTime()))return t.time;const a=c=>String(c).padStart(2,"0");return`${l.getFullYear()}-${a(l.getMonth()+1)}-${a(l.getDate())} ${a(l.getHours())}:${a(l.getMinutes())}`}),i=D(()=>o.value?s.value:Use(t.time,n("conversation.yesterday")));function r(){o.value=!o.value}return(l,a)=>(x(),E("button",{type:"button",class:"msg-time",onClick:Ct(r,["stop"])},R(i.value),1))}}),xE=ft(qse,[["__scopeId","data-v-7db81849"]]);function jse(e){return e.length===1?`0${e}`:e}function Vse(e,t){return`${String(Number(e))}:${jse(t)}`}const J4=e=>/^\d+$/.test(e);function Kse(e,t){const n=e.trim().split(/\s+/);if(n.length!==5)return e;const[o,s,i,r,l]=n,a=i==="*"&&r==="*"&&l==="*",c=i==="*"&&r==="*";if(o==="*"&&s==="*"&&a)return t("conversation.cron.everyMinute");const u=/^\*\/(\d+)$/.exec(o);if(u&&s==="*"&&a)return u[1]==="1"?t("conversation.cron.everyMinute"):t("conversation.cron.everyNMinutes",{n:u[1]});if(o==="0"&&s==="*"&&a)return t("conversation.cron.everyHour");const d=/^\*\/(\d+)$/.exec(s);if(o==="0"&&d&&a)return t("conversation.cron.everyNHours",{n:d[1]});if(J4(o)&&J4(s)&&c){const f=Vse(s,o);if(l==="1-5")return t("conversation.cron.weekdaysAt",{time:f});if(l==="*")return t("conversation.cron.dailyAt",{time:f})}return e}const Gse=["data-turn-id"],Yse={class:"cn-bubble"},Zse={class:"cn-title"},Xse={key:0,class:"cn-prompt"},Qse={class:"cn-meta"},Jse={key:0,class:"cn-meta-item"},eie={key:1,class:"cn-meta-item"},tie=["aria-label"],nie=["title"],oie=Qe({__name:"CronNotice",props:{text:{},cron:{},turnId:{},createdAt:{}},setup(e){const t=e,{t:n}=Ot(),o=D(()=>t.cron),s=D(()=>o.value?.missedCount!==void 0),i=D(()=>s.value?n("conversation.cron.missed"):n("conversation.cron.fired")),r=D(()=>{const u=o.value?.cron;return u?Kse(u,n):""}),l=D(()=>s.value?"error":"ok"),a=D(()=>{const u=o.value;if(!u)return"";const d=[];return u.recurring===!1&&d.push(n("conversation.cron.oneShot")),typeof u.coalescedCount=="number"&&u.coalescedCount>1&&d.push(n("conversation.cron.coalesced",{n:u.coalescedCount})),u.missedCount!==void 0&&d.push(n("conversation.cron.missedCount",{n:u.missedCount})),u.stale===!0&&d.push(n("conversation.cron.finalDelivery")),d.join(" · ")}),c=D(()=>t.text??"");return(u,d)=>(x(),E("div",{class:We(["cn cron-notice",{"turn-anchor":!!e.turnId}]),"data-turn-id":e.turnId,role:"status"},[_("div",Yse,[_("span",Zse,R(i.value),1),c.value?(x(),E("span",Xse,R(c.value),1)):ue("",!0)]),_("div",Qse,[fe(Ye,{name:"clock",size:"sm",class:"cn-meta-ico","aria-hidden":"true"}),r.value?(x(),E("span",Jse,R(r.value),1)):ue("",!0),a.value?(x(),E("span",eie,R(a.value),1)):ue("",!0),_("span",{class:We(["cn-status",l.value]),"aria-label":l.value},[l.value==="ok"?(x(),Ae(Ye,{key:0,name:"check",size:"sm"})):(x(),Ae(Ye,{key:1,name:"close",size:"sm"}))],10,tie),o.value?.jobId?(x(),E("span",{key:2,class:"cn-meta-item cn-id",title:C(n)("conversation.cron.job",{id:o.value.jobId})},R(o.value.jobId),9,nie)):ue("",!0),e.createdAt?(x(),Ae(xE,{key:3,time:e.createdAt},null,8,["time"])):ue("",!0)])],10,Gse))}}),sie=ft(oie,[["__scopeId","data-v-5de7e25d"]]),e3=Ht.clientId,iie="dimi-web",rie="web";function lie(){return{serverHttpUrl:cie(),clientId:hie(),clientName:iie,clientVersion:pie(),clientUiMode:rie}}function aie(){return typeof window<"u"&&window.location?.origin?window.location.origin:"http://127.0.0.1:58627"}function cie(e){const t=aie(),n=new URL(t);return n.pathname=n.pathname.replace(/\/v1\/?$/,"").replace(/\/$/,""),n.search="",n.hash="",n.toString().replace(/\/$/,"")}function uie(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}function die(){const e=typeof window<"u"&&window.location?.origin?window.location.origin:"";return uie(e)}function Gc(e,t){return`${e}/api/v1${t.startsWith("/")?t:`/${t}`}`}function fie(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 hie(){const e=uo(e3);if(e)return e;const t=`web_${globalThis.crypto?.randomUUID?.()||Math.random().toString(36).slice(2)}`;return xo(e3,t),t}function pie(){return"0.1.0".trim()?"0.1.0":"0.0.0-dev"}const mie=["app:load:start","app:load:complete","export:start","export:accepted","export:failed","prompt:start","prompt:accepted","prompt:failed","session:snapshot:start","session:snapshot:accepted","session:snapshot:failed","operation:failed","window:error","window:unhandled-rejection","ws:connection","ws:error","ws:resync","ws:stale-reconnect"],wE=500,Hm=256*1024,t3=200,gv=16384,vv=500,yv=50,kv=50,gie=6,vie=/api[_-]?key|authorization|token|secret|password|cookie|credential/i,yie=/^[A-Za-z0-9+/=_-]{200,}$/;let bv=null;function Yi(){if(bv!==null)return bv;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=uo(Ht.debug)==="1"),bv=e,e}const Ol=[],Yc=[];let Cd=0;const Sa=[];let Ad=0,kie=1;const Wm=new TextEncoder,bie=new Set(mie),K2=ne(0),Md=gr(!1);function xie(){return Ol}function wie(){Ol.length=0,Yc.length=0,Cd=0,Sa.length=0,Ad=0,K2.value++}function Jr(e){if(!Md.value){try{const t={id:kie++,ts:Date.now(),source:e.source,kind:String(fu(e.kind)),label:String(fu(e.label)),sessionId:e.sessionId===void 0?void 0:String(fu(e.sessionId)),method:e.method,path:e.path,eventType:e.eventType,seq:e.seq,offset:e.offset,status:e.status,code:e.code,requestId:e.requestId,durationMs:e.durationMs,detail:Yl(e.detail)},n=JSON.stringify(t),o=Wm.encode(n).byteLength;if(o>Hm)return;for(Ol.push(t),Yc.push(n),Cd+=o+(Yc.length>1?1:0);Ol.length>wE||Cd>Hm;){const s=Yc.shift();Ol.shift(),s!==void 0&&(Cd-=Wm.encode(s).byteLength,Yc.length>0&&(Cd-=1))}}catch{return}K2.value++}}function ga(e){if(typeof e=="string")return e.length<=t3?e:e.slice(0,t3)}function gi(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function _ie(e,t){if(bie.has(e))try{const n={ts:Date.now(),event:e,sessionId:ga(t?.sessionId),status:ga(t?.status),operation:ga(t?.operation),seq:gi(t?.seq),durationMs:gi(t?.durationMs),messageCount:gi(t?.messageCount),contentCount:gi(t?.contentCount),mediaCount:gi(t?.mediaCount),sessionCount:gi(t?.sessionCount),workspaceCount:gi(t?.workspaceCount),promptId:ga(t?.promptId),zipBytes:gi(t?.zipBytes),errorName:ga(t?.errorName),errorCode:gi(t?.errorCode),requestId:ga(t?.requestId),phase:ga(t?.phase),httpStatus:gi(t?.httpStatus),fatal:typeof t?.fatal=="boolean"?t.fatal:void 0,line:gi(t?.line),col:gi(t?.col)},o=JSON.stringify(n),s=Wm.encode(o).byteLength;if(s>Hm)return;for(Sa.push(o),Ad+=s+(Sa.length>1?1:0);Sa.length>wE||Ad>Hm;){const i=Sa.shift();i!==void 0&&(Ad-=Wm.encode(i).byteLength,Sa.length>0&&(Ad-=1))}}catch{return}}function fu(e,t=0){if(e==null)return e;const n=typeof e;if(n==="number"||n==="boolean")return e;if(n==="string"){const i=e;return yie.test(i)?`[base64-like, ${i.length} chars omitted]`:i.length>vv?`${i.slice(0,vv)}… [+${i.length-vv} chars]`:i}if(n!=="object")return String(e);if(t>=gie)return"[max depth]";if(Array.isArray(e)){const i=e.slice(0,yv).map(r=>fu(r,t+1));return e.length>yv&&i.push(`[+${e.length-yv} more items]`),i}const o={},s=Object.entries(e);for(const[i,r]of s.slice(0,kv))o[i]=vie.test(i)?"[redacted]":fu(r,t+1);return s.length>kv&&(o._truncatedKeys=s.length-kv),o}function Yl(e){if(e===void 0)return;const t=fu(e);try{const n=JSON.stringify(t);if(n!==void 0&&n.length>gv)return{_truncated:`detail JSON was ${n.length} chars; first ${gv} kept`,preview:n.slice(0,gv)}}catch{return"[unserializable detail]"}return t}function lp(e){Yi()&&Jr({source:"rest",kind:"rest:request",label:`→ ${e.method} ${e.path}`,method:e.method,path:e.path,requestId:e.requestId,detail:{url:e.url,body:Yl(e.body)}})}function Ec(e){if(!Yi())return;const t=e.code!==0;Jr({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:Yl(e.data)}})}function pl(e){Yi()&&Jr({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 Tc(e,t){Yi()&&Jr({source:"ws",kind:"ws:lifecycle",eventType:e,label:`ws ${e}`,detail:Yl(t)})}function Sie(e){if(!Yi())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",o=t.payload,s=typeof o?.session_id=="string"?o.session_id:void 0;Jr({source:"ws",kind:"ws:out",eventType:n,sessionId:s,label:`→ ${n}`,detail:Yl(e)})}function Cie(e){if(!Yi())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",o=typeof t.session_id=="string"?t.session_id:typeof t.payload?.session_id=="string"?t.payload.session_id:void 0,s=typeof t.seq=="number"?t.seq:void 0,i=typeof t.offset=="number"?t.offset:void 0,r=[o,s!==void 0?`seq=${s}`:void 0,i!==void 0?`offset=${i}`:void 0,t.volatile===!0?"volatile":void 0].filter(Boolean);Jr({source:"ws",kind:"ws:in",eventType:n,sessionId:o,seq:s,offset:i,label:`← ${n}${r.length>0?` (${r.join(" ")})`:""}`,detail:Yl(t.payload)})}const Aie={error:"✕",warn:"⚠",info:"ℹ",debug:"·",log:"·"};function Mie(e,t,n){Yi()&&Jr({source:"client",kind:`client:${e}`,label:`${Aie[e]} ${t}`,detail:Yl(n)})}function Br(e,t){Yi()&&Jr({source:"client",kind:"client:event",label:`· ${e}`,detail:Yl(t)})}function mo(e,t){_ie(e,t),Jr({source:"client",kind:"client:key",label:e,sessionId:typeof t?.sessionId=="string"?t.sessionId:void 0,seq:typeof t?.seq=="number"?t.seq:void 0,durationMs:typeof t?.durationMs=="number"?t.durationMs:void 0,detail:t})}let xv=!1,ap=null;function Eie(){if(xv)return()=>ap?.();xv=!0;const e=[];try{if(typeof window<"u"){const n=s=>{mo("window:error",{status:"failed",errorName:s.error instanceof Error?s.error.name:"Error",line:s.lineno,col:s.colno})},o=s=>{const i=s.reason;mo("window:unhandled-rejection",{status:"failed",errorName:i instanceof Error?i.name:typeof i})};window.addEventListener("error",n),window.addEventListener("unhandledrejection",o),e.push(()=>{window.removeEventListener("error",n)}),e.push(()=>{window.removeEventListener("unhandledrejection",o)})}}catch{}if(Yi())for(const n of["error","warn","log","info","debug"]){const o=console[n];if(typeof o!="function")continue;const s=(...i)=>{try{Mie(n,i.map(Tie).join(" "),i.length>1?i:i[0])}catch{}o.apply(console,i)};console[n]=s,e.push(()=>{console[n]===s&&(console[n]=o)})}const t=()=>{if(ap===t){for(const n of e.toReversed())n();ap=null,xv=!1}};return ap=t,t}function Tie(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 _E(e=Ol){if(typeof document>"u")return;const t=new Blob([Nie(e)],{type:"application/x-ndjson"}),n=URL.createObjectURL(t);let o;try{o=document.createElement("a"),o.href=n,o.download=`dimi-web-log-${new Date().toISOString().replaceAll(/[:.]/g,"-")}.jsonl`,document.body.append(o),o.click()}finally{o?.remove(),setTimeout(()=>{try{URL.revokeObjectURL(n)}catch{}},0)}}function Nie(e=Ol){return e===Ol?Yc.join(`
|
|
294
|
-
`):e.map(t=>JSON.stringify(t)).join(`
|
|
295
|
-
`)}function Iie(){return Sa.join(`
|
|
296
|
-
`)}function SE(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 Jy(e){return e.contextTokens===0&&e.contextLimit===0&&e.inputTokens===0&&e.outputTokens===0&&e.turnCount===0}function Ri(e){return{id:e.id,title:e.title,createdAt:e.created_at,updatedAt:e.updated_at,busy:e.busy,mainTurnActive:e.main_turn_active,pendingInteraction:e.pending_interaction,lastTurnReason:e.last_turn_reason,archived:e.archived??!1,currentPromptId:e.current_prompt_id,lastPrompt:e.last_prompt,cwd:e.metadata.cwd,model:e.agent_config.model,usage:SE(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 Zd(e){return{id:e.id,root:e.root,name:e.name,lastOpenedAt:e.last_opened_at,sessionCount:e.session_count}}function n3(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,id:e.id}}function G2(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:n3(e.source)};case"video":return{type:"video",source:n3(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 ek(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map(G2),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function Lie(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,id:t.id},{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 $ie(e){return{content:e.content.map(Lie),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 Fie(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function CE(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 Oie(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function Rie(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map(Oie),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function AE(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(Rie),createdAt:e.created_at}}function Bie(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 Die(e){const t={};for(const[n,o]of Object.entries(e.answers))t[n]=Bie(o);return{answers:t,method:e.method,note:e.note}}function Dp(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,runInBackground:e.run_in_background??(e.kind==="subagent"?!0:void 0)}}function o3(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 ml(e,t){const n=e[t];return typeof n=="string"?n:void 0}function Nc(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function vi(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function ME(e){if(!e||typeof e!="object")return null;const t=e,n=ml(t,"status");if(n!=="active"&&n!=="paused"&&n!=="blocked"&&n!=="complete")return null;const o=t.budget,s=o&&typeof o=="object"?o:{};return{goalId:ml(t,"goalId")??ml(t,"goal_id")??"goal",objective:ml(t,"objective")??"",completionCriterion:ml(t,"completionCriterion")??ml(t,"completion_criterion"),status:n,turnsUsed:Nc(t,"turnsUsed")??Nc(t,"turns_used")??0,tokensUsed:Nc(t,"tokensUsed")??Nc(t,"tokens_used")??0,wallClockMs:Nc(t,"wallClockMs")??Nc(t,"wall_clock_ms")??0,terminalReason:ml(t,"terminalReason")??ml(t,"terminal_reason"),budget:{tokenBudget:vi(s,"tokenBudget")??vi(s,"token_budget"),remainingTokens:vi(s,"remainingTokens")??vi(s,"remaining_tokens"),turnBudget:vi(s,"turnBudget")??vi(s,"turn_budget"),remainingTurns:vi(s,"remainingTurns")??vi(s,"remaining_turns"),wallClockBudgetMs:vi(s,"wallClockBudgetMs")??vi(s,"wall_clock_budget_ms"),remainingWallClockMs:vi(s,"remainingWallClockMs")??vi(s,"remaining_wall_clock_ms"),overBudget:s.overBudget===!0||s.over_budget===!0}}}function Pie(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:Ri(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:Ri(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:Zd(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:Zd(t.payload.workspace)};case"event.workspace.deleted":return{type:"workspaceDeleted",workspaceId:t.payload.workspace_id,root:t.payload.root};case"event.session.work_changed":return{type:"sessionWorkChanged",sessionId:t.session_id,busy:t.payload.busy,mainTurnActive:t.payload.main_turn_active,pendingInteraction:t.payload.pending_interaction,lastTurnReason:t.payload.last_turn_reason};case"event.session.status_changed":return{type:"sessionWorkChanged",sessionId:t.session_id,busy:t.payload.status!=="idle"&&t.payload.status!=="aborted",mainTurnActive:t.payload.status!=="idle"&&t.payload.status!=="aborted",pendingInteraction:t.payload.status==="awaiting_approval"?"approval":t.payload.status==="awaiting_question"?"question":"none",lastTurnReason:t.payload.status==="aborted"?"cancelled":void 0};case"event.session.usage_updated":return{type:"sessionUsageUpdated",sessionId:t.session_id,usage:SE(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=ME(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:ek(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map(G2),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:CE(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:AE(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.task.created":return{type:"taskCreated",sessionId:t.session_id,task:Dp(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:tk(t.payload.config)};case"event.model_catalog.changed":return{type:"modelCatalogChanged",changed:t.payload.changed.map(n=>({providerId:n.provider_id,providerName:n.provider_name,added:n.added,removed:n.removed})),unchanged:t.payload.unchanged,failed:t.payload.failed};default:return{type:"unknown",raw:e}}}function Hie(e){return{id:e.model,provider:e.provider,model:e.model,displayName:e.display_name,maxContextSize:e.max_context_size,capabilities:e.capabilities,supportEfforts:e.support_efforts,defaultEffort:e.default_effort}}function wv(e){return{id:e.id,name:e.name,baseUrl:e.base_url,defaultModel:e.default_model,authMethods:e.auth_methods,credentialType:e.credential_type,status:e.status,models:e.models}}function tk(e){return{defaultProvider:e.default_provider,defaultModel:e.default_model,thinking:e.thinking,planMode:e.plan_mode,yolo:e.yolo,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 Wie(e){return e.session_id}function zie(e){return e.seq}const Uie="main",qie=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","prompt.aborted","error"]);function $r(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 jie(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 s3(){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,retryReuseMsgId:void 0}}function us(e,t){const n=e[t];return typeof n=="string"?n:void 0}function ka(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function yi(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function Vie(e){if(!e||typeof e!="object")return null;const t=e,n=t.budget,o=n&&typeof n=="object"?n:{},s=us(t,"status");if(s!=="active"&&s!=="paused"&&s!=="blocked"&&s!=="complete")return null;const i=us(t,"goalId")??us(t,"goal_id")??"goal",r=us(t,"objective")??"";return{goalId:i,objective:r,completionCriterion:us(t,"completionCriterion")??us(t,"completion_criterion"),status:s,turnsUsed:ka(t,"turnsUsed")??ka(t,"turns_used")??0,tokensUsed:ka(t,"tokensUsed")??ka(t,"tokens_used")??0,wallClockMs:ka(t,"wallClockMs")??ka(t,"wall_clock_ms")??0,terminalReason:us(t,"terminalReason")??us(t,"terminal_reason"),budget:{tokenBudget:yi(o,"tokenBudget")??yi(o,"token_budget"),remainingTokens:yi(o,"remainingTokens")??yi(o,"remaining_tokens"),turnBudget:yi(o,"turnBudget")??yi(o,"turn_budget"),remainingTurns:yi(o,"remainingTurns")??yi(o,"remaining_turns"),wallClockBudgetMs:yi(o,"wallClockBudgetMs")??yi(o,"wall_clock_budget_ms"),remainingWallClockMs:yi(o,"remainingWallClockMs")??yi(o,"remaining_wall_clock_ms"),overBudget:o.overBudget===!0||o.over_budget===!0}}}function Ca(e,t,n,o){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"},...o,id:n,sessionId:t,kind:"subagent"};return e.subagentMeta.set(n,i),i}function Kie(e,t){if(e==="turn.step.started")return null;if(e==="tool.use"||e==="tool.call.started"){const n=us(t,"name")??us(t,"toolName")??"tool",o=ec(Gie(n)),s=Yie(n,t.args??t.input);return s?`Calling ${o}: ${s}`:`Calling ${o}`}if(e==="tool.progress"){const n=t.update;if(n&&typeof n=="object"){const s=us(n,"text");if(s)return _v(s);const i=us(n,"message");if(i)return _v(i)}const o=us(t,"message");if(o)return _v(o)}return null}function Gie(e){return e.replace(/_\d+$/,"")}const i3=2e3;function _v(e){return e.length>i3?`${e.slice(0,i3)}…`:e}function Yie(e,t){if(t==null)return"";const n=typeof t=="string"?t:JSON.stringify(t);return df(e,n)}function Zie(e,t,n,o,s,i){if(i.has(n)&&o==="turn.step.started")return[];if(o==="assistant.delta"){const u=us(s,"delta");if(!u)return[];const d=e.subagentMeta.get(n),f=Ca(e,t,n,{status:"running",subagentPhase:"working",startedAt:d?.startedAt??new Date().toISOString()}),h=[];return f&&h.push({type:"taskCreated",sessionId:t,task:f}),h.push({type:"taskProgress",sessionId:t,taskId:n,outputChunk:u,stream:"stdout",kind:"text"}),h}const r=Kie(o,s);if(r===null||r.length===0)return[];const l=e.subagentMeta.get(n),a=Ca(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 fd(e){return{...e,content:e.content.map(t=>({...t}))}}function r3(e,t,n){const o={id:$r("msg_"),sessionId:t,role:"assistant",content:[],createdAt:new Date().toISOString(),promptId:n};return e.messages.push(o),o}function Xie(e,t,n,o,s,i){const r={id:o,sessionId:t,role:"user",content:s,createdAt:i,promptId:n};return e.messages.push(r),r}function Qie(e){return Array.isArray(e)?e.map(t=>G2(t)):[]}function l3(e,t,n,o){const s=e.messages.find(r=>r.id===t);if(!s)return-1;const i=s.content.at(-1);return i&&i.type===n?(n==="text"?i.text+=o:i.thinking+=o,s.content.length-1):(s.content.push(n==="text"?{type:"text",text:o}:{type:"thinking",thinking:o}),s.content.length-1)}function Jie(e,t,n,o,s,i){const r=e.messages.find(l=>l.id===t);r&&r.content.push({type:"toolUse",toolCallId:n,toolName:o,input:s,outputLines:i})}function ere(e){const t=e.update,n=t&&typeof t=="object"?t:null,s=(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:s}:null}function a3(e,t){e.messages.find(n=>n.id===t)}function tre(e,t,n,o,s,i){const r={id:$r("msg_"),sessionId:t,role:"tool",content:[{type:"toolResult",toolCallId:n,output:o,isError:s}],createdAt:new Date().toISOString(),promptId:i};return e.messages.push(r),r}function hd(e,t){return e.messages.find(n=>n.id===t)}function c3(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 nre(){const e=new Map,t=new Set;function n(u){let d=e.get(u);return d||(d=s3(),e.set(u,d)),d}function o(u){e.set(u,s3())}function s(u){t.add(u)}function i(u,d){const f=n(u);f.currentPromptId=d}function r(u,d){o(u);const f=n(u),h=d.promptId??$r("pr_");f.currentPromptId=h,f.turnPromptId.set(d.turnId,h);const p=r3(f,u,h);d.thinkingText.length>0&&p.content.push({type:"thinking",thinking:d.thinkingText}),d.assistantText.length>0&&p.content.push({type:"text",text:d.assistantText});for(const m of d.runningTools){const y=typeof m.lastProgress?.text=="string"&&m.lastProgress.text.length>0?[m.lastProgress.text]:void 0;p.content.push({type:"toolUse",toolCallId:m.toolCallId,toolName:m.name,input:m.args??{},outputLines:y}),f.toolStartTimes.set(m.toolCallId,Date.now())}return f.currentAssistantMsgId=p.id,f.turnTextLen=d.assistantText.length,f.turnThinkLen=d.thinkingText.length,[{type:"messageCreated",message:fd(p)}]}function l(u,d,f,h){try{return c(u,d,f,h)}catch(p){return console.error("[agentProjector] Error projecting event:",u,p instanceof Error?p.message:p),[]}}function a(u,d){return d===void 0?"append":d<u?"skip":d>u?"gap":"append"}function c(u,d,f,h){const p=n(f),m=d,y=[],k=m?.agentId;if(typeof k=="string"&&k!==Uie){const g=t.has(k);if(g&&(u==="thinking.delta"||u==="assistant.delta")){const v=m?.delta??"";return v?[{type:"agentDelta",sessionId:f,agentId:k,delta:{[u==="thinking.delta"?"thinking":"text"]:v}}]:[]}if(g&&u==="turn.ended")return[{type:"agentTurnEnded",sessionId:f,agentId:k,reason:m?.reason}];if(qie.has(u))return Zie(p,f,k,u,m??{},t)}switch(u){case"session.meta.updated":{const g=m?.patch?.title??m?.title,v=m?.patch?.lastPrompt,b={};typeof g=="string"&&g.length>0&&(b.title=g),typeof v=="string"&&(b.lastPrompt=v),(b.title!==void 0||b.lastPrompt!==void 0)&&y.push({type:"sessionMetaUpdated",sessionId:f,...b});break}case"prompt.submitted":{const g=m?.promptId,v=m?.userMessageId;if(!g||!v)break;const b=Qie(m?.content);if(b.length===0)break;p.currentPromptId=g;const A=Xie(p,f,g,v,b,typeof m?.createdAt=="string"?m.createdAt:new Date().toISOString());y.push({type:"messageCreated",message:fd(A)});break}case"turn.started":{const g=m?.turnId,v=p.currentPromptId??$r("pr_");p.currentPromptId=v,g!==void 0&&p.turnPromptId.set(g,v),p.turnTextLen=0,p.turnThinkLen=0,y.push({type:"turnActiveChanged",sessionId:f,active:!0});break}case"turn.step.started":{const g=m?.turnId;let v=p.turnPromptId.get(g)??p.currentPromptId;if(v||(v=$r("pr_"),p.currentPromptId=v,g!==void 0&&p.turnPromptId.set(g,v)),p.turnTextLen=0,p.turnThinkLen=0,p.retryReuseMsgId!==void 0){const A=p.retryReuseMsgId;if(p.retryReuseMsgId=void 0,hd(p,A)!==void 0){p.currentAssistantMsgId=A;break}}const b=r3(p,f,v);p.currentAssistantMsgId=b.id,y.push({type:"messageCreated",message:fd(b)});break}case"thinking.delta":{const g=p.currentAssistantMsgId;if(!g)break;const v=m?.delta??"";if(!v)break;h?.offset===0&&p.turnThinkLen>0&&(p.turnThinkLen=0);const b=a(p.turnThinkLen,h?.offset);if(b==="skip")break;if(b==="gap"){y.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const A=l3(p,g,"thinking",v);if(A<0)break;p.turnThinkLen+=v.length,y.push({type:"assistantDelta",sessionId:f,messageId:g,contentIndex:A,delta:{thinking:v}});break}case"assistant.delta":{const g=p.currentAssistantMsgId;if(!g)break;const v=m?.delta??"";if(!v)break;h?.offset===0&&p.turnTextLen>0&&(p.turnTextLen=0);const b=a(p.turnTextLen,h?.offset);if(b==="skip")break;if(b==="gap"){y.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const A=l3(p,g,"text",v);if(A<0)break;p.turnTextLen+=v.length,y.push({type:"assistantDelta",sessionId:f,messageId:g,contentIndex:A,delta:{text:v}});break}case"tool.use":case"tool.call.started":{const g=p.currentAssistantMsgId,v=m?.turnId,b=p.turnPromptId.get(v)??p.currentPromptId;if(!g||!b)break;const A=m?.toolCallId,I=m?.name??m?.toolName??"",T=m?.args??m?.input??{};Jie(p,g,A,I,T);const M=hd(p,g);M&&M.content.length-1,p.toolStartTimes.set(A,Date.now()),M&&y.push({type:"messageUpdated",sessionId:f,messageId:g,content:M.content.map($=>({...$})),status:"pending"});break}case"tool.call.delta":break;case"tool.progress":{const g=m?.toolCallId,v=ere(m??{});g&&v&&y.push({type:"toolOutput",sessionId:f,toolCallId:g,outputChunk:v.outputChunk,stream:v.stream});break}case"tool.result":{const g=m?.turnId;let v=p.turnPromptId.get(g)??p.currentPromptId;v||(v=$r("pr_"),p.currentPromptId=v,g!==void 0&&p.turnPromptId.set(g,v));const b=m?.toolCallId,A=m?.output,I=m?.isError??!1;p.toolStartTimes.get(b)??Date.now(),p.toolStartTimes.delete(b);const T=tre(p,f,b,A,I,v);y.push({type:"messageCreated",message:fd(T)}),p.currentAssistantMsgId=void 0;break}case"turn.step.completed":{const g=p.currentAssistantMsgId,v=jie(m?.usage);if(p.totalInput+=v.input,p.totalOutput+=v.output,p.totalCacheRead+=v.cacheRead,p.totalCacheCreate+=v.cacheCreate,g){a3(p,g);const b=hd(p,g);b&&y.push({type:"messageUpdated",sessionId:f,messageId:g,content:b.content.map(A=>({...A})),status:"completed"})}break}case"agent.status.updated":{m?.model&&(p.model=m.model),m?.contextTokens!==void 0&&(p.contextTokens=m.contextTokens),m?.maxContextTokens!==void 0&&(p.contextLimit=m.maxContextTokens),y.push({type:"sessionUsageUpdated",sessionId:f,usage:c3(p),model:p.model||void 0,swarmMode:m?.swarmMode===!0?!0:m?.swarmMode===!1?!1:void 0,planMode:m?.planMode===!0?!0:m?.planMode===!1?!1:void 0,thinking:typeof m?.thinkingEffort=="string"&&m.thinkingEffort.length>0?m.thinkingEffort:void 0});break}case"turn.ended":{const g=p.currentAssistantMsgId,v=m?.reason??"completed",b=ka(m??{},"durationMs");if(y.push({type:"turnActiveChanged",sessionId:f,active:!1,reason:m?.reason}),g){a3(p,g);const I=hd(p,g);I&&y.push({type:"messageUpdated",sessionId:f,messageId:g,content:I.content.map(T=>({...T})),status:v==="failed"||v==="blocked"?"error":"completed",durationMs:b})}p.turnCount++;const A=c3(p);y.push({type:"sessionUsageUpdated",sessionId:f,usage:A}),p.currentAssistantMsgId=void 0,p.currentPromptId=void 0,p.turnTextLen=0,p.turnThinkLen=0,p.retryReuseMsgId=void 0;break}case"prompt.completed":{const g=m?.promptId;typeof g=="string"&&g.length>0&&y.push({type:"promptCompleted",sessionId:f,promptId:g,reason:m?.reason??"completed"});break}case"prompt.aborted":{const g=m?.promptId;typeof g=="string"&&g.length>0&&y.push({type:"promptAborted",sessionId:f,promptId:g});break}case"turn.step.retrying":{const g=p.currentAssistantMsgId;if(g!==void 0){const v=hd(p,g);v!==void 0&&(v.content=v.content.filter(b=>b.type!=="text"&&b.type!=="thinking"&&b.type!=="toolUse"),y.push({type:"messageUpdated",sessionId:f,messageId:g,content:v.content.map(b=>({...b})),status:"pending"}),p.retryReuseMsgId=g)}p.turnTextLen=0,p.turnThinkLen=0,p.toolStartTimes.clear();break}case"turn.step.interrupted":{p.currentAssistantMsgId=void 0,p.retryReuseMsgId=void 0;break}case"subagent.spawned":{const v={id:typeof m?.subagentId=="string"&&m.subagentId.length>0?m.subagentId:$r("task_"),sessionId:f,kind:"subagent",description:typeof m?.description=="string"?m.description:m?.subagentName??"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued",subagentType:typeof m?.subagentName=="string"?m.subagentName:void 0,parentToolCallId:typeof m?.parentToolCallId=="string"?m.parentToolCallId:void 0,swarmIndex:typeof m?.swarmIndex=="number"?m.swarmIndex:void 0,runInBackground:m?.runInBackground===!0};p.subagentMeta.set(v.id,v),y.push({type:"taskCreated",sessionId:f,task:v});break}case"subagent.started":{const g=Ca(p,f,m?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString()});g&&y.push({type:"taskCreated",sessionId:f,task:g});break}case"subagent.suspended":{const g=Ca(p,f,m?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof m?.reason=="string"?m.reason:void 0});g&&y.push({type:"taskCreated",sessionId:f,task:g});break}case"subagent.completed":{const g=typeof m?.resultSummary=="string"?m.resultSummary:void 0,v=Ca(p,f,m?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),outputPreview:g});v&&y.push({type:"taskCreated",sessionId:f,task:v}),y.push({type:"taskCompleted",sessionId:f,taskId:m?.subagentId??"",status:"completed",outputPreview:g});break}case"subagent.failed":{const g=typeof m?.error=="string"?m.error:void 0,v=Ca(p,f,m?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),outputPreview:g});v&&y.push({type:"taskCreated",sessionId:f,task:v}),y.push({type:"taskCompleted",sessionId:f,taskId:m?.subagentId??"",status:"failed",outputPreview:g});break}case"error":{y.push({type:"unknown",raw:{_agentError:!0,code:m?.code,message:m?.message,name:m?.name,details:m?.details,retryable:m?.retryable}});break}case"warning":{y.push({type:"unknown",raw:{_agentWarning:!0,message:m?.message}});break}case"task.started":{const g=m?.info??{},v=typeof g.startedAt=="number"?new Date(g.startedAt).toISOString():void 0,b=typeof g.taskId=="string"?g.taskId:typeof g.taskId=="number"?String(g.taskId):$r("task_"),A=typeof g.description=="string"?g.description:typeof g.command=="string"?g.command:$n.global.t("tasks.defaultDescription");if(g.kind==="agent"){const T=typeof g.agentId=="string"&&g.agentId.length>0?g.agentId:void 0;if(T!==void 0){const M=Ca(p,f,T,{description:A,backgroundTaskId:b,runInBackground:!0});M&&y.push({type:"taskCreated",sessionId:f,task:M})}else y.push({type:"taskCreated",sessionId:f,task:{id:b,sessionId:f,kind:"subagent",description:A,status:"running",createdAt:v??new Date().toISOString(),startedAt:v,subagentPhase:"queued",runInBackground:!0}});break}const I=typeof g.command=="string"?g.command:void 0;y.push({type:"taskCreated",sessionId:f,task:{id:b,sessionId:f,kind:"bash",description:A,command:I,status:"running",createdAt:v??new Date().toISOString(),startedAt:v,outputPreview:I!==void 0?`$ ${I}`:void 0}});break}case"task.terminated":{const g=m?.info??{},v=g.status==="failed"||typeof g.exitCode=="number"&&g.exitCode!==0;y.push({type:"taskCompleted",sessionId:f,taskId:typeof g.taskId=="string"?g.taskId:typeof g.taskId=="number"?String(g.taskId):"",status:v?"failed":"completed"});break}case"compaction.completed":{const g=m?.result??{};y.push({type:"compactionCompleted",sessionId:f,tokensBefore:typeof g.tokensBefore=="number"?g.tokensBefore:void 0,tokensAfter:typeof g.tokensAfter=="number"?g.tokensAfter:void 0,summary:typeof g.summary=="string"?g.summary:void 0}),y.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"auto_compact"});break}case"compaction.started":{y.push({type:"compactionStarted",sessionId:f,trigger:m?.trigger==="manual"?"manual":"auto",instruction:typeof m?.instruction=="string"?m.instruction:void 0});break}case"compaction.cancelled":{y.push({type:"compactionCancelled",sessionId:f});break}case"goal.updated":{const g=Vie(m?.snapshot??null);y.push({type:"goalUpdated",sessionId:f,goal:g?.status==="complete"?null:g});break}case"cron.fired":{const g=m?.origin,v=us(m??{},"prompt");if(g&&typeof g=="object"&&g.kind==="cron_job"&&v){const b={id:$r("cron_"),sessionId:f,role:"user",content:[{type:"text",text:v}],createdAt:new Date().toISOString(),metadata:{origin:g}};p.messages.push(b),y.push({type:"messageCreated",message:fd(b)})}break}}return y}return{project:l,bindNextPromptId:i,seedInFlight:r,reset:o,markSideChannelAgent:s}}const ore=new Set(["server_hello","ack","ping","resync_required","error","pong"]),u3=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","prompt.aborted","session.meta.updated","compaction.started","compaction.completed","compaction.cancelled","goal.updated","error","warning","subagent.spawned","subagent.started","subagent.suspended","subagent.completed","subagent.failed","task.started","task.terminated","cron.fired"]),sre=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","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"]),ire=new Set(["assistant.delta","thinking.delta"]);function rre(e,t){if(ore.has(e))return{route:"ignore"};const n=e.startsWith("event."),o=n?e.slice(6):e;return ire.has(o)?lre(t)?{route:"agent",agentType:o}:{route:"protocol"}:n?sre.has(o)?{route:"protocol"}:u3.has(o)?{route:"agent",agentType:o}:{route:"protocol"}:u3.has(o)?{route:"agent",agentType:o}:{route:"agent",agentType:o}}function lre(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 Ed extends Error{code;requestId;details;timestamp;durationMs;constructor(t){super(t.msg),this.name="DaemonApiError",this.code=t.code,this.requestId=t.requestId,this.details=t.details,this.timestamp=t.timestamp,this.durationMs=t.durationMs}}class Nr extends Error{cause;method;path;url;requestId;phase;timeoutMs;status;statusText;contentType;bodyPreview;timestamp;durationMs;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,this.timestamp=t.timestamp,this.durationMs=t.durationMs}}function _i(e){return e instanceof Ed||typeof e=="object"&&e!==null&&e.name==="DaemonApiError"&&typeof e.code=="number"}function Y2(e){return e instanceof Nr||typeof e=="object"&&e!==null&&e.name==="DaemonNetworkError"&&typeof e.method=="string"&&typeof e.path=="string"}const Vo="dimi-web.server-credential",are="token",cre=10080*60*1e3;let fr;const nk=new Set;function ure(){if(typeof window>"u")return;const e=window.location.hash??"";if(!e.startsWith("#"))return;const n=new URLSearchParams(e.slice(1)).get(are);if(!n)return;const o=new URL(window.location.href);return o.hash="",window.history.replaceState(window.history.state,"",`${o.pathname}${o.search}`),n}function ok(e){return{version:1,credential:e,expiresAt:Date.now()+cre}}function dre(e){return JSON.stringify(e)}function Z2(e){try{const t=JSON.parse(e);if(typeof t!="object"||t===null)return;const n=t;return n.version!==1||typeof n.credential!="string"||n.credential.length===0||typeof n.expiresAt!="number"||!Number.isFinite(n.expiresAt)?void 0:{version:1,credential:n.credential,expiresAt:n.expiresAt}}catch{return}}function sk(e){globalThis.localStorage?.setItem(Vo,dre(e))}function fre(){try{const e=globalThis.localStorage?.getItem(Vo);if(e){const n=Z2(e);if(n===void 0){const o=ok(e);let s=!1;try{sk(o),s=!0}catch{}if(!s)try{globalThis.localStorage?.getItem(Vo)===e&&globalThis.localStorage?.removeItem(Vo),s=!0}catch{}try{globalThis.sessionStorage?.removeItem(Vo)}catch{}return s?o:void 0}if(n.expiresAt>Date.now())return n;globalThis.sessionStorage?.removeItem(Vo),globalThis.localStorage?.getItem(Vo)===e&&globalThis.localStorage?.removeItem(Vo);return}const t=globalThis.sessionStorage?.getItem(Vo);if(t){const n=ok(t);let o=!1;try{sk(n),o=!0}catch{}try{globalThis.sessionStorage?.removeItem(Vo),o=!0}catch{}return o?n:void 0}return}catch{return}}function hre(){const e=ure();return e?(TE(e),!0):(fr=fre(),fr!==void 0)}function EE(){if(fr!==void 0){if(fr.expiresAt<=Date.now()){pre(fr);return}return fr.credential}}function pre(e){fr=void 0;try{globalThis.sessionStorage?.removeItem(Vo);const t=globalThis.localStorage?.getItem(Vo),n=t==null?void 0:Z2(t);(n===void 0?t===e.credential:n.credential===e.credential&&n.expiresAt===e.expiresAt)&&globalThis.localStorage?.removeItem(Vo)}catch{}}function TE(e){const t=ok(e);fr=t;try{sk(t)}catch{}try{globalThis.sessionStorage?.removeItem(Vo)}catch{}}function mre(){const e=fr;fr=void 0;try{const t=globalThis.localStorage?.getItem(Vo),o=(t==null?void 0:Z2(t))?.credential??t;e!==void 0&&o===e.credential&&globalThis.localStorage?.removeItem(Vo),globalThis.sessionStorage?.removeItem(Vo)}catch{}}function gre(e){return nk.add(e),()=>{nk.delete(e)}}function vre(){mre();for(const e of nk)try{e()}catch{}}const Pc=3e4,cp=5*6e4,NE="0123456789ABCDEFGHJKMNPQRSTVWXYZ",d3=500,IE=40101;function up(e=Pc){try{return AbortSignal.timeout(e)}catch{return}}function yre(e,t){let n="",o=e;for(let s=0;s<t;s++)n=NE[o%32]+n,o=Math.floor(o/32);return n}function kre(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=>NE[n%32]).join("")}function dp(){return`${yre(Date.now(),10)}${kre(16)}`}function bre(e){try{const t=[];return e.forEach((n,o)=>{typeof n=="string"?t.push({field:o,value:n}):t.push({field:o,file:n.name,size:n.size,type:n.type})}),{formData:t}}catch{return"[FormData]"}}async function Sv(e){try{const t=await e.text();return t?t.length>d3?`${t.slice(0,d3)}...`:t:void 0}catch{return}}class xre{constructor(t,n){this.origin=t,this.identity=n}async get(t,n){return this.request("GET",t,void 0,n)}async getBlob(t){const n=Gc(this.origin,t),o=dp(),s={"X-Request-Id":o};this.addClientHeaders(s);const i=Date.now();lp({method:"GET",path:t,url:n,requestId:o});let r;try{r=await fetch(n,{method:"GET",headers:s,signal:up()})}catch(a){throw pl({method:"GET",path:t,requestId:o,phase:"fetch",durationMs:Date.now()-i,error:a}),new Nr({message:`Network error calling GET ${t}`,cause:a,method:"GET",path:t,url:n,requestId:o,phase:"fetch",timeoutMs:Pc,timestamp:Date.now(),durationMs:Date.now()-i})}if(r.ok)return Ec({method:"GET",path:t,requestId:o,status:r.status,durationMs:Date.now()-i,code:0,msg:""}),r.blob();let l;try{l=await r.clone().json()}catch{}throw this.checkAuthRequired(r,l?.code??0),Ec({method:"GET",path:t,requestId:o,status:r.status,durationMs:Date.now()-i,code:l?.code??r.status,msg:l?.msg??r.statusText,envelopeRequestId:l?.request_id}),new Ed({code:l?.code??r.status,msg:l?.msg??r.statusText,requestId:l?.request_id??o,details:l?.details,timestamp:Date.now(),durationMs:Date.now()-i})}async post(t,n,o){return this.request("POST",t,n,void 0,o?.allowCodes)}async postZip(t,n,o){const s="POST",i=Gc(this.origin,t),r=dp(),l={"X-Request-Id":r,"Content-Type":"application/json; charset=utf-8"};this.addClientHeaders(l);const a=Date.now();lp({method:s,path:t,url:i,requestId:r,body:o});let c;try{c=await fetch(i,{method:s,headers:l,body:JSON.stringify(n),signal:up(cp)})}catch(h){throw pl({method:s,path:t,requestId:r,phase:"fetch",durationMs:Date.now()-a,error:h}),new Nr({message:`Network error calling ${s} ${t}`,cause:h,method:s,path:t,url:i,requestId:r,phase:"fetch",timeoutMs:cp,timestamp:Date.now(),durationMs:Date.now()-a})}const u=c.headers.get("content-type")??void 0,d=u?.split(";",1)[0]?.trim().toLowerCase();if(!c.ok||d!=="application/zip"){let h;try{h=await c.clone().json()}catch{}if(this.checkAuthRequired(c,h?.code??0),!c.ok||h!==void 0&&h.code!==0){const y=h?.code??c.status,k=h?.msg??c.statusText;throw Ec({method:s,path:t,requestId:r,status:c.status,durationMs:Date.now()-a,code:y,msg:k,envelopeRequestId:h?.request_id}),new Ed({code:y,msg:k,requestId:h?.request_id??r,details:h?.details,timestamp:Date.now(),durationMs:Date.now()-a})}const p=c.clone(),m=new TypeError(`Expected application/zip, received ${u??"no content type"}`);throw pl({method:s,path:t,requestId:r,phase:"parse",durationMs:Date.now()-a,status:c.status,error:m}),new Nr({message:`Invalid ZIP response from ${s} ${t}`,cause:m,method:s,path:t,url:i,requestId:r,phase:"parse",timeoutMs:cp,status:c.status,statusText:c.statusText,contentType:u,bodyPreview:await Sv(p),timestamp:Date.now(),durationMs:Date.now()-a})}let f;try{f=await c.blob()}catch(h){throw pl({method:s,path:t,requestId:r,phase:"parse",durationMs:Date.now()-a,status:c.status,error:h}),new Nr({message:`Failed to read ZIP response from ${s} ${t}`,cause:h,method:s,path:t,url:i,requestId:r,phase:"parse",timeoutMs:cp,status:c.status,statusText:c.statusText,contentType:u,timestamp:Date.now(),durationMs:Date.now()-a})}return Ec({method:s,path:t,requestId:r,status:c.status,durationMs:Date.now()-a,code:0,msg:""}),{blob:f,contentDisposition:c.headers.get("content-disposition")??void 0}}async postForm(t,n){const o=Gc(this.origin,t),s=dp(),i={"X-Request-Id":s};this.addClientHeaders(i);const r=Date.now();lp({method:"POST",path:t,url:o,requestId:s,body:bre(n)});let l;try{l=await fetch(o,{method:"POST",headers:i,body:n,signal:up()})}catch(u){throw pl({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-r,error:u}),new Nr({message:`Network error calling POST ${t}`,cause:u,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:Pc,timestamp:Date.now(),durationMs:Date.now()-r})}let a;const c=l.clone();try{a=await l.json()}catch(u){throw pl({method:"POST",path:t,requestId:s,phase:"parse",durationMs:Date.now()-r,status:l.status,error:u}),new Nr({message:`Failed to parse JSON response from POST ${t}`,cause:u,method:"POST",path:t,url:o,requestId:s,phase:"parse",timeoutMs:Pc,status:l.status,statusText:l.statusText,contentType:l.headers.get("content-type")??void 0,bodyPreview:await Sv(c),timestamp:Date.now(),durationMs:Date.now()-r})}if(Ec({method:"POST",path:t,requestId:s,status:l.status,durationMs:Date.now()-r,code:a.code,msg:a.msg,envelopeRequestId:a.request_id,data:a.data}),this.checkAuthRequired(l,a.code),a.code!==0)throw new Ed({code:a.code,msg:a.msg,requestId:a.request_id,details:a.details,timestamp:Date.now(),durationMs:Date.now()-r});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,o,s,i=[]){let r=Gc(this.origin,n);if(s){const h=new URLSearchParams;for(const[m,y]of Object.entries(s))y!==void 0&&h.set(m,String(y));const p=h.toString();p&&(r=`${r}?${p}`)}const l=dp(),a={"X-Request-Id":l};this.addClientHeaders(a),o!==void 0&&(a["Content-Type"]="application/json; charset=utf-8");const c=Date.now();lp({method:t,path:n,url:r,requestId:l,body:o});let u;try{u=await fetch(r,{method:t,headers:a,body:o!==void 0?JSON.stringify(o):void 0,signal:up()})}catch(h){throw pl({method:t,path:n,requestId:l,phase:"fetch",durationMs:Date.now()-c,error:h}),new Nr({message:`Network error calling ${t} ${n}`,cause:h,method:t,path:n,url:r,requestId:l,phase:"fetch",timeoutMs:Pc,timestamp:Date.now(),durationMs:Date.now()-c})}let d;const f=u.clone();try{d=await u.json()}catch(h){throw pl({method:t,path:n,requestId:l,phase:"parse",durationMs:Date.now()-c,status:u.status,error:h}),new Nr({message:`Failed to parse JSON response from ${t} ${n}`,cause:h,method:t,path:n,url:r,requestId:l,phase:"parse",timeoutMs:Pc,status:u.status,statusText:u.statusText,contentType:u.headers.get("content-type")??void 0,bodyPreview:await Sv(f),timestamp:Date.now(),durationMs:Date.now()-c})}if(Ec({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}),this.checkAuthRequired(u,d.code),d.code!==0&&!i.includes(d.code))throw new Ed({code:d.code,msg:d.msg,requestId:d.request_id,details:d.details,timestamp:Date.now(),durationMs:Date.now()-c});return d.data}addClientHeaders(t){const n=EE();n!==void 0&&(t.Authorization=`Bearer ${n}`),this.identity!==void 0&&(t["X-Dimi-Client-Id"]=this.identity.clientId,t["X-Dimi-Client-Name"]=this.identity.clientName,t["X-Dimi-Client-Version"]=this.identity.clientVersion,t["X-Dimi-Client-Ui-Mode"]=this.identity.clientUiMode)}checkAuthRequired(t,n){(t.status===401||n===IE)&&vre()}}const wre="dimi.bearer.",_re=3e4;class Sre{constructor(t,n,o){this.wsUrl=t,this.clientId=n,this.handlers=o}ws=null;connected=!1;closed=!1;subscriptions=new Map;pendingSubscriptions=[];terminalAttachments=new Map;msgSeq=0;reconnectAttempts=0;reconnectTimer=null;heartbeatMs=3e4;lastActivityAt=0;connect(){if(this.ws!==null||this.closed)return;this.lastActivityAt=Date.now(),Tc("connect",{url:this.wsUrl,attempt:this.reconnectAttempts});const t=EE(),n=t!==void 0?[`${wre}${t}`]:void 0,o=new WebSocket(this.wsUrl,n);this.ws=o,o.onopen=()=>{Tc("open")},o.onmessage=s=>{this.lastActivityAt=Date.now();try{const i=JSON.parse(String(s.data));Cie(i),this.handleFrame(i)}catch(i){Tc("parse-error",{error:String(i)}),this.handlers.onError(0,`Failed to parse WS frame: ${String(i)}`,!1)}},o.onerror=()=>{Tc("error"),this.handlers.onError(0,"WebSocket error",!1)},o.onclose=s=>{Tc("close",s?{code:s.code,reason:s.reason,wasClean:s.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,Tc("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 o=this.pendingSubscriptions.findIndex(s=>s.sessionId===t);o!==-1&&this.pendingSubscriptions.splice(o,1),this.pendingSubscriptions.push({sessionId:t,cursor:{...n}})}}unsubscribe(t){this.subscriptions.delete(t);const n=this.pendingSubscriptions.findIndex(o=>o.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,o){const s=fp(t,n),i=this.terminalAttachments.get(s),r=o??i?.lastSeq??0;this.terminalAttachments.set(s,{sessionId:t,terminalId:n,lastSeq:r}),!(!this.connected||!this.ws)&&this.sendTerminalAttach(t,n,r)}terminalInput(t,n,o){!this.connected||!this.ws||this.send({type:"terminal_input",id:this.nextId(),payload:{session_id:t,terminal_id:n,data:o}})}terminalResize(t,n,o,s){!this.connected||!this.ws||this.send({type:"terminal_resize",id:this.nextId(),payload:{session_id:t,terminal_id:n,cols:o,rows:s}})}terminalDetach(t,n){this.terminalAttachments.delete(fp(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(fp(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)}health(){const t=this.ws!==null&&this.ws.readyState===WebSocket.OPEN,n=Math.max(this.heartbeatMs*2,_re),o=this.lastActivityAt>0&&Date.now()-this.lastActivityAt>n;return{connected:this.connected,open:t,stale:o}}reconnect(){if(this.closed)return;this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null);const t=this.ws;if(t!==null){t.onopen=null,t.onmessage=null,t.onerror=null,t.onclose=null;try{t.close(1e3,"reconnect")}catch{}}const n=this.connected;this.ws=null,this.connected=!1,n&&this.handlers.onConnectionState(!1),this.connect()}handleFrame(t){const n=t;switch(t.type){case"server_hello":{const o=n.payload?.heartbeat_ms;typeof o=="number"&&o>0&&(this.heartbeatMs=o),this.onServerHello();break}case"ping":this.send({type:"pong",payload:{nonce:n.payload.nonce}});break;case"resync_required":{const o=n.payload.session_id,s=n.payload.epoch;this.subscriptions.set(o,{seq:n.payload.current_seq,epoch:s}),this.handlers.onResync(o,n.payload.current_seq,s);break}case"error":{const o=n.session_id;typeof o=="string"&&this.handlers.onRawAgentEvent?this.handlers.onRawAgentEvent({type:"error",seq:n.seq,session_id:o,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 o=n.session_id,s=n.terminal_id,i=n.seq,r=fp(o,s),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?.(o,s,a,i);break}case"terminal_exit":{const o=n.session_id,s=n.terminal_id,i=n.payload?.exit_code,r=typeof i=="number"?i:null;this.handlers.onTerminalExit?.(o,s,r);break}default:{this.trackCursor(n);const o=n.type,s=rre(o,n.payload);if(s.route==="protocol"){this.handlers.onWireEvent(n);break}if(s.route==="agent"){if(this.handlers.onRawAgentEvent&&typeof n.session_id=="string"){const i=n,r=n;this.handlers.onRawAgentEvent({type:s.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 o of this.pendingSubscriptions)this.subscriptions.set(o.sessionId,o.cursor),t.includes(o.sessionId)||t.push(o.sessionId);this.pendingSubscriptions.length=0;const n={};for(const[o,s]of this.subscriptions.entries())n[o]=s;this.send({type:"client_hello",id:this.nextId(),payload:{client_id:this.clientId,subscriptions:t,cursors:n}});for(const o of this.terminalAttachments.values())this.sendTerminalAttach(o.sessionId,o.terminalId,o.lastSeq)}sendSubscribe(t,n){this.send({type:"subscribe",id:this.nextId(),payload:{session_ids:t,cursors:n}})}sendTerminalAttach(t,n,o){this.send({type:"terminal_attach",id:this.nextId(),payload:{session_id:t,terminal_id:n,since_seq:o>0?o:void 0}})}trackCursor(t){if(t.volatile===!0)return;const n=t.session_id,o=t.seq;if(typeof n!="string"||typeof o!="number")return;const s=this.subscriptions.get(n);if(!s||o<=s.seq&&s.epoch!==void 0)return;const i=typeof t.epoch=="string"?t.epoch:s.epoch;this.subscriptions.set(n,{seq:Math.max(o,s.seq),epoch:i})}send(t){if(!(!this.ws||this.ws.readyState!==WebSocket.OPEN))try{this.ws.send(JSON.stringify(t)),Sie(t)}catch{}}nextId(){return`c_${++this.msgSeq}`}}function fp(e,t){return`${e}\0${t}`}function Cre(e,t){if(e===void 0)return t;let n;const o=/filename\*\s*=\s*UTF-8''([^;]+)/i.exec(e)?.[1]?.trim();if(o!==void 0)try{n=decodeURIComponent(o.replaceAll(/^"|"$/g,""))}catch{return t}else n=/filename\s*=\s*"([^"]*)"/i.exec(e)?.[1]??/filename\s*=\s*([^;]+)/i.exec(e)?.[1]?.trim();return n===void 0||n.length===0||n.length>200||n==="."||n===".."||/[\u0000-\u001F\u007F/\\]/.test(n)||!n.toLowerCase().endsWith(".zip")?t:n}function f3(e){if(typeof e!="object"||e===null)return{errorName:typeof e};const t=e;return{errorName:typeof t.name=="string"?t.name:"Error",errorCode:typeof t.code=="number"?t.code:void 0,requestId:typeof t.requestId=="string"?t.requestId:void 0,phase:typeof t.phase=="string"?t.phase:void 0,httpStatus:typeof t.status=="number"?t.status:void 0}}function Cv(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 h3(e){return e==="auto_compact"||e==="manual_compact"}class Are{http;config;constructor(t){this.config=t,this.http=new xre(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:[],dangerousBypassAuth:t.dangerous_bypass_auth===!0}}async listSessions(t){const n={before_id:t?.beforeId,after_id:t?.afterId,page_size:t?.pageSize,busy:t?.busy,include_archive:t?.includeArchive,archived_only:t?.archivedOnly,exclude_empty:t?.excludeEmpty,workspace_id:t?.workspaceId},o=await this.http.get("/sessions",n);return{items:o.items.map(Ri),hasMore:o.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 o=await this.http.post("/sessions",n);return Ri(o)}async getSession(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}`);return Ri(n)}async updateSession(t,n){const o={};n.title!==void 0&&(o.title=n.title),n.cwd!==void 0&&(o.metadata={cwd:n.cwd});const s={};n.model!==void 0&&(s.model=n.model),n.permissionMode!==void 0&&(s.permission_mode=n.permissionMode),n.planMode!==void 0&&(s.plan_mode=n.planMode),n.swarmMode!==void 0&&(s.swarm_mode=n.swarmMode),n.goalObjective!==void 0&&(s.goal_objective=n.goalObjective),n.goalControl!==void 0&&(s.goal_control=n.goalControl),n.thinking!==void 0&&(s.thinking=n.thinking),Object.keys(s).length>0&&(o.agent_config=s);const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/profile`,o);return Ri(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,thinkingEffort: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 getSessionGoal(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/goal`);return ME(n)}async getSessionWarnings(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/warnings`)).warnings??[]}async archiveSession(t){return await this.http.post(`/sessions/${encodeURIComponent(t)}:archive`,{})}async restoreSession(t){const n=await this.http.post(`/sessions/${encodeURIComponent(t)}:restore`,{});return Ri(n)}async listMessages(t,n){const o={before_id:n?.beforeId,after_id:n?.afterId,page_size:n?.pageSize,role:n?.role},s=await this.http.get(`/sessions/${encodeURIComponent(t)}/messages`,o);return{items:s.items.map(ek),hasMore:s.has_more}}async getSessionSnapshot(t){const n=Date.now();mo("session:snapshot:start",{sessionId:t});try{const o=await this.http.get(`/sessions/${encodeURIComponent(t)}/snapshot`),s={asOfSeq:o.as_of_seq,epoch:o.epoch,session:Ri(o.session),messages:o.messages.items.map(ek),hasMoreMessages:o.messages.has_more,inFlightTurn:o.in_flight_turn===null?null:{turnId:o.in_flight_turn.turn_id,assistantText:o.in_flight_turn.assistant_text,thinkingText:o.in_flight_turn.thinking_text,runningTools:o.in_flight_turn.running_tools.map(i=>({toolCallId:i.tool_call_id,name:i.name,args:i.args,description:i.description,lastProgress:i.last_progress})),promptId:o.in_flight_turn.current_prompt_id},pendingApprovals:o.pending_approvals.map(CE),pendingQuestions:o.pending_questions.map(AE),subagents:(o.subagents??[]).map(Dp)};return mo("session:snapshot:accepted",{sessionId:t,busy:s.session.busy,seq:s.asOfSeq,messageCount:s.messages.length,durationMs:Date.now()-n}),s}catch(o){throw mo("session:snapshot:failed",{sessionId:t,status:"failed",durationMs:Date.now()-n,...f3(o)}),o}}async exportSession(t,n){const o=n===void 0?0:new TextEncoder().encode(n).byteLength,s=n===void 0||n.length===0?0:n.split(`
|
|
297
|
-
`).length,i=await this.http.postZip(`/sessions/${encodeURIComponent(t)}/export`,{web_log:n},{web_log_bytes:o,web_log_entries:s}),r=`${t}.zip`;return{blob:i.blob,fileName:Cre(i.contentDisposition,r)}}async submitPrompt(t,n){const o=Date.now();mo("prompt:start",{sessionId:t,contentCount:n.content.length,mediaCount:n.content.filter(s=>s.type==="image"||s.type==="video"||s.type==="file").length});try{const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts`,$ie(n));return mo("prompt:accepted",{sessionId:t,promptId:s.prompt_id,status:s.status,durationMs:Date.now()-o}),{promptId:s.prompt_id,userMessageId:s.user_message_id,status:s.status}}catch(s){throw mo("prompt:failed",{sessionId:t,status:"failed",durationMs:Date.now()-o,...f3(s)}),s}}async steerPrompts(t,n){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts:steer`,{prompt_ids:n});return{steered:o.steered,promptIds:o.prompt_ids}}async abortPrompt(t,n){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts/${encodeURIComponent(n)}:abort`,void 0,{allowCodes:[40903]});return{aborted:o.aborted,atSeq:o.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 o={};n?.title!==void 0&&(o.title=n.title);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}:fork`,o);return Ri(s)}async createChildSession(t,n){const o={};n?.title!==void 0&&(o.title=n.title);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/children`,o);return Ri(s)}async listChildSessions(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/children`)).items.map(Ri)}async startBtw(t){return{agentId:(await this.http.post(`/sessions/${encodeURIComponent(t)}:btw`,{})).agent_id}}async respondApproval(t,n,o){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/approvals/${encodeURIComponent(n)}`,Fie(o));return{resolved:s.resolved,resolvedAt:s.resolved_at}}async respondQuestion(t,n,o){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}`,Die(o));return{resolved:s.resolved,resolvedAt:s.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 o={status:n};return(await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks`,o)).items.map(Dp)}async getTask(t,n,o){const s={with_output:o?.withOutput,output_bytes:o?.outputBytes},i=await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}`,s);return Dp(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(Cv)}async createTerminal(t,n={}){const o={cwd:n.cwd,shell:n.shell,cols:n.cols,rows:n.rows},s=await this.http.post(`/sessions/${encodeURIComponent(t)}/terminals`,o);return Cv(s)}async getTerminal(t,n){const o=await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}`);return Cv(o)}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(o=>({name:o.name,description:o.description,source:o.source}))}async listSkillsForWorkspace(t){return((await this.http.get(`/workspaces/${encodeURIComponent(t)}/skills`)).skills??[]).map(o=>({name:o.name,description:o.description,source:o.source}))}async activateSkill(t,n,o){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/skills/${encodeURIComponent(n)}:activate`,o!==void 0&&o.length>0?{args:o}:{});return{activated:s.activated,skillName:s.skill_name}}async listDirectory(t,n){const o={};n.path!==void 0&&(o.path=n.path),n.depth!==void 0&&(o.depth=n.depth),n.includeGitStatus!==void 0&&(o.include_git_status=n.includeGitStatus);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:list`,o),i=s.children_by_path?Object.fromEntries(Object.entries(s.children_by_path).map(([r,l])=>[r,l.map(o3)])):void 0;return{items:s.items.map(o3),childrenByPath:i,truncated:s.truncated}}async readFile(t,n){const o={path:n.path};n.offset!==void 0&&(o.offset=n.offset),n.length!==void 0&&(o.length=n.length);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:read`,o);return{path:s.path,content:s.content,encoding:s.encoding,size:s.size,truncated:s.truncated,etag:s.etag,mime:s.mime,languageId:s.language_id,lineCount:s.line_count,isBinary:s.is_binary}}async searchFiles(t,n){const o={query:n.query};n.limit!==void 0&&(o.limit=n.limit);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:search`,o);return{items:s.items.map(i=>({path:i.path,name:i.name,kind:i.kind,score:i.score,matchPositions:i.match_positions})),truncated:s.truncated}}async grepFiles(t,n){const o={pattern:n.pattern};n.regex!==void 0&&(o.regex=n.regex),n.caseSensitive!==void 0&&(o.case_sensitive=n.caseSensitive);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:grep`,o);return{files:s.files,filesScanned:s.files_scanned,truncated:s.truncated,elapsedMs:s.elapsed_ms}}async getGitStatus(t,n){const o={};n!==void 0&&(o.paths=n);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:git_status`,o);return{branch:s.branch,ahead:s.ahead,behind:s.behind,entries:s.entries,additions:s.additions,deletions:s.deletions,pullRequest:s.pullRequest??null}}async getFileDiff(t,n){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:diff`,{path:n});return{path:o.path,diff:o.diff}}getFileDownloadUrl(t,n){const o=n.split("/").map(s=>encodeURIComponent(s)).join("/");return Gc(this.config.serverHttpUrl,`/sessions/${encodeURIComponent(t)}/fs/${o}:download`)}async openFile(t,n){const o={path:n.path};return n.line!==void 0&&(o.line=n.line),this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open`,o)}async revealFile(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/fs:reveal`,{path:n.path})}async openInApp(t,n,o,s){const i={app_id:n,path:o};s!==void 0&&(i.line=s),await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open-in`,i)}async listWorkspaces(){try{return((await this.http.get("/workspaces")).items??[]).map(Zd)}catch{return[]}}async addWorkspace(t){const n={root:t.root};t.name!==void 0&&(n.name=t.name);const o=await this.http.post("/workspaces",n);return Zd(o)}async deleteWorkspace(t){await this.http.delete(`/workspaces/${encodeURIComponent(t)}`)}async updateWorkspace(t,n){const o=await this.http.patch(`/workspaces/${encodeURIComponent(t)}`,{name:n.name});return Zd(o)}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(o=>({name:o.name,path:o.path,isDir:o.is_dir}))}}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(Hie)}async listProviders(){return(await this.http.get("/providers")).items.map(wv)}async loginProviderApiKey(t,n){const o=await this.http.post(`/providers/${encodeURIComponent(t)}:login`,{method:"api_key",value:n});return wv(o)}async logoutProvider(t){const n=await this.http.post(`/providers/${encodeURIComponent(t)}:logout`,{});return wv(n)}async refreshProvider(t){const n=await this.http.post(`/providers/${encodeURIComponent(t)}:refresh`);return p3(n)}async refreshAllProviders(){const t=await this.http.post("/providers:refresh");return p3(t)}async getConfig(){const t=await this.http.get("/config");return tk(t)}async setConfig(t){const n={},o={defaultProvider:"default_provider",defaultModel:"default_model",thinking:"thinking",planMode:"plan_mode",yolo:"yolo",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=o[i];l!==void 0&&(n[l]=r)}const s=await this.http.post("/config",n);return tk(s)}async getAuth(){const t=await this.http.get("/auth");return{ready:t.ready,providersCount:t.providers_count,defaultModel:t.default_model,authenticatedProviders:t.authenticated_providers}}async startOAuthLogin(t){const n=await this.http.post("/oauth/login",{provider:t});return n.status==="authenticated"?{flowId:n.flow_id,provider:n.provider,status:"authenticated"}:{flowId:n.flow_id,provider:n.provider,status:"pending",verificationUri:n.verification_uri,verificationUriComplete:n.verification_uri_complete,userCode:n.user_code,expiresIn:n.expires_in,interval:n.interval,expiresAt:n.expires_at}}async pollOAuthLogin(t){const n=await this.http.get(`/oauth/login?provider=${encodeURIComponent(t)}`);return n?{flowId:n.flow_id,status:n.status,resolvedAt:n.resolved_at}:null}async cancelOAuthLogin(t){const n=await this.http.delete(`/oauth/login?provider=${encodeURIComponent(t)}`);return{cancelled:n.cancelled,status:n.status}}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 o=await this.http.postForm("/files",n);return{id:o.id,name:o.name,mediaType:o.media_type,size:o.size}}getFileUrl(t){return Gc(this.config.serverHttpUrl,`/files/${encodeURIComponent(t)}`)}async getFileBlob(t){return this.http.getBlob(`/files/${encodeURIComponent(t)}`)}connectEvents(t){const n=fie(this.config.serverHttpUrl,this.config.clientId),o=nre(),s=new Sre(n,this.config.clientId,{onWireEvent:i=>{const r=Wie(i),l=zie(i),a=Pie(i);a.type==="historyCompacted"&&!h3(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=o.project(r,c,a,{offset:u});for(const f of d){const h=c?.turnId,p=f.type==="assistantDelta"&&typeof h=="number"&&typeof u=="number"&&(r==="assistant.delta"||r==="thinking.delta")?{turnId:h,offset:u,kind:r==="assistant.delta"?"text":"thinking"}:void 0;f.type==="historyCompacted"&&!h3(f.reason)&&t.onResync(a,l),t.onEvent(f,{sessionId:a,seq:l,stream:p})}},onResync:(i,r,l)=>{o.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 s.connect(),{subscribe(i,r){s.subscribe(i,r??{seq:0})},unsubscribe(i){s.unsubscribe(i)},seedSnapshot(i,r){if(r.inFlightTurn===null){o.reset(i);return}const l=o.seedInFlight(i,r.inFlightTurn);for(const a of l)t.onEvent(a,{sessionId:i,seq:r.asOfSeq})},bindNextPromptId(i,r){o.bindNextPromptId(i,r)},abort(i,r){s.abort(i,r)},terminalAttach(i,r,l){s.terminalAttach(i,r,l)},terminalInput(i,r,l){s.terminalInput(i,r,l)},terminalResize(i,r,l,a){s.terminalResize(i,r,l,a)},terminalDetach(i,r){s.terminalDetach(i,r)},terminalClose(i,r){s.terminalClose(i,r)},markSideChannelAgent(i){o.markSideChannelAgent(i)},health(){return s.health()},reconnect(){s.reconnect()},close(){s.close()}}}}function p3(e){return{refreshed:e.refreshed,failed:e.failed}}let m3;function pt(){return m3??=new Are(lie()),m3}const Mre=["src","controls","muted"],Ere=["src","alt"],LE=Qe({__name:"AuthMedia",props:{url:{},kind:{},alt:{},fileId:{},mediaClass:{default:"u-img"},controls:{type:Boolean,default:!0},muted:{type:Boolean,default:!1}},setup(e){const t=e,n=ne(t.fileId?"":t.url),o=ne(null),s=ne(!t.fileId);let i=null,r=0,l=!1,a=null;function c(){i!==null&&(URL.revokeObjectURL(i),i=null)}async function u(){const d=++r;if(c(),!t.fileId){n.value=t.url;return}if(s.value)try{const f=await pt().getFileBlob(t.fileId),h=URL.createObjectURL(f);if(l||d!==r){URL.revokeObjectURL(h);return}i=h,n.value=i}catch{if(l||d!==r)return;n.value=t.url}}return et(()=>[t.fileId,t.url,s.value],u,{immediate:!0}),wn(()=>{typeof IntersectionObserver=="function"&&o.value?(a=new IntersectionObserver(d=>{d[0]?.isIntersecting&&(s.value=!0,a?.disconnect(),a=null)},{rootMargin:"200px"}),a.observe(o.value)):s.value=!0}),so(()=>{l=!0,a?.disconnect(),a=null,c()}),(d,f)=>e.kind==="video"?(x(),E("video",{key:0,ref_key:"mediaEl",ref:o,class:We(e.mediaClass),src:n.value||void 0,controls:e.controls,muted:e.muted,playsinline:"",preload:"metadata"},null,10,Mre)):(x(),E("img",{key:1,ref_key:"mediaEl",ref:o,class:We(e.mediaClass),src:n.value||void 0,alt:e.alt||"",loading:"lazy"},null,10,Ere))}}),Tre=["title","data-kind"],Nre=["aria-label"],Ire={class:"att-tile"},Lre={class:"att-name"},$re={key:1,class:"att-err"},Fre=["aria-label"],Ore=Qe({__name:"AttachmentChip",props:{kind:{},name:{},url:{},fileId:{},mediaType:{},size:{},uploading:{type:Boolean,default:!1},error:{type:Boolean,default:!1},removable:{type:Boolean,default:!1},removeLabel:{}},emits:["activate","remove"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Ot(),i=D(()=>{const d=n.name?.match(/\.([A-Za-z0-9]{1,8})$/)?.[1]??n.mediaType?.split("/")[1]?.split("+")[0];return d?d.toUpperCase():void 0}),r=D(()=>{const u=i.value??"";return/^(txt|md|doc|docx|rtf|log)$/i.test(u)?"file-text":"file"}),l=D(()=>n.name?n.name:n.kind==="image"?s("composer.attachmentImage"):n.kind==="video"?s("composer.attachmentVideo"):s("composer.attachmentFile"));function a(u){return u<1024?`${u} B`:u<1024*1024?`${Math.round(u/1024)} KB`:`${(u/(1024*1024)).toFixed(1)} MB`}const c=D(()=>{const u=[l.value];return n.size!==void 0&&u.push(a(n.size)),u.join(" · ")});return(u,d)=>(x(),E("span",{class:We(["att-chip",{"is-error":e.error,uploading:e.uploading}]),title:c.value,"data-kind":e.kind},[_("button",{type:"button",class:"att-activate","aria-label":c.value,onClick:d[0]||(d[0]=f=>o("activate"))},[_("span",Ire,[e.kind==="image"&&e.url?(x(),Ae(LE,{key:0,url:e.url,kind:"image",alt:e.name,"file-id":e.fileId,"media-class":"att-thumb"},null,8,["url","alt","file-id"])):e.kind==="video"?(x(),Ae(Ye,{key:1,name:"play",size:"sm"})):e.kind==="image"?(x(),Ae(Ye,{key:2,name:"image",size:"sm"})):(x(),Ae(Ye,{key:3,name:r.value,size:"sm"},null,8,["name"]))]),_("span",Lre,R(l.value),1),e.uploading?(x(),Ae(Hs,{key:0,size:"sm",label:C(s)("composer.uploading")},null,8,["label"])):e.error?(x(),E("span",$re,[fe(Ye,{name:"info",size:"sm"})])):ue("",!0)],8,Nre),e.removable?(x(),Ae(rn,{key:0,text:e.removeLabel??C(s)("composer.remove")},{default:Le(()=>[_("button",{type:"button",class:"att-rm","aria-label":e.removeLabel??C(s)("composer.remove"),onClick:d[1]||(d[1]=f=>o("remove"))},[fe(Ye,{name:"close",size:"sm"})],8,Fre)]),_:1},8,["text"])):ue("",!0)],10,Tre))}}),$E=ft(Ore,[["__scopeId","data-v-2bbeba01"]]),Rre=["aria-label"],Bre=120,Dre=60,Pre=Qe({__name:"MoonSpinner",props:{size:{default:"md"},fast:{type:Boolean},label:{default:"Waiting for response…"}},setup(e){const t=["🌑","🌒","🌓","🌔","🌕","🌖","🌗","🌘"];function n(o){return{"--moon-frame-delay":`${o*Bre}ms`,"--moon-frame-fast-delay":`${o*Dre}ms`}}return(o,s)=>(x(),E("span",{class:We(["ui-moon",[`ui-moon--${e.size}`,{"ui-moon--fast":e.fast}]]),"aria-label":e.label,role:"img"},[(x(),E(Pe,null,lt(t,(i,r)=>_("span",{key:i,class:"ui-moon__frame",style:tn(n(r)),"aria-hidden":"true"},R(i),5)),64))],10,Rre))}}),FE=ft(Pre,[["__scopeId","data-v-87f2e4d9"]]),cr=ne(null),hu=ne(!1);function X2(e){const t=cr.value;!t||hu.value||(cr.value=null,t.resolve(e))}async function Hre(){const e=cr.value;if(!(!e||hu.value)){if(!e.action){X2(!0);return}hu.value=!0;try{await e.action(),cr.value===e&&(cr.value=null),e.resolve(!0)}catch(t){cr.value===e&&(cr.value=null),e.reject(t)}finally{hu.value=!1}}}function Wre(e){return hu.value?Promise.resolve(!1):(cr.value&&X2(!1),new Promise((t,n)=>{cr.value={...e,resolve:t,reject:n}}))}function zf(){return{current:cr,busy:hu,confirm:Wre,settle:X2,runAction:Hre}}const zre=/^(application\/pdf|image\/(png|jpe?g|gif|webp|avif|bmp|x-icon|vnd\.microsoft\.icon)|video\/[\w.+-]+|audio\/[\w.+-]+)$/i,Ure=/^(txt|md|markdown|log|json|ya?ml|csv|tsv|ts|mts|tsx|jsx|css|py|go|rs|java|c|h|cc|cpp|hpp|sh|zsh|sql|toml|ini|cfg|conf|vue)$/i,qre=/^(png|jpe?g|gif|webp|avif|bmp|ico)$/i,g3="text/plain;charset=utf-8";function jre(e,t){const n=(t??"").toLowerCase();if(zre.test(n))return n;if(n.startsWith("text/"))return n==="text/html"?null:g3;const o=e?.match(/\.([A-Za-z0-9]{1,8})$/)?.[1]?.toLowerCase();return o===void 0?null:Ure.test(o)?g3:qre.test(o)?`image/${o==="jpg"?"jpeg":o==="ico"?"x-icon":o}`:o==="pdf"?"application/pdf":null}async function OE(e,t,n){const o=jre(t,n);if(o===null)return"unsupported";const s=window.open("","_blank");s!==null&&(s.opener=null);const i=await pt().getFileBlob(e).catch(()=>null);if(i===null)return s?.close(),"failed";const r=URL.createObjectURL(new Blob([i],{type:o}));if(s!==null)s.location.href=r;else{const l=document.createElement("a");l.href=r,l.download=t??e,l.click()}return setTimeout(()=>{URL.revokeObjectURL(r)},6e4),"previewed"}const Vre={class:"chat"},Kre={key:0,class:"chat-loading"},Gre={class:"chat-loading-text"},Yre={key:1,class:"chat-empty"},Zre={key:1,class:"top-sentinel-text"},Xre={key:0,class:"u-turn"},Qre=["data-turn-id"],Jre={key:0,class:"u-atts"},ele={key:1,class:"skill-act"},tle={class:"skill-act-head"},nle={key:0,class:"skill-act-args"},ole={key:2,class:"skill-act"},sle={class:"skill-act-head"},ile={key:0,class:"skill-act-args"},rle={key:3,class:"u-text"},lle={key:0,class:"u-meta"},ale=["aria-label","onClick"],cle=["aria-label","onClick"],ule=["data-turn-id"],dle=["onClick"],fle={class:"cd-view"},hle={key:1,class:"cd-label"},ple=["data-turn-id"],mle={key:1,class:"msg"},gle={key:0,class:"a-msg-ft"},vle={key:0,class:"a-duration"},yle=["aria-label","onClick"],kle={key:4,class:"sending-placeholder"},ble={key:5,class:"q-stack"},xle={class:"q-head"},wle={class:"q-title"},_le={class:"q-hint"},Sle=["onDragover","onDrop"],Cle={class:"u-bub q-bub"},Ale=["title","onDragstart"],Mle=["title","onClick"],Ele={key:0,class:"u-text q-text"},Tle={key:1,class:"q-text q-text-placeholder"},Nle={key:0,class:"q-imgs"},Ile={key:0,class:"q-file"},Lle={key:1,class:"q-tag q-tag-next"},$le={key:2,class:"q-tag q-tag-idx"},Fle=["aria-label","onClick"],Ole={key:0,class:"open-unsupported",role:"status"},Rle=2500,Ble=Qe({__name:"ChatPane",props:{turns:{},approvals:{default:()=>[]},turnActive:{type:Boolean,default:!1},working:{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},toolDiffPanel:{type:Boolean,default:!1},queued:{default:()=>[]}},emits:["openFile","openMedia","copyConversationCopied","openThinking","openCompaction","openAgent","openToolDiff","editMessage","loadOlderMessages","unqueue","editQueued","reorderQueue"],setup(e,{expose:t,emit:n}){const{t:o}=Ot(),{confirm:s}=zf();In(()=>{ie!==null&&(clearTimeout(ie),ie=null),B!==null&&(clearTimeout(B),B=null),$!==null&&(clearTimeout($),$=null),oe!==null&&(clearTimeout(oe),oe=null)});const i=e,r=ne(null);let l=null;function a(){!r.value||typeof IntersectionObserver>"u"||(l?.disconnect(),l=new IntersectionObserver(me=>{me[0]?.isIntersecting&&i.hasMoreMessages&&!i.loadingMore&&!i.loadingMoreError&&!i.sessionLoading&&!i.isFollowing&&d("loadOlderMessages")},{root:null,rootMargin:"200px 0px 0px 0px",threshold:0}),l.observe(r.value))}wn(a),In(()=>{l?.disconnect(),l=null}),et(()=>[i.hasMoreMessages,i.loadingMore,i.loadingMoreError],()=>{kt().then(a)});const c=D(()=>{if(!i.turnActive||i.turns.length===0)return null;const me=i.turns.at(-1);return me.role==="assistant"?me.id:null}),u=D(()=>i.working),d=n,f=ne(null),h=ne(null);function p(me){return(me.attachments?.length??0)>0}function m(me){d("editQueued",me)}function y(me,Ee){if(f.value=me,!Ee.dataTransfer)return;Ee.dataTransfer.effectAllowed="move",Ee.dataTransfer.setData("text/plain",String(me));const ae=Ee.currentTarget?.closest(".q-turn");ae&&Ee.dataTransfer.setDragImage(ae,24,24)}function k(me,Ee){if(f.value===null)return;Ee.preventDefault(),Ee.dataTransfer&&(Ee.dataTransfer.dropEffect="move");const ae=Ee.currentTarget.getBoundingClientRect(),Y=Ee.clientY<ae.top+ae.height/2?"before":"after";h.value={index:me,position:Y}}function g(me,Ee){Ee.preventDefault();const ae=f.value,Y=h.value?.position??"before";if(f.value=null,h.value=null,ae===null)return;let Q=Y==="before"?me:me+1;ae<Q&&(Q-=1),ae!==Q&&d("reorderQueue",{from:ae,to:Q})}function v(){f.value=null,h.value=null}const b=D(()=>{for(let me=i.turns.length-1;me>=0;me--)if(i.turns[me].role==="user")return i.turns[me].id;return null});function A(me){return me.role==="user"&&me.id===b.value&&!i.working&&!me.skillActivation&&!me.pluginCommand}function I(me){const Ee=me.compaction,ae=Ee?.trigger==="auto"?o("conversation.compactedAuto"):o("conversation.compactedPlain");return typeof Ee?.tokensBefore=="number"&&typeof Ee?.tokensAfter=="number"?ae+o("conversation.compactedTokens",{before:pr(Ee.tokensBefore),after:pr(Ee.tokensAfter)}):ae}const T=ne(null),M=ne(null);let $=null;async function N(me){await s({title:o("conversation.undo"),message:o("conversation.undoConfirm"),variant:"primary"})&&F(me)}function F(me){M.value===null&&(M.value=me.id,d("editMessage",{text:me.text,attachments:me.attachments}),$=setTimeout(()=>{$=null,M.value=null},Rle))}et(()=>i.turns,me=>{M.value!==null&&(me.some(Ee=>Ee.id===M.value)||(M.value=null,$!==null&&(clearTimeout($),$=null)))},{flush:"post"});const S=ne(!1);let B=null;function W(){if(i.turns.length===0)return;const me=[];for(const ae of i.turns){if(ae.role==="compaction"||ae.role==="cron")continue;const Y=ae.role==="user"?"User":"Assistant",Q=PU(ae);Q.trim()&&me.push(`**${Y}**
|
|
298
|
-
|
|
299
|
-
${Q}`)}const Ee=me.join(`
|
|
300
|
-
|
|
301
|
-
---
|
|
302
|
-
|
|
303
|
-
`);Xo(Ee).then(ae=>{ae&&(S.value=!0,d("copyConversationCopied"),B!==null&&clearTimeout(B),B=setTimeout(()=>{B=null,S.value=!1},2e3))}).catch(()=>{})}function z(me){const Ee=[];for(let ae=me;ae>=0;ae--){const Y=i.turns[ae];if(!Y||Y.role!=="assistant")break;Ee.unshift(Y)}return Ee}function L(me){return z(me).map(Ee=>DU(Ee)).filter(Boolean).join(`
|
|
304
|
-
|
|
305
|
-
`)}function O(){for(let me=i.turns.length-1;me>=0;me-=1)if(i.turns[me]?.role==="assistant")return L(me);return""}function j(){const me=O();me.trim()&&Xo(me).then(Ee=>{Ee&&(S.value=!0,d("copyConversationCopied"),B!==null&&clearTimeout(B),B=setTimeout(()=>{B=null,S.value=!1},2e3))}).catch(()=>{})}t({copyConversation:W,copyFinalSummary:j});function Z(me){const Ee=i.turns[me];if(!Ee||Ee.role!=="assistant")return!1;const ae=i.turns[me+1];return!ae||ae.role!=="assistant"}let ie=null;function U(me){const Ee=i.turns[me];if(!Ee)return;const ae=L(me);ae.trim()&&Xo(ae).then(Y=>{Y&&(T.value=Ee.id,ie!==null&&clearTimeout(ie),ie=setTimeout(()=>{ie=null,T.value=null},1400))}).catch(()=>{})}function q(me){const Ee=me.text;Ee.trim()&&Xo(Ee).then(ae=>{ae&&(T.value=me.id,ie!==null&&clearTimeout(ie),ie=setTimeout(()=>{ie=null,T.value=null},1400))}).catch(()=>{})}function ee(me){return{kind:me.kind==="video"?"video":"image",url:me.url,path:me.name,fileId:me.fileId}}const le=ne(null);let oe=null;function re(me){if(me.kind==="image"||me.kind==="video"){d("openMedia",ee(me));return}me.fileId!==void 0&&OE(me.fileId,me.name,me.mediaType).then(Ee=>{Ee==="unsupported"&&(le.value=me.name??me.fileId??"",oe!==null&&clearTimeout(oe),oe=setTimeout(()=>{oe=null,le.value=null},2400))})}function we(me,Ee){return me.id!==c.value?!1:Ee.sourceIndex===M1(me).length-1}return(me,Ee)=>(x(),E(Pe,null,[_("div",Vre,[e.sessionLoading?(x(),E("div",Kre,[fe(Hs,{size:"sm"}),_("span",Gre,R(C(o)("conversation.loading")),1)])):e.turns.length===0&&(!e.approvals||e.approvals.length===0)?(x(),E("div",Yre)):ue("",!0),e.hasMoreMessages||e.loadingMore?(x(),E("div",{key:2,ref_key:"topSentinelRef",ref:r,class:We(["top-sentinel",{"top-sentinel-loading":e.loadingMore}])},[e.loadingMore?(x(),E("span",Zre,[fe(Hs,{size:"sm"}),nt(" "+R(C(o)("conversation.loadingOlder")),1)])):(x(),E("button",{key:0,type:"button",class:"top-sentinel-btn",onClick:Ee[0]||(Ee[0]=ae=>d("loadOlderMessages"))},R(C(o)("conversation.loadOlder")),1))],2)):ue("",!0),(x(!0),E(Pe,null,lt(e.turns,(ae,Y)=>(x(),E(Pe,{key:ae.id},[ae.role==="user"?(x(),E("div",Xre,[_("div",{class:We(["u-bub turn-anchor",{undoing:M.value===ae.id}]),"data-turn-id":ae.id},[ae.attachments&&ae.attachments.length>0?(x(),E("div",Jre,[(x(!0),E(Pe,null,lt(ae.attachments,(Q,P)=>(x(),Ae($E,{key:P,kind:Q.kind,name:Q.name,url:Q.url,"file-id":Q.fileId,"media-type":Q.mediaType,size:Q.size,onActivate:G=>re(Q)},null,8,["kind","name","url","file-id","media-type","size","onActivate"]))),128))])):ue("",!0),ae.skillActivation?(x(),E("div",ele,[_("div",tle,[Ee[9]||(Ee[9]=_("span",{class:"skill-act-arrow"},"▶",-1)),_("span",null,R(C(o)("conversation.activatedSkill",{name:ae.skillActivation.name})),1)]),ae.skillActivation.args?(x(),E("div",nle,R(ae.skillActivation.args),1)):ue("",!0)])):ae.pluginCommand?(x(),E("div",ole,[_("div",sle,[Ee[10]||(Ee[10]=_("span",{class:"skill-act-arrow"},"▶",-1)),_("span",null,"/"+R(ae.pluginCommand.pluginId)+":"+R(ae.pluginCommand.commandName),1)]),ae.pluginCommand.args?(x(),E("div",ile,R(ae.pluginCommand.args),1)):ue("",!0)])):(x(),E("div",rle,R(ae.text),1))],10,Qre),ae.createdAt||A(ae)?(x(),E("div",lle,[A(ae)?(x(),E("div",{key:0,class:We(["u-edit-wrap",{undoing:M.value===ae.id}])},[_("button",{type:"button",class:"u-edit","aria-label":C(o)("conversation.undoTooltip"),onClick:Q=>N(ae)},[fe(Ye,{name:"undo",size:"sm"})],8,ale)],2)):ue("",!0),ae.text.trim().length>0?(x(),E("button",{key:1,type:"button",class:"u-copy","aria-label":C(o)("filePreview.copy"),onClick:Ct(Q=>q(ae),["stop"])},[T.value!==ae.id?(x(),Ae(Ye,{key:0,name:"copy",size:"sm"})):(x(),Ae(Ye,{key:1,name:"check",size:"sm"}))],8,cle)):ue("",!0),ae.createdAt?(x(),Ae(xE,{key:2,time:ae.createdAt},null,8,["time"])):ue("",!0)])):ue("",!0)])):ae.role==="compaction"?(x(),E("div",{key:1,class:"compact-divider turn-anchor","data-turn-id":ae.id,role:"separator"},[Ee[11]||(Ee[11]=_("span",{class:"cd-line","aria-hidden":"true"},null,-1)),ae.text?(x(),E("button",{key:0,type:"button",class:"cd-label cd-btn",onClick:Q=>d("openCompaction",{turnId:ae.id})},[_("span",null,R(I(ae)),1),_("span",fle,R(C(o)("conversation.viewSummary")),1)],8,dle)):(x(),E("span",hle,R(I(ae)),1)),Ee[12]||(Ee[12]=_("span",{class:"cd-line","aria-hidden":"true"},null,-1))],8,ule)):ae.role==="cron"?(x(),Ae(sie,{key:2,text:ae.text,cron:ae.cron,"turn-id":ae.id,"created-at":ae.createdAt},null,8,["text","cron","turn-id","created-at"])):(x(),E("div",{key:3,class:"a-msg turn-anchor","data-turn-id":ae.id},[(x(!0),E(Pe,null,lt(C(BU)(ae),(Q,P)=>(x(),E(Pe,{key:C(HU)(Q,P)},[Q.kind==="thinking"?(x(),Ae(Bse,{key:0,text:Q.thinking,mobile:"",streaming:we(ae,Q),onOpen:G=>d("openThinking",{turnId:ae.id,blockIndex:Q.sourceIndex})},null,8,["text","streaming","onOpen"])):Q.kind==="text"&&Q.text?(x(),E("div",mle,[fe(G1,{text:Q.text,streaming:we(ae,Q),"open-file":G=>d("openFile",G)},null,8,["text","streaming","open-file"])])):Q.kind==="tool-stack"?(x(),Ae(KU,{key:2,tools:Q.tools,mobile:"","tool-diff-panel":e.toolDiffPanel,onOpenMedia:Ee[1]||(Ee[1]=G=>d("openMedia",G)),onOpenFile:Ee[2]||(Ee[2]=G=>d("openFile",G)),onOpenToolDiff:Ee[3]||(Ee[3]=G=>d("openToolDiff",G)),onOpenAgent:Ee[4]||(Ee[4]=G=>d("openAgent",G))},null,8,["tools","tool-diff-panel"])):Q.kind==="tool"?(x(),Ae(v6,{key:3,tool:Q.tool,mobile:"","tool-diff-panel":e.toolDiffPanel,onOpenMedia:Ee[5]||(Ee[5]=G=>d("openMedia",G)),onOpenFile:Ee[6]||(Ee[6]=G=>d("openFile",G)),onOpenToolDiff:Ee[7]||(Ee[7]=G=>d("openToolDiff",G)),onOpenAgent:Ee[8]||(Ee[8]=G=>d("openAgent",G))},null,8,["tool","tool-diff-panel"])):ue("",!0)],64))),128)),ae.id!==c.value&&Z(Y)&&(L(Y).trim().length>0||ae.durationMs!==void 0)?(x(),E("div",gle,[fe(rn,{text:`${ae.durationMs} ms`},{default:Le(()=>[ae.durationMs!==void 0?(x(),E("span",vle,R(C(FU)(ae.durationMs)),1)):ue("",!0)]),_:2},1032,["text"]),L(Y).trim().length>0?(x(),E("button",{key:0,class:"a-cpbtn","aria-label":C(o)("filePreview.copy"),onClick:Q=>U(Y)},[T.value!==ae.id?(x(),Ae(Ye,{key:0,name:"copy",size:"sm"})):(x(),Ae(Ye,{key:1,name:"check",size:"sm"}))],8,yle)):ue("",!0)])):ue("",!0)],8,ple))],64))),128)),e.compaction?(x(),Ae(zse,{key:3,label:C(o)("conversation.compacting")},null,8,["label"])):ue("",!0),u.value?(x(),E("div",kle,[fe(FE,{fast:e.fastMoon},null,8,["fast"])])):ue("",!0),e.queued.length>0?(x(),E("div",ble,[_("div",xle,[_("span",wle,[fe(Ye,{name:"mail",size:"sm"}),nt(" "+R(C(o)("composer.queueLabel"))+" · ",1),_("b",null,R(e.queued.length),1)]),_("span",_le,R(C(o)("composer.queueAutoDrain")),1)]),(x(!0),E(Pe,null,lt(e.queued,(ae,Y)=>(x(),E("div",{key:Y,class:We(["u-turn q-turn",{"q-dragging":f.value===Y,"drop-before":h.value?.index===Y&&h.value.position==="before","drop-after":h.value?.index===Y&&h.value.position==="after"}]),onDragover:Q=>k(Y,Q),onDrop:Q=>g(Y,Q)},[_("div",Cle,[_("span",{class:"q-grip",title:C(o)("composer.queueDragTitle"),draggable:"true",onDragstart:Q=>y(Y,Q),onDragend:v},[fe(Ye,{name:"grip",size:"sm"})],40,Ale),_("button",{type:"button",class:"q-body",title:C(o)("composer.editQueued"),onClick:Q=>m(Y)},[ae.text?(x(),E("span",Ele,R(ae.text),1)):(x(),E("span",Tle,[fe(Ye,{name:"file",size:"sm"}),nt(" "+R(C(o)("composer.queuedAttachments",{n:ae.attachments?.length??0})),1)]))],8,Mle),p(ae)?(x(),E("div",Nle,[(x(!0),E(Pe,null,lt(ae.attachments,(Q,P)=>(x(),E(Pe,{key:P},[Q.kind==="file"?(x(),E("span",Ile,[fe(Ye,{name:"file",size:"sm"}),nt(" "+R(Q.name??Q.fileId),1)])):(x(),Ae(LE,{key:1,url:Q.url,kind:Q.kind,"file-id":Q.fileId,"media-class":"q-img",controls:!1,muted:""},null,8,["url","kind","file-id"]))],64))),128))])):ue("",!0),Y===0?(x(),E("span",Lle,R(C(o)("composer.queueNext")),1)):(x(),E("span",$le,"#"+R(Y+1),1)),_("button",{type:"button",class:"q-rm","aria-label":C(o)("composer.remove"),onClick:Ct(Q=>d("unqueue",Y),["stop"])},[fe(Ye,{name:"close",size:"sm"})],8,Fle)])],42,Sle))),128))])):ue("",!0)]),le.value!==null?(x(),E("div",Ole,R(C(o)("composer.attachmentOpenUnsupported",{name:le.value})),1)):ue("",!0)],64))}}),RE=ft(Ble,[["__scopeId","data-v-10ab1f89"]]),Dle={class:"ch-id"},Ple={key:0,class:"ch-ws"},Hle={key:1,class:"ch-sep"},Wle=["onKeydown"],zle={class:"ch-ses"},Ule={key:0,class:"ch-pill ch-sync-pill"},qle={key:0,class:"ch-ahead"},jle={key:1,class:"ch-behind"},Vle={key:1,class:"ch-pill ch-diff-pill"},Kle={key:0,class:"ch-add"},Gle={key:1,class:"ch-del"},Yle=Qe({__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","exportSession"],setup(e,{emit:t}){const{t:n}=Ot(),o=e,s=t,i=D(()=>o.ahead??0),r=D(()=>o.behind??0),l=D(()=>o.gitDiffStats?.totalAdditions??0),a=D(()=>o.gitDiffStats?.totalDeletions??0),c=D(()=>l.value>0||a.value>0),u={open:"header.prStatusOpen",closed:"header.prStatusClosed",merged:"header.prStatusMerged",draft:"header.prStatusDraft"};function d(Z){return Z.trim().toLowerCase().replaceAll("_","-")}function f(Z){const ie=d(Z);return u[ie]?`pr-${ie}`:"pr-unknown"}function h(Z){return n(u[d(Z)]??"header.prStatusUnknown")}const p=ne(!1),m=ne(null),y=ne(null),k=ne({});function g(Z){const ie=Z.target;y.value?.el?.contains(ie)||m.value?.el?.contains(ie)||A()}function v(){A()}async function b(Z){if(Z.stopPropagation(),p.value){A();return}p.value=!0,document.addEventListener("mousedown",g),window.addEventListener("resize",v),await kt();const ie=m.value?.el,U=y.value?.el;if(!ie||!U)return;const q=ie.getBoundingClientRect(),ee=4,le=8,oe=U.offsetWidth,re=U.offsetHeight;let we=q.bottom+ee;we+re>window.innerHeight-le&&(we=Math.max(le,q.top-re-ee));let me=q.left;me+oe>window.innerWidth-le&&(me=Math.max(le,q.right-oe)),k.value={top:`${Math.round(we)}px`,left:`${Math.round(me)}px`}}function A(){p.value=!1,document.removeEventListener("mousedown",g),window.removeEventListener("resize",v)}In(()=>{document.removeEventListener("mousedown",g),window.removeEventListener("resize",v)});function I(){s("copyAll"),A()}function T(){s("copyFinalSummary"),A()}const M=ne(!1);function $(){o.sessionId&&Xo(o.sessionId).then(Z=>{Z&&(M.value=!0,setTimeout(()=>{M.value=!1},1200))})}const N=ne(!1),F=ne(""),S=ne(null);async function B(){if(A(),!!o.sessionId){N.value=!0,F.value=o.sessionTitle??"",await kt();try{S.value?.focus(),S.value?.select()}catch{}}}function W(){const Z=F.value.trim();Z&&o.sessionId&&Z!==(o.sessionTitle??"").trim()&&s("renameSession",o.sessionId,Z),N.value=!1}function z(){N.value=!1}function L(){o.sessionId&&(A(),s("forkSession",o.sessionId))}function O(){o.sessionId&&(A(),s("exportSession",o.sessionId))}function j(){o.sessionId&&(A(),s("archiveSession",o.sessionId))}return(Z,ie)=>(x(),E("header",{class:We(["chat-header",{"macos-desktop":C(su)}])},[_("div",Dle,[e.workspaceName?(x(),E("span",Ple,R(e.workspaceName),1)):ue("",!0),e.workspaceName&&e.sessionTitle?(x(),E("span",Hle,"/")):ue("",!0),N.value?Wn((x(),E("input",{key:2,ref_key:"renameInputRef",ref:S,"onUpdate:modelValue":ie[0]||(ie[0]=U=>F.value=U),class:"ch-rename",type:"text",onKeydown:[ur(Ct(W,["stop"]),["enter"]),ur(Ct(z,["stop"]),["esc"])],onBlur:W,onClick:ie[1]||(ie[1]=Ct(()=>{},["stop"]))},null,40,Wle)),[[ws,F.value]]):e.sessionTitle?(x(),Ae(rn,{key:3,text:e.sessionTitle},{default:Le(()=>[_("span",zle,R(e.sessionTitle),1)]),_:1},8,["text"])):ue("",!0)]),fe(Kn,{ref_key:"kebabRef",ref:m,class:We(["ch-act-more",{open:p.value}]),label:C(n)("header.options"),"aria-expanded":p.value,"aria-haspopup":"menu",onClick:ie[2]||(ie[2]=Ct(U=>b(U),["stop"]))},{default:Le(()=>[fe(Ye,{name:"dots-horizontal",size:"md"})]),_:1},8,["class","label","aria-expanded"]),p.value?(x(),Ae(Ra,{key:0,ref_key:"menuRef",ref:y,class:"ch-menu",style:tn(k.value),onClick:ie[3]||(ie[3]=Ct(()=>{},["stop"]))},{default:Le(()=>[fe(Tn,{onClick:I},{default:Le(()=>[fe(Ye,{name:e.copied?"check":"copy",size:"sm"},null,8,["name"]),nt(" "+R(e.copied?C(n)("header.copied"):C(n)("header.copyAll")),1)]),_:1}),fe(Tn,{onClick:T},{default:Le(()=>[fe(Ye,{name:"file-text",size:"sm"}),nt(" "+R(C(n)("header.copyFinalSummary")),1)]),_:1}),e.sessionId?(x(),E(Pe,{key:0},[fe(Tn,{separator:""}),fe(Tn,{onClick:$},{default:Le(()=>[fe(Ye,{name:M.value?"check":"copy",size:"sm"},null,8,["name"]),nt(" "+R(M.value?C(n)("header.copied"):C(n)("header.copySessionId")),1)]),_:1}),fe(Tn,{onClick:B},{default:Le(()=>[fe(Ye,{name:"pencil",size:"sm"}),nt(" "+R(C(n)("header.renameSession")),1)]),_:1}),fe(Tn,{onClick:L},{default:Le(()=>[fe(Ye,{name:"git-fork",size:"sm"}),nt(" "+R(C(n)("header.forkSession")),1)]),_:1}),fe(Tn,{onClick:O},{default:Le(()=>[fe(Ye,{name:"download",size:"sm"}),nt(" "+R(C(n)("header.exportSession")),1)]),_:1}),fe(Tn,{danger:"",onClick:j},{default:Le(()=>[fe(Ye,{name:"archive",size:"sm"}),nt(" "+R(C(n)("header.archiveSession")),1)]),_:1})],64)):ue("",!0)]),_:1},8,["style"])):ue("",!0),ie[6]||(ie[6]=_("div",{class:"ch-spacer"},null,-1)),e.isGitRepo?(x(),E("button",{key:1,type:"button",class:"ch-git",onClick:ie[4]||(ie[4]=U=>s("openChanges"))},[_("span",{class:We(["ch-branch",{"ch-detached":!e.branch}])},R(e.branch||C(n)("header.detached")),3),i.value>0||r.value>0?(x(),E("span",Ule,[i.value>0?(x(),E("span",qle,"↑"+R(i.value),1)):ue("",!0),r.value>0?(x(),E("span",jle,"↓"+R(r.value),1)):ue("",!0)])):ue("",!0),c.value?(x(),E("span",Vle,[l.value>0?(x(),E("span",Kle,"+"+R(l.value),1)):ue("",!0),a.value>0?(x(),E("span",Gle,"-"+R(a.value),1)):ue("",!0)])):ue("",!0)])):ue("",!0),e.pr?(x(),E("button",{key:2,type:"button",class:We(["ch-pill ch-pr",f(e.pr.state)]),onClick:ie[5]||(ie[5]=U=>e.pr&&s("openPr",e.pr.url))},[fe(Ye,{name:"git-pull-request",size:"sm"}),_("span",null,"PR #"+R(e.pr.number)+" · "+R(h(e.pr.state)),1)],2)):ue("",!0)],2))}}),Zle=ft(Yle,[["__scopeId","data-v-999779db"]]),Xle=["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"],v3=[[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 Qle(e){if(e<=255)return Xle[e];let t=0,n=v3.length-1;for(;t<=n;){const o=t+n>>1,s=v3[o];if(e<s[0]){n=o-1;continue}if(e>s[1]){t=o+1;continue}return s[2]}return"L"}function Jle(e){const t=e.length;if(t===0)return null;const n=new Array(t);let o=!1;for(let c=0;c<t;){const u=e.charCodeAt(c);let d=u,f=1;if(u>=55296&&u<=56319&&c+1<t){const p=e.charCodeAt(c+1);p>=56320&&p<=57343&&(d=(u-55296<<10)+(p-56320)+65536,f=2)}const h=Qle(d);(h==="R"||h==="AL"||h==="AN")&&(o=!0);for(let p=0;p<f;p++)n[c+p]=h;c+=f}if(!o)return null;let s=0;for(let c=0;c<t;c++){const u=n[c];if(u==="L"){s=0;break}if(u==="R"||u==="AL"){s=1;break}}const i=new Int8Array(t);for(let c=0;c<t;c++)i[c]=s;const r=s&1?"R":"L",l=r;let a=l;for(let c=0;c<t;c++)n[c]==="NSM"?n[c]=a:a=n[c];a=l;for(let c=0;c<t;c++){const u=n[c];u==="EN"?n[c]=a==="AL"?"AN":"EN":(u==="R"||u==="L"||u==="AL")&&(a=u)}for(let c=0;c<t;c++)n[c]==="AL"&&(n[c]="R");for(let c=1;c<t-1;c++)n[c]==="ES"&&n[c-1]==="EN"&&n[c+1]==="EN"&&(n[c]="EN"),n[c]==="CS"&&(n[c-1]==="EN"||n[c-1]==="AN")&&n[c+1]===n[c-1]&&(n[c]=n[c-1]);for(let c=0;c<t;c++){if(n[c]!=="EN")continue;let u;for(u=c-1;u>=0&&n[u]==="ET";u--)n[u]="EN";for(u=c+1;u<t&&n[u]==="ET";u++)n[u]="EN"}for(let c=0;c<t;c++){const u=n[c];(u==="WS"||u==="ES"||u==="ET"||u==="CS")&&(n[c]="ON")}a=l;for(let c=0;c<t;c++){const u=n[c];u==="EN"?n[c]=a==="L"?"L":"EN":(u==="R"||u==="L")&&(a=u)}for(let c=0;c<t;c++){if(n[c]!=="ON")continue;let u=c+1;for(;u<t&&n[u]==="ON";)u++;const d=c>0?n[c-1]:l,f=u<t?n[u]:l,h=d!=="L"?"R":"L";if(h===(f!=="L"?"R":"L"))for(let m=c;m<u;m++)n[m]=h;c=u-1}for(let c=0;c<t;c++)n[c]==="ON"&&(n[c]=r);for(let c=0;c<t;c++){const u=n[c];(i[c]&1)===0?u==="R"?i[c]++:(u==="AN"||u==="EN")&&(i[c]+=2):(u==="L"||u==="AN"||u==="EN")&&i[c]++}return i}function eae(e,t){const n=Jle(e);if(n===null)return null;const o=new Int8Array(t.length);for(let s=0;s<t.length;s++)o[s]=n[t[s]];return o}const tae=/[ \t\n\r\f]+/g,nae=/[\t\n\r\f]| {2,}|^ | $/;function oae(e){const t=e??"normal";return t==="pre-wrap"?{mode:t,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:t,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function sae(e){if(!nae.test(e))return e;let t=e.replace(tae," ");return t.charCodeAt(0)===32&&(t=t.slice(1)),t.length>0&&t.charCodeAt(t.length-1)===32&&(t=t.slice(0,-1)),t}function iae(e){return/[\r\f]/.test(e)?e.replace(/\r\n/g,`
|
|
306
|
-
`).replace(/[\r\f]/g,`
|
|
307
|
-
`):e}let Av=null,rae;function lae(){return Av===null&&(Av=new Intl.Segmenter(rae,{granularity:"word"})),Av}const aae=/\p{Script=Arabic}/u,Zl=/\p{M}/u,Q2=/\p{Nd}/u;function y3(e){return aae.test(e)}function k3(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>=12592&&e<=12687||e>=44032&&e<=55215||e>=65280&&e<=65519}function mr(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 o=e.charCodeAt(t+1);if(o>=56320&&o<=57343){const s=(n-55296<<10)+(o-56320)+65536;if(k3(s))return!0;t++;continue}}if(k3(n))return!0}}return!1}function cae(e){const t=Uf(e);return t!==null&&(J2.has(t)||Ga.has(t))}const uae=new Set([" "," ","","\uFEFF"]),dae=new Set(["-","‐","–","—"]);function fae(e){const t=Uf(e);return t!==null&&uae.has(t)}function hae(e){const t=Uf(e);return t!==null&&dae.has(t)}function BE(e,t){return fae(e)?!1:t?!(cae(e)||hae(e)):!0}const J2=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),Y1=new Set(['"',"(","[","{","¡","¿","“","‘","‚","„","«","‹","⸘","(","〔","〈","《","「","『","【","〖","〘","〚"]),eb=new Set(["'","’"]),Ga=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),pae=new Set([":",".","،","؛"]),mae=new Set(["၏"]),gae=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function vae(e){if(tb(e))return!0;let t=!1;for(const n of e){if(Ga.has(n)||X1(n)){t=!0;continue}if(!(t&&Zl.test(n)))return!1}return t}function yae(e){for(const t of e)if(!J2.has(t)&&!Ga.has(t))return!1;return e.length>0}function kae(e){if(tb(e))return!0;for(const t of e)if(!Y1.has(t)&&!eb.has(t)&&!Zl.test(t)&&!X1(t))return!1;return e.length>0}function tb(e){let t=!1;for(const n of e)if(!(n==="\\"||Zl.test(n))){if(Y1.has(n)||Ga.has(n)||eb.has(n)){t=!0;continue}return!1}return t}function Z1(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const o=e.charCodeAt(n);if(o<56320||o>57343)return n;const s=n-1;if(s<0)return n;const i=e.charCodeAt(s);return i>=55296&&i<=56319?s:n}function Uf(e){if(e.length===0)return null;const t=Z1(e,e.length);return e.slice(t)}function bae(e){for(const t of e)if(!Zl.test(t))return t;return null}function xae(e){for(let t=e.length;t>0;){const n=Z1(e,t),o=e.slice(n,t);if(!Zl.test(o))return o;t=n}return null}const wae=[36,37,43,43,92,92,162,165,176,177,1423,1423,1545,1547,1642,1642,2046,2047,2546,2547,2553,2555,2801,2801,3065,3065,3449,3449,3647,3647,6107,6107,8240,8247,8279,8279,8352,8399,8451,8451,8457,8457,8470,8470,8722,8723,43064,43064,65020,65020,65129,65130,65284,65285,65504,65505,65509,65510,73693,73696,123647,123647,126124,126124,126128,126128];function _ae(e,t){for(let n=0;n<t.length;n+=2)if(e>=t[n]&&e<=t[n+1])return!0;return!1}function X1(e){const t=e.codePointAt(0);return t!==void 0&&_ae(t,wae)}function Sae(e){const t=xae(e);return t!==null&&X1(t)}function Cae(e){const t=bae(e);return t!==null&&Q2.test(t)}function Aae(e){const t=Array.from(e);let n=t.length;for(;n>0;){const o=t[n-1];if(Zl.test(o)){n--;continue}if(Y1.has(o)||eb.has(o)){n--;continue}break}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function Mae(e,t,n){return n==="text"&&!t&&e.length===1&&e!=="-"&&e!=="—"?e:null}function b3(e,t,n,o){const s=t[o],i=e[o];if(s==null)return i;const r=n[o];if(i.length===r)return i;const l=s.repeat(r);return e[o]=l,l}function x3(e,t){return e&&t!==null&&pae.has(t)}function Eae(e){const t=Uf(e);return t!==null&&mae.has(t)}function Tae(e){if(e.length<2||e[0]!==" ")return null;const t=e.slice(1);return/^\p{M}+$/u.test(t)?{space:" ",marks:t}:null}function ik(e){let t=e.length;for(;t>0;){const n=Z1(e,t),o=e.slice(n,t);if(gae.has(o))return!0;if(!Ga.has(o))return!1;t=n}return!1}function Nae(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
|
|
308
|
-
`)return"hard-break"}return e===" "?"space":e===" "||e===" "||e===""||e==="\uFEFF"?"glue":e===""?"zero-width-break":e===""?"soft-hyphen":"text"}const Iae=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function ji(e){return e.length===1?e[0]:e.join("")}function Lae(e,t){const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);return n.push(t),ji(n)}function $ae(e,t,n,o){if(!Iae.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const s=[];let i=null,r=[],l=n,a=!1,c=0;for(const u of e){const d=Nae(u,o),f=d==="text"&&t;if(i!==null&&d===i&&f===a){r.push(u),c+=u.length;continue}i!==null&&s.push({text:ji(r),isWordLike:a,kind:i,start:l}),i=d,r=[u],l=n+c,a=f,c+=u.length}return i!==null&&s.push({text:ji(r),isWordLike:a,kind:i,start:l}),s}function rk(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const Fae=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function Oae(e,t){const n=e.texts[t];return n.startsWith("www.")?!0:Fae.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function Rae(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}function Bae(e){const t=e.texts.slice(),n=e.isWordLike.slice(),o=e.kinds.slice(),s=e.starts.slice();for(let r=0;r<e.len;r++){if(o[r]!=="text"||!Oae(e,r))continue;const l=[t[r]];let a=r+1;for(;a<e.len&&!rk(o[a]);){l.push(t[a]),n[r]=!0;const c=t[a].includes("?");if(o[a]="text",t[a]="",a++,c)break}t[r]=ji(l)}let i=0;for(let r=0;r<t.length;r++){const l=t[r];l.length!==0&&(i!==r&&(t[i]=l,n[i]=n[r],o[i]=o[r],s[i]=s[r]),i++)}return t.length=i,n.length=i,o.length=i,s.length=i,{len:i,texts:t,isWordLike:n,kinds:o,starts:s}}function Dae(e){const t=[],n=[],o=[],s=[];for(let i=0;i<e.len;i++){const r=e.texts[i];if(t.push(r),n.push(e.isWordLike[i]),o.push(e.kinds[i]),s.push(e.starts[i]),!Rae(r))continue;const l=i+1;if(l>=e.len||rk(e.kinds[l]))continue;const a=[],c=e.starts[l];let u=l;for(;u<e.len&&!rk(e.kinds[u]);)a.push(e.texts[u]),u++;a.length>0&&(t.push(ji(a)),n.push(!0),o.push("text"),s.push(c),i=u-1)}return{len:t.length,texts:t,isWordLike:n,kinds:o,starts:s}}const Pae=new Set([":","-","/","×",",",".","+","–","—"]),Hae=/[\p{P}\p{S}\p{Co}]/u,Wae=/\p{Emoji_Presentation}/u,zae=new Set(["?","֊","-","‐","‒","–","—","…","‼","‽","⁉"]);function Uae(e){return e>=33&&e<=47&&e!==45||e>=58&&e<=64&&e!==63||e>=91&&e<=96||e>=123&&e<=126}function DE(e){const t=e.charCodeAt(0);return t<128?Uae(t):!zae.has(e)&&!Wae.test(e)&&Hae.test(e)}function w3(e){let t=!1;for(const n of e)if(!Zl.test(n)){if(!DE(n))return!1;t=!0}return t}function qae(e){for(let t=e.length;t>0;){const n=Z1(e,t),o=e.slice(n,t);if(Zl.test(o)){t=n;continue}return DE(o)||X1(o)}return!1}function jae(e,t,n,o){const s=!t&&w3(e),i=!o&&w3(n),r=Sae(e),l=(t||r)&&qae(e);return!s&&!i&&!l||mr(e)||mr(n)?!1:(t||s||r)&&(o||i)}function PE(e){for(const t of e)if(Q2.test(t))return!0;return!1}function zm(e){if(e.length===0)return!1;for(const t of e)if(!(Q2.test(t)||Pae.has(t)))return!1;return!0}function Vae(e){const t=[],n=[],o=[],s=[];for(let i=0;i<e.len;i++){const r=e.texts[i],l=e.kinds[i];if(l==="text"&&zm(r)&&PE(r)){const a=[r];let c=i+1;for(;c<e.len&&e.kinds[c]==="text"&&zm(e.texts[c]);)a.push(e.texts[c]),c++;t.push(ji(a)),n.push(!0),o.push("text"),s.push(e.starts[i]),i=c-1;continue}t.push(r),n.push(e.isWordLike[i]),o.push(l),s.push(e.starts[i])}return{len:t.length,texts:t,isWordLike:n,kinds:o,starts:s}}function Kae(e){const t=[],n=[],o=[],s=[];let i=0;for(;i<e.len;){const r=e.texts[i],l=e.kinds[i],a=e.isWordLike[i];if(l==="text"){const c=[r];let u=i+1,d=a;for(;u<e.len&&e.kinds[u]==="text"&&jae(e.texts[u-1],e.isWordLike[u-1],e.texts[u],e.isWordLike[u]);){const f=e.texts[u];c.push(f),d=d||e.isWordLike[u],u++}if(u>i+1){t.push(ji(c)),n.push(d),o.push("text"),s.push(e.starts[i]),i=u;continue}}t.push(r),n.push(a),o.push(l),s.push(e.starts[i]),i++}return{len:t.length,texts:t,isWordLike:n,kinds:o,starts:s}}function Gae(e){const t=[],n=[],o=[],s=[];for(let i=0;i<e.len;i++){const r=e.texts[i];if(e.kinds[i]==="text"&&r.includes("-")){const l=r.split("-");let a=l.length>1;for(let c=0;c<l.length;c++){const u=l[c];if(!a)break;(u.length===0||!PE(u)||!zm(u))&&(a=!1)}if(a){let c=0;for(let u=0;u<l.length;u++){const d=l[u],f=u<l.length-1?`${d}-`:d;t.push(f),n.push(!0),o.push("text"),s.push(e.starts[i]+c),c+=f.length}continue}}t.push(r),n.push(e.isWordLike[i]),o.push(e.kinds[i]),s.push(e.starts[i])}return{len:t.length,texts:t,isWordLike:n,kinds:o,starts:s}}function Yae(e){const t=[],n=[],o=[],s=[];let i=0;for(;i<e.len;){const r=[e.texts[i]];let l=e.isWordLike[i],a=e.kinds[i],c=e.starts[i];if(a==="glue"){const u=[r[0]],d=c;for(i++;i<e.len&&e.kinds[i]==="glue";)u.push(e.texts[i]),i++;const f=ji(u);if(i<e.len&&e.kinds[i]==="text")r[0]=f,r.push(e.texts[i]),l=e.isWordLike[i],a="text",c=d,i++;else{t.push(f),n.push(!1),o.push("glue"),s.push(d);continue}}else i++;if(a==="text")for(;i<e.len&&e.kinds[i]==="glue";){const u=[];for(;i<e.len&&e.kinds[i]==="glue";)u.push(e.texts[i]),i++;const d=ji(u);if(i<e.len&&e.kinds[i]==="text"){r.push(d,e.texts[i]),l=l||e.isWordLike[i],i++;continue}r.push(d)}t.push(ji(r)),n.push(l),o.push(a),s.push(c)}return{len:t.length,texts:t,isWordLike:n,kinds:o,starts:s}}function Zae(e){const t=e.texts.slice(),n=e.isWordLike.slice(),o=e.kinds.slice(),s=e.starts.slice();for(let i=0;i<t.length-1;i++){if(o[i]!=="text"||o[i+1]!=="text"||!mr(t[i])||!mr(t[i+1]))continue;const r=Aae(t[i]);r!==null&&(t[i]=r.head,t[i+1]=r.tail+t[i+1],s[i+1]=s[i]+r.head.length)}return{len:t.length,texts:t,isWordLike:n,kinds:o,starts:s}}function Xae(e,t,n){const o=lae();let s=0;const i=[],r=[],l=[],a=[],c=[],u=[],d=[],f=[],h=[],p=[],m=[],y=[];for(const I of o.segment(e))for(const T of $ae(I.segment,I.isWordLike??!1,I.index,n)){let L=function(){u[z]!==null&&(r[z]=[b3(i,u,d,z)],u[z]=null),r[z].push(T.text),l[z]=l[z]||T.isWordLike,f[z]=f[z]||N,h[z]=h[z]||F,p[z]=B,m[z]=W,y[z]=x3(h[z],S)};const M=T.kind==="text",$=Mae(T.text,T.isWordLike,T.kind),N=mr(T.text),F=y3(T.text),S=Uf(T.text),B=ik(T.text),W=Eae(T.text),z=s-1;t.carryCJKAfterClosingQuote&&M&&s>0&&a[z]==="text"&&N&&f[z]&&p[z]||M&&s>0&&a[z]==="text"&&yae(T.text)&&f[z]||M&&s>0&&a[z]==="text"&&m[z]?L():M&&s>0&&a[z]==="text"&&T.isWordLike&&F&&y[z]?(L(),l[z]=!0):$!==null&&s>0&&a[z]==="text"&&u[z]===$?d[z]=(d[z]??1)+1:M&&!T.isWordLike&&s>0&&a[z]==="text"&&!f[z]&&(vae(T.text)||T.text==="-"&&l[z])?L():(i[s]=T.text,r[s]=[T.text],l[s]=T.isWordLike,a[s]=T.kind,c[s]=T.start,u[s]=$,d[s]=$===null?0:1,f[s]=N,h[s]=F,p[s]=B,m[s]=W,y[s]=x3(F,S),s++)}for(let I=0;I<s;I++){if(u[I]!==null){i[I]=b3(i,u,d,I);continue}i[I]=ji(r[I])}for(let I=1;I<s;I++)a[I]==="text"&&!l[I]&&tb(i[I])&&a[I-1]==="text"&&!f[I-1]&&(i[I-1]+=i[I],l[I-1]=l[I-1]||l[I],i[I]="");const k=Array.from({length:s},()=>null);let g=-1;for(let I=s-1;I>=0;I--){const T=i[I];if(T.length!==0){if(a[I]==="text"&&!l[I]&&g>=0&&a[g]==="text"&&(kae(T)||T==="-"&&Cae(i[g]))){const M=k[g]??[];M.push(T),k[g]=M,c[g]=c[I],i[I]="";continue}g=I}}for(let I=0;I<s;I++){const T=k[I];T!=null&&(i[I]=Lae(T,i[I]))}let v=0;for(let I=0;I<s;I++){const T=i[I];T.length!==0&&(v!==I&&(i[v]=T,l[v]=l[I],a[v]=a[I],c[v]=c[I]),v++)}i.length=v,l.length=v,a.length=v,c.length=v;const b=Yae({len:v,texts:i,isWordLike:l,kinds:a,starts:c}),A=Zae(Kae(Gae(Vae(Dae(Bae(b))))));for(let I=0;I<A.len-1;I++){const T=Tae(A.texts[I]);T!==null&&(A.kinds[I]!=="space"&&A.kinds[I]!=="preserved-space"||A.kinds[I+1]!=="text"||!y3(A.texts[I+1])||(A.texts[I]=T.space,A.isWordLike[I]=!1,A.kinds[I]=A.kinds[I]==="preserved-space"?"preserved-space":"space",A.texts[I+1]=T.marks+A.texts[I+1],A.starts[I+1]=A.starts[I]+T.space.length))}return A}function Qae(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let o=0;for(let s=0;s<e.len;s++)e.kinds[s]==="hard-break"&&(n.push({startSegmentIndex:o,endSegmentIndex:s,consumedEndSegmentIndex:s+1}),o=s+1);return o<e.len&&n.push({startSegmentIndex:o,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}function Jae(e,t,n){if(t.len<=1)return t;const o=[],s=[],i=[],r=[];let l=-1,a=!1;function c(f){o.push(t.texts[f]),s.push(t.isWordLike[f]),i.push("text"),r.push(t.starts[f])}function u(f,h){let p=!1;for(let k=f;k<h;k++)p=p||t.isWordLike[k];const m=t.starts[f],y=h<t.len?t.starts[h]:e.length;o.push(e.slice(m,y)),s.push(p),i.push("text"),r.push(m)}function d(f){if(!(l<0)){if(a)l+1===f?c(l):u(l,f);else for(let h=l;h<f;h++)c(h);l=-1,a=!1}}for(let f=0;f<t.len;f++){const h=t.texts[f],p=t.kinds[f];if(p==="text"){l>=0&&!BE(t.texts[f-1],n)&&d(f),l<0&&(l=f),a=a||mr(h);continue}d(f),o.push(h),s.push(t.isWordLike[f]),i.push(p),r.push(t.starts[f])}return d(t.len),{len:o.length,texts:o,isWordLike:s,kinds:i,starts:r}}function ece(e,t,n="normal",o="normal"){const s=oae(n),i=s.mode==="pre-wrap"?iae(e):sae(e);if(i.length===0)return{normalized:i,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const r=Xae(i,t,s),l=o==="keep-all"?Jae(i,r,t.breakKeepAllAfterPunctuation):r;return{normalized:i,chunks:Qae(l,s),...l}}let Ic=null;const _3=new Map;let Lc=null;const tce=96,nce=/\p{Emoji_Presentation}/u,oce=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let Mv=null;const S3=new Map;function nb(){if(Ic!==null)return Ic;if(typeof OffscreenCanvas<"u")return Ic=new OffscreenCanvas(1,1).getContext("2d"),Ic;if(typeof document<"u")return Ic=document.createElement("canvas").getContext("2d"),Ic;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function sce(e){let t=_3.get(e);return t||(t=new Map,_3.set(e,t)),t}function Tl(e,t){let n=t.get(e);return n===void 0&&(n={width:nb().measureText(e).width,containsCJK:mr(e)},t.set(e,n)),n}function Q1(){if(Lc!==null)return Lc;if(typeof navigator>"u")return Lc={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,breakKeepAllAfterPunctuation:!0,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},Lc;const e=navigator.userAgent,n=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),o=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return Lc={lineFitEpsilon:n?1/64:.005,carryCJKAfterClosingQuote:o,breakKeepAllAfterPunctuation:!n,preferPrefixWidthsForBreakableRuns:n,preferEarlySoftHyphenBreak:n},Lc}function ice(e){const t=e.match(/(\d+(?:\.\d+)?)\s*px/);return t?parseFloat(t[1]):16}function HE(){return Mv===null&&(Mv=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Mv}function rce(e){return nce.test(e)||e.includes("️")}function lce(e){return oce.test(e)}function ace(e,t){let n=S3.get(e);if(n!==void 0)return n;const o=nb();o.font=e;const s=o.measureText("😀").width;if(n=0,s>t+.5&&typeof document<"u"&&document.body!==null){const i=document.createElement("span");i.style.font=e,i.style.display="inline-block",i.style.visibility="hidden",i.style.position="absolute",i.textContent="😀",document.body.appendChild(i);const r=i.getBoundingClientRect().width;document.body.removeChild(i),s-r>.5&&(n=s-r)}return S3.set(e,n),n}function cce(e){let t=0;const n=HE();for(const o of n.segment(e))rce(o.segment)&&t++;return t}function uce(e,t){return t.emojiCount===void 0&&(t.emojiCount=cce(e)),t.emojiCount}function Ia(e,t,n){return n===0?t.width:t.width-uce(e,t)*n}function dce(e,t,n,o,s){if(t.breakableFitAdvances!==void 0&&t.breakableFitMode===s)return t.breakableFitAdvances;t.breakableFitMode=s;const i=HE(),r=[];for(const u of i.segment(e))r.push(u.segment);if(r.length<=1)return t.breakableFitAdvances=null,t.breakableFitAdvances;if(s==="sum-graphemes"){const u=[];for(const d of r){const f=Tl(d,n);u.push(Ia(d,f,o))}return t.breakableFitAdvances=u,t.breakableFitAdvances}if(s==="pair-context"||r.length>tce){const u=[];let d=null,f=0;for(const h of r){const p=Tl(h,n),m=Ia(h,p,o);if(d===null)u.push(m);else{const y=d+h,k=Tl(y,n);u.push(Ia(y,k,o)-f)}d=h,f=m}return t.breakableFitAdvances=u,t.breakableFitAdvances}const l=[];let a="",c=0;for(const u of r){a+=u;const d=Tl(a,n),f=Ia(a,d,o);l.push(f-c),c=f}return t.breakableFitAdvances=l,t.breakableFitAdvances}function fce(e,t){const n=nb();n.font=e;const o=sce(e),s=ice(e),i=t?ace(e,s):0;return{cache:o,fontSize:s,emojiCorrection:i}}function hce(e){return e==="space"||e==="zero-width-break"||e==="soft-hyphen"}function WE(e){return e==="space"||e==="preserved-space"||e==="tab"||e==="zero-width-break"||e==="soft-hyphen"}function zE(e,t,n=e.widths.length){for(;t<n;){const o=e.kinds[t];if(!hce(o))break;t++}return t}function pce(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function mce(e,t,n){return e.letterSpacing!==0&&t&&e.spacingGraphemeCounts[n]>0?e.letterSpacing:0}function ob(e,t){return t===0?0:e+t}function gce(e,t){return e.letterSpacing!==0&&e.spacingGraphemeCounts[t]>0?e.letterSpacing:0}function vce(e,t,n,o,s){const i=t==="tab"?s+gce(e,n):e.lineEndFitAdvances[n];return ob(o,i)}function C3(e,t,n,o){const s=t==="tab"?0:e.lineEndFitAdvances[n];return ob(o,s)}function A3(e,t,n,o,s){const i=t==="tab"?s:e.lineEndPaintAdvances[n];return ob(o,i)}function yce(e,t,n){return e.letterSpacing!==0&&t?n+e.letterSpacing:n}function kce(e,t){return e.letterSpacing===0?t:t+e.letterSpacing}function Um(e,t,n){let o=t;for(;o<e.length&&e[o]<n;)o++;return o}function bce(e,t,n,o,s){if(e.letterSpacing===0)return 0;if(s>0)return e.spacingGraphemeCounts[o]>0?e.letterSpacing:0;for(let i=o-1;i>=t;i--){const r=e.kinds[i];if(!(r==="space"||r==="zero-width-break"||r==="hard-break")){if(r==="soft-hyphen"){if(i===o-1)return 0;continue}return i===t&&n>0||e.spacingGraphemeCounts[i]>0?e.letterSpacing:0}}return 0}function xce(e,t,n,o,s,i){return t+bce(e,n,o,s,i)}function wce(e,t,n){const{widths:o,kinds:s,breakableFitAdvances:i,breakablePreferredBreaks:r}=e;if(o.length===0)return 0;const a=Q1().lineFitEpsilon,c=t+a;let u=0,d=0,f=!1,h=0,p=0,m=0,y=0,k=-1,g=0;function v(){k=-1,g=0}function b(N=m,F=y,S=d){u++,n?.(S,h,p,N,F),d=0,f=!1,v()}function A(N,F){f=!0,h=N,p=0,m=N+1,y=0,d=F}function I(N,F,S){f=!0,h=N,p=F,m=N,y=F+1,d=S}function T(N,F){if(!f){A(N,F);return}d+=F,m=N+1,y=0}function M(N,F){const S=i[N],B=r[N]??null;let W=B===null?-1:Um(B,0,F+1),z=-1,L=0,O=F;for(;O<S.length;){const j=S[O];if(!f)I(N,O,j);else if(d+j>c){if(B!==null&&z>F){b(N,z,L),O=z,W=Um(B,W,O+1),z=-1,L=0;continue}b(),I(N,O,j)}else d+=j,m=N,y=O+1;const Z=O+1;B!==null&&B[W]===Z&&(z=Z,L=d,W++),O++}f&&m===N&&y===S.length&&(m=N+1,y=0)}let $=0;for(;$<o.length&&!(!f&&($=zE(e,$),$>=o.length));){const N=o[$],F=s[$],S=WE(F);if(!f){N>c&&i[$]!==null?M($,0):A($,N),S&&(k=$+1,g=d-N),$++;continue}if(d+N>c){if(S){T($,N),b($+1,0,d-N),$++;continue}if(k>=0){if(m>k||m===k&&y>0){b();continue}b(k,0,g);continue}if(N>c&&i[$]!==null){b(),M($,0),$++;continue}b();continue}T($,N),S&&(k=$+1,g=d-N),$++}return f&&b(),u}function _ce(e,t,n){if(e.simpleLineWalkFastPath)return wce(e,t,n);const{widths:o,kinds:s,breakableFitAdvances:i,breakablePreferredBreaks:r,discretionaryHyphenWidth:l,chunks:a}=e;if(o.length===0||a.length===0)return 0;const c=Q1(),u=c.lineFitEpsilon,d=t+u;let f=0,h=0,p=!1,m=0,y=0,k=0,g=0,v=-1,b=0,A=0,I=null;function T(){v=-1,b=0,A=0,I=null}function M(){return I==="soft-hyphen"&&v===k&&g===0?A:h}function $(L=k,O=g,j){f++,n!==void 0&&n(xce(e,j??M(),m,y,L,O),m,y,L,O),h=0,p=!1,T()}function N(L,O){p=!0,m=L,y=0,k=L+1,g=0,h=O}function F(L,O,j){p=!0,m=L,y=O,k=L,g=O+1,h=j}function S(L,O){if(!p){N(L,O);return}h+=O,k=L+1,g=0}function B(L,O,j,Z,ie,U){if(!O)return;const q=C3(e,L,j,ie),ee=A3(e,L,j,ie,Z);v=j+1,b=h-U+q,A=h-U+ee,I=L}function W(L,O){const j=i[L],Z=r[L]??null;let ie=Z===null?-1:Um(Z,0,O+1),U=-1,q=0,ee=O;for(;ee<j.length;){const le=j[ee];if(!p)F(L,ee,le);else{const re=yce(e,!0,le),we=h+re;if(kce(e,we)>d){if(Z!==null&&U>O){$(L,U,q),ee=U,ie=Um(Z,ie,ee+1),U=-1,q=0;continue}$(),F(L,ee,le)}else h=we,k=L,g=ee+1}const oe=ee+1;Z!==null&&Z[ie]===oe&&(U=oe,q=h,ie++),ee++}p&&k===L&&g===j.length&&(k=L+1,g=0)}function z(L){f++,n?.(0,L.startSegmentIndex,0,L.consumedEndSegmentIndex,0),T()}for(let L=0;L<a.length;L++){const O=a[L];if(O.startSegmentIndex===O.endSegmentIndex){z(O);continue}p=!1,h=0,m=O.startSegmentIndex,y=0,k=O.startSegmentIndex,g=0,T();let j=O.startSegmentIndex;for(;j<O.endSegmentIndex&&!(!p&&(j=zE(e,j,O.endSegmentIndex),j>=O.endSegmentIndex));){const Z=s[j],ie=WE(Z),U=mce(e,p,j),q=Z==="tab"?pce(h+U,e.tabStopAdvance):o[j],ee=U+q,le=vce(e,Z,j,U,q);if(Z==="soft-hyphen"){p&&(k=j+1,g=0,v=j+1,b=h+l,A=h+l,I=Z),j++;continue}if(!p){le>d&&i[j]!==null?W(j,0):N(j,q),B(Z,ie,j,q,U,ee),j++;continue}if(h+le>d){const re=h+C3(e,Z,j,U),we=h+A3(e,Z,j,U,q);if(I==="soft-hyphen"&&c.preferEarlySoftHyphenBreak&&b<=d){$(v,0,A);continue}if(ie&&re<=d){S(j,ee),$(j+1,0,we),j++;continue}if(v>=0&&b<=d){if(k>v||k===v&&g>0){$();continue}const me=v;$(me,0,A),j=me;continue}if(le>d&&i[j]!==null){$(),W(j,0),j++;continue}$();continue}S(j,ee),B(Z,ie,j,q,U,ee),j++}if(p){const Z=v===O.consumedEndSegmentIndex?A:h;$(O.consumedEndSegmentIndex,0,Z)}}return f}let Ev=null;function sb(){return Ev===null&&(Ev=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Ev}function Sce(e){return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],breakablePreferredBreaks:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[],segments:[]}}function Cce(e,t){const n=[];let o=[],s=0,i=!1,r=!1,l=!1;function a(){o.length!==0&&(n.push({text:o.length===1?o[0]:o.join(""),start:s}),o=[],i=!1,r=!1,l=!1)}function c(d,f,h){o=[d],s=f,i=h,r=ik(d),l=Y1.has(d)}function u(d,f){o.push(d),i=i||f;const h=ik(d);d.length===1&&Ga.has(d)?r=r||h:r=h,l=!1}for(const d of sb().segment(e)){const f=d.segment,h=mr(f);if(o.length===0){c(f,d.index,h);continue}if(l||J2.has(f)||Ga.has(f)||t.carryCJKAfterClosingQuote&&h&&r){u(f,h);continue}if(!i&&!h){u(f,h);continue}a(),c(f,d.index,h)}return a(),n}function Ace(e,t,n){if(t.length<=1)return t;const o=[];let s=-1,i=!1;function r(a,c){const u=t[a].start,d=c<t.length?t[c].start:e.length;o.push({text:e.slice(u,d),start:u})}function l(a){if(!(s<0)){if(i)s+1===a?o.push(t[s]):r(s,a);else for(let c=s;c<a;c++)o.push(t[c]);s=-1,i=!1}}for(let a=0;a<t.length;a++){const c=t[a];s>=0&&!BE(t[a-1].text,n)&&l(a),s<0&&(s=a),i=i||mr(c.text)}return l(t.length),o}function M3(e,t){if(t==="zero-width-break"||t==="soft-hyphen"||t==="hard-break")return 0;if(t==="tab")return 1;let n=0;const o=sb();for(const s of o.segment(e))n++;return n}function Mce(e){return e==="-"||e==="֊"||e==="‐"||e==="‒"||e==="–"||e==="—"}function Ece(e){if(!/[-\u058A\u2010\u2012\u2013\u2014]/u.test(e))return null;const t=[];let n=0;for(const o of sb().segment(e))n++,Mce(o.segment)&&t.push(n);return t.length===0?null:t}function Tce(e,t,n){return t>1?e+(t-1)*n:e}function Nce(e,t,n,o,s){const i=Q1(),{cache:r,emojiCorrection:l}=fce(t,lce(e.normalized)),a=Ia("-",Tl("-",r),l)+(s===0?0:s*2),u=Ia(" ",Tl(" ",r),l)*8,d=s!==0;if(e.len===0)return Sce();const f=[],h=[],p=[],m=[];let y=e.chunks.length<=1&&!d;const k=n?[]:null,g=[],v=[],b=[],A=n?[]:null,I=Array.from({length:e.len});function T(F,S,B,W,z,L,O,j,Z){z!=="text"&&z!=="space"&&z!=="zero-width-break"&&(y=!1),f.push(S),h.push(B),p.push(W),m.push(z),k?.push(L),g.push(O),v.push(j),d&&b.push(Z),A!==null&&A.push(F)}function M(F,S,B,W,z){const L=Tl(F,r),O=d?M3(F,S):0,j=Tce(Ia(F,L,l),O,s),Z=S==="space"||S==="preserved-space"||S==="zero-width-break"?0:j,ie=Z===0?0:Z+(O>0?s:0),U=S==="space"||S==="zero-width-break"?0:j;if(z&&W&&F.length>1){let q="sum-graphemes";s!==0?q="segment-prefixes":zm(F)?q="pair-context":i.preferPrefixWidthsForBreakableRuns&&(q="segment-prefixes");const ee=dce(F,L,r,l,q),le=ee===null||o==="keep-all"?null:Ece(F);T(F,j,ie,U,S,B,ee,le,O);return}T(F,j,ie,U,S,B,null,null,O)}for(let F=0;F<e.len;F++){I[F]=f.length;const S=e.texts[F],B=e.isWordLike[F],W=e.kinds[F],z=e.starts[F];if(W==="soft-hyphen"){T(S,0,a,a,W,z,null,null,0);continue}if(W==="hard-break"){T(S,0,0,0,W,z,null,null,0);continue}if(W==="tab"){T(S,0,0,0,W,z,null,null,d?M3(S,W):0);continue}const L=Tl(S,r);if(W==="text"&&L.containsCJK){const O=Cce(S,i),j=o==="keep-all"?Ace(S,O,i.breakKeepAllAfterPunctuation):O;for(let Z=0;Z<j.length;Z++){const ie=j[Z];M(ie.text,"text",z+ie.start,B,o==="keep-all"||!mr(ie.text))}continue}M(S,W,z,B,!0)}const $=Ice(e.chunks,I,f.length),N=k===null?null:eae(e.normalized,k);return A!==null?{widths:f,lineEndFitAdvances:h,lineEndPaintAdvances:p,kinds:m,simpleLineWalkFastPath:y,segLevels:N,breakableFitAdvances:g,breakablePreferredBreaks:v,letterSpacing:s,spacingGraphemeCounts:b,discretionaryHyphenWidth:a,tabStopAdvance:u,chunks:$,segments:A}:{widths:f,lineEndFitAdvances:h,lineEndPaintAdvances:p,kinds:m,simpleLineWalkFastPath:y,segLevels:N,breakableFitAdvances:g,breakablePreferredBreaks:v,letterSpacing:s,spacingGraphemeCounts:b,discretionaryHyphenWidth:a,tabStopAdvance:u,chunks:$}}function Ice(e,t,n){const o=[];for(let s=0;s<e.length;s++){const i=e[s],r=i.startSegmentIndex<t.length?t[i.startSegmentIndex]:n,l=i.endSegmentIndex<t.length?t[i.endSegmentIndex]:n,a=i.consumedEndSegmentIndex<t.length?t[i.consumedEndSegmentIndex]:n;o.push({startSegmentIndex:r,endSegmentIndex:l,consumedEndSegmentIndex:a})}return o}function Lce(e,t,n,o){const s=o?.wordBreak??"normal",i=o?.letterSpacing??0,r=ece(e,Q1(),o?.whiteSpace,s);return Nce(r,t,n,s,i)}function $ce(e,t,n){return Lce(e,t,!0,n)}function Fce(e){let t=0;return _ce(e,Number.POSITIVE_INFINITY,n=>{n>t&&(t=n)}),t}const Oce={key:0,class:"slash-menu",role:"listbox"},Rce=["aria-selected","onMouseenter","onMousedown"],Bce={class:"slash-name"},Dce={class:"slash-desc"},Pce=Qe({__name:"SlashMenu",props:{items:{},activeIndex:{}},emits:["select","hover"],setup(e,{emit:t}){const{t:n}=Ot(),o=e,s=t,i=ne([]);return et(()=>o.activeIndex,r=>{i.value[r]?.scrollIntoView({block:"nearest"})}),(r,l)=>e.items.length>0?(x(),E("div",Oce,[(x(!0),E(Pe,null,lt(e.items,(a,c)=>(x(),E("div",{ref_for:!0,ref:u=>{u&&(i.value[c]=u)},key:`${a.name}-${c}`,class:We(["slash-item",{active:c===o.activeIndex}]),role:"option","aria-selected":c===o.activeIndex,onMouseenter:u=>s("hover",c),onMousedown:Ct(u=>s("select",a),["prevent"])},[_("span",Bce,R(a.name),1),_("span",Dce,R(a.isSkill?a.desc:C(n)(a.desc)),1)],42,Rce))),128))])):ue("",!0)}}),Hce=ft(Pce,[["__scopeId","data-v-00a5ab11"]]),Wce={class:"mention-menu",role:"listbox"},zce={key:0,class:"mention-state dim"},Uce={key:1,class:"mention-state dim"},qce=["aria-selected","onMouseenter","onMousedown"],jce=["innerHTML"],Vce={class:"mention-name"},Kce={class:"mention-path"},Gce=Qe({__name:"MentionMenu",props:{items:{},activeIndex:{},loading:{type:Boolean}},emits:["select","hover"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Ot(),i=Bc("folder","sm"),r=Bc("code","sm"),l=Bc("file-text","sm"),a=Bc("image","sm"),c=Bc("file","sm"),u=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"]),d=new Set(["md","markdown","mdx","txt","rst","adoc","pdf","doc","docx"]),f=new Set(["png","jpg","jpeg","gif","svg","webp","bmp","ico","avif"]);function h(p){const m=p.path;if(m.endsWith("/"))return i;const y=p.name||m.split("/").pop()||m,k=y.lastIndexOf("."),g=k>0?y.slice(k+1).toLowerCase():"";return g?u.has(g)?r:d.has(g)?l:f.has(g)?a:c:c}return(p,m)=>(x(),E("div",Wce,[n.loading?(x(),E("div",zce,R(C(s)("mention.searching")),1)):n.items.length===0?(x(),E("div",Uce,R(C(s)("mention.noMatch")),1)):(x(!0),E(Pe,{key:2},lt(n.items,(y,k)=>(x(),E("div",{key:y.path,class:We(["mention-item",{active:k===n.activeIndex}]),role:"option","aria-selected":k===n.activeIndex,onMouseenter:g=>o("hover",k),onMousedown:Ct(g=>o("select",y),["prevent"])},[_("span",{class:"mention-icon",innerHTML:h(y),"aria-hidden":"true"},null,8,jce),_("span",Vce,R(y.name),1),_("span",Kce,R(y.path),1)],42,qce))),128))]))}}),Yce=ft(Gce,[["__scopeId","data-v-63291ac0"]]),UE=[{name:"/new",desc:"commands.new.desc"},{name:"/clear",desc:"commands.clear.desc"},{name:"/login",desc:"commands.login.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:"/export",desc:"commands.export.desc"},{name:"/status",desc:"commands.status.desc"}];function Zce(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)}}const qm="skill:";function Xce(e){return e.startsWith(qm)?e.slice(qm.length):e}function qE(e=[]){const t=e.map(n=>({name:n.source==="builtin"?`/${n.name}`:`/${qm}${n.name}`,desc:n.description,isSkill:!0,acceptsInput:!0}));return[...UE,...t]}function Qce(e,t=UE){const n=e.toLowerCase().trim().replace(/^\//,"");return n===""?t:t.map((o,s)=>{const i=o.name.toLowerCase().replace(/^\//,"");let r=0;return i===n?r=3:i.startsWith(n)?r=2:i.includes(n)&&(r=1),{item:o,index:s,score:r}}).filter(({score:o})=>o>0).sort((o,s)=>o.score!==s.score?s.score-o.score:o.index-s.index).map(({item:o})=>o)}function J1(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 jE(e){return e?.supportEfforts??[]}function Jce(e){return e[Math.floor(e.length/2)]}function _f(e){if(J1(e)==="unsupported")return"off";const t=jE(e);return t.length>0?e?.defaultEffort??Jce(t):"on"}function e0(e){const t=jE(e),n=J1(e);return t.length>0?n==="always-on"?[...t]:["off",...t]:n==="always-on"?["on"]:n==="unsupported"?["off"]:["on","off"]}function lk(e){return e.length===0?e:e.charAt(0).toUpperCase()+e.slice(1)}function eue(e){return e!=="off"}function tue(e,t){return e0(e).includes(t)}function ib(e,t){return t==="off"?"off":t==="on"?_f(e):t}function jm(e,t){return t??_f(e)}function nue(e,t){if(e==="off")return{enabled:!1};if(e==="on")return{enabled:!0};const n=t?.at(-1);return n!==void 0&&e===n?{enabled:!0}:{enabled:!0,effort:e}}function oue(e,t,n){return!n||e===void 0?t:_f(e)}const Vm=100;function sue(e){const t=S1(Ht.inputHistory);if(Array.isArray(t)){const n=t.filter(i=>typeof i=="string"&&i.length>0);if(!e||n.length===0)return{};const o=n.length>Vm?n.slice(-Vm):n,s={[e]:o};return $f(Ht.inputHistory,s),s}return t&&typeof t=="object"?t:{}}function iue(e){const{text:t,textareaRef:n,autosize:o,sessionId:s}=e,i=ne(sue(s())),r=D(()=>i.value[s()??""]??[]);let l=-1,a="";function c(k){const g=s();if(l=-1,!g)return;const v=k.trim();if(!v)return;const b=i.value[g]??[];if(b.at(-1)===v)return;const A=[...b,v],I=A.length>Vm?A.slice(-Vm):A;i.value={...i.value,[g]:I},$f(Ht.inputHistory,i.value)}function u(){const k=n.value;return k?(k.selectionStart??0)===0:!1}function d(k){t.value=k,kt(()=>{const g=n.value;if(!g)return;o();const v=k.length;g.setSelectionRange(v,v)})}function f(){const k=r.value;if(k.length!==0){if(l===-1)a=t.value,l=k.length-1;else if(l>0)l-=1;else return;d(k[l])}}function h(){if(l===-1)return;const k=r.value;l<k.length-1?(l+=1,d(k[l])):(l=-1,d(a))}function p(){l=-1}function m(){return l!==-1}function y(){return r.value.length>0}return et(s,()=>{l=-1}),{push:c,caretAtTextStart:u,recallOlder:f,recallNewer:h,resetBrowsing:p,isBrowsing:m,hasHistory:y}}function rue(e){const{text:t,textareaRef:n,autosize:o,skills:s,emitCommand:i,historyPush:r,clearDraft:l}=e,a=ne(!1),c=ne([]),u=ne(0);function d(){const h=t.value;h.startsWith("/")&&!h.includes(" ")?(c.value=Qce(h,qE(s())),u.value=0,a.value=c.value.length>0):a.value=!1}function f(h){if(a.value=!1,h.acceptsInput){t.value=`${h.name} `,kt(()=>{const p=n.value;if(!p)return;const m=t.value.length;p.setSelectionRange(m,m),p.focus(),o()});return}t.value="",l?.(),r(h.name),i(h.name)}return{open:a,items:c,active:u,update:d,select:f}}function lue(e){const{text:t,textareaRef:n,autosize:o,searchFiles:s}=e,i=ne(!1),r=ne([]),l=ne(0),a=ne(!1);let c=null;function u(){const h=t.value,p=n.value?.selectionStart??h.length;let m=p-1;for(;m>=0&&!/\s/.test(h[m]);)m--;m++;const y=h.slice(m,p);return y.startsWith("@")?{token:y.slice(1),start:m,end:p}:null}function d(){const h=u(),p=s();if(!h||!p){i.value=!1;return}const m=h.token;c!==null&&clearTimeout(c),c=setTimeout(async()=>{a.value=!0,i.value=!0,l.value=0;try{r.value=await p(m)}catch{r.value=[]}finally{a.value=!1}},200)}function f(h){const p=u();if(!p)return;const m=t.value;t.value=m.slice(0,p.start)+h.path+m.slice(p.end),i.value=!1,kt(()=>{const y=n.value;if(!y)return;const k=p.start+h.path.length;y.setSelectionRange(k,k),y.focus(),o()})}return{open:i,items:r,active:l,loading:a,update:d,select:f}}function aue(e){const{sessionId:t}=e;function n(c){return uo(k_(c))??""}function o(c,u){const d=k_(c);u?xo(d,u):qa(d)}const s=ne(n(t())),i=ne(null);function r(){const c=i.value;c&&(c.style.height="auto",c.style.height=`${c.scrollHeight}px`)}et(s,c=>{kt(r),o(t(),c)}),et(t,(c,u)=>{c!==u&&(o(u,s.value),s.value=n(c),kt(r))});function l(c){s.value=c,kt(()=>{const u=i.value;if(!u)return;u.focus();const d=c.length;u.setSelectionRange(d,d),r()})}function a(){o(t(),"")}return{text:s,textareaRef:i,autosize:r,loadForEdit:l,clearDraft:a}}function cue(e){const{uploadImage:t,sessionId:n}=e,o=ne({}),s=D(()=>o.value[n()??""]??[]),i=ne(null),r=ne(null),l=ne(!1);let a=0;function c(){return`att_${++a}`}function u(O,j){o.value={...o.value,[O]:j}}function d(O){if(O.previewUrl!==void 0)try{URL.revokeObjectURL(O.previewUrl)}catch{}}function f(O){return O.startsWith("image/")?"image":O.startsWith("video/")?"video":"file"}async function h(O){const j=t();if(!j)return;const Z=n()??"";if(O.length!==0)for(const ie of O){const U=f(ie.type),q=c(),ee=U==="file"?void 0:URL.createObjectURL(ie),le={localId:q,name:ie.name,kind:U,previewUrl:ee,mediaType:ie.type||"application/octet-stream",size:ie.size,uploading:!0};u(Z,[...o.value[Z]??[],le]),j(ie,ie.name).then(oe=>{const re=o.value[Z]??[];u(Z,re.map(we=>we.localId===q?{...we,uploading:!1,fileId:oe?.fileId,mediaType:oe?.mediaType??we.mediaType,error:oe===null}:we))}).catch(()=>{const oe=o.value[Z]??[];u(Z,oe.map(re=>re.localId===q?{...re,uploading:!1,error:!0}:re))})}}function p(O){const j=n()??"",Z=o.value[j]??[],ie=Z.find(U=>U.localId===O);i.value?.localId===O&&(i.value=null),ie&&d(ie),u(j,Z.filter(U=>U.localId!==O))}function m(O){i.value=O}function y(){i.value=null}function k(){r.value?.click()}function g(O){const j=O.target,Z=Array.from(j.files??[]);h(Z),j.value=""}function v(O){if(!t())return;const j=O.clipboardData;if(!j)return;const Z=[],ie=new Set,U=(q,ee)=>{const le=`${q.size}:${q.type}:${ee}`;if(ie.has(le))return;ie.add(le);const oe=q.type.split("/")[1]??"png",re=ee.includes(".")?ee:`paste-${Date.now()}.${oe}`;Z.push(q instanceof File?q:new File([q],re,{type:q.type}))};for(const q of Array.from(j.items))if(q.kind==="file"){const ee=q.getAsFile();ee&&U(ee,ee.name||`paste-${Date.now()}.${q.type.split("/")[1]??"png"}`)}for(const q of Array.from(j.files))U(q,q.name);Z.length!==0&&(O.preventDefault(),h(Z))}let b=0;function A(O){!t()||!Array.from(O.dataTransfer?.items??[]).some(Z=>Z.kind==="file")||(O.preventDefault(),O.stopPropagation(),l.value=!0)}function I(){l.value=!1}function T(O){if(b=0,l.value=!1,!t())return;O.preventDefault(),O.stopPropagation();const j=Array.from(O.dataTransfer?.files??[]);h(j)}function M(O){return Array.from(O.dataTransfer?.items??[]).some(j=>j.kind==="file")}function $(O){!t()||!M(O)||(O.preventDefault(),b+=1,l.value=!0)}function N(O){!t()||!M(O)||O.preventDefault()}function F(O){!t()||!M(O)||(b=Math.max(0,b-1),b===0&&(l.value=!1))}function S(O){if(b=0,l.value=!1,!t())return;O.preventDefault();const j=Array.from(O.dataTransfer?.files??[]);h(j)}function B(){const O=n()??"";for(const j of o.value[O]??[])d(j);u(O,[])}function W(O,j,Z){const ie=o.value[O]??[];ie.some(U=>U.localId===j)&&u(O,ie.map(U=>U.localId===j?{...U,...Z}:U))}function z(O){return fetch(O).then(j=>{if(!j.ok)throw new Error(`fetch failed: ${j.status}`);return j.blob()})}function L(O){const j=n()??"";for(const Z of o.value[j]??[])d(Z);u(j,[]);for(const Z of O){const ie=c(),U=/^data:/i.test(Z.url),q=/^blob:/i.test(Z.url),ee=Z.name??Z.kind;if(Z.fileId){const le={localId:ie,name:ee,kind:Z.kind,previewUrl:Z.kind==="file"?void 0:Z.url,uploading:!1,fileId:Z.fileId};u(j,[...o.value[j]??[],le]),Z.kind!=="file"&&!U&&!q&&pt().getFileBlob(Z.fileId).then(oe=>{const re=URL.createObjectURL(oe);if(!(o.value[j]??[]).some(me=>me.localId===ie)){URL.revokeObjectURL(re);return}W(j,ie,{previewUrl:re})}).catch(()=>{})}else{if(!Z.url)continue;const le=t();if(!le)continue;const oe={localId:ie,name:ee,kind:Z.kind,previewUrl:Z.url,uploading:!0};u(j,[...o.value[j]??[],oe]),z(Z.url).then(re=>{const we=ee.includes(".")?ee:`${ee}.${re.type.split("/")[1]??"bin"}`;return le(re,we)}).then(re=>{if(re===null){const we=o.value[j]??[];u(j,we.filter(me=>me.localId!==ie));return}W(j,ie,{uploading:!1,fileId:re.fileId})}).catch(()=>{const re=o.value[j]??[];u(j,re.filter(we=>we.localId!==ie))})}}}return et(n,()=>{i.value=null}),wn(()=>{document.addEventListener("paste",v),document.addEventListener("dragenter",$),document.addEventListener("dragover",N),document.addEventListener("dragleave",F),document.addEventListener("drop",S)}),In(()=>{document.removeEventListener("paste",v),document.removeEventListener("dragenter",$),document.removeEventListener("dragover",N),document.removeEventListener("dragleave",F),document.removeEventListener("drop",S);for(const O of Object.values(o.value))for(const j of O)d(j);i.value=null}),{attachments:s,previewAttachment:i,fileInputRef:r,isDragOver:l,removeAttachment:p,openAttachmentPreview:m,closeAttachmentPreview:y,openFilePicker:k,handleFileInputChange:g,handleDragOver:A,handleDragLeave:I,handleDrop:T,clearAfterSubmit:B,loadAttachments:L}}const uue=["type","disabled"],due={class:"ui-button__content"},fue=Qe({__name:"Button",props:{variant:{default:"primary"},size:{default:"md"},disabled:{type:Boolean},loading:{type:Boolean},type:{default:"button"}},setup(e){return(t,n)=>(x(),E("button",{class:We(["ui-button",[`ui-button--${e.variant}`,`ui-button--${e.size}`,{"is-loading":e.loading}]]),type:e.type,disabled:e.disabled||e.loading},[e.loading?(x(),Ae(Hs,{key:0,size:"sm",class:"ui-button__spinner"})):ue("",!0),_("span",due,[zn(t.$slots,"default",{},void 0,!0)])],10,uue))}}),jt=ft(fue,[["__scopeId","data-v-432a0181"]]),hue={class:"ctx-ring",viewBox:"0 0 20 20","aria-hidden":"true"},pue=["stroke-dasharray","stroke-dashoffset"],Tv=7,mue=Qe({__name:"ContextRing",props:{pct:{}},setup(e){const t=e,n=2*Math.PI*Tv;return(o,s)=>(x(),E("svg",hue,[_("circle",{class:"ctx-ring-track",cx:"10",cy:"10",r:Tv,fill:"none","stroke-width":"2.5"}),_("circle",{class:"ctx-ring-fill",cx:"10",cy:"10",r:Tv,fill:"none","stroke-width":"2.5","stroke-linecap":"round","stroke-dasharray":`${n}`,"stroke-dashoffset":`${n*(1-t.pct/100)}`},null,8,pue)]))}}),gue=ft(mue,[["__scopeId","data-v-56ca5e24"]]),vue={key:0,class:"att-strip"},yue={class:"att-lightbox-card"},kue=["src"],bue=["src","alt"],xue={class:"att-lightbox-name"},wue={class:"composer-card"},_ue={class:"cin-wrap"},Sue={class:"input-row"},Cue=["placeholder","disabled"],Aue=["aria-label"],Mue={class:"toolbar-left"},Eue=["onKeydown"],Tue=["onClick"],Nue={class:"pd-check"},Iue={class:"pd-info"},Lue={class:"pd-desc"},$ue={class:"mode-label"},Fue={key:0,class:"mode-tag"},Oue={key:1,class:"mode-tag"},Rue={key:2,class:"mode-tag"},Bue={class:"mode-row-icon"},Due={class:"mode-row-info"},Pue={class:"mode-row-name"},Hue={class:"mode-row-desc"},Wue={class:"mode-row-icon"},zue={class:"mode-row-info"},Uue={class:"mode-row-name"},que={class:"mode-row-desc"},jue={class:"mode-row-icon"},Vue={class:"mode-row-info"},Kue={class:"mode-row-name"},Gue={class:"mode-row-desc"},Yue={key:0,class:"mode-row-actions"},Zue={class:"toolbar-right"},Xue=["aria-label"],Que=["onKeydown"],Jue={key:0,class:"think-suffix"},ede=["aria-label"],tde=["aria-label","disabled"],nde={key:0,class:"md-section"},ode=["onClick"],sde={class:"md-check"},ide={class:"md-name"},rde={class:"md-provider"},lde={key:1,class:"md-divider"},ade={key:2,class:"md-section"},cde=["onClick"],ude={class:"md-check"},dde={class:"md-name"},fde={key:3,class:"md-divider"},hde={class:"md-name"},pde={key:0,class:"md-note"},mde=["aria-label"],gde=["disabled","onClick"],vde={class:"md-cache-note"},yde={class:"md-name"},kde={class:"drop-card"},E3=36,bde=Qe({__name:"Composer",props:{running:{type:Boolean,default:!1},starting:{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},goal:{},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 o=e,s=D(()=>o.starting?r("composer.starting"):o.running?r("composer.placeholderRunning"):o.goalMode?r("status.goalPlaceholder"):r("composer.placeholder")),i=n,{t:r,locale:l}=Ot(),{text:a,textareaRef:c,autosize:u,loadForEdit:d,clearDraft:f}=aue({sessionId:()=>o.sessionId}),h=ne(!1);function p(){h.value=!h.value,kt(()=>{u(),g(),c.value?.focus()})}function m(){h.value&&(h.value=!1,kt(u))}function y(je){if(typeof getComputedStyle>"u")return E3;const it=Number.parseFloat(getComputedStyle(je).minHeight);return Number.isFinite(it)&&it>0?it:E3}const k=ne(!1);function g(){const je=c.value;k.value=!!je&&je.scrollHeight>y(je)}et(a,()=>{kt(g)}),et(()=>o.sessionId,()=>{h.value=!1});const v=iue({text:a,textareaRef:c,autosize:u,sessionId:()=>o.sessionId}),{open:b,items:A,active:I,update:T,select:M}=rue({text:a,textareaRef:c,autosize:u,skills:()=>o.skills,emitCommand:je=>i("command",je),historyPush:je=>v.push(je),clearDraft:f}),{open:$,items:N,active:F,loading:S,update:B,select:W}=lue({text:a,textareaRef:c,autosize:u,searchFiles:()=>o.searchFiles});function z(){v.resetBrowsing(),T(),B()}const{attachments:L,previewAttachment:O,fileInputRef:j,isDragOver:Z,removeAttachment:ie,openAttachmentPreview:U,closeAttachmentPreview:q,openFilePicker:ee,handleFileInputChange:le,handleDragOver:oe,handleDragLeave:re,handleDrop:we,clearAfterSubmit:me,loadAttachments:Ee}=cue({uploadImage:()=>o.uploadImage,sessionId:()=>o.sessionId});wn(()=>{a.value&&kt(()=>{u(),g()})}),In(()=>{document.removeEventListener("mousedown",Un),V()});function ae(){c.value?.focus({preventScroll:!0})}function Y(je){Ee(je)}t({loadForEdit:d,loadAttachmentsForEdit:Y,focus:ae});function Q(je){return{fileId:je.fileId,kind:je.kind,name:je.name,mediaType:je.mediaType,size:je.size}}function P(je){if(je.kind==="file"){je.fileId!==void 0&&OE(je.fileId,je.name,je.mediaType);return}U(je)}function G(){const je=a.value.trim();if(L.value.some(ge=>ge.uploading))return;const it=L.value.filter(ge=>!ge.uploading&&!ge.error&&ge.fileId);if(!je&&it.length===0)return;if(v.push(je),je){const ge=Zce(je),K=ge?qE(o.skills).some(xe=>xe.name===ge.cmd||xe.name===`/${qm}${ge.cmd.slice(1)}`):!1;if(ge&&K){a.value="",f(),b.value=!1,m(),i("command",ge.arg?`${ge.cmd} ${ge.arg}`:ge.cmd);return}}const De={text:je,attachments:it.map(ge=>Q(ge))};O.value=null,me(),a.value="",f(),b.value=!1,$.value=!1,m(),i("submit",De)}function pe(){if(!o.running||L.value.some(ge=>ge.uploading))return;const je=a.value.trim(),it=L.value.filter(ge=>!ge.uploading&&!ge.error&&ge.fileId);if(!je&&it.length===0&&o.queued.length===0)return;const De={text:je,attachments:it.map(ge=>Q(ge))};me(),v.push(je),a.value="",f(),b.value=!1,$.value=!1,m(),i("steer",De)}let ve=!1,de=null;function V(){de!==null&&(clearTimeout(de),de=null)}function se(){V(),ve=!0}function he(){V(),de=setTimeout(()=>{de=null,ve=!1},0)}function ke(je){return ve||je.isComposing||je.keyCode===229}function Te(je){if(!ke(je)){if(je.key==="Escape"){if(be.value){je.preventDefault(),ut();return}if(Ge.value){je.preventDefault(),Nt();return}}if(b.value){if(je.key==="ArrowDown"){je.preventDefault(),I.value=(I.value+1)%A.value.length;return}if(je.key==="ArrowUp"){je.preventDefault(),I.value=(I.value-1+A.value.length)%A.value.length;return}if(je.key==="Enter"||je.key==="Tab"){je.preventDefault();const it=A.value[I.value];it&&M(it);return}if(je.key==="Escape"){je.preventDefault(),b.value=!1;return}}if($.value&&!S.value){if(je.key==="ArrowDown"){je.preventDefault(),F.value=(F.value+1)%Math.max(1,N.value.length);return}if(je.key==="ArrowUp"){je.preventDefault(),F.value=(F.value-1+Math.max(1,N.value.length))%Math.max(1,N.value.length);return}if(je.key==="Enter"||je.key==="Tab"){je.preventDefault();const it=N.value[F.value];it&&W(it);return}if(je.key==="Escape"){je.preventDefault(),$.value=!1;return}}if(je.key==="s"&&(je.ctrlKey||je.metaKey)&&!je.shiftKey&&!je.altKey){o.running&&(je.preventDefault(),pe());return}if(!h.value&&!b.value&&!$.value&&!je.shiftKey&&!je.altKey&&!je.metaKey&&!je.ctrlKey){const it=v.isBrowsing();if(je.key==="ArrowUp"&&v.hasHistory()&&(it||v.caretAtTextStart())){je.preventDefault(),v.recallOlder();return}if(je.key==="ArrowDown"&&it){je.preventDefault(),v.recallNewer();return}}if(je.key==="Enter"&&!je.shiftKey){if(h.value&&!(je.metaKey||je.ctrlKey))return;je.preventDefault(),G()}}}const ze=D(()=>r("composer.send")),ye=D(()=>!!o.uploadImage),be=ne(!1),Ge=ne(!1),tt=ne(null);function rt(){be.value=!be.value,be.value?(Ge.value=!1,_o(),document.addEventListener("click",_t,!0)):document.removeEventListener("click",_t,!0)}function ut(){be.value=!1,Ge.value||document.removeEventListener("click",_t,!0)}function vt(){Ge.value=!Ge.value,Ge.value?(be.value=!1,_o(),document.addEventListener("click",_t,!0)):document.removeEventListener("click",_t,!0)}function Nt(){Ge.value=!1,be.value||document.removeEventListener("click",_t,!0)}function _t(je){tt.value&&!tt.value.contains(je.target)&&(ut(),Nt())}In(()=>{document.removeEventListener("click",_t,!0)});const Rt=D(()=>{const je=o.status?.ctxMax??0;return je<=0?0:Math.min(100,Math.max(0,Math.ceil((o.status?.ctxUsed??0)/je*100)))}),ln=D(()=>{const je=pr(o.status?.ctxUsed??0),it=pr(o.status?.ctxMax??0);return r("status.ctxTooltip",{used:je,max:it,pct:Rt.value})}),Ln=D(()=>Rt.value>=80),Wt=D(()=>o.models?.find(je=>je.id===o.status?.modelId)),un=D(()=>J1(Wt.value)),vn=D(()=>e0(Wt.value)),Xt=D(()=>jm(Wt.value,o.thinking)),An=D(()=>vn.value.includes(Xt.value)?Xt.value:""),Je=D(()=>eue(Xt.value)),Ve=D(()=>un.value==="unsupported"||vn.value.length<=1),It=D(()=>{if(!Je.value)return"";const je=(Wt.value?.supportEfforts?.length??0)>0,it=Xt.value;return je&&it!=="on"?r("composer.thinkingSuffixEffort",{level:it}):r("composer.thinkingSuffix")});function Kt(je){Ve.value||i("setThinking",ib(Wt.value,je))}function Gt(je){return je==="on"?r("status.thinkingOn"):je==="off"?r("status.thinkingOff"):lk(je)}const Sn=D(()=>o.planMode===!0),mt=D(()=>o.swarmMode===!0),Rn=D(()=>o.goal?.status??o.activationBadges?.goal?.status??null),dn=D(()=>Rn.value!==null&&Rn.value!=="complete"),nn=D(()=>dn.value||o.goalMode===!0),fn=D(()=>Rn.value==="active"),Po=D(()=>Rn.value==="paused"||Rn.value==="blocked"),Ho=ne(!1),dt=ne(null),li=ne(null),_s=ne({}),Eo=D(()=>Sn.value||mt.value||nn.value);function _o(){Ho.value=!1,document.removeEventListener("mousedown",Un)}function Un(je){const it=je.target;dt.value?.contains(it)||li.value?.contains(it)||_o()}function To(){if(Ho.value){_o();return}ut(),Nt();const je=dt.value?.getBoundingClientRect();je&&(_s.value={left:`${Math.round(je.left)}px`,bottom:`${Math.round(window.innerHeight-je.top+8)}px`}),Ho.value=!0,setTimeout(()=>document.addEventListener("mousedown",Un),0)}const lo=[{mode:"manual",color:"var(--dim)",labelKey:"status.permissionManual",descKey:"status.permissionManualDesc"},{mode:"yolo",color:"var(--color-warning)",labelKey:"status.permissionYolo",descKey:"status.permissionYoloDesc"},{mode:"auto",color:"var(--color-danger)",labelKey:"status.permissionAuto",descKey:"status.permissionAutoDesc"}],Wo=["status.planDesc","status.swarmDesc","status.goalDesc"],Ss=ne(null),So=ne(""),Ws=ne("");function zo(je){const it={};return je&&(it["--composer-menu-desc-width"]=je),it}const ai=D(()=>zo(So.value)),Qo=D(()=>zo(Ws.value)),No=D(()=>({..._s.value,...Qo.value}));let Io=null;function ci(je){const it=Number.parseFloat(je);return Number.isFinite(it)?it:0}function en(je){return`${je.fontStyle||"normal"} ${je.fontWeight||"400"} ${je.fontSize} ${je.fontFamily}`}function zs(je){return je.letterSpacing==="normal"?0:ci(je.letterSpacing)}function Xn(je,it){if(!je)return 0;const De=$ce(je,en(it),{letterSpacing:zs(it)});return Fce(De)}function Us(){const je=Ss.value?.querySelector(".pd-desc");if(!je)return;const it=getComputedStyle(je),De=Math.max(0,...lo.map(K=>Xn(r(K.descKey),it))),ge=Math.max(0,...Wo.map(K=>Xn(r(K),it)));So.value=De>0?`${Math.ceil(De)}px`:"",Ws.value=ge>0?`${Math.ceil(ge)}px`:""}function ui(){typeof window>"u"||(Io!==null&&window.cancelAnimationFrame(Io),kt(()=>{Io=window.requestAnimationFrame(()=>{Io=null,Us()})}))}et(l,ui,{immediate:!0}),wn(()=>{ui(),document.fonts?.ready.then(ui)}),In(()=>{Io!==null&&(window.cancelAnimationFrame(Io),Io=null)});function Ni(je){i("setPermission",je),Nt()}const di=D(()=>lo.find(je=>je.mode===o.status?.permission)),qs=D(()=>di.value?r(di.value.labelKey):""),Jo=D(()=>Wt.value?.provider??""),es=D(()=>!Jo.value||!o.models?.length?[]:o.models.filter(je=>je.provider===Jo.value)),zt=D(()=>new Set(o.starredIds??[]));function js(je){return zt.value.has(je)}const Lo=D(()=>o.models?.length?o.models.filter(je=>js(je.id)&&je.provider!==Jo.value):[]);function fi(je){i("selectModel",je),ut()}return(je,it)=>(x(),E("div",{class:We(["composer",{"drag-over":C(Z),expanded:h.value}]),onDragover:it[18]||(it[18]=(...De)=>C(oe)&&C(oe)(...De)),onDragleave:it[19]||(it[19]=(...De)=>C(re)&&C(re)(...De)),onDrop:it[20]||(it[20]=(...De)=>C(we)&&C(we)(...De))},[C(L).length>0?(x(),E("div",vue,[(x(!0),E(Pe,null,lt(C(L),De=>(x(),Ae($E,{key:De.localId,kind:De.kind,name:De.name,url:De.previewUrl,"file-id":De.fileId,"media-type":De.mediaType,size:De.size,uploading:De.uploading,error:De.error,removable:"","remove-label":C(r)("composer.removeNamed",{name:De.name}),onActivate:ge=>P(De),onRemove:ge=>C(ie)(De.localId)},null,8,["kind","name","url","file-id","media-type","size","uploading","error","remove-label","onActivate","onRemove"]))),128))])):ue("",!0),C(O)?(x(),E("div",{key:1,class:"att-lightbox",onClick:it[1]||(it[1]=Ct((...De)=>C(q)&&C(q)(...De),["self"]))},[_("div",yue,[fe(rn,{text:C(r)("model.close")},{default:Le(()=>[_("button",{type:"button",class:"att-lightbox-close",onClick:it[0]||(it[0]=(...De)=>C(q)&&C(q)(...De))},"✕")]),_:1},8,["text"]),C(O).kind==="video"?(x(),E("video",{key:0,class:"att-lightbox-media",src:C(O).previewUrl,controls:"",playsinline:""},null,8,kue)):(x(),E("img",{key:1,class:"att-lightbox-media",src:C(O).previewUrl,alt:C(O).name},null,8,bue)),_("div",xue,R(C(O).name),1)])])):ue("",!0),_("div",wue,[_("div",_ue,[C(b)?(x(),Ae(Hce,{key:0,items:C(A),"active-index":C(I),onSelect:C(M),onHover:it[2]||(it[2]=De=>I.value=De)},null,8,["items","active-index","onSelect"])):ue("",!0),C($)?(x(),Ae(Yce,{key:1,items:C(N),"active-index":C(F),loading:C(S),onSelect:C(W),onHover:it[3]||(it[3]=De=>F.value=De)},null,8,["items","active-index","loading","onSelect"])):ue("",!0),_("div",Sue,[Wn(_("textarea",{ref_key:"textareaRef",ref:c,"onUpdate:modelValue":it[4]||(it[4]=De=>co(a)?a.value=De:null),class:"ph",placeholder:s.value,disabled:e.starting,rows:"1",onKeydown:Te,onCompositionstart:se,onCompositionend:he,onInput:z},null,40,Cue),[[ws,C(a)]]),h.value||k.value?(x(),E("button",{key:0,class:"expand-btn",type:"button","aria-label":h.value?C(r)("composer.collapseTitle"):C(r)("composer.expandTitle"),onClick:p},[h.value?(x(),Ae(Ye,{key:0,name:"collapse",size:"sm"})):(x(),Ae(Ye,{key:1,name:"expand",size:"sm"}))],8,Aue)):ue("",!0)])]),ye.value?(x(),E("input",{key:0,ref_key:"fileInputRef",ref:j,type:"file",multiple:"",class:"file-input-hidden",onChange:it[5]||(it[5]=(...De)=>C(le)&&C(le)(...De))},null,544)):ue("",!0),_("div",{ref_key:"toolbarRef",ref:tt,class:"toolbar"},[_("div",{ref_key:"menuMeasureRef",ref:Ss,class:"menu-measure","aria-hidden":"true"},[...it[21]||(it[21]=[_("span",{class:"pd-desc"},null,-1)])],512),_("div",Mue,[ye.value?(x(),Ae(Kn,{key:0,size:"md",label:C(r)("composer.attachFile"),onClick:C(ee)},{default:Le(()=>[fe(Ye,{name:"attachment"})]),_:1},8,["label","onClick"])):ue("",!0),e.status?(x(),E("span",{key:1,class:We(["perm-pill",["perm-"+e.status.permission,{open:Ge.value}]]),role:"button",tabindex:"0",onClick:Ct(vt,["stop"]),onKeydown:[ur(vt,["enter"]),ur(Ct(vt,["prevent"]),["space"])]},R(qs.value),43,Eue)):ue("",!0),Ge.value&&e.status?(x(),E("div",{key:2,class:"perm-dropdown",style:tn(ai.value),role:"menu",onClick:it[6]||(it[6]=Ct(()=>{},["stop"]))},[(x(),E(Pe,null,lt(lo,De=>_("button",{key:De.mode,class:We(["pd-row",{"is-current":De.mode===e.status.permission}]),role:"menuitem",onClick:ge=>Ni(De.mode)},[_("span",Nue,[De.mode===e.status.permission?(x(),Ae(Ye,{key:0,name:"check",size:"sm"})):ue("",!0)]),_("span",Iue,[_("span",{class:"pd-name",style:tn({color:De.color})},R(C(r)(De.labelKey)),5),_("span",Lue,R(C(r)(De.descKey)),1)])],10,Tue)),64))],4)):ue("",!0),e.status?(x(),E("div",{key:3,ref_key:"modesRef",ref:dt,class:"modes"},[_("button",{type:"button",class:We(["mode-pill",{on:Eo.value,open:Ho.value}]),onClick:Ct(To,["stop"])},[_("span",$ue,R(C(r)("status.modesLabel")),1),Sn.value?(x(),E("span",Fue,R(C(r)("status.planLabel")),1)):ue("",!0),mt.value?(x(),E("span",Oue,R(C(r)("status.swarmLabel")),1)):ue("",!0),nn.value?(x(),E("span",Rue,R(C(r)("status.goalLabel")),1)):ue("",!0)],2),Ho.value?(x(),E("div",{key:0,ref_key:"modesMenuRef",ref:li,class:"modes-menu",style:tn(No.value),role:"menu"},[_("button",{type:"button",class:We(["mode-row",{on:Sn.value}]),role:"menuitem",onClick:it[7]||(it[7]=De=>i("togglePlan"))},[_("span",Bue,[fe(Ye,{name:"file-edit",size:"sm"})]),_("span",Due,[_("span",Pue,R(C(r)("status.planLabel")),1),_("span",Hue,R(C(r)("status.planDesc")),1)]),_("span",{class:We(["mode-switch",{on:Sn.value}])},[...it[22]||(it[22]=[_("span",{class:"mode-knob"},null,-1)])],2)],2),_("button",{type:"button",class:We(["mode-row",{on:mt.value}]),role:"menuitem",onClick:it[8]||(it[8]=De=>i("toggleSwarm"))},[_("span",Wue,[fe(Ye,{name:"sparkles",size:"sm"})]),_("span",zue,[_("span",Uue,R(C(r)("status.swarmLabel")),1),_("span",que,R(C(r)("status.swarmDesc")),1)]),_("span",{class:We(["mode-switch",{on:mt.value}])},[...it[23]||(it[23]=[_("span",{class:"mode-knob"},null,-1)])],2)],2),_("div",{class:We(["mode-row mode-row-goal",{on:dn.value||o.goalMode}])},[_("button",{type:"button",class:"mode-row-main",role:"menuitem",onClick:it[9]||(it[9]=De=>dn.value?i("focusGoal"):i("toggleGoal"))},[_("span",jue,[fe(Ye,{name:"target",size:"sm"})]),_("span",Vue,[_("span",Kue,R(C(r)("status.goalLabel")),1),_("span",Gue,R(C(r)("status.goalDesc")),1)]),dn.value?ue("",!0):(x(),E("span",{key:0,class:We(["mode-switch",{on:o.goalMode}])},[...it[24]||(it[24]=[_("span",{class:"mode-knob"},null,-1)])],2))]),dn.value?(x(),E("div",Yue,[fn.value?(x(),Ae(jt,{key:0,size:"sm",variant:"secondary",class:"mode-row-action",onClick:it[10]||(it[10]=De=>i("controlGoal","pause"))},{default:Le(()=>[fe(Ye,{name:"pause",size:"sm"}),_("span",null,R(C(r)("status.goalPause")),1)]),_:1})):ue("",!0),Po.value?(x(),Ae(jt,{key:1,size:"sm",variant:"primary",class:"mode-row-action",onClick:it[11]||(it[11]=De=>i("controlGoal","resume"))},{default:Le(()=>[fe(Ye,{name:"play",size:"sm"}),_("span",null,R(C(r)("status.goalResume")),1)]),_:1})):ue("",!0),fe(jt,{size:"sm",variant:"danger-soft",class:"mode-row-action",onClick:it[12]||(it[12]=De=>i("controlGoal","cancel"))},{default:Le(()=>[fe(Ye,{name:"close",size:"sm"}),_("span",null,R(C(r)("status.goalCancel")),1)]),_:1})])):ue("",!0)],2)],4)):ue("",!0)],512)):ue("",!0)]),_("div",Zue,[Ln.value?(x(),E("button",{key:0,class:"compact-chip",onClick:it[13]||(it[13]=Ct(De=>i("compact"),["stop"]))},"/compact")):ue("",!0),fe(rn,{text:ln.value},{default:Le(()=>[e.status&&!e.hideContext?(x(),E("span",{key:0,class:"ctx-group",role:"img",tabindex:"0","aria-label":ln.value},[fe(gue,{pct:Rt.value},null,8,["pct"])],8,Xue)):ue("",!0)]),_:1},8,["text"]),e.status?(x(),E("span",{key:1,class:We(["model-pill",{open:be.value}]),role:"button",tabindex:"0",onClick:Ct(rt,["stop"]),onKeydown:[ur(rt,["enter"]),ur(Ct(rt,["prevent"]),["space"])]},[_("b",null,R(e.status.model),1),It.value?(x(),E("span",Jue,R(It.value),1)):ue("",!0),fe(Ye,{class:"cv",name:"chevron-down",size:"sm"})],42,Que)):ue("",!0),e.running?(x(),Ae(rn,{key:2,text:C(r)("composer.interruptTitle")},{default:Le(()=>[_("button",{class:"stop","aria-label":C(r)("composer.interrupt"),onClick:it[14]||(it[14]=De=>i("interrupt"))},[fe(Ye,{name:"stop",size:"sm"})],8,ede)]),_:1},8,["text"])):ue("",!0),_("button",{class:We(["send",{"is-starting":e.starting}]),"aria-label":ze.value,disabled:e.starting,onClick:it[15]||(it[15]=De=>G())},[e.starting?(x(),Ae(Hs,{key:0,size:"sm"})):(x(),Ae(Ye,{key:1,name:"send",size:"sm"}))],10,tde)]),be.value&&e.status?(x(),E("div",{key:0,class:"model-dropdown",role:"menu",onClick:it[17]||(it[17]=Ct(()=>{},["stop"]))},[Lo.value.length>0?(x(),E("div",nde,R(C(r)("status.starredModels")),1)):ue("",!0),(x(!0),E(Pe,null,lt(Lo.value,De=>(x(),E("button",{key:De.id,class:We(["md-row",{"is-current":De.id===e.status.modelId}]),role:"menuitem",onClick:ge=>fi(De.id)},[_("span",sde,[De.id===e.status.modelId?(x(),Ae(Ye,{key:0,name:"check",size:"sm"})):ue("",!0)]),_("span",ide,R(De.displayName??De.model),1),_("span",rde,R(De.provider),1),fe(Ye,{class:"md-star",name:"star",size:"sm"})],10,ode))),128)),Lo.value.length>0?(x(),E("div",lde)):ue("",!0),es.value.length>0?(x(),E("div",ade,R(Jo.value),1)):ue("",!0),(x(!0),E(Pe,null,lt(es.value,De=>(x(),E("button",{key:De.id,class:We(["md-row",{"is-current":De.id===e.status.modelId}]),role:"menuitem",onClick:ge=>fi(De.id)},[_("span",ude,[De.id===e.status.modelId?(x(),Ae(Ye,{key:0,name:"check",size:"sm"})):ue("",!0)]),_("span",dde,R(De.displayName??De.model),1),js(De.id)?(x(),Ae(Ye,{key:0,class:"md-star",name:"star",size:"sm"})):ue("",!0)],10,cde))),128)),es.value.length>0?(x(),E("div",fde)):ue("",!0),_("div",{class:We(["md-thinking",{"is-readonly":Ve.value}])},[_("span",hde,R(C(r)("status.thinkingLabel")),1),un.value==="unsupported"?(x(),E("span",pde,R(C(r)("status.modeNotSupported")),1)):(x(),E("div",{key:1,class:"effort-segments",role:"group","aria-label":C(r)("status.thinkingLabel")},[(x(!0),E(Pe,null,lt(vn.value,De=>(x(),E("button",{key:De,type:"button",class:We(["effort-seg",{"is-active":De===An.value}]),disabled:Ve.value,onClick:ge=>Kt(De)},R(Gt(De)),11,gde))),128))],8,mde))],2),it[25]||(it[25]=_("div",{class:"md-divider"},null,-1)),_("div",vde,R(C(r)("status.cacheNote")),1),it[26]||(it[26]=_("div",{class:"md-divider"},null,-1)),_("button",{class:"md-row md-row-more",role:"menuitem",onClick:it[16]||(it[16]=De=>{ut(),i("pickModel")})},[_("span",yde,R(C(r)("status.moreModels")),1)])])):ue("",!0)],512)]),_("div",{class:We(["drop-overlay",{show:C(Z)}]),"aria-hidden":"true"},[_("div",kde,[fe(Ye,{name:"file-plus",size:"lg"}),_("span",null,R(C(r)("composer.dropToAttach")),1)])],2)],34))}}),VE=ft(bde,[["__scopeId","data-v-d9cdd431"]]),xde={key:0,class:"ui-card__head"},wde={class:"ui-card__body"},_de={key:1,class:"ui-card__foot"},Sde=Qe({__name:"Card",props:{elevated:{type:Boolean,default:!1}},setup(e){return(t,n)=>(x(),E("div",{class:We(["ui-card",{"is-elevated":e.elevated}])},[t.$slots.head?(x(),E("div",xde,[zn(t.$slots,"head",{},void 0,!0)])):ue("",!0),_("div",wde,[zn(t.$slots,"default",{},void 0,!0)]),t.$slots.foot?(x(),E("div",_de,[zn(t.$slots,"foot",{},void 0,!0)])):ue("",!0)],2))}}),rb=ft(Sde,[["__scopeId","data-v-afa05a68"]]),Cde={class:"goal-kicker"},Ade={key:0,class:"goal-progress","aria-hidden":"true"},Mde={class:"goal-full"},Ede={key:0,class:"goal-criterion"},Tde=["inert","aria-hidden"],Nde={class:"goal-meta"},Ide={key:0},Lde={class:"goal-actions"},$de=Qe({__name:"GoalStrip",props:{goal:{},forceExpanded:{}},emits:["controlGoal"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Ot(),{confirm:i}=zf(),r=ne(!1);et(()=>n.forceExpanded,()=>{n.forceExpanded!==void 0&&(r.value=!0)});const l=D(()=>{const d=n.goal.budget.tokenBudget;return!d||d<=0?0:Math.max(0,Math.min(100,Math.round(n.goal.tokensUsed/d*100)))});function a(d){switch(d){case"active":return s("status.goalStatusActive");case"paused":return s("status.goalStatusPaused");case"blocked":return s("status.goalStatusBlocked");case"complete":return s("status.goalStatusComplete")}}function c(d){const f=Math.max(0,Math.round(d/1e3)),h=Math.floor(f/60),p=f%60;return h<=0?`${p}s`:h<60?`${h}m ${p}s`:`${Math.floor(h/60)}h ${h%60}m`}async function u(){await i({title:s("status.goalCancel"),message:s("status.goalCancelConfirm"),confirmLabel:s("status.goalCancelConfirmYes"),cancelLabel:s("status.goalCancelConfirmNo"),variant:"danger"})&&o("controlGoal","cancel")}return(d,f)=>(x(),Ae(rb,{class:We(["goal-strip",{expanded:r.value}])},{head:Le(()=>[_("button",{class:"goal-row",type:"button",onClick:f[0]||(f[0]=h=>r.value=!r.value)},[fe(Ye,{class:"goal-icon",name:"target",size:"md"}),_("span",Cde,R(C(s)("status.goalLabel")),1),_("span",{class:We(["goal-objective",{"expanded-hidden":r.value}])},R(e.goal.objective),3),fe(qi,{variant:e.goal.status==="active"?"success":e.goal.status==="blocked"?"danger":e.goal.status==="paused"?"warning":"neutral",size:"sm",class:"goal-status"},{default:Le(()=>[nt(R(a(e.goal.status)),1)]),_:1},8,["variant"]),e.goal.budget.tokenBudget!==null?(x(),E("span",Ade,[_("span",{class:"goal-progress-fill",style:tn({width:`${l.value}%`})},null,4)])):ue("",!0),fe(Ye,{class:We(["goal-chevron",{open:r.value}]),name:"chevron-right",size:"md"},null,8,["class"])])]),default:Le(()=>[_("div",Mde,R(e.goal.objective),1),e.goal.completionCriterion?(x(),E("div",Ede,[f[3]||(f[3]=_("span",null,"Done when",-1)),_("p",null,R(e.goal.completionCriterion),1)])):ue("",!0)]),foot:Le(()=>[_("div",{class:"goal-footer",inert:!r.value,"aria-hidden":!r.value},[_("div",Nde,[_("span",null,R(e.goal.turnsUsed)+" turns",1),_("span",null,R(C(pr)(e.goal.tokensUsed))+" tokens",1),_("span",null,R(c(e.goal.wallClockMs)),1),e.goal.budget.tokenBudget!==null?(x(),E("span",Ide,R(l.value)+"% token budget",1)):ue("",!0)]),_("div",Lde,[e.goal.status==="active"?(x(),Ae(jt,{key:0,size:"sm",variant:"secondary",class:"goal-action",onClick:f[1]||(f[1]=Ct(h=>o("controlGoal","pause"),["stop"]))},{default:Le(()=>[fe(Ye,{name:"pause",size:"md"}),_("span",null,R(C(s)("status.goalPause")),1)]),_:1})):ue("",!0),e.goal.status==="paused"||e.goal.status==="blocked"?(x(),Ae(jt,{key:1,size:"sm",variant:"primary",class:"goal-action",onClick:f[2]||(f[2]=Ct(h=>o("controlGoal","resume"),["stop"]))},{default:Le(()=>[fe(Ye,{name:"play",size:"md"}),_("span",null,R(C(s)("status.goalResume")),1)]),_:1})):ue("",!0),fe(jt,{size:"sm",variant:"danger-soft",class:"goal-action",onClick:Ct(u,["stop"])},{default:Le(()=>[fe(Ye,{name:"close",size:"md"}),_("span",null,R(C(s)("status.goalCancel")),1)]),_:1})])],8,Tde)]),_:1},8,["class"]))}}),Fde=ft($de,[["__scopeId","data-v-44bef30f"]]),Ode={class:"qh"},Rde={class:"qtitle"},Bde={key:0,class:"qstep"},Dde={key:1,class:"qmin-peek"},Pde={class:"qbody"},Hde=["aria-label"],Wde=["aria-selected","aria-label","onClick"],zde={class:"qstep-num"},Ude={key:1,class:"qheader-chip"},qde={class:"qtext"},jde={class:"qopts"},Vde=["onClick"],Kde={class:"qopt-key"},Gde={class:"qopt-glyph"},Yde={key:0,class:"chk"},Zde={key:1,class:"rad"},Xde={class:"qopt-text"},Qde={class:"qopt-label"},Jde={key:0,class:"qopt-desc"},efe={class:"qopt-glyph"},tfe={key:0,class:"chk"},nfe={key:1,class:"rad"},ofe={class:"qopt-label"},sfe=["placeholder"],ife={class:"qfoot"},rfe=Qe({__name:"QuestionCard",props:{question:{},busyKind:{}},emits:["answer","dismiss"],setup(e,{emit:t}){const n=e,{t:o}=Ot(),s=t,i=ne(0),r=ne(!1),l=D(()=>n.question.questions[i.value]),a=D(()=>n.question.questions.length);function c(){i.value>0&&i.value--}function u(){i.value<a.value-1&&i.value++}function d(L){L>=0&&L<a.value&&(i.value=L)}function f(L){const O=p.value[L];return O?O.kind==="multi"?O.optionIds.length>0:O.kind==="multiWithOther"?O.optionIds.length>0||O.otherText.trim().length>0:O.kind==="other"?O.text.trim().length>0:!0:!1}function h(){return f(l.value.id)}const p=ne({});function m(L){return L.recommended===!0?!0:/\b(?:recommended|recommend)\b|推荐/.test(`${L.label} ${L.description??""}`.toLowerCase())}function y(){const L={...p.value};let O=!1;for(const j of n.question.questions){if(L[j.id])continue;const Z=j.options.filter(m);Z.length!==0&&(L[j.id]=j.multiSelect?{kind:"multi",optionIds:Z.map(ie=>ie.id)}:{kind:"single",optionId:Z[0].id},O=!0)}O&&(p.value=L)}et(()=>n.question.questionId,()=>{i.value=0,r.value=!1,p.value={},v.value={}}),et(()=>n.question,()=>{i.value>=n.question.questions.length&&(i.value=0),y()},{immediate:!0,deep:!0});function k(L,O){const j=p.value[L];if(j&&j.kind==="single"&&j.optionId===O){const Z={...p.value};delete Z[L],p.value=Z}else p.value={...p.value,[L]:{kind:"single",optionId:O}}}function g(L,O){const j=p.value[L],Z=j&&(j.kind==="multi"||j.kind==="multiWithOther")?j.kind==="multi"?[...j.optionIds]:[...j.optionIds]:[],ie=Z.indexOf(O);ie>=0?Z.splice(ie,1):Z.push(O);const U=p.value[L],q=U&&U.kind==="multiWithOther"?U.otherText:"";q?p.value={...p.value,[L]:{kind:"multiWithOther",optionIds:Z,otherText:q}}:p.value={...p.value,[L]:{kind:"multi",optionIds:Z}}}const v=ne({}),b=ne(null);function A(L){const O=n.question.questions.find(Z=>Z.id===L),j=v.value[L]??"";if(O.multiSelect){const Z=p.value[L],ie=Z&&(Z.kind==="multi"||Z.kind==="multiWithOther")?Z.kind==="multi"?[...Z.optionIds]:[...Z.optionIds]:[];p.value={...p.value,[L]:{kind:"multiWithOther",optionIds:ie,otherText:j}}}else p.value={...p.value,[L]:{kind:"other",text:j}}}function I(L){A(L),kt(()=>b.value?.focus())}function T(L,O){const j=p.value[L];return j?j.kind==="single"?j.optionId===O:j.kind==="multi"||j.kind==="multiWithOther"?j.optionIds.includes(O):!1:!1}function M(L){const O=p.value[L];return!!(O&&(O.kind==="other"||O.kind==="multiWithOther"))}function $(){return n.question.questions.every(L=>f(L.id))}const N=D(()=>n.busyKind==="answer"),F=D(()=>n.busyKind==="dismiss"),S=D(()=>!!n.busyKind);function B(){if(S.value||!$())return;const L={answers:p.value,method:"click"};s("answer",n.question.questionId,L)}function W(){S.value||s("dismiss",n.question.questionId)}function z(L){const O=(document.activeElement?.tagName??"").toLowerCase(),j=O==="input"||O==="textarea";if(S.value)return;if(L.key==="Enter"){if(L.preventDefault(),r.value)return;i.value<a.value-1&&h()?u():$()&&B();return}if(j)return;if(L.key==="Escape"){L.preventDefault(),W();return}if(r.value)return;const Z=parseInt(L.key,10);if(!isNaN(Z)&&Z>=1&&Z<=9){L.preventDefault();const ie=l.value,U=Z-1,q=ie.options[U];q&&(ie.multiSelect?g(ie.id,q.id):k(ie.id,q.id))}}return wn(()=>document.addEventListener("keydown",z)),In(()=>document.removeEventListener("keydown",z)),(L,O)=>(x(),Ae(rb,{class:We(["qcard",{minimized:r.value}])},WA({head:Le(()=>[_("div",Ode,[O[5]||(O[5]=_("span",{class:"qh-ic"},"?",-1)),_("span",Rde,R(C(o)("question.title")),1),a.value>1&&!r.value?(x(),E("span",Bde,R(C(o)("question.step",{current:i.value+1,total:a.value})),1)):ue("",!0),r.value?(x(),E("span",Dde,R(l.value.question),1)):ue("",!0),fe(Kn,{class:"qmin",size:"sm",label:r.value?C(o)("question.expand"):C(o)("question.minimize"),onClick:O[0]||(O[0]=j=>r.value=!r.value)},{default:Le(()=>[r.value?(x(),Ae(Ye,{key:0,name:"chevron-up",size:"md"})):(x(),Ae(Ye,{key:1,name:"minus",size:"md"}))]),_:1},8,["label"])])]),_:2},[r.value?void 0:{name:"default",fn:Le(()=>[_("div",Pde,[a.value>1?(x(),E("div",{key:0,class:"qsteps",role:"tablist","aria-label":C(o)("question.step",{current:i.value+1,total:a.value})},[(x(!0),E(Pe,null,lt(n.question.questions,(j,Z)=>(x(),E("button",{key:j.id,type:"button",class:We(["qstep-dot",{active:Z===i.value,answered:f(j.id)}]),"aria-selected":Z===i.value,"aria-label":C(o)("question.step",{current:Z+1,total:a.value}),onClick:ie=>d(Z)},[_("span",zde,R(Z+1),1)],10,Wde))),128))],8,Hde)):ue("",!0),l.value.header?(x(),E("div",Ude,[fe(qi,{variant:"neutral",size:"sm"},{default:Le(()=>[nt(R(l.value.header),1)]),_:1})])):ue("",!0),_("div",qde,R(l.value.question),1),l.value.body?(x(),Ae(G1,{key:2,text:l.value.body,class:"qmdbody"},null,8,["text"])):ue("",!0),_("div",jde,[(x(!0),E(Pe,null,lt(l.value.options,(j,Z)=>(x(),E("label",{key:j.id,class:We(["qopt",{selected:T(l.value.id,j.id)}]),onClick:Ct(ie=>l.value.multiSelect?g(l.value.id,j.id):k(l.value.id,j.id),["prevent"])},[_("span",Kde,R(Z+1),1),_("span",Gde,[l.value.multiSelect?(x(),E("span",Yde,R(T(l.value.id,j.id)?"■":"□"),1)):(x(),E("span",Zde,R(T(l.value.id,j.id)?"●":"○"),1))]),_("span",Xde,[_("span",Qde,R(j.label),1),j.description?(x(),E("span",Jde,R(j.description),1)):ue("",!0)])],10,Vde))),128)),l.value.allowOther?(x(),E("label",{key:0,class:We(["qopt",{selected:M(l.value.id)}]),onClick:O[4]||(O[4]=Ct(j=>I(l.value.id),["prevent"]))},[O[6]||(O[6]=_("span",{class:"qopt-key"},null,-1)),_("span",efe,[l.value.multiSelect?(x(),E("span",tfe,R(M(l.value.id)?"■":"□"),1)):(x(),E("span",nfe,R(M(l.value.id)?"●":"○"),1))]),_("span",ofe,R(l.value.otherLabel??C(o)("question.otherDefault")),1),Wn(_("input",{ref_key:"otherInputEl",ref:b,"onUpdate:modelValue":O[1]||(O[1]=j=>v.value[l.value.id]=j),class:"other-input",type:"text",placeholder:l.value.otherLabel??C(o)("question.otherDefault"),onInput:O[2]||(O[2]=j=>A(l.value.id)),onFocus:O[3]||(O[3]=j=>A(l.value.id))},null,40,sfe),[[ws,v.value[l.value.id]]])],2)):ue("",!0)])])]),key:"0"},r.value?void 0:{name:"foot",fn:Le(()=>[_("div",ife,[i.value<a.value-1?(x(),Ae(jt,{key:0,class:"qfoot-btn qfoot-main",size:"sm",variant:"primary",disabled:!h(),onClick:u},{default:Le(()=>[nt(R(C(o)("question.nextQuestion")),1)]),_:1},8,["disabled"])):(x(),Ae(jt,{key:1,class:"qfoot-btn qfoot-main",size:"sm",variant:"primary",disabled:!$(),loading:N.value,onClick:B},{default:Le(()=>[nt(R(C(o)("question.submit")),1)]),_:1},8,["disabled","loading"])),a.value>1?(x(),Ae(jt,{key:2,class:"qfoot-btn",size:"sm",variant:"secondary",disabled:i.value===0||S.value,onClick:c},{default:Le(()=>[nt(R(C(o)("question.back")),1)]),_:1},8,["disabled"])):ue("",!0),fe(jt,{class:"qfoot-btn",size:"sm",variant:"ghost",loading:F.value,disabled:S.value,onClick:W},{default:Le(()=>[nt(R(C(o)("question.dismiss")),1)]),_:1},8,["loading","disabled"])])]),key:"1"}]),1032,["class"]))}}),lfe=ft(rfe,[["__scopeId","data-v-672d70d1"]]),afe={class:"ah"},cfe={class:"akind"},ufe={class:"apath"},dfe={class:"ah-path"},ffe={key:1,class:"diff"},hfe={class:"dg"},pfe={class:"dc"},mfe={key:2,class:"body-shell"},gfe={class:"shell-cmd"},vfe={key:0,class:"shell-cwd"},yfe={key:1,class:"shell-danger"},kfe={key:3,class:"body-file"},bfe={class:"file-bar"},xfe={class:"file-lang"},wfe={class:"file-content"},_fe={class:"file-ln"},Sfe={class:"file-text"},Cfe={key:4,class:"body-chip"},Afe={class:"chip-label"},Mfe={class:"chip-value"},Efe={key:0,class:"chip-detail"},Tfe={key:5,class:"body-chip"},Nfe={key:0,class:"chip-label"},Ife={class:"chip-value"},Lfe={key:6,class:"body-chip"},$fe={class:"chip-label"},Ffe={class:"chip-value"},Ofe={key:0,class:"chip-detail"},Rfe={key:7,class:"body-chip"},Bfe={class:"chip-label"},Dfe={class:"chip-value"},Pfe={key:0,class:"chip-detail"},Hfe={key:8,class:"body-todo"},Wfe={class:"todo-glyph"},zfe={key:9,class:"body-plan"},Ufe={key:10,class:"body-generic"},qfe={class:"gen-text"},jfe={key:11,class:"feedback-wrap"},Vfe=["placeholder"],Kfe={class:"feedback-hint"},Gfe={key:0,class:"plan-actions"},Yfe={key:1,class:"abtn"},Zfe=Qe({__name:"ApprovalCard",props:{block:{},agentName:{},busy:{type:Boolean}},emits:["decide"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Ot(),i=D(()=>{const N=n.block;return N.kind!=="plan_review"?null:{plan:N.plan,path:N.path,options:N.options??[]}}),r=ne(!1),l=["shell","diff","file","fileop","url","search","invocation","todo","plan_review","generic"];function a(){const N=l.includes(n.block.kind)?n.block.kind:"generic";return s(`approval.title.${N}`)}const c=ne(!1),u=ne(""),d=ne(null);function f(){n.busy||(c.value=!0,u.value="",setTimeout(()=>d.value?.focus(),0))}function h(){if(n.busy)return;const N=u.value.trim();i.value?k("feedback",{decision:"rejected",selectedLabel:"Revise",feedback:N||void 0}):k("feedback",{decision:"rejected",feedback:N||void 0}),c.value=!1,u.value=""}function p(){c.value=!1,u.value=""}function m(N){N.key==="Enter"&&!N.shiftKey?(N.preventDefault(),h()):N.key==="Escape"&&(N.preventDefault(),p())}const y=ne(null);et(()=>n.busy,N=>{N||(y.value=null)});function k(N,F){n.busy||(y.value=N,o("decide",F))}function g(){k("approve",{decision:"approved"})}function v(){k("approveSession",{decision:"approved",scope:"session"})}function b(){k("reject",{decision:"rejected"})}function A(){k("approvePlan",{decision:"approved"})}function I(N){k(`option:${N}`,{decision:"approved",selectedLabel:N})}function T(){n.busy||f()}function M(){k("rejectAndExit",{decision:"rejected",selectedLabel:"Reject and Exit"})}function $(N){const F=(document.activeElement?.tagName??"").toLowerCase();if(F==="input"||F==="textarea"||n.busy||r.value)return;const S=i.value;if(S){if(S.options.length===0){N.key==="1"?(N.preventDefault(),A()):N.key==="2"?(N.preventDefault(),T()):N.key==="3"&&(N.preventDefault(),M());return}N.key==="1"&&S.options[0]?(N.preventDefault(),I(S.options[0].label)):N.key==="2"&&S.options[1]?(N.preventDefault(),I(S.options[1].label)):N.key==="3"&&S.options[2]&&(N.preventDefault(),I(S.options[2].label));return}N.key==="1"?(N.preventDefault(),g()):N.key==="2"?(N.preventDefault(),v()):N.key==="3"?(N.preventDefault(),b()):N.key==="4"&&(N.preventDefault(),f())}return wn(()=>document.addEventListener("keydown",$)),In(()=>document.removeEventListener("keydown",$)),(N,F)=>(x(),Ae(rb,{class:We(["appr",{minimized:r.value}])},WA({head:Le(()=>[_("div",afe,[F[2]||(F[2]=_("span",{class:"ah-ic"},"!",-1)),_("span",cfe,R(a()),1),_("span",ufe,[e.block.kind==="diff"||e.block.kind==="file"||e.block.kind==="fileop"?(x(),E(Pe,{key:0},[nt(R(e.block.path),1)],64)):e.block.kind==="shell"?(x(),E(Pe,{key:1},[nt(R(e.block.command),1)],64)):e.block.kind==="url"?(x(),E(Pe,{key:2},[nt(R(e.block.url),1)],64)):e.block.kind==="search"?(x(),E(Pe,{key:3},[nt(R(e.block.query),1)],64)):e.block.kind==="invocation"?(x(),E(Pe,{key:4},[nt(R(e.block.name),1)],64)):e.block.kind==="generic"?(x(),E(Pe,{key:5},[nt(R(e.block.summary),1)],64)):ue("",!0)]),e.agentName&&!r.value?(x(),Ae(qi,{key:0,variant:"neutral",size:"sm"},{default:Le(()=>[nt(R(C(s)("approval.subagentBadge",{name:e.agentName})),1)]),_:1})):ue("",!0),r.value?ue("",!0):(x(),Ae(qi,{key:1,variant:"warning",size:"sm",class:"aw"},{default:Le(()=>[nt(R(C(s)("approval.required")),1)]),_:1})),fe(Kn,{class:"amin",size:"sm",label:r.value?C(s)("question.expand"):C(s)("question.minimize"),onClick:F[0]||(F[0]=S=>r.value=!r.value)},{default:Le(()=>[r.value?(x(),Ae(Ye,{key:0,name:"chevron-up",size:"md"})):(x(),Ae(Ye,{key:1,name:"minus",size:"md"}))]),_:1},8,["label"])])]),_:2},[r.value?void 0:{name:"default",fn:Le(()=>[e.block.kind==="plan_review"&&e.block.path?(x(),Ae(rn,{key:0,text:e.block.path},{default:Le(()=>[_("div",dfe,R(e.block.path),1)]),_:1},8,["text"])):ue("",!0),e.block.kind==="diff"?(x(),E("div",ffe,[(x(!0),E(Pe,null,lt(e.block.diff,(S,B)=>(x(),E("div",{key:B,class:We(["dl",S.kind==="add"?"add":S.kind==="rem"?"del":""])},[_("span",hfe,R(S.gutter),1),_("span",pfe,R(S.text),1)],2))),128))])):e.block.kind==="shell"?(x(),E("div",mfe,[_("div",gfe,[F[3]||(F[3]=_("span",{class:"shell-dollar"},"$",-1)),nt(" "+R(e.block.command),1)]),e.block.cwd?(x(),E("div",vfe,"cwd: "+R(e.block.cwd),1)):ue("",!0),e.block.danger?(x(),E("div",yfe,R(C(s)("approval.danger",{detail:e.block.danger})),1)):ue("",!0)])):e.block.kind==="file"?(x(),E("div",kfe,[_("div",bfe,[_("span",xfe,R(e.block.language??""),1)]),_("div",wfe,[(x(!0),E(Pe,null,lt(e.block.content.split(`
|
|
309
|
-
`),(S,B)=>(x(),E("div",{key:B,class:"file-line"},[_("span",_fe,R(B+1),1),_("span",Sfe,R(S),1)]))),128))])])):e.block.kind==="fileop"?(x(),E("div",Cfe,[_("span",Afe,R(e.block.op),1),_("span",Mfe,R(e.block.path),1),e.block.detail?(x(),E("span",Efe,R(e.block.detail),1)):ue("",!0)])):e.block.kind==="url"?(x(),E("div",Tfe,[e.block.method?(x(),E("span",Nfe,R(e.block.method),1)):ue("",!0),_("span",Ife,R(e.block.url),1)])):e.block.kind==="search"?(x(),E("div",Lfe,[_("span",$fe,R(C(s)("approval.searchQueryLabel")),1),_("span",Ffe,R(e.block.query),1),e.block.scope?(x(),E("span",Ofe,R(C(s)("approval.searchScope",{scope:e.block.scope})),1)):ue("",!0)])):e.block.kind==="invocation"?(x(),E("div",Rfe,[_("span",Bfe,R(e.block.kind2),1),_("span",Dfe,R(e.block.name),1),e.block.description?(x(),E("span",Pfe,R(e.block.description),1)):ue("",!0)])):e.block.kind==="todo"?(x(),E("div",Hfe,[(x(!0),E(Pe,null,lt(e.block.items,(S,B)=>(x(),E("div",{key:B,class:"todo-item"},[_("span",Wfe,R(S.status==="done"||S.status==="completed"?"✓":"○"),1),_("span",{class:We(["todo-title",{"todo-done":S.status==="done"||S.status==="completed"}])},R(S.title),3)]))),128))])):e.block.kind==="plan_review"?(x(),E("div",zfe,[fe(G1,{text:e.block.plan},null,8,["text"])])):(x(),E("div",Ufe,[_("span",qfe,R(e.block.summary),1)])),c.value?(x(),E("div",jfe,[Wn(_("textarea",{ref_key:"feedbackRef",ref:d,"onUpdate:modelValue":F[1]||(F[1]=S=>u.value=S),class:"feedback-ta",placeholder:C(s)("approval.feedbackPlaceholder"),rows:"2",onKeydown:m},null,40,Vfe),[[ws,u.value]]),_("div",Kfe,R(C(s)("approval.feedbackHint")),1)])):ue("",!0)]),key:"0"},r.value?void 0:{name:"foot",fn:Le(()=>[i.value?(x(),E("div",Gfe,[i.value.options.length>0?(x(!0),E(Pe,{key:0},lt(i.value.options,(S,B)=>(x(),Ae(rn,{key:B,text:S.description},{default:Le(()=>[fe(jt,{class:"kbtn",size:"sm",variant:"primary",loading:y.value===`option:${S.label}`,disabled:e.busy,onClick:W=>I(S.label)},{default:Le(()=>[nt(R(S.label),1),fe(Er,{class:"k",keys:[String(B+1)]},null,8,["keys"])]),_:2},1032,["loading","disabled","onClick"])]),_:2},1032,["text"]))),128)):(x(),Ae(jt,{key:1,class:"kbtn",size:"sm",variant:"primary",loading:y.value==="approvePlan",disabled:e.busy,onClick:A},{default:Le(()=>[nt(R(C(s)("approval.approvePlan")),1),fe(Er,{class:"k",keys:["1"]})]),_:1},8,["loading","disabled"])),fe(jt,{class:"kbtn",size:"sm",variant:"secondary",disabled:e.busy,onClick:T},{default:Le(()=>[nt(R(C(s)("approval.revise")),1),i.value.options.length===0?(x(),Ae(Er,{key:0,class:"k",keys:["2"]})):ue("",!0)]),_:1},8,["disabled"]),fe(jt,{class:"kbtn",size:"sm",variant:"danger-soft",loading:y.value==="rejectAndExit",disabled:e.busy,onClick:M},{default:Le(()=>[nt(R(C(s)("approval.rejectAndExit")),1),i.value.options.length===0?(x(),Ae(Er,{key:0,class:"k",keys:["3"]})):ue("",!0)]),_:1},8,["loading","disabled"])])):(x(),E("div",Yfe,[fe(jt,{class:"kbtn",size:"sm",variant:"primary",loading:y.value==="approve",disabled:e.busy,onClick:g},{default:Le(()=>[nt(R(C(s)("approval.approve")),1),fe(Er,{class:"k",keys:["1"]})]),_:1},8,["loading","disabled"]),fe(jt,{class:"kbtn",size:"sm",variant:"secondary",loading:y.value==="approveSession",disabled:e.busy,onClick:v},{default:Le(()=>[nt(R(C(s)("approval.approveSession")),1),fe(Er,{class:"k",keys:["2"]})]),_:1},8,["loading","disabled"]),fe(jt,{class:"kbtn",size:"sm",variant:"secondary",loading:y.value==="reject",disabled:e.busy,onClick:b},{default:Le(()=>[nt(R(C(s)("approval.reject")),1),fe(Er,{class:"k",keys:["3"]})]),_:1},8,["loading","disabled"]),fe(jt,{class:"kbtn",size:"sm",variant:"secondary",disabled:e.busy,onClick:f},{default:Le(()=>[nt(R(C(s)("approval.feedback")),1),fe(Er,{class:"k",keys:["4"]})]),_:1},8,["disabled"])]))]),key:"1"}]),1032,["class"]))}}),Xfe=ft(Zfe,[["__scopeId","data-v-9ab30d7f"]]),Qfe=Qe({__name:"StatusGlyph",props:{status:{}},setup(e){const t=e,n={pending:"○",run:"●",done:"✓",fail:"✗"};return(o,s)=>(x(),E("span",{class:We(["status-glyph",`s-${t.status}`]),"aria-hidden":"true"},R(n[t.status]),3))}}),KE=ft(Qfe,[["__scopeId","data-v-f7213288"]]),Jfe={class:"taskspane"},ehe={class:"tp-head"},the={class:"tp-title"},nhe={class:"tp-count"},ohe={class:"tp-list"},she={key:0,class:"tp-empty"},ihe=["role","onClick"],rhe={class:"tp-name"},lhe={class:"tp-time"},ahe=["onClick"],che={key:0,class:"tp-detail"},uhe={key:0,class:"tp-codebox"},dhe=["onClick"],fhe={class:"tp-pre"},hhe={class:"tp-cmd"},phe={key:1,class:"tp-codebox"},mhe=["onClick"],ghe={class:"tp-pre"},vhe=Qe({__name:"TasksPane",props:{tasks:{}},emits:["cancel","open"],setup(e,{emit:t}){const n=t,{t:o}=Ot(),s=Do(new Set),i=Do(new Set),r=Do(new Set);function l(p){return!!(p.output&&p.output.length>0||p.meta)}function a(p){if(p.kind==="subagent"){n("open",p.id);return}l(p)&&(s.has(p.id)?s.delete(p.id):s.add(p.id))}function c(p){return p.kind==="subagent"||l(p)}function u(p){return p==="run"||p==="done"||p==="fail"?p:"pending"}async function d(p,m,y){await Xo(p)&&(y.add(m),setTimeout(()=>y.delete(m),1500))}async function f(p){p.meta&&await d(p.meta,p.id,i)}async function h(p){const m=p.output?.join(`
|
|
310
|
-
`)??"";m&&await d(m,p.id,r)}return(p,m)=>(x(),E("div",Jfe,[_("div",ehe,[_("span",the,R(C(o)("tasks.tag")),1),_("span",nhe,R(e.tasks.length),1)]),_("div",ohe,[e.tasks.length===0?(x(),E("div",she,R(C(o)("tasks.emptyTasks")),1)):(x(!0),E(Pe,{key:1},lt(e.tasks,y=>(x(),E("div",{key:y.id,class:We(["tp-row",{done:y.state==="done",fail:y.state==="fail",expandable:c(y)}])},[_("div",{class:"tp-main",role:c(y)?"button":void 0,onClick:k=>a(y)},[fe(KE,{status:u(y.state)},null,8,["status"]),_("span",rhe,R(y.name),1),fe(qi,{variant:"neutral",size:"sm"},{default:Le(()=>[nt(R(y.kind),1)]),_:2},1024),_("span",lhe,R(y.timing),1),y.state==="run"?(x(),E("button",{key:0,class:"tp-stop",onClick:Ct(k=>n("cancel",y.id),["stop"])},R(C(o)("tasks.stop")),9,ahe)):ue("",!0),y.kind==="subagent"?(x(),Ae(Ye,{key:1,class:"tp-chevron",name:"chevron-right",size:"sm"})):l(y)?(x(),Ae(Ye,{key:2,class:We(["tp-chevron",{open:s.has(y.id)}]),name:"chevron-right",size:"sm"},null,8,["class"])):ue("",!0)],8,ihe),s.has(y.id)&&l(y)?(x(),E("div",che,[y.meta?(x(),E("div",uhe,[_("button",{class:We(["tp-copy",{copied:i.has(y.id)}]),onClick:Ct(k=>f(y),["stop"])},R(i.has(y.id)?"已复制":"复制"),11,dhe),_("pre",fhe,[_("code",null,[_("span",hhe,R(y.meta),1)])])])):ue("",!0),y.output&&y.output.length>0?(x(),E("div",phe,[_("button",{class:We(["tp-copy",{copied:r.has(y.id)}]),onClick:Ct(k=>h(y),["stop"])},R(r.has(y.id)?"已复制":"复制"),11,mhe),_("pre",ghe,[_("code",null,[m[0]||(m[0]=nt(`
|
|
311
|
-
`,-1)),(x(!0),E(Pe,null,lt(y.output,(k,g)=>(x(),E("span",{key:g,class:"tp-line"},R(k),1))),128)),m[1]||(m[1]=nt(`
|
|
312
|
-
`,-1))])])])):ue("",!0)])):ue("",!0)],2))),128))])]))}}),T3=ft(vhe,[["__scopeId","data-v-a7458569"]]),yhe={class:"todo-card"},khe={key:0,class:"tc-empty"},bhe={class:"tc-name"},xhe=Qe({__name:"TodoCard",props:{todos:{}},setup(e){const t=e,{t:n}=Ot();function o(s){return s==="in_progress"?"run":s}return(s,i)=>(x(),E("div",yhe,[t.todos.length===0?(x(),E("div",khe,[i[0]||(i[0]=_("svg",{class:"tc-empty-ico",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[_("path",{d:"M9 11l2 2 4-4"}),_("rect",{x:"4",y:"4",width:"16",height:"16",rx:"3"})],-1)),_("span",null,R(C(n)("tasks.emptyTodo")),1)])):ue("",!0),(x(!0),E(Pe,null,lt(t.todos,(r,l)=>(x(),E("div",{key:l,class:We(["tc-row",`s-${r.status}`])},[fe(KE,{status:o(r.status)},null,8,["status"]),_("span",bhe,R(r.title),1)],2))),128))]))}}),whe=ft(xhe,[["__scopeId","data-v-7c1dfd30"]]),_he=["disabled","aria-pressed"],She=Qe({__name:"Pill",props:{clickable:{type:Boolean,default:!0},active:{type:Boolean},disabled:{type:Boolean},ariaPressed:{type:Boolean}},emits:["click"],setup(e){return(t,n)=>e.clickable?(x(),E("button",{key:0,class:We(["ui-pill",{"is-active":e.active}]),type:"button",disabled:e.disabled,"aria-pressed":e.ariaPressed,onClick:n[0]||(n[0]=o=>t.$emit("click",o))},[zn(t.$slots,"default",{},void 0,!0)],10,_he)):(x(),E("span",{key:1,class:We(["ui-pill",{"is-active":e.active}])},[zn(t.$slots,"default",{},void 0,!0)],2))}}),Nv=ft(She,[["__scopeId","data-v-64fdc56d"]]),Che={class:"dock-work-head"},Ahe={key:0,class:"dock-work-tab static"},Mhe={key:1,class:"dock-work-tab static"},Ehe={key:2,class:"dock-work-tab static"},The={class:"dock-work-body"},Nhe={class:"dw-count"},Ihe={class:"dw-count"},Lhe={class:"dw-count"},$he=Qe({__name:"ChatDock",props:{sessionId:{},running:{type:Boolean},starting:{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:{},questionBusyKind:{},pendingApproval:{},approvalBusy:{type:Boolean},mobile:{type:Boolean}},emits:["submit","steer","command","interrupt","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","openBtw","createGoal","controlGoal","focusGoal","focusSwarm","compact","pickModel","selectModel","answer","dismiss","approval","cancelTask","toggle-dock-panel","close-dock-panel","openAgent"],setup(e,{expose:t,emit:n}){const o=e,s=n,{t:i}=Ot(),r=ne(null),l=ne(null),a=ne(null),c=ne(null);function u(y){return r.value?(r.value.loadForEdit(y),!0):!1}function d(y){r.value?.loadAttachmentsForEdit(y)}function f(){r.value?.focus()}function h(y){if(!o.dockPanel)return;const k=y.target;k&&(l.value?.contains(k)||a.value?.contains(k)||s("close-dock-panel"))}et(()=>o.dockPanel,y=>{typeof document>"u"||(document.removeEventListener("mousedown",h,!0),y&&document.addEventListener("mousedown",h,!0))},{immediate:!0});let p=null;function m(){const y=c.value?.offsetHeight??0;document.documentElement.style.setProperty("--dock-h",`${y}px`)}return wn(()=>{typeof ResizeObserver!="function"||!c.value||(p=new ResizeObserver(m),p.observe(c.value),m())}),In(()=>{typeof document<"u"&&document.removeEventListener("mousedown",h,!0),p?.disconnect(),p=null}),t({loadForEdit:u,loadAttachmentsForEdit:d,focus:f}),(y,k)=>(x(),E("div",{ref_key:"dockRef",ref:c,class:We(["chat-dock",[e.mobile?"align-mobile":"align-center"]]),onClick:k[28]||(k[28]=Ct(()=>{},["stop"]))},[fe(Ua,{name:"dock-panel"},{default:Le(()=>[e.dockPanel?(x(),E("div",{key:0,ref_key:"workPanelRef",ref:l,class:"dock-work-panel",onClick:k[3]||(k[3]=Ct(()=>{},["stop"]))},[_("div",Che,[e.dockPanel==="bash"?(x(),E("span",Ahe,R(C(i)("tasks.dockBash"))+" · "+R(e.bashRunning)+" "+R(C(i)("tasks.running")),1)):e.dockPanel==="subagent"?(x(),E("span",Mhe,R(C(i)("tasks.dockSubagent"))+" · "+R(e.subagentRunning)+" "+R(C(i)("tasks.running")),1)):e.dockPanel==="todos"?(x(),E("span",Ehe,R(C(i)("tasks.dockTodos"))+" · "+R(e.todoDoneCount)+"/"+R(e.todos?.length??0),1)):ue("",!0)]),_("div",The,[e.dockPanel==="bash"?(x(),Ae(T3,{key:0,tasks:e.bashTasks,onCancel:k[0]||(k[0]=g=>s("cancelTask",g))},null,8,["tasks"])):e.dockPanel==="subagent"?(x(),Ae(T3,{key:1,tasks:e.subagentTasks,onCancel:k[1]||(k[1]=g=>s("cancelTask",g)),onOpen:k[2]||(k[2]=g=>s("openAgent",g))},null,8,["tasks"])):e.dockPanel==="todos"?(x(),Ae(whe,{key:2,todos:e.todos??[]},null,8,["todos"])):ue("",!0)])],512)):ue("",!0)]),_:1}),e.goal?(x(),Ae(Fde,{key:0,goal:e.goal,"force-expanded":e.goalExpandSignal,onControlGoal:k[4]||(k[4]=g=>s("controlGoal",g))},null,8,["goal","force-expanded"])):ue("",!0),e.hasDockWork?(x(),E("div",{key:1,ref_key:"workbarRef",ref:a,class:"dock-workbar"},[e.bashTasks.length>0?(x(),Ae(Nv,{key:0,active:e.dockPanel==="bash","aria-pressed":e.dockPanel==="bash",onClick:k[5]||(k[5]=g=>s("toggle-dock-panel","bash"))},{default:Le(()=>[fe(Ye,{name:"clock",size:"md"}),_("span",null,R(C(i)("tasks.dockBash")),1),_("span",Nhe,[k[29]||(k[29]=nt("(",-1)),_("b",null,R(e.bashTasks.length),1),k[30]||(k[30]=nt(")",-1))])]),_:1},8,["active","aria-pressed"])):ue("",!0),e.subagentTasks.length>0?(x(),Ae(Nv,{key:1,active:e.dockPanel==="subagent","aria-pressed":e.dockPanel==="subagent",onClick:k[6]||(k[6]=g=>s("toggle-dock-panel","subagent"))},{default:Le(()=>[fe(Ye,{name:"sparkles",size:"md"}),_("span",null,R(C(i)("tasks.dockSubagent")),1),_("span",Ihe,[k[31]||(k[31]=nt("(",-1)),_("b",null,R(e.subagentTasks.length),1),k[32]||(k[32]=nt(")",-1))])]),_:1},8,["active","aria-pressed"])):ue("",!0),(e.todos?.length??0)>0?(x(),Ae(Nv,{key:2,active:e.dockPanel==="todos","aria-pressed":e.dockPanel==="todos",onClick:k[7]||(k[7]=g=>s("toggle-dock-panel","todos"))},{default:Le(()=>[fe(Ye,{name:"check-list",size:"md"}),_("span",null,R(C(i)("tasks.dockTodos")),1),_("span",Lhe,[k[33]||(k[33]=nt("(",-1)),_("b",null,R(e.todoDoneCount)+"/"+R(e.todos?.length??0),1),k[34]||(k[34]=nt(")",-1))])]),_:1},8,["active","aria-pressed"])):ue("",!0)],512)):ue("",!0),e.pendingQuestion?(x(),Ae(lfe,{key:e.pendingQuestion.questionId,question:e.pendingQuestion,"busy-kind":e.questionBusyKind,onAnswer:k[8]||(k[8]=(g,v)=>s("answer",g,v)),onDismiss:k[9]||(k[9]=g=>s("dismiss",g))},null,8,["question","busy-kind"])):e.pendingApproval?(x(),Ae(Xfe,{key:e.pendingApproval.approvalId,class:"dock-approval",block:e.pendingApproval.block,"agent-name":e.pendingApproval.agentName,busy:e.approvalBusy,onDecide:k[10]||(k[10]=g=>s("approval",e.pendingApproval.approvalId,g))},null,8,["block","agent-name","busy"])):(x(),Ae(VE,{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,goal:e.goal,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,starting:e.starting,onSubmit:k[11]||(k[11]=g=>s("submit",g)),onSteer:k[12]||(k[12]=g=>s("steer",g)),onCommand:k[13]||(k[13]=g=>s("command",g)),onInterrupt:k[14]||(k[14]=g=>s("interrupt")),onSetPermission:k[15]||(k[15]=g=>s("setPermission",g)),onSetThinking:k[16]||(k[16]=g=>s("setThinking",g)),onTogglePlan:k[17]||(k[17]=g=>s("togglePlan")),onToggleSwarm:k[18]||(k[18]=g=>s("toggleSwarm")),onToggleGoal:k[19]||(k[19]=g=>s("toggleGoal")),onOpenBtw:k[20]||(k[20]=g=>s("openBtw")),onCreateGoal:k[21]||(k[21]=g=>s("createGoal",g)),onControlGoal:k[22]||(k[22]=g=>s("controlGoal",g)),onFocusGoal:k[23]||(k[23]=g=>s("focusGoal")),onFocusSwarm:k[24]||(k[24]=g=>s("focusSwarm")),onCompact:k[25]||(k[25]=g=>s("compact")),onPickModel:k[26]||(k[26]=g=>s("pickModel")),onSelectModel:k[27]||(k[27]=g=>s("selectModel",g))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","goal","activation-badges","models","starred-ids","skills","starting"]))],2))}}),Fhe=ft($he,[["__scopeId","data-v-61ebeda5"]]),Ohe=["aria-label","aria-hidden"],Rhe={class:"toc-scroll"},Bhe=["onClick"],Dhe={class:"toc-label"},Phe=240,Hhe=Qe({__name:"ConversationToc",props:{items:{},activeTurnId:{},mobile:{type:Boolean},sessionLoading:{type:Boolean},occluded:{type:Boolean}},emits:["select"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Ot(),i=ne(null),r=ne(!0);let l=null;function a(){const u=i.value,d=u?.offsetParent;if(!u||!d)return;const f=u.getBoundingClientRect().left,h=d.getBoundingClientRect().right;r.value=h-f>=Phe}const c=D(()=>!n.mobile&&!n.sessionLoading&&n.items.length>1);return et(c,u=>{l?.disconnect(),l=null,u&&kt(()=>{const d=i.value,f=d?.offsetParent;!d||!f||(typeof ResizeObserver<"u"&&(l=new ResizeObserver(a),l.observe(f)),a())})},{immediate:!0}),so(()=>{l?.disconnect(),l=null}),(u,d)=>c.value?(x(),E("nav",{key:0,ref_key:"navRef",ref:i,class:We(["conversation-toc",{"toc-clipped":!r.value||e.occluded}]),"aria-label":C(s)("conversation.toc"),"aria-hidden":r.value&&!e.occluded?void 0:!0},[_("div",Rhe,[(x(!0),E(Pe,null,lt(e.items,f=>(x(),E("button",{key:f.id,type:"button",class:We(["toc-row",{active:e.activeTurnId===f.id}]),onClick:h=>o("select",f.id)},[d[0]||(d[0]=_("span",{class:"toc-bar"},null,-1)),_("span",Dhe,R(f.title),1)],10,Bhe))),128))])],10,Ohe)):ue("",!0)}}),Whe=ft(Hhe,[["__scopeId","data-v-ad916253"]]),zhe=5;function Uhe(e,t,n,o=zhe){if(n||e.length<=o)return e;const s=e.slice(0,o);if(t&&!s.some(i=>i.id===t)){const i=e.find(r=>r.id===t);i&&(s[o-1]=i)}return s}const qhe={class:"chat-layout"},jhe={class:"empty-hint"},Vhe={key:0,class:"empty-hint-text"},Khe={key:1,class:"ws-pick"},Ghe={class:"ws-pick-name"},Yhe={key:1,class:"ws-pick-menu"},Zhe=["onClick"],Xhe={class:"ws-pick-item-name"},Qhe={class:"ws-pick-item-path"},Jhe=["aria-label"],epe={key:0,class:"abort-toast",role:"status","aria-live":"polite"},tpe={class:"abort-toast-text"},Iv=80,N3=1e3,npe=420,ope=3e3,spe=Qe({__name:"ConversationPane",props:{turns:{},sessionId:{},approvals:{},gitInfo:{},tasks:{},todos:{},goal:{},activationBadges:{},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},questions:{},pendingQuestionActions:{},pendingApprovalActions:{},running:{type:Boolean},turnActive:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},changes:{},fileReloadKey:{},working:{type:Boolean},starting:{type:Boolean},fastMoon:{type:Boolean},mobile:{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:{},conversationToc:{type:Boolean}},emits:["submit","steer","approval","cancelTask","answer","dismiss","command","interrupt","unqueue","editQueued","reorderQueue","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","createGoal","controlGoal","compact","pickModel","selectModel","openFile","openMedia","openThinking","openCompaction","openAgent","openToolDiff","openChanges","refreshGitStatus","editMessage","selectWorkspace","addWorkspace","openPr","renameSession","forkSession","archiveSession","exportSession"],setup(e,{expose:t,emit:n}){const{t:o}=Ot(),s=e,i=n,r=ne(!1),l=ne(!1),a=D(()=>s.workspaces?.find(xe=>xe.id===s.activeWorkspaceId)?.name??s.workspaceName??""),c=D(()=>(s.workspaces?.length??0)>0),u=D(()=>Uhe(s.workspaces??[],s.activeWorkspaceId,l.value)),d=D(()=>(s.workspaces?.length??0)-u.value.length);et(r,K=>{K||(l.value=!1)});function f(K){r.value=!1,K!==s.activeWorkspaceId&&i("selectWorkspace",K)}qa(Ht.contentAlign);const h=ne(null),p=ne(null),m=ne(null),y=ne(!1),k=ne(0);let g=null;function v(K,xe){const He=m.value??p.value;return!He||He.loadForEdit(K)===!1?!1:(He.loadAttachmentsForEdit(xe??[]),!0)}function b(){y.value=!0,g!==null&&clearTimeout(g),g=setTimeout(()=>{g=null,y.value=!1},2e3)}function A(){k.value++}const I=D(()=>s.tasks.filter(K=>K.kind!=="subagent")),T=D(()=>s.tasks.filter(K=>K.kind==="subagent"&&K.runInBackground)),M=D(()=>I.value.filter(K=>K.state==="run").length),$=D(()=>T.value.filter(K=>K.state==="run").length);function N(K){const xe=s.tasks,He=xe.find(Ut=>Ut.id===K)??xe.find(Ut=>Ut.parentToolCallId===K);if(He)return He.id;const Dt=xe.filter(Ut=>Ut.kind==="subagent"&&!Ut.parentToolCallId);if(Dt.length===1)return Dt[0].id}En("resolveAgentTaskId",N),En("pinScroll",Sn);const F=D(()=>(s.todos??[]).filter(K=>K.status==="done").length),S=D(()=>I.value.length>0||T.value.length>0||(s.todos?.length??0)>0||(s.queued?.length??0)>0),B=ne(null),W=D(()=>s.gitInfo?s.changes?.length??0:0);function z(K){B.value=B.value===K?null:K}function L(){B.value=null}et(S,K=>{K||L()});function O(K){if(K.role==="compaction")return o("conversation.compactedPlain");if(K.role==="user"){if(K.skillActivation)return`/${K.skillActivation.name}`;if(K.pluginCommand)return`/${K.pluginCommand.pluginId}:${K.pluginCommand.commandName}`;const He=K.text.trim().replaceAll(/\s+/g," ");return He.length>0?He:"user"}const xe=(K.text||K.thinking||"").trim().replaceAll(/\s+/g," ");return xe.length>0?xe:(K.tools?.length??0)>0?`${K.tools.length} tools`:"dimi"}const j=D(()=>s.turns.filter(K=>K.role==="user").map((K,xe)=>({id:K.id,role:K.role,no:xe+1,title:O(K)}))),Z=ne(null);function ie(){const K=Ee.value;if(!K)return;const xe=K.querySelectorAll(".turn-anchor[data-turn-id]");if(xe.length===0)return;const He=j.value;if(He.length===0)return;const Dt=new Set(He.map(ls=>ls.id));if(he()<=Iv){Z.value=He[He.length-1].id;return}const Ut=K.getBoundingClientRect(),yn=Ut.height/2;let ao=null;xe.forEach(ls=>{const te=ls.dataset.turnId;if(!te||!Dt.has(te))return;ls.getBoundingClientRect().top-Ut.top<=yn&&(ao=te)}),Z.value=ao??He[0].id}const U=ne(!1);let q=0;function ee(){q||(q=Xt(()=>{q=0,le()}))}function le(){const K=Ee.value,xe=!s.mobile&&s.conversationToc&&K?K.closest(".con")?.querySelector(".conversation-toc"):null,He=xe?.querySelector(".toc-bar");let Dt=!1;if(K&&xe&&He){const Ut=He.getBoundingClientRect(),yn=xe.getBoundingClientRect(),ao=Ut.left+Ut.width/2;Dt=Array.from(K.querySelectorAll(".table-node-wrapper")).some(ls=>{const te=ls.getBoundingClientRect();return te.left<=ao&&ao<=te.right&&te.top<yn.bottom&&te.bottom>yn.top})}U.value!==Dt&&(U.value=Dt)}const oe=D(()=>s.questions&&s.questions.length>0?s.questions[0]:void 0),re=D(()=>{const K=oe.value;if(K)return s.pendingQuestionActions?.[K.questionId]}),we=D(()=>s.approvals&&s.approvals.length>0?s.approvals[0]:void 0),me=D(()=>{const K=we.value;return K?!!s.pendingApprovalActions?.[K.approvalId]:!1}),Ee=ne(null),ae=ne(null),Y=ne(0),Q=ne(0),P=D(()=>({"--panes-scrollbar-width":`${Y.value}px`}));function G(K){return K instanceof HTMLElement?K:K&&"$el"in K&&K.$el instanceof HTMLElement?K.$el:null}function pe(){const K=Ee.value;Y.value=K?Math.max(0,K.offsetWidth-K.clientWidth):0,Q.value=ae.value?.offsetHeight??0}function ve(K){const xe=G(K);Ee.value=xe,xe&&Jo()}function de(K){const xe=G(K);ae.value=xe??null,K&&"loadForEdit"in K&&typeof K.loadForEdit=="function"&&"focus"in K&&typeof K.focus=="function"?m.value={loadForEdit:K.loadForEdit.bind(K),loadAttachmentsForEdit:"loadAttachmentsForEdit"in K&&typeof K.loadAttachmentsForEdit=="function"?K.loadAttachmentsForEdit.bind(K):()=>{},focus:K.focus.bind(K)}:m.value=null,qs()}const V=ne(!0),se=ne(!1);function he(){const K=Ee.value;return K?K.scrollHeight-K.scrollTop-K.clientHeight:0}let ke=0,Te=0,ze=0,ye=0,be=0,Ge=0;function tt(){return Date.now()<Te}function rt(){ee();const K=Ee.value;if(!K)return;const xe=K.scrollTop;if(Gt()){ke=xe;return}if(performance.now()-ze<100){ke=xe;return}const He=he();if(tt()){V.value=!0,se.value=!1,ke=xe;return}xe<ke-1&&He>1?(V.value=!1,se.value=!0):He<=Iv&&xe>ke+1&&(V.value=!0,se.value=!1),ke=xe,ie()}function ut(K=!1){const xe=Ee.value;V.value=!0,se.value=!1,xe&&(!K&&performance.now()<ye||(K&&typeof xe.scrollTo=="function"?(ze=performance.now(),ye=performance.now()+npe,xe.scrollTo({top:xe.scrollHeight,behavior:"smooth"})):xe.scrollTop=xe.scrollHeight,ke=xe.scrollTop))}function vt(K,xe){return(xe.closest("[inert]")?.closest(".tool-group")??xe).getBoundingClientRect().top-K.getBoundingClientRect().top+K.scrollTop}function Nt(K,xe){const He=Array.from(K.querySelectorAll(".turn-anchor[data-turn-id], [data-scroll-anchor-id]")).map(yn=>({node:yn,top:vt(K,yn)})),Dt=He.findIndex(yn=>yn.top>=xe),Ut=Dt<0?Math.max(0,He.length-1):Dt;return He.slice(Ut,Ut+2).flatMap(yn=>{const ao=yn.node.dataset.scrollAnchorId,ls=ao??yn.node.dataset.turnId;return ls?[{kind:ao?"tool":"turn",id:ls,top:yn.top}]:[]})}const _t=new Map;function Rt(K,xe){for(const He of xe.anchors){const Dt=He.kind==="tool"?"data-scroll-anchor-id":"data-turn-id",Ut=K.querySelector(`[${Dt}="${Wt(He.id)}"]`);if(Ut)return vt(K,Ut)-He.top}return K.scrollHeight-xe.oldHeight}function ln(K,xe,He=K.scrollTop){return K.scrollTop=He+Rt(K,xe),ke=K.scrollTop,K.scrollTop}async function Ln(){if(!s.sessionId||!s.loadOlderMessages||s.loadingMore||zo.value||!s.hasMoreMessages)return;const K=s.sessionId,xe=Ee.value,He=xe?.scrollTop??0,Dt={anchors:xe?Nt(xe,He):[],oldHeight:xe?.scrollHeight??0};ai(K,!0),No();try{if(await kt(),await s.loadOlderMessages(K),await kt(),s.sessionId!==K){_t.set(K,Dt);return}const Ut=Ee.value;if(!Ut)return;ln(Ut,Dt),_t.delete(K)}finally{ai(K,!1)}}function Wt(K){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(K):K.replaceAll(/["\\]/g,"\\$&")}function un(K){const xe=Ee.value;if(!xe)return;const He=xe.querySelector(`.turn-anchor[data-turn-id="${Wt(K)}"]`);He&&(Io(),V.value=!1,se.value=he()>Iv,He.scrollIntoView({behavior:"smooth",block:"center"}))}function vn(){const K=Ee.value;if(!K)return"none";const xe=K.firstElementChild,He=xe instanceof HTMLElement?xe.offsetHeight:0,Dt=ae.value?.offsetHeight??0;return`${K.scrollHeight}:${K.clientHeight}:${He}:${Dt}`}function Xt(K){return typeof requestAnimationFrame=="function"?requestAnimationFrame(K):setTimeout(K,16)}function An(K){typeof cancelAnimationFrame=="function"?cancelAnimationFrame(K):clearTimeout(K)}let Je=0,Ve=0,It=null,Kt=0;function Gt(){return performance.now()<Je}function Sn(K,xe=260){const He=Ee.value;if(!He||(It=K,Kt=K.getBoundingClientRect().top,Je=performance.now()+xe,Ve))return;const Dt=()=>{if(Ve=0,performance.now()>=Je||!It){It=null;return}const Ut=It.getBoundingClientRect().top-Kt;Ut&&(He.scrollTop+=Ut),Ve=Xt(Dt)};Ve=Xt(Dt)}function mt(K=36){if(!V.value&&!tt())return;const xe=++Ge;let He="",Dt=0,Ut=0;be&&(An(be),be=0);const yn=()=>{if(be=0,xe!==Ge||!V.value&&!tt())return;ut(!1);const ao=vn();Dt=ao===He?Dt+1:0,He=ao,Ut++,Dt<3&&Ut<K&&(be=Xt(yn))};be=Xt(yn)}function Rn(K,xe){return K!==void 0&&K.length>0&&xe.length>=K.length&&K.firstId!==xe.firstId&&K.lastId===xe.lastId&&K.lastTextLen===xe.lastTextLen&&K.lastThinkingLen===xe.lastThinkingLen&&K.lastToolsLen===xe.lastToolsLen&&K.approvalIds===xe.approvalIds}const dn=D(()=>{const K=(s.approvals??[]).map(yn=>yn.approvalId).join(","),xe=s.turns,He=xe.at(-1),Dt=He?.thinking?.length??0,Ut=He?.tools?.reduce((yn,ao)=>yn+ao.name.length+(ao.arg?.length??0)+(ao.output?.join("").length??0),0)??0;return{length:xe.length,firstId:xe[0]?.id??"",lastId:He?.id??"",lastTextLen:He?.text.length??0,lastThinkingLen:Dt,lastToolsLen:Ut,approvalIds:K}});et(dn,async(K,xe)=>{if(zo.value&&Rn(xe,K)){ie();return}await kt(),V.value||tt()?ut(K.length<xe.length):se.value=!0,ie()}),et(ae,()=>{qs()}),et(()=>s.mobile,async()=>{await kt(),pe()});const nn=new Map;et(()=>s.fileReloadKey,async(K,xe)=>{const He=Ee.value;xe&&He&&nn.set(String(xe),{top:He.scrollTop,following:V.value}),Io(),await kt();const Dt=Ee.value,Ut=K?nn.get(String(K)):void 0;if(Ut&&Dt){const yn=_t.get(String(K)),ao=yn?ln(Dt,yn,Ut.top):Ut.top;yn&&_t.delete(String(K)),V.value=Ut.following,Dt.scrollTop=ao,ke=Dt.scrollTop,se.value=!Ut.following&&he()>1,Ut.following&&mt()}else V.value=!0,ke=0,ut(!1),mt();ie()}),et(()=>s.sessionLoading,async(K,xe)=>{K||!xe||(V.value=!0,await kt(),mt(),ie())}),et(()=>s.turnActive,async(K,xe)=>{K||!xe||!V.value&&!tt()||(await kt(),mt(48),ie())});function fn(){V.value=!0,se.value=!1,Te=Date.now()+N3,kt(()=>{ut(!0),mt(16)})}function Po(K){fn(),i("submit",K)}function Ho(K){V.value=!0,se.value=!1,Te=Date.now()+N3,i("editMessage",K)}function dt(K){const xe=s.queued?.[K],He=xe?.text??"";v(He,xe?.attachments)&&i("editQueued",K)}function li(K){i("reorderQueue",K)}function _s(K,xe){fn(),i("answer",K,xe)}function Eo(K,xe){!K||!xe||i("approval",K,xe)}let _o=null,Un=null,To=null,lo=null,Wo=0,Ss=0,So=0;const Ws=ne(new Set),zo=D(()=>!!s.sessionId&&Ws.value.has(s.sessionId));function ai(K,xe){const He=new Set(Ws.value);xe?He.add(K):He.delete(K),Ws.value=He}function Qo(){zo.value||So||(So=Xt(()=>{So=0,!zo.value&&(Gt()||(V.value||tt())&&ut(!1))}))}function No(){Ge++,be&&(An(be),be=0),So&&(An(So),So=0)}function Io(){const K=Ee.value;if(Te=0,No(),Je=0,It=null,K){const xe=K.scrollTop;typeof K.scrollTo=="function"?K.scrollTo({top:xe,behavior:"auto"}):K.scrollTop=xe}ye=0,ze=Number.NEGATIVE_INFINITY,K&&(ke=K.scrollTop)}function ci(){const K=Ee.value;!K||K.scrollHeight-K.clientHeight<=1&&!s.hasMoreMessages||(V.value=!1,Io(),K.scrollHeight-K.clientHeight>1&&(se.value=!0))}function en(K){const xe=Ee.value;if(!xe)return!1;for(const He of K.composedPath()){if(He===xe)return!1;if(He instanceof HTMLElement&&He.scrollHeight>He.clientHeight+1&&He.scrollTop>1)return!0}return!1}function zs(K){K.defaultPrevented||K.ctrlKey||K.shiftKey||K.deltaY>=0||en(K)||ci()}function Xn(K){const xe=Ee.value;if(!xe||K.defaultPrevented||K.button!==0||K.pointerType==="touch")return;const He=xe.getBoundingClientRect(),Dt=xe.offsetWidth-xe.clientWidth,Ut=Dt>0?Dt:12;K.target===xe&&K.clientX>=He.right-Ut&&ci()}let Us=null;function ui(K){Us=K.touches.length===1?K.touches[0].clientY:null}function Ni(K){const xe=K.touches.length===1?K.touches[0].clientY:null;xe!==null&&Us!==null&&xe>Us+2&&!en(K)&&ci(),Us=xe}function di(){if(!Un)return;const K=Ee.value?.firstElementChild??null;K!==To&&(To&&Un.unobserve(To),To=K,K&&Un.observe(K))}function qs(){if(!Un)return;const K=ae.value;K!==lo&&(lo&&Un.unobserve(lo),lo=K,K&&Un.observe(K))}function Jo(){const K=Ee.value;pe(),_o&&(_o.disconnect(),K&&_o.observe(K,{childList:!0,subtree:!0,characterData:!0})),Un&&(Un.disconnect(),To=null,lo=null,K&&Un.observe(K),di(),qs()),Wo=K?.scrollHeight??0,Ss=K?.clientHeight??0,ee()}function es(){di(),Qo(),ee()}function zt(){typeof document>"u"||document.visibilityState==="visible"&&V.value&&mt()}const js=ne(!1);let Lo=null;function fi(){js.value=!0,Lo!==null&&clearTimeout(Lo),Lo=setTimeout(()=>{js.value=!1},ope)}function je(){fi(),i("interrupt")}function it(K){K.key==="Escape"&&(s.running||s.working)&&(K.preventDefault(),je())}function De(){V.value&&Qo()}wn(()=>{kt(()=>{typeof MutationObserver=="function"&&(_o=new MutationObserver(es)),typeof ResizeObserver=="function"&&(Un=new ResizeObserver(()=>{ee(),pe();const K=Ee.value;if(!K)return;const{scrollHeight:xe,clientHeight:He}=K,Dt=xe>Wo+1,Ut=He<Ss-1;Wo=xe,Ss=He,!Gt()&&(Dt||Ut)&&Qo()})),Jo(),mt(48),ie(),typeof document<"u"&&(document.addEventListener("visibilitychange",zt),document.addEventListener("keydown",it)),window.visualViewport?.addEventListener("resize",De)})}),In(()=>{_o&&_o.disconnect(),Un&&Un.disconnect(),So&&An(So),be&&An(be),Ve&&An(Ve),q&&An(q),Lo!==null&&clearTimeout(Lo),g!==null&&(clearTimeout(g),g=null),typeof document<"u"&&(document.removeEventListener("visibilitychange",zt),document.removeEventListener("keydown",it)),window.visualViewport?.removeEventListener("resize",De)});function ge(){(m.value??p.value)?.focus()}return t({loadComposerForEdit:v,focusComposer:ge}),(K,xe)=>(x(),E("section",{class:We(["con",{mobile:e.mobile}])},[!e.mobile&&!(e.turns.length===0&&!e.sessionLoading)?(x(),Ae(Zle,{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":W.value,"git-diff-stats":e.gitDiffStats,"is-git-repo":!!e.gitInfo,pr:e.pr,copied:y.value,onOpenChanges:xe[0]||(xe[0]=He=>i("openChanges")),onCopyAll:xe[1]||(xe[1]=He=>h.value?.copyConversation()),onCopyFinalSummary:xe[2]||(xe[2]=He=>h.value?.copyFinalSummary()),onOpenPr:xe[3]||(xe[3]=He=>e.pr&&i("openPr",e.pr.url)),onRenameSession:xe[4]||(xe[4]=(He,Dt)=>i("renameSession",He,Dt)),onForkSession:xe[5]||(xe[5]=He=>i("forkSession",He)),onArchiveSession:xe[6]||(xe[6]=He=>i("archiveSession",He)),onExportSession:xe[7]||(xe[7]=He=>i("exportSession",He))},null,8,["session-id","workspace-name","workspace-root","session-title","branch","ahead","behind","changes-count","git-diff-stats","is-git-repo","pr","copied"])):ue("",!0),e.conversationToc?(x(),Ae(Whe,{key:1,items:j.value,"active-turn-id":Z.value,mobile:e.mobile,"session-loading":e.sessionLoading,occluded:U.value,onSelect:un},null,8,["items","active-turn-id","mobile","session-loading","occluded"])):ue("",!0),_("div",qhe,[_("div",{ref:ve,class:We(["panes chat-scroll",{"is-following":V.value,"history-prepending":zo.value}]),onScrollPassive:rt,onWheelPassive:zs,onPointerdownPassive:Xn,onTouchstartPassive:ui,onTouchmovePassive:Ni},[_("div",{class:We(["content-wrap",[e.mobile?"align-mobile":"align-center"]])},[e.turns.length===0&&!e.sessionLoading?(x(),E(Pe,{key:0},[xe[55]||(xe[55]=_("div",{class:"empty-spacer"},null,-1)),_("div",jhe,[_("span",{class:We(["empty-hint-title",{"is-starting":e.starting}])},[e.starting?(x(),Ae(Hs,{key:0,size:"sm"})):ue("",!0),_("span",null,R(e.starting?C(o)("conversation.starting"):C(o)("composer.emptyConversationTitle")),1)],2),e.starting?ue("",!0):(x(),E("span",Vhe,R(C(o)("composer.emptyConversation")),1)),c.value&&!e.starting?(x(),E("div",Khe,[fe(rn,{text:C(o)("conversation.switchWorkspace")},{default:Le(()=>[_("button",{type:"button",class:"ws-pick-btn",onClick:xe[8]||(xe[8]=Ct(He=>r.value=!r.value,["stop"]))},[fe(Ye,{name:"folder",size:"sm"}),_("span",Ghe,R(a.value),1),fe(Ye,{class:We(["ws-pick-chev",{open:r.value}]),name:"chevron-down",size:"sm"},null,8,["class"])])]),_:1},8,["text"]),r.value?(x(),E("div",{key:0,class:"ws-pick-backdrop",onClick:xe[9]||(xe[9]=He=>r.value=!1)})):ue("",!0),r.value?(x(),E("div",Yhe,[(x(!0),E(Pe,null,lt(u.value,He=>(x(),E("button",{key:He.id,type:"button",class:We(["ws-pick-item",{on:He.id===e.activeWorkspaceId}]),onClick:Ct(Dt=>f(He.id),["stop"])},[_("span",Xhe,R(He.name),1),_("span",Qhe,R(He.shortPath),1)],10,Zhe))),128)),d.value>0?(x(),E("button",{key:0,type:"button",class:"ws-pick-item ws-pick-more",onClick:xe[10]||(xe[10]=Ct(He=>l.value=!l.value,["stop"]))},[_("span",null,R(C(o)("conversation.moreWorkspaces",{count:d.value})),1)])):ue("",!0),xe[54]||(xe[54]=_("div",{class:"ws-pick-divider"},null,-1)),_("button",{type:"button",class:"ws-pick-action",onClick:xe[11]||(xe[11]=Ct(He=>{r.value=!1,i("addWorkspace")},["stop"]))},[fe(Ye,{name:"plus",size:"sm"}),_("span",null,R(C(o)("conversation.addWorkspace")),1)])])):ue("",!0)])):e.starting?ue("",!0):(x(),E("button",{key:2,type:"button",class:"empty-add-workspace",onClick:xe[12]||(xe[12]=He=>i("addWorkspace"))},[fe(Ye,{name:"folder-plus",size:"sm"}),_("span",null,R(C(o)("conversation.addWorkspace")),1)]))]),fe(VE,{ref_key:"emptyComposerRef",ref:p,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,goal:e.goal,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,starting:e.starting,"hide-context":"",onSubmit:Po,onSteer:xe[13]||(xe[13]=He=>i("steer",He)),onCommand:xe[14]||(xe[14]=He=>i("command",He)),onInterrupt:je,onUnqueue:xe[15]||(xe[15]=He=>i("unqueue",He)),onEditQueued:xe[16]||(xe[16]=He=>i("editQueued",He)),onSetPermission:xe[17]||(xe[17]=He=>i("setPermission",He)),onSetThinking:xe[18]||(xe[18]=He=>i("setThinking",He)),onTogglePlan:xe[19]||(xe[19]=He=>i("togglePlan")),onToggleSwarm:xe[20]||(xe[20]=He=>i("toggleSwarm")),onToggleGoal:xe[21]||(xe[21]=He=>i("toggleGoal")),onOpenBtw:xe[22]||(xe[22]=He=>i("command","/btw")),onCreateGoal:xe[23]||(xe[23]=He=>i("createGoal",He)),onControlGoal:xe[24]||(xe[24]=He=>i("controlGoal",He)),onFocusGoal:A,onCompact:xe[25]||(xe[25]=He=>i("compact")),onPickModel:xe[26]||(xe[26]=He=>i("pickModel")),onSelectModel:xe[27]||(xe[27]=He=>i("selectModel",He))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","goal","activation-badges","models","starred-ids","skills","starting"]),xe[56]||(xe[56]=_("div",{class:"empty-spacer"},null,-1))],64)):(x(),Ae(RE,{ref_key:"chatPaneRef",ref:h,key:e.fileReloadKey??"no-session",turns:e.turns,approvals:e.approvals,"turn-active":e.turnActive,working:e.working,"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":V.value,"tool-diff-panel":!0,queued:e.queued,onOpenFile:xe[28]||(xe[28]=He=>i("openFile",He)),onOpenMedia:xe[29]||(xe[29]=He=>i("openMedia",He)),onCopyConversationCopied:b,onOpenThinking:xe[30]||(xe[30]=He=>i("openThinking",He)),onOpenCompaction:xe[31]||(xe[31]=He=>i("openCompaction",He)),onOpenAgent:xe[32]||(xe[32]=He=>i("openAgent",He)),onOpenToolDiff:xe[33]||(xe[33]=He=>i("openToolDiff",He)),onEditMessage:Ho,onLoadOlderMessages:Ln,onUnqueue:xe[34]||(xe[34]=He=>i("unqueue",He)),onEditQueued:dt,onReorderQueue:li},null,8,["turns","approvals","turn-active","working","fast-moon","session-loading","compaction","has-more-messages","loading-more","loading-more-error","is-following","queued"]))],2)],34),e.turns.length===0&&!e.sessionLoading?ue("",!0):(x(),Ae(Fhe,{key:0,ref:de,style:tn(P.value),"session-id":e.sessionId,running:e.running,starting:e.starting,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":k.value,"dock-panel":B.value,"bash-tasks":I.value,"subagent-tasks":T.value,"bash-running":M.value,"subagent-running":$.value,"todo-done-count":F.value,"has-dock-work":S.value,todos:e.todos,"pending-question":oe.value,"question-busy-kind":re.value,"pending-approval":we.value,"approval-busy":me.value,mobile:e.mobile,onToggleDockPanel:xe[35]||(xe[35]=He=>z(He)),onCloseDockPanel:xe[36]||(xe[36]=He=>L()),onOpenAgent:xe[37]||(xe[37]=He=>i("openAgent",He)),onAnswer:_s,onDismiss:xe[38]||(xe[38]=He=>i("dismiss",He)),onApproval:Eo,onCancelTask:xe[39]||(xe[39]=He=>i("cancelTask",He)),onControlGoal:xe[40]||(xe[40]=He=>i("controlGoal",He)),onSubmit:Po,onSteer:xe[41]||(xe[41]=He=>i("steer",He)),onCommand:xe[42]||(xe[42]=He=>i("command",He)),onInterrupt:je,onSetPermission:xe[43]||(xe[43]=He=>i("setPermission",He)),onSetThinking:xe[44]||(xe[44]=He=>i("setThinking",He)),onTogglePlan:xe[45]||(xe[45]=He=>i("togglePlan")),onToggleSwarm:xe[46]||(xe[46]=He=>i("toggleSwarm")),onToggleGoal:xe[47]||(xe[47]=He=>i("toggleGoal")),onOpenBtw:xe[48]||(xe[48]=He=>i("command","/btw")),onCreateGoal:xe[49]||(xe[49]=He=>i("createGoal",He)),onFocusGoal:A,onCompact:xe[50]||(xe[50]=He=>i("compact")),onPickModel:xe[51]||(xe[51]=He=>i("pickModel")),onSelectModel:xe[52]||(xe[52]=He=>i("selectModel",He))},null,8,["style","session-id","running","starting","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","question-busy-kind","pending-approval","approval-busy","mobile"]))]),fe(Ua,{name:"pill"},{default:Le(()=>[se.value?(x(),E("button",{key:0,class:"newmsg-pill",style:tn({bottom:`${Q.value+12}px`}),"aria-label":C(o)("conversation.jumpToLatestAria"),onClick:xe[53]||(xe[53]=He=>ut(!0))},[fe(Ye,{class:"pill-chevron",name:"chevron-down",size:"md"}),nt(" "+R(C(o)("conversation.newMessages")),1)],12,Jhe)):ue("",!0)]),_:1}),fe(Ua,{name:"abort-toast"},{default:Le(()=>[js.value?(x(),E("div",epe,[_("span",tpe,R(C(o)("conversation.manuallyAborted")),1)])):ue("",!0)]),_:1})],2))}}),ipe=ft(spe,[["__scopeId","data-v-7ccce000"]]),rpe=["aria-selected","onClick"],lpe=Qe({__name:"SegmentedControl",props:{modelValue:{},options:{},size:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(o,s)=>(x(),E("div",{class:We(["ui-seg",`ui-seg--${e.size??"md"}`]),role:"tablist"},[(x(!0),E(Pe,null,lt(e.options,i=>(x(),E("button",{key:i.value,class:We(["ui-seg__item",{"is-on":i.value===e.modelValue}]),type:"button",role:"tab","aria-selected":i.value===e.modelValue,onClick:r=>n("update:modelValue",i.value)},R(i.label),11,rpe))),128))],2))}}),ms=ft(lpe,[["__scopeId","data-v-67c67fe2"]]),ape={class:"ui-panel-header__title"},cpe={key:0,class:"ui-panel-header__sub"},upe=Qe({__name:"PanelHeader",props:{title:{},subtitle:{},closable:{type:Boolean,default:!0},closeLabel:{default:"Close"},wrap:{type:Boolean}},emits:["close"],setup(e){return(t,n)=>(x(),E("div",{class:We(["ui-panel-header",{wrap:e.wrap}])},[_("span",ape,R(e.title),1),fe(rn,{text:e.subtitle},{default:Le(()=>[e.subtitle?(x(),E("span",cpe,R(e.subtitle),1)):ue("",!0)]),_:1},8,["text"]),zn(t.$slots,"default",{},void 0,!0),e.closable?(x(),Ae(Kn,{key:0,class:"ui-panel-header__close",size:"sm",label:e.closeLabel,onClick:n[0]||(n[0]=o=>t.$emit("close"))},{default:Le(()=>[fe(Ye,{name:"close",size:"sm"})]),_:1},8,["label"])):ue("",!0)],2))}}),Ya=ft(upe,[["__scopeId","data-v-62b5f713"]]),dpe={key:0,class:"fp-empty fp-error"},fpe={key:1,class:"fp-empty"},hpe={key:2,class:"fp-loading"},ppe={class:"fp-path"},mpe={class:"fp-meta"},gpe={key:0,class:"fp-lines"},vpe={class:"fp-size"},ype={key:3,class:"fp-search"},kpe=["placeholder"],bpe={key:0,class:"fp-search-count"},xpe=["href","aria-label"],wpe={key:1,class:"fp-code"},_pe={class:"fp-line-table"},Spe=["data-line"],Cpe={class:"fp-gutter"},Ape=["innerHTML"],Mpe={key:1,class:"fp-body fp-code"},Epe={class:"fp-line-table"},Tpe=["data-line"],Npe={class:"fp-gutter"},Ipe=["innerHTML"],Lpe={key:2,class:"fp-body"},$pe=["srcdoc","title"],Fpe={key:1,class:"fp-code"},Ope={class:"fp-line-table"},Rpe=["data-line"],Bpe={class:"fp-gutter"},Dpe=["innerHTML"],Ppe={key:3,class:"fp-body fp-pdf-wrap"},Hpe=["src","title"],Wpe={key:1,class:"fp-binary-card"},zpe={class:"fp-binary-label"},Upe={key:4,class:"fp-body fp-table-wrap"},qpe={class:"fp-table"},jpe=["data-line"],Vpe={key:5,class:"fp-body fp-image-wrap"},Kpe=["src","alt"],Gpe={key:1,class:"fp-binary-card"},Ype={class:"fp-binary-icon"},Zpe={class:"fp-binary-label"},Xpe={key:6,class:"fp-body fp-image-wrap"},Qpe=["src"],Jpe={key:1,class:"fp-binary-card"},eme={class:"fp-binary-icon"},tme={class:"fp-binary-label"},nme={key:7,class:"fp-body fp-code"},ome={class:"fp-line-table"},sme=["data-line"],ime={class:"fp-gutter"},rme=["innerHTML"],lme={key:8,class:"fp-body fp-binary-wrap"},ame={class:"fp-binary-card"},cme={class:"fp-binary-icon"},ume={class:"fp-binary-label"},dme=Qe({__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}=Ot();function o(ae,Y){const Q=Y?Y.split("/").filter(Boolean):[];for(const P of ae.split("/"))P===""||P==="."||(P===".."?Q.pop():Q.push(P));return Q.join("/")}const s=Jt("resolveImage",async ae=>ae),i=D(()=>{const ae=c.file?.path??"",Y=ae.lastIndexOf("/");return Y>0?ae.slice(0,Y):""});function r(ae){if(/^(https?:|data:|blob:)/i.test(ae)||ae.startsWith("/"))return ae;const Y=i.value;return Y?o(ae,Y):ae}async function l(ae){const Y=r(ae);return s?s(Y):Y}En("resolveImage",l);function a(ae){let Y=ae.path;if(/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(Y)||Y.startsWith("/"))return ae;for(const P of["#","?"]){const G=Y.indexOf(P);G!==-1&&(Y=Y.slice(0,G))}const Q=i.value;return{...ae,path:o(Y,Q)}}const c=e,u=t;function d(ae){c.openFile?.(a(ae))}const f=ne(null),h=D(()=>{const ae=c.file;if(!ae)return"binary";const Y=ae.mime??"",Q=ae.languageId??"",P=ae.path.toLowerCase();return Y==="text/markdown"||Q==="markdown"||Q==="md"||P.endsWith(".mdx")?"markdown":Y==="application/json"||Q==="json"?"json":Y==="text/html"||Q==="html"||P.endsWith(".html")||P.endsWith(".htm")?"html":Y==="application/pdf"||P.endsWith(".pdf")?"pdf":Y==="text/csv"||Q==="csv"||P.endsWith(".csv")?"csv":Y.startsWith("image/")?"image":Y.startsWith("video/")?"video":ae.isBinary?"binary":Y.startsWith("text/")||Q!==""?"text":"binary"});function p(ae){const Y=atob(ae),Q=Uint8Array.from(Y,P=>P.charCodeAt(0));return new TextDecoder().decode(Q)}const m=D(()=>{const ae=c.file;if(!ae)return"";if(ae.encoding==="base64")try{return p(ae.content)}catch{return ae.content}return ae.content}),y=D(()=>{if(h.value!=="json"||!c.file)return"";try{return JSON.stringify(JSON.parse(m.value),null,2)}catch{return m.value}}),k=D(()=>c.file?(h.value==="json"?y.value:m.value).split(`
|
|
313
|
-
`):[]),g=D(()=>c.file?h.value==="json"?y.value:m.value:""),v=ne(""),b=ne(0),A=D(()=>{const ae=v.value.trim().toLowerCase();if(!ae)return[];const Y=[];return k.value.forEach((Q,P)=>{Q.toLowerCase().includes(ae)&&Y.push(P+1)}),Y});et(v,()=>{b.value=0});function I(ae,Y=!1){ae&&kt(()=>{const Q=f.value?.querySelector(".fp-body"),P=Q?.querySelector(`[data-line="${ae}"]`);if(!Q||!P)return;Y&&(Q.scrollTop=0);const G=Q.getBoundingClientRect(),pe=P.getBoundingClientRect(),ve=pe.top-G.top+Q.scrollTop;Q.scrollTop=ve-Q.clientHeight/2+pe.height/2})}et(()=>[c.file?.path,c.line],()=>I(c.line,!0),{immediate:!0});function T(ae){const Y=A.value;Y.length!==0&&(b.value=(b.value+ae+Y.length)%Y.length,I(Y[b.value]))}function M(ae){const Y=A.value;return{target:c.line===ae,hit:Y.includes(ae),active:Y[b.value]===ae}}function $(ae){return ae<1024?`${ae} B`:ae<1024*1024?`${(ae/1024).toFixed(1)} KB`:`${(ae/(1024*1024)).toFixed(1)} MB`}const N=ne(!1),F=ne(!1);function S(){c.file&&Xo(g.value).then(ae=>{ae&&(N.value=!0,setTimeout(()=>{N.value=!1},1400))})}function B(){c.file&&Xo(c.file.path).then(ae=>{ae&&(F.value=!0,setTimeout(()=>{F.value=!1},1400))})}const W=ne("preview"),z=ne("preview"),L=ne("fit");function O(ae){W.value=ae}function j(ae){z.value=ae}function Z(ae){L.value=ae}et(h,ae=>{W.value=ae==="html"?"preview":"source",z.value="preview",L.value="fit"});const ie=D(()=>{const ae=c.file;return!ae||h.value!=="image"?null:ae.sourceUrl?ae.sourceUrl:ae.encoding==="base64"?`data:${ae.mime};base64,${ae.content}`:ae.mime==="image/svg+xml"?`data:${ae.mime};charset=utf-8,${encodeURIComponent(ae.content)}`:null}),U=D(()=>{const ae=c.file;return!ae||h.value!=="video"?null:ae.sourceUrl?ae.sourceUrl:ae.encoding==="base64"?`data:${ae.mime};base64,${ae.content}`:null}),q=D(()=>{const ae=c.file;return!ae||h.value!=="pdf"?null:c.downloadUrl?c.downloadUrl:ae.encoding==="base64"?`data:${ae.mime};base64,${ae.content}`:null}),ee=D(()=>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:;">`,m.value].join(""):"");function le(ae){const Y=[];let Q="",P=!1;for(let G=0;G<ae.length;G++){const pe=ae[G];pe==='"'&&ae[G+1]==='"'?(Q+='"',G++):pe==='"'?P=!P:pe===","&&!P?(Y.push(Q),Q=""):Q+=pe}return Y.push(Q),Y}const oe=D(()=>k.value.slice(0,200).map(le));function re(ae){return ae.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""")}function we(){const ae=c.file;if(!ae)return"";const Y=ae.languageId?.toLowerCase();return Y||(ae.path.split(".").pop()?.toLowerCase()??"")}function me(ae){const Y=we();let Q=re(ae);return h.value==="json"||Y==="json"||Y==="jsonc"?(Q=Q.replace(/("[^&]*?")(\s*:)/g,'<span class="tok-key">$1</span>$2'),Q=Q.replace(/(:\s*)("[^&]*?")/g,'$1<span class="tok-string">$2</span>'),Q=Q.replace(/\b(true|false|null)\b/g,'<span class="tok-literal">$1</span>'),Q=Q.replace(/(:\s*)(-?\d+(?:\.\d+)?)/g,'$1<span class="tok-number">$2</span>'),Q):h.value==="html"||Y==="html"||Y==="xml"||Y==="svg"?(Q=Q.replace(/\s([A-Za-z_:][-A-Za-z0-9_:.]*)(=)/g,' <span class="tok-attr">$1</span>$2'),Q=Q.replace(/(".*?")/g,'<span class="tok-string">$1</span>'),Q=Q.replace(/(<\/?)([A-Za-z][\w:-]*)/g,'$1<span class="tok-tag">$2</span>'),Q):(Q=Q.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>'),Q=Q.replace(/(".*?"|'.*?')/g,'<span class="tok-string">$1</span>'),Q=Q.replace(/(\/\/.*)$/g,'<span class="tok-comment">$1</span>'),Q)}function Ee(ae,Y=55){return!ae||ae.length<=Y?ae:"…"+ae.slice(ae.length-Y+1)}return(ae,Y)=>(x(),E("div",{ref_key:"rootRef",ref:f,class:"file-preview"},[e.error&&!e.loading?(x(),E("div",dpe,[_("span",null,R(e.error),1),e.closable?(x(),Ae(jt,{key:0,variant:"secondary",size:"sm",onClick:Y[0]||(Y[0]=Q=>u("close"))},{default:Le(()=>[nt(R(C(n)("filePreview.close")),1)]),_:1})):ue("",!0)])):!e.file&&!e.loading?(x(),E("div",fpe,R(C(n)("filePreview.empty")),1)):e.loading?(x(),E("div",hpe,[Y[7]||(Y[7]=_("span",{class:"spinner"},null,-1)),_("span",null,R(C(n)("filePreview.loading")),1)])):e.file?(x(),E(Pe,{key:3},[fe(Ya,{wrap:"",title:C(n)("common.preview"),closable:e.closable,"close-label":C(n)("filePreview.close"),onClose:Y[6]||(Y[6]=Q=>u("close"))},{default:Le(()=>[fe(rn,{text:e.file.path},{default:Le(()=>[_("span",ppe,R(Ee(e.file.path)),1)]),_:1},8,["text"]),_("span",mpe,[e.file.lineCount?(x(),E("span",gpe,R(C(n)("filePreview.lineCount",{count:e.file.lineCount})),1)):ue("",!0),_("span",vpe,R($(e.file.size)),1)]),h.value==="html"?(x(),Ae(ms,{key:0,"model-value":W.value,size:"sm",options:[{value:"preview",label:C(n)("filePreview.preview")},{value:"source",label:C(n)("filePreview.source")}],"onUpdate:modelValue":O},null,8,["model-value","options"])):ue("",!0),h.value==="markdown"?(x(),Ae(ms,{key:1,"model-value":z.value,size:"sm",options:[{value:"preview",label:C(n)("filePreview.preview")},{value:"source",label:C(n)("filePreview.source")}],"onUpdate:modelValue":j},null,8,["model-value","options"])):ue("",!0),h.value==="image"?(x(),Ae(ms,{key:2,"model-value":L.value,size:"sm",options:[{value:"fit",label:C(n)("filePreview.fit")},{value:"actual",label:C(n)("filePreview.actual")}],"onUpdate:modelValue":Z},null,8,["model-value","options"])):ue("",!0),h.value==="text"||h.value==="json"||h.value==="html"||h.value==="csv"?(x(),E("div",ype,[Wn(_("input",{"onUpdate:modelValue":Y[1]||(Y[1]=Q=>v.value=Q),class:"fp-search-input",type:"search",placeholder:C(n)("filePreview.search")},null,8,kpe),[[ws,v.value]]),v.value.trim()?(x(),E("span",bpe,R(A.value.length),1)):ue("",!0),fe(Kn,{size:"sm",disabled:A.value.length===0,label:C(n)("filePreview.prevMatch"),onClick:Y[2]||(Y[2]=Q=>T(-1))},{default:Le(()=>[fe(Ye,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),fe(Kn,{size:"sm",disabled:A.value.length===0,label:C(n)("filePreview.nextMatch"),onClick:Y[3]||(Y[3]=Q=>T(1))},{default:Le(()=>[fe(Ye,{name:"arrow-down",size:"md"})]),_:1},8,["disabled","label"])])):ue("",!0),fe(Kn,{size:"sm",class:We({copied:F.value}),label:F.value?C(n)("filePreview.copied"):C(n)("filePreview.copyPath"),onClick:B},{default:Le(()=>[F.value?(x(),Ae(Ye,{key:1,class:"fp-check",name:"check",size:"md"})):(x(),Ae(Ye,{key:0,name:"link",size:"md"}))]),_:1},8,["class","label"]),e.externalActions?(x(),Ae(Kn,{key:4,size:"sm",label:C(n)("filePreview.openInEditor"),onClick:Y[4]||(Y[4]=Q=>u("openExternal"))},{default:Le(()=>[fe(Ye,{name:"external-link",size:"md"})]),_:1},8,["label"])):ue("",!0),e.externalActions?(x(),Ae(Kn,{key:5,size:"sm",label:C(n)("filePreview.reveal"),onClick:Y[5]||(Y[5]=Q=>u("reveal"))},{default:Le(()=>[fe(Ye,{name:"folder",size:"md"})]),_:1},8,["label"])):ue("",!0),e.downloadUrl?(x(),E("a",{key:6,class:"fp-download",href:e.downloadUrl,target:"_blank",rel:"noreferrer",download:"","aria-label":C(n)("filePreview.download")},[fe(Ye,{name:"download",size:"md"})],8,xpe)):ue("",!0),!e.file.isBinary&&h.value!=="image"?(x(),Ae(Kn,{key:7,size:"sm",class:We({copied:N.value}),label:N.value?C(n)("filePreview.copied"):C(n)("filePreview.copy"),onClick:S},{default:Le(()=>[N.value?(x(),Ae(Ye,{key:1,class:"fp-check",name:"check",size:"md"})):(x(),Ae(Ye,{key:0,name:"copy",size:"md"}))]),_:1},8,["class","label"])):ue("",!0)]),_:1},8,["title","closable","close-label"]),h.value==="markdown"?(x(),E("div",{key:0,class:We(["fp-body",{"fp-markdown":z.value==="preview"}])},[z.value==="preview"?(x(),Ae(G1,{key:0,text:m.value,"open-file":c.openFile?d:void 0},null,8,["text","open-file"])):(x(),E("div",wpe,[_("div",_pe,[(x(!0),E(Pe,null,lt(k.value,(Q,P)=>(x(),E("div",{key:P,class:We(["fp-line-row",M(P+1)]),"data-line":P+1},[_("span",Cpe,R(P+1),1),_("span",{class:"fp-line-text",innerHTML:me(Q)},null,8,Ape)],10,Spe))),128))])]))],2)):h.value==="json"?(x(),E("div",Mpe,[_("div",Epe,[(x(!0),E(Pe,null,lt(k.value,(Q,P)=>(x(),E("div",{key:P,class:We(["fp-line-row",M(P+1)]),"data-line":P+1},[_("span",Npe,R(P+1),1),_("span",{class:"fp-line-text",innerHTML:me(Q)},null,8,Ipe)],10,Tpe))),128))])])):h.value==="html"?(x(),E("div",Lpe,[W.value==="preview"?(x(),E("iframe",{key:0,class:"fp-html-frame",sandbox:"",srcdoc:ee.value,title:e.file.path},null,8,$pe)):(x(),E("div",Fpe,[_("div",Ope,[(x(!0),E(Pe,null,lt(k.value,(Q,P)=>(x(),E("div",{key:P,class:We(["fp-line-row",M(P+1)]),"data-line":P+1},[_("span",Bpe,R(P+1),1),_("span",{class:"fp-line-text",innerHTML:me(Q)},null,8,Dpe)],10,Rpe))),128))])]))])):h.value==="pdf"?(x(),E("div",Ppe,[q.value?(x(),E("iframe",{key:0,class:"fp-pdf-frame",src:q.value,title:e.file.path},null,8,Hpe)):(x(),E("div",Wpe,[_("span",zpe,R(C(n)("filePreview.pdfNoPreview")),1)]))])):h.value==="csv"?(x(),E("div",Upe,[_("table",qpe,[_("tbody",null,[(x(!0),E(Pe,null,lt(oe.value,(Q,P)=>(x(),E("tr",{key:P,class:We(M(P+1)),"data-line":P+1},[_("th",null,R(P+1),1),(x(!0),E(Pe,null,lt(Q,(G,pe)=>(x(),E("td",{key:pe},R(G),1))),128))],10,jpe))),128))])])])):h.value==="image"?(x(),E("div",Vpe,[ie.value?(x(),E("img",{key:0,src:ie.value,alt:e.file.path,class:We(["fp-image",{actual:L.value==="actual"}])},null,10,Kpe)):(x(),E("div",Gpe,[_("span",Ype,[fe(Ye,{name:"image-off",size:"lg"})]),_("span",Zpe,R(C(n)("filePreview.imageNoPreview",{mime:e.file.mime,size:$(e.file.size)})),1)]))])):h.value==="video"?(x(),E("div",Xpe,[U.value?(x(),E("video",{key:0,src:U.value,class:"fp-image",controls:"",playsinline:"",preload:"metadata"},null,8,Qpe)):(x(),E("div",Jpe,[_("span",eme,[fe(Ye,{name:"image-off",size:"lg"})]),_("span",tme,R(C(n)("filePreview.videoNoPreview",{mime:e.file.mime,size:$(e.file.size)})),1)]))])):h.value==="text"?(x(),E("div",nme,[_("div",ome,[(x(!0),E(Pe,null,lt(k.value,(Q,P)=>(x(),E("div",{key:P,class:We(["fp-line-row",M(P+1)]),"data-line":P+1},[_("span",ime,R(P+1),1),_("span",{class:"fp-line-text",innerHTML:me(Q)},null,8,rme)],10,sme))),128))])])):(x(),E("div",lme,[_("div",ame,[_("span",cme,[fe(Ye,{name:"file-off",size:"lg"})]),_("span",ume,R(C(n)("filePreview.binaryNoPreview",{mime:e.file.mime||C(n)("filePreview.unknownType"),size:$(e.file.size)})),1)])]))],64)):ue("",!0)],512))}}),fme=ft(dme,[["__scopeId","data-v-b4f28f25"]]),hme={class:"tp"},pme=Qe({__name:"ThinkingPanel",props:{text:{},subtitle:{}},emits:["close"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Ot(),i=ne(null);return et(()=>n.text,()=>{const r=i.value;!r||!(r.scrollHeight-r.scrollTop-r.clientHeight<24)||kt(()=>{i.value&&(i.value.scrollTop=i.value.scrollHeight)})},{immediate:!0}),(r,l)=>(x(),E("div",hme,[fe(Ya,{title:C(s)("common.preview"),subtitle:e.subtitle??C(s)("thinking.panelTitle"),"close-label":C(s)("thinking.close"),onClose:l[0]||(l[0]=a=>o("close"))},null,8,["title","subtitle","close-label"]),_("pre",{ref_key:"bodyEl",ref:i,class:"tp-body"},R(e.text),513)]))}}),I3=ft(pme,[["__scopeId","data-v-98fe6e80"]]),mme={class:"ap"},gme={key:0,class:"ap-type"},vme={key:1,class:"ap-reason"},yme={key:2,class:"ap-field"},kme={class:"ap-field-body"},bme={key:3,class:"ap-field"},xme={class:"ap-field-body ap-live"},wme={key:4,class:"ap-field"},_me={class:"ap-field-body ap-progress"},Sme={key:0,class:"ap-call"},Cme={key:1,class:"ap-output"},Ame=["onClick"],Mme={key:5,class:"ap-field"},Eme={class:"ap-field-body"},Tme=8,L3=5,$3=2,Nme=Qe({__name:"AgentDetailPanel",props:{member:{}},emits:["close"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Ot(),i=D(()=>(n.member.outputLines??[]).map(m=>m.trimEnd()).filter(m=>m.length>0)),r=D(()=>(n.member.text??"").trimEnd());function l(m){const y=[];let k=null,g=0;for(const v of m)v.startsWith("Calling ")?(k={key:`g${g++}`,call:v,output:[]},y.push(k)):k?k.output.push(v):(k={key:`g${g++}`,call:"",output:[v]},y.push(k));return y}const a=D(()=>l(i.value)),c=ne(new Set);function u(m){return c.value.has(m)}function d(m){const y=new Set(c.value);y.has(m)?y.delete(m):y.add(m),c.value=y}function f(m){return m.output.length-L3-$3}function h(m){switch(m){case"queued":return"Queued";case"working":return"Working";case"suspended":return"Suspended";case"completed":return"Completed";case"failed":return"Failed"}}const p=ne(null);return et(()=>i.value.length+r.value.length,()=>{const m=p.value;!m||!(m.scrollHeight-m.scrollTop-m.clientHeight<24)||kt(()=>{p.value&&(p.value.scrollTop=p.value.scrollHeight)})},{immediate:!0}),(m,y)=>(x(),E("div",mme,[fe(Ya,{title:C(s)("common.preview"),subtitle:e.member.name,"close-label":C(s)("thinking.close"),onClose:y[0]||(y[0]=k=>o("close"))},{default:Le(()=>[fe(qi,{variant:"neutral",size:"sm",class:"ap-phase"},{default:Le(()=>[nt(R(h(e.member.phase)),1)]),_:1})]),_:1},8,["title","subtitle","close-label"]),_("div",{ref_key:"bodyEl",ref:p,class:"ap-body"},[e.member.subagentType?(x(),E("div",gme,R(e.member.subagentType),1)):ue("",!0),e.member.suspendedReason?(x(),E("div",vme,R(e.member.suspendedReason),1)):ue("",!0),e.member.prompt?(x(),E("div",yme,[y[1]||(y[1]=_("span",{class:"ap-field-label"},"Task",-1)),_("div",kme,R(e.member.prompt),1)])):ue("",!0),r.value?(x(),E("div",bme,[y[2]||(y[2]=_("span",{class:"ap-field-label"},"Output",-1)),_("div",xme,R(r.value),1)])):ue("",!0),a.value.length>0?(x(),E("div",wme,[y[4]||(y[4]=_("span",{class:"ap-field-label"},"Progress",-1)),_("div",_me,[(x(!0),E(Pe,null,lt(a.value,k=>(x(),E("div",{key:k.key,class:"ap-group"},[k.call?(x(),E("div",Sme,[y[3]||(y[3]=_("span",{class:"ap-glyph","aria-hidden":"true"},"▶",-1)),nt(" "+R(k.call),1)])):ue("",!0),k.output.length>0?(x(),E("div",Cme,[k.output.length<=Tme||u(k.key)?(x(!0),E(Pe,{key:0},lt(k.output,(g,v)=>(x(),E("div",{key:v,class:"ap-out-line"},R(g),1))),128)):(x(),E(Pe,{key:1},[(x(!0),E(Pe,null,lt(k.output.slice(0,L3),(g,v)=>(x(),E("div",{key:v,class:"ap-out-line"},R(g),1))),128)),_("button",{type:"button",class:"ap-fold",onClick:g=>d(k.key)}," … ("+R(f(k))+" more) ",9,Ame),(x(!0),E(Pe,null,lt(k.output.slice(-$3),(g,v)=>(x(),E("div",{key:"t"+v,class:"ap-out-line"},R(g),1))),128))],64))])):ue("",!0)]))),128))])])):ue("",!0),e.member.summary?(x(),E("div",Mme,[y[5]||(y[5]=_("span",{class:"ap-field-label"},"Result",-1)),_("div",Eme,R(e.member.summary),1)])):ue("",!0)],512)]))}}),Ime=ft(Nme,[["__scopeId","data-v-6f6dc328"]]),Lme={class:"diff-lines"},$me={key:0,class:"hunk-text"},Fme={class:"dl-gutter old"},Ome={class:"dl-gutter new"},Rme={class:"dl-sign"},Bme={class:"dl-text"},Dme=Qe({__name:"DiffLines",props:{lines:{}},setup(e){function t(s){return s.oldNo!==void 0?String(s.oldNo):""}function n(s){return s.newNo!==void 0?String(s.newNo):""}function o(s){return`dl-${s.type}`}return(s,i)=>(x(),E("div",Lme,[(x(!0),E(Pe,null,lt(e.lines,(r,l)=>(x(),E("div",{key:l,class:We(["dl",o(r)])},[r.type==="hunk"?(x(),E("span",$me,R(r.text),1)):(x(),E(Pe,{key:1},[_("span",Fme,R(t(r)),1),_("span",Ome,R(n(r)),1),_("span",Rme,R(r.type==="add"?"+":r.type==="del"?"-":" "),1),_("span",Bme,R(r.text),1)],64))],2))),128))]))}}),GE=ft(Dme,[["__scopeId","data-v-ceae1af5"]]),Pme={class:"tdp"},Hme={class:"tdp-body"},Wme={key:1,class:"tdp-output"},zme={key:2,class:"tdp-empty"},Ume=Qe({__name:"ToolDiffPanel",props:{target:{}},emits:["close"],setup(e,{emit:t}){const n=t,{t:o}=Ot();return(s,i)=>(x(),E("div",Pme,[fe(Ya,{title:e.target.title,subtitle:e.target.path,"close-label":C(o)("thinking.close"),onClose:i[0]||(i[0]=r=>n("close"))},null,8,["title","subtitle","close-label"]),_("div",Hme,[e.target.lines&&e.target.lines.length>0?(x(),Ae(GE,{key:0,lines:e.target.lines},null,8,["lines"])):e.target.output&&e.target.output.length>0?(x(),E("div",Wme,[(x(!0),E(Pe,null,lt(e.target.output,(r,l)=>(x(),E("div",{key:l},R(r),1))),128))])):(x(),E("div",zme,R(C(o)("diff.noDiff")),1))])]))}}),qme=ft(Ume,[["__scopeId","data-v-567c17f4"]]),jme={class:"sc"},Vme={key:0,class:"sc-empty"},Kme={key:2,class:"sc-loading","aria-hidden":"true"},Gme={class:"sc-composer"},Yme=["placeholder"],Zme=["disabled"],Xme=Qe({__name:"SideChatPanel",props:{turns:{},running:{type:Boolean},sending:{type:Boolean},title:{},subtitle:{}},emits:["send","close"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Ot(),i=D(()=>n.turns.find(g=>g.role==="user")?.text?.trim()??""),r=D(()=>n.title?.trim()||s("sideChat.title")),l=D(()=>n.subtitle?.trim()?n.subtitle.trim():i.value||s("sideChat.subtitle")),a=ne(""),c=ne(null),u=ne(null);function d(){const k=a.value.trim();k&&(o("send",k),a.value="",kt(()=>{c.value&&(c.value.style.height="auto"),f()}))}function f(){const k=u.value;k&&(k.scrollTop=k.scrollHeight)}const h=D(()=>{const k=n.turns;if(k.length===0)return"0";const g=k.at(-1),v=g.thinking?.length??0,b=g.tools?.reduce((A,I)=>A+I.name.length+(I.arg?.length??0)+(I.output?.join("").length??0),0)??0;return`${k.length}:${g.text.length}:${v}:${b}`});et(h,async()=>{!n.running&&!n.sending||(await kt(),f())});const p=D(()=>n.sending?n.turns.at(-1)?.role==="user":!1);function m(k){k.key==="Enter"&&!k.shiftKey&&!k.isComposing&&(k.preventDefault(),d())}function y(){const k=c.value;k&&(k.style.height="auto",k.style.height=`${Math.min(k.scrollHeight,160)}px`)}return(k,g)=>(x(),E("div",jme,[fe(Ya,{title:r.value,subtitle:l.value,"close-label":C(s)("thinking.close"),onClose:g[0]||(g[0]=v=>o("close"))},null,8,["title","subtitle","close-label"]),_("div",{ref_key:"bodyRef",ref:u,class:"sc-body"},[e.turns.length===0?(x(),E("div",Vme,R(C(s)("sideChat.empty")),1)):(x(),Ae(RE,{key:1,turns:e.turns,approvals:[],"turn-active":e.running,working:e.sending||e.running},null,8,["turns","turn-active","working"])),p.value?(x(),E("div",Kme,[fe(FE)])):ue("",!0)],512),_("div",Gme,[Wn(_("textarea",{ref_key:"inputRef",ref:c,"onUpdate:modelValue":g[1]||(g[1]=v=>a.value=v),class:"sc-input",rows:"1",placeholder:C(s)("sideChat.placeholder"),onInput:y,onKeydown:m},null,40,Yme),[[ws,a.value]]),fe(rn,{text:C(s)("sideChat.send")},{default:Le(()=>[_("button",{type:"button",class:"sc-send",disabled:!a.value.trim(),onClick:d},[fe(Ye,{name:"arrow-right",size:"sm"})],8,Zme)]),_:1},8,["text"])])]))}}),Qme=ft(Xme,[["__scopeId","data-v-142addaa"]]),Jme={class:"changes-pane"},e1e={class:"dv-path"},t1e={class:"diff-head"},n1e={class:"back-label"},o1e={key:0,class:"empty-state"},s1e={key:1,class:"dv-lines-wrap"},i1e={key:2,class:"empty-state"},r1e={class:"dv-change-count"},l1e={class:"ch-head"},a1e={class:"br-label"},c1e={class:"br-name"},u1e={key:0,class:"sync-info"},d1e={key:0,class:"ahead"},f1e={key:0,class:"behind"},h1e={key:1,class:"empty-head"},p1e={key:0,class:"ch-list"},m1e=["onClick"],g1e={class:"fpath"},v1e={key:1,class:"ch-list ch-tree"},y1e={class:"tree-list"},k1e=["onClick"],b1e={class:"tree-name"},x1e=["onClick"],w1e={class:"tree-name"},_1e={key:2,class:"empty-state"},S1e={key:3,class:"empty-state"},C1e=Qe({__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}=Ot(),o=e,s=t;function i(F){const S=F.toLowerCase();return S==="modified"?"modified":S==="added"?"added":S==="deleted"?"deleted":S==="renamed"?"renamed":S==="untracked"?"untracked":S==="conflicted"?"conflicted":S==="ignored"?"ignored":S==="clean"?"clean":"unknown"}const r={modified:"M",added:"A",deleted:"D",renamed:"R",untracked:"U",conflicted:"C",ignored:"I",clean:"·",unknown:"?"};function l(F){return r[i(F)]??"?"}function a(F,S=60){return F.length<=S?F:"…"+F.slice(F.length-S+1)}const c=D(()=>o.gitInfo!==null),u=D(()=>o.changes.length>0),d=D(()=>(o.selectedDiffPath??null)!==null),f=D(()=>o.mode==="detail"||o.mode==="full"&&d.value),h=D(()=>o.fileDiff??[]),p=D(()=>o.fileDiffLoading===!0);function m(F){s("open",F)}function y(){s("back")}function k(){s("close")}const g=ne("list");function v(F){g.value=F}function b(F){const S={children:[]},B=[...F].sort((W,z)=>W.path.localeCompare(z.path));for(const W of B){const z=W.path.split("/");let L=S;for(let O=0;O<z.length;O++){const j=z[O],Z=O===z.length-1,ie=z.slice(0,O+1).join("/");let U=L.children.find(q=>q.name===j&&q.kind===(Z?"file":"folder"));U||(U={name:j,path:ie,kind:Z?"file":"folder",status:Z?W.status:void 0,children:[]},L.children.push(U)),L=U}}return S.children}const A=D(()=>b(o.changes)),I=ne(new Set);function T(F){return!I.value.has(F)}const M=D(()=>{const F=[];function S(B,W){for(const z of B)F.push({node:z,depth:W}),z.kind==="folder"&&T(z.path)&&S(z.children,W+1)}return S(A.value,0),F});function $(F){const S=new Set(I.value);S.has(F.path)?S.delete(F.path):S.add(F.path),I.value=S}function N(F){return`${16+F*16}px`}return(F,S)=>(x(),E("div",Jme,[f.value?(x(),E(Pe,{key:0},[fe(Ya,{title:C(n)("diff.title"),closable:e.closable,"close-label":C(n)("diff.close"),onClose:k},{default:Le(()=>[fe(rn,{text:e.selectedDiffPath??""},{default:Le(()=>[_("span",e1e,R(a(e.selectedDiffPath??"",50)),1)]),_:1},8,["text"])]),_:1},8,["title","closable","close-label"]),_("div",t1e,[e.hideBack?ue("",!0):(x(),Ae(jt,{key:0,variant:"ghost",size:"sm",onClick:y},{default:Le(()=>[S[0]||(S[0]=_("span",{"aria-hidden":"true"},"←",-1)),_("span",n1e,R(C(n)("diff.back")),1)]),_:1}))]),p.value?(x(),E("div",o1e,R(C(n)("diff.loading")),1)):h.value.length>0?(x(),E("div",s1e,[fe(GE,{lines:h.value},null,8,["lines"])])):(x(),E("div",i1e,R(C(n)("diff.noDiff")),1))],64)):(x(),E(Pe,{key:1},[fe(Ya,{title:C(n)("diff.title"),closable:e.closable,"close-label":C(n)("diff.close"),onClose:k},{default:Le(()=>[_("span",r1e,R(C(n)("diff.changeCount",{count:e.changes.length})),1),fe(ms,{"model-value":g.value,size:"sm",options:[{value:"list",label:C(n)("diff.list")},{value:"tree",label:C(n)("diff.tree")}],"onUpdate:modelValue":v},null,8,["model-value","options"])]),_:1},8,["title","closable","close-label"]),_("div",l1e,[c.value?(x(),E(Pe,{key:0},[_("span",a1e,R(C(n)("diff.branch")),1),_("span",c1e,R(e.gitInfo.branch),1),e.gitInfo.ahead>0||e.gitInfo.behind>0?(x(),E("span",u1e,[fe(rn,{text:C(n)("diff.aheadTitle")},{default:Le(()=>[e.gitInfo.ahead>0?(x(),E("span",d1e,"↑"+R(e.gitInfo.ahead),1)):ue("",!0)]),_:1},8,["text"]),fe(rn,{text:C(n)("diff.behindTitle")},{default:Le(()=>[e.gitInfo.behind>0?(x(),E("span",f1e,"↓"+R(e.gitInfo.behind),1)):ue("",!0)]),_:1},8,["text"])])):ue("",!0)],64)):(x(),E("span",h1e,R(C(n)("diff.empty")),1))]),u.value&&g.value==="list"?(x(),E("div",p1e,[(x(!0),E(Pe,null,lt(e.changes,B=>(x(),Ae(rn,{key:B.path,text:B.path},{default:Le(()=>[_("button",{type:"button",class:"ch-row",onClick:W=>m(B.path)},[_("span",{class:We(["badge",i(B.status)])},R(l(B.status)),3),_("span",g1e,R(a(B.path)),1)],8,m1e)]),_:2},1032,["text"]))),128))])):u.value&&g.value==="tree"?(x(),E("div",v1e,[_("ul",y1e,[(x(!0),E(Pe,null,lt(M.value,({node:B,depth:W})=>(x(),E("li",{key:B.path,class:"tree-node"},[B.kind==="folder"?(x(),E("button",{key:0,type:"button",class:"tree-row tree-folder",style:tn({paddingLeft:N(W)}),onClick:z=>$(B)},[fe(Ye,{class:"tree-icon",name:"folder-solid",size:"sm"}),_("span",b1e,R(B.name),1)],12,k1e)):(x(),Ae(rn,{key:1,text:B.path},{default:Le(()=>[_("button",{type:"button",class:"tree-row tree-file",style:tn({paddingLeft:N(W)}),onClick:z=>m(B.path)},[_("span",{class:We(["badge",i(B.status)])},R(l(B.status)),3),_("span",w1e,R(B.name),1)],12,x1e)]),_:2},1032,["text"]))]))),128))])])):c.value?(x(),E("div",_1e,R(C(n)("diff.clean")),1)):(x(),E("div",S1e,R(C(n)("diff.empty")),1))],64))]))}}),A1e=ft(C1e,[["__scopeId","data-v-335a33c8"]]);function lb(e,t){let n=null;wn(()=>{n=typeof document<"u"&&document.activeElement instanceof HTMLElement?document.activeElement:null,kt(()=>{const o=t?.value??e.value;try{o?.focus()}catch{}})}),so(()=>{const o=n;if(n=null,!(!o||typeof document>"u"||!document.contains(o)))try{o.focus()}catch{}})}const M1e=["type","value","placeholder","disabled","readonly"],E1e=Qe({__name:"Input",props:{modelValue:{},size:{default:"md"},type:{default:"text"},placeholder:{},disabled:{type:Boolean},readonly:{type:Boolean},error:{type:Boolean}},emits:["update:modelValue","focus","blur"],setup(e,{expose:t,emit:n}){const o=n,s=ne();function i(a){o("update:modelValue",a.target.value)}function r(){s.value?.focus()}function l(){s.value?.select()}return t({focus:r,select:l,el:s}),(a,c)=>(x(),E("input",{ref_key:"el",ref:s,class:We(["ui-input",[`ui-input--${e.size}`,{"has-error":e.error}]]),type:e.type,value:e.modelValue,placeholder:e.placeholder,disabled:e.disabled,readonly:e.readonly,onInput:i,onFocus:c[0]||(c[0]=u=>a.$emit("focus",u)),onBlur:c[1]||(c[1]=u=>a.$emit("blur",u))},null,42,M1e))}}),t0=ft(E1e,[["__scopeId","data-v-479f73c4"]]),T1e={class:"search-wrap"},N1e={key:0,class:"tab-strip"},I1e={key:1,class:"state-row"},L1e={key:2,class:"state-row unavail"},$1e={key:3,class:"model-list"},F1e=["aria-selected","onClick","onMouseenter"],O1e={class:"check"},R1e={class:"model-main"},B1e={class:"model-name"},D1e={class:"model-id"},P1e={key:0,class:"caps"},H1e={class:"model-provider"},W1e={class:"model-ctx"},z1e={key:0,class:"empty"},U1e={class:"footer-hint"},q1e=Qe({__name:"ModelPicker",props:{models:{},current:{},starredIds:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["select","toggle-star","close"],setup(e,{emit:t}){const{t:n}=Ot(),o=e,s=t,i=D(()=>new Set(o.starredIds??[]));function r(v){return i.value.has(v)}const l=ne(""),a=ne(null),c=ne(null),u=ne("all");lb(c,a);const d=D(()=>{const v=new Set,b=[{id:"all",label:n("model.allTab")}];for(const A of o.models)v.has(A.provider)||(v.add(A.provider),b.push({id:A.provider,label:A.provider}));return b}),f=D(()=>{const v=l.value.toLowerCase().trim(),b=o.models.filter(A=>{if(u.value!=="all"&&A.provider!==u.value)return!1;const I=(A.displayName??A.model).toLowerCase().includes(v),T=A.provider.toLowerCase().includes(v),M=A.id.toLowerCase().includes(v);return!v||I||T||M});return u.value!=="all"?b:b.sort((A,I)=>{const T=r(A.id)?1:0;return(r(I.id)?1:0)-T})}),h=D(()=>f.value),p=ne(0);et([l,u],()=>{p.value=0}),et(d,v=>{v.some(b=>b.id===u.value)||(u.value="all")}),et(h,v=>{p.value=Math.min(p.value,Math.max(v.length-1,0))});function m(v){if(v.key==="Escape"){s("close");return}if(v.key==="ArrowDown")v.preventDefault(),p.value=Math.min(p.value+1,h.value.length-1);else if(v.key==="ArrowUp")v.preventDefault(),p.value=Math.max(p.value-1,0);else if(v.key==="Enter"){const b=h.value[p.value];b&&s("select",b.id)}}wn(()=>{document.addEventListener("keydown",m)}),In(()=>{document.removeEventListener("keydown",m)});function y(v){s("select",v)}function k(v){return h.value.indexOf(v)}function g(v){u.value=v}return(v,b)=>(x(),Ae(Qr,{open:!0,"close-on-esc":!1,title:C(n)("model.title"),size:"xl",height:"fixed",onClose:b[1]||(b[1]=A=>s("close"))},{default:Le(()=>[_("div",{ref_key:"dialogRef",ref:c,class:"mp"},[_("div",T1e,[fe(t0,{ref_key:"searchRef",ref:a,modelValue:l.value,"onUpdate:modelValue":b[0]||(b[0]=A=>l.value=A),placeholder:C(n)("model.searchPlaceholder"),autocomplete:"off",spellcheck:"false",autofocus:""},null,8,["modelValue","placeholder"])]),d.value.length>1?(x(),E("div",N1e,[(x(!0),E(Pe,null,lt(d.value,A=>(x(),Ae(jt,{key:A.id,variant:A.id===u.value?"secondary":"ghost",size:"sm",onClick:I=>g(A.id)},{default:Le(()=>[nt(R(A.label),1)]),_:2},1032,["variant","onClick"]))),128))])):ue("",!0),e.loading?(x(),E("div",I1e,[fe(Hs,{size:"sm"}),_("span",null,R(C(n)("model.loading")),1)])):e.unavailable?(x(),E("div",L1e,[fe(Ye,{name:"alert-triangle",size:"lg"}),_("span",null,R(C(n)("model.unavailable")),1)])):(x(),E("div",$1e,[(x(!0),E(Pe,null,lt(h.value,A=>(x(),E("div",{key:A.id,class:We(["model-row",{"is-current":A.id===e.current,"is-selected":k(A)===p.value}]),role:"option","aria-selected":A.id===e.current,onClick:I=>y(A.id),onMouseenter:I=>p.value=k(A)},[_("span",O1e,[A.id===e.current?(x(),Ae(Ye,{key:0,name:"check",size:"sm"})):ue("",!0)]),_("span",R1e,[_("span",B1e,R(A.displayName??A.model),1),_("span",D1e,R(A.id),1),A.capabilities&&A.capabilities.length>0?(x(),E("span",P1e,[(x(!0),E(Pe,null,lt(A.capabilities,I=>(x(),Ae(qi,{key:I,variant:"info",size:"sm"},{default:Le(()=>[nt(R(I),1)]),_:2},1024))),128))])):ue("",!0)]),_("span",H1e,R(A.provider),1),_("span",W1e,R(C(n)("model.contextSuffix",{size:C(pr)(A.maxContextSize)})),1),fe(Kn,{size:"sm",label:r(A.id)?C(n)("model.unstarTitle"):C(n)("model.starTitle"),onClick:Ct(I=>s("toggle-star",A.id),["stop"])},{default:Le(()=>[r(A.id)?(x(),Ae(Ye,{key:0,name:"star",size:"md"})):(x(),Ae(Ye,{key:1,name:"star-outline",size:"md"}))]),_:2},1032,["label","onClick"])],42,F1e))),128)),h.value.length===0&&!e.loading&&!e.unavailable?(x(),E("div",z1e,R(o.models.length===0?C(n)("model.emptyNoModels"):C(n)("model.emptyNoMatch")),1)):ue("",!0)])),_("div",U1e,R(C(n)("model.footerHint")),1)],512)]),_:1},8,["title"]))}}),j1e=ft(q1e,[["__scopeId","data-v-0d8e0be0"]]),V1e={key:0,class:"ui-field__label"},K1e={key:1,class:"ui-field__error"},G1e={key:2,class:"ui-field__hint"},Y1e=Qe({__name:"Field",props:{label:{},hint:{},error:{}},setup(e){return(t,n)=>(x(),E("div",{class:We(["ui-field",{"has-error":!!e.error}])},[e.label?(x(),E("label",V1e,R(e.label),1)):ue("",!0),zn(t.$slots,"default",{},void 0,!0),e.error?(x(),E("span",K1e,R(e.error),1)):e.hint?(x(),E("span",G1e,R(e.hint),1)):ue("",!0)],2))}}),Z1e=ft(Y1e,[["__scopeId","data-v-3b312583"]]),X1e={class:"prov-list"},Q1e={key:0,class:"state-row"},J1e={key:1,class:"state-row unavail"},e0e={key:2,class:"empty"},t0e={class:"prov-info"},n0e={class:"prov-type"},o0e={key:0,class:"prov-url"},s0e={class:"prov-meta"},i0e={key:0},r0e={class:"prov-actions"},l0e={key:0,class:"add-section"},a0e={class:"add-form"},c0e={key:0,class:"add-error"},u0e={class:"form-btns"},d0e={class:"footer-hint"},f0e=Qe({__name:"ProviderManager",props:{providers:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["loginApiKey","refresh","logout","openLogin","close"],setup(e,{emit:t}){const{t:n}=Ot(),o=ne(null);lb(o);const s=t,i=ne(!1),r=Do({providerId:"",apiKey:""}),l=ne("");function a(p){r.providerId=p,r.apiKey="",l.value="",i.value=!0}function c(){i.value=!1}function u(){if(!r.apiKey.trim()){l.value=n("providers.apiKeyRequired");return}l.value="",s("loginApiKey",{providerId:r.providerId,value:r.apiKey.trim()}),i.value=!1}function d(p){if(p.key==="Escape"){if(i.value){c();return}s("close")}}wn(()=>document.addEventListener("keydown",d)),In(()=>document.removeEventListener("keydown",d));function f(p){return p==="connected"?"var(--color-success)":p==="error"?"var(--color-danger)":"var(--color-text-faint)"}function h(p){return n(p==="connected"?"providers.status.connected":p==="error"?"providers.status.error":"providers.status.unconfigured")}return(p,m)=>(x(),Ae(Qr,{open:!0,"close-on-esc":!1,title:C(n)("providers.title"),size:"xl",height:"fixed",onClose:m[1]||(m[1]=y=>s("close"))},{default:Le(()=>[_("div",{ref_key:"dialogRef",ref:o,class:"pm"},[_("div",X1e,[e.loading?(x(),E("div",Q1e,[fe(Hs,{size:"sm"}),_("span",null,R(C(n)("providers.loading")),1)])):e.unavailable?(x(),E("div",J1e,[fe(Ye,{name:"alert-triangle",size:"md"}),_("span",null,R(C(n)("providers.unavailable")),1)])):e.providers.length===0?(x(),E("div",e0e,R(C(n)("providers.empty")),1)):(x(!0),E(Pe,{key:3},lt(e.providers,y=>(x(),E("div",{key:y.id,class:"prov-row"},[fe(rn,{text:h(y.status)},{default:Le(()=>[_("span",{class:We(["status-dot",{"status-dot--empty":y.status!=="connected"&&y.status!=="error"}]),style:tn(y.status==="connected"||y.status==="error"?{background:f(y.status)}:void 0)},null,6)]),_:2},1032,["text"]),_("div",t0e,[_("span",n0e,R(y.name),1),y.baseUrl?(x(),E("span",o0e,R(y.baseUrl),1)):ue("",!0),_("span",s0e,[fe(qi,{variant:y.status==="connected"?"success":"neutral",size:"sm"},{default:Le(()=>[nt(R(y.credentialType??C(n)("providers.notConnected")),1)]),_:2},1032,["variant"]),y.models&&y.models.length>0?(x(),E("span",i0e," · "+R(C(n)("providers.modelCount",{count:y.models.length})),1)):ue("",!0)])]),_("div",r0e,[y.status!=="connected"&&y.authMethods.includes("oauth")?(x(),Ae(jt,{key:0,variant:"primary",size:"sm",onClick:k=>s("openLogin",y.id)},{default:Le(()=>[nt(R(C(n)("providers.signIn")),1)]),_:1},8,["onClick"])):ue("",!0),y.status!=="connected"&&y.authMethods.includes("api_key")?(x(),Ae(jt,{key:1,variant:"secondary",size:"sm",onClick:k=>a(y.id)},{default:Le(()=>[nt(R(C(n)("providers.enterApiKey")),1)]),_:1},8,["onClick"])):ue("",!0),fe(rn,{text:C(n)("providers.refreshTitle",{type:y.name})},{default:Le(()=>[fe(jt,{variant:"secondary",size:"sm",onClick:k=>s("refresh",y.id)},{default:Le(()=>[nt(R(C(n)("providers.refresh")),1)]),_:1},8,["onClick"])]),_:2},1032,["text"]),y.status==="connected"?(x(),Ae(rn,{key:2,text:C(n)("providers.logoutTitle",{type:y.name})},{default:Le(()=>[fe(jt,{variant:"danger-soft",size:"sm",onClick:k=>s("logout",y.id)},{default:Le(()=>[nt(R(C(n)("providers.logout")),1)]),_:1},8,["onClick"])]),_:2},1032,["text"])):ue("",!0)])]))),128))]),!e.unavailable&&i.value?(x(),E("div",l0e,[_("template",null,[_("div",a0e,[fe(Z1e,{label:`${e.providers.find(y=>y.id===r.providerId)?.name??r.providerId} · ${C(n)("providers.fieldApiKey")}`},{default:Le(()=>[fe(t0,{modelValue:r.apiKey,"onUpdate:modelValue":m[0]||(m[0]=y=>r.apiKey=y),type:"password",placeholder:"sk-…",autocomplete:"off",spellcheck:"false"},null,8,["modelValue"])]),_:1},8,["label"]),l.value?(x(),E("div",c0e,R(l.value),1)):ue("",!0),_("div",u0e,[fe(jt,{variant:"primary",size:"sm",onClick:u},{default:Le(()=>[nt(R(C(n)("providers.connect")),1)]),_:1}),fe(jt,{variant:"secondary",size:"sm",onClick:c},{default:Le(()=>[nt(R(C(n)("common.cancel")),1)]),_:1})])])])])):ue("",!0),_("div",d0e,R(C(n)("providers.escClose")),1)],512)]),_:1},8,["title"]))}}),h0e=ft(f0e,[["__scopeId","data-v-9db396a7"]]),p0e={key:0,width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",stroke:"var(--color-success)","stroke-width":"2","aria-hidden":"true"},m0e={key:1,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-danger)","stroke-width":"1.5","aria-hidden":"true"},g0e={key:2,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-warning)","stroke-width":"1.5","aria-hidden":"true"},Lv=Qe({__name:"AuthStateIcon",props:{kind:{}},setup(e){return(t,n)=>e.kind==="success"?(x(),E("svg",p0e,[...n[0]||(n[0]=[_("circle",{cx:"18",cy:"18",r:"15"},null,-1),_("polyline",{points:"10,18 15,24 26,12"},null,-1)])])):e.kind==="expired"?(x(),E("svg",m0e,[...n[1]||(n[1]=[_("circle",{cx:"14",cy:"14",r:"12"},null,-1),_("line",{x1:"14",y1:"8",x2:"14",y2:"15"},null,-1),_("circle",{cx:"14",cy:"19",r:"1.2",fill:"var(--color-danger)"},null,-1)])])):(x(),E("svg",g0e,[...n[2]||(n[2]=[_("path",{d:"M14 3 L26 24 H2 Z"},null,-1),_("line",{x1:"14",y1:"12",x2:"14",y2:"18"},null,-1),_("circle",{cx:"14",cy:"21.5",r:"1",fill:"var(--color-warning)"},null,-1)])]))}}),v0e={key:0,class:"center-body"},y0e={class:"center-text"},k0e={key:1,class:"nb"},b0e={class:"nb-lead"},x0e=["href"],w0e={class:"nb-or"},_0e={class:"nb-fallback"},S0e={class:"nb-fb-text"},C0e=["href"],A0e={class:"nb-code-row"},M0e={class:"nb-code"},E0e={class:"nb-status"},T0e={class:"nb-status-text"},N0e={class:"nb-countdown"},I0e={key:2,class:"center-body"},L0e={class:"center-text success-text"},$0e={class:"center-hint"},F0e={class:"center-body"},O0e={class:"center-text err-text"},R0e={class:"center-hint"},B0e={class:"actions"},D0e={class:"center-body"},P0e={class:"center-text warn-text"},H0e={class:"center-hint"},W0e={class:"actions"},z0e=3,U0e=Qe({__name:"LoginDialog",props:{providerName:{},onStartOAuthLogin:{type:Function},onPollOAuthLogin:{type:Function},onCancelOAuthLogin:{type:Function}},emits:["success","close"],setup(e,{emit:t}){const{t:n}=Ot(),o=ne(!0),s=t,i=e,r=ne("starting"),l=ne(!1),a=ne(null),c=ne(0),u=ne(!1);let d=null,f=null,h=0;wn(async()=>{await p()}),In(()=>{k()});async function p(){k(),a.value=null,l.value=!1,h=0,r.value="starting";const I=await i.onStartOAuthLogin();if(!I){r.value="error";return}if(I.status==="authenticated"){k(),r.value="success",setTimeout(()=>{s("success"),s("close")},800);return}a.value={flowId:I.flowId,verificationUri:I.verificationUri,verificationUriComplete:I.verificationUriComplete,userCode:I.userCode,expiresIn:I.expiresIn,interval:I.interval},c.value=I.expiresIn,r.value="device-code",m(),y(I.interval)}function m(){f&&clearInterval(f),f=setInterval(()=>{c.value>0?c.value--:(f&&clearInterval(f),f=null)},1e3)}function y(I){d&&clearTimeout(d),d=setTimeout(async()=>{const T=await i.onPollOAuthLogin();if(T===null){if(h+=1,h>=z0e){k(),l.value=!0,r.value="error";return}y(I);return}h=0,T.status==="authenticated"?(k(),r.value="success",setTimeout(()=>{s("success"),s("close")},1200)):T.status==="expired"||T.status==="cancelled"?(k(),r.value="expired"):y(I)},I*1e3)}function k(){d&&(clearTimeout(d),d=null),f&&(clearInterval(f),f=null)}async function g(){await p()}async function v(){!a.value||!await Xo(a.value.userCode)||(u.value=!0,setTimeout(()=>{u.value=!1},2e3))}async function b(){k(),r.value==="device-code"&&i.onCancelOAuthLogin(),s("close")}function A(I){const T=Math.floor(I/60),M=I%60;return`${T}:${String(M).padStart(2,"0")}`}return(I,T)=>(x(),Ae(Qr,{open:o.value,"onUpdate:open":T[0]||(T[0]=M=>o.value=M),title:C(n)("login.title",{provider:e.providerName}),"close-on-overlay":!1,onClose:b},{default:Le(()=>[r.value==="starting"?(x(),E("div",v0e,[fe(Hs,{size:"md"}),_("span",y0e,R(C(n)("login.starting")),1)])):r.value==="device-code"&&a.value?(x(),E("div",k0e,[_("div",b0e,R(C(n)("login.lead")),1),_("a",{class:"nb-primary",href:a.value.verificationUriComplete,target:"_blank",rel:"noopener noreferrer"},[nt(R(C(n)("login.authorizeInBrowser"))+" ",1),fe(Ye,{name:"external-link",size:"sm"})],8,x0e),_("div",w0e,R(C(n)("login.orDivider")),1),_("div",_0e,[_("div",S0e,[nt(R(C(n)("login.fallbackPrefix")),1),_("a",{class:"nb-fb-link",href:a.value.verificationUri,target:"_blank",rel:"noopener noreferrer"},R(a.value.verificationUri),9,C0e),nt(R(C(n)("login.fallbackSuffix")),1)]),_("div",A0e,[_("span",M0e,R(a.value.userCode),1),fe(jt,{class:We(["nb-copy",{"is-copied":u.value}]),variant:"secondary",size:"sm",onClick:v},{default:Le(()=>[u.value?(x(),E(Pe,{key:0},[fe(Ye,{name:"check",size:"sm"}),nt(" "+R(C(n)("login.copied")),1)],64)):(x(),E(Pe,{key:1},[fe(Ye,{name:"copy",size:"sm"}),nt(" "+R(C(n)("login.copy")),1)],64))]),_:1},8,["class"])])]),_("div",E0e,[fe(Hs,{size:"sm",label:C(n)("login.waitingAuth")},null,8,["label"]),_("span",T0e,R(C(n)("login.waitingAutoClose")),1),_("span",N0e,R(A(c.value)),1)])])):r.value==="success"?(x(),E("div",I0e,[fe(Lv,{kind:"success"}),_("span",L0e,R(C(n)("login.success")),1),_("span",$0e,R(C(n)("login.successHint")),1)])):r.value==="expired"?(x(),E(Pe,{key:3},[_("div",F0e,[fe(Lv,{kind:"expired"}),_("span",O0e,R(C(n)("login.expiredTitle")),1),_("span",R0e,R(C(n)("login.expiredHint")),1)]),_("div",B0e,[fe(jt,{variant:"primary",onClick:g},{default:Le(()=>[nt(R(C(n)("login.retry")),1)]),_:1}),fe(jt,{variant:"secondary",onClick:b},{default:Le(()=>[nt(R(C(n)("login.closeBtn")),1)]),_:1})])],64)):r.value==="error"?(x(),E(Pe,{key:4},[_("div",D0e,[fe(Lv,{kind:"error"}),_("span",P0e,R(l.value?C(n)("login.pollErrorTitle"):C(n)("login.errorTitle")),1),_("span",H0e,R(l.value?C(n)("login.pollErrorHint"):C(n)("login.errorHint")),1)]),_("div",W0e,[fe(jt,{variant:"primary",onClick:g},{default:Le(()=>[nt(R(C(n)("login.retry")),1)]),_:1}),fe(jt,{variant:"secondary",onClick:b},{default:Le(()=>[nt(R(C(n)("login.closeBtn")),1)]),_:1})])],64)):ue("",!0)]),_:1},8,["open","title"]))}}),q0e=ft(U0e,[["__scopeId","data-v-e3693edc"]]);function j0e(e){const t=e.split("/").filter(Boolean);return t.length>0?t[t.length-1]:e}const V0e=/^(?:[A-Za-z]:[\\/]|\\\\|\/\/)/;function zi(e){const t=e.replaceAll("\\","/"),n=V0e.test(t),o=t.replace(/\/+$/,"");return n?o.toLowerCase():o}function K0e(e,t){const n=zi(t.cwd);return e.find(o=>zi(o.root)===n)?.id??t.workspaceId??t.cwd}function G0e(e){const{workspaces:t,sessions:n,hiddenWorkspaceRoots:o,sessionsHasMoreByWorkspace:s}=e,i=new Set(o.map(zi)),r=new Map;for(const d of t){const f=zi(d.root);i.has(f)||r.has(f)||r.set(f,{...d})}for(const d of n){const f=d.cwd;if(!f)continue;const h=zi(f);i.has(h)||r.has(h)||r.set(h,{id:d.workspaceId??f,root:f,name:j0e(f),sessionCount:0})}const l=new Map;for(const d of n){const f=K0e(t,d);l.set(f,(l.get(f)??0)+1)}const a=[];for(const d of t){const f=zi(d.root);!i.has(f)&&!a.includes(f)&&a.push(f)}const c=[...r.keys()].filter(d=>!a.includes(d));c.sort((d,f)=>r.get(d).root.localeCompare(r.get(f).root));const u=[];for(const d of[...a,...c]){const f=r.get(d),h=l.get(f.id)??l.get(f.root)??0,p=s[f.id]===!1?h:Math.max(f.sessionCount,h);u.push({...f,sessionCount:p})}return u}function Y0e(e,t){if(t.length===0||e.length===0)return t;const n=Date.parse(t[0].createdAt);if(Number.isNaN(n))return t;const o=new Set(t.map(r=>r.id)),s=new Set(t.filter(r=>r.role==="user").map(r=>r.id)),i=e.filter(r=>{const l=Date.parse(r.createdAt);return!(Number.isNaN(l)||l>=n||o.has(r.id)||r.role==="user"&&r.promptId!==void 0&&s.has(r.promptId))});return i.length>0?[...i,...t]:t}function F3(e,t){const n=new Set(e.map(a=>a.id)),o=t.filter(a=>a.kind==="subagent"&&!n.has(a.id));if(o.length===0)return e;const s=new Map(e.map(a=>[a.id,a])),i=new Set,r=o.map(a=>{const c=a.backgroundTaskId!==void 0?s.get(a.backgroundTaskId):void 0;if(c===void 0)return a;i.add(c.id);const u=a.status==="running"&&c.status!=="running";return{...a,status:a.status==="running"?c.status:a.status,subagentPhase:u?c.status==="completed"?"completed":"failed":a.subagentPhase,completedAt:a.completedAt??c.completedAt,outputPreview:c.outputPreview??a.outputPreview,outputBytes:c.outputBytes??a.outputBytes}});return[...e.filter(a=>!i.has(a.id)),...r]}function Z0e(e,t){if(e.length===0)return t;const n=new Map(t.map(r=>[r.id,r])),o=new Set(e.map(r=>r.id)),s=e.map(r=>{const l=n.get(r.id);return l?{...r,outputLines:l.outputLines,text:l.text}:r}),i=t.filter(r=>!o.has(r.id));return i.length===0?s:[...s,...i]}function X0e(e){const t=new Map,n=new Set;function o(i){const r=t.get(i);if(r!==void 0)return r;const l=(async()=>e(i))().finally(()=>{t.delete(i),n.delete(i)&&o(i)});return t.set(i,l),l}function s(i){if(t.has(i)){n.add(i);return}o(i)}return{run:o,request:s}}const Q0e=new Set(["assistantDelta","agentDelta","toolOutput","taskProgress"]);function J0e(e){return Q0e.has(e.type)}const ege=50,tge=100,ak=32*1024,nge={requestFrame(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):null},cancelFrame(e){typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(e)},requestTask(e){return setTimeout(e,ege)},cancelTask(e){clearTimeout(e)}};function oge(e,t,n={}){const o=n.scheduler??nge,s=Math.max(1,Math.floor(n.maxItemsPerSlice??tge)),i=[];let r=0,l=null,a=null,c=0,u=!1;const d=()=>i.length-r,f=()=>{c+=1,l!==null&&(o.cancelFrame(l),l=null),a!==null&&(o.cancelTask(a),a=null)},h=()=>{r===i.length?(i.length=0,r=0):r>=1024&&(i.splice(0,r),r=0)};let p;const m=()=>{if(u||l!==null||a!==null||d()===0)return;const k=++c,g=()=>{k===c&&p()};l=o.requestFrame(g),a=o.requestTask(g)};p=()=>{f();let k=0;for(;!u&&k<s&&r<i.length;){const g=i[r++];e(g),k+=1}h(),m()};const y=(k=>{if(!u){if(t(k)){const g=i.length>r?i.at(-1):void 0,v=g===void 0?void 0:n.coalesce?.(g,k);v===void 0?i.push(k):i[i.length-1]=v,m();return}if(d()===0){e(k);return}i.push(k),p()}});return y.flush=()=>{if(!u){for(f();!u&&r<i.length;)e(i[r++]);h()}},y.discard=k=>{if(u||d()===0)return;let g=r;for(let v=r;v<i.length;v+=1){const b=i[v];k(b)||(i[g++]=b)}i.length=g,h(),d()===0?f():m()},y.dispose=()=>{u||(u=!0,f(),i.length=0,r=0)},y}function ck(e){if(e.type==="assistantDelta"){if(e.delta.text!==void 0&&e.delta.thinking===void 0)return{kind:"text",value:e.delta.text};if(e.delta.thinking!==void 0&&e.delta.text===void 0)return{kind:"thinking",value:e.delta.thinking}}}function sge(e){if(e.appEvent.type!=="assistantDelta")return[e];const t=e.appEvent,n=e.meta.stream,o=ck(t);if(n===void 0||o===void 0||n.kind!==o.kind||o.value.length<=ak)return[e];const s=[];let i=0;for(;i<o.value.length;){let r=Math.min(i+ak,o.value.length);r<o.value.length&&r>i&&/[\uD800-\uDBFF]/u.test(o.value[r-1])&&/[\uDC00-\uDFFF]/u.test(o.value[r])&&(r-=1);const l=o.value.slice(i,r);s.push({appEvent:{...t,delta:o.kind==="text"?{text:l}:{thinking:l}},meta:{...e.meta,stream:{...n,offset:n.offset+i}}}),i=r}return s}function ige(e,t){if(e.appEvent.type!=="assistantDelta"||t.appEvent.type!=="assistantDelta")return;const n=e.meta.stream,o=t.meta.stream,s=ck(e.appEvent),i=ck(t.appEvent);if(n===void 0||o===void 0||s===void 0||i===void 0||e.meta.sessionId!==t.meta.sessionId||e.appEvent.sessionId!==t.appEvent.sessionId||e.appEvent.messageId!==t.appEvent.messageId||e.appEvent.contentIndex!==t.appEvent.contentIndex||n.turnId!==o.turnId||n.kind!==o.kind||s.kind!==i.kind||n.kind!==s.kind||o.kind!==i.kind||o.offset!==n.offset+s.value.length||s.value.length+i.value.length>ak)return;const r=s.value+i.value;return{appEvent:{...e.appEvent,delta:s.kind==="text"?{text:r}:{thinking:r}},meta:{...t.meta,stream:{...n}}}}const YE=["blue","mono"],ZE=["light","dark","system"],XE=14,rge=12,lge=20;function age(){const e=uo(Ht.accent);return e&&YE.includes(e)?e:"blue"}function cge(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.accent=e)}function uge(){const e=uo(Ht.colorScheme);return e&&ZE.includes(e)?e:"system"}function dge(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(o=>{const i=(o.getAttribute("media")??"").includes("dark")?"#0d1117":"#ffffff";o.setAttribute("content",n??i)})}function ab(e){return Number.isFinite(e)?Math.min(lge,Math.max(rge,Math.round(e))):XE}function fge(){const e=uo(Ht.uiFontSize);return e===null?XE:ab(Number(e))}function hge(e){typeof document>"u"||!document.documentElement||document.documentElement.style.setProperty("--base-ui-font-size",`${ab(e)}px`)}const cb=ne(uge()),ub=ne(age()),db=ne(fge());et(cb,dge,{immediate:!0});et(ub,cge,{immediate:!0});et(db,hge,{immediate:!0});function pge(e){ZE.includes(e)&&(cb.value=e,xo(Ht.colorScheme,e))}function mge(e){YE.includes(e)&&(ub.value=e,xo(Ht.accent,e))}function gge(e){const t=ab(e);db.value=t,xo(Ht.uiFontSize,String(t))}const vge=600,yge=250,n0=250,kge=1e3,bge=160,Km=ne(!1);let Aa=[],La=null,Gm=-n0;function xge(){Aa=[],Gm=-n0,Km.value=!1,La!==null&&(clearTimeout(La),La=null)}function wge(){Km.value=!0,La!==null&&clearTimeout(La),La=setTimeout(()=>{La=null,Aa=[],Gm=-n0,Km.value=!1},kge)}function _ge(e){if(e<=0)return;const t=Date.now();Aa.push({time:t,chars:e});const n=t-vge;if(Aa=Aa.filter(l=>l.time>=n),t-Gm<n0)return;Gm=t;const o=Aa[0]?.time??t,s=Math.max(t-o,yge);Aa.reduce((l,a)=>l+a.chars,0)/s*1e3>=bge&&wge()}function QE(){return{colorScheme:cb,accent:ub,uiFontSize:db,fastMoon:Km,setColorScheme:pge,setAccent:mge,setUiFontSize:gge,resetFastMoon:xge,recordMoonDelta:_ge}}function Sge(e,t,n){return e==="idle"&&!t&&!n}function fb(e,t){const n=uo(e);return n===null?t:n==="1"}const hb=ne(fb(Ht.notifyOnComplete,!0)),pb=ne(fb(Ht.notifyOnQuestion,!1)),mb=ne(fb(Ht.notifyOnApproval,!1)),gb=ne(typeof Notification<"u"?Notification.permission:"denied"),Cge="/favicon.ico";async function vb(e,t,n){if(!n){e.value=!1,xo(t,"0");return}if(typeof Notification>"u")return;let o=Notification.permission;if(o==="default")try{o=await Notification.requestPermission()}catch{}gb.value=o,o==="granted"&&(e.value=!0,xo(t,"1"))}function Age(e){return vb(hb,Ht.notifyOnComplete,e)}function Mge(e){return vb(pb,Ht.notifyOnQuestion,e)}function Ege(e){return vb(mb,Ht.notifyOnApproval,e)}function yb(...e){for(const t of e){const n=t?.trim();if(n)return n}return""}function Tge(e){return{title:$n.global.t("settings.notifyTitle"),body:yb(e,$n.global.t("settings.notifyFallback"))}}function Nge(e,t){return{title:$n.global.t("settings.notifyQuestionTitle"),body:yb(t,e,$n.global.t("settings.notifyQuestionFallback"))}}function Ige(e,t){return{title:$n.global.t("settings.notifyApprovalTitle"),body:yb(t,e,$n.global.t("settings.notifyApprovalFallback"))}}function kb(e,t,n,o){if(!e||typeof Notification>"u")return;const s=Notification.permission;if(s!=="denied"){if(s==="default"){Notification.requestPermission().then(i=>{gb.value=i,i==="granted"&&O3(t,n,o)});return}O3(t,n,o)}}function O3(e,t,n){if(!e.isUserWatching)try{const o=new Notification(t.title,{body:t.body,tag:n,icon:Cge});o.onclick=()=>{try{window.focus()}catch{}e.onClick(),o.close()}}catch{}}function Lge(e,t){kb(hb.value,t,Tge(t.sessionTitle),`dimi-complete-${e}-${t.promptId??Date.now()}`)}function $ge(e){kb(pb.value,e,Nge(e.sessionTitle,e.questionPreview),`dimi-question-${e.questionId}`)}function Fge(e){kb(mb.value,e,Ige(e.sessionTitle,e.toolName),`dimi-approval-${e.approvalId}`)}function Oge(){return{notifyOnComplete:hb,notifyOnQuestion:pb,notifyOnApproval:mb,notifyPermission:gb,setNotifyOnComplete:Age,setNotifyOnQuestion:Mge,setNotifyOnApproval:Ege,maybeNotifyCompletion:Lge,maybeNotifyQuestion:$ge,maybeNotifyApproval:Fge}}function Rge(){return uo(Ht.soundOnComplete)==="1"}const Eu=ne(Rge());function Bge(){if(typeof window>"u")return;const e=window;return window.AudioContext??e.webkitAudioContext}let $v=null;function JE(){const e=Bge();if(!e)return null;if($v===null)try{$v=new e}catch{return null}return $v}function eT(){if(!Eu.value)return;const e=JE();e!==null&&e.state==="suspended"&&e.resume().then(()=>{Br("sound: audio context resumed",{state:e.state})},t=>{Br("sound: audio context resume rejected",{error:String(t)})})}let R3=!1;function Dge(){if(R3||typeof window>"u")return;R3=!0;const e=()=>{eT()};window.addEventListener("pointerdown",e,{capture:!0}),window.addEventListener("keydown",e,{capture:!0})}Dge();function Pge(e){Eu.value=e,xo(Ht.soundOnComplete,e?"1":"0"),e&&eT()}function B3(e,t,n,o,s){const i=e.createOscillator(),r=e.createGain();i.type="sine",i.frequency.value=t,i.connect(r),r.connect(e.destination);const l=e.currentTime+n;r.gain.setValueAtTime(1e-4,l),r.gain.exponentialRampToValueAtTime(s,l+.01),r.gain.exponentialRampToValueAtTime(1e-4,l+o),i.start(l),i.stop(l+o+.02)}function bb(){const e=JE();if(e===null){Br("sound: skipped, AudioContext unavailable");return}if(e.state!=="running"){Br("sound: skipped, context not running",{state:e.state}),e.state==="suspended"&&e.resume().then(()=>{Br("sound: context resumed for next time",{state:e.state})},t=>{Br("sound: resume rejected",{error:String(t)})});return}try{B3(e,880,0,.16,.18),B3(e,1320,.1,.22,.16),Br("sound: chime scheduled",{state:e.state})}catch(t){Br("sound: failed to play",{error:String(t)})}}function Hge(){Eu.value&&bb()}function Wge(){Eu.value&&bb()}function zge(){Eu.value&&bb()}function Uge(){return{soundOnComplete:Eu,setSoundOnComplete:Pge,maybePlayCompletionSound:Hge,maybePlayQuestionSound:Wge,maybePlayApprovalSound:zge}}const qge=1e3,jge=4096,D3=32*1024;function Vge(e,t){let n=null,o;const s=new Set;async function i(f){try{const p=await pt().listTasks(f);e.tasksBySession={...e.tasksBySession,[f]:F3(p,e.tasksBySession[f]??[])},await r(f,p)}catch{}}async function r(f,h){if(e.activeSessionId!==f)return;const p=h??e.tasksBySession[f]??[],m=pt(),y=new Map;if(await Promise.all(p.map(async g=>{if((g.status==="completed"||g.status==="failed"||g.status==="cancelled")&&!s.has(g.id)&&!((g.outputLines?.length??0)>0))try{const b=await m.getTask(f,g.id,{withOutput:!0,outputBytes:D3});b.outputPreview!==void 0&&y.set(g.id,{preview:b.outputPreview,bytes:b.outputBytes}),s.add(g.id)}catch{}})),y.size===0)return;const k=e.tasksBySession[f]??[];e.tasksBySession={...e.tasksBySession,[f]:k.map(g=>{const v=y.get(g.id)??(g.backgroundTaskId!==void 0?y.get(g.backgroundTaskId):void 0);return v?{...g,outputPreview:v.preview,outputBytes:v.bytes}:g})}}async function l(f){if(e.activeSessionId!==f)return;const h=pt();let p;try{p=await h.listTasks(f)}catch{return}const m=new Map;await Promise.all(p.map(async v=>{const b=v.status==="running",A=v.status==="completed"||v.status==="failed"||v.status==="cancelled";if(!(!b&&!A)&&!(A&&(s.has(v.id)||(v.outputLines?.length??0)>0)))try{const I=await h.getTask(f,v.id,{withOutput:!0,outputBytes:b?jge:D3});I.outputPreview!==void 0&&m.set(v.id,{preview:I.outputPreview,bytes:I.outputBytes}),A&&s.add(v.id)}catch{}}));const y=e.tasksBySession[f]??[],k=new Map(y.map(v=>[v.id,v])),g=p.map(v=>{const b=k.get(v.id),A=m.get(v.id);return{...v,outputLines:b?.outputLines,text:b?.text,outputPreview:A?.preview??b?.outputPreview,outputBytes:A?.bytes??b?.outputBytes}});e.tasksBySession={...e.tasksBySession,[f]:F3(g,y)}}function a(f){n!==null&&o===f||(c(),o=f,l(f),n=setInterval(()=>{typeof document<"u"&&document.visibilityState==="hidden"||(e.activeSessionId===f?l(f):c())},qge))}function c(){n!==null&&(clearInterval(n),n=null),o=void 0,s.clear()}const u=ne(0);let d=null;return et(()=>t.value.some(f=>f.status==="running"),f=>{f&&d===null?d=setInterval(()=>{u.value=(u.value+1)%Number.MAX_SAFE_INTEGER},1e3):!f&&d!==null&&(clearInterval(d),d=null)},{immediate:!0}),et(()=>{const f=e.activeSessionId;if(!f)return{sid:void 0,hasRunning:!1};const h=e.tasksBySession[f]??[];return{sid:f,hasRunning:h.some(p=>p.status==="running")}},({sid:f,hasRunning:h},p,m)=>{let y;h&&f!==void 0?a(f):f!==void 0?y=setTimeout(()=>{(e.tasksBySession[f]??[]).some(g=>g.status==="running")||c()},1500):c(),m(()=>{y!==void 0&&clearTimeout(y)})},{deep:!0,immediate:!0}),{taskClock:D(()=>u.value),loadTasksForSession:i}}function Kge(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 Gge(e){const t=[];if(!e)return t;let n=0,o=0,s=!1;for(const i of e.split(`
|
|
314
|
-
`)){if(i.startsWith("diff --git")){s=!1;continue}if(!s&&Kge(i))continue;if(i.startsWith("@@")){const a=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(i);a&&(n=Number.parseInt(a[1],10),o=Number.parseInt(a[2],10)),s=!0,t.push({type:"hunk",text:i});continue}if(!s||i.startsWith("\\"))continue;const r=i.charAt(0),l=i.slice(1);r==="+"?(t.push({type:"add",text:l,newNo:o}),o+=1):r==="-"?(t.push({type:"del",text:l,oldNo:n}),n+=1):r===" "&&(t.push({type:"context",text:l,oldNo:n,newNo:o}),n+=1,o+=1)}return t}const uk="/sessions/";function P3(e){const{pathname:t}=e;if(!t.startsWith(uk))return;const n=t.slice(uk.length);if(!(!n||n.includes("/")))try{const o=decodeURIComponent(n);return o.length>0?o:void 0}catch{return}}function Yge(e){return e===void 0||e.length===0?"/":`${uk}${encodeURIComponent(e)}`}const Zge=50,dk=5,Xge=40402,Qge=40410,Jge=40902,eve=2e3;function Fv(e){return _i(e)&&e.code===Jge}const tve=40904;function nve(e){return _i(e)&&e.code===tve}const va=Do({}),hp=Do({}),Ov=Do({}),or=Do(new Set),o0=new Map,Za=new Map,Ym=new Map;let ove=0;const ba=new Map,sve=3;let H3=0;function ive(){return H3+=1,`${Date.now().toString(36)}-${H3}`}function rve(e){return{generation:o0.get(e)??0,pending:(Za.get(e)?.size??0)>0}}function fk(e){const t=++ove;o0.set(e,t);const n=Za.get(e)??new Set;return n.add(t),Za.set(e,n),t}function hk(e,t){const n=Za.get(e);if(n===void 0||(n.delete(t),n.size>0))return;Za.delete(e);const o=Ym.get(e);Ym.delete(e),o?.()}function lve(e){o0.delete(e),Za.delete(e),Ym.delete(e),ba.delete(e)}function ave(e,t){return!t.pending&&t.generation===(o0.get(e)??0)}function cve(e,t){if((Za.get(e)?.size??0)===0){t();return}Ym.set(e,t)}function uve(e,t){const{t:n}=$n.global,{confirm:o}=zf(),{taskPoller:s,sideChat:i,modelProvider:r,pushOperationFailure:l,activity:a,sessionsKnownEmpty:c,setSessions:u,updateSession:d,upsertSessionFront:f,appendSession:h,forgetSession:p,setActiveSessionId:m,updateSessionMessages:y,nextOptimisticMsgId:k,getEventConn:g,syncSessionFromSnapshot:v,reopenSession:b,hasLoadedMessages:A,refreshSessionStatus:I,refreshSessionGoal:T,persistSessionProfile:M,mergedWorkspaces:$,workspacesView:N,status:F,workspaceIdForSession:S,savePermissionToStorage:B,savePlanModeToStorage:W,saveSwarmModeToStorage:z,saveGoalModeToStorage:L,draftModes:O,saveUnread:j,saveActiveWorkspaceToStorage:Z,saveHiddenWorkspacesToStorage:ie,goalErrorMessage:U,resetFastMoon:q,initialized:ee,connectIssue:le,selectedDiffPath:oe,fileDiffLines:re,fileDiffLoading:we}=t;let me=!1;async function Ee(te){if(e.messagesLoadingMoreBySession[te])return;const _e=e.messagesBySession[te];if(!_e||_e.length===0)return;const Me=_e[0].id;e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[te]:!0},e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[te]:!1};try{const Oe=await pt().listMessages(te,{beforeId:Me,pageSize:Zge}),Ze=[...Oe.items].reverse();y(te,at=>[...Ze,...at]),e.messagesHasMoreBySession={...e.messagesHasMoreBySession,[te]:Oe.hasMore}}catch(Oe){e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[te]:!0},l("loadOlderMessages",Oe,{sessionId:te})}finally{e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[te]:!1}}}function ae(te){s.loadTasksForSession(te),P(te),I(te),T(te),Object.prototype.hasOwnProperty.call(r.skillsBySession.value,te)||r.loadSkillsForSession(te)}async function Y(te){const _e=e.activeSessionId;if(_e){oe.value=te,re.value=[],we.value=!0;try{const Oe=await pt().getFileDiff(_e,te);if(oe.value!==te)return;re.value=Gge(Oe.diff)}catch(Me){oe.value===te&&(re.value=[]),console.warn("[loadFileDiff] diff unavailable for",te,Me)}finally{oe.value===te&&(we.value=!1)}}}function Q(){oe.value=null,re.value=[],we.value=!1}async function P(te){try{const Me=await pt().getGitStatus(te);e.gitStatusBySession={...e.gitStatusBySession,[te]:Me}}catch{}}async function G(){try{const _e=await pt().getAuth();return e.authReady=_e.ready,e.defaultModel=_e.defaultModel,e.authenticatedProviders=_e.authenticatedProviders,le.value=null,"proceed"}catch(te){return _i(te)&&(te.code===401||te.code===IE)?(le.value=null,"server-auth-required"):(le.value=(te instanceof Error?te.message:String(te)).slice(0,140),"retry")}}async function pe(){let te=!0;for(;;){const _e=await G();if(_e!=="retry")return _e;te&&(le.value=null,te=!1),await new Promise(Me=>{setTimeout(Me,eve)})}}async function ve(){try{const te=pt();e.config=await te.getConfig()}catch{}}async function de(te){try{const Me=await pt().setConfig(te);return e.config=Me,e.defaultModel=Me.defaultModel??null,!0}catch(_e){return l("setConfig",_e),!1}}const V=100,se=30,he=720*60*1e3;async function ke(){const te=pt(),_e=[];let Me,Oe;for(;;){let Ze;try{Ze=await te.listSessions({pageSize:V,beforeId:Me,excludeEmpty:!0})}catch(at){if(_e.length===0)throw at;Oe=at;break}if(_e.push(...Ze.items),!Ze.hasMore||Ze.items.length===0)break;Me=Ze.items[Ze.items.length-1].id}return{sessions:_e,error:Oe}}function Te(te){const _e=new Map(e.sessions.map(Me=>[Me.id,Me.usage]));u(te.map(Me=>{const Oe=_e.get(Me.id);return Oe!==void 0&&Jy(Me.usage)&&!Jy(Oe)?{...Me,usage:Oe}:Me}))}function ze(te){const _e=[...te],Me=new Set(_e.map(Oe=>Oe.id));for(const Oe of e.sessions)Me.has(Oe.id)||(_e.push(Oe),Me.add(Oe.id));return _e.sort((Oe,Ze)=>new Date(Ze.updatedAt).getTime()-new Date(Oe.updatedAt).getTime()),_e}async function ye(te){const _e=pt(),Me=[],Oe=Date.now(),Ze=Vt=>Oe-new Date(Vt.updatedAt).getTime();let at,$t=!1,Qt=!0,an;for(;;){let Vt;try{Vt=await _e.listSessions({workspaceId:te,pageSize:dk,beforeId:at,excludeEmpty:!0})}catch(Lt){if(Qt)throw Lt;an=Lt,$t=!0;break}if($t=Vt.hasMore,Vt.items.length===0)break;const Bn=Vt.items[Vt.items.length-1],to=Ze(Bn)>=he;if(!Qt&&to){const Lt=Vt.items.findIndex(Yt=>Ze(Yt)>=he),St=Lt>=0?Lt+1:Vt.items.length;Me.push(...Vt.items.slice(0,St)),$t=Vt.hasMore||St<Vt.items.length;break}if(Me.push(...Vt.items),Qt=!1,!Vt.hasMore||to)break;at=Bn.id}return{workspaceId:te,page:{items:Me,hasMore:$t},error:an}}async function be(){const te=e.workspaces;if(te.length===0){const Lt=await ke(),St=Lt.error===void 0?Lt.sessions:ze(Lt.sessions);return e.sessionsHasMoreByWorkspace={},e.sessionsCursorByWorkspace={},e.sessionsInitialCountByWorkspace={},e.sessionsFullyLoaded=Lt.error===void 0,Lt.error!==void 0&&l("load",Lt.error),St}const _e=await Promise.allSettled(te.map(Lt=>ye(Lt.id))),Me=[],Oe=new Set,Ze=new Map,at=new Set;let $t;for(let Lt=0;Lt<_e.length;Lt++){const St=_e[Lt];if(St.status==="fulfilled"){Ze.set(St.value.workspaceId,St.value.page),St.value.error!==void 0&&(at.size===0&&($t=St.value.error),at.add(St.value.workspaceId));for(const Yt of St.value.page.items)Oe.has(Yt.id)||(Me.push(Yt),Oe.add(Yt.id));continue}at.size===0&&($t=St.reason),at.add(te[Lt].id)}if(Ze.size===0){l("load",$t);return}const Qt=new Set(te.filter(Lt=>at.has(Lt.id)).map(Lt=>Lt.root)),an=new Set(te.map(Lt=>Lt.id));for(const Lt of e.sessions)!(Lt.workspaceId!==void 0&&an.has(Lt.workspaceId)?at.has(Lt.workspaceId):Qt.has(Lt.cwd)||at.has(S(Lt)))||Oe.has(Lt.id)||(Me.push(Lt),Oe.add(Lt.id));const Vt={},Bn={},to={};for(const{id:Lt}of te){const St=Ze.get(Lt);if(St===void 0){const Yt=e.sessionsHasMoreByWorkspace[Lt],Gn=e.sessionsCursorByWorkspace[Lt],Qn=e.sessionsInitialCountByWorkspace[Lt];Yt!==void 0&&(Vt[Lt]=Yt),Gn!==void 0&&(Bn[Lt]=Gn),Qn!==void 0&&(to[Lt]=Qn);continue}Vt[Lt]=St.hasMore,Bn[Lt]=St.items.length>0?St.items[St.items.length-1].id:void 0,to[Lt]=Math.max(St.items.length,dk)}return e.sessionsHasMoreByWorkspace=Vt,e.sessionsCursorByWorkspace=Bn,e.sessionsInitialCountByWorkspace=to,e.sessionsFullyLoaded=!1,Me.sort((Lt,St)=>new Date(St.updatedAt).getTime()-new Date(Lt.updatedAt).getTime()),at.size>0&&l("load",$t),Me}async function Ge(te){if(e.sessionsLoadingMoreByWorkspace[te]||e.sessionsHasMoreByWorkspace[te]===!1)return;const _e=e.sessionsCursorByWorkspace[te];if(_e!==void 0){e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[te]:!0};try{const Me=await pt().listSessions({workspaceId:te,pageSize:se,beforeId:_e,excludeEmpty:!0}),Oe=new Set(e.sessions.map(at=>at.id)),Ze=Me.items.filter(at=>!Oe.has(at.id));Ze.length>0&&u([...e.sessions,...Ze]),e.sessionsCursorByWorkspace={...e.sessionsCursorByWorkspace,[te]:Me.items.length>0?Me.items[Me.items.length-1].id:_e},e.sessionsHasMoreByWorkspace={...e.sessionsHasMoreByWorkspace,[te]:Me.hasMore}}catch(Me){l("loadMoreSessions",Me)}finally{e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[te]:!1}}}}async function tt(){if(e.sessionsFullyLoaded)return;const te=await ke().catch(Oe=>(console.warn("[dimi-web] loadAllSessions failed; search covers only loaded sessions",Oe),null));if(te===null)return;const _e=te.error===void 0?te.sessions:ze(te.sessions);if(Te(_e),e.sessionsFullyLoaded=te.error===void 0,te.error!==void 0)return;const Me={};for(const Oe of e.workspaces)Me[Oe.id]=!1;e.sessionsHasMoreByWorkspace=Me}async function rt(){const te=await pt().getMeta().catch(()=>null);te!==null&&(e.serverVersion=te.serverVersion,e.availableOpenInApps=te.openInApps,e.dangerousBypassAuth=te.dangerousBypassAuth)}async function ut(){const te=Date.now();let _e="accepted";mo("app:load:start"),e.loading=!0;const Me=!ee.value;let Oe=!0;try{if(Me&&await pe()==="server-auth-required"){Oe=!1,_e="auth-required";return}const Ze=pt();await Promise.all([Ze.getHealth().catch(()=>null),rt(),r.loadModels()]),Me||await G(),await ve(),await vt();const at=await be(),$t=at??e.sessions;at!==void 0&&Te(at);const Qt=$t[0],an=e.activeWorkspaceId;!(an!==null&&$.value.some(to=>to.id===an))&&Qt&&_t(S(Qt)),dn();const Bn=typeof window<"u"?P3(window.location):void 0;!e.activeSessionId&&Bn!==void 0&&(e.sessions.some(Lt=>Lt.id===Bn)||await Sn(Bn))&&await nn(Bn,{urlMode:"replace"}),!e.activeSessionId&&$t.length>0&&await nn($t[0].id,{urlMode:"replace"})}catch(Ze){_e="failed",l("load",Ze)}finally{e.loading=!1,Oe&&(ee.value=!0),mo("app:load:complete",{status:_e,sessionId:e.activeSessionId,sessionCount:e.sessions.length,workspaceCount:e.workspaces.length,durationMs:Date.now()-te})}}async function vt(){try{const te=pt(),[_e,Me]=await Promise.all([te.listWorkspaces().catch(()=>[]),te.getFsHome().catch(()=>({home:"",recentRoots:[]}))]);e.workspaces=Nt(_e),e.fsHome=Me.home||null,e.recentRoots=Me.recentRoots}catch{}}function Nt(te){const _e=Rh();return Object.keys(_e).length===0?te:te.map(Me=>{const Oe=_e[Me.root];return Oe!==void 0?{...Me,name:Oe}:Me})}function _t(te){e.activeWorkspaceId=te,Z(te)}function Rt(te){_t(te);const _e=e.sessions.filter(Me=>S(Me)===te);if(_e.length>0){const Me=_e[0];Me&&Me.id!==e.activeSessionId&&nn(Me.id)}else m(void 0),Gt(void 0,"push")}function ln(te){const _e=Rh()[te.root],Me=_e!==void 0?{...te,name:_e}:te,Oe=zi(Me.root);e.hiddenWorkspaceRoots.some($t=>zi($t)===Oe)&&(e.hiddenWorkspaceRoots=e.hiddenWorkspaceRoots.filter($t=>zi($t)!==Oe),ie(e.hiddenWorkspaceRoots));const Ze=e.workspaces.findIndex($t=>$t.id===Me.id||$t.root===Me.root);if(Ze===-1){e.workspaces=[Me,...e.workspaces];return}const at=[...e.workspaces];at[Ze]=Me,e.workspaces=at}function Ln(te){if(te.type==="workspaceCreated"||te.type==="workspaceUpdated"){ln(te.workspace);return}const _e=e.workspaces.find(Oe=>Oe.id===te.workspaceId)?.root??te.root;if(_e&&!e.hiddenWorkspaceRoots.includes(_e)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,_e],ie(e.hiddenWorkspaceRoots)),e.workspaces=e.workspaces.filter(Oe=>Oe.id!==te.workspaceId&&Oe.root!==_e),e.activeWorkspaceId===te.workspaceId||e.activeWorkspaceId===_e){const Oe=N.value[0]?.id??null;if(e.activeWorkspaceId=Oe,Oe)Z(Oe);else try{qa(Ht.activeWorkspace)}catch{}m(void 0),e.sessionLoading=!1,Q(),Gt(void 0,"replace")}}function Wt(){m(void 0),Gt(void 0,"push")}function un(te){_t(te),Wt(),Q()}async function vn(te){const _e=$.value.find(Bn=>Bn.id===te);if(!_e)return null;const Me=e.thinking,Oe=pt();let Ze,at=_e.root;try{const Bn=await Oe.addWorkspace({root:_e.root});Ze=Bn.id,at=Bn.root,ln(Bn)}catch{}const $t=r.draftModel.value??void 0,Qt=await Oe.createSession({workspaceId:Ze,cwd:at,model:$t});r.draftModel.value=null;const an=$t!==void 0&&(!Qt.model||Qt.model.length===0)?{...Qt,model:$t}:Qt;f(an),_t(Qt.workspaceId??Ze??te),await nn(Qt.id);const Vt=Qt.id;return Me!==void 0&&(e.thinkingBySession={...e.thinkingBySession,[Vt]:Me}),O.planMode&&(e.planModeBySession={...e.planModeBySession,[Vt]:!0},W()),O.swarmMode&&(e.swarmModeBySession={...e.swarmModeBySession,[Vt]:!0},z()),O.goalMode&&(e.goalModeBySession={...e.goalModeBySession,[Vt]:!0},L()),O.planMode=!1,O.swarmMode=!1,O.goalMode=!1,Vt}async function Xt(te,_e,Me){if(!or.has(te)){or.add(te);try{const Oe=await vn(te);if(!Oe)return;await fn(Oe,_e,Me)}catch(Oe){l("startSessionAndSendPrompt",Oe)}finally{or.delete(te)}}}async function An(te,_e,Me){if(!or.has(te)){or.add(te);try{const Oe=await vn(te);if(!Oe)return;const Ze=e.planModeBySession[Oe]??!1,at=e.swarmModeBySession[Oe]??!1,$t=e.sessions.find(Vt=>Vt.id===Oe),Qt=($t?.model&&$t.model.length>0?$t.model:e.defaultModel)??void 0;if(!await M({model:Qt,planMode:Ze,swarmMode:at,permissionMode:e.permission},Oe))return;await r.activateSkill(_e,Me,Oe)}catch(Oe){l("startSessionAndActivateSkill",Oe)}finally{or.delete(te)}}}async function Je(te,_e){if(!or.has(te)){or.add(te);try{const Me=await vn(te);if(!Me)return;await i.openSideChatOn(Me,_e)}catch(Me){l("startSessionAndOpenSideChat",Me)}finally{or.delete(te)}}}async function Ve(te){const _e=te.trim();if(!_e)return!1;const Me=pt();try{const Oe=await Me.addWorkspace({root:_e});return ln(Oe),un(Oe.id),!0}catch(Oe){return console.warn("[dimi-web] addWorkspaceByPath failed for",_e,Oe),!1}}async function It(te){try{return await pt().browseFs(te)}catch{return{path:"",parent:null,entries:[]}}}async function Kt(){try{return await pt().getFsHome()}catch{return{home:"",recentRoots:[]}}}function Gt(te,_e){if(_e==="none"||typeof window>"u"||!window.history)return;const Me=Yge(te);if(window.location.pathname!==Me)try{_e==="push"?window.history.pushState(null,"",Me):window.history.replaceState(null,"",Me)}catch{}}async function Sn(te){try{const _e=await pt().getSession(te);return e.sessions.some(Me=>Me.id===_e.id)||h(_e),!0}catch{return!1}}function mt(){const te=P3(window.location);if(te===void 0){m(void 0);return}if(te!==e.activeSessionId){if(e.sessions.some(_e=>_e.id===te)){nn(te,{urlMode:"none"});return}(async()=>{if(await Sn(te)){await nn(te,{urlMode:"none"});return}const _e=e.sessions[0];_e?await nn(_e.id,{urlMode:"replace"}):(m(void 0),Gt(void 0,"replace"))})()}}let Rn=!1;function dn(){Rn||typeof window>"u"||(Rn=!0,window.addEventListener("popstate",mt))}async function nn(te,_e){const Me=A(te),Oe=!Me&&c.has(te);c.delete(te);try{Gt(te,_e?.urlMode??"push"),e.sessionLoading=!Me&&!Oe,m(te),q(),e.unreadBySession[te]&&(e.unreadBySession={...e.unreadBySession,[te]:!1},j({[te]:!1})),Q();const Ze=e.sessions.find(at=>at.id===te);if(Ze){const at=S(Ze);e.activeWorkspaceId!==at&&_t(at)}if(Me){if(await b(te)==="not-found")return}else if(await v(te)==="not-found")return;ae(te)}catch(Ze){l("selectSession",Ze,{sessionId:te})}finally{e.activeSessionId===te&&(e.sessionLoading=!1)}}async function fn(te,_e,Me){const Oe=fk(te);e.inFlightBySession={...e.inFlightBySession,[te]:!0};const Ze=k();try{const at=pt(),$t=[];_e&&$t.push({type:"text",text:_e});for(const Yt of Me??[])Yt.kind==="video"?$t.push({type:"video",source:{kind:"file",fileId:Yt.fileId}}):Yt.kind==="file"?$t.push({type:"file",fileId:Yt.fileId,name:Yt.name??"",mediaType:Yt.mediaType||"application/octet-stream",size:Yt.size??0}):$t.push({type:"image",source:{kind:"file",fileId:Yt.fileId}});if($t.length===0)return e.inFlightBySession={...e.inFlightBySession,[te]:!1},"rejected";const Qt={id:Ze,sessionId:te,role:"user",content:$t,createdAt:new Date().toISOString(),metadata:{"dimiWeb.optimisticUserMessage":!0}};y(te,Yt=>[...Yt,Qt]);const an=e.sessions.find(Yt=>Yt.id===te),Vt=(an?.model&&an.model.length>0?an.model:e.defaultModel)??void 0,Bn=e.planModeBySession[te]??!1,to=e.swarmModeBySession[te]??!1,Lt=e.goalModeBySession[te]??!1;if(Lt&&_e)try{await at.updateSession(te,{goalObjective:_e.trim()})}catch(Yt){return l("createGoal",Yt,{sessionId:te}),e.inFlightBySession={...e.inFlightBySession,[te]:!1},y(te,Gn=>Gn.some(Qn=>Qn.id===Ze)?Gn.filter(Qn=>Qn.id!==Ze):Gn),"rejected"}const St=await at.submitPrompt(te,{content:$t,model:Vt,thinking:await r.resolveThinkingForPrompt(te,Vt)??e.thinking,permissionMode:e.permission,planMode:Bn,swarmMode:to});return Lt&&(e.goalModeBySession={...e.goalModeBySession,[te]:!1},L()),e.promptIdBySession={...e.promptIdBySession,[te]:St.promptId},y(te,Yt=>{const Gn=Yt.findIndex(Vs=>Vs.id===Ze);if(Gn===-1)return Yt;const Qn=[...Yt];return Qn[Gn]={...Qn[Gn],promptId:Qn[Gn].promptId??St.promptId},Qn}),g()?.bindNextPromptId(te,St.promptId),"ok"}catch(at){return e.inFlightBySession={...e.inFlightBySession,[te]:!1},y(te,$t=>$t.some(Qt=>Qt.id===Ze)?$t.filter(Qt=>Qt.id!==Ze):$t),l("sendPrompt",at,{sessionId:te}),_i(at)?"rejected":"uncertain"}finally{hk(te,Oe)}}async function Po(te,_e){const Me=e.activeSessionId;if(Me){if(a.value!=="idle"||e.inFlightBySession[Me]){li(te,_e);return}if((e.queuedBySession[Me]?.length??0)>0){li(te,_e),_s(Me);return}await fn(Me,te,_e)}}async function Ho(te,_e){const Me=e.activeSessionId;if(!Me)return;const Oe=e.queuedBySession[Me]??[],Ze=[],at=[];for(const St of Oe){const Yt=St.text.trim();Yt&&Ze.push(Yt),St.attachments?.length&&at.push(...St.attachments)}const $t=te.trim();if($t&&Ze.push($t),_e?.length&&at.push(..._e),Ze.length===0&&at.length===0)return;Oe.length>0&&(e.queuedBySession={...e.queuedBySession,[Me]:[]});const Qt=Ze.join(`
|
|
315
|
-
|
|
316
|
-
`),an=()=>{if(Oe.length===0)return;const St=e.queuedBySession[Me]??[];e.queuedBySession={...e.queuedBySession,[Me]:[...Oe,...St]}};if(a.value==="idle"&&!e.inFlightBySession[Me]){await fn(Me,Qt,at)==="rejected"&&an();return}const Vt=[];Qt&&Vt.push({type:"text",text:Qt});for(const St of at)St.kind==="video"?Vt.push({type:"video",source:{kind:"file",fileId:St.fileId}}):St.kind==="file"?Vt.push({type:"file",fileId:St.fileId,name:St.name??"",mediaType:St.mediaType||"application/octet-stream",size:St.size??0}):Vt.push({type:"image",source:{kind:"file",fileId:St.fileId}});const Bn=k(),to={id:Bn,sessionId:Me,role:"user",content:Vt,createdAt:new Date().toISOString(),metadata:{"dimiWeb.optimisticUserMessage":!0}};y(Me,St=>[...St,to]);const Lt=fk(Me);try{const St=pt(),Yt=e.sessions.find(Vs=>Vs.id===Me),Gn=(Yt?.model&&Yt.model.length>0?Yt.model:e.defaultModel)??void 0,Qn=await St.submitPrompt(Me,{content:Vt,model:Gn,thinking:await r.resolveThinkingForPrompt(Me,Gn)??e.thinking,permissionMode:e.permission,planMode:e.planModeBySession[Me]??!1,swarmMode:e.swarmModeBySession[Me]??!1});if(y(Me,Vs=>{const Ii=Vs.findIndex(Kf=>Kf.id===Bn);if(Ii===-1)return Vs;const Ks=[...Vs];return Ks[Ii]={...Ks[Ii],promptId:Ks[Ii].promptId??Qn.promptId},Ks}),Qn.status!=="queued"){e.promptIdBySession={...e.promptIdBySession,[Me]:Qn.promptId},g()?.bindNextPromptId(Me,Qn.promptId);return}try{await St.steerPrompts(Me,[Qn.promptId])}catch{}}catch(St){y(Me,Yt=>Yt.filter(Gn=>Gn.id!==Bn)),_i(St)&&an(),l("steer",St,{sessionId:Me})}finally{hk(Me,Lt)}}async function dt(te,_e){try{const Oe=await pt().uploadFile({file:te,name:_e});return{fileId:Oe.id,name:Oe.name,mediaType:Oe.mediaType}}catch(Me){return l("uploadImage",Me),null}}function li(te,_e){const Me=e.activeSessionId;if(!Me)return;const Oe=e.queuedBySession[Me]??[],Ze={text:te,attachments:_e,id:ive()};e.queuedBySession={...e.queuedBySession,[Me]:[...Oe,Ze]}}function _s(te){const[_e,...Me]=e.queuedBySession[te]??[];_e!==void 0&&(e.queuedBySession={...e.queuedBySession,[te]:Me},fn(te,_e.text,_e.attachments).then(Oe=>{if(Oe==="ok"){ba.delete(te);return}if(Oe==="uncertain"){ba.delete(te);return}if(!e.sessions.some(an=>an.id===te)){ba.delete(te);return}const Ze=_e.id??_e.text,at=ba.get(te),$t=at!==void 0&&at.key===Ze?at.count+1:1;if($t>=sve){ba.delete(te),(e.queuedBySession[te]?.length??0)>0&&_s(te);return}ba.set(te,{key:Ze,count:$t});const Qt=e.queuedBySession[te]??[];e.queuedBySession={...e.queuedBySession,[te]:[_e,...Qt]}}))}function Eo(te,_e){const Me=e.inFlightBySession[te]===!0;if(e.inFlightBySession={...e.inFlightBySession,[te]:!1},e.promptIdBySession[te]!==void 0){const Ze={...e.promptIdBySession};delete Ze[te],e.promptIdBySession=Ze}return te===e.activeSessionId&&q(),(Me||_e?.turnWasActive===!0||(e.turnActiveBySession[te]??!1))&&_s(te),Me}function _o(te,_e){_e.inFlightTurn!==null&&_e.busy||Eo(te)}async function Un(){const te=e.activeSessionId;if(!te)return;const _e=e.sessions.find(Ze=>Ze.id===te);let Me=e.promptIdBySession[te];if(Me===void 0){const Ze=_e?.currentPromptId;Ze!==void 0&&Ze.length>0&&!Ze.startsWith("pr_")&&(Me=Ze)}const Oe=pt();if(Me!==void 0)try{if((await Oe.abortPrompt(te,Me)).aborted)return;const at={...e.promptIdBySession};delete at[te],e.promptIdBySession=at}catch(Ze){if(_i(Ze)&&Ze.code===Xge){const at={...e.promptIdBySession};delete at[te],e.promptIdBySession=at}else{l("abortCurrentPrompt",Ze,{sessionId:te});return}}try{await Oe.abortSession(te)}catch(Ze){l("abortCurrentPrompt",Ze,{sessionId:te})}}function To(te,_e){const Me=e.approvalsBySession[te]??[];e.approvalsBySession={...e.approvalsBySession,[te]:Me.filter(Oe=>Oe.approvalId!==_e)}}function lo(te,_e){const Me=e.questionsBySession[te]??[];e.questionsBySession={...e.questionsBySession,[te]:Me.filter(Oe=>Oe.questionId!==_e)}}async function Wo(te,_e){const Me=e.activeSessionId;if(Me&&!hp[te]){hp[te]=!0;try{const Oe=pt(),Ze={decision:_e.decision,scope:_e.scope,feedback:_e.feedback,selectedLabel:_e.selectedLabel};await Oe.respondApproval(Me,te,Ze),To(Me,te)}catch(Oe){Fv(Oe)?To(Me,te):l("respondApproval",Oe,{sessionId:Me})}finally{delete hp[te]}}}async function Ss(te,_e){const Me=e.activeSessionId;if(Me&&!va[te]){va[te]="answer";try{await pt().respondQuestion(Me,te,_e),lo(Me,te)}catch(Oe){Fv(Oe)?lo(Me,te):l("respondQuestion",Oe,{sessionId:Me})}finally{delete va[te]}}}async function So(te){const _e=e.activeSessionId;if(_e&&!va[te]){va[te]="dismiss";try{await pt().dismissQuestion(_e,te),lo(_e,te)}catch(Me){Fv(Me)?lo(_e,te):l("dismissQuestion",Me,{sessionId:_e})}finally{delete va[te]}}}async function Ws(te){const _e=e.activeSessionId;if(_e&&!Ov[te]){Ov[te]=!0;try{const Me=pt(),Oe=(e.tasksBySession[_e]??[]).find(at=>at.id===te)?.backgroundTaskId;await Me.cancelTask(_e,Oe??te);const Ze=e.tasksBySession[_e]??[];e.tasksBySession={...e.tasksBySession,[_e]:Ze.map(at=>at.id===te?{...at,status:"cancelled"}:at)}}catch(Me){nve(Me)||l("cancelTask",Me,{sessionId:_e})}finally{delete Ov[te]}}}function zo(te){const _e=e.activeSessionId;_e?(e.planModeBySession={...e.planModeBySession,[_e]:te},W(),M({planMode:te})):O.planMode=te}function ai(){const te=e.activeSessionId,_e=te?e.planModeBySession[te]??!1:O.planMode;zo(!_e)}function Qo(te){const _e=e.activeSessionId;_e?(e.swarmModeBySession={...e.swarmModeBySession,[_e]:te},z(),M({swarmMode:te})):O.swarmMode=te}async function No(){const te=e.activeSessionId,Me=!(te?e.swarmModeBySession[te]??!1:O.swarmMode);Me&&e.permission==="manual"&&!await o({title:n("workspace.swarmEnableConfirm"),variant:"primary"})||Qo(Me)}function Io(te){const _e=e.activeSessionId;_e?(e.goalModeBySession={...e.goalModeBySession,[_e]:te},L()):O.goalMode=te}function ci(){const te=e.activeSessionId,_e=te?e.goalModeBySession[te]??!1:O.goalMode;Io(!_e)}async function en(te){const _e=te.trim();if(!_e||e.permission==="manual"&&!await o({title:n("workspace.goalStartConfirm",{objective:_e}),variant:"primary"}))return;let Me=e.activeSessionId;if(!Me){const Oe=e.activeWorkspaceId,Ze=Oe&&N.value.some(at=>at.id===Oe)?Oe:N.value[0]?.id??null;if(!Ze)return;try{Me=await vn(Ze)??void 0}catch(at){l("createGoal",at);return}if(!Me)return}try{await pt().updateSession(Me,{goalObjective:_e})}catch(Oe){l("createGoal",Oe,{sessionId:Me,message:U(Oe)});return}e.goalModeBySession[Me]&&(e.goalModeBySession={...e.goalModeBySession,[Me]:!1},L()),e.activeSessionId===Me?await Po(_e):await fn(Me,_e)}function zs(te){const _e=e.activeSessionId;_e&&Promise.resolve(pt().updateSession(_e,{goalControl:te})).catch(Me=>{l("controlGoal",Me,{sessionId:_e,message:U(Me)})})}function Xn(te){e.permission=te,B(te),M({permissionMode:te})}function Us(te){const _e=[...e.warnings];_e.splice(te,1),e.warnings=_e}async function ui(te,_e){try{await pt().updateSession(te,{title:_e}),d(te,Oe=>({...Oe,title:_e}))}catch(Me){l("renameSession",Me,{sessionId:te})}}async function Ni(te,_e){const Me=e.workspaces.find(Ze=>Ze.id===te)?.root,Oe=()=>{e.workspaces=e.workspaces.map(Ze=>Ze.id===te?{...Ze,name:_e}:Ze)};try{if(await pt().updateWorkspace(te,{name:_e}),Me!==void 0){const Ze=Rh();Me in Ze&&(delete Ze[Me],b_(Ze))}Oe()}catch(Ze){if(Me!==void 0&&_i(Ze)&&Ze.code===Qge){b_({...Rh(),[Me]:_e}),Oe();return}l("renameWorkspace",Ze)}}async function di(te){const _e=e.workspaces.find(at=>at.id===te)?.root??$.value.find(at=>at.id===te)?.root??te,Me=e.activeSessionId?e.sessions.find(at=>at.id===e.activeSessionId):void 0,Oe=e.activeWorkspaceId===te||e.activeWorkspaceId===_e,Ze=!!(Me&&(Me.cwd===_e||Me.workspaceId===te||S(Me)===te));_e&&!e.hiddenWorkspaceRoots.includes(_e)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,_e],ie(e.hiddenWorkspaceRoots));try{await pt().deleteWorkspace(te)}catch(at){console.warn("[dimi-web] deleteWorkspace registry cleanup failed for",te,at)}if(e.workspaces=e.workspaces.filter(at=>at.id!==te&&at.root!==_e),Oe||Ze){const at=N.value[0]?.id??null;if(e.activeWorkspaceId=at,at)Z(at);else try{qa(Ht.activeWorkspace)}catch{}}(Oe||Ze)&&(m(void 0),e.sessionLoading=!1,Q(),Gt(void 0,"replace"))}async function qs(te){try{await pt().archiveSession(te),p(te),i.clearSideChatForSession(te);const{[te]:Me,...Oe}=e.sideChatUserMessageIdsBySession;if(e.sideChatUserMessageIdsBySession=Oe,e.activeSessionId===te){const Ze=e.sessions[0];Ze?await nn(Ze.id,{urlMode:"replace"}):(m(void 0),Gt(void 0,"replace"))}}catch(_e){l("archiveSession",_e,{sessionId:te})}}async function Jo(te){if(me)return;const _e=te??e.activeSessionId;if(!_e){const Oe=n("commands.export.noSession");mo("export:failed",{status:"no-session"}),l("exportSession",new Error(Oe),{message:Oe});return}me=!0;const Me=Date.now();mo("export:start",{sessionId:_e});try{const Oe=Iie(),{blob:Ze,fileName:at}=await pt().exportSession(_e,Oe);if(typeof document>"u")throw new Error("Document is unavailable");const $t=URL.createObjectURL(Ze);let Qt;try{Qt=document.createElement("a"),Qt.href=$t,Qt.download=at,document.body.append(Qt),Qt.click()}finally{Qt?.remove(),setTimeout(()=>{try{URL.revokeObjectURL($t)}catch{}},0)}mo("export:accepted",{sessionId:_e,status:"accepted",zipBytes:Ze.size,durationMs:Date.now()-Me})}catch(Oe){const Ze=typeof Oe=="object"&&Oe!==null?Oe:void 0;mo("export:failed",{sessionId:_e,status:"failed",durationMs:Date.now()-Me,errorName:typeof Ze?.name=="string"?Ze.name:typeof Oe,errorCode:typeof Ze?.code=="number"?Ze.code:void 0,requestId:typeof Ze?.requestId=="string"?Ze.requestId:void 0,phase:typeof Ze?.phase=="string"?Ze.phase:void 0,httpStatus:typeof Ze?.status=="number"?Ze.status:void 0}),l("exportSession",Oe,{sessionId:_e})}finally{me=!1}}async function es(te){try{const _e=await pt().restoreSession(te);return f(_e),!0}catch(_e){return l("restoreSession",_e,{sessionId:te}),!1}}function zt(te){return pt().listSessions({archivedOnly:!0,beforeId:te?.beforeId,pageSize:te?.pageSize??50})}async function js(te){try{const _e=pt(),Me=e.defaultModel?.includes("/")?e.defaultModel.slice(0,e.defaultModel.indexOf("/")):void 0,Oe=te??e.authenticatedProviders.find(Ze=>Ze.id===Me)?.id??e.authenticatedProviders[0]?.id;if(Oe===void 0)return;await _e.logoutProvider(Oe),await G(),await ut()}catch(_e){l("logout",_e)}}function Lo(te){const _e=e.activeSessionId;_e&&pt().compactSession(_e,te).catch(Me=>{l("compact",Me,{sessionId:_e})})}async function fi(te){const _e=te??e.activeSessionId;if(_e)try{const Me=await pt().forkSession(_e);f(Me),await nn(Me.id)}catch(Me){l("fork",Me,{sessionId:_e})}}async function je(te=1){const _e=e.activeSessionId;if(!_e)return null;const Me=(()=>{const Oe=e.messagesBySession[_e]??[];for(let Ze=Oe.length-1;Ze>=0;Ze--){const at=Oe[Ze];if(at.role==="user"&&!(at.metadata?.origin&&at.metadata.origin.kind!=="user"))return at.content.filter($t=>$t.type==="text").map($t=>$t.text).join(`
|
|
317
|
-
`)}return null})();try{return await pt().undoSession(_e,te),await v(_e),Me}catch(Oe){return l("undo",Oe,{sessionId:_e}),null}}function it(te){const _e=e.activeSessionId;if(!_e)return;const Me=e.queuedBySession[_e]??[];if(te<0||te>=Me.length)return;const Oe=[...Me];Oe.splice(te,1),e.queuedBySession={...e.queuedBySession,[_e]:Oe}}function De(te,_e){const Me=e.activeSessionId;if(!Me)return;const Oe=e.queuedBySession[Me]??[];if(te===_e||te<0||te>=Oe.length||_e<0||_e>=Oe.length)return;const Ze=[...Oe],[at]=Ze.splice(te,1);at!==void 0&&(Ze.splice(_e,0,at),e.queuedBySession={...e.queuedBySession,[Me]:Ze})}async function ge(te){const _e=e.activeSessionId;if(!_e)return[];try{return(await pt().listDirectory(_e,{path:te,includeGitStatus:!0})).items}catch{return[]}}async function K(te){const _e=e.activeSessionId;if(!_e)return null;try{const Oe=await pt().readFile(_e,{path:te});return{path:Oe.path,content:Oe.content,encoding:Oe.encoding,mime:Oe.mime,languageId:Oe.languageId,isBinary:Oe.isBinary,size:Oe.size,lineCount:Oe.lineCount}}catch(Me){return console.warn("[dimi-web] readFileContent failed for",te,Me),null}}const xe=10485760;function He(te){const _e=e.activeSessionId;return _e?pt().getFileDownloadUrl(_e,te):null}async function Dt(te,_e){const Me=e.activeSessionId;if(!Me)return!1;try{return await pt().openFile(Me,{path:te,line:_e}),!0}catch(Oe){return l("openFile",Oe,{sessionId:Me}),!1}}async function Ut(te){const _e=e.activeSessionId;if(!_e)return;const Me=F.value.cwd||".";try{await pt().openInApp(_e,te,Me)}catch(Oe){l("openInApp",Oe,{sessionId:_e})}}async function yn(te){const _e=e.activeSessionId;if(!_e)return!1;try{return await pt().revealFile(_e,{path:te}),!0}catch(Me){return l("revealFile",Me,{sessionId:_e}),!1}}async function ao(te){if(/^(https?:|data:|blob:)/i.test(te))return te;const _e=e.activeSessionId;if(!_e)return te;let Me=te;if(Me.startsWith("/")){const Oe=e.sessions.find(Ze=>Ze.id===_e)?.cwd;if(Oe&&(Me===Oe||Me.startsWith(Oe.endsWith("/")?Oe:`${Oe}/`))){if(Me=Me.slice(Oe.length).replace(/^\//,""),!Me)return te}else return te}try{const Ze=await pt().readFile(_e,{path:Me,length:xe});return!Ze.isBinary||Ze.encoding!=="base64"||Ze.truncated?te:`data:${Ze.mime};base64,${Ze.content}`}catch{return te}}async function ls(te){const _e=e.activeSessionId;if(!_e)return[];try{return(await pt().searchFiles(_e,{query:te,limit:20})).items.map(Ze=>({path:Ze.path,name:Ze.name}))}catch{return[]}}return{loadFileDiff:Y,clearFileDiff:Q,loadGitStatus:P,checkAuth:G,loadConfig:ve,updateConfig:de,listAllSessionsGlobal:ke,load:ut,refreshServerMeta:rt,loadWorkspaces:vt,loadMoreSessions:Ge,loadAllSessions:tt,selectWorkspace:_t,openWorkspace:Rt,upsertWorkspacePreserveOrder:ln,applyWorkspaceEvent:Ln,clearActiveSession:Wt,openWorkspaceDraft:un,startSessionAndSendPrompt:Xt,startSessionAndActivateSkill:An,startSessionAndOpenSideChat:Je,addWorkspaceByPath:Ve,browseFs:It,getFsHome:Kt,writeSessionUrl:Gt,fetchSessionIntoList:Sn,onSessionRoutePopState:mt,bindSessionRoute:dn,selectSession:nn,submitPromptInternal:fn,finishPromptLocal:Eo,localTurnStartState:rve,isLocalTurnSnapshotCurrent:ave,afterLocalTurnStartsSettle:cve,handleSessionSnapshot:_o,sendPrompt:Po,steerPrompt:Ho,uploadImage:dt,enqueue:li,unqueue:it,reorderQueue:De,abortCurrentPrompt:Un,respondApproval:Wo,respondQuestion:Ss,dismissQuestion:So,pendingQuestionActions:va,pendingApprovalActions:hp,cancelTask:Ws,setPlanMode:zo,togglePlanMode:ai,setSwarmMode:Qo,toggleSwarmMode:No,setGoalMode:Io,toggleGoalMode:ci,createGoal:en,controlGoal:zs,setPermission:Xn,dismissWarning:Us,renameSession:ui,renameWorkspace:Ni,deleteWorkspace:di,archiveSession:qs,exportSession:Jo,restoreSession:es,loadArchivedSessions:zt,logout:js,compact:Lo,forkSession:fi,undo:je,listDir:ge,readFileContent:K,getFileDownloadUrl:He,openWorkspaceFile:Dt,openInApp:Ut,revealWorkspaceFile:yn,resolveImageUrl:ao,searchFiles:ls,loadOlderMessages:Ee,refreshSessionSidecars:ae,isStartingFirstPrompt:()=>or.size>0}}const tT=Ht.starredModels,W3=new Error("profile persist failed");function dve(){try{const e=uo(tT);if(!e)return[];const t=JSON.parse(e);if(Array.isArray(t)&&t.every(n=>typeof n=="string"))return t}catch{}return[]}function fve(e){try{xo(tT,JSON.stringify(e))}catch{}}function hve(e,t){const{pushOperationFailure:n,refreshSessionStatus:o,persistSessionProfile:s,activity:i,updateSession:r,updateSessionMessages:l}=t,a=ne([]),c=ne(dve()),u=ne({}),d=ne({}),f=ne([]),h=ne(null);function p(U){if(!(U==null||U.length===0))return a.value.find(q=>q.id===U)??a.value.find(q=>q.model===U)}function m(){const U=e.activeSessionId?e.sessions.find(ee=>ee.id===e.activeSessionId):void 0,q=U===void 0?h.value??e.defaultModel:U.model||e.defaultModel;return p(q)?.id??q??void 0}function y(U){if(U===void 0)return;const q=p(U);return q===void 0?void 0:_f(q)}function k(U,q){const ee=U==null?void 0:e.thinkingBySession[U];return ee!==void 0&&tue(q,ee)?ee:_f(q)}function g(U,q){if(q===void 0)return;const ee=p(q);return ee===void 0?void 0:k(U,ee)}async function v(U,q){return U!=null&&e.thinkingBySession[U]===void 0&&await o(U),g(U,q)}function b(U){e.thinking=U;const q=e.activeSessionId;return U!==void 0&&q!==null&&q!==void 0&&(e.thinkingBySession={...e.thinkingBySession,[q]:U}),U}et([()=>e.activeSessionId,()=>m(),()=>{const U=e.activeSessionId;return U==null?void 0:e.thinkingBySession[U]}],()=>{const U=p(m());U!==void 0&&(e.thinking=k(e.activeSessionId,U))});function A(U){pt().setConfig({thinking:nue(U,p(m())?.supportEfforts)}).catch(q=>n("setConfig",q))}async function I(U){try{const ee=await pt().listSkills(U);u.value={...u.value,[U]:ee}}catch{}}async function T(U){try{const ee=await pt().listSkillsForWorkspace(U);d.value={...d.value,[U]:ee}}catch{}}async function M(){try{const U=pt();a.value=await U.listModels();const q=p(m());q!==void 0&&(e.thinking=k(e.activeSessionId,q))}catch(U){n("loadModels",U)}}async function $(){try{const U=pt();f.value=await U.listProviders()}catch(U){n("loadProviders",U)}}async function N(U){const q=e.activeSessionId,ee=p(U),le=e.thinking,oe=q?e.sessions.find(me=>me.id===q)?.model:void 0,re=m()!==(ee?.id??U),we=oue(ee,le,re);if(!q)return h.value=U,e.thinking=we,we!==le&&we!==void 0&&A(we),!0;r(q,me=>({...me,model:U})),we!==le&&(e.thinking=we,we!==void 0&&(e.thinkingBySession={...e.thinkingBySession,[q]:we}));try{await pt().updateSession(q,{model:U,thinking:we!==le?we:void 0})}catch(me){return r(q,Ee=>({...Ee,model:oe??Ee.model})),we!==le&&(e.thinking=le,le!==void 0&&(e.thinkingBySession={...e.thinkingBySession,[q]:le})),n("setModel",me,{sessionId:q}),!1}return we!==le&&we!==void 0&&A(we),await o(q),!0}function F(U){const q=new Set(c.value);q.has(U)?q.delete(U):q.add(U),c.value=Array.from(q),fve(c.value)}async function S(U,q,ee){const le=ee??e.activeSessionId;if(!le)return;const oe=i.value==="idle"&&!e.inFlightBySession[le],re=`msg_skill_opt_${Date.now().toString(36)}`,we=oe?fk(le):void 0;if(oe){e.inFlightBySession={...e.inFlightBySession,[le]:!0};const me={id:re,sessionId:le,role:"user",content:[{type:"text",text:`/${U}${q?` ${q}`:""}`}],createdAt:new Date().toISOString(),metadata:{"dimiWeb.optimisticUserMessage":!0,origin:{kind:"skill_activation",trigger:"user-slash",skillName:U,skillArgs:q}}};l(le,Ee=>[...Ee,me])}try{const me=e.sessions.find(Y=>Y.id===le)?.model,Ee=(me&&me.length>0?me:e.defaultModel)??void 0;if(!await s({thinking:await v(le,Ee)??e.thinking},le))throw W3;await pt().activateSkill(le,U,q)}catch(me){oe&&(e.inFlightBySession={...e.inFlightBySession,[le]:!1},l(le,Ee=>Ee.filter(ae=>ae.id!==re))),me!==W3&&n("activateSkill",me,{sessionId:le})}finally{we!==void 0&&hk(le,we)}}async function B(U,q){try{return await pt().loginProviderApiKey(U,q),await Promise.all([$(),M()]),!0}catch(ee){return n("loginProviderApiKey",ee,{message:U}),!1}}async function W(U){try{await pt().logoutProvider(U),await Promise.all([$(),M()])}catch(q){n("logoutProvider",q,{message:U})}}async function z(U){try{const q=await pt().refreshProvider(U);for(const ee of q.failed)n("refreshProvider",new Error(ee.message),{message:ee.provider});await Promise.all([$(),M()])}catch(q){n("refreshProvider",q)}}async function L(){try{const U=await pt().refreshAllProviders();for(const q of U.failed)n("refreshAllProviders",new Error(q.message),{message:q.provider});await Promise.all([$(),M()])}catch(U){n("refreshAllProviders",U)}}async function O(U){try{return await pt().startOAuthLogin(U)}catch{return null}}async function j(U){try{return await pt().pollOAuthLogin(U)}catch(q){return console.warn("[dimi-web] pollOAuthLogin failed",q),null}}async function Z(U){try{await pt().cancelOAuthLogin(U)}catch{}}function ie(U){const q=b(U);s({thinking:q}),q!==void 0&&A(q)}return{models:a,starredModelIds:c,providers:f,draftModel:h,skillsBySession:u,skillsByWorkspace:d,loadSkillsForSession:I,loadSkillsForWorkspace:T,loadModels:M,loadProviders:$,setModel:N,thinkingLevelForModelId:y,thinkingLevelForSessionId:g,resolveThinkingForPrompt:v,toggleStarModel:F,activateSkill:S,loginProviderApiKey:B,logoutProvider:W,refreshProvider:z,refreshAllProviders:L,startOAuthLogin:O,pollOAuthLogin:j,cancelOAuthLogin:Z,setThinking:ie}}const nT="dimiWeb.compaction",pve=/^read[_-]?media(?:file)?$/i,mve=/^data:([^;]+);base64,(.*)$/s,gve=/^<(image|video|audio)\s+path="([^"]+)">$/,vve=/^<(image|video|audio)\s+path="([^"]+)">(?:<\/\1>)?$/,yve=/Mime type:\s*([^.\s]+)/i,kve=/Size:\s*(\d+)\s*bytes/i,bve=/Original dimensions:\s*(\d+)x(\d+)\s*pixels/i,xve="<system>Image compressed to fit model limits:",wve=/<system>Image compressed to fit model limits:[\s\S]*?<\/system>/g;function _ve(e){return e.includes(xve)?e.replace(wve,""):e}function Sve(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function Cve(e){const t=vve.exec(e.trim());return t?{kind:t[1],path:Sve(t[2])}:null}const oT=/^f_(?:[0-9A-Za-z]{26}|[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})$/,Ave=/^f_(?:[0-9A-Za-z]{26}|[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})(?=-)/;function Mve(e){const t=e.split(/[\\/]/).at(-1)??"",n=t.lastIndexOf("."),o=n>0?t.slice(0,n):t;return oT.test(o)?o:void 0}const Eve=/^Attached file "(.+)" \(([^,]+), (\d+) bytes\): (.+) — open it with the Read tool$/;function Tve(e){const t=Eve.exec(e.trim());if(!t)return null;const n=(t[4]??"").split(/[\\/]/).at(-1)??"",o=Ave.exec(n)?.[0];return{name:t[1],mediaType:t[2],size:Number(t[3]),fileId:o!==void 0&&oT.test(o)?o:void 0}}function Nve(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 Ive(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 Lve(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 s=e[n==="image"?"imageUrl":n==="video"?"videoUrl":"audioUrl"];if(typeof s!="object"||s===null)return null;const i=s.url;return typeof i=="string"?{kind:n,url:i}:null}function $ve(e,t){if(!pve.test(e))return;const n=Ive(t);if(n===null)return;let o,s,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 h=d.text,p=gve.exec(h);p&&(s=p[1],o=p[2]);const m=yve.exec(h);m?.[1]&&(i=m[1]);const y=kve.exec(h);y?.[1]&&(r=Number(y[1]));const k=bve.exec(h);k?.[1]&&k[2]&&(l=`${k[1]}x${k[2]}`);continue}const f=Lve(d);f&&(a=f)}if(a===null)return;const c=mve.exec(a.url);return c?.[1]&&(i=c[1]),c?.[2]&&(r=Nve(c[2])),{kind:a.kind??s??"image",url:a.url,path:o,mimeType:i,bytes:Number.isFinite(r)?r:void 0,dimensions:l}}function Fve(e){if(e!=null){if(typeof e=="string")return e.split(`
|
|
318
|
-
`);if(Array.isArray(e)){const t=[];for(const n of e)if(typeof n=="string")t.push(...n.split(`
|
|
319
|
-
`));else if(n&&typeof n=="object"){const o=n;o.type==="text"&&typeof o.text=="string"?t.push(...o.text.split(`
|
|
320
|
-
`)):o.type==="think"&&typeof o.think=="string"?t.push(...o.think.split(`
|
|
321
|
-
`)):o.type==="image_url"||o.type==="image"?t.push("[image]"):typeof o.type=="string"?t.push(`[${o.type}]`):t.push(JSON.stringify(n))}return t.length>0?t:void 0}return[JSON.stringify(e)]}}function Ove(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,text:e.text,suspendedReason:e.suspendedReason,swarmIndex:e.swarmIndex}}function Rve(e,t){const n=e.split(`
|
|
322
|
-
`),o=t.split(`
|
|
323
|
-
`),s=[];return n.forEach((i,r)=>{s.push({kind:"rem",gutter:String(r+1),text:`- ${i}`})}),o.forEach((i,r)=>{s.push({kind:"add",gutter:String(r+1),text:`+ ${i}`})}),s}function Bve(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const o=typeof t.path=="string"?t.path:"";return Array.isArray(t.diff)?{kind:"diff",path:o,diff:t.diff}:typeof t.old_text=="string"&&typeof t.new_text=="string"?{kind:"diff",path:o,diff:Rve(t.old_text,t.new_text)}:{kind:"diff",path:o,diff:[]}}if(n==="shell"||n==="command")return{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};if(n==="file_content"||n==="file")return{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};if(n==="file_op"||n==="fileop")return{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};if(n==="url_fetch"||n==="url")return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:typeof t.url=="string"?t.url:e.action};if(n==="search")return{kind:"search",query:typeof t.query=="string"?t.query:e.action,scope:typeof t.scope=="string"?t.scope:void 0};if(n==="invocation"||n==="agent_call"||n==="skill_call")return{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};if(n==="todo"||n==="todo_list")return{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"}})};if(n==="plan_review"){const o=typeof t.plan=="string"?t.plan:"",s=typeof t.path=="string"?t.path:void 0,r=(Array.isArray(t.options)?t.options:[]).map(l=>{const a=l??{},c=typeof a.label=="string"?a.label:"";if(!c)return null;const u=typeof a.description=="string"?a.description:void 0;return{label:c,description:u}}).filter(l=>l!==null);return{kind:"plan_review",plan:o,path:s,options:r.length>0?r:void 0}}return{kind:"generic",summary:e.action}}function Dve(e){const t=`<prompt>
|
|
324
|
-
`,n=`
|
|
325
|
-
</prompt>`,o=e.indexOf(t),s=e.lastIndexOf(n);return o>=0&&s>=o+t.length?e.slice(o+t.length,s):Pve(e)}function Pve(e){const t=e.split(`
|
|
326
|
-
`);return t.length>=2&&t[0]?.startsWith("<cron-fire ")&&t.at(-1)==="</cron-fire>"?t.slice(1,-1).join(`
|
|
327
|
-
`):e}function Hve(e){const t=e.metadata?.origin;if(t?.kind==="cron_job"||t?.kind==="cron_missed")return t.kind}function Wve(e){const t=e.content.filter(n=>n.type==="text").map(n=>n.text).join(`
|
|
328
|
-
`);return Dve(t)}function zve(e,t){const n=e.metadata?.origin??{},o=Wve(e);return t==="cron_missed"?{text:o,cron:{missedCount:typeof n.count=="number"?n.count:void 0}}:{text:o,cron:{jobId:typeof n.jobId=="string"?n.jobId:void 0,cron:typeof n.cron=="string"?n.cron:void 0,recurring:typeof n.recurring=="boolean"?n.recurring:void 0,coalescedCount:typeof n.coalescedCount=="number"?n.coalescedCount:void 0,stale:typeof n.stale=="boolean"?n.stale:void 0}}}function Uve(e,t,n){const{text:o,cron:s}=zve(e,n);return{id:e.id,role:"cron",no:t,text:o,createdAt:e.createdAt,cron:s}}function qve(e){const t=e.metadata?.origin,n=t?.kind;return n===void 0||n==="user"?!0:n==="skill_activation"||n==="plugin_command"?t?.trigger==="user-slash":!1}function jve(e){return e.metadata?.origin?.kind==="compaction_summary"}function Vve(e,t){return e===null?!1:e.promptId===void 0||t===void 0||e.promptId===t}function Kve(e){if(!e||e.length===0)return;const t="Plan saved to: ";for(const n of e)if(n.startsWith(t))return n.slice(t.length).trim()}function Gve(e){let t="",n="";const o=[],s=[];for(const i of e)i.type==="text"?t+=i.text:i.type==="thinking"?n+=i.thinking:i.type==="toolUse"?o.push(i.toolCallId):s.push(JSON.stringify(i));return o.sort(),s.sort(),{text:t,thinking:n,toolIds:o,rest:s}}function Yve(e,t){return t.text!==""&&t.text!==e.text||t.thinking!==""&&t.thinking!==e.thinking?!1:t.toolIds.every(n=>e.toolIds.includes(n))&&t.rest.every(n=>e.rest.includes(n))}function sT(e,t,n,o=!0,s={}){const i=[];let r=1;const l=new Map;for(const h of t)l.set(h.toolCallId,h);let a=null;function c(h=!1){if(!a)return;const p=a;if(a=null,!h||!o)for(let m=0;m<p.tools.length;m++){const y=p.tools[m];if(y.status!=="running")continue;const k={...y,status:"ok"};p.tools[m]=k;const g=p.blocks.find(v=>v.kind==="tool"&&v.tool.id===k.id);g&&g.kind==="tool"&&(g.tool=k)}i.push({id:p.id,role:"assistant",no:r++,text:p.textParts.join(`
|
|
329
|
-
`),thinking:p.thinkingParts.length>0?p.thinkingParts.join(`
|
|
330
|
-
`):void 0,tools:p.tools.length>0?p.tools:void 0,blocks:p.blocks.length>0?p.blocks:void 0,approval:p.approval,approvalId:p.approvalId,durationMs:p.durationMs})}function u(h,p){for(const m of p)if(m.type==="text"){if(m.text){h.textParts.push(m.text);const y=h.blocks.at(-1);y&&y.kind==="text"?y.text+=`
|
|
331
|
-
`+m.text:h.blocks.push({kind:"text",text:m.text})}}else if(m.type==="thinking"){if(m.thinking){h.thinkingParts.push(m.thinking);const y=h.blocks.at(-1);y&&y.kind==="thinking"?y.thinking+=`
|
|
332
|
-
`+m.thinking:h.blocks.push({kind:"thinking",thinking:m.thinking})}}else if(m.type==="toolUse"){const y=l.get(m.toolCallId),k={id:m.toolCallId,name:m.toolName,arg:typeof m.input=="string"?m.input:JSON.stringify(m.input),status:"running",output:m.outputLines,planPath:m.toolName==="ExitPlanMode"?s[m.toolCallId]?.path:void 0};h.tools.push(k),h.blocks.push({kind:"tool",tool:k}),y&&(h.approval=Bve(y),h.approvalId=y.approvalId)}else if(m.type==="toolResult"){const y=h.tools.findIndex(k=>k.id===m.toolCallId);if(y!==-1){const k=h.tools[y],g={...k,status:m.isError?"error":"ok",output:Fve(m.output),media:m.isError?void 0:$ve(k.name,m.output)};g.name==="ExitPlanMode"&&!g.planPath&&(g.planPath=Kve(g.output)),h.tools[y]=g;const v=h.blocks.find(b=>b.kind==="tool"&&b.tool.id===m.toolCallId);v&&v.kind==="tool"&&(v.tool=g)}}}function d(h,p){for(const m of p){if(m.type!=="toolUse"||!m.outputLines?.length)continue;const y=h.tools.findIndex(b=>b.id===m.toolCallId);if(y===-1)continue;const k=h.tools[y];if(k.output!==void 0)continue;const g={...k,output:m.outputLines};h.tools[y]=g;const v=h.blocks.find(b=>b.kind==="tool"&&b.tool.id===m.toolCallId);v&&v.kind==="tool"&&(v.tool=g)}}function f(h){if(h.type==="image"||h.type==="video"){const p=h.type,m=h.source;if(m.kind==="url")return{url:m.url,kind:p};if(m.kind==="base64")return{url:`data:${m.mediaType};base64,${m.data}`,kind:p};if(m.kind==="file"&&n)return{url:n(m.fileId),kind:p,fileId:m.fileId}}if(h.type==="file"&&n){if(h.mediaType.startsWith("image/"))return{url:n(h.fileId),kind:"image",fileId:h.fileId};if(h.mediaType.startsWith("video/"))return{url:n(h.fileId),kind:"video",fileId:h.fileId}}}for(const h of e){if(h.role==="system")continue;if(jve(h)){c();const g=h.metadata?.[nT];i.push({id:h.id,role:"compaction",no:r,text:h.content.filter(v=>v.type==="text").map(v=>v.text).join(`
|
|
333
|
-
`),compaction:{trigger:g?.trigger,tokensBefore:g?.tokensBefore,tokensAfter:g?.tokensAfter}});continue}if(h.role==="user"){const g=Hve(h);if(c(),g!==void 0){i.push(Uve(h,r++,g));continue}if(!qve(h))continue;const v=h.metadata?.origin,b=v?.kind==="skill_activation"&&v?.trigger==="user-slash",A=v?.kind==="plugin_command"&&v?.trigger==="user-slash",I=[],T=[];for(const M of h.content){if(M.type==="text")if(b)I.push(v.skillArgs??"");else if(A)I.push(v.commandArgs??"");else{const N=Cve(M.text);if(N&&(N.kind==="video"||N.kind==="image")&&n){const B=Mve(N.path);if(B){T.push({url:n(B),kind:N.kind,fileId:B});continue}}const F=Tve(M.text);if(F){T.push({kind:"file",url:F.fileId&&n?n(F.fileId):"",fileId:F.fileId,name:F.name,mediaType:F.mediaType,size:F.size});continue}const S=_ve(M.text);if(S!==M.text&&S.trim().length===0)continue;I.push(S)}const $=f(M);if($){T.push({url:$.url,kind:$.kind,name:M.type==="file"?M.name:void 0,fileId:$.fileId});continue}M.type==="file"&&n&&T.push({kind:"file",url:n(M.fileId),fileId:M.fileId,name:M.name,mediaType:M.mediaType||void 0,size:M.size})}i.push({id:h.id,role:"user",no:r++,text:I.join(`
|
|
334
|
-
`),attachments:T.length>0?T:void 0,skillActivation:b?{name:v.skillName,args:v.skillArgs}:void 0,pluginCommand:A?{pluginId:v.pluginId,commandName:v.commandName,args:v.commandArgs}:void 0,createdAt:h.createdAt});continue}if(h.role==="tool"){a&&u(a,h.content);continue}const p=h.promptId;Vve(a,p)?a!==null&&a.promptId===void 0&&p!==void 0&&(a.promptId=p):(c(),a={id:h.id,promptId:p,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,foldedSigs:[],durationMs:h.durationMs});const y=a;if(y===null)continue;const k=Gve(h.content);if(y.promptId!==void 0&&y.foldedSigs.some(g=>Yve(g,k))){d(y,h.content);continue}y.foldedSigs.push(k),u(y,h.content)}return c(!0),i}function Zve(e,t){const{pushOperationFailure:n,nextOptimisticMsgId:o,connectEventsIfNeeded:s,getEventConn:i,resolveThinkingForPrompt:r}=t,l=ne({}),a=D(()=>{const N=e.activeSessionId;if(!N)return null;const F=l.value[N];return F?{parentId:N,agentId:F.agentId}:null}),c=D(()=>a.value?.parentId??null),u=D(()=>a.value!==null),d=D(()=>{const N=a.value;return N?!!e.sideChatSendingByAgent[N.agentId]:!1}),f=D(()=>{const N=a.value;return N?e.sideChatSendingByAgent[N.agentId]?!0:(e.tasksBySession[N.parentId]??[]).some(F=>F.id===N.agentId&&F.status==="running"):!1}),h=D(()=>{const N=a.value;if(!N)return[];const F=e.sideChatMessagesByAgent[N.agentId]??[];return sT(F,[],S=>pt().getFileUrl(S),f.value)});function p(N,F){e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[N]:F(e.sideChatMessagesByAgent[N]??[])}}function m(N,F){p(N,S=>[...S,F])}function y(N){p(N,F=>{const S=[...F].reverse().findIndex(W=>W.role==="user");if(S===-1)return F;const B=F.length-1-S;return F.filter((W,z)=>z!==B)})}function k(N,F){p(N,S=>{const B=[...S];for(let W=B.length-1;W>=0;W-=1){const z=B[W];if(z.role==="user")return B[W]={...z,promptId:z.promptId??F},B}return S})}function g(N,F,S){S&&p(N,B=>{const W=B.at(-1);if(W?.role==="assistant"){const z=W.content[0],L=z?.type==="text"?z.text:"";return[...B.slice(0,-1),{...W,content:[{type:"text",text:`${L}${S}`}]}]}return[...B,{id:o(),sessionId:F,role:"assistant",content:[{type:"text",text:S}],createdAt:new Date().toISOString()}]})}function v(N,F,S){if(e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[N]:!1},!S)return;const W=(e.sideChatMessagesByAgent[N]??[]).at(-1);(W?.role==="assistant"&&W.content[0]?.type==="text"?W.content[0].text:"").trim().length>0||g(N,F,S)}async function b(N){const F=e.activeSessionId;F&&await A(F,N)}async function A(N,F){if(!l.value[N]){let S;try{({agentId:S}=await pt().startBtw(N))}catch(B){n("openSideChat",B,{sessionId:N});return}e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[S]:e.sideChatMessagesByAgent[S]??[]},l.value={...l.value,[N]:{agentId:S}},s(),i()?.markSideChannelAgent(S)}F&&F.trim()&&await I(N,F.trim())}async function I(N,F){const S=l.value[N],B=F.trim();if(!S||!B)return;const W=N,z=S.agentId;e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[z]:!0};const L={id:o(),sessionId:W,role:"user",content:[{type:"text",text:B}],createdAt:new Date().toISOString(),metadata:{"dimiWeb.optimisticUserMessage":!0}};m(z,L);try{const O=e.sessions.find(ie=>ie.id===W),j=(O?.model&&O.model.length>0?O.model:e.defaultModel)??void 0,Z=await pt().submitPrompt(W,{content:[{type:"text",text:B}],agentId:z,model:j,thinking:await r(W,j)??e.thinking,permissionMode:e.permission,planMode:e.planModeBySession[W]??!1,swarmMode:e.swarmModeBySession[W]??!1});k(z,Z.promptId),e.sideChatUserMessageIdsBySession={...e.sideChatUserMessageIdsBySession,[W]:[...e.sideChatUserMessageIdsBySession[W]??[],Z.userMessageId]}}catch(O){n("sendSideChatPrompt",O,{sessionId:W}),y(z),e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[z]:!1}}}function T(){const N=e.activeSessionId;if(!N)return;const{[N]:F,...S}=l.value;l.value=S}async function M(N){const F=a.value;F&&await I(F.parentId,N)}function $(N){if(!l.value[N])return;const{[N]:F,...S}=l.value;l.value=S}return{sideChatTargetBySession:l,sideChatSessionId:c,sideChatVisible:u,sideChatSending:d,sideChatRunning:f,sideChatTurns:h,appendSideChatAssistantText:g,finishSideChatAgent:v,openSideChat:b,openSideChatOn:A,closeSideChat:T,sendSideChatPrompt:M,clearSideChatForSession:$}}const Xve="dimiWeb.optimisticUserMessage",z3="Sub Agent";function Qve(){return{sessions:[],activeSessionId:void 0,messagesBySession:{},approvalsBySession:{},planReviewByToolCallId:{},questionsBySession:{},tasksBySession:{},goalBySession:{},goalVersionBySession:{},lastSeqBySession:{},turnActiveBySession:{},compactionBySession:{},warnings:[]}}function Jve(e){return{...e,sessions:e.sessions,messagesBySession:{...e.messagesBySession},approvalsBySession:{...e.approvalsBySession},planReviewByToolCallId:{...e.planReviewByToolCallId},questionsBySession:{...e.questionsBySession},tasksBySession:{...e.tasksBySession},goalBySession:{...e.goalBySession},goalVersionBySession:{...e.goalVersionBySession},lastSeqBySession:{...e.lastSeqBySession},turnActiveBySession:{...e.turnActiveBySession},compactionBySession:{...e.compactionBySession},warnings:[...e.warnings]}}function eye(e,t,n){if(t!==void 0&&n!==void 0&&n>0){const o=e.lastSeqBySession[t]??0;n>o&&(e.lastSeqBySession[t]=n)}}function Rv(e){return e.role==="user"&&e.metadata?.[Xve]===!0}function tye(e){const t=e.metadata?.origin;return t?.kind==="cron_job"||t?.kind==="cron_missed"}function nye(e,t){return JSON.stringify(e.content)===JSON.stringify(t.content)}const oye=/^<(image|video|audio)\s+path="[^"]+"><\/\1>$/;function U3(e){let t="",n=0;for(const o of e.content)o.type==="text"?oye.test(o.text.trim())?n+=1:t+=o.text:(o.type==="image"||o.type==="video"||o.type==="file")&&(n+=1);return{text:t,media:n}}function sye(e,t){const n=U3(e),o=U3(t);return n.text===o.text&&n.media===o.media}function iye(e,t){const n=t.promptId;if(n!==void 0)for(let o=e.length-1;o>=0;o--){const s=e[o];if(Rv(s)&&s.promptId===n)return o}for(let o=e.length-1;o>=0;o--){const s=e[o];if(Rv(s)&&nye(s,t))return o}for(let o=e.length-1;o>=0;o--){const s=e[o];if(Rv(s)&&sye(s,t))return o}return-1}function rye(e,t,n){let o=!1;const s=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?(o=!0,{...i,content:l}):i});return o?s:e}const lye={"provider.connection_error":"connection","provider.auth_error":"auth","provider.rate_limit":"rateLimit","provider.overloaded":"overloaded","provider.filtered":"filtered","provider.api_error":"api","context.overflow":"contextOverflow"};function aye(e){const t=$n.global.t,n=[],o=(r,l)=>{typeof l=="number"||typeof l=="boolean"?n.push({label:r,value:String(l)}):typeof l=="string"&&l.length>0&&n.push({label:r,value:l})};o(t("warnings.details.code"),e.code);const s=e.details??{};o(t("warnings.details.status"),s.statusCode),o(t("warnings.details.requestId"),s.requestId),o(t("warnings.details.errorName"),e.name);for(const[r,l]of Object.entries(s))r==="statusCode"||r==="requestId"||o(r,l);const i=(e.code!==void 0?lye[e.code]:void 0)??"title";return{severity:"error",title:t(`warnings.agentError.${i}`),message:e.message,details:n.length>0?n:void 0}}function cye(e,t,n){const o=Jve(e);switch(eye(o,n.sessionId,n.seq),t.type){case"sessionCreated":{o.sessions.some(i=>i.id===t.session.id)||(o.sessions=[t.session,...o.sessions]);break}case"sessionUpdated":{o.sessions=o.sessions.map(s=>s.id===t.session.id?t.session:s);break}case"sessionDeleted":{const s=t.sessionId;o.sessions=o.sessions.filter(i=>i.id!==s),delete o.messagesBySession[s],delete o.tasksBySession[s],delete o.goalBySession[s],delete o.approvalsBySession[s],delete o.questionsBySession[s],delete o.lastSeqBySession[s],delete o.turnActiveBySession[s],o.activeSessionId===s&&(o.activeSessionId=void 0);break}case"sessionWorkChanged":{o.sessions=o.sessions.map(s=>s.id!==t.sessionId?s:{...s,busy:t.busy,mainTurnActive:t.mainTurnActive??(t.busy?s.mainTurnActive:!1),pendingInteraction:t.pendingInteraction??s.pendingInteraction,lastTurnReason:t.lastTurnReason}),t.mainTurnActive===!0?o.turnActiveBySession[t.sessionId]=!0:(t.mainTurnActive===!1||!t.busy)&&delete o.turnActiveBySession[t.sessionId];break}case"sessionMetaUpdated":{o.sessions=o.sessions.map(s=>s.id===t.sessionId?{...s,title:t.title??s.title,lastPrompt:t.lastPrompt??s.lastPrompt}:s);break}case"sessionUsageUpdated":{o.sessions=o.sessions.map(s=>{if(s.id!==t.sessionId)return s;const i=t.model&&t.model.length>0?t.model:s.model;return{...s,usage:t.usage,model:i}});break}case"historyCompacted":break;case"compactionStarted":{o.compactionBySession={...o.compactionBySession,[t.sessionId]:{status:"running",trigger:t.trigger}};break}case"compactionCompleted":{const s=t.sessionId,i=o.compactionBySession[s],{[s]:r,...l}=o.compactionBySession;if(o.compactionBySession=l,Object.prototype.hasOwnProperty.call(o.messagesBySession,s)){const a=o.messagesBySession[s]??[],c=`compaction_${s}_${n.seq}`;if(!a.some(u=>u.id===c)){const u={trigger:i?.trigger??"auto",tokensBefore:t.tokensBefore,tokensAfter:t.tokensAfter};o.messagesBySession[s]=[...a,{id:c,sessionId:s,role:"assistant",content:t.summary?[{type:"text",text:t.summary}]:[],createdAt:new Date().toISOString(),metadata:{origin:{kind:"compaction_summary"},[nT]:u}}]}}break}case"compactionCancelled":{const{[t.sessionId]:s,...i}=o.compactionBySession;o.compactionBySession=i;break}case"messageCreated":{const s=t.message.sessionId,i=t.message.createdAt;o.sessions=o.sessions.map(a=>a.id===s&&i>a.updatedAt?{...a,updatedAt:i}:a);const r=o.messagesBySession[s]??[];if(!r.some(a=>a.id===t.message.id)){if(t.message.role==="user"&&!tye(t.message)){const a=iye(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}},o.messagesBySession[s]=c;break}}o.messagesBySession[s]=[...r,t.message]}break}case"messageUpdated":{const s=t.sessionId,i=o.messagesBySession[s]??[];o.messagesBySession[s]=i.map(r=>r.id!==t.messageId?r:{...r,content:t.content,durationMs:t.durationMs??r.durationMs});break}case"assistantDelta":{const s=t.sessionId,i=o.messagesBySession[s]??[];o.messagesBySession[s]=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 s=t.sessionId,i=o.messagesBySession[s]??[];o.messagesBySession[s]=rye(i,t.toolCallId,t.outputChunk);break}case"approvalRequested":{const s=t.sessionId,i=o.approvalsBySession[s]??[];i.some(a=>a.approvalId===t.approval.approvalId)||(o.approvalsBySession[s]=[...i,t.approval]);const l=t.approval.display;l?.kind==="plan_review"&&typeof l.plan=="string"&&l.plan.length>0&&(o.planReviewByToolCallId={...o.planReviewByToolCallId,[t.approval.toolCallId]:{plan:l.plan,path:typeof l.path=="string"?l.path:void 0}});break}case"approvalResolved":case"approvalExpired":{const s=t.sessionId,i=t.approvalId,r=o.approvalsBySession[s]??[];o.approvalsBySession[s]=r.filter(l=>l.approvalId!==i);break}case"questionRequested":{const s=t.sessionId,i=o.questionsBySession[s]??[];i.some(l=>l.questionId===t.question.questionId)||(o.questionsBySession[s]=[...i,t.question]);break}case"questionAnswered":case"questionDismissed":{const s=t.sessionId,i=t.questionId,r=o.questionsBySession[s]??[];o.questionsBySession[s]=r.filter(l=>l.questionId!==i);break}case"taskCreated":{const s=t.sessionId,i=o.tasksBySession[s]??[],r=i.findIndex(l=>l.id===t.task.id);if(r===-1)o.tasksBySession[s]=[...i,t.task];else{const l=[...i],a=i[r];l[r]={...t.task,outputLines:a.outputLines,text:a.text,description:t.task.description===z3&&a.description!==z3?a.description:t.task.description,swarmIndex:t.task.swarmIndex??a.swarmIndex,parentToolCallId:t.task.parentToolCallId??a.parentToolCallId,subagentType:t.task.subagentType??a.subagentType,runInBackground:t.task.runInBackground??a.runInBackground,backgroundTaskId:t.task.backgroundTaskId??a.backgroundTaskId},o.tasksBySession[s]=l}break}case"taskProgress":{const s=t.sessionId,i=o.tasksBySession[s]??[];o.tasksBySession[s]=i.map(r=>{if(r.id!==t.taskId)return r;if(r.kind==="subagent"&&t.kind==="text")return{...r,text:(r.text??"")+t.outputChunk};const l=r.outputLines??[];if(l.at(-1)===t.outputChunk)return r;const a=[...l,t.outputChunk];return{...r,outputLines:r.kind==="subagent"?a:a.slice(-40)}});break}case"taskCompleted":{const s=t.sessionId,i=o.tasksBySession[s]??[];o.tasksBySession[s]=i.map(r=>r.id!==t.taskId?r:{...r,status:t.status,outputPreview:t.outputPreview,outputBytes:t.outputBytes});break}case"goalUpdated":{const s=t.sessionId;o.goalVersionBySession[s]=(o.goalVersionBySession[s]??0)+1,t.goal===null||t.goal.status==="complete"?delete o.goalBySession[s]:o.goalBySession[s]=t.goal;break}case"configChanged":{o.config=t.config;break}case"modelCatalogChanged":break;case"agentDelta":case"agentTurnEnded":break;case"promptCompleted":case"promptAborted":break;case"turnActiveChanged":{o.sessions=o.sessions.map(s=>s.id===t.sessionId?{...s,mainTurnActive:t.active}:s),t.active?o.turnActiveBySession[t.sessionId]=!0:delete o.turnActiveBySession[t.sessionId];break}case"unknown":{const s=t.raw;if(!(s&&s._noop===!0))if(s&&s._agentError)o.warnings=[...o.warnings,aye(s)];else if(s&&s._agentWarning){const i=s.message??s.code??"agent warning";o.warnings=[...o.warnings,`${$n.global.t("warnings.noteLabel")}: ${i}`]}else{const i=s?.type??"(unknown)";o.warnings=[...o.warnings,`Unhandled event: ${i}`]}break}}return o}function uye(e){return e==="in_progress"?"in_progress":e==="done"||e==="completed"?"done":"pending"}function dye(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.role==="assistant")for(let o=n.content.length-1;o>=0;o--){const s=n.content[o];if(s.type!=="toolUse"||Ja(s.toolName)!=="todo")continue;let i=s.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:uye(a.status)}]:[]})}}return[]}const fye=["queued","working","suspended","completed","failed"];function iT(e){return e.status==="completed"?"completed":e.status==="failed"||e.status==="cancelled"?"failed":e.subagentPhase?e.subagentPhase:"working"}function hye(){return{queued:0,working:0,suspended:0,completed:0,failed:0}}function pye(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||n.swarmIndex===void 0)continue;const o=n.parentToolCallId??"swarm",s=t.get(o)??[];s.push({id:n.id,name:n.description,subagentType:n.subagentType,phase:iT(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex}),t.set(o,s)}return[...t.entries()].map(([n,o])=>{const s=o.toSorted((r,l)=>r.swarmIndex-l.swarmIndex||r.id.localeCompare(l.id)),i=hye();for(const r of s)i[r.phase]++;return{id:n,members:s,counts:i}}).filter(n=>n.members.length>1).toSorted((n,o)=>{const s=n.members.at(0)?.swarmIndex??0,i=o.members.at(0)?.swarmIndex??0;return s!==i?s-i:n.id.localeCompare(o.id)})}function mye(e){let t=0,n=0;for(const o of e){n+=o.members.length;for(const s of fye)(s==="completed"||s==="failed")&&(t+=o.counts[s])}return{done:t,total:n}}function gye(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||!n.parentToolCallId)continue;const o=t.get(n.parentToolCallId)??[];o.push({id:n.id,name:n.description,subagentType:n.subagentType,phase:iT(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex??Number.MAX_SAFE_INTEGER}),t.set(n.parentToolCallId,o)}for(const[n,o]of t)t.set(n,o.toSorted((s,i)=>s.swarmIndex-i.swarmIndex||s.id.localeCompare(i.id)));return t}const Fr=QE(),lr=Oge(),Sf=Uge(),rT=Ht.permission,lT=Ht.activeWorkspace,aT=Ht.planMode,cT=Ht.swarmMode,uT=Ht.goalMode,q3=40401,dT=Ht.onboarded;qa(Ht.codeFont);qa(Ht.theme);qa(Ht.thinking);function vye(){try{const e=uo(rT);if(e==="auto"||e==="yolo"||e==="manual")return e}catch{}return"manual"}function yye(e){try{xo(rT,e)}catch{}}function Bv(e){const t=uo(e);if(!t)return{};try{const n=JSON.parse(t);if(!n||typeof n!="object"||Array.isArray(n))return{};const o={};for(const[s,i]of Object.entries(n))i===!0&&(o[s]=!0);return o}catch{return{}}}function xb(e,t){try{const n={};for(const[o,s]of Object.entries(t))s&&(n[o]=!0);xo(e,JSON.stringify(n))}catch{}}function fT(){xb(aT,Ce.planModeBySession)}function hT(){xb(cT,Ce.swarmModeBySession)}function pT(){xb(uT,Ce.goalModeBySession)}function kye(){try{return uo(lT)}catch{return null}}const mT=Ht.hiddenWorkspaces;function bye(){try{const e=uo(mT);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function xye(e){try{xo(mT,JSON.stringify(e))}catch{}}function wye(e){try{xo(lT,e)}catch{}}function _ye(e,t){if(t&&e.startsWith(t)){const o=e.slice(t.length);return o?`~${o}`:"~"}const n=e.match(/^\/(?:Users|home)\/[^/]+(\/.*)?$/);return n?`~${n[1]??""}`:e}const Ce=Do({...Qve(),connected:!1,serverVersion:"",dangerousBypassAuth:!1,workspaceName:"dimi-web",connection:"disconnected",permission:vye(),thinking:void 0,thinkingBySession:{},planModeBySession:Bv(aT),swarmModeBySession:Bv(cT),goalModeBySession:Bv(uT),loading:!1,sessionLoading:!1,queuedBySession:{},gitStatusBySession:{},promptIdBySession:{},inFlightBySession:{},unreadBySession:Yk(),authReady:!1,defaultModel:null,authenticatedProviders:[],workspaces:[],activeWorkspaceId:kye(),fsHome:null,recentRoots:[],hiddenWorkspaceRoots:bye(),availableOpenInApps:[],config:null,sideChatMessagesByAgent:{},sideChatSendingByAgent:{},sideChatUserMessageIdsBySession:{},messagesLoadingMoreBySession:{},messagesHasMoreBySession:{},messagesLoadMoreErrorBySession:{},sessionsHasMoreByWorkspace:{},sessionsLoadingMoreByWorkspace:{},sessionsCursorByWorkspace:{},sessionsInitialCountByWorkspace:{},sessionsFullyLoaded:!1}),s0=Do({planMode:!1,swarmMode:!1,goalMode:!1});function gT(e){Ce.sessions=e}function i0(e,t){Ce.sessions=Ce.sessions.map(n=>n.id===e?t(n):n)}function Sye(e){Ce.sessions=[e,...Ce.sessions.filter(t=>t.id!==e.id)]}function Cye(e){Ce.sessions=[...Ce.sessions,e]}function Aye(e){Ce.sessions=Ce.sessions.filter(t=>t.id!==e)}function vT(){const e=Ce.activeSessionId;e&&Ce.unreadBySession[e]&&typeof document<"u"&&document.visibilityState==="visible"&&(Ce.unreadBySession={...Ce.unreadBySession,[e]:!1},Zk({[e]:!1}))}typeof window<"u"&&window.addEventListener("storage",e=>{e.key===Ht.unread&&(Ce.unreadBySession=Yk(),vT())});function pk(){if(Mi===null||!Mi.health().stale)return;mo("ws:stale-reconnect",{sessionId:Ce.activeSessionId,status:"stale"}),Br("ws: stale socket on focus, reconnecting",{activeSessionId:Ce.activeSessionId}),Mi.reconnect();const e=Ce.activeSessionId;e&&Qm.request(e)}typeof document<"u"&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&(vT(),pk())});typeof window<"u"&&(window.addEventListener("focus",pk),window.addEventListener("online",pk));function wb(e){Ce.activeSessionId=e}function Mye(e){Ce.messagesBySession=e}function Eye(e,t){Ce.messagesBySession={...Ce.messagesBySession,[e]:t}}function yT(e,t){Ce.messagesBySession={...Ce.messagesBySession,[e]:t(Ce.messagesBySession[e]??[])}}function Tye(e){const{[e]:t,...n}=Ce.messagesBySession;Ce.messagesBySession=n}function kT(e){Mi?.unsubscribe(e),Jye(e),Zm.discard(({meta:t})=>t.sessionId===e),Aye(e),Tye(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 mk[e],Xm.delete(e),Pp.delete(e),IT.delete(e),lve(e),delete Ce.queuedBySession[e],delete Ce.promptIdBySession[e],delete Ce.inFlightBySession[e],delete Ce.turnActiveBySession[e],delete Ce.planModeBySession[e],delete Ce.swarmModeBySession[e],delete Ce.goalModeBySession[e],delete Ce.thinkingBySession[e],fT(),hT(),pT()}const bT=ne(null),xT=ne([]),wT=ne(!1),_T=ne(!1),ST=ne(null);async function qf(e){let t;try{t=await pt().getSessionStatus(e)}catch{return}i0(e,n=>({...n,model:t.model||n.model,usage:{...n.usage,contextTokens:t.contextTokens,contextLimit:t.maxContextTokens}})),Ce.swarmModeBySession={...Ce.swarmModeBySession,[e]:t.swarmMode},Ce.planModeBySession={...Ce.planModeBySession,[e]:t.planMode},t.thinkingEffort.length>0&&(Ce.thinkingBySession={...Ce.thinkingBySession,[e]:t.thinkingEffort})}async function Nye(e){const t=Ce.goalVersionBySession[e]??0;let n;try{n=await pt().getSessionGoal(e)}catch{return}if((Ce.goalVersionBySession[e]??0)!==t)return;const o={...Ce.goalBySession};n===null||n.status==="complete"?delete o[e]:o[e]=n,Ce.goalBySession=o}function CT(e,t){const n=t??Ce.activeSessionId;return n?Promise.resolve(pt().updateSession(n,e)).then(()=>qf(n)).then(()=>!0).catch(o=>(jf("persistSessionProfile",o,{sessionId:n}),!1)):Promise.resolve(!1)}const AT=Ht.conversationToc;function Iye(){try{const e=uo(AT);return e===null?!0:e==="true"}catch{return!0}}function Lye(e){try{xo(AT,e?"true":"false")}catch{}}const MT=ne(Iye());function $ye(e){MT.value=e,Lye(e)}function Fye(e){try{return uo(e)??""}catch{return""}}const ET=ne(Fye(dT)==="1");function Oye(e){ET.value=e;try{xo(dT,e?"1":"0")}catch{}}let Mi=null,j3=0;function TT(){return j3+=1,`msg_opt_${Date.now().toString(36)}_${j3}`}function Rye(e,t,n){const o={sessions:Ce.sessions,activeSessionId:Ce.activeSessionId,messagesBySession:Ce.messagesBySession,approvalsBySession:Ce.approvalsBySession,planReviewByToolCallId:Ce.planReviewByToolCallId,questionsBySession:Ce.questionsBySession,tasksBySession:Ce.tasksBySession,goalBySession:Ce.goalBySession,goalVersionBySession:Ce.goalVersionBySession,lastSeqBySession:Ce.lastSeqBySession,turnActiveBySession:Ce.turnActiveBySession,compactionBySession:Ce.compactionBySession,config:Ce.config,warnings:Ce.warnings},s=cye(o,e,{sessionId:t,seq:n});gT(s.sessions),wb(s.activeSessionId),Mye(s.messagesBySession),Ce.approvalsBySession=s.approvalsBySession,Ce.planReviewByToolCallId=s.planReviewByToolCallId,Ce.questionsBySession=s.questionsBySession,Ce.tasksBySession=s.tasksBySession,Ce.goalBySession=s.goalBySession,Ce.goalVersionBySession=s.goalVersionBySession,Ce.lastSeqBySession=s.lastSeqBySession,Ce.turnActiveBySession=s.turnActiveBySession,Ce.compactionBySession=s.compactionBySession,Ce.config=s.config??null,Ce.warnings=s.warnings,e.type==="configChanged"&&(Ce.defaultModel=e.config.defaultModel??null),e.type==="modelCatalogChanged"&&(Pn.loadModels(),Pn.loadProviders()),e.type==="sessionUsageUpdated"&&(e.swarmMode!==void 0&&(Ce.swarmModeBySession={...Ce.swarmModeBySession,[e.sessionId]:e.swarmMode}),e.planMode!==void 0&&(Ce.planModeBySession={...Ce.planModeBySession,[e.sessionId]:e.planMode}),e.thinking!==void 0&&(Ce.thinkingBySession={...Ce.thinkingBySession,[e.sessionId]:e.thinking}))}function Bye(e,t){const n=Ce.lastSeqBySession[t.sessionId]??0,o=Ce.turnActiveBySession[t.sessionId]??!1;Rye(e,t.sessionId,t.seq);const s=ds.sideChatTargetBySession.value[t.sessionId];if(s){const{agentId:i}=s,r=t.sessionId;e.type==="agentDelta"&&e.agentId===i?e.delta.text&&ds.appendSideChatAssistantText(i,r,e.delta.text):e.type==="agentTurnEnded"&&e.agentId===i?ds.finishSideChatAgent(i,r):e.type==="taskProgress"&&e.taskId===i?ds.appendSideChatAssistantText(i,r,e.outputChunk):e.type==="taskCompleted"&&e.taskId===i&&ds.finishSideChatAgent(i,r,e.outputPreview)}if(e.type==="messageCreated"&&e.message.role==="user"&&e.message.promptId!==void 0){const i=e.message.sessionId;Ce.promptIdBySession[i]!==e.message.promptId&&(Ce.promptIdBySession={...Ce.promptIdBySession,[i]:e.message.promptId})}if(e.type==="assistantDelta"&&t.sessionId===Ce.activeSessionId&&Fr.recordMoonDelta((e.delta.text?.length??0)+(e.delta.thinking?.length??0)),e.type==="turnActiveChanged"&&!e.active&&t.seq>n){const i=e.reason;s2e(e.sessionId,i==="cancelled"||i==="failed"||i==="blocked"?"aborted":"idle",o)}e.type==="sessionWorkChanged"&&(e.mainTurnActive===!1&&o||e.mainTurnActive===void 0&&!e.busy)&&t.seq>n&&o2e(e.sessionId),(e.type==="promptAborted"||e.type==="promptCompleted"&&e.reason==="blocked")&&t.seq>n&&Ce.promptIdBySession[e.sessionId]===e.promptId&&ht.finishPromptLocal(e.sessionId),e.type==="questionRequested"&&i2e(e.sessionId,e.question),e.type==="approvalRequested"&&r2e(e.sessionId,e.approval)}const Zm=oge(({appEvent:e,meta:t})=>Bye(e,t),({appEvent:e})=>J0e(e),{coalesce:ige});function NT(){if(Mi!==null||typeof WebSocket>"u")return;mo("ws:connection",{status:"connecting"}),Ce.connection="connecting",Mi=pt().connectEvents({onEvent(t,n){if(t.type==="workspaceCreated"||t.type==="workspaceUpdated"||t.type==="workspaceDeleted"){ht.applyWorkspaceEvent(t);return}for(const o of sge({appEvent:t,meta:n}))Zm(o)},onResync(t,n,o){mo("ws:resync",{sessionId:t,status:"required",seq:n}),Zm.flush(),Xm.add(t),Qm.request(t)},onError(t,n,o){mo("ws:error",{status:"failed",errorCode:t,fatal:o}),_b({severity:"error",title:$n.global.t("warnings.wsTitle"),message:n,details:[Jn("message",n)].filter(s=>s!==void 0)})},onConnectionChange(t){mo("ws:connection",{status:t?"connected":"disconnected"}),Ce.connected=t,Ce.connection=t?"connected":"disconnected",t&&(jye(),ht.refreshServerMeta())}})}const mk={},Xm=new Set,Pp=new Set,IT=new Set;function Dye(e){return _i(e)&&e.code===q3?!0:typeof e=="object"&&e!==null&&e.code===q3}function Jn(e,t){if(!(t==null||t===""))return{label:$n.global.t(`warnings.details.${e}`),value:LT(t)}}function LT(e){if(e instanceof Error)return typeof e.stack=="string"&&e.stack?e.stack: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 Pye(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.name=="string"?e.name:void 0}function Hye(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.message=="string"?e.message:void 0}function Wye(e){return e instanceof Error&&typeof e.stack=="string"&&e.stack?e.stack:void 0}function zye(e){if(!(typeof e!="number"||!Number.isFinite(e)))return new Date(e).toISOString()}function V3(e){if(!(typeof e!="number"||!Number.isFinite(e)))return`${Math.round(e)}ms`}function Uye(e,t,n){const o=Y2(t),s=_i(t),i=o||s?t.timestamp:void 0,r=o||s?t.durationMs:void 0,l=[Jn("operation",e),Jn("sessionId",n??Ce.activeSessionId),Jn("connection",Ce.connection),Jn("timestamp",zye(i??Date.now()))];return o?l.push(Jn("duration",V3(r)),Jn("request",`${t.method} ${t.path}`),Jn("endpoint",t.url),Jn("requestId",t.requestId),Jn("phase",t.phase),Jn("timeout",`${t.timeoutMs}ms`),Jn("status",t.status===void 0?void 0:`${t.status} ${t.statusText??""}`.trim()),Jn("contentType",t.contentType),Jn("responsePreview",t.bodyPreview),Jn("cause",t.cause)):s?l.push(Jn("duration",V3(r)),Jn("code",t.code),Jn("requestId",t.requestId),Jn("message",t.message),Jn("details",t.details)):l.push(Jn("errorName",Pye(t)),Jn("message",Hye(t)??LT(t)),Jn("stack",Wye(t))),l.filter(a=>a!==void 0)}function qye(e,t,n={}){const o=Y2(t),s=_i(t),i=n.title??(o?$n.global.t("warnings.daemonNetworkTitle"):s?$n.global.t("warnings.daemonApiTitle"):$n.global.t("warnings.operationFailedTitle")),r=n.message??(o?$n.global.t("warnings.daemonNetworkMessage"):s?t.message:$n.global.t("warnings.operationFailedMessage"));return{severity:"error",title:i,message:r,details:Uye(e,t,n.sessionId)}}function _b(e){Ce.warnings=[...Ce.warnings,e]}function jye(){const e=$n.global.t("warnings.wsTitle"),t=Ce.warnings.filter(n=>!(typeof n=="object"&&n!==null&&n.severity==="error"&&n.title===e));t.length!==Ce.warnings.length&&(Ce.warnings=t)}function jf(e,t,n){console.error(`[dimi-web] operation failed: ${e}`,t);const o=_i(t),s=Y2(t);mo("operation:failed",{sessionId:n?.sessionId,status:"failed",operation:e,errorName:t instanceof Error?t.name:typeof t,errorCode:o?t.code:void 0,requestId:o||s?t.requestId:void 0,phase:s?t.phase:void 0,httpStatus:s?t.status:void 0}),_b(qye(e,t,n))}const Vye={40913:"warnings.goal.alreadyExists",40914:"warnings.goal.notFound",40915:"warnings.goal.statusInvalid",40916:"warnings.goal.notResumable",40918:"warnings.goal.objectiveTooLong"};function Kye(e){if(!_i(e))return;const t=Vye[e.code];return t?$n.global.t(t):void 0}async function Gye(e){if(kT(e),Ce.activeSessionId!==e)return;const t=Ce.sessions[0];t?await ht.selectSession(t.id,{urlMode:"replace"}):(wb(void 0),Ce.sessionLoading=!1,ht.writeSessionUrl(void 0,"replace"))}const K3=new Set;async function Yye(e){if(!K3.has(e)){K3.add(e);try{const t=await pt().getSessionWarnings(e),n=$n.global.t("warnings.noteLabel");for(const o of t)_b(`${n}: ${o.message}`)}catch{}}}async function Sb(e){const t=ht.localTurnStartState(e);try{const o=await pt().getSessionSnapshot(e);if(!Ce.sessions.some(a=>a.id===e))return"ok";Zm.flush();const s=Ce.lastSeqBySession[e]??0,i=mk[e];if(!(Xm.has(e)||Jm.has(e))&&i!==void 0&&i===o.epoch&&s>o.asOfSeq)return Pp.delete(e)||(Pp.add(e),Qm.request(e)),"ok";if(!ht.isLocalTurnSnapshotCurrent(e,t))return ht.afterLocalTurnStartsSettle(e,()=>{Qm.request(e)}),"ok";const l=Jy(o.session.usage);i0(e,a=>({...o.session,model:o.session.model&&o.session.model.length>0?o.session.model:a.model,usage:l?a.usage:o.session.usage})),Eye(e,Y0e(Ce.messagesBySession[e]??[],o.messages)),Ce.tasksBySession={...Ce.tasksBySession,[e]:Z0e(o.subagents,Ce.tasksBySession[e]??[])},Ce.messagesHasMoreBySession={...Ce.messagesHasMoreBySession,[e]:o.hasMoreMessages},Ce.approvalsBySession={...Ce.approvalsBySession,[e]:o.pendingApprovals};for(const a of o.pendingApprovals){const c=a.display;c?.kind==="plan_review"&&typeof c.plan=="string"&&c.plan.length>0&&(Ce.planReviewByToolCallId={...Ce.planReviewByToolCallId,[a.toolCallId]:{plan:c.plan,path:typeof c.path=="string"?c.path:void 0}})}Ce.questionsBySession={...Ce.questionsBySession,[e]:o.pendingQuestions},Ce.lastSeqBySession={...Ce.lastSeqBySession,[e]:o.asOfSeq},mk[e]=o.epoch,Xm.delete(e),Pp.delete(e),ht.handleSessionSnapshot(e,{inFlightTurn:o.inFlightTurn,busy:o.session.busy});{const a={...Ce.turnActiveBySession};o.session.mainTurnActive??(o.inFlightTurn!==null&&o.session.busy)?a[e]=!0:delete a[e],Ce.turnActiveBySession=a}return NT(),Mi&&(Mi.seedSnapshot(e,o),Mi.subscribe(e,{seq:o.asOfSeq,epoch:o.epoch}),Qye(e)),Jm.delete(e),l&&qf(e),Yye(e),"ok"}catch(n){return Dye(n)?(await Gye(e),"not-found"):(jf("getSessionSnapshot",n,{title:$n.global.t("warnings.sessionSnapshotTitle"),message:$n.global.t("warnings.sessionSnapshotMessage"),sessionId:e}),"failed")}}const Qm=X0e(Sb);function Zye(e){return Object.prototype.hasOwnProperty.call(Ce.messagesBySession,e)}const Xye=4,Or=[],Jm=new Set;function Qye(e){const t=Or.indexOf(e);for(t!==-1&&Or.splice(t,1),Or.unshift(e);Or.length>Xye;){let n=-1;for(let s=Or.length-1;s>=0;s--)if(Or[s]!==Ce.activeSessionId){n=s;break}if(n===-1)break;const[o]=Or.splice(n,1);if(o===void 0)break;Mi?.unsubscribe(o),Jm.add(o)}}function Jye(e){const t=Or.indexOf(e);t!==-1&&Or.splice(t,1),Jm.delete(e)}async function eke(e){return Sb(e)}function Cb(e,t){return(Ce.inFlightBySession[e]??!1)||(Ce.turnActiveBySession[e]??!1)||(t??Ce.sessions.find(n=>n.id===e)?.mainTurnActive??!1)}function Ab(e){try{const t=new Date(e),o=Date.now()-t.getTime(),s=o/36e5;if(o<6e4)return $n.global.t("sessions.justNow");if(s<1)return`${Math.round(o/6e4)}m`;if(s<24)return`${Math.round(s)}h`;const i=o/864e5;return i<7?`${Math.round(i)}d`:i<30?`${Math.round(i/7)}w`:i<365?`${Math.round(i/30)}mo`:`${Math.round(i/365)}y`}catch{return e}}const tke=3e4,Cf=ne(0);let Dv=null;function nke(){Dv===null&&(Dv=setInterval(()=>{Cf.value=(Cf.value+1)%Number.MAX_SAFE_INTEGER},tke),Dv.unref?.())}function oke(e,t){const n=e.split(`
|
|
335
|
-
`),o=t.split(`
|
|
336
|
-
`),s=[];return n.forEach((i,r)=>{s.push({kind:"rem",gutter:String(r+1),text:`- ${i}`})}),o.forEach((i,r)=>{s.push({kind:"add",gutter:String(r+1),text:`+ ${i}`})}),s}function ske(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const o=typeof t.path=="string"?t.path:"";return Array.isArray(t.diff)?{kind:"diff",path:o,diff:t.diff}:typeof t.old_text=="string"&&typeof t.new_text=="string"?{kind:"diff",path:o,diff:oke(t.old_text,t.new_text)}:{kind:"diff",path:o,diff:[]}}if(n==="shell"||n==="command"){const o=typeof t.command=="string"?t.command:e.action,s=typeof t.cwd=="string"?t.cwd:void 0,i=typeof t.danger=="string"?t.danger:void 0;return{kind:"shell",command:o,cwd:s,danger:i}}if(n==="file_content"||n==="file"){const o=typeof t.path=="string"?t.path:"",s=typeof t.content=="string"?t.content:"",i=typeof t.language=="string"?t.language:void 0;return{kind:"file",path:o,content:s,language:i}}if(n==="file_op"||n==="fileop"){const o=typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,s=typeof t.path=="string"?t.path:"",i=typeof t.detail=="string"?t.detail:void 0;return{kind:"fileop",op:o,path:s,detail:i}}if(n==="url_fetch"||n==="url"){const o=typeof t.url=="string"?t.url:e.action;return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:o}}if(n==="search"){const o=typeof t.query=="string"?t.query:e.action,s=typeof t.scope=="string"?t.scope:void 0;return{kind:"search",query:o,scope:s}}if(n==="invocation"||n==="agent_call"||n==="skill_call"){const o=typeof t.kind=="string"?t.kind:n,s=typeof t.name=="string"?t.name:e.toolName,i=typeof t.description=="string"?t.description:void 0;return{kind:"invocation",kind2:o,name:s,description:i}}if(n==="todo"||n==="todo_list")return{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"}})};if(n==="plan_review"){const o=typeof t.plan=="string"?t.plan:"",s=typeof t.path=="string"?t.path:void 0,r=(Array.isArray(t.options)?t.options:[]).map(l=>{const a=l??{},c=typeof a.label=="string"?a.label:"";if(!c)return null;const u=typeof a.description=="string"?a.description:void 0;return{label:c,description:u}}).filter(l=>l!==null);return{kind:"plan_review",plan:o,path:s,options:r.length>0?r:void 0}}return{kind:"generic",summary:e.action}}function ike(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 rke(e){const t=Ce.messagesBySession[e.sessionId];if(!t||t.length===0)return;const n=new Map;for(const s of t)if(s.role==="assistant")for(const i of s.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 o=`task_id: ${e.id}`;for(const s of t)if(s.role==="tool")for(const i of s.content){if(i.type!=="toolResult")continue;if((typeof i.output=="string"?i.output:i.output!==void 0?JSON.stringify(i.output):"").includes(o)){const l=n.get(i.toolCallId);if(l)return l}}}function lke(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 o=e.outputLines&&e.outputLines.length>0?e.outputLines:e.outputPreview?e.outputPreview.split(/\r?\n/):void 0,s=e.command??rke(e),i=e.kind==="bash"&&s?`$ ${s}`:void 0;return{id:e.id,name:e.description,kind:e.kind,state:t,timing:n,meta:i,output:o,runInBackground:e.runInBackground,parentToolCallId:e.parentToolCallId}}const ake=D(()=>{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}}),cke=D(()=>(Cf.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:Ab(e.updatedAt),busy:Cb(e.id,e.mainTurnActive),pendingInteraction:e.pendingInteraction,lastTurnReason:e.lastTurnReason})))),uke=D(()=>Ce.activeSessionId??""),dke=D(()=>{const e=Ce.activeSessionId;if(e)return Pn.skillsBySession.value[e]??[];const t=l0.value;return t?Pn.skillsByWorkspace.value[t]??[]:[]}),Mb=D(()=>{const e=Ce.activeSessionId;return e?Ce.inFlightBySession[e]??!1:!1}),fke=D(()=>ht.isStartingFirstPrompt()),ds=Zve(Ce,{pushOperationFailure:jf,nextOptimisticMsgId:TT,connectEventsIfNeeded:NT,getEventConn:()=>Mi,resolveThinkingForPrompt:(e,t)=>Pn.resolveThinkingForPrompt(e,t)}),Vf=D(()=>{const e=Ce.activeSessionId;if(!e)return[];const t=ds.sideChatTargetBySession.value[e]?.agentId;return(Ce.tasksBySession[e]??[]).filter(n=>n.id!==t)}),$T=Vge(Ce,Vf),hke=D(()=>{const e=Ce.activeSessionId;if(!e)return[];const t=new Set(Ce.sideChatUserMessageIdsBySession[e]??[]),n=(Ce.messagesBySession[e]??[]).filter(s=>!t.has(s.id)),o=Ce.approvalsBySession[e]??[];return sT(n,o,s=>pt().getFileUrl(s),r0.value,Ce.planReviewByToolCallId)}),r0=D(()=>{const e=Ce.activeSessionId;return e?(Ce.turnActiveBySession[e]??!1)||(Ce.sessions.find(t=>t.id===e)?.mainTurnActive??!1):!1}),pke=D(()=>Mb.value||r0.value),mke=D(()=>($T.taskClock.value,Vf.value.map(lke))),FT=D(()=>pye(Vf.value)),gke=D(()=>gye(Vf.value)),Hc=D(()=>{const e=Ce.activeSessionId;return e?Ce.goalBySession[e]??null:null}),vke=D(()=>{const e=Ce.activeSessionId;return e?dye(Ce.messagesBySession[e]??[]):[]}),yke=D(()=>{const e=Ce.activeSessionId;return e?Ce.compactionBySession[e]??null:null}),kke=D(()=>Ce.connection),bke=D(()=>Ce.loading),xke=D(()=>Ce.sessionLoading),wke=D(()=>{const e=Ce.activeSessionId;return e?Ce.messagesLoadingMoreBySession[e]??!1:!1}),_ke=D(()=>{const e=Ce.activeSessionId;return e?Ce.messagesHasMoreBySession[e]??!1:!1}),Ske=D(()=>{const e=Ce.activeSessionId;return e?Ce.messagesLoadMoreErrorBySession[e]??!1:!1}),Cke=D(()=>Ce.serverVersion),Ake=D(()=>Ce.dangerousBypassAuth);function Mke(){Ce.dangerousBypassAuth=!1}const Eke=D(()=>Ce.permission),Tke=D(()=>Ce.thinking),OT=D(()=>{const e=Ce.activeSessionId;return e?Ce.planModeBySession[e]??!1:s0.planMode}),Nke=D(()=>{const e=Ce.activeSessionId;return e?Ce.swarmModeBySession[e]??!1:s0.swarmMode}),Ike=D(()=>{const e=Ce.activeSessionId;return e?Ce.goalModeBySession[e]??!1:s0.goalMode}),Lke=D(()=>{const e=mye(FT.value);return{plan:OT.value,goal:Hc.value&&Hc.value.status!=="complete"?{status:Hc.value.status,turnsUsed:Hc.value.turnsUsed,elapsedMs:Hc.value.wallClockMs}:null,swarm:e.total>0?e:null}}),$ke=D(()=>{const e=Ce.activeSessionId;if(!e)return[];const t=pt();return(Ce.queuedBySession[e]??[]).map(n=>({text:n.text,attachmentCount:n.attachments?.length??0,attachments:n.attachments?.map(o=>({fileId:o.fileId,kind:o.kind,url:t.getFileUrl(o.fileId),name:o.name}))}))}),Fke=D(()=>Ce.warnings),Oke=D(()=>{const e=Ce.activeSessionId;return e?(Ce.questionsBySession[e]??[]).map(ike):[]}),Rke=D(()=>{const e=Ce.activeSessionId;return e?(Ce.approvalsBySession[e]??[]).map(t=>({approvalId:t.approvalId,block:ske(t),agentName:t.agentName})):[]}),Eb=D(()=>{const e=Ce.activeSessionId;return e?(Ce.approvalsBySession[e]??[]).length>0?"awaiting-approval":(Ce.questionsBySession[e]??[]).length>0?"awaiting-question":Mb.value||r0.value?"running":"idle":"idle"}),Pn=hve(Ce,{pushOperationFailure:jf,refreshSessionStatus:qf,persistSessionProfile:CT,activity:Eb,updateSession:i0,updateSessionMessages:yT}),gk=D(()=>{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}),Bke=D(()=>{const e=Ce.activeSessionId;return e?Ce.gitStatusBySession[e]?.pullRequest??null:null}),Dke=D(()=>{const e=Ce.activeSessionId;if(!e)return[];const t=Ce.gitStatusBySession[e];return t?Object.entries(t.entries).map(([n,o])=>({path:n,status:o})).sort((n,o)=>n.path.localeCompare(o.path)):[]}),Pke=D(()=>{const e=Ce.activeSessionId;if(!e)return null;const t=Ce.gitStatusBySession[e];return t?{totalAdditions:t.additions,totalDeletions:t.deletions}:null}),RT=D(()=>{const e=Ce.sessions.find(r=>r.id===Ce.activeSessionId),t=gk.value?.branch??(e?e.cwd.split("/").pop()??e.cwd:"main"),n=e===void 0?Pn.draftModel.value:null,o=(e?.model&&e.model.length>0?e.model:n??Ce.defaultModel)??"—",s=Pn.models.value.find(r=>r.id===o)??Pn.models.value.find(r=>r.model===o);return{model:s?.displayName||s?.model||(o.includes("/")?o.split("/").pop():o),modelId:s?.id??o,ctxUsed:e?.usage.contextTokens??0,ctxMax:e?.usage.contextLimit??0,permission:Ce.permission,branch:t,cwd:e?.cwd??"",isGitRepo:gk.value!==null}}),Hke=D(()=>xT.value),Wke=D(()=>Ce.sessions.find(t=>t.id===Ce.activeSessionId)?.usage.totalCostUsd??0),zke=D(()=>Ce.authReady),Uke=D(()=>Ce.defaultModel),qke=D(()=>Ce.authenticatedProviders),jke=D(()=>Ce.config),Vke=D(()=>{const e=Ce.activeSessionId;if(!e)return{};const t=Ce.gitStatusBySession[e];return t?{...t.entries}:{}});function bu(e){const t=zi(e.cwd);return Ce.workspaces.find(n=>zi(n.root)===t)?.id??e.workspaceId??e.cwd}const Tb=D(()=>G0e({workspaces:Ce.workspaces,sessions:Ce.sessions,hiddenWorkspaceRoots:Ce.hiddenWorkspaceRoots,sessionsHasMoreByWorkspace:Ce.sessionsHasMoreByWorkspace})),e1=ne(Q$()),xu=ne(J$()==="manual"?"manual":"recent");et(()=>[Tb.value.map(e=>e.id).join("\0"),Ce.loading],([e,t])=>{if(t)return;const n=e?e.split("\0"):[],o=eF(n,e1.value);o!==null&&(e1.value=o,l6(o))});const Xa=D(()=>{const e=Tb.value.map(t=>({id:t.id,name:t.name,root:t.root,shortPath:_ye(t.root,Ce.fsHome),sessionCount:t.sessionCount}));if(xu.value==="recent"){const t=new Map;for(const n of Ce.sessions){if(n.parentSessionId)continue;const o=bu(n),s=new Date(n.updatedAt).getTime();s>(t.get(o)??Number.NEGATIVE_INFINITY)&&t.set(o,s)}return oF(e,t)}return tF(e,e1.value)}),l0=D(()=>{const e=Ce.activeWorkspaceId,t=Xa.value;return e&&t.some(n=>n.id===e)?e:t[0]?.id??null});et(l0,e=>{e&&(Object.prototype.hasOwnProperty.call(Pn.skillsByWorkspace.value,e)||Pn.loadSkillsForWorkspace(e))},{immediate:!0});const Kke=D(()=>{const e=l0.value;return e?Xa.value.find(t=>t.id===e)??null:null}),Gke=D(()=>{Cf.value;const e=new Set(Xa.value.map(n=>n.id)),t=new Map(Xa.value.map(n=>[n.id,n.name]));return Ce.sessions.filter(n=>!n.parentSessionId&&e.has(bu(n))).map(n=>{const o=bu(n);return{id:n.id,title:n.title,time:Ab(n.updatedAt),busy:Cb(n.id,n.mainTurnActive),pendingInteraction:n.pendingInteraction,lastTurnReason:n.lastTurnReason,lastPrompt:n.lastPrompt,workspaceId:o,workspaceName:t.get(o)}})}),Yke=D(()=>{Cf.value;const e=new Map;for(const t of Ce.sessions.toSorted((n,o)=>new Date(o.updatedAt).getTime()-new Date(n.updatedAt).getTime())){if(t.parentSessionId)continue;const n=bu(t),o={id:t.id,title:t.title,time:Ab(t.updatedAt),busy:Cb(t.id,t.mainTurnActive),pendingInteraction:t.pendingInteraction,lastTurnReason:t.lastTurnReason,updatedAt:t.updatedAt},s=e.get(n)??[];s.push(o),e.set(n,s)}return Xa.value.map(t=>({workspace:t,sessions:e.get(t.id)??[],hasMore:Ce.sessionsHasMoreByWorkspace[t.id]??!1,loadingMore:Ce.sessionsLoadingMoreByWorkspace[t.id]??!1,initialCount:Ce.sessionsInitialCountByWorkspace[t.id]??dk}))});function Zke(e){e1.value=e,l6(e),xu.value!=="manual"&&(xu.value="manual",a6("manual"))}function Xke(e){xu.value!==e&&(xu.value=e,a6(e))}const BT=D(()=>{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}),Qke=D(()=>{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}),Jke=D(()=>{const e={};for(const[t,n]of Object.entries(Ce.unreadBySession))n&&(e[t]=!0);return e}),e2e=D(()=>{const e={},t=BT.value;for(const n of Ce.sessions){const o=t[n.id]??0;if(o<=0)continue;const s=bu(n);e[s]=(e[s]??0)+o}return e}),t2e=D(()=>Ce.recentRoots),n2e=D(()=>Ce.availableOpenInApps),ht=uve(Ce,{taskPoller:$T,sideChat:ds,modelProvider:Pn,pushOperationFailure:jf,activity:Eb,sessionsKnownEmpty:IT,setSessions:gT,updateSession:i0,upsertSessionFront:Sye,appendSession:Cye,forgetSession:kT,setActiveSessionId:wb,updateSessionMessages:yT,nextOptimisticMsgId:TT,getEventConn:()=>Mi,syncSessionFromSnapshot:Sb,reopenSession:eke,hasLoadedMessages:Zye,refreshSessionStatus:qf,refreshSessionGoal:Nye,persistSessionProfile:CT,mergedWorkspaces:Tb,workspacesView:Xa,status:RT,workspaceIdForSession:bu,savePermissionToStorage:yye,savePlanModeToStorage:fT,saveSwarmModeToStorage:hT,saveGoalModeToStorage:pT,draftModes:s0,saveUnread:Zk,saveActiveWorkspaceToStorage:wye,saveHiddenWorkspacesToStorage:xye,goalErrorMessage:Kye,resetFastMoon:Fr.resetFastMoon,initialized:_T,connectIssue:ST,selectedDiffPath:bT,fileDiffLines:xT,fileDiffLoading:wT});function Nb(e){return e===Ce.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible"&&document.hasFocus()}function o2e(e){if(Ce.turnActiveBySession[e]){const t={...Ce.turnActiveBySession};delete t[e],Ce.turnActiveBySession=t}Ce.inFlightBySession[e]&&(Ce.inFlightBySession={...Ce.inFlightBySession,[e]:!1})}function s2e(e,t,n){const o=Ce.promptIdBySession[e];ht.finishPromptLocal(e,{turnWasActive:n}),e===Ce.activeSessionId?(ht.loadGitStatus(e),qf(e)):t==="idle"&&(Ce.unreadBySession={...Ce.unreadBySession,[e]:!0},Zk({[e]:!0}));const s=(Ce.approvalsBySession[e]??[]).length>0,i=(Ce.questionsBySession[e]??[]).length>0;Sge(t,s,i)&&lr.maybeNotifyCompletion(e,{isUserWatching:Nb(e),sessionTitle:Ce.sessions.find(r=>r.id===e)?.title??"",promptId:o,onClick:()=>{ht.selectSession(e)}}),t==="idle"&&Sf.maybePlayCompletionSound()}function i2e(e,t){const n=t.questions[0],o=n?.header?.trim()??"",s=n?.question?.trim()??"",i=o&&s?`${o}: ${s}`:s||o;lr.maybeNotifyQuestion({isUserWatching:Nb(e),sessionTitle:Ce.sessions.find(r=>r.id===e)?.title??"",questionPreview:i,questionId:t.questionId,onClick:()=>{ht.selectSession(e)}}),Sf.maybePlayQuestionSound()}function r2e(e,t){lr.maybeNotifyApproval({isUserWatching:Nb(e),sessionTitle:Ce.sessions.find(n=>n.id===e)?.title??"",toolName:t.toolName,approvalId:t.approvalId,onClick:()=>{ht.selectSession(e)}}),Sf.maybePlayApprovalSound()}function Ib(){return nke(),{workspace:ake,sessions:cke,activeSessionId:uke,workspacesView:Xa,workspaceSortMode:xu,visibleWorkspace:Kke,activeWorkspaceId:l0,sessionsForView:Gke,workspaceGroups:Yke,attentionBySession:BT,pendingBySession:Qke,attentionByWorkspace:e2e,unreadBySession:Jke,recentRoots:t2e,turns:hke,tasks:mke,activeAppTasks:Vf,todos:vke,goal:Hc,swarms:FT,swarmMembersByToolCallId:gke,activationBadges:Lke,compaction:yke,status:RT,sessionCost:Wke,fileDiff:Hke,selectedDiffPath:bT,fileDiffLoading:wT,changes:Dke,gitInfo:gk,gitDiffStats:Pke,activePullRequest:Bke,changesByPath:Vke,pendingApprovals:Rke,availableOpenInApps:n2e,connection:kke,loading:bke,sessionLoading:xke,loadingMoreMessages:wke,hasMoreMessages:_ke,loadMoreMessagesError:Ske,serverVersion:Cke,dangerousBypassAuth:Ake,clearDangerousBypassAuth:Mke,initialized:_T,connectIssue:ST,permission:Eke,thinking:Tke,planMode:OT,swarmMode:Nke,goalMode:Ike,queued:$ke,warnings:Fke,questions:Oke,activity:Eb,turnActive:r0,inFlight:Mb,working:pke,isStartingFirstPrompt:fke,fastMoon:Fr.fastMoon,models:Pn.models,starredModelIds:Pn.starredModelIds,providers:Pn.providers,uiFontSize:Fr.uiFontSize,setUiFontSize:Fr.setUiFontSize,conversationToc:MT,setConversationToc:$ye,colorScheme:Fr.colorScheme,setColorScheme:Fr.setColorScheme,accent:Fr.accent,setAccent:Fr.setAccent,notifyOnComplete:lr.notifyOnComplete,notifyOnQuestion:lr.notifyOnQuestion,notifyOnApproval:lr.notifyOnApproval,notifyPermission:lr.notifyPermission,setNotifyOnComplete:lr.setNotifyOnComplete,setNotifyOnQuestion:lr.setNotifyOnQuestion,setNotifyOnApproval:lr.setNotifyOnApproval,soundOnComplete:Sf.soundOnComplete,setSoundOnComplete:Sf.setSoundOnComplete,onboarded:ET,setOnboarded:Oye,load:ht.load,selectSession:ht.selectSession,clearActiveSession:ht.clearActiveSession,loadOlderMessages:ht.loadOlderMessages,loadWorkspaces:ht.loadWorkspaces,loadMoreSessions:ht.loadMoreSessions,loadAllSessions:ht.loadAllSessions,selectWorkspace:ht.selectWorkspace,openWorkspace:ht.openWorkspace,openWorkspaceDraft:ht.openWorkspaceDraft,startSessionAndSendPrompt:ht.startSessionAndSendPrompt,startSessionAndActivateSkill:ht.startSessionAndActivateSkill,startSessionAndOpenSideChat:ht.startSessionAndOpenSideChat,addWorkspaceByPath:ht.addWorkspaceByPath,browseFs:ht.browseFs,getFsHome:ht.getFsHome,sendPrompt:ht.sendPrompt,steerPrompt:ht.steerPrompt,sideChatVisible:ds.sideChatVisible,sideChatSessionId:ds.sideChatSessionId,sideChatTurns:ds.sideChatTurns,sideChatRunning:ds.sideChatRunning,sideChatSending:ds.sideChatSending,openSideChat:ds.openSideChat,closeSideChat:ds.closeSideChat,sendSideChatPrompt:ds.sendSideChatPrompt,uploadImage:ht.uploadImage,abortCurrentPrompt:ht.abortCurrentPrompt,respondApproval:ht.respondApproval,respondQuestion:ht.respondQuestion,dismissQuestion:ht.dismissQuestion,pendingQuestionActions:ht.pendingQuestionActions,pendingApprovalActions:ht.pendingApprovalActions,cancelTask:ht.cancelTask,setPermission:ht.setPermission,setThinking:Pn.setThinking,setPlanMode:ht.setPlanMode,togglePlanMode:ht.togglePlanMode,setSwarmMode:ht.setSwarmMode,toggleSwarmMode:ht.toggleSwarmMode,setGoalMode:ht.setGoalMode,toggleGoalMode:ht.toggleGoalMode,createGoal:ht.createGoal,controlGoal:ht.controlGoal,enqueue:ht.enqueue,dismissWarning:ht.dismissWarning,renameSession:ht.renameSession,renameWorkspace:ht.renameWorkspace,deleteWorkspace:ht.deleteWorkspace,reorderWorkspaces:Zke,setWorkspaceSortMode:Xke,archiveSession:ht.archiveSession,exportSession:ht.exportSession,restoreSession:ht.restoreSession,loadArchivedSessions:ht.loadArchivedSessions,compact:ht.compact,forkSession:ht.forkSession,undo:ht.undo,unqueue:ht.unqueue,reorderQueue:ht.reorderQueue,searchFiles:ht.searchFiles,loadGitStatus:ht.loadGitStatus,loadFileDiff:ht.loadFileDiff,clearFileDiff:ht.clearFileDiff,listDir:ht.listDir,readFileContent:ht.readFileContent,getFileDownloadUrl:ht.getFileDownloadUrl,openWorkspaceFile:ht.openWorkspaceFile,openInApp:ht.openInApp,revealWorkspaceFile:ht.revealWorkspaceFile,resolveImageUrl:ht.resolveImageUrl,loadModels:Pn.loadModels,loadProviders:Pn.loadProviders,skills:dke,activateSkill:Pn.activateSkill,setModel:Pn.setModel,toggleStarModel:Pn.toggleStarModel,loginProviderApiKey:Pn.loginProviderApiKey,logoutProvider:Pn.logoutProvider,refreshProvider:Pn.refreshProvider,refreshAllProviders:Pn.refreshAllProviders,authReady:zke,defaultModel:Uke,authenticatedProviders:qke,config:jke,updateConfig:ht.updateConfig,checkAuth:ht.checkAuth,startOAuthLogin:Pn.startOAuthLogin,pollOAuthLogin:Pn.pollOAuthLogin,cancelOAuthLogin:Pn.cancelOAuthLogin,logout:ht.logout}}const DT=Qe({__name:"LanguageSwitcher",setup(e){const{locale:t}=Ot(),n=d6.map(s=>({value:s.code,label:s.label}));function o(s){t.value!==s&&f6(s)}return(s,i)=>(x(),Ae(ms,{"model-value":C(t),options:C(n),"onUpdate:modelValue":o},null,8,["model-value","options"]))}}),l2e=["aria-checked","aria-label","disabled"],a2e=Qe({__name:"Switch",props:{modelValue:{type:Boolean},disabled:{type:Boolean},label:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(o,s)=>(x(),E("button",{class:We(["ui-switch",{"is-on":e.modelValue}]),type:"button",role:"switch","aria-checked":e.modelValue,"aria-label":e.label,disabled:e.disabled,onClick:s[0]||(s[0]=i=>n("update:modelValue",!e.modelValue))},[...s[1]||(s[1]=[_("span",{class:"ui-switch__thumb"},null,-1)])],10,l2e))}}),Mr=ft(a2e,[["__scopeId","data-v-b35d3d03"]]),c2e=["value","disabled"],u2e=Qe({__name:"Select",props:{modelValue:{},size:{default:"md"},disabled:{type:Boolean},error:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;function o(s){n("update:modelValue",s.target.value)}return(s,i)=>(x(),E("select",{class:We(["ui-select",[`ui-select--${e.size}`,{"has-error":e.error}]]),value:e.modelValue,disabled:e.disabled,onChange:o},[zn(s.$slots,"default",{},void 0,!0)],42,c2e))}}),G3=ft(u2e,[["__scopeId","data-v-b569f3aa"]]),d2e=["aria-label"],f2e=["aria-selected","onClick"],h2e={class:"body"},p2e={class:"panel"},m2e={class:"sec"},g2e={class:"sec-title"},v2e={class:"row"},y2e={class:"rlabel"},k2e={class:"row"},b2e={class:"rlabel"},x2e={class:"row"},w2e={class:"rlabel"},_2e={class:"num-field"},S2e=["value","aria-label"],C2e={class:"row"},A2e={class:"rlabel"},M2e={class:"row"},E2e={class:"rlabel"},T2e={class:"hint"},N2e={class:"sec"},I2e={class:"sec-title"},L2e={class:"row"},$2e={class:"rlabel"},F2e={key:0,class:"hint"},O2e={class:"row"},R2e={class:"rlabel"},B2e={key:0,class:"hint"},D2e={class:"row"},P2e={class:"rlabel"},H2e={key:0,class:"hint"},W2e={class:"row"},z2e={class:"rlabel"},U2e={class:"panel"},q2e={class:"sec"},j2e={class:"sec-title"},V2e={class:"row"},K2e={class:"rlabel"},G2e={key:0,class:"rvalue"},Y2e={class:"actions"},Z2e={class:"panel"},X2e={class:"sec"},Q2e={class:"sec-head"},J2e={class:"sec-title"},ebe={key:0,class:"saving"},tbe={class:"row"},nbe={class:"rlabel"},obe={class:"hint"},sbe={key:0,class:"select-wrap"},ibe={key:0,value:"",disabled:""},rbe=["label"],lbe=["value"],abe={key:1,class:"rvalue mono"},cbe={class:"row"},ube={class:"rlabel"},dbe={class:"hint"},fbe={class:"row"},hbe={class:"rlabel"},pbe={class:"hint"},mbe={class:"row"},gbe={class:"rlabel"},vbe={class:"hint"},ybe={class:"row"},kbe={class:"rlabel"},bbe={class:"hint"},xbe={key:1,class:"empty-config"},wbe={class:"panel"},_be={class:"sec"},Sbe={class:"sec-title"},Cbe={class:"row"},Abe={class:"rlabel"},Mbe={class:"rvalue mono"},Ebe={class:"row"},Tbe={class:"rlabel"},Nbe={class:"rvalue mono"},Ibe={key:0,class:"row"},Lbe={class:"rlabel"},$be={class:"hint"},Fbe={class:"hint"},Obe={class:"row"},Rbe={class:"rlabel"},Bbe={key:0,class:"hint"},Dbe={class:"panel"},Pbe={class:"panel-head"},Hbe={class:"panel-title"},Wbe={class:"panel-desc"},zbe={class:"archive-toolbar"},Ube={class:"archive-search"},qbe=["placeholder"],jbe={value:"all"},Vbe=["value"],Kbe={key:0,class:"archive-empty"},Gbe={key:0,class:"archive-list"},Ybe={class:"archive-workspace"},Zbe={class:"path"},Xbe={class:"count"},Qbe={class:"setting-card"},Jbe={class:"archive-meta"},exe={class:"archive-name"},txe={class:"archive-time"},nxe={key:1,class:"archive-empty"},oxe=100,sxe=Qe({__name:"SettingsDialog",props:{colorScheme:{},accent:{},uiFontSize:{},authReady:{type:Boolean},accountModel:{},notify:{type:Boolean},notifyQuestion:{type:Boolean},notifyApproval:{type:Boolean},notifyPermission:{},sound:{type:Boolean},conversationToc:{type:Boolean},config:{},models:{},configSaving:{type:Boolean},serverVersion:{}},emits:["setColorScheme","setAccent","setUiFontSize","setNotify","setNotifyQuestion","setNotifyApproval","setSound","setConversationToc","login","logout","openOnboarding","openProviders","updateConfig","close"],setup(e,{emit:t}){const{t:n}=Ot(),o=e,s=t,i=ne("general"),r=[{id:"general",labelKey:"settings.tabs.general"},{id:"agent",labelKey:"settings.tabs.agent"},{id:"account",labelKey:"settings.tabs.account"},{id:"advanced",labelKey:"settings.tabs.advanced"},{id:"archived",labelKey:"settings.tabs.archived"}],l=die(),a=["manual","auto","yolo"],c={manual:"status.permissionManual",auto:"status.permissionAuto",yolo:"status.permissionYolo"},u=ne(null);lb(u);function d(U){U.key==="Escape"&&s("close")}wn(()=>document.addEventListener("keydown",d)),In(()=>document.removeEventListener("keydown",d));function f(){_E()}const h=D(()=>(o.models??[]).map(U=>({id:U.id,label:U.displayName??U.model??U.id,provider:U.provider}))),p=D(()=>{const U=new Map;for(const q of h.value){const ee=U.get(q.provider)??[];ee.push(q),U.set(q.provider,ee)}for(const q of U.values())q.sort((ee,le)=>ee.label.localeCompare(le.label));return Array.from(U.entries()).toSorted(([q],[ee])=>q.localeCompare(ee)).map(([q,ee])=>({provider:q,options:ee}))}),m=D(()=>{const U=o.config?.defaultPermissionMode;return U==="auto"||U==="yolo"||U==="manual"?U:"manual"});function y(U){return U===!0}function k(U){!U||U===o.config?.defaultModel||s("updateConfig",{defaultModel:U})}function g(U){U!==m.value&&s("updateConfig",{defaultPermissionMode:U})}function v(U){const q=o.config?.[U];s("updateConfig",{[U]:!y(q)})}function b(){const U=o.config?.thinking;return!U||typeof U!="object"?!0:U.enabled!==!1}function A(){s("updateConfig",{thinking:{enabled:!b()}})}function I(){const U=o.config?.telemetry!==!1;s("updateConfig",{telemetry:!U})}function T(U){i.value=U}const M=Ib(),$=ne([]),N=ne(!1),F=ne(!1),S=ne(""),B=ne("all"),W=ne("archived-desc");async function z(){if(!(N.value||F.value)){N.value=!0;try{const U=[];let q;for(;;){const ee=await M.loadArchivedSessions({beforeId:q,pageSize:oxe});if(U.push(...ee.items),!ee.hasMore||ee.items.length===0)break;const le=ee.items.at(-1)?.id;if(le===void 0)break;q=le}$.value=U,F.value=!0}catch(U){console.warn("loadAllArchived failed",U)}finally{N.value=!1}}}et(i,U=>{U==="archived"&&!F.value&&z()});const L=D(()=>{const U=new Set;for(const q of $.value)U.add(q.cwd);return Array.from(U).sort((q,ee)=>q.localeCompare(ee))}),O=D(()=>{const U=S.value.trim().toLowerCase();let q=$.value.filter(ee=>ee.archived===!0);return B.value!=="all"&&(q=q.filter(ee=>ee.cwd===B.value)),U&&(q=q.filter(ee=>ee.title.toLowerCase().includes(U))),q=q.slice(),W.value==="archived-desc"?q.sort((ee,le)=>le.updatedAt.localeCompare(ee.updatedAt)):W.value==="created-desc"?q.sort((ee,le)=>le.createdAt.localeCompare(ee.createdAt)):q.sort((ee,le)=>ee.title.localeCompare(le.title,"zh")),q}),j=D(()=>{const U=new Map;for(const q of O.value){const ee=U.get(q.cwd)??[];ee.push(q),U.set(q.cwd,ee)}return Array.from(U.entries()).map(([q,ee])=>({cwd:q,items:ee}))});async function Z(U){await M.restoreSession(U)&&($.value=$.value.filter(ee=>ee.id!==U))}function ie(U){const q=new Date(U);if(Number.isNaN(q.getTime()))return U;const ee=le=>String(le).padStart(2,"0");return`${q.getFullYear()}-${ee(q.getMonth()+1)}-${ee(q.getDate())} ${ee(q.getHours())}:${ee(q.getMinutes())}`}return(U,q)=>(x(),Ae(Qr,{open:!0,"close-on-esc":!1,title:C(n)("settings.title"),size:"xl",height:"fixed",padded:!1,onClose:q[19]||(q[19]=ee=>s("close"))},{default:Le(()=>[_("div",{ref_key:"dialogRef",ref:u,class:"sd"},[_("nav",{class:"settings-tabs",role:"tablist","aria-label":C(n)("settings.title")},[(x(),E(Pe,null,lt(r,ee=>_("button",{key:ee.id,type:"button",class:We(["tab",{on:i.value===ee.id}]),role:"tab","aria-selected":i.value===ee.id,onClick:le=>T(ee.id)},R(C(n)(ee.labelKey)),11,f2e)),64))],8,d2e),_("div",h2e,[Wn(_("section",p2e,[_("section",m2e,[_("h3",g2e,R(C(n)("settings.appearance")),1),_("div",v2e,[_("span",y2e,R(C(n)("theme.colorSchemeLabel")),1),fe(ms,{"model-value":e.colorScheme,options:[{value:"light",label:C(n)("theme.light")},{value:"dark",label:C(n)("theme.dark")},{value:"system",label:C(n)("theme.system")}],"onUpdate:modelValue":q[0]||(q[0]=ee=>s("setColorScheme",ee))},null,8,["model-value","options"])]),_("div",k2e,[_("span",b2e,R(C(n)("theme.accentLabel")),1),fe(ms,{"model-value":e.accent,options:[{value:"blue",label:C(n)("theme.accentBlue")},{value:"mono",label:C(n)("theme.accentBlack")}],"onUpdate:modelValue":q[1]||(q[1]=ee=>s("setAccent",ee))},null,8,["model-value","options"])]),_("div",x2e,[_("span",w2e,R(C(n)("settings.uiFontSize")),1),_("label",_2e,[_("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":C(n)("settings.uiFontSize"),onInput:q[2]||(q[2]=ee=>s("setUiFontSize",Number(ee.target.value)))},null,40,S2e),q[20]||(q[20]=_("span",{class:"num-unit"},"px",-1))])]),_("div",C2e,[_("span",A2e,R(C(n)("sidebar.language")),1),fe(DT)]),_("div",M2e,[_("span",E2e,[nt(R(C(n)("settings.conversationToc"))+" ",1),_("span",T2e,R(C(n)("settings.conversationTocHint")),1)]),fe(Mr,{"model-value":e.conversationToc??!0,label:C(n)("settings.conversationToc"),"onUpdate:modelValue":q[3]||(q[3]=ee=>s("setConversationToc",ee))},null,8,["model-value","label"])])]),_("section",N2e,[_("h3",I2e,R(C(n)("settings.notifications")),1),_("div",L2e,[_("span",$2e,[nt(R(C(n)("settings.notifyOnComplete"))+" ",1),e.notifyPermission==="denied"?(x(),E("span",F2e,R(C(n)("settings.notifyDenied")),1)):ue("",!0)]),fe(Mr,{"model-value":e.notify,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnComplete"),"onUpdate:modelValue":q[4]||(q[4]=ee=>s("setNotify",ee))},null,8,["model-value","disabled","label"])]),_("div",O2e,[_("span",R2e,[nt(R(C(n)("settings.notifyOnQuestion"))+" ",1),e.notifyPermission==="denied"?(x(),E("span",B2e,R(C(n)("settings.notifyDenied")),1)):ue("",!0)]),fe(Mr,{"model-value":e.notifyQuestion,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnQuestion"),"onUpdate:modelValue":q[5]||(q[5]=ee=>s("setNotifyQuestion",ee))},null,8,["model-value","disabled","label"])]),_("div",D2e,[_("span",P2e,[nt(R(C(n)("settings.notifyOnApproval"))+" ",1),e.notifyPermission==="denied"?(x(),E("span",H2e,R(C(n)("settings.notifyDenied")),1)):ue("",!0)]),fe(Mr,{"model-value":e.notifyApproval,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnApproval"),"onUpdate:modelValue":q[6]||(q[6]=ee=>s("setNotifyApproval",ee))},null,8,["model-value","disabled","label"])]),_("div",W2e,[_("span",z2e,R(C(n)("settings.soundOnComplete")),1),fe(Mr,{"model-value":e.sound,label:C(n)("settings.soundOnComplete"),"onUpdate:modelValue":q[7]||(q[7]=ee=>s("setSound",ee))},null,8,["model-value","label"])])])],512),[[wi,i.value==="general"]]),Wn(_("section",U2e,[_("section",q2e,[_("h3",j2e,R(C(n)("settings.account")),1),_("div",V2e,[_("span",K2e,R(e.authReady?e.accountModel?.split("/")[0]??C(n)("providers.status.connected"):C(n)("sidebar.notSignedIn")),1),fe(rn,{text:e.accountModel},{default:Le(()=>[e.authReady&&e.accountModel?(x(),E("span",G2e,R(e.accountModel),1)):ue("",!0)]),_:1},8,["text"])]),_("div",Y2e,[fe(jt,{variant:"secondary",size:"sm",onClick:q[8]||(q[8]=ee=>{s("openOnboarding"),s("close")})},{default:Le(()=>[nt(R(C(n)("onboarding.reopen")),1)]),_:1}),e.authReady?(x(),Ae(jt,{key:0,variant:"danger-soft",size:"sm",onClick:q[9]||(q[9]=ee=>s("logout"))},{default:Le(()=>[nt(R(C(n)("sidebar.signOut")),1)]),_:1})):(x(),Ae(jt,{key:1,variant:"primary",size:"sm",onClick:q[10]||(q[10]=ee=>s("login"))},{default:Le(()=>[nt(R(C(n)("sidebar.signIn")),1)]),_:1}))])])],512),[[wi,i.value==="account"]]),Wn(_("section",Z2e,[_("section",X2e,[_("div",Q2e,[_("h3",J2e,R(C(n)("settings.agentDefaults")),1),e.configSaving?(x(),E("span",ebe,R(C(n)("settings.saving")),1)):ue("",!0)]),e.config?(x(),E(Pe,{key:0},[_("div",tbe,[_("span",nbe,[nt(R(C(n)("settings.defaultModel"))+" ",1),_("span",obe,R(C(n)("settings.defaultModelHint")),1)]),p.value.length>0?(x(),E("div",sbe,[fe(G3,{"model-value":e.config.defaultModel??"",disabled:e.configSaving,"aria-label":C(n)("settings.defaultModel"),"onUpdate:modelValue":k},{default:Le(()=>[e.config.defaultModel?ue("",!0):(x(),E("option",ibe,R(C(n)("settings.noDefaultModel")),1)),(x(!0),E(Pe,null,lt(p.value,ee=>(x(),E("optgroup",{key:ee.provider,label:ee.provider},[(x(!0),E(Pe,null,lt(ee.options,le=>(x(),E("option",{key:le.id,value:le.id},R(le.label),9,lbe))),128))],8,rbe))),128))]),_:1},8,["model-value","disabled","aria-label"])])):(x(),E("span",abe,R(e.config.defaultModel??C(n)("settings.noDefaultModel")),1))]),_("div",cbe,[_("span",ube,[nt(R(C(n)("settings.defaultPermission"))+" ",1),_("span",dbe,R(C(n)("settings.defaultPermissionHint")),1)]),fe(ms,{"model-value":m.value,options:a.map(ee=>({value:ee,label:C(n)(c[ee])})),"onUpdate:modelValue":q[11]||(q[11]=ee=>g(ee))},null,8,["model-value","options"])]),_("div",fbe,[_("span",hbe,[nt(R(C(n)("settings.defaultThinking"))+" ",1),_("span",pbe,R(C(n)("settings.defaultThinkingHint")),1)]),fe(Mr,{"model-value":b(),disabled:e.configSaving,label:C(n)("settings.defaultThinking"),"onUpdate:modelValue":q[12]||(q[12]=ee=>A())},null,8,["model-value","disabled","label"])]),_("div",mbe,[_("span",gbe,[nt(R(C(n)("settings.defaultPlanMode"))+" ",1),_("span",vbe,R(C(n)("settings.defaultPlanModeHint")),1)]),fe(Mr,{"model-value":y(e.config.defaultPlanMode),disabled:e.configSaving,label:C(n)("settings.defaultPlanMode"),"onUpdate:modelValue":q[13]||(q[13]=ee=>v("defaultPlanMode"))},null,8,["model-value","disabled","label"])]),_("div",ybe,[_("span",kbe,[nt(R(C(n)("settings.mergeSkills"))+" ",1),_("span",bbe,R(C(n)("settings.mergeSkillsHint")),1)]),fe(Mr,{"model-value":y(e.config.mergeAllAvailableSkills),disabled:e.configSaving,label:C(n)("settings.mergeSkills"),"onUpdate:modelValue":q[14]||(q[14]=ee=>v("mergeAllAvailableSkills"))},null,8,["model-value","disabled","label"])])],64)):(x(),E("div",xbe,R(C(n)("settings.configUnavailable")),1))])],512),[[wi,i.value==="agent"]]),Wn(_("section",wbe,[_("section",_be,[_("h3",Sbe,R(C(n)("settings.advanced")),1),_("div",Cbe,[_("span",Abe,R(C(n)("sidebar.daemon")),1),_("span",Mbe,R(C(l)),1)]),_("div",Ebe,[_("span",Tbe,R(C(n)("settings.serverVersion")),1),_("span",Nbe,R(e.serverVersion||"-"),1)]),e.config?(x(),E("div",Ibe,[_("span",Lbe,[nt(R(C(n)("settings.telemetry"))+" ",1),_("span",$be,R(C(n)("settings.telemetryHint")),1),_("span",Fbe,R(C(n)("settings.telemetryRestartHint")),1)]),fe(Mr,{"model-value":e.config.telemetry!==!1,disabled:e.configSaving,label:C(n)("settings.telemetry"),"onUpdate:modelValue":q[15]||(q[15]=ee=>I())},null,8,["model-value","disabled","label"])])):ue("",!0),_("div",Obe,[_("span",Rbe,[nt(R(C(n)("settings.exportLog"))+" ",1),C(Yi)()?ue("",!0):(x(),E("span",Bbe,R(C(n)("settings.logHint")),1))]),fe(jt,{variant:"secondary",size:"sm",onClick:f},{default:Le(()=>[nt(R(C(n)("settings.exportLogBtn")),1)]),_:1})])])],512),[[wi,i.value==="advanced"]]),Wn(_("section",Dbe,[_("div",Pbe,[q[21]||(q[21]=_("div",{class:"panel-kicker"},"Archived sessions",-1)),_("h4",Hbe,R(C(n)("settings.archivedTitle")),1),_("p",Wbe,R(C(n)("settings.archivedDesc")),1)]),_("div",zbe,[_("label",Ube,[q[22]||(q[22]=_("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[_("circle",{cx:"11",cy:"11",r:"7"}),_("path",{d:"m21 21-4.3-4.3"})],-1)),Wn(_("input",{"onUpdate:modelValue":q[16]||(q[16]=ee=>S.value=ee),placeholder:C(n)("settings.archivedSearch")},null,8,qbe),[[ws,S.value]])]),fe(G3,{"model-value":B.value,size:"sm","aria-label":C(n)("settings.archivedAllWorkspaces"),"onUpdate:modelValue":q[17]||(q[17]=ee=>B.value=ee)},{default:Le(()=>[_("option",jbe,R(C(n)("settings.archivedAllWorkspaces")),1),(x(!0),E(Pe,null,lt(L.value,ee=>(x(),E("option",{key:ee,value:ee},R(ee),9,Vbe))),128))]),_:1},8,["model-value","aria-label"]),fe(ms,{size:"sm","model-value":W.value,options:[{value:"archived-desc",label:C(n)("settings.archivedSortArchived")},{value:"created-desc",label:C(n)("settings.archivedSortCreated")},{value:"name-asc",label:C(n)("settings.archivedSortName")}],"onUpdate:modelValue":q[18]||(q[18]=ee=>W.value=ee)},null,8,["model-value","options"])]),N.value?(x(),E("div",Kbe,R(C(n)("settings.archivedLoadingAll")),1)):(x(),E(Pe,{key:1},[j.value.length>0?(x(),E("div",Gbe,[(x(!0),E(Pe,null,lt(j.value,ee=>(x(),E("section",{key:ee.cwd,class:"archive-card"},[_("div",Ybe,[q[23]||(q[23]=_("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[_("path",{d:"M3 7h6l2 2h10v9H3z"}),_("path",{d:"M3 7V5h6l2 2"})],-1)),_("span",Zbe,R(ee.cwd),1),_("span",Xbe,R(C(n)("settings.archivedSessionsCount",{count:ee.items.length})),1)]),_("div",Qbe,[(x(!0),E(Pe,null,lt(ee.items,le=>(x(),E("div",{key:le.id,class:"archive-row"},[_("div",Jbe,[_("div",exe,R(le.title),1),_("div",txe,R(C(n)("settings.archivedAt",{time:ie(le.updatedAt)})),1)]),fe(jt,{variant:"secondary",size:"sm",onClick:oe=>Z(le.id)},{default:Le(()=>[nt(R(C(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128))])]))),128))])):(x(),E("div",nxe,R($.value.length===0?C(n)("settings.archivedEmpty"):C(n)("settings.archivedNoMatch")),1))],64))],512),[[wi,i.value==="archived"]])])],512)]),_:1},8,["title"]))}}),ixe=ft(sxe,[["__scopeId","data-v-c3c3a507"]]),rxe=/^(?:\/|~(?:\/|$)|[A-Za-z]:[\\/]|\\\\)/,PT=/^[A-Za-z]:[\\/]/,lxe=/^\/\/(?!\/)/;function Pv(e){return rxe.test(e.trim())}function axe(e,t){return e==="~"?t||e:e.startsWith("~/")?(t||"~")+e.slice(1):e}function cxe(e){return lxe.test(e)?`//${e.slice(2).replaceAll(/\/{2,}/g,"/")}`:e.replaceAll(/\/{2,}/g,"/")}function uxe(e){return PT.test(e)||e.startsWith("\\\\")||e.startsWith("//")}function dxe(e){return PT.test(e)?3:e.startsWith("\\\\")||e.startsWith("//")?2:e.startsWith("/")?1:0}function vk(e,t){let n=cxe(axe(e.trim(),t));const o=uxe(n),s=n==="/"||n==="//"||n==="\\\\"||/^[A-Za-z]:[\\/]$/.test(n),i=o?/[\\/]$/.test(n):n.endsWith("/");!s&&i&&(n=n.slice(0,-1));const r=n.lastIndexOf("/"),l=o?n.lastIndexOf("\\"):-1,a=Math.max(r,l),c=l>r?"\\":"/",u=dxe(n),d=a<u?n.slice(0,u)||"/":n.slice(0,a)||"/";return{target:n,parent:d,base:n.slice(a+1),separator:c}}function fxe(e,t,n){return`${e}${e.endsWith(n)?"":n}${t}`}function hxe(e,t,n){if(n===null)return null;const{target:o}=vk(e,t);return o===n?n:null}const pxe={class:"aw"},mxe={key:0,class:"crumbbar"},gxe={class:"crumbs"},vxe={key:0,class:"crumb-sep"},yxe=["onClick"],kxe=["placeholder"],bxe={key:2,class:"folder-list"},xxe={key:0,class:"fl-loading"},wxe={key:0,class:"fl-loading"},_xe={key:0,class:"fl-note"},Sxe=["onClick"],Cxe={class:"folder-name"},Axe={key:1,class:"fl-empty fl-error"},Mxe={key:2,class:"fl-empty fl-error"},Exe=["onClick"],Txe={class:"folder-name search-rel"},Nxe={key:0,class:"fl-empty"},Ixe={key:1,class:"fl-loading"},Lxe=["onClick"],$xe={class:"folder-name"},Fxe={key:0,class:"fl-empty"},Oxe={key:3,class:"degraded-hint"},Rxe={key:4,class:"add-error",role:"alert"},Bxe={class:"actions"},Dxe={class:"footer-hint"},Pxe=600,Hxe=6,Y3=150,Wxe=Qe({__name:"AddWorkspaceDialog",props:{browseFs:{type:Function},getFsHome:{type:Function},defaultPath:{},error:{}},emits:["add","close"],setup(e,{emit:t}){const{t:n}=Ot(),o=e,s=t,i=ne(!0),r=ne(!1),l=ne(!1),a=ne(""),c=ne(null),u=ne([]),d=ne(""),f=ne(!1),h=ne([]),p=D(()=>d.value.trim().length>0);let m=0,y=null;const k=D(()=>Pv(d.value)),g=ne("idle"),v=ne(""),b=ne("/"),A=ne([]),I=ne(""),T=ne(null),M=ne(null),$=D(()=>g.value!=="valid"?null:hxe(d.value,I.value,M.value));let N=0,F=null;function S(oe,re){const we=oe.toLowerCase(),me=re.toLowerCase();let Ee=0;for(let ae=0;ae<me.length&&Ee<we.length;ae++)me[ae]===we[Ee]&&Ee++;return Ee===we.length}async function B(oe){const re=a.value,we=oe.trim();if(!re||we===""){h.value=[],f.value=!1;return}const me=++m;f.value=!0;const Ee=[],ae=[{path:re,depth:0}];let Y=0;for(;ae.length>0&&Y<Pxe&&Ee.length<Y3;){if(me!==m)return;const Q=ae.shift();Y++;let P;try{P=await o.browseFs(Q.path)}catch{continue}if(me!==m)return;for(const G of P.entries){if(!G.isDir)continue;const pe=G.path.startsWith(re)?G.path.slice(re.length).replace(/^\/+/,""):G.path;if(S(we,pe||G.name)&&(Ee.push({path:G.path,name:G.name,rel:pe||G.name}),Ee.length>=Y3))break;Q.depth+1<Hxe&&ae.push({path:G.path,depth:Q.depth+1})}me===m&&(h.value=[...Ee])}me===m&&(f.value=!1)}et(d,oe=>{y&&clearTimeout(y),F&&clearTimeout(F),N++,g.value="idle",A.value=[],M.value=null;const re=oe.trim();if(re===""){m++,h.value=[],f.value=!1;return}if(Pv(re)){if(m++,h.value=[],f.value=!1,l.value)return;g.value="checking",F=setTimeout(()=>void W(re),150);return}y=setTimeout(()=>void B(oe),220)});async function W(oe){const re=++N;g.value="checking",M.value=null;const we=vk(oe,I.value),{target:me}=we;try{const ae=await o.browseFs(me);if(re!==N)return;if(ae.path){g.value="valid",A.value=[],M.value=me,a.value=ae.path,c.value=ae.parent,u.value=ae.entries,l.value=!1;return}}catch{}if(re!==N)return;const Ee=we.base.toLowerCase();v.value=we.parent,b.value=we.separator;try{const ae=await o.browseFs(we.parent);if(re!==N)return;if(ae.path){A.value=ae.entries.filter(Y=>Y.isDir&&Y.name.toLowerCase().startsWith(Ee)),g.value="not-found";return}}catch{}re===N&&(A.value=[],g.value="bad-parent")}function z(oe){d.value=fxe(v.value,oe,b.value),T.value?.focus()}const L=D(()=>l.value?n("workspace.degradedPlaceholder"):n("workspace.searchPlaceholder")),O=D(()=>l.value?n("workspace.degradedHint"):k.value&&g.value==="valid"?n("workspace.pathFollowHint"):n("workspace.browseHint"));function j(oe){if(oe.key==="Escape"){d.value?d.value="":s("close");return}if(oe.key!=="Enter")return;const re=d.value.trim();if(Pv(re)){if(oe.preventDefault(),l.value){const{target:we}=vk(re,I.value);we&&s("add",we);return}g.value==="valid"?le():g.value==="not-found"&&A.value[0]&&z(A.value[0].name)}}const Z=D(()=>{const oe=a.value;if(!oe)return[];const re=oe.split("/").filter(Boolean),we=[{label:"/",path:"/"}];let me="";for(const Ee of re)me+=`/${Ee}`,we.push({label:Ee,path:me});return we}),ie=D(()=>!(a.value.length===0||k.value&&$.value===null));async function U(oe){r.value=!0;try{const re=await o.browseFs(oe);if(!re.path){l.value=!0;return}a.value=re.path,c.value=re.parent,u.value=re.entries,d.value="",l.value=!1}catch{l.value=!0}finally{r.value=!1}}function q(oe){oe.isDir&&U(oe.path)}function ee(){c.value&&U(c.value)}function le(){ie.value&&s("add",$.value??a.value)}return wn(async()=>{r.value=!0;try{const oe=await o.getFsHome().catch(()=>({home:"",recentRoots:[]}));if(oe.home&&(I.value=oe.home),o.defaultPath&&(await U(o.defaultPath),!l.value))return;I.value?await U(I.value):l.value=!0}catch{l.value=!0}finally{r.value=!1}}),In(()=>{y&&clearTimeout(y),F&&clearTimeout(F)}),(oe,re)=>(x(),Ae(Qr,{open:i.value,"onUpdate:open":re[2]||(re[2]=we=>i.value=we),title:C(n)("workspace.addTitle"),size:"lg",height:"fixed",onClose:re[3]||(re[3]=we=>s("close"))},{default:Le(()=>[_("div",pxe,[l.value?ue("",!0):(x(),E("div",mxe,[fe(Kn,{size:"sm",disabled:!c.value,label:C(n)("workspace.up"),onClick:ee},{default:Le(()=>[fe(Ye,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),_("div",gxe,[(x(!0),E(Pe,null,lt(Z.value,(we,me)=>(x(),E(Pe,{key:we.path},[me>1?(x(),E("span",vxe,"/")):ue("",!0),_("button",{class:We(["crumb",{last:me===Z.value.length-1}]),onClick:Ee=>U(we.path)},R(we.label),11,yxe)],64))),128))])])),!r.value||l.value?(x(),E("div",{key:1,class:We(["filterbar",{"has-error":g.value==="not-found"||g.value==="bad-parent"}])},[fe(Ye,{class:"filter-icon",name:"search",size:"md"}),Wn(_("input",{ref_key:"filterEl",ref:T,"onUpdate:modelValue":re[0]||(re[0]=we=>d.value=we),class:"filter-input",type:"text",placeholder:L.value,autocomplete:"off",spellcheck:"false",onKeydown:Ct(j,["stop"])},null,40,kxe),[[ws,d.value]]),f.value||g.value==="checking"?(x(),Ae(Hs,{key:0,size:"sm"})):ue("",!0)],2)):ue("",!0),l.value?(x(),E("div",Oxe,R(C(n)("workspace.degradedHint")),1)):(x(),E("div",bxe,[r.value?(x(),E("div",xxe,R(C(n)("workspace.browsing")),1)):k.value&&g.value!=="valid"?(x(),E(Pe,{key:1},[g.value==="checking"?(x(),E("div",wxe,R(C(n)("workspace.checkingPath")),1)):g.value==="not-found"?(x(),E(Pe,{key:1},[A.value.length>0?(x(),E("div",_xe,R(C(n)("workspace.pathPickHint")),1)):ue("",!0),(x(!0),E(Pe,null,lt(A.value,we=>(x(),E("button",{key:we.path,class:"folder-row",onClick:me=>z(we.name)},[fe(Ye,{class:"dir-icon",name:"folder-closed",size:"sm"}),_("span",Cxe,R(we.name),1)],8,Sxe))),128)),A.value.length===0?(x(),E("div",Axe,R(C(n)("workspace.noPathMatch",{parent:v.value})),1)):ue("",!0)],64)):g.value==="bad-parent"?(x(),E("div",Mxe,R(C(n)("workspace.badParent",{parent:v.value})),1)):ue("",!0)],64)):p.value&&!k.value?(x(),E(Pe,{key:2},[(x(!0),E(Pe,null,lt(h.value,we=>(x(),E("button",{key:we.path,class:"folder-row",onClick:me=>U(we.path)},[fe(Ye,{class:"dir-icon",name:"folder-closed",size:"sm"}),_("span",Txe,R(we.rel),1)],8,Exe))),128)),!f.value&&h.value.length===0?(x(),E("div",Nxe,R(C(n)("workspace.noFilterMatch",{q:d.value.trim()})),1)):f.value&&h.value.length===0?(x(),E("div",Ixe,R(C(n)("workspace.searching")),1)):ue("",!0)],64)):(x(),E(Pe,{key:3},[(x(!0),E(Pe,null,lt(u.value,we=>(x(),E("button",{key:we.path,class:"folder-row",onClick:me=>q(we)},[fe(Ye,{class:"dir-icon",name:"folder-closed",size:"sm"}),_("span",$xe,R(we.name),1)],8,Lxe))),128)),u.value.length===0?(x(),E("div",Fxe,R(C(n)("workspace.noSubfolders")),1)):ue("",!0)],64))])),e.error?(x(),E("div",Rxe,R(e.error),1)):ue("",!0),_("div",Bxe,[fe(rn,{text:a.value},{default:Le(()=>[l.value?ue("",!0):(x(),Ae(jt,{key:0,variant:"primary",disabled:!ie.value,onClick:le},{default:Le(()=>[nt(R(C(n)("workspace.openThisFolder")),1)]),_:1},8,["disabled"]))]),_:1},8,["text"]),fe(jt,{variant:"secondary",onClick:re[1]||(re[1]=we=>s("close"))},{default:Le(()=>[nt(R(C(n)("workspace.cancel")),1)]),_:1})]),_("div",Dxe,R(O.value),1)])]),_:1},8,["open","title"]))}}),zxe=ft(Wxe,[["__scopeId","data-v-b0b096be"]]),Uxe={key:0,class:"confirm-dialog__message"},qxe=Qe({__name:"ConfirmDialog",props:{open:{type:Boolean},title:{},message:{},confirmLabel:{},cancelLabel:{},variant:{default:"danger"},loading:{type:Boolean}},emits:["update:open","confirm","cancel"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Ot();function i(){n.loading||(o("update:open",!1),o("cancel"))}function r(l){if(l.key!=="Enter"||!n.open||n.loading)return;const a=l.target;a instanceof HTMLButtonElement||a instanceof HTMLAnchorElement||a instanceof HTMLTextAreaElement||a instanceof HTMLSelectElement||a instanceof HTMLInputElement||(l.preventDefault(),o("confirm"))}return typeof window<"u"&&window.addEventListener("keydown",r),so(()=>{typeof window<"u"&&window.removeEventListener("keydown",r)}),(l,a)=>(x(),Ae(Qr,{open:e.open,title:e.title,height:"auto","initial-focus":".confirm-dialog__confirm","close-on-esc":!e.loading,"close-on-overlay":!e.loading,"onUpdate:open":a[1]||(a[1]=c=>o("update:open",c)),onClose:i},{foot:Le(()=>[fe(jt,{variant:"secondary",disabled:e.loading,onClick:i},{default:Le(()=>[nt(R(e.cancelLabel??C(s)("common.cancel")),1)]),_:1},8,["disabled"]),fe(jt,{class:"confirm-dialog__confirm",variant:e.variant,loading:e.loading,onClick:a[0]||(a[0]=c=>o("confirm"))},{default:Le(()=>[nt(R(e.confirmLabel??C(s)("common.confirm")),1)]),_:1},8,["variant","loading"])]),default:Le(()=>[e.message?(x(),E("p",Uxe,R(e.message),1)):ue("",!0)]),_:1},8,["open","title","close-on-esc","close-on-overlay"]))}}),jxe=ft(qxe,[["__scopeId","data-v-ea995309"]]),Vxe=Qe({__name:"ConfirmDialogHost",setup(e){const{current:t,busy:n,settle:o,runAction:s}=zf();function i(){s()}return(r,l)=>(x(),Ae(jxe,{open:C(t)!==null,title:C(t)?.title??"",message:C(t)?.message,"confirm-label":C(t)?.confirmLabel,"cancel-label":C(t)?.cancelLabel,variant:C(t)?.variant,loading:C(n),onConfirm:i,onCancel:l[0]||(l[0]=a=>C(o)(!1))},null,8,["open","title","message","confirm-label","cancel-label","variant","loading"]))}}),Kxe={class:"rows"},Gxe={class:"row"},Yxe={class:"row"},Zxe={class:"row"},Xxe={class:"row"},Qxe={class:"row"},Jxe={class:"row"},ewe={class:"ctx-text"},twe={key:0,class:"bar"},nwe={class:"row"},owe=Qe({__name:"StatusPanel",props:{status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},costUsd:{}},emits:["close"],setup(e,{emit:t}){const{t:n}=Ot(),o=e,s=t,i=ne(!0),r=D(()=>o.status.ctxMax<=0?0:Math.min(100,Math.max(0,Math.ceil(o.status.ctxUsed/o.status.ctxMax*100)))),l=D(()=>o.status.ctxMax>0?n("status.statusContextValue",{used:pr(o.status.ctxUsed),max:pr(o.status.ctxMax),pct:r.value}):n("status.statusNone"));function a(p){return n(p==="yolo"?"status.permissionYolo":p==="auto"?"status.permissionAuto":"status.permissionManual")}const c=D(()=>{const p=o.status.permission;return p==="yolo"?"var(--color-danger)":p==="auto"?"var(--color-warning)":"var(--color-text)"}),u=D(()=>o.planMode?n("status.planOn"):n("status.planOff")),d=D(()=>o.swarmMode?n("status.swarmOn"):n("status.swarmOff")),f=D(()=>typeof o.costUsd=="number"&&o.costUsd>0),h=D(()=>f.value?`$${o.costUsd.toFixed(4)}`:n("status.statusNone"));return(p,m)=>(x(),Ae(Qr,{open:i.value,"onUpdate:open":m[0]||(m[0]=y=>i.value=y),title:C(n)("status.statusPanelTitle"),onClose:m[1]||(m[1]=y=>s("close"))},{default:Le(()=>[_("dl",Kxe,[_("div",Gxe,[_("dt",null,R(C(n)("status.statusModel")),1),_("dd",null,R(e.status.model),1)]),_("div",Yxe,[_("dt",null,R(C(n)("status.statusThinking")),1),_("dd",null,R(e.thinking),1)]),_("div",Zxe,[_("dt",null,R(C(n)("status.statusPermission")),1),_("dd",{style:tn({color:c.value})},R(a(e.status.permission)),5)]),_("div",Xxe,[_("dt",null,R(C(n)("status.statusPlanMode")),1),_("dd",{class:We({"plan-on":e.planMode})},R(u.value),3)]),_("div",Qxe,[_("dt",null,R(C(n)("status.statusSwarmMode")),1),_("dd",{class:We({"swarm-on":e.swarmMode})},R(d.value),3)]),_("div",Jxe,[_("dt",null,R(C(n)("status.statusContext")),1),_("dd",null,[_("span",ewe,R(l.value),1),e.status.ctxMax>0?(x(),E("span",twe,[_("i",{style:tn({width:r.value+"%"})},null,4)])):ue("",!0)])]),_("div",nwe,[_("dt",null,R(C(n)("status.statusCost")),1),_("dd",null,R(h.value),1)])])]),_:1},8,["open","title"]))}}),swe=ft(owe,[["__scopeId","data-v-c493cffd"]]),iwe={class:"ui-toast__icon","aria-hidden":"true"},rwe={class:"ui-toast__body"},lwe={class:"ui-toast__title"},awe={key:0,class:"ui-toast__msg"},cwe=Qe({__name:"Toast",props:{variant:{default:"info"},title:{},message:{},dismissLabel:{default:"Dismiss"}},emits:["dismiss"],setup(e){return(t,n)=>(x(),E("div",{class:We(["ui-toast",`ui-toast--${e.variant}`])},[_("span",iwe,[zn(t.$slots,"icon",{},()=>[e.variant==="success"?(x(),Ae(Ye,{key:0,name:"check"})):e.variant==="danger"?(x(),Ae(Ye,{key:1,name:"close"})):e.variant==="warning"?(x(),Ae(Ye,{key:2,name:"alert-triangle"})):(x(),Ae(Ye,{key:3,name:"info"}))],!0)]),_("div",rwe,[_("div",lwe,R(e.title),1),e.message?(x(),E("div",awe,R(e.message),1)):ue("",!0),zn(t.$slots,"default",{},void 0,!0)]),fe(Kn,{class:"ui-toast__close",size:"sm",label:e.dismissLabel,onClick:n[0]||(n[0]=o=>t.$emit("dismiss"))},{default:Le(()=>[fe(Ye,{name:"close",size:"sm"})]),_:1},8,["label"])],2))}}),uwe=ft(cwe,[["__scopeId","data-v-5edc3c48"]]),dwe={key:0,class:"actions"},fwe=["onClick"],hwe=["onClick"],pwe={key:1,class:"details"},mwe=Qe({__name:"WarningToasts",props:{warnings:{}},emits:["dismiss"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Ot();function i(M){return typeof M=="object"&&M!==null}function r(M){return i(M)?M.title:M}function l(M){return i(M)?M.message??"":""}function a(M){return i(M)?M.details:void 0}function c(M){return i(M)?M.severity==="error":M.startsWith(`${s("warnings.errorLabel")}:`)||/\b4\d\d\b|error|失败|failed/i.test(M)}function u(M){return i(M)?`notice:${M.severity}:${M.title}:${M.message??""}:${JSON.stringify(M.details??[])}`:`text:${M}`}function d(M){if(!i(M))return M;const $=[M.title];M.message&&$.push(M.message);const N=M.details??[];if(N.length>0){$.push("",`${s("warnings.diagnostics")}:`);for(const F of N)$.push(`${F.label}: ${F.value}`)}return $.join(`
|
|
337
|
-
`)}let f=1;const h=ne([]),p=new Map,m=new Map;function y(M){const $=c(M)?12e3:6e3;return typeof window<"u"&&window.matchMedia?.("(hover: none)").matches===!0?$+5e3:$}function k(M,$){const N=p.get(M)??{handle:null,deadline:0,remaining:0};N.handle=setTimeout(()=>T(M),$),N.deadline=Date.now()+$,p.set(M,N)}function g(M){const $=p.get(M);$&&$.handle!==null&&clearTimeout($.handle),p.delete(M)}function v(M){const $=p.get(M);!$||$.handle===null||(clearTimeout($.handle),$.handle=null,$.remaining=Math.max(0,$.deadline-Date.now()))}function b(M){if(h.value.find(F=>F.id===M)?.detailsOpen)return;const N=p.get(M);!N||N.handle!==null||k(M,N.remaining)}function A(M){M.detailsOpen=!M.detailsOpen,M.detailsOpen?v(M.id):b(M.id)}async function I(M){if(!await Xo(d(M.warning)))return;M.copied=!0;const N=m.get(M.id);N&&clearTimeout(N),m.set(M.id,setTimeout(()=>{M.copied=!1,m.delete(M.id)},1400))}function T(M){g(M);const $=m.get(M);$&&clearTimeout($),m.delete(M);const N=h.value.findIndex(F=>F.id===M);N!==-1&&(h.value=h.value.filter(F=>F.id!==M),o("dismiss",N))}return et(()=>n.warnings,M=>{const $=[...h.value];h.value=M.map(N=>{const F=u(N),S=$.findIndex(z=>z.key===F),B=S===-1?void 0:$.splice(S,1)[0];if(B)return B.warning=N,B;const W={id:f++,key:F,warning:N,detailsOpen:!1,copied:!1};return k(W.id,y(N)),W});for(const N of $){g(N.id);const F=m.get(N.id);F&&clearTimeout(F),m.delete(N.id)}},{immediate:!0,flush:"post"}),In(()=>{p.forEach(M=>{M.handle!==null&&clearTimeout(M.handle)}),p.clear(),m.forEach(M=>clearTimeout(M)),m.clear()}),(M,$)=>(x(),Ae(I7,{name:"toast",tag:"div",class:"toasts",role:"status","aria-live":"polite"},{default:Le(()=>[(x(!0),E(Pe,null,lt(h.value,N=>(x(),Ae(uwe,{key:N.id,variant:c(N.warning)?"danger":"warning",title:r(N.warning),message:l(N.warning),"dismiss-label":C(s)("warnings.dismiss"),onDismiss:F=>T(N.id),onPointerenter:F=>v(N.id),onPointerleave:F=>b(N.id)},{default:Le(()=>[a(N.warning)?.length?(x(),E("div",dwe,[_("button",{class:"link",type:"button",onClick:F=>A(N)},R(N.detailsOpen?C(s)("warnings.hideDetails"):C(s)("warnings.showDetails")),9,fwe),_("button",{class:"link",type:"button",onClick:F=>I(N)},R(N.copied?C(s)("warnings.copied"):C(s)("warnings.copyDetails")),9,hwe)])):ue("",!0),N.detailsOpen&&a(N.warning)?.length?(x(),E("dl",pwe,[(x(!0),E(Pe,null,lt(a(N.warning),F=>(x(),E("div",{key:`${F.label}:${F.value}`,class:"detail-row"},[_("dt",null,R(F.label),1),_("dd",null,R(F.value),1)]))),128))])):ue("",!0)]),_:2},1032,["variant","title","message","dismiss-label","onDismiss","onPointerenter","onPointerleave"]))),128))]),_:1}))}}),gwe=ft(mwe,[["__scopeId","data-v-a0066058"]]),vwe={class:"topbar"},ywe={class:"wsq"},kwe=["aria-label"],bwe={class:"tb-path"},xwe={class:"ws"},wwe={class:"se"},_we={class:"tb-sub"},Swe=Qe({__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}=Ot(),o=e,s=t,i=D(()=>{const a=o.workspace,u=(a?.name||a?.root||"").trim().charAt(0);return u?u.toUpperCase():"K"}),r=D(()=>o.workspace?.name??n("workspace.noWorkspace")),l=D(()=>o.running?n("mobile.running"):n("mobile.idle"));return(a,c)=>(x(),E("div",vwe,[_("span",ywe,R(i.value),1),_("button",{type:"button",class:"tb-mid","aria-label":C(n)("mobile.openSwitcher"),onClick:c[0]||(c[0]=u=>s("openSwitcher"))},[_("span",bwe,[_("span",xwe,R(r.value),1),e.sessionTitle?(x(),E(Pe,{key:0},[c[2]||(c[2]=_("span",{class:"sl"},"/",-1)),_("span",wwe,R(e.sessionTitle),1)],64)):ue("",!0),c[3]||(c[3]=_("span",{class:"cv"},"⌄",-1))]),_("span",_we,[_("span",{class:We(["rd",{on:e.running}])},null,2),_("span",null,R(l.value),1),e.branch?(x(),E(Pe,{key:0},[nt(" · "+R(e.branch),1)],64)):ue("",!0),e.sessionCount>0?(x(),E(Pe,{key:1},[nt(" · "+R(C(n)("mobile.sessionCount",{n:e.sessionCount})),1)],64)):ue("",!0)])],8,kwe),fe(Kn,{size:"lg",label:C(n)("mobile.openSettings"),onClick:c[1]||(c[1]=u=>s("openSettings"))},{default:Le(()=>[fe(Ye,{name:"sliders",size:"lg"})]),_:1},8,["label"])]))}}),Cwe=ft(Swe,[["__scopeId","data-v-ac2feb1d"]]),Awe={key:0,class:"sheet-root"},Mwe=["aria-label"],Ewe=["aria-label"],Twe={key:0,class:"sheet-head"},Nwe={class:"sheet-title"},Iwe={class:"sheet-body"},Lwe=Qe({__name:"BottomSheet",props:{modelValue:{type:Boolean},title:{default:""}},emits:["update:modelValue","close"],setup(e,{emit:t}){const{t:n}=Ot(),o=e,s=t;function i(){s("update:modelValue",!1),s("close")}function r(l){l.key==="Escape"&&i()}return et(()=>o.modelValue,l=>{typeof document>"u"||(l?document.addEventListener("keydown",r):document.removeEventListener("keydown",r))},{immediate:!0}),In(()=>{typeof document<"u"&&document.removeEventListener("keydown",r)}),(l,a)=>(x(),Ae(Ua,{name:"sheet"},{default:Le(()=>[e.modelValue?(x(),E("div",Awe,[_("div",{class:"sheet-scrim",onClick:i}),_("div",{class:"sheet-panel",role:"dialog","aria-label":e.title||C(n)("mobile.sheetLabel")},[_("button",{type:"button",class:"sheet-grab","aria-label":C(n)("mobile.closeSheet"),onClick:i},null,8,Ewe),e.title?(x(),E("div",Twe,[_("span",Nwe,R(e.title),1)])):ue("",!0),_("div",Iwe,[zn(l.$slots,"default",{},void 0,!0)])],8,Mwe)])):ue("",!0)]),_:3}))}}),HT=ft(Lwe,[["__scopeId","data-v-cc2a88fe"]]),$we={class:"mlist"},Fwe={key:0,class:"mempty"},Owe=["onClick"],Rwe={class:"mgh-main"},Bwe={class:"mgh-name"},Dwe={class:"mgh-path"},Pwe={key:2,class:"att"},Hwe={key:0,class:"mempty small"},Wwe=["onClick"],zwe={class:"m"},Uwe={class:"s"},qwe={key:0,class:"att"},jwe=["disabled","onClick"],Vwe=["onClick"],Kwe=Qe({__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","loadMore"],setup(e,{emit:t}){const{t:n}=Ot(),o=e,s=t;function i(){s("update:modelValue",!1)}function r(F){s("select",F),i()}function l(F){s("createInWorkspace",F),i()}function a(){s("create"),i()}function c(){s("addWorkspace"),i()}const u=ne(new Set);function d(F){return u.value.has(F)}function f(F){const S=new Set(u.value);S.has(F)?S.delete(F):S.add(F),u.value=S,v.value=null,T.value=null}const h=ne(new Set);function p(F){return h.value.has(F)}function m(F){const S=new Set(h.value);S.has(F)?S.delete(F):S.add(F),h.value=S}function y(F){if(p(F.workspace.id))return F.sessions;const S=F.sessions.slice(0,F.initialCount);if(o.activeId&&!S.some(B=>B.id===o.activeId)){const B=F.sessions.find(W=>W.id===o.activeId);if(B)return[...S,B]}return S}function k(F){if(!h.value.has(F)){const S=new Set(h.value);S.add(F),h.value=S}s("loadMore",F)}function g(F){return o.attentionByWorkspace[F]??0}const v=ne(null);function b(F){v.value=v.value===F?null:F,T.value=null}function A(F){v.value=null;const B=(typeof window<"u"?window.prompt(n("sidebar.rename"),F.title):null)?.trim();B&&s("rename",F.id,B)}function I(F){v.value=null,s("archive",F)}const T=ne(null);function M(F){T.value=T.value===F?null:F,v.value=null}function $(F){Xo(F.root),T.value=null}function N(F){T.value=null,s("deleteWorkspace",F.id)}return(F,S)=>(x(),Ae(HT,{"model-value":e.modelValue,"onUpdate:modelValue":S[2]||(S[2]=B=>s("update:modelValue",B))},{default:Le(()=>[_("button",{type:"button",class:"newrow",onClick:a},[fe(Ye,{name:"message",size:"sm"}),nt(" "+R(C(n)("sidebar.newChat")),1)]),_("button",{type:"button",class:"newrow secondary",onClick:c},[fe(Ye,{name:"folder",size:"sm"}),nt(" "+R(C(n)("sidebar.newWorkspace")),1)]),_("div",$we,[e.groups.length===0?(x(),E("div",Fwe,R(C(n)("workspace.noWorkspace")),1)):ue("",!0),(x(!0),E(Pe,null,lt(e.groups,B=>(x(),E("div",{key:B.workspace.id,class:"mgroup"},[_("div",{class:We(["mgh",{on:B.workspace.id===e.activeWorkspaceId}]),onClick:W=>f(B.workspace.id)},[d(B.workspace.id)?(x(),Ae(Ye,{key:0,class:"mgh-folder",name:"folder-closed",size:"sm"})):(x(),Ae(Ye,{key:1,class:"mgh-folder",name:"folder",size:"sm"})),_("div",Rwe,[_("span",Bwe,R(B.workspace.name),1),fe(rn,{text:B.workspace.root},{default:Le(()=>[_("span",Dwe,R(B.workspace.shortPath),1)]),_:2},1032,["text"])]),d(B.workspace.id)&&g(B.workspace.id)>0?(x(),E("span",Pwe,R(g(B.workspace.id)),1)):ue("",!0),fe(Kn,{size:"lg",class:"mgh-more",label:C(n)("sidebar.options"),onClick:Ct(W=>M(B.workspace.id),["stop"])},{default:Le(()=>[fe(Ye,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),fe(Kn,{size:"lg",class:"mgh-add",label:C(n)("workspace.newInGroup"),onClick:Ct(W=>l(B.workspace.id),["stop"])},{default:Le(()=>[fe(Ye,{name:"plus",size:"md"})]),_:1},8,["label","onClick"]),T.value===B.workspace.id?(x(),Ae(Ra,{key:3,class:"kmenu wsmenu",onClick:S[0]||(S[0]=Ct(()=>{},["stop"]))},{default:Le(()=>[fe(Tn,{size:"lg",onClick:W=>$(B.workspace)},{default:Le(()=>[nt(R(C(n)("sidebar.copyPath")),1)]),_:1},8,["onClick"]),fe(Tn,{size:"lg",danger:"",onClick:W=>N(B.workspace)},{default:Le(()=>[nt(R(C(n)("sidebar.delete")),1)]),_:1},8,["onClick"])]),_:2},1024)):ue("",!0)],10,Owe),Wn(_("div",null,[B.sessions.length===0?(x(),E("div",Hwe,R(C(n)("sidebar.noSessions")),1)):ue("",!0),(x(!0),E(Pe,null,lt(y(B),W=>(x(),E("div",{key:W.id,class:We(["srow",{cur:W.id===e.activeId}]),onClick:z=>r(W.id)},[_("div",zwe,[_("div",{class:We(["t",{run:W.busy,aborted:!W.busy&&(e.attentionBySession[W.id]??0)===0&&(W.lastTurnReason==="cancelled"||W.lastTurnReason==="failed")}])},R(W.title),3),_("div",Uwe,R(W.time),1)]),(e.attentionBySession[W.id]??0)>0?(x(),E("span",qwe,R(e.attentionBySession[W.id]),1)):ue("",!0),fe(Kn,{size:"lg",class:"kb",label:C(n)("sidebar.options"),onClick:Ct(z=>b(W.id),["stop"])},{default:Le(()=>[fe(Ye,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),v.value===W.id?(x(),Ae(Ra,{key:1,class:"kmenu",onClick:S[1]||(S[1]=Ct(()=>{},["stop"]))},{default:Le(()=>[fe(Tn,{size:"lg",onClick:z=>A(W)},{default:Le(()=>[nt(R(C(n)("sidebar.rename")),1)]),_:1},8,["onClick"]),fe(Tn,{size:"lg",danger:"",onClick:z=>I(W.id)},{default:Le(()=>[nt(R(C(n)("sidebar.archive")),1)]),_:1},8,["onClick"])]),_:2},1024)):ue("",!0)],10,Wwe))),128)),B.hasMore||B.loadingMore?(x(),E("button",{key:1,type:"button",class:"mshow-more",disabled:B.loadingMore,onClick:Ct(W=>k(B.workspace.id),["stop"])},R(B.loadingMore?C(n)("sidebar.loadingMore"):C(n)("sidebar.showMore",{count:Math.max(0,B.workspace.sessionCount-B.sessions.length)})),9,jwe)):ue("",!0),B.sessions.length>B.initialCount?(x(),E("button",{key:2,type:"button",class:"mshow-more",onClick:Ct(W=>m(B.workspace.id),["stop"])},R(p(B.workspace.id)?C(n)("sidebar.showLess"):C(n)("sidebar.showAll",{count:B.sessions.length-B.initialCount})),9,Vwe)):ue("",!0)],512),[[wi,!d(B.workspace.id)]])]))),128))])]),_:1},8,["model-value"]))}}),Gwe=ft(Kwe,[["__scopeId","data-v-23ac86d1"]]),Ywe={class:"group-title"},Zwe={class:"srow-main"},Xwe={class:"srow-label"},Qwe={class:"srow-sub"},Jwe={class:"srow read-only"},e_e={class:"srow-main"},t_e={class:"srow-label"},n_e={key:0,class:"srow-sub"},o_e={class:"cache-note"},s_e={class:"srow-main"},i_e={class:"srow-label"},r_e={class:"srow-sub"},l_e=["aria-checked"],a_e={class:"srow-main"},c_e={class:"srow-label"},u_e={class:"srow-sub"},d_e=["aria-checked"],f_e={class:"srow-main"},h_e={class:"srow-label"},p_e={class:"srow read-only"},m_e={class:"srow-main"},g_e={class:"srow-label"},v_e={class:"srow-sub"},y_e=["aria-label"],k_e={class:"group-title"},b_e={class:"srow-main"},x_e={class:"srow-label"},w_e={class:"srow-sub"},__e={class:"srow read-only pref"},S_e={class:"srow-main"},C_e={class:"srow-label"},A_e={class:"srow read-only pref"},M_e={class:"srow-main"},E_e={class:"srow-label"},T_e={class:"srow read-only pref"},N_e={class:"srow-main"},I_e={class:"srow-label"},L_e={class:"num-field"},$_e=["value","aria-label"],F_e={class:"srow-main"},O_e={class:"srow-label"},R_e={class:"srow-sub"},B_e=["aria-checked"],D_e={class:"srow-main"},P_e={class:"srow-label"},H_e={class:"srow-main"},W_e={class:"srow-label"},z_e={key:2,class:"srow read-only"},U_e={class:"srow-main"},q_e={class:"srow-label"},j_e={class:"srow-val dim"},V_e={class:"arch-subhead"},K_e={class:"arch-count"},G_e={class:"arch-tools"},Y_e={key:0,class:"arch-empty"},Z_e={class:"arch-meta"},X_e={class:"arch-name"},Q_e={class:"arch-time"},J_e={key:2,class:"arch-empty"},eSe=100,tSe=Qe({__name:"MobileSettingsSheet",props:{modelValue:{type:Boolean},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},colorScheme:{default:"system"},uiFontSize:{default:14},authReady:{type:Boolean,default:!1},conversationToc:{type:Boolean},serverVersion:{default:""},models:{default:()=>[]}},emits:["update:modelValue","pickModel","setThinking","togglePlan","toggleSwarm","setPermission","setColorScheme","setUiFontSize","setConversationToc","login","logout"],setup(e,{emit:t}){const{t:n}=Ot(),o=e,s=t;function i(U){s("setColorScheme",U)}const r=["manual","auto","yolo"],l=D(()=>o.models?.find(U=>U.id===o.status?.modelId)),a=D(()=>J1(l.value)),c=D(()=>e0(l.value)),u=D(()=>jm(l.value,o.thinking)),d=D(()=>c.value.includes(u.value)?u.value:""),f=D(()=>c.value.map(U=>({value:U,label:lk(U)}))),h=D(()=>o.planMode===!0),p=D(()=>o.swarmMode===!0),m=D(()=>{const U=o.status.permission;return U==="yolo"?"var(--color-danger)":U==="auto"?"var(--color-warning)":"var(--color-text-muted)"}),y=D(()=>{const U=o.status.permission,q=n(U==="yolo"?"mobile.permYoloSub":U==="auto"?"mobile.permAutoSub":"mobile.permManualSub");return`${U} · ${q}`}),k=D(()=>o.status.ctxMax>0?Math.min(100,Math.max(0,Math.ceil(o.status.ctxUsed/o.status.ctxMax*100))):0),g=D(()=>o.status.ctxMax>0?`${pr(o.status.ctxUsed)}/${pr(o.status.ctxMax)}`:n("status.statusNone"));function v(U){s("setThinking",ib(l.value,U))}function b(){const U=r.indexOf(o.status.permission),q=r[(U+1)%r.length];s("setPermission",q)}function A(){s("pickModel"),s("update:modelValue",!1)}function I(){s("login"),s("update:modelValue",!1)}function T(){s("logout"),s("update:modelValue",!1)}const M=Ib(),$=ne("main"),N=ne([]),F=ne(!1),S=ne(!1),B=ne(""),W=ne("archived-desc");async function z(){if(!F.value){F.value=!0,S.value=!1;try{const U=[];let q;for(;;){const ee=await M.loadArchivedSessions({beforeId:q,pageSize:eSe});if(U.push(...ee.items),!ee.hasMore||ee.items.length===0)break;const le=ee.items.at(-1)?.id;if(le===void 0)break;q=le}N.value=U,S.value=!0}catch(U){console.warn("loadAllArchived failed",U)}finally{F.value=!1}}}function L(){$.value="archived",B.value="",z()}function O(){$.value="main"}const j=D(()=>{const U=B.value.trim().toLowerCase();let q=N.value.filter(ee=>ee.archived===!0);return U&&(q=q.filter(ee=>ee.title.toLowerCase().includes(U))),q=q.slice(),W.value==="archived-desc"?q.sort((ee,le)=>le.updatedAt.localeCompare(ee.updatedAt)):W.value==="created-desc"?q.sort((ee,le)=>le.createdAt.localeCompare(ee.createdAt)):q.sort((ee,le)=>ee.title.localeCompare(le.title,"zh")),q});async function Z(U){await M.restoreSession(U)&&(N.value=N.value.filter(ee=>ee.id!==U))}function ie(U){const q=new Date(U);if(Number.isNaN(q.getTime()))return U;const ee=le=>String(le).padStart(2,"0");return`${q.getFullYear()}-${ee(q.getMonth()+1)}-${ee(q.getDate())} ${ee(q.getHours())}:${ee(q.getMinutes())}`}return et(()=>o.modelValue,U=>{U||($.value="main")}),(U,q)=>(x(),Ae(HT,{"model-value":e.modelValue,title:C(n)("mobile.settingsTitle"),"onUpdate:modelValue":q[6]||(q[6]=ee=>s("update:modelValue",ee))},{default:Le(()=>[$.value==="main"?(x(),E(Pe,{key:0},[_("div",Ywe,R(C(n)("mobile.groupSession")),1),_("button",{type:"button",class:"srow",onClick:A},[_("span",Zwe,[_("span",Xwe,R(C(n)("status.statusModel")),1),_("span",Qwe,R(e.status.model),1)]),q[7]||(q[7]=_("span",{class:"chev"},"›",-1))]),_("div",Jwe,[_("span",e_e,[_("span",t_e,R(C(n)("status.statusThinking")),1),a.value==="unsupported"?(x(),E("span",n_e,R(C(n)("status.modeNotSupported")),1)):ue("",!0)]),c.value.length>1?(x(),Ae(ms,{key:0,"model-value":d.value,options:f.value,size:"sm","onUpdate:modelValue":v},null,8,["model-value","options"])):(x(),E("span",{key:1,class:We(["srow-val",{dim:u.value==="off"}])},R(u.value==="off"?C(n)("status.planOff"):C(lk)(u.value)),3))]),_("div",o_e,R(C(n)("status.cacheNote")),1),_("button",{type:"button",class:"srow",onClick:q[0]||(q[0]=ee=>s("togglePlan"))},[_("span",s_e,[_("span",i_e,R(C(n)("status.statusPlanMode")),1),_("span",r_e,R(C(n)("mobile.planModeSub")),1)]),_("span",{class:We(["toggle",{on:h.value}]),role:"switch","aria-checked":h.value},null,10,l_e)]),_("button",{type:"button",class:"srow",onClick:q[1]||(q[1]=ee=>s("toggleSwarm"))},[_("span",a_e,[_("span",c_e,R(C(n)("status.statusSwarmMode")),1),_("span",u_e,R(C(n)("mobile.swarmModeSub")),1)]),_("span",{class:We(["toggle",{on:p.value}]),role:"switch","aria-checked":p.value},null,10,d_e)]),_("button",{type:"button",class:"srow",onClick:b},[_("span",f_e,[_("span",h_e,R(C(n)("status.statusPermission")),1),_("span",{class:"srow-sub",style:tn({color:m.value})},R(y.value),5)]),q[8]||(q[8]=_("span",{class:"chev"},"›",-1))]),_("div",p_e,[_("span",m_e,[_("span",g_e,R(C(n)("status.statusContext")),1),_("span",v_e,R(g.value),1)]),_("span",{class:"ctx-meter","aria-label":g.value},[_("i",{style:tn({width:k.value+"%"})},null,4)],8,y_e)]),_("div",k_e,R(C(n)("mobile.groupApp")),1),_("button",{type:"button",class:"srow",onClick:L},[_("span",b_e,[_("span",x_e,R(C(n)("mobile.archivedSessions")),1),_("span",w_e,R(C(n)("mobile.archivedSessionsSub")),1)]),q[9]||(q[9]=_("span",{class:"chev"},"›",-1))]),_("div",__e,[_("span",S_e,[_("span",C_e,R(C(n)("theme.colorSchemeLabel")),1)]),fe(ms,{"model-value":e.colorScheme??"system",options:[{value:"light",label:C(n)("theme.light")},{value:"dark",label:C(n)("theme.dark")},{value:"system",label:C(n)("theme.system")}],"onUpdate:modelValue":i},null,8,["model-value","options"])]),_("div",A_e,[_("span",M_e,[_("span",E_e,R(C(n)("sidebar.language")),1)]),fe(DT)]),_("div",T_e,[_("span",N_e,[_("span",I_e,R(C(n)("settings.uiFontSize")),1)]),_("label",L_e,[_("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":C(n)("settings.uiFontSize"),onInput:q[2]||(q[2]=ee=>s("setUiFontSize",Number(ee.target.value)))},null,40,$_e),q[10]||(q[10]=_("span",{class:"num-unit"},"px",-1))])]),_("button",{type:"button",class:"srow",onClick:q[3]||(q[3]=ee=>s("setConversationToc",!e.conversationToc))},[_("span",F_e,[_("span",O_e,R(C(n)("settings.conversationToc")),1),_("span",R_e,R(C(n)("settings.conversationTocHint")),1)]),_("span",{class:We(["toggle",{on:e.conversationToc}]),role:"switch","aria-checked":e.conversationToc},null,10,B_e)]),e.authReady?(x(),E("button",{key:0,type:"button",class:"srow acct out",onClick:T},[_("span",D_e,[_("span",P_e,R(C(n)("sidebar.signOut")),1)])])):(x(),E("button",{key:1,type:"button",class:"srow acct in",onClick:I},[_("span",H_e,[_("span",W_e,R(C(n)("sidebar.signIn")),1)])])),e.serverVersion?(x(),E("div",z_e,[_("span",U_e,[_("span",q_e,R(C(n)("settings.serverVersion")),1)]),_("span",j_e,R(e.serverVersion),1)])):ue("",!0)],64)):(x(),E(Pe,{key:1},[_("div",V_e,[_("button",{type:"button",class:"arch-back",onClick:O},[q[11]||(q[11]=_("span",{class:"chev back"},"‹",-1)),nt(" "+R(C(n)("mobile.archivedBack")),1)]),_("span",K_e,R(C(n)("mobile.sessionCount",{n:j.value.length})),1)]),_("div",G_e,[fe(t0,{class:"arch-search-input","model-value":B.value,size:"sm",placeholder:C(n)("settings.archivedSearch"),"onUpdate:modelValue":q[4]||(q[4]=ee=>B.value=ee)},null,8,["model-value","placeholder"]),fe(ms,{size:"sm","model-value":W.value,options:[{value:"archived-desc",label:C(n)("settings.archivedSortArchived")},{value:"created-desc",label:C(n)("settings.archivedSortCreated")},{value:"name-asc",label:C(n)("settings.archivedSortName")}],"onUpdate:modelValue":q[5]||(q[5]=ee=>W.value=ee)},null,8,["model-value","options"])]),F.value?(x(),E("div",Y_e,R(C(n)("settings.archivedLoadingAll")),1)):j.value.length>0?(x(!0),E(Pe,{key:1},lt(j.value,ee=>(x(),E("div",{key:ee.id,class:"arch-row"},[_("div",Z_e,[_("div",X_e,R(ee.title),1),_("div",Q_e,R(C(n)("settings.archivedAt",{time:ie(ee.updatedAt)})),1)]),fe(jt,{variant:"secondary",size:"sm",onClick:le=>Z(ee.id)},{default:Le(()=>[nt(R(C(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128)):(x(),E("div",J_e,R(N.value.length===0?C(n)("settings.archivedEmpty"):C(n)("settings.archivedNoMatch")),1))],64))]),_:1},8,["model-value","title"]))}}),nSe=ft(tSe,[["__scopeId","data-v-32378dfd"]]),oSe={class:"ob-brand"},sSe={class:"ob-brand-text"},iSe={class:"ob-title"},rSe={class:"ob-sub"},lSe={class:"ob-sec"},aSe={class:"ob-label"},cSe={class:"ob-sec"},uSe={class:"ob-label"},dSe={class:"ob-sec"},fSe={class:"ob-label"},hSe=Qe({__name:"Onboarding",emits:["complete","skip"],setup(e,{emit:t}){const n=t,{t:o,locale:s}=Ot(),{colorScheme:i,accent:r,setColorScheme:l,setAccent:a}=QE();function c(d){s.value!==d&&f6(d)}function u(){n("complete")}return(d,f)=>(x(),Ae(Qr,{open:!0,size:"md","close-on-overlay":!1,"close-on-esc":!1,onClose:f[3]||(f[3]=h=>n("skip"))},{head:Le(()=>[_("div",oSe,[f[4]||(f[4]=_("svg",{class:"ob-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Dimi"},[_("defs",null,[_("mask",{id:"obDimiEyes",maskUnits:"userSpaceOnUse"},[_("rect",{x:"0",y:"0",width:"32",height:"22",fill:"#fff"}),_("g",{class:"ob-eyes",fill:"#000"},[_("rect",{class:"ob-eye",x:"11.8",y:"7",width:"2.8",height:"8",rx:"1.4"}),_("rect",{class:"ob-eye",x:"17.4",y:"7",width:"2.8",height:"8",rx:"1.4"})])])]),_("rect",{x:"1",y:"1",width:"30",height:"20",rx:"6",fill:"var(--color-accent)",mask:"url(#obDimiEyes)"})],-1)),_("div",sSe,[_("div",iSe,R(C(o)("onboarding.title")),1),_("div",rSe,R(C(o)("onboarding.subtitle")),1)])])]),default:Le(()=>[_("section",lSe,[_("div",aSe,R(C(o)("onboarding.languageLabel")),1),fe(ms,{"model-value":C(s),options:C(d6).map(h=>({value:h.code,label:h.label})),"onUpdate:modelValue":f[0]||(f[0]=h=>c(h))},null,8,["model-value","options"])]),_("section",cSe,[_("div",uSe,R(C(o)("theme.colorSchemeLabel")),1),fe(ms,{"model-value":C(i),options:[{value:"light",label:C(o)("theme.light")},{value:"dark",label:C(o)("theme.dark")},{value:"system",label:C(o)("theme.system")}],"onUpdate:modelValue":f[1]||(f[1]=h=>C(l)(h))},null,8,["model-value","options"])]),_("section",dSe,[_("div",fSe,R(C(o)("theme.accentLabel")),1),fe(ms,{"model-value":C(r),options:[{value:"blue",label:C(o)("theme.accentBlue")},{value:"mono",label:C(o)("theme.accentBlack")}],"onUpdate:modelValue":f[2]||(f[2]=h=>C(a)(h))},null,8,["model-value","options"])]),fe(jt,{variant:"primary",size:"lg",class:"ob-start",onClick:u},{default:Le(()=>[nt(R(C(o)("onboarding.start")),1)]),_:1})]),_:1}))}}),pSe=ft(hSe,[["__scopeId","data-v-b9bc9f52"]]),mSe=["aria-label"],gSe={class:"gload-box"},vSe={class:"gload-text"},ySe={key:0,class:"gload-issue"},kSe={class:"gload-issue-detail"},bSe=Qe({__name:"GlobalLoading",props:{issue:{}},setup(e){const{t}=Ot();return(n,o)=>(x(),E("div",{class:"gload",role:"status","aria-label":C(t)("app.connecting")},[_("div",gSe,[o[0]||(o[0]=Bk('<svg class="gload-logo" viewBox="0 0 96 32" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" data-v-b07a6ece><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-b07a6ece></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-b07a6ece></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-b07a6ece></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-b07a6ece></path></svg>',1)),fe(Hs,{size:"md",label:C(t)("app.connecting")},null,8,["label"]),_("div",vSe,R(C(t)("app.connecting")),1),e.issue?(x(),E("div",ySe,[_("div",null,R(C(t)("app.connectRetrying")),1),_("div",kSe,R(e.issue),1)])):ue("",!0)])],8,mSe))}}),xSe=ft(bSe,[["__scopeId","data-v-b07a6ece"]]),wSe={class:"kap-root"},_Se={class:"kap-head"},SSe={class:"kap-count"},CSe={class:"kap-head-actions"},ASe={class:"kap-filters"},MSe=["value"],ESe={class:"kap-check"},TSe={class:"kap-check"},NSe={class:"kap-view-toggle",role:"group"},ISe={key:0,class:"kap-empty"},LSe=["onClick"],$Se={class:"kap-ts"},FSe={class:"kap-label"},OSe={key:0,class:"kap-detail"},RSe={class:"kap-detail-actions"},BSe=["onClick"],DSe={key:1,class:"kap-agg"},PSe={class:"mono"},HSe={class:"mono"},WSe={class:"num"},zSe={class:"num"},USe={key:0},qSe={class:"mono"},jSe={class:"num"},VSe={class:"num"},KSe={key:0},GSe=Qe({__name:"KapDebugView",emits:["close"],setup(e,{emit:t}){const n=t,o=ne("all"),s=ne(""),i=ne(""),r=ne(!1),l=ne("timeline"),a=D(()=>(K2.value,[...xie()])),c=D(()=>{const $=new Set;for(const N of a.value)N.sessionId&&$.add(N.sessionId);return[...$].sort()});function u($){return $.kind==="rest:error"||$.code!==void 0&&$.code!==0||$.eventType==="error"||$.eventType==="parse-error"}const d=D(()=>{const $=s.value.trim().toLowerCase();return a.value.filter(N=>!(o.value!=="all"&&N.source!==o.value||i.value&&N.sessionId!==i.value||r.value&&!u(N)||$&&!`${N.label} ${N.kind} ${N.eventType??""} ${N.sessionId??""} ${N.requestId??""}`.toLowerCase().includes($)))}),f=D(()=>{const $=new Map;for(const N of d.value){if(N.kind!=="ws:in"&&N.kind!=="ws:out")continue;const F=N.kind==="ws:in"?"←":"→",S=`${F} ${N.eventType??"?"} @ ${N.sessionId??"-"}`,B=$.get(S)??{key:S,sessionId:N.sessionId??"-",eventType:N.eventType??"?",dir:F,count:0};B.count++,N.seq!==void 0&&(B.lastSeq=N.seq),$.set(S,B)}return[...$.values()].sort((N,F)=>F.count-N.count)}),h=D(()=>{const $=new Map;for(const N of d.value){if(N.source!=="rest"||N.kind==="rest:request")continue;const F=`${N.method??"?"} ${N.path??"?"}`,S=$.get(F)??{count:0,errors:0,totalMs:0,timed:0};S.count++,u(N)&&S.errors++,N.durationMs!==void 0&&(S.totalMs+=N.durationMs,S.timed++),$.set(F,S)}return[...$.entries()].map(([N,F])=>({key:N,count:F.count,errors:F.errors,avgMs:F.timed>0?Math.round(F.totalMs/F.timed):0})).sort((N,F)=>F.count-N.count)}),p=ne(null),m=ne(!0),y=ne(null),k=ne(null);et(()=>d.value.length,async()=>{if(!m.value||l.value!=="timeline")return;await kt();const $=y.value;$&&($.scrollTop=$.scrollHeight)});function g($){p.value=p.value===$?null:$}function v($){const N=new Date($),F=(S,B=2)=>String(S).padStart(B,"0");return`${F(N.getHours())}:${F(N.getMinutes())}:${F(N.getSeconds())}.${F(N.getMilliseconds(),3)}`}function b($){return JSON.stringify($,null,2)}async function A($){await Xo(b($))&&(k.value=$.id,setTimeout(()=>{k.value===$.id&&(k.value=null)},1500))}function I(){_E(d.value)}function T($){return u($)||$.source==="client"?"b-err":$.source==="rest"?"b-rest":$.kind==="ws:lifecycle"?"b-life":$.kind==="ws:out"?"b-out":"b-in"}function M($){return $.source==="rest"?"REST":$.source==="client"?"APP":"WS"}return($,N)=>(x(),E("section",wSe,[_("header",_Se,[N[11]||(N[11]=_("strong",null,"KAP debug",-1)),_("span",SSe,R(d.value.length)+"/"+R(a.value.length),1),_("div",CSe,[_("button",{type:"button",class:We({on:C(Md)}),onClick:N[0]||(N[0]=F=>Md.value=!C(Md))},R(C(Md)?"resume":"pause"),3),_("button",{type:"button",onClick:N[1]||(N[1]=F=>C(wie)())},"clear"),_("button",{type:"button",onClick:N[2]||(N[2]=F=>I())},"export jsonl"),fe(rn,{text:"Close window"},{default:Le(()=>[_("button",{type:"button",onClick:N[3]||(N[3]=F=>n("close"))},"✕")]),_:1})])]),_("div",ASe,[Wn(_("select",{"onUpdate:modelValue":N[4]||(N[4]=F=>o.value=F),"aria-label":"Source filter"},[...N[12]||(N[12]=[_("option",{value:"all"},"rest + ws + app",-1),_("option",{value:"rest"},"rest",-1),_("option",{value:"ws"},"ws",-1),_("option",{value:"client"},"app errors",-1)])],512),[[iy,o.value]]),Wn(_("select",{"onUpdate:modelValue":N[5]||(N[5]=F=>i.value=F),"aria-label":"Session filter"},[N[13]||(N[13]=_("option",{value:""},"all sessions",-1)),(x(!0),E(Pe,null,lt(c.value,F=>(x(),E("option",{key:F,value:F},R(F),9,MSe))),128))],512),[[iy,i.value]]),Wn(_("input",{"onUpdate:modelValue":N[6]||(N[6]=F=>s.value=F),type:"text",placeholder:"filter (type / path / id)","aria-label":"Text filter"},null,512),[[ws,s.value]]),_("label",ESe,[Wn(_("input",{"onUpdate:modelValue":N[7]||(N[7]=F=>r.value=F),type:"checkbox"},null,512),[[om,r.value]]),N[14]||(N[14]=nt(" errors",-1))]),_("label",TSe,[Wn(_("input",{"onUpdate:modelValue":N[8]||(N[8]=F=>m.value=F),type:"checkbox"},null,512),[[om,m.value]]),N[15]||(N[15]=nt(" follow",-1))]),_("div",NSe,[_("button",{type:"button",class:We({on:l.value==="timeline"}),onClick:N[9]||(N[9]=F=>l.value="timeline")},"timeline",2),_("button",{type:"button",class:We({on:l.value==="aggregate"}),onClick:N[10]||(N[10]=F=>l.value="aggregate")},"aggregate",2)])]),l.value==="timeline"?(x(),E("div",{key:0,ref_key:"listRef",ref:y,class:"kap-list"},[d.value.length===0?(x(),E("div",ISe," No trace entries yet. REST calls and WS frames will appear here. ")):ue("",!0),(x(!0),E(Pe,null,lt(d.value,F=>(x(),E("div",{key:F.id,class:"kap-row-wrap"},[_("button",{type:"button",class:We(["kap-row",{expanded:p.value===F.id}]),onClick:S=>g(F.id)},[_("span",$Se,R(v(F.ts)),1),_("span",{class:We(["kap-badge",T(F)])},R(M(F)),3),_("span",FSe,R(F.label),1)],10,LSe),p.value===F.id?(x(),E("div",OSe,[_("div",RSe,[_("button",{type:"button",onClick:S=>A(F)},R(k.value===F.id?"copied ✓":"copy json"),9,BSe)]),_("pre",null,R(b(F)),1)])):ue("",!0)]))),128))],512)):(x(),E("div",DSe,[N[20]||(N[20]=_("h4",null,"WS frames by session / type",-1)),_("table",null,[N[17]||(N[17]=_("thead",null,[_("tr",null,[_("th",null,"dir"),_("th",null,"type"),_("th",null,"session"),_("th",null,"count"),_("th",null,"last seq")])],-1)),_("tbody",null,[(x(!0),E(Pe,null,lt(f.value,F=>(x(),E("tr",{key:F.key},[_("td",null,R(F.dir),1),_("td",PSe,R(F.eventType),1),_("td",HSe,R(F.sessionId),1),_("td",WSe,R(F.count),1),_("td",zSe,R(F.lastSeq??"—"),1)]))),128)),f.value.length===0?(x(),E("tr",USe,[...N[16]||(N[16]=[_("td",{colspan:"5",class:"kap-empty"},"no ws frames",-1)])])):ue("",!0)])]),N[21]||(N[21]=_("h4",null,"REST by endpoint",-1)),_("table",null,[N[19]||(N[19]=_("thead",null,[_("tr",null,[_("th",null,"endpoint"),_("th",null,"count"),_("th",null,"errors"),_("th",null,"avg ms")])],-1)),_("tbody",null,[(x(!0),E(Pe,null,lt(h.value,F=>(x(),E("tr",{key:F.key},[_("td",qSe,R(F.key),1),_("td",jSe,R(F.count),1),_("td",{class:We(["num",{err:F.errors>0}])},R(F.errors),3),_("td",VSe,R(F.avgMs),1)]))),128)),h.value.length===0?(x(),E("tr",KSe,[...N[18]||(N[18]=[_("td",{colspan:"4",class:"kap-empty"},"no rest calls",-1)])])):ue("",!0)])])]))]))}}),YSe=ft(GSe,[["__scopeId","data-v-a3d2c406"]]),ZSe=Qe({__name:"DebugPanel",setup(e){const t=ne(!1);let n=null,o=null,s=null;const i=["data-color-scheme","data-accent"];function r(u){const d=document.documentElement,f=u.documentElement;for(const h of i){const p=d.getAttribute(h);p!==null?f.setAttribute(h,p):f.removeAttribute(h)}}function l(u){const d=u.document;d.title="KAP debug";const f=d.createElement("base");f.href=location.href,d.head.appendChild(f);for(const p of Array.from(document.querySelectorAll('style, link[rel="stylesheet"]')))d.head.appendChild(p.cloneNode(!0));r(d),d.body.style.margin="0";const h=d.createElement("div");return h.style.height="100vh",d.body.appendChild(h),h}function a(){s?.disconnect(),s=null;try{o?.unmount()}catch{}o=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),f=sm(YSe,{onClose:()=>u.close()});f.mount(d),o=f,t.value=!0,s=new MutationObserver(()=>{n&&!n.closed&&r(n.document)}),s.observe(document.documentElement,{attributes:!0,attributeFilter:[...i]}),u.addEventListener("pagehide",a),u.addEventListener("beforeunload",a)}return wn(()=>{c()}),so(()=>{n&&!n.closed&&n.close(),a()}),(u,d)=>(x(),Ae(rn,{text:t.value?"Focus KAP debug window":"Open KAP debug window"},{default:Le(()=>[_("button",{class:"kap-fab",type:"button",onClick:c}," KAP ")]),_:1},8,["text"]))}}),XSe=ft(ZSe,[["__scopeId","data-v-b4944171"]]);function QSe({client:e,authLogoRef:t}){const n=D(()=>e.authReady.value),o=D(()=>e.initialized.value&&!n.value),s="/login",i=ne(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)}et(o,u=>{if(!(typeof window>"u")){if(u){window.location.pathname!==s&&(i.value=l(),a(s));return}window.location.pathname===s&&(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 In(()=>{r!==null&&clearTimeout(r)}),{showAuthGate:o,blinkAuthLogo:c}}function JSe({running:e,showAuthGate:t}){const{t:n}=Ot(),o=["◐","◓","◑","◒"],s=ne(0);let i=null;function r(){i===null&&(s.value=0,i=setInterval(()=>{s.value=(s.value+1)%o.length},250))}function l(){i!==null&&(clearInterval(i),i=null),s.value=0}et(e,c=>{c?r():l()},{immediate:!0});const a=D(()=>{const c=e.value?`${o[s.value]} `:"";return t.value?`${c}${n("app.authPageTitle")} - Dimi Web`:`${c}Dimi Web`});TA(()=>{typeof document<"u"&&(document.title=a.value)}),In(()=>{l()})}const WT=ne(typeof window>"u"?0:window.innerWidth);let pp=0,t1=!1;function yk(){WT.value=window.innerWidth}function eCe(){t1||typeof window>"u"||(window.addEventListener("resize",yk),t1=!0,yk())}function tCe(){!t1||typeof window>"u"||(window.removeEventListener("resize",yk),t1=!1)}function zT(e,t,n){return Math.max(t,e-n)}function kk(e,t,n){return Math.min(n,Math.max(t,e))}function UT(){return wn(()=>{pp+=1,eCe()}),so(()=>{pp=Math.max(0,pp-1),pp===0&&tCe()}),{viewportWidth:WT}}const nCe="dimi-web.file-preview-width",Wc=320;function oCe({client:e,sideWidth:t,detailTarget:n,closeFilePreview:o}){const{viewportWidth:s}=UT(),i=D(()=>Math.max(0,s.value-t.value)),r=D(()=>zT(i.value,Wc,Wc));function l(Q){return kk(Math.round(Q),Wc,r.value)}function a(){return l(i.value/2)}const c=D(()=>a()),u=ne(c.value),d=D(()=>kk(u.value,Wc,r.value)),f=ne(null),h=D(()=>{const Q=f.value;if(!Q)return null;const G=e.turns.value.find(pe=>pe.id===Q.turnId)?.blocks?.[Q.blockIndex];return G?.kind==="thinking"?G.thinking:null}),p=D(()=>h.value!==null);function m(Q){const P=f.value;if(P&&P.turnId===Q.turnId&&P.blockIndex===Q.blockIndex){f.value=null,n.value==="thinking"&&(n.value=null);return}n.value="thinking",f.value=Q}function y(){f.value=null,n.value==="thinking"&&(n.value=null)}const k=ne(null),g=D(()=>{const Q=k.value;if(!Q)return null;const P=e.turns.value.find(G=>G.id===Q.turnId);return P?.role==="compaction"&&P.text?P.text:null}),v=D(()=>g.value!==null);function b(Q){if(k.value?.turnId===Q.turnId){k.value=null,n.value==="compaction"&&(n.value=null);return}n.value="compaction",k.value=Q}function A(){k.value=null,n.value==="compaction"&&(n.value=null)}const I=ne(null);function T(Q){const P=e.activeAppTasks.value,G=P.find(ve=>ve.id===Q)??P.find(ve=>ve.parentToolCallId===Q);if(G)return G.id;const pe=P.filter(ve=>ve.kind==="subagent"&&!ve.parentToolCallId);if(pe.length===1)return pe[0].id}const M=D(()=>{const Q=I.value;if(!Q)return null;const P=e.activeAppTasks.value.find(G=>G.id===Q.subagentId);return P?Ove(P):null}),$=D(()=>M.value!==null);function N(Q){const P=T(Q);if(P){if(I.value?.subagentId===P){I.value=null,n.value==="agent"&&(n.value=null);return}I.value={subagentId:P},n.value="agent"}}function F(){I.value=null,n.value==="agent"&&(n.value=null)}const S=ne(null),B=D(()=>{const Q=S.value;if(!Q)return null;const P=Iz(e.turns.value,Q);return P?{id:Q,title:ec(P.name),path:Nz(P.arg),lines:P.status==="error"?null:m6(P),output:P.output}:null}),W=D(()=>B.value!==null);function z(Q){if(n.value==="toolDiff"&&S.value===Q){L();return}n.value="toolDiff",S.value=Q}function L(){S.value=null,n.value==="toolDiff"&&(n.value=null)}const O=ne("list"),j=ne(null);function Z(){if(n.value==="diff"){ie();return}n.value="diff",O.value="list",j.value=null,e.loadGitStatus(e.activeSessionId.value)}function ie(){n.value==="diff"&&(n.value=null),O.value="list",j.value=null,e.clearFileDiff()}async function U(Q){O.value="detail",j.value=Q,await e.loadFileDiff(Q)}async function q(Q){!e.activeSessionId.value&&e.activeWorkspaceId.value?await e.startSessionAndOpenSideChat(e.activeWorkspaceId.value,Q):await e.openSideChat(Q),n.value="btw"}function ee(){e.closeSideChat(),n.value==="btw"&&(n.value=null)}function le(){n.value==="btw"&&(n.value=null)}const oe=D(()=>e.sideChatVisible.value),re=D(()=>n.value!==null&&(n.value!=="thinking"||p.value)&&(n.value!=="compaction"||v.value)&&(n.value!=="agent"||$.value)&&(n.value!=="toolDiff"||W.value)&&(n.value!=="btw"||oe.value)),we=ne(!1),me=ne({});function Ee(){switch(n.value){case"thinking":return f.value?{kind:"thinking",...f.value}:null;case"compaction":return k.value?{kind:"compaction",...k.value}:null;case"agent":return I.value?{kind:"agent",...I.value}:null;case"toolDiff":return S.value?{kind:"toolDiff",toolId:S.value}:null;case"btw":return{kind:"btw"};default:return null}}function ae(Q){if(Q)switch(Q.kind){case"thinking":f.value={turnId:Q.turnId,blockIndex:Q.blockIndex},n.value="thinking";break;case"compaction":k.value={turnId:Q.turnId},n.value="compaction";break;case"agent":I.value={subagentId:Q.subagentId},n.value="agent";break;case"toolDiff":S.value=Q.toolId,n.value="toolDiff";break;case"btw":e.sideChatVisible.value&&(n.value="btw");break}}function Y(){return n.value==="thinking"&&p.value?(y(),!0):n.value==="compaction"&&v.value?(A(),!0):n.value==="agent"&&$.value?(F(),!0):n.value==="toolDiff"&&W.value?(L(),!0):n.value==="file"?(o(),!0):n.value==="diff"?(ie(),!0):n.value==="btw"?(ee(),!0):!1}return et(e.activeSessionId,(Q,P)=>{if(P){const G=Ee();G?me.value[P]=G:delete me.value[P]}o(),y(),A(),F(),L(),ie(),le(),Q&&ae(me.value[Q])}),{PREVIEW_WIDTH_KEY:nCe,PREVIEW_MIN:Wc,previewDefaultWidth:c,previewMax:r,previewWidth:u,previewPanelWidth:d,thinkingPanelText:h,thinkingVisible:p,openThinkingPanel:m,closeThinkingPanel:y,compactionPanelText:g,compactionPanelVisible:v,openCompactionPanel:b,closeCompactionPanel:A,agentPanelMember:M,agentPanelVisible:$,openAgentPanel:N,closeAgentPanel:F,toolDiffTarget:B,toolDiffVisible:W,openToolDiff:z,closeToolDiff:L,detailDiffMode:O,detailDiffPath:j,openDiffDetail:Z,closeDiffDetail:ie,selectDiffFile:U,btwVisible:oe,openSideChatTab:q,closeSideChat:ee,hideSideChatPanel:le,sidePanelVisible:re,panelDragging:we,closeOpenSidePanel:Y}}const sCe=Ht.sidebarWidth,Z3=Ht.sidebarCollapsed,X3=270,Hv=170,iCe=480,rCe=320;function lCe(e={}){const{viewportWidth:t}=UT(),n=ne(X3),o=ne(!1),s=ne(!1),i=D(()=>{const u=rCe+(xA(e.previewOpen)?Wc:0);return Math.min(iCe,zT(t.value,Hv,u))}),r=D(()=>kk(n.value,Hv,i.value));function l(){try{o.value=uo(Z3)==="true"}catch{o.value=!1}}function a(){try{xo(Z3,String(o.value))}catch{}}function c(){o.value=!o.value,a()}return{SIDEBAR_WIDTH_KEY:sCe,SIDEBAR_DEFAULT:X3,SIDEBAR_MIN:Hv,sidebarMax:i,sessionColWidth:n,sidebarCollapsed:o,sidebarDragging:s,sideWidth:r,loadSidebarCollapsed:l,toggleSidebarCollapse:c}}function aCe(e){return/^(?:https?:|blob:|data:)/i.test(e)}function cCe({client:e,detailTarget:t}){const{t:n}=Ot(),o=ne(null),s=ne(null),i=ne(!1),r=ne(null),l=ne(null);let a=0,c=null;function u(){c!==null&&(URL.revokeObjectURL(c),c=null)}const d=D(()=>{const T=l.value;return T?e.getFileDownloadUrl(T):null}),f=D(()=>o.value!==null);function h(T){return T.length>1?T.replace(/\/+$/,""):T}function p(T){const M=[];for(const $ of T.split(/[\\/]+/))if(!(!$||$===".")){if($===".."){M.pop();continue}M.push($)}return M.join("/")}function m(T){const M=T.trim();if(!M)return{error:n("filePreview.errors.emptyPath")};if(/^[a-z][a-z0-9+.-]*:\/\//i.test(M))return{error:n("filePreview.errors.unsupportedPath")};if(M.startsWith("~"))return{error:n("filePreview.errors.outsideWorkspace")};const $=h(e.status.value.cwd);if(M.startsWith("/")){if(!$||M!==$&&!M.startsWith(`${$}/`))return{error:n("filePreview.errors.outsideWorkspace")};const F=M===$?"":M.slice($.length+1);if(F.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const S=p(F);return S?{path:S}:{error:n("filePreview.errors.isDirectory")}}if(M.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const N=p(M);return N?{path:N}:{error:n("filePreview.errors.emptyPath")}}async function y(T){const M=o.value;if(t.value==="file"&&M&&M.path===T.path&&M.line===T.line){b();return}const $=++a;u(),t.value="file",s.value=null,r.value=null,i.value=!0,o.value=T,l.value=null;const N=m(T.path);if("error"in N){i.value=!1,r.value=N.error;return}l.value=N.path;try{const F=await e.readFileContent(N.path);if($!==a)return;F?s.value={...F,path:F.path||N.path}:r.value=n("filePreview.errors.loadFailed")}catch(F){if($!==a)return;r.value=F instanceof Error?F.message:n("filePreview.errors.loadFailed")}finally{$===a&&(i.value=!1)}}function k(T){return/^data:([^;,]+)/i.exec(T)?.[1]}function g(T){if(T.kind!=="image"&&T.kind!=="video")return;const M=++a;u(),t.value="file",o.value=null,l.value=null,r.value=null;const $=T.kind==="video",N={path:T.path??($?"Video":"ReadMediaFile image"),content:"",encoding:"utf-8",mime:T.mimeType??k(T.url)??($?"video/*":"image/*"),isBinary:!0,size:T.bytes??0};T.fileId?(i.value=!0,s.value=N,pt().getFileBlob(T.fileId).then(F=>{if(M===a){if(t.value!=="file"||!s.value){i.value=!1;return}c=URL.createObjectURL(F),s.value={...s.value,sourceUrl:c},i.value=!1}}).catch(()=>{M===a&&(s.value&&(s.value={...s.value,sourceUrl:T.url}),i.value=!1)})):(i.value=!1,s.value=aCe(T.url)?{...N,sourceUrl:T.url}:N)}function v(){a+=1,o.value=null,l.value=null,s.value=null,r.value=null,i.value=!1,u()}function b(){v(),t.value==="file"&&(t.value=null)}et(t,(T,M)=>{M==="file"&&T!=="file"&&v()});function A(){const T=s.value?.path??o.value?.path;T&&e.openWorkspaceFile(T,o.value?.line)}function I(){const T=s.value?.path??o.value?.path;T&&e.revealWorkspaceFile(T)}return{previewTarget:o,previewFile:s,previewLoading:i,previewError:r,previewDownloadUrl:d,previewExternalActions:f,openFilePreview:y,openMediaPreview:g,closeFilePreview:b,openPreviewInEditor:A,revealPreviewFile:I}}const uCe=640,dCe=`(max-width: ${uCe}px)`;function fCe(){const e=ne(!1);if(typeof window>"u"||typeof window.matchMedia!="function")return e;const t=window.matchMedia(dCe);e.value=t.matches;const n=o=>{e.value=o.matches};return typeof t.addEventListener=="function"?(t.addEventListener("change",n),In(()=>t.removeEventListener("change",n))):typeof t.addListener=="function"&&(t.addListener(n),In(()=>t.removeListener(n))),e}const hCe={class:"server-auth-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"server-auth-title"},pCe={class:"server-auth-card"},mCe={class:"server-auth-body"},gCe={class:"server-auth-foot"},vCe=Qe({__name:"ServerAuthDialog",setup(e){const t=ne(""),n=ne(null),o=ne(!1);wn(()=>{kt(()=>n.value?.focus())});function s(){const r=t.value;!r||o.value||(o.value=!0,TE(r),window.location.reload())}function i(r){r.key==="Enter"&&(r.preventDefault(),s())}return(r,l)=>(x(),E("div",hCe,[_("div",pCe,[l[1]||(l[1]=_("div",{class:"server-auth-head"},[_("h1",{id:"server-auth-title",class:"server-auth-title"},"Server token required"),_("p",{class:"server-auth-hint"},[nt(" This server is protected. Enter the bearer token printed when the server started (or the password set via "),_("code",null,"DIMI_CODE_PASSWORD"),nt("). ")])],-1)),_("div",mCe,[fe(t0,{ref_key:"inputRef",ref:n,modelValue:t.value,"onUpdate:modelValue":l[0]||(l[0]=a=>t.value=a),type:"password",autocomplete:"current-password",placeholder:"Token",disabled:o.value,onKeydown:i},null,8,["modelValue","disabled"])]),_("div",gCe,[fe(jt,{variant:"primary",disabled:!t.value||o.value,loading:o.value,onClick:s},{default:Le(()=>[nt(R(o.value?"Connecting…":"Connect"),1)]),_:1},8,["disabled","loading"])])])]))}}),yCe=ft(vCe,[["__scopeId","data-v-1b085c63"]]),kCe=["aria-label"],bCe=Qe({__name:"InternalBuildBanner",setup(e){const{t}=Ot(),n=eH;return(o,s)=>C(n)?(x(),E("span",{key:0,class:"internal-build-tag",role:"note","aria-label":C(t)("app.internalBuildBanner")},[s[0]||(s[0]=_("svg",{viewBox:"0 0 16 16",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[_("path",{d:"M8 2 14 13H2L8 2Z"}),_("path",{d:"M8 6v3.5"}),_("path",{d:"M8 11.5h.01"})],-1)),_("span",null,R(C(t)("app.internalBuildBanner")),1)],8,kCe)):ue("",!0)}}),xCe=ft(bCe,[["__scopeId","data-v-06693836"]]),wCe={class:"app-shell"},_Ce={key:1,class:"auth-page"},SCe={class:"auth-page-inner"},CCe={class:"auth-page-copy"},ACe=["aria-label","aria-hidden"],MCe=Qe({__name:"App",setup(e){hre();const t=ne(!1);let n=null;const o=Ib(),s=D(()=>!o.dangerousBypassAuth.value&&t.value);En("resolveImage",o.resolveImageUrl),En("resolveSwarmMembers",De=>o.swarmMembersByToolCallId.value.get(De)??[]);const{t:i}=Ot(),{confirm:r}=zf(),l=Yi(),a=fCe(),c=ne(!1),u=ne(!1),d=D(()=>{const De=o.activeSessionId.value;return o.sessions.value.find(ge=>ge.id===De)?.title??""}),f=D(()=>o.visibleWorkspace.value?.sessionCount??0),h=D(()=>o.activity.value!=="idle"),p=ne(null),{showAuthGate:m,blinkAuthLogo:y}=QSe({client:o,authLogoRef:p});JSe({running:h,showAuthGate:m});function k(De){const ge=o.models.value.find(Dt=>Dt.id===o.status.value.modelId),K=e0(ge),xe=K.indexOf(jm(ge,De)),He=K[(xe+1)%K.length]??K[0]??"off";return ib(ge,He)}const g=D(()=>{const De=o.models.value.find(ge=>ge.id===o.status.value.modelId);return jm(De,o.thinking.value)}),v=ne(!o.onboarded.value);function b(){o.setOnboarded(!0),v.value=!1}function A(){v.value=!0}let I=0;function T(){const De=window.visualViewport,ge=document.documentElement.style;ge.setProperty("--app-height",`${De?.height??window.innerHeight}px`),ge.setProperty("--app-top",`${De?.offsetTop??0}px`)}function M(){I||(I=requestAnimationFrame(()=>{I=0,T()}))}wn(()=>{n=gre(()=>{t.value=!0,o.clearDangerousBypassAuth()}),o.load(),Q(),T(),window.visualViewport?.addEventListener("resize",M),window.visualViewport?.addEventListener("scroll",M),window.addEventListener("resize",M),document.addEventListener("keydown",$,!0)}),In(()=>{document.removeEventListener("keydown",$,!0),window.visualViewport?.removeEventListener("resize",M),window.visualViewport?.removeEventListener("scroll",M),window.removeEventListener("resize",M),I&&(cancelAnimationFrame(I),I=0),document.documentElement.style.removeProperty("--app-height"),document.documentElement.style.removeProperty("--app-top"),n!==null&&(n(),n=null)});function $(De){De.key==="Escape"&&(li.value||Kt()&&(De.stopPropagation(),De.preventDefault()))}const N=ne(null),F=ne(!1);et(o.activeSessionId,()=>{F.value=!0,kt(()=>{F.value=!1})});const{previewTarget:S,previewFile:B,previewLoading:W,previewError:z,previewDownloadUrl:L,previewExternalActions:O,openFilePreview:j,openMediaPreview:Z,closeFilePreview:ie,openPreviewInEditor:U,revealPreviewFile:q}=cCe({client:o,detailTarget:N}),ee=D(()=>N.value!==null),{SIDEBAR_WIDTH_KEY:le,SIDEBAR_DEFAULT:oe,SIDEBAR_MIN:re,sidebarMax:we,sessionColWidth:me,sidebarCollapsed:Ee,sidebarDragging:ae,sideWidth:Y,loadSidebarCollapsed:Q,toggleSidebarCollapse:P}=lCe({previewOpen:ee}),{PREVIEW_WIDTH_KEY:G,PREVIEW_MIN:pe,previewDefaultWidth:ve,previewMax:de,previewWidth:V,previewPanelWidth:se,thinkingPanelText:he,thinkingVisible:ke,openThinkingPanel:Te,closeThinkingPanel:ze,compactionPanelText:ye,compactionPanelVisible:be,openCompactionPanel:Ge,closeCompactionPanel:tt,agentPanelMember:rt,openAgentPanel:ut,closeAgentPanel:vt,toolDiffTarget:Nt,openToolDiff:_t,closeToolDiff:Rt,detailDiffMode:ln,detailDiffPath:Ln,openDiffDetail:Wt,closeDiffDetail:un,selectDiffFile:vn,btwVisible:Xt,openSideChatTab:An,closeSideChat:Je,sidePanelVisible:Ve,panelDragging:It,closeOpenSidePanel:Kt}=oCe({client:o,sideWidth:Y,detailTarget:N,closeFilePreview:ie}),Gt=ne(null),Sn=ne(!1),mt=ne(!1),Rn=ne(!1),dn=ne(null),nn=ne(!1),fn=ne(!1),Po=ne(!1),Ho=ne(null),dt=ne(null),li=D(()=>Rc.value>0||Sn.value||mt.value||Rn.value||nn.value||fn.value||Po.value||v.value||c.value||u.value),_s=ne(!1),Eo=ne(!1),_o=ne(!1),Un=ne(!1),To=ne(!1);async function lo(){_s.value=!0,Eo.value=!1,Sn.value=!0;try{await o.refreshAllProviders()}catch{Eo.value=!0}finally{_s.value=!1}}async function Wo(){_o.value=!0,Un.value=!1,mt.value=!0;try{await o.loadProviders()}catch{Un.value=!0}finally{_o.value=!1}}function Ss(De){dn.value=De,Rn.value=!0}async function So(De){Sn.value=!1,await Ws(De)}async function Ws(De){await o.setModel(De)&&De!==o.defaultModel.value&&o.updateConfig({defaultModel:De})}async function zo(De){await o.loginProviderApiKey(De.providerId,De.value)&&(mt.value=!1,await o.checkAuth(),await o.load())}async function ai(De){await o.refreshProvider(De)}async function Qo(De){await r({title:i("sidebar.archive"),message:i("sidebar.archiveConfirm"),variant:"danger",action:()=>o.archiveSession(De)})}async function No(De){const ge=o.workspacesView.value.find(K=>K.id===De)?.name??De;await r({title:i("sidebar.removeWorkspace"),message:i("workspace.removeWorkspaceConfirm",{name:ge}),variant:"danger",action:()=>o.deleteWorkspace(De)})}async function Io(De){const ge=o.providers.value.find(K=>K.id===De)?.name??De;await r({title:i("providers.logout"),message:i("providers.logoutTitle",{type:ge}),variant:"danger",action:()=>o.logoutProvider(De)})}async function ci(De){To.value=!0;try{await o.updateConfig(De)&&await o.checkAuth()}finally{To.value=!1}}async function en(){return dn.value===null?null:o.startOAuthLogin(dn.value)}async function zs(){return dn.value===null?null:o.pollOAuthLogin(dn.value)}async function Xn(){dn.value!==null&&await o.cancelOAuthLogin(dn.value)}async function Us(){Rn.value=!1,dn.value=null,await o.checkAuth(),await o.load()}async function ui(De){await o.undo(1),await kt(),Gt.value?.loadComposerForEdit(De.text,De.attachments)}function Ni(De){if(De==="/compact"||De.startsWith("/compact ")){o.compact(De.slice(8).trim()||void 0);return}if(De==="/swarm"||De.startsWith("/swarm ")){const ge=De.slice(6).trim();ge==="on"?o.setSwarmMode(!0):ge==="off"?o.setSwarmMode(!1):ge?(o.setSwarmMode(!0),o.sendPrompt(ge)):o.toggleSwarmMode();return}if(De==="/goal"||De.startsWith("/goal ")){const ge=De.slice(5).trim();ge==="pause"||ge==="resume"||ge==="cancel"?o.controlGoal(ge):ge?o.createGoal(ge):o.toggleGoalMode();return}if(De==="/btw"||De.startsWith("/btw ")){const ge=De.slice(4).trim();!ge&&o.sideChatVisible.value?Je():An(ge||void 0);return}switch(De){case"/new":case"/clear":fi();break;case"/fork":o.forkSession();break;case"/export":o.exportSession();break;case"/undo":o.undo();break;case"/plan":o.togglePlanMode();break;case"/auto":o.setPermission("auto");break;case"/yolo":o.setPermission("yolo");break;case"/thinking":o.setThinking(k(o.thinking.value));break;case"/status":fn.value=!0;break;case"/login":Wo();break;default:{const ge=De.indexOf(" "),K=Xce((ge===-1?De:De.slice(0,ge)).slice(1)),xe=ge===-1?void 0:De.slice(ge+1).trim()||void 0;if(!K)break;!o.activeSessionId.value&&o.activeWorkspaceId.value?o.startSessionAndActivateSkill(o.activeWorkspaceId.value,K,xe):o.activateSkill(K,xe);break}}}function di(De){o.unqueue(De)}function qs(De){o.unqueue(De)}function Jo(De){o.reorderQueue(De.from,De.to)}async function es(De){const ge=o.activeWorkspaceId.value;if(!o.activeSessionId.value&&ge){await o.startSessionAndSendPrompt(ge,De.text,De.attachments);return}if(!o.activeSessionId.value&&!ge){Ho.value=De,nn.value=!0;return}o.sendPrompt(De.text,De.attachments)}async function zt(De){if(dt.value=null,!await o.addWorkspaceByPath(De)){dt.value=i("workspace.addFailed");return}nn.value=!1;const K=Ho.value;Ho.value=null;const xe=o.activeWorkspaceId.value;K&&xe&&await o.startSessionAndSendPrompt(xe,K.text,K.attachments)}function js(){Ho.value=null,dt.value=null,nn.value=!1}function Lo(){kt(()=>{Gt.value?.focusComposer()})}function fi(){const De=o.activeWorkspaceId.value;De?o.openWorkspaceDraft(De):o.clearActiveSession(),Lo()}function je(De){o.openWorkspaceDraft(De),Lo()}function it(De){De&&window.open(De,"_blank","noopener")}return(De,ge)=>(x(),E("div",wCe,[s.value?(x(),Ae(yCe,{key:0})):ue("",!0),C(m)?(x(),E("section",_Ce,[_("div",SCe,[(x(),E("svg",{ref_key:"authLogoRef",ref:p,class:"auth-page-logo ch-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Dimi",onMousedown:ge[0]||(ge[0]=Ct(()=>{},["prevent"])),onClick:ge[1]||(ge[1]=(...K)=>C(y)&&C(y)(...K))},[...ge[98]||(ge[98]=[Bk('<defs data-v-bcb3f8d4><mask id="authDimiEyes" maskUnits="userSpaceOnUse" data-v-bcb3f8d4><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-bcb3f8d4></rect><g class="ch-eyes" fill="#000" data-v-bcb3f8d4><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-bcb3f8d4></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-bcb3f8d4></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#authDimiEyes)" data-v-bcb3f8d4></rect>',2)])],544)),_("div",CCe,[_("h1",null,R(C(i)("app.authPageTitle")),1),_("p",null,R(C(i)("app.authPageMessage")),1)]),fe(jt,{class:"auth-page-btn",variant:"primary",onClick:Wo},{default:Le(()=>[fe(Ye,{name:"log-in",size:"md"}),_("span",null,R(C(i)("app.authPageLogin")),1)]),_:1})])])):(x(),E("div",{key:2,class:We(["app",{mobile:C(a),"sidebar-collapsed":C(Ee)&&!C(a),"macos-desktop":C(su)}]),style:tn({"--preview-w":C(se)+"px"})},[C(a)?(x(),Ae(Cwe,{key:1,workspace:C(o).visibleWorkspace.value,"session-title":d.value,running:h.value,branch:C(o).status.value.branch,"session-count":f.value,onOpenSwitcher:ge[19]||(ge[19]=K=>c.value=!0),onOpenSettings:ge[20]||(ge[20]=K=>u.value=!0)},null,8,["workspace","session-title","running","branch","session-count"])):(x(),E(Pe,{key:0},[fe(vH,{collapsed:C(Ee),dragging:C(ae),"col-width":C(Y),"active-workspace":C(o).visibleWorkspace.value,"active-workspace-id":C(o).activeWorkspaceId.value,sessions:C(o).sessionsForView.value,groups:C(o).workspaceGroups.value,"active-id":C(o).activeSessionId.value,"attention-by-session":C(o).attentionBySession.value,"pending-by-session":C(o).pendingBySession.value,"unread-by-session":C(o).unreadBySession.value,"workspace-sort-mode":C(o).workspaceSortMode.value,onSelect:ge[2]||(ge[2]=K=>C(o).selectSession(K)),onCreate:fi,onCreateInWorkspace:ge[3]||(ge[3]=K=>je(K)),onSelectWorkspace:ge[4]||(ge[4]=K=>C(o).openWorkspace(K)),onAddWorkspace:ge[5]||(ge[5]=K=>nn.value=!0),onRename:ge[6]||(ge[6]=(K,xe)=>C(o).renameSession(K,xe)),onArchive:ge[7]||(ge[7]=K=>Qo(K)),onFork:ge[8]||(ge[8]=K=>C(o).forkSession(K)),onExport:ge[9]||(ge[9]=K=>C(o).exportSession(K)),onRenameWorkspace:ge[10]||(ge[10]=(K,xe)=>C(o).renameWorkspace(K,xe)),onDeleteWorkspace:ge[11]||(ge[11]=K=>No(K)),onReorderWorkspaces:ge[12]||(ge[12]=K=>C(o).reorderWorkspaces(K)),onSetWorkspaceSortMode:ge[13]||(ge[13]=K=>C(o).setWorkspaceSortMode(K)),onLoadMoreSessions:ge[14]||(ge[14]=K=>void C(o).loadMoreSessions(K)),onLoadAllSessions:ge[15]||(ge[15]=K=>void C(o).loadAllSessions()),onOpenSettings:ge[16]||(ge[16]=K=>Po.value=!0),onCollapse:C(P)},null,8,["collapsed","dragging","col-width","active-workspace","active-workspace-id","sessions","groups","active-id","attention-by-session","pending-by-session","unread-by-session","workspace-sort-mode","onCollapse"]),Wn(fe(I_,{class:"side-handle","storage-key":C(le),"default-width":C(oe),min:C(re),max:C(we),"onUpdate:width":ge[17]||(ge[17]=K=>me.value=K),"onUpdate:dragging":ge[18]||(ge[18]=K=>ae.value=K)},null,8,["storage-key","default-width","min","max"]),[[wi,!C(Ee)]])],64)),fe(ipe,{ref_key:"conversationPaneRef",ref:Gt,mobile:C(a),turns:C(o).turns.value,"session-id":C(o).activeSessionId.value,approvals:C(o).pendingApprovals.value,changes:C(o).changes.value,"git-info":C(o).gitInfo.value,tasks:C(o).tasks.value,todos:C(o).todos.value,goal:C(o).goal.value,"activation-badges":C(o).activationBadges.value,status:C(o).status.value,thinking:C(o).thinking.value,"plan-mode":C(o).planMode.value,"swarm-mode":C(o).swarmMode.value,"goal-mode":C(o).goalMode.value,models:C(o).models.value,"starred-ids":C(o).starredModelIds.value,skills:C(o).skills.value,questions:C(o).questions.value,"pending-question-actions":C(o).pendingQuestionActions,"pending-approval-actions":C(o).pendingApprovalActions,running:h.value,"turn-active":C(o).turnActive.value,queued:C(o).queued.value,"search-files":C(o).searchFiles,"upload-image":C(o).uploadImage,working:C(o).working.value,starting:C(o).isStartingFirstPrompt.value,"fast-moon":C(o).fastMoon.value,"file-reload-key":C(o).activeSessionId.value,"session-loading":C(o).sessionLoading.value,compaction:C(o).compaction.value,"has-more-messages":C(o).hasMoreMessages.value,"loading-more":C(o).loadingMoreMessages.value,"loading-more-error":C(o).loadMoreMessagesError.value,"load-older-messages":C(o).loadOlderMessages,"workspace-name":C(o).visibleWorkspace.value?.name,"workspace-root":C(o).visibleWorkspace.value?.root??C(o).status.value.cwd,"git-diff-stats":C(o).gitDiffStats.value,workspaces:C(o).workspacesView.value,"active-workspace-id":C(o).activeWorkspaceId.value,"session-title":d.value,pr:C(o).activePullRequest.value,"conversation-toc":C(o).conversationToc.value,onOpenChanges:ge[21]||(ge[21]=K=>C(Wt)()),onSelectWorkspace:ge[22]||(ge[22]=K=>je(K)),onAddWorkspace:ge[23]||(ge[23]=K=>nn.value=!0),onOpenPr:it,onSubmit:ge[24]||(ge[24]=K=>es(K)),onSteer:ge[25]||(ge[25]=K=>C(o).steerPrompt(K.text,K.attachments)),onApproval:ge[26]||(ge[26]=(K,xe)=>C(o).respondApproval(K,xe)),onCancelTask:ge[27]||(ge[27]=K=>C(o).cancelTask(K)),onAnswer:ge[28]||(ge[28]=(K,xe)=>C(o).respondQuestion(K,xe)),onDismiss:ge[29]||(ge[29]=K=>C(o).dismissQuestion(K)),onCommand:Ni,onInterrupt:ge[30]||(ge[30]=K=>C(o).abortCurrentPrompt()),onUnqueue:di,onEditQueued:qs,onReorderQueue:Jo,onSetPermission:ge[31]||(ge[31]=K=>C(o).setPermission(K)),onSetThinking:ge[32]||(ge[32]=K=>C(o).setThinking(K)),onTogglePlan:ge[33]||(ge[33]=K=>C(o).togglePlanMode()),onToggleSwarm:ge[34]||(ge[34]=K=>C(o).toggleSwarmMode()),onToggleGoal:ge[35]||(ge[35]=K=>C(o).toggleGoalMode()),onCreateGoal:ge[36]||(ge[36]=K=>C(o).createGoal(K)),onControlGoal:ge[37]||(ge[37]=K=>C(o).controlGoal(K)),onRefreshGitStatus:ge[38]||(ge[38]=K=>C(o).activeSessionId.value&&C(o).loadGitStatus(C(o).activeSessionId.value)),onRenameSession:ge[39]||(ge[39]=(K,xe)=>C(o).renameSession(K,xe)),onForkSession:ge[40]||(ge[40]=K=>C(o).forkSession(K)),onArchiveSession:ge[41]||(ge[41]=K=>Qo(K)),onExportSession:ge[42]||(ge[42]=K=>C(o).exportSession(K)),onCompact:ge[43]||(ge[43]=K=>C(o).compact()),onPickModel:ge[44]||(ge[44]=K=>lo()),onSelectModel:ge[45]||(ge[45]=K=>Ws(K)),onOpenFile:ge[46]||(ge[46]=K=>C(j)(K)),onOpenMedia:ge[47]||(ge[47]=K=>C(Z)(K)),onOpenThinking:ge[48]||(ge[48]=K=>C(Te)(K)),onOpenCompaction:ge[49]||(ge[49]=K=>C(Ge)(K)),onOpenAgent:ge[50]||(ge[50]=K=>C(ut)(K)),onOpenToolDiff:ge[51]||(ge[51]=K=>C(_t)(K)),onEditMessage:ui},null,8,["mobile","turns","session-id","approvals","changes","git-info","tasks","todos","goal","activation-badges","status","thinking","plan-mode","swarm-mode","goal-mode","models","starred-ids","skills","questions","pending-question-actions","pending-approval-actions","running","turn-active","queued","search-files","upload-image","working","starting","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","conversation-toc"]),!C(a)&&(C(su)||C(Ee))?(x(),Ae(Kn,{key:2,class:"sidebar-toggle-btn",size:"sm",label:C(Ee)?C(i)("sidebar.expandSidebar"):C(i)("sidebar.collapseSidebar"),onClick:C(P)},{default:Le(()=>[fe(Ye,{name:C(Ee)?"panel-expand":"panel-collapse"},null,8,["name"])]),_:1},8,["label","onClick"])):ue("",!0),C(Ve)&&!C(a)?(x(),Ae(I_,{key:3,class:"preview-handle","storage-key":C(G),"default-width":C(ve),min:C(pe),max:C(de),reverse:"","aria-label":C(i)("layout.resizePreviewAria"),"onUpdate:width":ge[52]||(ge[52]=K=>V.value=K),"onUpdate:dragging":ge[53]||(ge[53]=K=>It.value=K)},null,8,["storage-key","default-width","min","max","aria-label"])):ue("",!0),!C(a)||C(Ve)?(x(),E("aside",{key:4,class:We(["global-preview",{open:C(Ve),mobile:C(a),"no-anim":C(It)||F.value}]),role:"complementary","aria-label":C(i)("layout.detailPanelAria"),"aria-hidden":!C(Ve)},[N.value==="thinking"&&C(ke)?(x(),Ae(I3,{key:0,text:C(he)??"",onClose:C(ze)},null,8,["text","onClose"])):N.value==="compaction"&&C(be)?(x(),Ae(I3,{key:1,text:C(ye)??"",subtitle:C(i)("conversation.summaryTitle"),onClose:C(tt)},null,8,["text","subtitle","onClose"])):N.value==="agent"&&C(rt)?(x(),Ae(Ime,{key:2,member:C(rt),onClose:C(vt)},null,8,["member","onClose"])):N.value==="btw"&&C(Xt)?(x(),Ae(Qme,{key:3,turns:C(o).sideChatTurns.value,running:C(o).sideChatRunning.value,sending:C(o).sideChatSending.value,onSend:ge[54]||(ge[54]=K=>C(o).sendSideChatPrompt(K)),onClose:C(Je)},null,8,["turns","running","sending","onClose"])):N.value==="diff"?(x(),Ae(A1e,{key:4,mode:C(ln),changes:C(o).changes.value,"git-info":C(o).gitInfo.value,"file-diff":C(o).fileDiff.value,"selected-diff-path":C(o).selectedDiffPath.value,"file-diff-loading":C(o).fileDiffLoading.value,closable:"",onOpen:C(vn),onBack:ge[55]||(ge[55]=K=>{ln.value="list",Ln.value=null,C(o).clearFileDiff()}),onClose:C(un)},null,8,["mode","changes","git-info","file-diff","selected-diff-path","file-diff-loading","onOpen","onClose"])):N.value==="toolDiff"&&C(Nt)?(x(),Ae(qme,{key:5,target:C(Nt),onClose:C(Rt)},null,8,["target","onClose"])):N.value==="file"?(x(),Ae(fme,{key:6,file:C(B),loading:C(W),error:C(z),line:C(S)?.line,"download-url":C(L),closable:"","external-actions":C(O),"open-file":C(j),onClose:C(ie),onOpenExternal:C(U),onReveal:C(q)},null,8,["file","loading","error","line","download-url","external-actions","open-file","onClose","onOpenExternal","onReveal"])):ue("",!0)],10,ACe)):ue("",!0),fe(xCe,{class:"internal-build-fab"}),Sn.value?(x(),Ae(j1e,{key:5,models:C(o).models.value,current:C(o).status.value.modelId,"starred-ids":C(o).starredModelIds.value,loading:_s.value,unavailable:Eo.value,onSelect:ge[56]||(ge[56]=K=>So(K)),onToggleStar:ge[57]||(ge[57]=K=>C(o).toggleStarModel(K)),onClose:ge[58]||(ge[58]=K=>Sn.value=!1)},null,8,["models","current","starred-ids","loading","unavailable"])):ue("",!0),Po.value?(x(),Ae(ixe,{key:6,"color-scheme":C(o).colorScheme.value,accent:C(o).accent.value,"ui-font-size":C(o).uiFontSize.value,"auth-ready":C(o).authReady.value,"account-model":C(o).defaultModel.value,notify:C(o).notifyOnComplete.value,"notify-question":C(o).notifyOnQuestion.value,"notify-approval":C(o).notifyOnApproval.value,"notify-permission":C(o).notifyPermission.value,sound:C(o).soundOnComplete.value,"conversation-toc":C(o).conversationToc.value,config:C(o).config.value,models:C(o).models.value,"config-saving":To.value,"server-version":C(o).serverVersion.value,onSetColorScheme:ge[59]||(ge[59]=K=>C(o).setColorScheme(K)),onSetAccent:ge[60]||(ge[60]=K=>C(o).setAccent(K)),onSetUiFontSize:ge[61]||(ge[61]=K=>C(o).setUiFontSize(K)),onSetNotify:ge[62]||(ge[62]=K=>C(o).setNotifyOnComplete(K)),onSetNotifyQuestion:ge[63]||(ge[63]=K=>C(o).setNotifyOnQuestion(K)),onSetNotifyApproval:ge[64]||(ge[64]=K=>C(o).setNotifyOnApproval(K)),onSetSound:ge[65]||(ge[65]=K=>C(o).setSoundOnComplete(K)),onSetConversationToc:ge[66]||(ge[66]=K=>C(o).setConversationToc(K)),onUpdateConfig:ge[67]||(ge[67]=K=>ci(K)),onLogin:ge[68]||(ge[68]=()=>{Po.value=!1,Wo()}),onLogout:C(o).logout,onOpenOnboarding:ge[69]||(ge[69]=()=>{Po.value=!1,A()}),onOpenProviders:ge[70]||(ge[70]=()=>{Po.value=!1,Wo()}),onClose:ge[71]||(ge[71]=K=>Po.value=!1)},null,8,["color-scheme","accent","ui-font-size","auth-ready","account-model","notify","notify-question","notify-approval","notify-permission","sound","conversation-toc","config","models","config-saving","server-version","onLogout"])):ue("",!0),fn.value?(x(),Ae(swe,{key:7,status:C(o).status.value,thinking:g.value,"plan-mode":C(o).planMode.value,"swarm-mode":C(o).swarmMode.value,"cost-usd":C(o).sessionCost.value,onClose:ge[72]||(ge[72]=K=>fn.value=!1)},null,8,["status","thinking","plan-mode","swarm-mode","cost-usd"])):ue("",!0),nn.value?(x(),Ae(zxe,{key:8,"browse-fs":C(o).browseFs,"get-fs-home":C(o).getFsHome,"default-path":C(o).visibleWorkspace.value?.root??C(o).status.value.cwd,error:dt.value,onAdd:ge[73]||(ge[73]=K=>zt(K)),onClose:js},null,8,["browse-fs","get-fs-home","default-path","error"])):ue("",!0),fe(Ua,{name:"gload-fade"},{default:Le(()=>[C(o).initialized.value?ue("",!0):(x(),Ae(xSe,{key:0,issue:C(o).connectIssue.value},null,8,["issue"]))]),_:1}),C(o).initialized.value&&v.value&&!C(m)?(x(),Ae(pSe,{key:9,onComplete:b,onSkip:b})):ue("",!0),fe(gwe,{warnings:C(o).warnings.value,onDismiss:C(o).dismissWarning},null,8,["warnings","onDismiss"]),C(l)?(x(),Ae(XSe,{key:10})):ue("",!0),fe(Vxe),C(a)?(x(),Ae(Gwe,{key:11,modelValue:c.value,"onUpdate:modelValue":ge[74]||(ge[74]=K=>c.value=K),groups:C(o).workspaceGroups.value,"active-workspace-id":C(o).activeWorkspaceId.value,"active-id":C(o).activeSessionId.value,"attention-by-session":C(o).attentionBySession.value,"attention-by-workspace":C(o).attentionByWorkspace.value,onSelect:ge[75]||(ge[75]=K=>C(o).selectSession(K)),onCreate:fi,onCreateInWorkspace:ge[76]||(ge[76]=K=>je(K)),onAddWorkspace:ge[77]||(ge[77]=K=>nn.value=!0),onRename:ge[78]||(ge[78]=(K,xe)=>C(o).renameSession(K,xe)),onArchive:ge[79]||(ge[79]=K=>Qo(K)),onDeleteWorkspace:ge[80]||(ge[80]=K=>No(K)),onLoadMore:ge[81]||(ge[81]=K=>void C(o).loadMoreSessions(K))},null,8,["modelValue","groups","active-workspace-id","active-id","attention-by-session","attention-by-workspace"])):ue("",!0),C(a)?(x(),Ae(nSe,{key:12,modelValue:u.value,"onUpdate:modelValue":ge[82]||(ge[82]=K=>u.value=K),status:C(o).status.value,thinking:C(o).thinking.value,models:C(o).models.value,"plan-mode":C(o).planMode.value,"swarm-mode":C(o).swarmMode.value,"color-scheme":C(o).colorScheme.value,"ui-font-size":C(o).uiFontSize.value,"auth-ready":C(o).authReady.value,"conversation-toc":C(o).conversationToc.value,"server-version":C(o).serverVersion.value,onPickModel:ge[83]||(ge[83]=K=>lo()),onSetThinking:ge[84]||(ge[84]=K=>C(o).setThinking(K)),onTogglePlan:ge[85]||(ge[85]=K=>C(o).togglePlanMode()),onToggleSwarm:ge[86]||(ge[86]=K=>C(o).toggleSwarmMode()),onSetPermission:ge[87]||(ge[87]=K=>C(o).setPermission(K)),onSetColorScheme:ge[88]||(ge[88]=K=>C(o).setColorScheme(K)),onSetUiFontSize:ge[89]||(ge[89]=K=>C(o).setUiFontSize(K)),onSetConversationToc:ge[90]||(ge[90]=K=>C(o).setConversationToc(K)),onLogin:ge[91]||(ge[91]=()=>{u.value=!1,Wo()}),onLogout:C(o).logout},null,8,["modelValue","status","thinking","models","plan-mode","swarm-mode","color-scheme","ui-font-size","auth-ready","conversation-toc","server-version","onLogout"])):ue("",!0)],6)),mt.value?(x(),Ae(h0e,{key:3,providers:C(o).providers.value,loading:_o.value,unavailable:Un.value,onLoginApiKey:ge[92]||(ge[92]=K=>zo(K)),onRefresh:ge[93]||(ge[93]=K=>ai(K)),onLogout:ge[94]||(ge[94]=K=>Io(K)),onOpenLogin:ge[95]||(ge[95]=K=>{mt.value=!1,Ss(K)}),onClose:ge[96]||(ge[96]=K=>mt.value=!1)},null,8,["providers","loading","unavailable"])):ue("",!0),Rn.value&&dn.value?(x(),Ae(q0e,{key:4,"provider-name":C(o).providers.value.find(K=>K.id===dn.value)?.name??dn.value,"on-start-o-auth-login":en,"on-poll-o-auth-login":zs,"on-cancel-o-auth-login":Xn,onSuccess:Us,onClose:ge[97]||(ge[97]=()=>{Rn.value=!1,dn.value=null})},null,8,["provider-name"])):ue("",!0)]))}}),ECe=ft(MCe,[["__scopeId","data-v-bcb3f8d4"]]);Eie();sm(ECe).use($n).mount("#app");export{d9 as $,WA as A,tI as B,go as C,C4e as D,sA as E,Pe as F,Bk as G,nt as H,fe as I,O9 as J,ZCe as K,Hi as L,Qe as M,A7 as N,e4e as O,t4e as P,s4e as Q,Wp as R,nu as S,v1 as T,n4e as U,Pk as V,JCe as W,M4e as X,o4e as Y,b4e as Z,TCe as _,FA as a,Ro as a$,bo as a0,wk as a1,RCe as a2,Mk as a3,dM as a4,Ft as a5,_u as a6,zCe as a7,N4e as a8,VCe as a9,PA as aA,fI as aB,yI as aC,wn as aD,vI as aE,gI as aF,Mf as aG,mI as aH,In as aI,Tk as aJ,H9 as aK,x as aL,_7 as aM,HCe as aN,En as aO,wA as aP,PCe as aQ,jp as aR,Do as aS,qv as aT,ne as aU,p4e as aV,z7 as aW,lt as aX,zn as aY,bI as aZ,XCe as a_,YCe as aa,GCe as ab,KCe as ac,g4e as ad,I4e as ae,Jt as af,n7 as ag,m1 as ah,Nl as ai,Gr as aj,co as ak,m4e as al,ei as am,Bl as an,yt as ao,l4e as ap,a4e as aq,bn as ar,kt as as,l7 as at,We as au,r9 as av,tn as aw,dI as ax,pI as ay,so as az,DCe as b,Cte as b$,_4e as b0,tf as b1,Xp as b2,x4e as b3,Rl as b4,N9 as b5,ICe as b6,gr as b7,K9 as b8,w4e as b9,ws as bA,wi as bB,o7 as bC,y4e as bD,et as bE,TA as bF,UCe as bG,Y9 as bH,u4e as bI,Le as bJ,i4e as bK,Wn as bL,ur as bM,v4e as bN,Ct as bO,WCe as bP,_n as bQ,ps as bR,B4e as bS,D4e as bT,U8 as bU,P4e as bV,qee as bW,z8 as bX,Fy as bY,U4e as bZ,Ete as b_,NCe as ba,R as bb,mp as bc,QCe as bd,hn as be,$Ce as bf,LCe as bg,xA as bh,h4e as bi,L9 as bj,C as bk,If as bl,T4e as bm,A4e as bn,E7 as bo,qCe as bp,d4e as bq,G9 as br,E4e as bs,r4e as bt,jCe as bu,$A as bv,om as bw,B7 as bx,MM as by,iy as bz,k4e as c,O2 as c0,$2 as c1,F2 as c2,j4e as c3,Im as c4,Vc as c5,Tm as c6,xte as c7,wte as c8,V4e as c9,q4e as ca,F4e as cb,K4e as cc,U1 as cd,Is as ce,Dte as cf,Bte as cg,Bee as ch,R4e as ci,$ee as cj,Fee as ck,O4e as cl,R2 as cm,Pte as cn,d4 as co,jC as cp,Vee as cq,Nm as cr,Em as cs,H4e as ct,z4e as cu,$4e as cv,W4e as cw,Ye as cx,L4e as cy,ft as cz,f4e as d,Il as e,FCe as f,Ua as g,I7 as h,OCe as i,BCe as j,Ei as k,Ef as l,Mo as m,l1 as n,Yr as o,S4e as p,D as q,sm as r,Ae as s,ue as t,E as u,_ as v,zI as w,c4e as x,WI as y,U7 as z};
|